So, ich kämpfe ja mit den Banditengraphiken herum und habe mir eine kleine Notlösung einfallen lassen. Der Chuck als Bandit ist zwar schön und gut, aber ich vereinfache das Ganze ein bisschen. Es gibt ja den Yoshis Island Grunt als Sprite (sozusagen ein Bandit mit Helm auf dem Kopf). Ich hab nun die Banditengraphiken genommen und so gelegt, dass sie auf den Grunt passen (siehe Screenshot).
Dass der Körper rot ist, ist nicht weiter wichtig. Habe gesehen, dass es die Banditen in blauer und in roter Kleidung gibt, dementsprechend mache ich zwei Sprites draus: Einen blauen Banditen, der langsam geht und einen roten, der schnell läuft und Mario wohl folgt.
1. Die Palette konnte ich mittlerweile ändern. Allerdings existiert nun folgendes Problem: Ich kann einige Felder weiter rechts neben den Banditen springen und töte ihn (warum auch immer). Ebenfalls werde ich getötet, wenn ich eine gewisse Distanz rechts von ihm stehe und er auf mich zuläuft. Kann man das irgendwie beheben? Dazu muss ich sagen, dass ich die Tilemaps in der .asm Datei anders angeordnet habe, und zwar von dem unteren Mittelbereich der SP4 Graphik auf die linke Seite.
2. Scheinbar ist es nicht vorgesehen, dass der Grund durch einen Sprung besiegt werden kann. Ich habe ein wenig mit dem cfg_editor rumgefummelt und mittlerweile eingestellt, dass der Grunt mit einem Sprung auf den Kopf besiegt werden kann. Allerdings hätte ich es gerne, dass er dann wie andere Gegner nach unten aus dem Bildschirm fällt (wie z.B. ein besiegter Chuck). Aktuell ist es so, dass nach einem Sprung auf den Kopf die Graphik noch kurz angezeigt wird und sie dann verschwindet. Sollte da niemand eine Lösung für wissen, werde ich den Grunt in einer Rauchwolke verschwinden lassen.
Spoiler anzeigen;Grunt
;by smkdan
;IMPORTANT: Sprite clipping offset is 9 by default, but may be wider than you'd like.
; Sprite clipping offset 1 is a viable alternative, which is less wide. This will cause the sprite to be unaffected by being
; hit from a block from below.
;you can change the palette to green, blue, red or yellow. The head and feet are unaffected.
;USES EXTRA BIT
;if set, it will run else it will walk.
;Extra prop 1:
;bit 0 = stay on ledges?
;bit 1 = follow mario?
;Tilemaps for SP4
DIR = $03
PROPRAM = $04
PROPINDEX = $05
XDISPINDEX = $06
YDISPINDEX = $07
FRAMEINDEX = $08
TEMP = $09
Speed dcb $08,$F8 ;walking speed
dcb $10,$F0 ;running speed
;C2: for follow behaviour
;1570: frame number
;151C: turn counter
;=====
dcb "INIT"
JSR SUB_HORZ_POS
TYA
STA $157C,x ;face mario intially
STZ $1570,x ;reset frame number
LDA $1588,x
ORA #$04
STA $1588,x
RTL
dcb "MAIN"
PHB
PHK
PLB
JSR Run
PLB
RTL
Return_l
RTS
Run
JSR GET_DRAW_INFO
JSR GFX ;draw sprite
JSR SUB_OFF_SCREEN_X0
LDA $14C8,x
CMP #$08 ;if it's not living, see if the sprite should be generated
BNE Return_l
LDA $9D ;locked sprites?
BNE Return_l
LDA $15D0,x ;yoshi eating?
BNE Return_l
;===
LDA $7FAB28,x ;load prop 1
AND #$01 ;bit 0 set?
BEQ Fall ;if clear, just fall, else stay on ledge
LDA $1588,x ;sprite in air?
ORA $151C,x
BNE OnGround
JSR SUB_CHANGE_DIR
LDA #$01 ;turning decision bit
STA $151C,x
OnGround
LDA $1588,x ;if on the ground, reset the turn counter
AND #$04
BEQ InAir
STZ $151C,x
STZ $AA,x ;no Yspd
BRA InAir
;Only run when stay on ledges is disabled
Fall LDA $1588,x
AND #$04
BEQ InAir
LDA #$10 ;falling yspd, if not already falling
STA $AA,x
;===
InAir
LDA $1588,x ;touching object?
AND #$03
BEQ SameDir
LDA $157C,x
EOR #$01 ;invert direction
STA $157C,x
SameDir
LDA $7FAB10,x ;extra bit
AND #$04 ;just that
LSR A ;bit 1 = running
ORA $157C,x ;bit 0 = direction
TAY ;into Y
LDA Speed,y ;x speed depends on direction
STA $B6,x
JSL $018032 ;other sprites
JSL $01802A ;update position based on speed values
JSL $01A7DC ;mario interact
LDA $7FAB28,x ;load prop 1
AND #$02 ;bit 1, follow mario?
BEQ Return ;if clear, don't do anything else
JSR SUB_HORZ_POS ;left/right?
TYA ;result into A
CMP $157C,x ;compare to direction, if matches there's no need to follow
BEQ NoFollowing
LDA $C2,x
INC A
STA $C2,x
CMP #$10 ;don't change dir for X frames
BNE Return ;if not yet, return
LDA $157C,x ;else flip direction
EOR #$01
STA $157C,x ;and, also reset turn counter
NoFollowing
STZ $C2,x ;not following = zero follow counter for later use
Return
RTS
;=====
TILEMAP dcb $E2,$A0,$C0
dcb $F0,$F1 ;different feet tiles
dcb $E2,$A0,$C0
dcb $E0,$F1
dcb $E2,$A0,$C0
dcb $E1,$E1
dcb $E2,$A0,$C0
dcb $E0,$E1
dcb $E2,$A0,$C0
dcb $F0,$F1
;running tilemaps
dcb $E2,$A0,$C0
dcb $F0,$E1
dcb $E2,$A0,$C0
dcb $E0,$E0
dcb $E2,$A0,$C0
dcb $E0,$E0
XDISP dcb $00,$00,$00
dcb $05,$00
dcb $00,$00,$00
dcb $09,$00
dcb $00,$00,$00
dcb $FE,$0C
dcb $00,$00,$00
dcb $FF,$0D
dcb $00,$00,$00
dcb $03,$00
;
dcb $00,$00,$00
dcb $05,$0D
dcb $00,$00,$00
dcb $01,$0A
dcb $00,$00,$00
dcb $01,$0A
XBIAS
dcb $00,$00,$00
dcb $08,$08
YDISP dcb $FE,$05,$0C
dcb $18,$00
dcb $FF,$06,$0D
dcb $18,$00
dcb $00,$07,$0E
dcb $17,$19
dcb $01,$07,$0D
dcb $18,$14
dcb $00,$06,$0C
dcb $18,$00
;
dcb $01,$07,$0D
dcb $18,$17
dcb $00,$06,$0C
dcb $17,$17
dcb $00,$06,$0C
dcb $17,$17
PROP dcb $00,$00,$00
dcb $00,$00
dcb $00,$00,$00
dcb $40,$00
dcb $00,$00,$00
dcb $00,$40
dcb $00,$00,$00
dcb $00,$00
dcb $00,$00,$00
dcb $00,$00
;
dcb $00,$00,$00
dcb $00,$40
dcb $00,$00,$00
dcb $00,$40
dcb $00,$00,$00
dcb $00,$40
CPAL dcb $00,$00,$00 ;00 if custom palette is used, else palette data here is used
dcb $03,$03 ;feet are blue
SIZE dcb $02,$02,$02
dcb $00,$00
EORF dcb $40,$00
GFX
LDA $157C,x ;direction
STA DIR
LDA $15F6,x ;properties, palette and page bit
STA PROPRAM
LDA $7FAB10,x
AND #$04 ;extra bit = running
BEQ Walking
LDA $14
AND #$01 ;every odd frame
BNE SkipR
LDA $9D ;due to odd way it animates, skip animating if sprites are locked
BNE SkipR
LDA $14C8,x ;if not normal status, don't animate
CMP #$08
BNE SkipR
LDA $1570,x
INC A
STA $1570,x
CMP #$03 ;3 = overflow
BNE SkipR
STZ $1570,x
SkipR
LDA $1570,x
ASL A
ASL A ;x4
CLC
ADC $1570,x ;x5
ADC #$19 ;+25, skip past walking frames
STA FRAMEINDEX
LDX #$00 ;loop index
BRA OAM_Loop ;jump into loop
Walking
LDA $14
AND #$03 ;every 4th frame
BNE SkipW
LDA $9D ;due to odd way it animates, skip animating if sprites are locked
BNE SkipW
LDA $14C8,x ;if not normal status, don't animate
CMP #$08
BNE SkipW
LDA $1570,x ;grab frame no.
INC A
STA $1570,x
CMP #$05 ;5 = overflow
BNE SkipW
STZ $1570,x
SkipW
LDA $1570,x ;frame no...
ASL A
ASL A ;x4
CLC
ADC $1570,x ;x5
STA FRAMEINDEX
LDX #$00 ;loop index
OAM_Loop
TYA
LSR A
LSR A
PHY
TAY
LDA SIZE,x
STA $0460,y ;size table
PLY ;restore
TXA
CLC
ADC FRAMEINDEX
PHX
TAX
LDA DIR
BNE XLeft
LDA $00
SEC
SBC XDISP,x
PLX ;pulling x here = loop index
CLC
ADC XBIAS,x ;add bias since it throws it on the other side
STA $0300,y
BRA XNext
XLeft
LDA $00
CLC
ADC XDISP,x
STA $0300,y
PLX
XNext
TXA
CLC
ADC FRAMEINDEX
PHX
TAX
LDA $01
CLC
ADC YDISP,x
STA $0301,y
PLX
TXA
CLC
ADC FRAMEINDEX
PHX
TAX
LDA TILEMAP,x
STA $0302,y
PLX
TXA
CLC
ADC FRAMEINDEX
PHX
TAX
LDA PROP,x
ORA $64
PHX
LDX DIR
EOR EORF,x
PLX
PLX ;restore loop index, since the same palette applies to each tile
STA TEMP ;store current value to TEMP
LDA CPAL,x
BEQ CustomPal ;if zero, use user supplied palette
ASL A ;else move into palette bits
TSB TEMP ;OR with current bits
LDA PROPRAM
AND #$01 ;load only the low bit, page bit
TSB TEMP ;OR with current bits
LDA TEMP ;get ready to store it
BRA StoreProp ;skip past custom palette bit
CustomPal
LDA #$00 ;reset
LDA PROPRAM ;just OR with propram
ORA TEMP ;and also TEMP
StoreProp
STA $0303,y
INY
INY
INY
INY
INX
CPX #$05 ;5 tiles ATM
BEQ End_Loop
JMP OAM_Loop
End_Loop
LDX $15E9
LDY #$FF ;$460 written to
LDA #$04 ;5 tiles
JSL $01B7B3
RTS
;=================
;BORROWED ROUTINES
;=================
;GET_DRAW_INFO
;==============
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $B760 - graphics routine helper - shared
; sets off screen flags and sets index to OAM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SPR_T1 dcb $0C,$1C
SPR_T2 dcb $01,$02
GET_DRAW_INFO STZ $186C,x ; reset sprite offscreen flag, vertical
STZ $15A0,x ; reset sprite offscreen flag, horizontal
LDA $E4,x ; \
CMP $1A ; | set horizontal offscreen if necessary
LDA $14E0,x ; |
SBC $1B ; |
BEQ ON_SCREEN_X ; |
INC $15A0,x ; /
ON_SCREEN_X LDA $14E0,x ; \
XBA ; |
LDA $E4,x ; |
REP #$20 ; |
SEC ; |
SBC $1A ; | mark sprite invalid if far enough off screen
CLC ; |
ADC.W #$0040 ; |
CMP.W #$0180 ; |
SEP #$20 ; |
ROL A ; |
AND #$01 ; |
STA $15C4,x ; /
BNE INVALID ;
LDY #$00 ; \ set up loop:
LDA $1662,x ; |
AND #$20 ; | if not smushed (1662 & 0x20), go through loop twice
BEQ ON_SCREEN_LOOP ; | else, go through loop once
INY ; /
ON_SCREEN_LOOP LDA $D8,x ; \
CLC ; | set vertical offscreen if necessary
ADC SPR_T1,y ; |
PHP ; |
CMP $1C ; | (vert screen boundry)
ROL $00 ; |
PLP ; |
LDA $14D4,x ; |
ADC #$00 ; |
LSR $00 ; |
SBC $1D ; |
BEQ ON_SCREEN_Y ; |
LDA $186C,x ; | (vert offscreen)
ORA SPR_T2,y ; |
STA $186C,x ; |
ON_SCREEN_Y DEY ; |
BPL ON_SCREEN_LOOP ; /
LDY $15EA,x ; get offset to sprite OAM
LDA $E4,x ; \
SEC ; |
SBC $1A ; | $00 = sprite x position relative to screen boarder
STA $00 ; /
LDA $D8,x ; \
SEC ; |
SBC $1C ; | $01 = sprite y position relative to screen boarder
STA $01 ; /
RTS ; return
INVALID PLA ; \ return from *main gfx routine* subroutine...
PLA ; | ...(not just this subroutine)
RTS ; /
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SUB_OFF_SCREEN
; This subroutine deals with sprites that have moved off screen
; It is adapted from the subroutine at $01AC0D
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SPR_T12 dcb $40,$B0
SPR_T13 dcb $01,$FF
SPR_T14 dcb $30,$C0,$A0,$C0,$A0,$F0,$60,$90 ;bank 1 sizes
dcb $30,$C0,$A0,$80,$A0,$40,$60,$B0 ;bank 3 sizes
SPR_T15 dcb $01,$FF,$01,$FF,$01,$FF,$01,$FF ;bank 1 sizes
dcb $01,$FF,$01,$FF,$01,$00,$01,$FF ;bank 3 sizes
SUB_OFF_SCREEN_X1 LDA #$02 ; \ entry point of routine determines value of $03
BRA STORE_03 ; | (table entry to use on horizontal levels)
SUB_OFF_SCREEN_X2 LDA #$04 ; |
BRA STORE_03 ; |
SUB_OFF_SCREEN_X3 LDA #$06 ; |
BRA STORE_03 ; |
SUB_OFF_SCREEN_X4 LDA #$08 ; |
BRA STORE_03 ; |
SUB_OFF_SCREEN_X5 LDA #$0A ; |
BRA STORE_03 ; |
SUB_OFF_SCREEN_X6 LDA #$0C ; |
BRA STORE_03 ; |
SUB_OFF_SCREEN_X7 LDA #$0E ; |
STORE_03 STA $03 ; |
BRA START_SUB ; |
SUB_OFF_SCREEN_X0 STZ $03 ; /
START_SUB JSR SUB_IS_OFF_SCREEN ; \ if sprite is not off screen, return
BEQ RETURN_35 ; /
LDA $5B ; \ goto VERTICAL_LEVEL if vertical level
AND #$01 ; |
BNE VERTICAL_LEVEL ; /
LDA $D8,x ; \
CLC ; |
ADC #$50 ; | if the sprite has gone off the bottom of the level...
LDA $14D4,x ; | (if adding 0x50 to the sprite y position would make the high byte >= 2)
ADC #$00 ; |
CMP #$02 ; |
BPL ERASE_SPRITE ; / ...erase the sprite
LDA $167A,x ; \ if "process offscreen" flag is set, return
AND #$04 ; |
BNE RETURN_35 ; /
LDA $13 ;A:8A00 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdiZcHC:0756 VC:176 00 FL:205
AND #$01 ;A:8A01 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizcHC:0780 VC:176 00 FL:205
ORA $03 ;A:8A01 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizcHC:0796 VC:176 00 FL:205
STA $01 ;A:8A01 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizcHC:0820 VC:176 00 FL:205
TAY ;A:8A01 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizcHC:0844 VC:176 00 FL:205
LDA $1A ;A:8A01 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizcHC:0858 VC:176 00 FL:205
CLC ;A:8A00 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdiZcHC:0882 VC:176 00 FL:205
ADC SPR_T14,y ;A:8A00 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdiZcHC:0896 VC:176 00 FL:205
ROL $00 ;A:8AC0 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:eNvMXdizcHC:0928 VC:176 00 FL:205
CMP $E4,x ;A:8AC0 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:eNvMXdizCHC:0966 VC:176 00 FL:205
PHP ;A:8AC0 X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizCHC:0996 VC:176 00 FL:205
LDA $1B ;A:8AC0 X:0009 Y:0001 D:0000 DB:01 S:01F0 P:envMXdizCHC:1018 VC:176 00 FL:205
LSR $00 ;A:8A00 X:0009 Y:0001 D:0000 DB:01 S:01F0 P:envMXdiZCHC:1042 VC:176 00 FL:205
ADC SPR_T15,y ;A:8A00 X:0009 Y:0001 D:0000 DB:01 S:01F0 P:envMXdizcHC:1080 VC:176 00 FL:205
PLP ;A:8AFF X:0009 Y:0001 D:0000 DB:01 S:01F0 P:eNvMXdizcHC:1112 VC:176 00 FL:205
SBC $14E0,x ;A:8AFF X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizCHC:1140 VC:176 00 FL:205
STA $00 ;A:8AFF X:0009 Y:0001 D:0000 DB:01 S:01F1 P:eNvMXdizCHC:1172 VC:176 00 FL:205
LSR $01 ;A:8AFF X:0009 Y:0001 D:0000 DB:01 S:01F1 P:eNvMXdizCHC:1196 VC:176 00 FL:205
BCC SPR_L31 ;A:8AFF X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdiZCHC:1234 VC:176 00 FL:205
EOR #$80 ;A:8AFF X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdiZCHC:1250 VC:176 00 FL:205
STA $00 ;A:8A7F X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizCHC:1266 VC:176 00 FL:205
SPR_L31 LDA $00 ;A:8A7F X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizCHC:1290 VC:176 00 FL:205
BPL RETURN_35 ;A:8A7F X:0009 Y:0001 D:0000 DB:01 S:01F1 P:envMXdizCHC:1314 VC:176 00 FL:205
ERASE_SPRITE LDA $14C8,x ; \ if sprite status < 8, permanently erase sprite
CMP #$08 ; |
BCC KILL_SPRITE ; /
LDY $161A,x ;A:FF08 X:0007 Y:0001 D:0000 DB:01 S:01F3 P:envMXdiZCHC:1108 VC:059 00 FL:2878
CPY #$FF ;A:FF08 X:0007 Y:0000 D:0000 DB:01 S:01F3 P:envMXdiZCHC:1140 VC:059 00 FL:2878
BEQ KILL_SPRITE ;A:FF08 X:0007 Y:0000 D:0000 DB:01 S:01F3 P:envMXdizcHC:1156 VC:059 00 FL:2878
LDA #$00 ;A:FF08 X:0007 Y:0000 D:0000 DB:01 S:01F3 P:envMXdizcHC:1172 VC:059 00 FL:2878
STA $1938,y ;A:FF00 X:0007 Y:0000 D:0000 DB:01 S:01F3 P:envMXdiZcHC:1188 VC:059 00 FL:2878
KILL_SPRITE STZ $14C8,x ; erase sprite
RETURN_35 RTS ; return
VERTICAL_LEVEL LDA $167A,x ; \ if "process offscreen" flag is set, return
AND #$04 ; |
BNE RETURN_35 ; /
LDA $13 ; \
LSR A ; |
BCS RETURN_35 ; /
LDA $E4,x ; \
CMP #$00 ; | if the sprite has gone off the side of the level...
LDA $14E0,x ; |
SBC #$00 ; |
CMP #$02 ; |
BCS ERASE_SPRITE ; / ...erase the sprite
LDA $13 ;A:0000 X:0009 Y:00E4 D:0000 DB:01 S:01F3 P:eNvMXdizcHC:1218 VC:250 00 FL:5379
LSR A ;A:0016 X:0009 Y:00E4 D:0000 DB:01 S:01F3 P:envMXdizcHC:1242 VC:250 00 FL:5379
AND #$01 ;A:000B X:0009 Y:00E4 D:0000 DB:01 S:01F3 P:envMXdizcHC:1256 VC:250 00 FL:5379
STA $01 ;A:0001 X:0009 Y:00E4 D:0000 DB:01 S:01F3 P:envMXdizcHC:1272 VC:250 00 FL:5379
TAY ;A:0001 X:0009 Y:00E4 D:0000 DB:01 S:01F3 P:envMXdizcHC:1296 VC:250 00 FL:5379
LDA $1C ;A:001A X:0009 Y:0001 D:0000 DB:01 S:01F3 P:eNvMXdizcHC:0052 VC:251 00 FL:5379
CLC ;A:00BD X:0009 Y:0001 D:0000 DB:01 S:01F3 P:eNvMXdizcHC:0076 VC:251 00 FL:5379
ADC SPR_T12,y ;A:00BD X:0009 Y:0001 D:0000 DB:01 S:01F3 P:eNvMXdizcHC:0090 VC:251 00 FL:5379
ROL $00 ;A:006D X:0009 Y:0001 D:0000 DB:01 S:01F3 P:enVMXdizCHC:0122 VC:251 00 FL:5379
CMP $D8,x ;A:006D X:0009 Y:0001 D:0000 DB:01 S:01F3 P:eNVMXdizcHC:0160 VC:251 00 FL:5379
PHP ;A:006D X:0009 Y:0001 D:0000 DB:01 S:01F3 P:eNVMXdizcHC:0190 VC:251 00 FL:5379
LDA.W $001D ;A:006D X:0009 Y:0001 D:0000 DB:01 S:01F2 P:eNVMXdizcHC:0212 VC:251 00 FL:5379
LSR $00 ;A:0000 X:0009 Y:0001 D:0000 DB:01 S:01F2 P:enVMXdiZcHC:0244 VC:251 00 FL:5379
ADC SPR_T13,y ;A:0000 X:0009 Y:0001 D:0000 DB:01 S:01F2 P:enVMXdizCHC:0282 VC:251 00 FL:5379
PLP ;A:0000 X:0009 Y:0001 D:0000 DB:01 S:01F2 P:envMXdiZCHC:0314 VC:251 00 FL:5379
SBC $14D4,x ;A:0000 X:0009 Y:0001 D:0000 DB:01 S:01F3 P:eNVMXdizcHC:0342 VC:251 00 FL:5379
STA $00 ;A:00FF X:0009 Y:0001 D:0000 DB:01 S:01F3 P:eNvMXdizcHC:0374 VC:251 00 FL:5379
LDY $01 ;A:00FF X:0009 Y:0001 D:0000 DB:01 S:01F3 P:eNvMXdizcHC:0398 VC:251 00 FL:5379
BEQ SPR_L38 ;A:00FF X:0009 Y:0001 D:0000 DB:01 S:01F3 P:envMXdizcHC:0422 VC:251 00 FL:5379
EOR #$80 ;A:00FF X:0009 Y:0001 D:0000 DB:01 S:01F3 P:envMXdizcHC:0438 VC:251 00 FL:5379
STA $00 ;A:007F X:0009 Y:0001 D:0000 DB:01 S:01F3 P:envMXdizcHC:0454 VC:251 00 FL:5379
SPR_L38 LDA $00 ;A:007F X:0009 Y:0001 D:0000 DB:01 S:01F3 P:envMXdizcHC:0478 VC:251 00 FL:5379
BPL RETURN_35 ;A:007F X:0009 Y:0001 D:0000 DB:01 S:01F3 P:envMXdizcHC:0502 VC:251 00 FL:5379
BMI ERASE_SPRITE ;A:8AFF X:0002 Y:0000 D:0000 DB:01 S:01F3 P:eNvMXdizcHC:0704 VC:184 00 FL:5490
SUB_IS_OFF_SCREEN LDA $15A0,x ; \ if sprite is on screen, accumulator = 0
ORA $186C,x ; |
RTS ; / return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SUB_HORZ_POS
; This routine determines which side of the sprite Mario is on. It sets the Y register
; to the direction such that the sprite would face Mario
; It is ripped from $03B817
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SUB_HORZ_POS LDY #$00
LDA $94
SEC
SBC $E4,x
STA $0F
LDA $95
SBC $14E0,x
BPL SPR_L16
INY
SPR_L16 RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SUB_CHANGE_DIR
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;org $019098
SUB_CHANGE_DIR LDA $15AC,x
BNE LABEL41
LDA #$08
STA $15AC,x
LDA $B6,x
EOR #$FF
INC A
STA $B6,x
LDA $157C,x
EOR #$01
STA $157C,x
LABEL41 RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SUB_HORZ_POS
; This routine determines which side of the sprite Mario is on. It sets the Y register
; to the direction such that the sprite would face Mario
; It is ripped from $03B817
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SUB_HORZ_POS LDY #$00
LDA $94
SEC
SBC $E4,x
STA $0F
LDA $95
SBC $14E0,x
BPL SPR_L16
INY
SPR_L16 RTS