Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cheat macro lable, addr, code
- if strlen(\code)&1
- dc.b 0
- endif
- \lable:
- .lc = 0
- rept strlen(\code)
- .cc substr .lc+1,.lc+1,\code
- if ('\.cc'='u')|('\.cc'='U')
- dc.b ~$01+1
- elseif ('\.cc'='d')|('\.cc'='D')
- dc.b ~$02+1
- elseif ('\.cc'='l')|('\.cc'='L')
- dc.b ~$04+1
- elseif ('\.cc'='r')|('\.cc'='R')
- dc.b ~$08+1
- elseif ('\.cc'='a')|('\.cc'='A')
- dc.b ~$40+1
- elseif ('\.cc'='b')|('\.cc'='B')
- dc.b ~$10+1
- elseif ('\.cc'='c')|('\.cc'='C')
- dc.b ~$20+1
- else
- inform 3,"Illegal character '\.cc'"
- endif
- .lc = .lc+1
- endr
- dc.l \addr&$FFFFFF
- endm
- CheckButtonPresses:
- move.b $FFFFF605.w,d2 ; get pressed buttons
- beq.s .rts ; if none were pressed, branch
- lea CheatsOffset.w,a1 ; get cheats offset
- tst.l (a1) ; check if no cheats are active
- beq.s .chkallcheats ; if no cheat active, branch
- bsr.s .chk ; check cheats here
- addq.w #2,a1 ; next cheats
- move.b $FFFFF605.w,d2 ; get pressed buttons
- .chk move.w (a1),d0 ; get the offset to read from
- add.b .chtarr(pc,d0.w),d2 ; get next cheat entry
- bne.s .resetcheat ; if not 0, reset cheat
- ; cheat ok
- addq.w #1,(a1) ; next cheat offset
- move.b .chtarr+1(pc,d0.w),d2 ; check if this is the end of the cheat
- bne.s .rts ; if not 0, branch
- clr.w (a1)
- move.l .chtarr+1(pc,d0.w),a0 ; get the address to run
- jmp (a0) ; and run it
- .chtarr dc.w dncht1+1-.chtarr
- dc.w dncht2+1-.chtarr
- dc.w dncht3+1-.chtarr
- dc.w foxcht+1-.chtarr
- dc.w gencht+1-.chtarr
- dc.w 0
- .chkallcheats lea .chtarr(pc),a0 ; get cheats array1
- .chknextcht move.w (a0)+,d0 ; get cheat offset
- beq.s .rts ; if null, end
- move.b .chtarr-1(pc,d0.w),d1 ; get next cheat entry
- add.b d2,d1 ; eor together
- bne.s .chknextcht ; if not 0, rcheck another cheat
- move.w d0,(a1)+ ; save cheats offset
- bra.s .chknextcht ; check next cheat
- .resetcheat clr.w (a1) ; reset cheat
- .rts rts
- ; cheat codes
- cheat dncht1, WriteFanficOnScreen, "BABABCB"
- cheat dncht2, WriteFanficOnScreen, "ABCBCAB"
- cheat dncht3, WriteFanficOnScreen, "ACCABAB"
- cheat foxcht, NatsumiAnim, "BACLUA"
- cheat gencht, GenesisDoes, "UUDDLRLRBA"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement