News:

11 March 2016 - Forum Rules

Main Menu

Super Mario Bros. Outlined

Started by Lukas Siso, March 11, 2023, 11:32:54 AM

Previous topic - Next topic

Lukas Siso

This patch is already finalized and contents:
All new graphics. All sprites and tiles now have edges, like SMB2 and SMB3 artwork. Some graphics i have imported of All-Stars version, but i created the most.
Some palettes fixes: Mario color change from brown to blue, Cheep-Cheeps color change from grey to green, and others.
I also made some small improvements to the original graphics, like inserting lips in the piranha plants mouth and fixing the helmet of the hammer brothers.

The logo in the title screen is now more like the logo from atual days.



A little help! I would like to correct the height of the Princess and change the color of Bowser's flag at the end of the levels, from green to red. Can you help me with this?



Link to download the patch (BPS format): https://mega.nz/file/Dv5xVYCC#pCYE4sLR2etxYDSozicEFulvIDein4jDp17X9GB8O5E

Use this in your RomHack. But don't forget to mention me in the credits - Lukas Siso Pixelartist  :thumbsup: :cookie:
Feel free to leave your opinion in the comments. If you find any defects, report to me!

Cyneprepou4uk

To change flag color you need to change the value which is written to these 3 addresses.



But you can't simply replace that LDA #$01 at the top with LDA #$02.

capncrunch992

#2
This looks quite good. Good job!

If I could make a couple of small suggestions: I think the title screen would look better if you retained the title logo border, or perhaps if you draw a new border to fit with the revised style.

And the HUD text is one pixel too tall, which causes the bottom-most pixels to get dragged along as the screen is scrolled. This happens with any ROM hack that places pixels on the bottom-most row, so it's an issue with the game itself. One possible workaround would be to use a left-aligned drop shadow rather than a full outline. Example:




Lukas Siso

Quote from: capncrunch992 on March 14, 2023, 01:16:38 PMThis looks quite good. Good job!
Thanks so much for the compliment, and suggestions are always welcome! I loved your work editing the HUD text, it was really beautiful, but I think it deviates a little from the concept of the hack, which is to add borders to all possible sprites, then the ideal would be to correct this last line of pixels dragging error. If it's not possible to fix this, would be really cool to use your idea. You can place your edited file here for others to download.

Lukas Siso

Quote from: Cyneprepou4uk on March 11, 2023, 12:12:39 PMTo change flag color you need to change the value which is written to these 3 addresses.



But you can't simply replace that LDA #$01 at the top with LDA #$02.
This sound good. can you do this? I don't understand much about programming.

forple

Quote from: Lukas Siso on March 15, 2023, 01:31:44 PMthe ideal would be to correct this last line of pixels dragging error. If it's not possible to fix this, would be really cool to use your idea. You can place your edited file here for others to download.

Editing the Sprite 0 hit is a bit more work; If you carefully look at the coin icon in the HUD in the original game, you'll notice one part is a sprite. That sprite would have to be moved down a bit; Which would require editing the graphic, but in turn this also may impact how Sprite 0 behaves, due to how the hardware works.

Midnight Metronome

Out of all graphics hacks this is the best believe it or not. Most smb1 gfx use smb3 sprites and change a lot of the gfx but all smb1 needs was a subtle gfx hack like this that preserves the general look and feel of the sprites. Keep it up.

tobiasvl

Quote from: Lukas Siso on March 15, 2023, 01:31:44 PMthe ideal would be to correct this last line of pixels dragging error. If it's not possible to fix this, would be really cool to use your idea.
It's probably not impossible, but I've been toying around with this a bit now, and it seems pretty hard to pull off. I've never done any NES hacking though.

In case you don't know about it, you should read into the NES's "sprite zero hit" to understand how SMB makes the HUD (which is just the top of the background) stand still while the rest of the background scrolls.

In order to make a clean break between the very last row of pixels in the HUD and the very first row of pixels in the regular background, you need to find the sweet spot in time to update the scroll registers.

I've been trying to remove top-left opaque pixels from sprite 0 (which is what tells the game when it's almost done drawing the HUD) and changing the number $14 at address $158 in the PRG ROM (which is a value used for a delay loop after hitting sprite 0, but before updating the scroll registers) and I have been able to come pretty close, where the bottom of the HUD doesn't smear, but then I get some artifacts on the topmost pixels in the clouds after the logo has scrolled away.

Perhaps you could move the coin graphic (which is what sprite 0 hits) to the left or right, combined with what I mentioned above, to reach the sweet spot...

Someone who's more experienced with NES hacking than I might be able to figure something out though! Or maybe the emulator I'm using (Mesen) is inaccurate here, I don't know.

Hamtaro126

If you want to modify the rom more better, You can just go to the disassemblies for modification, This is always the standard now that XDELTA and especially BPS is here!

Here are four good disassemblies, None of these are mine, BTW...

My advice:
"Start looking at SMBDis First, if you understand, go from there!!!"

SMBDIS, for NES/ASM6, by Doppelganger (disassembly, original):
RHDN Link

SMB2jDIS, for FDS/ASM6, by Doppelganger, (disassembly, original):
RHDN Link

SMBANNDIS, All Night Nippon disassembly, also includes SMB2jdis for comparsion, for FDS/ASM6(?), by Threecreepio (disassembly, fork): Github Link

NES-SMB2j, source for MMC5 versions of SMB2j and ANNSMB for NES/CA65, by Threecreepio (conversion, fork):
Github Link

If you want my fixes, I am busy right now, Plus, since you are making a good hack, you have my permission to use and search for my fixes for both SMB1 and 2J, on NESDEV and RHDN...

(Give credit, of course when using my fixes!)

you also can do one better by asking about the fixes provided by ShaneM, SMB2J-2Q too.

And of course, Have faith and Good luck, Hero.
I Hath Returned...

BTW My username is not Hamtaro129. THAT IS WRONG, Please correct immediately or I will try to correct it myself!

tacoschip

#9
Quote from: Hamtaro126 on April 11, 2023, 12:03:27 AMIf you want to modify the rom more better, You can just go to the disassemblies for modification, This is always the standard now that XDELTA and especially BPS is here!

@Lukas Siso

This repo rebuilds "Super Mario Bros. (World).nes", using NES 1.0 header
https://github.com/pgattic/smb1-disasm/tree/master

which I modified to add file padding at end and NES 2.0 header
https://github.com/tacoschip/tacoschip/raw/ff318ae844c1488e1278a54f7eae7f4ed55d46f0/smb1-nes20.asm



Quote from: Lukas Siso on March 11, 2023, 11:32:54 AMUse this in your RomHack. But don't forget to mention me in the credits - Lukas Siso Pixelartist  :thumbsup: :cookie:
Feel free to leave your opinion in the comments. If you find any defects, report to me!

I ported your assets + palette changes into the above repo. It builds your new Outlined rom @ 100%.
https://web.archive.org/web/20230412024943if_/https://cdn-143.anonfiles.com/V866H3k7zf/84ffba7c-1681268365/smb1-outline-assets.7z


###############


Onto the first item.

Quote from: Cyneprepou4uk on March 11, 2023, 12:12:39 PMTo change flag color you need to change the value which is written to these 3 addresses.

Thank you for pointing that out! It looks like this:

lda FlagpoleFNum_Y_Pos ;get vertical coordinate for floatey number
sta $02 ;store it here
lda #$01
sta $03 ;set value for flip which will not be used, and
sta $04 ;attribute byte for floatey number
; ====
sta Sprite_Attributes,y ;set attribute bytes for all three sprites
sta Sprite_Attributes+4,y
sta Sprite_Attributes+8,y
; ====
lda #$7e
sta Sprite_Tilenumber,y ;put triangle shaped tile
sta Sprite_Tilenumber+8,y ;into first and third sprites
lda #$7f
sta Sprite_Tilenumber+4,y ;put skull tile into second sprite

@Cyneprepou4uk says we need to add "lda #$02" to code like this.

lda #$01
sta $03 ;set value for flip which will not be used, and
sta $04 ;attribute byte for floatey number
lda #$02 ;change bowser flag color to red
sta Sprite_Attributes,y ;set attribute bytes for all three sprites
sta Sprite_Attributes+4,y
sta Sprite_Attributes+8,y

Note that ROM no longer works because we added +2 bytes. We must remove -2 bytes somewhere.
Comments say that "sta $03" is residual = dead code. Remove it.

lda #$01
sta $04 ;attribute byte for floatey number
lda #$02 ;change bowser flag color to red
sta Sprite_Attributes,y ;set attribute bytes for all three sprites
sta Sprite_Attributes+4,y
sta Sprite_Attributes+8,y

Rebuild and run ROM. Red Bowser flag like @Cyneprepou4uk promised.




Fair note that this game must have 50+ bugs. You can always ask for others like this thread.
https://www.romhacking.net/forum/index.php?topic=32473.0


############


Our HUD line is this.

Sprite0Hit:
lda PPU_STATUS ;do sprite #0 hit detection
and #%01000000
beq Sprite0Hit
ldy #$14 ;small delay, to wait until we hit horizontal blank time
HBlankDelay:
dey
bne HBlankDelay
SkipSprite0:
lda HorizontalScroll ;set scroll registers from variables
sta PPU_SCROLL_REG
lda VerticalScroll
sta PPU_SCROLL_REG
lda Mirror_PPU_CTRL_REG1  ;load saved mirror of $2000
pha
sta PPU_CTRL_REG1


Quote from: tobiasvl on April 10, 2023, 05:41:14 PMOr maybe the emulator I'm using (Mesen) is inaccurate here, I don't know.

The flicker / smear is from unstable timing problems, muddying up our manual h-blank wait.
Should happen everywhere, even real hardware.

bcs Sprite0HitStart
jsr MoveSpritesOffscreen
jsr SpriteShuffler
Sprite0HitStart:
ldy #$1e ;small delay, to wait until we hit horizontal blank time
lda HorizontalScroll ;set scroll registers from variables
ldx VerticalScroll
Sprite0Hit:
bit PPU_STATUS ;do sprite #0 hit detection
bvc Sprite0Hit
nop
HBlankDelay:
dey
bne HBlankDelay
SkipSprite0:
sta PPU_SCROLL_REG
stx PPU_SCROLL_REG
lda Mirror_PPU_CTRL_REG1  ;load saved mirror of $2000
pha
sta PPU_CTRL_REG1

This will help a lot but it still has some timing wobble, likely from these previous lines doing random amounts of work.

Sprite0Clr:
lda PPU_STATUS ;wait for sprite 0 flag to clear, which will
and #%01000000 ;not happen until vblank has ended
bne Sprite0Clr
lda GamePauseStatus ;if in pause mode, do not bother with sprites at all
lsr
bcs Sprite0Hit
jsr MoveSpritesOffscreen
jsr SpriteShuffler

Can't use double IRQ to stable the timing. Hmm..


Maybe someone will chime in. Nice visual work btw!


EDIT:
I realized I screwed "SkipSprite0" - that needs fixing!

tacoschip

Starting over. The top line of the clouds glitch out when HorizontalScroll (73f) rolls over from FF to 00. It stays glitched until the next roll over, then looks normal. Pattern keeps repeating. :huh:

tacoschip

Quote from: Lukas Siso on March 15, 2023, 01:31:44 PMthen the ideal would be to correct this last line of pixels dragging error.




Here is your asm file:
https://github.com/tacoschip/tacoschip/raw/b4ed56c1e82260dfe6f02a8478079c7f6dc1d3e8/smb1.asm


And what got changed:

1. https://www.romhacking.net/forum/index.php?topic=32473.msg439419

thanks [b]kindlekat[/b]!

PauseSkip:
ldx #$00
ldy #$07
lda PseudoRandomBitReg    ;get first memory location of LSFR bytes
eor PseudoRandomBitReg+1  ;perform exclusive-OR on second memory location  [speed optimize]
lsr                      ;if neither or both are set, carry will be clear
lsr                      ;if one or the other is set, carry will be set


2. The evil scroll timing

lda Sprite0HitDetectFlag  ;check for flag here
beq SkipSprite0
Sprite0Clr:
bit PPU_STATUS ;wait for sprite 0 flag to clear, which will
bvs Sprite0Clr ;not happen until vblank has ended
lda GamePauseStatus ;if in pause mode, do not bother with sprites at all
lsr
bcs Sprite0Hit
jsr MoveSpritesOffscreen
jsr SpriteShuffler
Sprite0Hit:
bit PPU_STATUS ;do sprite #0 hit detection
bvc Sprite0Hit
ldy #$1a ;small delay, to wait until we hit horizontal blank time
nop
nop
nop
HBlankDelay:
dey
bne HBlankDelay
SkipSprite0:
lda Mirror_PPU_CTRL_REG1  ;load saved mirror of $2000
ldx HorizontalScroll ;set scroll registers from variables
ldy VerticalScroll
sta PPU_CTRL_REG1
stx PPU_SCROLL_REG
sty PPU_SCROLL_REG ; not important outside of bootup
pha
lda GamePauseStatus ;if in pause mode, do not perform operation mode stuff
lsr
bcs SkipMainOper
jsr OperModeExecutionTree ;otherwise do one of many, many possible subroutines

Important: we have to update the x-high (2000) first! That little annoying bit is very timing sensitive and must be done early. The rest of 2005 timing not-so-sure.

Also note that the hud bar likely should blow up with random pixels on the last line, but we have nothing on the bottom-right box.

imkrut

Looks great, adding it to my collection for sure!

tacoschip

New package
https://web.archive.org/web/20230413150026if_/https://cdn-145.anonfiles.com/P8reZ3k0z3/a8cf3932-1681398567/smb1-outline-assets2.7z


Fixes flagpole score bug, because it's incredibly unsightly to always see it


0E50F A9 02                      lda #$02 ;bowser flag color to red
0E511 99 02 02                  sta Sprite_Attributes,y ;set attribute bytes for all three sprites
0E514 99 06 02                  sta Sprite_Attributes+4,y
0E517 99 0A 02                  sta Sprite_Attributes+8,y
0E51A 4A                        lsr
0E51B 85 04                      sta $04 ;attribute byte for floatey number (01)

###
0E51D 4A                        lsr
0E51E 85 03                      sta $03 ;bugfix: no flip for floatey number (00)
###

0E520 A9 7E                      lda #$7e
0E522 99 01 02                  sta Sprite_Tilenumber,y ;put triangle shaped tile
0E525 99 09 02                  sta Sprite_Tilenumber+8,y ;into first and third sprites


And the Princess height



Which was a massive pain, and it's still not perfect.

0. Removed lots of residual code to free space

1. Replaced blank FC sprite tile with Princess body
- Swapped "sprite 0 coin" (FF tile) to 00 tile
- Changed all FC tiles to 00 tile
- Changed DrawSpriteObject to ignore 00 tile

2. InitRetainerObj / RunRetainerObjPrincess / ESRtnr
- Makes another Princess clone so we can draw the head


The Princess crown needs 2 more tiles, but we only have 1 left.
- tile ee == tile eb (piranha stem), which is identical.

I left it alone and replaced tile ee with flower stem, to animate the piranha.



We are full right now.




asm-only
https://github.com/tacoschip/tacoschip/raw/305161f00321fa8fbb585bcebb455029fa3015fb/smb1.asm

B. Gangster

When's the next update for this Patch?

Lukas Siso

Quote from: B. Gangster on April 17, 2023, 08:01:18 PMWhen's the next update for this Patch?
I'm working on more self-drawn sprites to replace the ones who i imported from the "All-Stars" version.
I'm kinda busy with my college, so when i take more free time i will put here the link to download the file with updated graphics, i will also take a look in these game code changes made by the friends above.
The users who are making alterations in the game code can leave here the download links of yours mods, later i find a way to unite all the progress in a single rom.
And thank very much to all of you who are collaborating.

tacoschip

Quote from: Lukas Siso on April 22, 2023, 09:54:34 AMThe users who are making alterations in the game code can leave here the download links of yours mods, later i find a way to unite all the progress in a single rom.

Super Mario Bros - Outlined ==> wip upgrade patch
https://github.com/tacoschip/tacoschip/raw/704ce6cc414552c3807f04ab52db7292a167548e/outlined1.ips

- Note: Outlined requires iNES 1.0 header
4e 45 53 1a 02 01 01 00 - 00 00 00 00 00 00 00 00



Super Mario Bros. (World) ==> outlined + wip
https://github.com/tacoschip/tacoschip/raw/704ce6cc414552c3807f04ab52db7292a167548e/outlined2.ips

- Note: World requires iNES 2.0 header
4e 45 53 1a 02 01 01 08 - 00 00 00 00 02 00 00 01



Or those who want to build the rom themselves, which includes everything
https://web.archive.org/web/20230413150026if_/https://cdn-145.anonfiles.com/P8reZ3k0z3/a8cf3932-1681398567/smb1-outline-assets2.7z

- Note that all the code changes require Jakiki6 asm file, which is included above. It's way too hard to make everyone's new changes fit as traditional code hacks. Free space is a premium for this game.

B. Gangster

Quote from: Lukas Siso on April 22, 2023, 09:54:34 AMI'm working on more self-drawn sprites to replace the ones who i imported from the "All-Stars" version.
I'm kinda busy with my college, so when i take more free time i will put here the link to download the file with updated graphics, i will also take a look in these game code changes made by the friends above.
The users who are making alterations in the game code can leave here the download links of yours mods, later i find a way to unite all the progress in a single rom.
And thank very much to all of you who are collaborating.
Oh okay, I see

tygerbug

  This is looking great.

  Lukas, did you ever finish your All Stars animations of Peach and Toad and so on?