diff --git a/TODO b/TODO index 95c258f..5d6bd33 100644 --- a/TODO +++ b/TODO @@ -2,6 +2,7 @@ For the 2.0.0 release: * bopti: remove image_t, leaving only bopti_image_t * project: remove the compat branch * gray: remove g*() functions +* core: remove the boot log Crucial, missing things. ! core: the four basic memory functions (with automated tests) diff --git a/include/gint/display-cg.h b/include/gint/display-cg.h index f850090..6d47ef4 100644 --- a/include/gint/display-cg.h +++ b/include/gint/display-cg.h @@ -19,7 +19,7 @@ #define DWIDTH 396 #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 data when not drawing. Triple buffering is already implemented in gint, see the dvram() function below. @@ -84,7 +84,7 @@ typedef struct // 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 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 @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 */ diff --git a/src/render-cg/dvram.c b/src/render-cg/dvram.c index 9a0f104..ab874bd 100644 --- a/src/render-cg/dvram.c +++ b/src/render-cg/dvram.c @@ -7,8 +7,8 @@ static uint16_t *scnd = (void *)0xac11b500; /* Shared VRAM pointer, the one exposed by */ uint16_t *gint_vram = (void *)0xac0f0000; -/* dvram() - control video RAM address and triple buffering */ -void dvram(uint16_t *new_main, uint16_t *new_secondary) +/* dsetvram() - Control video RAM address and triple buffering */ +void dsetvram(uint16_t *new_main, uint16_t *new_secondary) { if(gint_vram == main) gint_vram = new_main; 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; } -/* 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(). */ void dvram_switch(void) {