Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monster Gate (Japan) - Screen Covered With Dashes With Max Cards #145

Open
HeroponRikiBestest opened this issue May 6, 2023 · 2 comments
Assignees
Labels
GBA Issues with the GBA core LCD Issues with LCD emulation

Comments

@HeroponRikiBestest
Copy link

If you fill all 10 of your cards/items slots, the screen will be covered with dashes, and this will show up everytime you open your list of cards (which is pretty much all the time, since you need it to use items)
Seems to occur on Rev 1 as well, and the save seems to work there too, but most testing was done with the original version.

This issue was fixed in mGBA in commit mgba-emu/mgba@4ce9b83 between releases 0.1.0 and 0.1.1, and the game has continued functioning properly from there until now, as of the latest nightly..

Apparently, this is the result of a documentation error in gbatek. While I don't know of any existing correct documentation, it seems like mode0 can only use the first 64k of vram for background tiles.

To reproduce, load the following save file, choose to continue, and immediately walk to the right; your 10th card slot will be filled up, and the card screen will display, showing the issue.
Monster Gate (Japan).sav.zip

monstergate

file: Monster Gate (Japan).gba
sha256: <3b48a60acb92f0ca17772a0d551656cd550968cfa720e83f8abe48bd0064d5ad>

Tested on latest commit
Tested on Linux Mint 21.1

@shonumi
Copy link
Owner

shonumi commented May 6, 2023

Thanks for the detailed info! The save is also very much appreciated. I'll look into this as soon as I can.

@shonumi shonumi self-assigned this May 6, 2023
@shonumi shonumi added GBA Issues with the GBA core LCD Issues with LCD emulation labels May 6, 2023
@HeroponRikiBestest
Copy link
Author

Further research done at nanoboy, added with nba-emu/NanoBoyAdvance@8739672

If this is it then it is indeed what I suspected: open bus from the internal background VRAM bus. This means that the data that was most recently (successfully) read from background VRAM is read and interpreted as tile data.
In the simple case where only one background layer is enabled this is the tile map entry that was fetched before the tile data.
With multiple background layers the situation most likely is more complicated and the data that is returned could be map or tile data from another background layer.
Monster Gate still works with my change, so that's good.

I think I pretty much confirmed that it's open bus and background layers can affect other background layers.
Luckily this is very easy to support with NBA's cycle-accurate PPU emulation.
Other emulators are advised to just return 0 for the out-of-bounds accesses, since they do not replicate the proper VRAM access patterns for open-bus to return the right values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GBA Issues with the GBA core LCD Issues with LCD emulation
Projects
None yet
Development

No branches or pull requests

2 participants