mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-07-13 22:29:14 +00:00
checkers: sort of split off
This commit is contained in:
parent
c063a35d11
commit
d5b7c3cc6e
12
demos/lovebyte2021/sw/apple2_70_zp.inc
Normal file
12
demos/lovebyte2021/sw/apple2_70_zp.inc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
MEMORY {
|
||||||
|
ZP: start = $70, size = $90, type = rw;
|
||||||
|
RAM: start = $70, size = $8E00, file = %O;
|
||||||
|
}
|
||||||
|
|
||||||
|
SEGMENTS {
|
||||||
|
#CODE: load = RAM, type = ro;
|
||||||
|
#RODATA: load = RAM, type = ro;
|
||||||
|
#DATA: load = RAM, type = rw;
|
||||||
|
#BSS: load = RAM, type = bss, define = yes;
|
||||||
|
ZEROPAGE: load = ZP, type = ro;
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
all:
|
all:
|
||||||
cd boxes && make
|
cd boxes && make
|
||||||
|
cd checkers && make
|
||||||
cd drops && make
|
cd drops && make
|
||||||
cd mode7 && make
|
cd mode7 && make
|
||||||
cd plasma && make
|
cd plasma && make
|
||||||
@ -11,6 +12,7 @@ all:
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
cd boxes && make clean
|
cd boxes && make clean
|
||||||
|
cd checkers && make clean
|
||||||
cd drops && make clean
|
cd drops && make clean
|
||||||
cd mode7 && make clean
|
cd mode7 && make clean
|
||||||
cd plasma && make clean
|
cd plasma && make clean
|
||||||
|
@ -3,6 +3,9 @@ Various experiments in lo-res graphics
|
|||||||
+ boxes
|
+ boxes
|
||||||
makes lores pictures by drawing boxes
|
makes lores pictures by drawing boxes
|
||||||
|
|
||||||
|
+ checkers
|
||||||
|
some attempts at 32B graphics
|
||||||
|
|
||||||
+ drops
|
+ drops
|
||||||
raindrops
|
raindrops
|
||||||
|
|
||||||
|
93
graphics/gr/checkers/Makefile
Normal file
93
graphics/gr/checkers/Makefile
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
include ../../../Makefile.inc
|
||||||
|
|
||||||
|
LINKER_DIR = ../../../linker_scripts/
|
||||||
|
EMPTY_DISK = ../../../empty_disk/empty.dsk
|
||||||
|
|
||||||
|
DOS33 = ../../../utils/dos33fs-utils/dos33
|
||||||
|
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
|
||||||
|
|
||||||
|
all: checkers32.dsk
|
||||||
|
|
||||||
|
checkers32.dsk: HELLO CHECKERS CHECKERS_SMALL CHECKERS_SMALL2 CHECKERS_LINE \
|
||||||
|
CHECKERS_QUESTION CHECKERS_RAINBOW CHECKERS_ORIG
|
||||||
|
cp $(EMPTY_DISK) checkers32.dsk
|
||||||
|
$(DOS33) -y checkers32.dsk SAVE A HELLO
|
||||||
|
$(DOS33) -y checkers32.dsk BSAVE -a 0x070 CHECKERS
|
||||||
|
$(DOS33) -y checkers32.dsk BSAVE -a 0x070 CHECKERS_SMALL
|
||||||
|
$(DOS33) -y checkers32.dsk BSAVE -a 0x070 CHECKERS_SMALL2
|
||||||
|
$(DOS33) -y checkers32.dsk BSAVE -a 0x070 CHECKERS_LINE
|
||||||
|
$(DOS33) -y checkers32.dsk BSAVE -a 0x070 CHECKERS_RAINBOW
|
||||||
|
$(DOS33) -y checkers32.dsk BSAVE -a 0x070 CHECKERS_QUESTION
|
||||||
|
$(DOS33) -y checkers32.dsk BSAVE -a 0x070 CHECKERS_ORIG
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
CHECKERS: checkers.o
|
||||||
|
ld65 -o CHECKERS checkers.o -C $(LINKER_DIR)/apple2_70_zp.inc
|
||||||
|
|
||||||
|
checkers.o: checkers.s
|
||||||
|
ca65 -o checkers.o checkers.s -l checkers.lst
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
CHECKERS_SMALL: checkers_small.o
|
||||||
|
ld65 -o CHECKERS_SMALL checkers_small.o -C $(LINKER_DIR)/apple2_70_zp.inc
|
||||||
|
|
||||||
|
checkers_small.o: checkers_small.s
|
||||||
|
ca65 -o checkers_small.o checkers_small.s -l checkers_small.lst
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
CHECKERS_LINE: checkers_line.o
|
||||||
|
ld65 -o CHECKERS_LINE checkers_line.o -C $(LINKER_DIR)/apple2_70_zp.inc
|
||||||
|
|
||||||
|
checkers_line.o: checkers_line.s
|
||||||
|
ca65 -o checkers_line.o checkers_line.s -l checkers_line.lst
|
||||||
|
###
|
||||||
|
|
||||||
|
CHECKERS_QUESTION: checkers_question.o
|
||||||
|
ld65 -o CHECKERS_QUESTION checkers_question.o -C $(LINKER_DIR)/apple2_70_zp.inc
|
||||||
|
|
||||||
|
checkers_question.o: checkers_question.s
|
||||||
|
ca65 -o checkers_question.o checkers_question.s -l checkers_question.lst
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
CHECKERS_RAINBOW: checkers_rainbow.o
|
||||||
|
ld65 -o CHECKERS_RAINBOW checkers_rainbow.o -C $(LINKER_DIR)/apple2_70_zp.inc
|
||||||
|
|
||||||
|
checkers_rainbow.o: checkers_rainbow.s
|
||||||
|
ca65 -o checkers_rainbow.o checkers_rainbow.s -l checkers_rainbow.lst
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
CHECKERS_ORIG: checkers_orig.o
|
||||||
|
ld65 -o CHECKERS_ORIG checkers_orig.o -C $(LINKER_DIR)/apple2_70_zp.inc
|
||||||
|
|
||||||
|
checkers_orig.o: checkers_orig.s
|
||||||
|
ca65 -o checkers_orig.o checkers_orig.s -l checkers_orig.lst
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
CHECKERS_SMALL2: checkers_small2.o
|
||||||
|
ld65 -o CHECKERS_SMALL2 checkers_small2.o -C $(LINKER_DIR)/apple2_70_zp.inc
|
||||||
|
|
||||||
|
checkers_small2.o: checkers_small2.s
|
||||||
|
ca65 -o checkers_small2.o checkers_small2.s -l checkers_small2.lst
|
||||||
|
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
|
||||||
|
HELLO: hello.bas
|
||||||
|
$(TOKENIZE) < hello.bas > HELLO
|
||||||
|
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *~ *.o *.lst HELLO CHECKERS CHECKERS_SMALL CHECKERS_SMALL2 CHECKERS_QUESTION CHECKERS_RAINBOW CHECKERS_ORIG CHECKERS_LINE
|
||||||
|
|
12
graphics/gr/checkers/apple2_70_zp.inc
Normal file
12
graphics/gr/checkers/apple2_70_zp.inc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
MEMORY {
|
||||||
|
ZP: start = $70, size = $80, type = rw;
|
||||||
|
RAM: start = $70, size = $8E00, file = %O;
|
||||||
|
}
|
||||||
|
|
||||||
|
SEGMENTS {
|
||||||
|
#CODE: load = RAM, type = ro;
|
||||||
|
#RODATA: load = RAM, type = ro;
|
||||||
|
#DATA: load = RAM, type = rw;
|
||||||
|
#BSS: load = RAM, type = bss, define = yes;
|
||||||
|
ZEROPAGE: load = ZP, type = ro;
|
||||||
|
}
|
97
graphics/gr/checkers/checkers.s
Normal file
97
graphics/gr/checkers/checkers.s
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
; Checkers, based on the code in Hellmood's Memories
|
||||||
|
|
||||||
|
; 42 bytes
|
||||||
|
; could be shorter if you're not picky about colors
|
||||||
|
|
||||||
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
; 42 -- original
|
||||||
|
; 39 -- not fullscreen
|
||||||
|
; 36 -- now marches oddly
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
BASL = $28
|
||||||
|
BASH = $29
|
||||||
|
H2 = $2C
|
||||||
|
COLOR = $30
|
||||||
|
|
||||||
|
X1 = $F0
|
||||||
|
X2 = $F1
|
||||||
|
Y1 = $F2
|
||||||
|
Y2 = $F3
|
||||||
|
|
||||||
|
TEMP = $FA
|
||||||
|
TEMPY = $FB
|
||||||
|
FRAME = $FC
|
||||||
|
TEMPX = $FD
|
||||||
|
|
||||||
|
|
||||||
|
; Soft Switches
|
||||||
|
KEYPRESS= $C000
|
||||||
|
KEYRESET= $C010
|
||||||
|
SET_GR = $C050 ; Enable graphics
|
||||||
|
FULLGR = $C052 ; Full screen, no text
|
||||||
|
PAGE0 = $C054 ; Page0
|
||||||
|
PAGE1 = $C055 ; Page1
|
||||||
|
LORES = $C056 ; Enable LORES graphics
|
||||||
|
|
||||||
|
; ROM routines
|
||||||
|
|
||||||
|
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
|
||||||
|
SETCOL = $F864
|
||||||
|
TEXT = $FB36 ;; Set text mode
|
||||||
|
BASCALC = $FBC1
|
||||||
|
SETGR = $FB40
|
||||||
|
HOME = $FC58 ;; Clear the text screen
|
||||||
|
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||||
|
HLINE = $F819
|
||||||
|
|
||||||
|
|
||||||
|
.zeropage
|
||||||
|
|
||||||
|
checkers:
|
||||||
|
|
||||||
|
;===================
|
||||||
|
; init screen
|
||||||
|
jsr SETGR ; 3
|
||||||
|
; bit FULLGR ; 3
|
||||||
|
;====
|
||||||
|
; 6
|
||||||
|
checkers_forever:
|
||||||
|
|
||||||
|
inc FRAME ; 2
|
||||||
|
|
||||||
|
ldx #39 ; 2
|
||||||
|
yloop:
|
||||||
|
ldy #39 ; 2
|
||||||
|
xloop:
|
||||||
|
|
||||||
|
; calculate color
|
||||||
|
|
||||||
|
; color = (XX-FRAME)^(A) | DB+1
|
||||||
|
|
||||||
|
; sec ; subtract frame from Y
|
||||||
|
tya
|
||||||
|
sbc FRAME
|
||||||
|
sta X2
|
||||||
|
|
||||||
|
txa
|
||||||
|
; sbc #0
|
||||||
|
|
||||||
|
eor X2
|
||||||
|
; ora #$DB
|
||||||
|
; adc #1
|
||||||
|
|
||||||
|
jsr SETCOL
|
||||||
|
|
||||||
|
txa ; A==Y1 ; 1
|
||||||
|
jsr PLOT ; plots in (Y,A) ; 3
|
||||||
|
|
||||||
|
dey ; 1
|
||||||
|
bpl xloop ; 2
|
||||||
|
|
||||||
|
dex ; 1
|
||||||
|
bpl yloop ; 2
|
||||||
|
|
||||||
|
bmi checkers_forever ; 2
|
||||||
|
|
92
graphics/gr/checkers/checkers_line.s
Normal file
92
graphics/gr/checkers/checkers_line.s
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
; Checkers, based on the code in Hellmood's Memories
|
||||||
|
|
||||||
|
; 42 bytes
|
||||||
|
; could be shorter if you're not picky about colors
|
||||||
|
|
||||||
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
BASL = $28
|
||||||
|
BASH = $29
|
||||||
|
H2 = $2C
|
||||||
|
COLOR = $30
|
||||||
|
|
||||||
|
X1 = $F0
|
||||||
|
X2 = $F1
|
||||||
|
Y1 = $F2
|
||||||
|
Y2 = $F3
|
||||||
|
|
||||||
|
TEMP = $FA
|
||||||
|
TEMPY = $FB
|
||||||
|
FRAME = $FC
|
||||||
|
TEMPX = $FD
|
||||||
|
|
||||||
|
|
||||||
|
; Soft Switches
|
||||||
|
KEYPRESS= $C000
|
||||||
|
KEYRESET= $C010
|
||||||
|
SET_GR = $C050 ; Enable graphics
|
||||||
|
FULLGR = $C052 ; Full screen, no text
|
||||||
|
PAGE0 = $C054 ; Page0
|
||||||
|
PAGE1 = $C055 ; Page1
|
||||||
|
LORES = $C056 ; Enable LORES graphics
|
||||||
|
|
||||||
|
; ROM routines
|
||||||
|
|
||||||
|
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
|
||||||
|
SETCOL = $F864
|
||||||
|
TEXT = $FB36 ;; Set text mode
|
||||||
|
BASCALC = $FBC1
|
||||||
|
SETGR = $FB40
|
||||||
|
HOME = $FC58 ;; Clear the text screen
|
||||||
|
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||||
|
HLINE = $F819
|
||||||
|
|
||||||
|
|
||||||
|
.zeropage
|
||||||
|
|
||||||
|
; orig = 42
|
||||||
|
; make 32x32
|
||||||
|
|
||||||
|
checkers:
|
||||||
|
|
||||||
|
;===================
|
||||||
|
; init screen
|
||||||
|
jsr SETGR ; 3
|
||||||
|
; bit FULLGR ; 3
|
||||||
|
;====
|
||||||
|
; 6
|
||||||
|
checkers_forever:
|
||||||
|
|
||||||
|
inc FRAME ; 2
|
||||||
|
|
||||||
|
; ldx #39 ; 2
|
||||||
|
yloop:
|
||||||
|
; ldy #39 ; 2
|
||||||
|
xloop:
|
||||||
|
; sec ; 1
|
||||||
|
tya ; 1
|
||||||
|
sbc FRAME ; 2
|
||||||
|
sta X2 ; 2
|
||||||
|
txa ; 1
|
||||||
|
sbc #0 ; 2
|
||||||
|
|
||||||
|
eor X2 ; 2
|
||||||
|
ora #$DC ; 2
|
||||||
|
; adc #1 ; 2
|
||||||
|
|
||||||
|
sta COLOR
|
||||||
|
|
||||||
|
; jsr SETCOL ; 3
|
||||||
|
|
||||||
|
txa ; A==Y1 ; 1
|
||||||
|
jsr PLOT ; (X2,Y1) ; 3
|
||||||
|
|
||||||
|
dey ; 1
|
||||||
|
bpl xloop ; 2
|
||||||
|
|
||||||
|
dex ; 1
|
||||||
|
bpl yloop ; 2
|
||||||
|
|
||||||
|
bmi checkers_forever ; 2
|
||||||
|
|
95
graphics/gr/checkers/checkers_orig.s
Normal file
95
graphics/gr/checkers/checkers_orig.s
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
; Checkers, based on the code in Hellmood's Memories
|
||||||
|
|
||||||
|
; 42 bytes
|
||||||
|
; could be shorter if you're not picky about colors
|
||||||
|
|
||||||
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
; 42 -- original
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
BASL = $28
|
||||||
|
BASH = $29
|
||||||
|
H2 = $2C
|
||||||
|
COLOR = $30
|
||||||
|
|
||||||
|
X1 = $F0
|
||||||
|
X2 = $F1
|
||||||
|
Y1 = $F2
|
||||||
|
Y2 = $F3
|
||||||
|
|
||||||
|
TEMP = $FA
|
||||||
|
TEMPY = $FB
|
||||||
|
FRAME = $FC
|
||||||
|
TEMPX = $FD
|
||||||
|
|
||||||
|
|
||||||
|
; Soft Switches
|
||||||
|
KEYPRESS= $C000
|
||||||
|
KEYRESET= $C010
|
||||||
|
SET_GR = $C050 ; Enable graphics
|
||||||
|
FULLGR = $C052 ; Full screen, no text
|
||||||
|
PAGE0 = $C054 ; Page0
|
||||||
|
PAGE1 = $C055 ; Page1
|
||||||
|
LORES = $C056 ; Enable LORES graphics
|
||||||
|
|
||||||
|
; ROM routines
|
||||||
|
|
||||||
|
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
|
||||||
|
SETCOL = $F864
|
||||||
|
TEXT = $FB36 ;; Set text mode
|
||||||
|
BASCALC = $FBC1
|
||||||
|
SETGR = $FB40
|
||||||
|
HOME = $FC58 ;; Clear the text screen
|
||||||
|
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||||
|
HLINE = $F819
|
||||||
|
|
||||||
|
|
||||||
|
.zeropage
|
||||||
|
|
||||||
|
checkers:
|
||||||
|
|
||||||
|
;===================
|
||||||
|
; init screen
|
||||||
|
jsr SETGR ; 3
|
||||||
|
bit FULLGR ; 3
|
||||||
|
;====
|
||||||
|
; 6
|
||||||
|
checkers_forever:
|
||||||
|
|
||||||
|
inc FRAME ; 2
|
||||||
|
|
||||||
|
ldx #47 ; 2
|
||||||
|
yloop:
|
||||||
|
ldy #39 ; 2
|
||||||
|
xloop:
|
||||||
|
|
||||||
|
; calculate color
|
||||||
|
|
||||||
|
; color = (XX-FRAME)^(A) | DB+1
|
||||||
|
|
||||||
|
sec ; subtract frame from Y
|
||||||
|
tya
|
||||||
|
sbc FRAME
|
||||||
|
sta X2
|
||||||
|
|
||||||
|
txa
|
||||||
|
sbc #0
|
||||||
|
|
||||||
|
eor X2
|
||||||
|
ora #$DB
|
||||||
|
adc #1
|
||||||
|
|
||||||
|
jsr SETCOL
|
||||||
|
|
||||||
|
txa ; A==Y1 ; 1
|
||||||
|
jsr PLOT ; plots in (Y,A) ; 3
|
||||||
|
|
||||||
|
dey ; 1
|
||||||
|
bpl xloop ; 2
|
||||||
|
|
||||||
|
dex ; 1
|
||||||
|
bpl yloop ; 2
|
||||||
|
|
||||||
|
bmi checkers_forever ; 2
|
||||||
|
|
92
graphics/gr/checkers/checkers_question.s
Normal file
92
graphics/gr/checkers/checkers_question.s
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
; Checkers, based on the code in Hellmood's Memories
|
||||||
|
|
||||||
|
; 42 bytes
|
||||||
|
; could be shorter if you're not picky about colors
|
||||||
|
|
||||||
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
BASL = $28
|
||||||
|
BASH = $29
|
||||||
|
H2 = $2C
|
||||||
|
COLOR = $30
|
||||||
|
|
||||||
|
X1 = $F0
|
||||||
|
X2 = $F1
|
||||||
|
Y1 = $F2
|
||||||
|
Y2 = $F3
|
||||||
|
|
||||||
|
TEMP = $FA
|
||||||
|
TEMPY = $FB
|
||||||
|
FRAME = $FC
|
||||||
|
TEMPX = $FD
|
||||||
|
|
||||||
|
|
||||||
|
; Soft Switches
|
||||||
|
KEYPRESS= $C000
|
||||||
|
KEYRESET= $C010
|
||||||
|
SET_GR = $C050 ; Enable graphics
|
||||||
|
FULLGR = $C052 ; Full screen, no text
|
||||||
|
PAGE0 = $C054 ; Page0
|
||||||
|
PAGE1 = $C055 ; Page1
|
||||||
|
LORES = $C056 ; Enable LORES graphics
|
||||||
|
|
||||||
|
; ROM routines
|
||||||
|
|
||||||
|
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
|
||||||
|
SETCOL = $F864
|
||||||
|
TEXT = $FB36 ;; Set text mode
|
||||||
|
BASCALC = $FBC1
|
||||||
|
SETGR = $FB40
|
||||||
|
HOME = $FC58 ;; Clear the text screen
|
||||||
|
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||||
|
HLINE = $F819
|
||||||
|
|
||||||
|
|
||||||
|
.zeropage
|
||||||
|
|
||||||
|
; orig = 42
|
||||||
|
; make 32x32
|
||||||
|
|
||||||
|
checkers:
|
||||||
|
|
||||||
|
;===================
|
||||||
|
; init screen
|
||||||
|
jsr SETGR ; 3
|
||||||
|
; bit FULLGR ; 3
|
||||||
|
;====
|
||||||
|
; 6
|
||||||
|
checkers_forever:
|
||||||
|
|
||||||
|
inc FRAME ; 2
|
||||||
|
|
||||||
|
; ldx #39 ; 2
|
||||||
|
yloop:
|
||||||
|
ldy #39 ; 2
|
||||||
|
xloop:
|
||||||
|
; sec ; 1
|
||||||
|
tya ; 1
|
||||||
|
sbc FRAME ; 2
|
||||||
|
sta X2 ; 2
|
||||||
|
txa ; 1
|
||||||
|
sbc #0 ; 2
|
||||||
|
|
||||||
|
eor X2 ; 2
|
||||||
|
ora #$DC ; 2
|
||||||
|
; adc #1 ; 2
|
||||||
|
|
||||||
|
sta COLOR
|
||||||
|
|
||||||
|
; jsr SETCOL ; 3
|
||||||
|
|
||||||
|
txa ; A==Y1 ; 1
|
||||||
|
jsr PLOT ; (X2,Y1) ; 3
|
||||||
|
|
||||||
|
dey ; 1
|
||||||
|
bpl xloop ; 2
|
||||||
|
|
||||||
|
dex ; 1
|
||||||
|
bpl yloop ; 2
|
||||||
|
|
||||||
|
bmi checkers_forever ; 2
|
||||||
|
|
94
graphics/gr/checkers/checkers_rainbow.s
Normal file
94
graphics/gr/checkers/checkers_rainbow.s
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
; Checkers, based on the code in Hellmood's Memories
|
||||||
|
|
||||||
|
; 42 bytes
|
||||||
|
; could be shorter if you're not picky about colors
|
||||||
|
|
||||||
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
BASL = $28
|
||||||
|
BASH = $29
|
||||||
|
H2 = $2C
|
||||||
|
COLOR = $30
|
||||||
|
|
||||||
|
X1 = $F0
|
||||||
|
X2 = $F1
|
||||||
|
Y1 = $F2
|
||||||
|
Y2 = $F3
|
||||||
|
|
||||||
|
TEMP = $FA
|
||||||
|
TEMPY = $FB
|
||||||
|
FRAME = $FC
|
||||||
|
TEMPX = $FD
|
||||||
|
|
||||||
|
|
||||||
|
; Soft Switches
|
||||||
|
KEYPRESS= $C000
|
||||||
|
KEYRESET= $C010
|
||||||
|
SET_GR = $C050 ; Enable graphics
|
||||||
|
FULLGR = $C052 ; Full screen, no text
|
||||||
|
PAGE0 = $C054 ; Page0
|
||||||
|
PAGE1 = $C055 ; Page1
|
||||||
|
LORES = $C056 ; Enable LORES graphics
|
||||||
|
|
||||||
|
; ROM routines
|
||||||
|
|
||||||
|
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
|
||||||
|
SETCOL = $F864
|
||||||
|
TEXT = $FB36 ;; Set text mode
|
||||||
|
BASCALC = $FBC1
|
||||||
|
SETGR = $FB40
|
||||||
|
HOME = $FC58 ;; Clear the text screen
|
||||||
|
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||||
|
HLINE = $F819
|
||||||
|
|
||||||
|
|
||||||
|
.zeropage
|
||||||
|
|
||||||
|
; orig = 42
|
||||||
|
; make 32x32
|
||||||
|
|
||||||
|
checkers:
|
||||||
|
|
||||||
|
;===================
|
||||||
|
; init screen
|
||||||
|
jsr SETGR ; 3
|
||||||
|
; bit FULLGR ; 3
|
||||||
|
;====
|
||||||
|
; 6
|
||||||
|
checkers_forever:
|
||||||
|
|
||||||
|
inc FRAME ; 2
|
||||||
|
|
||||||
|
ldx #39 ; 2
|
||||||
|
yloop:
|
||||||
|
ldy #39 ; 2
|
||||||
|
xloop:
|
||||||
|
; sec ; 1
|
||||||
|
tya ; 1
|
||||||
|
sbc FRAME ; 2
|
||||||
|
;sta X2 ; 2
|
||||||
|
sta COLOR ; 2
|
||||||
|
txa ; 1
|
||||||
|
sbc #0 ; 2
|
||||||
|
|
||||||
|
; eor X2 ; 2
|
||||||
|
eor COLOR ; 2
|
||||||
|
ora #$DC ; 2
|
||||||
|
; adc #1 ; 2
|
||||||
|
|
||||||
|
; sta COLOR
|
||||||
|
|
||||||
|
; jsr SETCOL ; 3
|
||||||
|
|
||||||
|
txa ; A==Y1 ; 1
|
||||||
|
jsr PLOT ; (X2,Y1) ; 3
|
||||||
|
|
||||||
|
dey ; 1
|
||||||
|
bpl xloop ; 2
|
||||||
|
|
||||||
|
dex ; 1
|
||||||
|
bpl yloop ; 2
|
||||||
|
|
||||||
|
bmi checkers_forever ; 2
|
||||||
|
|
94
graphics/gr/checkers/checkers_small.s
Normal file
94
graphics/gr/checkers/checkers_small.s
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
; Checkers, based on the code in Hellmood's Memories
|
||||||
|
|
||||||
|
; 42 bytes
|
||||||
|
; could be shorter if you're not picky about colors
|
||||||
|
|
||||||
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
BASL = $28
|
||||||
|
BASH = $29
|
||||||
|
H2 = $2C
|
||||||
|
COLOR = $30
|
||||||
|
|
||||||
|
X1 = $F0
|
||||||
|
X2 = $F1
|
||||||
|
Y1 = $F2
|
||||||
|
Y2 = $F3
|
||||||
|
|
||||||
|
TEMP = $FA
|
||||||
|
TEMPY = $FB
|
||||||
|
FRAME = $FC
|
||||||
|
TEMPX = $FD
|
||||||
|
|
||||||
|
|
||||||
|
; Soft Switches
|
||||||
|
KEYPRESS= $C000
|
||||||
|
KEYRESET= $C010
|
||||||
|
SET_GR = $C050 ; Enable graphics
|
||||||
|
FULLGR = $C052 ; Full screen, no text
|
||||||
|
PAGE0 = $C054 ; Page0
|
||||||
|
PAGE1 = $C055 ; Page1
|
||||||
|
LORES = $C056 ; Enable LORES graphics
|
||||||
|
|
||||||
|
; ROM routines
|
||||||
|
|
||||||
|
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
|
||||||
|
SETCOL = $F864
|
||||||
|
TEXT = $FB36 ;; Set text mode
|
||||||
|
BASCALC = $FBC1
|
||||||
|
SETGR = $FB40
|
||||||
|
HOME = $FC58 ;; Clear the text screen
|
||||||
|
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||||
|
HLINE = $F819
|
||||||
|
|
||||||
|
|
||||||
|
.zeropage
|
||||||
|
|
||||||
|
; orig = 42
|
||||||
|
; make 32x32
|
||||||
|
|
||||||
|
checkers:
|
||||||
|
|
||||||
|
;===================
|
||||||
|
; init screen
|
||||||
|
jsr SETGR ; 3
|
||||||
|
; bit FULLGR ; 3
|
||||||
|
;====
|
||||||
|
; 6
|
||||||
|
checkers_forever:
|
||||||
|
|
||||||
|
inc FRAME ; 2
|
||||||
|
|
||||||
|
ldx #39 ; 2
|
||||||
|
yloop:
|
||||||
|
ldy #39 ; 2
|
||||||
|
xloop:
|
||||||
|
; sec ; 1
|
||||||
|
tya ; 1
|
||||||
|
sbc FRAME ; 2
|
||||||
|
;sta X2 ; 2
|
||||||
|
sta COLOR ; 2
|
||||||
|
txa ; 1
|
||||||
|
sbc #0 ; 2
|
||||||
|
|
||||||
|
; eor X2 ; 2
|
||||||
|
eor COLOR ; 2
|
||||||
|
; ora #$DC ; 2
|
||||||
|
; adc #1 ; 2
|
||||||
|
|
||||||
|
; sta COLOR
|
||||||
|
|
||||||
|
; jsr SETCOL ; 3
|
||||||
|
|
||||||
|
txa ; A==Y1 ; 1
|
||||||
|
jsr PLOT ; (X2,Y1) ; 3
|
||||||
|
|
||||||
|
dey ; 1
|
||||||
|
bpl xloop ; 2
|
||||||
|
|
||||||
|
dex ; 1
|
||||||
|
bpl yloop ; 2
|
||||||
|
|
||||||
|
bmi checkers_forever ; 2
|
||||||
|
|
92
graphics/gr/checkers/checkers_small2.s
Normal file
92
graphics/gr/checkers/checkers_small2.s
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
; Checkers, based on the code in Hellmood's Memories
|
||||||
|
|
||||||
|
; 42 bytes
|
||||||
|
; could be shorter if you're not picky about colors
|
||||||
|
|
||||||
|
; by deater (Vince Weaver) <vince@deater.net>
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
BASL = $28
|
||||||
|
BASH = $29
|
||||||
|
H2 = $2C
|
||||||
|
COLOR = $30
|
||||||
|
|
||||||
|
X1 = $F0
|
||||||
|
X2 = $F1
|
||||||
|
Y1 = $F2
|
||||||
|
Y2 = $F3
|
||||||
|
|
||||||
|
TEMP = $FA
|
||||||
|
TEMPY = $FB
|
||||||
|
FRAME = $FC
|
||||||
|
TEMPX = $FD
|
||||||
|
|
||||||
|
|
||||||
|
; Soft Switches
|
||||||
|
KEYPRESS= $C000
|
||||||
|
KEYRESET= $C010
|
||||||
|
SET_GR = $C050 ; Enable graphics
|
||||||
|
FULLGR = $C052 ; Full screen, no text
|
||||||
|
PAGE0 = $C054 ; Page0
|
||||||
|
PAGE1 = $C055 ; Page1
|
||||||
|
LORES = $C056 ; Enable LORES graphics
|
||||||
|
|
||||||
|
; ROM routines
|
||||||
|
|
||||||
|
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
|
||||||
|
SETCOL = $F864
|
||||||
|
TEXT = $FB36 ;; Set text mode
|
||||||
|
BASCALC = $FBC1
|
||||||
|
SETGR = $FB40
|
||||||
|
HOME = $FC58 ;; Clear the text screen
|
||||||
|
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||||
|
HLINE = $F819
|
||||||
|
|
||||||
|
|
||||||
|
.zeropage
|
||||||
|
|
||||||
|
; orig = 42
|
||||||
|
; make 32x32
|
||||||
|
|
||||||
|
checkers:
|
||||||
|
|
||||||
|
;===================
|
||||||
|
; init screen
|
||||||
|
jsr SETGR ; 3
|
||||||
|
; bit FULLGR ; 3
|
||||||
|
;====
|
||||||
|
; 6
|
||||||
|
checkers_forever:
|
||||||
|
|
||||||
|
inc FRAME ; 2
|
||||||
|
|
||||||
|
ldx #39 ; 2
|
||||||
|
yloop:
|
||||||
|
ldy #39 ; 2
|
||||||
|
xloop:
|
||||||
|
sec ; 1
|
||||||
|
tya ; 1
|
||||||
|
sbc FRAME ; 2
|
||||||
|
sta X2 ; 2
|
||||||
|
txa ; 1
|
||||||
|
sbc #0 ; 2
|
||||||
|
|
||||||
|
eor X2 ; 2
|
||||||
|
ora #$DB ; 2
|
||||||
|
adc #1 ; 2
|
||||||
|
|
||||||
|
sta COLOR
|
||||||
|
|
||||||
|
; jsr SETCOL ; 3
|
||||||
|
|
||||||
|
txa ; A==Y1 ; 1
|
||||||
|
jsr PLOT ; (X2,Y1) ; 3
|
||||||
|
|
||||||
|
dey ; 1
|
||||||
|
bpl xloop ; 2
|
||||||
|
|
||||||
|
dex ; 1
|
||||||
|
bpl yloop ; 2
|
||||||
|
|
||||||
|
bmi checkers_forever ; 2
|
||||||
|
|
3
graphics/gr/checkers/hello.bas
Normal file
3
graphics/gr/checkers/hello.bas
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
5 HOME
|
||||||
|
100 PRINT "32B DEMO"
|
||||||
|
120 PRINT CHR$(4);"CATALOG"
|
Loading…
Reference in New Issue
Block a user