fixes for ymfm

This commit is contained in:
Ian Scott committed 2023-08-06 21:41:51 -05:00
1 parent 8e03d453f2
commit 33d55617f9
3 files changed
+15 -12

No files matched your search

+8 -6
View File
@@ -14,7 +14,7 @@ include(pico_sdk_import.cmake)
include(pico_extras_import.cmake)
project(picogus
VERSION "0.7.0"
VERSION "0.7.99"
LANGUAGES C CXX ASM
)
@@ -101,6 +101,7 @@ if(PROJECT_TYPE STREQUAL "OPL")
target_link_libraries(
picogus
ymfm
# opl
)
target_compile_definitions(picogus PRIVATE
SOUND_OPL=1
@@ -108,12 +109,13 @@ if(PROJECT_TYPE STREQUAL "OPL")
# USE_EMU8950_OPL=1
# EMU8950_ASM=1
)
set(ASYNC_UART 1)
add_compile_definitions(
ASYNC_UART=1
)
set(ASYNC_UART 0)
# add_compile_definitions(
# ASYNC_UART=1
# )
add_subdirectory(ymfm)
pico_enable_stdio_uart(picogus 0)
# add_subdirectory(opl)
pico_enable_stdio_uart(picogus 1)
pico_enable_stdio_usb(picogus 0)
pico_enable_stdio_semihosting(picogus 0)
endif()
+3 -3
View File
@@ -38,7 +38,7 @@ bi_decl(bi_3pins_with_names(PICO_AUDIO_I2S_DATA_PIN, "I2S DIN", PICO_AUDIO_I2S_C
struct audio_buffer_pool *init_audio() {
static audio_format_t audio_format = {
.sample_freq = 49716 / 3,
.sample_freq = 49716,
.format = AUDIO_BUFFER_FORMAT_PCM_S16,
.channel_count = 2,
};
@@ -92,11 +92,11 @@ void play_adlib() {
samples[i << 1] = output.data[0];
samples[(i << 1) + 1] = output.data[1];
}
uint32_t audio_elapsed = time_us_32() - audio_begin;
// uint32_t audio_elapsed = time_us_32() - audio_begin;
// if (audio_elapsed > 1280) {
// printf("took too long: %u %u\n", audio_elapsed, buffer->max_sample_count);
// }
printf("%u ", audio_elapsed);
// printf("%u ", audio_elapsed);
buffer->sample_count = buffer->max_sample_count;
// putchar('=');
#else
+4 -3
View File
@@ -280,9 +280,9 @@ __force_inline void handle_iow(void) {
myOPL->write_address(iow_read & 0xFF);
*/
opl_addr = iow_read & 0xFF;
#else
#else // OPL_YMFM
OPL_Pico_PortWrite(OPL_REGISTER_PORT, iow_read & 0xFF);
#endif
#endif // OPL_YMFM
// Fast write - return early as we've already written 0x0u to the PIO
return;
break;
@@ -293,8 +293,9 @@ __force_inline void handle_iow(void) {
myOPL->write_address(opl_addr);
myOPL->write_data(iow_read & 0xFF);
critical_section_exit(&opl_crit);
#else
#else // OPL_YMFM
OPL_Pico_PortWrite(OPL_DATA_PORT, iow_read & 0xFF);
#endif // OPL_YMFM
// __dsb();
break;
#ifdef OPL_YMFM