Skip to content

Commit

Permalink
Merge pull request ps2homebrew#2 from ps2homebrew/master
Browse files Browse the repository at this point in the history
Merge Main Repo Changes
  • Loading branch information
JoseAaronLopezGarcia authored May 18, 2022
2 parents 80059ce + 4e032f7 commit e371acd
Show file tree
Hide file tree
Showing 39 changed files with 179 additions and 148 deletions.
4 changes: 2 additions & 2 deletions ee_core/src/igs_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ static u8 SaveBitmapFile(u16 width, u16 height, u8 pixel_size, void *buffer, u8
if (ret != 2)
BlinkColour(5, 0x0000FF, 1); // Red
//(...then, write the remaining info!)
bh = buffer + image_size;
bh = (void *)((u8 *)buffer + image_size);
bh->filesize = (u32)file_size;
bh->reserved = (u32)0;
bh->headersize = (u32)54;
Expand All @@ -663,7 +663,7 @@ static u8 SaveBitmapFile(u16 width, u16 height, u8 pixel_size, void *buffer, u8
if (intffmd == 3) // Interlace Mode, FRAME Mode (Read every line)
height >>= 1;
for (i = 1; i <= height; i++) {
addr = buffer + ((height - i) * lenght);
addr = (void *)((u8 *)buffer + ((height - i) * lenght));

// Ensure that all the data has indeed been written back to main memory
FlushCache(GS_WRITEBACK_DCACHE);
Expand Down
6 changes: 3 additions & 3 deletions include/cheatman.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
*/
typedef struct
{
int addr;
int val;
u32 addr;
u32 val;
} code_t;

void InitCheatsConfig(config_set_t *configSet);
int GetCheatsEnabled(void);
const int *GetCheatsList(void);
const u32 *GetCheatsList(void);
int load_cheats(const char *cheatfile);

#endif /* _CHEATMAN_H_ */
30 changes: 15 additions & 15 deletions lng_pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ then
export OPL_VERSION=$(make oplversion)
else
echo "Falling back to old OPL Lang Pack"
VERSION=$(cat ${CURRENT_DIR}/Makefile | grep "VERSION =" | head -1 | cut -d " " -f 3)
SUBVERSION=$(cat ${CURRENT_DIR}/Makefile | grep "SUBVERSION =" | head -1 | cut -d " " -f 3)
PATCHLEVEL=$(cat ${CURRENT_DIR}/Makefile | grep "PATCHLEVEL =" | head -1 | cut -d " " -f 3)
REVISION=$(($(cat ${CURRENT_DIR}/DETAILED_CHANGELOG | grep "rev" | head -1 | cut -d " " -f 1 | cut -c 4-) + 1))
EXTRAVERSION=$(cat ${CURRENT_DIR}/Makefile | grep "EXTRAVERSION =" | head -1 | cut -d " " -f 3)
if [ ${EXTRAVERSION} != "" ]; then EXTRAVERSION=-${EXTRAVERSION}; fi
GIT_HASH=$(git -C ${CURRENT_DIR}/ rev-parse --short=7 HEAD 2>/dev/null)
if [ ${GIT_HASH} != "" ]; then GIT_HASH=-${GIT_HASH}; fi
VERSION=$(grep "VERSION =" < "${CURRENT_DIR}/Makefile" | head -1 | cut -d " " -f 3)
SUBVERSION=$(grep "SUBVERSION =" < "${CURRENT_DIR}/Makefile" | head -1 | cut -d " " -f 3)
PATCHLEVEL=$(grep "PATCHLEVEL =" < "${CURRENT_DIR}/Makefile" | head -1 | cut -d " " -f 3)
REVISION=$(($(grep "rev" < "${CURRENT_DIR}/DETAILED_CHANGELOG" | head -1 | cut -d " " -f 1 | cut -c 4-) + 1))
EXTRAVERSION=$(grep "EXTRAVERSION =" < "${CURRENT_DIR}/Makefile" | head -1 | cut -d " " -f 3)
if [ "${EXTRAVERSION}" != "" ]; then EXTRAVERSION=-${EXTRAVERSION}; fi
GIT_HASH=$(git -C "${CURRENT_DIR}/" rev-parse --short=7 HEAD 2>/dev/null)
if [ "${GIT_HASH}" != "" ]; then GIT_HASH=-${GIT_HASH}; fi
export OPL_VERSION=${VERSION}.${SUBVERSION}.${PATCHLEVEL}.${REVISION}${EXTRAVERSION}${GIT_HASH}
fi

# Print a list
printf "$(ls ${CURRENT_DIR}/lng/ | cut -c 6- | rev | cut -c 5- | rev)" > ${LANG_LIST}
printf "$(ls ${CURRENT_DIR}/lng/ | cut -c 6- | rev | cut -c 5- | rev)" > "${LANG_LIST}"

# Copy format
while IFS= read -r CURRENT_FILE
do
mkdir -p ${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/
cp ${CURRENT_DIR}/lng/lang_${CURRENT_FILE}.lng ${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/lang_${CURRENT_FILE}.lng
if [ -e thirdparty/font_${CURRENT_FILE}.ttf ]
mkdir -p "${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/"
cp "${CURRENT_DIR}/lng/lang_${CURRENT_FILE}.lng" "${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/lang_${CURRENT_FILE}.lng"
if [ -e "thirdparty/font_${CURRENT_FILE}.ttf" ]
then
cp ${CURRENT_DIR}/thirdparty/font_${CURRENT_FILE}.ttf ${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/font_${CURRENT_FILE}.ttf
cp "${CURRENT_DIR}/thirdparty/font_${CURRENT_FILE}.ttf" "${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/font_${CURRENT_FILE}.ttf"
fi
done < ${LANG_LIST}

Expand Down Expand Up @@ -65,13 +65,13 @@ EOF
# Lets pack it!
cd ${BUILD_DIR}/
zip -r ${CURRENT_DIR}/OPNPS2LD_LANGS-${OPL_VERSION}.zip *
zip -r "${CURRENT_DIR}/OPNPS2LD_LANGS-${OPL_VERSION}.zip" ./*
if [ -f "${CURRENT_DIR}/OPNPS2LD_LANGS-${OPL_VERSION}.zip" ]
then echo "OPL Lang Package Complete: OPNPS2LD_LANGS-${OPL_VERSION}.zip"
else echo "OPL Lang Package not found!"
fi
# Cleanup
cd ${CURRENT_DIR}
cd "${CURRENT_DIR}"
rm -rf ${BUILD_DIR}/ ${LANG_LIST}
unset CURRENT_DIR BUILD_DIR LANG_LIST OPL_VERSION CURRENT_FILE
8 changes: 4 additions & 4 deletions make_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ fi
printf '\n' >> /tmp/commit_summary
# Store number of commits
old_number_commits=$(($(cat OLD_DETAILED_CHANGELOG | grep "rev" | head -1 | cut -d " " -f 1 | cut -c 4-)))
number_commits=$(cat /tmp/commit_summary | wc -l)
new_number_commits=$((${number_commits} - ${old_number_commits} + 2))
old_number_commits=$(($(grep "rev" < OLD_DETAILED_CHANGELOG | head -1 | cut -d " " -f 1 | cut -c 4-)))
number_commits=$(wc -l < /tmp/commit_summary)
new_number_commits=$((number_commits - old_number_commits + 2))
# Echo it!
echo "Current Revision ${number_commits} (Of BitBucket r${old_number_commits} + Of GIT r${new_number_commits})"
Expand All @@ -62,7 +62,7 @@ gawk '{ L[n++] = $0 } END { while(n--) print L[n] }' /tmp/commit_summary > /tmp/
# Store each commit in one variable[list]
while read line_commit_summary
do
old_number_commits=$((${old_number_commits} + 1))
old_number_commits=$((old_number_commits + 1))
echo "rev${old_number_commits} - ${line_commit_summary}" >> /tmp/commit_summary_new
done < /tmp/commit_summary_reverse
Expand Down
5 changes: 1 addition & 4 deletions modules/debug/ps2link/cmdHandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,13 @@ pkoWriteMem(char *buf, int len)
static void
cmdListener(int sock)
{
int done;
int len;
int addrlen;
unsigned int cmd;
pko_pkt_hdr *header;
struct sockaddr_in remote_addr;

done = 0;

while (!done) {
while (1) {

addrlen = sizeof(remote_addr);
len = recvfrom(sock, &recvbuf[0], BUF_SIZE, 0,
Expand Down
4 changes: 3 additions & 1 deletion modules/debug/ps2link/net_fio.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,9 @@ int pko_read_dir(int fd, void *buf)
dirent->stat.attr = ntohl(dirrly->attr);
dirent->stat.size = ntohl(dirrly->size);
dirent->stat.hisize = ntohl(dirrly->hisize);
memcpy(dirent->stat.ctime, dirrly->ctime, 8 * 3);
memcpy(dirent->stat.ctime, dirrly->ctime, 8);
memcpy(dirent->stat.atime, dirrly->atime, 8);
memcpy(dirent->stat.mtime, dirrly->mtime, 8);
strncpy(dirent->name, dirrly->name, 256);
dirent->unknown = 0;

Expand Down
10 changes: 5 additions & 5 deletions modules/ds34bt/iop/ds34bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,13 +1645,13 @@ void *rpc_sf(int cmd, void *data, int size)
*(u8 *)data = ds34bt_get_status(*(u8 *)data);
break;
case DS34BT_GET_BDADDR:
*(u8 *)(data + 6) = ds34bt_get_bdaddr((u8 *)data);
*((u8 *)data + 6) = ds34bt_get_bdaddr((u8 *)data);
break;
case DS34BT_SET_RUMBLE:
ds34bt_set_rumble(*(u8 *)(data + 1), *(u8 *)(data + 2), *(u8 *)data);
ds34bt_set_rumble(*((u8 *)data + 1), *((u8 *)data + 2), *(u8 *)data);
break;
case DS34BT_SET_LED:
ds34bt_set_led((u8 *)(data + 1), *(u8 *)data);
ds34bt_set_led(((u8 *)data + 1), *(u8 *)data);
break;
case DS34BT_GET_DATA:
ds34bt_get_data((char *)data, 18, *(u8 *)data);
Expand All @@ -1660,10 +1660,10 @@ void *rpc_sf(int cmd, void *data, int size)
ds34bt_reset();
break;
case DS34BT_GET_VERSION:
*(u8 *)(data + sizeof(hci_information_t)) = ds34bt_get_ver((u8 *)data);
*((u8 *)data + sizeof(hci_information_t)) = ds34bt_get_ver((u8 *)data);
break;
case DS34BT_GET_FEATURES:
*(u8 *)(data + 8) = ds34bt_get_feat((u8 *)data);
*((u8 *)data + 8) = ds34bt_get_feat((u8 *)data);
break;
default:
break;
Expand Down
8 changes: 4 additions & 4 deletions modules/ds34usb/iop/ds34usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,16 +716,16 @@ void *rpc_sf(int cmd, void *data, int size)
*(u8 *)data = ds34usb_get_status(*(u8 *)data);
break;
case DS34USB_GET_BDADDR:
*(u8 *)data = ds34usb_get_bdaddr((u8 *)(data + 1), *(u8 *)data);
*(u8 *)data = ds34usb_get_bdaddr(((u8 *)data + 1), *(u8 *)data);
break;
case DS34USB_SET_BDADDR:
ds34usb_set_bdaddr((u8 *)(data + 1), *(u8 *)data);
ds34usb_set_bdaddr(((u8 *)data + 1), *(u8 *)data);
break;
case DS34USB_SET_RUMBLE:
ds34usb_set_rumble(*(u8 *)(data + 1), *(u8 *)(data + 2), *(u8 *)data);
ds34usb_set_rumble(*((u8 *)data + 1), *((u8 *)data + 2), *(u8 *)data);
break;
case DS34USB_SET_LED:
ds34usb_set_led((u8 *)(data + 1), *(u8 *)data);
ds34usb_set_led(((u8 *)data + 1), *(u8 *)data);
break;
case DS34USB_GET_DATA:
ds34usb_get_data((char *)data, 18, *(u8 *)data);
Expand Down
4 changes: 2 additions & 2 deletions modules/iopcore/cdvdman/atad.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ static int ata_device_select(int device)

/* Select the device. */
ata_hwport->r_select = (device & 1) << 4;
res = ata_hwport->r_control;
res = ata_hwport->r_control; //Only done once in v1.04.
(void)(ata_hwport->r_control);
(void)(ata_hwport->r_control); //Only done once in v1.04.

return ata_wait_bus_busy();
}
Expand Down
21 changes: 12 additions & 9 deletions modules/iopcore/cdvdman/cdvdman.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static int cdvdman_read_sectors(u32 lsn, unsigned int sectors, void *buf)
}
}

ptr += SectorsToRead * 2048;
ptr = (void *)((u8 *)ptr + (SectorsToRead * 2048));
remaining -= SectorsToRead;
lsn += SectorsToRead;
ReadPos += SectorsToRead * 2048;
Expand Down Expand Up @@ -358,7 +358,7 @@ static int cdvdman_read(u32 lsn, u32 sectors, void *buf)

memcpy(buf, cdvdman_buf, nbytes);

buf = (void *)(buf + nbytes);
buf = (void *)((u8 *)buf + nbytes);
}

SignalSema(cdvdman_searchfilesema);
Expand Down Expand Up @@ -560,7 +560,6 @@ static int cdvdman_writeSCmd(u8 cmd, const void *in, u16 in_size, void *out, u16
{
int i;
u8 *p;
u8 rdbuf[64];

WaitSema(cdvdman_scmdsema);

Expand All @@ -577,7 +576,7 @@ static int cdvdman_writeSCmd(u8 cmd, const void *in, u16 in_size, void *out, u16

if (in_size > 0) {
for (i = 0; i < in_size; i++) {
p = (void *)(in + i);
p = (void *)((const u8 *)in + i);
CDVDreg_SDATAIN = *p;
}
}
Expand All @@ -592,16 +591,20 @@ static int cdvdman_writeSCmd(u8 cmd, const void *in, u16 in_size, void *out, u16
i = 0;
if (!(CDVDreg_SDATAIN & 0x40)) {
do {
p = (void *)(rdbuf + i);
if (i >= out_size) {
break;
}
p = (void *)((u8 *)out + i);
*p = CDVDreg_SDATAOUT;
i++;
} while (!(CDVDreg_SDATAIN & 0x40));
}

if (out_size > i)
out_size = i;

memcpy((void *)out, (void *)rdbuf, out_size);
if (!(CDVDreg_SDATAIN & 0x40)) {
do {
(void)CDVDreg_SDATAOUT;
} while (!(CDVDreg_SDATAIN & 0x40));
}

SignalSema(cdvdman_scmdsema);

Expand Down
2 changes: 1 addition & 1 deletion modules/iopcore/cdvdman/device-hdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int DeviceReadSectors(u32 lsn, void *buffer, unsigned int sectors)
nsectors = sectors;

u32 lba = cdvdman_partspecs[CurrentPart].data_start + ((lsn - cdvdman_partspecs[CurrentPart].part_offset) << 2);
if (ata_device_sector_io(0, (void *)(buffer + offset), lba, nsectors << 2, ATA_DIR_READ) != 0) {
if (ata_device_sector_io(0, (void *)((u8 *)buffer + offset), lba, nsectors << 2, ATA_DIR_READ) != 0) {
return SCECdErREAD;
}
offset += nsectors * 2048;
Expand Down
3 changes: 1 addition & 2 deletions modules/iopcore/cdvdman/ioops.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static int cdrom_read(iop_file_t *f, void *buf, int size)

sceCdSync(0);
memcpy(buf, &cdvdman_fs_buf[offset], nbytes);
buf += nbytes;
buf = (void *)((u8 *)buf + nbytes);
}

//Phase 2: read the data to the middle of the buffer, in units of 2048.
Expand All @@ -296,7 +296,6 @@ static int cdrom_read(iop_file_t *f, void *buf, int size)
while (sceCdRead(fh->lsn + (fh->position / 2048), 1, cdvdman_fs_buf, NULL) == 0)
DelayThread(10000);

size -= nbytes;
fh->position += nbytes;
rpos += nbytes;

Expand Down
4 changes: 2 additions & 2 deletions modules/iopcore/cdvdman/ioplib_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ static int Hook_LoadModuleBuffer(void *ptr)
{
const struct FakeModule *mod;

DPRINTF("Hook_LoadModuleBuffer() modname = %s\n", (char *)(ptr + 0x8e));
DPRINTF("Hook_LoadModuleBuffer() modname = %s\n", ((char *)ptr + 0x8e));

mod = checkFakemodByName((char *)(ptr + 0x8e), modulefake_list);
mod = checkFakemodByName(((char *)ptr + 0x8e), modulefake_list);
if (mod != NULL)
return mod->id;

Expand Down
Loading

0 comments on commit e371acd

Please # to comment.