AndreaOrru / LaiNES

Cycle-accurate NES emulator in ~1000 lines of code
BSD 2-Clause "Simplified" License
1.49k stars 122 forks source link

Doesn't work for Contra #15

Closed adambarta closed 7 years ago

adambarta commented 7 years ago

?

AndreaOrru commented 7 years ago

This is expected: read the README. Contra uses Mapper 002, which is not currently implemented. For reference, there are 256 different mappers.

It should be pretty straightforward to add support for this one. However, reaching 100% support through a full mapper library is beyond the goals I set for this project, contributions are of course more than welcome. Personally I'd rather improve the core and make it smaller, more accurate and more readable.

johnrocamora commented 7 years ago

@AndreaOrru I think the same can be said for BattleToads, I'll check later to make sure. Awesome project, btw!

AndreaOrru commented 7 years ago

Thanks! All the interest is really motivating for me to keep improving this. BattleToads is the ultimate accuracy beast, I'm expecting some extra fixes will be needed to make it work.

kraln commented 7 years ago

I'll have a look at Mapper 002, and whatever BattleToads uses--see if I can't contribute

kraln commented 7 years ago

Should be solved by https://github.com/AndreaOrru/LaiNES/pull/16 -- note that this exposes some other issues (Castlevania and Contra both have graphical issues, but load and play). I think these issues aren't mapper problems...

AndreaOrru commented 7 years ago

Thanks @kraln, there are various reasons I can think of why there would be graphical problems.

There is a list of issues I wrote 3 years ago and those are good candidates to work on in order to improve accuracy. It all feels kind of weird to me 'cause this unknown thing I built back in uni is now at the center of attention and suddenly worth of love :)

kraln commented 7 years ago

hackernews is weird like that. I'm going to work through some of the to-do list... if you're still willing to moderate the project I'm willing to put some effort in. consider accepting the PR(s) and I can see what else can be done to get contra going?

AndreaOrru commented 7 years ago

Yeah I'm definitely willing to put some effort on this. Thanks for your contributions. :)

johnrocamora commented 7 years ago

I'm guessing that it's because it's concise and uses C++11. A lot of us work/worked on projects that for some reason or other don't/didn't allow us to use modern C++ features (not even boost!), so this is eye candy :)

johnrocamora commented 7 years ago

That and the NES Classic Edition coming out soon and currently being sold out

kraln commented 7 years ago

Just a note, Castlevania, Duck Tales and Duck Tales 2 seem to have similar issues. Contra is especially broken. Commando seems just fine.

AndreaOrru commented 7 years ago

Ok. Are those all mapper 002? There may be something worth investigating there.

In fact Castlevania not loading the background sounds a lot like a mapper problem to me. Most likely the mirroring issue that's listed here on GitHub.

kraln commented 7 years ago

Yes, those are all mapper 002. Mapper 002 has mirroring hard-wired on the cart, so my implementation reads the iNES header to set the mirroring. Is mirroring not fully implemented? I will dig in, then.

kraln commented 7 years ago

Ah, I am reading the wrong header byte. When I read the correct header byte, the aforementioned games work.

kraln commented 7 years ago

18 should resolve.

adambarta commented 7 years ago

Nice! thanks

AndreaOrru commented 7 years ago

Oh, it was a mapper thing after all. Great work @kraln, thank you!

Maybe I should write an internal debugger for this stuff.

kraln commented 7 years ago

@johnrocamora battletoads has partial support as of #28, but seems to be particularly nasty to emulate