Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello World inconsistencies across emulators

A topic by LogicProjects created Mar 03, 2021 Views: 472 Replies: 5
Viewing posts 1 to 5

Hello!

To prepare for this jam I have been following this tutorial https://en.wikibooks.org/wiki/Super_NES_Programming/Initialization_Tutorial to set up my tools.  The code I built works great on Snes9x and bsnes but on Mesen-S it creates a corrupted graphic with a square MissingNo type pattern (I can't add a screenshot to this post for some reason).  The goal is a solid green screen.  Any ideas what is wrong (is it my code or the emulator)? It's been a struggle to get started learning snes development and I've found many nonworking hello world examples. 

Most importantly is there a way to be sure my code works when I submit to the jam (without owning hardware)? The jam lists mesen and bsnes as the recommended emulators but even at the learning stage I am getting differences between them.

(1 edit)

Also this code: https://github.com/SlithyMatt/snes-hello works on snes9x, creates corrupted sprites on mesen-s, creates a pink background on bsnes and creates a black background on bsnes-plus.  I feel like I'm losing my mind already

Hey. Ive been following the same tutorials lately, and got the same results as you have at first. I managed to fix it, but cant remember exactly how i did it right now. Seems to me though, that 9 times out of 10, it was some sep rep fubar... ie 16 bit when it should have been 8 or vice versa.

Host (5 edits)

Do you have a rom or source code that you can post? My guess is that with Mesen-S it's initializing VRAM to a randomized state (instead of all zeros). Typically that's a emulator config option which would explain the discrepancy between different emulators. Are you using $212C to disable layers you don't need? You can also go into the debugger of bsnes or mesen-s to look at what's in VRAM.


As for tutorials, the ones on the SFC wiki are pretty good, I've followed a couple. libSFX also has a good set of sample programs, but they of course take full advantage of libSFX macros so it might not be an option if you don't want to do that. Unfortunately the issue with homebrew is many people develop tutorials and sample programs based off of aging and inaccurate emulators. For example the hello-snes repo you linked doesn't work on actual hardware either, and it seems like it was developed using snes9x (considered to be out of date at this point)

I've just created a small section in the main jam page with spots for folks to ask for help if they get stuck. There are others that have way better knowledge of the hardware than I do

Thanks for the quick reply! I'm still incredibly new and mostly just trying to get a basic tool chain running.  You nailed it with $212C guess (still haven't dug into what it really is yet though).  In their init code (https://en.wikibooks.org/wiki/Super_NES_Programming/Initialization_Tutorial/Snes...) they used sta instead stz (forgive me not knowing the exact differences yet, I haven't done asm since college) and a discussion page found that changing it made it work with a different emulator and now it works for me with both bsnes and Mesen-S! Great hint!

I've joined the discord and I'm going to check out the tutorials you recommended. It's a shame that there is faulty info out there.  Thanks again, I really appreciate it!