diff options
| author | John Wilbert M. Villamor <lameguy64@gmail.com> | 2020-01-06 09:39:20 +0800 |
|---|---|---|
| committer | John Wilbert M. Villamor <lameguy64@gmail.com> | 2020-01-06 09:39:20 +0800 |
| commit | c98ad0e7dbc48c928aaea0f78214c7ed6556417d (patch) | |
| tree | bcbafb8547eceb867f342bfe504377e13a5533a9 | |
| parent | 87ded2ccb9db9bf3b2ed40a0b02b663179d5868f (diff) | |
| download | psn00bsdk-c98ad0e7dbc48c928aaea0f78214c7ed6556417d.tar.gz | |
Some minor updates, added CD-ROM library documentation
| -rw-r--r-- | README.md | 36 | ||||
| -rw-r--r-- | changelog.txt | 10 | ||||
| -rw-r--r-- | doc/LibPSn00b Reference.odt | bin | 114279 -> 125874 bytes | |||
| -rw-r--r-- | examples/hello/main.c | 85 | ||||
| -rw-r--r-- | examples/hello/makefile | 39 | ||||
| -rw-r--r-- | examples/render2tex/textures.tpj | 6 | ||||
| -rw-r--r-- | libpsn00b/makefile | 2 | ||||
| -rw-r--r-- | libpsn00b/psxcd/_cd_control.s (renamed from libpsn00b/libpsxcd/_cd_control.s) | 0 | ||||
| -rw-r--r-- | libpsn00b/psxcd/cdgetsector.s (renamed from libpsn00b/libpsxcd/cdgetsector.s) | 0 | ||||
| -rw-r--r-- | libpsn00b/psxcd/cdmix.s (renamed from libpsn00b/libpsxcd/cdmix.s) | 0 | ||||
| -rw-r--r-- | libpsn00b/psxcd/cdsearchfile.c (renamed from libpsn00b/libpsxcd/cdsearchfile.c) | 0 | ||||
| -rw-r--r-- | libpsn00b/psxcd/makefile (renamed from libpsn00b/libpsxcd/makefile) | 0 | ||||
| -rw-r--r-- | libpsn00b/psxcd/psxcd.c (renamed from libpsn00b/libpsxcd/psxcd.c) | 0 | ||||
| -rw-r--r-- | libpsn00b/psxcd/psxcd_asm.s (renamed from libpsn00b/libpsxcd/psxcd_asm.s) | 0 | ||||
| -rw-r--r-- | libpsn00b/psxcd/readme.txt (renamed from libpsn00b/libpsxcd/readme.txt) | 0 |
15 files changed, 149 insertions, 29 deletions
@@ -33,30 +33,32 @@ As of LibPSn00b run-time library v0.15b * Extensive GPU support with polygon primitives, high-speed DMA VRAM transfers and DMA ordering table processing. All video modes for both NTSC and PAL standards also supported with fully adjustable display area and - automatic video standard detection based on last GPU mode, no BIOS ROM + automatic video standard detection based on last GPU mode. No BIOS ROM string checks used. * Extensive GTE support with rotate, translate, perspective correction and lighting through assembly macros (for both C and ASM) and high performance - matrix and vector functions, all calculations performed in fixed point + matrix and vector functions. All calculations performed in fixed point integer math. * Stable interrupt service routine with easy to use callback system for - simplified handling of hardware and DMA interrupts, no crude event handlers - or kernel hacks used and should be compatible with HLE BIOS implementations. - Should also play well with writing loader programs. + simplified handling and hooking of hardware and DMA interrupts, no crude + event handler hooks or kernel hacks used and should be compatible with + HLE BIOS implementations. Should also play well with writing loader + programs. * Complete Serial I/O support with SIOCONS driver for tty console access through serial interface. * BIOS controller functions for polling controller input work as intended - thanks to proper interrupt handling, no crude manual polling of controllers + thanks to proper interrupt handling. No crude manual polling of controllers in your main loop. * Full CD-ROM support with data reading, CD audio and XA audio playback. Features built-in ISO9660 file system parser for locating files and - supports directories containing more than 30 files. Data streaming - should also be possible. + supports directories containing more than 30 files (classic ISO9660 only, + no Rock Ridge or Joliet extensions support). Data streaming should also be + possible. * Uses Sony SDK library syntax for familiarity to experienced programmers and to make porting existing homebrew projects to PSn00bSDK easier. @@ -157,21 +159,11 @@ and contributed example programs are welcome. * psxgte: Higher level GTE rotate translate and perspective functions, and many matrix transformation functions yet to be implemented. -* psxspu: Plenty of work to be done. - -* psxapi: BIOS function calls intended for stdio may need to be moved - to libc instead. - -* psxetc: Text stream stuff (FntOpen(), FntPrint(), FndFlush()) for - debug purposes yet to be implemented. +* psxspu: Plenty of work to be done. Hardware timer driven sound/music + system may need to be implemented (an equivalent to the Ss* series of + functions in libspu basically). -* And many more. - -There's been some working prototype CD-ROM code in the works for PSn00bSDK -that is functional enough to play CD Audio tracks. The prototype code can -be found in the SVN repo of PSn00bSDK which can be found in the PSn00bSDK -page of Lameguy64's website, if you're interested to work on the CD-ROM -implementation yourself. +* Support for MDEC. ## Usage terms diff --git a/changelog.txt b/changelog.txt index 66b847b..5c0f824 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,16 @@ PSn00bSDK changelog Items that are lower in the log are more recently implemented. + +01-06-2020 by Lameguy64: + +* libpsn00b: Renamed libpsxcd directory to psxcd to match with other libraries. + +* examples: Added obligatory hello world example. + +* documentation: Added CD-ROM library documentation. + + 11-22-2019 by Lameguy64: * psxapi: Added root counter or timer functions and related definitions. diff --git a/doc/LibPSn00b Reference.odt b/doc/LibPSn00b Reference.odt Binary files differindex d12510c..1b4afef 100644 --- a/doc/LibPSn00b Reference.odt +++ b/doc/LibPSn00b Reference.odt diff --git a/examples/hello/main.c b/examples/hello/main.c new file mode 100644 index 0000000..6cd03f9 --- /dev/null +++ b/examples/hello/main.c @@ -0,0 +1,85 @@ +#include <stdio.h> +#include <psxgpu.h> +#include <psxgte.h> +#include <psxetc.h> + +#define PAL + +#ifdef PAL + +#define SCREEN_XRES 320 +#define SCREEN_YRES 256 + +#else + +#define SCREEN_XRES 320 +#define SCREEN_YRES 240 + +#endif + +typedef struct DB +{ + DISPENV disp; + DRAWENV draw; +} DB; + +DB db[2]; +int db_active; + +void init(void) +{ + ResetGraph(0); + + SetDefDispEnv(&db[0].disp, 0, 0, SCREEN_XRES, SCREEN_YRES); + SetDefDispEnv(&db[1].disp, 0, SCREEN_YRES, SCREEN_XRES, SCREEN_YRES); + + SetDefDrawEnv(&db[0].draw, 0, SCREEN_YRES, SCREEN_XRES, SCREEN_YRES); + SetDefDrawEnv(&db[1].draw, 0, 0, SCREEN_XRES, SCREEN_YRES); + + db[0].draw.isbg = 1; + setRGB0(&db[0].draw, 63, 0, 127); + db[1].draw.isbg = 1; + setRGB0(&db[1].draw, 63, 0, 127); + +#ifdef PAL + SetVideoMode(MODE_PAL); + db[0].disp.screen.y = 18; + db[1].disp.screen.y = 18; + db[0].disp.screen.h = 256; + db[1].disp.screen.h = 256; +#endif + + PutDispEnv(&db[0].disp); + PutDrawEnv(&db[0].draw); + db_active = 0; + + FntLoad(960, 0); + FntOpen(0, 8, SCREEN_XRES, SCREEN_YRES-16, 0, 100); +} + +void display(void) +{ + FntFlush(-1); + DrawSync(0); + VSync(0); + + db_active = !db_active; + PutDispEnv(&db[db_active].disp); + PutDrawEnv(&db[db_active].draw); + SetDispMask(1); +} + +int main(int argc, const char *argv[]) +{ + int count = 0; + + init(); + + while(1) + { + FntPrint(-1, "HELLO WORLD\n"); + FntPrint(-1, "COUNTER=%d\n", count); + display(); + count++; + } +}
\ No newline at end of file diff --git a/examples/hello/makefile b/examples/hello/makefile new file mode 100644 index 0000000..3350b85 --- /dev/null +++ b/examples/hello/makefile @@ -0,0 +1,39 @@ +include ../sdk-common.mk + +TARGET = hello.elf + +CFILES = $(notdir $(wildcard *.c)) +CPPFILES = $(notdir $(wildcard *.cpp)) +AFILES = $(notdir $(wildcard *.s)) + +OFILES = $(addprefix build/,$(CFILES:.c=.o) $(CPPFILES:.cpp=.o) $(AFILES:.s=.o)) + +INCLUDE += +LIBDIRS += + +LIBS = -lpsxetc -lpsxgpu -lpsxgte -lpsxspu -lpsxapi -lc + +CFLAGS = -g -O2 -fno-builtin -fdata-sections -ffunction-sections +CPPFLAGS = $(CFLAGS) -fno-exceptions +AFLAGS = -g -msoft-float +LDFLAGS = -g -Ttext=0x80010000 -gc-sections -T $(GCC_BASE)/mipsel-unknown-elf/lib/ldscripts/elf32elmip.x + +CC = $(PREFIX)gcc +CXX = $(PREFIX)g++ +AS = $(PREFIX)as +LD = $(PREFIX)ld + +all: $(OFILES) + $(LD) $(LDFLAGS) $(LIBDIRS) $(OFILES) $(LIBS) -o $(TARGET) + elf2x -q $(TARGET) + +build/%.o: %.c + @mkdir -p $(dir $@) + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +build/%.o: %.s + @mkdir -p $(dir $@) + $(CC) $(AFLAGS) $(INCLUDE) -c $< -o $@ + +clean: + rm -rf build $(TARGET) $(TARGET:.elf=.exe) diff --git a/examples/render2tex/textures.tpj b/examples/render2tex/textures.tpj deleted file mode 100644 index b34d4fd..0000000 --- a/examples/render2tex/textures.tpj +++ /dev/null @@ -1,6 +0,0 @@ -<tim_project> - <properties buffer_res="2" buffer_order="4"/> - <tim_group name="global"> - <tim>C:\Users\Lameguy64\Desktop\Projects\psn00bsdk\examples\render2tex\blendpattern-16c.tim</tim> - </tim_group> -</tim_project> diff --git a/libpsn00b/makefile b/libpsn00b/makefile index f095f17..b3f6896 100644 --- a/libpsn00b/makefile +++ b/libpsn00b/makefile @@ -4,7 +4,7 @@ TOPTARGETS = all clean -LIBDIRS = libc lzp psxgpu psxgte psxapi psxetc psxspu psxsio libpsxcd +LIBDIRS = libc lzp psxgpu psxgte psxapi psxetc psxspu psxsio psxcd $(TOPTARGETS): $(LIBDIRS) diff --git a/libpsn00b/libpsxcd/_cd_control.s b/libpsn00b/psxcd/_cd_control.s index 7f69266..7f69266 100644 --- a/libpsn00b/libpsxcd/_cd_control.s +++ b/libpsn00b/psxcd/_cd_control.s diff --git a/libpsn00b/libpsxcd/cdgetsector.s b/libpsn00b/psxcd/cdgetsector.s index 70039bf..70039bf 100644 --- a/libpsn00b/libpsxcd/cdgetsector.s +++ b/libpsn00b/psxcd/cdgetsector.s diff --git a/libpsn00b/libpsxcd/cdmix.s b/libpsn00b/psxcd/cdmix.s index 745fb65..745fb65 100644 --- a/libpsn00b/libpsxcd/cdmix.s +++ b/libpsn00b/psxcd/cdmix.s diff --git a/libpsn00b/libpsxcd/cdsearchfile.c b/libpsn00b/psxcd/cdsearchfile.c index 60e4377..60e4377 100644 --- a/libpsn00b/libpsxcd/cdsearchfile.c +++ b/libpsn00b/psxcd/cdsearchfile.c diff --git a/libpsn00b/libpsxcd/makefile b/libpsn00b/psxcd/makefile index 87466b3..87466b3 100644 --- a/libpsn00b/libpsxcd/makefile +++ b/libpsn00b/psxcd/makefile diff --git a/libpsn00b/libpsxcd/psxcd.c b/libpsn00b/psxcd/psxcd.c index 5be9eec..5be9eec 100644 --- a/libpsn00b/libpsxcd/psxcd.c +++ b/libpsn00b/psxcd/psxcd.c diff --git a/libpsn00b/libpsxcd/psxcd_asm.s b/libpsn00b/psxcd/psxcd_asm.s index 7fe1c1d..7fe1c1d 100644 --- a/libpsn00b/libpsxcd/psxcd_asm.s +++ b/libpsn00b/psxcd/psxcd_asm.s diff --git a/libpsn00b/libpsxcd/readme.txt b/libpsn00b/psxcd/readme.txt index a85fab5..a85fab5 100644 --- a/libpsn00b/libpsxcd/readme.txt +++ b/libpsn00b/psxcd/readme.txt |
