-
Notifications
You must be signed in to change notification settings - Fork 108
Rdpq
Giovanni Bajo edited this page Aug 30, 2024
·
4 revisions
- Low-level "raw" APIs to execute raw RDP commands, via RSP. Raw commands are close to the hardware, though they still hide a few quirks (fixing them up transparently on RSP). rdpq.h
- Higher-level APIs for loading surfaces (eg: textures) into TMEM, including support for all palettized pixel formats (for instance, as generated by the mksprite tool). rdpq_tex.h
- Drawing textured rectangles, including support for negative coordinates. rdpq_quad.h
- Drawing all kinds of screen-space RDP triangles (shaded, textured, z-buffered), with fully correct subpixel precision (no seams). This allows for simple 3D use cases where the CPU can transform the polygons and use the RDP to rasterize them. rdpq_tri.h
- Higher-level API for drawing arbitrary-sized sprites, including support for translation, scale and rotation (rotated surfaces are automatically drawn as triangles). This includes splitting the surface in multiple subrects maximizing TMEM usage, and also with optimal RDP loading command generation. rdpq_sprite.h.
- High-level user-friendly render mode configuration API, based on simple on/off commands (eg: "enable mipmap", "disable antialias"). The RSP takes care of converting this higher-level configurations into the low-level RDP register configurations. This also takes care of the complex "1-cycle vs 2-cycle" hardware configuration, including adjusting automatically combiner and blender configuration. rdpq_mode.h
- RDP validation engine: optionally, the final stream of RDP commands is piped through a validation engine that keeps track of the RDP state and emits warnings and errors for many common programming mistakes. For instance, drawing a palettized sprite without activating palette support in the render mode configuration. The validator contains 70+ different checks and is able to prevent many common mistakes (including ones that are not apparent with emulators). See rdpq_debug.h or the implementation in rdpq_debug.c
- RDP disassembly support. The validation engine can optionally also emit a textual stream of disassembled RDP commands in the debug log. This can be activated on specific portions of code to help debugging.
- Ability to pre-compile "blocks" of commands to execute many times with zero CPU usage (based on rspq).
- Automatic, efficient handling of "sync" commands where required