27 byte
*rmap
[0x10], *wmap
[0x10];
44 extern struct mbc mbc
;
45 extern struct rom rom
;
46 extern struct ram ram
;
48 void mem_updatemap(void) ICODE_ATTR
;
49 void mem_write(int a
, byte b
) ICODE_ATTR
;
50 byte
mem_read(int a
) ICODE_ATTR
;
54 #define READB(a) ( mbc.rmap[(a)>>12] \
55 ? mbc.rmap[(a)>>12][(a)] \
57 #define READW(a) ( READB((a)) | ((word)READB((a)+1)<<8) )
59 #define WRITEB(a, b) ( mbc.wmap[(a)>>12] \
60 ? ( mbc.wmap[(a)>>12][(a)] = (b) ) \
61 : ( mem_write((a), (b)), (b) ) )
62 #define WRITEW(a, w) ( WRITEB((a), (w)&0xFF), WRITEB((a)+1, (w)>>8) )