1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-26 17:38:06 +11:00

Compare commits

..

No commits in common. "400ef99b548f5e59e7039b337f4c54cc96f4e0fd" and "48078d9c9c4e37ee4d0d17189464f8bcf92f4b98" have entirely different histories.

3 changed files with 4 additions and 16 deletions

View File

@ -7,7 +7,6 @@ They all run on the same kind of virtual machine: A z80 CPU, 64K of RAM/ROM.
#include "emul.h" #include "emul.h"
static Machine m; static Machine m;
static ushort traceval = 0;
static uint8_t io_read(int unused, uint16_t addr) static uint8_t io_read(int unused, uint16_t addr)
{ {
@ -93,15 +92,6 @@ void emul_loop()
while (emul_step()); while (emul_step());
} }
void emul_trace(ushort addr)
{
ushort newval = m.mem[addr+1] << 8 | m.mem[addr];
if (newval != traceval) {
traceval = newval;
fprintf(stderr, "trace: %04x PC: %04x\n", traceval, m.cpu.PC);
}
}
void emul_printdebug() void emul_printdebug()
{ {
fprintf(stderr, "Min SP: %04x\n", m.minsp); fprintf(stderr, "Min SP: %04x\n", m.minsp);

View File

@ -30,5 +30,4 @@ Machine* emul_init();
bool emul_step(); bool emul_step();
bool emul_steps(unsigned int steps); bool emul_steps(unsigned int steps);
void emul_loop(); void emul_loop();
void emul_trace(ushort addr);
void emul_printdebug(); void emul_printdebug();

View File

@ -683,13 +683,12 @@ CBR:
or l or l
jp z, BR+2 ; False, branch jp z, BR+2 ; False, branch
; True, skip next 2 bytes and don't branch ; True, skip next 2 bytes and don't branch
ld hl, (IP) ld hl, IP
inc hl inc (hl)
inc hl inc (hl)
ld (IP), hl
jp next jp next
.fill 15 .fill 18
.db "," .db ","
.dw $-CBR .dw $-CBR