diff --git a/sw/n64/src/sc64.c b/sw/n64/src/sc64.c index cec5b81..f89b98e 100644 --- a/sw/n64/src/sc64.c +++ b/sw/n64/src/sc64.c @@ -47,15 +47,13 @@ void sc64_set_config(cfg_id_t id, uint32_t value) { } void sc64_get_info(info_t *info) { - io32_t *src = UNCACHED(SC64_BL_VERSION_BASE); + io32_t *src = UNCACHED(&header_text_info); uint32_t *dst = (uint32_t *) info->bootloader_version; sc64_set_config(CFG_ID_SDRAM_SWITCH, false); - for (int i = 0; i < sizeof(info->bootloader_version); i += sizeof(uint32_t)) { *dst++ = pi_io_read(src++); } - sc64_set_config(CFG_ID_SDRAM_SWITCH, true); info->dd_enabled = (bool) sc64_get_config(CFG_ID_DD_ENABLE); diff --git a/sw/n64/src/sc64.h b/sw/n64/src/sc64.h index de62173..4c142fb 100644 --- a/sw/n64/src/sc64.h +++ b/sw/n64/src/sc64.h @@ -18,11 +18,6 @@ #endif -extern char *header_text_info; - -#define SC64_BL_VERSION_BASE (PHYSICAL((io32_t *) (header_text_info))) - - typedef struct { io32_t SR_CMD; io32_t DATA[2]; @@ -103,6 +98,9 @@ typedef struct { } info_t; +extern char header_text_info; + + bool sc64_check_presence(void); void sc64_wait_cpu_ready(void); bool sc64_wait_cpu_busy(void); diff --git a/sw/n64/src/sys.h b/sw/n64/src/sys.h index 99a79be..43e2060 100644 --- a/sw/n64/src/sys.h +++ b/sw/n64/src/sys.h @@ -12,7 +12,6 @@ typedef volatile uint32_t io32_t; #define ALIGN(value, align) (((value) + ((typeof(value))(align) - 1)) & ~((typeof(value))(align) - 1)) -#define PHYSICAL(address) ((io32_t *) (((io32_t) (address)) & 0x1FFFFFFFUL)) #define CACHED(address) ((io32_t *) ((((io32_t) (address)) & 0x1FFFFFFFUL) | 0x80000000UL)) #define UNCACHED(address) ((io32_t *) ((((io32_t) (address)) & 0x1FFFFFFFUL) | 0xA0000000UL))