From 2e1cf13e604121b9d1cb79ef7ca7a08b475eaadb Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 12 May 2023 23:49:49 +0100 Subject: We can do 4MIPS fine! --- README.md | 4 ++-- vm.c | 4 ++-- 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) { -- cgit v1.2.3