2020-05-08 20:50:34 +10:00
|
|
|
0x8000 CONSTANT RAMSTART
|
|
|
|
0xb000 CONSTANT RS_ADDR
|
2020-05-12 11:08:24 +10:00
|
|
|
0xbffa CONSTANT PS_ADDR
|
2020-05-09 22:50:55 +10:00
|
|
|
RAMSTART 0x70 + CONSTANT LCD_MEM
|
2020-05-10 23:37:36 +10:00
|
|
|
RAMSTART 0x72 + CONSTANT KBD_MEM
|
2020-05-10 01:55:58 +10:00
|
|
|
0x01 CONSTANT KBD_PORT
|
2020-05-08 20:50:34 +10:00
|
|
|
212 LOAD ( z80 assembler )
|
2020-05-11 04:06:01 +10:00
|
|
|
: ZFILL, ( u ) 0 DO 0 A, LOOP ;
|
2020-05-08 20:50:34 +10:00
|
|
|
262 LOAD ( xcomp )
|
2020-05-08 23:07:44 +10:00
|
|
|
522 LOAD ( font compiler )
|
2020-05-08 20:50:34 +10:00
|
|
|
: CODE XCODE ;
|
2020-05-13 11:08:18 +10:00
|
|
|
: COMPILE XCOMPILE ; IMMEDIATE
|
|
|
|
: [COMPILE] X[COMPILE] ; IMMEDIATE
|
2020-05-08 20:50:34 +10:00
|
|
|
: IMMEDIATE XIMM ;
|
|
|
|
: (entry) (xentry) ;
|
2020-05-10 01:55:58 +10:00
|
|
|
: CREATE XCREATE ; ( for KBD tbls )
|
2020-05-08 20:50:34 +10:00
|
|
|
: : [ ' X: , ] ;
|
|
|
|
|
2020-05-11 04:06:01 +10: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. )
|
|
|
|
|
2020-05-11 04:33:35 +10:00
|
|
|
0x5a JPnn, 0x15 ZFILL, ( 0x18 )
|
|
|
|
0x5a JPnn, ( reboot ) 0x1d ZFILL, ( 0x38 )
|
2020-05-11 04:06:01 +10:00
|
|
|
( handleInterrupt )
|
|
|
|
DI,
|
|
|
|
AF PUSHqq,
|
|
|
|
( did we push the ON button? )
|
|
|
|
0x04 ( PORT_INT_TRIG ) INAn,
|
|
|
|
0 ( INT_TRIG_ON ) A BITbr,
|
|
|
|
IFNZ,
|
|
|
|
( yes? acknowledge and boot )
|
|
|
|
0x03 ( PORT_INT_MASK ) INAn,
|
|
|
|
0x00 ( INT_MASK_ON ) A RESbr, ( ack interrupt )
|
|
|
|
0x03 ( PORT_INT_MASK ) OUTnA,
|
|
|
|
AF POPqq,
|
|
|
|
EI,
|
|
|
|
0x100 JPnn,
|
|
|
|
THEN,
|
|
|
|
AF POPqq,
|
|
|
|
EI,
|
|
|
|
RETI,
|
|
|
|
|
|
|
|
0x03 ZFILL, ( 0x53 )
|
2020-05-11 04:33:35 +10:00
|
|
|
0x5a JPnn, ( 0x56 ) 0xff A, 0xa5 A, 0xff A, ( 0x5a )
|
|
|
|
( boot )
|
|
|
|
DI,
|
|
|
|
(im1)
|
|
|
|
( enable the ON key interrupt )
|
|
|
|
0x03 ( PORT_INT_MASK ) INAn,
|
|
|
|
0x00 ( INT_MASK_ON ) A SETbr,
|
|
|
|
0x03 ( PORT_INT_MASK ) OUTnA,
|
|
|
|
A 0x80 LDrn,
|
|
|
|
0x07 ( PORT_BANKB ) OUTnA,
|
|
|
|
EI,
|
|
|
|
( LCD off )
|
|
|
|
A 0x02 ( LCD_CMD_DISABLE ) LDrn,
|
|
|
|
0x10 ( LCD_PORT_CMD ) OUTnA,
|
|
|
|
HALT,
|
|
|
|
|
|
|
|
0x95 ZFILL, ( 0x100 )
|
2020-05-11 04:06:01 +10:00
|
|
|
( All set, carry on! )
|
|
|
|
|
2020-05-08 20:50:34 +10:00
|
|
|
CURRENT @ XCURRENT !
|
|
|
|
|
2020-05-11 04:06:01 +10:00
|
|
|
0x100 BIN( !
|
2020-05-08 20:50:34 +10:00
|
|
|
282 LOAD ( boot.z80 )
|
2020-05-09 11:47:03 +10:00
|
|
|
393 LOAD ( icore low )
|
2020-05-13 02:41:47 +10:00
|
|
|
CREATE ~FNT CPFNT3x5
|
|
|
|
555 560 LOADR ( LCD low )
|
2020-05-10 10:54:47 +10:00
|
|
|
566 570 LOADR ( KBD low )
|
2020-05-09 11:47:03 +10:00
|
|
|
415 LOAD ( icore high )
|
2020-05-08 20:50:34 +10:00
|
|
|
(entry) _
|
|
|
|
( Update LATEST )
|
|
|
|
PC ORG @ 8 + !
|
2020-05-13 02:41:47 +10:00
|
|
|
422 451 XPACKR ( core print fmt readln )
|
2020-05-10 23:37:36 +10:00
|
|
|
," : _ LCD$ KBD$ (ok) RDLN$ ; _ "
|
2020-05-11 04:06:01 +10:00
|
|
|
ORG @ 0x100 - 256 /MOD 2 PC! 2 PC!
|
2020-05-08 20:50:34 +10:00
|
|
|
H@ 256 /MOD 2 PC! 2 PC!
|