Skip to content

Commit

Permalink
- Reinitialize EXIRegs in reload stub.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Feb 15, 2024
1 parent acd0805 commit 38e42b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cube/patches/stub/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021, Extrems <extrems@extremscorner.org>
* Copyright (c) 2020-2024, Extrems <extrems@extremscorner.org>
*
* This file is part of Swiss.
*
Expand All @@ -26,7 +26,7 @@
#include "eltorito.h"
#include "pff.h"

volatile uint32_t(*EXIRegs)[5] = (volatile uint32_t(*)[5])0x0C006800;
volatile uint32_t(*EXIRegs)[5] = EXI;

void run(void (*entry)(void));

Expand All @@ -36,8 +36,6 @@ void dly_us(UINT n)
while (OSDiffTick(OSGetTick(), start) < OSMicrosecondsToTicks(n));
}

uint32_t dvd_read(void *address, uint32_t length, uint32_t offset);

static bool memeq(const void *a, const void *b, size_t size)
{
const uint8_t *x = a;
Expand All @@ -51,6 +49,8 @@ static bool memeq(const void *a, const void *b, size_t size)
return true;
}

uint32_t dvd_read(void *address, uint32_t length, uint32_t offset);

static void dvd_load(uint32_t offset)
{
DOLImage image __attribute((aligned(32)));
Expand Down Expand Up @@ -142,6 +142,7 @@ static void pf_load(const char *path)
void pf_main(void)
{
FATFS fs;
EXIRegs = EXI;

for (int chan = 0; chan < EXI_CHANNEL_MAX; chan++, EXIRegs++) {
if (pf_mount(&fs) == FR_OK) {
Expand Down
2 changes: 2 additions & 0 deletions cube/patches/stub/reboot.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ SECTIONS
{
. = 0x01300000;
}

EXI = 0x0C006800;
2 changes: 2 additions & 0 deletions cube/patches/stub/stub.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ SECTIONS
{
. = 0x00001800;
}

EXI = 0x0C006800;

0 comments on commit 38e42b5

Please sign in to comment.