Compare commits

...

3 Commits

4 changed files with 12 additions and 9 deletions

View File

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

View File

@ -249,10 +249,12 @@ void interrupt()
break; break;
} }
*/ */
if (state.channel[ch].keyon == 255) { if (state.channel[ch].keyon > 128) {
wait(); aica_sound.channel[ch].KYONB(1);
state.channel[ch].keyon -= 1; state.channel[ch].keyon -= 1;
} }
if (state.channel[ch].keyon == 128) {
wait(); aica_sound.channel[ch].KYONB(1);
}
} }
wait(); aica_sound.channel[0].KYONEX(1); wait(); aica_sound.channel[0].KYONEX(1);
@ -261,7 +263,7 @@ void interrupt()
} }
for (int ch = 0; ch < 64; ch++) { for (int ch = 0; ch < 64; ch++) {
int keyon = state.channel[ch].keyon; int keyon = state.channel[ch].keyon;
if (keyon != 255 && keyon != 0) { if (keyon < 128 && keyon != 0) {
state.channel[ch].keyon -= 1; state.channel[ch].keyon -= 1;
} }
} }
@ -366,12 +368,12 @@ const int sample_data_length = (sizeof (sample_data));
void deferred_load(int buf) 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(); stop_sound();
const float aica_clock_multiplier = 44.1;
state.sample_data_ix = xm_init(&interpreter::state.xm, state.sample_data_ix = xm_init(&interpreter::state.xm,
buf, buf,
sample_data, sample_data,

View File

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

View File

@ -131,7 +131,7 @@ void init()
wait(); aica_sound.common.tactl_tima = wait(); aica_sound.common.tactl_tima =
aica::tactl_tima::TACTL(0) // increment once every sample 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 wait(); aica_sound.common.mcieb = (1 << 6); // interrupt timer A