graphics: both: a2 lores

This commit is contained in:
Vince Weaver 2022-10-11 21:58:19 -04:00
parent 23b4af92f6
commit cce5b35c61
4 changed files with 236 additions and 3 deletions

View File

@ -28,7 +28,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \
BOXES.BAS SOLARIS.BAS SOLARIS2.BAS ASPLODE.BAS SOLARIS3.BAS \
TARGET.BAS ELITE.BAS MYSTERY.BAS OFFICE.BAS GR_XOR.BAS \
LARGE_XOR.BAS PAR_XOR.BAS PAR_HGR.BAS SIER_XOR.BAS PATTERN_LOGO.BAS \
GEARS.BAS DSR_LORES.BAS
GEARS.BAS DSR_LORES.BAS A2_LORES.BAS
cp $(EMPTY_DISK)/empty_lots_of_dirents.dsk appleiibot.dsk
# cp empty.dsk appleiibot.dsk
# $(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD
@ -150,6 +150,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \
$(DOS33) -y appleiibot.dsk SAVE A PATTERN_LOGO.BAS
$(DOS33) -y appleiibot.dsk SAVE A GEARS.BAS
$(DOS33) -y appleiibot.dsk SAVE A DSR_LORES.BAS
$(DOS33) -y appleiibot.dsk SAVE A A2_LORES.BAS
####
@ -837,6 +838,12 @@ GEARS.BAS: gears.bas
DSR_LORES.BAS: dsr_lores.bas
$(TOKENIZE) < dsr_lores.bas > DSR_LORES.BAS
####
A2_LORES.BAS: a2_lores.bas
$(TOKENIZE) < a2_lores.bas > A2_LORES.BAS

View File

@ -0,0 +1,2 @@
1FORI=0TO139:POKE876+I,4*PEEK(2125+I)-204+(PEEK(2265+I/3)-35)/4^(I-INT(I/3)*3):NEXT
2&"-ho<Gc<HcP<U:7pVj\;XOU;XAe7n[3W7]5:7n[mT2\o5;Hp[:SrWq`FTa2`CG^3U[3;3qW2]+RrIjJ/:]3_4WqLq;Li96qec1l4br7lmgdcr.blhZq=;9IVV_3gMd9><<MD58>@>3FK3[++Q'=)@+&53+?-,69G*`%#5IP3#8%C#S-%<GI$41[$:N$/

View File

@ -8,11 +8,12 @@ TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
all: both.dsk
both.dsk: HELLO DSR_BOT DSR_LORES PROOF PROOF2
both.dsk: HELLO DSR_BOT A2_BOT DSR_LORES PROOF PROOF2
cp $(EMPTY_DISK) both.dsk
$(DOS33) -y both.dsk SAVE A HELLO
$(DOS33) -y both.dsk BSAVE -a 0xC00 DSR_LORES
$(DOS33) -y both.dsk BSAVE -a 0x373 DSR_BOT
$(DOS33) -y both.dsk BSAVE -a 0x36C DSR_BOT
$(DOS33) -y both.dsk BSAVE -a 0xC00 A2_BOT
$(DOS33) -y both.dsk BSAVE -a 0xC00 PROOF
$(DOS33) -y both.dsk BSAVE -a 0xC00 PROOF2
@ -35,6 +36,15 @@ dsr_bot.o: dsr_bot.s
###
A2_BOT: a2_bot.o
ld65 -o A2_BOT a2_bot.o -C $(LINKER_DIR)/apple2_36c.inc
a2_bot.o: a2_bot.s
ca65 -o a2_bot.o a2_bot.s -l a2_bot.lst
###
PROOF: proof.o
ld65 -o PROOF proof.o -C $(LINKER_DIR)/apple2_c00.inc

View File

@ -0,0 +1,214 @@
; ][ rotate lores
; by deater (Vince Weaver) <vince@deater.net>
; 144 bytes (close)
; 143 bytes -> jmp to bne
; Zero Page
GBASL = $26
GBASH = $27
COLOR = $30
HGR_X = $E0
HGR_Y = $E2
HGR_COLOR = $E4
HGR_HORIZ = $E5
HGR_PAGE = $E6
HGR_SCALE = $E7
FRAME = $F9
ROTATION = $FA
COUNT = $FC
YY = $FD
BB = $FE
XX = $FF
; Soft Switches
SET_GR = $C050
SET_TEXT = $C051
FULLGR = $C052
TEXTGR = $C053
PAGE1 = $C054 ; Page1
PAGE2 = $C055 ; Page2
LORES = $C056 ; Enable LORES graphics
HIRES = $C057 ; Enable HIRES graphics
; ROM routines
HGR = $F3E2
HGR2 = $F3D8
HCLR = $F3F2
HPLOT0 = $F457 ; plot at (Y,X), (A)
WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
HPOSN = $F411 ; (Y,X),(A) (valued stores in HGRX,XH,Y)
PLOT = $F800 ;; PLOT AT Y,A
PLOT1 = $F80E ;; PLOT at (GBASL),Y (need MASK to be $0f or $f0)
SETCOL = $F864 ;; COLOR=A
XDRAW0 = $F65D
hgr_lookup_h = $40 ; $40-$70
hgr_lookup_l = $70 ; $70-$A0
dsr_rotate:
;===================
; init screen
jsr HGR ; clear PAGE1
; A,Y are 0?
bit FULLGR
bit LORES
;===================
; init vars
; ldx #4
; stx HGR_SCALE
;===================
; int tables
ldx #47
init_loop:
txa
jsr HPOSN ; important part is A=ycoord
ldx HGR_Y ; A value stored in HGR_Y
lda GBASL
sta hgr_lookup_l,X
lda GBASH
sta hgr_lookup_h,X
dex
bpl init_loop
big_loop:
;=====================================
; draw ][
draw_II:
ldy #0 ; Y
ldx #20
lda #24
jsr HPOSN ; set screen position to X= (y,x) Y=(a)
; saves X,Y,A to zero page
; after Y= orig X/7
; A and X are ??
ldx #<shape_a2 ; point to bottom byte of shape address
ldy #>shape_a2 ; point to top byte of shape address
; ROT in A
lda ROTATION ; ROT=0
asl
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
;===============================
; copy to lores
; X654 3210 X654 3210
ldy #47
sty YY ; set y-coord to 47
lsier_outer:
ldx YY ; a bit of a wash
lda hgr_lookup_l,X
sta hgr_scrn_smc+1
lda hgr_lookup_h,X
sta hgr_scrn_smc+2
txa
ldy #0 ; COUNT
jsr PLOT ; plot at Y,A
; this sets up GBASL for us
; does create slight glitch
; on left side of screen
ldx #0 ; X = hires x-coord
lsier_inner:
lda #6
sta BB
sta HGR_SCALE
lsier_inner_inner:
hgr_scrn_smc:
lsr $2000,X ; note this also clears screen
lda #0
; bcc = $90, bcs = $b0
; 1001 1011
flip_smc:
bcs no_color
lda YY ; use Y-coord for color
adc ROTATION ; rotate colors
no_color:
jsr SETCOL
; x-coord already in Y
jsr PLOT1 ; plot at (GBASL),Y
; GBASL/H set earlier with PLOT
iny ; increment count
cpy #40 ; if hit 40, done
beq done_line
dec BB ; decrement byte count
bpl lsier_inner_inner ; if <7 then keep shifting
inx ; increment hires-x value
bne lsier_inner ; bra
done_line:
dec YY ; decrement y-coord
bpl lsier_outer ; until less than 0
end:
inc ROTATION
; inc ROTATION
lda ROTATION
and #$20
clc
adc #$90 ; flip bcs/bcc
sta flip_smc
bne big_loop ; bra
shape_a2:
;.byte $2d,$36,$ff,$3f
;.byte $24,$ad,$22,$24,$94,$21,$2c,$4d
;.byte $91,$3f,$36,$00
;.byte $01,$00,$04,$00
;.byte $36,$ff,$3f,$24
;.byte $2d,$12,$24,$40,$ad,$12,$24,$4c
;.byte $39,$37,$36,$2e,$05,$00
.byte $d2,$1b,$2d,$24
.byte $24,$7f,$49,$09,$3f,$36,$36,$2d
.byte $00
; 36C
for_bot:
jmp dsr_rotate