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

Author Topic: Super Mario Bros - I can not find Mario's DIE y-axis  (Read 2574 times)

Guyver

  • Jr. Member
  • **
  • Posts: 46
  • =<O_O>=
    • View Profile
    • Chief-Net.ru
Super Mario Bros - I can not find Mario's DIE y-axis
« on: November 11, 2016, 08:09:01 pm »
Hello. Help me! I can not find a coordinate along the Y axis, when Mario dies.



I want to change this value. When Mario falls into the pit, he did not immediately die. It flies some distance down.


I need to Mario died when his hat hidden behind the screen.


It is necessary for my hack. Everything else I've done. But this option can not find. Rom - Super Mario Bros. (JU) [!].nes
« Last Edit: June 21, 2019, 10:55:40 pm by Guyver »
I not the wizard, I only study...

dougeff

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
Re: Super Mario Bros - I can not find Mario's DIE y-axis
« Reply #1 on: November 12, 2016, 06:32:55 pm »
Working from doppleganger's smb dissassembly...

change...

PlayerHole: lda Player_Y_HighPos        ;check player's vertical high byte
         cmp #$02                    ;for below the screen
         bmi ExitCtrl                ;branch to leave if not that far down

to...

PlayerHole: lda Player_Y_HighPos        ;check player's vertical high byte
         cmp #$01                    ;for still on the screen
         bne ExitCtrl
         lda Player_Y_Position
         cmp #$e9            ;perhaps
         bcc ExitCtrl

For reference...RAM addresses
Player_Y_Position     = $ce
Player_Y_HighPos      = $b5

This will trigger the first time Y position is below e8, which should be maybe just a few pixels of mario's hat above the bottom of the screen.
« Last Edit: November 12, 2016, 06:37:58 pm by dougeff »
nesdoug.com -- blog/tutorial on programming for the NES

Guyver

  • Jr. Member
  • **
  • Posts: 46
  • =<O_O>=
    • View Profile
    • Chief-Net.ru
Re: Super Mario Bros - I can not find Mario's DIE y-axis
« Reply #2 on: November 12, 2016, 07:40:26 pm »
I can not find this place in the ROM. Not in the RAM. HEX address in the real ROM...
I not the wizard, I only study...

tomaitheous

  • Hero Member
  • *****
  • Posts: 543
    • View Profile
    • PC Engine Dev
Re: Super Mario Bros - I can not find Mario's DIE y-axis
« Reply #3 on: November 12, 2016, 09:07:38 pm »
Look at the code posted, find the hex values for the opcodes and operands - then do a binary search for those values.

dougeff

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
Re: Super Mario Bros - I can not find Mario's DIE y-axis
« Reply #4 on: November 13, 2016, 04:11:58 pm »
ROM offset...

0x3189

A5 B5 = lda Player_Y_HighPos
C9 02 = cmp #$02
30 3B = bmi ExitCtrl

I hope you realize that you can't just insert 6 bytes into the ROM. That would break the game. I prefer to work with the disassembly, and reassemble.
nesdoug.com -- blog/tutorial on programming for the NES

tomaitheous

  • Hero Member
  • *****
  • Posts: 543
    • View Profile
    • PC Engine Dev
Re: Super Mario Bros - I can not find Mario's DIE y-axis
« Reply #5 on: November 19, 2016, 04:51:00 pm »
There's no free area in rom that he can move stuff around? If that's the case, I'd check to see if someone hasn't already provided a patch to upgrade the rom to a different mapper - giving that support.