src/musashi/example/sim.h

Tue, 15 Jan 2013 17:02:56 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Tue, 15 Jan 2013 17:02:56 +0000
changeset 121
15ae2788e848
parent 0
8bf1bf91a36d
permissions
-rw-r--r--

Implement m68k_read_disassembler_* properly

The previous implementations of m68k_read_disassembler are unsuitable due to
interactions with the memory mapper. A read from memory by the DASM should not
mutate system state.

So we modify the m68k_read_disassembler_{8,16,32} functions to do the memory
mapping themselves without causing page faults (bus error exception) or
updating the page flag bits (which could really upset the kernel).

Now all we need is a debugger/disassembler...

     1 #ifndef SIM__HEADER
     2 #define SIM__HEADER
     4 unsigned int m68k_read_memory_8(unsigned int address);
     5 unsigned int m68k_read_memory_16(unsigned int address);
     6 unsigned int m68k_read_memory_32(unsigned int address);
     7 void m68k_write_memory_8(unsigned int address, unsigned int value);
     8 void m68k_write_memory_16(unsigned int address, unsigned int value);
     9 void m68k_write_memory_32(unsigned int address, unsigned int value);
    10 void cpu_pulse_reset(void);
    11 void cpu_set_fc(unsigned int fc);
    12 int  cpu_irq_ack(int level);
    14 #endif /* SIM__HEADER */