Commit 2ada4ce

Nick committed on
More WIP instruments
commit 2ada4cee13df2515397776e1855109ef64642965 parent 1d84f7a
1 changed files +45−28
Modifieddriver.z80 +45−28
@@ -139,7 +139,7 @@ order_cnt: db 2
139 order1: dw unreal, unreal, unreal 139 order1: dw unreal, unreal, unreal
140 order2: dw empty, unreal_arps, unreal_arps 140 order2: dw empty, unreal_arps, unreal_arps
141 order3: dw empty 141 order3: dw empty
142 order4: dw empty 142 order4: dw drums
143 143
144 lunawaves: 144 lunawaves:
145 include "lunawaves.inc" 145 include "lunawaves.inc"
@@ -153,14 +153,14 @@ tfau_bass:
153 include "tfau_bass.inc" 153 include "tfau_bass.inc"
154 empty: 154 empty:
155 rept 64 155 rept 64
156 db 90, 0, 0 156 dn 90, 0, 0
157 endr 157 endr
158 drums: 158 drums:
159 rept 16 159 rept 16
160 db C4, 0, 0 160 dn C4, 2, 0
161 db 90, 0, 0 161 dn 90, 0, 0
162 db 90, 0, 0 162 dn 90, 0, 0
163 db 90, 0, 0 163 dn 90, 0, 0
164 endr 164 endr
165 walkup: 165 walkup:
166 _ASDF = C3 166 _ASDF = C3
@@ -264,9 +264,9 @@ voice_instrument:
264 ;; Format for channel 4: 264 ;; Format for channel 4:
265 265
266 noise_instrument: 266 noise_instrument:
267 .length: db 267 .length: db 0
268 .envelope: db 268 .envelope: db %11110001
269 .step_and_ratio: db 269 .step_and_ratio: db 0
270 .unused: db 270 .unused: db
271 271
272 SECTION "Playback variables", WRAM0 272 SECTION "Playback variables", WRAM0
@@ -576,7 +576,7 @@ _playnote1:
576 ret 576 ret
577 577
578 _playnote2: 578 _playnote2:
579 ;; Play a note on channel 2 (square wave) 579 ;; Play a note on channel 2 (square wave)
580 ld a, [temp_note_value+1] 580 ld a, [temp_note_value+1]
581 ld [channel_period2], a 581 ld [channel_period2], a
582 ld [rAUD2LOW], a 582 ld [rAUD2LOW], a
@@ -590,7 +590,7 @@ _playnote2:
590 ret 590 ret
591 591
592 _playnote3: 592 _playnote3:
593 ;; Play a note on channel 3 (waveform) 593 ;; Play a note on channel 3 (waveform)
594 ld a, [temp_note_value+1] 594 ld a, [temp_note_value+1]
595 ld [channel_period3], a 595 ld [channel_period3], a
596 ld [rAUD3LOW], a 596 ld [rAUD3LOW], a
@@ -604,14 +604,7 @@ _playnote3:
604 ret 604 ret
605 605
606 _playnote4: 606 _playnote4:
607 ;; Call with: 607 ;; Play a "note" on channel 4 (noise)
608 ;; Note value in H and L
609 ;; instrument + effect code in B
610
611 ;; Play a "note" on channel 4 (noise)
612
613 ; ld a, %11110001
614 ; ld [rAUD4ENV], a
615 608
616 ld a, [temp_note_value+1] 609 ld a, [temp_note_value+1]
617 ld [channel_period4], a 610 ld [channel_period4], a
@@ -622,8 +615,12 @@ _playnote4:
622 ld d, a 615 ld d, a
623 616
624 call _quantize_channel4_note 617 call _quantize_channel4_note
618 ld b, a
625 619
620 ld a, [rAUD4POLY]
621 or b
626 ld [rAUD4POLY], a 622 ld [rAUD4POLY], a
623
627 ld a, %10000000 624 ld a, %10000000
628 ld [rAUD4GO], a 625 ld [rAUD4GO], a
629 626
@@ -1315,9 +1312,15 @@ _dosound:
1315 loadShort pattern2, b, c 1312 loadShort pattern2, b, c
1316 ld de, channel_note2 1313 ld de, channel_note2
1317 call _lookup_note 1314 call _lookup_note
1318 1315 push af
1319 jr nc, .do_setvol2 1316 jr nc, .do_setvol2
1320 ld a, %11110000 1317
1318 call _setup_instrument_pointer
1319 inc de
1320 ld a, [de]
1321 inc de
1322 ld [rAUD2LEN], a
1323 ld a, [de]
1321 ld [rAUD2ENV], a 1324 ld [rAUD2ENV], a
1322 1325
1323 .do_setvol2: 1326 .do_setvol2:
@@ -1326,8 +1329,6 @@ _dosound:
1326 ld a, l 1329 ld a, l
1327 ld [temp_note_value+1], a 1330 ld [temp_note_value+1], a
1328 1331
1329 push af
1330
1331 ld e, 1 1332 ld e, 1
1332 call _doeffect 1333 call _doeffect
1333 1334
@@ -1341,10 +1342,20 @@ _dosound:
1341 loadShort pattern3, b, c 1342 loadShort pattern3, b, c
1342 ld de, channel_note3 1343 ld de, channel_note3
1343 call _lookup_note 1344 call _lookup_note
1345 push af
1344 1346
1345 jr nc, .do_setvol3 1347 jr nc, .do_setvol3
1346 ld a, %00100000 1348
1349 call _setup_instrument_pointer
1350 ld a, [de]
1351 inc de
1352 ld [rAUD3LEN], a
1353 ld a, [de]
1354 inc de
1347 ld [rAUD3LEVEL], a 1355 ld [rAUD3LEVEL], a
1356 ;; TODO: Write to _AUD3WAVERAM
1357 ; ld a, [de]
1358 ; ld [rAUD3ENV], a
1348 1359
1349 .do_setvol3: 1360 .do_setvol3:
1350 ld a, h 1361 ld a, h
@@ -1352,7 +1363,6 @@ _dosound:
1352 ld a, l 1363 ld a, l
1353 ld [temp_note_value+1], a 1364 ld [temp_note_value+1], a
1354 1365
1355 push af
1356 1366
1357 ld e, 2 1367 ld e, 2
1358 call _doeffect 1368 call _doeffect
@@ -1367,10 +1377,19 @@ _dosound:
1367 loadShort pattern4, b, c 1377 loadShort pattern4, b, c
1368 ld de, channel_note4 1378 ld de, channel_note4
1369 call _lookup_note 1379 call _lookup_note
1380 push af
1370 1381
1371 jr nc, .do_setvol4 1382 jr nc, .do_setvol4
1372 ld a, %11110000 1383
1384 call _setup_instrument_pointer
1385 ld a, [de]
1386 inc de
1387 ld [rAUD4LEN], a
1388 ld a, [de]
1389 inc de
1373 ld [rAUD4ENV], a 1390 ld [rAUD4ENV], a
1391 ld a, [de]
1392 ld [rAUD4POLY], a
1374 1393
1375 .do_setvol4: 1394 .do_setvol4:
1376 ld a, h 1395 ld a, h
@@ -1378,8 +1397,6 @@ _dosound:
1378 ld a, l 1397 ld a, l
1379 ld [temp_note_value+1], a 1398 ld [temp_note_value+1], a
1380 1399
1381 push af
1382
1383 ld e, 3 1400 ld e, 3
1384 call _doeffect 1401 call _doeffect
1385 1402