From 9f4891f95070c66ea9f1aba99d72724d4ab24e5a Mon Sep 17 00:00:00 2001 From: "John Wilbert M. Villamor" Date: Sat, 19 Sep 2020 20:43:05 +0800 Subject: 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() --- examples/system/childexec/child.c | 8 +++++++- examples/system/childexec/makefile | 8 ++++---- examples/system/childexec/parent.c | 28 +++++++++++++++++++++------- examples/system/console/main.c | 2 +- examples/system/console/makefile | 4 ++-- examples/system/timer/makefile | 4 ++-- examples/system/tty/makefile | 4 ++-- 7 files changed, 39 insertions(+), 19 deletions(-) (limited to 'examples/system') diff --git a/examples/system/childexec/child.c b/examples/system/childexec/child.c index fb38b63..2ed656b 100644 --- a/examples/system/childexec/child.c +++ b/examples/system/childexec/child.c @@ -102,7 +102,7 @@ void display(); /* Main function */ -int main() { +int main(int argc, const char *argv[]) { int i,p,xy_temp; @@ -113,6 +113,12 @@ int main() { POLY_F4 *pol4; /* Flat shaded quad primitive pointer */ + printf( "Arguments passed: %d\n", argc ); + for( i=0; iparam, 0, 0); + Exec(&exe->param, 3, args); - // Reset previous handler + // Restore interrupts for this PS-EXE EnterCriticalSection(); RestartCallback(); ExitCriticalSection(); @@ -300,6 +313,7 @@ void run_child() { ChangeClearPAD(0); // Set this program's display mode + SetDispMask(0); PutDispEnv(&disp); } diff --git a/examples/system/console/main.c b/examples/system/console/main.c index 988b428..405f0d6 100644 --- a/examples/system/console/main.c +++ b/examples/system/console/main.c @@ -172,7 +172,7 @@ int main(int argc, const char* argv[]) { /* Uncomment this line if you don't have tty interfaces * provided by n00brom or similar development environments with tty */ - AddSIO(115200); + //AddSIO(115200); /* Main loop */ diff --git a/examples/system/console/makefile b/examples/system/console/makefile index 0c27b55..d7e9374 100644 --- a/examples/system/console/makefile +++ b/examples/system/console/makefile @@ -1,4 +1,4 @@ -include ../../sdk-common.mk +include ../../examples-setup.mk # Project target name TARGET = console.elf @@ -19,7 +19,7 @@ INCLUDE += LIBDIRS += # Libraries to link -LIBS = -lpsxsio -lpsxetc -lpsxgpu -lpsxgte -lpsxspu -lpsxapi -lc +LIBS = -lpsxsio -lpsxgpu -lpsxgte -lpsxspu -lpsxetc -lpsxapi -lc # C compiler flags CFLAGS = -g -O2 -fno-builtin -fdata-sections -ffunction-sections diff --git a/examples/system/timer/makefile b/examples/system/timer/makefile index c35c445..3fe1562 100644 --- a/examples/system/timer/makefile +++ b/examples/system/timer/makefile @@ -1,4 +1,4 @@ -include ../../sdk-common.mk +include ../../examples-setup.mk TARGET = timer.elf @@ -11,7 +11,7 @@ OFILES = $(addprefix build/,$(CFILES:.c=.o) $(CPPFILES:.cpp=.o) $(AFILES:.s=.o) INCLUDE += LIBDIRS += -LIBS = -lpsxetc -lpsxgpu -lpsxgte -lpsxspu -lpsxapi -lc +LIBS = -lpsxgpu -lpsxgte -lpsxspu -lpsxetc -lpsxapi -lc CFLAGS = -g -O2 -fno-builtin -fdata-sections -ffunction-sections CPPFLAGS = $(CFLAGS) -fno-exceptions diff --git a/examples/system/tty/makefile b/examples/system/tty/makefile index a3884ad..d0a8caa 100644 --- a/examples/system/tty/makefile +++ b/examples/system/tty/makefile @@ -1,4 +1,4 @@ -include ../../sdk-common.mk +include ../../examples-setup.mk # Project target name TARGET = tty.elf @@ -19,7 +19,7 @@ INCLUDE += LIBDIRS += # Libraries to link -LIBS = -lpsxetc -lpsxgpu -lpsxgte -lpsxspu -lpsxapi -lc +LIBS = -lpsxgpu -lpsxgte -lpsxspu -lpsxetc -lpsxapi -lc # C compiler flags CFLAGS = -g -O2 -fno-builtin -fdata-sections -ffunction-sections -- cgit v1.2.3