#include "xm.h"
#include "xm/milkypack01.xm.h"

const float aica_clock_multiplier = 44.1;

namespace playlist {

  static playlist_item playlist[] = {
    {
      "milkypack01"
    }
  };


  void load_xm(float clock_multiplier, int buf)
  {
    using namespace interpreter;

    static uint8_t __attribute__((aligned(32))) sample_data[1024 * 1024 * 2];
    const int sample_data_length = (sizeof (sample_data));

    interpreter::pause();

    int sample_data_ix = xm_init(&state.xm,
                                 buf,
                                 sample_data,
                                 sample_data_length);
    interpreter::init(clock_multiplier);
    sound::transfer(sample_data, sample_data_ix);
    //printf("tick_rate %d\n", state.tick_rate);

    interpreter::resume();
  }
}
