mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
recomment ReadNoiseSample
This commit is contained in:
parent
b2dd26c8a0
commit
12f0be8ccc
@ -1060,27 +1060,28 @@ ReadNoiseSample: ; e85af
|
|||||||
; sample struct:
|
; sample struct:
|
||||||
; [wx] [yy] [zz]
|
; [wx] [yy] [zz]
|
||||||
; w: ? either 2 or 3
|
; w: ? either 2 or 3
|
||||||
; x: ? 0-7
|
; x: duration
|
||||||
; zzyy: pointer to sample data
|
; zz: intensity
|
||||||
; NOTE: these seem to have $4000 added to them later
|
; yy: frequency
|
||||||
|
|
||||||
; de = NoiseSampleAddress
|
; de = [NoiseSampleAddress]
|
||||||
ld hl, NoiseSampleAddress
|
ld hl, NoiseSampleAddress
|
||||||
ld e, [hl]
|
ld e, [hl]
|
||||||
inc hl
|
inc hl
|
||||||
ld d, [hl]
|
ld d, [hl]
|
||||||
|
|
||||||
; is it empty?
|
; is it empty?
|
||||||
ld a, e
|
ld a, e
|
||||||
or d
|
or d
|
||||||
jr z, .quit
|
jr z, .quit
|
||||||
; get the noise sample
|
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
inc de
|
inc de
|
||||||
; are we done?
|
|
||||||
cp a, $ff
|
cp $ff
|
||||||
jr z, .quit
|
jr z, .quit
|
||||||
;
|
|
||||||
and a, $0f ; bottom nybble
|
and $f
|
||||||
inc a
|
inc a
|
||||||
ld [$c2a2], a
|
ld [$c2a2], a
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
@ -1091,11 +1092,12 @@ ReadNoiseSample: ; e85af
|
|||||||
ld [$c294], a
|
ld [$c294], a
|
||||||
xor a
|
xor a
|
||||||
ld [$c295], a
|
ld [$c295], a
|
||||||
;
|
|
||||||
ld hl, NoiseSampleAddress
|
ld hl, NoiseSampleAddress
|
||||||
ld [hl], e
|
ld [hl], e
|
||||||
inc hl
|
inc hl
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
|
|
||||||
ld hl, Channel1NoteFlags - Channel1
|
ld hl, Channel1NoteFlags - Channel1
|
||||||
add hl, bc
|
add hl, bc
|
||||||
set 4, [hl]
|
set 4, [hl]
|
||||||
|
Loading…
Reference in New Issue
Block a user