233 |
/* FIXME somehow check if Addr will fit in int on current platform */ |
/* FIXME somehow check if Addr will fit in int on current platform */ |
234 |
void set_read_callback(int Addr) { |
void set_read_callback(int Addr) { |
235 |
perlCallBack[Addr] == perlCallBack[Addr] & CALLBACK_WRITE_MASK | CALLBACK_READ_ALWAYS; |
perlCallBack[Addr] == perlCallBack[Addr] & CALLBACK_WRITE_MASK | CALLBACK_READ_ALWAYS; |
236 |
|
debugf(("MEM: %04x read callback\n", Addr)); |
237 |
} |
} |
238 |
|
|
239 |
void set_write_callback(int Addr) { |
void set_write_callback(int Addr) { |
240 |
perlCallBack[Addr] == perlCallBack[Addr] & CALLBACK_READ_MASK | CALLBACK_WRITE_ALWAYS; |
perlCallBack[Addr] == perlCallBack[Addr] & CALLBACK_READ_MASK | CALLBACK_WRITE_ALWAYS; |
241 |
|
debugf(("MEM: %04x write callback\n", Addr)); |
242 |
} |
} |
243 |
|
|
244 |
/* 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... */ |
245 |
int disable_all_callbacks(void) { |
int set_all_callbacks(int mode) { |
246 |
memset( perlCallBack, CALLBACK_READ_ONCE | CALLBACK_WRITE_ONCE, CACHE_SIZE ); |
memset( perlCallBack, mode, CACHE_SIZE ); |
247 |
|
debugf(("MEM: all callbacks set to %02x\n", perlCallBack[0])); |
248 |
return perlCallBack[0]; |
return perlCallBack[0]; |
249 |
} |
} |
250 |
|
|
251 |
|
int get_callback(int Addr) { |
252 |
|
return perlCallBack[Addr]; |
253 |
|
} |
254 |
|
|
255 |
|
|
256 |
MODULE = M6502 PACKAGE = M6502 |
MODULE = M6502 PACKAGE = M6502 |
257 |
|
|
282 |
set_write_callback(int Addr) |
set_write_callback(int Addr) |
283 |
|
|
284 |
int |
int |
285 |
disable_all_callbacks() |
set_all_callbacks(int mode) |
286 |
|
|
287 |
|
int get_callback(int Addr) |