mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-12-26 10:35:39 +00:00
first commit
This commit is contained in:
16
src/samples/template/elf_template/Makefile.sample
Normal file
16
src/samples/template/elf_template/Makefile.sample
Normal file
@@ -0,0 +1,16 @@
|
||||
TARGET = template
|
||||
OBJS = main.o
|
||||
|
||||
INCDIR =
|
||||
CFLAGS = -O2 -G0 -Wall
|
||||
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
|
||||
EXTRA_TARGETS = EBOOT.PBP
|
||||
PSP_EBOOT_TITLE = Template
|
||||
|
||||
PSPSDK=$(shell psp-config --pspsdk-path)
|
||||
include $(PSPSDK)/lib/build.mak
|
||||
33
src/samples/template/elf_template/main.c
Normal file
33
src/samples/template/elf_template/main.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* PSP Software Development Kit - http://www.pspdev.org
|
||||
* -----------------------------------------------------------------------
|
||||
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
|
||||
*
|
||||
* main.c - Basic ELF template
|
||||
*
|
||||
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
|
||||
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
|
||||
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
|
||||
*
|
||||
* $Id: main.c 1888 2006-05-01 08:47:04Z tyranid $
|
||||
* $HeadURL$
|
||||
*/
|
||||
#include <pspkernel.h>
|
||||
#include <pspdebug.h>
|
||||
|
||||
#define printf pspDebugScreenPrintf
|
||||
|
||||
/* Define the module info section */
|
||||
PSP_MODULE_INFO("template", 0, 1, 1);
|
||||
|
||||
/* Define the main thread's attribute value (optional) */
|
||||
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
pspDebugScreenInit();
|
||||
|
||||
pspDebugScreenPrintf("Hello World\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
19
src/samples/template/kprx_template/Makefile.sample
Normal file
19
src/samples/template/kprx_template/Makefile.sample
Normal file
@@ -0,0 +1,19 @@
|
||||
TARGET = ktemplate
|
||||
OBJS = main.o
|
||||
|
||||
# Use the kernel's small inbuilt libc
|
||||
USE_KERNEL_LIBC = 1
|
||||
# Use only kernel libraries
|
||||
USE_KERNEL_LIBS = 1
|
||||
|
||||
INCDIR =
|
||||
CFLAGS = -O2 -G0 -Wall -fno-builtin-printf
|
||||
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
LIBDIR =
|
||||
|
||||
LIBS =
|
||||
|
||||
PSPSDK=$(shell psp-config --pspsdk-path)
|
||||
include $(PSPSDK)/lib/build_prx.mak
|
||||
12
src/samples/template/kprx_template/exports.exp
Normal file
12
src/samples/template/kprx_template/exports.exp
Normal file
@@ -0,0 +1,12 @@
|
||||
# Define the exports for the prx
|
||||
PSP_BEGIN_EXPORTS
|
||||
|
||||
# These four lines are mandatory (although you can add other functions like module_stop)
|
||||
# syslib is a psynonym for the single mandatory export.
|
||||
PSP_EXPORT_START(syslib, 0, 0x8000)
|
||||
PSP_EXPORT_FUNC(module_start)
|
||||
PSP_EXPORT_FUNC(module_stop)
|
||||
PSP_EXPORT_VAR(module_info)
|
||||
PSP_EXPORT_END
|
||||
|
||||
PSP_END_EXPORTS
|
||||
44
src/samples/template/kprx_template/main.c
Normal file
44
src/samples/template/kprx_template/main.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* PSP Software Development Kit - http://www.pspdev.org
|
||||
* -----------------------------------------------------------------------
|
||||
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
|
||||
*
|
||||
* main.c - Basic Kernel PRX template
|
||||
*
|
||||
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
|
||||
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
|
||||
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
|
||||
*
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
*/
|
||||
#include <pspkernel.h>
|
||||
#include <stdio.h>
|
||||
|
||||
PSP_MODULE_INFO("template", PSP_MODULE_KERNEL, 1, 1);
|
||||
|
||||
int main_thread(SceSize args, void *argp)
|
||||
{
|
||||
printf("Hello World\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Entry point */
|
||||
int module_start(SceSize args, void *argp)
|
||||
{
|
||||
int thid;
|
||||
|
||||
thid = sceKernelCreateThread("template", main_thread, 7, 0x800, 0, NULL);
|
||||
if(thid >= 0)
|
||||
{
|
||||
sceKernelStartThread(thid, args, argp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Module stop entry */
|
||||
int module_stop(SceSize args, void *argp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
13
src/samples/template/lib_template/Makefile.sample
Normal file
13
src/samples/template/lib_template/Makefile.sample
Normal file
@@ -0,0 +1,13 @@
|
||||
TARGET_LIB = libtemplate.a
|
||||
OBJS = template.o
|
||||
|
||||
INCDIR =
|
||||
CFLAGS = -O2 -G0 -Wall
|
||||
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
|
||||
PSPSDK=$(shell psp-config --pspsdk-path)
|
||||
include $(PSPSDK)/lib/build.mak
|
||||
18
src/samples/template/lib_template/template.c
Normal file
18
src/samples/template/lib_template/template.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* PSP Software Development Kit - http://www.pspdev.org
|
||||
* -----------------------------------------------------------------------
|
||||
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
|
||||
*
|
||||
* template.c - Template source file for a library
|
||||
*
|
||||
* Copyright (c) 2005 James F <tyranid@gmail.com>
|
||||
*
|
||||
* $Id: template.c 1888 2006-05-01 08:47:04Z tyranid $
|
||||
*/
|
||||
|
||||
#include "template.h"
|
||||
|
||||
int template_call(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
26
src/samples/template/lib_template/template.h
Normal file
26
src/samples/template/lib_template/template.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* PSP Software Development Kit - http://www.pspdev.org
|
||||
* -----------------------------------------------------------------------
|
||||
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
|
||||
*
|
||||
* template.c - Template source file for a library
|
||||
*
|
||||
* Copyright (c) 2005 James F <tyranid@gmail.com>
|
||||
*
|
||||
* $Id: template.h 1888 2006-05-01 08:47:04Z tyranid $
|
||||
*/
|
||||
|
||||
#ifndef __TEMPLATE_H
|
||||
#define __TEMPLATE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int template_call(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
15
src/samples/template/prx_template/Makefile.sample
Normal file
15
src/samples/template/prx_template/Makefile.sample
Normal file
@@ -0,0 +1,15 @@
|
||||
TARGET = template
|
||||
OBJS = main.o
|
||||
|
||||
BUILD_PRX=1
|
||||
|
||||
INCDIR =
|
||||
CFLAGS = -O2 -G0 -Wall
|
||||
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
|
||||
PSPSDK=$(shell psp-config --pspsdk-path)
|
||||
include $(PSPSDK)/lib/build.mak
|
||||
29
src/samples/template/prx_template/main.c
Normal file
29
src/samples/template/prx_template/main.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* PSP Software Development Kit - http://www.pspdev.org
|
||||
* -----------------------------------------------------------------------
|
||||
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
|
||||
*
|
||||
* main.c - Basic PRX template
|
||||
*
|
||||
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
|
||||
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
|
||||
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
|
||||
*
|
||||
* $Id: main.c 1888 2006-05-01 08:47:04Z tyranid $
|
||||
* $HeadURL$
|
||||
*/
|
||||
#include <pspkernel.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* Define the module info section */
|
||||
PSP_MODULE_INFO("template", 0, 1, 1);
|
||||
|
||||
/* Define the main thread's attribute value (optional) */
|
||||
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
printf("Hello World\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user