2022-02-10 15:21:24 +00:00
|
|
|
.scope Main
|
|
|
|
.zeropage
|
2022-02-10 21:33:27 +00:00
|
|
|
HasBitmap_bitmap_b0:
|
2022-02-10 15:21:24 +00:00
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
2022-02-10 21:33:27 +00:00
|
|
|
HasXpos_xpos_b0:
|
2022-02-10 15:21:24 +00:00
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
2022-02-10 21:33:27 +00:00
|
|
|
HasYpos_ypos_b0:
|
2022-02-10 15:21:24 +00:00
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
2022-02-10 21:33:27 +00:00
|
|
|
SpriteSlot_sprite_b0:
|
2022-02-10 15:21:24 +00:00
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
2022-02-10 21:33:27 +00:00
|
|
|
HasColormap_colormap_b0:
|
2022-02-10 15:21:24 +00:00
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
TEMP:
|
2022-02-17 15:58:13 +00:00
|
|
|
Kernel2Sprite__2__tmp:
|
|
|
|
Joystick__3__tmp:
|
2022-02-19 18:38:16 +00:00
|
|
|
SpriteHider__9__tmp:
|
2022-02-10 15:21:24 +00:00
|
|
|
.res 1
|
2022-02-17 15:58:13 +00:00
|
|
|
SpriteShuffler__8__tmp:
|
2022-02-10 15:21:24 +00:00
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.code
|
2022-02-10 21:33:27 +00:00
|
|
|
KernelSection_lines_b0:
|
|
|
|
.byte 192
|
|
|
|
BGColor_bgcolor_b0:
|
|
|
|
.byte 162
|
2022-02-15 17:25:00 +00:00
|
|
|
Bitmap_bitmapdata_b0:
|
|
|
|
.byte <(Bitmap_bitmapdata_e1_b0+31)
|
|
|
|
.byte <(Bitmap_bitmapdata_e2_b0+31)
|
|
|
|
Bitmap_bitmapdata_b8:
|
|
|
|
.byte >(Bitmap_bitmapdata_e1_b0+31)
|
|
|
|
.byte >(Bitmap_bitmapdata_e2_b0+31)
|
2022-02-10 15:21:24 +00:00
|
|
|
Bitmap_bitmapdata_e1_b0:
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 3
|
|
|
|
.byte 7
|
|
|
|
.byte 15
|
|
|
|
.byte 31
|
|
|
|
.byte 63
|
|
|
|
.byte 127
|
|
|
|
Bitmap_height_b0:
|
|
|
|
.byte 8
|
|
|
|
.byte 8
|
|
|
|
Bitmap_bitmapdata_e2_b0:
|
|
|
|
.byte 24
|
|
|
|
.byte 62
|
|
|
|
.byte 255
|
|
|
|
.byte 255
|
|
|
|
.byte 255
|
|
|
|
.byte 255
|
|
|
|
.byte 62
|
|
|
|
.byte 24
|
2022-02-15 17:25:00 +00:00
|
|
|
Colormap_colormapdata_b0:
|
|
|
|
.byte <(Colormap_colormapdata_e3_b0+31)
|
|
|
|
Colormap_colormapdata_b8:
|
|
|
|
.byte >(Colormap_colormapdata_e3_b0+31)
|
2022-02-10 15:21:24 +00:00
|
|
|
Colormap_colormapdata_e3_b0:
|
|
|
|
.byte 6
|
|
|
|
.byte 3
|
|
|
|
.byte 6
|
|
|
|
.byte 9
|
|
|
|
.byte 12
|
|
|
|
.byte 14
|
|
|
|
.byte 31
|
|
|
|
.byte 63
|
|
|
|
Sprite_plyrflags_b0:
|
|
|
|
.byte 0
|
|
|
|
.byte 3
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
Main__INITDATA:
|
2022-02-10 21:33:27 +00:00
|
|
|
.byte 1
|
2022-02-10 15:21:24 +00:00
|
|
|
.byte 0
|
|
|
|
.byte 1
|
2022-02-10 21:33:27 +00:00
|
|
|
.byte 0
|
2022-02-10 15:21:24 +00:00
|
|
|
.byte 50
|
|
|
|
.byte 100
|
|
|
|
.byte 80
|
|
|
|
.byte 40
|
2022-02-10 21:33:27 +00:00
|
|
|
.byte 150
|
|
|
|
.byte 60
|
|
|
|
.byte 90
|
|
|
|
.byte 150
|
2022-02-10 15:21:24 +00:00
|
|
|
.byte 0
|
2022-02-10 21:33:27 +00:00
|
|
|
.byte 1
|
|
|
|
.byte 2
|
|
|
|
.byte 3
|
2022-02-10 15:21:24 +00:00
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
__Start:
|
2022-02-19 08:37:19 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Init 10 main_init
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
.include "vcs-ca65.h"
|
|
|
|
.macpack longbranch
|
|
|
|
.define PAL 0
|
|
|
|
__NMI:
|
|
|
|
__Reset:
|
|
|
|
__BRK:
|
|
|
|
CLEAN_START
|
|
|
|
|
|
|
|
ldy #20
|
|
|
|
: lda Main__INITDATA-1,y
|
2022-02-10 21:33:27 +00:00
|
|
|
sta HasBitmap_bitmap_b0-1,y
|
2022-02-10 15:21:24 +00:00
|
|
|
dey
|
|
|
|
bne :-
|
2022-02-19 08:37:19 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action FrameLoop 1 start
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
FrameLoop__start__2__NextFrame:
|
|
|
|
FRAME_START
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
.define KLINES #192
|
|
|
|
.define KPAD 32
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
ldy #0
|
|
|
|
Kernel2Sprite__preframe__4____each:
|
|
|
|
ldx SpriteSlot_sprite_b0,y
|
|
|
|
|
|
|
|
; set player object flags
|
|
|
|
lda Sprite_plyrflags_b0,x
|
|
|
|
sta NUSIZ0,y
|
|
|
|
sta REFP0,y
|
|
|
|
; calculate screen height - ypos
|
|
|
|
lda KLINES+KPAD
|
|
|
|
sec
|
|
|
|
sbc HasYpos_ypos_b0,x
|
2022-02-10 21:51:03 +00:00
|
|
|
sta Kernel2Sprite__2__tmp+11
|
2022-02-10 15:21:24 +00:00
|
|
|
; calculate bitmap pointer
|
2022-02-10 21:51:03 +00:00
|
|
|
stx Kernel2Sprite__2__tmp+12 ; save X (Sprite index)
|
2022-02-10 15:21:24 +00:00
|
|
|
lda HasBitmap_bitmap_b0,x ; deref bitmap
|
|
|
|
tax
|
|
|
|
lda Bitmap_bitmapdata_b0,x
|
|
|
|
sec
|
2022-02-10 21:51:03 +00:00
|
|
|
sbc Kernel2Sprite__2__tmp+11
|
|
|
|
sta Kernel2Sprite__2__tmp+0,y ; Y = sprite slot index
|
2022-02-10 15:21:24 +00:00
|
|
|
lda Bitmap_bitmapdata_b8,x
|
|
|
|
sbc #0
|
2022-02-10 21:51:03 +00:00
|
|
|
sta Kernel2Sprite__2__tmp+2,y
|
2022-02-10 15:21:24 +00:00
|
|
|
; get bitmap height
|
|
|
|
lda Bitmap_height_b0,x
|
2022-02-10 21:51:03 +00:00
|
|
|
sta Kernel2Sprite__2__tmp+8,y
|
2022-02-10 15:21:24 +00:00
|
|
|
; calculate colormap pointer
|
2022-02-10 21:51:03 +00:00
|
|
|
ldx Kernel2Sprite__2__tmp+12 ; restore X
|
2022-02-10 15:21:24 +00:00
|
|
|
lda HasColormap_colormap_b0,x ; deref colormap
|
|
|
|
tax
|
|
|
|
lda Colormap_colormapdata_b0,x
|
|
|
|
sec
|
2022-02-10 21:51:03 +00:00
|
|
|
sbc Kernel2Sprite__2__tmp+11
|
|
|
|
sta Kernel2Sprite__2__tmp+4,y
|
2022-02-10 15:21:24 +00:00
|
|
|
lda Colormap_colormapdata_b8,x
|
|
|
|
sbc #0
|
2022-02-10 21:51:03 +00:00
|
|
|
sta Kernel2Sprite__2__tmp+6,y
|
2022-02-10 15:21:24 +00:00
|
|
|
; save ypos
|
2022-02-10 21:51:03 +00:00
|
|
|
ldx Kernel2Sprite__2__tmp+12 ; restore X
|
2022-02-10 15:21:24 +00:00
|
|
|
lda HasYpos_ypos_b0,x
|
2022-02-10 21:51:03 +00:00
|
|
|
sta Kernel2Sprite__2__tmp+10,y
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
iny
|
|
|
|
cpy #2
|
|
|
|
jne Kernel2Sprite__preframe__4____each
|
|
|
|
Kernel2Sprite__preframe__4____exit:
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
; L0 L1 H0 H1 -> L0 H0 L1 H1
|
2022-02-10 21:51:03 +00:00
|
|
|
lda Kernel2Sprite__2__tmp+1
|
|
|
|
ldy Kernel2Sprite__2__tmp+2
|
|
|
|
sty Kernel2Sprite__2__tmp+1
|
|
|
|
sta Kernel2Sprite__2__tmp+2
|
|
|
|
lda Kernel2Sprite__2__tmp+5
|
|
|
|
ldy Kernel2Sprite__2__tmp+6
|
|
|
|
sty Kernel2Sprite__2__tmp+5
|
|
|
|
sta Kernel2Sprite__2__tmp+6
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
lda #162
|
|
|
|
sta COLUBK
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action SetXPos 6 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
sta HMCLR
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action SetXPos 6 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action SetXPos 6 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
ldy #0
|
2022-02-17 18:52:13 +00:00
|
|
|
SetXPos__preframe__9____each:
|
2022-02-10 15:21:24 +00:00
|
|
|
ldx SpriteSlot_sprite_b0,y
|
|
|
|
|
|
|
|
lda HasXpos_xpos_b0,x
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action SetHorizPos 7 SetHorizPos
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
; SetHorizPos routine
|
|
|
|
; A = X coordinate
|
|
|
|
; Y = player number (0 or 1)
|
|
|
|
sta WSYNC ; start a new line
|
|
|
|
sec ; set carry flag
|
|
|
|
nop
|
2022-02-17 18:52:13 +00:00
|
|
|
SetHorizPos__SetHorizPos__10__DivideLoop:
|
2022-02-10 15:21:24 +00:00
|
|
|
sbc #15 ; subtract 15
|
2022-02-17 18:52:13 +00:00
|
|
|
bcs SetHorizPos__SetHorizPos__10__DivideLoop ; branch until negative
|
2022-02-10 15:21:24 +00:00
|
|
|
eor #7 ; calculate fine offset
|
|
|
|
asl
|
|
|
|
asl
|
|
|
|
asl
|
|
|
|
asl
|
|
|
|
sta RESP0,y ; fix coarse position
|
|
|
|
sta HMP0,y ; set fine offset
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action SetHorizPos 7 SetHorizPos
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
cpy #2
|
2022-02-17 18:52:13 +00:00
|
|
|
jne SetXPos__preframe__9____each
|
|
|
|
SetXPos__preframe__9____exit:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action SetXPos 6 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action SetXPos 6 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action SetXPos 6 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action SetXPos 6 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
sta WSYNC
|
|
|
|
sta HMOVE
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action SetXPos 6 preframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
KERNEL_START
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 kernel
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
ldy #0
|
|
|
|
sty VDELP0
|
|
|
|
iny
|
|
|
|
sta VDELP1
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 kernel
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 kernel
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
; define macro for each line
|
2022-02-17 18:52:13 +00:00
|
|
|
.macro Kernel2Sprite__kernel__14__DrawLine do_wsync
|
2022-02-10 15:21:24 +00:00
|
|
|
.local DoDraw1
|
|
|
|
.local DoDraw2
|
|
|
|
; draw player 0
|
2022-02-10 21:51:03 +00:00
|
|
|
lda Kernel2Sprite__2__tmp+8 ; height
|
|
|
|
dcp Kernel2Sprite__2__tmp+10 ; ypos
|
2022-02-10 15:21:24 +00:00
|
|
|
bcs DoDraw1
|
|
|
|
lda #0
|
|
|
|
.byte $2C
|
|
|
|
DoDraw1:
|
2022-02-10 21:51:03 +00:00
|
|
|
lda (Kernel2Sprite__2__tmp+0),y
|
2022-02-10 15:21:24 +00:00
|
|
|
.if do_wsync
|
|
|
|
sta WSYNC
|
|
|
|
.endif
|
|
|
|
sta GRP0
|
2022-02-10 21:51:03 +00:00
|
|
|
lda (Kernel2Sprite__2__tmp+4),y
|
2022-02-10 15:21:24 +00:00
|
|
|
sta COLUP0
|
|
|
|
; draw player 1
|
2022-02-10 21:51:03 +00:00
|
|
|
lda Kernel2Sprite__2__tmp+9 ; height
|
|
|
|
dcp Kernel2Sprite__2__tmp+11 ; ypos
|
2022-02-10 15:21:24 +00:00
|
|
|
bcs DoDraw2
|
|
|
|
lda #0
|
|
|
|
.byte $2C
|
|
|
|
DoDraw2:
|
2022-02-10 21:51:03 +00:00
|
|
|
lda (Kernel2Sprite__2__tmp+2),y
|
2022-02-10 15:21:24 +00:00
|
|
|
sta GRP1
|
2022-02-10 21:51:03 +00:00
|
|
|
lda (Kernel2Sprite__2__tmp+6),y
|
2022-02-10 15:21:24 +00:00
|
|
|
sta COLUP1
|
|
|
|
.endmacro
|
|
|
|
|
|
|
|
ldy #192
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel2Sprite__kernel__14__LVScan:
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 scanline1
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 scanline1
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel2Sprite__kernel__14__DrawLine 1 ; macro: draw scanline w/ WSYNC
|
2022-02-10 15:21:24 +00:00
|
|
|
dey ; next scanline
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel2Sprite__kernel__14__DrawLine 0 ; macro: draw scanline no WSYNC
|
2022-02-10 15:21:24 +00:00
|
|
|
dey ; next scanline
|
2022-02-17 18:52:13 +00:00
|
|
|
bne Kernel2Sprite__kernel__14__LVScan ; repeat until out of lines
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 kernel
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Kernel2Sprite 2 kernel
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta GRP0
|
|
|
|
sta GRP1
|
|
|
|
sta GRP0
|
|
|
|
sta GRP1
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Kernel2Sprite 2 kernel
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
KERNEL_END
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Joystick 3 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
; 2 control inputs share a single byte, 4 bits each
|
|
|
|
lda SWCHA
|
2022-02-10 21:51:03 +00:00
|
|
|
sta Joystick__3__tmp+0
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Joystick 3 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action Joystick 3 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
ldx #0
|
2022-02-17 18:52:13 +00:00
|
|
|
Joystick__postframe__18____each:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
asl Joystick__3__tmp+0
|
2022-02-17 18:52:13 +00:00
|
|
|
bcs Joystick__postframe__18__SkipMoveRight
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action MoveJoyX 4 joyright
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
lda HasXpos_xpos_b0,x
|
|
|
|
clc
|
|
|
|
adc #1
|
|
|
|
cmp #152
|
2022-02-17 18:52:13 +00:00
|
|
|
bcs MoveJoyX__joyright__19__nomove
|
2022-02-10 15:21:24 +00:00
|
|
|
sta HasXpos_xpos_b0,x
|
2022-02-17 18:52:13 +00:00
|
|
|
MoveJoyX__joyright__19__nomove:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action MoveJoyX 4 joyright
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Joystick__postframe__18__SkipMoveRight:
|
2022-02-10 21:51:03 +00:00
|
|
|
asl Joystick__3__tmp+0
|
2022-02-17 18:52:13 +00:00
|
|
|
bcs Joystick__postframe__18__SkipMoveLeft
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action MoveJoyX 4 joyleft
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
lda HasXpos_xpos_b0,x
|
|
|
|
sec
|
|
|
|
sbc #1
|
2022-02-17 18:52:13 +00:00
|
|
|
bcc MoveJoyX__joyleft__20__nomove
|
2022-02-10 15:21:24 +00:00
|
|
|
sta HasXpos_xpos_b0,x
|
2022-02-17 18:52:13 +00:00
|
|
|
MoveJoyX__joyleft__20__nomove:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action MoveJoyX 4 joyleft
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Joystick__postframe__18__SkipMoveLeft:
|
2022-02-10 21:51:03 +00:00
|
|
|
asl Joystick__3__tmp+0
|
2022-02-17 18:52:13 +00:00
|
|
|
bcs Joystick__postframe__18__SkipMoveDown
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action MoveJoyY 5 joydown
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
lda HasYpos_ypos_b0,x
|
|
|
|
clc
|
|
|
|
adc #1
|
|
|
|
cmp #220
|
2022-02-17 18:52:13 +00:00
|
|
|
bcs MoveJoyY__joydown__21__nomove
|
2022-02-10 15:21:24 +00:00
|
|
|
sta HasYpos_ypos_b0,x
|
2022-02-17 18:52:13 +00:00
|
|
|
MoveJoyY__joydown__21__nomove:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action MoveJoyY 5 joydown
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Joystick__postframe__18__SkipMoveDown:
|
2022-02-10 21:51:03 +00:00
|
|
|
asl Joystick__3__tmp+0
|
2022-02-17 18:52:13 +00:00
|
|
|
bcs Joystick__postframe__18__SkipMoveUp
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action MoveJoyY 5 joyup
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
lda HasYpos_ypos_b0,x
|
|
|
|
sec
|
|
|
|
sbc #1
|
2022-02-17 18:52:13 +00:00
|
|
|
bcc MoveJoyY__joyup__22__nomove
|
2022-02-10 15:21:24 +00:00
|
|
|
sta HasYpos_ypos_b0,x
|
2022-02-17 18:52:13 +00:00
|
|
|
MoveJoyY__joyup__22__nomove:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action MoveJoyY 5 joyup
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Joystick__postframe__18__SkipMoveUp:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
inx
|
|
|
|
cpx #4
|
2022-02-17 18:52:13 +00:00
|
|
|
jne Joystick__postframe__18____each
|
|
|
|
Joystick__postframe__18____exit:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Joystick 3 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action SpriteShuffler 8 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
; load two sprite slots at left side of array
|
|
|
|
lda SpriteSlot_sprite_b0
|
2022-02-10 21:51:03 +00:00
|
|
|
sta SpriteShuffler__8__tmp+0
|
2022-02-10 15:21:24 +00:00
|
|
|
lda SpriteSlot_sprite_b0+1
|
2022-02-10 21:51:03 +00:00
|
|
|
sta SpriteShuffler__8__tmp+1
|
2022-02-10 15:21:24 +00:00
|
|
|
; move two slots to the left
|
|
|
|
ldx #0
|
2022-02-17 18:52:13 +00:00
|
|
|
SpriteShuffler__postframe__23__loop:
|
2022-02-10 15:21:24 +00:00
|
|
|
lda SpriteSlot_sprite_b0+2,x
|
|
|
|
sta SpriteSlot_sprite_b0,x
|
|
|
|
inx
|
|
|
|
cpx #4-2
|
2022-02-17 18:52:13 +00:00
|
|
|
bne SpriteShuffler__postframe__23__loop
|
2022-02-10 15:21:24 +00:00
|
|
|
; store two sprite slots at right side of array
|
2022-02-10 21:51:03 +00:00
|
|
|
lda SpriteShuffler__8__tmp+0
|
2022-02-10 15:21:24 +00:00
|
|
|
sta SpriteSlot_sprite_b0+4-2
|
2022-02-10 21:51:03 +00:00
|
|
|
lda SpriteShuffler__8__tmp+1
|
2022-02-10 15:21:24 +00:00
|
|
|
sta SpriteSlot_sprite_b0+4-1
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action SpriteShuffler 8 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action SpriteHider 9 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
lda #4-1
|
2022-02-10 21:51:03 +00:00
|
|
|
sta SpriteHider__9__tmp+0
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action SpriteHider 9 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; start action SpriteHider 9 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
ldy #0
|
2022-02-17 18:52:13 +00:00
|
|
|
SpriteHider__postframe__25____each:
|
2022-02-10 15:21:24 +00:00
|
|
|
ldx SpriteSlot_sprite_b0,y
|
|
|
|
|
|
|
|
lda HasYpos_ypos_b0,x
|
|
|
|
cmp #192
|
2022-02-17 18:52:13 +00:00
|
|
|
bcc SpriteHider__postframe__25__skip
|
2022-02-10 15:21:24 +00:00
|
|
|
; swap this sprite slot with slot at end of array
|
|
|
|
lda SpriteSlot_sprite_b0,y
|
|
|
|
pha
|
2022-02-10 21:51:03 +00:00
|
|
|
ldx SpriteHider__9__tmp+0 ; clobbers X, but no longer used
|
2022-02-10 15:21:24 +00:00
|
|
|
lda SpriteSlot_sprite_b0,x
|
|
|
|
sta SpriteSlot_sprite_b0,y
|
|
|
|
pla
|
|
|
|
sta SpriteSlot_sprite_b0,x
|
2022-02-10 21:51:03 +00:00
|
|
|
dec SpriteHider__9__tmp+0
|
2022-02-17 18:52:13 +00:00
|
|
|
SpriteHider__postframe__25__skip:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
iny
|
|
|
|
cpy #2
|
2022-02-17 18:52:13 +00:00
|
|
|
jne SpriteHider__postframe__25____each
|
|
|
|
SpriteHider__postframe__25____exit:
|
2022-02-10 15:21:24 +00:00
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action SpriteHider 9 postframe
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
FRAME_END
|
2022-02-19 10:06:25 +00:00
|
|
|
|
2022-02-10 15:21:24 +00:00
|
|
|
jmp FrameLoop__start__2__NextFrame ; loop to next frame
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action FrameLoop 1 start
|
2022-02-10 15:21:24 +00:00
|
|
|
; start main routine
|
|
|
|
.segment "VECTORS"
|
|
|
|
Return: .word $6060
|
|
|
|
VecNMI:
|
|
|
|
VecReset: .word Main::__Reset
|
|
|
|
VecBRK: .word Main::__BRK
|
|
|
|
|
2022-02-10 21:51:03 +00:00
|
|
|
;;; end action Init 10 main_init
|
2022-02-10 15:21:24 +00:00
|
|
|
|
|
|
|
.endscope
|
|
|
|
Main__Start = Main::__Start
|