Getting Started

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Pixelgamer
New Member
Posts: 8
Joined: Thu Nov 24, 2005 10:56 pm
Location: Örebro, Sweden

Getting Started

Post by Pixelgamer »

Hi. I just found out today about all those things about making a snes game with assembler 65816. But I got some nooby questions and things to straighten up for all of you. (:

First, 65816 used for SNES-programming, coul u say this to be the language? And if almost: what is it really called? Or is the number just some sort of "version" of assembly which uses different keywords?

Secondly, 6502? Is this the asm. ver. used to programm NES-games? And could you call it a parent to 65816?

Thirdly, I've senn both 65816 and 65c816 while surfin' the net. Really, what does that c mean?

Fourthly (lol can you say that word?), Is x816 and WLA the two biggest compilers for compiling asm. 65816 code?

Fifthly (Starting to get tiresome), I've tried with both x816 and WLA to compile a usable .smc file, but haven't managed. First I got the error "not enough memory" for x816 but then i changed some memory things and compatibility mode and got it to work. But still when i try compile some source code i have, it won't make any fole out of this, and neither do i get an error? wth am i doing wrong?
I didn't got it to work with WLA, so could someone please explain what to do, or give me a source code u know works so I can try and see if there isn't anything corrupt which my files (which there probably isn't).

Btw, I got these two programs from nesdev.parodius.com (Snes-starterkit and x816). Or is there any other place to get these?

I tried looking for an easy faq or so, but I catually I must be quite dumb =P
So please answer I'm waiting =)
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

First, 65816 used for SNES-programming, coul u say this to be the language? And if almost: what is it really called? Or is the number just some sort of "version" of assembly which uses different keywords?
Yes, this is the programming language, commonly referred to as 65816 asm.
Secondly, 6502? Is this the asm. ver. used to programm NES-games? And could you call it a parent to 65816?
6502 is the CPU for the NES. So, yes it's the asm version for NES games.

This is all I can answer for you, sorry.
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Re: Getting Started

Post by creaothceann »

Pixelgamer wrote:First, 65816 used for SNES-programming, coul u say this to be the language? And if almost: what is it really called? Or is the number just some sort of "version" of assembly which uses different keywords?
"65816" is the name of the processor. CPUs don't use a language, they just expect opcodes and opcode parameters. ASM is one way to write down these opcodes in a more readable way; the "language" could then be called "65816 ASM" or "65816 assembler" or "65816's ASM dialect" or whatever you want to use.
Pixelgamer wrote:Secondly, 6502? Is this the asm. ver. used to programm NES-games? And could you call it a parent to 65816?
Yep, the 6502 CPU is the 65816's precursor (w?) in the same processor family.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Pixelgamer
New Member
Posts: 8
Joined: Thu Nov 24, 2005 10:56 pm
Location: Örebro, Sweden

Post by Pixelgamer »

okey thanks for tha fast replies =)

Sorry if I have missed any faq or noob-guide around here, but could u in that case point me to a tutorial on how to compile using x816 or WLA? Or maybe even better, just try to answer here and help me (:
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: Getting Started

Post by grinvader »

Pixelgamer wrote:Thirdly, I've senn both 65816 and 65c816 while surfin' the net. Really, what does that c mean?
The 65C816 is the CMOS version of the 65816. Meaning it has a few opcodes more than the 65816.
Anyway, the SNES main cpu is a 5A22, a custom chip very close to a 65c816 but not the exact same. The differences are probably minimal but could probably cause troubles with programs made for a 65816.
Fifthly (Starting to get tiresome), I've tried with both x816 and WLA to compile a usable .smc file, but haven't managed.
A SMC file is already compiled. It's a binary, the program for the chip to run (it also should have a SMC header for copier use only).
You don't feed binary to a compiler, you give it source.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Pixelgamer
New Member
Posts: 8
Joined: Thu Nov 24, 2005 10:56 pm
Location: Örebro, Sweden

Re: Getting Started

Post by Pixelgamer »

grinvader wrote:
Fifthly (Starting to get tiresome), I've tried with both x816 and WLA to compile a usable .smc file, but haven't managed.
A SMC file is already compiled. It's a binary, the program for the chip to run (it also should have a SMC header for copier use only).
You don't feed binary to a compiler, you give it source.
Oops sry, I must have explained unclearly, i had some source code, which i wanted to make a smc file from, but I didn't manage it to work =/

Edit: At least I have been able to compile the source codes which comes with WLA in the starter pack, but I haven't been able to compile anything else with WLA, let alone x816...
byuu

Post by byuu »

Try using a real cross assembler.

file.asm :

Code: Select all

lorom

org $8000 : fill $20000 ;pad some space on the image

;add a quick header
org $ffc0
  db 'ROM TITLE            '
  db $30   ;lorom ($31 = hirom)
  db $02   ;rom+save ram
  db $08   ;2mbit rom
  db $03   ;64kb sram
  db $00   ;japan
  db $00   ;no developer
  db $01   ;version 1.1
  dw $0000 ;inverse checksum
  dw $ffff ;checksum

  dw $ffff,$ffff,$ffff
  dw $ffff ;brk
  dw $ffff
  dw $8c00 ;nmi
  dw $ffff
  dw $8800 ;irq
  dw $ffff,$ffff
  dw $ffff ;cop
  dw $ffff,$ffff,$ffff
  dw $8000 ;reset
  dw $ffff

org $8000
  - bra -
then run: xkas file.asm file.smc
Pixelgamer
New Member
Posts: 8
Joined: Thu Nov 24, 2005 10:56 pm
Location: Örebro, Sweden

Post by Pixelgamer »

Thx for the code, it compiled very easily with x816, but what is this cross plattform assembler xkas? Just another assembler for 65816?
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

byuu wrote:

Code: Select all

  db $01   ;version 1.1
'revision', not 'version'.

</nitpick>
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Pixelgamer
New Member
Posts: 8
Joined: Thu Nov 24, 2005 10:56 pm
Location: Örebro, Sweden

Post by Pixelgamer »

Don't you always say version? What does revision mean? and Why revision and not version in this case? Is it because you don't realease different versions of a snes game, just the Final version, and the rest b4 that is just different revisions?
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Code: Select all

<grinvader> it is "revision" and not "version", just because the official term is 'revision', right ?
<DrNach> It's officially Revision, and it's also logically Revision
<grinvader> thanks
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
byuu

Post by byuu »

It's officially Revision, and it's also logically Revision
re·vi·sion (r-vzhn) n.

1. The act or process of revising.
2. A revised or new version, as of a book or other written material.

re·vise (r-vz) tr.v. re·vised, re·vis·ing, re·vis·es

1. To prepare a newly edited version of (a text).
2. To reconsider and change or modify: I have revised my opinion of him. See Synonyms at correct.

Therefore, by definition: the first release of a game cannot possibly be a revision. You fail. But I have no intentions of discussing this matter any further, call it whatever the hell you like, and I'll do the same.

Oh, and please don't argue that the first version is a "new version", the intent made by the definition is clearly implying that a version already existed beforehand.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

byuu wrote:the intent made by the definition is clearly implying that a version already existed beforehand.
Are you forgetting the concept of betas ? The released games aren't the first revision at all.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

A Revision of zero means no Revision, I don't think this is a hard concept.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Jipcy
Veteran
Posts: 768
Joined: Thu Feb 03, 2005 8:18 pm
Contact:

Post by Jipcy »

byuu wrote:

Code: Select all

  db $01   ;version 1.1
So, going by what Nach and grinvader say, would this be Version 1, Revision 1? Meaning, there was an initial release, Version 1, Revision 0, followed by Version 1, Revision 1?

byuu, has version 1 had any revisions? Or do you start with 1.1 as the first version, no revisions?
[url=http://zsnes-docs.sf.net]Official ZSNES Docs[/url] | [url=http://zsnes-docs.sf.net/nsrt]NSRT Guide[/url] | [url=http://endoftransmission.net/phpBB3/viewtopic.php?t=394]Using a Wiimote w/ emulators[/url]
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

revision is the correct term - its revision 1.1. the values are arbitrary, there is nothing stopping somebody from using A as the first revision.

Version only applies in comparison to something else - the word has been co-opted by marketing, so you get #3 - the abused meaning everyone uses.

1. A description or account from one point of view, especially as opposed to another: Your version of the accident differs from mine.

3. A particular form or variation of an earlier or original type: downloaded the latest version of the software from the Internet.
4. An adaptation of a work of art or literature into another medium or style: the film version of a famous novel.

version also isn't derivative of revision.
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
byuu

Post by byuu »

Interesting, I didn't bother to check the definition of version. That just seems wrong to me though. The prefix re- applies "again" or "next". Taking that off logically implies that something could be the first version. But apparently that's not possible according to the definition at dictionary.com.

Ah well, I'll call it what I want and you do the same. We can agree to disagree.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

byuu wrote:Try using a real cross assembler.

file.asm :

Code: Select all

lorom

org $8000 : fill $20000 ;pad some space on the image

;add a quick header
org $ffc0
  db 'ROM TITLE            '
  db $30   ;lorom ($31 = hirom)
  db $02   ;rom+save ram
  db $08   ;2mbit rom
  db $03   ;64kb sram
  db $00   ;japan
  db $00   ;no developer
  db $01   ;version 1.1
  dw $0000 ;inverse checksum
  dw $ffff ;checksum

  dw $ffff,$ffff,$ffff
  dw $ffff ;brk
  dw $ffff
  dw $8c00 ;nmi
  dw $ffff
  dw $8800 ;irq
  dw $ffff,$ffff
  dw $ffff ;cop
  dw $ffff,$ffff,$ffff
  dw $8000 ;reset
  dw $ffff

org $8000
  - bra -
then run: xkas file.asm file.smc
Slap that in a text file and include it in the zip with xkas I think that was the missing link for recommending xkas to be used for creating new ROMs over the competition for new homebrew developers. A few people I spoke to didn't quite undersatnd how to create a working new ROM with it even after I explained what they need to do to them. A picture(or code example in this case is worth a thousand words.)

My answer to almost any WLA problem is to use xkas! Aside from being functionally sound and superior, it's more intuitive to use. xkas is my most frequently used SNES hacking tool.
Last edited by Nightcrawler on Tue Nov 29, 2005 2:54 pm, edited 1 time in total.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
Overload
Hazed
Posts: 70
Joined: Sat Sep 18, 2004 12:47 am
Location: Australia
Contact:

Post by Overload »

Byuu is correct, it is version but it is not the software version it is the production version. The software version only appears on eproms submitted to nintendo. Overload wins!
byuu

Post by byuu »

My answer to almost any WLA problem is to use xkas! Aside from being functionally sound and seperior, it's more intuitive to use. xkas is my most frequently used SNES hacking tool.
I can't understand why anyone would want to write memory mapping code for every single bank when two ROM formats can allow for modification of all but four SNES games. Albeit you may occasionally have to "lie" about the address (basically, use base + org at the same time) in some very weird cases. WLA was never specifically optimized for the SNES target. xkas does everything x816 does and more, and it does it faster and better. I have no idea why people keep using WLA and x816 to this day. PsyQ is the only assembler better, and it's not exactly freeware.
And honestly, xkas isn't really even that good. It's just the competition is that much worse.
Byuu is correct, it is version but it is not the software version it is the production version. The software version only appears on eproms submitted to nintendo. Overload wins!
Hooray. I'm glad you addressed that, I didn't even feel like responding to grinvader's comments about beta versions :/
No offense grin, we still love you :D
Pixelgamer
New Member
Posts: 8
Joined: Thu Nov 24, 2005 10:56 pm
Location: Örebro, Sweden

Post by Pixelgamer »

So what assembler do people advise me to use? :P xkas? ^^
And where can i get it? (I could probably googled, but what if I find a scam site with like 100 viruses? ;))
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Pixelgamer
New Member
Posts: 8
Joined: Thu Nov 24, 2005 10:56 pm
Location: Örebro, Sweden

Post by Pixelgamer »

Thanks, but is there really not a newer version of xkas? (:
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

Pixelgamer wrote:Thanks, but is there really not a newer version of xkas? (:
What are you talking about? That's the newest version. There is no newer version because it doesn't NEED a newer version. Unless Byuu comes up with some new feature he decides to add, which at this point is getting unlikely due to the large number of features already there, why would a new version be needed?

It's pretty darn bug free as well. I have been using it regularly for an assortment of applications and have had no problem with it.

So, really? What is your issue with needing a newer version?
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
byuu

Post by byuu »

Well, I can't release a new version because I rewrote the string parsing library to be a lot faster / cleaner, and adding in the new library means rewriting most of xkas.
But I would like to try and merge the 65c816 and spc700 assemblers into one. It would be nice to add 'stupid' header generation for those that don't bother to make their own.
Something like
header {
name = "whatever"
reset = $8000
} ;anything not listed is set to defaults, or not modified at all

But x816 is what... like 8 years old now? :/
Post Reply