aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxcd/psxcd.c
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2022-01-18 08:31:14 +0800
committerGitHub <noreply@github.com>2022-01-18 08:31:14 +0800
commit05d44488bd5587786f4bd0286fc0f555c79aa46a (patch)
tree5740f396d10a9580c3a39ca536544436898ff1b6 /libpsn00b/psxcd/psxcd.c
parent08de895e8582dbc70b639ae5f511ab9ebfb4d68a (diff)
parente9475e283a82665fe6c19bebc3318b5084f15a2e (diff)
downloadpsn00bsdk-05d44488bd5587786f4bd0286fc0f555c79aa46a.tar.gz
Merge pull request #44 from spicyjpeg/actions
GitHub Actions CI, psxcd and libc fixes, new examples
Diffstat (limited to 'libpsn00b/psxcd/psxcd.c')
-rw-r--r--libpsn00b/psxcd/psxcd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libpsn00b/psxcd/psxcd.c b/libpsn00b/psxcd/psxcd.c
index 74c6c1c..8f19c8d 100644
--- a/libpsn00b/psxcd/psxcd.c
+++ b/libpsn00b/psxcd/psxcd.c
@@ -21,7 +21,7 @@ volatile int _cd_last_sector_count;
int _cd_media_changed;
void _cd_init(void);
-void _cd_control(unsigned char com, unsigned char *param, int plen);
+void _cd_control(unsigned char com, const void *param, int plen);
void _cd_wait_ack(void);
void _cd_wait(void);
@@ -50,7 +50,7 @@ int CdInit(void)
return 1;
}
-int CdControl(unsigned char com, unsigned char *param, unsigned char *result)
+int CdControl(unsigned char com, const void *param, unsigned char *result)
{
// Don't issue command if ack is not received yet
if( _cd_ack_wait )
@@ -72,7 +72,7 @@ int CdControl(unsigned char com, unsigned char *param, unsigned char *result)
return 1;
}
-int CdControlB(unsigned char com, unsigned char *param, unsigned char *result)
+int CdControlB(unsigned char com, const void *param, unsigned char *result)
{
if( !CdControl(com, param, result) )
{
@@ -83,7 +83,7 @@ int CdControlB(unsigned char com, unsigned char *param, unsigned char *result)
return 1;
}
-int CdControlF(unsigned char com, unsigned char *param)
+int CdControlF(unsigned char com, const void *param)
{
int param_len=0;
@@ -255,7 +255,7 @@ static void _CdReadReadyCallback(int status, unsigned char *result)
CdGetSector((void*)_cd_read_addr, _cd_read_sector_sz);
// Increment destination address
- _cd_read_addr += _cd_read_sector_sz>>2;
+ _cd_read_addr += _cd_read_sector_sz;
// Subtract sector count
_cd_sector_count--;
@@ -290,15 +290,15 @@ int CdRead(int sectors, u_long *buf, int mode)
// Determine sector based on mode flags
if( mode & CdlModeSize0 )
{
- _cd_read_sector_sz = 2328;
+ _cd_read_sector_sz = 2328 / 4;
}
else if( mode & CdlModeSize1 )
{
- _cd_read_sector_sz = 2340;
+ _cd_read_sector_sz = 2340 / 4;
}
else
{
- _cd_read_sector_sz = 2048;
+ _cd_read_sector_sz = 2048 / 4;
}
_cd_read_counter = VSync(-1);