// this is wrong inline static void dec0YMxxxxIrqHandler(int, int nStatus) { if (nStatus) { m6502SetIRQ(M6502_IRQ); } else { m6502SetIRQ(0); } }
static int DrvFrame() { if (DrvReset) { DrvDoReset(); } m6502Open(0); m6502Run(4000000 / 60); m6502SetIRQ(M6502_IRQ); m6502Close(); if (pBurnSoundOut) { int nSample; int nSegmentLength = nBurnSoundLen; short* pSoundBuf = pBurnSoundOut; if (nSegmentLength) { AY8910Update(0, &pAY8910Buffer[0], nSegmentLength); for (int n = 0; n < nSegmentLength; n++) { nSample = pAY8910Buffer[0][n]; nSample += pAY8910Buffer[1][n]; nSample += pAY8910Buffer[2][n]; nSample /= 4; if (nSample < -32768) { nSample = -32768; } else { if (nSample > 32767) { nSample = 32767; } } pSoundBuf[(n << 1) + 0] = nSample; pSoundBuf[(n << 1) + 1] = nSample; } } } if (pBurnDraw) { DrvDraw(); } return 0; }
void dec_ctrl_writeword(unsigned int a, unsigned short d) { switch (a) { case 0: // Playfield & Sprite priority // dec0_priority_w(0,data,mem_mask); dec_pri_reg=d; printf("priority reg: %x,%x\n",a,d); break; case 2:// DMA flag // dec0_update_sprites_w(0,0,mem_mask); // printf("oh no, is dma: %x,%x\n",a,d); break; case 4: // 6502 robocopSoundLatch = d & 0xFF; bprintf(PRINT_NORMAL, _T("sound code: %x\n"),d); m6502SetIRQ(M6502_NMI); break; case 6: printf("write to i8751 %x, %x\n",a,d); baddudes_i8751_write(d); SekSetIRQLine(5, SEK_IRQSTATUS_AUTO); break; case 8: //mame says int ack for vbl, but just ignores it??? VBL_ACK = false; break; case 0xa: // unknown break; case 0xc: // coin block? break; case 0xe: //reset i8751?? i8751_return=0; break; default: printf("unknown dec_ctrl_writeword %x,%x\n",a,d); } }