comprehensive SMB1 disassembly
Moderator: Moderators
-
doppelganger
- Posts: 183
- Joined: Tue Apr 05, 2005 7:30 pm
You want to have the time count down as soon as the player leaves the flag to make it appear as though the player is walking to the next level? And you want to eliminate the brick that keeps the player from walking endlessly? But how would you explain the discontinuity between levels (an endless plain in one level and the castle appearing at the beginning of the next level)? And what about the fireworks?
Be whatever the situation demands.
In fact, counting down the time could be done while the flag is being lowered, especially if it counts the ones, tens, and hundreds digits separately like Super Mario Bros. 3 does.doppelganger wrote:You want to have the time count down as soon as the player leaves the flag to make it appear as though the player is walking to the next level?
As I understand it, we want to leave the brick there (to trigger the next level), but don't hide Mario's sprite and don't show the black screen with "WORLD 1-2" after act breaks. Super Mario Bros. as it stands has a structure like that of the later Sonic the Hedgehog and Sonic 2 for Genesis, which fade to black between acts; hacker wants to approximate Sonic 3.And you want to eliminate the brick that keeps the player from walking endlessly?
Can those be done during the timer countdown?And what about the fireworks?
-
doppelganger
- Posts: 183
- Joined: Tue Apr 05, 2005 7:30 pm
doppelganger wrote:You want to have the time count down as soon as the player leaves the flag to make it appear as though the player is walking to the next level?
That would require a rewrite of AwardGameTimerPoints, which is one of the many subroutines run by the star flag object ($31). As for doing it as soon as the player touches the flagpole, I believe that would require some modification to the PlayerEndLevel subroutine...the game timer doesn't actually count down until the star flag object code is activated...and the star flag object code doesn't actually activate until the player object collides with the brick in front of the castle entrance.tepples wrote:In fact, counting down the time could be done while the flag is being lowered, especially if it counts the ones, tens, and hundreds digits separately like Super Mario Bros. 3 does.
doppelganger wrote:And you want to eliminate the brick that keeps the player from walking endlessly?
Hoo boy. This would require some significant change in the way the game handles starting a new area, as well as a little modification to the actual game area data (taking out the castle object at the beginning of many areas comes to mind). The transition from levels -3 to the castle levels in -4 would also have to be taken into consideration, although if I were implementing a hack like this, I would do it the regular way between levels -3 and -4.tepples wrote:As I understand it, we want to leave the brick there (to trigger the next level), but don't hide Mario's sprite and don't show the black screen with "WORLD 1-2" after act breaks. Super Mario Bros. as it stands has a structure like that of the later Sonic the Hedgehog and Sonic 2 for Genesis, which fade to black between acts; hacker wants to approximate Sonic 3.
doppelganger wrote:And what about the fireworks?
Perhaps by moving the fireworks code in RaiseFlagSetoffFWorks (which starts at the label SetOffF) to somewhere in AwardGameTimerPoints, it could be done (also you'd have to send that branch to SetOffF to DrawStarFlag instead). Though you would then have to deal with how to separate the timer tick sound from the fireworks/gunfire sound, since they both play on the same sound engine and channel.tepples wrote:Can those be done during the timer countdown?
Sorry it took me so long to reply to this, but I haven't looked at my own disassembly for a while, and, well, you know how it is when you haven't looked at your own work for a while. Needless to say, by now it should be obvious that some hacks to SMB will be harder to implement than others.
Be whatever the situation demands.
-
GameGenie81
- Posts: 4
- Joined: Mon Jul 07, 2008 5:59 pm
- Hamtaro126
- Posts: 786
- Joined: Thu Jan 19, 2006 5:08 pm
I really have a problem with disabling the SPRITE 0 code. It seems that if I do that, I either get Corruption of the screen and palettes, Sprites not deleteing properly, and shaking/flickering from the status bar. I have been trying to get an MMC3 IRQ routine working. But It won't act right without Sprite 0 being disabled
There is One hack - Mario VS Airman (by ATA, get from acmlm.kafuka.org). There is also SMB2j MMC3. I tried. Both of them failed
There is One hack - Mario VS Airman (by ATA, get from acmlm.kafuka.org). There is also SMB2j MMC3. I tried. Both of them failed
- Hamtaro126
- Posts: 786
- Joined: Thu Jan 19, 2006 5:08 pm
Just For a Reminder.Hamtaro126 wrote:I really have a problem with disabling the SPRITE 0 code. It seems that if I do that, I either get Corruption of the screen and palettes, Sprites not deleteing properly, and shaking/flickering from the status bar. I have been trying to get an MMC3 IRQ routine working. But It won't act right without Sprite 0 being disabled
There is One hack - Mario VS Airman (by ATA, get from acmlm.kafuka.org). There is also SMB2j MMC3. I tried. Both of them failed
-Hamtaro126
-
doppelganger
- Posts: 183
- Joined: Tue Apr 05, 2005 7:30 pm
He's trying to get a screen split in SMB1 using MMC3's IRQ, rather than sprite zero hit. "Reminder" is just his way of saying "someone do it for me."
- BMF
RuSteD LOgIc
RuSteD LOgIc
- Hamtaro126
- Posts: 786
- Joined: Thu Jan 19, 2006 5:08 pm
Sorry, Can you please look to see if you can remove sprite 0 for me. I have tried very hard.doppelganger wrote:I have no idea what you're trying to do, Hamtaro126, and I'm not sure I want to, either. And by the way, reposting the same information that is only located two posts away makes you look VERY stupid.
And Another thing:
;-------------------------------------------------------------------------------------
;$00 - temp vram buffer offset
;$01 - temp metatile buffer offset
;$02 - temp metatile graphics table offset
;$03 - used to store attribute bits
;$04 - used to determine attribute table row
;$05 - used to determine attribute table column
;$06 - metatile graphics table address low
;$07 - metatile graphics table address high
; Insert Attributes for New Engine Below
Attributes:
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
RenderAreaGraphics:
lda CurrentColumnPos ;store LSB of where we're at
and #$01
sta $05
ldy VRAM_Buffer2_Offset ;store vram buffer offset
sty $00
lda CurrentNTAddr_Low ;get current name table address we're supposed to render
sta VRAM_Buffer2+1,y
lda CurrentNTAddr_High
sta VRAM_Buffer2,y
lda #$9a ;store length byte of 26 here with d7 set
sta VRAM_Buffer2+2,y ;to increment by 32 (in columns)
lda #$00 ;init attribute row
sta $04
tax
DrawMTLoop: stx $01 ;store init value of 0 or incremented offset for buffer
lda MetatileBuffer,x
and #%11000000
sta $03
asl ;note that metatile format is:
rol ;%xx000000 - attribute table bits,
rol ;%00xxxxxx - metatile number
tay ;rotate bits to d1-d0 and use as offset here
lda MetatileGraphics_Low,y ;get address to graphics table from here
sta $06
lda MetatileGraphics_High,y
sta $07
lda Attributes,y
sta $03
lda MetatileBuffer,x ;get metatile number again
asl ;multiply by 4 and use as tile offset
asl
sta $02
lda AreaParserTaskNum ;get current task number for level processing and
and #%00000001 ;mask out all but LSB, then invert LSB, multiply by 2
eor #%00000001 ;to get the correct column position in the metatile,
asl ;then add to the tile offset so we can draw either side
adc $02 ;of the metatiles
tay
ldx $00 ;use vram buffer offset from before as X
lda ($06),y
sta VRAM_Buffer2+3,x ;get first tile number (top left or top right) and store
iny
lda ($06),y ;now get the second (bottom left or bottom right) and store
sta VRAM_Buffer2+4,x
ldy $04 ;get current attribute row
lda $05 ;get LSB of current column where we're at, and
bne RightCheck ;branch if set (clear = left attrib, set = right)
lda $01 ;get current row we're rendering
lsr ;branch if LSB set (clear = top left, set = bottom left)
bcs LLeft
rol $03 ;rotate attribute bits 3 to the left
rol $03 ;thus in d1-d0, for upper left square
rol $03
jmp SetAttrib
RightCheck: lda $01 ;get LSB of current row we're rendering
lsr ;branch if set (clear = top right, set = bottom right)
bcs NextMTRow
lsr $03 ;shift attribute bits 4 to the right
lsr $03 ;thus in d3-d2, for upper right square
lsr $03
lsr $03
jmp SetAttrib
LLeft: lsr $03 ;shift attribute bits 2 to the right
lsr $03 ;thus in d5-d4 for lower left square
NextMTRow: inc $04 ;move onto next attribute row
SetAttrib: lda AttributeBuffer,y ;get previously saved bits from before
ora $03
sta AttributeBuffer,y ;the old, and store
inc $00 ;increment vram buffer offset by 2
inc $00
ldx $01 ;get current gfx buffer row, and check for
inx ;the bottom of the screen
cpx #$0d
bcc DrawMTLoop ;if not there yet, loop back
ldy $00 ;get current vram buffer offset, increment by 3
iny ;(for name table address and length bytes)
iny
iny
lda #$00
sta VRAM_Buffer2,y ;put null terminator at end of data for name table
sty VRAM_Buffer2_Offset ;store new buffer offset
inc CurrentNTAddr_Low ;increment name table address low
lda CurrentNTAddr_Low ;check current low byte
and #%00011111 ;if no wraparound, just skip this part
bne ExitDrawM
lda #$80 ;if wraparound occurs, make sure low byte stays
sta CurrentNTAddr_Low ;just under the status bar
lda CurrentNTAddr_High ;and then invert d2 of the name table address high
eor #%00000100 ;to move onto the next appropriate name table
sta CurrentNTAddr_High
ExitDrawM: jmp SetVRAMCtrl ;jump to set buffer to $0341 and leave
I made the new Attribute engine partly working. But It doesn't let all the attributes in. There is only one attribute working right now!
The Format should be 00,55,AA,FF, Representing a 16x16 metatile
-
doppelganger
- Posts: 183
- Joined: Tue Apr 05, 2005 7:30 pm
- Hamtaro126
- Posts: 786
- Joined: Thu Jan 19, 2006 5:08 pm
Have you tried making a split screen demo from scratch using your own graphics? And why do you want to get SMB working without sprite 0?
-It's how the game times its updates
-It was designed from the ground up to work this way
-When you waste a lot of time not getting something done, it's best to move on to something doable
-It's how the game times its updates
-It was designed from the ground up to work this way
-When you waste a lot of time not getting something done, it's best to move on to something doable
- Hamtaro126
- Posts: 786
- Joined: Thu Jan 19, 2006 5:08 pm