From 279dd4b4062c6208bc2a1aca242b4ae2997da5e0 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 1 May 2023 21:54:07 +0100 Subject: Documented current palette --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index d847d49..bd21d66 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Other features: * programmable in ASM * 16-bit registers: stack pointer (SP) and program counter (PC) * 8-bit registers: 4 general purpose registers (a, b, x, y), flags register (F) -* frame interrupt (60Hz) and external IO interrupt +* frame interrupt (60Hz) and external IO interrupt (planned) * port based IO Memory map: @@ -52,7 +52,7 @@ Then run `make`. This will result in two binaries: - **tr8as**: the TR8 assembler - - **tr8vm**: the TR8 VM that can run `tr8` files + - **tr8vm**: the TR8 VM Player that can run `tr8` files You can then compile and run the example with `make example`. @@ -86,7 +86,26 @@ controller 1, and `0xf1` for controller 2. ### Palette -TODO: palette colors +Current palette (not final) is the default EGA 16 colour palette: + +| Index | RGB (hex) | +| --- | --- | +| 0 | 0x000000 | +| 1 | 0x0000aa | +| 2 | 0x00aa00 | +| 3 | 0x00aaaa | +| 4 | 0xaa0000 | +| 5 | 0xaa00aa | +| 6 | 0xaa5500 | +| 7 | 0xaaaaaa | +| 8 | 0x555555 | +| 9 | 0x5555ff | +| 10 | 0x55ff55 | +| 11 | 0x55ffff | +| 12 | 0xff5555 | +| 13 | 0xff55ff | +| 14 | 0xffff55 | +| 15 | 0xffffff | ### Frame interrupt @@ -128,6 +147,9 @@ int_handler: iret ``` +Because the flags are preserved, any code run in the interrupt handler only +needs to preserve the 4 registers and the stack. + ### Instructions All the instructions are 16-bit, with the exception of `JMP addr` and `CALL -- cgit v1.2.3