mirror of
https://github.com/pret/pmd-sky.git
synced 2026-09-30 06:12:17 -05:00
Rename DSE structs to match pmdsky-debug
This commit is contained in:
419
include/dse.h
419
include/dse.h
@@ -2,12 +2,10 @@
|
||||
#define PMDSKY_DSE_H
|
||||
|
||||
struct dse_fade {
|
||||
s32 val;
|
||||
u32 delta;
|
||||
u32 target;
|
||||
u16 steps;
|
||||
u8 field4_0xe;
|
||||
u8 field5_0xf;
|
||||
s32 current;
|
||||
s32 delta;
|
||||
s32 target;
|
||||
u16 ticks_remaining;
|
||||
};
|
||||
|
||||
struct dse_lfo {
|
||||
@@ -46,7 +44,7 @@ struct dse_sub_loop {
|
||||
u8 field5_0xb;
|
||||
};
|
||||
|
||||
struct dse_sound_envelope_parameters {
|
||||
struct sound_envelope_parameters {
|
||||
u8 use_envelope;
|
||||
u8 slide_time_multiplier;
|
||||
u16 unk_0x2;
|
||||
@@ -61,19 +59,18 @@ struct dse_sound_envelope_parameters {
|
||||
u8 unk_0xf;
|
||||
};
|
||||
|
||||
struct dse_sound_envelope {
|
||||
struct dse_sound_envelope_parameters parameters;
|
||||
struct sound_envelope {
|
||||
struct sound_envelope_parameters parameters;
|
||||
s32 current_volume;
|
||||
s32 volume_delta;
|
||||
s32 ticks_left;
|
||||
u8 state;
|
||||
u8 target_volume;
|
||||
u8 update_volume;
|
||||
u8 field7_0x1f;
|
||||
};
|
||||
|
||||
struct dse_track {
|
||||
u16 field0_0x0;
|
||||
u16 field_0x0;
|
||||
u8 is_playing;
|
||||
u8 field_0x3;
|
||||
u8 current_octave;
|
||||
@@ -97,233 +94,245 @@ struct dse_track {
|
||||
u8 field_0x5b;
|
||||
};
|
||||
|
||||
struct dse_voice {
|
||||
u32 field0_0x0;
|
||||
u16 unk_flags_0x4;
|
||||
u16 unk_flags_0x6;
|
||||
u16 field3_0x8;
|
||||
u16 field4_0xa;
|
||||
u8 field5_0xc;
|
||||
u8 key; /* Created by retype action */
|
||||
u8 field7_0xe;
|
||||
u8 field8_0xf;
|
||||
u16 field9_0x10;
|
||||
u16 field10_0x12;
|
||||
s16 field11_0x14;
|
||||
u8 field12_0x16;
|
||||
u8 field13_0x17;
|
||||
u16 field14_0x18;
|
||||
u8 field15_0x1a;
|
||||
u8 field16_0x1b;
|
||||
u32 field17_0x1c;
|
||||
u32 field18_0x20;
|
||||
u32 field19_0x24;
|
||||
u32 field20_0x28;
|
||||
u32 field21_0x2c;
|
||||
u32 field22_0x30;
|
||||
u32 field23_0x34;
|
||||
u32 field24_0x38;
|
||||
struct dse_sound_envelope envelope;
|
||||
struct dse_lfo_bank lfo_bank;
|
||||
u8 field27_0x13c;
|
||||
u8 field28_0x13d;
|
||||
u8 field29_0x13e;
|
||||
u8 field30_0x13f;
|
||||
u8 field31_0x140;
|
||||
u8 field32_0x141;
|
||||
u8 field33_0x142;
|
||||
u8 field34_0x143;
|
||||
u8 field35_0x144;
|
||||
u8 field36_0x145;
|
||||
u8 field37_0x146;
|
||||
u8 field38_0x147;
|
||||
u8 field39_0x148;
|
||||
u8 field40_0x149;
|
||||
u8 field41_0x14a;
|
||||
u8 field42_0x14b;
|
||||
u32 field43_0x14c;
|
||||
u8 field44_0x150;
|
||||
u8 field45_0x151;
|
||||
u8 field46_0x152;
|
||||
u8 field47_0x153;
|
||||
struct dse_voice *next;
|
||||
struct dse_channel *channel;
|
||||
struct dse_sample {
|
||||
u8 field_0x0[3];
|
||||
u8 sample_format;
|
||||
u8 field_0x4[5];
|
||||
u8 psg_duty;
|
||||
u8 field_0xA[10];
|
||||
void* sample_pcm_data;
|
||||
s32 sample_loop_start;
|
||||
s32 sample_size;
|
||||
};
|
||||
|
||||
struct dse_channel_unk_0x74dt {
|
||||
u8 field0_0x0;
|
||||
u8 field1_0x1;
|
||||
u8 field2_0x2;
|
||||
u8 field3_0x3;
|
||||
u32 field4_0x4;
|
||||
u16 field5_0x8;
|
||||
u16 field6_0xa;
|
||||
u16 field7_0xc;
|
||||
u8 field8_0xe;
|
||||
u8 field9_0xf;
|
||||
struct dse_voice {
|
||||
u32 allocated_sequence_id;
|
||||
u16 note_off_flag;
|
||||
u16 update_flags;
|
||||
u16 hw_voice_index;
|
||||
u16 hw_voice_bit;
|
||||
u8 field_0xC;
|
||||
u8 current_note_number;
|
||||
s8 wave_index;
|
||||
u8 key_bend_sensitivity;
|
||||
s16 key_bend;
|
||||
u16 note_key;
|
||||
s16 key_base;
|
||||
u8 note_volume;
|
||||
u8 wave_pan;
|
||||
u16 channel_and_keygroup;
|
||||
u16 field_0x1C;
|
||||
struct dse_sample sample;
|
||||
struct sound_envelope envelope;
|
||||
struct dse_lfo_bank lfo_bank;
|
||||
s32 timer;
|
||||
s32 volume;
|
||||
s32 pan;
|
||||
u32 field_0x148;
|
||||
u8 envelope_volume;
|
||||
u8 field_0x14D[7];
|
||||
struct dse_voice* next_in_channel_allocation_list;
|
||||
struct dse_channel* channel_allocation;
|
||||
};
|
||||
|
||||
struct dse_lfo_settings {
|
||||
u8 field_0x0;
|
||||
u8 type;
|
||||
u8 output_type;
|
||||
u8 lfo_waveform_index;
|
||||
s32 amplitude;
|
||||
u16 lfo_phase_change_msec;
|
||||
u16 msec_until_lfo_started;
|
||||
u16 lfo_envelope_len_msec;
|
||||
};
|
||||
|
||||
struct dse_wavebank {
|
||||
void* file;
|
||||
u16 id;
|
||||
u16 mainbank_id;
|
||||
s16 num_waves;
|
||||
u16 num_instruments;
|
||||
u8 num_keygroups;
|
||||
u8 sample_container_kind;
|
||||
u16 field_0xE;
|
||||
|
||||
void* wavi_chunk_location;
|
||||
void* prgi_chunk_location;
|
||||
void* kgrp_chunk_location;
|
||||
void* pcmd_chunk_location;
|
||||
|
||||
u32 pcm_data_size;
|
||||
|
||||
struct dse_wavebank* next;
|
||||
};
|
||||
|
||||
struct dse_channel {
|
||||
u32 field0_0x0;
|
||||
u8 unk_flags_0x4;
|
||||
u8 field2_0x5;
|
||||
u8 field3_0x6;
|
||||
u8 field4_0x7;
|
||||
u8 field5_0x8;
|
||||
u8 field6_0x9;
|
||||
u16 jitter_range;
|
||||
u8 random_note_min;
|
||||
u8 random_note_max;
|
||||
u16 bank_id;
|
||||
u16 field11_0x10;
|
||||
u8 field12_0x12;
|
||||
u8 field13_0x13;
|
||||
u16 field14_0x14;
|
||||
u16 tune_final;
|
||||
u16 vol_final;
|
||||
u16 pan_final;
|
||||
struct dse_fade tune_fade;
|
||||
struct dse_fade vol_fade;
|
||||
struct dse_fade pan_fade;
|
||||
u8 field21_0x4c;
|
||||
u8 field22_0x4d;
|
||||
u8 field23_0x4e;
|
||||
u8 field24_0x4f;
|
||||
u32 sequence_id;
|
||||
u8 channel_flags;
|
||||
u8 channel_index;
|
||||
u8 field_0x6;
|
||||
u8 field_0x7;
|
||||
u8 field_0x8;
|
||||
s8 total_num_voices;
|
||||
u16 bend_jitter_amplitude;
|
||||
u8 note_random_region_begin;
|
||||
u8 note_random_region_end;
|
||||
u16 swd_id;
|
||||
u16 selected_instrument_index;
|
||||
s16 field_0x12;
|
||||
s16 field_0x14;
|
||||
u16 bend_final;
|
||||
u16 volume_final;
|
||||
s16 pan_final;
|
||||
struct dse_fade bend;
|
||||
struct dse_fade volume;
|
||||
struct dse_fade pan;
|
||||
u32 field_0x4C;
|
||||
u8 expression;
|
||||
s8 field26_0x51;
|
||||
u16 field27_0x52;
|
||||
u16 field28_0x54;
|
||||
u16 field29_0x56;
|
||||
u8 opt_volume; /* Created by retype action */
|
||||
u8 bend_range; /* Created by retype action */
|
||||
u8 field32_0x5a;
|
||||
u8 field33_0x5b;
|
||||
u8 field34_0x5c;
|
||||
u8 field35_0x5d;
|
||||
u8 field36_0x5e;
|
||||
u8 field37_0x5f;
|
||||
u8 field38_0x60;
|
||||
u8 field39_0x61;
|
||||
u8 field40_0x62;
|
||||
u8 field41_0x63;
|
||||
struct dse_sound_envelope_parameters envelope;
|
||||
struct dse_channel_unk_0x74dt field43_0x74[4];
|
||||
struct dse_voice *voices;
|
||||
struct dse_note_node *notes;
|
||||
u32 field46_0xbc;
|
||||
u32 field47_0xc0;
|
||||
u8 lfo_amplitude;
|
||||
s16 key_bend;
|
||||
s16 tuning;
|
||||
s16 field_0x56;
|
||||
u8 optional_volume;
|
||||
u8 bend_sensitivity_override;
|
||||
u8 field_0x5A[10];
|
||||
struct sound_envelope_parameters envelope_override;
|
||||
struct dse_lfo_settings lfo_settings[4];
|
||||
struct dse_voice* voice_list;
|
||||
struct dse_note_list* held_notes_list;
|
||||
struct dse_wavebank* wavebank;
|
||||
struct dse_instrument* instrument;
|
||||
struct dse_synth *container;
|
||||
};
|
||||
|
||||
struct dse_instrument_split {
|
||||
u8 field_0x0;
|
||||
u8 index;
|
||||
u8 bend_sensitivity;
|
||||
u8 field_0x3;
|
||||
u8 min_note_num;
|
||||
u8 max_note_num;
|
||||
u8 field_0x6;
|
||||
u8 field_0x7;
|
||||
u8 min_note_volume;
|
||||
u8 max_note_volume;
|
||||
u8 field_0xC[8];
|
||||
s16 wave_index;
|
||||
s16 key_base;
|
||||
u8 field_0x16;
|
||||
s8 note_delta;
|
||||
u8 volume;
|
||||
u8 pan;
|
||||
u8 keygroup_index;
|
||||
u8 field_0x1B[5];
|
||||
|
||||
struct sound_envelope_parameters envelope_params;
|
||||
};
|
||||
|
||||
struct dse_instrument {
|
||||
u16 field_0x0;
|
||||
u8 num_splits;
|
||||
u8 field_0x3;
|
||||
u8 volume;
|
||||
u8 field_0x5[11];
|
||||
|
||||
struct dse_lfo_settings lfo_settings;
|
||||
u8 field_0x20[16];
|
||||
|
||||
struct dse_instrument_split splits[];
|
||||
};
|
||||
|
||||
struct dse_synth {
|
||||
u8 field0_0x0;
|
||||
u8 n_channels;
|
||||
u8 global_vol;
|
||||
u8 global_vol_idx;
|
||||
u8 field_0x0;
|
||||
u8 num_channels;
|
||||
s8 global_volume;
|
||||
s8 global_volume_index;
|
||||
s16 bend;
|
||||
s8 vol;
|
||||
s8 volume;
|
||||
s8 pan;
|
||||
s8 combined_vol;
|
||||
u8 field8_0x9;
|
||||
u8 field9_0xa;
|
||||
u8 field10_0xb;
|
||||
s8 song_and_global_volume;
|
||||
u8 clear_volume_and_timer;
|
||||
u8 field_0xA;
|
||||
u8 num_voices;
|
||||
struct dse_synth *next;
|
||||
struct dse_channel channels[16]; /* flexible */
|
||||
};
|
||||
|
||||
struct dse_note_parameters {
|
||||
u8 field0_0x0;
|
||||
u8 field_0x0;
|
||||
u8 channel_idx;
|
||||
u8 key;
|
||||
u8 volume;
|
||||
};
|
||||
|
||||
struct dse_note_node {
|
||||
struct dse_note_list {
|
||||
struct dse_note_parameters parameters;
|
||||
s32 duration;
|
||||
struct dse_note_node *next;
|
||||
struct dse_note_list *next;
|
||||
};
|
||||
|
||||
struct dse_seq_unk_0x0 {
|
||||
u8 field0_0x0;
|
||||
u8 field1_0x1;
|
||||
u8 field2_0x2;
|
||||
u8 field3_0x3;
|
||||
struct dse_sequence_unk_0x0 {
|
||||
s8 initialized;
|
||||
s8 is_stopped;
|
||||
s8 restart;
|
||||
u8 has_looped;
|
||||
};
|
||||
|
||||
struct dse_seq_unk_0x4 {
|
||||
u8 field0_0x0;
|
||||
s8 field1_0x1;
|
||||
u8 field2_0x2;
|
||||
u8 field3_0x3;
|
||||
struct dse_sequence_unk_0x4 {
|
||||
s8 is_playing;
|
||||
s8 field_0x1;
|
||||
s8 field_0x2;
|
||||
s8 field_0x3;
|
||||
};
|
||||
|
||||
struct dse_seq_unk_0x8 {
|
||||
s8 field0_0x0;
|
||||
u8 field1_0x1;
|
||||
u8 field2_0x2;
|
||||
u8 field3_0x3;
|
||||
struct dse_sequence_unk_0x8 {
|
||||
s8 field_0x0;
|
||||
s8 field_0x1;
|
||||
s8 field_0x2;
|
||||
u8 field_0x3;
|
||||
};
|
||||
|
||||
struct dse_seq {
|
||||
struct dse_seq_unk_0x0 field0_0x0;
|
||||
struct dse_seq_unk_0x4 field1_0x4;
|
||||
struct dse_seq_unk_0x8 field2_0x8;
|
||||
u8 unk_flags_0xc;
|
||||
u8 n_active_tracks;
|
||||
u8 field5_0xe;
|
||||
u8 n_tracks;
|
||||
u8 n_channels;
|
||||
u8 field8_0x11;
|
||||
u8 field9_0x12;
|
||||
u8 field10_0x13;
|
||||
u8 field11_0x14;
|
||||
u8 field12_0x15;
|
||||
u8 field13_0x16;
|
||||
struct dse_sequence {
|
||||
struct dse_sequence_unk_0x0 field_0x0;
|
||||
struct dse_sequence_unk_0x4 field_0x4;
|
||||
struct dse_sequence_unk_0x8 field_0x8;
|
||||
u8 active_fades_flags;
|
||||
u8 num_tracks_playing;
|
||||
s8 num_tracks;
|
||||
s8 num_tracks_2;
|
||||
s8 num_channels;
|
||||
u8 field_0x11;
|
||||
u8 field_0x12;
|
||||
u8 global_volume_index;
|
||||
u8 effect_id;
|
||||
u8 seq_ticks_per_eighth_beat;
|
||||
u8 field_0x16;
|
||||
u8 bpm;
|
||||
u8 field15_0x18;
|
||||
u8 field16_0x19;
|
||||
s16 field17_0x1a;
|
||||
u8 *seq_file;
|
||||
u8 *field19_0x20;
|
||||
struct dse_synth *synth;
|
||||
u32 id;
|
||||
u16 field22_0x2c;
|
||||
u8 field23_0x2e;
|
||||
u8 field24_0x2f;
|
||||
u32 field25_0x30;
|
||||
u32 field26_0x34;
|
||||
u32 field27_0x38;
|
||||
u32 field28_0x3c;
|
||||
u32 field29_0x40;
|
||||
s32 us_per_standard_qn; /* us per 256 ticks */
|
||||
struct dse_fade tpqn_fade;
|
||||
struct dse_fade bend_fade;
|
||||
struct dse_fade vol_fade;
|
||||
struct dse_fade pan_fade;
|
||||
u8 field35_0x88;
|
||||
u8 field36_0x89;
|
||||
u8 field37_0x8a;
|
||||
u8 field38_0x8b;
|
||||
u8 field39_0x8c;
|
||||
u8 field40_0x8d;
|
||||
u8 field41_0x8e;
|
||||
u8 field42_0x8f;
|
||||
u8 field43_0x90;
|
||||
u8 field44_0x91;
|
||||
u8 field45_0x92;
|
||||
u8 field46_0x93;
|
||||
u8 field47_0x94;
|
||||
u8 field48_0x95;
|
||||
u8 field49_0x96;
|
||||
u8 field50_0x97;
|
||||
s8 field51_0x98;
|
||||
u8 field52_0x99;
|
||||
u8 field53_0x9a;
|
||||
u8 field54_0x9b;
|
||||
void (*unk_callback)(u32, u32, u32, u32);
|
||||
u32 field56_0xa0;
|
||||
struct dse_seq *next;
|
||||
u8 field_0x18;
|
||||
u8 field_0x19;
|
||||
s16 ticks_until_update;
|
||||
u8* file;
|
||||
u8* field_0x20;
|
||||
struct dse_synth* synth;
|
||||
s32 id;
|
||||
u16 field_0x2C;
|
||||
u16 field_0x2E;
|
||||
s32 total_driver_ticks_at_reset;
|
||||
s32 field_0x34;
|
||||
s32 seq_tick_counter;
|
||||
s32 time_since_last_seq_tick;
|
||||
s32 beatsplit_times_ticktime;
|
||||
s32 microseconds_per_beat; /* us per 256 ticks */
|
||||
struct dse_fade tempo;
|
||||
struct dse_fade bend;
|
||||
struct dse_fade volume;
|
||||
struct dse_fade pan;
|
||||
u8 field_0x88[16];
|
||||
s8 volume_fade_target;
|
||||
u8 field_0x99[3];
|
||||
void (*signal_callback)(u32, u32, u32, void*);
|
||||
void* callback_arg;
|
||||
struct dse_sequence* next;
|
||||
struct dse_track tracks[16];
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
#include "dse.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_sequence *sequence, struct dse_track *track, struct dse_channel *channel);
|
||||
|
||||
#endif //PMDSKY_MAIN_02071A98_H
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
#include "dse.h"
|
||||
|
||||
u8* DseTrackEvent_SetInstrument(u8 *cur, struct dse_seq *seq, struct dse_track *trk, struct dse_channel *chn);
|
||||
u8* DseTrackEvent_SetInstrument(u8 *cur, struct dse_sequence *seq, struct dse_track *trk, struct dse_channel *chn);
|
||||
|
||||
#endif //PMDSKY_MAIN_02071BF4_H
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "main_02071A98.h"
|
||||
|
||||
u8* DseTrackEvent_SubLoopBreakOnLastIteration(u8 *ptr_next_byte, struct dse_seq *sequence, struct dse_track *track, struct dse_channel *channel)
|
||||
u8* DseTrackEvent_SubLoopBreakOnLastIteration(u8 *ptr_next_byte, struct dse_sequence *sequence, struct dse_track *track, struct dse_channel *channel)
|
||||
{
|
||||
u8 n = track->loop_stack_index;
|
||||
struct dse_sub_loop *last_loop = &track->loop_stack[n-1];
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
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)
|
||||
u8* DseTrackEvent_SetInstrument(u8 *ptr_next_byte, struct dse_sequence *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);
|
||||
sequence->signal_callback(sequence->id,-0xcc,(u32)(u16)channel->swd_id * 0x10000 - iVar1,sequence->callback_arg);
|
||||
}
|
||||
return ptr_next_byte + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user