mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-12 05:54:03 +00:00
added 0x2123 - 0x212D ppu registers w/ tests
This commit is contained in:
@@ -77,4 +77,128 @@ Test(PPU_write_2, vmdata_full_high_byte_null)
|
||||
pair.first->write(0x2118, 0b11111111);
|
||||
pair.first->write(0x2119, 0b00000000);
|
||||
cr_assert_eq(pair.second.ppu->_vmdata.vmdata, 0b0000000011111111);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, cgadd_full_high_byte_null)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x2121, 0b11111111);
|
||||
cr_assert_eq(pair.second.ppu->_cgadd, 0b11111111);
|
||||
cr_assert_eq(pair.second.ppu->_isLowByte, true);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, cgdata_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x2121, 0b11111111);
|
||||
pair.first->write(0x2122, 0b11111111);
|
||||
cr_assert_eq(pair.second.ppu->_cgdata.cgdatal, 0b11111111);
|
||||
cr_assert_eq(pair.second.ppu->_isLowByte, false);
|
||||
int address = pair.second.ppu->_cgadd;
|
||||
pair.first->write(0x2122, 0b11111000);
|
||||
cr_assert_eq(pair.second.ppu->_cgdata.cgdatah, 0b11111000);
|
||||
cr_assert_eq(pair.second.ppu->_isLowByte, true);
|
||||
cr_assert_eq(pair.second.ppu->_cgadd, address + 1);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, m7sel_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x211A, 0b11111111);
|
||||
cr_assert_eq(pair.second.ppu->_m7sel.playingFieldSize, true);
|
||||
cr_assert_eq(pair.second.ppu->_m7sel.emptySpaceFill, true);
|
||||
cr_assert_eq(pair.second.ppu->_m7sel.horizontalMirroring, true);
|
||||
cr_assert_eq(pair.second.ppu->_m7sel.verticalMirroring, true);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, m7sel_data_actual)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x211A, 0b01111101);
|
||||
cr_assert_eq(pair.second.ppu->_m7sel.playingFieldSize, false);
|
||||
cr_assert_eq(pair.second.ppu->_m7sel.emptySpaceFill, true);
|
||||
cr_assert_eq(pair.second.ppu->_m7sel.horizontalMirroring, true);
|
||||
cr_assert_eq(pair.second.ppu->_m7sel.verticalMirroring, false);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, w12sel_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x2123, 0b11111111);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[0].window1InversionForBg1Bg2Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[0].enableWindow1ForBg1Bg2Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[0].window2InversionForBg1Bg3Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[0].enableWindow2ForBg1Bg3Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[0].window1InversionForBg2Bg4Color, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[0].enableWindow1ForBg2Bg4Color, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[0].window2InversionForBg2Bg4Color, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[0].enableWindow2ForBg2Bg4Color, true);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, w34sel_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x2124, 0b10101010);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[1].window1InversionForBg1Bg2Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[1].enableWindow1ForBg1Bg2Obj, false);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[1].window2InversionForBg1Bg3Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[1].enableWindow2ForBg1Bg3Obj, false);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[1].window1InversionForBg2Bg4Color, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[1].enableWindow1ForBg2Bg4Color, false);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[1].window2InversionForBg2Bg4Color, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[1].enableWindow2ForBg2Bg4Color, false);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, wobjsel_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x2125, 0b10110001);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[2].window1InversionForBg1Bg2Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[2].enableWindow1ForBg1Bg2Obj, false);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[2].window2InversionForBg1Bg3Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[2].enableWindow2ForBg1Bg3Obj, true);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[2].window1InversionForBg2Bg4Color, false);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[2].enableWindow1ForBg2Bg4Color, false);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[2].window2InversionForBg2Bg4Color, false);
|
||||
cr_assert_eq(pair.second.ppu->_wsel[2].enableWindow2ForBg2Bg4Color, true);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, wbglog_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x212A, 0b10110001);
|
||||
cr_assert_eq(pair.second.ppu->_wbglog.maskLogicBg1, 0b10);
|
||||
cr_assert_eq(pair.second.ppu->_wbglog.maskLogicBg2, 0b11);
|
||||
cr_assert_eq(pair.second.ppu->_wbglog.maskLogicBg3, 0b00);
|
||||
cr_assert_eq(pair.second.ppu->_wbglog.maskLogicBg4, 0b01);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, wobjlog_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x212B, 0b10110001);
|
||||
cr_assert_eq(pair.second.ppu->_wobjlog.maskLogicObj, 0b01);
|
||||
cr_assert_eq(pair.second.ppu->_wobjlog.maskLogicColor, 0b00);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, tm_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x212C, 0b10110001);
|
||||
cr_assert_eq(pair.second.ppu->_t[0].enableWindowDisplayBg1, true);
|
||||
cr_assert_eq(pair.second.ppu->_t[0].enableWindowDisplayBg2, false);
|
||||
cr_assert_eq(pair.second.ppu->_t[0].enableWindowDisplayBg3, false);
|
||||
cr_assert_eq(pair.second.ppu->_t[0].enableWindowDisplayBg4, false);
|
||||
cr_assert_eq(pair.second.ppu->_t[0].enableWindowDisplayObj, true);
|
||||
}
|
||||
|
||||
Test(PPU_write_2, ts_data_full)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.first->write(0x212D, 0b10101110);
|
||||
cr_assert_eq(pair.second.ppu->_t[1].enableWindowDisplayBg1, false);
|
||||
cr_assert_eq(pair.second.ppu->_t[1].enableWindowDisplayBg2, true);
|
||||
cr_assert_eq(pair.second.ppu->_t[1].enableWindowDisplayBg3, true);
|
||||
cr_assert_eq(pair.second.ppu->_t[1].enableWindowDisplayBg4, true);
|
||||
cr_assert_eq(pair.second.ppu->_t[1].enableWindowDisplayObj, false);
|
||||
}
|
||||
Reference in New Issue
Block a user