aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-01 21:54:07 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-01 21:54:07 +0100
commit279dd4b4062c6208bc2a1aca242b4ae2997da5e0 (patch)
tree6e44d3ba86f7452e8789edff2ec2762e3706549d /README.md
parentef84fb6fcb45a86fce97acda58606a76a937a1da (diff)
downloadtr8vm-279dd4b4062c6208bc2a1aca242b4ae2997da5e0.tar.gz
tr8vm-279dd4b4062c6208bc2a1aca242b4ae2997da5e0.zip
Documented current palette
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
1 files changed, 25 insertions, 3 deletions
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