aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxcd/psxcd.c
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2020-09-19 20:43:05 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2020-09-19 20:43:05 +0800
commit9f4891f95070c66ea9f1aba99d72724d4ab24e5a (patch)
tree723e3ef2118a3d1a9e6dafa811ed1b8b1bc9196e /libpsn00b/psxcd/psxcd.c
parent6762c39551ded059450d17d8bb0cb80642c8aaab (diff)
downloadpsn00bsdk-9f4891f95070c66ea9f1aba99d72724d4ab24e5a.tar.gz
Revised makefiles, added strtok(), command line arguments, SetHeapSize(), moved ISR and callback system to psxetc, moved debug font to psxgpu, fixed CD-ROM library crashing on PSIO, fixed interrupt callback setup to fix crashing on ResetGraph()
Diffstat (limited to 'libpsn00b/psxcd/psxcd.c')
-rw-r--r--libpsn00b/psxcd/psxcd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libpsn00b/psxcd/psxcd.c b/libpsn00b/psxcd/psxcd.c
index 76b6c08..76a8eba 100644
--- a/libpsn00b/psxcd/psxcd.c
+++ b/libpsn00b/psxcd/psxcd.c
@@ -17,7 +17,7 @@ volatile CdlLOC _cd_last_setloc;
volatile unsigned int *_cd_last_read_addr;
volatile int _cd_last_sector_count;
-extern volatile char _cd_media_changed;
+int _cd_media_changed;
void _cd_init(void);
void _cd_control(unsigned char com, unsigned char *param, int plen);
@@ -62,6 +62,12 @@ int CdControl(unsigned char com, unsigned char *param, unsigned char *result)
CdControlF(com, param);
_cd_wait_ack();
+ // Set media changed flag if lid had been opened
+ if( (CdStatus()&0x10) )
+ {
+ _cd_media_changed = 1;
+ }
+
return 1;
}