SNES, where to start?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: SNES, where to start?

Post by nicklausw »

dougeff wrote:I see you are also working on an SNES assembler. Did you know that Disch wrote an SNES assember last year...

http://www.romhacking.net/forum/index.p ... 086.0.html

Also, since you gave us the source code, would you be able to post a link to the compiled .sfc file that you're having trouble with?

I'd like to take a close look at it, make sure you're not getting some kind of assembler error.
Done. (in the repo, click on basic.sfc and click "View Raw" to download)
User avatar
dougeff
Posts: 2876
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: SNES, where to start?

Post by dougeff »

I've noticed in your .cfg file you defined 4 banks of $8000, total $20000.

I believe the smallest SNES ROMs are 2Mbit /8 = (262,144) or $40000 bytes. Shouldn't you have a minimum 8 banks of $8000 ?

Edit. On searching the web, I see some 1 Mbit chips available, so maybe I'm completely wrong.
Last edited by dougeff on Sun Mar 27, 2016 7:36 pm, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: SNES, where to start?

Post by nicklausw »

This is true, 128k roms technically shouldn't be a thing, I might as well change that.

This has no effect on the problem I'm having with higan, however.
User avatar
dougeff
Posts: 2876
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: SNES, where to start?

Post by dougeff »

I edited my above statement while you were typing.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: SNES, where to start?

Post by nicklausw »

I would test out the rom on higan 9.5 (older version) to see if this is a new thing in the emulator, but the emulator didn't get support for loading ROMs outside its library system until the newest version...and the library system doesn't get along well with wine.
User avatar
dougeff
Posts: 2876
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: SNES, where to start?

Post by dougeff »

Well, I checked the entire assembly, and it matches the source code. It seems to work fine in everything except Higan Accuracy.

I'm looking at the save state (Higan) at what appears to be the palette. The color here is listed as ff7f = white, but the screen is displaying a pink. I'm trying to think of what would cause the palette to display wrong. Hmm?


The problem is not 2130 or 2133.

I'm wondering if Higan is flawed.
nesdoug.com -- blog/tutorial on programming for the NES
Near
Founder of higan project
Posts: 1553
Joined: Mon Mar 27, 2006 5:23 pm

Re: SNES, where to start?

Post by Near »

No emulator is perfect, but I'd put odds at 99:100 it's a bug in your code.

Make sure you are properly initializing -all- registers. That's the main thing that breaks games in accuracy; it aggressively randomizes all registers/memory to detect these bugs.
User avatar
dougeff
Posts: 2876
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: SNES, where to start?

Post by dougeff »

Well, I replaced your startup code with a different set that I know works, and sets all registers, and zeros every RAM and VRAM and CGRAM byte. Still get the same weird colors in Higan Accuracy. So, the problem is not your startup code.

This one has stumped me.

I also know exactly which byte of the save-state is the problem $463b7. Changing this byte and reloading save-state causes the weird color issue. I have no idea what this part of the save-state is. I even peeked at the source code of Higan. Still no idea.

It's not the palette. It's not color math or color intensity or color brightness or windows or any other thing that would reasonably affect color.

The startup code is working. The palette is correctly set. The graphics are correctly loaded. The base addresses are correct. Only BG1 is active, so no other backgrounds are interfering.

This one is unsolvable.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
koitsu
Posts: 4203
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: SNES, where to start?

Post by koitsu »

Might I respectfully suggest trying it out on an actual SNES? If the "unexpected" behaviour is the same there, then it's definitely a programming mistake and not an emulator quirk (and thus should be taken seriously). If you can provide an actual ROM image I can try this out for you, assuming I'm told what exactly to look for.
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: SNES, where to start?

Post by nicklausw »

koitsu wrote:If you can provide an actual ROM image I can try this out for you, assuming I'm told what exactly to look for.
What constitutes an "actual ROM image"? The sfc is here, I'm not sure if you need it in some other format or anything.

As for what to look for, what's supposed to happen in this: in the top left corner of the screen, the number '5' is drawn and is white. In higan-accuracy, however, sometimes the number doesn't show up or shows up with a different color. (Note, I can now confirm that this isn't an OS-specific thing). I just want to know which one is correct.

Where can I get a snes flashcart of my own, anyway? I hear they're expensive.
User avatar
koitsu
Posts: 4203
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: SNES, where to start?

Post by koitsu »

nicklausw wrote:What constitutes an "actual ROM image"? The sfc is here, I'm not sure if you need it in some other format or anything.
Nope, that's perfectly fine and exactly what I was wanting.
nicklausw wrote:As for what to look for, what's supposed to happen in this: in the top left corner of the screen, the number '5' is drawn and is white. In higan-accuracy, however, sometimes the number doesn't show up or shows up with a different color. (Note, I can now confirm that this isn't an OS-specific thing). I just want to know which one is correct.
Thanks, that's all I need.

I'll try to test this out either later tonight or on Tuesday, as I don't have much spare time today/tomorrow afternoon.
nicklausw wrote:Where can I get a snes flashcart of my own, anyway? I hear they're expensive.
The two most popular are the Super EverDrive and the SD2SNES. I can only speak to the reliability and quality of the SD2SNES (I wanted something that had a very good menu interface and something that felt better designed), which I bought from Krikzz directly. The devices range from about US$80 to $200, depending on what all you want on them (I paid $190 for mine, which included a proper cartridge case); the Super EverDrive is less expensive.

I've discussed in the past (can't find the post now though, sorry) how these prices are *ridiculously* cheap compared to what we paid for similar devices in the early 90s (the original/major snesdev days), so I don't wanna hear any whinging about how expensive they are -- they're pocket change comparatively, while being significantly more convenient, reliable, and faster than old SNES copiers (which usually went for US$450-800).

If you want one and can't afford it, give me a PayPal address (send me a PM) and I'll be happy to donate money, no strings attached, that'll get you the Super Everdrive. I did this for user 93143 here on the forum to help with his homebrew efforts. I always believe in supporting homebrewers any way I can. It's honestly too bad the tools folks have nowadays for SNES homebrew are almost seem worse than what we had in the 90s -- count your small blessings (SNES9x debug build, no$sns, YYCHR). But you really need to test your code on the actual thing -- emulators are fine for general development and "hey it works!" scenarios, but you should always make sure it works on the real thing.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: SNES, where to start?

Post by tokumaru »

koitsu wrote:But you really need to test your code on the actual thing -- emulators are fine for general development and "hey it works!" scenarios, but you should always make sure it works on the real thing.
Unfortunately, copiers and flash cartridges are still not ideal for development, since they temper with the power up state of the machine, so you can't be absolutely sure your code would work when running from a regular cartridge. This is not a big problem though, since the initialization process is much simpler to fix than the game engine itself. Just make sure you or someone else can test the final game in a standalone cartridge before considering it 100% compatible with the actual hardware.
User avatar
bazz
Posts: 476
Joined: Fri Sep 02, 2011 8:34 pm
Contact:

Re: SNES, where to start?

Post by bazz »

Hey, I see that you've gone off and done other things for 4 pages of this forum thread, but I wrote some tutorials about 10 years ago and it looks they are still "very helpful". I also recognize you from WLA-DX Github, and my tutorials employ WLA DX, so you can't really go wrong there :)
SNES Tutorials (WLA DX)
SNES Memory Mapping Tutorial (Universal / LoROM) -- By Universal I introduce how memory mapping works, rather than just provide a LoROM map.
SNES Tracker (WIP) - Music/SFX composition tool / SPC Debugger
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: SNES, where to start?

Post by nicklausw »

Yeah, I have a very mixed relationship with wla-dx. It's the only assembler I've ever contributed to, but at the same time I refuse to use it for 65xx development simply because it's not meant for it. It can be used for gameboy development (it was originally designed for it actually) but rgbds is just more common (and fully designed around the gameboy,) so I use that instead for convenience. The Sega 8 bit community has WLA on lock-down, though; it's the best assembler there. Of course, I haven't worked with a Sega system in forever now, so basically I don't use it.
User avatar
bazz
Posts: 476
Joined: Fri Sep 02, 2011 8:34 pm
Contact:

Re: SNES, where to start?

Post by bazz »

Right, well I'm not really here to advocate use of any assembler -- I don't care -- but I do still believe there is something special about my tutorials. To be precise, if you use your own assembler and build scripts, I bet you could still learn better from my tutorials -- skipping over any WLA DX specifics -- but the source code would also need to be ported to your flavor.

In fact -- if anyone decides to port my tutorials source code to another assembler, feel free to include the project files as zip archives, in the same fashion the WLA-DX ones are! Eventually, the tutorials could be broken into "Assembler specifics" (ie. memory map / build scripts for assembler "foo") and "General SNES Tutorial" parts -- well it's an idea for somebody :)
Last edited by bazz on Mon Mar 28, 2016 7:00 pm, edited 1 time in total.
SNES Tutorials (WLA DX)
SNES Memory Mapping Tutorial (Universal / LoROM) -- By Universal I introduce how memory mapping works, rather than just provide a LoROM map.
SNES Tracker (WIP) - Music/SFX composition tool / SPC Debugger
Post Reply