basic: update par_bot

This commit is contained in:
Vince Weaver 2022-09-25 23:24:43 -04:00
parent 6aa3e56252
commit 4a1a6e6126
4 changed files with 42 additions and 64 deletions

View File

@ -1,2 +1,2 @@
1FORI=0TO126:POKE889+I,4*PEEK(2125+I)-204+(PEEK(2252+I/3)-35)/4^(I-INT(I/3)*3):NEXT
2&"/@q<GcY2ThjmRkEIkEPm\h[r;CE\aH_LE/SrP6U8DqY<9GqT0X<Y2TrAYhmTkTDh;3k3]ETr=Xl`QqQ8M&Aq=4o+[<TrAPjmIoU0K3=p=5o4V8Tq\rU<U/`e7^?REQ3S+4LLP49K'37Q/08V4#4>J3'3Z5X$G$GPG@#@',C#5&
1FORI=0TO124:POKE891+I,4*PEEK(2125+I)-204+(PEEK(2250+I/3)-35)/4^(I-INT(I/3)*3):NEXT
2&"/@q<GcY2ThjmRkEIkEPm\jCEA\aHcMA3TdX8I8DdY<4KrQ<[;]3TrAXlnIoU=p=3o4YETrAYelToU9H2Dp=4k3];Tr=Xl`QqQ8M&Aq=5o'Z9Pq\iU<U7be7^?WFN3S+4LLP4D5#4\UW70*$'P@%4#@.8*3)3Y5Y$W4G#%#2

View File

@ -16,7 +16,7 @@ paralax.dsk: HELLO BOXES BOXES_BOT LARGE LARGE_BOT PAR PAR_BOT
$(DOS33) -y paralax.dsk BSAVE -a 0xc00 LARGE
$(DOS33) -y paralax.dsk BSAVE -a 0x386 LARGE_BOT
$(DOS33) -y paralax.dsk BSAVE -a 0xc00 PAR
$(DOS33) -y paralax.dsk BSAVE -a 0x379 PAR_BOT
$(DOS33) -y paralax.dsk BSAVE -a 0x37B PAR_BOT
###
@ -64,7 +64,7 @@ large_bot.o: large_bot.s
###
PAR_BOT: par_bot.o
ld65 -o PAR_BOT par_bot.o -C $(LINKER_DIR)/apple2_379.inc
ld65 -o PAR_BOT par_bot.o -C $(LINKER_DIR)/apple2_37b.inc
par_bot.o: par_bot.s
ca65 -o par_bot.o par_bot.s -l par_bot.lst

View File

@ -6,8 +6,6 @@
; Zero Page
GBASL = $26
GBASH = $27
H2 = $2C
COLOR = $30
FRAME = $EA
FRAME2 = $EB
@ -19,8 +17,6 @@ COLORS = $FC
PAGE = $FD
; Soft Switches
KEYPRESS= $C000
KEYRESET= $C010
SET_GR = $C050 ; Enable graphics
FULLGR = $C052 ; Full screen, no text
PAGE1 = $C054 ; Page1
@ -29,94 +25,74 @@ LORES = $C056 ; Enable LORES graphics
; ROM routines
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
SETCOL = $F864
GBASCALC= $F847 ;; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear)
GBASCALC= $F847 ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear)
SETGR = $FB40
HOME = $FC58 ;; Clear the text screen
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
HLINE = $F819
parallax:
;===================
; init screen
jsr SETGR ; 3
bit FULLGR ; 3
jsr SETGR ; lores graphics
bit FULLGR ; full screen
lda #$0
lda #$0 ; start on page1
sta PAGE
parallax_forever:
inc FRAME ; 2
lda FRAME
inc FRAME ; increment frame
lda FRAME ; also have frame/2 and frame/4
lsr
sta FRAME2
lsr
sta FRAME4
;========================
; update color
lda FRAME
; lsr
; lsr
; lsr
; lsr
; lsr
; and #$3
; tax
; lda colors,X
; sta COLORS
;==========================
; flip page
lda PAGE
pha
lda PAGE ; get current page
pha ; save for later
lsr
lsr ; switch visible page
lsr
tay
lda PAGE1,Y
pla
pla ; save old draw page
eor #$4
eor #$4 ; toggle to other draw page
sta PAGE
;========================
; setup for 23 lines
ldx #23 ; 2
ldx #23 ; 23 lines (double high)
yloop:
;==============
; point GBASL/GBSAH to current line
txa
txa ; get line addr in GBASL/H
jsr GBASCALC
lda GBASH
clc
adc PAGE
adc PAGE ; adjust for page
sta GBASH
;==============
; current column (work backwards)
ldy #39 ; 2
ldy #39
xloop:
lda #0
lda #0 ; default color black
sta COLORS
; calculate colors
@ -126,7 +102,7 @@ xloop:
;===========================
; SMALL
sec ; subtract frame from Y
sec ; subtract frame from Y
tya
sbc FRAME4
@ -196,30 +172,20 @@ skip_color_large:
; actually draw color
lda COLORS
lda COLORS ; store out pixel
sta (GBASL),Y
dey ; 1
bpl xloop ; 2
dex ; 1
bpl yloop ; 2
bmi parallax_forever ; 2
; 00 = right
; 01 = up
; 10 = left
; 11 = down
; adc = $65
; sbc = $E5
dey ; loop for X-coord
bpl xloop ;
dex ; loop for Y-coord
bpl yloop ;
bmi parallax_forever ; bra
; for bot
; $3F5 - 127 + 3 = $379
; $3F5 - 125 + 3 = $37B
jmp parallax

View File

@ -0,0 +1,12 @@
MEMORY {
ZP: start = $00, size = $1A, type = rw;
RAM: start = $37B, 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 = zp;
}