Mercurial > audlegacy-plugins
annotate src/console/sap_cpu_io.h @ 2143:4610f14103e4
fixed some memory leaks and dangling file descriptor pointers in the aac/mp4 plugin
author | Ben Tucker <ben.tucker@gmail.com> |
---|---|
date | Sun, 28 Oct 2007 16:31:12 -0700 |
parents | 986f098da058 |
children |
rev | line source |
---|---|
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
1 |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
2 #include "Sap_Emu.h" |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
3 |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
4 #include "blargg_source.h" |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
5 |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
6 #define CPU_WRITE( cpu, addr, data, time ) STATIC_CAST(Sap_Emu&,*cpu).cpu_write( addr, data ) |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
7 |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
8 void Sap_Emu::cpu_write( sap_addr_t addr, int data ) |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
9 { |
341 | 10 mem.ram [addr] = data; |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
11 if ( (addr >> 8) == 0xD2 ) |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
12 cpu_write_( addr, data ); |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
13 } |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
14 |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
15 #ifdef NDEBUG |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
16 #define CPU_READ( cpu, addr, time ) READ_LOW( addr ) |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
17 #else |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
18 #define CPU_READ( cpu, addr, time ) STATIC_CAST(Sap_Emu&,*cpu).cpu_read( addr ) |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
19 |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
20 int Sap_Emu::cpu_read( sap_addr_t addr ) |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
21 { |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
22 if ( (addr & 0xF900) == 0xD000 ) |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
23 dprintf( "Unmapped read $%04X\n", addr ); |
341 | 24 return mem.ram [addr]; |
316
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
25 } |
fb513e10174e
[svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents:
diff
changeset
|
26 #endif |