High level SMB Disassembly on RHDN

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
Hamtaro126
Posts: 818
Joined: Thu Jan 19, 2006 5:08 pm

High level SMB Disassembly on RHDN

Post by Hamtaro126 »

The RHDN release seems to not have a good upload...

As in: It is corrupt.

Movax12, Can you please solve it?

EDIT: The person actually posted a corrupted link posing as a ZIP file using the WikiSend File Shareing site, He should find a better place to upload things like this!
AKA SmilyMZX/AtariHacker.
User avatar
Movax12
Posts: 541
Joined: Sun Jan 02, 2011 11:50 am

Re: High level SMB Disassembly - Corrupted Released

Post by Movax12 »

I'm sure it will be resolved soon.
User avatar
Movax12
Posts: 541
Joined: Sun Jan 02, 2011 11:50 am

Re: High level SMB Disassembly - Corrupted Released

Post by Movax12 »

This is fixed, Hamtaro126. Please see http://www.romhacking.net/documents/635/


Edit: Maybe we could change the title of this thread? Maybe: High level SMB Disassembly - Released
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: High level SMB Disassembly - Corrupted Released

Post by rainwarrior »

Here, I made some FCEUX debugging symbols with this, for people who would like to inspect it with FCEUX.

(It also works on a regular SMB ROM, you don't need to go compiling Movax12's.)
Attachments
smbdisHL_fceux_symbols.zip
(27.31 KiB) Downloaded 259 times
teremochek
Posts: 12
Joined: Thu Mar 07, 2013 6:32 am

Re: High level SMB Disassembly - Corrupted Released

Post by teremochek »

Hey. The really interesting code!
I want to ask questions.
When I change the source code (make mistakes), then build, wait, and nothing happens.
In the folder "obj" appears Fail "smbdishl.o". No more files do not.
What a way to debug?
User avatar
Movax12
Posts: 541
Joined: Sun Jan 02, 2011 11:50 am

Re: High level SMB Disassembly - Corrupted Released

Post by Movax12 »

I don't think I understand the problem. Could you try to explain more?

If you are getting an assembly error, please check the line referenced in the error output.
Example: There is something wrong at line 188:

src\smbdishl.s(188): Error: Unexpected trailing garbage characters
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: High level SMB Disassembly - Corrupted Released

Post by tepples »

The problem with ca65's error messages for programs that use lots of macros is that "Unexpected trailing garbage characters" shows up on the line where the macro is called even if the error is inside the macro.
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: High level SMB Disassembly - Corrupted Released

Post by thefox »

tepples wrote:The problem with ca65's error messages for programs that use lots of macros is that "Unexpected trailing garbage characters" shows up on the line where the macro is called even if the error is inside the macro.
This was fixed (kind of) a long time ago, but I'm not sure if the change has made it in to the release version yet. In some situations what you described will still occur, but it's pretty rare.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
Movax12
Posts: 541
Joined: Sun Jan 02, 2011 11:50 am

Re: High level SMB Disassembly - Corrupted Released

Post by Movax12 »

tepples wrote:The problem with ca65's error messages for programs that use lots of macros is that "Unexpected trailing garbage characters" shows up on the line where the macro is called even if the error is inside the macro.
There was the opposite problem for some time with the snapshot releases: It would only show the error line inside the macro and not where it was called from at all. This was fixed: The error messages are pretty verbose/helpful now.
teremochek
Posts: 12
Joined: Thu Mar 07, 2013 6:32 am

Re: High level SMB Disassembly on RHDN

Post by teremochek »

Now I'm running CMD and see a error message.

Code: Select all

ld65.exe: Warning: src\nes.cfg(9): Memory area overflow in 'ROM', segment 'CODE' (1 bytes)
ld65.exe: Error: src\nes.cfg(9): Start adress too low in 'ROM', segment 'VECTORS'
User avatar
Movax12
Posts: 541
Joined: Sun Jan 02, 2011 11:50 am

Re: High level SMB Disassembly on RHDN

Post by Movax12 »

Unfortunately there is no room left in the ROM. If you want to add code you're going to have to figure out what you can remove or a way to add banks.
Last edited by Movax12 on Fri Mar 08, 2013 1:56 pm, edited 1 time in total.
teremochek
Posts: 12
Joined: Thu Mar 07, 2013 6:32 am

Re: High level SMB Disassembly on RHDN

Post by teremochek »

Movax12 wrote:Unfortunately there is no room left in the ROM. If you want to add code you're going to have to figure out what you can remove or a way to add banks.
If I add a bank, then the new code will work with your code?

What is better to remove the code inside?

Another question. Which program is better to edit the code?
teremochek
Posts: 12
Joined: Thu Mar 07, 2013 6:32 am

Re: High level SMB Disassembly on RHDN

Post by teremochek »

Can anyone explain how to add a bank?

(Good idea to port Mario for easy programming language. I do not understand how the assembler, too many unclear statements.)
User avatar
qbradq
Posts: 972
Joined: Wed Oct 15, 2008 11:50 am

Re: High level SMB Disassembly on RHDN

Post by qbradq »

There's been a lot of discussion about this in the past, but I'll give you the 10,000-foot view as a starting point. Also, I'd like to mention that this is an excellent first hack to get your feet wet with NES development! Don't dismiss it as too complex!

First, understand what a memory mapper is and what it does. The wiki doesn't really have a high-level overview, so I'll start with that.

The NES's memory goes something like this:
$0000 - $07FF RAM
$0800 - $7FFF Registers and etc.
$8000 - $FFFF Game code and data

That gives you 2KB of RAM and 32KB of game code and data to work with, of which SMB uses just about all of it. Using only the NES, there is no way to access more game code or data.

A memory mapper allows a game to access game code and data beyond the 32KB limit by means of "bank switching". For instance, if we have a game with 128KB of code and data, we could think of it as 4 separate 32KB "banks", and we could call them banks 0 through 3. By means of bank switching, we can select which of the four banks are visible to the NES in the address space $8000 - $FFFF at any given time.

One way to approach extending SMB into multiple banks is to use the fairly simple BNROM mapper, which provides 4 separate 32KB banks for code and data, but uses RAM for the character patterns.

The strategy is to embed all character data (8KB) into the first bank, along with the code to load that data into character RAM, and the rest of the code to initialize the system. The other three banks will contain copies of the original 32KB SMB code and data bank with your code modifications, consuming level data to make up the extra room. Finally you split the level data into separate banks and change the level load routine to bank switch prior to passing the data pointer back.

There are other approaches that have been used in the past, and many more to come I'm sure.
User avatar
cpow
NESICIDE developer
Posts: 1097
Joined: Mon Oct 13, 2008 7:55 pm
Location: Minneapolis, MN
Contact:

Re: High level SMB Disassembly on RHDN

Post by cpow »

I wonder if I'd face any repercussions making a NESICIDE project out of this? Source code is OK but CHR is not?
Post Reply