LIJI32 / SameBoy

Game Boy and Game Boy Color emulator written in C
https://sameboy.github.io/
Other
1.66k stars 207 forks source link

Space Invasion Weirdness #303

Open GreatHierophant opened 3 years ago

GreatHierophant commented 3 years ago

The Unlicensed Game Space Invasion (a Space Invaders clone by Thalamus Interactive) works okay until the game starts. When the game starts, the shots from the enemies behave very strangely. The shots use the wrong sprites at times, sometimes will drop down nowhere near an enemy and sometimes background titles get redrawn for no apparent reason. This behavior does not appear when the game is run on an original GBC with an EverDrive or on bgb.

ghost commented 2 years ago

Fails on GBA, CGB-E. Usually (*) okay on CGB-0, B, C, D.

(*) Strangeness depends on random power-up state. Sometimes it generates patterns where some invaders will shoot oddly-placed, junk-looking shots.


Game also fails to load on latest master commit https://github.com/LIJI32/SameBoy/commit/f78fac12c2456e67363efa78fad1ee87998f9f3a

It's a MBC1 clone.

http://archive.nes.science/nesdev-forums/f20/t17471.xhtml#p220696

by Great Hierophant on 2018-07-06 Rocket Games single game GBC releases use an MCB1 clone, but it's header needs to be fixed to work with most emulators and flash carts. Designate them as MCB1 (Cartridge Type 01), make sure the ROM and RAM size is correct (never any RAM), restore the Nintendo logo and fix the header checksum.

by lidnariq on 2018-07-06 BennVenn's analysis of Datel's Game Boy Modem indicated that the logo was stored in the MBC itself, and the MBC knows when to switch between the external ROM (for the desired logo) and the internal ROM (for the TMSS circumvention).


Or you can check others' work here https://github.com/tzlion/hhugboy https://github.com/tzlion/hhugboy/tree/d86491a3992f2b70b19582ba6f4d16bee781b2fd/src/memory/mbc https://github.com/tzlion/hhugboy/blob/120e606a9be6872d6b7721216f52308145eb33d0/src/memory/mbc/MbcUnlRocketGames.cpp

which I think NewRisingSun covers the multi-cart Rocket also.

radimerry commented 2 years ago

This behavior does not appear when the game is run on an original GBC with an EverDrive or on bgb.

BGB emulates a CGB A-C model. Your EverDrive is highly likely A-C revision. Rev D-E + GBA has problems.

ROM1:44EF FA B6 C7         ld   a,(C7B6)
ROM1:44F2 3C               inc  a
ROM1:44F3 EA B6 C7         ld   (C7B6),a

ROM1:44F6 FE 23            cp   a,23
ROM1:44F8 20 05            jr   nz,44FF  <-- game bug: should be jr c, 44ff

ROM1:44FA 3E 00            ld   a,00
ROM1:44FC EA B6 C7         ld   (C7B6),a

Game doesn't initialize a memory value at C7B6, which very often is FF on the A-C models and avoids the problem. It can get an odd value like 7F but the error shows up more rarely.

SameBoy uses CGB E by default, which can be switched. Otherwise it's not an emulator error.