system_interface
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
system_interface [2025/07/03 16:11] – reggie | system_interface [2025/08/26 15:57] (current) – [Keyboard] reggie | ||
---|---|---|---|
Line 5: | Line 5: | ||
const SIbaseAddress=$ff80 | const SIbaseAddress=$ff80 | ||
const SIrefreshOff=0, | const SIrefreshOff=0, | ||
+ | const SIArrowButtons=4; | ||
SIrefreshOff | SIrefreshOff | ||
Line 10: | Line 11: | ||
SIgraphicsMode | SIgraphicsMode | ||
SIkeyInterface | SIkeyInterface | ||
+ | SIArrowButtons | ||
| | ||
==== Refresh ==== | ==== Refresh ==== | ||
Line 59: | Line 61: | ||
The colour palette used is the 16-colour [[https:// | The colour palette used is the 16-colour [[https:// | ||
- | ==== Keyboard ==== | + | ==== Text screen ==== |
+ | |||
+ | The text screen is a memory-mapped display of the contents of 512 bytes of RAM beginning at address $0400. One byte represents one character. Values of 64..95 are the corresponding ASCII characters; 96..127 are ASCII characters 32..63. Values of 0..63 mirror those of 64+ but in inverse video. | ||
+ | |||
+ | Columns and rows are zero-based with (0, 0) at the (left, top). Addresses increase left to right, then top to bottom, for a 32 wide and 16 high display. So column 7, row 3 is at address $400+(3*32)+(7). | ||
+ | |||
+ | ==== Keyboard | ||
The keyboard is accessed by a single port. Simply write 0 to the port then read from the same address. A negative value means no key has been pressed, otherwise the value is the ASCII code of the last key pressed. Write $ff to the same port to clear the keyboard buffer. | The keyboard is accessed by a single port. Simply write 0 to the port then read from the same address. A negative value means no key has been pressed, otherwise the value is the ASCII code of the last key pressed. Write $ff to the same port to clear the keyboard buffer. | ||
Line 71: | Line 79: | ||
cmpa # | cmpa # | ||
rts | rts | ||
+ | | ||
+ | A game controller is emulated using the keyboard. The arrow keys are for movement, plus Space and Enter can be used for ' | ||
+ | |||
+ | const ArrowLeft=$01, | ||
+ | const BtnFire=$10, | ||
+ | readControls: | ||
+ | lda SIBaseAddress+SIArrowButtons | ||
+ | bita #BtnFire | ||
+ | bne fireWeapon | ||
+ | |||
+ | ==== Hex Dump ==== | ||
+ | Click this button to copy a range of bytes to the system clipboard. Set the X and Y registers to specify the start and end of the range, ie. from X to Y-1. For example, if we have a program starting at $4000, | ||
+ | The format used is [[https:// | ||
system_interface.1751559117.txt.gz · Last modified: 2025/07/03 16:11 by reggie