11 |
int debug = 0; |
int debug = 0; |
12 |
|
|
13 |
// same as memory size |
// same as memory size |
14 |
#define CACHE_SIZE 0xffff |
#define CACHE_SIZE 0x10000 |
15 |
byte opCache[CACHE_SIZE]; |
byte opCache[CACHE_SIZE]; |
16 |
|
|
17 |
#define CALLBACK_READ_SKIP 0x00 |
#define CALLBACK_READ_SKIP 0x00 |
205 |
exit(1); |
exit(1); |
206 |
} |
} |
207 |
memset( opCache, 0, CACHE_SIZE ); |
memset( opCache, 0, CACHE_SIZE ); |
|
memset( perlCallBack, CALLBACK_READ_ALWAYS | CALLBACK_WRITE_ALWAYS, CACHE_SIZE ); |
|
208 |
} |
} |
209 |
|
memset( perlCallBack, ( CALLBACK_READ_ALWAYS | CALLBACK_WRITE_ALWAYS ), CACHE_SIZE ); |
210 |
Reset6502(R); |
Reset6502(R); |
211 |
debugf(("Reset6502 over")); |
debugf(("Reset6502 over")); |
212 |
update_perl_R(); |
update_perl_R(); |
238 |
|
|
239 |
/* FIXME somehow check if Addr will fit in int on current platform */ |
/* FIXME somehow check if Addr will fit in int on current platform */ |
240 |
void set_read_callback(int Addr) { |
void set_read_callback(int Addr) { |
241 |
perlCallBack[Addr] == perlCallBack[Addr] & CALLBACK_WRITE_MASK | CALLBACK_READ_ALWAYS; |
perlCallBack[Addr] = perlCallBack[Addr] & CALLBACK_WRITE_MASK | CALLBACK_READ_ALWAYS; |
242 |
debugf(("MEM: %04x read callback\n", Addr)); |
debugf(("MEM: %04x read callback to %02x\n", Addr, perlCallBack[Addr])); |
243 |
} |
} |
244 |
|
|
245 |
void set_write_callback(int Addr) { |
void set_write_callback(int Addr) { |
246 |
perlCallBack[Addr] == perlCallBack[Addr] & CALLBACK_READ_MASK | CALLBACK_WRITE_ALWAYS; |
perlCallBack[Addr] = perlCallBack[Addr] & CALLBACK_READ_MASK | CALLBACK_WRITE_ALWAYS; |
247 |
debugf(("MEM: %04x write callback\n", Addr)); |
debugf(("MEM: %04x write callback to %02x\n", Addr, perlCallBack[Addr])); |
248 |
} |
} |
249 |
|
|
250 |
/* we fake here, since we will need to call perl at least once to get initial value... */ |
/* we fake here, since we will need to call perl at least once to get initial value... */ |