SimpleNES icon indicating copy to clipboard operation
SimpleNES copied to clipboard

[Discuss] Add support to Rad Racer II (4screen mirroring, scanline IRQ)

Open grimoire opened this issue 3 years ago • 7 comments

Hi, I am working on support Rad Racer II. Which include 4 screen and scanline IRQ.

before:

uXjf7ex4SI

After:

tSkLZLW0sk E3ovBQVBFu

There are still some glitch, I guess it has something to do with the way I add scanline IRQ in PPU. But I have no idea how to fix it.

I have add extra RAM in mapper to support nametable 2 and 3. It would be much easer to just resize the picturebus. But I think we should emulate what the NES do, right? Would it be better to add another mirroring type MapperControled so we can support more complex mirroring for some Mapper?

grimoire avatar Jul 13 '22 13:07 grimoire

Thank you for the pull request!

I have add extra RAM in mapper to support nametable 2 and 3. It would be much easer to just resize the picturebus. But I think we should emulate what the NES do, right? Would it be better to add another mirroring type MapperControled so we can support more complex mirroring for some Mapper?

I think this approach is good, since it's mapper specific, the extra memory should go there. I like the idea of MapperControlled!

amhndu avatar Jul 17 '22 11:07 amhndu

Hey, sorry for the delay. I'm currently cleaning up some mappers, including MMC3, unfortunately I have little time, so I'm not done yet. I'll try to clean that as soon as possible. I also just found out that nametable isn't correctly read from an iNES file. I'll need to fix that before this will work well.

MapperControlled

After reading more about this, I realize that FourScreen and MapperControlled basically mean the same thing. I don't think we need a new enum for that anymore.

amhndu avatar Jul 31 '22 16:07 amhndu

MMC5 has a complex mirroring mode which is configured by a mapping register, that is why I add this new enum (maybe renaming the FourScreen would be better?).

I am refactoring PPU steps following PPU rendering because I thought it has something to do with the glitch (trigger the IRQ by A13). But the glitch still exists after I finish(almost) the refactor. Do you have any idea what should I do to fix it?

By the way, do you need github hooks? Such as format and spellcheck. I have some experiments on that.

grimoire avatar Aug 01 '22 02:08 grimoire

GitHub hooks

That sounds great! Some contributed files have bad indentation, this would really help

amhndu avatar Aug 01 '22 04:08 amhndu

Sure. I will add the hooks after you cleaning up the mappers.

grimoire avatar Aug 01 '22 11:08 grimoire

I've pushed up some changes to master, including a fix for ines header reading. (Although I've yet to find a Rad Racer dump that has the correct 4 screen header). And getting back to NameTableMirroring, I suggest removing MapperControlled, and using FourScreen instead. FourScreen should mean mapper controlled. That's the only it's possible and that's the nesdev wiki seems to be calling it.

amhndu avatar Aug 06 '22 15:08 amhndu

But the glitch still exists after I finish(almost) the refactor. Do you have any idea what should I do to fix it?

I also see glitches in SMB2 and Kirby's Adventure, it's possible that MMC3 itself has a bug. Another functionality missing is the APU, it's possible that some ROMs are using that for timing. Working on the APU is also on my queue.

amhndu avatar Aug 06 '22 15:08 amhndu

Sure. I will add the hooks after you cleaning up the mappers.

Hi I saw that you fixed IRQ did you try rad racer 2 which uses mapper 4 you can try to see if it goes in alien 3 game should go now

SuzieQQ avatar Aug 13 '22 02:08 SuzieQQ

aliens 3 works on 7f4aac5 but failed on 1617ff7. guess I have made some mistake.

grimoire avatar Aug 14 '22 09:08 grimoire

@SuzieQQ Alien 3 works now.

grimoire avatar Aug 15 '22 14:08 grimoire

@SuzieQQ Alien 3 works now. as soon as i can i try it, now i don't remember i had a small list with IRQ bugs with other games maybe super mario 2 should go in game now! this is a particular game they say

SuzieQQ avatar Aug 15 '22 18:08 SuzieQQ

7BDABA39-F5AE-4978-B1E5-B7A2EB7B1D36 84E2F32E-99B6-4878-8C1F-B7FF47D1CE1E F53C1567-27AB-476F-9890-E71A735BC60A CD7972CE-690A-4704-926E-006D641CE75F C42005C0-4022-489B-B908-D8E63033DE81 F3008136-AB34-4E7B-9CE9-EEC0C237DCAD 333BBC14-52D5-4D58-A6A2-0AF3864EED69 D70F6FEA-ECE7-464B-835F-B830A7D9F7CB 87D830F0-EA12-4FC5-AEEA-EF418264E8DC EE6B5BF1-567C-4127-845B-213232F2A361 5D35BCF9-E569-4AEF-B638-68D785BAB301

i have tested all the games i had tried in the past these are the improvements, the rest either behaves the same, or some no longer work. I noticed that in particular all the ninja turtle games never worked

SuzieQQ avatar Aug 16 '22 05:08 SuzieQQ

@SuzieQQ Does SMB3 work now?

amhndu avatar Aug 16 '22 11:08 amhndu

@SuzieQQ Does SMB3 work now?

no, before it went into the menu now graphical glitch and does not enter the menu

SuzieQQ avatar Aug 16 '22 14:08 SuzieQQ

@amhndu @SuzieQQ Hi, I think I find out why SMB3 not working. I download the rom from here and the head[6] & 0x2 is 0, that means no extended RAM. But after IRQ, CPU will try to read $0x7964, which leads to 0 because there is no such RAM. After I force the RAM enable, the game works. IiFPcr2dy6

EGTylpRvW7

I am not sure if it is caused by the ROM(maybe this is a hacked one). Any advice? May I remove else if (addr < 0x8000) branch in MainBus.cpp and leave every read to m_mapper->readPRG(addr)?

grimoire avatar Aug 21 '22 14:08 grimoire

Great find! I think a simpler fix could be to simply always have extended ram available. There's no particular reason to "disable" it I think. I've made some more changes so I'll do the change. This is good work! I can merge this MR if you feel this is in a good state.

amhndu avatar Aug 21 '22 14:08 amhndu