29 byte
*rmap
[0x10], *wmap
[0x10];
47 extern struct mbc mbc
;
48 extern struct rom rom
;
49 extern struct ram ram
;
56 void ioreg_write(byte r
, byte b
);
57 void mbc_write(int a
, byte b
);
58 void mem_write(int a
, byte b
);
64 #define READB(a) ( mbc.rmap[(a)>>12] \
65 ? mbc.rmap[(a)>>12][(a)] \
67 #define READW(a) ( READB((a)) | ((word)READB((a)+1)<<8) )
69 #define WRITEB(a, b) ( mbc.wmap[(a)>>12] \
70 ? ( mbc.wmap[(a)>>12][(a)] = (b) ) \
71 : ( mem_write((a), (b)), (b) ) )
72 #define WRITEW(a, w) ( WRITEB((a), (w)&0xFF), WRITEB((a)+1, (w)>>8) )