int MDEC_StateAction(StateMem *sm, int load, int data_only) { SFORMAT StateRegs[] = { SFVAR(ClockCounter), SFVAR(MDRPhase), #define SFFIFO32(fifoobj) SFARRAY32(&fifoobj.data[0], fifoobj.data.size()), \ SFVAR(fifoobj.read_pos), \ SFVAR(fifoobj.write_pos), \ SFVAR(fifoobj.in_count) SFFIFO32(InFIFO), SFFIFO32(OutFIFO), #undef SFFIFO SFARRAY(&block_y[0][0], sizeof(block_y) / sizeof(block_y[0][0])), SFARRAY(&block_cb[0][0], sizeof(block_cb) / sizeof(block_cb[0][0])), SFARRAY(&block_cr[0][0], sizeof(block_cr) / sizeof(block_cr[0][0])), SFVAR(Control), SFVAR(Command), SFVAR(InCommand), SFARRAY(&QMatrix[0][0], sizeof(QMatrix) / sizeof(QMatrix[0][0])), SFVAR(QMIndex), SFARRAY16(&IDCTMatrix[0], sizeof(IDCTMatrix) / sizeof(IDCTMatrix[0])), SFVAR(IDCTMIndex), SFVAR(QScale), SFARRAY16(&Coeff[0], sizeof(Coeff) / sizeof(Coeff[0])), SFVAR(CoeffIndex), SFVAR(DecodeWB), SFARRAY32(&PixelBuffer.pix32[0], sizeof(PixelBuffer.pix32) / sizeof(PixelBuffer.pix32[0])), SFVAR(PixelBufferReadOffset), SFVAR(PixelBufferCount32), SFVAR(InCounter), SFVAR(RAMOffsetY), SFVAR(RAMOffsetCounter), SFVAR(RAMOffsetWWS), SFEND }; int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MDEC"); if(load) { InFIFO.SaveStatePostLoad(); OutFIFO.SaveStatePostLoad(); } return(ret); }
void MDEC_StateAction(StateMem *sm, const unsigned load, const bool data_only) { SFORMAT StateRegs[] = { SFVAR(ClockCounter), SFVAR(MDRPhase), #define SFFIFO32(fifoobj) SFPTR32(&fifoobj.data[0], sizeof(fifoobj.data) / sizeof(fifoobj.data[0])), \ SFVAR(fifoobj.read_pos), \ SFVAR(fifoobj.write_pos), \ SFVAR(fifoobj.in_count) SFFIFO32(InFIFO), SFFIFO32(OutFIFO), #undef SFFIFO SFVARN(block_y, "&block_y[0][0]"), SFVARN(block_cb, "&block_cb[0][0]"), SFVARN(block_cr, "&block_cr[0][0]"), SFVAR(Control), SFVAR(Command), SFVAR(InCommand), SFVARN(QMatrix, "&QMatrix[0][0]"), SFVAR(QMIndex), SFVARN(IDCTMatrix, "&IDCTMatrix[0]"), SFVAR(IDCTMIndex), SFVAR(QScale), SFVARN(Coeff, "&Coeff[0]"), SFVAR(CoeffIndex), SFVAR(DecodeWB), SFVARN(PixelBuffer.pix32, "&PixelBuffer.pix32[0]"), SFVAR(PixelBufferReadOffset), SFVAR(PixelBufferCount32), SFVAR(InCounter), SFVAR(RAMOffsetY), SFVAR(RAMOffsetCounter), SFVAR(RAMOffsetWWS), SFEND }; MDFNSS_StateAction(sm, load, data_only, StateRegs, "MDEC"); if(load) { InFIFO.SaveStatePostLoad(); OutFIFO.SaveStatePostLoad(); PixelBufferCount32 %= (sizeof(PixelBuffer.pix32) / sizeof(PixelBuffer.pix32[0])) + 1; } }