Skip to content

Commit

Permalink
Namco 163: fix compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
tildearrow committed Aug 19, 2023
1 parent c045fb5 commit b384367
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/engine/platform/n163.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,16 @@ void DivPlatformN163::updateWave(int ch, int wave, int pos, int len) {
len&=0xfc; // 4 nibble boundary
if (wave<0) {
// load from wave synth
for (int i=0; i<len; i++) {
unsigned char addr=(pos+i); // address (nibble each)
if (addr>=((0x78-(chanMax<<3))<<1)) { // avoid conflict with channel register area
break;
if (ch>=0) {
for (int i=0; i<len; i++) {
unsigned char addr=(pos+i); // address (nibble each)
if (addr>=((0x78-(chanMax<<3))<<1)) { // avoid conflict with channel register area
break;
}
unsigned char mask=(addr&1)?0xf0:0x0f;
int data=chan[ch].ws.output[i];
rWriteMask(addr>>1,(addr&1)?(data<<4):(data&0xf),mask);
}
unsigned char mask=(addr&1)?0xf0:0x0f;
int data=chan[ch].ws.output[i];
rWriteMask(addr>>1,(addr&1)?(data<<4):(data&0xf),mask);
}
} else {
// load from custom
Expand Down

0 comments on commit b384367

Please sign in to comment.