-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix return to loader on GC Loader with data.iso present.
- Loading branch information
Showing
5 changed files
with
90 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2020-2024, Extrems <[email protected]> | ||
* Copyright (c) 2020-2025, Extrems <[email protected]> | ||
* | ||
* This file is part of Swiss. | ||
* | ||
|
@@ -65,13 +65,37 @@ xmit_spi: | |
srwi r3, r0, 24 | ||
blr | ||
|
||
.globl dvd_reset | ||
dvd_reset: | ||
lis r3, 0x0C00 | ||
li r4, 0x3000 + 9*4 | ||
eciwx r0, r4, r3 | ||
rlwinm r0, r0, 0, 30, 28 | ||
ori r0, r0, 0b001 | ||
ecowx r0, r4, r3 | ||
mftb r5 | ||
1: mftb r6 | ||
sub r0, r6, r5 | ||
cmplwi r0, 486 | ||
blt 1b | ||
eciwx r0, r4, r3 | ||
ori r0, r0, 0b101 | ||
ecowx r0, r4, r3 | ||
blr | ||
|
||
.globl dvd_inquiry | ||
dvd_inquiry: | ||
lis r6, 0x1200 | ||
li r5, 0 | ||
1: li r5, 0 | ||
li r4, 32 | ||
b dvd_readdma | ||
|
||
.globl dvd_read_id | ||
dvd_read_id: | ||
lis r6, 0xA800 | ||
ori r6, r6, 0x0040 | ||
b 1b | ||
|
||
.globl dvd_read | ||
dvd_read: | ||
lis r6, 0xA800 | ||
|
@@ -115,6 +139,20 @@ dvd_readdma: | |
3: li r3, 0 | ||
blr | ||
|
||
.globl dvd_stop_motor | ||
dvd_stop_motor: | ||
lis r3, 0x0C00 | ||
li r4, 0x6000 + 2*4 | ||
lis r0, 0xE300 | ||
ecowx r0, r4, r3 | ||
li r4, 0x6000 + 7*4 | ||
li r0, 0b001 | ||
ecowx r0, r4, r3 | ||
1: eciwx r0, r4, r3 | ||
andi. r0, r0, 0b001 | ||
bne 1b | ||
blr | ||
|
||
.globl flippy_reset | ||
flippy_reset: | ||
lis r3, 0x0C00 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2020-2024, Extrems <[email protected]> | ||
* Copyright (c) 2020-2025, Extrems <[email protected]> | ||
* | ||
* This file is part of Swiss. | ||
* | ||
|
@@ -51,8 +51,11 @@ static bool memeq(const void *a, const void *b, size_t size) | |
return true; | ||
} | ||
|
||
void dvd_reset(void); | ||
uint32_t dvd_inquiry(DVDDriveInfo *info); | ||
uint32_t dvd_read_id(DVDDiskID *id); | ||
uint32_t dvd_read(void *address, uint32_t length, uint32_t offset); | ||
void dvd_stop_motor(void); | ||
void flippy_reset(void); | ||
|
||
static void dvd_load(uint32_t offset) | ||
|
@@ -89,6 +92,15 @@ void dvd_main(void) | |
if (!dvd_inquiry(&info)) return; | ||
|
||
switch (info.releaseDate) { | ||
case 0x20196C64: | ||
{ | ||
dvd_stop_motor(); | ||
dvd_reset(); | ||
dly_us(1150 * 1000); | ||
dvd_reset(); | ||
if (!dvd_read_id(NULL)) return; | ||
break; | ||
} | ||
case 0x20220426: | ||
flippy_reset(); | ||
case 0x20220420: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,7 @@ | |
|
||
extern DEVICEHANDLER_INTERFACE __device_gcloader; | ||
|
||
bool gcloaderGetBootFile(file_handle* file); | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters