Xavier Del Campo Romero
8a2647469b
Makefile.cfg: select PSXSDK_PATH if defined
2021-10-24 03:10:57 +02:00
Xavier Del Campo Romero
573e4c150b
Fix vprintf(3)
...
TODO: what did this actually fix?
2021-10-24 03:10:03 +02:00
Xavier Del Campo Romero
a34280dec7
Provide buffered fread(3)
...
In order to reduce calls to seek(2) (which are very expensive), this
commit keeps a sector-sized cache for each available FILE instance,
except from the standard streams, of course.
As expected, this allows calls to fread(3) to react much faster when
small, contiguous chunks are read.
2021-10-24 03:10:03 +02:00
Xavier Del Campo Romero
9c6112eb5b
fopen_internal: return ENOENT on file not found
...
This is actually expected by open(2), but I do not expect the BIOS
implementation to conform.
2021-10-24 03:10:03 +02:00
Xavier Del Campo Romero
9157d1d6e6
lib.c: reduce NUM_OF_FILE_STRUCTS
...
Number has been reduced to a minimum to save memory.
2021-10-24 03:10:03 +02:00
Xavier Del Campo Romero
7af858caaf
Provide conforming interface for fwrite(3)
2021-10-24 03:10:03 +02:00
Xavier Del Campo Romero
cbd551e8a3
Provide implementations for strtoul(3) and strtoull(3)
2021-10-24 03:10:03 +02:00
Xavier Del Campo Romero
eaff9ccf1d
Provide implementation for perror(3)
2021-10-24 03:10:03 +02:00
Xavier Del Campo Romero
80beba98c7
Provide implementation for fprintf(3)
2021-10-24 03:10:03 +02:00
Xavier Del Campo Romero
fdf8c18335
Add conforming interfaces of standard streams
2021-10-24 03:09:47 +02:00
Xavier Del Campo Romero
ac37834fe6
fix16.h: provide fix16_from-like compile-time macros
2021-10-24 02:42:00 +02:00
Xavier Del Campo Romero
d9068688be
malloc: remove useless goto
2021-10-24 02:38:59 +02:00
Xavier Del Campo Romero
4b1beb6199
fmode_to_desmode: remove annoying debug messages
2021-10-24 02:37:52 +02:00
Xavier Del Campo Romero
60528d5913
errno.h: always define errno
2021-10-24 02:34:46 +02:00
Xavier Del Campo Romero
5f6b1e98dd
Set conforming interface for vprintf(3)
2021-10-24 02:33:52 +02:00
Xavier Del Campo Romero
58256c917e
fopen_internal: do not resolve cdromL by default
...
This avoids calling malloc(3) and thus allowing the linker to remove
the heap implementation from memory.c via --gc-sections.
2021-10-24 02:30:59 +02:00
Xavier Del Campo Romero
282a7ff1f3
Provide word-aligned access to memcpy(3) and memset(3)
2021-10-24 02:28:13 +02:00
Xavier Del Campo Romero
7de5b52faa
Use memset(3) on calloc(3)
2021-10-24 02:22:56 +02:00
Xavier Del Campo Romero
bea2c98a06
stdio.h: use NULL definition from stddef.h
2021-10-24 02:21:17 +02:00
Xavier Del Campo Romero
17832b2bed
Clear BSS space using memset(3)
2021-10-24 02:17:02 +02:00
Xavier Del Campo Romero
15e2ff6bb6
Lazy-initialize heap
2021-10-24 02:15:50 +02:00
Xavier Del Campo Romero
6989798d87
Import MEMCARD_STATUS_UNKNOWN from psxsdk-20150729
2021-01-03 01:16:34 +01:00
Xavier Del Campo Romero
faa425ef7a
Fix non-standard memset definition
2021-01-03 01:09:04 +01:00
Xavier Del Campo Romero
e3eb9612af
Add implementation for strtok_r
2021-01-03 01:02:25 +01:00
Xavier Del Campo Romero
cbd6cab28b
Provide experimental (non-working) mouse support
2021-01-03 01:02:25 +01:00
Xavier Del Campo Romero
a9b446f915
Fix const-correctness on psxgpu
...
- Added GsSetDrawEnv_DMA and GsUploadCLUT.
2021-01-03 01:02:23 +01:00
Xavier Del Campo Romero
5043ded4b6
Qualify local variables as static
2021-01-01 23:52:16 +01:00
Xavier Del Campo Romero
09910de8ee
Add debugging symbols to assembly files
2020-11-10 23:09:17 +01:00
Xavier Del Campo Romero
59e38e90a3
Remove trailing whitespaces
2020-11-09 21:01:29 +01:00
Xavier Del Campo Romero
c65395be64
Implement strerror(3) and strerror_r(3)
...
Error descriptions obtained from include/errno.h.
2020-11-08 17:37:16 +01:00
Xavier Del Campo Romero
4fb20e290e
Add PRiX* macros to inttypes.h
2020-11-08 17:33:15 +01:00
Xavier Del Campo Romero
a6a6e2aac9
Create output folders before building
2020-11-07 16:05:33 +01:00
Xavier Del Campo Romero
d3780c0d7d
Fix buffer overflow on GsLoadFont
...
LoadImage accesses img[0..15] when w=16, h=1, causing it to read past `pal`.
2020-11-07 16:03:06 +01:00
Xavier Del Campo Romero
d9acf265ff
Enable debug info
2020-11-07 16:03:06 +01:00
Xavier Del Campo Romero
89b059cace
Allocate .sbss and .common into .bss
...
GNU ld fragments .bss into .sbss and .common (see man nm(1) for further
reference). However, the linker script used by PSXSDK did not determine where
to put such sections, causing some statically allocated objects to be placed
**after** __bss_end, leading to undefined behaviour.
2020-11-07 16:02:54 +01:00
Xavi Del Campo
ad890e56b6
Fixed non-standard memset() declaration
2020-03-05 18:22:52 +01:00
Xavi Del Campo
e769a8ab05
Solved issue with pads under real hw
2020-02-01 12:14:48 +01:00
Xavi Del Campo
55e4700bc7
Minor change on COLORMODE definition
2020-02-01 11:23:06 +01:00
Xavi Del Campo
a8fb879457
Enabled debugging symbols
2020-02-01 07:20:36 +01:00
Xavi Del Campo
3ccdeed57a
Removed useless const qualifiers
2020-02-01 07:20:00 +01:00
Xavi Del Campo
805fc37a06
Added missing extern "C"
2020-02-01 00:51:53 +01:00
Xavi Del Campo
5f638ea86c
Fixed redundant conditions
2020-01-31 22:24:08 +01:00
Xavi Del Campo
10e46fc09e
Fixed undefined value on local variable
2020-01-31 22:21:19 +01:00
Xavi Del Campo
25aedbde21
Fixed buffer overflow
2020-01-31 22:19:19 +01:00
Xavi Del Campo
6f225f14b3
Fixed another invalid encoding on string literal
2020-01-31 22:17:43 +01:00
Xavi Del Campo
51e31fe4cb
Fixed invalid encoding on string literal
2020-01-31 22:16:02 +01:00
Xavi Del Campo
37d37cb102
Solved undefined value
2020-01-31 22:13:47 +01:00
Xavi Del Campo
6b14cee120
Added silent flag to mkpsxixo
2020-01-31 14:11:39 +01:00
Xavi Del Campo
aad614833a
Fixed typos and invalid width '384'
2020-01-31 14:11:12 +01:00
Xavi Del Campo
26b206560d
Added -ffunction/data-sections and -Os to libpsx
2020-01-31 14:10:20 +01:00