X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=platform%2Fgp2x%2Fcode940%2F940shared.h;fp=platform%2Fgp2x%2F940shared.h;h=cc5d0c4ad29d545cae194341cab7e87f4c767213;hb=42c7b14797fad5ad8adc822e8d0cebf326eb620b;hp=bad0f3c2ea020f1d0645611204c022999b93c782;hpb=b837b69b3fcff1737431c8be1c78d1cfd64003a6;p=picodrive.git diff --git a/platform/gp2x/940shared.h b/platform/gp2x/code940/940shared.h similarity index 52% rename from platform/gp2x/940shared.h rename to platform/gp2x/code940/940shared.h index bad0f3c..cc5d0c4 100644 --- a/platform/gp2x/940shared.h +++ b/platform/gp2x/code940/940shared.h @@ -1,10 +1,12 @@ -#include "../../Pico/sound/ym2612.h" +#include "../../../Pico/sound/ym2612.h" +#include "../helix/pub/mp3dec.h" enum _940_job_t { - JOB940_YM2612INIT = 1, + JOB940_INITALL = 1, JOB940_YM2612RESETCHIP, JOB940_YM2612UPDATEONE, JOB940_PICOSTATELOAD, + JOB940_MP3DECODE, JOB940_NUMJOBS }; @@ -12,9 +14,10 @@ enum _940_job_t { typedef struct { - YM2612 ym2612; /* current state of the emulated YM2612 */ - int mix_buffer[44100/50*2]; /* this is where the YM2612 samples will be mixed to */ - short mp3_buffer[2][1152*2]; /* buffer for mp3 decoder's output */ + YM2612 ym2612; /* current state of the emulated YM2612 */ + HMP3Decoder mp3dec; /* mp3 decoder's handle */ + int mix_buffer[44100/50*2]; /* this is where the YM2612 samples will be mixed to */ + short mp3_buffer[2][1152*2]; /* buffers for mp3 decoder's output */ } _940_data_t; @@ -29,7 +32,11 @@ typedef struct int writebuffsel; /* which write buffer to use (from 940 side) */ UINT16 writebuff0[2048]; /* list of writes to ym2612, 1024 for savestates, 1024 extra */ UINT16 writebuff1[2048]; + int mp3_len; /* data len of loaded mp3 */ + int mp3_offs; /* current playback offset (just after last decoded frame) */ + int mp3_buffsel; /* which output buffer to decode to */ int vstarts[8]; /* debug: number of starts from each of 8 vectors */ int loopc; /* debug: main loop counter */ - int waitc; /* debug: wait loop counter */ + int mp3_errors; /* debug: mp3 decoder's error counter */ + int mp3_lasterr; /* debug: mp3 decoder's last error */ } _940_ctl_t;