Skip to content

Commit

Permalink
255 waves
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDisk committed Dec 31, 2024
1 parent d805548 commit 10f6551
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
11 changes: 6 additions & 5 deletions doc/driver-format.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,18 @@ Instrument formats
1: Sweep NR10
2: Length NR11
3: Envelope NR12
4: Highmask (%xytttttt) where X is set if it is a trigger note
4-5: Table
6: Highmask (%xy000000) where X is set if it is a trigger note
(should always be 1) and Y is the length enabled flag
and T is the table number

-=-=-Wave-=-=-
1: Length NR31
2: Sound level NR32
3: Waveform number associated with this instrument
4: Highmask as shown before
4-5: Table
6: Highmask as shown before

-=-=-Noise-=-=-
1: Envelope NR42
2: Highmask + Length combined; 1 bit for counter step, 1 bit for length enabled, followed by the length itself
3: Table
2-3: Table
4: Highmask + Length combined; 1 bit for counter step, 1 bit for length enabled, followed by the length itself
20 changes: 13 additions & 7 deletions hUGEDriver.asm
Original file line number Diff line number Diff line change
Expand Up @@ -808,16 +808,20 @@ fx_set_duty:

update_ch3_waveform:
ld [hl], a
;; Get pointer to new wave
swap a
ld l, a
ld h, 0
add hl, hl
add hl, hl
add hl, hl
add hl, hl
ld b, h
ld c, l

ld hl, waves
add [hl]
inc hl
ld a, [hl+]
ld h, [hl]
ld l, a
adc h
sub l
ld h, a
add hl, bc

ldh a, [rAUDTERM]
push af
Expand Down Expand Up @@ -1588,7 +1592,9 @@ process_ch3:
ld hl, current_wave
cp [hl]
jr z, .no_wave_copy
push bc
call update_ch3_waveform
pop bc

.no_wave_copy:
pop hl
Expand Down

0 comments on commit 10f6551

Please sign in to comment.