1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
PSn00bSDK changelog
Items that are lower in the log are more recently implemented.
11-22-2019 by Lameguy64:
* psxapi: Added root counter or timer functions and related definitions.
* examples: Added timer example.
* psxgpu: Added DR_AREA, DR_OFFSET and DR_TWIN primitives and accompanying
setDrawArea(), setDrawOffset() and setTexWindow() macros.
* psxgpu: Added parenthesis to argument value in setlen(), setaddr() and
setcode() macros, preventing addPrims() from being used in a more
sensible manner (ie. addPrims(ot, sub_ot+3, sub_ot)).
* examples: Added render2tex render to texture example.
* psxspu: Fixed typo in spuinit.s on section specifier specifying a data
section instead of text section, resulting to jump to
non-instruction-aligned linker errors.
* psxgpu: Increased ISR stack size to 2048 bytes.
* psxsio: Added kbhit() to poll keyboard input asynchronously and stdin
is now buffered with an IRQ handler.
* psxapi: Added AddDummyTty() (for psxsio DelSIO() fix).
* psxsio: DelSIO() now calls AddDummyTty().
* libc: Fixed bug in strncpy() not placing a NULL byte at end of string.
* libc: Fixed strchr() and strrchr() declarations commented out in string.h.
* libpsn00b: Added the long awaited libpsxcd library with cdxa example.
Documentation will come soon but existing libcd docs should be good
enough for awhile.
* psxgpu: Fixed non functioning GPU DMA wait in DrawSync().
* LibPSn00b run-time library is now officially 0.15b.
10-11-2019 by Lameguy64:
* psxetc: Added FntOpen(), FntPrint() and FntFlush() functions.
* psxgpu: Fixed typo in termPrim() macro (value too long).
* examples: Added billboarding sprites example.
* psxapi: Transferred putchar() BIOS function to libc.
* libpsn00b: Updated makefiles adding -fdata-sections and -ffunction-sections
so unused functions will be stripped out, which yields smaller executables.
* libc: Fixed negative integers not displaying properly in vsprintf()/vsnprintf().
* libc: Fixed zero padding not working in vsprintf()/vsnprintf().
* fpscam: Added debug text using FntOpen(), FntPrint() and FntFlush(). Also added
_boot() call for returning to CD based serial loaders.
09-23-2019 by Lameguy64:
* libc: Added strcat() function.
* Included PSn00bSDK logo vector.
* psxgte: Added gte_stsz() macro.
* psxgpu: Fixed typos in setUVWH() macro.
* Added _boot() BIOS function (A(A0h) aka Warmboot, useful for CD based
serial loaders).
08-17-2019 by Lameguy64:
* LibPSn00b run-time library is officially version 0.13b.
* examples: updated balls and n00bdemo examples for the setDrawTPage()
correction.
* psxgpu: Fixed error on setDrawTPage() syntax and removed setDrawTPageVal()
macro (not needed).
* psxapi: Added event handler definitions related to memory cards.
* psxapi: Added BIOS memory card functions.
* examples: Added childexec example demonstrating a parent executable
transferring execution to a child executable and back.
* elf2x: s_addr no longer set on PS-EXE header, console BIOS already sets it
by STACK value in SYSTEM.CNF and allows child executables to return to
parent if left zero.
* psxapi: Renamed _InitPad(), _StartPad() and _StopPad() to InitPAD(),
StartPAD() and StopPAD() respectively. Fpscam example updated to new
syntax.
07-18-2019 by Lameguy64:
* Added fpscam example.
* Gave examples small descriptions.
* Updated readme a little.
07-17-2019 by Lameguy64:
* LibPSn00b run-time library is officially version 0.12b.
* libc: Added basic C++ support (many thanks to ijacquez).
* libc: Updated start function that should make it possible for a child
executable to return to a parent executable, return logic automatically
calls EnterCriticalSection().
* libc: Updated build method which takes libgcc from the compiler and adds
its own object files into it, eliminating linker problems caused by having
to order libc and libgcc libraries in a specific manner.
* psxgpu: Added RestartCallback().
* psxgpu: Added StoreImage() function.
* psxgpu: Fixed bugged setRECT() macro.
* libc: Added assert.h.
* examples: Balls example now has 166% more balls.
* psxgpu: Increased ISR stack size to 1024 bytes so printf can be used in
callbacks safely.
* libc: Removed int64 (long long) printing in vsprintf() for better
performance, as the R3000 does not support 64-bit arithmetic natively
so its emulated like floats. int64 still used for processing floats and
doubles and old vsprintf.c file is still included for those who really
want int64 support for whatever reason.
* libc: Removed stdarg.h which is part of GCC and not license compatible
with MPL. The toolchain compiled with libgcc provides stdarg.h and other
standard headers.
* examples: Updated sdk-common.mk variable convention for better flexibility.
* libpsn00b: Added common.mk file containing global values for all libraries.
* Updated library and toolchain build instructions.
* psxgpu: Fixed bug in DMACallback where the internal DMA handler would fail
to install due to GetInterruptCallback() retrieving the callback value
immediately in the branch delay slot of a jr instruction, which resuls to
an inconsistent return value. This also broke DrawSyncCallback().
* psxsio: Done fixes on _sio_control() from the aformentioned issues with load
instructions in delay slots.
* psxgte: Added DVECTOR struct.
* psxgpu: Added setLineF2(), setLineG2(), setLineF3() and setLineG3()
primitive macros.
* Added more functions in documentation.
07-01-2019 by williamblair:
* Fixed FntLoad() Y coordinate not working properly for debug font (due to
Y coordinate not being specified for the getTPage() macro.
06-23-2019 by Lameguy64:
* LibPSn00b Run-time Library is officially version 0.10b.
* Reworked readme file with improved build instructions.
* libpsn00b: Added missing C extern groups for C++ compatibility in
psxapi.h, stdlib.h and string.h.
* libpsn00b: Removed changelogs in the readmes of each libpsn00b library
as its much easier to keep track of changes in a single changelog than
scattering them across multiple changelogs.
* psxapi: Added Exec() function and EXEC struct.
* psxgpu: Added DrawPrim() function (uses direct I/O).
* psxgpu: VSync() function completely overhauled. Logic is now based on
Sony's code but more efficient and can return total number of vblanks
elapsed, number of hblanks since last call and wait up to n vblanks
specified by an appropriate argument value. It will also generate a
timeout when vblank interrupt stops working and would attempt to
restart it.
* psxapi: Added gets() and getc() BIOS functions.
* psxapi: Corrected a putc()/putchar() discrepancy. putc() puts a character
to a file stream, putchar() puts a character to stdout.
* Completely revised library reference manual with better formatting and
more functions documented.
* psxgpu: Added DrawSyncCallback().
* psxgpu: Implemented DMA interrupt callback system with DMACallback()
allowing to handle DMA interrupts very easily.
* libpsn00b: Implemented Serial I/O library (psxsio) with serial tty device
(installed using AddSIO) and serial callback support. Serial library
is also fully documented.
* psxgpu: Implemented IRQ callback system with InterruptCallback() allowing
to set interrupt callbacks very easily.
* psxgpu: Implemented proper IRQ handler installed using HookEntryInt or
SetCustomExitFromException() for handling VSync and other interrupts.
ChangeClearPAD(0) must now be called after _InitPad() or vsync timeout
will occur.
* libpsn00b: Started making local labels prefixed with .L instead of . making
them not appear in symbol lists resulting in a cleaner symbol dump. Still
not possible to do function-scope local labels like in ASMPSX because GAS
syntax is ASS (or ASS GAS which is farts, GAS is farts).
* psxgpu: DrawSync() function now waits for DMA completion and GPU transfer
ready instead of simply waiting for GPU transfer ready which is the likely
cause of subtle GPU related timing issues, it also sets GPU DMA transfer
mode to off afterwards. It can also read number of words remaining in DMA
transfer if a0 is non-zero but it likely only returns the correct value on
VRAM transfers. Exact way how DrawSync() returns the count in the official
SDK is currently unknown.
06-07-2019 by qbradq:
* lzpack: Swapped a buffer length litteral with sizeof operator, fixing a
stack overflow bug in some instances.
05-23-2019 by Lameguy64:
* Added dev notes.txt file in docs that includes notes about the many
quirks about the console discovered during the development of this
SDK project.
* Updated libn00bref.odf a little.
* Added turboboot example.
* Added rgb24 example.
* Got custom exit handler set using SetCustomExitFromException() (BIOS
function B(19h)) working. Currently used to acknowledge VSync IRQ but
actual VSync handling is still done with events and needs to be
transferred to the custom exit handler. At least it lets BIOS
controller functions to work now. See doc/dev notes.txt for details
on how this handler behaves.
* Made stack usage in ResetGraph() less wasteful. You only need to
allocate N words on stack based on N arguments of the function
being called.
* VSync IRQ handling now done using a custom exit from exception handler.
Actual VSync handling is yet to be moved to the custom exit handler
though.
* Made stack usage in start.s of libc a lot less wasteful.
* Implemented controller support via BIOS functions (use _InitPad(),
_StartPad() and _StopPad()). BIOS memory card functions may also
work as well but its not tested yet.
* Removed duplicate initpad.s and initcard.s functions in psxapi.
* Added _InitCd() function to psxapi which is a safer version of _96_init()
as it preserves other DMA channel settings. Use BIOS file functions such
as open(), read() and close() with path names starting with cdrom:/ to
access files from CD after calling _InitCd().
|