2022-02-16 20:50:48 +00:00
|
|
|
.scope Main
|
|
|
|
.zeropage
|
|
|
|
TEMP:
|
2022-02-17 15:58:13 +00:00
|
|
|
Kernel48Pixel__2__tmp:
|
2022-02-16 20:50:48 +00:00
|
|
|
.res 1
|
|
|
|
.res 1
|
|
|
|
.code
|
|
|
|
KernelSection_lines_b0:
|
|
|
|
.byte 10
|
|
|
|
.byte 10
|
|
|
|
.byte 2
|
|
|
|
.byte 10
|
|
|
|
.byte 10
|
|
|
|
BGColor_bgcolor_b0:
|
|
|
|
.byte 160
|
|
|
|
.byte 162
|
|
|
|
.byte 164
|
|
|
|
.byte 162
|
|
|
|
.byte 160
|
|
|
|
PFColor_pfcolor_b0:
|
|
|
|
.byte 252
|
|
|
|
Bitmap48_bitmap0_b0:
|
|
|
|
.byte <Bitmap48_bitmap0_e2_b0
|
|
|
|
Bitmap48_bitmap0_b8:
|
|
|
|
.byte >Bitmap48_bitmap0_e2_b0
|
|
|
|
Bitmap48_bitmap0_e2_b0:
|
|
|
|
.byte 0
|
|
|
|
.byte 240
|
|
|
|
.byte 207
|
|
|
|
.byte 192
|
|
|
|
.byte 196
|
|
|
|
.byte 196
|
|
|
|
.byte 199
|
|
|
|
.byte 196
|
|
|
|
.byte 196
|
|
|
|
.byte 196
|
|
|
|
.byte 192
|
|
|
|
.byte 207
|
|
|
|
.byte 240
|
|
|
|
.byte 192
|
|
|
|
.byte 128
|
|
|
|
Bitmap48_bitmap1_b0:
|
|
|
|
.byte <Bitmap48_bitmap1_e2_b0
|
|
|
|
Bitmap48_bitmap1_b8:
|
|
|
|
.byte >Bitmap48_bitmap1_e2_b0
|
|
|
|
Bitmap48_bitmap1_e2_b0:
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 192
|
|
|
|
.byte 32
|
|
|
|
.byte 144
|
|
|
|
.byte 136
|
|
|
|
.byte 144
|
|
|
|
.byte 32
|
|
|
|
.byte 32
|
|
|
|
.byte 192
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
Bitmap48_bitmap2_b0:
|
|
|
|
.byte <Bitmap48_bitmap2_e2_b0
|
|
|
|
Bitmap48_bitmap2_b8:
|
|
|
|
.byte >Bitmap48_bitmap2_e2_b0
|
|
|
|
Bitmap48_bitmap2_e2_b0:
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 1
|
|
|
|
.byte 2
|
|
|
|
.byte 33
|
|
|
|
.byte 226
|
|
|
|
.byte 129
|
|
|
|
.byte 2
|
|
|
|
.byte 1
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
Bitmap48_bitmap3_b0:
|
|
|
|
.byte <Bitmap48_bitmap3_e2_b0
|
|
|
|
Bitmap48_bitmap3_b8:
|
|
|
|
.byte >Bitmap48_bitmap3_e2_b0
|
|
|
|
Bitmap48_bitmap3_e2_b0:
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 128
|
|
|
|
.byte 64
|
|
|
|
.byte 136
|
|
|
|
.byte 78
|
|
|
|
.byte 130
|
|
|
|
.byte 64
|
|
|
|
.byte 128
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
Bitmap48_bitmap4_b0:
|
|
|
|
.byte <Bitmap48_bitmap4_e2_b0
|
|
|
|
Bitmap48_bitmap4_b8:
|
|
|
|
.byte >Bitmap48_bitmap4_e2_b0
|
|
|
|
Bitmap48_bitmap4_e2_b0:
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 3
|
|
|
|
.byte 4
|
|
|
|
.byte 24
|
|
|
|
.byte 32
|
|
|
|
.byte 64
|
|
|
|
.byte 32
|
|
|
|
.byte 24
|
|
|
|
.byte 4
|
|
|
|
.byte 4
|
|
|
|
.byte 3
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
.byte 0
|
|
|
|
Bitmap48_bitmap5_b0:
|
|
|
|
.byte <Bitmap48_bitmap5_e2_b0
|
|
|
|
Bitmap48_bitmap5_b8:
|
|
|
|
.byte >Bitmap48_bitmap5_e2_b0
|
|
|
|
Bitmap48_bitmap5_e2_b0:
|
|
|
|
.byte 0
|
|
|
|
.byte 255
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 1
|
|
|
|
.byte 225
|
|
|
|
.byte 29
|
|
|
|
.byte 3
|
|
|
|
Bitmap48_height_b0:
|
|
|
|
.byte 14
|
|
|
|
__Start:
|
|
|
|
.code
|
|
|
|
|
|
|
|
;;; start action Init 4 main_init
|
|
|
|
|
|
|
|
.include "vcs-ca65.h"
|
|
|
|
.macpack longbranch
|
|
|
|
.define PAL 0
|
|
|
|
__NMI:
|
|
|
|
__Reset:
|
|
|
|
__BRK:
|
|
|
|
CLEAN_START
|
|
|
|
; initialize data segment
|
|
|
|
.code
|
|
|
|
|
|
|
|
;;; start action FrameLoop 1 start
|
|
|
|
|
|
|
|
FrameLoop__start__2__NextFrame:
|
|
|
|
FRAME_START
|
|
|
|
.code
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 preframe
|
|
|
|
|
|
|
|
.code
|
|
|
|
|
|
|
|
;;; start action Kernel48Pixel 2 kernelsetup
|
|
|
|
|
|
|
|
;;; end action Kernel48Pixel 2 kernelsetup
|
|
|
|
|
|
|
|
;;; start action Kernel48Pixel 2 kernelsetup
|
|
|
|
|
|
|
|
;;; end action Kernel48Pixel 2 kernelsetup
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
lda #160
|
|
|
|
sta COLUBK
|
|
|
|
|
|
|
|
;;; end action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
;;; end action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
;;; end action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
|
|
|
|
;;; end action StaticKernel 3 preframe
|
|
|
|
|
|
|
|
KERNEL_START
|
|
|
|
.code
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 kernel
|
|
|
|
|
|
|
|
ldx #0
|
2022-02-17 18:52:13 +00:00
|
|
|
StaticKernel__kernel__9____each:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
sta WSYNC
|
|
|
|
.code
|
|
|
|
|
|
|
|
;;; start action Kernel48Pixel 2 kernelsetup
|
|
|
|
|
|
|
|
cpx #2+1
|
2022-02-17 18:52:13 +00:00
|
|
|
jcs Kernel48Pixel__kernelsetup__10____skipxhi
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
cpx #2
|
2022-02-17 18:52:13 +00:00
|
|
|
jcc Kernel48Pixel__kernelsetup__10____skipxlo
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
lda #14
|
|
|
|
sta Kernel48Pixel__2__tmp+0 ; scanline counter
|
|
|
|
lda #$22
|
|
|
|
sta COLUP0 ; show how players alternate
|
|
|
|
lda #$12
|
|
|
|
sta COLUP1 ; by having different colors
|
|
|
|
lda #3
|
|
|
|
sta NUSIZ0
|
|
|
|
sta NUSIZ1 ; both players have 3 copies
|
|
|
|
sta WSYNC
|
|
|
|
SLEEPH 34
|
|
|
|
sta RESP0 ; position 1st player
|
|
|
|
sta RESP1 ; ...and 2nd player
|
|
|
|
lda #$10
|
|
|
|
sta HMP1 ; 1 pixel to the left
|
|
|
|
sta WSYNC
|
|
|
|
sta HMOVE ; apply HMOVE
|
|
|
|
SLEEPH 24 ; sleep 24 cycles
|
|
|
|
sta HMCLR ; clear HMOVE registers
|
|
|
|
lda #1
|
|
|
|
sta VDELP0 ; we need the VDEL registers
|
|
|
|
sta VDELP1 ; so we can do our 4-store trick
|
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel48Pixel__kernelsetup__10____skipxlo:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel48Pixel__kernelsetup__10____skipxhi:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
;;; end action Kernel48Pixel 2 kernelsetup
|
|
|
|
|
|
|
|
;;; start action Kernel48Pixel 2 kernelsetup
|
|
|
|
|
|
|
|
cpx #2+1
|
2022-02-17 18:52:13 +00:00
|
|
|
jcs Kernel48Pixel__kernelsetup__11____skipxhi
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
cpx #2
|
2022-02-17 18:52:13 +00:00
|
|
|
jcc Kernel48Pixel__kernelsetup__11____skipxlo
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
lda #252
|
|
|
|
sta COLUP0
|
|
|
|
sta COLUP1
|
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel48Pixel__kernelsetup__11____skipxlo:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel48Pixel__kernelsetup__11____skipxhi:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
;;; end action Kernel48Pixel 2 kernelsetup
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
lda BGColor_bgcolor_b0,x
|
|
|
|
sta COLUBK
|
|
|
|
|
|
|
|
;;; end action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
cpx #2+1
|
2022-02-17 18:52:13 +00:00
|
|
|
jcs StaticKernel__kernelsetup__13____skipxhi
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
cpx #2
|
2022-02-17 18:52:13 +00:00
|
|
|
jcc StaticKernel__kernelsetup__13____skipxlo
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
lda #252
|
|
|
|
sta COLUPF
|
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
StaticKernel__kernelsetup__13____skipxlo:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
StaticKernel__kernelsetup__13____skipxhi:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
;;; end action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
;;; end action StaticKernel 3 kernelsetup
|
|
|
|
|
|
|
|
.code
|
|
|
|
|
|
|
|
;;; start action Kernel48Pixel 2 kerneldraw
|
|
|
|
|
|
|
|
cpx #2+1
|
2022-02-17 18:52:13 +00:00
|
|
|
jcs Kernel48Pixel__kerneldraw__15____skipxhi
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
cpx #2
|
2022-02-17 18:52:13 +00:00
|
|
|
jcc Kernel48Pixel__kerneldraw__15____skipxlo
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
txa
|
|
|
|
pha
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel48Pixel__kerneldraw__15__Loop:
|
2022-02-16 20:50:48 +00:00
|
|
|
ldy Kernel48Pixel__2__tmp+0 ; counts backwards
|
|
|
|
sta WSYNC ; sync to next scanline
|
|
|
|
lda Bitmap48_bitmap0_e2_b0,y ; load B0 (1st sprite byte)
|
|
|
|
sta GRP0 ; B0 -> [GRP0]
|
|
|
|
lda Bitmap48_bitmap1_e2_b0,y ; load B1 -> A
|
|
|
|
sta GRP1 ; B1 -> [GRP1], B0 -> GRP0
|
|
|
|
lda Bitmap48_bitmap2_e2_b0,y ; load B2 -> A
|
|
|
|
sta GRP0 ; B2 -> [GRP0], B1 -> GRP1
|
|
|
|
lda Bitmap48_bitmap5_e2_b0,y ; load B5 -> A
|
|
|
|
sta Kernel48Pixel__2__tmp+1 ; B5 -> temp
|
|
|
|
ldx Bitmap48_bitmap4_e2_b0,y ; load B4 -> X
|
|
|
|
lda Bitmap48_bitmap3_e2_b0,y ; load B3 -> A
|
|
|
|
ldy Kernel48Pixel__2__tmp+1 ; load B5 -> Y
|
|
|
|
sta GRP1 ; B3 -> [GRP1]; B2 -> GRP0
|
|
|
|
stx GRP0 ; B4 -> [GRP0]; B3 -> GRP1
|
|
|
|
sty GRP1 ; B5 -> [GRP1]; B4 -> GRP0
|
|
|
|
sta GRP0 ; ?? -> [GRP0]; B5 -> GRP1
|
|
|
|
dec Kernel48Pixel__2__tmp+0 ; go to next line
|
2022-02-17 18:52:13 +00:00
|
|
|
bpl Kernel48Pixel__kerneldraw__15__Loop ; repeat until < 0
|
2022-02-16 20:50:48 +00:00
|
|
|
pla
|
|
|
|
tax
|
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel48Pixel__kerneldraw__15____skipxlo:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
2022-02-17 18:52:13 +00:00
|
|
|
Kernel48Pixel__kerneldraw__15____skipxhi:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
;;; end action Kernel48Pixel 2 kerneldraw
|
|
|
|
|
|
|
|
;;; start action StaticKernel 3 kerneldraw
|
|
|
|
|
|
|
|
ldy KernelSection_lines_b0,x
|
2022-02-17 18:52:13 +00:00
|
|
|
StaticKernel__kerneldraw__16__loop:
|
2022-02-16 20:50:48 +00:00
|
|
|
sta WSYNC
|
|
|
|
|
|
|
|
dey
|
2022-02-17 18:52:13 +00:00
|
|
|
bne StaticKernel__kerneldraw__16__loop
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
;;; end action StaticKernel 3 kerneldraw
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
cpx #5
|
2022-02-17 18:52:13 +00:00
|
|
|
jne StaticKernel__kernel__9____each
|
|
|
|
StaticKernel__kernel__9____exit:
|
2022-02-16 20:50:48 +00:00
|
|
|
|
|
|
|
;;; end action StaticKernel 3 kernel
|
|
|
|
|
|
|
|
KERNEL_END
|
|
|
|
.code
|
|
|
|
|
|
|
|
FRAME_END
|
|
|
|
.code
|
|
|
|
|
|
|
|
jmp FrameLoop__start__2__NextFrame ; loop to next frame
|
|
|
|
|
|
|
|
;;; end action FrameLoop 1 start
|
|
|
|
; start main routine
|
|
|
|
.segment "VECTORS"
|
|
|
|
Return: .word $6060
|
|
|
|
VecNMI:
|
|
|
|
VecReset: .word Main::__Reset
|
|
|
|
VecBRK: .word Main::__BRK
|
|
|
|
|
|
|
|
;;; end action Init 4 main_init
|
|
|
|
|
|
|
|
.endscope
|
|
|
|
Main__Start = Main::__Start
|