From 4a3108e1decbeadd2981ae3649c004596c4d3c58 Mon Sep 17 00:00:00 2001 From: Polprzewodnikowy Date: Tue, 30 Nov 2021 01:31:24 +0100 Subject: [PATCH] better --- build.sh | 4 ++-- sw/n64/src/main.c | 2 +- sw/n64/src/{ => old}/boot.c | 0 sw/n64/src/{ => old}/boot.h | 0 sw/n64/src/{ => old}/n64_regs.h | 0 sw/n64/src/sc64.c | 6 +++--- sw/n64/src/sc64.h | 4 ++-- sw/n64/src/sys.h | 1 - 8 files changed, 8 insertions(+), 9 deletions(-) rename sw/n64/src/{ => old}/boot.c (100%) rename sw/n64/src/{ => old}/boot.h (100%) rename sw/n64/src/{ => old}/n64_regs.h (100%) diff --git a/build.sh b/build.sh index 05fd66b..a240f1f 100755 --- a/build.sh +++ b/build.sh @@ -52,9 +52,9 @@ build_riscv () { pushd sw/riscv > /dev/null if [ "$FORCE_CLEAN" = true ]; then - make clean -j + make clean fi - make all USER_FLAGS="$USER_FLAGS" + make all -j USER_FLAGS="$USER_FLAGS" popd > /dev/null BUILT_RISCV=true diff --git a/sw/n64/src/main.c b/sw/n64/src/main.c index dc4f7d7..de9946a 100644 --- a/sw/n64/src/main.c +++ b/sw/n64/src/main.c @@ -24,7 +24,7 @@ void main(void) { LOG_I(" Mask ROM version: %d\r\n", header.version); LOG_I("\r\n"); - info_t info; + cart_info_t info; sc64_get_info(&info); diff --git a/sw/n64/src/boot.c b/sw/n64/src/old/boot.c similarity index 100% rename from sw/n64/src/boot.c rename to sw/n64/src/old/boot.c diff --git a/sw/n64/src/boot.h b/sw/n64/src/old/boot.h similarity index 100% rename from sw/n64/src/boot.h rename to sw/n64/src/old/boot.h diff --git a/sw/n64/src/n64_regs.h b/sw/n64/src/old/n64_regs.h similarity index 100% rename from sw/n64/src/n64_regs.h rename to sw/n64/src/old/n64_regs.h diff --git a/sw/n64/src/sc64.c b/sw/n64/src/sc64.c index f89b98e..64e75b7 100644 --- a/sw/n64/src/sc64.c +++ b/sw/n64/src/sc64.c @@ -46,7 +46,7 @@ void sc64_set_config(cfg_id_t id, uint32_t value) { sc64_perform_cmd(SC64_CMD_CONFIG, args, NULL); } -void sc64_get_info(info_t *info) { +void sc64_get_info(cart_info_t *info) { io32_t *src = UNCACHED(&header_text_info); uint32_t *dst = (uint32_t *) info->bootloader_version; @@ -60,8 +60,8 @@ void sc64_get_info(info_t *info) { info->save_type = (save_type_t) sc64_get_config(CFG_ID_SAVE_TYPE); info->cic_seed = (uint8_t) sc64_get_config(CFG_ID_CIC_SEED); info->tv_type = (tv_type_t) sc64_get_config(CFG_ID_TV_TYPE); - info->save_offset = (io32_t *) sc64_get_config(CFG_ID_SAVE_OFFEST); - info->dd_offset = (io32_t *) sc64_get_config(CFG_ID_DD_OFFEST); + info->save_offset = (io32_t *) (0x10000000 | sc64_get_config(CFG_ID_SAVE_OFFEST)); + info->dd_offset = (io32_t *) (0x10000000 | sc64_get_config(CFG_ID_DD_OFFEST)); info->boot_mode = (boot_mode_t) sc64_get_config(CFG_ID_BOOT_MODE); } diff --git a/sw/n64/src/sc64.h b/sw/n64/src/sc64.h index 4c142fb..a055cbb 100644 --- a/sw/n64/src/sc64.h +++ b/sw/n64/src/sc64.h @@ -95,7 +95,7 @@ typedef struct { io32_t *dd_offset; boot_mode_t boot_mode; char bootloader_version[32]; -} info_t; +} cart_info_t; extern char header_text_info; @@ -107,7 +107,7 @@ bool sc64_wait_cpu_busy(void); bool sc64_perform_cmd(uint8_t cmd, uint32_t *args, uint32_t *result); uint32_t sc64_get_config(cfg_id_t id); void sc64_set_config(cfg_id_t id, uint32_t value); -void sc64_get_info(info_t *info); +void sc64_get_info(cart_info_t *info); void sc64_wait_usb_tx_ready(void); void sc64_usb_tx_data(io32_t *address, uint32_t length); void sc64_debug_write(uint8_t type, const void *data, uint32_t len); diff --git a/sw/n64/src/sys.h b/sw/n64/src/sys.h index 43e2060..da74134 100644 --- a/sw/n64/src/sys.h +++ b/sw/n64/src/sys.h @@ -107,7 +107,6 @@ typedef struct { #define PIFRAM ((io8_t *) PIFRAM_BASE) - void wait_ms(uint32_t ms); uint32_t io_read(io32_t *address); void io_write(io32_t *address, uint32_t value);