Professional Documents
Culture Documents
Emuxy and KML 2.0: Index
Emuxy and KML 2.0: Index
0
Introduction
This document explains in detail the KML 2.0 scripting files. KML, Key oard Mapping Language, started of as a script that Emu!" used to map #ey oard uttons $ith uttons of the emulator, no$ it has ecome much more. KML 2.0, also used y Emu%0, Emu2", Emu&2 and Emu!2, no$ ma#es it possi le to change many ad'anced options of the $ay the emulator loo#s.
Index
(asics *lo al (ac#ground L,-igit /nnunciator (utton 0ut1n ,odes 2cancode ,onclusion )age % )age 2 )age + )age . )age " )age %0 )age %% )age %& )age 2% )age 22
Basics
/ KML script file is a text file that the emulators use to set its screen layout and #ey oard layout. / custom itmap file can e created to e the 3faceplate4 of the calculator. KML defines the si5e and position of the screen, uttons, annunciators, and the Emu!" $indo$. The 364 character can e used to add remar#s to a line. The follo$ing sections descri e each main loc# of the KML script.
Global
The glo al section of the KML file tells the itmap, title of the KML, and the ,alculator hard$are and the model. The follo$ing is the syntax.
Global
End
Title STRING Author STRING Hardware STRING Model STRING Class INTEGER Rom STRING Patch STRING Bitmap STRING Print STRING ebu! INTEGER
Title is the title of the KML file that the emulator $ill use. This is not the filename. Example7
Title "#ohn$s G%&
8ard$are is the emulated calculator hard$are. This definition is optional on Emu!". The parameter is necessary to separate the KML scripts from each emulator. 9alid entries are Emu%07
Hardware "Bert&
Emu2"7 Emu&27
Emu!27 Emu!"7
Model is the model of your emulated calculator inside the hard$are family. The model entries differ from hard$are to hard$are. This setting groups KML files of the same hard$are and :0M together. ;hen s$itching et$een KML scripts, it is the first character of the parameter that is chec#ed against the type of the current document <$hich $as set y the Model command in the KML file $ith $hich the document $as created=. 9alid entries are7 Emu%07 3E4 > 8)%0( 3?4 > 8)202 3M4 > 8)2%2 Emu2"7 3)4 > 8)2", Emu&27 3M4 > 8)%!( 3@4 > 8)&2211 Emu!27 3T4 > 8)%A( 3B4 > 8)%A(11 3Y4 > 8)%C(11 3M4 > 8)2A2 304 > 8)2"2 3-4 > 8)!22 Emu!"7 3.4 > 8)&"* <.!K( :/M= 3/4 > 8)&"* 3E4 > 8)&C* or 8)!0* 3*4 > 8)!"*, 8)!"*D or 8)!"*X 324 > 8)!"2 or 8)!"2X 3X4 > 8)!C* Example7
Model "G&
,lass is used for different calculators ase on the same :0M for further distinction. ?or other models than listed elo$ this argument can e omitted. 9alid entries are7 Emu!27 3&24 > 8)!22 $ith &2K( :/M Emu!"7 3&C4 > 8)&C* 3!04 > 8)!0* Example7
Class +,
)atch is the name of a :0M patch file. /ny file $ith correct syntax can e used as a patch file. Multiple )atch lines can e used, and all files $ill e loaded in the order in $hich they are declared. 1mportant7 They MB2T appear after the :om command. Example7
Patch "BEEP.E1T&
)rint $ill display a string $hen the KML file is loaded. You can ha'e as many of these as necessary. They are more effecti'e if you put them efore the other settings. Example7
Print "M2 homepa!e is at http344www.!ul5tel.com46pattersc4emu/04&
-e ug sets the emulator to return an information message ox telling the scancode num er of the #ey oard #ey pressed $hen the scancode num er isnEt defined. 9alid entries are 0 or %. 0ne is on and Fero is off. Example7
ebu! 7
Background
This section sets $here the ac#ground itmap $ill e placed and the si5e of the emulator $indo$.
Bac*!round 8!a INTEGER Topbar INTEGER -55set INTEGER INTEGER Si9e INTEGER INTEGER End
0ffset is ho$ far the top left corner of the itmap $ill e offset in the $indo$. Most of the time you should set this to 0 0. The first integer is the amount of pixels to the right and the second is that amount of pixels do$n. Example7
-55set : :
2i5e sets the si5e of the emulator $indo$ in pixels. The first integer is the $idth and the second is the height. This is the $idth of the $indo$, not the itmap. 1t is usually smaller that the itmap si5e. Example7
Si9e +:; /0<
9ga is a special command only for the )oc#et ), 'ersions of Emu&2, Emu!2 and Emu!" to ena leGdisa le the use of 9*/ screen resolution on a 9*/ capa le )oc#et ),. 9alid entries are 0 or %. 0ne is the 9*/ mode $ith .!0x!"0 pixel and Fero is the H9*/ mode $ith &20x2!0 pixel. Example7
8!a 7
Top ar is a special command only for the )oc#et ), 'ersions of Emu&2, Emu!2 and Emu!" to ena leGdisa le the top ar of the screen. 9alid entries are 0 or %. 0ne is ena led and Fero is disa led. Example7
Topbar :
LCD
This section set the si5e, position and contrast setting of the L,- screen.
(cd
End
=oom INTEGER 8ertical INTEGER -55set INTEGER INTEGER Color INTEGER INTEGER INTEGER INTEGER
Foom is the si5e of the pixels in the L,- screen. This command is only 'alid for Emu2", Emu!2 and Emu!" and $ill e ignored on Emu%0 and Emu&2. 9alid entries are %, 2, & or !. Foom factor t$o is usually used y the dot matrix L,- types emulated y Emu2", Emu!2 and Emu!". Example7
=oom ;
0ffset sets the position of the L,- screen. The first integer is the amount of pixels right and the second is the amount of pixels do$n. Example7
-55set ;: ;:
,olor sets the color of the L,- display for different contrast settings. The first 1nteger is the contrast setting for each possi le 'alue. The num er of settings depend on the hard$are type. Emu%07 0IA > 0 is lightest, A is dar#est Emu&27 0I%+ > foreground colors <)ixel on=, 0 is lightest, %+ is dar#est %.I&% > ac#ground colors <)ixel off=, %. corresponds to 0, %A to %, J unused num er at ac#ground colors > transparent Emu2", Emu!2, Emu!"7 0I&% > foreground colors <)ixel on=, 0 is lightest, %+ is dar#est &2I.& > ac#ground colors <)ixel off=, &2 corresponds to 0, && to %, J unused num er at ac#ground colors > use color defined y setting 0 You should include one line for e'ery foreground color setting. (ut the calculator :om ounds the contrast setting $ith the #ey oard to useful 'alues. The 8)!"2G2X :om use 'alues et$een & and %C, the 8)!"*G*X :om use 'alues et$een C and 2!. :emem er this $hen you $rite the color ta le please. The other three integers are the :*( num ers <:ed, *reen, (lue=. The :*( num ers range from 0 to 2++. The ac#ground color num er for the corresponding foreground color is al$ays calculated y adding the first ac#ground num er setting to the color 'alue. 1f the ac#ground color for the contrast setting isnKt defined, color 0 is used y the emulators Emu2", Emu!2 and Emu!" and transparent mode y Emu&2. Example7
9ertical is a special command only for the )oc#et ), 'ersions of Emu!2 and Emu!" to rotate the display y C0L cloc# or anticloc#$ise to allo$ s#ins in landscape mode. 9alid entries are 0 for portrait, % for anticloc#$ise and 2 for cloc#$ise rotated landscape mode. The default setting is portrait mode. Example7
8ertical 7
Digit
This section is only 'alid for Emu%0 and Emu&2 and descri es the <alphaI= numeric part of the L,- screen.Emu%0 and Emu&2 use different methods for creating a numeric 'alue.
i!it
End
-55set INTEGER INTEGER Si9e INTEGER INTEGER istance INTEGER Bitmap STRING
Emu%07 The lo$Iend )ioneer series use a classic A segment L,-. ;ith the first nine annunciators <segments MaE to MgE, MdpE and McmE= one digit is descri ed. The commands 0ffset and 2i5e are unused. -istance is the distance in pixel et$een the eginnings of each digit, so only one description for a digit is necessary. Example7
istance 70 ? distance between di!its
(itmap is an optional command for including an external annunciator itmap instead of using the annunciators in the ac#ground itmap. Example7
Bitmap "m2lcd.bmp&
Emu&27 The mid range )ioneer series use a +xA pixel dot matrix for each digit. 2i5e is the si5e of one pixel in the L,- screen. ;idth 8eight. Example7
Si9e + / ? si9e o5 (C pi%el
0ffset is the position of the first digit inside the display area. Example7
-55set 7A 7+ ? position o5 7st di!it
-istance set the distance in pixel et$een the eginnings of each digit. Example7
istance ;7 ? distance between di!its
(itmap is an optional command for including an external annunciator itmap instead of using the annunciators in the ac#ground itmap. Example7
Bitmap "m2lcd.bmp&
Annunciator
/nnunciators are the 2& <Emu%0=, .0 <Emu&2=, six <Emu!"= and se'en <Emu2", Emu!2= status icons on the screen. You must specify one of these loc#s for each annunciator.
Annunciator INTEGER Si9e INTEGER INTEGER -55set INTEGER INTEGER own INTEGER INTEGER End
/nnunciator tells $hich annunciator you are setting. 9alid entries are emulator depending and can 'ary from % through ., A, 2& or .0. The annunciator sym ol itself depends on the specific L,- of the calculator. :efer to existing KML scripts for getting the sym ol of each annunciator. Example7
Annunciator 7
0ffset is the position that the annunciator $ill e displayed. This is the lan# part. Example7
-55set @7 /
-o$n is the position of the annunciator in the itmap $hen it is on. There are some restrictions on the different emulators. 0n Emu%0 and Emu&2 the annunciators must e dra$n in lac# on a $hite ac#ground. 0n Emu2" and Emu!2 the pixel at the -o$n position must contain the ac#ground color, this is necessary for mas#ing operation. Emu!" donEt mas# the ac#ground color, here the annunciator must ha'e the ac#ground color of the target area. Example7
own 7@ /0<
Button
(utton sets the position of the utton and $hat the utton does.
Button INTEGER T2pe INTEGER Si9e INTEGER INTEGER -55set INTEGER INTEGER own INTEGER INTEGER -utIn INTEGER INTEGER 8irtual NoHold -nBp CCommandsD End -n own CCommandsD End End
(utton tells the num er of the utton you are creating. This can e any num er. Most of the time this is set to a num er that represents the ro$ and column of the utton. /ny num er can e used, ut only 2+. uttons can e declared. 1f more uttons are declared, only the first 2+. $ill e used, and the others $ill e ignored. Example7
Button 77
Type tells ho$ the utton $ill eha'e $hen it is pressed. 9alid entries are 0, %, 2, &, !, or +. Type 0 sets it to recogni5e the Bp and -o$n option. Type % sets it to only recogni5e the Bp setting and use a default utton effect. Type 2 ma#es the utton loo# the same $hen pressed. Type & is used for the L,- screen and $ill in'ert that area. Type ! is also used for the L,- screen and it $ill sho$ the itmap ehind it $hile pressed. Type + dra$s a transparent circle $ith a diameter of the si5e height parameter into the middle of the utton area. Example7
T2pe :
0ffset sets the position of the utton. This is $hen it is not pressed. )ixels right and pixels do$n. Example7
-55set 0 7<0
-o$n sets the picture of the do$n utton. This is only needed if type 0 is set. )ixels right and pixels do$n. Example7
own +:; ;<
0ut1n tells Emu!" $hich utton is eing pressed. / ta le of 0ut1n codes are on the next
9irtual mode should e used for uttons that duplicate the function of a 8)!" utton. This type of utton cannot e held do$n. / 0n-o$n e'ent is generated $hen the utton pressed. / 0nBp e'ent is generated $hen the utton is released. Example7
8irtual
@o8old $ill #eep a utton from stic#ing in the do$n position. 1t only generates an 0nBp e'ent. Example7
NoHold
0n-o$n and 0nBp are used to carryout scancode commands $hen you press a utton. /ny 2cancode command <see page 2%= can e used. 0n-o$n is $hen the utton is pressed do$n. 0nBp is $hen the utton is released. Example7
-n own End -nBp Release @+ Release 07 Press 07 Press @+
End
N
5 64
I/YR
4 64
PV
3 64
PMT
2 64
FV
1 64
SUM+
0 64
%
5 32
RCL
4 32
CFj
3 32
CST
2 32
PRC
1 32
MAR
0 32
INPUT
4 16
->M
3 16
RM
2 16
M+
1 16
<0 16
+/58
7
38 34
8
28
9
18
/
08
K
54
!
24
"
14
#
04
S$IFT
52
%
32
&
22
'
12
02
C
0 32768
(
31
)
21
*
11
+
01
N
0 16
I/YR
1 16
PV
2 16
PMT
5 15
FV
4 16
SUM+
3 16
STO
01
RCL
11
CST
21
PRC
51
MAR
41
STAT
31
INPUT
14
+/24
+
54
,
44
<34
%
02
7
22 28
8
52
9
42
/
32
08
!
58
"
48
#
38
S$IFT
0 32
%
2 32
&
5 32
'
4 32
3 32
C
0 32768
(
2 64
)
5 54
*
4 64
+
3 64
.
5 64
.
4 64
.
3 64
.
2 64
.
1 64
.
0 64
STO
5 32
RCL
4 32
%
3 32
/SP
2 32
PRT
1 32
01IT
0 32
INPUT
4 16
+/3 16
+
2 16
,
1 16
<0 16
.
58
7
38 34
8
28
9
18
/
08
54
!
24
"
14
#
04
S$IFT
52
%
32
&
22
'
12
02
C
0 32768
(
31
)
21
*
11
+
01
A
6 256
2
6 2048
C
6 64
/
6 32
0
61
F
6 1024
3
5 256
$
5 2048
I
5 64
4
5 32
K
51
L
5 1024
M
4 256
N
4 2048
O
4 64
P
4 32
5
41
R
4 1024
S
3 256
T
3 2048
U
3 64
V
4 32
6
41
1
4 1024
Y
2 256
7
2 2048
8
2 64
9
2 32
:
21
;
2 1024
SPAC0
1 2048
INS
1 64
/0L
1 32
<11
->
1 1024
Key
OutIn
72
7 128
7 512
74
78
7 16
S$IFT
62
STO
6 128
RCL
6 512
/ISP
64
PRNT
68
01IT
6 16
INPUT
6 128
+/5 512
+
54
,
58
<5 16
.
42
7
4 128 3 128
8
4 512
9
44
/
48
32
!
3 512
"
34
#
38
%
52
%
32
&
22
'
12
02
ON
0 32768
O
1 128
)
1 512
*
14
+
18
S5R+1 e.1 ,
5 64 4 64
LN
3 64
Y.1
2 64
%/1
1 64
SUM+
0 64
STO
5 32
RCL
4 32
SIN
3 32
COS
2 32
TAN
1 32
R/S
0 32
INPUT
4 16
+/3 16
+
2 16
,
1 16
<0 16
105
58
7
38 34
8
28
9
18
/
08
<-<
54
!
24
"
14
#
04
/->
52
%
32
&
22
'
12
02
C
0 32768
(
31
)
21
*
11
+
01
.
5 64
.
4 64
.
3 64
.
2 64
.
1 64
.
0 64
STO
5 32
RCL
4 32
SIN
3 32
COS
2 32
TAN
1 32
01IT
0 32
INPUT
4 16
+/3 16
+
2 16
,
1 16
<0 16
.
58
7
38 34
8
28
9
18
/
08
54
!
24
"
14
#
04
S$IFT
52
%
32
&
22
'
12
02
C
0 32768
(
31
)
21
*
11
+
01
A
6 16
2
6 32
C
6 2048
/
6 1024
0
6 512
F
6 128
3
5 16
$
5 32
I
5 2048
4
5 1024
K
5 512
L
5 128
M
4 16
N
4 32
O
4 2048
P
4 1024
5
4 512
R
4 128
S
3 16
T
3 32
U
3 2048
V
3 1024
6
3 512
1
3 128
Y
2 16
7
2 32
:
2 2048
=
2 1024
>
2 512
+
2 128
SPAC0
1 32
<<
1 2048
*
1 1024
LC
1 512
ALP$ A
1 128
Key
OutIn
INS
7 256
/0L
7 64
.
78
71
<
72
>
74
S$IFT
6 256
<.->
6 64
TRI3
68
SOLV
61
US0R
62
N01T
64
0NT0R
5 64
C$S
58
001
51
/ROP
52
<54
?
4 256
7
4 64 3 64
8
48
9
41
/
42
STO
3 256
!
38
"
31
#
32
0VAL
2 256
%
2 64
&
28
'
21
22
ON
0 32768
O
1 64
)
18
@
11
+
12
A
6 256
2
6 2048
C
6 64
/
6 32
0
61
F
6 1024
3
5 256
$
5 2048
I
5 64
4
5 32
K
51
L
5 1024
M
4 256
N
4 2048
O
4 64
P
4 32
5
41
R
4 1024
S
3 256
T
3 2048
U
3 64
V
4 32
6
41
1
4 1024
Y
2 256
7
2 2048
:
2 64
=
2 32
>
21
+
2 1024
SPAC0
1 2048
<<
1 64
*
1 32
LC
11
ALP$ A
1 1024
Key
OutIn
INS
72
/0L
7 128
.
7 512
74
<
78
>
7 16
S$IFT
62
<.->
6 128
TRI3
6 512
SOLV
64
US0R
68
N01T
6 16
0NT0R
6 128
C$S
5 512
001
54
/ROP
58
<5 16
?
42
7
4 128 3 128
8
4 512
9
44
/
48
STO
32
!
3 512
"
34
#
38
0VAL
22
%
2 128
&
2 512
'
24
28
ON
0 32768
O
1 128
)
1 512
@
14
+
18
S5A+1, e.1
5 64 4 64
LN
3 64
Y.1
2 64
%/1
1 64
SUM+
0 64
STO
5 32
RCL
4 32
R3 32
SIN
2 32
COS
1 32
TAN
0 32
0NT0R
41
1<>Y
31
+/21
0
11
<01
105
58
7
38 3 16
8
28
9
18
/
08
<-<
5 16
!
2 16
"
1 16
#
0 16
/->
54
%
34
&
24
'
14
04
01IT
0 32768
(
32
)
22
R/S
12
+
02
SUM+
5 64
%/1
4 64
S5R+1 ,
3 64
LO3
2 64
LN
1 64
105
0 64
STO
5 32
RCL
4 32
R3 32
SIN
2 32
COS
1 32
TAN
0 32
0NT0R
4 16
1<>Y
3 16
+/2 16
0
1 16
<0 16
.
58
7
38 34
8
28
9
18
/
08
54
!
24
"
14
#
04
S$IFT
52
%
32
&
22
'
12
02
01IT
0 32768
(
31
)
21
R/S
11
+
01
A
1 16
2
8 16
C
88
/
84
0
82
F
81
3
2 16
$
7 16
I
78
4
74
K
72
L
71
M
0 16
N
6 16
O
68
P
64
5
62
R
61
S
3 16
T
5 16
U
58
V
54
6
52
1
51
0NT0R
4 16
Y
48
7
44
/0L
42
/ROP
41
A
3 32
7
38 28
8
34
9
32
/
31
<-<
2 32
!
24
"
22
#
21
/->
1 32
%
18
&
14
'
12
11
ON
0 32768
(
08
)
04
SPC
02
+
01
A
51
2
52
C
54
/
58
0
5 16
F
5 32
3
5 128
$
4 128
I
3 128
.
68
4
2 128
K
1 128
L
0 128
<
64
62 0 64
>
61
M
4 64
N
3 64
O
2 64
P
1 64
/0L U
0 32
5
4 32
R
3 32
S
2 32
T
1 32
V
4 16
6
3 16
1
2 16
Y
1 16
7
0 16
ALP$A
78
7
38 34
8
28
9
18
#
08
<-<
74
!
24
"
14
04
/-)>
72
%
32
&
22
'
12
+
02
ON
SPC
0NT0R
0 32768
31
21
11
01
#cancode
The 2cancode defines $hat the emulator $ill do $hen a certain #ey on the #ey oard is pressed. )ressing a #ey that has no scancode defined $ill <only if de ug mode is on= display a message ox $ith the #eyKs scancode num er, so that you can $rite a 2cancode loc#. The commands in the 2cancode loc# are executed t$ice, first $hen the #ey is pressed and a second time $hen the #ey is released. ?lags can help to transfer information <for example can e set to sho$ that a shift #ey is pressed= from one 2cancode loc# to another. 9alid flags are 0I&%.
Scancode INTEGER CC-MMAN SD End
9alid ,ommands
Map INTEGER INTEGER or or or Press INTEGER Release INTEGER I5Pressed INTEGER CC-MMAN SD Else CC-MMAN SD End SetEla! INTEGER ResetEla! INTEGER NotEla! INTEGER I5Ela! INTEGER CC-MMAN SD Else CC-MMAN SD End MenuItem INTEGER
or or or or
or
Map N2,/@,0-EO N(BTT0@O $ill map the state <pressed or released= of the #ey N2,/@,0-EO <defined y the P2cancode N2,/@,0-EOP loc#= to the utton N(BTT0@O <defined y the P(utton N(BTT0@OP loc#=. This means $hen Map is called in the #ey pressing state the (utton is pressed else, $hen Map is called in the #ey releasing state, the (utton is released. Example7
Map <7 77
)ress N(BTT0@O $ill press the utton defined y the P(utton N(BTT0@OP loc#. Example7
Press 77
:elease N(BTT0@O $ill release the utton defined y the P(utton N(BTT0@OP loc#. Example7
Release 77
1f)ressed N2,/@,0-EO tests if 2cancode loc# is called y a #ey press or a #ey release. 1f the loc# is called y a #ey press, the command lines ehind 1f)ressed are executed until a Else or End command is reached. 1f the loc# is called y a #ey release, all command lines et$een Else and the corresponding End are executed. Example7
I5Pressed <7 Map <7 77 Else Map <7 7; End
1f?lag N?L/*@0O tests the state of the flag. 1f the ?lag is set, the command lines ehind 1f?lag are executed until a Else or End command is reached. 1f the ?lag is not set, all command lines et$een Else and the corresponding End are executed. Example7
I5Ela! 7 Map <7 77 Else Map <7 7; End
Menu1tem $ill open a menu <only if itEs supported=. The follo$ing 'alues are accepted7
EI(EFNEG EI(EF-PEN EI(EFSA8E EI(EFSA8EAS EI(EFE1IT E ITFC-P)FSCREEN EI(EFSETTINGS E ITFRESET E ITF(-A F-B#ECT E ITFSA8EF-B#ECT HE(PFAB-BT HE(PFT-PICS EI(EFC(-SE E ITFBACHBPFSA8E E ITFBACHBPFREST-RE E ITFBACHBPF E(ETE 8IEGFSCRIPT E ITFC-P)FSTRING E ITFPASTEFSTRING T--(F ISASM T--(F EBBG T--(FMACR-FREC-R T--(FMACR-FP(A) 7 ; + / < @ A 0 , 7: 77 7; 7+ 7/ 7< 7@ 7A 7, ;: ;7 ;; ;+ ;/
T--(FMACR-FST-P T--(FMACR-FSETTINGS
;< ;@
Conclusion
This document $as originally $ritten y ,asey )atterson for the Key oard Macro Language made y 2Q astien ,arlier and is no$ maintained y ,hristoph *ieRelin#. 1Em sorry, the authors canEt gi'e any indi'idual support, try the ne$sgroup comp.sys.hp!" please. The latest updates are a'aila le at7 C)risto*) Gie+elink c.giesselin#Sgmx.de ,hristoph *iesselin# Main )age http7GGpri'at.s$ol.deG,hristoph*iesselin#G