collapseos/arch/z80/ti84/xcomp.fs

77 lines
1.7 KiB
Forth
Raw Permalink Normal View History

0xbf00 CONSTANT RS_ADDR
0xbffa CONSTANT PS_ADDR
RS_ADDR 0xb0 - CONSTANT SYSVARS
2020-06-28 19:45:28 -04:00
0x8000 CONSTANT HERESTART
SYSVARS 0xa0 + CONSTANT LCD_MEM
SYSVARS 0xa2 + CONSTANT GRID_MEM
SYSVARS 0xa5 + CONSTANT KBD_MEM
2020-05-09 11:55:58 -04:00
0x01 CONSTANT KBD_PORT
5 LOAD ( z80 assembler )
2020-05-08 06:50:34 -04:00
262 LOAD ( xcomp )
522 LOAD ( font compiler )
282 LOAD ( boot.z80.decl )
270 LOAD ( xcomp overrides )
2020-05-08 06:50:34 -04:00
( TI-84+ requires specific code at specific offsets which
come in conflict with Collapse OS' stable ABI. We thus
offset the binary by 0x100, which is our minimum possible
increment and fill the TI stuff with the code below. )
0x5a JP, 0x15 ALLOT0 ( 0x18 )
0x5a JP, ( reboot ) 0x1d ALLOT0 ( 0x38 )
( handleInterrupt )
DI,
AF PUSH,
( did we push the ON button? )
0x04 ( PORT_INT_TRIG ) INAi,
0 ( INT_TRIG_ON ) A BIT,
IFNZ,
( yes? acknowledge and boot )
0x03 ( PORT_INT_MASK ) INAi,
0x00 ( INT_MASK_ON ) A RES, ( ack interrupt )
0x03 ( PORT_INT_MASK ) OUTiA,
AF POPqq,
EI,
0x100 JP,
THEN,
AF POP,
EI,
RETI,
0x03 ALLOT0 ( 0x53 )
0x5a JP, ( 0x56 ) 0xff C, 0xa5 C, 0xff C, ( 0x5a )
2020-05-10 14:33:35 -04:00
( boot )
DI,
IM1,
2020-05-10 14:33:35 -04:00
( enable the ON key interrupt )
0x03 ( PORT_INT_MASK ) INAi,
0x00 ( INT_MASK_ON ) A SET,
0x03 ( PORT_INT_MASK ) OUTiA,
A 0x80 LDri,
0x07 ( PORT_BANKB ) OUTiA,
2020-05-10 14:33:35 -04:00
EI,
( LCD off )
A 0x02 ( LCD_CMD_DISABLE ) LDri,
0x10 ( LCD_PORT_CMD ) OUTiA,
2020-05-10 14:33:35 -04:00
HALT,
0x95 ALLOT0 ( 0x100 )
( All set, carry on! )
2020-05-08 06:50:34 -04:00
CURRENT @ XCURRENT !
0x100 BIN( !
283 335 LOADR ( boot.z80 )
353 LOAD ( xcomp core low )
2020-05-12 12:41:47 -04:00
CREATE ~FNT CPFNT3x5
605 609 LOADR ( LCD low )
402 403 LOADR ( Grid )
616 620 LOADR ( KBD low )
390 LOAD ( xcomp core high )
2020-05-08 06:50:34 -04:00
(entry) _
( Update LATEST )
PC ORG @ 8 + !
," LCD$ KBD$ GRID$ " EOT,
ORG @ 0x100 - |M 2 PC! 2 PC!
H@ |M 2 PC! 2 PC!