Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New toolchain port #8

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: ps2dev/ps2dev:v1.0
container: ps2dev/ps2dev:v1.1
# instead of "ps2dev/ps2dev:latest" you can use different tags, for example for old projects you can use "ps2dev/ps2dev:v1.0"
steps:
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EE_BIN = $(EE_BIN_DIR)SMS.elf

EE_INCS = -I$(EE_INC_DIR) -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include -I$(PS2SDK)/ports/include -I$(PS2SDK)/sbv/include
EE_LDFLAGS = -L$(PS2SDK)/sbv/lib -L$(PS2SDK)/ee/lib -L$(PS2SDK)/ports/lib -L$(EE_SRC_DIR)/lzma2
EE_LIBS = -lpatches -lc -lkernel -lmf
EE_LIBS = -lpatches -lc -lkernel-nopatch -lm

EE_OBJS = main.o SMS_OS.o SMS_GS_0.o SMS_GS_1.o SMS_GS_2.o SMS_Timer.o \
SMS_MP123Core.o SMS_FileContext.o SMS_H263.o \
Expand Down Expand Up @@ -74,9 +74,9 @@ $(EE_OBJ_DIR)%.o : $(EE_SRC_DIR)%.s
$(EE_OBJ_DIR)%.o : $(EE_SRC_DIR)%.S
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@

$(EE_BIN) : $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o
$(EE_CC) -mno-crt0 -T$(PS2SDK)/ee/startup/linkfile $(EE_LDFLAGS) \
-o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(EE_OBJS) $(EE_LIBS) -Xlinker -Map -Xlinker ./obj/SMS.map
$(EE_BIN) : $(EE_OBJS)
$(EE_CC) $(EE_LDFLAGS) \
-o $(EE_BIN) $(EE_OBJS) $(EE_LIBS) -Xlinker -Map -Xlinker ./obj/SMS.map

rebuild: clean all

Expand Down
2 changes: 1 addition & 1 deletion iop/SMSCDVD/SMSCDVD.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ static int CDVD_dopen ( iop_io_file_t* apFile, const char* apName ) {

static int ISO_DRead ( iop_io_file_t* apFile, void* apRetVal ) {

fio_dirent_t* lpBuf = ( fio_dirent_t* )apRetVal;
io_dirent_t* lpBuf = ( io_dirent_t* )apRetVal;

if ( !s_tocEntryPointer ) return -EPROTO;

Expand Down
2 changes: 1 addition & 1 deletion iop/SMSCDVD/SMSCDVD_UDFS.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ static int UDF_DOpen ( iop_io_file_t* apFile, const char* apPath ) {

static int UDF_DRead ( iop_io_file_t* apFile, void* apRetVal ) {

fio_dirent_t* lpBuf = ( fio_dirent_t* )apRetVal;
io_dirent_t* lpBuf = ( io_dirent_t* )apRetVal;
UDFAddress lFileICB;

if ( s_ScanPos == 0xFFFFFFFF ) return -EPROTO;
Expand Down
4 changes: 2 additions & 2 deletions iop/SMSUMS/src/ums.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ static int _ums_dread ( iop_file_t* apFile, void* apData ) {

else {

fio_dirent_t* lpEntry = ( fio_dirent_t* )apData;
io_dirent_t* lpEntry = ( io_dirent_t* )apData;

mips_memset ( apData, 0, sizeof ( fio_dirent_t ) );
mips_memset ( apData, 0, sizeof ( io_dirent_t ) );
strcpy ( lpEntry -> name, lpDev -> m_LUName[ lIdx ] );
lIdx += 1;
lpEntry -> stat.mode = FIO_SO_IFDIR;
Expand Down
2 changes: 1 addition & 1 deletion iop/SMSUMS/src/ums_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ static int _fat_dclose ( iop_file_t* apFile ) {

static int _fat_dread ( iop_file_t* apFile, void* apBuf ) {

fio_dirent_t* lpEntry = ( fio_dirent_t* )apBuf;
io_dirent_t* lpEntry = ( io_dirent_t* )apBuf;
find_file_info* lpFFInfo = ( find_file_info* )apFile -> privdata;
USBMDevice* lpDev;
int lfCont;
Expand Down
2 changes: 1 addition & 1 deletion src/SMS_AAC.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "SMS_Locale.h"

#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

Expand Down
3 changes: 2 additions & 1 deletion src/SMS_Codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#include "SMS_FLAC.h"
#include "SMS_VideoBuffer.h"

#include <malloc.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

static SMS_CodecTag s_CodecVideoTags[] = {
Expand Down
4 changes: 4 additions & 0 deletions src/SMS_Config.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
#include "SMS_IOP.h"

#include <malloc.h>
#define NEWLIB_PORT_AWARE
#include <fileio.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <sjis.h>

extern void _check_dc_offset ( void );
extern unsigned char g_IconSMS[ 2020 ] __attribute__( ( section( ".data" ) ) );
Expand Down
1 change: 1 addition & 0 deletions src/SMS_ContainerMOV.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef struct MOVIndex {
uint32_t m_Flags;
Expand Down
3 changes: 3 additions & 0 deletions src/SMS_CopyTree.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include <malloc.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#define NEWLIB_PORT_AWARE
#include <fileio.h>

#define BUF_SIZE ( 4096 * 96 )

Expand Down
4 changes: 3 additions & 1 deletion src/SMS_DirTree.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
#include <malloc.h>
#include <string.h>
#include <sys/stat.h>
#define NEWLIB_PORT_AWARE
#include <fileio.h>
#include <iox_stat.h>

#define STRING( n ) ( ( ( char* )( n ) ) + sizeof ( SMS_DirNode ) )

Expand Down Expand Up @@ -94,7 +96,7 @@ void SMS_DirTreeScan ( SMS_DirTree* apTree, SMS_Dir* apRoot, const char* apPath
if ( lDD >= 0 ) {

SMS_DirNode* lpNode;
fio_dirent_t lEntry;
io_dirent_t lEntry;

if ( apTree -> DirCB ) {
apTree -> m_Error = apTree -> DirCB ( lpPath );
Expand Down
6 changes: 5 additions & 1 deletion src/SMS_EE.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@

#include <kernel.h>
#include <malloc.h>
#include <ctype.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#define NEWLIB_PORT_AWARE
#include <fileio.h>

unsigned char* g_pSPRTop;
Expand Down Expand Up @@ -751,7 +755,7 @@ __asm__(

void SMS_EEScanDir ( const char* apPath, const char* apExt, SMS_List* apList ) {

fio_dirent_t lEntry;
io_dirent_t lEntry;
int lDD;

lDD = fioDopen ( apPath );
Expand Down
2 changes: 2 additions & 0 deletions src/SMS_FileContext.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ BOOL _find_signature ( CDDAContext* apCtx ) {
} /* end _find_signature */
#else /* PS2 */
# include <kernel.h>
# define NEWLIB_PORT_AWARE
# include <fileio.h>
# include <stdio.h>
# include <fcntl.h>
# include "SMS_CDDA.h"

Expand Down
97 changes: 50 additions & 47 deletions src/SMS_FileDir.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

#include <kernel.h>
#include <string.h>
#define NEWLIB_PORT_AWARE
#include <fileio.h>
#include <iox_stat.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <malloc.h>
Expand Down Expand Up @@ -84,25 +87,25 @@ int SMS_SubContID ( const char* apName ) {

const char* lpExt = apName + lLen - 4;

if ( !stricmp ( lpExt, s_pMP3 ) ||
!stricmp ( lpExt, s_pMPA ) ||
!stricmp ( lpExt, s_pMP2 )
if ( !strcasecmp ( lpExt, s_pMP3 ) ||
!strcasecmp ( lpExt, s_pMPA ) ||
!strcasecmp ( lpExt, s_pMP2 )
) retVal = SMS_SUBCONTAINER_MP3;
else if ( !stricmp ( lpExt, s_pOGG ) )
else if ( !strcasecmp ( lpExt, s_pOGG ) )
retVal = SMS_SUBCONTAINER_OGG;
else if ( !stricmp ( lpExt, s_pWMA ) )
else if ( !strcasecmp ( lpExt, s_pWMA ) )
retVal = SMS_SUBCONTAINER_ASF;
else if ( !stricmp ( lpExt, s_pM4A ) ||
!stricmp ( lpExt, s_pMP4 )
else if ( !strcasecmp ( lpExt, s_pM4A ) ||
!strcasecmp ( lpExt, s_pMP4 )
) retVal = SMS_SUBCONTAINER_M4A;
else if ( !stricmp ( lpExt, s_pAAC ) )
else if ( !strcasecmp ( lpExt, s_pAAC ) )
retVal = SMS_SUBCONTAINER_AAC;
else if ( !stricmp ( lpExt, s_pAC3 ) )
else if ( !strcasecmp ( lpExt, s_pAC3 ) )
retVal = SMS_SUBCONTAINER_AC3;

if ( retVal == -1 && lLen > 5 ) {

if ( !stricmp ( lpExt, s_pFLAC ) ) retVal = SMS_SUBCONTAINER_FLAC;
if ( !strcasecmp ( lpExt, s_pFLAC ) ) retVal = SMS_SUBCONTAINER_FLAC;

} /* end if */

Expand All @@ -121,41 +124,41 @@ int SMS_ContID ( const char* apName ) {

const char* lpExt = apName + lLen - 4;

if ( !stricmp ( lpExt, s_pAVI ) )
if ( !strcasecmp ( lpExt, s_pAVI ) )
retVal = SMS_CONTAINER_AVI;
else if ( !stricmp ( lpExt, s_pMPG ) )
else if ( !strcasecmp ( lpExt, s_pMPG ) )
retVal = SMS_CONTAINER_MPEG_PS;
else if ( !stricmp ( lpExt, s_pMP3 ) ||
!stricmp ( lpExt, s_pMPA ) ||
!stricmp ( lpExt, s_pMP2 )
else if ( !strcasecmp ( lpExt, s_pMP3 ) ||
!strcasecmp ( lpExt, s_pMPA ) ||
!strcasecmp ( lpExt, s_pMP2 )
) retVal = SMS_CONTAINER_MP3;
else if ( !stricmp ( lpExt, s_pOGG ) )
else if ( !strcasecmp ( lpExt, s_pOGG ) )
retVal = SMS_CONTAINER_OGG;
else if ( !stricmp ( lpExt, s_pWMA ) )
else if ( !strcasecmp ( lpExt, s_pWMA ) )
retVal = SMS_CONTAINER_ASF;
else if ( !stricmp ( lpExt, s_pM4A ) ||
!stricmp ( lpExt, s_pMP4 )
else if ( !strcasecmp ( lpExt, s_pM4A ) ||
!strcasecmp ( lpExt, s_pMP4 )
) retVal = SMS_CONTAINER_M4A;
else if ( !stricmp ( lpExt, s_pAAC ) )
else if ( !strcasecmp ( lpExt, s_pAAC ) )
retVal = SMS_CONTAINER_AAC;
else if ( !stricmp ( lpExt, s_pAC3 ) )
else if ( !strcasecmp ( lpExt, s_pAC3 ) )
retVal = SMS_CONTAINER_AC3;
else if ( !stricmp ( lpExt, s_pM3U ) )
else if ( !strcasecmp ( lpExt, s_pM3U ) )
retVal = SMS_CONTAINER_M3U;
else if ( !stricmp ( lpExt, s_pJPG ) )
else if ( !strcasecmp ( lpExt, s_pJPG ) )
retVal = SMS_CONTAINER_JPG;

if ( retVal == -1 && lLen > 5 ) {

if ( !stricmp ( --lpExt, s_pDIVX ) ||
!stricmp ( lpExt, s_pXVID )
if ( !strcasecmp ( --lpExt, s_pDIVX ) ||
!strcasecmp ( lpExt, s_pXVID )
)
retVal = SMS_CONTAINER_AVI;
else if ( !stricmp ( lpExt, s_pMPEG ) )
else if ( !strcasecmp ( lpExt, s_pMPEG ) )
retVal = SMS_CONTAINER_MPEG_PS;
else if ( !stricmp ( lpExt, s_pFLAC ) )
else if ( !strcasecmp ( lpExt, s_pFLAC ) )
retVal = SMS_CONTAINER_FLAC;
else if ( !stricmp ( lpExt, s_pJPEG ) )
else if ( !strcasecmp ( lpExt, s_pJPEG ) )
retVal = SMS_CONTAINER_JPG;

} /* end if */
Expand All @@ -175,36 +178,36 @@ int SMS_FileID ( const char* apName ) {

const char* lpExt = apName + lLen - 4;

if ( !stricmp ( lpExt, s_pAVI ) ||
!stricmp ( lpExt, s_pMPG )
if ( !strcasecmp ( lpExt, s_pAVI ) ||
!strcasecmp ( lpExt, s_pMPG )
)
retVal = GUICON_AVI;
else if ( !stricmp ( lpExt, s_pMP3 ) ||
!stricmp ( lpExt, s_pMPA ) ||
!stricmp ( lpExt, s_pMP2 ) ||
!stricmp ( lpExt, s_pOGG ) ||
!stricmp ( lpExt, s_pWMA ) ||
!stricmp ( lpExt, s_pM4A ) ||
!stricmp ( lpExt, s_pAAC ) ||
!stricmp ( lpExt, s_pMP4 ) ||
!stricmp ( lpExt, s_pAC3 )
else if ( !strcasecmp ( lpExt, s_pMP3 ) ||
!strcasecmp ( lpExt, s_pMPA ) ||
!strcasecmp ( lpExt, s_pMP2 ) ||
!strcasecmp ( lpExt, s_pOGG ) ||
!strcasecmp ( lpExt, s_pWMA ) ||
!strcasecmp ( lpExt, s_pM4A ) ||
!strcasecmp ( lpExt, s_pAAC ) ||
!strcasecmp ( lpExt, s_pMP4 ) ||
!strcasecmp ( lpExt, s_pAC3 )
)
retVal = GUICON_MP3;
else if ( !stricmp ( lpExt, s_pM3U ) )
else if ( !strcasecmp ( lpExt, s_pM3U ) )
retVal = GUICON_M3U;
else if ( !stricmp ( lpExt, s_pJPG ) )
else if ( !strcasecmp ( lpExt, s_pJPG ) )
retVal = GUICON_PICTURE;

if ( retVal == GUICON_FILE && lLen > 5 ) {

if ( !stricmp ( --lpExt, s_pDIVX ) ||
!stricmp ( lpExt, s_pXVID ) ||
!stricmp ( lpExt, s_pMPEG )
if ( !strcasecmp ( --lpExt, s_pDIVX ) ||
!strcasecmp ( lpExt, s_pXVID ) ||
!strcasecmp ( lpExt, s_pMPEG )
)
retVal = GUICON_AVI;
else if ( !stricmp ( lpExt, s_pFLAC ) )
else if ( !strcasecmp ( lpExt, s_pFLAC ) )
retVal = GUICON_MP3;
else if ( !stricmp ( lpExt, s_pJPEG ) )
else if ( !strcasecmp ( lpExt, s_pJPEG ) )
retVal = GUICON_PICTURE;

} /* end if */
Expand All @@ -222,7 +225,7 @@ void SMS_FileDirInit ( char* apPath ) {
SMS_List* lpDirList;
SMS_List* lpFileList;
SMS_List* lpList;
fio_dirent_t lEntry;
io_dirent_t lEntry;
char lPath[ 1024 ] __attribute__( ( aligned( 4 ) ) );
char* lpPtr;
SMS_ListNode* lpNode;
Expand Down
3 changes: 2 additions & 1 deletion src/SMS_GS_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#include <kernel.h>
#include <string.h>
#include <limits.h>
#include <fileio.h>
#include <stdio.h>
#include <fcntl.h>
#include <malloc.h>

#include <lzma2.h>
Expand Down
3 changes: 2 additions & 1 deletion src/SMS_GUI.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
#include <kernel.h>
#include <loadfile.h>
#include <libhdd.h>
#include <fileio.h>
#include <malloc.h>
#include <sifrpc.h>
#include <string.h>
#define NEWLIB_PORT_AWARE
#include <fileio.h>

#define GUIF_DEV_CHECK 0x00000001

Expand Down
1 change: 1 addition & 0 deletions src/SMS_GUIDesktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <kernel.h>
#include <malloc.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <libhdd.h>

Expand Down
1 change: 0 additions & 1 deletion src/SMS_GUIDevMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <kernel.h>
#include <malloc.h>
#include <fileio.h>
#include <stdio.h>
#include <string.h>

Expand Down
2 changes: 2 additions & 0 deletions src/SMS_GUIFileCtxMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <string.h>
#include <stdio.h>
#include <sys/fcntl.h>
#define NEWLIB_PORT_AWARE
#include <fileio.h>

extern void GUIMenuSMS_Redraw ( GUIMenu* );
extern int CtxMenu_HandleEvent ( GUIObject*, u64 );
Expand Down
1 change: 1 addition & 0 deletions src/SMS_GUIFileMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <kernel.h>
#include <malloc.h>
#include <string.h>
#define NEWLIB_PORT_AWARE
#include <fileio.h>
#include <fcntl.h>

Expand Down
Loading