From 1f31e497e2743ef434c171054d0a22660e1b86c7 Mon Sep 17 00:00:00 2001 From: nukeykt Date: Thu, 11 Apr 2024 01:45:02 +0900 Subject: [PATCH] update readme, fix sc-55st, bump version --- CMakeLists.txt | 2 +- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++----- src/lcd.cpp | 2 +- src/mcu.cpp | 27 ++++++++++-------------- src/mcu.h | 1 + src/pcm.h | 1 + 6 files changed, 66 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52710fab..34a53bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.2...3.5) -project (NukedSC55 VERSION 0.1.1 LANGUAGES CXX) +project (NukedSC55 VERSION 0.2.0 LANGUAGES CXX) include(FindPkgConfig) include(GNUInstallDirs) diff --git a/README.md b/README.md index b24533d5..66f5e861 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Nuked SC-55 -Roland SC-55mkII emulator, by nukeykt. +Roland SC-55 emulator, by nukeykt. + +Supported models: +- SC-55mk2 (v1.01 firmware is confirmed to work) +- SC-55mk1 (v1.21/v2.0 firmwares are confirmed to work) +- CM-300/SCC-1 (v1.10/v1.20 firmwares are confirmed to work) +- SC-55st (v1.01) Special thanks: - John McMaster: SC-55 PCM chip decap. @@ -31,13 +37,51 @@ MCUs are emulated using info from their datasheets. PCM chip info is derived fro ## Install -Put SC-55mkII firmware image into the same folder as Nuked SC-55. Files should be names as such: +Put firmware image into the same folder as Nuked SC-55. Files should be names as such: + ``` +SC-55mk2 (v1.01): R15199858 (H8/532 mcu) -> rom1.bin R00233567 (H8/532 extra code) -> rom2.bin R15199880 (M37450M2 mcu) -> rom_sm.bin R15209359 (WAVE 16M) -> waverom1.bin R15279813 (WAVE 8M) -> waverom2.bin + +SC-55st (v1.01): +R15199858 (H8/532 mcu) -> rom1.bin +R00561413 (H8/532 extra code) -> rom2_st.bin +R15199880 (M37450M2 mcu) -> rom_sm.bin +R15209359 (WAVE 16M) -> waverom1.bin +R15279813 (WAVE 8M) -> waverom2.bin + +SC-55 (v1.21): +R15199778 (H8/532 mcu) -> sc55_rom1.bin +R15209363 (H8/532 extra code) -> sc55_rom2.bin +R15209276 (WAVE A) -> sc55_waverom1.bin +R15209277 (WAVE B) -> sc55_waverom2.bin +R15209281 (WAVE C) -> sc55_waverom3.bin + +SC-55 (v2.0): +R15199799 (H8/532 mcu) -> sc55_rom1.bin +R15209387 (H8/532 extra code) -> sc55_rom2.bin +R15209276 (WAVE A) -> sc55_waverom1.bin +R15209277 (WAVE B) -> sc55_waverom2.bin +R15209281 (WAVE C) -> sc55_waverom3.bin + +CM-300/SCC-1 (v1.10): +R15199774 (H8/532 mcu) -> cm300_rom1.bin +R15279809 (H8/532 extra code) -> cm300_rom2.bin +R15279806 (WAVE A) -> cm300_waverom1.bin +R15279807 (WAVE B) -> cm300_waverom2.bin +R15279808 (WAVE C) -> cm300_waverom3.bin + +CM-300/SCC-1 (v1.20): +R15199774 (H8/532 mcu) -> cm300_rom1.bin +R15279812 (H8/532 extra code) -> cm300_rom2.bin +R15279806 (WAVE A) -> cm300_waverom1.bin +R15279807 (WAVE B) -> cm300_waverom2.bin +R15279808 (WAVE C) -> cm300_waverom3.bin + ``` ## License @@ -47,9 +91,9 @@ Non-commercial license was chosen to prevent making and selling SC-55 emulation ## Additional info -- Nuked SC-55 will listen to the specified MIDI IN port (default is port 0). Use '-p:' command line argument to specify port number. To use it with the other applications use external MIDI pipe software (e.g. loopMIDI). +- Nuked SC-55 will listen to the specified MIDI IN port (default is port 0). Use `-p:` command line argument to specify port number. To use it with the other applications use external MIDI pipe software (e.g. loopMIDI). -- SC-55mkII buttons are mapped as such (currently hardcoded): +- SC-55mk2/SC-55mk1 buttons are mapped as such (currently hardcoded): ``` Q -> POWER @@ -75,4 +119,6 @@ LEFT -> PART L RIGHT -> PART R ``` -- Due to a bug in the SC-55mkII's firmware, some parameters don't reset properly on startup. Do GM, GS or MT-32 reset using buttons to fix this issue. +- `-mk2`, `-st`, `mk1` and `-cm300` command line arguments can be used to specify rom set. If no model is specified emulator will try to autodetect rom set (based on file names). + +- Due to a bug in the SC-55mk2's firmware, some parameters don't reset properly on startup. Do GM, GS or MT-32 reset using buttons to fix this issue. diff --git a/src/lcd.cpp b/src/lcd.cpp index 16f1127e..04487277 100644 --- a/src/lcd.cpp +++ b/src/lcd.cpp @@ -322,7 +322,7 @@ void LCD_Update(void) if (!lcd_init) return; - if (!mcu_cm300) + if (!mcu_cm300 && !mcu_st) { MCU_WorkThread_Lock(); diff --git a/src/mcu.cpp b/src/mcu.cpp index 86946e24..25e60081 100644 --- a/src/mcu.cpp +++ b/src/mcu.cpp @@ -111,6 +111,7 @@ void MCU_ErrorTrap(void) int mcu_mk1 = 0; // 0 - SC-55mkII, SC-55ST. 1 - SC-55, CM-300/SCC-1 int mcu_cm300 = 0; // 0 - SC-55, 1 - CM-300/SCC-1 +int mcu_st = 0; // 0 - SC-55mk2, 1 - SC-55ST static int ga_int[8]; static int ga_int_enable = 0; @@ -866,6 +867,10 @@ int SDLCALL work_thread(void* data) MCU_WorkThread_Lock(); while (work_thread_run) { + if (pcm.config_reg_3c & 0x40) + sample_write_ptr &= ~3; + else + sample_write_ptr &= ~1; if (sample_read_ptr == sample_write_ptr) { MCU_WorkThread_Unlock(); @@ -1226,28 +1231,18 @@ int main(int argc, char *argv[]) } printf("ROM set autodetect: %s\n", rs_name[romset]); } - else - { - if (mcu_mk1) - { - if (mcu_cm300) - romset = ROM_SET_CM300; - else - romset = ROM_SET_MK2; - } - } - + + mcu_mk1 = false; + mcu_cm300 = false; + mcu_st = false; switch (romset) { - case ROM_SET_MK2: case ROM_SET_ST: - default: - mcu_mk1 = false; - mcu_cm300 = false; + mcu_st = true; break; case ROM_SET_MK1: mcu_mk1 = true; - mcu_cm300 = false; + mcu_st = false; break; case ROM_SET_CM300: mcu_mk1 = true; diff --git a/src/mcu.h b/src/mcu.h index 5e539b50..84c4a1f5 100644 --- a/src/mcu.h +++ b/src/mcu.h @@ -409,6 +409,7 @@ extern int romset; extern int mcu_mk1; extern int mcu_cm300; +extern int mcu_st; extern SDL_atomic_t mcu_button_pressed; diff --git a/src/pcm.h b/src/pcm.h index 165b52e6..7f136c80 100644 --- a/src/pcm.h +++ b/src/pcm.h @@ -63,6 +63,7 @@ struct pcm_t { int rcsum[2]; }; +extern pcm_t pcm; extern uint8_t waverom1[]; extern uint8_t waverom2[]; extern uint8_t waverom3[];