News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: SMB1 Title screen hex edit  (Read 2860 times)

Sgt Jack V

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
SMB1 Title screen hex edit
« on: September 04, 2017, 02:34:58 pm »
Hello! I have just joined, and I would like an edit for my custom title screen similar to what was done for RandomManA in an older topic.


EDIT: Replaced images with revised versions.
« Last Edit: September 04, 2017, 08:20:12 pm by Sgt Jack V »
Call me Nate because I can't manually change my username and there isn't a thread specifically for that.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7102
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: SMB1 Title screen hex edit
« Reply #1 on: September 05, 2017, 12:06:50 am »
Are you asking how you can fix it?
Or are you asking someone to fix it for you? The former is fine but the latter is very discouraged.

Dougeff's post explains it.
It has do with the "Attribute Table" which is what the NES uses to tell what colors each 16x16 block on the screen uses.

It appears the title screen editor you are using might be flawed and does not consider the Attribute Table.

Quote
Basically, what I think is happening is...the tool ran out of room, so it omitted the attribute table information off the end of the data stream...
these lines...
23C9 5655
23E2  0499AAAAAA
23EA  0499AAAAAA

Meaning that after the 22F601, make the following data

Code: [Select]
23C9565523E20499AAAAAA23EA0499AA
AAAA00
"My watch says 30 chickens" Google, 2018

Eden.GT

  • Full Member
  • ***
  • Posts: 106
  • Hardcore SMB1 Player and Hacker
    • View Profile
Re: SMB1 Title screen hex edit
« Reply #2 on: September 05, 2017, 05:21:04 am »
Have you ever used Beta's SMB title editor? That will save you a lot of time and even change title colour attributes, unless you want to do it this way.
Is the pool clean?

Sgt Jack V

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: SMB1 Title screen hex edit
« Reply #3 on: September 05, 2017, 07:50:34 am »
If you mean the one by betaworld, then there was too much stuff going on, and I couldn't save.

September 05, 2017, 05:06:02 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Meaning that after the 22F601, make the following data

Code: [Select]
23C9565523E20499AAAAAA23EA0499AA
AAAA00
I attempted that.
This is what I got out of it.
« Last Edit: September 05, 2017, 05:06:03 pm by Sgt Jack V »
Call me Nate because I can't manually change my username and there isn't a thread specifically for that.

Eden.GT

  • Full Member
  • ***
  • Posts: 106
  • Hardcore SMB1 Player and Hacker
    • View Profile
Re: SMB1 Title screen hex edit
« Reply #4 on: September 06, 2017, 02:10:02 am »
If you mean the one by betaworld, then there was too much stuff going on, and I couldn't save.

After creating the title in the tool, press the second button, and there will be a window pop up. Close it by pressing the first button in the pop up, then press the fourth button. If if a dialogue window appears only once instead of twice, then the title screen data is too big.
Is the pool clean?

Sgt Jack V

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: SMB1 Title screen hex edit
« Reply #5 on: September 06, 2017, 07:58:22 am »
Yes, that's what happened.
Call me Nate because I can't manually change my username and there isn't a thread specifically for that.

dougeff

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
Re: SMB1 Title screen hex edit
« Reply #6 on: September 09, 2017, 03:26:39 am »
Sgt Jack V. It appears my previous advice was wrong. Now that I look at the disassembly, I misunderstood some things. (or possibly not, but any way, this version is shorter).

BTW, in FCEUX you can only edit the rom in 'view=ROM file' on the hex editor, so looking at 9ff0, enter these last 2 lines for the PPU data...

1B24100A160E22EC041D18192823C868
5523E84200000000000000000000FFFF

Should fix your title screen. Then click File/Save Rom As... in the hex editor.

-----------------------------------------
IMPORTANT NOTE FOR ALL FUTURE SMB HACKERS
-----------------------------------------

This is how SMB1 decodes the TITLE SCREEN DATA, from DrawTitleScreen: (line 1587 in the disassembly).
1st byte = high byte of PPU address (if zero, end of file)
2nd byte = low byte of PPU address
3rd byte = PPU control / repeat count
4th byte+ = data

3rd byte, divided into bits 76543210.
d7 = direction, 0 = L to R, 1 = U to D
d6 = repeat same byte?, 1 = y, 0 = no
d5-d0 = how many repeats 1-63 (if zero, would do 256 repeats)
 (or how many non-repeat bytes of data, if repeat is off)

--------------------------------------------------------------------------------------

So, looking back at the data I suggested...

23C8 68 55 - PPU address $23c8, $68 = 01101000 = repeat on, repeat same byte $28 times, data = $55

(I colored the left hill top the wrong palette, fix it now)
23E8 42 00 - PPU address $23e8, $42 = 01000010 = repeat on, repeat same byte $02 times, data = $00

00 - end of file

and you can't have data on the last 5 bytes of the CHR-ROM, unless you edit the disassembly (or ROM) on line 1607, CPY #$3a. So, that is, the last set is expected to start before $3a bytes from the start of the 'draw title screen buffer'.
« Last Edit: September 09, 2017, 04:00:02 am by dougeff »
nesdoug.com -- blog/tutorial on programming for the NES

Sgt Jack V

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: SMB1 Title screen hex edit
« Reply #7 on: September 09, 2017, 04:56:27 pm »
Eden already linked me a fixed version on the SMB-Hacking Discord.
Call me Nate because I can't manually change my username and there isn't a thread specifically for that.