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

Author Topic: Button hacks  (Read 681 times)

yugisokubodai

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • Assembly
Button hacks
« on: December 16, 2019, 07:19:37 am »
Some of my hacks on fighting games, that allow you to press a button to do special moves.

1. Power Rangers the fighting

https://www.youtube.com/watch?v=QTnlEMZjOUQ

Code: [Select]
org $00C063
JML newcode

//###########
org $B08010

newcode:
PHX
LDA $7E05E0
TAX
PHP
JSR (move,x)
return:
PLP
PLX
LDA $E2
BIT #$1000
BEQ _C0AD
JML $00C06A

_C0AD:
JML $00C0AD


move:
dw thunder
dw tiger
dw ninja
dw lip
dw shogun
dw gold
dw silver
dw zed

thunder:
LDA $E2
CMP #$0030
BNE +
LDA #$0030
STA $7E06A0
LDA #$008A
STA $7E1A00
BRA end_thunder
+
CMP #$0010
BNE +
LDA #$0003
STA $7E1A00
BRA end_thunder
+
CMP #$0410
BNE +
LDA #$0008
STA $7E1A00
BRA end_thunder
+
CMP #$0020
BNE +
LDA #$0004
STA $7E1A00
BRA end_thunder
+
CMP #$2000
BNE +
LDA #$008A
STA $7E1A00
BRA end_thunder
+
end_thunder:
RTS
tiger:
LDA $E2
CMP #$0030
BNE +
LDA #$0030
STA $7E06A0
LDA #$008A
STA $7E1A00
BRA end_tiger
+
CMP #$0020 //L
BNE +
LDA #$0004
STA $7E1A00
BRA end_tiger
+
CMP #$0010 //R
BNE +
LDA #$0002
STA $7E1A00
BRA end_tiger
+
CMP #$2000  //select
BNE +
LDA #$008A
STA $7E1A00
+
end_tiger:
RTS

ninja:
LDA $E2
CMP #$0030
BNE +
LDA #$0030
STA $7E06A0
LDA #$008A
STA $7E1A00
BRA end_ninja
+
CMP #$0020 //L
BNE +
LDA #$0008
STA $7E1A00
BRA end_ninja
+
CMP #$0010 //R
BNE +
LDA #$0007
STA $7E1A00
BRA end_ninja
+
CMP #$2000
BNE +
LDA #$008A
STA $7E1A00
+
end_ninja:
RTS

lip:
LDA $E2
CMP #$0030
BNE +
LDA #$008A
STA $7E1A00
LDA #$0030
STA $7E06A0
BRA end_lip
+
end_lip:
RTS

shogun:
RTS

gold:
RTS

silver:
RTS

zed:
LDA $E2
CMP #$0030
BNE +
LDA #$0030
STA $7E06A0
LDA #$008A
STA $7E1A00
BRA end_zed
+
CMP #$0010
BNE +
LDA #$0002 //nage
STA $7E1A00
BRA end_zed
+
CMP #$0020
BNE +
LDA #$0011 //kakushi
STA $7E1A00
BRA end_zed
+
CMP #$0410
BNE +
LDA #$0005 //hand2
STA $7E1A00
BRA end_zed
+
CMP #$0420
BNE +
LDA #$0008 //thunder
STA $7E1A00
BRA end_zed
+
CMP #$0120
BNE +
LDA #$0009 //thunder 2
STA $7E1A00
BRA end_zed
+
CMP #$0220
BNE +
LDA #$0004 //hand
STA $7E1A00
BRA end_zed
+
CMP #$0110
BNE +
LDA #$4040
STA $7E1A00
BRA end_zed
+
end_zed:
RTS

December 16, 2019, 07:23:21 am - (Auto Merged - Double Posts are not allowed before 7 days.)
2. Teakwondo

https://www.youtube.com/watch?v=Mbd3pHo9DU8

Code: [Select]
org $828470
LDA $186A
BIT #$0002
//BRA $10




//distance
org $82A50D
//NOP     //trigged regardless to distance
//NOP

//no health limit
org $82A4F5
LDA $15CD,y //HP
CMP #$0110
//BCS $24
NOP
NOP
LDA $1585 //p1 pos
SEC
SBC $15A5 //p2 pos
BPL +
DEC
EOR #$FFFF
+
CMP #$0060
// BCS $0A
nop
nop
JSR $EB4D //check input





org $82EB5B
LDA $16C5,y
BEQ _EB68
LDA #$0000   
STA $16C5,y
BRA _waza
_EB68:
TYA                 
BNE _EB70   
LDA $010D 
BRA _EB73 
_EB70:
LDA $010F 
_EB73:
STA $00
LDA $16A1,y
//BEQ _EBE5
beq +
LDA $16A1,y
DEC
STA $16A1,y
LDA $169F,y
TAX         
TYA       
BNE _EB8D
+
LDA $1892,x //preset button, X= left pos, right pos
BRA _EB90

//JML new_code
_EB8D:
LDA $18B2,x
_EB90:
CMP $00
BNE _EBE3
INX                 
INX                 
TXA                 
STA $169F,y
LDA $D762,x
//BPL _EBE0
nop
nop

_waza:
LDA #$0001      //disable input
STA $169D,y
LDA #$0000 //bne interupt string   
STA $1657,y
TYA                 
EOR #$0020
TAX               
LDA $1585,y
CMP $1585,x
BEQ _EBBF   
BCC _EBBF   
//LDA #$FFFC
LDA #$FFF0
BRA _EBC2
_EBBF:
LDA #$000F //dash speed + range
_EBC2:
STA $1647,y
LDA #$0051
CLC                   
ADC $1593,y //animation ID
TAX               
LDA #$0000
STA $16A1,y
STA $1689,y
LDA #$0001
JSR $ED16
SEC                 
RTS           
BRA _EBE3
_EBE0:
STA $16A1,y
_EBE3:
BRA  _EC02
_EBE5:
LDA $00 
CMP #$0400
BNE _EC02
LDA #$0014
STA $16A1,y
LDA $1591,y
BEQ _EBFC
LDA #$0010
BRA _EBFF
_EBFC:
LDA #$0000
_EBFF:
STA $169F,y
_EC02:
CLC                   
// RTS   




//no health limit move
org $82A4CC
LDA $16C5,y
NOP
NOP



//###################
org $A08000
new_code:

LDA #$2000 //select button
STA $1892
STA $18A2
STA $18B2
STA $18C2
LDA #$0000
STA $1894
STA $18A4
STA $18B4
STA $18C4
STA $1896
STA $18A6
STA $18B6
STA $18C6
LDA $1892,x
JML _EB90

init_move:
LDX #$0000


org $80C91B
db $20 //select
org $80C91D
db $20
org $80C92B
db $20
org $80C92D
db $20

Vanya

  • Hero Member
  • *****
  • Posts: 1714
    • View Profile
Re: Button hacks
« Reply #1 on: December 20, 2019, 12:57:19 am »
When I saw the title I hoped it might be about swapping buttons in general.
Oh well.

Question. Have you ever thought about doing a hack where the specials are executed by pressing a button while holding a direction so that they play more like Smash Bros?
Might be interesting.