hgr: wires: add bot version

This commit is contained in:
Vince Weaver 2021-10-07 22:59:03 -04:00
parent e5818412f3
commit 3207ccd526
2 changed files with 117 additions and 1 deletions

View File

@ -7,10 +7,11 @@ EMPTY_DISK = ../../../empty_disk
all: wires.dsk
wires.dsk: HELLO WIRES CYCLE STAGGERED BLUEORANGE BLUEORANGEZ
wires.dsk: HELLO WIRES WIRES_BOT CYCLE STAGGERED BLUEORANGE BLUEORANGEZ
cp $(EMPTY_DISK)/empty.dsk wires.dsk
$(DOS33) -y wires.dsk SAVE A HELLO
$(DOS33) -y wires.dsk BSAVE -a 0x0C00 WIRES
$(DOS33) -y wires.dsk BSAVE -a 0x039a WIRES_BOT
$(DOS33) -y wires.dsk BSAVE -a 0x0C00 CYCLE
$(DOS33) -y wires.dsk BSAVE -a 0x0C00 STAGGERED
$(DOS33) -y wires.dsk BSAVE -a 0x0373 BLUEORANGE
@ -31,6 +32,15 @@ wires.o: wires.s
####
WIRES_BOT: wires_bot.o
ld65 -o WIRES_BOT wires_bot.o -C $(LINKER_SCRIPTS)/apple2_39a.inc
wires_bot.o: wires_bot.s
ca65 -o wires_bot.o wires_bot.s -l wires_bot.lst
####
STAGGERED: staggered.o
ld65 -o STAGGERED staggered.o -C $(LINKER_SCRIPTS)/apple2_c00.inc

View File

@ -0,0 +1,106 @@
; wires -- Apple II Hires
; D0+ used by HGR routines
HGR_COLOR = $E4
HGR_PAGE = $E6
GBASL = $26
GBASH = $27
COUNT = $FE
FRAME = $FF
; soft-switches
; ROM routines
HGR2 = $F3D8 ; set hires page2 and clear $4000-$5fff
WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
wires:
jsr HGR2
reset_x:
ldx #$0
outer_loop:
; pulse loop horizontal
lda #$00
tay
sta GBASL
lda #$40
sta GBASH
horiz_loop:
lda even_lookup,X
sta (GBASL),Y
iny
lda odd_lookup,X
sta (GBASL),Y
iny
bne noflo2
inc GBASH
noflo2:
lda #$44
cmp GBASH
bne horiz_loop
; A should already be $44 here
; Y should be 0
vert_loop:
txa
clc
adc #2
asl
asl
adc #$40
sbc GBASH
cmp #8
lda #$81
bcs noeor
ora #$02
noeor:
sta (GBASL),Y
inc GBASL
inc GBASL
bne noflo
inc GBASH
noflo:
lda #$60
cmp GBASH
bne vert_loop
inx ; wrap at 7
cpx #7
beq reset_x
bne outer_loop
even_lookup:
.byte $D7,$DD,$F5, $D5,$D5,$D5,$D5
odd_lookup:
.byte $AA,$AA,$AA, $AB,$AE,$BA,$EA
; want this to be at 3f5
; Length is 94 so start at
; $3F5 - 91 = $39A
jmp wires