Commit graph

566 commits

Author SHA1 Message Date
Lephe
b2b1f00d04
fs: take const descriptor in open_generic() 2024-03-19 19:03:33 +01:00
Lephe
5ff6a518f6
gint: memory micro-optimizations 2024-03-19 19:03:17 +01:00
Lephe
bc74586a2c
render: parametrize existence of dmode in config.h
This is the first of many steps designed to reduce gint's reliance on
the FX9860G and FXCG50 macros by describing the compile target more
symbolically. The goal is to allow both for g3a compilation of fx-API
code and for a potential CP port.
2024-03-19 18:37:13 +01:00
Lephenixnoir
e0ac25fbb0
render: improve implementation of dpoly()
* Honor dwindow settings immediately (avoids useless dline() calls)
* Bound to ymin/ymax instead of doing many useless cut computations
* Remove the need for floating-point operations and division
2024-03-02 23:16:22 +00:00
Sylvain PILLOT
b802e8edef
added dpoly() rendering method 2024-03-01 17:37:35 +00:00
Lephe
d8005b5d49
kmalloc: support for PRAM0 arena
PRAM0 is mostly standard memory but it can only be read from and written
to with 32-bit memory accesses.
2024-02-04 22:10:25 +01:00
Lephe
e50769c824
kmalloc: add kmalloc_remove_arena() function 2024-02-04 22:10:01 +01:00
Lephe
542b4f0a81
fs: fix fugue_dir_explore() error not propagating to open() 2024-02-04 18:50:37 +01:00
Lephe
1e220af616
fs: fix incorrect OoM handling in fugue_dir_explore()
Non-NULL dp would be returned by alloc failure path despite having been
freed.
2024-02-04 18:17:41 +01:00
Lephe
caa68b08bf
render-fx: add image formats in public API 2024-01-31 15:51:39 +01:00
Lephe
833025f5dd
render-fx: turn bopti_image_t's data array into a pointer
It used to be a flexible array member because in the old days fxconv
could only output a fixed set of bytes, so any referencing was out the
question. Nowadays fxconv can output pretty much anything. Separating
the data pointer will be useful for PythonExtra to expose it as a Python
bytes() or bytearray() object while using the gint API.
2024-01-29 09:49:34 +01:00
Lephe
fd5a70e21b
gint: add power-off feature and shortcut in getkey() 2024-01-16 11:42:49 +01:00
Lephe
5655699cd8
gint: reload on-chip sections after world, with option to backup (#26)
Solves the power off crash, at least for programs that don't store
long-term data in on-chip memory.
2024-01-16 11:07:41 +01:00
Lephe
235fa8a361
keydev: fix timing or repeat release 2024-01-07 16:47:51 +01:00
Lephe
18a7b9ae5b
display: add dcircle() and dellipse() rendering functions
For PythonExtra#2.
2024-01-04 12:00:58 +01:00
Lephe
2bb5294578
gint: avoid annoying banner on return from menu on fx-CG
Instead of using GetKeyWait(), we directly call into an internal OS
function, which avoids the need to press a key before we can redraw over
the OS banner and VRAM when coming back. The disassembly to locate the
function was developed by Dr-Carlos.

We still have to redraw when coming back; getkey() will do it by
dupdate() by default, and it that's not a possibility for the
application an option to receive a special event and handle it manually
is provided.
2023-08-19 22:52:53 +02:00
Lephe
6d86c54507
keyboard: add keypressed() and keyreleased() functions 2023-07-24 14:08:23 +02:00
Lephe
16259deb20
render: expose some internal text rendering utilities 2023-06-04 23:24:34 +02:00
redoste
6f53fa7842
gdb: move recv buffer to the heap to support fx-9860G III smaller .data 2023-06-04 23:20:42 +02:00
redoste
5087a91101
gdb: make memory map XML more generic to ensure fx-9860G III support 2023-06-04 23:20:42 +02:00
redoste
7d3663483f
gdb: break before panicking in user code 2023-06-04 23:20:42 +02:00
redoste
6efcfa6018
ubc: panic when trying to break in code using register bank 1 2023-06-04 23:20:42 +02:00
redoste
0b7d8d6800
ubc: ignore breaks when no debug handler is set 2023-06-04 23:20:42 +02:00
redoste
9c22ecea8d
gdb: prevent TLB misses during arbitrary memory RW operations 2023-05-30 01:03:38 +02:00
redoste
02a97719ac
gdb: break when a message is recived during execution
This behaviour implements support for breaking the add-in during
execution by pressing ^C in GDB without setting a breakpoint beforehand.
2023-05-27 19:06:29 +02:00
redoste
33dae5d218
ubc: add a global lock to inform if a UBC break is being handled 2023-05-27 18:59:24 +02:00
redoste
21ff5c1d53
usb: expose the context of the interrupted function on USB interrupt 2023-05-27 18:52:05 +02:00
redoste
76c82beec6
intc: allow user-space handlers to access the interrupted context
This workaround using a gint_call_t with an odd address is not realy the
cleanest idea but it helps keep the existing intc_generic_handler in
the 32 bytes size limit of the VBR space.
2023-05-27 18:36:15 +02:00
redoste
eca05ec64c
gdb: send memory map XML to GDB to enforce hw-breakpoints 2023-05-27 17:50:44 +02:00
redoste
2f6ee59d43
gdb: add memory write support 2023-05-24 23:30:29 +02:00
redoste
3aa11b4252
gdb: add register write support 2023-05-24 23:07:41 +02:00
redoste
eab3184dbb
gdb: add "kill request" packet support by abort()ing the add-in 2023-05-24 22:22:54 +02:00
redoste
238bccddbe
gdb: add hw-breakpoint and single step support using the UBC 2023-05-24 22:21:01 +02:00
redoste
aa0ff7b10b
ubc: basic User Break Controller driver 2023-05-24 22:21:01 +02:00
redoste
0bea485f4b
gdb: first implementation with basic memory and register read support 2023-05-21 19:49:23 +02:00
Lephe
dcb876dfe0
bump version to 2.10.0 2023-04-02 00:10:13 +02:00
Lephe
82258b9f89
keysc: bind SHIFT+7+3+AC/ON to abort() for un-freeze attempts 2023-04-01 23:24:55 +02:00
Lephe
eb49f0258d
usb: show prototypes of debug functions in non-debug mode 2023-04-01 23:24:21 +02:00
Lephe
b5f0f08183
usb: use optimized DSP loop for read from module 2023-03-26 20:40:48 +02:00
Lephe
1423f40a96
usb: disable USB_LOG_TR() when no log is configured
For some reason this has a *massive* impact on read performance, like
78 ms -> 20 ms on a full-screen read (177 kB) on the CG-50.
2023-03-26 20:40:08 +02:00
Lephe
3a2a194693
usb: unaligned reading (release candidate on features)
The only thing left on the bucket list is performance.
2023-03-26 11:36:40 +02:00
Lephe
4983849510
usb: consolidate reading logic again, now beta-worthy
This looks like it could work in the long term. The only issue that
really hasn't been addressed is how to use packet counters to cut
transactions when there's no ZLP, but we can leave that for later.
2023-03-18 19:51:57 +01:00
Lephe
fc1f510288
usb: consolidate reading mode (basic multi-segment reads now working) 2023-03-12 17:53:44 +01:00
Lephe
c59b2f90fb
usb: prototype reading mode
Currently only tested with short messages using the fxlink interface.
There is much to be expanded upon, but this is a worthy start.
2023-03-04 18:06:38 +01:00
Lephe
eb1f9a35a1
usb: use negative values for error codes
This will allow usb_read_sync() to return a combined error code / size
read integer.
2023-03-04 18:06:38 +01:00
Lephe
f4e13afa84
usb: fix a missing PIPESEL access
This resulted in a random PIPECFG access.
2023-03-04 10:59:06 +01:00
Lephe
911691461f
usb: clarify functions used to access endpoint configuration
The previous scheme was really unclear. Now, an endpoint_t carries all
of the endpoint info (instead of the global address being implicitly
its array index, which couldn't be returned).

An _endpoint address_ is the 8-bit value consisting of an endpoint
number (bits 0x0f) and a direction (bit 0x80).

The _global address_ of an endpoint is the address used to communicate
with the host, and it is unique. The _local address_ of an endpoint is
the interface-specific numbering that gint provides to allow interfaces
to compose without risks of address collisions.

The complete data for an endpoint can be queried with the new functions
usb_get_endpoint_by_*() which accept global addresses, local addresses,
and pipe numbers.
2023-03-04 10:58:07 +01:00
Lephe
aee67a76f3
usb: clear pipes/FIFOs during world switches, delay configuration
* Clear pipes and FIFOs during world switches to avoid interference
  with the OS. LINK uses pipes 3 and 4, and attempts to add a second
  pipe to the fxlink interface (thus using pipe 4) would interfere with
  LINK and somehow prevent the pipe from being used (Wireshark captures
  showed no responses on that pipe). Forcing a blank state is a valid
  move because that state occurs naturally after a RESET, thus LINK and
  other add-ins must support it as well.

* Delay the application of configuration to the USB configuration stage
  (specifically, the DVST configured interrupt, even though technically
  we should do that in SET_CONFIGURATION 0). This is because we
  previously relied on world switches preserving pipe settings (by not
  changing them) to reconnect the gint driver after a world switch.
  This is no longer possible as the world switch now clears the pipes.
  The new timing makes the driver automatically re-configure as the
  connection restarts.
2023-02-18 17:15:28 +01:00
Lephe
c0671649df
usb: prevent double opening
This could happen in gintctl's USB tracer and obviously cause all sorts
of problems.
2023-02-18 16:48:28 +01:00
Lephe
53c67af52d
usb: fix wrong interface numbering (+ comments)
This worked previously because the only interface (number 0) had its
interface descriptor in first position (position 0).
2023-02-18 16:47:49 +01:00