Jump to content

Sharing of cheat used in Raine


ffman1985

Recommended Posts

5 hours ago, ffman1985 said:

At first, i wrongly perceived the $618000, $618002… as unwrittable (since they return to $ff immediately after i change the value). But now i know that to see the effect of changing value, the 3 address should be poke together…

And thank you for telling me that both $618000($618001) and $618002($618003) are both related to the sound code.

I hope this technique can use on all cps games.

The reason why your values are changed is because it's a shared ram which is mapped directly to the z80, it serves as a way of communication between the 68k & the z80. They were pretty in advance for multi cpus architecture considering it was in the 90s, but this way to communicate was probably already used in the 80s in the arcades too.

For the z80 it's some normal ram. You can access it by using the z80 instead, but it obliges to do

cpu z80a (to switch to the z80)
poke $c000-$cfff for this shared ram, this time it's some normal ram for the z80, which means the sound command is in the word $c000-$c001.
But I advise to keep the way it works now since almost all your work is for the 68k, it's just an explanation of why this ram is so weird ! So as soon as the z80 executes during a frame it reads what is there, and eventually changes the values.

For the other games, well maybe, you'll see, maybe I was to careful with the whole area, but it's not a big problem anyway, if something fails you'll know where it comes from !
 

Link to comment
Share on other sites

It is good to know that some rams are shared by different cpus, as i remember that there are many rams that seems nothing happen when i change a value.

Eg: in sfad, $ff805c, which is related to the test service button. It is =$02 when the test service (u) button is pressed. When i manually poke $02 to it, nth happened. Later, i found out that there are some instructions to write value to it from the data registry. So, i remove all the instructions of it temporarily and following that, use poke $ff805c $02 can enter the menu (as in the option mode script). (In x men, the situation is simpler, i can directly poke the ram for test service button, so it is the first game I include the ‘option mode’.)

I don’t know if it is the correct method to hack. But in my newer scripts, i alway use this method when there is ram i want to change value but not ok.

Link to comment
Share on other sites

Update for Street Fighter Zero 2 Alpha Phoenix Edition (sfz2ald.zip):

- includes a new menu screen that look like the ss/ps version with sound effect which is similar to my previous  script for sfad.zip (Again, thank you for the technical support from Tux for the sound effect part)

- add the option in menu, which is the test service. Unlike entering by pressing u buttion, it is forced to show Engligh text regardless of region, and returning to menu screen when leaving.

- can press start to start game in the opening.

- the Dramatic Battle Mode is enhanced: Human player can select all Ex characters including the SF2 version. And the CPU partner can select Evil Ryu and Shin Akuma. (Capcom didn't develop the ai for the sf2 version characters)

- the "Stop flashing on title screen" script is fixed.

(It is NOT needed on menu screen.)

 

Preview:

https://drive.google.com/file/d/1-K1ij0lxQVYTKV9NPDvahn5E_rr6mqRM/view?usp=share_link

Download:

https://drive.google.com/file/d/1dJfwQlwqRDi1Vfn8YVBWjdfzKB5FT_lo/view?usp=share_link

Edited by ffman1985
Link to comment
Share on other sites

Ok, some little optimizations again, get them from git this time, I didn't review the whole script, stopped at the beginning of the menu (Menu Screen), but there is a big one here !

You might eventually want to try :

ff0=peek($FF0000)
if ff0==0

...
elsif ff0==1 ...

instead of having the if peek($FF0000)==0 elsif peek($FF0000)==?? etc, the reason is that the variable version gets the peek result only once, the peek version might get it a lot of times, and functions are a lot slower to evaluate than simple variables.
But you need to check if it really makes a difference by checking the misc counter when changing this, and I was too lazy to do it tonight, so it's just an idea !

Link to comment
Share on other sites

I think i understand the reason of setting a variable instead of repeating using the peek. The $ff0000 is actually represented the mode selected, so it may be named as ‘mode’. It affects whether the vs mode script, training mode script… enable or not. All of my scripts have this part written in the same way. I think i have to re-write all of my scripts partially (including the part for up/down buttons pressed in the menu screen) which is quite a big project, as i almost finish all the script for the cps fighting games…

Edited by ffman1985
Link to comment
Share on other sites

20 minutes ago, ffman1985 said:

I think i understand the reason of setting a variable instead of repeating using the peek. The $ff0000 is actually represented the mode selected, so it may be named as ‘mode’. It affects whether the vs mode script, training mode script… enable or not. All of my script have this part written in the same way. I think i have to re-write all of my scripts (including the part for up/down buttons pressed in the menu screen) which is a painful job for me, as i almost finish all script for the cps fighting games…

Test 1st, maybe the improvement will be almost nothing, in this case don't bother.

Link to comment
Share on other sites

Hello, Tux, I make a variable for $FF000 called "mode" as we have discussed previosuly. Although there is no obvious improvement, I change it for sfad and sfz2ald, as it is rather easy. There are also some minor changes:

sfad:

- bug fix when returning from option

- some color change for menu text

sfz2ald:

- some change in the stop flashing part. (in the old version, when the sceen flashs and turns white, during this, if the stop flashing function executes, the screen will remain white all the time.)

 

Preview:

https://drive.google.com/file/d/12inVaHnm0aJGAeLSLbarpfNFdjAEP-ho/view?usp=share_link

Download:

https://drive.google.com/file/d/1IptRNGbai_rOv0PdlGwM3BZwXq2DF6yf/view?usp=share_link

Edited by ffman1985
Link to comment
Share on other sites

Yeah I was not totally sure it would be worth it for the speed, at least it's good news for my peek function, it's not so slow after all ! And yes it's clearer with the mode variable.

Thanks for the fixes, updated in git.

Link to comment
Share on other sites

Console mode script for the three CPS1 Street Fighter II titles: 

(Each title contains a script for parent rom and one for a japanese rom.)

- the title/menu screen adds the opening music, with the sound effect when switching modes. (This is the first time I try the music staff on cps1 game, so it requires more test for bug.)

- the airplane sprite is used to indicate the mode selected. (Again, it is my first time to try the sprite stuff. I don't know why the sprite keeps flashing.)

- just like the beta script for sf2.txt, you can press the left/right button on the menu screen to change the difficulty. After some test, I think it works as intended. (Remember: you can still set the default difficulty in the dip switch. To save the setting of dip switch, quit Raine in the menu after setting.)(I hate using the dip switch for setting because it is only work in the very beginning of the start up.)

 

Preview:

https://drive.google.com/file/d/1uXibhoWlKeQdgQANHBYPMUXtBS5Muad3/view?usp=share_link

Download:

https://drive.google.com/file/d/1Vxh5cEskfAuufEwWHJvm3oWgE26SkPvc/view?usp=share_link

Edited by ffman1985
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...