From e63fb66b40103c427febfa0b1a8c4119fa4e1a35 Mon Sep 17 00:00:00 2001 From: qeed Date: Mon, 19 Oct 2009 10:18:20 +0000 Subject: [PATCH] [ES-1064] Qi Long Zhu (C) should be mostly playable now, still some graphic glitches though --- src/mappers/253.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/mappers/253.cpp b/src/mappers/253.cpp index 964730a3..9fc52b8e 100644 --- a/src/mappers/253.cpp +++ b/src/mappers/253.cpp @@ -8,12 +8,16 @@ static int32 irq_enable, irq_counter, irq_latch, irq_clock; static void Mapper253_IRQHook(int cycles) { + //basically, this happens at every frame + //0x72 is 114 cycles, so like one scanline + //happens for 0xff scanlines so 256 scanlines (frame) if( irq_enable & 0x02 ) { if( (irq_clock+=cycles) >= 0x72 ) { irq_clock -= 0x72; - if( irq_counter == 0xFF ) + + if( irq_counter == 0xFF) { irq_counter = irq_latch; irq_enable = (irq_enable & 0x01) * 3; @@ -40,22 +44,20 @@ static void SetBank_PPUSUB(int bank, int page) } if ((page == 4) || (page == 5)) { - printf("Page in 4 5: %d\n", page); - if(VRAM_switch == 0) - setchr1( bank << 10, page ); //CHR-ROM - else - setchr1( bank << 10, page ); //CHR-RAM + // [ES-1064] Qi Long Zhu (C).NES game uses CHR-RAM for these pages + //and doesn't seem to set VRAM switch so use + //CHR-RAM as default for now + //if (VRAM_switch == 0) + // setchr1(bank << 10, page); //CHR-ROM + else + setvramb1(&CHRRAM[page << 10], page << 10, 0); //CHR-RAM } else - { - printf("Page: %d\n", page); setchr1(bank << 10, page); - } } static DECLFW(Mapper253_Write) { - printf("Address: 0x%X V: 0x%X\n", A, V); if (A == 0x8010) //8kb select at 0x8000 { setprg8(0x8000, V); @@ -169,9 +171,6 @@ static DECLFW(Mapper253_Write) } X6502_IRQEnd(FCEU_IQEXT); break; - default: - break; - //printf("Not handled 0x%X 0x%X", A, V); } }