mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-06 23:51:21 +00:00
Neo Geo: safety checks
This commit is contained in:
parent
e4ad569f8d
commit
82c8b97d9c
2 changed files with 13 additions and 1 deletions
|
@ -627,6 +627,10 @@ class DivEngine {
|
|||
size_t adpcmBMemLen;
|
||||
unsigned char* qsoundMem;
|
||||
size_t qsoundMemLen;
|
||||
unsigned char* qsoundAMem;
|
||||
size_t qsoundAMemLen;
|
||||
unsigned char* dpcmMem;
|
||||
size_t dpcmMemLen;
|
||||
|
||||
DivEngine():
|
||||
output(NULL),
|
||||
|
@ -685,6 +689,10 @@ class DivEngine {
|
|||
adpcmBMem(NULL),
|
||||
adpcmBMemLen(0),
|
||||
qsoundMem(NULL),
|
||||
qsoundMemLen(0) {}
|
||||
qsoundMemLen(0),
|
||||
qsoundAMem(NULL),
|
||||
qsoundAMemLen(0),
|
||||
dpcmMem(NULL),
|
||||
dpcmMemLen(0) {}
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
uint8_t DivYM2610Interface::ymfm_external_read(ymfm::access_class type, uint32_t address) {
|
||||
switch (type) {
|
||||
case ymfm::ACCESS_ADPCM_A:
|
||||
if (parent->adpcmAMem==NULL) return 0;
|
||||
if ((address&0xffffff)>=parent->adpcmAMemLen) return 0;
|
||||
return parent->adpcmAMem[address&0xffffff];
|
||||
case ymfm::ACCESS_ADPCM_B:
|
||||
if (parent->adpcmBMem==NULL) return 0;
|
||||
if ((address&0xffffff)>=parent->adpcmBMemLen) return 0;
|
||||
return parent->adpcmBMem[address&0xffffff];
|
||||
default:
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue