midline: ill-advised demo

This commit is contained in:
Vince Weaver 2023-05-17 15:39:09 -04:00
parent cb276305fc
commit b76e1b20ef
6 changed files with 359 additions and 0 deletions

32
vaporlock/demo/Makefile Normal file
View File

@ -0,0 +1,32 @@
include ../../Makefile.inc
DOS33 = ../../utils/dos33fs-utils/dos33
TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../linker_scripts
EMPTYDISK = ../../empty_disk/empty.dsk
all: demo.dsk
demo.dsk: HELLO MIDLINE
cp $(EMPTYDISK) demo.dsk
$(DOS33) -y demo.dsk SAVE A HELLO
$(DOS33) -y demo.dsk BSAVE -a 0x6000 MIDLINE
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
MIDLINE: midline.o
ld65 -o MIDLINE midline.o -C $(LINKERSCRIPTS)/apple2_6000.inc
midline.o: midline.s \
zp.inc hardware.inc
ca65 -o midline.o midline.s -l midline.lst
###
clean:
rm -f *~ *.o *.lst HELLO MIDLINE

View File

@ -0,0 +1,10 @@
gr_offsets_h:
.byte $4,$4,$5,$5,$6,$6,$7,$7
.byte $4,$4,$5,$5,$6,$6,$7,$7
.byte $4,$4,$5,$5,$6,$6,$7,$7
gr_offsets_l:
.byte $00,$80,$00,$80,$00,$80,$00,$80
.byte $28,$a8,$28,$a8,$28,$a8,$28,$a8
.byte $50,$d0,$50,$d0,$50,$d0,$50,$d0

View File

@ -0,0 +1,51 @@
; soft-switches
; yes, I know these aren't necessary the "official" names
KEYBOARD = $C000 ; Read keypress+128
EIGHTYSTOREOFF = $C000 ; (write) turns off 80store
EIGHTYSTOREON = $C001 ; (write) page2 writes to AUX memory
WRMAINRAM = $C004 ; (write)
WRAUXRAM = $C005 ; (write)
CLR80COL = $C00C ; (write)
SET80COL = $C00D ; (write)
CLRMOUSETET = $C00E ; (write) disable moust text
SETMOUSETEXT = $C00F ; (write) enable mouse text
KEYRESET = $C010
VBLANK = $C019 ; *not* RDVBL (VBL signal low) (iie, opposite iigs)
RDVBLBAR = $C019 ; iic
TBCOLOR = $C022 ; IIgs text foreground / background colors
CLOCKCTL = $C034 ; bits 0-3 are IIgs border color
NEWVIDEO = $C029 ; IIgs graphics modes
RDVBLMSK = $C041 ; iic read vbl interrupt
SET_GR = $C050
SET_TEXT= $C051
FULLGR = $C052
TEXTGR = $C053
PAGE1 = $C054
PAGE2 = $C055
LORES = $C056
HIRES = $C057
DISVBL = $C05B ; (write) (iic) (ioudison) disable VBL interrupt
ENVBL = $C05B ; (write) (iic) (ioudison) enable VBL interrupt
CLRAN3 = $C05E ; (write) in 80-col mode, enable double graphics
SETAN3 = $C05F ; (write) in 80-col mode, disable double graphics
PTRIG = $C070 ; analog input reset / reset VBL interrupt (iic)
IOUDISON = $C07E ; (write) disable IOU
IOUDISOFF = $C07F ; (write) enable IOU
; ROM routines
SETCOL = $F864 ; COLOR=A*17
SETGR = $FB40
VLINE = $F828 ; VLINE A,$2D at Y
HGR = $F3E2
HPOSN = $F411
HPLOT0 = $F457 ; plot at (Y,X), (A)
HGLIN = $F53A ; line to (X,A),(Y)
ROM_TEXT2COPY = $F962 ; iigs
ROM_MACHINEID = $FBB3 ; iigs

5
vaporlock/demo/hello.bas Normal file
View File

@ -0,0 +1,5 @@
5 HOME
10 PRINT CHR$(4);"CATALOG"
15 PRINT:PRINT "LOADING DOUBLE..."
'20 PRINT CHR$(4);"BRUN DOUBLE"

175
vaporlock/demo/midline.s Normal file
View File

@ -0,0 +1,175 @@
; Blargh
; by Vince `deater` Weaver
.include "zp.inc"
.include "hardware.inc"
double:
lda #0
sta FRAME
lda #$ff
sta FRAMEH
;================================
; Clear screen and setup graphics
;================================
jsr SETGR ; set lo-res 40x40 mode
bit LORES
sta FULLGR
;====================================================
; setup text page2 screen of "Apple II Forever" text
;====================================================
; there are much better ways to accomplish this
sta SETMOUSETEXT
ldy #0
ldx #0
sty XX
a24e_newy:
lda gr_offsets_l,Y
sta stringing_smc+1
lda gr_offsets_h,Y
clc
adc #4
sta stringing_smc+2
a24e_loop:
lda a2_string,X
bne keep_stringing
ldx #0
lda a2_string,X
keep_stringing:
inx
eor #$80
stringing_smc:
sta $d000
inc stringing_smc+1
inc XX
lda XX
cmp #40
bne a24e_loop
lda #0
sta XX
iny
cpy #24
bne a24e_newy
stringing_done:
bit PAGE2
blog:
ldx #255
blog_loop:
jsr delay_12 ; 12
bit SET_GR ; 4
; 16
jsr delay_12 ; 12
; 28
bit SET_TEXT ; 4
; 32
jsr delay_12 ; 12
; 44
bit SET_GR ; 4
; 48
jsr delay_12 ; 12
; 60
dex ; 2
; bne blog_loop ; 2/3
jmp blog_loop ; 3
delay_12:
rts
.if 0
; -1
;==================================
; vblank = 4550 cycles
; Try X=226 Y=4 cycles=4545
skip_vblank:
lda $00 ; nop3
ldy #4 ; 2
loop3: ldx #226 ; 2
loop4: dex ; 2
bne loop4 ; 2nt/3
dey ; 2
bne loop3 ; 2nt/3
jmp midline_loop ; 3
.align $100
;===================================
; wait y-reg times 10
;===================================
loop10:
bne skip
waitx10:
dey ; wait y-reg times 10 ; 2
skip:
dey ; 2
nop ; 2
bne loop10 ; 2/3
rts ; 6
;===================================
; wait x-reg times 1000
;===================================
loop1k:
pha ; 3
pla ; 4
nop ; 2
nop ; 2
waitx1k:
ldy #98 ; wait x-reg times 1000 ; 2
jsr waitx10 ; 980
nop ; 2
dex ; 2
bne loop1k ; 2/3
rts1:
rts ; 6
.include "vblank.s"
.endif
.include "gr_offsets.s"
a2_string:
; 012345678901234567 8 9
.byte "Apple II Forever!! ",'@'+$80," "
.byte "Apple II Forever! ",'@'+$80," ",0

86
vaporlock/demo/zp.inc Normal file
View File

@ -0,0 +1,86 @@
;=========================
; zero page
;=========================
; ZX02 addresses
ZP=$00
offset = ZP+0
ZX0_src = ZP+2
ZX0_dst = ZP+4
bitr = ZP+6
pntr = ZP+7
CH = $24
GBASL = $26
GBASH = $27
BASL = $28
BASH = $29
V2 = $2D
COLOR = $30
; pt3 player
ORNAMENT_L = $60
ORNAMENT_H = $61
SAMPLE_L = $62
SAMPLE_H = $63
LOOP = $64
MB_ADDR_L = $65
MB_ADDR_H = $66
MB_VALUE = $67
DONE_PLAYING = $68
DONE_SONG = $69
PT3_TEMP = $6A
APPLEII_MODEL = $6B
AY_REGISTERS = $70
A_FINE_TONE = $70
A_COARSE_TONE = $71
B_FINE_TONE = $72
B_COARSE_TONE = $73
C_FINE_TONE = $74
C_COARSE_TONE = $75
NOISE = $76
ENABLE = $77
PT3_MIXER_VAL = $77
A_VOLUME = $78
B_VOLUME = $79
C_VOLUME = $7A
ENVELOPE_FINE = $7B
ENVELOPE_COARSE = $7C
ENVELOPE_SHAPE = $7D
PATTERN_L = $7E
PATTERN_H = $7F
DRAW_PAGE = $8A
SOUND_STATUS = $DE
SOUND_DISABLED = $80
SOUND_IN_LC = $01 ; $01 sound effects in language card
SOUND_MOCKINGBOARD = $02 ; mockingboard detected
HGRPAGE = $E6
TEMPY = $F0
XX = $F1
FRAME = $F2
FRAMEH = $F3
YPOS = $FA
TCOLOR = $FB
INL = $FC
INH = $FD
OUTL = $FE
OUTH = $FF