dos33fsprogs/demos/d2/d2.s

200 lines
2.7 KiB
ArmAsm
Raw Normal View History

2021-11-09 06:51:33 +00:00
; HGR Demo2
2021-11-05 04:23:34 +00:00
; by deater (Vince Weaver) <vince@deater.net>
2021-11-12 00:58:20 +00:00
; 1484
2021-11-05 04:23:34 +00:00
; Zero Page
.include "zp.inc"
.include "hardware.inc"
2021-11-06 04:09:39 +00:00
d2:
2021-11-05 04:23:34 +00:00
;===================
2021-11-06 04:09:39 +00:00
; music Player Setup
2021-11-05 04:23:34 +00:00
lda #<peasant_song
sta SONG_L
lda #>peasant_song
sta SONG_H
; assume mockingboard in slot#4
2021-11-12 00:58:20 +00:00
; TODO: inline?
2021-11-05 04:23:34 +00:00
jsr mockingboard_init
2021-11-12 00:58:20 +00:00
2021-11-05 04:23:34 +00:00
2021-11-06 04:09:39 +00:00
;================================
; Clear screen and setup graphics
;================================
jsr HGR2 ; set hi-res 140x192, page2, fullscreen
; A and Y both 0 at end
2021-11-12 00:58:20 +00:00
sty FRAME ; start at 0
2021-11-06 04:09:39 +00:00
;==================
; create sinetable
;ldy #0 ; Y is 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 ; blt
sin_right:
; sec carry should be set here
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
2021-11-12 00:58:20 +00:00
adc #0
2021-11-06 04:09:39 +00:00
sin_done:
sta sinetable,Y
iny
bne sinetable_loop
; NOTE: making gbash/gbasl table wasn't worth it
2021-11-12 00:58:20 +00:00
;=====================
; setup credits
; TODO: inline?
2021-11-07 19:06:57 +00:00
2021-11-09 06:51:33 +00:00
jsr print_message
2021-11-12 00:58:20 +00:00
;==========================
; beginning of demo
;==========================
jsr dsr_spin
; start music, no music for spin
start_interrupts:
cli
forever:
;=====================
; orange/green effect
2021-11-06 04:09:39 +00:00
jsr moving
2021-11-05 04:23:34 +00:00
2021-11-12 00:58:20 +00:00
;=====================
; clear screen
2021-11-07 19:06:57 +00:00
jsr fast_hclr
2021-11-09 06:51:33 +00:00
2021-11-07 19:06:57 +00:00
jsr flip_page
2021-11-12 00:58:20 +00:00
;=====================
; wires effect
2021-11-06 04:09:39 +00:00
jsr wires
2021-11-12 00:58:20 +00:00
;=====================
; oval effect
2021-11-07 19:06:57 +00:00
jsr oval
2021-11-12 00:58:20 +00:00
;=====================
; repeat
2021-11-06 04:09:39 +00:00
jmp forever
2021-11-05 04:23:34 +00:00
2021-11-07 19:06:57 +00:00
2021-11-12 00:58:20 +00:00
;===========================
; common flip page routine
2021-11-07 19:06:57 +00:00
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
2021-11-09 06:51:33 +00:00
;===================
; print message
;===================
print_message:
2021-11-12 00:58:20 +00:00
; TODO: inline?
2021-11-09 06:51:33 +00:00
jsr clear_both_bottoms
2021-11-12 00:58:20 +00:00
ldx #13
2021-11-09 06:51:33 +00:00
print_message_loop:
lda message1,X
2021-11-12 00:58:20 +00:00
; ora #$80
2021-11-09 06:51:33 +00:00
sta $650,X
sta $A50,X
lda message2,X
2021-11-12 00:58:20 +00:00
; ora #$80
2021-11-09 06:51:33 +00:00
sta $6d0,X
sta $AD0,X
dex
bpl print_message_loop
rts
; 01234567890123456789012345678901234567890"
2021-11-12 00:58:20 +00:00
;message1:
;.byte "THE APPLE II HAS NO PALETTE ROTATION"
;message2:
;.byte "WE ARE DOING THIS THE HARD WAY... "
.macro hiasc str
.repeat .strlen(str),I
.byte .strat(str,I) | $80
.endrep
.endmacro
2021-11-09 06:51:33 +00:00
message1:
2021-11-12 00:58:20 +00:00
hiasc "CODE: DEATER"
2021-11-09 06:51:33 +00:00
message2:
2021-11-12 00:58:20 +00:00
hiasc "MUSIC: MA2E "
2021-11-07 19:06:57 +00:00
.include "dsr_shape.s"
2021-11-05 04:23:34 +00:00
.include "moving.s"
2021-11-06 04:09:39 +00:00
.include "wires.s"
.include "oval.s"
2021-11-09 06:51:33 +00:00
.include "clear_bottom.s"
2021-11-05 04:23:34 +00:00
; music
2021-11-12 00:58:20 +00:00
.include "mA2E_2.s"
2021-11-05 04:23:34 +00:00
.include "interrupt_handler.s"
; must be last
.include "mockingboard_setup.s"