940shared.h 1.7 KB

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