d2_hgr: update music

This commit is contained in:
Vince Weaver 2021-11-11 19:58:20 -05:00
parent 07910f980b
commit 44d0160b26
5 changed files with 289 additions and 24 deletions

View File

@ -25,13 +25,19 @@ peasant_music.s: peasant.txt text_to_tiny
####
mA2E_2.s: mA2E_2.txt text_to_tiny
./text_to_tiny mA2E_2.txt > mA2E_2.s
####
D2: d2.o
ld65 -o D2 d2.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
d2.o: d2.s \
moving.s wires.s oval.s dsr_shape.s \
zp.inc hardware.inc \
peasant_music.s \
mA2E_2.s \
interrupt_handler.s mockingboard_setup.s
ca65 -o d2.o d2.s -l d2.lst
@ -46,5 +52,4 @@ text_to_tiny.o: text_to_tiny.c
####
clean:
rm -f *~ *.o *.lst D2 HELLO text_to_tiny peasant_music.s
rm -f *~ *.o *.lst D2 HELLO text_to_tiny mA2E_2.s

View File

@ -2,6 +2,8 @@
; by deater (Vince Weaver) <vince@deater.net>
; 1484
; Zero Page
.include "zp.inc"
.include "hardware.inc"
@ -18,10 +20,12 @@ d2:
sta SONG_H
; assume mockingboard in slot#4
; TODO: inline?
jsr mockingboard_init
start_interrupts:
cli
;================================
; Clear screen and setup graphics
@ -30,7 +34,7 @@ start_interrupts:
jsr HGR2 ; set hi-res 140x192, page2, fullscreen
; A and Y both 0 at end
sty FRAME ; start at 1 for wires purposes
sty FRAME ; start at 0
;==================
; create sinetable
@ -62,7 +66,7 @@ sin_left:
sin_negate:
; carry set here
eor #$ff
; adc #0 ; FIXME: this makes things off by 1
adc #0
sin_done:
sta sinetable,Y
@ -70,31 +74,62 @@ sin_done:
iny
bne sinetable_loop
; NOTE: making gbash/gbasl table wasn't worth it
;=====================
; setup credits
; TODO: inline?
jsr print_message
;==========================
; beginning of demo
;==========================
jsr dsr_spin
forever:
jsr print_message
; start music, no music for spin
bit TEXTGR
start_interrupts:
cli
forever:
;=====================
; orange/green effect
jsr moving
;=====================
; clear screen
jsr fast_hclr
jsr flip_page
;=====================
; wires effect
jsr wires
;=====================
; oval effect
jsr oval
;=====================
; repeat
jmp forever
;===========================
; common flip page routine
flip_page:
ldy #$0
lda HGR_PAGE ; will be $20/$40
@ -113,16 +148,19 @@ done_flip_page:
; print message
;===================
print_message:
; TODO: inline?
jsr clear_both_bottoms
ldx #35
ldx #13
print_message_loop:
lda message1,X
ora #$80
; ora #$80
sta $650,X
sta $A50,X
lda message2,X
ora #$80
; ora #$80
sta $6d0,X
sta $AD0,X
dex
@ -132,13 +170,21 @@ print_message_loop:
; 01234567890123456789012345678901234567890"
message1:
.byte "THE APPLE II HAS NO PALETTE ROTATION"
message2:
.byte "WE ARE DOING THIS THE HARD WAY... "
;message1:
;.byte "THE APPLE II HAS NO PALETTE ROTATION"
;message2:
;.byte "WE ARE DOING THIS THE HARD WAY... "
.byte "CODE: DEATER",0
.byte "MUSIC: MA2E",0
.macro hiasc str
.repeat .strlen(str),I
.byte .strat(str,I) | $80
.endrep
.endmacro
message1:
hiasc "CODE: DEATER"
message2:
hiasc "MUSIC: MA2E "
.include "dsr_shape.s"
.include "moving.s"
@ -147,7 +193,7 @@ message2:
.include "clear_bottom.s"
; music
.include "peasant_music.s"
.include "mA2E_2.s"
.include "interrupt_handler.s"
; must be last
.include "mockingboard_setup.s"

212
demos/d2/mA2E_2.txt Normal file
View File

@ -0,0 +1,212 @@
'' TITLE: Mockingboard Tune 2 - 2021
' AUTHOR: mA2E / dSr
' COMMENTS:
'
' LOOP: 640
'
' BPM: 250
' TEMPO: 6
' FREQ: 1000000
' IRQ: 50
'
' LYRICS: 0
'
' ENDHEADER
-------
' 0
0 F 3-- C 5-- C 4--
1 ----- ----- -----
2 ----- ----- -----
3 ----- ----- -----
4 ----- ----- F 4--
5 ----- ----- -----
6 ----- ----- -----
7 ----- ----- -----
8 F 4-- F 5-- G 4--
9 ----- ----- -----
A ----- ----- -----
B ----- ----- -----
C ----- ----- G#4--
D ----- ----- -----
E ----- ----- -----
F ----- ----- -----
10 F 3-- G 5-- C 4--
11 ----- ----- -----
12 ----- ----- -----
13 ----- ----- -----
14 ----- ----- F 4--
15 ----- ----- -----
16 ----- ----- -----
17 ----- ----- -----
18 F 4-- G#5-- G 4--
19 ----- ----- -----
1A ----- ----- -----
1B ----- ----- -----
1C ----- ----- G#4--
1D ----- ----- -----
1E ----- ----- -----
1F ----- ----- -----
20 F 3-- G 5-- C 4--
21 ----- ----- -----
22 ----- ----- -----
23 ----- ----- -----
24 ----- ----- F 4--
25 ----- ----- -----
26 ----- ----- -----
27 ----- ----- -----
28 F 4-- G#5-- G 4--
29 ----- ----- -----
2A ----- ----- -----
2B ----- ----- -----
2C ----- ----- G#4--
2D ----- ----- -----
2E ----- ----- -----
2F ----- ----- -----
30 F 3-- C 6-- C 4--
31 ----- ----- -----
32 ----- ----- -----
33 ----- ----- -----
34 ----- ----- F 4--
35 ----- ----- -----
36 ----- ----- -----
37 ----- ----- -----
38 F 4-- ----- G 4--
39 ----- ----- -----
3A ----- ----- -----
3B ----- ----- -----
3C ----- ----- G#4--
3D ----- ----- -----
3E ----- ----- -----
3F ----- ----- -----
' 1
0 D#3-- A#5-- D#4--
1 ----- ----- -----
2 ----- ----- -----
3 ----- ----- -----
4 ----- ----- G 4--
5 ----- ----- -----
6 ----- ----- -----
7 ----- ----- -----
8 D#4-- G#5-- G#4--
9 ----- ----- -----
A ----- ----- -----
B ----- ----- -----
C ----- ----- A#4--
D ----- ----- -----
E ----- ----- -----
F ----- ----- -----
10 D#3-- G 5-- D#4--
11 ----- ----- -----
12 ----- ----- -----
13 ----- ----- -----
14 ----- ----- G 4--
15 ----- ----- -----
16 ----- ----- -----
17 ----- ----- -----
18 D#4-- F 5-- G#4--
19 ----- ----- -----
1A ----- ----- -----
1B ----- ----- -----
1C ----- ----- A#4--
1D ----- ----- -----
1E ----- ----- -----
1F ----- ----- -----
20 D#3-- G 5-- D#4--
21 ----- ----- -----
22 ----- ----- -----
23 ----- ----- -----
24 ----- ----- G 4--
25 ----- ----- -----
26 ----- ----- -----
27 ----- ----- -----
28 D#4-- G#5-- G#4--
29 ----- ----- -----
2A ----- ----- -----
2B ----- ----- -----
2C ----- ----- A#4--
2D ----- ----- -----
2E ----- ----- -----
2F ----- ----- -----
30 D#3-- G 5-- D#4--
31 ----- ----- -----
32 ----- ----- -----
33 ----- ----- -----
34 ----- ----- G 4--
35 ----- ----- -----
36 ----- ----- -----
37 ----- ----- -----
38 D#4-- ----- G#4--
39 ----- ----- -----
3A ----- ----- -----
3B ----- ----- -----
3C ----- ----- A#4--
3D ----- ----- -----
3E ----- ----- -----
3F ----- ----- -----
' 2
0 C#3-- G 5-- C#4--
1 ----- ----- -----
2 ----- ----- -----
3 ----- ----- -----
4 ----- ----- F 4--
5 ----- ----- -----
6 ----- ----- -----
7 ----- ----- -----
8 C#4-- ----- G 4--
9 ----- ----- -----
A ----- ----- -----
B ----- ----- -----
C ----- ----- G#4--
D ----- ----- -----
E ----- ----- -----
F ----- ----- -----
10 C#3-- G#5-- C#4--
11 ----- ----- -----
12 ----- ----- -----
13 ----- ----- -----
14 ----- ----- F 4--
15 ----- ----- -----
16 ----- ----- -----
17 ----- ----- -----
18 C#4-- F 5-- G 4--
19 ----- ----- -----
1A ----- ----- -----
1B ----- ----- -----
1C ----- ----- G#4--
1D ----- ----- -----
1E ----- ----- -----
1F ----- ----- -----
20 C#3-- ----- C#4--
21 ----- ----- -----
22 ----- ----- -----
23 ----- ----- -----
24 ----- ----- F 4--
25 ----- ----- -----
26 ----- ----- -----
27 ----- ----- -----
28 C#4-- ----- G 4--
29 ----- ----- -----
2A ----- ----- -----
2B ----- ----- -----
2C ----- ----- G#4--
2D ----- ----- -----
2E ----- ----- -----
2F ----- ----- -----
30 C#3-- ----- C#4--
31 ----- ----- -----
32 ----- ----- -----
33 ----- ----- -----
34 ----- ----- F 4--
35 ----- ----- -----
36 ----- ----- -----
37 ----- ----- -----
38 C#4-- ----- G 4--
39 ----- ----- -----
3A ----- ----- -----
3B ----- ----- -----
3C ----- ----- A#4--
3D ----- ----- -----
3E ----- ----- -----
3F ----- ----- -----

View File

@ -120,11 +120,13 @@ mockingboard_setup_interrupt:
sta MOCK_6522_IFR ; IFR: 1100, enable interrupt on timer one oflow
sta MOCK_6522_IER ; IER: 1100, enable timer one interrupt
lda #$34
lda #$40
; lda #$34
; lda #$E7
sta MOCK_6522_T1CL ; write into low-order latch
lda #$85
lda #$9C
; lda #$85
; lda #$4f
sta MOCK_6522_T1CH ; write into high-order latch,
; load both values into counter

View File

@ -13,7 +13,7 @@
#include <string.h>
#include <math.h>
static int octave_adjust=1;
static int octave_adjust=0;
// CCOONNNN -- c=channel, o=octave, n=note