-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
151 additions
and
143 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "time.h" | ||
|
||
volatile unsigned long* dvd = (volatile unsigned long*)0xCC006000; | ||
|
||
int dvd_cover_status() { | ||
return (dvd[1] & 1); // 0: cover closed, 1: cover opened | ||
} | ||
|
||
int dvd_read_id() | ||
{ | ||
dvd[0] = 0x2E; | ||
dvd[1] = 0; | ||
dvd[2] = 0xA8000040; | ||
dvd[3] = 0; | ||
dvd[4] = 0x20; | ||
dvd[5] = 0; | ||
dvd[6] = 0x20; | ||
dvd[7] = 3; // enable reading! | ||
while (dvd[7] & 1) | ||
; | ||
if (dvd[0] & 0x4) | ||
return 1; | ||
return 0; | ||
} | ||
|
||
unsigned int dvd_get_error(void) | ||
{ | ||
dvd[2] = 0xE0000000; | ||
dvd[8] = 0; | ||
dvd[7] = 1; // IMM | ||
while (dvd[7] & 1); | ||
return dvd[8]; | ||
} | ||
|
||
|
||
void dvd_reset() | ||
{ | ||
dvd[1] = 2; | ||
volatile unsigned long v = *(volatile unsigned long*)0xcc003024; | ||
*(volatile unsigned long*)0xcc003024 = (v & ~4) | 1; | ||
udelay(12); | ||
*(volatile unsigned long*)0xcc003024 = v | 5; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
void dvd_reset(); | ||
unsigned int dvd_get_error(void); | ||
int dvd_read_id(); |
Oops, something went wrong.