PHK
PEA.w .jslrtsreturn-1
PEA $84CE ; varies per bank, must point to RTL-1 (example: $0084CF-1, must be in the same bank as the JML target)
JML $00D076
.jslrtsreturn
REP #$20
LDA XPos
STA $13E9
LDA YPos
STA $13EB
SEP #$20
LDA #$01
STA $13E8
LDA #$12
STA $14A6
;;
[Code der überprüft ob Mario duckt/auf Boden etc.]
[Hier soll der Schadenscode eigentlich hin]
[Animation]
return:
BetweenValues:
RTL
Poses:
db $42,$BB,$30,$3C ;
%RATS_end(0)
;@xkas
!XPos = $94 ;Achtung! 16-bit!!11
!YPos = $96 ; Ebenfalls 16-bit!
macro RATS_start(id)
db "STAR"
dw RATS_Endcode-RATS_Startcode
dw RATS_Endcode-RATS_Startcode ^#$FFFF
RATS_Startcode:
endmacro
macro RATS_end(id)
RATS_Endcode:
endmacro
lorom ;\ ROM is LoRom
header ;/ and has a header.
org $8DC4 ;\ Hijack NMI routine
JSL StatusCode ;| and jump to our code
NOP ;/ also NOP one time.
org $218015 ;| POINT TO FREE SPACE!!!
%RATS_start(0)
StatusCode:
LDA #$02 ;\ Restore previous
STA $420B ;/ hijacked NMI routine.
LDA $7B ;\Check if you're moving
SEC
SBC #$10 ;MinimalWert
CMP #$EB ;MaximalWert - Minimalwert
BCS BetweenValues
NotBetweenValues:
LDA $1470 ;\Check if you're carrying something
BNE return ;/
LDA $73 ;\check if you're ducking
BEQ return ;/
LDA $77 ;\ as always, Check if your in the air
AND #$04 ;|
BEQ return ;/
;;
PHX
LDX $76 ;Mario Direction (00=Left;01=Right)
;REP #$20
LDA !XPos
CLC
ADC CapeOffsetX,x
STA $13E9 ;CapeXPos
LDA !YPos
CLC
ADC CapeOffsetY
STA $13EB
;SEP #$20
;;;
skip:
PHX
LDA $14 ; timer that increases each frame
LSR
AND #$03 ; animate between 00,01,02 and 03 (4 frames)
TAX ; and put that value into X
LDA Poses,x ; Load from the table
PLX
STA $13E0 ; store into pose address
;
PHK
PEA.w .jslrtsreturn-1
PEA $84CE ; varies per bank, must point to RTL-1 (example: $0084CF-1, must be in the same bank as the JML target)
JML $00D076
.jslrtsreturn
;
;;
return:
BetweenValues:
RTL
Poses:
db $42,$BB,$30,$3C ;
CapeOffsetX:
db $10 ;Abstand in Pixel Horizontal
CapeOffsetY:
db $08 ;Abstand in Pixel Vertikal
%RATS_end(0)
.RedColour
db $06,$20
db $06,$21
db $06,$22
db $06,$23
db $06,$24
db $06,$25
db $06,$26
db $06,$27
db $06,$28
db $06,$29
db $06,$2a
db $06,$2b
db $06,$2c
db $06,$2d
db $06,$2e
db $06,$2f
db $06,$30
db $06,$31
db $06,$32
db $06,$33
db $06,$34
db $06,$35
db $06,$36
db $06,$37
db $06,$38
db $06,$39
db $06,$3a
db $06,$3b
db $06,$3c
db $06,$3d
db $00
.GreenColour
db $06,$4e
db $06,$4f
db $06,$50
db $06,$51
db $06,$52
db $06,$53
db $06,$54
db $06,$55
db $06,$56
db $06,$57
db $06,$58
db $06,$59
db $06,$5a
db $06,$5b
db $06,$5c
db $06,$5d
db $06,$5e
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $06,$5f
db $00
.BlueColour
db $06,$9d
db $06,$9e
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $06,$9f
db $00