aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-12 23:49:49 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-12 23:49:49 +0100
commit2e1cf13e604121b9d1cb79ef7ca7a08b475eaadb (patch)
treeb690e515a1c0e8c3e85fc549a11f8fd5669eb989
parenta20b308cfe92a8bb47c6896e7fdb24b15c2efd59 (diff)
downloadtr8vm-2e1cf13e604121b9d1cb79ef7ca7a08b475eaadb.tar.gz
tr8vm-2e1cf13e604121b9d1cb79ef7ca7a08b475eaadb.zip
We can do 4MIPS fine!
-rw-r--r--README.md4
-rw-r--r--vm.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/README.md b/README.md
index b00e1a9..16f2bad 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ TR8 is an 8-bit fantasy console inspired by MIPS, Z80 and 6502 real world CPUs.
```
Display: 128 x 128 pixels 16 colors
Memory: 64K
-CPU: TR-8, 8M VM instr/sec
+CPU: TR-8, 4M VM instr/sec
Sound: TBD
```
@@ -225,7 +225,7 @@ A label is defined as an ID that ends in `:`.
All the instructions are 16-bit, with the exception of `JMP addr` and `CALL
addr` that use an extra 16-bit parameter for "addr". All the instructions take
-the same time to run, and being 8 MIPS it can fit `133333` instructions in a
+the same time to run, and being 4 MIPS it can fit `66666` instructions in a
frame (at 60Hz).
There are no 16-bit registers, but they can be implemented with 2 registers,
diff --git a/vm.c b/vm.c
index 98f33ef..63836c6 100644
--- a/vm.c
+++ b/vm.c
@@ -51,8 +51,8 @@
#define INT_VECTOR ((uin16_t)0xff00)
-/* (1 / 60.) * 8000000 */
-#define INSTR_PER_FRAME 133333L
+/* (1 / 60.) * 4000000 */
+#define INSTR_PER_FRAME 66666L
static uint8_t flags(uint8_t *f, uint16_t v, uint8_t mask)
{