comprehensive SMB1 disassembly

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: short answer

Post by tepples »

tokumaru wrote:It only "makes sense" because "armário" rhymes with "Mario"
This joke works in Spanish too, where "closet" is also armario. A variation might work in English:

-Do you know Hubbard?
-What Hubbard?
-The one that banged you behind the cupboard!
I think people should understand exactly what goes on with a piece of code that was copied and pasted. If they don't, there might just be a case where this code misbehaves (when compared to their expectations) and they are just buying themselves some nasty bugs, while they could have coded something specifically tailored to their needs, and have no nasty surprises.
Code designed to be copied and pasted is called a library, and the ability of a piece of code to act as a library is called modularity. Yes, people who write libraries should state the pre- and post-conditions of each function (whether defined, implementation-defined, unspecified, or undefined), and people who use libraries should understand the pre- and post-conditions of each function and should not depend on any behavior that isn't defined. Otherwise, you get DLL hell when people depend on undocumented behaviors of the library.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: short answer

Post by tokumaru »

tepples wrote:-Do you know Hubbard?
But I don't really know any Hubbard... Mario is famous! =) That, in fact, makes it hard for people to answer "What Mario?"... ¬¬! "Luigi's brother?" is a more common answer, I guess! =)
Yes, people who write libraries should state the pre- and post-conditions of each function (whether defined, implementation-defined, unspecified, or undefined), and people who use libraries should understand the pre- and post-conditions of each function and should not depend on any behavior that isn't defined.
I get it. This makes a lot more sense in today's complicated architectures though... Which is one of the reasons I don't like to program for the PC anymore. It used to be really fun to program in DOS, but windows ruined it all.

Yeah, I'm a control freak, I want to know everything that goes on with my programs. I admit this is a personal issue, and I can acknowledge libraries (even for the NES) as useful things for people that don't want to (or can't) program the whole thing.
User avatar
commodorejohn
Posts: 193
Joined: Mon Sep 11, 2006 6:48 pm
Location: Moose Lake, Minnesota

Re: short answer

Post by commodorejohn »

tokumaru wrote:
commodorejohn wrote:Mind repeating it in Portuguese? I'm just curious.
It's too stupid... so, I ask that any other brazilian members around forgive me for propagating something so stupid...

It goes something like:
-Conhece o Mario?
-Que Mario?
-Aquele que te comeu atrás do armário!

Which translates to:
-Do you know Mario? (kids used to ask other kids this question)
-What Mario? (this was the most likely answer)
-The one that banged you behind the closet! (the first kid, feeling so smart, replied with this)

It only "makes sense" because "armário" rhymes with "Mario"...
That's okay, English has loads of jokes like that =)
Although I find it a little odd that "comeu" is used as slang for that...I'm pretty sure that whatever the connection is, I don't want to know it.
[size=0]"There is only one basic human right, the right to do as you damn well please. And with it comes the only basic human duty, the duty to take the consequences."
- P.J. O'Rourke[/size]
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Post by doppelganger »

beneficii wrote: Actually, I'm curious, what did you do to add the labels? Did you just work them in manually, or did you have a program that added as you disassembled the code?

Additionally, what do you think of using a code data logger to help disassemble?
I worked them in manually. The only things I used were a text editor and a lot of cut and paste, and find and replace. My method was probably very slow and inefficient, but it was simple enough for my purposes. I wasn't trying to re-invent SMB, only figure out what made it tick.

A code data logger would probably only help as far as the actual reverse-engineering phase is concerned. But that can only speed up the process, so I'd be for it, I guess.
Be whatever the situation demands.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

What exactly is a closet ? (just because I'm frustrated making no sense of this). So that I could build up a french version of the joke.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Bregalad wrote:What exactly is a closet ?
Oh boy, I knew I shouldn't have said anything about the joke! >_<

Take a look at what the dictionary has to say. "Closet" seems to be more of a small room where you store clothes, but "armário" is more of a standalone, tall piece of furniture for the same purpose. I don't know, maybe "wardrobe" would be a better translation for "armário"?

I'm really really sorry for these latest messages about famous characters having sex behind furniture, it's just that when I saw the question "You know MARIO?" I couldn't avoid thinking about the joke. And I just realized that someone tried to do this in english already...

Sorry, sorry! Is it possible for the joke part of this thread to be split and moved to general stuff? We shouldn't be ruining the discussion about this great disassembly job...
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

It's difficult to split a topic that talks about subject A and digression B when almost every post that mentions B also mentions A.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

I'll go ahead and post a french version of the joke (repacing Mario by Luigi so that it rhymes).

- Tu connais Luigi ?
- Quel Luigi ?
- Celui qui te frappe derriere l'armoire à habits.


... I still don't get much fun from it.
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Post by doppelganger »

That's all well and good, except in the middle of digression B I think you guys forgot what subject A is. :-P
Be whatever the situation demands.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

So will the RAM use of this SMB1 disassembly be modularized (e.g. to ".res" statements in segment BSS), or not?
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

I'm not doing it. Too busy right now. And probably for the next few months. Why don't you do it?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

I'll take a look at it.

EDIT: Now that I look at the RAM map on datacrystal, it doesn't appear as complete as this one.
CKY-2K/Clay Man
Posts: 214
Joined: Sun Apr 01, 2007 2:10 pm

Post by CKY-2K/Clay Man »

k nevermind. You could at least say "no".
Image
Here to at least get an idea of how the NES works. I mean I know alot of the basic things, but this place'll help me grasp more how NES functions.
Major respect to NES developers.
doppelganger
Posts: 183
Joined: Tue Apr 05, 2005 7:30 pm

Post by doppelganger »

I get the feeling we missed something.

<goes over thread again>

Are you referring to this:
CKY-2K/Clay Man wrote:How would I edit it so that the fireflower doesn't use h-flipping for the right half of the sprite?

I really want to know this and I think an example of how to change something would help me a little.
or something else?

re: that, the only thing you really have to do is change the branch the game uses when it finds a fire flower to go elsewhere, like so...

This is the way it looks normally:

Code: Select all

        ldx $00
        dex                        ;check power-up type for fire flower
        beq FlipPUpRightSide       ;if found, skip this part
        sta Sprite_Attributes+8,y  ;otherwise set new palette bits  for bottom left
        sta Sprite_Attributes+12,y ;and bottom right sprites as well for star only
This is what you would do if you wanted to stop the fire flower from horizontally flipping on the right side:

Code: Select all


        ldx $00
        dex                        ;check power-up type for fire flower
        beq PUpOfs       <--- change third line to this
        sta Sprite_Attributes+8,y  ;otherwise set new palette bits  for bottom left
        sta Sprite_Attributes+12,y ;and bottom right sprites as well for star only
Doing this will cause the game to skip the horizontal flip part of the power-up graphics handler used to flip fire flowers and stars and go straight to offscreen handling instead. It will still flip star power-ups, due to the condition checking.

You should bear in mind, though, that the fire flower will probably look messed up unless you change the graphics.
Be whatever the situation demands.
CKY-2K/Clay Man
Posts: 214
Joined: Sun Apr 01, 2007 2:10 pm

Post by CKY-2K/Clay Man »

Yeah, thanks man!

Thanks to your asm I could make these neat pipes for my project.

Image
Image
Here to at least get an idea of how the NES works. I mean I know alot of the basic things, but this place'll help me grasp more how NES functions.
Major respect to NES developers.
Post Reply