mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-29 13:03:36 +01:00
render-cg: expose vram buffers with dgetvram() and dsetvram()
This commit is contained in:
parent
d3c43c3ecd
commit
e217309adf
3 changed files with 18 additions and 6 deletions
1
TODO
1
TODO
|
@ -2,6 +2,7 @@ For the 2.0.0 release:
|
||||||
* bopti: remove image_t, leaving only bopti_image_t
|
* bopti: remove image_t, leaving only bopti_image_t
|
||||||
* project: remove the compat branch
|
* project: remove the compat branch
|
||||||
* gray: remove g*() functions
|
* gray: remove g*() functions
|
||||||
|
* core: remove the boot log
|
||||||
|
|
||||||
Crucial, missing things.
|
Crucial, missing things.
|
||||||
! core: the four basic memory functions (with automated tests)
|
! core: the four basic memory functions (with automated tests)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#define DWIDTH 396
|
#define DWIDTH 396
|
||||||
#define DHEIGHT 224
|
#define DHEIGHT 224
|
||||||
|
|
||||||
/* gint VRAM address. This value must always point to a 32-aligned bufer of
|
/* gint VRAM address. This value must always point to a 32-aligned buffer of
|
||||||
size 177408. Any function can use it freely to perform rendering or store
|
size 177408. Any function can use it freely to perform rendering or store
|
||||||
data when not drawing. Triple buffering is already implemented in gint, see
|
data when not drawing. Triple buffering is already implemented in gint, see
|
||||||
the dvram() function below.
|
the dvram() function below.
|
||||||
|
@ -84,7 +84,7 @@ typedef struct
|
||||||
// Video RAM management
|
// Video RAM management
|
||||||
//---
|
//---
|
||||||
|
|
||||||
/* dvram() - Control video RAM address and triple buffering
|
/* dsetvram() - Control video RAM address and triple buffering
|
||||||
|
|
||||||
Normal rendering under gint uses double-buffering: there is one image
|
Normal rendering under gint uses double-buffering: there is one image
|
||||||
displayed on the screen and one in memory, in a region called the video RAM
|
displayed on the screen and one in memory, in a region called the video RAM
|
||||||
|
@ -112,7 +112,11 @@ typedef struct
|
||||||
|
|
||||||
@main Main VRAM area, used alone if [secondary] is NULL
|
@main Main VRAM area, used alone if [secondary] is NULL
|
||||||
@secondary Additional VRAM area, enables triple buffering if non-NULL */
|
@secondary Additional VRAM area, enables triple buffering if non-NULL */
|
||||||
void dvram(uint16_t *main, uint16_t *secondary);
|
void dsetvram(uint16_t *main, uint16_t *secondary);
|
||||||
|
|
||||||
|
/* dgetvram() - Get VRAM addresses
|
||||||
|
Returns the VRAM buffer addresses used to render on fx-CG 50. */
|
||||||
|
void dgetvram(uint16_t **main, uint16_t **secondary);
|
||||||
|
|
||||||
#endif /* FXCG50 */
|
#endif /* FXCG50 */
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ static uint16_t *scnd = (void *)0xac11b500;
|
||||||
/* Shared VRAM pointer, the one exposed by <gint/display.h> */
|
/* Shared VRAM pointer, the one exposed by <gint/display.h> */
|
||||||
uint16_t *gint_vram = (void *)0xac0f0000;
|
uint16_t *gint_vram = (void *)0xac0f0000;
|
||||||
|
|
||||||
/* dvram() - control video RAM address and triple buffering */
|
/* dsetvram() - Control video RAM address and triple buffering */
|
||||||
void dvram(uint16_t *new_main, uint16_t *new_secondary)
|
void dsetvram(uint16_t *new_main, uint16_t *new_secondary)
|
||||||
{
|
{
|
||||||
if(gint_vram == main) gint_vram = new_main;
|
if(gint_vram == main) gint_vram = new_main;
|
||||||
else if(gint_vram == scnd) gint_vram = new_secondary;
|
else if(gint_vram == scnd) gint_vram = new_secondary;
|
||||||
|
@ -17,7 +17,14 @@ void dvram(uint16_t *new_main, uint16_t *new_secondary)
|
||||||
scnd = new_secondary;
|
scnd = new_secondary;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dvram_switch() - triple buffering switch
|
/* dgetvram() - Get VRAM addresses */
|
||||||
|
void dgetvram(uint16_t **ptr_main, uint16_t **ptr_scnd)
|
||||||
|
{
|
||||||
|
if(ptr_main) *ptr_main = main;
|
||||||
|
if(ptr_scnd) *ptr_scnd = scnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* dvram_switch() - Triple buffering switch
|
||||||
This function is not public, it is used only by dupdate(). */
|
This function is not public, it is used only by dupdate(). */
|
||||||
void dvram_switch(void)
|
void dvram_switch(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue