mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-28 17:55:04 +00:00
d2: update code
This commit is contained in:
parent
857cfd8cd3
commit
b0f8ec9120
@ -29,7 +29,7 @@ D2: d2.o
|
||||
ld65 -o D2 d2.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
|
||||
|
||||
d2.o: d2.s \
|
||||
moving.s wires.s \
|
||||
moving.s wires.s oval.s dsr_shape.s \
|
||||
zp.inc hardware.inc \
|
||||
peasant_music.s \
|
||||
interrupt_handler.s mockingboard_setup.s
|
||||
|
@ -75,15 +75,40 @@ sin_done:
|
||||
; NOTE: making gbash/gbasl table wasn't worth it
|
||||
|
||||
|
||||
jsr dsr_spin
|
||||
|
||||
forever:
|
||||
jsr oval
|
||||
|
||||
jsr moving
|
||||
|
||||
jsr fast_hclr
|
||||
jsr flip_page
|
||||
|
||||
jsr wires
|
||||
|
||||
jsr oval
|
||||
|
||||
jmp forever
|
||||
|
||||
|
||||
|
||||
flip_page:
|
||||
ldy #$0
|
||||
lda HGR_PAGE ; will be $20/$40
|
||||
cmp #$20
|
||||
beq done_flip_page
|
||||
iny
|
||||
done_flip_page:
|
||||
ldx PAGE1,Y ; set display page to PAGE1 or PAGE2
|
||||
|
||||
eor #$60 ; flip draw page between $2000/$4000
|
||||
sta HGR_PAGE
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
.include "dsr_shape.s"
|
||||
.include "moving.s"
|
||||
.include "wires.s"
|
||||
.include "oval.s"
|
||||
|
85
demos/d2/dsr_shape.s
Normal file
85
demos/d2/dsr_shape.s
Normal file
@ -0,0 +1,85 @@
|
||||
; spinning dsr logo
|
||||
|
||||
dsr_spin:
|
||||
ldy #$0
|
||||
sty FRAME ; 2
|
||||
sty OUR_ROT ; 2
|
||||
|
||||
iny ; 1 ; set shape table scale to 1
|
||||
sty HGR_SCALE ; 2
|
||||
|
||||
;=========================================
|
||||
; MAIN LOOP
|
||||
;=========================================
|
||||
|
||||
main_loop:
|
||||
; increment FRAME
|
||||
|
||||
inc FRAME ; 2
|
||||
|
||||
;=======================
|
||||
; xdraw
|
||||
;=======================
|
||||
xdraw:
|
||||
; setup X and Y co-ords
|
||||
|
||||
ldy #0 ; XPOSH always 0 for us
|
||||
ldx #140
|
||||
lda #96
|
||||
jsr HPOSN ; X= (y,x) Y=(a)
|
||||
|
||||
jsr fast_hclr
|
||||
|
||||
ldx #<shape_dsr ; point to our shape
|
||||
ldy #>shape_dsr ; code fits in one page so this doesn't change
|
||||
lda OUR_ROT ; set rotation
|
||||
|
||||
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
||||
|
||||
jsr flip_page
|
||||
|
||||
lda FRAME
|
||||
lsr
|
||||
bcc skip_bigger
|
||||
|
||||
inc HGR_SCALE ; 2 ; increment scale
|
||||
skip_bigger:
|
||||
inc OUR_ROT ; 2
|
||||
inc OUR_ROT ; 2
|
||||
|
||||
lda FRAME
|
||||
cmp #33 ; 2
|
||||
bcc main_loop ; 2
|
||||
|
||||
ldx #10
|
||||
long_wait:
|
||||
lda #200
|
||||
jsr WAIT
|
||||
dex
|
||||
bne long_wait
|
||||
|
||||
rts
|
||||
|
||||
fast_hclr:
|
||||
lda HGR_PAGE
|
||||
sta hclr_smc+2
|
||||
ldy #0
|
||||
hclr_outer:
|
||||
tya
|
||||
hclr_inner:
|
||||
hclr_smc:
|
||||
sta $2000,Y
|
||||
iny
|
||||
bne hclr_inner
|
||||
|
||||
inc hclr_smc+2
|
||||
lda hclr_smc+2
|
||||
and #$1f
|
||||
bne hclr_outer
|
||||
|
||||
rts
|
||||
|
||||
shape_dsr:
|
||||
.byte $2d,$36,$ff,$3f
|
||||
.byte $24,$ad,$22,$24,$94,$21,$2c,$4d
|
||||
.byte $91,$3f,$36,$00
|
@ -27,8 +27,9 @@ PTRIG = $C070
|
||||
|
||||
NORMAL = $F273
|
||||
HGR2 = $F3D8
|
||||
HCLR = $F3F2
|
||||
HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y)
|
||||
|
||||
XDRAW0 = $F65D
|
||||
|
||||
|
||||
;; MONITOR ROUTINES
|
||||
|
@ -49,11 +49,18 @@ set_notes_loop:
|
||||
; if at end, loop
|
||||
|
||||
loop_forever:
|
||||
jmp loop_forever
|
||||
; jmp loop_forever
|
||||
|
||||
; lda #0
|
||||
; sta SONG_OFFSET
|
||||
; beq try_again
|
||||
lda #0
|
||||
sta SONG_OFFSET
|
||||
|
||||
lda #<peasant_song
|
||||
sta SONG_L
|
||||
lda #>peasant_song
|
||||
sta SONG_H
|
||||
|
||||
|
||||
jmp try_again
|
||||
all_ok:
|
||||
|
||||
; see if note
|
||||
|
@ -5,6 +5,8 @@
|
||||
; Clear screen and setup graphics
|
||||
;================================
|
||||
moving:
|
||||
lda #0
|
||||
sta FRAME
|
||||
|
||||
;============================
|
||||
; main loop
|
||||
@ -80,19 +82,21 @@ ror_nop_smc:
|
||||
cmp #$ff ; blah want to draw line 0
|
||||
bne create_yloop
|
||||
|
||||
flip_pages:
|
||||
jsr flip_page
|
||||
|
||||
;flip_pages:
|
||||
|
||||
; Y should be $FF here
|
||||
|
||||
lda HGR_PAGE ; will be $20/$40
|
||||
cmp #$20
|
||||
bne done_page
|
||||
dey
|
||||
done_page:
|
||||
ldx PAGE1-$FE,Y ; set display page to PAGE1 or PAGE2
|
||||
; lda HGR_PAGE ; will be $20/$40
|
||||
; cmp #$20
|
||||
; bne done_page
|
||||
; dey
|
||||
;done_page:
|
||||
; ldx PAGE1-$FE,Y ; set display page to PAGE1 or PAGE2
|
||||
|
||||
eor #$60 ; flip draw page between $2000/$4000
|
||||
sta HGR_PAGE
|
||||
; eor #$60 ; flip draw page between $2000/$4000
|
||||
; sta HGR_PAGE
|
||||
|
||||
lda FRAME
|
||||
cmp #$1f
|
||||
@ -107,19 +111,12 @@ colorlookup:
|
||||
;.byte $11,$55,$5d,$7f,$5d,$55,$11 ; use 00 from sinetable
|
||||
;.byte $00
|
||||
|
||||
|
||||
;sinetable_base = $F5BA
|
||||
|
||||
sinetable_base:
|
||||
; this is actually (32*sin(x))
|
||||
.byte $00,$03,$06,$09,$0C,$0F,$11,$14
|
||||
.byte $16,$18,$1A,$1C,$1D,$1E,$1F,$1F
|
||||
.byte $20
|
||||
|
||||
; for bot
|
||||
; 3F5 - 7d = 378
|
||||
; jmp moving
|
||||
|
||||
sinetable=$8000
|
||||
|
||||
|
||||
|
@ -33,50 +33,13 @@ oval:
|
||||
|
||||
; jsr HGR2 ; set hi-res 140x192, page2, fullscreen
|
||||
|
||||
;====================
|
||||
; create sinetable
|
||||
|
||||
; ldy #0
|
||||
;sinetable_loop:
|
||||
; tya ; 2
|
||||
; and #$3f ; wrap sine at 63 entries ; 2
|
||||
|
||||
; cmp #$20
|
||||
; php ; save pos/negative for later
|
||||
;
|
||||
; and #$1f
|
||||
|
||||
; cmp #$10
|
||||
; bcc sin_left
|
||||
|
||||
;sin_right:
|
||||
; sec carry should be set?
|
||||
; eor #$FF
|
||||
; adc #$20 ; 32-X
|
||||
;sin_left:
|
||||
; tax
|
||||
; lda sinetable_base,X ; 4+
|
||||
|
||||
; plp
|
||||
; bcc sin_done
|
||||
|
||||
;sin_negate:
|
||||
; carry set here
|
||||
; eor #$ff
|
||||
; adc #0
|
||||
|
||||
;sin_done:
|
||||
; sta sinetable,Y
|
||||
|
||||
; iny
|
||||
; bne sinetable_loop
|
||||
|
||||
; NOTE: making gbash/gbasl table wasn't worth it
|
||||
|
||||
;============================
|
||||
; main loop
|
||||
;============================
|
||||
|
||||
lda #0
|
||||
sta FRAME
|
||||
|
||||
draw_oval:
|
||||
inc FRAME
|
||||
|
||||
@ -143,40 +106,17 @@ oval_ror_nop_smc:
|
||||
|
||||
; we skip drawing line 0 as it makes it easier
|
||||
|
||||
oval_flip_pages:
|
||||
jsr flip_page
|
||||
|
||||
; Y should be $FF here
|
||||
|
||||
; iny
|
||||
lda HGR_PAGE
|
||||
cmp #$20
|
||||
bne oval_done_page
|
||||
dey
|
||||
oval_done_page:
|
||||
ldx PAGE1-$FE,Y ; set display page to PAGE1 or PAGE2
|
||||
|
||||
eor #$60 ; flip draw page between $400/$800
|
||||
sta HGR_PAGE
|
||||
lda FRAME
|
||||
cmp #32
|
||||
|
||||
bne draw_oval ; bra
|
||||
|
||||
rts
|
||||
|
||||
colorlookup2:
|
||||
.byte $11,$55,$5d,$7f,$5d,$55,$11,$00
|
||||
|
||||
;sinetable_base:
|
||||
; this is actually (32*sin(x))
|
||||
;.byte $00,$03,$06,$09,$0C,$0F,$11,$14
|
||||
;.byte $16,$18,$1A,$1C,$1D,$1E,$1F,$1F
|
||||
;.byte $20
|
||||
;,$1F,$1F,$1E,$1D,$1C,$1A,$18
|
||||
;.byte $16,$14,$11,$0F,$0C,$09,$06,$03
|
||||
|
||||
|
||||
; for bot
|
||||
; 3F5 - 7d = 378
|
||||
; jmp oval
|
||||
|
||||
;sinetable=$6000
|
||||
|
||||
|
||||
|
@ -6,10 +6,12 @@ wires:
|
||||
|
||||
; jsr HGR2
|
||||
|
||||
reset_x:
|
||||
ldx #$0
|
||||
stx FRAME
|
||||
|
||||
reset_x:
|
||||
ldx #$0
|
||||
stx COUNT
|
||||
outer_loop:
|
||||
|
||||
|
||||
@ -73,7 +75,11 @@ noflo:
|
||||
cpx #7
|
||||
beq reset_x
|
||||
|
||||
inc COUNT
|
||||
inc FRAME
|
||||
lda FRAME
|
||||
cmp #32
|
||||
|
||||
bne outer_loop
|
||||
|
||||
rts
|
||||
@ -84,11 +90,5 @@ 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -14,11 +14,14 @@ SONG_H = $71
|
||||
SONG_OFFSET = $72
|
||||
SONG_COUNTDOWN = $73
|
||||
|
||||
OUR_ROT = $A5
|
||||
|
||||
HGR_X = $E0
|
||||
HGR_XH = $E1
|
||||
HGR_Y = $E2
|
||||
HGR_COLOR = $E4
|
||||
HGR_PAGE = $E6
|
||||
HGR_SCALE = $E7
|
||||
|
||||
COUNT = $FB
|
||||
FRAME = $FC
|
||||
|
Loading…
Reference in New Issue
Block a user