Compare commits

...

3 Commits

5 changed files with 15 additions and 8 deletions

View File

@ -1,6 +1,6 @@
all: xm_player.elf
OPT = -O2
OPT = -O1
MAKEFILE_PATH := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
LIB ?= $(MAKEFILE_PATH)/dreamcast

View File

@ -249,7 +249,11 @@ void interrupt()
break;
}
*/
if (state.channel[ch].keyon == 255) {
const int keyon_tick = 254;
if (state.channel[ch].keyon > keyon_tick) {
state.channel[ch].keyon -= 1;
}
else if (state.channel[ch].keyon == keyon_tick) {
wait(); aica_sound.channel[ch].KYONB(1);
state.channel[ch].keyon -= 1;
}
@ -261,7 +265,7 @@ void interrupt()
}
for (int ch = 0; ch < 64; ch++) {
int keyon = state.channel[ch].keyon;
if (keyon != 255 && keyon != 0) {
if (keyon != 0) {
state.channel[ch].keyon -= 1;
}
}
@ -366,12 +370,12 @@ const int sample_data_length = (sizeof (sample_data));
void deferred_load(int buf)
{
state.deferred_load_tick = 44100 / 2;
const float aica_clock_multiplier = 44.1 / 3;
state.deferred_load_tick = aica_clock_multiplier * 1000 / 2;
stop_sound();
const float aica_clock_multiplier = 44.1;
state.sample_data_ix = xm_init(&interpreter::state.xm,
buf,
sample_data,

View File

@ -44,7 +44,7 @@ void vbr600()
wait(); aica_sound.common.mcire = (1 << 6); // interrupt timer A
wait(); aica_sound.common.tactl_tima =
aica::tactl_tima::TACTL(0) // increment once every sample
| aica::tactl_tima::TIMA(0xffff) // interrupt after 1 counts
| aica::tactl_tima::TIMA(0xfffd) // interrupt after 3 counts
;
//scene::logo::sound::interrupt();
@ -108,6 +108,7 @@ void main()
system.IML6NRM = istnrm::end_of_render_tsp
| istnrm::v_blank_in
| istnrm::end_of_transferring_punch_through_list
| istnrm::end_of_transferring_opaque_list;
system.IML4EXT = istext::aica;

View File

@ -64,6 +64,8 @@ void draw(ta_multiwriter& multi, int x, int y)
int keyon = 128 * (state.channel[ch].keyon - 224) / 16;
if (keyon < 0) keyon = 0;
if (keyon != 0)
printf("%d %d\n", state.channel[ch].keyon, keyon);
uint32_t base_color = (keyon << 16) | (keyon << 8) | (keyon << 0);
transfer_rectangle(multi.op,
xi, y, 1.0 / 10000.0,

View File

@ -131,7 +131,7 @@ void init()
wait(); aica_sound.common.tactl_tima =
aica::tactl_tima::TACTL(0) // increment once every sample
| aica::tactl_tima::TIMA(0xffff) // interrupt after 1 counts
| aica::tactl_tima::TIMA(0xfffd) // interrupt after 3 counts
;
wait(); aica_sound.common.mcieb = (1 << 6); // interrupt timer A