• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Fire Red]: Extending The Number Of Safe Flags And Variables

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
After very serious testing, I've come across the knowledge that the Variable hack is broken. After applying it, numerous game-crashing glitches occured. The first is what I call the qAF glitch, in which a textbox comes up that delivers endless streams of the word qAF that never stops. Other times my character will simply freeze on a random spot (usually one of the blocks next to a warp). On one occasion, the game wouldn't go past the bootscreen and looped back to it every single time it was supposed to go into the opening animation. On another, the game froze on a black screen when it tried to load the name-entering screen. Every single one of these requires a restart, and the worst part is, the first two are random and will appear at different intervals of time. I have no clue if it's the save patch, the ASM code, or my own incompitence causing this, but every time I applied the variable code, it broke the game. Are you positive that it's safe to use those variables even with the code? I feel like they're way too important to overwrite or that they contain something super important in them. Hopefully this little bug report can fix the code (although honestly, there's enough variables since one can hold enormous values and work for numerous scripts, but it'd still be nice)

/end wall
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
It's the same code that's in LC. Unchanged. It works in LC perfectly, so I have to assume you've screwed something up.

It turns out I accidentally uploaded completely the wrong routine for the var hack. My sincerest apologies!
 
Last edited:

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
I've re-tested and can confirm that this works with no glitches whatsoever.

After more testing, I've found that the current code (as of 6/28/2013) disables movement commands and hidesprite/showsprite.
 
Last edited:

shinyabsol1

Pokemon DarkJasper!?
333
Posts
13
Years
  • Seen Nov 23, 2022
Question: Does the Save Block patch work when applied to a hack that is already in progress? I tested it and it doesn't seem to cause any problems, but you never know.

Regardless, I'm still having problems getting the Variable hack to work even on a clean FR rom. I've tried in numerous times and the results are always the same:

1). The givepokemon command ceases to work. Well, it works but it will always give me a ??? Pokemon.
2). It messes up the unaltered scripts in Palette town. Warping to the town out of your house for the first time activates one of the level scripts and displays some text that Oak says at one time or another.

I'm 99% sure that I followed all the instructions correctly (and the Flag hack gives me no such problems, BTW), so what could be going wrong here?
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
The Var hack doesn't work. All my scripts only show textboxes, nothing else. It's this one, because I did one at a time.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Then you have messed something up. Both PJBottomz and I have tested the var routine that is here, and it works exactly as intended. There is also the simple fact that it is virtually identical to the system in Liquid Crystal where it works perfectly too.
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
Ok, I think it's me. I have done it 4 times now and made sure the offset ended with C. Then went to the offset and branched with the + 1. I'll just leave it. I came for the flag hack anyway.
 

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
Actually Jambo, I hate to be the devil's advocate, but I tested the hack again and it screwed up movement commands and the hidesprite/showsprite commands. I'll compare the hex code in LC and the one that gets created when assembling the version itt and see if they match. Maybe that'll shed some light on the issue. I can't find the var hack code anywhere in the current LC beta. Are you positive they actually inserted it?
 
Last edited:

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Yes, I know it's in LC because I inserted it.

It's not identical, but it's almost identical (the only differences being the length of the memory used (and by extension, the number of vars)).
 

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
Huh. Well then... something happened during the transition from LC to this topic that causes the code to screw up. Maybe changing the length of the memory used or the number of vars did something wrong, or maybe it's overwriting the code at a wrong offset. When I looked at LC's hex, there were no changes to the code at the offset 0x6E45C. Maybe it's supposed to go somewhere else?
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I just checked it, and there's no differences that could cause problems, except perhaps an oddity where vars lower than 0x4000 would get processed as normal vars. I added extra code to deal with such variables, but those shouldn't cause issues ANYWAY.

Otherwise, all vars are being dealt with exactly as the should, on a logical level, and I checked. LC does have those changes at exactly 0x6E45C, so whichever version you were checking on is, evidently, very outdated.
 

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
It was the most recent one on the hack topic, beta 2.2.
 

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
Ah, okay, this one has changes. Here's my findings and the comparisons between the hack in a regular FR and in LC. Differences, Pointers.

At 0x6E45C:

Code:
Liquid Crystal

02 48 00 47 04 D8 00 20 58 E0 00 00 79 AD 7B 08

Code:
FireRed

00 48 00 47 01 00 80 08

Clearly, there are noticeable differences. I'm guessing the length of the code in LC has to do with the number of variables? Either way, it still works. When I replace the data at 0x6E45C, I usually notice that the code never hits the 08 in the original game's hex. Meaning, the original code is the exact length of LC's code and the one in the post never gets to the ending 08 byte - it's only halfway there.

At the Pointers:

Code:
Liquid Crystal 0x7BAD78

40 20 00 02 84 42 12 DB 50 20 00 02 84 42 10 DB 25 04 00 2D 0D DB 0A 48 84 42 08 D8 50 20 00 02 24 1A 64 00 07 48 00 19 70 BC 02 BC 08 47 00 20 FA E7 20 04 00 28 01 DB 03 48 00 47 03 48 00 47 62 55 00 00 00 D4 03 02 73 E4 06 08 0D E5 06 08

Code:
FireRed 0x800000

41 22 12 02 94 42 15 DB 22 04 00 2A 14 DB 50 22 12 02 94 42 0C DB 52 22 12 02 94 42 08 DA 07 48 50 22 12 02 A4 1A 61 00 40 18 70 BC 02 BC 08 47 00 20 FA E7 02 48 00 47 02 48 00 47 00 D2 03 02 73 E4 06 08 0D E5 06 08

Here, the differences are less noticeable. One thing I did see was that the code after the DB bytes tended to get out of line after ~the third DB. I'll contribute the length of the entire code and possibly the misalignment to less variables again, but it seems like there's stuff in LC's code that wasn't in the one we're getting.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
This version has MORE code, as opposed to less. I simply dealt with the upper limit in a different manner in this version by comparison to LC's. It's functionally identical.

Furthermore, the 2 branches are functionally identical, the only difference being where the pointer gets loaded from.

I know you're trying to help me find the errors, and I appreciate that, however, comparing hex code won't help you find errors. Most of the differences are down to minor changes with regards to registers and how I dealt with the upper limit.

I DID however, give you the wrong memory address for it to read from, which probably didn't help (Latest version of the var code only). I've updated the error in the var code.
 
Last edited:

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
Now it won't assemble.

YgWe7DW.png


The "newline" thing usually isn't a problem, it'll just insert a newline (which doesn't affect anything). I don't know why it says "text" is a bad command though. It was my understanding that that starts off every ASM code.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
You must've missed the . before the word text at the very start.
 

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
Well, the random freezing glitch came back. @_@
 
Back
Top