I was playing with Castlevania, and just thought of a way to hack it so you can select your weapon just pressing a button. The select button is unused, so its perfect for this. So, first I searched for the RAM address for the joypad. Here's what I found:
F7: Joypad Address
08, Up
04, Down
02, Left
01, Right
10, Start
20, Select,
40, B
80, A
An extract of my VirtuaNES cheat file:
Next thing to do was find a piece of code to replace with a JMP. I used a JMP instead of an JSR because the game crashed sometimes with it. The JMP seems to solve the problem. I maked a trace and I found a winner n_n:
$C144: 9D 00 02 => 4C 3C BA Jump to BA3C
1C154 9D 00 02 => 4C 3C BA
Also I needed a bunch of 00s or FFs to write the new routine:
$BA3C:
1BA4C:
{*1}
When you begin a new game you start without a weapon. So the value of 15b is 0. The first weapon (the dagger) has the 08 value. Any value between 00 and 08 is an useless buggie weapon (some values can freeze the game). So I had to set to 08 the value if you don't have a weapon to prevent that.
{*2}
The clock (0F) is the last weapon. Values beyond it are buggie weapons and some just freeze the game. So when you have the clock, if you press select, the count reverts to 08.
With this routine everytime you press select, your weapon changes to the next one. The only problem I found is the speed of the weapon change. I have to slightly press the button, because It skips 3 or 4 weapons or all of them.
Is there any way to alter the routine to slowdown the weapon select?.
Thank you very much.
Whipon. ñ_ñ
F7: Joypad Address
08, Up
04, Down
02, Left
01, Right
10, Start
20, Select,
40, B
80, A
An extract of my VirtuaNES cheat file:
Code:
#2 015B-01-08 Weapon - Dagger #2 015B-01-09 Weapon - Boomerang #2 015B-01-0A Weapon - Devastator (It kills all enemies on screen) #2 015B-01-0B Weapon - Bottle #2 015B-01-0C Weapon - Red Axe #2 015B-01-0D Weapon - Axe #2 015B-01-0E Weapon - 1 up (Another clock) #2 015B-01-0F Weapon - Clock
Next thing to do was find a piece of code to replace with a JMP. I used a JMP instead of an JSR because the game crashed sometimes with it. The JMP seems to solve the problem. I maked a trace and I found a winner n_n:
$C144: 9D 00 02 => 4C 3C BA Jump to BA3C
1C154 9D 00 02 => 4C 3C BA
Also I needed a bunch of 00s or FFs to write the new routine:
$BA3C:
1BA4C:
Code:
$BA3C:9D 00 02 STA $0200,X @ $02F0 = #$F4
$BA3F:A9 20 LDA #$20
$BA41:C5 F7 CMP $00F7 Compares F7 with 20 (value of Select button)
$BA43:D0 11 BNE $BA56 If not equal branch to BA56
$BA45:A9 00 LDA #$00
$BA47:CD 5B 01 CMP $015B Compares 15B with 0 [COLOR="Red"][B]{*1}[/B][/COLOR]
$BA4A:F0 0D BEQ $BA59 If equal branch to BA59
$BA4C:EE 5B 01 INC $015B Increase 15B by one
$BA4F:A9 0F LDA #$0F
$BA51:CD 5B 01 CMP $015B Compare 15B with 0F [COLOR="Red"][B]{*2}[/B][/COLOR]
$BA54:F0 03 BEQ $BA59 If equal branch to BA59
$BA56:4C 47 C1 JMP $C147 Jump back to C147
$BA59:A9 08 LDA #$08
$BA5B:8D 5B 01 STA $015B Sets 15B to 08
$BA5E:4C 47 C1 JMP $C147
When you begin a new game you start without a weapon. So the value of 15b is 0. The first weapon (the dagger) has the 08 value. Any value between 00 and 08 is an useless buggie weapon (some values can freeze the game). So I had to set to 08 the value if you don't have a weapon to prevent that.
{*2}
The clock (0F) is the last weapon. Values beyond it are buggie weapons and some just freeze the game. So when you have the clock, if you press select, the count reverts to 08.
With this routine everytime you press select, your weapon changes to the next one. The only problem I found is the speed of the weapon change. I have to slightly press the button, because It skips 3 or 4 weapons or all of them.
Is there any way to alter the routine to slowdown the weapon select?.
Thank you very much.
Whipon. ñ_ñ

Comment