Welcome to Spyro the Dragon Forums!

You are not logged in.

#26 Dec 05, 2014 5:14 PM

Stormy
Administrator
Award: Admin
From: Illinois
Registered: Jun 01, 2006
Posts: 10,077
Gems: 487
Birthday: 3 April
Gender: Female
Website

Re: IN NEED OF GAMESHARK CODE

Ulfbjörn wrote:

As a funny side note, merely changing this value doesn't only affect how many hits Spyro / Sparx can take but it actually directly affects the visual appearance of Sparx as well. Setting it to anything above 4 (which is the highest you can normally get in the game) will cause some interesting visuals on Sparx, some higher values cause him to fly upside down, others change his colours to gray or greatly increase the size of his glowing rays. I don't know why this would happen, it's just a byte value so it shouldn't overflow into his transform; I suppose the latter is set by some calculation using the previous. Also, setting the value to for example 5 will allow you to survive 5 hits, it is only clamped by the game upon eating a butterfly.

I really want to try experimenting with this now, haha.

Actually, this whole thread is pretty interesting. Don't have a Gameshark, though. sad


Come watch me play dance games and other stuff on Twitch!

Offline

#27 Dec 05, 2014 5:33 PM

CaptainBee
Member
From: Facet 5
Registered: Aug 10, 2013
Posts: 244
Gems: 0
Age: 20 years old
Gender: Female

Re: IN NEED OF GAMESHARK CODE

oh duh.. i thought i had read somewhere that sparx's health is 75, 50, 25 etc. anyway thanks for the quick responses tongue
btw i found some interesting things with the dialogue cheat.

right before sheilas cutscene started i did the cheat.
tumblr_ng4dpoOp4J1rpco6xo1_1280.png
the weird thing is that her voice actress recorded this dialogue (same with sgt byrd) but it's never used within the game. agent 9 says the same thing after beating the sorceress without freeing him though he lacks his voice actor unlike sheila and sgt byrd
also moneybags does this
tumblr_ng4dpoOp4J1rpco6xo2_1280.png

also i figured out that getting eggs before cutscenes happen, you can get multiple eggs by pushing L2 over and over again.
tumblr_ng4dpoOp4J1rpco6xo3_1280.png

edit: i also discovered that sgt byrd's alternate character model has an idle animation
tumblr_ng4hsg3L5E1rpco6xo1_400.gif
it always bugged me that the other playable characters didnt really have an idle animation. they just kinda... stared...

Last edited by CaptainBee (Dec 05, 2014 6:57 PM)

Offline

#28 Dec 05, 2014 9:50 PM

LXShadow
Member
From: Lurker's Corner (England)
Registered: Nov 05, 2010
Posts: 67
Gems: 0

Re: IN NEED OF GAMESHARK CODE

Wow- That's some pretty awesome stuff! Love how Moneybags is acting like 'what am I even doing here' in the second picture. XD Most of these are things I haven't seen in all the years I hacked this game. Nicely done big_smile

Ulfbjörn, forgive me but that code's ringing alarm bells! It's going over the PS1's 2MB memory. If it does actually work I am gonna be pretty impressed =P

Offline

#29 Dec 05, 2014 11:38 PM

Ulfbjörn
Member
From: Sweden
Registered: Sep 18, 2013
Posts: 54
Gems: 0

Re: IN NEED OF GAMESHARK CODE

Haha, nice findings Agent 9 big_smile

Stormy wrote:

Actually, this whole thread is pretty interesting. Don't have a Gameshark, though.

You can use pec if you use an emulator, otherwise I'm sure the real PSX appendage can be bought second hand from here and there. I actually have two Action Replay's (the European name of essentially the same thing) laying around, I can't remember where or why I got the second one though...

LXShadow wrote:

Ulfbjörn, forgive me but that code's ringing alarm bells! It's going over the PS1's 2MB memory. If it does actually work I am gonna be pretty impressed =P

Hm, yeah I might have screwed that one up, I'll take a look and get back x)

Edit: yep, the actual GS entry from my previous post should be like so:

30070688 - 4

Last edited by Ulfbjörn (Dec 05, 2014 11:56 PM)

Offline

#30 Dec 06, 2014 2:05 AM

CaptainBee
Member
From: Facet 5
Registered: Aug 10, 2013
Posts: 244
Gems: 0
Age: 20 years old
Gender: Female

Re: IN NEED OF GAMESHARK CODE

so ive been messing with cheat engine today and found the address to spyro's height. the address is 00AC32B0 and I want to set the value to 60000 (or EA60 i think) im still not sure how to convert it into a cheat code, ive been reading through different websites and still dont get it.

forgot to mention im trying to make a moon jump cheat since i dont have one for the 1.1 version. also is there a way to set it to a certain button?

Last edited by CaptainBee (Dec 06, 2014 2:06 AM)

Offline

#31 Dec 06, 2014 3:09 AM

Ulfbjörn
Member
From: Sweden
Registered: Sep 18, 2013
Posts: 54
Gems: 0

Re: IN NEED OF GAMESHARK CODE

Agent9 wrote:

so ive been messing with cheat engine today and found the address to spyro's height. the address is 00AC32B0 and I want to set the value to 60000 (or EA60 i think) im still not sure how to convert it into a cheat code, ive been reading through different websites and still dont get it.

The first thing to consider is that the addresses found by CheatEngine are locations in your computer's RAM - they can be either global or relative to the currently scanned process. The addresses used by a GameShark / ActionReplay device instead refer to the Playstation's RAM, or in the case of emulation, the small area of computer memory (2 megabytes as LXShadow pointed out just above here) used to emulate it.
As such the two addresses will be different, however there is a constant offset between them. The easiest way to find this offset is to find one specific memory address that you know both the GameShark and the CheatEngine address entries for. The CheatEngine entry will always be significantly larger than the GameShark one due to the much larger RAM available on a personal computer and the fact that the lowermost addresses are almost certainly reserved for use by its operating system and as such cannot be used by your emulator. One important thing to note here is that the two first hexadecimal digits, or the first byte if you will, of a GameShark code is an opcode for the instruction to perform and as such isn't part of the actual address. The address is instead comprised of the six digits following the opcode and to the left of the hyphen. Not considering this it might (incorrectly) appear that the GameShark address is larger than it should be.
So in conclusion a GameShark instruction looks like this:

xxaaaaaa - bbcc

The xx part is the first byte and is an opcode. This determines what instruction to perform. The most commonly used ones are:
30 - Sets the single byte at the given address to cc. Because it only sets a single byte, only cc is relevant. But in order for the instruction to be valid, bb must be set to 00.
80 - Like the above instruction but this sets two bytes at the given address. Both bb and cc are relevant; bb is commonly the most significant byte and cc the least significant. Since the maximum unsigned value of a single byte is 255, 256 would thus be represented by 01 00. Note that the game might possibly read this in either little or big endian order (which means whether bb or cc is the most significant may differ between different games). The same game should use the same endianness for all its values at least.
D0 - Two byte conditional operation. This instruction needs to be linked with a following one (which is usually one of the memory setting instructions described above). If the value at the given address is equal to the one given in bb cc, the next instruction will be run. If it is not, the next instruction will be skipped. This can be used to only set values in certain situations such as in a certain scene, when a certain event is happening, or when a certain set of buttons are pressed on your controller.
E0 - Identical to the above (D0) instruction, but only checks a single byte. As with the 30 instruction (or any others operating on single bytes), the bb part of the value must be set to 00.
Take note that this instruction is not present in all GameShark products, it seems it was added with a later release of the system.

One thing to keep in mind about instructions that use two bytes (such as 80 and D0 above) is that they can only be used with an even address. If you for example need to set two bytes at an odd address, you will have to use two 30 instructions for it. This has to do with the fact that the PSX's wordlength is 16-bits and it can therefore only access 16-bit blocks of memory. The 8-bit operations work by masking a 16-bit value, but it is not physically possible to read a value at an odd address (if you set a 8-bit value at the address 112233 for example, the whole 16-bit value at address 112232 will be read and masked together with your byte value so that its byte value at address 112232 remains unchanged).
Trying to set a 16-bit value at an odd address will cause your Playstation to crash.


Now for the aaaaaa part, that is a 24-byte address. You should know what this is by now I guess ^^

As described above bb corresponds to the most significant byte and needs to be set to 00 when only setting / comparing 8-bit (single byte) values, and cc corresponds to the least significant byte.



With that out of the way, to find your GameShark (PSX RAM) address, the easiest way is to find a known GameShark code, such as the amount of gems in a level or the number of total dragon eggs. You then find the address for this same value using CheatEngine. Now you can compute the difference, that is the CheatEngine address minus the GameShark address. This difference is your address offset between the two (beware that the addresses used by CheatEngine may change between two runs if they are absolute rather than relative to your emulator process; in this case you will have to find the offset again for each time you restart your emulator). So, if you now know the CheatEngine address and want to turn it into a GameShark address, you simply subtract your calculated offset from the CheatEngine address and there it is!



Agent9 wrote:

also is there a way to set it to a certain button?

Yes, this can be done using the D0 instruction since the PSX stores the current controller button state in a 16-bit value in RAM. I used this to trigger the skip-dialog flag in that code, the address is exactly the same. If you want to use both codes at the same time you probably want to assign your moon jump to another key however.
The instruction you want is thus the following:

D007151A - ????

Now for the ???? you can set this to any button on your controller, or any combination of buttons. The following are the values for the individual buttons:

L1 - FBFF
L2 - FEFF
R1 - F7FF
R2 - FDFF
X  - BFFF
[] - 7FFF
/\ - EFFF
O  - DFFF
↓  - FFBF
←  - FF7F
↑  - FFEF
→  - FFDF
Start - FFF7
Select - FFFE

Combining these values becomes a bit more complex since they are inverses. One easy way to do with without the need for logical operations is to get the inverse of the values, add them together, and then inverse the result again.
For example a trigger when L2 and R2 are pressed simultaneously would be 0100 + 0200 = 0300, which when inverted becomes FBFF. An even easier way might be to think of it as just subtracting the smaller value from the larger where F nybbles are left intact if they exist in all involved values (sorry, the time is 04:00 am here at the moment, I'm not entirely sure if this part makes proper sense).

Summarily, you will put your trigger code (the one with the D0 opcode, checking the button status as described above) directly before the one setting your height value.
Good luck, let us know how it turns out smile

Offline

#32 Dec 06, 2014 5:05 AM

CaptainBee
Member
From: Facet 5
Registered: Aug 10, 2013
Posts: 244
Gems: 0
Age: 20 years old
Gender: Female

Re: IN NEED OF GAMESHARK CODE

OH MY GOSH I CANT BELIEVE IT BUT I ACTUALLY FIGURED IT OUT THANKS SO MUCH tongue :PPPPPP
seriously iM SO SURPRISED I GOT IT TO WORK I MEAN I DONT EVEN KNOW WHAT I DID I ADDED 50001109 TO D007151A AND IT JUST... WORKED??? IDK

Offline

#33 Dec 07, 2014 11:54 PM

Ulfbjörn
Member
From: Sweden
Registered: Sep 18, 2013
Posts: 54
Gems: 0

Re: IN NEED OF GAMESHARK CODE

Glad you got it to work smile

Agent9 wrote:

I DONT EVEN KNOW WHAT I DID I ADDED 50001109 TO D007151A AND IT JUST... WORKED???

If you add the found offset like that you'll get the CE address from the GS one, if that's what you're getting at?
Also you should not keep the D0 part when you do offsets, the address is just the last 6 digits to the left of the hyphen as described above.

On a side note, if you have a more modern GS it might support these opcodes which can be quite interesting when doing moon jumps and the like:
10 - Increments the 16-bit value at the given address by the number you supply (bb cc in my list above). Overflows will happen if you add enough to a 16-bit value that the resulting value exceeds what it can at most contain. This is interesting in that you can couple it with a conditional button check code and the result will be that you can continually increase the value, like Spyro's height, for as long as you press the button. Since this is a 2-byte instruction, the address must be even as usual.
11 - Like the above but it decrements the 16-bit value instead.
20 - Increments the 8-bit value at the given address by the supplied number. As usual, this means bb must be set to 00. Otherwise works like 10; since it's a single byte instruction, the address may be odd or even.
21 - Like the above but it decrements the 8-bit value instead.

Offline

Board footer

Powered by FluxBB