emu48-mirror/Macro/Mac2txt.txt
Gwenhael Le Moine e1230f4415
2005-06-14: Updated to version 1.37
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2024-03-19 23:33:35 +01:00

121 lines
3.5 KiB
Text

Mac2Txt - Keyboard Macro to Text File Converter
11/09/04 (c) by Christoph Gießelink, c dot giesselink at gmx dot de
***********
* Mac2Txt *
***********
Mac2Txt is an emulator keyboard macro file converter for converting macro into
text files and vice versa. This allow to edit the keyboard macro files with a
simple text editor.
1) Commands
The text file knows three commands:
P <out> <in>
R <out> <in>
T <delay>
1.1) <P>ress key
P <out> <in>
means pressing a key, where <out> is the out and <in> is the in code of the key.
Please look into the latest KML description available at
http://privat.swol.de/ChristophGiesselink/ for the calculator dependent keyboard
Out/In codes.
1.2) <R>elease key
R <out> <in>
means releasing a key, where <out> is the out and <in> is the in code of the
key.
1.3) <T>ime for delay
T <delay>
means waiting <delay> milliseconds. You have delay times between every key state
changing especially when you have recorded them on an emulator. When the time
information is missing behind a <P>ress or <R>elease command, the emulator is
using the default time of the keyboard macro settings in macro replay mode. So
it's a good idea to use "T 0" if you want to have no delay. In the other case,
if you don't want to switch between 'Real' and 'Manual' Replay speed and want to
have always 'Manual' speed it's a good idea to remove all time information in
the text file. The "T" command is alway ignored on 'Manual' Replay speed.
Example
T 821
P 0 32767
T 70
R 0 32767
for waiting 821 ms, pressing the <ON> key, waiting for 70 ms and finally
releasing the <ON> key again.
2) Keyboard macro file format (MAC)
All numbers are coded in the little endian format (LSB first).
2.1) Header
Every keyboard macro file begins with the string "Emu-KeyMacro".
2.2) Extended Header
The string header is followed by a reserved 4 byte length information number for
the extended header length and the extended header data. At this time the
extended header length information must be zero followed by no data.
2.3) Data
Each data field is coded in a 32 bit number.
2.3.1) Time data
Bit 31 = 1
Bit 30 - 0 = time information in ms (2^31 ms ~ 25 days)
2.3.2) Key data
Bit 31 = 0
Bit 30 - 24 = 0000000 = Release key
Bit 30 - 24 = 0000001 = Press key
Bit 23 - 16 = byte with the <out> code
Bit 15 - 0 = word with the <in> code
All other not listed bit combinations of Bit 30 - 24 are forbidden and reserved
for further use.
3) Program description
You have a source and destination edit field for holding the source and
destination file names. So the <Browse> button for the source edit field is
calling a "Open" file dialog, where the <Browse> button for the destination edit
field is calling a "Save As" file dialog.
The button <Src -> Dest> now converts the file in "source" to the opposite
format and save the result in "destination". For converting back to the original
format you can use the button <Dest -> Src>. This method is very flexible for
any conversation, for your own convenience you should only remember that there's
an "Open" file dialog behind Source-Browse button and a "Save As" file dialog
behind Destination-Browse button.
Be careful, both convert buttons work without request and will overwrite the
destination immediately!
***************
* LEGAL STUFF *
***************
Mac2Txt - Keyboard Macro to Text File Converter
Copyright (c) 2004 Christoph Gießelink
This program is freeware. Use it at your own risk.