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