mirror of
https://github.com/pret/pmd-sky.git
synced 2026-03-21 17:25:15 -05:00
Decomped DseTrackEvent_SetInstrument
Decomped by @Snioflake
This commit is contained in:
parent
4e14734d61
commit
08c20fbc18
|
|
@ -1,42 +1,3 @@
|
|||
#pragma once
|
||||
.public DRIVER_WORK
|
||||
.public DseMem_Allocate
|
||||
.public DseMem_Free
|
||||
.public DseSwd_GetBankById
|
||||
.public DseSwd_GetInstrument
|
||||
.public DseSwd_GetNextSplitInRange
|
||||
.public DseUtil_GetRandomNumber
|
||||
.public ReadWaviEntry
|
||||
.public SoundEnvelopeParameters_CheckValidity
|
||||
.public SoundEnvelopeParameters_Reset
|
||||
.public SoundEnvelope_Release
|
||||
.public SoundEnvelope_Reset
|
||||
.public SoundEnvelope_SetParameters
|
||||
.public SoundEnvelope_Stop
|
||||
.public SoundEnvelope_Stop2
|
||||
.public SoundEnvelope_Tick
|
||||
.public SoundLfoBank_Reset
|
||||
.public SoundLfoBank_Set
|
||||
.public SoundLfoBank_SetConstEnvelopes
|
||||
.public SoundLfoBank_Tick
|
||||
.public UpdateTrackVolumeEnvelopes
|
||||
.public _020B0D50
|
||||
.public _020B1310
|
||||
.public _020B1394
|
||||
.public _022B7370
|
||||
.public _022B7988
|
||||
.public _022B7A30
|
||||
.public _022B7A6C
|
||||
.public _022B8330
|
||||
.public _022B9584
|
||||
.public _s32_div_f
|
||||
.public DseChannel_SetBank
|
||||
.public _u32_div_f
|
||||
.public sub_0207C8B8
|
||||
.public sub_0207C8E0
|
||||
.public sub_0207CA04
|
||||
.public sub_0207CA24
|
||||
.public sub_0207CA4C
|
||||
.public sub_0207CA6C
|
||||
.public sub_0207CAB8
|
||||
.public sub_0207CAE0
|
||||
.public sub_0207D470
|
||||
|
|
|
|||
42
asm/include/main_02071C3C.inc
Normal file
42
asm/include/main_02071C3C.inc
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#pragma once
|
||||
.public DRIVER_WORK
|
||||
.public DseMem_Allocate
|
||||
.public DseMem_Free
|
||||
.public DseSwd_GetBankById
|
||||
.public DseSwd_GetInstrument
|
||||
.public DseSwd_GetNextSplitInRange
|
||||
.public DseUtil_GetRandomNumber
|
||||
.public ReadWaviEntry
|
||||
.public SoundEnvelopeParameters_CheckValidity
|
||||
.public SoundEnvelopeParameters_Reset
|
||||
.public SoundEnvelope_Release
|
||||
.public SoundEnvelope_Reset
|
||||
.public SoundEnvelope_SetParameters
|
||||
.public SoundEnvelope_Stop
|
||||
.public SoundEnvelope_Stop2
|
||||
.public SoundEnvelope_Tick
|
||||
.public SoundLfoBank_Reset
|
||||
.public SoundLfoBank_Set
|
||||
.public SoundLfoBank_SetConstEnvelopes
|
||||
.public SoundLfoBank_Tick
|
||||
.public UpdateTrackVolumeEnvelopes
|
||||
.public _020B0D50
|
||||
.public _020B1310
|
||||
.public _020B1394
|
||||
.public _022B7370
|
||||
.public _022B7988
|
||||
.public _022B7A30
|
||||
.public _022B7A6C
|
||||
.public _022B8330
|
||||
.public _022B9584
|
||||
.public _s32_div_f
|
||||
.public _u32_div_f
|
||||
.public sub_0207C8B8
|
||||
.public sub_0207C8E0
|
||||
.public sub_0207CA04
|
||||
.public sub_0207CA24
|
||||
.public sub_0207CA4C
|
||||
.public sub_0207CA6C
|
||||
.public sub_0207CAB8
|
||||
.public sub_0207CAE0
|
||||
.public sub_0207D470
|
||||
3874
asm/main_02071AC0.s
3874
asm/main_02071AC0.s
File diff suppressed because it is too large
Load Diff
3855
asm/main_02071C3C.s
Normal file
3855
asm/main_02071C3C.s
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -74,27 +74,27 @@ struct dse_sound_envelope {
|
|||
|
||||
struct dse_track {
|
||||
u16 field0_0x0;
|
||||
u8 active;
|
||||
u8 field2_0x3;
|
||||
u8 octave;
|
||||
u8 duration_multiplier;
|
||||
u8 n_sub_loops;
|
||||
u8 field6_0x7;
|
||||
u8 field7_0x8;
|
||||
u8 field8_0x9;
|
||||
u16 maybe_n_reps;
|
||||
u32 current_wait;
|
||||
u32 last_wait;
|
||||
u32 last_duration;
|
||||
u8 *start;
|
||||
u8 *next_event;
|
||||
u8 *loop_start;
|
||||
struct dse_sub_loop sub_loops[4];
|
||||
u8 is_playing;
|
||||
u8 field_0x3;
|
||||
u8 current_octave;
|
||||
u8 note_duration_multiplier;
|
||||
u8 loop_stack_index;
|
||||
u8 previous_note_number;
|
||||
u8 ignore_playnote;
|
||||
u8 field_0x9;
|
||||
u16 main_loop_count;
|
||||
u32 wait_ticks_left;
|
||||
u32 previous_wait_ticks;
|
||||
u32 previous_duration;
|
||||
u8* track_data_location;
|
||||
u8* position;
|
||||
u8* loop_start;
|
||||
struct dse_sub_loop loop_stack[4];
|
||||
struct dse_channel *channel;
|
||||
u8 field18_0x58;
|
||||
u8 field19_0x59;
|
||||
u8 field20_0x5a;
|
||||
u8 field21_0x5b;
|
||||
u8 field_0x58;
|
||||
u8 field_0x59;
|
||||
u8 field_0x5a;
|
||||
u8 field_0x5b;
|
||||
};
|
||||
|
||||
struct dse_voice {
|
||||
|
|
@ -174,7 +174,7 @@ struct dse_channel {
|
|||
u16 jitter_range;
|
||||
u8 random_note_min;
|
||||
u8 random_note_max;
|
||||
u16 field10_0xe;
|
||||
u16 bank_id;
|
||||
u16 field11_0x10;
|
||||
u8 field12_0x12;
|
||||
u8 field13_0x13;
|
||||
|
|
@ -321,7 +321,7 @@ struct dse_seq {
|
|||
u8 field52_0x99;
|
||||
u8 field53_0x9a;
|
||||
u8 field54_0x9b;
|
||||
u8 *unk_callback;
|
||||
void (*unk_callback)(u32, u32, u32, u32);
|
||||
u32 field56_0xa0;
|
||||
struct dse_seq *next;
|
||||
struct dse_track tracks[16];
|
||||
|
|
|
|||
8
include/main_02071BF4.h
Normal file
8
include/main_02071BF4.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef PMDSKY_MAIN_02071BF4_H
|
||||
#define PMDSKY_MAIN_02071BF4_H
|
||||
|
||||
#include "dse.h"
|
||||
|
||||
u8* DseTrackEvent_SetInstrument(u8 *cur, struct dse_seq *seq, struct dse_track *trk, struct dse_channel *chn);
|
||||
|
||||
#endif //PMDSKY_MAIN_02071BF4_H
|
||||
2
main.lsf
2
main.lsf
|
|
@ -79,6 +79,8 @@ Static main
|
|||
Object asm/main_0206C9BC.o
|
||||
Object src/main_02071A98.o
|
||||
Object asm/main_02071AC0.o
|
||||
Object src/main_02071BF4.o
|
||||
Object asm/main_02071C3C.o
|
||||
Object lib/DSE/src/dc_envelope.o
|
||||
Object lib/DSE/src/dc_lfo.o
|
||||
Object lib/DSE/asm/dc_lfo_1.o
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
#include "main_02071A98.h"
|
||||
|
||||
u8* DseTrackEvent_SubLoopBreakOnLastIteration(u8 *cur, struct dse_seq *seq, struct dse_track *trk, struct dse_channel *chn)
|
||||
u8* DseTrackEvent_SubLoopBreakOnLastIteration(u8 *ptr_next_byte, struct dse_seq *sequence, struct dse_track *track, struct dse_channel *channel)
|
||||
{
|
||||
u8 n = trk->n_sub_loops;
|
||||
struct dse_sub_loop *last_loop = &trk->sub_loops[n-1];
|
||||
u8 n = track->loop_stack_index;
|
||||
struct dse_sub_loop *last_loop = &track->loop_stack[n-1];
|
||||
|
||||
if (last_loop->count - 1 == 0) {
|
||||
cur = last_loop->end;
|
||||
trk->n_sub_loops = n - 1;
|
||||
ptr_next_byte = last_loop->end;
|
||||
track->loop_stack_index = n - 1;
|
||||
}
|
||||
|
||||
return cur;
|
||||
return ptr_next_byte;
|
||||
}
|
||||
|
|
|
|||
14
src/main_02071BF4.c
Normal file
14
src/main_02071BF4.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "main_02071BF4.h"
|
||||
|
||||
extern u32 DseChannel_SetInstrument(struct dse_channel *channel, u16 instrument_index);
|
||||
|
||||
u8* DseTrackEvent_SetInstrument(u8 *ptr_next_byte, struct dse_seq *sequence, struct dse_track *track, struct dse_channel *channel)
|
||||
{
|
||||
s32 iVar1;
|
||||
|
||||
iVar1 = DseChannel_SetInstrument(channel,(u16)*ptr_next_byte);
|
||||
if (iVar1 < 0) {
|
||||
sequence->unk_callback(sequence->id,-0xcc,(u32)(u16)channel->bank_id * 0x10000 - iVar1,sequence->field56_0xa0);
|
||||
}
|
||||
return ptr_next_byte + 1;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user