mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-28 05:07:58 -05:00
Decomped DseTrackEvent_SetInstrument
Decomped by @Snioflake
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user