Page 1 of 2

Getting started (sticky?)

Posted: Fri Jan 30, 2009 8:29 am
by Jeroen
Ok post stuff to get started in snesdev in this thread:

So far:
http://en.wikibooks.org/wiki/Super_NES_Programming
http://hirudov.com/nintendo/Nintendo.html
http://www.snesdev.net/

Hope to find more info later.

Posted: Sat Jan 31, 2009 4:05 pm
by cybertron
The wikibook is ok I guess for basic things, but is really incomplete

Download MazezaM from here here This is a great framework for SNES program

For the assembler you need WLA-DX

There are tons of text files describing programming and the hardware. I think most of them are on Zophar's Domain. I have a collection of these files, I can email them if anyone wants it...

Programming in assembly isn't as hard as you think, but its still a huge pain to get anything done on that horrible CPU

Posted: Sat Jan 31, 2009 4:46 pm
by Memblers
I remember MazezaM, the player.asm file in there is from my NSF Player. :D
Sounds like it never got implemented though, spc.obj is dated 1994 and sounds like Censor's SID emulator.

If anyone ever wants NES sound in their game, I'll help.

Posted: Sat Jan 31, 2009 11:12 pm
by Hamtaro126
cybertron wrote:The wikibook is ok I guess for basic things, but is really incomplete

Download MazezaM from here here This is a great framework for SNES program

For the assembler you need WLA-DX

There are tons of text files describing programming and the hardware. I think most of them are on Zophar's Domain. I have a collection of these files, I can email them if anyone wants it...

Programming in assembly isn't as hard as you think, but its still a huge pain to get anything done on that horrible CPU
WLA-DX is what I hate about SNES-dev. You have to use .W or .B to try to port NES games. (Although I am also recoding a couple routine)

I am making a hack to enhance SMB1 (porting to SNES) using doppleganger's disassembly (although the game is in SMAS already. SMAS's Sprite arrangement is crappy in it's SMB1/2j port).

Until there is a Windows Assembler with x816 (and SNES Opcode) compatibility and do not have to use .B/.W with opcodes. I am stuck with that one *OUTDATED* assembler

________________________________________

About the NSF Player: I would like it if you can use HEBEREKE.NSF for a demo music player for SNES under one of these two conditions:

1: Make a DPCM porter/converter and player for SNES BBR format (Can give seperate DPCM samples to you to convert to BBR)

2: Use NO DPCM at all, I can do that part already as a modded NSF. Since it is simple to remove DPCM Data and remove DPCM channel ASM

Posted: Sat Jan 31, 2009 11:51 pm
by Celius
On the main page of this site (nesdev, I mean), there's a small section for SNESdev info. I downloaded some of the stuff a while back, and it helped me a lot for getting started. Though I still find lots of the information totally confusing/ambiguous.

Find Qwertie's documentation on SNES video registers. It elaborates more on what Yoshi explains in his docs and what's explained in other places. Which also brings me to say get Yoshi's documentation. I've heard stuff about anomie's documentation on rom hacking dot net which is up to date sort of, but I don't remember finding it very useful (I don't think I looked at it for very long). Then there was some official SFC docs floating around not so long ago, so uh, maybe back those up :wink: .

Then there's probably some good info in this thread:

http://nesdev.com/bbs/viewtopic.php?t=3780

about an emulator to use for debugging.

Then yeah, use WLA-DX. It's really not that awful. But I seriously don't know crap about SNES hardware and all that hi rom low rom crap in the header. Basically where you'll find yourself struggling is in the setting-it-up phase, initializing the system properly and making a good header. I kind of put learning about SNESdev aside after getting annoyed and having completely different results on different emulators with my test roms. I couldn't figure out some of the really basic stuff. I guess we're spoiled with the NES because it's easy to debug your stuff, with everyone having such great and up-to-date tools to do so.

Posted: Sun Feb 01, 2009 6:15 am
by tepples
Hamtaro126 wrote:Until there is a Windows Assembler with x816 (and SNES Opcode) compatibility and do not have to use .B/.W with opcodes. I am stuck with that one *OUTDATED* assembler
CA65 runs on Windows and supports 65C816, leaving only the SPC700 for some other assembler to handle.

Posted: Sun Feb 01, 2009 6:16 am
by Banshaku
Hamtaro126 wrote:Until there is a Windows Assembler with x816 (and SNES Opcode) compatibility and do not have to use .B/.W with opcodes. I am stuck with that one *OUTDATED* assembler
Then write your own.

Posted: Sun Feb 01, 2009 8:27 am
by Hamtaro126
tepples wrote:
Hamtaro126 wrote:Until there is a Windows Assembler with x816 (and SNES Opcode) compatibility and do not have to use .B/.W with opcodes. I am stuck with that one *OUTDATED* assembler
CA65 runs on Windows and supports 65C816, leaving only the SPC700 for some other assembler to handle.
The problem is that CA65 has that in the WIP areas and possibly very incomplete, So the Assembler is no use right now for SNESdev

Yes. Initianization is another gripe, and may look hard. but there is a INIT routine for x816 from SNES Developer's lobby.

I can put together a version of the WLA-DX version of the INIT routine from the original wiki above. That is... once the 65c816 support CA65 has is completed

(If you do not believe me about the WIP support stuff. Look at the ''What's New'' or something like documentation of the current version)

EDIT: I read that may only apply if using CC65 with it, So I can do the assembler then.

EDIT 2 (Off topic): Moral of this part of my story: Make sure you look at EVERY document and website concerning info about it and double/triple check it, or do not talk at all.

Posted: Sun Feb 01, 2009 10:16 am
by Memblers
I thought the unfinished 65816 support was only with the C compiler. I would think the assembler part of it would work fine, I haven't used it though.

Posted: Sun Feb 01, 2009 10:19 am
by Memblers
Hamtaro126 wrote: 2: Use NO DPCM at all, I can do that part already as a modded NSF. Since it is simple to remove DPCM Data and remove DPCM channel ASM
I could do this sometime, I don't think I'm motivated enough to make a DPCM hack though (removing regs writes would be unnecessary since my player would just ignore it).

Posted: Sun Feb 01, 2009 10:25 am
by Hamtaro126
Memblers wrote:
Hamtaro126 wrote: 2: Use NO DPCM at all, I can do that part already as a modded NSF. Since it is simple to remove DPCM Data and remove DPCM channel ASM
I could do this sometime, I don't think I'm motivated enough to make a DPCM hack though (removing regs writes would be unnecessary since my player would just ignore it).
I thought the original player had a bit of a problem with DPCM (and possibly unfixed $4017 writes).

Posted: Sun Feb 01, 2009 10:49 am
by Memblers
Since the emulated memory is all in the WRAM (bank $7F, right?), all register writes will just go into RAM and wait for the sound emulator to pick it up. It ignores $4017 also.

Posted: Wed Feb 04, 2009 6:55 am
by d4s
Hamtaro126 wrote: WLA-DX is what I hate about SNES-dev. You have to use .W or .B to try to port NES games. (Although I am also recoding a couple routine)
Wrong.
You don't have to specify accumulator/index size for wla dx in general and certainly not for porting NES games, it's optional.
It will guess the current mode if you don't specify the size, probably by trying to keep track of the corresponding status flags.
Putting the cpu into emulation mode and a sep #$30 should be enough.

Wla dx might become confused once you start mixing 16bit and 8bit code, but that's another story.


Also, here's a tip from someone who has already struggled to win the battle of getting his code to run on real SNES hardware:
Only use Anomies register documents as reference and disregard all other previously published ones such as Qwerties or even Y0shis, the latter ones will only get you in trouble in the long run.

Anomies doc absolutely is the most accurate and it describes every hardware quirk that can stop your code from running on the real thing.
In fact, it tells you more about the hardware than the available official Nintendo documentation.

If you have trouble understanding something in Anomies docs, consult Nintendos official documentation available on romhacking.net. (the 1995-ish ones, not the 1989 prototype specs.)

Posted: Wed Feb 04, 2009 5:15 pm
by Hamtaro126
d4s wrote: Wrong.
You don't have to specify accumulator/index size for wla dx in general and certainly not for porting NES games, it's optional.
It will guess the current mode if you don't specify the size, probably by trying to keep track of the corresponding status flags.
d4s wrote: Wla dx might become confused once you start mixing 16bit and 8bit code, but that's another story.
True, I will not worry about the Accumulator anymore as long as codes from 16bit has not been mixed with 8bit codes.
d4s wrote: Putting the cpu into emulation mode and a sep #$30 should be enough.
That is also a very wise thing that I could have for NES to SNES conversion, since 6502 is emulated that way
d4s wrote: Also, here's a tip from someone who has already struggled to win the battle of getting his code to run on real SNES hardware:
Only use Anomies register documents as reference and disregard all other previously published ones such as Qwerties or even Y0shis, the latter ones will only get you in trouble in the long run.
Anomie's Documents are what I am using right now, So I am pretty much set

Thanks d4s, And say to that ''Mystery Person'' that I appreciated the tip.

EDIT: The Last Complant about ''Lables'' Unlike ASM6 and others like DASM:

WLADX only uses this:

Code: Select all

Lable:
      ;Insert ASM Routine(s) Here
But Does not allow:

Code: Select all

Lable:       ;Insert ASM Routine(s) Here
And Is the official SNES docs illegal to distribute? If not, Does the official NES2GBC doc have to go in RHDN? I am confused!

Posted: Thu Feb 05, 2009 8:19 am
by cybertron
Did romhacking.net just go down yesterday? Good thing I downloaded that snes developers manual at work :o

I was going to suggest to put this site into the top post...