init repo
This commit is contained in:
commit
90e6151613
3260 files changed
+3745062
No files matched your search
@@ -0,0 +1,40 @@
|
||||
#-----------------------------------------------------------------------
|
||||
#
|
||||
# Makefile for Gigatron ROM and tooling
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
# Allow application-specific SYS extensions to live in Apps/
|
||||
export PYTHONPATH:=Core:Apps/Loader:Apps/Racer
|
||||
export PYTHONDONTWRITEBYTECODE:=please
|
||||
|
||||
ifdef OS # Windows
|
||||
export PYTHONPATH:=$(subst :,;,$(PYTHONPATH))
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Experimental and temporary (to be removed)
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
# Adds vCPU slices on scanlines to get 400 cycles per scanline
|
||||
ROMv3y.rom:
|
||||
cd ../../.. && \
|
||||
python3 Contrib/kervinck/12.5MHz/ROMv3y.asm.py\
|
||||
Apps/Snake/Snake_v2.gcl\
|
||||
Apps/Racer/Racer_v1.gcl\
|
||||
Apps/Mandelbrot/Mandelbrot_v1.gcl\
|
||||
Apps/Pictures/Pictures_v2.gcl\
|
||||
Apps/Credits/Credits_v2.gcl\
|
||||
Apps/Loader/Loader_v2.gcl\
|
||||
Apps/Tetronis/Tetronis_v1.gt1\
|
||||
Apps/Bricks/Bricks_v1.gt1\
|
||||
Apps/TinyBASIC/TinyBASIC_v2.gcl\
|
||||
Apps/WozMon/WozMon_v2.gt1\
|
||||
Egg=Apps/Sprites/Sprites_v1.gt1\
|
||||
Main=Apps/MainMenu/MainMenu_v3.gcl\
|
||||
Contrib/kervinck/12.5MHz/Reset_v3y.gcl
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# vi: noexpandtab
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,124 @@
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Reset Gigatron (pseudo) hardware |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
gcl0x
|
||||
|
||||
{ Setup video }
|
||||
[def
|
||||
{ Setup video indirection table }
|
||||
$100 p= {videoTable}
|
||||
$800 q= {frame}
|
||||
[do
|
||||
q>, p. p<++ { Y[i] = 8..127}
|
||||
0 p. p<++ {dX[i] = 0}
|
||||
q>++ q if>0loop]
|
||||
|
||||
{ Clear screen }
|
||||
\SYS_SetMemory_v2_54 _sysFn= {!!! Not in ROM v1 !!!}
|
||||
32 \sysArgs1. {Color blue}
|
||||
$800 [do
|
||||
p= _sysArgs2= {Destination}
|
||||
160 \sysArgs0. {Count}
|
||||
54!! {SYS call}
|
||||
$100 p+ if>0loop]
|
||||
|
||||
ret
|
||||
] SetupVideo=
|
||||
|
||||
[def {PrintStartupMessage}
|
||||
push
|
||||
[def
|
||||
`***`Gigatron`??K`*** #10
|
||||
``TTL`microcomputer`ROM`v3y #0
|
||||
] Text=
|
||||
|
||||
{ Convert memory size into decimal text }
|
||||
{StartupMessage} 13+ p= {Position within StartupMessage for memory size}
|
||||
$2f2f Char= {Two ASCII counters, both starting at '0'-1}
|
||||
\memSize, 1- 255& 1+ {Number of pages as counted at boot}
|
||||
[do Char>++ 40- if>=0loop] 40+ {Count number of 10K chunks}
|
||||
[do Char<++ 4- if>=0loop] {Count number of 1K chunks}
|
||||
Char>, p. p<++ Char p. {Put decimals into StartupMessage}
|
||||
|
||||
[do
|
||||
Text, if<>0 Char= Text<++ {while((Char=*Text++)!=0)...}
|
||||
10^ [if=0 2 Pos<. Pos>, 8+ Pos>. else PrintChar!]
|
||||
loop]
|
||||
pop ret
|
||||
] PrintStartupMessage=
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
|}\vLR>++ ret{ RAM page 3 |
|
||||
+-----------------------------------------------------------------------}
|
||||
$0300:
|
||||
|
||||
{ Print a 5x8 character on screen with the built-in font
|
||||
Char must be in the 32-127 range (this is not checked) }
|
||||
[def {PrintChar}
|
||||
{Map ASCII code to offset in font table}
|
||||
Char 82- [if<0 50+ i= \font32up
|
||||
else i= \font82up] fontData= {Select low or high page}
|
||||
i 2<< i+ {Multiply by 5}
|
||||
fontData+ fontData= {Add to page address to reach bitmap data for Char}
|
||||
|
||||
{Draw 5 vertical slices: 5 using font data}
|
||||
$3f20 \sysArgs0: {Blue/White}
|
||||
Pos \sysArgs4:
|
||||
6+ Pos=
|
||||
\SYS_VDrawBits_134 _sysFn=
|
||||
$fb i= [do
|
||||
fontData 0?? fontData<++ \sysArgs2. 134!!
|
||||
\sysArgs4<++
|
||||
i<++ i if<>0loop]
|
||||
ret
|
||||
] PrintChar=
|
||||
|
||||
{ Play a note on one channel
|
||||
High byte is channel, low byte is note (should be even)
|
||||
Reset the oscillators and channel variables }
|
||||
[def {SetupChannel}
|
||||
i= 255| 255^ $fa| p= {Pointer to channel struct}
|
||||
i<, i= {Extract note}
|
||||
0 p. p<++ {.wavA}
|
||||
3 p. p<++ {.wavX, 3=Sawtooth}
|
||||
\notesTable i+ 0?? p. p<++ {.keyL}
|
||||
\notesTable i+ 1?? p. p<++ {.keyH}
|
||||
p. p<++ {.oscL}
|
||||
p. {.oscH}
|
||||
ret
|
||||
] SetupChannel=
|
||||
|
||||
{ Setup a G-major chord with 4 channels but don't play it yet }
|
||||
[def {SetupAudio}
|
||||
push
|
||||
$158 {1: G-3} SetupChannel!
|
||||
$270 {2: G-4} SetupChannel!
|
||||
$378 {3: B-4} SetupChannel!
|
||||
$47e {4: D-5} SetupChannel!
|
||||
pop ret
|
||||
] SetupAudio=
|
||||
|
||||
{ Now it is safe to call functions }
|
||||
SetupAudio!
|
||||
SetupVideo!
|
||||
$814 Pos= PrintStartupMessage! {Returns 0}
|
||||
|
||||
{ Start blinkenlights }
|
||||
\ledState_v2, 128& {Check if sequencer still running}
|
||||
[if=0 \ledState_v2. \ledTimer.] {For continuity only restart when paused}
|
||||
9 \ledTempo. {6.0 Hz ( = 60/(9+1)), was 5.5 Hz}
|
||||
|
||||
\SYS_SetMode_v2_80 _sysFn= {!!! Not in ROM v1 !!!}
|
||||
1 80!! {Mode 1 -> "ABC-"}
|
||||
|
||||
{ Load and start main program }
|
||||
\Main _sysArgs0= $200 _vLR= \SYS_Exec_88 _sysFn= 88!!
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
3D with free rotation around 1 axis
|
||||
See Cube.gtb
|
||||
|
||||
Per frame
|
||||
|
||||
Variable dX dY Rz Camera position and direction
|
||||
Constant f Fixed focus
|
||||
|
||||
1 sin/cos (byte) Use small lookup table
|
||||
C = cos Rz
|
||||
S = sin Rz
|
||||
|
||||
Per 3D point x, y, z
|
||||
|
||||
2 add/sub Translation
|
||||
x1 = x - dx
|
||||
x1 = y - dY
|
||||
|
||||
4 mul, 2 add/sub Rotation
|
||||
x2 = x1 * C - y1 * S
|
||||
y2 = x1 * S + y1 * C
|
||||
[A rotating object demo can do these
|
||||
incrementally, sin a = a, cos a = 1,
|
||||
fixed "convenient" a (e.g. a=1/256)
|
||||
|
||||
x2 = x1 - y1 * a
|
||||
y2 = x1 * a + y1
|
||||
|
||||
Zero multiplications
|
||||
|
||||
This is a like a mass-spring system.
|
||||
The 2D points before projection follow
|
||||
a harmonic motion]
|
||||
|
||||
2 div, 3 add/sub Projection
|
||||
r = y2 + f
|
||||
u = 80 + x2/r
|
||||
v = 60 - z/r
|
||||
|
||||
Total: 6 mul/div + some add/subs
|
||||
|
||||
Bresenham's algorithm to trace the edge between two points
|
||||
|
||||
SYS_SetMemory to fill the area between two edges
|
||||
|
||||
Either triangles (polygon system), or point lists per pixel line
|
||||
|
||||
Arithmetic: 15 bit signed fixed point
|
||||
|
||||
High byte: 1 sign, 7 integer -128..127
|
||||
Low byte: 1 internal carry, 7 fraction 0..127
|
||||
|
||||
Speed:
|
||||
7 iterations per mul, plus shifts
|
||||
Fast internal carry
|
||||
|
||||
Maybe down to 2 scanlines per operation???
|
||||
10 scanlines per point???
|
||||
This can become really fast
|
||||
|
||||
Eliminate iteration overhead: SYS functions that process vector
|
||||
of points through self-restart
|
||||
|
||||
Addition: 9 cycles
|
||||
; A1 A0
|
||||
; B1 B0
|
||||
; ----- +
|
||||
; C1 C0
|
||||
|
||||
ld [A0]
|
||||
adda [B0]
|
||||
anda $80,x
|
||||
anda $7f
|
||||
st [C0]
|
||||
ld [x]
|
||||
adda [A1]
|
||||
adda [B1]
|
||||
st [C1]
|
||||
|
||||
Multiplication: 217 cycles
|
||||
|
||||
;(A2)A1.A0 A2 is sign extension: 0 or 127/255
|
||||
; B0 Is cos() or sin() XXX TODO +/- sign, -1.0 and +1.0
|
||||
; -------- +*
|
||||
; C2 C1.C0
|
||||
|
||||
ld [B0] #0 Bit N (18 cycles)
|
||||
anda 1<<N #1
|
||||
bpl .4 #2
|
||||
ld [A0] #3
|
||||
ld 4 #4 Zero
|
||||
.3 bne .3 #5,7,9,11,13
|
||||
suba 1 #6,8,10,12,14
|
||||
beq .5 #15
|
||||
ld [C2] #16
|
||||
.4 adda [C0] #4 One
|
||||
anda $80,x #5
|
||||
anda $7f #6
|
||||
st [C0] #7
|
||||
ld [X] #8
|
||||
adda [A1] #9
|
||||
adda [C1] #10
|
||||
anda $80,x #11
|
||||
anda $7f #12
|
||||
st [C1] #13
|
||||
ld [X] #14
|
||||
adda [A2] #15
|
||||
adda [C2] #16
|
||||
.5 st [C2] #17
|
||||
|
||||
ld [C0] #0 Shift left (15 cycles)
|
||||
adda [C0] #1
|
||||
anda $80,x #2
|
||||
anda $7f #3
|
||||
st [C0] #4
|
||||
ld [X] #5
|
||||
adda [C1] #6
|
||||
adda [C1] #7
|
||||
anda $80,x #8
|
||||
anda $7f #9
|
||||
st [C1] #10
|
||||
ld [X] #11
|
||||
adda [C2] #12
|
||||
adda [C2] #13
|
||||
st [C2] #14
|
||||
|
||||
Total
|
||||
add bit: 7 x 18 = 126
|
||||
shift left: 6 x 15 = 75
|
||||
===
|
||||
216 cycles
|
||||
|
||||
Table based multiplication
|
||||
|
||||
(a+b)^2 = a^2 + b^2 + ^2ab
|
||||
(a-b)^2 = a^2 + b^2 - ^2ab
|
||||
========================== -
|
||||
4ab = (a+b)^2 - (a-b)^2
|
||||
|
||||
ab = (a+b)^2/4 - (a-b)^2/4
|
||||
= table[a+b] - table[abs(a-b)]
|
||||
|
||||
table[i] = i^2/4
|
||||
|
||||
For 7-bit x 7-bit muliply, needs two 255-byte tables
|
||||
The quarters cancel out
|
||||
|
||||
http://nparker.llx.com/a2/mult.html
|
||||
|
||||
|
||||
mulTableLo: nop
|
||||
ld ...
|
||||
ld ...
|
||||
ld ...
|
||||
...
|
||||
mulTableLo+255: bra 255 XXX Can also spread out the code over 4 pages
|
||||
mulTableHi: nop
|
||||
ld ...
|
||||
ld ...
|
||||
ld ...
|
||||
...
|
||||
mulTableHi+255: bra [vTmp]
|
||||
nop
|
||||
|
||||
vACH vACL
|
||||
A0
|
||||
---------
|
||||
vACL * A0 -> 28+25 cycles
|
||||
A1 A2
|
||||
vACH * A0 -> 28+27 cycles
|
||||
A2 A3
|
||||
--------------
|
||||
A2 A1 -> 8 cycles
|
||||
-------------
|
||||
116 cycles
|
||||
|
||||
SYS_Mul:
|
||||
; Strip sign(s)
|
||||
; XXX TODO
|
||||
|
||||
; Partial vACL * A0
|
||||
ld .L0 ;(a-b)^2/4 lo 28 cycles
|
||||
st [vTmp]
|
||||
ld [vACL]
|
||||
suba [A0]
|
||||
bmi pc+3
|
||||
bra pc+3
|
||||
suba 1
|
||||
xora 255
|
||||
adda 1
|
||||
st [A1]
|
||||
ld >mulTableLo,Y
|
||||
jmp y,ac
|
||||
bra 255
|
||||
;ld ...
|
||||
;bra [vTmp]
|
||||
;nop
|
||||
.L0 st [A2]
|
||||
ld .L1 ;hi
|
||||
st [vTmp]
|
||||
ld [A1]
|
||||
ld >mulTableHi,Y
|
||||
jmp y,ac
|
||||
bra 255
|
||||
;ld ...
|
||||
;bra [vTmp]
|
||||
;nop
|
||||
.L1 xora 255 ;Almost negate
|
||||
st [A1]
|
||||
|
||||
ld .L2 ;(a-b)^2/4 lo 25 cycles
|
||||
st [vTmp]
|
||||
ld [vACL]
|
||||
adda [A0]
|
||||
ld >mulTableLo,Y
|
||||
jmp y,ac
|
||||
bra 255
|
||||
;ld ...
|
||||
;bra [vTmp]
|
||||
;nop
|
||||
.L2 suba [A2]
|
||||
anda $80,x ;Carry
|
||||
ld .L3 ;hi
|
||||
st [vTmp]
|
||||
ld [vACL]
|
||||
adda [A0]
|
||||
ld >mulTableHi,Y
|
||||
jmp y,ac
|
||||
bra 255
|
||||
;ld ...
|
||||
;bra [vTmp]
|
||||
;nop
|
||||
.L3 adda [A1]
|
||||
adda [x] ;Apply carry
|
||||
st [A1]
|
||||
|
||||
; Partial vACH * A0
|
||||
ld .L4 ;(a-b)^2/4 lo 28 cycles
|
||||
st [vTmp]
|
||||
ld [vACH]
|
||||
suba [A0]
|
||||
bmi pc+3
|
||||
bra pc+3
|
||||
suba 1
|
||||
xora 255
|
||||
adda 1
|
||||
st [A1]
|
||||
ld >mulTableLo,Y
|
||||
jmp y,ac
|
||||
bra 255
|
||||
;ld ...
|
||||
;bra [vTmp]
|
||||
;nop
|
||||
.L4 st [A3]
|
||||
ld .L5 ;hi
|
||||
st [vTmp]
|
||||
ld [A1]
|
||||
ld >mulTableHi,Y
|
||||
jmp y,ac
|
||||
bra 255
|
||||
;ld ...
|
||||
;bra [vTmp]
|
||||
;nop
|
||||
.L5 xora 255 ;Almost negate
|
||||
st [A2]
|
||||
|
||||
ld .L6 ;(a-b)^2/4 lo 27 cycles
|
||||
st [vTmp]
|
||||
ld [vACH]
|
||||
adda [A0]
|
||||
ld >mulTableLo,Y
|
||||
jmp y,ac
|
||||
bra 255
|
||||
;ld ...
|
||||
;bra [vTmp]
|
||||
;nop
|
||||
.L6 suba [A3]
|
||||
anda $80,x ;Carry
|
||||
anda $7f
|
||||
st [A3]
|
||||
ld .L7 ;hi
|
||||
st [vTmp]
|
||||
ld [vACL]
|
||||
adda [A0]
|
||||
ld >mulTableHi,Y
|
||||
jmp y,ac
|
||||
bra 255
|
||||
;ld ...
|
||||
;bra [vTmp]
|
||||
;nop
|
||||
.L7 adda [A2]
|
||||
adda [x] ;Apply carry
|
||||
st [A2]
|
||||
|
||||
ld [A1] ;Sum 8 cycles
|
||||
adda [A3]
|
||||
anda $80,x ;Carry
|
||||
anda $7d
|
||||
st [A1]
|
||||
ld [A2]
|
||||
adda [x] ;Apply carry
|
||||
st [A2]
|
||||
|
||||
; Apply result sign
|
||||
; XXX TODO
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
$00 BRK $01 ORA ------- ------- ------- $05 ORA $06 ASL ------- $08 PHP $09 ORA $0A ASL ------- ------- $0D ORA $0E ASL -------
|
||||
- ($DD,X) ------- ------- ------- $DD $DD ------- - #$DD A ------- ------- $DDDD $DDDD -------
|
||||
|
||||
$10 BPL $11 ORA ------- ------- ------- $15 ORA $16 ASL ------- $18 CLC $19 ORA ------- ------- ------- $1D ORA $1E ASL -------
|
||||
PC+$DD ($DD),Y ------- ------- ------- $DD,X $DD,X ------- - $DDDD,Y ------- ------- ------- $DDDD,X $DDDD,X -------
|
||||
|
||||
$20 JSR $21 AND ------- ------- $24 BIT $25 AND $26 ROL ------- $28 PLP $29 AND $2A ROL ------- $2C BIT $2D AND $2E ROL -------
|
||||
$DDDD ($DD,X) ------- ------- $DD $DD $DD ------- - #$DD A ------- $DDDD $DDDD $DDDD -------
|
||||
|
||||
$30 BMI $31 AND ------- ------- ------- $35 AND $36 ROL ------- $38 SEC $39 AND ------- ------- ------- $3D AND $3E ROL -------
|
||||
PC+$DD ($DD),Y ------- ------- ------- $DD,X $DD,X ------- - $DDDD,Y ------- ------- ------- $DDDD,X $DDDD,X -------
|
||||
|
||||
$40 RTI $41 EOR ------- ------- ------- $45 EOR $46 LSR ------- $48 PHA $49 EOR $4A LSR ------- $4C JMP $4D EOR $4E LSR -------
|
||||
- ($DD,X) ------- ------- ------- $DD $DD ------- - #$DD A ------- $DDDD $DDDD $DDDD -------
|
||||
|
||||
$50 BVC $51 EOR ------- ------- ------- $55 EOR $56 LSR ------- $58 CLI $59 EOR ------- ------- ------- $5D EOR $5E LSR -------
|
||||
PC+$DD ($DD),Y ------- ------- ------- $DD,X $DD,X ------- - $DDDD,Y ------- ------- ------- $DDDD,X $DDDD,X -------
|
||||
|
||||
$60 RTS $61 ADC ------- ------- ------- $65 ADC $66 ROR ------- $68 PLA $69 ADC $6A ROR ------- $6C JMP $6D ADC $6E ROR -------
|
||||
- ($DD,X) ------- ------- ------- $DD $DD ------- - #$DD A ------- ($DDDD) $DDDD $DDDD -------
|
||||
|
||||
$70 BVS $71 ADC ------- ------- ------- $75 ADC $76 ROR ------- $78 SEI $79 ADC ------- ------- ------- $7D ADC $7E ROR -------
|
||||
PC+$DD ($DD),Y ------- ------- ------- $DD,X $DD,X ------- - $DDDD,Y ------- ------- ------- $DDDD,X $DDDD,X -------
|
||||
|
||||
------- $81 STA ------- ------- $84 STY $85 STA $86 STX ------- $88 DEY ------- $8A TXA ------- $8C STY $8D STA $8E STX -------
|
||||
------- ($DD,X) ------- ------- $DD $DD $DD ------- - ------- - ------- $DDDD $DDDD $DDDD -------
|
||||
|
||||
$90 BCC $91 STA ------- ------- $94 STY $95 STA $96 STX ------- $98 TYA $99 STA $9A TXS ------- ------- $9D STA ------- -------
|
||||
PC+$DD ($DD),Y ------- ------- $DD,X $DD,X $DD,Y ------- - $DDDD,Y - ------- ------- $DDDD,X ------- -------
|
||||
|
||||
$A0 LDY $A1 LDA $A2 LDX ------- $A4 LDY $A5 LDA $A6 LDX ------- $A8 TAY $A9 LDA $AA TAX ------- $AC LDY $AD LDA $AE LDX -------
|
||||
#$DD ($DD,X) #$DD ------- $DD $DD $DD ------- - #$DD - ------- $DDDD $DDDD $DDDD -------
|
||||
|
||||
$B0 BCS $B1 LDA ------- ------- $B4 LDY $B5 LDA $B6 LDX ------- $B8 CLV $B9 LDA $BA TSX ------- $BC LDY $BD LDA $BE LDX -------
|
||||
PC+$DD ($DD),Y ------- ------- $DD,X $DD,X $DD,Y ------- - $DDDD,Y - ------- $DDDD,X $DDDD,X $DDDD,Y -------
|
||||
|
||||
$C0 CPY $C1 CMP ------- ------- $C4 CPY $C5 CMP $C6 DEC ------- $C8 INY $C9 CMP $CA DEX ------- $CC CPY $CD CMP $CE DEC -------
|
||||
#$DD ($DD,X) ------- ------- $DD $DD $DD ------- - #$DD - ------- $DDDD $DDDD $DDDD -------
|
||||
|
||||
$D0 BNE $D1 CMP ------- ------- ------- $D5 CMP $D6 DEC ------- $D8 CLD $D9 CMP ------- ------- ------- $DD CMP $DE DEC -------
|
||||
PC+$DD ($DD),Y ------- ------- ------- $DD,X $DD,X ------- - $DDDD,Y ------- ------- ------- $DDDD,X $DDDD,X -------
|
||||
|
||||
$E0 CPX $E1 SBC ------- ------- $E4 CPX $E5 SBC $E6 INC ------- $E8 INX $E9 SBC $EA NOP ------- $EC CPX $ED SBC $EE INC -------
|
||||
#$DD ($DD,X) ------- ------- $DD $DD $DD ------- - #$DD - ------- $DDDD $DDDD $DDDD -------
|
||||
|
||||
$F0 BEQ $F1 SBC ------- ------- ------- $F5 SBC $F6 INC ------- $F8 SED $F9 SBC ------- ------- ------- $FD SBC $FE INC -------
|
||||
PC+$DD ($DD),Y ------- ------- ------- $DD,X $DD,X ------- - $DDDD,Y ------- ------- ------- $DDDD,X $DDDD,X -------
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
; 6502 codes
|
||||
; AC IP IM ZP Zx Zy AB Ax Ay IN Ix Iy PC
|
||||
|
||||
adc -- -- 69 65 75 -- 6d 7d 79 -- 61 71 --
|
||||
and -- -- 29 25 35 -- 2d 3d 39 -- 21 31 --
|
||||
asl 0a -- -- 06 16 -- 0e 1e -- -- -- -- --
|
||||
bcc -- -- -- -- -- -- -- -- -- -- -- -- 90
|
||||
bcs -- -- -- -- -- -- -- -- -- -- -- -- b0
|
||||
beq -- -- -- -- -- -- -- -- -- -- -- -- f0
|
||||
bit -- -- -- 24 -- -- 2c -- -- -- -- -- --
|
||||
bmi -- -- -- -- -- -- -- -- -- -- -- -- 30
|
||||
bne -- -- -- -- -- -- -- -- -- -- -- -- d0
|
||||
bpl -- -- -- -- -- -- -- -- -- -- -- -- 10
|
||||
brk -- 00 -- -- -- -- -- -- -- -- -- -- --
|
||||
bvc -- -- -- -- -- -- -- -- -- -- -- -- 50
|
||||
bvs -- -- -- -- -- -- -- -- -- -- -- -- 70
|
||||
clc -- 18 -- -- -- -- -- -- -- -- -- -- --
|
||||
cld -- d8 -- -- -- -- -- -- -- -- -- -- --
|
||||
cli -- 58 -- -- -- -- -- -- -- -- -- -- --
|
||||
clv -- b8 -- -- -- -- -- -- -- -- -- -- --
|
||||
cmp -- -- c9 c5 d5 -- cd dd d9 -- c1 d1 --
|
||||
cpx -- -- e0 e4 -- -- ec -- -- -- -- -- --
|
||||
cpy -- -- c0 c4 -- -- cc -- -- -- -- -- --
|
||||
dec -- -- -- c6 d6 -- ce de -- -- -- -- --
|
||||
dex -- ca -- -- -- -- -- -- -- -- -- -- --
|
||||
dey -- 88 -- -- -- -- -- -- -- -- -- -- --
|
||||
eor -- -- 49 45 55 -- 4d 5d 59 -- 41 51 --
|
||||
inc -- -- -- e6 f6 -- ee fe -- -- -- -- --
|
||||
inx -- e8 -- -- -- -- -- -- -- -- -- -- --
|
||||
iny -- c8 -- -- -- -- -- -- -- -- -- -- --
|
||||
jmp -- -- -- -- -- -- 4c -- -- 6c -- -- --
|
||||
jsr -- -- -- -- -- -- 20 -- -- -- -- -- --
|
||||
lda -- -- a9 a5 b5 -- ad bd b9 -- a1 b1 --
|
||||
ldx -- -- a2 a6 -- b6 ae -- be -- -- -- --
|
||||
ldy -- -- a0 a4 b4 -- ac bc -- -- -- -- --
|
||||
lsr 4a -- -- 46 56 -- 4e 5e -- -- -- -- --
|
||||
nop -- ea -- -- -- -- -- -- -- -- -- -- --
|
||||
ora -- -- 09 05 15 -- 0d 1d 19 -- 01 11 --
|
||||
pha -- 48 -- -- -- -- -- -- -- -- -- -- --
|
||||
php -- 08 -- -- -- -- -- -- -- -- -- -- --
|
||||
pla -- 68 -- -- -- -- -- -- -- -- -- -- --
|
||||
plp -- 28 -- -- -- -- -- -- -- -- -- -- --
|
||||
rol 2a -- -- 26 36 -- 2e 3e -- -- -- -- --
|
||||
ror 6a -- -- 66 76 -- 6e 7e -- -- -- -- --
|
||||
rti -- 40 -- -- -- -- -- -- -- -- -- -- --
|
||||
rts -- 60 -- -- -- -- -- -- -- -- -- -- --
|
||||
sbc -- -- e9 e5 f5 -- ed fd f9 -- e1 f1 --
|
||||
sec -- 38 -- -- -- -- -- -- -- -- -- -- --
|
||||
sed -- f8 -- -- -- -- -- -- -- -- -- -- --
|
||||
sei -- 78 -- -- -- -- -- -- -- -- -- -- --
|
||||
sta -- -- -- 85 95 -- 8d 9d 99 -- 81 91 --
|
||||
stx -- -- -- 86 -- 96 8e -- -- -- -- -- --
|
||||
sty -- -- -- 84 94 -- 8c -- -- -- -- -- --
|
||||
tax -- aa -- -- -- -- -- -- -- -- -- -- --
|
||||
tay -- a8 -- -- -- -- -- -- -- -- -- -- --
|
||||
tsx -- ba -- -- -- -- -- -- -- -- -- -- --
|
||||
txa -- 8a -- -- -- -- -- -- -- -- -- -- --
|
||||
txs -- 9a -- -- -- -- -- -- -- -- -- -- --
|
||||
tya -- 98 -- -- -- -- -- -- -- -- -- -- --
|
||||
@@ -0,0 +1 @@
|
||||
Can we do a raster interrupt?
|
||||
@@ -0,0 +1,45 @@
|
||||
'DRAW 3D CUBE WITH SOME
|
||||
'ROTATION AROUND X
|
||||
|
||||
10 CLS:U=48:GOTO 100
|
||||
|
||||
'ROTATION AND PROJECTION
|
||||
20 R=K+L+F
|
||||
25 P(I)=80+X/R
|
||||
30 Q(I)=60+(M-N)/R
|
||||
35 P(I+4)=160-P(I)
|
||||
40 Q(I+4)=Q(I)
|
||||
45 I=I+1:RETURN
|
||||
|
||||
'DRAW EDGE
|
||||
50 X=P(A):Y=Q(A):AT X,Y
|
||||
55 LINE P(B)-X,Q(B)-Y
|
||||
60 RETURN
|
||||
|
||||
'SETUP CAMERA
|
||||
' S=SIN C=COS F=FLEN
|
||||
100 S=24:C=42:F=3*U
|
||||
|
||||
'PROCESS CUBE CORNERS
|
||||
110 I=0:X=U*U
|
||||
120 K=S:M=U*C
|
||||
130 L=C:N=U*S:GOSUB 20
|
||||
140 L=-L:N=-N:GOSUB 20
|
||||
150 K=-K:M=-M:GOSUB 20
|
||||
160 L=-L:N=-N:GOSUB 20
|
||||
|
||||
'DRAW CUBE
|
||||
200 A=0:B=1:GOSUB 50
|
||||
205 A=1:B=2:GOSUB 50
|
||||
210 A=2:B=3:GOSUB 50
|
||||
215 A=3:B=0:GOSUB 50
|
||||
220 A=4:B=5:GOSUB 50
|
||||
225 A=5:B=6:GOSUB 50
|
||||
230 A=6:B=7:GOSUB 50
|
||||
235 A=7:B=4:GOSUB 50
|
||||
240 A=4:B=0:GOSUB 50
|
||||
245 A=5:B=1:GOSUB 50
|
||||
250 A=6:B=2:GOSUB 50
|
||||
255 A=7:B=3:GOSUB 50
|
||||
|
||||
300 AT 2,104:END
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 308 KiB |
@@ -0,0 +1,826 @@
|
||||
gcl0x
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Forth74 -- Inner interpreter for a vCPU-based Forth |
|
||||
| |
|
||||
| !!! WORK IN PROGRESS !!! |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{
|
||||
References:
|
||||
|
||||
https://colorforth.github.io/HOPL.html
|
||||
Forth - The Early Years
|
||||
Chuck Moore
|
||||
|
||||
http://forth.org/OffeteStore/1010_SystemsGuideToFigForth.pdf
|
||||
Systems Guide to figForth
|
||||
C.H.Ting, Ph.D
|
||||
|
||||
http://www.bradrodriguez.com/papers/moving1.htm
|
||||
Moving Forth
|
||||
Brad Rodriguez
|
||||
|
||||
https://www.sifflez.org/lectures/ASE/C3.pdf
|
||||
ASE: Writing a forth interpreter from scratch
|
||||
Pablo de Oliveira
|
||||
|
||||
https://users.ece.cmu.edu/~koopman/stack_computers/appb.html
|
||||
A Glossery of Forth Primitives
|
||||
Philip Koopman
|
||||
|
||||
Variables:
|
||||
|
||||
IP Instruction pointer
|
||||
RSP Return stack
|
||||
W i j Work register(s)
|
||||
DoColon Fall into threaded code, save IP on stack
|
||||
Next Fetch and dispatch next threaded instruction
|
||||
Pos Cursor position in video memory (initialized by CR)
|
||||
|
||||
Other:
|
||||
\vSP Data stack
|
||||
}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| RAM page 2 |
|
||||
+-----------------------------------------------------------------------}
|
||||
*=$200
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Inner or address interpreter |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
_COLD=*
|
||||
|
||||
{ Next }
|
||||
[def
|
||||
IP 2+ IP= {Advance IP}
|
||||
deek call {Fetch address and dispatch}
|
||||
] Next=
|
||||
|
||||
{ DoColon }
|
||||
[def
|
||||
RSP 2- RSP= IP RSP: {Push IP on return stack}
|
||||
\vLR; IP= {vLR points to address after CALL}
|
||||
deek call {Fetch and execute first word}
|
||||
] DoColon=
|
||||
|
||||
{ DoVar }
|
||||
[def
|
||||
push {Same as "\vLR; 2-- %0="}
|
||||
Next!
|
||||
] DoVar=
|
||||
|
||||
0 RSP= {Clear return stack: top of memory}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| ABORT |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
_ABORT=*
|
||||
0 \vSP. {Clear data stack: top of page 0}
|
||||
DoColon! {The rest is hand compiled Forth}
|
||||
##_HELLO
|
||||
##_Lit ##_FreeMem {Select vocabulary}
|
||||
##_CP ##_Doke
|
||||
##_WORDS
|
||||
##_QUIT {Doesn't return}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| QUIT |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{ QUIT embeds the outer or text interpreter, a.k.a. INTERPRET }
|
||||
|
||||
_QUIT=*
|
||||
DoColon!
|
||||
##_Zero ##_RspStore {Clear return stack: top of memory}
|
||||
_quit1=*
|
||||
##_CR
|
||||
##_Byte `O ##_EMIT {'Ok' prompt}
|
||||
##_Byte `k ##_EMIT
|
||||
##_Byte `> ##_EMIT
|
||||
##_Byte #32 ##_EMIT
|
||||
##_QUERY {Let user type something}
|
||||
##_DUMMY {Dummy interpreter just echoes}
|
||||
##_Jump ##_quit1
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| Execution tokens not in dictionary |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
_Exit=*
|
||||
RSP deek IP= {Address from return stack}
|
||||
RSP 2+ RSP= {Pop return stack}
|
||||
Next!
|
||||
|
||||
_Lit=*
|
||||
IP 2+ deek {Fetch immediate value}
|
||||
2-- %0= {Push on stack}
|
||||
IP 4+ IP= {Skip operand as well}
|
||||
deek call {Same as Next}
|
||||
|
||||
_Byte=*
|
||||
IP 2+ peek {Fetch immediate byte}
|
||||
2-- %0= {Push on stack}
|
||||
IP 3+ IP= {Skip operand as well}
|
||||
deek call {Same as Next}
|
||||
|
||||
_RspStore=*
|
||||
%0 2++ RSP= {Set Return Stack Pointer}
|
||||
Next!
|
||||
|
||||
_Escape=* {Eacape into vCPU}
|
||||
IP 2+ \vLR:
|
||||
RSP deek IP= {Same as _Exit}
|
||||
RSP 2+ RSP= {Pop return stack}
|
||||
[ret] {Note: Brackets suppress the Loader patch}
|
||||
|
||||
_Cursor=* {Emit character and move back position}
|
||||
DoColon!
|
||||
##_EMIT ##_GoBack ##_DROP
|
||||
##_Exit
|
||||
|
||||
_Jump=*
|
||||
IP 2+ deek {Target address in operand}
|
||||
IP= deek call {Same as Next}
|
||||
|
||||
_JumpEq=*
|
||||
%0 2++ {Pop condition}
|
||||
[if=0 IP 2+ deek {Address in operand}
|
||||
else IP 4+] {Address after operand}
|
||||
IP= deek call {Same as Next}
|
||||
|
||||
_JumpNe=*
|
||||
%0 2++ {Pop condition}
|
||||
[if<>0 IP 2+ deek {Address in operand}
|
||||
else IP 4+] {Address after operand}
|
||||
IP= deek call {Same as Next}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| RAM page 3 |
|
||||
+-----------------------------------------------------------------------}
|
||||
*=$300
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Dictionary |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{
|
||||
From this point on, everything is part of the dictionary
|
||||
|
||||
| |
|
||||
FreeMem --> | | High memory
|
||||
+-----------------------+
|
||||
| Pointer to name 2 | ------.
|
||||
+-----------------------+ |
|
||||
| vCPU code and data 2 | |
|
||||
| | |
|
||||
| | |
|
||||
~ ~ |
|
||||
Execution token --> | | |
|
||||
+-----------------------+ |
|
||||
| Name 2 | |
|
||||
~ ~ |
|
||||
| Lenght of name 2 | <-----'
|
||||
+-----------------------+
|
||||
| Pointer to name 1 | ------.
|
||||
+-----------------------+ |
|
||||
| | |
|
||||
| Etc. | |
|
||||
~ ~ |
|
||||
Execution token --> | | |
|
||||
+-----------------------+ |
|
||||
| Name 1 | |
|
||||
~ ~ |
|
||||
| Length of name 1 | <-----'
|
||||
+-----------------------+
|
||||
| Null |
|
||||
+-----------------------+
|
||||
| |
|
||||
| Primitives | Low memory
|
||||
| |
|
||||
|
||||
Naming convention for word labels:
|
||||
|
||||
_ALLCAPS Standard Forth words listed as `ALLCAPS' in dictionary
|
||||
_MixedCase 1. Internal word not in the dictionary, or
|
||||
2. Forth word with special chars (eg. _Add1 for 1+), or
|
||||
3. Gigatron-specific words in dictionary
|
||||
_someword1..n Internal labels for SOMEWORD/SomeWord implementation
|
||||
__SomeWord Internal label for linking dictionary items
|
||||
}
|
||||
|
||||
##0 {Null}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Constants words |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__Zero=*
|
||||
#@_Zero `0 {Name}
|
||||
_Zero=*
|
||||
0 2-- %0= Next!
|
||||
##__Zero {Link}
|
||||
|
||||
__One=*
|
||||
#@_One `1 {Name}
|
||||
_One=*
|
||||
1 2-- %0= Next!
|
||||
##__One {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Memory words |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__Deek=*
|
||||
#@_Deek `@ {Name}
|
||||
_Deek=*
|
||||
%0 deek %0= Next!
|
||||
##__Deek {Link}
|
||||
|
||||
__Doke=*
|
||||
#@_Doke `! {Name}
|
||||
_Doke=*
|
||||
%0 W= %2 W: 4++ Next!
|
||||
##__Doke {Link}
|
||||
|
||||
__Peek=*
|
||||
#@_Peek `C@ {Name}
|
||||
_Peek=*
|
||||
%0 peek %0= Next!
|
||||
##__Peek {Link}
|
||||
|
||||
__Poke=*
|
||||
#@_Poke `C! {Name}
|
||||
_Poke=*
|
||||
%0 W= %2 W. 4++ Next!
|
||||
##__Poke {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Operator words |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__Add=*
|
||||
#@_Add `+ {Name}
|
||||
_Add=*
|
||||
%0 2++ W= %0 W+ %0= Next!
|
||||
##__Add {Link}
|
||||
|
||||
__Sub=*
|
||||
#@_Sub `- {Name}
|
||||
_Sub=*
|
||||
%0 2++ W= %0 W- %0= Next!
|
||||
##__Sub {Link}
|
||||
|
||||
__AND=*
|
||||
#@_AND `AND {Name}
|
||||
_AND=*
|
||||
%0 2++ W= %0 W& %0= Next!
|
||||
##__AND {Link}
|
||||
|
||||
__OR=*
|
||||
#@_OR `OR {Name}
|
||||
_OR=*
|
||||
%0 2++ W= %0 W| %0= Next!
|
||||
##__OR {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Data stack words |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__DROP=*
|
||||
#@_DROP `DROP {Name}
|
||||
_DROP=*
|
||||
2++ Next! {Drop word from stack}
|
||||
##__DROP {Link}
|
||||
|
||||
__DUP=*
|
||||
#@_DUP `DUP {Name}
|
||||
_DUP=*
|
||||
%0 2-- %0= Next! {Duplication top of stack}
|
||||
##__DUP {Link}
|
||||
|
||||
__OVER=*
|
||||
#@_OVER `OVER {Name}
|
||||
_OVER=*
|
||||
%2 2-- %0= Next!
|
||||
##__OVER {Link}
|
||||
|
||||
__SWAP=*
|
||||
#@_SWAP `SWAP {Name}
|
||||
_SWAP=*
|
||||
%2 W= %0 %2= W %0= Next!
|
||||
##__SWAP {Link}
|
||||
|
||||
__ROT=*
|
||||
#@_ROT `ROT {Name}
|
||||
_ROT=*
|
||||
%4 W= %2 %4= %0 %2= W %0= Next!
|
||||
{-----------------------------------------------------------------------+
|
||||
| RAM page 4 |
|
||||
+-----------------------------------------------------------------------}
|
||||
*=$400
|
||||
##__ROT {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Video terminal words |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| CR ( -- ) Newline |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__CR=*
|
||||
#@_CR `CR {Name}
|
||||
_CR=*
|
||||
|
||||
{ Find the top text row }
|
||||
|
||||
2 <Pos. {Go to start of line, indent 2 pixels}
|
||||
$fe+ i= {i=$100: start of the video table}
|
||||
peek >Pos. {Go to what is now still the top row}
|
||||
|
||||
{ Clear the text row }
|
||||
|
||||
$10 \sysArgs0. \sysArgs1. {Both colors DarkBlue}
|
||||
Pos 2- \sysArgs4: {Set drawing position for clearing}
|
||||
\SYS_VDrawBits_134 _sysFn= {Prepare SYS calls}
|
||||
[do
|
||||
134!! {SYS call to draw 8 pixels vertically}
|
||||
<\sysArgs4++ {Step 1 pixel right}
|
||||
\sysArgs4, 160^ if<>0loop] {Loop until end of pixel line}
|
||||
|
||||
{
|
||||
Scroll everything up by modifying the video indirection table.
|
||||
[This may be a cool effect to watch in slow motion?]
|
||||
}
|
||||
[do
|
||||
i 16+ j= {j looks 8 entries ahead of i}
|
||||
i, \sysArgs7. {Swap scanlines}
|
||||
j, i.
|
||||
\sysArgs7, j.
|
||||
<i++ <i++ {Advance to next entry in video table}
|
||||
<i, 224^ if<>0loop] {Until all done}
|
||||
{ The cleared text row has now bubbled down to the bottom }
|
||||
|
||||
Next!
|
||||
##__CR {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| EMIT ( c -- ) Emit ASCII to video terminal |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{ XXX Doesn't do backspace }
|
||||
{ XXX Doesn't do bell }
|
||||
|
||||
__EMIT=*
|
||||
#@_EMIT `EMIT {Name}
|
||||
_EMIT=*
|
||||
|
||||
%0 10^ [if<>0 {Test for explicit CR}
|
||||
<Pos, 155- if>0 0] {Or implicit line wrap}
|
||||
[if=0
|
||||
DoColon! ##_CR {Move to next line}
|
||||
##_Escape] {Continue in vCPU}
|
||||
|
||||
%0 2++ {Pop parameter}
|
||||
|
||||
[128- if<0 96+ if>=0 {Skip non-printables to prevent crashing}
|
||||
{
|
||||
Draw ASCII character (32..127) on screen in 5x8 pixels
|
||||
and advance cursor position
|
||||
}
|
||||
50- {Map ASCII code to offset in font table}
|
||||
[if<0 50+ i= \font32up {ASCII 32..81}
|
||||
else i= \font82up] {ASCII 82..127}
|
||||
j= i 2<< i+ {Multiply char code by 5}
|
||||
j+ j= {Add to page address to reach bitmap data}
|
||||
|
||||
\SYS_VDrawBits_134 _sysFn= {Prepare SYS calls}
|
||||
$c10 \sysArgs0: {LightGreen on DarkBlue}
|
||||
Pos \sysArgs4: {Screen position for character}
|
||||
6+ Pos= {Advance by 6 pixels}
|
||||
|
||||
5 [do i= {Draw character as 5 vertical bit slices}
|
||||
j 0? \sysArgs2. {Get bit slice as byte from ROM table}
|
||||
134!! {SYS call to draw 8 pixels vertically}
|
||||
<j++ <\sysArgs4++ {Advance to next byte}
|
||||
i 1- if>0loop] {Looping}
|
||||
]
|
||||
Next!
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| RAM page 5 |
|
||||
+-----------------------------------------------------------------------}
|
||||
*=$500
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| GoBack ( -- r ) Step character back on line if possible |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{ Returns 0 on success }
|
||||
|
||||
_GoBack=*
|
||||
<Pos, 6- [if>=0 <Pos. 0]
|
||||
2-- %0= Next!
|
||||
|
||||
##__EMIT {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| KEY ( -- c ) Wait for key stroke |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__KEY=*
|
||||
#@_KEY `KEY {Name}
|
||||
_KEY=*
|
||||
\serialRaw, W= {Reference}
|
||||
2-- {Make space on stack}
|
||||
[do
|
||||
\serialRaw, %0= W^ {Probe and compare with reference}
|
||||
if=0loop {Loop if not changed}
|
||||
%0 W= 128& {Check high bit}
|
||||
if<>0loop] {Loop if no ASCII or keyboard idle}
|
||||
Next!
|
||||
##__KEY {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| 0< ( n -- f ) True if top number negative |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__IsNeg=*
|
||||
#@_IsNeg `0< {Name}
|
||||
_IsNeg=*
|
||||
%1 128& [if<>0 129-] %0= {Set to -1 or 0}
|
||||
Next!
|
||||
##__IsNeg
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| 1+ ( n -- n+1 ) Add 1 i |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__Add1=*
|
||||
#@_Add1 `1+ {Name}
|
||||
_Add1=*
|
||||
%0 1+ %0= Next!
|
||||
##__Add1 {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| 1- ( n -- n-1 ) Subtract 1 |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__Sub1=*
|
||||
#@_Sub1 `1- {Name}
|
||||
_Sub1=*
|
||||
%0 1- %0= Next!
|
||||
##__Sub1 {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| MINUS ( n -- -n ) Change sign |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{ Later Forths call this `NEGATE' }
|
||||
|
||||
__MINUS=*
|
||||
#@_MINUS `MINUS {Name}
|
||||
_MINUS=*
|
||||
%0 W= 0 W- %0= Next!
|
||||
##__MINUS {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Return Stack words |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| >R ( n -- ) Move top item to return stack |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__ToR=*
|
||||
#@_ToR `>R {Name}
|
||||
_ToR=*
|
||||
RSP 2- RSP= %0 2++ RSP: Next! {Code}
|
||||
##__ToR {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| R> ( -- n ) Retrieve item from return stack |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__FromR=*
|
||||
#@_FromR `R> {Name}
|
||||
_FromR=*
|
||||
RSP; 2-- %0= RSP 2+ RSP= Next!{Code}
|
||||
##__FromR {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| R ( -- n ) Copy top of return stack into stack |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__R=*
|
||||
#@_R `R {Name}
|
||||
_R=*
|
||||
RSP; 2-- %0= Next! {Code}
|
||||
##__R {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| SPACE ( -- ) Print one space |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__SPACE=*
|
||||
#@_SPACE `SPACE {Name}
|
||||
_SPACE=*
|
||||
DoColon!
|
||||
##_Byte #32 ##_EMIT
|
||||
##_Exit
|
||||
##__SPACE {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| . ( n -- ) Print number |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__Dot=*
|
||||
#@_Dot `. {Name}
|
||||
_Dot=*
|
||||
DoColon!
|
||||
##_SPACE
|
||||
##_DUP ##_IsNeg {Test sign}
|
||||
##_JumpEq ##_dot1
|
||||
##_Byte `- ##_EMIT {Print "-"}
|
||||
##_MINUS
|
||||
_dot1=*
|
||||
##_Zero {Suppress leading zeroes}
|
||||
##_Lit ##10000 ##_Digit
|
||||
##_Lit ##1000 ##_Digit
|
||||
##_Byte #100 ##_Digit
|
||||
##_Byte #10 ##_Digit
|
||||
##_Byte #1 ##_Digit
|
||||
##_DROP ##_DROP
|
||||
##_Exit
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| RAM page 6 |
|
||||
+-----------------------------------------------------------------------}
|
||||
*=$600
|
||||
|
||||
{ Helper for _Dot }
|
||||
_Digit=* { n z r -- n-d*r z+d }
|
||||
DoColon!
|
||||
##_ToR { n 0 | r }
|
||||
##_SWAP { 0 n | r }
|
||||
_digit1=*
|
||||
##_R { 0 n r | r }
|
||||
##_Sub { 0 m | r }
|
||||
##_DUP { 0 m m | r }
|
||||
##_IsNeg { 0 m sign | r }
|
||||
##_JumpNe ##_digit2 { 0 m | r }
|
||||
##_SWAP ##_Add1 ##_SWAP { 1 m | r }
|
||||
##_Jump ##_digit1
|
||||
_digit2=*
|
||||
##_FromR { 1 m r }
|
||||
##_Add { 1 m }
|
||||
##_SWAP { m 1 }
|
||||
##_DUP ##_JumpEq ##_digit3
|
||||
##_Byte #$30 ##_OR { m '1' }
|
||||
_digit3=*
|
||||
##_EMIT { m }
|
||||
##_Byte #$30 { m 0 }
|
||||
##_Exit
|
||||
##__Dot {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| HELLO ( -- ) Send text to terminal |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__HELLO=*
|
||||
#@_HELLO `HELLO {Name}
|
||||
_HELLO=*
|
||||
DoColon!
|
||||
##_CR {Activate terminal}
|
||||
##_Byte `F ##_EMIT
|
||||
##_Byte `o ##_EMIT
|
||||
##_Byte `r ##_EMIT
|
||||
##_Byte `t ##_EMIT
|
||||
##_Byte `h ##_EMIT
|
||||
##_Byte `7 ##_EMIT
|
||||
##_Byte `4 ##_EMIT
|
||||
##_CR
|
||||
##_Exit
|
||||
##__HELLO {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| TYPE ( addr u -- ) Type u characters starting at address |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__TYPE=*
|
||||
#@_TYPE `TYPE {Name}
|
||||
_TYPE=*
|
||||
DoColon!
|
||||
##_Jump ##_type2
|
||||
_type1=*
|
||||
##_SWAP
|
||||
##_DUP ##_Peek ##_EMIT
|
||||
##_Add1
|
||||
##_SWAP
|
||||
##_Sub1
|
||||
_type2=*
|
||||
##_DUP ##_JumpNe ##_type1
|
||||
##_DROP ##_DROP
|
||||
##_Exit
|
||||
##__TYPE {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| CP ( -- addr ) Variable to begin of free memory |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__CP=*
|
||||
#@_CP `CP {Name}
|
||||
_CP=*
|
||||
DoVar!
|
||||
##0
|
||||
##__CP {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| HERE ( -- addr ) Return address above dictionary |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__HERE=*
|
||||
#@_HERE `HERE {Name}
|
||||
_HERE=*
|
||||
DoColon!
|
||||
##_CP ##_Deek ##_Exit
|
||||
##__HERE {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
| Text interpreter words |
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| WORDS ( -- ) Print names in dictionary |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__WORDS=*
|
||||
#@_WORDS `WORDS {Name}
|
||||
_WORDS=*
|
||||
DoColon!
|
||||
##_HERE
|
||||
##_Jump ##_words2
|
||||
_words1=*
|
||||
##_SPACE
|
||||
##_DUP ##_Add1
|
||||
##_OVER ##_Peek
|
||||
##_TYPE
|
||||
_words2=*
|
||||
##_Byte #2 ##_Sub ##_Deek
|
||||
##_DUP ##_JumpNe ##_words1
|
||||
##_DROP
|
||||
##_CR
|
||||
##_Exit
|
||||
##__WORDS {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| TIB (variable) Address of terminal input buffer |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__TIB=*
|
||||
#@_TIB `TIB {Name}
|
||||
_TIB=*
|
||||
DoVar!
|
||||
##\userVars2 {Default in zero page}
|
||||
##__TIB {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| IN (variable) Input character counter |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__IN=*
|
||||
#@_IN `IN {Name}
|
||||
_IN=*
|
||||
DoVar!
|
||||
##0
|
||||
{-----------------------------------------------------------------------+
|
||||
| RAM page 8 |
|
||||
+-----------------------------------------------------------------------}
|
||||
*=$8a0
|
||||
##__IN {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| EXPECT ( addr n -- ) Let user edit line in buffer of size n |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{
|
||||
Line edditing with delete capability within the same terminal line.
|
||||
Delete at beginning of a non-first line restarts the line entry completely.
|
||||
Prevents buffer overflow and replaces final newline with a zero byte.
|
||||
}
|
||||
|
||||
__EXPECT=*
|
||||
#@_EXPECT `EXPECT {Name}
|
||||
_EXPECT=*
|
||||
DoColon!
|
||||
##_OVER ##_Add ##_Sub1 {End of buffer}
|
||||
##_ToR {Place it on return stack}
|
||||
##_DUP {Active buffer pointer on top of stack}
|
||||
_expect1=*
|
||||
##_Byte #127 ##_Cursor {Show cursor}
|
||||
##_KEY {Wait for key}
|
||||
##_Byte #32 ##_Cursor {Hide cursor}
|
||||
|
||||
##_DUP ##_Byte #127 ##_Sub {Test for DEL}
|
||||
##_JumpNe ##_expect2
|
||||
##_DROP
|
||||
##_OVER ##_OVER ##_Sub {Ignore DEL at start of buffer}
|
||||
##_JumpEq ##_expect1
|
||||
##_Sub1
|
||||
##_GoBack
|
||||
##_JumpEq ##_expect1 {Continue if DEL ok}
|
||||
##_Byte `? ##_EMIT ##_CR {Display error indicator}
|
||||
##_DROP ##_DUP {Clear buffer}
|
||||
##_Jump ##_expect1
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| RAM page 9 |
|
||||
+-----------------------------------------------------------------------}
|
||||
*=$9a0
|
||||
|
||||
_expect2=*
|
||||
##_DUP ##_Byte #10 ##_Sub {Test for '\n'}
|
||||
##_JumpEq ##_expect3
|
||||
##_OVER ##_R ##_Sub {Test for buffer space}
|
||||
##_JumpNe ##_expect4
|
||||
##_DROP ##_Jump ##_expect1 {Ignore if buffer full}
|
||||
_expect4=*
|
||||
##_DUP ##_EMIT {Echo character if all good}
|
||||
##_OVER ##_Poke {And store in buffer}
|
||||
##_Add1 {Advance buffer pointer}
|
||||
##_Jump ##_expect1
|
||||
_expect3=*
|
||||
##_EMIT {Emit and drop '\n'}
|
||||
##_Zero ##_SWAP ##_Poke {Replace '\n' with '\0' terminator}
|
||||
##_DROP ##_FromR ##_DROP
|
||||
##_Exit
|
||||
##__EXPECT {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| QUERY ( -- ) Input 80 chars of text from video terminal |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
__QUERY=*
|
||||
#@_QUERY `QUERY {Name}
|
||||
_QUERY=*
|
||||
DoColon!
|
||||
##_TIB ##_Deek {Address of input buffer}
|
||||
##_Byte #81 ##_EXPECT {Get up to 80 characters plus '\0'}
|
||||
##_Zero ##_IN ##_Doke {IN=0}
|
||||
##_Exit
|
||||
{-----------------------------------------------------------------------+
|
||||
| RAM page 10 |
|
||||
+-----------------------------------------------------------------------}
|
||||
*=$aa0
|
||||
##__QUERY {Link}
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| DUMMY ( -- ) Dummy interpreter |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
{ Simply type back the input buffer to screen }
|
||||
|
||||
__DUMMY=*
|
||||
#@_DUMMY `DUMMY {Name}
|
||||
_DUMMY=*
|
||||
DoColon!
|
||||
##_TIB ##_Deek
|
||||
_dummy1=*
|
||||
##_DUP ##_Peek
|
||||
##_JumpEq ##_dummy2
|
||||
##_DUP ##_Peek ##_EMIT
|
||||
##_Add1 ##_Jump ##_dummy1
|
||||
_dummy2=*
|
||||
##_DROP
|
||||
##_Exit
|
||||
##__DUMMY {Link}
|
||||
|
||||
_FreeMem=*
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
| |
|
||||
+-----------------------------------------------------------------------}
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1 @@
|
||||
Can videoC(?) add 1 or another offset to the videoY page?
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 9.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
Some one-shot tools to generate the keymap table for in PS2.ino
|
||||
@@ -0,0 +1,229 @@
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x0d, 9 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x5a, 10 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x76, 27 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x29, 32 },
|
||||
{ +US+GB+DE +IT+ES +SHIFT, 0x16, 33 }, // '!'
|
||||
{ +FR +NOMOD, 0x4a, 33 },
|
||||
{ +GB+DE +IT+ES +SHIFT, 0x1e, 34 }, // '"'
|
||||
{ +FR +NOMOD, 0x26, 34 },
|
||||
{ +US +SHIFT, 0x52, 34 },
|
||||
{ +US +SHIFT, 0x26, 35 }, // '#'
|
||||
{ +FR +ES +ALTGR, 0x26, 35 },
|
||||
{ +IT +ALTGR, 0x52, 35 },
|
||||
{ +GB+DE +NOMOD, 0x5d, 35 },
|
||||
{ +DE+FR +ALTGR, 0x5d, 35 },
|
||||
{ +US+GB+DE +IT+ES +SHIFT, 0x25, 36 }, // '$'
|
||||
{ +FR +NOMOD, 0x5b, 36 },
|
||||
{ +US+GB+DE +IT+ES +SHIFT, 0x2e, 37 }, // '%'
|
||||
{ +FR +SHIFT, 0x52, 37 },
|
||||
{ +FR +NOMOD, 0x16, 38 }, // '&'
|
||||
{ +DE +IT+ES +SHIFT, 0x36, 38 },
|
||||
{ +US+GB +SHIFT, 0x3d, 38 },
|
||||
{ +FR +NOMOD, 0x25, 39 }, // '''
|
||||
{ +IT+ES +NOMOD, 0x4e, 39 },
|
||||
{ +US+GB +NOMOD, 0x52, 39 },
|
||||
{ +DE +NOMOD, 0x55, 39 },
|
||||
{ +DE +SHIFT, 0x5d, 39 },
|
||||
{ +FR +NOMOD, 0x2e, 40 }, // '('
|
||||
{ +DE +IT+ES +SHIFT, 0x3e, 40 },
|
||||
{ +US+GB +SHIFT, 0x46, 40 },
|
||||
{ +US+GB +SHIFT, 0x45, 41 }, // ')'
|
||||
{ +DE +IT+ES +SHIFT, 0x46, 41 },
|
||||
{ +FR +NOMOD, 0x4e, 41 },
|
||||
{ +US+GB +SHIFT, 0x3e, 42 }, // '*'
|
||||
{ +DE +IT+ES +SHIFT, 0x5b, 42 },
|
||||
{ +FR +NOMOD, 0x5d, 42 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x7c, 42 },
|
||||
{ +US+GB +FR +SHIFT, 0x55, 43 }, // '+'
|
||||
{ +DE +IT+ES +NOMOD, 0x5b, 43 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x79, 43 },
|
||||
{ +FR +NOMOD, 0x3a, 44 }, // ','
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x41, 44 },
|
||||
{ +FR +NOMOD, 0x36, 45 }, // '-'
|
||||
{ +DE +IT+ES +NOMOD, 0x4a, 45 },
|
||||
{ +US+GB +NOMOD, 0x4e, 45 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x7b, 45 },
|
||||
{ +FR +SHIFT, 0x41, 46 }, // '.'
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x49, 46 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x71, 46 },
|
||||
{ +DE +IT+ES +SHIFT, 0x3d, 47 }, // '/'
|
||||
{ +FR +SHIFT, 0x49, 47 },
|
||||
{ +US+GB +NOMOD, 0x4a, 47 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x45, 48 }, // '0'
|
||||
{ +FR +SHIFT, 0x45, 48 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x70, 48 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x16, 49 }, // '1'
|
||||
{ +FR +SHIFT, 0x16, 49 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x69, 49 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x1e, 50 }, // '2'
|
||||
{ +FR +SHIFT, 0x1e, 50 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x72, 50 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x26, 51 }, // '3'
|
||||
{ +FR +SHIFT, 0x26, 51 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x7a, 51 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x25, 52 }, // '4'
|
||||
{ +FR +SHIFT, 0x25, 52 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x6b, 52 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x2e, 53 }, // '5'
|
||||
{ +FR +SHIFT, 0x2e, 53 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x73, 53 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x36, 54 }, // '6'
|
||||
{ +FR +SHIFT, 0x36, 54 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x74, 54 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x3d, 55 }, // '7'
|
||||
{ +FR +SHIFT, 0x3d, 55 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x6c, 55 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x3e, 56 }, // '8'
|
||||
{ +FR +SHIFT, 0x3e, 56 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x75, 56 },
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x46, 57 }, // '9'
|
||||
{ +FR +SHIFT, 0x46, 57 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x7d, 57 },
|
||||
{ +FR +NOMOD, 0x49, 58 }, // ':'
|
||||
{ +DE +IT+ES +SHIFT, 0x49, 58 },
|
||||
{ +US+GB +SHIFT, 0x4c, 58 },
|
||||
{ +FR +NOMOD, 0x41, 59 }, // ';'
|
||||
{ +DE +IT+ES +SHIFT, 0x41, 59 },
|
||||
{ +US+GB +NOMOD, 0x4c, 59 },
|
||||
{ +US+GB +SHIFT, 0x41, 60 }, // '<'
|
||||
{ +DE+FR+IT+ES +NOMOD, 0x61, 60 },
|
||||
{ +DE +IT+ES +SHIFT, 0x45, 61 }, // '='
|
||||
{ +US+GB +FR +NOMOD, 0x55, 61 },
|
||||
{ +US+GB +SHIFT, 0x49, 62 }, // '>'
|
||||
{ +DE+FR+IT+ES +SHIFT, 0x61, 62 },
|
||||
{ +FR +SHIFT, 0x3a, 63 }, // '?'
|
||||
{ +US+GB +SHIFT, 0x4a, 63 },
|
||||
{ +DE +IT+ES +SHIFT, 0x4e, 63 },
|
||||
{ +DE+FR +ALTGR, 0x15, 64 }, // '@'
|
||||
{ +US +SHIFT, 0x1e, 64 },
|
||||
{ +ES +ALTGR, 0x1e, 64 },
|
||||
{ +FR +ALTGR, 0x45, 64 },
|
||||
{ +IT +ALTGR, 0x4c, 64 },
|
||||
{ +GB +SHIFT, 0x52, 64 },
|
||||
{ +FR +SHIFT, 0x15, 65 }, // 'A'
|
||||
{ +US+GB+DE +IT+ES +SHIFT, 0x1c, 65 },
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x32, 66 }, // 'B'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x21, 67 }, // 'C'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x23, 68 }, // 'D'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x24, 69 }, // 'E'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x2b, 70 }, // 'F'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x34, 71 }, // 'G'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x33, 72 }, // 'H'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x43, 73 }, // 'I'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x3b, 74 }, // 'J'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x42, 75 }, // 'K'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x4b, 76 }, // 'L'
|
||||
{ +US+GB+DE +IT+ES +SHIFT, 0x3a, 77 }, // 'M'
|
||||
{ +FR +SHIFT, 0x4c, 77 },
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x31, 78 }, // 'N'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x44, 79 }, // 'O'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x4d, 80 }, // 'P'
|
||||
{ +US+GB+DE +IT+ES +SHIFT, 0x15, 81 }, // 'Q'
|
||||
{ +FR +SHIFT, 0x1c, 81 },
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x2d, 82 }, // 'R'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x1b, 83 }, // 'S'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x2c, 84 }, // 'T'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x3c, 85 }, // 'U'
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x2a, 86 }, // 'V'
|
||||
{ +FR +SHIFT, 0x1a, 87 }, // 'W'
|
||||
{ +US+GB+DE +IT+ES +SHIFT, 0x1d, 87 },
|
||||
{ +US+GB+DE+FR+IT+ES +SHIFT, 0x22, 88 }, // 'X'
|
||||
{ +DE +SHIFT, 0x1a, 89 }, // 'Y'
|
||||
{ +US+GB +FR+IT+ES +SHIFT, 0x35, 89 },
|
||||
{ +US+GB +IT+ES +SHIFT, 0x1a, 90 }, // 'Z'
|
||||
{ +FR +SHIFT, 0x1d, 90 },
|
||||
{ +DE +SHIFT, 0x35, 90 },
|
||||
{ +FR +ALTGR, 0x2e, 91 }, // '['
|
||||
{ +DE +IT +ALTGR, 0x3e, 91 },
|
||||
{ +US+GB +NOMOD, 0x54, 91 },
|
||||
{ +IT+ES +ALTGR, 0x54, 91 },
|
||||
{ +IT +NOMOD, 0x0e, 92 }, // '\'
|
||||
{ +ES +ALTGR, 0x0e, 92 },
|
||||
{ +FR +ALTGR, 0x3e, 92 },
|
||||
{ +DE +ALTGR, 0x4e, 92 },
|
||||
{ +US +NOMOD, 0x5d, 92 },
|
||||
{ +GB +NOMOD, 0x61, 92 },
|
||||
{ +DE +IT +ALTGR, 0x46, 93 }, // ']'
|
||||
{ +FR +ALTGR, 0x4e, 93 },
|
||||
{ +US+GB +NOMOD, 0x5b, 93 },
|
||||
{ +IT+ES +ALTGR, 0x5b, 93 },
|
||||
{ +DE +NOMOD, 0x0e, 94 }, // '^'
|
||||
{ +US+GB +SHIFT, 0x36, 94 },
|
||||
{ +FR +ALTGR, 0x46, 94 },
|
||||
{ +FR +NOMOD, 0x54, 94 },
|
||||
{ +ES +SHIFT, 0x54, 94 },
|
||||
{ +IT +SHIFT, 0x55, 94 },
|
||||
{ +FR +NOMOD, 0x3e, 95 }, // '_'
|
||||
{ +DE +IT+ES +SHIFT, 0x4a, 95 },
|
||||
{ +US+GB +SHIFT, 0x4e, 95 },
|
||||
{ +US+GB +NOMOD, 0x0e, 96 }, // '`'
|
||||
{ +FR +ALTGR, 0x3d, 96 },
|
||||
{ +IT +ALTGR, 0x4e, 96 },
|
||||
{ +ES +NOMOD, 0x54, 96 },
|
||||
{ +DE +SHIFT, 0x55, 96 },
|
||||
{ +FR +NOMOD, 0x15, 97 }, // 'a'
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x1c, 97 },
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x32, 98 }, // 'b'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x21, 99 }, // 'c'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x23, 100 }, // 'd'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x24, 101 }, // 'e'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x2b, 102 }, // 'f'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x34, 103 }, // 'g'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x33, 104 }, // 'h'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x43, 105 }, // 'i'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x3b, 106 }, // 'j'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x42, 107 }, // 'k'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x4b, 108 }, // 'l'
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x3a, 109 }, // 'm'
|
||||
{ +FR +NOMOD, 0x4c, 109 },
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x31, 110 }, // 'n'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x44, 111 }, // 'o'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x4d, 112 }, // 'p'
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x15, 113 }, // 'q'
|
||||
{ +FR +NOMOD, 0x1c, 113 },
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x2d, 114 }, // 'r'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x1b, 115 }, // 's'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x2c, 116 }, // 't'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x3c, 117 }, // 'u'
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x2a, 118 }, // 'v'
|
||||
{ +FR +NOMOD, 0x1a, 119 }, // 'w'
|
||||
{ +US+GB+DE +IT+ES +NOMOD, 0x1d, 119 },
|
||||
{ +US+GB+DE+FR+IT+ES +NOMOD, 0x22, 120 }, // 'x'
|
||||
{ +DE +NOMOD, 0x1a, 121 }, // 'y'
|
||||
{ +US+GB +FR+IT+ES +NOMOD, 0x35, 121 },
|
||||
{ +US+GB +IT+ES +NOMOD, 0x1a, 122 }, // 'z'
|
||||
{ +FR +NOMOD, 0x1d, 122 },
|
||||
{ +DE +NOMOD, 0x35, 122 },
|
||||
{ +FR +ALTGR, 0x25, 123 }, // '{'
|
||||
{ +DE +IT +ALTGR, 0x3d, 123 },
|
||||
{ +ES +ALTGR, 0x52, 123 },
|
||||
{ +US+GB +SHIFT, 0x54, 123 },
|
||||
{ +IT +SHIFT, 0x0e, 124 }, // '|'
|
||||
{ +ES +ALTGR, 0x16, 124 },
|
||||
{ +FR +ALTGR, 0x36, 124 },
|
||||
{ +US +SHIFT, 0x5d, 124 },
|
||||
{ +GB +SHIFT, 0x61, 124 },
|
||||
{ +DE+FR +ES +ALTGR, 0x61, 124 },
|
||||
{ +DE +IT +ALTGR, 0x45, 125 }, // '}'
|
||||
{ +FR +ALTGR, 0x56, 125 },
|
||||
{ +US+GB +SHIFT, 0x5b, 125 },
|
||||
{ +ES +ALTGR, 0x5d, 125 },
|
||||
{ +US +SHIFT, 0x0e, 126 }, // '~'
|
||||
{ +FR +ALTGR, 0x1e, 126 },
|
||||
{ +ES +ALTGR, 0x25, 126 },
|
||||
{ +IT +ALTGR, 0x55, 126 },
|
||||
{ +DE +ALTGR, 0x5b, 126 },
|
||||
{ +GB +SHIFT, 0x5d, 126 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x66, 127 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x05, 193 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x06, 194 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x04, 195 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x0c, 196 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x03, 197 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x0b, 198 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x83, 199 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x0a, 200 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x01, 201 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x09, 202 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x78, 203 },
|
||||
{ +US+GB+DE+FR+IT+ES +EVERY, 0x07, 204 },
|
||||
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
|
||||
./remap |
|
||||
sort -n -k 8 -k6 -k 4 -k 2 |
|
||||
awk '
|
||||
function emit()
|
||||
{
|
||||
if (ascii == 0)
|
||||
return;
|
||||
|
||||
a[j++] = map FS mods FS code FS ascii
|
||||
if (j == 3 && a[0] ~ /^UGDFIE/ && a[1] ~ /^UGDFIE/) {
|
||||
map = "UGDFIE"
|
||||
mods = 3
|
||||
j = 0
|
||||
a[j++] = map FS mods FS code FS ascii
|
||||
}
|
||||
|
||||
if ($8 != ascii || $6 != code) {
|
||||
for (i=0; i<j; i++)
|
||||
print a[i]
|
||||
j = 0
|
||||
}
|
||||
}
|
||||
BEGIN {
|
||||
L[0] = "U"
|
||||
L[1] = "G"
|
||||
L[2] = "D"
|
||||
L[3] = "F"
|
||||
L[4] = "I"
|
||||
L[5] = "E"
|
||||
emit()
|
||||
}
|
||||
{
|
||||
if ($8 != ascii || $6 != code || $4 != mods) {
|
||||
emit()
|
||||
map = "------"
|
||||
mods = $4
|
||||
code = $6
|
||||
ascii = $8
|
||||
}
|
||||
map = substr(map, 1, $2) L[$2] substr(map, $2+2, length(map)-$2)
|
||||
}
|
||||
END {
|
||||
$8 = 0
|
||||
emit()
|
||||
}' |
|
||||
|
||||
awk '{
|
||||
map = ""
|
||||
if ($1~/U/) map = map "+US"; else map = map " "
|
||||
if ($1~/G/) map = map "+GB"; else map = map " "
|
||||
if ($1~/D/) map = map "+DE"; else map = map " "
|
||||
if ($1~/F/) map = map "+FR"; else map = map " "
|
||||
if ($1~/I/) map = map "+IT"; else map = map " "
|
||||
if ($1~/E/) map = map "+ES"; else map = map " "
|
||||
if ($2 == 0) mod = "NOMOD"
|
||||
if ($2 == 1) mod = "SHIFT"
|
||||
if ($2 == 2) mod = "ALTGR"
|
||||
if ($2 == 3) mod = "EVERY"
|
||||
printf " { %-18s +%s, 0x%02x, %3d },", map, mod, $3, $4
|
||||
if (32 < $4 && $4 <= 126 && $4 != last)
|
||||
printf " // '"'"'%c'"'"'", $4
|
||||
last = $4
|
||||
printf "\n"
|
||||
}' > keys.txt
|
||||
|
||||
echo "Sanity check:"
|
||||
for C in +US +GB +DE +FR +IT +ES
|
||||
do
|
||||
echo -n "$C:"
|
||||
grep $C keys.txt | awk -F, '{print $3}' | sort -u | wc -l
|
||||
done
|
||||
|
||||
@@ -0,0 +1,517 @@
|
||||
|
||||
/*
|
||||
* Convert Arduino keymaps to more compact data
|
||||
* structure for use in BabelFish on ATtiny85
|
||||
*
|
||||
* Original encoding:
|
||||
* 6 * 409 bytes = 2454 bytes
|
||||
* New encoding
|
||||
* 3 * 329 bytes = 658 bytes
|
||||
*
|
||||
* Encoding is
|
||||
* 6 bits to indicate which subsets apply
|
||||
* 2 bits for shift/altGr
|
||||
* 00 no modifier
|
||||
* 01 modfier must be shift
|
||||
* 10 modifier must be AltGr
|
||||
* 11 ignore modifier
|
||||
* 8 bits keyboard code
|
||||
* 1..131
|
||||
* 8 bits ascii
|
||||
* 9,10,27,32-127,193-204
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define ps2keymapSize 132
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
|
||||
typedef struct keymap {
|
||||
byte noshift[ps2keymapSize];
|
||||
byte shift[ps2keymapSize];
|
||||
byte hasAltGr;
|
||||
byte altgr[ps2keymapSize];
|
||||
} PS2Keymap_t;
|
||||
|
||||
#define PS2_ENTER '\n'
|
||||
#define PS2_TAB 9
|
||||
#define PS2_BACKSPACE 127
|
||||
|
||||
#define PS2_ESC 27
|
||||
#define PS2_F1 (0xc0 + 1)
|
||||
#define PS2_F2 (0xc0 + 2)
|
||||
#define PS2_F3 (0xc0 + 3)
|
||||
#define PS2_F4 (0xc0 + 4)
|
||||
#define PS2_F5 (0xc0 + 5)
|
||||
#define PS2_F6 (0xc0 + 6)
|
||||
#define PS2_F7 (0xc0 + 7)
|
||||
#define PS2_F8 (0xc0 + 8)
|
||||
#define PS2_F9 (0xc0 + 9)
|
||||
#define PS2_F10 (0xc0 + 10)
|
||||
#define PS2_F11 (0xc0 + 11)
|
||||
#define PS2_F12 (0xc0 + 12)
|
||||
#define PS2_SCROLL 0
|
||||
#define PS2_EURO_SIGN 0
|
||||
|
||||
#define PS2_INVERTED_EXCLAMATION 161 // ¡
|
||||
#define PS2_CENT_SIGN 162 // ¢
|
||||
#define PS2_POUND_SIGN 163 // £
|
||||
#define PS2_CURRENCY_SIGN 164 // ¤
|
||||
#define PS2_YEN_SIGN 165 // ¥
|
||||
#define PS2_BROKEN_BAR 166 // ¦
|
||||
#define PS2_SECTION_SIGN 167 // §
|
||||
#define PS2_DIAERESIS 168 // ¨
|
||||
#define PS2_COPYRIGHT_SIGN 169 // ©
|
||||
#define PS2_FEMININE_ORDINAL 170 // ª
|
||||
#define PS2_LEFT_DOUBLE_ANGLE_QUOTE 171 // «
|
||||
#define PS2_NOT_SIGN 172 // ¬
|
||||
#define PS2_HYPHEN 173
|
||||
#define PS2_REGISTERED_SIGN 174 // ®
|
||||
#define PS2_MACRON 175 // ¯
|
||||
#define PS2_DEGREE_SIGN 176 // °
|
||||
#define PS2_PLUS_MINUS_SIGN 177 // ±
|
||||
#define PS2_SUPERSCRIPT_TWO 178 // ²
|
||||
#define PS2_SUPERSCRIPT_THREE 179 // ³
|
||||
#define PS2_ACUTE_ACCENT 180 // ´
|
||||
#define PS2_MICRO_SIGN 181 // µ
|
||||
#define PS2_PILCROW_SIGN 182 // ¶
|
||||
#define PS2_MIDDLE_DOT 183 // ·
|
||||
#define PS2_CEDILLA 184 // ¸
|
||||
#define PS2_SUPERSCRIPT_ONE 185 // ¹
|
||||
#define PS2_MASCULINE_ORDINAL 186 // º
|
||||
#define PS2_RIGHT_DOUBLE_ANGLE_QUOTE 187 // »
|
||||
#define PS2_FRACTION_ONE_QUARTER 188 // ¼
|
||||
#define PS2_FRACTION_ONE_HALF 189 // ½
|
||||
#define PS2_FRACTION_THREE_QUARTERS 190 // ¾
|
||||
#define PS2_INVERTED_QUESTION_MARK 191 // ¿
|
||||
#define PS2_A_GRAVE 192 // À
|
||||
// These 12 conflict with the function key codes in Gigatron
|
||||
#define PS2_A_ACUTE 0 // 193 // Á
|
||||
#define PS2_A_CIRCUMFLEX 0 // 194 // Â
|
||||
#define PS2_A_TILDE 0 // 195 // Ã
|
||||
#define PS2_A_DIAERESIS 0 // 196 // Ä
|
||||
#define PS2_A_RING_ABOVE 0 // 197 // Å
|
||||
#define PS2_AE 0 // 198 // Æ
|
||||
#define PS2_C_CEDILLA 0 // 199 // Ç
|
||||
#define PS2_E_GRAVE 0 // 200 // È
|
||||
#define PS2_E_ACUTE 0 // 201 // É
|
||||
#define PS2_E_CIRCUMFLEX 0 // 202 // Ê
|
||||
#define PS2_E_DIAERESIS 0 // 203 // Ë
|
||||
#define PS2_I_GRAVE 0 // 204 // Ì
|
||||
#define PS2_I_ACUTE 205 // Í
|
||||
#define PS2_I_CIRCUMFLEX 206 // Î
|
||||
#define PS2_I_DIAERESIS 207 // Ï
|
||||
#define PS2_ETH 208 // Ð
|
||||
#define PS2_N_TILDE 209 // Ñ
|
||||
#define PS2_O_GRAVE 210 // Ò
|
||||
#define PS2_O_ACUTE 211 // Ó
|
||||
#define PS2_O_CIRCUMFLEX 212 // Ô
|
||||
#define PS2_O_TILDE 213 // Õ
|
||||
#define PS2_O_DIAERESIS 214 // Ö
|
||||
#define PS2_MULTIPLICATION 215 // ×
|
||||
#define PS2_O_STROKE 216 // Ø
|
||||
#define PS2_U_GRAVE 217 // Ù
|
||||
#define PS2_U_ACUTE 218 // Ú
|
||||
#define PS2_U_CIRCUMFLEX 219 // Û
|
||||
#define PS2_U_DIAERESIS 220 // Ü
|
||||
#define PS2_Y_ACUTE 221 // Ý
|
||||
#define PS2_THORN 222 // Þ
|
||||
#define PS2_SHARP_S 223 // ß
|
||||
#define PS2_a_GRAVE 224 // à
|
||||
#define PS2_a_ACUTE 225 // á
|
||||
#define PS2_a_CIRCUMFLEX 226 // â
|
||||
#define PS2_a_TILDE 227 // ã
|
||||
#define PS2_a_DIAERESIS 228 // ä
|
||||
#define PS2_a_RING_ABOVE 229 // å
|
||||
#define PS2_ae 230 // æ
|
||||
#define PS2_c_CEDILLA 231 // ç
|
||||
#define PS2_e_GRAVE 232 // è
|
||||
#define PS2_e_ACUTE 233 // é
|
||||
#define PS2_e_CIRCUMFLEX 234 // ê
|
||||
#define PS2_e_DIAERESIS 235 // ë
|
||||
#define PS2_i_GRAVE 236 // ì
|
||||
#define PS2_i_ACUTE 237 // í
|
||||
#define PS2_i_CIRCUMFLEX 238 // î
|
||||
#define PS2_i_DIAERESIS 239 // ï
|
||||
#define PS2_eth 240 // ð
|
||||
#define PS2_n_TILDE 241 // ñ
|
||||
#define PS2_o_GRAVE 242 // ò
|
||||
#define PS2_o_ACUTE 243 // ó
|
||||
#define PS2_o_CIRCUMFLEX 244 // ô
|
||||
#define PS2_o_TILDE 245 // õ
|
||||
#define PS2_o_DIAERESIS 246 // ö
|
||||
#define PS2_DIVISION 247 // ÷
|
||||
#define PS2_o_STROKE 248 // ø
|
||||
#define PS2_u_GRAVE 249 // ù
|
||||
#define PS2_u_ACUTE 250 // ú
|
||||
#define PS2_u_CIRCUMFLEX 251 // û
|
||||
#define PS2_u_DIAERESIS 252 // ü
|
||||
#define PS2_y_ACUTE 253 // ý
|
||||
#define PS2_thorn 254 // þ
|
||||
#define PS2_y_DIAERESIS 255 // ÿ
|
||||
|
||||
// Keymaps courtesy of
|
||||
// Arduino PS2Keyboard library (US,DE,FR)
|
||||
// https://playground.arduino.cc/Main/PS2Keyboard
|
||||
// and
|
||||
// Teensy PS2Keyboard library (GB,IT,ES)
|
||||
// http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html
|
||||
//
|
||||
// Modifications made for Gigatron project
|
||||
|
||||
static const PS2Keymap_t keymaps[] = {
|
||||
/* US */ {
|
||||
// without shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, '`', 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'q', '1', 0,
|
||||
0, 0, 'z', 's', 'a', 'w', '2', 0,
|
||||
0, 'c', 'x', 'd', 'e', '4', '3', 0,
|
||||
0, ' ', 'v', 'f', 't', 'r', '5', 0,
|
||||
0, 'n', 'b', 'h', 'g', 'y', '6', 0,
|
||||
0, 0, 'm', 'j', 'u', '7', '8', 0,
|
||||
0, ',', 'k', 'i', 'o', '0', '9', 0,
|
||||
0, '.', '/', 'l', ';', 'p', '-', 0,
|
||||
0, 0, '\'', 0, '[', '=', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, ']', 0, '\\', 0, 0,
|
||||
0, 0, 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
// with shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, '~', 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'Q', '!', 0,
|
||||
0, 0, 'Z', 'S', 'A', 'W', '@', 0,
|
||||
0, 'C', 'X', 'D', 'E', '$', '#', 0,
|
||||
0, ' ', 'V', 'F', 'T', 'R', '%', 0,
|
||||
0, 'N', 'B', 'H', 'G', 'Y', '^', 0,
|
||||
0, 0, 'M', 'J', 'U', '&', '*', 0,
|
||||
0, '<', 'K', 'I', 'O', ')', '(', 0,
|
||||
0, '>', '?', 'L', ':', 'P', '_', 0,
|
||||
0, 0, '"', 0, '{', '+', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '}', 0, '|', 0, 0,
|
||||
0, 0, 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
0
|
||||
},
|
||||
|
||||
/* UK */ {
|
||||
// without shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, '`', 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'q', '1', 0,
|
||||
0, 0, 'z', 's', 'a', 'w', '2', 0,
|
||||
0, 'c', 'x', 'd', 'e', '4', '3', 0,
|
||||
0, ' ', 'v', 'f', 't', 'r', '5', 0,
|
||||
0, 'n', 'b', 'h', 'g', 'y', '6', 0,
|
||||
0, 0, 'm', 'j', 'u', '7', '8', 0,
|
||||
0, ',', 'k', 'i', 'o', '0', '9', 0,
|
||||
0, '.', '/', 'l', ';', 'p', '-', 0,
|
||||
0, 0, '\'', 0, '[', '=', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, ']', 0, '#', 0, 0,
|
||||
0, '\\', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
// with shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, 172 /* ¬ */, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'Q', '!', 0,
|
||||
0, 0, 'Z', 'S', 'A', 'W', '"', 0,
|
||||
0, 'C', 'X', 'D', 'E', '$', 163 /* £ */, 0,
|
||||
0, ' ', 'V', 'F', 'T', 'R', '%', 0,
|
||||
0, 'N', 'B', 'H', 'G', 'Y', '^', 0,
|
||||
0, 0, 'M', 'J', 'U', '&', '*', 0,
|
||||
0, '<', 'K', 'I', 'O', ')', '(', 0,
|
||||
0, '>', '?', 'L', ':', 'P', '_', 0,
|
||||
0, 0, '@', 0, '{', '+', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '}', 0, '~', 0, 0,
|
||||
0, '|', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
0
|
||||
},
|
||||
|
||||
/* DE */ {
|
||||
// without shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, '^', 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'q', '1', 0,
|
||||
0, 0, 'y', 's', 'a', 'w', '2', 0,
|
||||
0, 'c', 'x', 'd', 'e', '4', '3', 0,
|
||||
0, ' ', 'v', 'f', 't', 'r', '5', 0,
|
||||
0, 'n', 'b', 'h', 'g', 'z', '6', 0,
|
||||
0, 0, 'm', 'j', 'u', '7', '8', 0,
|
||||
0, ',', 'k', 'i', 'o', '0', '9', 0,
|
||||
0, '.', '-', 'l', PS2_o_DIAERESIS, 'p', PS2_SHARP_S, 0,
|
||||
0, 0, PS2_a_DIAERESIS, 0, PS2_u_DIAERESIS, '\'', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '+', 0, '#', 0, 0,
|
||||
0, '<', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
// with shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, PS2_DEGREE_SIGN, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'Q', '!', 0,
|
||||
0, 0, 'Y', 'S', 'A', 'W', '"', 0,
|
||||
0, 'C', 'X', 'D', 'E', '$', PS2_SECTION_SIGN, 0,
|
||||
0, ' ', 'V', 'F', 'T', 'R', '%', 0,
|
||||
0, 'N', 'B', 'H', 'G', 'Z', '&', 0,
|
||||
0, 0, 'M', 'J', 'U', '/', '(', 0,
|
||||
0, ';', 'K', 'I', 'O', '=', ')', 0,
|
||||
0, ':', '_', 'L', PS2_O_DIAERESIS, 'P', '?', 0,
|
||||
0, 0, PS2_A_DIAERESIS, 0, PS2_U_DIAERESIS, '`', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '*', 0, '\'', 0, 0,
|
||||
0, '>', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
1,
|
||||
// with altgr
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, 0, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, '@', 0, 0,
|
||||
0, 0, 0, 0, 0, 0, PS2_SUPERSCRIPT_TWO, 0,
|
||||
0, 0, 0, 0, PS2_CURRENCY_SIGN, 0, PS2_SUPERSCRIPT_THREE, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, PS2_MICRO_SIGN, 0, 0, '{', '[', 0,
|
||||
0, 0, 0, 0, 0, '}', ']', 0,
|
||||
0, 0, 0, 0, 0, 0, '\\', 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '~', 0, '#', 0, 0,
|
||||
0, '|', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 }
|
||||
},
|
||||
|
||||
/* FR */ {
|
||||
// without shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, PS2_SUPERSCRIPT_TWO, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'a', '&', 0,
|
||||
0, 0, 'w', 's', 'q', 'z', PS2_e_ACUTE, 0,
|
||||
0, 'c', 'x', 'd', 'e', '\'', '"', 0,
|
||||
0, ' ', 'v', 'f', 't', 'r', '(', 0,
|
||||
0, 'n', 'b', 'h', 'g', 'y', '-', 0,
|
||||
0, 0, ',', 'j', 'u', PS2_e_GRAVE, '_', 0,
|
||||
0, ';', 'k', 'i', 'o', PS2_a_GRAVE, PS2_c_CEDILLA, 0,
|
||||
0, ':', '!', 'l', 'm', 'p', ')', 0,
|
||||
0, 0, PS2_u_GRAVE, 0, '^', '=', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '$', 0, '*', 0, 0,
|
||||
0, '<', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
// with shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, 0, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'A', '1', 0,
|
||||
0, 0, 'W', 'S', 'Q', 'Z', '2', 0,
|
||||
0, 'C', 'X', 'D', 'E', '4', '3', 0,
|
||||
0, ' ', 'V', 'F', 'T', 'R', '5', 0,
|
||||
0, 'N', 'B', 'H', 'G', 'Y', '6', 0,
|
||||
0, 0, '?', 'J', 'U', '7', '8', 0,
|
||||
0, '.', 'K', 'I', 'O', '0', '9', 0,
|
||||
0, '/', PS2_SECTION_SIGN, 'L', 'M', 'P', PS2_DEGREE_SIGN, 0,
|
||||
0, 0, '%', 0, PS2_DIAERESIS, '+', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, PS2_POUND_SIGN, 0, PS2_MICRO_SIGN, 0, 0,
|
||||
0, '>', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
1,
|
||||
// with altgr
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, 0, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, '@', 0, 0,
|
||||
0, 0, 0, 0, 0, 0, '~', 0,
|
||||
0, 0, 0, 0, 0 /*PS2_EURO_SIGN*/, '{', '#', 0,
|
||||
0, 0, 0, 0, 0, 0, '[', 0,
|
||||
0, 0, 0, 0, 0, 0, '|', 0,
|
||||
0, 0, 0, 0, 0, '`', '\\', 0,
|
||||
0, 0, 0, 0, 0, '@', '^', 0,
|
||||
0, 0, 0, 0, 0, 0, ']', 0,
|
||||
0, 0, 0, 0, 0, 0, '}', 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, /*'¤'*/0, 0, '#', 0, 0,
|
||||
0, '|', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 }
|
||||
},
|
||||
|
||||
/* IT */ {
|
||||
// without shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, '\\', 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'q', '1', 0,
|
||||
0, 0, 'z', 's', 'a', 'w', '2', 0,
|
||||
0, 'c', 'x', 'd', 'e', '4', '3', 0,
|
||||
0, ' ', 'v', 'f', 't', 'r', '5', 0,
|
||||
0, 'n', 'b', 'h', 'g', 'y', '6', 0,
|
||||
0, 0, 'm', 'j', 'u', '7', '8', 0,
|
||||
0, ',', 'k', 'i', 'o', '0', '9', 0,
|
||||
0, '.', '-', 'l', PS2_o_GRAVE, 'p', '\'', 0,
|
||||
0, 0, PS2_a_GRAVE, 0, PS2_e_GRAVE, PS2_i_GRAVE, 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '+', 0, PS2_u_GRAVE, 0, 0,
|
||||
0, '<', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
// with shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, '|', 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'Q', '!', 0,
|
||||
0, 0, 'Z', 'S', 'A', 'W', '\"', 0,
|
||||
0, 'C', 'X', 'D', 'E', '$', PS2_POUND_SIGN, 0,
|
||||
0, ' ', 'V', 'F', 'T', 'R', '%', 0,
|
||||
0, 'N', 'B', 'H', 'G', 'Y', '&', 0,
|
||||
0, 0, 'M', 'J', 'U', '/', '(', 0,
|
||||
0, ';', 'K', 'I', 'O', '=', ')', 0,
|
||||
0, ':', '_', 'L', PS2_c_CEDILLA, 'P', '?', 0,
|
||||
0, 0, PS2_DEGREE_SIGN, 0, PS2_e_ACUTE, '^', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '*', 0, PS2_SECTION_SIGN, 0, 0,
|
||||
0, '>', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
1,
|
||||
// with altgr
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, PS2_NOT_SIGN, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 0, PS2_SUPERSCRIPT_ONE, 0,
|
||||
0, 0, 0, 0, 0, 0, PS2_SUPERSCRIPT_TWO, 0,
|
||||
0, 0, 0, 0, PS2_EURO_SIGN, PS2_FRACTION_ONE_QUARTER, PS2_SUPERSCRIPT_THREE, 0,
|
||||
0, ' ', 0, 0, 0, 0, PS2_FRACTION_ONE_HALF, 0,
|
||||
0, 0, 0, 0, 0, 0, PS2_NOT_SIGN, 0,
|
||||
0, 0, 0, 0, 0, '{', '[', 0,
|
||||
0, 0, 0, 0, 0, '}', ']', 0,
|
||||
0, 0, 0, 0, '@', 0, '`', 0,
|
||||
0, 0, '#', 0, '[', '~', 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, ']', 0, 0, 0, 0,
|
||||
0, PS2_LEFT_DOUBLE_ANGLE_QUOTE, 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 }
|
||||
},
|
||||
|
||||
/* ES */ {
|
||||
// without shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, PS2_MASCULINE_ORDINAL, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'q', '1', 0,
|
||||
0, 0, 'z', 's', 'a', 'w', '2', 0,
|
||||
0, 'c', 'x', 'd', 'e', '4', '3', 0,
|
||||
0, ' ', 'v', 'f', 't', 'r', '5', 0,
|
||||
0, 'n', 'b', 'h', 'g', 'y', '6', 0,
|
||||
0, 0, 'm', 'j', 'u', '7', '8', 0,
|
||||
0, ',', 'k', 'i', 'o', '0', '9', 0,
|
||||
0, '.', '-', 'l', PS2_n_TILDE, 'p', '\'', 0,
|
||||
0, 0, PS2_ACUTE_ACCENT, 0, '`', PS2_INVERTED_EXCLAMATION, 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '+', 0, PS2_c_CEDILLA, 0, 0,
|
||||
0, '<', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
// with shift
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, PS2_FEMININE_ORDINAL, 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 'Q', '!', 0,
|
||||
0, 0, 'Z', 'S', 'A', 'W', '\"', 0,
|
||||
0, 'C', 'X', 'D', 'E', '$', PS2_MIDDLE_DOT, 0,
|
||||
0, ' ', 'V', 'F', 'T', 'R', '%', 0,
|
||||
0, 'N', 'B', 'H', 'G', 'Y', '&', 0,
|
||||
0, 0, 'M', 'J', 'U', '/', '(', 0,
|
||||
0, ';', 'K', 'I', 'O', '=', ')', 0,
|
||||
0, ':', '_', 'L', PS2_N_TILDE, 'P', '?', 0,
|
||||
0, 0, PS2_DIAERESIS, 0, '^', PS2_INVERTED_QUESTION_MARK, 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, '*', 0, PS2_C_CEDILLA, 0, 0,
|
||||
0, '>', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 },
|
||||
1,
|
||||
// with altgr
|
||||
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
|
||||
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, '\\', 0,
|
||||
0, 0 /*Lalt*/, 0 /*Lshift*/, 0, 0 /*Lctrl*/, 0, '|', 0,
|
||||
0, 0, 0, 0, 0, 0, '@', 0,
|
||||
0, 0, 0, 0, PS2_EURO_SIGN, '~', '#', 0,
|
||||
0, ' ', 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, PS2_NOT_SIGN, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, '{', 0, '[', PS2_INVERTED_EXCLAMATION, 0, 0,
|
||||
0 /*CapsLock*/, 0 /*Rshift*/, PS2_ENTER /*Enter*/, ']', 0, '}', 0, 0,
|
||||
0, '|', 0, 0, 0, 0, PS2_BACKSPACE, 0,
|
||||
0, '1', 0, '4', '7', 0, 0, 0,
|
||||
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
|
||||
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
|
||||
0, 0, 0, PS2_F7 }
|
||||
}
|
||||
};
|
||||
|
||||
byte gigatronKey(byte ascii)
|
||||
{
|
||||
if (ascii == 9)
|
||||
return ascii;
|
||||
if (ascii == 10)
|
||||
return ascii;
|
||||
if (ascii == 27)
|
||||
return ascii;
|
||||
if (32 <= ascii && ascii <= 127)
|
||||
return ascii;
|
||||
if (0xc1 <= ascii && ascii <= 0xcc)
|
||||
return ascii;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
for (int map=0; map<6; map++) {
|
||||
for (int i=0; i<ps2keymapSize; i++) {
|
||||
int j;
|
||||
|
||||
j = keymaps[map].noshift[i];
|
||||
if (gigatronKey(j))
|
||||
printf("map %d page 0 code %3d ascii %3d\n", map, i, j);
|
||||
|
||||
j = keymaps[map].shift[i];
|
||||
if (gigatronKey(j))
|
||||
printf("map %d page 1 code %3d ascii %3d\n", map, i, j);
|
||||
|
||||
if (keymaps[map].hasAltGr) {
|
||||
j = keymaps[map].altgr[i];
|
||||
if (gigatronKey(j))
|
||||
printf("map %d page 2 code %3d ascii %3d\n", map, i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <Gigatron.h>
|
||||
|
||||
static char name[9];
|
||||
static word addr;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (romType < romTypeValue_DEVROM)
|
||||
return 1;
|
||||
|
||||
addr = ReadRomDir_DEVROM(0, &name[0]);
|
||||
while (addr != 0) {
|
||||
printf("%5u %s\n", addr, name);
|
||||
addr = ReadRomDir_DEVROM(addr, &name[0]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,58 @@
|
||||
|
||||
Context switch
|
||||
--------------
|
||||
vPC vAC vLR vSP vCPUselect -> 8 bytes
|
||||
sysFn sysArgs0..7 -> 10 bytes
|
||||
Minimal:
|
||||
vPC vAC sysFn vCPUselect -> 7 bytes
|
||||
|
||||
Preemptive context switching is *easier*, because there's no nice
|
||||
way to swap context from within vCPU itself without leaving anything
|
||||
behind...
|
||||
|
||||
-> There is instruction to change state
|
||||
-> SYS needs sysFn in state
|
||||
-> Except through DOKE, needing a special ZP location
|
||||
-> CALL and CALLI instuction clobber vLR
|
||||
-> Can we special-case an existing instruction? (if stack becomes zero, ...)
|
||||
-> Poke vCPUselect (and wait), but then we lose our own state
|
||||
|
||||
From vCPU code:
|
||||
LDI vCPUrelease
|
||||
ST vCPUselect
|
||||
_spin BRA _spin
|
||||
<continue>
|
||||
|
||||
LDI SYS_ContextSwitch_40
|
||||
STW sysFn
|
||||
SYS 40
|
||||
|
||||
From v6502 code:
|
||||
LDIM v6502release
|
||||
STZ vCPUselect
|
||||
_spin BNE _spin
|
||||
|
||||
Or better:
|
||||
Add a BRK instruction
|
||||
|
||||
Interrupt
|
||||
---------
|
||||
Its the same?
|
||||
|
||||
Interrupts set: vPC
|
||||
Interrupts save: vPC vAC sysFn vCPUselect -> 7 bytes
|
||||
|
||||
This is almost a full context switch. We can easily swap out and in 18 bytes then?
|
||||
|
||||
|
||||
ld [y,x] ; 3 cycles per context in byte -> 18*3 = 54
|
||||
st [y,x++]
|
||||
st [$dd]
|
||||
|
||||
ld [$dd] ; 2 cycles per context out byte -> 18*2 = 36
|
||||
st [y,x++]
|
||||
|
||||
Total: 90 cycles
|
||||
|
||||
Line 40 -has- 104 cycles
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
gcl0x
|
||||
|
||||
[def
|
||||
{ X dX Y dY }
|
||||
##$0800 ##0 ##0 ##-$80
|
||||
##$1000 ##0 ##0 ##-$100
|
||||
##$1800 ##0 ##0 ##-$180
|
||||
##$2000 ##0 ##0 ##-$200
|
||||
##$2800 ##0 ##0 ##-$280
|
||||
##$3000 ##0 ##0 ##-$300
|
||||
##$3800 ##0 ##0 ##-$380
|
||||
] Points=
|
||||
|
||||
[def
|
||||
##$4450 ##$4450 ##$4450
|
||||
##$4450 ##$4450 ##$4450
|
||||
##$4450
|
||||
] Current=
|
||||
|
||||
{ Clear screen }
|
||||
$800 [do
|
||||
p= $2020 p:
|
||||
p 2+ if>0loop]
|
||||
|
||||
[do
|
||||
{ Draw points }
|
||||
Points p=
|
||||
Current c=
|
||||
0 d=
|
||||
14 [do i=
|
||||
c; q= d q. {Plot last position in color}
|
||||
p 1+ peek $50+ <q.
|
||||
p 5+ peek $44+ >q. {Let Y point down for now}
|
||||
q c: {New position}
|
||||
63 q. {White}
|
||||
d 23+ d= {New color}
|
||||
c 2+ c= p 8+ p= {Next point}
|
||||
i 2- if>0loop]
|
||||
|
||||
{ Update coordinates }
|
||||
Points p=
|
||||
14 [do i=
|
||||
{p[0] += p[1]}
|
||||
p deek u=
|
||||
p 2+ q= deek v=
|
||||
u+ p:
|
||||
{p[1] -= p[0]/256}
|
||||
p 1+ peek 128^ 128- u= {Sign extend}
|
||||
v u- q:
|
||||
|
||||
p 4+ p= {Next point}
|
||||
i 1- if>0loop]
|
||||
loop]
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,138 @@
|
||||
|
||||
|
||||
GPU instruction pair <= 148 cycles:
|
||||
setup
|
||||
(burst)
|
||||
clean
|
||||
|
||||
Pixel burst (videoA,B and/or C)
|
||||
|
||||
CopperSetup
|
||||
Burst Burst Burst Burst
|
||||
CopperClean CopperSetup
|
||||
Burst Burst Burst Burst
|
||||
CopperClean
|
||||
|
||||
Setup:
|
||||
; Overhead
|
||||
ld [videoY],x ; Find out page from video indirection table
|
||||
ld $01,y
|
||||
ls [y,x]
|
||||
st [vTmp],y
|
||||
|
||||
; Object
|
||||
ld [y,$a0] ; X position of object
|
||||
ld ac,x
|
||||
|
||||
; Pixel 1
|
||||
ld [y,x] ; Preserve background
|
||||
st [y,$a1]
|
||||
ld [y,$a2] ; Display object
|
||||
st [y,x++]
|
||||
|
||||
Clean:
|
||||
; Overhead
|
||||
ld [vTmp],y ; XXX is this untouched by the video loop?
|
||||
|
||||
ld [y,$a0] ; X position of object
|
||||
ld ac,x
|
||||
ld [y,$a1] ; Restore background
|
||||
st [y,x++]
|
||||
|
||||
Object costs: 4 cycles
|
||||
Pixel costs: 6 cycles
|
||||
|
||||
5 pixel object: 34 cycles -> 4 objects (ghosts!), 10 cycles for overhead sounds ok
|
||||
6 pixel object: 40 cycles -> 3 objects (boring)
|
||||
|
||||
Eg. 4 objects of 6 pixels
|
||||
|
||||
148/4 = 37
|
||||
|
||||
- # # # - - - - - -
|
||||
# O # O # - - - - -
|
||||
# # # # # - - X - -
|
||||
# # # # # - - - - -
|
||||
# - # - # - - - - -
|
||||
|
||||
- O O O -
|
||||
O O # O O
|
||||
O O O O O
|
||||
O O O O O
|
||||
- O O O -
|
||||
|
||||
- O O O -
|
||||
O O # O O
|
||||
- O O O O
|
||||
O O O O O
|
||||
- O O O -
|
||||
|
||||
O O O O -
|
||||
- O # O O
|
||||
- - O O O
|
||||
- O O O O
|
||||
O O O O -
|
||||
|
||||
Because most lines have no sprites, there is a lot of wasted CPU time.
|
||||
These kind of sprites are better done in vertical blank.
|
||||
|
||||
|
||||
But here's an idea for a cool screensaver:
|
||||
|
||||
Setup:
|
||||
ld [y,$a7]
|
||||
st [vTmp],x
|
||||
ld [y,$a8]
|
||||
adda sprite1
|
||||
bra [ac]
|
||||
sprite1 ld [y,$a0] ;Draw sprite 1
|
||||
st [y,x++]
|
||||
ld [y,$a1]
|
||||
st [y,x++]
|
||||
ld [y,$a2]
|
||||
st [y,x++]
|
||||
ld [y,$a3]
|
||||
st [y,x++]
|
||||
ld [y,$a4]
|
||||
st [y,x++]
|
||||
ld [y,$a5]
|
||||
st [y,x++]
|
||||
ld [y,$a6]
|
||||
st [y,x++]
|
||||
|
||||
ld [y,$a0]
|
||||
loop bne loop ;Resync
|
||||
suba 2
|
||||
|
||||
Clean:
|
||||
ld [vTmp],x
|
||||
|
||||
ld [x] ;Restore sprite 1
|
||||
st [y,x++]
|
||||
ld [x]
|
||||
st [y,x++]
|
||||
ld [x]
|
||||
st [y,x++]
|
||||
ld [x]
|
||||
st [y,x++]
|
||||
ld [x]
|
||||
st [y,x++]
|
||||
ld [x]
|
||||
st [y,x++]
|
||||
ld [x]
|
||||
st [y,x++]
|
||||
|
||||
With a background in 160 bytes in zero page, we have a vertical bars.
|
||||
Playing with videoTable[].dX gives us a blocky pattern!
|
||||
|
||||
7 pixel objects cost 8*4 = 32 cycles. We can have 4 objects <-- lets try this
|
||||
6 pixel objects cost 7*4 = 28 cycles. We can have 5 objects
|
||||
|
||||
But no alpha channel..
|
||||
Different ROM routine per shape?
|
||||
|
||||
ld [y,x]
|
||||
op [y,$a0]
|
||||
st [y,x++]
|
||||
|
||||
Maybe we don't need full screen frame buffer. 1 line is enough?
|
||||
@@ -0,0 +1,272 @@
|
||||
0200 20 21 11 a2 ff 9a 20 d6 10 a5 a2 85 a3 a5 a7 85 | !.... .........|
|
||||
0210 a8 a5 a1 09 80 85 a2 a5 a6 09 80 85 a7 a6 b4 a5 |................|
|
||||
0220 c7 85 b4 86 c7 e6 bf 20 fa 02 ae 04 a0 86 b2 20 |....... ....... |
|
||||
0230 ae 0e 20 da 0e a5 96 30 03 4c 09 03 20 1c 10 20 |.. ....0.L.. .. |
|
||||
0240 42 0c a5 d8 0a 18 65 b1 0a 0a 0a 85 c9 a9 00 85 |B.....e.........|
|
||||
0250 b5 85 c5 a9 0a a6 b4 e0 1a b0 28 e6 b5 a4 c6 d0 |..........(.....|
|
||||
0260 0e a8 c8 8a 18 65 c7 c9 32 98 b0 03 18 69 02 a4 |.....e..2....i..|
|
||||
0270 cb f0 04 a4 c3 d0 0c e0 0b 90 06 a6 c7 e0 0b b0 |................|
|
||||
0280 02 69 02 85 8d 78 a5 82 c5 80 a5 83 e5 81 58 b0 |.i...x........X.|
|
||||
0290 0b a9 80 85 c5 a5 8d 38 e9 03 85 8d a2 0e 86 94 |.......8........|
|
||||
02a0 a2 07 86 95 ad 11 a4 85 c0 a9 00 8d 11 a4 20 13 |.............. .|
|
||||
02b0 ea 20 df 03 20 f3 10 a5 c0 8d 11 a4 a6 9d a4 9e |. .. ...........|
|
||||
02c0 a5 89 d0 03 4c 3c 03 e0 00 d0 07 c0 39 d0 03 4c |....L<......9..L|
|
||||
02d0 50 03 a5 96 85 a1 a5 97 85 a6 85 b6 a5 98 85 90 |P...............|
|
||||
02e0 85 be 20 a6 0b 20 13 ea a5 bf 4a 20 46 ea 20 3e |.. .. ....J F. >|
|
||||
02f0 e8 20 8c 03 20 3e e8 4c 06 02 20 93 e9 c9 0d d0 |. .. >.L.. .....|
|
||||
0300 05 a9 ff 85 96 60 4c 54 03 a9 c5 85 94 a9 0e 85 |.....`LT........|
|
||||
0310 95 a9 00 85 ca 85 b9 20 98 04 a5 ca d0 03 4c 81 |....... ......L.|
|
||||
0320 03 a5 96 85 a1 a5 97 85 a6 a5 98 85 90 85 be 20 |............... |
|
||||
0330 13 ea 20 a6 0b a5 a6 85 b6 4c 06 02 e0 00 d0 08 |.. ......L......|
|
||||
0340 c0 dd d0 04 a2 05 d0 02 a2 11 20 7f 0f 4c a1 e1 |.......... ..L..|
|
||||
0350 a2 1d d0 f6 20 62 03 85 96 20 5f 03 85 97 60 20 |.... b... _...` |
|
||||
0360 93 e9 38 e9 41 90 1a c9 08 b0 16 85 b8 20 93 e9 |..8.A........ ..|
|
||||
0370 38 e9 31 90 0c c9 08 b0 08 49 07 0a 0a 0a 05 b8 |8.1......I......|
|
||||
0380 60 a2 03 20 7f 0f a2 ff 9a 4c 27 02 a5 96 20 93 |`.. .....L'... .|
|
||||
0390 03 a5 97 48 29 07 18 69 41 20 7a e9 68 4a 4a 4a |...H)..iA z.hJJJ|
|
||||
03a0 49 07 18 69 31 4c 7a e9 a5 d7 f0 33 a2 85 86 94 |I..i1Lz....3....|
|
||||
03b0 a2 0f 86 95 a4 bb a9 00 91 d5 85 d7 a6 a6 e8 8a |................|
|
||||
03c0 ca 29 3f 85 ba 20 e9 0b 20 9a 04 20 e9 0b a2 0e |.)?.. .. .. ....|
|
||||
03d0 86 94 a2 07 86 95 a4 bb b1 d5 d0 03 c6 d7 60 a5 |..............`.|
|
||||
03e0 d1 85 d0 a5 8b 18 69 03 c5 8d 90 0a a5 b9 c9 c7 |......i.........|
|
||||
03f0 f0 04 a5 b3 30 2d a9 16 85 94 a9 05 85 95 a0 3f |....0-.........?|
|
||||
0400 a9 00 91 d5 b9 00 00 29 bf 99 00 00 88 10 f1 20 |.......)....... |
|
||||
0410 88 04 a9 0e 85 94 a9 07 85 95 a6 9a e0 39 d0 03 |.............9..|
|
||||
0420 4c ee 04 a2 00 86 b9 86 da ca 86 bb a5 cf f0 07 |L...............|
|
||||
0430 a6 b3 e8 30 53 10 04 a5 b3 30 4d a5 8e 29 07 c9 |...0S....0M..)..|
|
||||
0440 06 f0 0d c9 03 90 09 a6 a4 bd 90 13 a6 8f f0 02 |................|
|
||||
0450 a9 05 85 c1 a2 88 86 94 a2 0f 86 95 20 e9 0b a6 |............ ...|
|
||||
0460 a7 e8 8a 29 3f 85 ba 20 98 04 20 e9 0b a2 0e 86 |...)?.. .. .....|
|
||||
0470 94 a2 07 86 95 a5 da f0 0a a9 00 a6 b9 e0 39 f0 |..............9.|
|
||||
0480 02 a9 f0 38 e5 b9 85 b9 a2 00 86 99 a2 c7 86 9a |...8............|
|
||||
0490 a6 d0 86 ba a2 00 86 89 a6 ba b5 00 f0 0b 85 8e |................|
|
||||
04a0 29 08 c5 88 d0 03 4c 56 05 e8 8a 29 3f aa e4 ba |).....LV...)?...|
|
||||
04b0 d0 e8 a5 89 d0 38 e6 89 a2 24 86 94 a2 05 86 95 |.....8...$......|
|
||||
04c0 20 e9 0b 20 98 04 20 e9 0b a2 0e 86 94 a2 07 86 | .. .. .........|
|
||||
04d0 95 a2 00 86 89 a6 9d a4 9e e0 00 d0 0b c0 39 d0 |..............9.|
|
||||
04e0 07 a2 00 a0 d8 4c f2 04 20 42 0c 4c f2 04 a6 99 |.....L.. B.L....|
|
||||
04f0 a4 9a 86 9d 84 9e 24 9e 10 1b 98 4a 66 9d 4a 66 |......$....Jf.Jf|
|
||||
0500 9d 4a 66 9d 09 e0 a8 8a 38 e5 9d 85 9d a5 9e 84 |.Jf.....8.......|
|
||||
0510 9e e5 9e 85 9e 60 e6 89 a5 a7 29 3f c5 a6 d0 04 |.....`....)?....|
|
||||
0520 a5 a1 85 d0 a5 8f 29 07 c9 06 d0 03 4c 28 07 60 |......).....L(.`|
|
||||
0530 0d 0a 00 3f 00 20 49 4b 20 53 54 41 20 4d 41 54 |...?. IK STA MAT|
|
||||
0540 00 20 49 4b 20 53 54 41 20 50 41 54 00 20 49 4b |. IK STA PAT. IK|
|
||||
0550 20 57 49 4e 21 00 a5 8e 29 07 0a 0a 0a 0a 18 69 | WIN!...)......i|
|
||||
0560 0f 85 a5 a9 0f 85 a4 86 a1 a6 a5 bd 00 13 f0 0a |................|
|
||||
0570 10 13 49 ff 85 a5 29 0f 85 a4 c6 a5 c6 a4 10 e9 |..I...).........|
|
||||
0580 a6 a1 4c a9 04 85 90 29 0f 85 91 a5 c8 c5 8a 90 |..L....)........|
|
||||
0590 04 a9 00 85 c8 a4 a1 c4 a8 d0 15 a5 8e 29 07 c9 |.............)..|
|
||||
05a0 05 d0 08 a5 c8 d0 09 a5 8a 85 c8 a9 02 4c b2 05 |.............L..|
|
||||
05b0 a9 00 85 a9 98 29 07 85 92 45 a1 85 93 a6 a4 a5 |.....)...E......|
|
||||
05c0 92 18 7d 70 13 85 92 29 f8 d0 af a5 93 18 7d 80 |..}p...)......}.|
|
||||
05d0 13 85 93 29 c7 d0 a3 a5 92 05 93 85 a6 aa b5 00 |...)............|
|
||||
05e0 85 8f a6 94 e0 0e f0 73 e0 c5 f0 6f a5 90 29 10 |.......s...o..).|
|
||||
05f0 d0 69 a0 01 a5 8e 29 07 c9 02 b0 1a a6 a6 b5 00 |.i....).........|
|
||||
0600 f0 14 48 09 40 95 00 68 29 40 d0 08 a5 8f 29 07 |..H.@..h)@....).|
|
||||
0610 c9 02 b0 02 a0 03 84 b8 a6 94 a4 a6 b1 d5 e0 88 |................|
|
||||
0620 d0 06 18 65 b8 4c 2b 06 38 e5 b8 91 d5 a5 8f 29 |...e.L+.8......)|
|
||||
0630 08 c5 88 d0 26 45 8f 0a 0a 0a 0a c9 60 f0 1c 18 |....&E......`...|
|
||||
0640 65 a4 aa bd 00 13 f0 13 30 11 c6 91 f0 22 85 90 |e.......0...."..|
|
||||
0650 29 0f c5 91 b0 02 85 91 4c bd 05 a4 a9 a5 8f d0 |).......L.......|
|
||||
0660 09 a9 20 24 90 f0 13 4c e3 06 29 08 c5 88 d0 03 |.. $...L..).....|
|
||||
0670 4c 7a 05 c8 a9 10 24 90 d0 f6 98 a4 a6 c4 a2 d0 |Lz....$.........|
|
||||
0680 02 09 04 c4 a3 d0 02 09 08 c4 a7 d0 02 09 10 85 |................|
|
||||
0690 a9 20 0b 07 a5 a9 4a b0 1d c6 91 d0 0e e6 91 a5 |. ....J.........|
|
||||
06a0 a5 a4 93 c9 03 d0 07 c0 28 d0 0b 4c bd 05 c9 11 |........(..L....|
|
||||
06b0 d0 07 c0 10 f0 f5 4c 7a 05 a5 90 29 40 f0 f7 a5 |......Lz...)@...|
|
||||
06c0 8e 10 f3 a5 b9 c9 c7 f0 ed 20 2d 0c b5 00 10 e6 |......... -.....|
|
||||
06d0 8a 49 01 aa b5 00 d0 de a5 90 29 bf 09 90 85 90 |.I........).....|
|
||||
06e0 4c bd 05 c8 a5 a7 29 7f aa b5 00 45 8e c9 09 d0 |L.....)....E....|
|
||||
06f0 c5 a5 a2 18 65 a7 4a aa 45 a2 29 07 d0 b8 e4 a6 |....e.J.E.).....|
|
||||
0700 d0 b4 a5 90 09 88 85 90 4c 7a 06 6c 94 00 a5 8f |........Lz.l....|
|
||||
0710 29 07 c9 06 f0 12 a5 be 29 88 c9 80 d0 15 a5 a2 |).......).......|
|
||||
0720 18 65 a7 4a c5 a6 d0 0b a2 00 a0 39 86 99 84 9a |.e.J.......9....|
|
||||
0730 4c 35 0a a5 a3 29 3f c5 a6 d0 25 a5 a8 29 3f c5 |L5...)?...%..)?.|
|
||||
0740 a1 d0 1d ba bd 05 01 29 3f c5 a2 d0 13 bd 06 01 |.......)?.......|
|
||||
0750 29 3f c5 a7 d0 0a 20 42 0c 86 9b 84 9c 4c ea 09 |)?.... B.....L..|
|
||||
0760 a5 8a d0 03 20 f3 10 a9 00 85 d2 85 cf 85 d7 a6 |.... ...........|
|
||||
0770 8a e4 d9 b0 02 85 d9 a5 b9 c9 c7 d0 03 4c 33 08 |.............L3.|
|
||||
0780 a5 8e 20 8c 0c d0 1f a4 93 c0 08 f0 04 c0 30 d0 |.. ...........0.|
|
||||
0790 15 a6 d9 d0 11 a6 8a e8 86 d9 a5 8e 09 10 a4 a1 |................|
|
||||
07a0 99 00 00 4c c1 09 aa bd e8 13 a6 a6 35 40 f0 5e |...L........5@.^|
|
||||
07b0 a6 a7 b5 00 29 07 c9 06 d0 06 a5 b5 d0 02 e6 d2 |....)...........|
|
||||
07c0 a6 b3 e8 30 49 e6 cf a5 8e 29 07 c9 02 f0 21 a5 |...0I....)....!.|
|
||||
07d0 b5 f0 1d ba bd 14 01 c9 c7 d0 33 bd 16 01 c5 a1 |..........3.....|
|
||||
07e0 d0 0e a4 a4 b9 70 13 18 79 80 13 dd 17 01 d0 1e |.....p..y.......|
|
||||
07f0 a4 a6 a6 b3 10 0c b1 d5 c9 ff d0 06 a6 a6 e4 a2 |................|
|
||||
0800 f0 0c b1 d5 10 08 a5 a9 09 01 aa 4c 10 08 a6 a9 |...........L....|
|
||||
0810 a5 8b 18 7d a0 13 c5 8d b0 03 4c c3 09 a5 b9 c9 |...}......L.....|
|
||||
0820 c7 d0 08 a6 b3 e8 10 2b 4c 34 0a a6 b3 30 45 c9 |.......+L4...0E.|
|
||||
0830 f1 30 1a a5 bb 30 3d c5 a1 f0 12 a5 bc 29 3f c5 |.0...0=......)?.|
|
||||
0840 a6 f0 0a 18 65 bd c5 bb d0 f5 4c 6b 08 a5 b9 c9 |....e.....Lk....|
|
||||
0850 c7 f0 bb c6 b3 20 95 0c a5 8b 20 45 0a e6 b3 a5 |..... .... E....|
|
||||
0860 d7 10 05 e6 d7 4c f8 08 4c d1 09 a5 b9 c9 c7 d0 |.....L..L.......|
|
||||
0870 06 4c 34 0a 4c f8 08 a5 bc 10 7d a4 bb a5 8e 29 |.L4.L.....}....)|
|
||||
0880 07 aa c9 02 90 06 b1 d5 c9 01 d0 6c 98 29 07 38 |...........l.).8|
|
||||
0890 e5 92 85 b8 f0 4a 98 38 e5 93 4a 4a 4a f0 41 85 |.....J.8..JJJ.A.|
|
||||
08a0 ae 29 10 f0 02 a9 e0 05 ae a8 c5 b8 f0 36 18 65 |.)...........6.e|
|
||||
08b0 b8 f0 31 e0 02 d0 41 a2 0a 86 b8 a5 b6 48 a5 a6 |..1...A......H..|
|
||||
08c0 85 b6 a5 bb 20 3c 0f aa 68 85 b6 e4 b8 b0 29 4c |.... <..h.....)L|
|
||||
08d0 53 08 8a 0a 38 e9 01 84 b8 c5 b8 d0 1b 4c 53 08 |S...8........LS.|
|
||||
08e0 a9 04 d0 06 e0 02 90 ea a9 02 3d e8 13 f0 05 e6 |..........=.....|
|
||||
08f0 d7 4c 53 08 e0 06 f0 c1 a5 c3 f0 4a a5 a8 c5 a1 |.LS........J....|
|
||||
0900 d0 07 a5 8e 20 8c 0c f0 46 a6 a7 20 8a 0c d0 36 |.... ...F.. ...6|
|
||||
0910 a5 8e 29 07 c9 06 f0 06 c9 03 b0 2a d0 23 a5 b6 |..)........*.#..|
|
||||
0920 48 a5 a7 0a 38 e5 a2 85 b6 a5 a6 20 3c 0f 85 b8 |H...8...... <...|
|
||||
0930 a5 a7 85 b6 a5 a1 20 3c 0f aa 68 85 b6 e4 b8 b0 |...... <..h.....|
|
||||
0940 33 a0 f8 4c 89 09 a5 8e 20 8c 0c d0 29 a5 93 f0 |3..L.... ...)...|
|
||||
0950 70 c9 38 f0 6c a5 92 f0 1d c9 07 f0 19 a5 88 49 |p.8.l..........I|
|
||||
0960 08 0a 38 e9 08 18 65 a6 aa ca 20 b3 10 90 07 e8 |..8...e... .....|
|
||||
0970 e8 20 b3 10 b0 4b a6 8a e4 d9 f0 45 a5 90 10 07 |. ...K.....E....|
|
||||
0980 a4 b9 a2 0f 4c 59 07 a4 b9 a6 d2 f0 07 a6 c6 f0 |....LY..........|
|
||||
0990 01 c8 a2 c0 a5 b3 30 26 84 b8 86 ae a4 a6 a5 8f |......0&........|
|
||||
09a0 20 8d 0e f0 15 18 65 b8 85 b8 b1 d5 30 0c a5 8e | .....e.....0...|
|
||||
09b0 20 8d 0e 49 ff 38 65 b8 85 b8 a4 b8 a6 ae 4c 59 | ..I.8e.......LY|
|
||||
09c0 07 a5 8b 48 20 95 0c 68 20 45 0a a6 a1 a5 8e 95 |...H ..h E......|
|
||||
09d0 00 a6 9d a4 9e e0 00 d0 04 c0 39 f0 57 38 a5 9b |..........9.W8..|
|
||||
09e0 e5 9d 85 9b a5 9c e5 9e 85 9c e6 89 a5 9b a4 9c |................|
|
||||
09f0 c4 9a 30 40 d0 06 c5 99 90 3a f0 38 85 99 84 9a |..0@.....:.8....|
|
||||
0a00 c4 a0 30 06 d0 2f c5 9f b0 2b a5 b9 c9 c7 f0 14 |..0../...+......|
|
||||
0a10 c9 f1 10 09 18 69 10 c5 9c 10 09 85 b9 98 30 04 |.....i........0.|
|
||||
0a20 a9 ff 85 bb a5 8a d0 0c a5 a6 85 97 a5 a1 85 96 |................|
|
||||
0a30 a5 90 85 98 60 68 68 a5 a1 85 d1 4c ee 04 a2 00 |....`hh....L....|
|
||||
0a40 86 9d 86 9e 60 a4 8a c8 c4 8c b0 f2 85 b8 c0 02 |....`...........|
|
||||
0a50 90 36 ba bd 10 01 38 fd 12 01 85 ac bd 0f 01 fd |.6....8.........|
|
||||
0a60 11 01 85 ad 10 16 a6 ac 4a 66 ac 4a 66 ac 09 c0 |........Jf.Jf...|
|
||||
0a70 48 8a 18 65 ac 85 ac 68 65 ad 85 ad c5 9a 30 08 |H..e...he.....0.|
|
||||
0a80 d0 0e a5 ac c5 99 b0 08 a5 99 85 ac a5 9a 85 ad |................|
|
||||
0a90 a5 9b 38 e5 ac 85 ac a5 9c e5 ad 85 ad a6 b8 a5 |..8.............|
|
||||
0aa0 b3 10 15 a5 c3 05 cf d0 0f 8a 18 69 04 c5 8d 90 |...........i....|
|
||||
0ab0 07 a5 ad 10 03 4c 3e 0a 84 8a a5 8b 48 86 8b 20 |.....L>.....H.. |
|
||||
0ac0 a6 0b a5 d5 18 69 40 85 d5 90 02 e6 d6 a6 a6 a4 |.....i@.........|
|
||||
0ad0 a1 20 08 10 a5 ba 48 a5 bd 48 a5 bc 48 a5 bb 48 |. ....H..H..H..H|
|
||||
0ae0 a5 b9 48 a5 be 48 a5 90 85 be a5 a5 48 a5 a9 48 |..H..H......H..H|
|
||||
0af0 a5 9f 48 a5 a0 48 a5 9b 48 a5 ac 85 9f a5 9c 48 |..H..H..H......H|
|
||||
0b00 a5 ad 85 a0 a5 99 48 a5 9a 48 a5 89 48 a5 91 48 |......H..H..H..H|
|
||||
0b10 a5 8e 48 a5 8f 48 a5 a3 48 a5 a2 85 a3 a5 a1 85 |..H..H..H.......|
|
||||
0b20 a2 a5 a8 48 a5 a7 85 a8 a5 a6 85 a7 20 a8 03 a5 |...H........ ...|
|
||||
0b30 a7 85 a6 29 07 85 92 45 a6 85 93 a5 a8 85 a7 68 |...)...E.......h|
|
||||
0b40 85 a8 a5 a2 85 a1 a5 a3 85 a2 68 85 a3 68 85 8f |..........h..h..|
|
||||
0b50 68 85 8e 68 85 91 68 85 89 68 85 9a 68 85 99 68 |h..h..h..h..h..h|
|
||||
0b60 85 9c 68 85 9b 68 85 a0 68 85 9f 68 85 a9 68 85 |..h..h..h..h..h.|
|
||||
0b70 a5 29 0f 85 a4 a5 be 85 90 68 85 be 68 85 b9 68 |.).......h..h..h|
|
||||
0b80 85 bb 68 85 bc 68 85 bd 68 85 ba a5 d5 38 e9 40 |..h..h..h....8.@|
|
||||
0b90 85 d5 b0 02 c6 d6 20 f7 0b a6 a1 a4 a6 20 08 10 |...... ...... ..|
|
||||
0ba0 68 85 8b c6 8a 60 a5 90 10 1c 29 08 f0 0c a5 a7 |h....`....).....|
|
||||
0bb0 29 7f aa a9 00 95 00 4c c6 0b 20 2d 0c b5 00 99 |)......L.. -....|
|
||||
0bc0 00 00 a9 00 95 00 a6 a1 a4 a6 20 8a 0c d0 10 b5 |.......... .....|
|
||||
0bd0 00 29 1f c0 08 90 04 c0 38 90 04 09 05 29 ef 99 |.)......8....)..|
|
||||
0be0 00 00 20 c4 10 a9 00 95 00 a5 88 49 08 85 88 a9 |.. ........I....|
|
||||
0bf0 00 38 e5 c9 85 c9 60 a5 90 10 1f 29 08 f0 0e a5 |.8....`....)....|
|
||||
0c00 a7 29 7f aa a5 8e 49 09 95 00 4c 1a 0c 20 2d 0c |.)....I...L.. -.|
|
||||
0c10 b9 00 00 95 00 a9 00 99 00 00 a6 a6 a4 a1 a5 8f |................|
|
||||
0c20 95 00 a5 8e 99 00 00 20 c4 10 4c e9 0b a5 a1 18 |....... ..L.....|
|
||||
0c30 65 a6 4a a8 38 e5 a6 4a 29 07 45 a6 29 07 45 a6 |e.J.8..J).E.).E.|
|
||||
0c40 aa 60 a2 00 86 b0 86 b1 b5 00 86 ae 20 8d 0e a6 |.`.......... ...|
|
||||
0c50 ae b5 00 29 08 c5 88 d0 0e 38 a5 b0 e5 9b 85 b0 |...).....8......|
|
||||
0c60 a5 b1 e5 9c 4c 72 0c 18 a5 b0 65 9b 85 b0 a5 b1 |....Lr....e.....|
|
||||
0c70 65 9c 85 b1 e8 e0 40 d0 cf a6 b0 a4 b1 60 18 65 |e.....@......`.e|
|
||||
0c80 ad aa b5 00 29 08 c5 88 d0 0a b5 00 29 0f c9 08 |....).......)...|
|
||||
0c90 f0 02 c9 01 60 a5 90 10 43 29 08 f0 05 a9 01 4c |....`...C).....L|
|
||||
0ca0 de 0c a0 ff a5 a6 49 10 20 81 0c d0 02 c8 c8 8a |......I. .......|
|
||||
0cb0 49 18 20 81 0c d0 03 c8 c8 c8 e8 20 82 0c d0 01 |I. ........ ....|
|
||||
0cc0 c8 ca ca 20 82 0c d0 02 c8 c8 98 84 b8 0a 0a 18 |... ............|
|
||||
0cd0 65 b8 0a 85 b8 a9 00 85 9c 4c 56 0e a5 8f 20 8d |e........LV... .|
|
||||
0ce0 0e a5 8e 29 07 aa a9 00 e0 06 d0 1e a6 b5 f0 14 |...)............|
|
||||
0cf0 a5 a6 20 3c 0f 85 b8 a5 a1 20 3c 0f 38 e5 b8 0a |.. <..... <.8...|
|
||||
0d00 0a 4c 0e 0e 38 e9 14 4c 0e 0e e0 04 90 4c d0 3a |.L..8..L.....L.:|
|
||||
0d10 a6 8f d0 43 85 b8 a5 a1 45 a6 29 20 f0 10 a5 88 |...C....E.) ....|
|
||||
0d20 0a 0a 45 a6 29 20 f0 04 a9 19 d0 02 a9 e7 18 65 |..E.) .........e|
|
||||
0d30 b8 a8 a5 a1 29 07 aa 98 38 fd 80 16 a8 a5 a6 29 |....)...8......)|
|
||||
0d40 07 aa 98 18 7d 80 16 4c 57 0d e0 05 d0 09 a6 bf |....}..LW.......|
|
||||
0d50 e0 08 b0 03 38 e9 0f 4c 1a 0e e0 02 b0 a9 a6 d9 |....8..L........|
|
||||
0d60 ca e4 8a d0 02 e6 9c 18 69 0f a6 b5 f0 03 18 69 |........i......i|
|
||||
0d70 1e a6 88 f0 12 a6 cc b4 00 30 21 a6 a1 85 b8 b5 |.........0!.....|
|
||||
0d80 40 29 0e f0 19 d0 10 a6 cd b4 00 30 0f a6 a1 85 |@).........0....|
|
||||
0d90 b8 b5 40 29 e0 f0 07 a5 b8 38 e9 1e 85 b8 a5 a1 |..@).....8......|
|
||||
0da0 29 38 85 ad 45 a1 85 ac a5 ac 38 e9 02 30 05 20 |)8..E.....8..0. |
|
||||
0db0 7e 0c f0 07 a5 b8 38 e9 0f 85 b8 a5 ac 18 69 02 |~.....8.......i.|
|
||||
0dc0 c9 08 b0 05 20 7e 0c f0 07 a5 b8 38 e9 0f 85 b8 |.... ~.....8....|
|
||||
0dd0 a5 a6 38 e9 08 30 2e c5 a1 f0 0c 20 81 0c d0 07 |..8..0..... ....|
|
||||
0de0 38 a5 b8 e9 28 85 b8 a5 a6 18 69 08 c9 40 b0 15 |8...(.....i..@..|
|
||||
0df0 c5 a1 f0 0c 20 81 0c d0 07 38 a5 b8 e9 28 85 b8 |.... ....8...(..|
|
||||
0e00 a5 b8 4c 0e 0e a9 07 18 65 9c 85 9c a9 00 a6 a6 |..L.....e.......|
|
||||
0e10 18 7d c0 12 a6 a1 38 fd c0 12 85 b8 a5 a8 29 3f |.}....8.......)?|
|
||||
0e20 c5 a1 d0 13 a5 8e 29 07 c9 06 f0 0b c9 03 90 07 |......).........|
|
||||
0e30 a5 b8 38 e9 0f 85 b8 a5 88 0a 18 65 a6 38 e9 08 |..8........e.8..|
|
||||
0e40 a8 29 c0 d0 11 98 c5 a1 f0 0c 20 81 0c d0 07 a5 |.)........ .....|
|
||||
0e50 b8 38 e9 0f 85 b8 a5 b8 10 02 c6 9c a6 8f e0 02 |.8..............|
|
||||
0e60 90 10 e0 08 f0 0c 24 c9 10 02 e6 9c e5 c9 b0 02 |......$.........|
|
||||
0e70 c6 9c 85 9b a5 8a d0 14 a5 b2 18 69 27 85 b2 4a |...........i'..J|
|
||||
0e80 4a 4a 4a 18 65 9b 85 9b 90 02 e6 9c 60 29 1f c9 |JJJ.e.......`)..|
|
||||
0e90 0f 08 29 0f c9 08 d0 02 a9 01 29 07 0a aa bd c0 |..).......).....|
|
||||
0ea0 13 85 9b bd c1 13 28 90 02 a9 02 85 9c 60 a9 c2 |......(......`..|
|
||||
0eb0 85 94 a9 0e 85 95 20 94 04 a5 89 18 65 c7 6a 85 |...... .....e.j.|
|
||||
0ec0 c7 60 e6 89 60 a5 a1 c5 96 d0 0c a5 a6 c5 97 d0 |.`..`...........|
|
||||
0ed0 06 a5 90 85 98 e6 ca e6 89 60 a0 3f a9 01 85 c3 |.........`.?....|
|
||||
0ee0 a9 00 85 c6 85 cb 85 d8 a2 07 9d 80 16 ca 10 fa |................|
|
||||
0ef0 b9 00 00 f0 43 29 07 c9 06 d0 09 b9 00 00 20 c4 |....C)........ .|
|
||||
0f00 10 4c 38 0f c9 02 f0 20 b0 12 e6 cb 98 29 07 aa |.L8.... .....)..|
|
||||
0f10 bd 80 16 38 e9 0c 9d 80 16 4c 38 0f a2 00 86 c3 |...8.....L8.....|
|
||||
0f20 c9 05 d0 04 a2 01 86 c6 b9 00 00 29 08 c5 88 d0 |...........)....|
|
||||
0f30 05 c6 d8 4c 38 0f e6 d8 88 10 b5 60 20 67 0f 86 |...L8......` g..|
|
||||
0f40 ac 84 ad a5 b6 20 67 0f 8a 38 e5 ac 20 71 0f 85 |..... g..8.. q..|
|
||||
0f50 ae 98 38 e5 ad 20 71 0f c5 ae 10 05 aa a5 ae 86 |..8.. q.........|
|
||||
0f60 ae 0a 0a 18 65 ae 60 48 29 07 aa 68 4a 4a 4a a8 |....e.`H)..hJJJ.|
|
||||
0f70 60 c9 00 10 05 49 ff 18 69 00 60 20 7a e9 e8 bd |`....I..i.` z...|
|
||||
0f80 30 05 d0 f7 60 e6 89 60 a5 8f f0 7b 29 07 c9 06 |0...`..`...{)...|
|
||||
0f90 f0 25 a6 a4 bd 90 13 c5 c1 f0 6c ba bd 16 01 c9 |.%........l.....|
|
||||
0fa0 c7 f0 14 bd 13 01 4a f0 02 b0 0c a5 a9 29 04 d0 |......J......)..|
|
||||
0fb0 06 a6 a1 e4 a7 d0 50 a5 8e 29 0f aa bd e8 13 a4 |......P..)......|
|
||||
0fc0 a6 39 40 00 f0 06 b1 d5 30 02 f0 00 a5 8f f0 37 |.9@.....0......7|
|
||||
0fd0 20 8d 0e 85 b8 a5 8e 20 8d 0e c5 b8 a9 00 90 0a | ...... ........|
|
||||
0fe0 a4 a6 b1 d5 f0 21 30 1f a9 80 a6 b8 e4 b9 30 17 |.....!0.......0.|
|
||||
0ff0 f0 15 86 b9 05 a1 85 bc a6 a4 bd 70 13 18 7d 80 |...........p..}.|
|
||||
1000 13 85 bd a6 a6 86 bb 60 b5 40 29 ee f0 03 4c 1c |.......`.@)...L.|
|
||||
1010 10 b9 40 00 29 ee f0 03 4c 25 10 60 a2 3f a9 00 |..@.)...L%.`.?..|
|
||||
1020 95 40 ca 10 fb a4 cc a9 01 20 5a 10 a4 cd a9 10 |.@....... Z.....|
|
||||
1030 20 5a 10 a2 07 a4 cc a9 02 20 86 10 a4 cd a9 20 | Z....... ..... |
|
||||
1040 20 86 10 ca e0 04 b0 ed a4 cc a9 04 20 86 10 a4 | ........... ...|
|
||||
1050 cd a9 40 20 86 10 ca 10 ef 60 84 b8 85 ce a0 07 |..@ .....`......|
|
||||
1060 a5 b8 18 79 e0 13 30 1a aa c9 40 b0 15 45 b8 29 |...y..0...@..E.)|
|
||||
1070 04 f0 09 a5 b8 59 e0 13 29 04 d0 06 b5 40 05 ce |.....Y..)....@..|
|
||||
1080 95 40 88 10 db 60 85 ce 98 84 b8 18 7d d8 13 30 |.@...`......}..0|
|
||||
1090 21 a8 c9 40 b0 1c 45 b8 29 04 f0 09 a5 b8 5d d8 |!..@..E.).....].|
|
||||
10a0 13 29 04 d0 0d b9 40 00 05 ce 99 40 00 b9 00 00 |.)....@....@....|
|
||||
10b0 f0 d6 60 b5 00 29 08 c5 88 f0 07 b5 00 29 07 c9 |..`..).......)..|
|
||||
10c0 02 60 18 60 29 0f c9 06 d0 05 84 cd 4c d5 10 c9 |.`.`).......L...|
|
||||
10d0 0e d0 02 84 cc 60 a2 03 a5 82 18 69 78 85 82 90 |.....`.....ix...|
|
||||
10e0 02 e6 83 78 b5 80 48 b5 84 95 80 68 95 84 ca 10 |...x..H....h....|
|
||||
10f0 f3 58 60 20 13 ea a5 89 20 46 ea 20 3e e8 a5 a1 |.X` .... F. >...|
|
||||
1100 a6 a6 20 42 ea 20 3e e8 a5 9a a6 99 20 42 ea 20 |.. B. >..... B. |
|
||||
1110 3e e8 a5 8d 20 46 ea 20 3e e8 ad ff 16 20 46 ea |>... F. >.... F.|
|
||||
1120 60 a2 00 d8 86 b3 86 8a 86 8b 86 be 86 c3 86 ba |`...............|
|
||||
1130 86 d1 86 d5 ca 86 a1 86 a3 86 a6 86 a8 a2 01 86 |................|
|
||||
1140 bf a2 09 86 8c a2 09 86 8d a2 08 86 88 a2 00 86 |................|
|
||||
1150 9f a2 39 86 a0 a2 40 86 b4 86 c7 a2 14 86 d6 a2 |..9...@.........|
|
||||
1160 07 bd d0 13 09 80 95 00 09 08 95 38 a9 81 95 08 |...........8....|
|
||||
1170 a9 88 95 30 a9 00 95 10 95 18 95 20 95 28 95 80 |...0....... .(..|
|
||||
1180 ca 10 de a2 07 86 83 86 87 58 60 00 00 00 00 00 |.........X`.....|
|
||||
1190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|
||||
11a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|
||||
11b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|
||||
11c0 00 03 0a 0f 0f 0a 03 00 05 14 19 1c 1c 1e 14 05 |................|
|
||||
11d0 0a 1e 2a 2d 2d 2a 1e 0a 0f 23 2d 32 32 2d 23 0f |..*--*...#-22-#.|
|
||||
11e0 0f 23 2d 32 32 2d 23 0f 0a 1e 2a 2d 2d 2a 1e 0a |.#-22-#...*--*..|
|
||||
11f0 05 14 19 1c 1c 1e 14 05 00 03 0a 0f 0f 0a 03 00 |................|
|
||||
1200 00 00 ff 11 00 fb 21 21 00 00 00 00 00 00 00 f7 |......!!........|
|
||||
1210 00 11 00 ed 21 21 00 00 00 00 00 00 00 00 00 e9 |....!!..........|
|
||||
1220 00 00 00 00 00 00 00 df 01 01 01 01 01 01 01 01 |................|
|
||||
1230 00 00 00 cf 07 07 07 07 00 00 00 00 00 00 00 c7 |................|
|
||||
1240 07 07 07 07 00 00 00 00 00 00 00 00 00 00 00 bb |................|
|
||||
1250 07 07 07 07 07 07 07 07 00 00 00 00 00 00 00 a7 |................|
|
||||
1260 41 01 41 01 01 01 01 01 00 00 00 00 00 00 00 97 |A.A.............|
|
||||
1270 01 00 ff 00 01 ff ff 01 02 01 ff fe fe ff 01 02 |................|
|
||||
1280 00 08 00 f8 08 08 f8 f8 08 10 10 08 f8 f0 f0 f8 |................|
|
||||
1290 00 01 00 01 02 03 02 03 04 04 04 04 04 04 04 04 |................|
|
||||
12a0 04 03 04 00 04 00 04 00 04 00 04 00 04 00 04 00 |................|
|
||||
12b0 08 00 08 00 08 00 08 00 08 00 08 00 08 00 08 00 |................|
|
||||
12c0 00 00 00 01 00 03 00 03 00 05 00 09 00 39 00 00 |.............9..|
|
||||
12d0 04 02 03 05 06 03 02 04 01 08 ff f8 09 07 f7 f9 |................|
|
||||
12e0 0a 11 0f 06 f6 ef f1 fa 00 00 01 02 04 06 00 00 |................|
|
||||
12f0 00 00 10 20 40 60 00 00 00 00 00 db 11 8b 13 f8 |... @`..........|
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,133 @@
|
||||
|
||||
/*
|
||||
* Bindings for ROM v1
|
||||
* XXX: check all numbers as they are hand typed
|
||||
*
|
||||
* Serious attempts should be made to keep all of these stable accross
|
||||
* ROM versions. The location of embedded programs, application data and
|
||||
* application-specific SYS extensions are not part of the defined
|
||||
* bindings and are therefore free to change.
|
||||
*
|
||||
*/
|
||||
|
||||
enum ROMv1bindings {
|
||||
/*
|
||||
* ROM version/type identifier. There is no real scheme yet.
|
||||
* Suggest to use 0 for home-grown ROMs.
|
||||
*/
|
||||
romTypeROMv1 = 0x001c,
|
||||
|
||||
/* Zero page */
|
||||
memSize = 0x0001,
|
||||
bootCount = 0x0004,
|
||||
bootCheck = 0x0005,
|
||||
entropy = 0x0006,
|
||||
videoY = 0x0009,
|
||||
frameCount = 0x000e,
|
||||
serialRaw = 0x000f,
|
||||
buttonState = 0x0011,
|
||||
xout = 0x0013,
|
||||
xoutMask = 0x0014,
|
||||
vPC = 0x0016,
|
||||
vAC = 0x0018,
|
||||
vLR = 0x001a,
|
||||
vSP = 0x001c,
|
||||
romType = 0x0021,
|
||||
sysFn = 0x0022,
|
||||
sysArgs = 0x0024,
|
||||
soundTimer = 0x002c,
|
||||
ledTimer = 0x002d,
|
||||
ledState = 0x002e,
|
||||
ledTempo = 0x002f,
|
||||
vars = 0x0030,
|
||||
|
||||
/* Main memory */
|
||||
videoTable = 0x0100,
|
||||
vReset = 0x01f0,
|
||||
vCpuStart = 0x0200,
|
||||
soundTable = 0x0700,
|
||||
screenPages = 0x0800,
|
||||
|
||||
/* Sound channels */
|
||||
channel1 = 0x01fa,
|
||||
channel2 = 0x02fa,
|
||||
channel3 = 0x03fa,
|
||||
channel4 = 0x04fa,
|
||||
|
||||
/* Sound channel structure */
|
||||
wavA = 250,
|
||||
wavX = 251,
|
||||
keyL = 252,
|
||||
keyH = 253,
|
||||
oscL = 254,
|
||||
oscH = 255,
|
||||
|
||||
/* vCPU byte codes */
|
||||
LDWI = 0x11,
|
||||
LD = 0x1a,
|
||||
LDW = 0x21,
|
||||
STW = 0x2b,
|
||||
BCC = 0x35,
|
||||
EQ = 0x3f,
|
||||
GT = 0x4d,
|
||||
LT = 0x50,
|
||||
GE = 0x53,
|
||||
LE = 0x56,
|
||||
LDI = 0x59,
|
||||
ST = 0x5e,
|
||||
NE = 0x72,
|
||||
PUSH = 0x75,
|
||||
LUP = 0x7f,
|
||||
ANDI = 0x82,
|
||||
ORI = 0x88,
|
||||
XORI = 0x8c,
|
||||
BRA = 0x90,
|
||||
INC = 0x93,
|
||||
ADDW = 0x99,
|
||||
PEEK = 0xad,
|
||||
SYS = 0xb4,
|
||||
SUBW = 0xb8,
|
||||
DEF = 0xcd,
|
||||
CALL = 0xcf,
|
||||
ALLOC = 0xdf,
|
||||
ADDI = 0xe3,
|
||||
SUBI = 0xe6,
|
||||
LSLW = 0xe9,
|
||||
STLW = 0xec,
|
||||
LDLW = 0xee,
|
||||
POKE = 0xf0,
|
||||
DOKE = 0xf3,
|
||||
DEEK = 0xf6,
|
||||
ANDW = 0xf8,
|
||||
ORW = 0xfa,
|
||||
XORW = 0xfc,
|
||||
RET = 0xff,
|
||||
|
||||
/* Core SYS extensions */
|
||||
SYS_Reset_36 = 0x009a,
|
||||
SYS_Exec_88 = 0x00ad,
|
||||
SYS_Out_22 = 0x00f4,
|
||||
SYS_In_24 = 0x00f9,
|
||||
SYS_NextByteIn = 0x02e9,
|
||||
SYS_Random_34 = 0x04a7,
|
||||
SYS_LSRW7_30 = 0x04b9,
|
||||
SYS_LSRW8_24 = 0x04c6,
|
||||
SYS_LSLW8_24 = 0x04cd,
|
||||
SYS_Draw4_30 = 0x04d4,
|
||||
SYS_VDrawBits_134 = 0x04e1,
|
||||
SYS_LSRW1_48 = 0x0600,
|
||||
SYS_LSRW2_52 = 0x0619,
|
||||
SYS_LSRW3_52 = 0x0636,
|
||||
SYS_LSRW4_50 = 0x0652,
|
||||
SYS_LSRW5_50 = 0x066d,
|
||||
SYS_LSRW6_48 = 0x0687,
|
||||
SYS_LSLW4_46 = 0x06a0,
|
||||
SYS_Read3_40 = 0x06b9,
|
||||
SYS_Unpack_56 = 0x06c0,
|
||||
SYS_PayloadCopy_34 = 0x06e7,
|
||||
|
||||
/* Built-in font */
|
||||
font32up = 0x0700,
|
||||
font82up = 0x0800,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bindings.h"
|
||||
#include "gcl.h"
|
||||
|
||||
#define null ((void*) 0)
|
||||
|
||||
/*----------------------------------------------------------------------+
|
||||
| Definitions |
|
||||
+----------------------------------------------------------------------*/
|
||||
|
||||
typedef enum {
|
||||
endType, openType, closeType, wordType, condType, loopType
|
||||
} WordType_t;
|
||||
|
||||
// Disected word
|
||||
struct word {
|
||||
char prefix; // optional
|
||||
char *name; // null in case of a number
|
||||
int number; // length in case of a name
|
||||
char operator[3]; // or a conditional
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------+
|
||||
| Variables |
|
||||
+----------------------------------------------------------------------*/
|
||||
|
||||
char *cursor;
|
||||
char *compileError;
|
||||
int blockDepth;
|
||||
|
||||
int base, offset, size;
|
||||
unsigned char page[256];
|
||||
|
||||
/*----------------------------------------------------------------------+
|
||||
| Internal functions |
|
||||
+----------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Get the next word skipping whitespace and nested comments.
|
||||
* Classify the word according to its structure.
|
||||
* Generate an error message if malformed.
|
||||
* Most work is done here already.
|
||||
*/
|
||||
static WordType_t nextWord(struct word *word)
|
||||
{
|
||||
#define hasMore\
|
||||
(isprint(*cursor) && !strchr("[{", *cursor))
|
||||
|
||||
#define error(s)\
|
||||
((compileError = (s)), -1)
|
||||
|
||||
memset(word, 0, sizeof *word);
|
||||
|
||||
// Whitespace
|
||||
while (1) {
|
||||
// Spaces or newlines
|
||||
if (strchr(" \n", *cursor) || strncmp("\r\n", cursor, 2)==0) {
|
||||
cursor++;
|
||||
continue;
|
||||
}
|
||||
// Comments
|
||||
if (*cursor == '{') {
|
||||
cursor++;
|
||||
int depth = 1;
|
||||
do {
|
||||
if (*cursor == 0) return error("Comment without end");
|
||||
if (!isprint(*cursor)) return error("Invalid byte");
|
||||
if (*cursor == '{') depth++;
|
||||
if (*cursor == '}') depth--;
|
||||
cursor++;
|
||||
} while (depth > 0);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// End of file/line
|
||||
if (*cursor == 0) return endType;
|
||||
|
||||
// Blocks
|
||||
if (*cursor == '[') return cursor++, openType;
|
||||
if (*cursor == ']') return cursor++, closeType;
|
||||
|
||||
// Prefix
|
||||
if (strchr("<>\\%", *cursor))
|
||||
word->prefix = *cursor++;
|
||||
|
||||
// Word or number
|
||||
char *s = strchr("-+", *cursor);
|
||||
char sign = s ? *cursor++ : 0;
|
||||
if (isdigit(*cursor)) {
|
||||
// Decimal number (ignore overflows)
|
||||
int n = 0;
|
||||
do {
|
||||
n = 10 * n + (*cursor - '0');
|
||||
cursor++;
|
||||
} while (isdigit(*cursor));
|
||||
word->number = (sign == '-') ? -n : n;
|
||||
} else if (*cursor == '$') {
|
||||
// Hexadecimal number (ignore overflows)
|
||||
int n = 0;
|
||||
s = ++cursor;
|
||||
while (1) {
|
||||
if (isdigit(*cursor))
|
||||
n = 16 * n + (*cursor - '0');
|
||||
else if ('a' <= *cursor && *cursor <= 'f')
|
||||
n = 16 * n + (*cursor - 'a');
|
||||
else if ('A' <= *cursor && *cursor <= 'F')
|
||||
n = 16 * n + (*cursor - 'A');
|
||||
else
|
||||
break;
|
||||
cursor++;
|
||||
}
|
||||
if (cursor == s)
|
||||
return error("Missing hex");
|
||||
word->number = (sign == '-') ? -n : n;
|
||||
} else if (sign)
|
||||
return error("Sign without number");
|
||||
else if (isalpha(*cursor)) {
|
||||
// Name
|
||||
word->name = cursor++;
|
||||
while (isalnum(*cursor) || *cursor == '_')
|
||||
cursor++;
|
||||
word->number = cursor - word->name;
|
||||
} else
|
||||
return error("Invalid word");
|
||||
|
||||
// Conditionals
|
||||
if (strncmp("if", word->name, 2)==0 && word->number == 2 &&
|
||||
!word->prefix && !sign) {
|
||||
int i = 0;
|
||||
if (*cursor == '<') word->operator[i++] = *cursor++;
|
||||
if (*cursor == '>') word->operator[i++] = *cursor++;
|
||||
if (*cursor == '=' && i<2) word->operator[i++] = *cursor++;
|
||||
if (i > 0 && *cursor++ == '0') {
|
||||
if (strncmp(cursor, "loop", 4)==0)
|
||||
cursor += 4;
|
||||
if (!hasMore)
|
||||
return condType;
|
||||
}
|
||||
return error("Invalid conditional");
|
||||
}
|
||||
|
||||
// Operator
|
||||
s = strchr("+-&|^=.,:;?!<", *cursor);
|
||||
if (s) {
|
||||
word->operator[0] = *cursor++;
|
||||
if (cursor[-1] == cursor[0] && strchr("+-<", *cursor))
|
||||
word->operator[1] = *cursor++; // ++ -- <<
|
||||
}
|
||||
|
||||
if (hasMore)
|
||||
return error("Invalid word");
|
||||
return wordType;
|
||||
}
|
||||
|
||||
static int compileWord(struct word *w)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void emit(int byte)
|
||||
{
|
||||
if (offset < size)
|
||||
page[offset] = byte;
|
||||
offset++;
|
||||
}
|
||||
|
||||
static int emitIf(int cond)
|
||||
{
|
||||
emit(BCC);
|
||||
emit(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int emitIfLoop(int cond)
|
||||
{
|
||||
emit(BCC);
|
||||
emit(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compileCond(struct word *w)
|
||||
{
|
||||
if (strcmp(w->operator, "<")==0) return emitIf(GE);
|
||||
if (strcmp(w->operator, ">")==0) return emitIf(LE);
|
||||
if (strcmp(w->operator, "=")==0) return emitIf(NE);
|
||||
if (strcmp(w->operator, "<>")==0) return emitIf(EQ);
|
||||
if (strcmp(w->operator, "<=")==0) return emitIf(GT);
|
||||
if (strcmp(w->operator, ">=")==0) return emitIf(LT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int compileLoop(struct word *w)
|
||||
{
|
||||
if (strcmp(w->operator, "<")==0) return emitIfLoop(LT);
|
||||
if (strcmp(w->operator, ">")==0) return emitIfLoop(GT);
|
||||
if (strcmp(w->operator, "=")==0) return emitIfLoop(EQ);
|
||||
if (strcmp(w->operator, "<>")==0) return emitIfLoop(NE);
|
||||
if (strcmp(w->operator, "<=")==0) return emitIfLoop(LE);
|
||||
if (strcmp(w->operator, ">=")==0) return emitIfLoop(GE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------+
|
||||
| External functions |
|
||||
+----------------------------------------------------------------------*/
|
||||
|
||||
void compileBegin(void)
|
||||
{
|
||||
compileError = null;
|
||||
blockDepth = 0;
|
||||
|
||||
base = 0x0200;
|
||||
offset = 0;
|
||||
size = 250;
|
||||
}
|
||||
|
||||
int compileLine(char *line)
|
||||
{
|
||||
cursor = line;
|
||||
struct word w;
|
||||
while (1) {
|
||||
switch (nextWord(&w)) {
|
||||
case endType:
|
||||
break;
|
||||
case openType:
|
||||
blockDepth++;
|
||||
continue;
|
||||
case closeType:
|
||||
if (blockDepth <= 0)
|
||||
return error("Close block without open");
|
||||
blockDepth--;
|
||||
continue;
|
||||
case wordType:
|
||||
if (compileWord(&w))
|
||||
return -1;
|
||||
continue;
|
||||
case condType:
|
||||
if (compileCond(&w))
|
||||
return -1;
|
||||
continue;
|
||||
case loopType:
|
||||
if (compileLoop(&w))
|
||||
return -1;
|
||||
continue;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int compileEnd(void)
|
||||
{
|
||||
if (blockDepth > 0)
|
||||
return error("Open block without close");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------+
|
||||
| |
|
||||
+----------------------------------------------------------------------*/
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
extern char *compileError;
|
||||
void compileBegin(void);
|
||||
int compileLine(char *line);
|
||||
int compileEnd(void);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Gigatron Control Language v1 definition
|
||||
* EBNF in W3C notation
|
||||
* Recommended railroad diagram generator: http://www.bottlecaps.de/rr/ui
|
||||
*/
|
||||
Gcl1File ::= Space* 'gcl1' ((Space|Block) Word?)* Newline
|
||||
Block ::= '[' Word? ((Space|Block) Word?)* ']'
|
||||
Word ::= Keyword | Prefix? (Name | Number) Operator?
|
||||
Keyword ::= 'call' | 'deek' | 'def' | 'do' | 'else' |
|
||||
'if' ('<' | '=' | '>' | '<=' | '<>' | '>=') '0' 'loop'? |
|
||||
'loop' | 'peek' | 'pop' | 'push' | 'ret'
|
||||
Prefix ::= [<>\%]
|
||||
Name ::= Letter (Letter | '_' | Decimal)*
|
||||
Operator ::= [-+&|^=.,:;!?^] | '++' | '--' | '<<'
|
||||
Number ::= [-+]? (Decimal+ | '$' Hexadecimal+)
|
||||
Comment ::= '{' (Space | [#x21-#x7A] | #x7C | #x7E)* '}'
|
||||
Letter ::= [a-zA-Z]
|
||||
Decimal ::= [0-9]
|
||||
Hexadecimal ::= [0-9a-fA-F]
|
||||
Space ::= #x20 | Newline | Comment
|
||||
Newline ::= #x09? #x0A
|
||||
@@ -0,0 +1,94 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "gcl.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
compileBegin();
|
||||
|
||||
while (1) {
|
||||
size_t len;
|
||||
char *line = fgetln(stdin, &len);
|
||||
if (!line)
|
||||
break;
|
||||
if (line[len-1] != '\n') {
|
||||
fprintf(stderr, "Incomplete line\n");
|
||||
break;
|
||||
}
|
||||
if (compileLine(line)) {
|
||||
fprintf(stderr, "Compile error\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (compileEnd())
|
||||
fprintf(stderr, "Compile error\n");
|
||||
|
||||
if (compileError)
|
||||
fprintf(stderr, "Error: %s\n", compileError);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
V=
|
||||
<V.
|
||||
\V.
|
||||
\V
|
||||
V.
|
||||
|
||||
\buttonA
|
||||
|
||||
if (scan("{")) { }
|
||||
if (scan("}")) { }
|
||||
if (scan("[")) { }
|
||||
if (scan("]")) { }
|
||||
if (scan("I")) { }
|
||||
if (scan("I&")) { }
|
||||
if (scan("I|")) { }
|
||||
if (scan("I^")) { }
|
||||
if (scan("I+")) { }
|
||||
if (scan("I-")) { }
|
||||
if (scan("I.")) { }
|
||||
if (scan("I!")) { }
|
||||
if (scan("V")) { }
|
||||
if (scan("V&")) { }
|
||||
if (scan("V|")) { }
|
||||
if (scan("V^")) { }
|
||||
if (scan("V+")) { }
|
||||
if (scan("V-")) { }
|
||||
if (scan("V=")) { }
|
||||
if (scan("V!")) { }
|
||||
if (scan("V.")) { }
|
||||
if (scan("V,")) { }
|
||||
if (scan("<V++")) { }
|
||||
if (scan("<V.")) { }
|
||||
if (scan("<V,")) { }
|
||||
if (scan(">V++")) { }
|
||||
if (scan(">V.")) { }
|
||||
if (scan(">V,")) { }
|
||||
if (scan("if=0")) { }
|
||||
if (scan("if>0")) { }
|
||||
if (scan("if<0")) { }
|
||||
if (scan("if>=0")) { }
|
||||
if (scan("if<=0")) { }
|
||||
if (scan("if<>0")) { }
|
||||
if (scan("if=0loop")) { }
|
||||
if (scan("if>0loop")) { }
|
||||
if (scan("if<0loop")) { }
|
||||
if (scan("if>=0loop")) { }
|
||||
if (scan("if<=0loop")) { }
|
||||
if (scan("if<>0loop")) { }
|
||||
if (scan("do")) { }
|
||||
if (scan("loop")) { }
|
||||
if (scan("push")) { }
|
||||
if (scan("def")) { }
|
||||
if (scan("peek")) { }
|
||||
if (scan("push")) { }
|
||||
if (scan("pop")) { }
|
||||
if (scan("call")) { }
|
||||
if (scan("ret")) { }
|
||||
if (scan("else")) { }
|
||||
if (scan("gcl1")) { }
|
||||
*/
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
# Take raw byte data and wrap it in GT1 format
|
||||
import sys
|
||||
#address = sys.stdin.buffer.read(2)
|
||||
#address = address[0]+ address[1]*256
|
||||
address = 0x212
|
||||
raw = sys.stdin.buffer.read()
|
||||
while len(raw) > 0:
|
||||
nextPage = (address + 256) & ~255
|
||||
dataSize = min(nextPage - address, len(raw))
|
||||
segmentData, raw = raw[0:dataSize], raw[dataSize:]
|
||||
sys.stdout.buffer.write(bytes([address>>8, address&255, dataSize&255]))
|
||||
sys.stdout.buffer.write(segmentData)
|
||||
address = nextPage
|
||||
sys.stdout.buffer.write(bytes([0,0,0]))
|
||||
@@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
#-----------------------------------------------------------------------
|
||||
#
|
||||
# plotGt1Maps.sh -- Create heatmaps from GT1 files
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
#
|
||||
# 2019-10-08 (marcelk) First version
|
||||
#
|
||||
|
||||
find . -name \*.gt1 |
|
||||
xargs -n 1 gt1dump.py |
|
||||
cut -c -54 |
|
||||
awk '
|
||||
function copy() {
|
||||
if (length(f))
|
||||
for (addr in f)
|
||||
n[addr]++
|
||||
delete f
|
||||
}
|
||||
/^\* file:/ {
|
||||
copy()
|
||||
}
|
||||
/^[0-9a-f]/ {
|
||||
addr=int("0x"$1)
|
||||
for (i=0;i<NF-1;i++)
|
||||
f[addr+i]++
|
||||
}
|
||||
END {
|
||||
copy()
|
||||
for (y=0;y<256;y++) {
|
||||
for (x=0;x<256;x++) {
|
||||
addr = y*256+x
|
||||
z = addr in n ? n[addr] : 0
|
||||
print int(addr/256), addr%256, z
|
||||
}
|
||||
print ""
|
||||
}
|
||||
}' > segments.dat
|
||||
|
||||
gnuplot <<!
|
||||
set title 'Gigatron file segment heatmap (32K)'
|
||||
set nokey
|
||||
set noborder
|
||||
set xrange [-1:256]
|
||||
set yrange [128:-1]
|
||||
set format x2 'xx%02X'
|
||||
set format y '%02Xxx'
|
||||
set noxtics
|
||||
set x2tics out 0,16,255
|
||||
set x2tics add (255)
|
||||
set ytics out 0,8,127
|
||||
set ytics add (127)
|
||||
set palette defined (\
|
||||
0 .7 .7 .7,\
|
||||
.001 0 0 1, \
|
||||
2 0 .5 1, \
|
||||
3 0 1 1, \
|
||||
4 .5 1 .5,\
|
||||
5 1 1 0, \
|
||||
6 1 .5 0, \
|
||||
7 1 0 0, \
|
||||
8 1 0 0)
|
||||
set cblabel 'Number of GT1 files'
|
||||
set cbrange [0.7:]
|
||||
set logscale cb
|
||||
set cbtics out 1,2
|
||||
set nomcbtics
|
||||
set terminal png size 1280,960
|
||||
set output 'Heatmap_32K.png'
|
||||
# Invalidate pages >= 128
|
||||
plot 'segments.dat' using 2:1:(\$1<128?\$3:1/0) with image
|
||||
|
||||
# 64K view
|
||||
set title 'Gigatron file segment heatmap (64K)'
|
||||
set yrange [256:-2]
|
||||
set ytics out 0,16,255
|
||||
set ytics add (255)
|
||||
set output 'Heatmap_64K.png'
|
||||
plot 'segments.dat' using 2:1:3 with image
|
||||
!
|
||||
|
||||
open Heatmap_*K.png
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
queens.c by Marcel van Kervinck <marcelk@stack.urc.tue.nl>
|
||||
solves the problem of placing n queens on
|
||||
an n*n board without attacking eachother
|
||||
*/
|
||||
#include <stdio.h>
|
||||
t(a,b,c){int d=0,e=a&~b&~c,f=1;if(a)for(f=0;e-=d,d=e&-e;f+=t(a-d,(b+d)*2,(
|
||||
c+d)/2));return f;}main(q){scanf("%d",&q);printf("%d\n",t(~(~0<<q),0,0));}
|
||||
Binary file not shown.
Reference in new issue
Block a user