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

Author Topic: Why can't I find this ram address (snes)  (Read 6849 times)

slidelljohn

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Why can't I find this ram address (snes)
« on: January 25, 2011, 10:52:15 pm »
I am trying to fix a bug in megaman x3 but I cant seem to find where it is storing in ram. Any help would be much appreciated.

$03/90FE A5 01          LDA $01    [$00:0001]   A:0082 X:001C  Y:0058 D:0000 DB:06
$03/9100 9D 01 60    STA $6001,x[$06:601D]   A:00FE X:001C
$03/9103 A9 84          LDA #$84                    A:00FE X:001C   Tile index
$03/9105 9D 02 60    STA $6002,x[$06:601E]   A:0084 X:001C   Is $06:601E Ram?
$03/9108 60              RTS                            A:0084 X:001C

I cant find where it is storing 84. I was assuming it was storing at $7e:601e or $7f:601e but I cant find 84 anywhere.




« Last Edit: January 25, 2011, 10:58:53 pm by john »

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7135
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Why can't I find this ram address (snes)
« Reply #1 on: January 25, 2011, 11:53:50 pm »
I THINK that area might be used to write to RAM in the Cx4 chip.
But I believe it has something to do with the Cx4.
"My watch says 30 chickens" Google, 2018

justin3009

  • Hero Member
  • *****
  • Posts: 1658
  • Welp
    • View Profile
Re: Why can't I find this ram address (snes)
« Reply #2 on: January 25, 2011, 11:58:27 pm »
Oh crud I knew it was familiar.  Now I remember why I should have written this down.
« Last Edit: January 26, 2011, 10:29:18 am by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

goldenband

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
Re: Why can't I find this ram address (snes)
« Reply #3 on: January 26, 2011, 02:18:30 am »
Maybe this link would be helpful?

http://users.tpg.com.au/advlink/dsp/cx4.html

At a glance, it looks like the RAM address space listed for the chip matches the STA commands.

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5791
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Why can't I find this ram address (snes)
« Reply #4 on: January 26, 2011, 09:31:00 am »
Indeed, it is the CX4 chip's RAM.

http://www.romhacking.net/docs/192/

TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

justin3009

  • Hero Member
  • *****
  • Posts: 1658
  • Welp
    • View Profile
Re: Why can't I find this ram address (snes)
« Reply #5 on: January 26, 2011, 02:06:16 pm »
Edit: FIXED IT!

Code: [Select]
    $03/91D6 9D 1C 60    STA $601C,x[$06:601C]   A:0018 X:0000 Y:000E D:0000 DB:06 S:0133 P:envMxdIzc HC:1308 VC:094 FC:00 I:00 - Changed to 20
    $03/91DB 9D 1D 60    STA $601D,x[$06:601D]   A:00E0 X:0000 Y:000E D:0000 DB:06 S:0133 P:eNvMxdIzc HC:0014 VC:095 FC:00 I:00 - Changed to 21
    $03/91E0 9D 1E 60    STA $601E,x[$06:601E]   A:0080 X:0000 Y:000E D:0000 DB:06 S:0133 P:eNvMxdIzc HC:0084 VC:095 FC:00 I:00 - Changed to 22
    $03/91E5 9D 1F 60    STA $601F,x[$06:601F]   A:0036 X:0000 Y:000E D:0000 DB:06 S:0133 P:envMxdIzc HC:0162 VC:095 FC:00 I:00 - Changed to 23
    $03/91F3 8D 1D 60    STA $601D  [$06:601D]   A:0050 X:0024 Y:000E D:0000 DB:06 S:0133 P:envMxdIzC HC:1272 VC:097 FC:00 I:00 - Changed to 21
    $03/91F8 8D 1E 60    STA $601E  [$06:601E]   A:00AC X:0024 Y:000E D:0000 DB:06 S:0133 P:eNvMxdIzC HC:1336 VC:097 FC:00 I:00 - Changed to 22
    $03/922A 9D 1D 60    STA $601D,x[$06:6021]   A:0040 X:0004 Y:000E D:0000 DB:06 S:0133 P:envMxdIzC HC:0666 VC:098 FC:00 I:00 - Changed to 21
    $03/9234 9D 1E 60    STA $601E,x[$06:6022]   A:0080 X:0004 Y:000E D:0000 DB:06 S:0133 P:eNvMxdIzC HC:0814 VC:098 FC:00 I:00 - Changed to 22
    $03/9244 9D 1D 60    STA $601D,x[$06:602D]   A:0018 X:0010 Y:000E D:0000 DB:06 S:0133 P:envMxdIzc HC:0954 VC:099 FC:00 I:00 - Changed to 21
    $03/924E 9D 1E 60    STA $601E,x[$06:602E]   A:0080 X:0010 Y:000E D:0000 DB:06 S:0133 P:eNvMxdIzC HC:1102 VC:099 FC:00 I:00 - Changed to 22
    $03/9275 9D 1D 60    STA $601D,x[$06:6031]   A:0018 X:0014 Y:000E D:0000 DB:06 S:0133 P:envMxdIzc HC:0450 VC:100 FC:00 I:00 - Changed to 21
    $03/927F 9D 1E 60    STA $601E,x[$06:6032]   A:0082 X:0014 Y:000E D:0000 DB:06 S:0133 P:eNvMxdIzC HC:0638 VC:100 FC:00 I:00 - Changed to 22
    $03/928F 9D 1D 60    STA $601D,x[$06:6031]   A:0018 X:0014 Y:000E D:0000 DB:06 S:0133 P:envMxdIzc HC:0450 VC:100 FC:00 I:00 - Changed to 21
    $03/9299 9D 1E 60    STA $601E,x[$06:6032]   A:0082 X:0014 Y:000E D:0000 DB:06 S:0133 P:eNvMxdIzC HC:0638 VC:100 FC:00 I:00 - Changed to 22

Moving the data a few bytes up fixed all the bugs with the sub-weapon and life disappearance.  I'll do a full test soon enough to see if anything else is bugged.  From what I've seen so far, everything is working 100%!
« Last Edit: January 26, 2011, 02:58:45 pm by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

slidelljohn

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Why can't I find this ram address (snes)
« Reply #6 on: January 26, 2011, 05:50:31 pm »
Awesome job Justin the code looks perfect! Thank you hero members what would we do without you. :)

Is there any debugger that allows you to view or edit the ram in the CX4 chip?

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5791
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Why can't I find this ram address (snes)
« Reply #7 on: January 27, 2011, 12:32:52 pm »
justin3009:
Nice find there. :)

john:
I believe they all should. The debuggers just work with SNES addresses. So, just like in the code, if you use hex viewer to view and/or edit  the proper address range, you're effectively viewing or reading the CX4 RAM. Can someone confirm? I'm not at home.
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

slidelljohn

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Why can't I find this ram address (snes)
« Reply #8 on: January 29, 2011, 03:05:30 pm »
I use geiger's debugger and I cant seem to figure out how to view the CX4 ram in it. Do I need a different debugger to view it?

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5791
    • View Profile
    • Nightcrawler's Translation Corporation
Re: Why can't I find this ram address (snes)
« Reply #9 on: January 30, 2011, 11:34:43 am »
Yeah, it looks like it doesn't work in Geiger's. It does seem to work in BSNES though. Open the memory editor (choose S-CPU Bus) and scroll down to address range for the CX4 RAM (066000-066bff)  I can see it change there and also see it mirrored properly in the other banks you can access CX4 RAM from.
TransCorp - Over 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

slidelljohn

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Why can't I find this ram address (snes)
« Reply #10 on: January 30, 2011, 01:21:09 pm »
Thank's a lot Nightcrawler!  :)
This will definitely help for writing new code for x2 and x3.
« Last Edit: January 30, 2011, 06:09:12 pm by john »