quick fixes and definitely a few bugs in there

This commit is contained in:
Lephe 2024-03-21 19:08:14 +01:00
parent 2e5f99a996
commit 3edb80018c
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
4 changed files with 18 additions and 12 deletions

View File

@ -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()

View File

@ -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 */

View File

@ -2,7 +2,7 @@
#include <gint/kmalloc.h>
#include <gint/config.h>
#include <gint/drivers/r61524.h>
#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);
void _WEAK_dupdate(void);

View File

@ -6,9 +6,11 @@
#include <gint/drivers/r61524.h>
#include <gint/gray.h>
#include <gint/display.h>
#include <gint/kmalloc.h>
#include <stdlib.h>
#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;