logo
 drop

Main

Community

Submissions

Help

88188454 visitors

Author Topic: OK, starting 6502 work but really puzzled... need help.  (Read 1420 times)

w7n

  • Jr. Member
  • **
  • Posts: 64
  • Location: Nanjing, China
  • Kodoku no Kansokusha.
    • View Profile
    • w7n's SMB Hacks&NES projects page
OK, starting 6502 work but really puzzled... need help.
« on: October 12, 2011, 10:58:08 am »
Well, trying to work on Super Mario Bros. 1... Got 3 questions:
1. The 6502 asm is, of course, very different from languages such as C, Pascal, etc. Though I can understand the meanings of commands, I hardly know what the values in WRAM and others mean. What should I do if I want to know what a specific value mean? I'm completely all thumbs...
2. Well I just figured out that a nonsense series of 'commands' are usually data instead of commands. Of course I need some more experience, so anyone can share some?
3. I'm using a debugger called NO$NES, but I don't know if it's the best. My computer is a million years old, so it cannot survive the attack from FCEUX. Any good debuggers u know?

Thank you Mario, but our #1(How do you call it?) is in another country... So are there English mistakes in the words above? If yes, also tell me.
Recently there's a trend in Chinese SNS & forums to defend the policies, saying that you're nothing without your country.
They would defend GFW even when many foreign sites are blocked, and defend Marxism even when they have to take the bullshit course in school. WTH.

BTW, Acfun comments zone=hell.

Lenophis

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 879
  • Location: Duluth, MN
  • The return of the sombrero!
    • View Profile
    • Slick Productions
Re: OK, starting 6502 work but really puzzled... need help.
« Reply #1 on: October 12, 2011, 12:55:24 pm »
3. I'm using a debugger called NO$NES, but I don't know if it's the best. My computer is a million years old, so it cannot survive the attack from FCEUX. Any good debuggers u know?
Use FCEUXD instead, it doesn't have as much overhead as FCEUX. If you need a couple more features, you can try the other forked version instead.


https://ff6randomizer.codeplex.com/ - Randomize your FF6 experience!

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5830
    • View Profile
    • Nightcrawler's Translation Corporation
Re: OK, starting 6502 work but really puzzled... need help.
« Reply #2 on: October 12, 2011, 12:56:49 pm »
Well, trying to work on Super Mario Bros. 1... Got 3 questions:
1. The 6502 asm is, of course, very different from languages such as C, Pascal, etc. Though I can understand the meanings of commands, I hardly know what the values in WRAM and others mean. What should I do if I want to know what a specific value mean? I'm completely all thumbs...

WRAM is simply general RAM. So, it would be the same as data values in RAM for any C or Pascal program. The only way you're going to know what they mean is either by source code, documentation, or experimentation. :) In most cases, ROM hackers don't have any source code, but in this case we have a commented dis-assembly of SMB in our documents section. You can also check our wiki for a RAM map of SMB. Ultimately though, you figure it out through experimentation. Change some values and see what happens. Study some lines of code that use that memory location to help clue you in. These are the true skills of a ROM hacker and what you'd need for any game not already heavily documented like SMB. That's what the guys who made that documentation did. So, I'd recommend trying to figure it out yourself and using the documentation as a fallback to see if you are right or to lend a helping hand.

Quote
2. Well I just figured out that a nonsense series of 'commands' are usually data instead of commands. Of course I need some more experience, so anyone can share some?

In terms of a ROM, everything is lumped together. You have code, graphics, sound, and other data all lumped together in no discernible organization. It can be tricky distinguishing what is what in a ROM file. You'd use a tile editor to scan for visible graphics as a start. Scan for text with a hex editor that uses a table file or a relative searching program. Using the debugger will greatly help you figure out what section of the ROM are. Also, if you're using a debugger, all commands being executed should definitely be valid code or you have a problem! There shouldn't be any 'nonsense' being executed unless there is a programming error.
TransCorp - Over 15 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Herakles IV SFC/SNES Translations

Klarth

  • Sr. Member
  • ****
  • Posts: 424
  • Location: Pittsburgh
    • View Profile
Re: OK, starting 6502 work but really puzzled... need help.
« Reply #3 on: October 12, 2011, 02:19:00 pm »
Well, trying to work on Super Mario Bros. 1... Got 3 questions:
Though I can understand the meanings of commands, I hardly know what the values in WRAM and others mean. What should I do if I want to know what a specific value mean?
Knowing 6502 isn't enough.  You need to learn the NES hardware (memory map and registers) and you'll discover that things like STA $2007 doesn't mean "store accumulator to $2007" at the system level.  On the NES, it more precisely means "store accumulator to current VRAM address".

w7n

  • Jr. Member
  • **
  • Posts: 64
  • Location: Nanjing, China
  • Kodoku no Kansokusha.
    • View Profile
    • w7n's SMB Hacks&NES projects page
Re: OK, starting 6502 work but really puzzled... need help.
« Reply #4 on: October 13, 2011, 09:35:03 am »
Thanks guys above. With the SMB Memory List, everything is going on quite fine, and I've found some implementations for the Dr. Floppy's SMB1 music hacking guide. (Honestly saying, that guide needs to be updated...)
Recently there's a trend in Chinese SNS & forums to defend the policies, saying that you're nothing without your country.
They would defend GFW even when many foreign sites are blocked, and defend Marxism even when they have to take the bullshit course in school. WTH.

BTW, Acfun comments zone=hell.

Gil Galad

  • Full Member
  • ***
  • Posts: 186
  • Location: Ohio, USA.
    • View Profile
    • Homepage of Gil Galad
Re: OK, starting 6502 work but really puzzled... need help.
« Reply #5 on: December 22, 2011, 11:31:19 pm »
Don't forget about SMBDis. Which is a disassembly of Super Mario Bros. 1. You can assemble the source code with the listed assembler and with a few minor modifications with ASM6. I've done it awhile back, so I know it works.

It may even be possible to make edits to the game. Although, ROM space will be a problem so you may have to use a mapper and then expand.

For NES in particular, there are two types of WRAM. Internal WRAM and cartridge WRAM.

$0 - $07FF - internal WRAM

$6000 - $7FFF - cartridge WRAM

Homepage of Gil Galad || New Forum

“I don’t know half of you half as well as I should like; and I like less than half of you half as well as you deserve. ”