Commit graph

376 commits

Author SHA1 Message Date
Lephe
7a3604ccbb
render-cg: allocate VRAM in the heap; default to double buffering
* Create a heap arena over the OS stack, large enough to hold two VRAMs
  as was previously done, unless GINT_NO_OS_STACK is set at compile
  time. (This replaces GINT_USER_VRAM.)

* Allocate a single VRAM in the heap at startup.

* Use double buffering by default as triple buffering is almost entirely
  useless. dudpate() waits if both VRAMs are identical to prevent
  corruption, but this can be bypassed with R61524 functions as usual.
  This adds about 180 kB of heap data to any add-in using default
  settings.
2022-05-04 20:08:52 +01:00
Lephe
f219e5c882
render-cg: add new image rendering functions with dynamic effects 2022-05-04 19:08:54 +01:00
Lephe
904ab74984
(minor) 2022-05-04 19:08:54 +01:00
Lephe
8210524152
ld: merge XRAM and YRAM into a single 16-kiB section 2022-05-04 19:08:54 +01:00
Lephe
26c5b76037
render-cg: round RGB16 images to even widths 2022-05-04 17:17:18 +01:00
Lephe
e57efb5e37
keysc: simpler keyboard device with more consistent repeats
* Stop trying to be smart and generate repeats on the fly; this breaks
  time consistency. Also if repeats are not handled in time this causes
  infinite loops.
* Move rarely-used functions to external files, simplify stuff, get rid
  of internal driver events; saves ~1 kB per add-in overall.
2022-04-23 13:34:41 +01:00
Lephe
0c2935055e
cpg: provide a function to recompute clock frequency 2022-04-15 21:08:37 +01:00
Lephe
fdadb0dd71
mpu: rename FRQCRA into FRQCR 2022-04-12 16:23:18 +01:00
Lephe
b10c065abe
mpu: update CPG definition
We should also rename FRQCRA to FRQCR.
2022-04-12 16:22:14 +01:00
Lephe
a3ce29b7b8
mpu: add BSC register definitions 2022-04-12 14:57:07 +01:00
Lephe
a7bcf6cd77
meta: mkg3a is no longer needed since fxgxa supports g3a 2022-04-11 11:12:25 +01:00
Lephe
4223164063
r61524: fix r61524_display() not fully honoring [start] 2022-03-23 20:42:37 +00:00
Lephe
93169e8803
render: fix drsize() skipping one byte past NUL
This would work if the string has double NUL, which is common enough
that this bug never came up before. x)
2022-03-22 18:48:06 +00:00
Lephe
2bf5dd93f4
bump version to 2.7.1 2022-03-19 19:27:53 +00:00
Lephe
f300338a57
fs: fix tracking of initial position with O_APPEND (*)
(*) O_APPEND is *not* functional yet, this is just a hack for write-only
streams. Currently O_APPEND does not reposition the cursor at the end of
the file before every write.
2022-03-19 19:26:23 +00:00
Lephe
48325fc54d
ld: exclude more debug sections (C++) 2022-03-19 19:26:05 +00:00
Lephe
36d66a6317
bopti: fix p4 stride omission from 1384c54b5 2022-01-18 13:50:04 +01:00
Lephe
d8b85a9fab
hardware: specify gint[HWRAM] = 8 MiB on the CG-50 2022-01-18 13:49:33 +01:00
Lephe
227c06631b
fs: buffer Fugue writes through RAM
Writing from ROM causes occasional crashes, which are fairly hard to
produce when the buffers are small.
2022-01-10 14:47:14 +01:00
Lephe
d6ada7f11f
ld: reserve stack space from the static RAM region 2022-01-10 14:47:14 +01:00
Lephe
8aea762e7a
fs: use a static variable in calls to BFile_Create()
There is no evidence that BFile_Create() keeps the address and writes
to it later on, but I'd rather be overly careful than have to debug a
stack corruption problem in half a year :)
2022-01-10 13:38:28 +01:00
Lephe
59a3b39fb4
dma: do not use ICS in foreign unbinds
I'm pretty sure it makes no difference because the OS does not rely on
interrupts for most (if not all) of its DMA operations, but it's better
to keep it clean anyway.
2022-01-10 13:36:57 +01:00
Lephe
ef8707ee9d
dma: remove IE flag at end of transfer
This should have no effect since the channel is disabled, but it's much
better to leave unused modules in predictable states.
2022-01-10 13:31:20 +01:00
Lephe
3aa1471ac5
fs: track offset of Fugue files manually
This helped locate some bugs:
* read() could read past EOF due to BFile_Read() allowing you to read up
  until the end of the last sector, beyond the file size
* pread() did not restore the file offset because the negative seek at
  the end is not relative (that was the CASIOWIN fs API), so pread()
  could not actually be written without knowing the current position
* lseek() would clamp you to EOF but still return its out-of-bounds
  arguments, as a direct result of BFile_Seek() doing that

Benefits:
* Made pread() a generic function
2022-01-06 14:05:52 +01:00
Lephe
9b02f5f1db
bump version to 2.7.0 2021-12-31 10:46:46 +01:00
Lephe
472f1245c7
fix bad indent 2021-12-31 10:37:59 +01:00
Lephe
b549fd68ba
fs: stat(), proper unlink(), rmdir() 2021-12-30 18:17:13 +01:00
Lephe
ed30895a49
properly handle the mutual dependency with fxlibc 2021-12-23 16:54:57 +01:00
Lephe
aed90d9b3c
fs: folder support, part 2 (path normalization and root) 2021-12-23 01:19:45 +01:00
Lephe
9cae0040b5
fs: folder support, part 1 (mkdir/rmdir and the opendir(3) family) 2021-12-21 19:01:00 +01:00
Lephe
34c73ba0ba
fs: fix include path for bfile.h 2021-12-15 13:32:39 +01:00
Lephe
6903bd58d5
fs: cast BFile support into generic file descriptors
This paves the way for standard streams, USB streams, and some more.
2021-12-13 18:38:47 +01:00
Lephe
321d6937e0
kernel: tentative stack overflow panic, 14 kiB stack on G-III
I saw a crash with the 12 kB stack. Added an error message to diagnose
further similar issues, and bumbed the stack to 14 kB. That's a lot of
space just for BFile but stability is queen... :x
2021-12-11 16:38:31 +01:00
Lephe
8635880bbb
fs: basic filesystem support over BFile 2021-12-11 16:38:28 +01:00
Lephe
71de4dcb95
bfile: clean up header, add BFile_Seek and BFile_GetPos 2021-12-10 07:24:12 +01:00
Lephe
2e5e56f82e
hardware: expose filesystem type in the hardware info
Filesystem type is detected with a trivial heuristic:
* fx-9860G: CASIOWIN, unless Fugue in the G-III series (OS >= 3.00)
* fx-CG 50: Always Fugue
2021-12-06 21:31:00 +01:00
Lephe
86fad757e1
kernel: increase stack size to 12 kB on SH4 fx-9860G
BFile calls on the G-III series can overflow an 8 kB stack, overriding
the VBR which is located just before (!).
2021-12-05 21:15:41 +01:00
Lephe
b7173a5109
kernel: fix incorrect interrupt save/restore for MAC on SH3 2021-11-25 14:02:04 +01:00
Lephe
055c8f405b
r61524: fix a tight freeze window due to a CPU/DMA race 2021-11-20 16:39:46 +01:00
Lephe
caf585b0a1
tmu: fix freeze when using sleep_us_spin() with interrupts on
Because of timing the interrupt handler could run before the flag is
checked.
2021-11-15 06:43:00 +01:00
Lephe
1384c54b5f
render-cg: update to bopti formats for Azur 2021-09-28 09:55:26 +02:00
Lephe
73446aae61
bfile: use non-smem syscalls for Fugue
Not sure how the design is internally, but only these ones can find
files in subfolders.
2021-09-25 15:59:47 +02:00
Lephe
192ff17303
render-cg: fix an incorrect x bound on vertical lines 2021-09-05 17:55:29 +02:00
Lephe
7adcdea5f1
keyboard: add a note about the use of transforms in getkey_opt() 2021-09-01 16:21:53 +02:00
Lephe
2d0e18f2d8
bump version to 2.6.0 2021-08-29 11:53:40 +02:00
Lephe
97934cc18e
README: clarify install command 2021-08-26 10:49:34 +02:00
Lephe
d3a2cf07a0
usb: add video capture through the fxlink protocol 2021-08-11 01:43:26 +02:00
Lephe
8713d2644f
defs: take ssize_t and off_t in the standard library 2021-07-02 09:52:17 +02:00
Lephe
545db2f9ce
r61524: add low-level get/set and start_frame functions 2021-06-22 17:52:26 +02:00
Lephe
02c1b551cd
mpu/cpg.h: specify DDCLKCR 2021-06-22 17:51:54 +02:00