diff --git a/.gitignore b/.gitignore index 2e1177e..ca0d302 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ **/.DS_Store -**/.vscode +**/.vscode/settings.json **/*.bak **/*.zip diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..6c42d76 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,58 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Build SW and Update", + "type": "python", + "request": "launch", + "program": "sw/pc/sc64.py", + "preLaunchTask": "build", + "args": [ + "-u", "fw/output_files/SC64_update.bin", + ] + }, + { + "name": "Build FW & SW and Update", + "type": "python", + "request": "launch", + "program": "sw/pc/sc64.py", + "preLaunchTask": "build_full", + "args": [ + "-u", "fw/output_files/SC64_update.bin", + ] + }, + { + "name": "Run menu from SD with debug output", + "type": "python", + "request": "launch", + "program": "sw/pc/sc64.py", + "args": [ + "-b", "0", + "-q", + ] + }, + { + "name": "Run menu from USB with debug output", + "type": "python", + "request": "launch", + "program": "sw/pc/sc64.py", + "console": "integratedTerminal", + "linux": { + "args": [ + "-f", "/dev/ttyUSB0", + "-b", "3", + "-q", + "sw/n64/build/n64boot.bin", + ] + }, + "windows": { + "args": [ + "-f", "\\\\.\\D:", + "-b", "3", + "-q", + "sw/n64/build/n64boot.bin", + ] + } + }, + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..13088f3 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,35 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "./docker_build.sh update -s -c -d", + "windows":{ + "command": "wsl -- ./docker_build.sh update -s -c -d" + }, + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "build_full", + "type": "shell", + "command": "./docker_build.sh release -c -d", + "windows": { + "command": "wsl -- ./docker_build.sh update -c -d" + }, + "group": "build" + }, + { + "label": "build_n64_bootloader", + "type": "shell", + "command": "./docker_build.sh n64 -d", + "windows": { + "command": "wsl -- ./docker_build.sh n64 -d" + }, + "group": "build" + } + ] +} \ No newline at end of file diff --git a/sw/n64/src/main.c b/sw/n64/src/main.c index 8efaf7e..509df70 100644 --- a/sw/n64/src/main.c +++ b/sw/n64/src/main.c @@ -30,7 +30,7 @@ void main (void) { break; case BOOT_MODE_DIRECT: - LOG_I("Running bootloader from SDRAM - running menu from FSD\r\n"); + LOG_I("Running menu from USB\r\n"); storage_run_menu(STORAGE_BACKEND_USB, &boot_info, &sc64_info); break; diff --git a/sw/pc/sc64.py b/sw/pc/sc64.py index c473561..3797cb3 100644 --- a/sw/pc/sc64.py +++ b/sw/pc/sc64.py @@ -590,7 +590,7 @@ class SC64: if (self.__disk_file): self.__disk_file.seek(disk_file_offset) if (transfer_mode): - time.sleep(0.01) # Fixes weird bug in Mario Artist Paint Studio minigame + time.sleep(0.016) # Fixes weird bug in Mario Artist Paint Studio minigame self.__write_cmd("S", sdram_offset, block_length) self.__write(self.__disk_file.read(block_length)) else: @@ -821,6 +821,9 @@ if __name__ == "__main__": sc64.upload_save(save_file) if (debug_server): + sc64.debug_init(sd_file, disk_file, is_viewer_enabled) + if (is_viewer_enabled): + print(f"Setting IS-Viewer 64 emulation to [Enabled]") if (sd_file): print(f"Using fake SD emulation file [{sd_file}]") if (disk_file): @@ -828,9 +831,6 @@ if __name__ == "__main__": sc64.set_dd_configuration_for_disk(disk_file) print(f"Setting 64DD disk state to [Changed]") sc64.set_dd_disk_state("changed" if disk_file else "ejected") - if (is_viewer_enabled): - print(f"Setting IS-Viewer 64 emulation to [Enabled]") - sc64.debug_init(sd_file, disk_file, is_viewer_enabled) sc64.debug_loop() except SC64Exception as e: