Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.7KB

  1. 0xbf00 CONSTANT RS_ADDR
  2. 0xbffa CONSTANT PS_ADDR
  3. RS_ADDR 0x80 - CONSTANT SYSVARS
  4. 0x8000 CONSTANT HERESTART
  5. SYSVARS 0x70 + CONSTANT LCD_MEM
  6. SYSVARS 0x72 + CONSTANT KBD_MEM
  7. 0x01 CONSTANT KBD_PORT
  8. 212 LOAD ( z80 assembler )
  9. : ZFILL, ( u ) 0 DO 0 A, LOOP ;
  10. 262 LOAD ( xcomp )
  11. 522 LOAD ( font compiler )
  12. 282 LOAD ( boot.z80.decl )
  13. 270 LOAD ( xcomp overrides )
  14. ( TI-84+ requires specific code at specific offsets which
  15. come in conflict with Collapse OS' stable ABI. We thus
  16. offset the binary by 0x100, which is our minimum possible
  17. increment and fill the TI stuff with the code below. )
  18. 0x5a JP, 0x15 ZFILL, ( 0x18 )
  19. 0x5a JP, ( reboot ) 0x1d ZFILL, ( 0x38 )
  20. ( handleInterrupt )
  21. DI,
  22. AF PUSH,
  23. ( did we push the ON button? )
  24. 0x04 ( PORT_INT_TRIG ) INAi,
  25. 0 ( INT_TRIG_ON ) A BIT,
  26. IFNZ,
  27. ( yes? acknowledge and boot )
  28. 0x03 ( PORT_INT_MASK ) INAi,
  29. 0x00 ( INT_MASK_ON ) A RES, ( ack interrupt )
  30. 0x03 ( PORT_INT_MASK ) OUTiA,
  31. AF POPqq,
  32. EI,
  33. 0x100 JP,
  34. THEN,
  35. AF POP,
  36. EI,
  37. RETI,
  38. 0x03 ZFILL, ( 0x53 )
  39. 0x5a JP, ( 0x56 ) 0xff A, 0xa5 A, 0xff A, ( 0x5a )
  40. ( boot )
  41. DI,
  42. IM1,
  43. ( enable the ON key interrupt )
  44. 0x03 ( PORT_INT_MASK ) INAi,
  45. 0x00 ( INT_MASK_ON ) A SET,
  46. 0x03 ( PORT_INT_MASK ) OUTiA,
  47. A 0x80 LDri,
  48. 0x07 ( PORT_BANKB ) OUTiA,
  49. EI,
  50. ( LCD off )
  51. A 0x02 ( LCD_CMD_DISABLE ) LDri,
  52. 0x10 ( LCD_PORT_CMD ) OUTiA,
  53. HALT,
  54. 0x95 ZFILL, ( 0x100 )
  55. ( All set, carry on! )
  56. CURRENT @ XCURRENT !
  57. 0x100 BIN( !
  58. 283 335 LOADR ( boot.z80 )
  59. 353 LOAD ( xcomp core low )
  60. CREATE ~FNT CPFNT3x5
  61. 605 610 LOADR ( LCD low )
  62. 616 620 LOADR ( KBD low )
  63. 380 LOAD ( xcomp core high )
  64. (entry) _
  65. ( Update LATEST )
  66. PC ORG @ 8 + !
  67. ," LCD$ KBD$ " EOT,
  68. ORG @ 0x100 - 256 /MOD 2 PC! 2 PC!
  69. H@ 256 /MOD 2 PC! 2 PC!