1 #include "../../../pico/sound/ym2612.h" 2 3 // max 16 jobs, lower num means higher prio 4 enum _940_job_t { 5 JOB940_INITALL = 1, 6 JOB940_INVALIDATE_DCACHE, 7 JOB940_YM2612RESETCHIP, 8 JOB940_YM2612UPDATEONE, 9 JOB940_MP3DECODE, 10 JOB940_PICOSTATELOAD, 11 JOB940_PICOSTATESAVE2, 12 JOB940_PICOSTATELOAD2_PREP, 13 JOB940_PICOSTATELOAD2, 14 JOB940_MP3RESET, 15 }; 16 17 //#define MAX_940JOBS 2 18 19 typedef struct 20 { 21 YM2612 ym2612; /* current state of the emulated YM2612 */ 22 void *mp3dec; /* mp3 decoder's handle */ 23 int ym_buffer[44100/50*2]; /* this is where the YM2612 samples will be mixed to */ 24 short mp3_buffer[2][1152*2]; /* buffers for mp3 decoder's output */ 25 } _940_data_t; 26 27 28 typedef struct 29 { 30 int vstarts[8]; /* debug: 00: number of starts from each of 8 vectors */ 31 int last_lr; /* debug: 20: last exception's lr */ 32 // int jobs[MAX_940JOBS]; /* jobs for second core */ 33 // int busy_; /* unused */ 34 int length; /* number of samples to mix (882 max) */ 35 int stereo; /* mix samples as stereo, doubles sample count automatically */ 36 int baseclock; /* ym2612 settings */ 37 int rate; 38 int writebuffsel; /* which write buffer to use (from 940 side) */ 39 UINT16 writebuff0[2048]; /* list of writes to ym2612, 1024 for savestates, 1024 extra */ 40 UINT16 writebuff1[2048]; 41 int ym_active_chs; 42 int mp3_len; /* data len of loaded mp3 */ 43 int mp3_offs; /* current playback offset (just after last decoded frame) */ 44 int mp3_buffsel; /* which output buffer to decode to */ 45 int loopc; /* debug: main loop counter */ 46 int mp3_errors; /* debug: mp3 decoder's error counter */ 47 int mp3_lasterr; /* debug: mp3 decoder's last error */ 48 int lastjob; /* debug: last job id */ 49 } _940_ctl_t; 50