Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;$$inject.asm:
- ;@0609F154
- mov.l @(core_address, PC), R3
- JMP R3
- NOP
- NOP
- core_address:
- dc.l {{ core_address }}
- ;$$ choose_address.asm:
- ;:6118634
- ;:60A4B38, 60AA308, 60AA448, 60ACBCC, 60AD0F4, 60AD8D4, 60ADC1C, 60ADD58
- start:
- MOV.L R14,@-R15
- MOV #$00,R14
- MOV.L R13,@-R15
- MOV.L R12,@-R15
- MOV.L R11,@-R15
- MOV R14,R12
- MOV.W @(groupSize,PC),R13 ; 0930
- MOV.L R10,@-R15
- MOV.L R9,@-R15
- STS.L PR,@-R15
- STS.L MACL,@-R15
- specPallet:
- MOV #$07, R2
- CMP/GT R6,R2
- BT normalPallet
- ADD #$F9, R6
- BRA procPallet
- MOV.L @(newPalLoc,PC),R2 ; 061A7DE8
- normalPallet:
- MOV.L @(palletAddr,PC),R2 ; 061A7DE8
- procPallet:
- MULU.W R13,R4 ; 930 * unit index
- MOV.W @(sideSize,PC),R3 ; 498 (unit half)
- STS MACL,R13
- EXTU.W R13,R13 ; A8 = size of color index
- MULS.W R3,R5 ; 498*?
- MOV.W @(selectionSize,PC),R1 ; A8
- MOV.L @(addr2,PC),R10 ; 06137DF0
- ADD R2,R13
- MOV.L @(addr3,PC),R11 ; 0202839C
- STS MACL,R5
- MULS.W R1,R6 ; multiply color index by A8
- EXTS.W R5,R5
- ADD R5,R13
- STS MACL,R6
- EXTS.W R6,R6
- ADD R6,R13 ; add base value
- ;MOV.L @(testAddr,PC),R3
- ;MOV R3,R13
- ;MOV R3,R2
- MOV.L @(exitLoc,PC),R3
- NOP
- JMP R3
- MOV #$0A,R9
- newPalLoc:
- dc.l {{ new_pallets_address }};
- groupSize:
- dc.w $0930
- align.l
- sideSize:
- dc.w $0498
- align.l
- palletAddr:
- dc.l $061A7DE8
- testAddr:
- dc.l $061A7DE8
- selectionSize:
- dc.w $A8
- align.l
- addr2:
- dc.l $06137DF0
- addr3:
- dc.l $0202839C
- exitLoc:
- dc.l $060D5084
- ;$$core.asm
- start:
- MOV.W R0,@R15 ;<-- possible break/entry point
- EXTS.W R13,R12
- MOV.W @(anyButton,PC),R3 ;<-- 03F0, set to 13F0
- EXTS.W R13,R6
- MOV.W @(btnSet7,PC),R11 ;<-- 0150
- AND R3,R14
- MOV.L @(someAddrx,PC),R5 ;<-- 02017032
- SHLL R6
- MOV.L @(someAddr2,PC),R0 ;<-- 02016B36
- MOV.W @R15,R4
- MOV.B @(R0,R12),R0
- EXTU.W R4,R4
- MOV R4,R7
- OR R11,R7
- CMP/EQ #$00,R0
- BT/S procBtnSel
- ADD R5,R6
- CMP/EQ #$01,R0
- BT resumeMultiPress
- BRA beforeComplete
- NOP
- align.l
- anyButton:
- dc.w $13F0
- align.l
- btnSet7:
- dc.w $0150
- align.l
- someAddrx:
- dc.l $02017032
- someAddr2:
- dc.l $02016B36
- procBtnSel:
- EXTU.W R14,R2
- MOV.W @(btnOnly,PC),R3 ;<-- 03F0, set to 13F0
- TST R3,R2 ;-- Test against 13F0 ( Normal button, with start included )
- BT beforeComplete ;-- complete since no normal button is pressed
- EXTU.W R14,R1
- CMP/EQ R11,R1 ;-- check if lp+mk+hp is pressed
- BF procNormalBtn ;-- if not, proc individual buttons
- BRA unknownProc ;-- button is 7, move it to r0
- MOV R7,R0
- btnOnly:
- dc.w $03F0
- align.l
- procNormalBtn:
- EXTU.W R14,R3
- MOV.W @(btnPressed,PC),R2
- TST R2,R3
- BF btnSpecStart
- MOV.L @(zeroValue, PC),R0 ; just put the normal button in the queue and call it a day
- BRA unknownProc
- OR R4,R0 ; don't know if this is necessary
- btnPressed:
- dc.w $03F0; allow even with start
- ; here is where it starts
- btnSpecStart:
- MOV.W R14,@R6
- MOV #$01,R3
- MOV.L @(btnNormal_1,PC),R0
- MOV #$03,R2
- MOV.B R3,@(R0,R12)
- MOV.L @(btnNormal_2,PC),R0
- BRA beforeComplete
- MOV.B R2,@(R0,R12)
- resumeMultiPress:
- MOV.W @R6,R1
- OR R14,R1
- MOV.W R1,@R6
- MOV.L @(btnNormal_2,PC),R0
- MOV.B @(R0,R12),R2
- ADD #$FF,R2
- MOV.B R2,@(R0,R12)
- EXTS.B R2,R2
- TST R2,R2
- BF chkSpecComplete
- EXTS.W R13,R0 ; after multiple attemps, we never get the value we wanted
- SHLL R0
- MOV.W @(R0,R5),R0 ; load the final value here
- EXTU.W R0,R0
- BRA unknownProc
- OR R4,R0
- btnNormal_1:
- dc.l $02016B36
- btnNormal_2:
- dc.l $02016B38
- chkSpecComplete:
- EXTS.W R13,R0
- SHLL R0
- MOV.W @(R0,R5),R3
- EXTU.W R3,R3
- CMP/EQ R11,R3
- BF beforeComplete
- BRA unknownProc ; release regardless
- MOV R7,R0
- beforeComplete:
- MOV R4,R0
- ; I believe at this point, r0 is checked to see if it contains a value, and pulls when it does?
- unknownProc:
- ADD #$04,R15
- LDS.L @R15+,PR
- MOV.L @R15+,R11
- MOV.L @R15+,R12
- MOV.L @R15+,R13
- RTS
- MOV.L @R15+,R14
- zeroValue:
- dc.l $0
- ;$$ exclude_hold_inject.asm
- ;@0609F0BC
- MOV.L @(chkFunc,PC), R3
- JMP R3
- NOP
- NOP
- chkFunc:
- dc.l {{ exclude_hold_address }}
- ;$$ exclude_hold.asm
- BF p2btnset
- p1btnset:
- MOV.L @(d0609F0BE,PC),R2
- MOV.L @(d0609F0BC,PC),R1
- MOV.W @R2,R14
- BRA complete
- NOP
- p2btnset:
- MOV.L @(d0609F144,PC),R2
- MOV.W @R2,R14
- MOV.L @(d0609F148,PC),R1
- complete:
- MOV.W @R1,R3
- MOV #$18,R5
- NOT R14,R14
- SHLL8 R5
- OR R5,R14
- AND R3,R14
- MOV.L @(jExit,PC), R3
- JSR R3
- EXTU.W R14,R4
- MOV.L @(end,PC), R3
- JMP R3
- NOP
- NOP
- d0609F0BE:
- dc.l $206AA8E
- d0609F0BC:
- dc.l $206AA8C
- d0609F144:
- dc.l $206AA92
- d0609F148:
- dc.l $206AA90
- d0609EF98:
- dc.l $020154F9
- jExit:
- dc.l $0609F32E
- end:
- dc.l $0609F154
- ;$$color_select.asm
- ;:609F588,60962D8
- beginSelColor:
- MOV.L R14,@-R15
- MOV.L R13,@-R15
- MOV.L R12,@-R15
- MOV.L R11,@-R15
- MOV #$01,R12
- MOV.W @(d060A2908,PC),R2
- MOV R12,R3
- MOV.L @(d060A290C,PC),R0
- XOR R4,R3 ; r4 = player num, r3 = opposite player
- MOV.L R10,@-R15
- MOV.L R9,@-R15
- STS.L MACL,@-R15
- MULS.W R2,R3
- STS MACL,R3
- EXTS.W R3,R3
- MOV.B @(R0,R3),R0 ; always 1?
- TST R1,R1
- BF/S unknown01
- EXTS.W R4,R10 ; offset?
- MOV #$FF,R7
- BRA unknown02
- MOV R12,R14
- unknown01:
- MOV.L @(d060A292A,PC),R6 ; 2011387
- MOV R6,R0
- MOV.B @(R0,R10),R7 ; R10 = who, R7 = unit
- EXTS.W R4,R0
- XOR R12,R0
- MOV.B @(R0,R6),R14 ; R14 = oppsite player?
- unknown02:
- EXTS.W R4,R3
- MOV.L @(d060A2938,PC),R0
- XOR R12,R3
- SHLL R3
- MOV.W @(R0,R3),R2
- TST R2,R2
- BF/S unknown03
- MOV #$03,R9
- MOV #$7F,R7
- unknown03:
- MOV.L @(d060A2948,PC),R2 ; investigate further
- EXTS.W R4,R13
- MOV #$00,R11
- XOR R12,R13 ; investigate further
- ADD R2,R13
- MOV R10,R6
- MOV.W @(btnOnly,PC),R1
- EXTU.W R5,R0
- AND R1,R0
- ; set the R0 value now
- ADD R2, R6
- CMP/EQ #$10,R0
- BT jmpBtn1
- CMP/EQ #$20,R0
- BT jmpBtn2
- CMP/EQ #$40,R0
- BT jmpBtn3
- MOV.W @(d060A2964,PC),R1
- CMP/EQ R1,R0
- BT jmpBtn4
- MOV.W @(d060A296A,PC),R1
- CMP/EQ R1,R0
- BT jmpBtn5
- MOV.W @(d060A2970,PC),R1
- CMP/EQ R1,R0
- BT jmpBtn7
- BRA jmpBtn6
- NOP
- jmpBtn1:
- BRA checkStart
- MOV #$00, R0
- jmpBtn2:
- BRA checkStart
- MOV #$01, R0
- jmpBtn3:
- BRA checkStart
- MOV #$02, R0
- jmpBtn4:
- BRA checkStart
- MOV #$03, R0
- jmpBtn5:
- BRA checkStart
- MOV #$04, R0
- jmpBtn6:
- BRA checkStart
- MOV #$05, R0
- jmpBtn7:
- MOV #$06, R0
- checkStart:
- ; just go through with any button, then complete
- MOV #$10, R1
- SHLL8 R1
- AND R5,R1
- TST R1,R1
- BF startPressed
- BRA jmpBtnComplete
- NOP
- startPressed:
- ADD #$07, R0
- jmpBtnComplete:
- MOV.B R0,@R6
- BRA complete
- NOP
- ; start checking for individual buttons
- ;end
- button7pressed:
- MOV.L @(d060A297A,PC),R3
- MOV.B @R3,R0
- EXTU.B R0,R0
- CMP/EQ #$03,R0
- BF btn7Chosen
- MOV.B @R13,R1
- TST R1,R1
- BF button7select
- EXTS.B R7,R7
- EXTS.B R14,R14
- CMP/EQ R14,R7
- BT button1complete
- button7select:
- BRA complete
- MOV.B R11,@R6
- btn7Chosen:
- MOV.B @R13,R0
- CMP/EQ #$06,R0
- BF btn7NotChosen
- EXTS.B R7,R7
- EXTS.B R14,R14
- CMP/EQ R14,R7
- BT button4complete
- btn7NotChosen:
- MOV #$06,R2
- BRA complete
- MOV.B R2,@R6
- button1pressed:
- MOV.B @R13,R1 ; get the other color chosen from player
- TST R1,R1 ; check to see if it's 0
- BF btn1completeAlt ; if the other color is 0 then
- EXTS.B R7,R7 ; selecting char, 7F if not selected
- EXTS.B R14,R14 ; other char
- CMP/EQ R14,R7 ; if same
- BF btn1completeAlt ; jump here if same
- button1complete:
- BRA complete
- MOV.B R9,@R6 ; loading 3 if the same button is pressed
- btn1completeAlt: ; jump here if color is already picked
- BRA complete
- MOV.B R11,@R6
- button2pressed:
- MOV.B @R13,R0
- CMP/EQ #$01,R0
- BF button2complete
- EXTS.B R7,R7
- EXTS.B R14,R14
- CMP/EQ R14,R7
- BF button2complete
- BRA btnMultiComplete
- MOV #$04,R3
- button2complete:
- BRA complete
- MOV.B R12,@R6
- button3pressed:
- MOV.B @R13,R0
- CMP/EQ #$02,R0
- BF button3complete
- EXTS.B R7,R7
- EXTS.B R14,R14
- CMP/EQ R14,R7
- BF button3complete
- BRA btnMultiComplete
- MOV #$05,R3
- button3complete:
- MOV #$02,R1
- BRA complete
- MOV.B R1,@R6
- button4pressed:
- MOV.B @R13,R0
- CMP/EQ #$03,R0
- BF btn4completeAlt
- EXTS.B R7,R7
- EXTS.B R14,R14
- CMP/EQ R14,R7
- BF btn4completeAlt
- button4complete:
- BRA complete
- MOV.B R11,@R6
- btn4completeAlt:
- BRA complete
- MOV.B R9,@R6
- button5pressed:
- MOV.B @R13,R0
- CMP/EQ #$04,R0
- BF button5complete
- EXTS.B R7,R7
- EXTS.B R14,R14
- CMP/EQ R14,R7
- BF button5complete
- BRA complete
- MOV.B R12,@R6
- button5complete:
- MOV #$04,R2
- BRA complete
- MOV.B R2,@R6
- button6Multi:
- MOV.B @R13,R0
- CMP/EQ #$05,R0
- BF btnMCompleteAlt
- EXTS.B R7,R7
- EXTS.B R14,R14
- CMP/EQ R14,R7
- BF btnMCompleteAlt
- MOV #$02,R3
- btnMultiComplete:
- BRA complete
- MOV.B R3,@R6
- btnMCompleteAlt:
- MOV #$05,R1
- MOV.B R1,@R6
- complete:
- LDS.L @R15+,MACL
- MOV.L @R15+,R9
- MOV.L @R15+,R10
- MOV.L @R15+,R11
- MOV.L @R15+,R12
- MOV.L @R15+,R13
- RTS
- MOV.L @R15+,R14
- d060A2908:
- dc.w $0498
- align.l
- d060A290C:
- dc.l $02068C6F
- d060A292A:
- dc.l $02011387
- d060A2938:
- dc.l $020154C2
- d060A2948:
- dc.l $02015683
- d060A2964:
- dc.w $0080
- d060A296A:
- dc.w $0100
- d060A2970:
- dc.w $0150
- align.l
- d060A297A:
- dc.l $020156B2
- btnOnly:
- dc.w $03F0
- align.l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement