From 3edb80018ca2fdb75fd630f391ebb72eebdc7500 Mon Sep 17 00:00:00 2001 From: Lephe Date: Thu, 21 Mar 2024 19:08:14 +0100 Subject: [PATCH] quick fixes and definitely a few bugs in there --- CMakeLists.txt | 6 +++--- include/gint/config.h.in | 8 ++++++-- src/render-fxascg/dupdate.c | 10 +++++----- src/render-fxascg/engine_fxascg.c | 6 ++++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 268ba19..4d02144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,14 +312,14 @@ if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) ${LINKER_SCRIPTS}) endif() -if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_AS_CG) +if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A) add_compile_options(-DFXCG50) add_compile_definitions(FX9860G_AS_CG) - set(NAME "gint-fxascg") + set(NAME "gint-fxg3a") set(LINKER_SCRIPTS "${CMAKE_CURRENT_BINARY_DIR}/fxcg50.ld" "${CMAKE_CURRENT_BINARY_DIR}/fxcg50_fastload.ld") - add_library(gint-fxascg STATIC ${SOURCES_COMMON} ${SOURCES_FXASCG} ${ASSETS_FX} + add_library(gint-fxg3a STATIC ${SOURCES_COMMON} ${SOURCES_FXASCG} ${ASSETS_FX} ${LINKER_SCRIPTS}) endif() diff --git a/include/gint/config.h.in b/include/gint/config.h.in index 6e3d500..347e29c 100644 --- a/include/gint/config.h.in +++ b/include/gint/config.h.in @@ -20,7 +20,7 @@ #if defined(FX9860G) # define GINT_HW_FX 1 # define GINT_HW_CG 0 -#elif defined(FXCG50) +#elif defined(FXCG50) || defined(FX9860G_AS_CG) # define GINT_HW_FX 0 # define GINT_HW_CG 1 #endif @@ -57,6 +57,10 @@ /* GINT_RENDER_DMODE: Selects whether the dmode override is available on rendering functions. */ -#define GINT_RENDER_DMODE GINT_HW_FX +#if defined(FX9860G_AS_CG) +# define GINT_RENDER_DMODE 1 +#else +# define GINT_RENDER_DMODE GINT_HW_FX +#endif #endif /* GINT_CONFIG */ diff --git a/src/render-fxascg/dupdate.c b/src/render-fxascg/dupdate.c index af4e11d..6d97813 100644 --- a/src/render-fxascg/dupdate.c +++ b/src/render-fxascg/dupdate.c @@ -2,7 +2,7 @@ #include #include #include -#include "../render-fx/render-fx.h" +#include "../render/render.h" /* The destination VRAM for upscaling + centering + conversion B&W --> 16bits RGB565 */ uint16_t *cg_vram; // set to 0 at initialisation @@ -48,11 +48,11 @@ bool dvram_init( void ) void dgetvram(uint16_t **ptr_vram_1, uint16_t **ptr_vram_2) { - if(ptr_vram_1) *ptr_vram_1 = &cg_vram; - if(ptr_vram_2) *ptr_vram_2 = &cg_vram; + if(ptr_vram_1) *ptr_vram_1 = cg_vram; + if(ptr_vram_2) *ptr_vram_2 = cg_vram; } -inline drawupscale( int x, int y, int color ) +void drawupscale( int x, int y, int color ) { int u=y*396*3; int v=x*3; @@ -134,4 +134,4 @@ void dupdate(void) gint_call(dupdate_get_hook()); } __attribute__((alias("dupdate"))) -void _WEAK_dupdate(void); \ No newline at end of file +void _WEAK_dupdate(void); diff --git a/src/render-fxascg/engine_fxascg.c b/src/render-fxascg/engine_fxascg.c index aedd5ed..00ce56c 100644 --- a/src/render-fxascg/engine_fxascg.c +++ b/src/render-fxascg/engine_fxascg.c @@ -6,9 +6,11 @@ #include #include #include +#include #include +#include "../render/render.h" #include "../render-fx/render-fx.h" /* Three additional video RAMS, allocated statically if --static-gray was set @@ -63,7 +65,7 @@ static void gray_quit(void); static int gray_isinit(void) { //return (vrams[0] && vrams[1] && vrams[2] && vrams[3] && timer >= 0); - return (vrams[0] && vrams[1] >= 0); + return (vrams[0] && vrams[1]); } @@ -192,7 +194,7 @@ int dgray(int mode) } /* convert the gray scale into RGB565 and draw in the virutal VRAMthe 3x3 pixels upscaled and centered */ -inline gdrawupscale( int x, int y, int color_fx ) +void gdrawupscale( int x, int y, int color_fx ) { int u=y*396*3; int v=x*3;