src/musashi/example/sim.h

Fri, 04 Mar 2011 01:36:30 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Fri, 04 Mar 2011 01:36:30 +0000
changeset 104
b12651d8a0ab
parent 0
8bf1bf91a36d
permissions
-rw-r--r--

fix issue with WE+ bit becoming unset, fix pagefault:not-mapped-in logic

- The WE+ (page write enable) bit was becoming unset when the Page Status bits were being set.
A stupid mistake in an AND expression was unsetting the write-enable, thus making S4TEST 12,2 and 12,3 fail spectacularly.

- Pagefaults were not being generated correctly for pages which were not mapped in. Even Supervisor code accessing unmapped pages should get a PF.

     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 */