static UInt8 joyIoRead(void* dummy, UInt16 ioPort) { switch (ioPort & 1) { case 0: return boardCaptureUInt8(0, (UInt8)(sg1000JoyIoRead(joyIo) & 0xff)); case 1: return boardCaptureUInt8(1, (UInt8)(sg1000JoyIoRead(joyIo) >> 8)); } return 0xff; }
static UInt8 readA(SviPPI* ppi) { #if 1 // dvik: reverted to 2.8 since wav support is not finished yet return boardCaptureUInt8(16, sviJoyIoReadTrigger(ppi->joyIO)) | (boardGetCassetteInserted() ? 0:0x40); #else UInt8 value; UInt8 casdat = 0; value = boardCaptureUInt8(16, sviJoyIoReadTrigger(ppi->joyIO)); value |= boardGetCassetteInserted() ? 0:0x40; tapeRead(&casdat); value |= (casdat) ? 0:0x80; dacWrite(ppi->dac, DAC_CH_MONO, (casdat & 0x01) ? 0 : 255); return value; #endif }
static UInt8 sviPsgReadHandler(void* arg, UInt16 address) { UInt8 value = 0xff; switch (address) { case 0: value = boardCaptureUInt8(17, sviJoyIoRead(joyIO)); lastJoystickValue = value; break; case 1: value = psgAYReg15; break; } return value; }
static UInt8 readB(SviPPI* ppi) { return boardCaptureUInt8(ppi->row, getKeyState(ppi->row)); }