gint: switch from file filters to config macros + basic fxg3a target

Nothing interesting in this commit, just moving files around, making
sure every target compiles every file, and controlling with macros
instead.

Basic support for fxg3a target in CMakeLists.txt, cmake/FindGint.cmake,
giteapc.make and include/gint/config.h.in. The rest is forgettable.
This commit is contained in:
Lephe 2024-03-23 10:02:51 +01:00
parent b2b1f00d04
commit 28bea2e1ce
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
112 changed files with 1128 additions and 687 deletions

View File

@ -22,7 +22,7 @@ else()
endif()
configure_file(include/gint/config.h.in include/gint/config.h)
set(SOURCES_COMMON
set(SOURCES
# Clock Pulse Generator driver
src/cpg/cpg.c
src/cpg/overclock.c
@ -70,73 +70,6 @@ set(SOURCES_COMMON
src/fs/fugue/fugue_rmdir.c
src/fs/fugue/fugue_unlink.c
src/fs/fugue/util.c
# Interrupt Controller driver
src/intc/intc.c
src/intc/inth.s
# Kernel
src/kernel/exch.c
src/kernel/exch.s
src/kernel/hardware.c
src/kernel/inth.S
src/kernel/kernel.c
src/kernel/osmenu.c
src/kernel/start.c
src/kernel/syscalls.S
src/kernel/tlbh.S
src/kernel/world.c
# Key Scan Interface driver
src/keysc/getkey.c
src/keysc/iokbd.c
src/keysc/keycodes.c
src/keysc/keydev.c
src/keysc/keydev_idle.c
src/keysc/keydev_process_key.c
src/keysc/keydown_all.c
src/keysc/keydown_any.c
src/keysc/keysc.c
src/keysc/scan_frequency.c
# Memory allocator
src/kmalloc/arena_gint.c
src/kmalloc/arena_osheap.c
src/kmalloc/kmalloc.c
# MMU driver
src/mmu/mmu.c
# Rendering
src/render/dcircle.c
src/render/dellipse.c
src/render/dhline.c
src/render/dimage.c
src/render/dline.c
src/render/dpoly.c
src/render/dprint.c
src/render/drect_border.c
src/render/dtext.c
src/render/dupdate_hook.c
src/render/dvline.c
src/render/dwindow.c
src/render/topti.c
# RTC driver
src/rtc/rtc.c
src/rtc/rtc_ticks.c
# Sound Processing Unit driver
src/spu/spu.c
# Timer Unit driver
src/tmu/inth-etmu.s
src/tmu/inth-tmu.s
src/tmu/sleep.c
src/tmu/tmu.c
# USB driver
src/usb/asyncio.c
src/usb/classes/ff-bulk.c
src/usb/configure.c
src/usb/pipes.c
src/usb/read4.S
src/usb/setup.c
src/usb/string.c
src/usb/usb.c
src/usb/write4.S
)
set(SOURCES_FX
# Gray engine
src/gray/engine.c
src/gray/gclear.c
@ -146,30 +79,6 @@ set(SOURCES_FX
src/gray/grect.c
src/gray/gsubimage.c
src/gray/gtext.c
# Rendering
src/render-fx/bopti-asm-gray-scsp.s
src/render-fx/bopti-asm-gray.s
src/render-fx/bopti-asm-mono-scsp.s
src/render-fx/bopti-asm.s
src/render-fx/bopti.c
src/render-fx/dclear.c
src/render-fx/dgetpixel.c
src/render-fx/dpixel.c
src/render-fx/drect.c
src/render-fx/dsubimage.c
src/render-fx/dupdate.c
src/render-fx/gint_dline.c
src/render-fx/masks.c
src/render-fx/topti-asm.s
src/render-fx/topti.c
# T6K11 driver
src/t6k11/t6k11.c
src/usb/classes/ff-bulk-gray.c
)
set(SOURCES_CG
# R61524 driver
src/r61524/r61524.c
# Image library
src/image/image_alloc.c
src/image/image_alloc_palette.c
@ -201,7 +110,54 @@ set(SOURCES_CG
src/image/image_valid.c
src/image/image_vflip.c
src/image/image_vflip_alloc.c
# Rendering
# Interrupt Controller driver
src/intc/intc.c
src/intc/inth.s
# Kernel
src/kernel/exch.c
src/kernel/exch.s
src/kernel/hardware.c
src/kernel/inth.S
src/kernel/kernel.c
src/kernel/osmenu.c
src/kernel/start.c
src/kernel/syscalls.S
src/kernel/tlbh.S
src/kernel/world.c
# Key Scan Interface driver
src/keysc/getkey.c
src/keysc/iokbd.c
src/keysc/keycodes.c
src/keysc/keydev.c
src/keysc/keydev_idle.c
src/keysc/keydev_process_key.c
src/keysc/keydown_all.c
src/keysc/keydown_any.c
src/keysc/keysc.c
src/keysc/scan_frequency.c
# Memory allocator
src/kmalloc/arena_gint.c
src/kmalloc/arena_osheap.c
src/kmalloc/kmalloc.c
# MMU driver
src/mmu/mmu.c
# R61524 display driver
src/r61524/r61524.c
# Format-agnostic rendering
src/render/dcircle.c
src/render/dellipse.c
src/render/dhline.c
src/render/dimage.c
src/render/dline.c
src/render/dpoly.c
src/render/dprint.c
src/render/drect_border.c
src/render/dtext.c
src/render/dupdate_hook.c
src/render/dvline.c
src/render/dwindow.c
src/render/topti.c
# RGB Rendering
src/render-cg/dclear.c
src/render-cg/dgetpixel.c
src/render-cg/dpixel.c
@ -210,9 +166,9 @@ set(SOURCES_CG
src/render-cg/dupdate.c
src/render-cg/dvram.c
src/render-cg/gint_dline.c
src/render-cg/topti-asm.s
src/render-cg/topti-asm.S
src/render-cg/topti.c
# Fast image renderer
# Fast RGB image renderer
src/render-cg/image/image.c
src/render-cg/image/image_rgb16.S
src/render-cg/image/image_rgb16_normal.S
@ -229,7 +185,7 @@ set(SOURCES_CG
src/render-cg/image/image_p4_clearbg_alt.S
src/render-cg/image/image_p4_swapcolor.S
src/render-cg/image/image_p4_dye.S
# Interface to the fast image renderer
# Interface to the fast RGB image renderer
src/render-cg/image/image_rgb16.c
src/render-cg/image/image_rgb16_effect.c
src/render-cg/image/image_rgb16_swapcolor.c
@ -243,6 +199,45 @@ set(SOURCES_CG
src/render-cg/image/image_p4_effect.c
src/render-cg/image/image_p4_swapcolor.c
src/render-cg/image/image_p4_dye.c
# Mono rendering
src/render-fx/bopti-asm-gray-scsp.S
src/render-fx/bopti-asm-gray.S
src/render-fx/bopti-asm-mono-scsp.S
src/render-fx/bopti-asm.S
src/render-fx/bopti.c
src/render-fx/dclear.c
src/render-fx/dgetpixel.c
src/render-fx/dpixel.c
src/render-fx/drect.c
src/render-fx/dsubimage.c
src/render-fx/dupdate.c
src/render-fx/gint_dline.c
src/render-fx/masks.c
src/render-fx/topti-asm.S
src/render-fx/topti.c
# RTC driver
src/rtc/rtc.c
src/rtc/rtc_ticks.c
# Sound Processing Unit driver
src/spu/spu.c
# T6K11 display driver
src/t6k11/t6k11.c
# Timer Unit driver
src/tmu/inth-etmu.s
src/tmu/inth-tmu.s
src/tmu/sleep.c
src/tmu/tmu.c
# USB driver
src/usb/asyncio.c
src/usb/classes/ff-bulk.c
src/usb/classes/ff-bulk-gray.c
src/usb/configure.c
src/usb/pipes.c
src/usb/read4.S
src/usb/setup.c
src/usb/string.c
src/usb/usb.c
src/usb/write4.S
)
set(ASSETS_FX src/font5x7.png)
@ -259,8 +254,7 @@ if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
set(NAME "gint-fx")
set(LINKER_SCRIPTS
"${CMAKE_CURRENT_BINARY_DIR}/fx9860g.ld")
add_library(gint-fx STATIC ${SOURCES_COMMON} ${SOURCES_FX} ${ASSETS_FX}
${LINKER_SCRIPTS})
add_library(${NAME} STATIC ${SOURCES} ${ASSETS_FX} ${LINKER_SCRIPTS})
endif()
if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
@ -269,8 +263,16 @@ if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
set(LINKER_SCRIPTS
"${CMAKE_CURRENT_BINARY_DIR}/fxcg50.ld"
"${CMAKE_CURRENT_BINARY_DIR}/fxcg50_fastload.ld")
add_library(gint-cg STATIC ${SOURCES_COMMON} ${SOURCES_CG} ${ASSETS_CG}
${LINKER_SCRIPTS})
add_library(${NAME} STATIC ${SOURCES} ${ASSETS_CG} ${LINKER_SCRIPTS})
endif()
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A)
add_compile_definitions(FX9860G_G3A)
set(NAME "gint-fxg3a")
set(LINKER_SCRIPTS
"${CMAKE_CURRENT_BINARY_DIR}/fxcg50.ld"
"${CMAKE_CURRENT_BINARY_DIR}/fxcg50_fastload.ld")
add_library(${NAME} STATIC ${SOURCES} ${ASSETS_FX} ${LINKER_SCRIPTS})
endif()
set_target_properties("${NAME}" PROPERTIES OUTPUT_NAME "${NAME}")

View File

@ -7,6 +7,10 @@ elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
set(PC fx)
set(INTF_DEFN FX9860G)
set(INTF_LINK "-T;fx9860g.ld")
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A)
set(PC fxg3a)
set(INTF_DEFN FX9860G_G3A)
set(INTF_LINK "-T;fxcg50.ld")
else()
message(FATAL_ERROR "gint: unknown fxSDK platform '${FXSDK_PLATFORM}'")
endif()

View File

@ -5,14 +5,17 @@
configure:
@ fxsdk build-fx -c $(GINT_CMAKE_OPTIONS)
@ fxsdk build-cg -c $(GINT_CMAKE_OPTIONS)
@ fxsdk build-fxg3a -c $(GINT_CMAKE_OPTIONS)
build:
@ fxsdk build-fx
@ fxsdk build-cg
@ fxsdk build-fxg3a
install:
@ fxsdk build-fx install
@ fxsdk build-cg install
@ fxsdk build-fxg3a install
uninstall:
@ if [ -e build-fx/install_manifest.txt ]; then \
@ -21,5 +24,8 @@ uninstall:
@ if [ -e build-cg/install_manifest.txt ]; then \
xargs rm -f < build-cg/install_manifest.txt; \
fi
@ if [ -e build-fxg3a/install_manifest.txt ]; then \
xargs rm -f < build-fxg3a/install_manifest.txt; \
fi
.PHONY: configure build install uninstall

View File

@ -5,8 +5,6 @@
#ifndef GINT_CONFIG
#define GINT_CONFIG
#include <gint/defs/types.h>
/* GINT_VERSION: Latest tag and number of additional commits
"2.1.0" = Release 2.1.0
"2.1.1-5" = 5 commits after release 2.1.1 */
@ -25,6 +23,13 @@
# define GINT_HW_CG 1
#endif
/* Shorthand to simplify definitions below. Won't be needed for long. */
#if defined(FX9860G_G3A)
# define GINT_FX9860G_G3A 1
#else
# define GINT_FX9860G_G3A 0
#endif
/* GINT_OS_{FX,CG}: Identifies the type of OS API we're assuming. Currently I
see no reason this would be different from hardware, but who knows. */
#define GINT_OS_FX GINT_HW_FX
@ -57,6 +62,11 @@
/* GINT_RENDER_DMODE: Selects whether the dmode override is available on
rendering functions. */
#define GINT_RENDER_DMODE GINT_HW_FX
#define GINT_RENDER_DMODE (GINT_HW_FX || GINT_FX9860G_G3A)
/* GINT_RENDER_{MONO,RGB}: Enable the mono/rgb rendering API.
Currently these are exclusive. */
#define GINT_RENDER_MONO (GINT_HW_FX || GINT_FX9860G_G3A)
#define GINT_RENDER_RGB (GINT_HW_CG && !GINT_FX9860G_G3A)
#endif /* GINT_CONFIG */

View File

@ -15,7 +15,7 @@
#ifndef GINT_DISPLAY_CG
#define GINT_DISPLAY_CG
#ifdef FXCG50
#if GINT_RENDER_RGB
#ifdef __cplusplus
extern "C" {
@ -104,6 +104,6 @@ void dgetvram(uint16_t **main, uint16_t **secondary);
}
#endif
#endif /* FXCG50 */
#endif /* GINT_RENDER_RGB */
#endif /* GINT_DISPLAY_CG */

View File

@ -9,7 +9,7 @@
#ifndef GINT_DISPLAY_FX
#define GINT_DISPLAY_FX
#ifdef FX9860G
#if GINT_RENDER_MONO
#ifdef __cplusplus
extern "C" {
@ -110,6 +110,6 @@ GINLINE static int image_layer_count(int profile)
}
#endif
#endif /* FX9860G */
#endif /* GINT_RENDER_MONO */
#endif /* GINT_DISPLAY_FX */

View File

@ -15,15 +15,16 @@ extern "C" {
#include <gint/defs/types.h>
#include <gint/defs/call.h>
#include <gint/config.h>
/* Platform-specific functions include VRAM management and the definition of
the color_t type. */
#ifdef FX9860G
#if GINT_RENDER_MONO
#include <gint/display-fx.h>
#endif
#ifdef FXCG50
#if GINT_RENDER_RGB
#include <gint/display-cg.h>
#endif

View File

@ -34,9 +34,8 @@
extern "C" {
#endif
#ifndef FXCG50
#error <gint/image.h> is only supported on FXCG50
#else
#include <gint/config.h>
#if GINT_RENDER_RGB
#include <gint/defs/attributes.h>
#include <gint/defs/types.h>
@ -838,7 +837,7 @@ bool image_target(image_t const *src, image_t *dst, ...);
#define image_alpha_2(fmt, copy_alpha) \
((copy_alpha) ? 0x10000 : image_alpha(fmt))
#endif /* FXCG50 */
#endif /* GINT_RENDER_RGB */
#ifdef __cplusplus
}

View File

@ -12,6 +12,10 @@
#include "../render-fx/render-fx.h"
#include "../render/render.h"
#include <gint/config.h>
// TODO: Move the gray "engine" into the T6K11 driver.
#if GINT_RENDER_MONO && GINT_HW_FX
/* Three additional video RAMS, allocated statically if --static-gray was set
at configure time, or with malloc() otherwise. */
@ -270,3 +274,5 @@ void dgray_getscreen(uint32_t **light, uint32_t **dark)
if(light) *light = vrams[base & 2];
if(dark) *dark = vrams[base | 1];
}
#endif /* GINT_RENDER_MONO && GINT_HW_FX */

View File

@ -1,4 +1,7 @@
#include <gint/gray.h>
#include <gint/config.h>
#if GINT_RENDER_MONO
/* gclear(): Fill the screen with a single color */
void gclear(color_t color)
@ -35,3 +38,5 @@ void gclear(color_t color)
dark += 8;
}
}
#endif /* GINT_RENDER_MONO */

View File

@ -1,5 +1,8 @@
#include <gint/gray.h>
#include <gint/defs/types.h>
#include <gint/config.h>
#if GINT_RENDER_MONO
int ggetpixel(int x, int y)
{
@ -13,3 +16,5 @@ int ggetpixel(int x, int y)
bool d = (dark [offset] & mask) != 0;
return (d << 1) | l;
}
#endif /* GINT_RENDER_MONO */

View File

@ -1,5 +1,8 @@
#include <gint/display.h>
#include <gint/defs/util.h>
#include <gint/config.h>
#if GINT_RENDER_MONO
/* gint_ghline(): Optimized horizontal line, but not actually optimized */
void gint_ghline(int x1, int x2, int y, int color)
@ -14,3 +17,5 @@ void gint_gvline(int y1, int y2, int x, int color)
if(y1 > y2) swap(y1, y2);
for(int y = y1; y <= y2; y++) dpixel(x, y, color);
}
#endif /* GINT_RENDER_MONO */

View File

@ -1,5 +1,8 @@
#include <gint/gray.h>
#include <gint/defs/types.h>
#include <gint/config.h>
#if GINT_RENDER_MONO
/* gpixel(): Change a pixel's color */
void gpixel(int x, int y, color_t color)
@ -55,3 +58,5 @@ void gpixel(int x, int y, color_t color)
break;
}
}
#endif /* GINT_RENDER_MONO */

View File

@ -1,6 +1,9 @@
#include <gint/defs/util.h>
#include <gint/gray.h>
#include "../render-fx/render-fx.h"
#include <gint/config.h>
#if GINT_RENDER_MONO
/* grect(): Fill a rectangle on the screen */
void grect(int x1, int y1, int x2, int y2, color_t color)
@ -112,3 +115,5 @@ void grect(int x1, int y1, int x2, int y2, color_t color)
light++, dark++;
}
}
#endif /* GINT_RENDER_MONO */

View File

@ -1,6 +1,8 @@
#include <gint/gray.h>
#include "../render-fx/render-fx.h"
#include "../render-fx/bopti-asm.h"
#include <gint/config.h>
#if GINT_RENDER_MONO
#pragma GCC optimize("O3")
@ -37,3 +39,5 @@ void gsubimage(bopti_image_t const *img, struct rbox *r, GUNUSED int flags)
bopti_render(img, r, light, dark);
}
}
#endif /* GINT_RENDER_MONO */

View File

@ -1,6 +1,9 @@
#include <gint/gray.h>
#include "../render/render.h"
#include "../render-fx/topti-asm.h"
#include "../render-fx/render-fx.h"
#include <gint/config.h>
#if GINT_RENDER_MONO
/* gtext_opt(): Display a string of text */
void gtext_opt(int x, int y, int fg, int bg, int halign, int valign,
@ -23,3 +26,5 @@ void gtext_opt(int x, int y, int fg, int bg, int halign, int valign,
topti_render(x, y, str, topti_font, topti_asm_text[fg],
topti_asm_text[bg], light, dark, size);
}
#endif /* GINT_RENDER_MONO */

View File

@ -5,6 +5,8 @@
#ifndef GINT_IMAGE_FIXED
#define GINT_IMAGE_FIXED
#include <stdint.h>
/* Constants */
#define fconst(x) ((x) * 65536)

View File

@ -1,6 +1,8 @@
#include <gint/image.h>
#include <stdlib.h>
#include <gint/defs/util.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
image_t *image_alloc(int width, int height, int format)
{
@ -25,3 +27,5 @@ image_t *image_alloc(int width, int height, int format)
img->flags |= IMAGE_FLAGS_DATA_ALLOC;
return img;
}
#endif

View File

@ -3,6 +3,9 @@
#include <stdlib.h>
#include <string.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
bool image_alloc_palette(image_t *img, int size)
{
if(!img || !IMAGE_IS_INDEXED(img->format))
@ -29,3 +32,5 @@ bool image_alloc_palette(image_t *img, int size)
img->flags |= IMAGE_FLAGS_PALETTE_ALLOC;
return true;
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
int image_alpha(int format)
{
@ -14,3 +16,5 @@ int image_alpha(int format)
return 0x10000;
}
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_clear(image_t *img)
{
@ -7,3 +9,5 @@ void image_clear(image_t *img)
image_fill(img, image_alpha(img->format));
}
#endif

View File

@ -1,5 +1,7 @@
#include <gint/image.h>
#include <gint/defs/util.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_copy(image_t const *src, image_t *dst, bool copy_alpha)
{
@ -120,3 +122,5 @@ void image_copy(image_t const *src, image_t *dst, bool copy_alpha)
} while(--h > 0);
}
}
#endif

View File

@ -2,6 +2,9 @@
#include <gint/defs/util.h>
#include <string.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
image_t *image_copy_alloc(image_t const *src, int new_format)
{
if(!image_valid(src))
@ -18,3 +21,5 @@ image_t *image_copy_alloc(image_t const *src, int new_format)
image_copy(src, dst, true);
return dst;
}
#endif

View File

@ -2,6 +2,9 @@
#include <gint/defs/util.h>
#include <string.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
bool image_copy_palette(image_t const *src, image_t *dst, int size)
{
if(!image_valid(src) || !dst)
@ -18,3 +21,5 @@ bool image_copy_palette(image_t const *src, image_t *dst, int size)
memcpy(dst->palette, src->palette, 2*N);
return true;
}
#endif

View File

@ -1,6 +1,9 @@
#include <gint/image.h>
#include <stdlib.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
image_t *image_create(int width, int height, int format)
{
if(!IMAGE_IS_RGB16(format) && !IMAGE_IS_P8(format) && !IMAGE_IS_P4(format))
@ -23,3 +26,5 @@ image_t *image_create(int width, int height, int format)
return img;
}
#endif

View File

@ -1,5 +1,7 @@
#include <gint/image.h>
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
image_t *image_create_vram(void)
{
@ -11,3 +13,5 @@ image_t *image_create_vram(void)
img->data = gint_vram;
return img;
}
#endif

View File

@ -1,6 +1,10 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
int image_data_size(image_t const *img)
{
return img->stride * img->height;
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
int image_decode_pixel(image_t const *img, int pixel)
{
@ -10,3 +12,5 @@ int image_decode_pixel(image_t const *img, int pixel)
return img->palette[pixel];
return -1;
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_fill(image_t *img, int value)
{
@ -24,3 +26,5 @@ void image_fill(image_t *img, int value)
}
}
}
#endif

View File

@ -2,6 +2,9 @@
#include <gint/mmu.h>
#include <stdlib.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_free(image_t *img)
{
if(!img || mmu_is_rom(img))
@ -14,3 +17,5 @@ void image_free(image_t *img)
free(img);
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
int image_get_pixel(image_t const *img, int x, int y)
{
@ -23,3 +25,5 @@ int image_get_pixel(image_t const *img, int x, int y)
}
return 0;
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_hflip(image_t const *src, image_t *dst, bool copy_alpha)
{
@ -45,3 +47,5 @@ void image_hflip(image_t const *src, image_t *dst, bool copy_alpha)
}
}
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
image_t *image_hflip_alloc(image_t const *src)
{
@ -14,3 +16,5 @@ image_t *image_hflip_alloc(image_t const *src)
image_hflip(src, dst, true);
return dst;
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _image_linear_rgb16
.global _image_linear_p8
@ -124,3 +127,5 @@ _image_linear_rgb16:
_image_linear_p8:
GEN_LINEAR_LOOP mov.b, 1
#endif

View File

@ -2,6 +2,9 @@
#include <gint/defs/util.h>
#include "fixed.h"
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_linear_rgb16(void *src, void *dst, struct image_linear_map *map);
void image_linear_p8(void *src, void *dst, struct image_linear_map *map);
@ -32,3 +35,5 @@ void image_linear(image_t const *src, image_t *dst,
else if(IMAGE_IS_P8(src->format))
image_linear_p8(src->data, dst->data, map);
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
image_t *image_linear_alloc(image_t const *src, struct image_linear_map *map)
{
@ -18,3 +20,5 @@ image_t *image_linear_alloc(image_t const *src, struct image_linear_map *map)
image_linear(src, dst, map);
return dst;
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_rotate(image_t const *src, float angle, bool resize,
struct image_linear_map *map)
@ -11,3 +13,5 @@ void image_rotate(image_t const *src, float angle, bool resize,
image_rotate_around(src, angle, resize, &center_x, &center_y, map);
}
#endif

View File

@ -1,9 +1,14 @@
#include <gint/image.h>
#include "fixed.h"
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_rotate_around(image_t const *src, float angle, bool resize,
int *center_x, int *center_y, struct image_linear_map *map)
{
image_rotate_around_scale(src, angle, fconst(1.0), resize, center_x,
center_y, map);
}
#endif

View File

@ -2,6 +2,9 @@
#include <math.h>
#include "fixed.h"
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_rotate_around_scale(image_t const *src, float alpha, int gamma,
bool resize, int *center_x, int *center_y, struct image_linear_map *map)
{
@ -58,3 +61,5 @@ void image_rotate_around_scale(image_t const *src, float alpha, int gamma,
*center_x = new_center_x;
*center_y = new_center_y;
}
#endif

View File

@ -1,6 +1,9 @@
#include <gint/image.h>
#include "fixed.h"
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_scale(image_t const *src, int gamma_x, int gamma_y,
struct image_linear_map *map)
{
@ -22,3 +25,5 @@ void image_scale(image_t const *src, int gamma_x, int gamma_y,
map->dst_w = fround(src->width * gamma_x);
map->dst_h = fround(src->height * gamma_y);
}
#endif

View File

@ -1,6 +1,9 @@
#include <gint/image.h>
#include <stdlib.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_set_palette(image_t *img, uint16_t *palette, int size, bool owns)
{
if(!img || !IMAGE_IS_INDEXED(img->format))
@ -16,3 +19,5 @@ void image_set_palette(image_t *img, uint16_t *palette, int size, bool owns)
else
img->flags &= ~IMAGE_FLAGS_PALETTE_ALLOC;
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void image_set_pixel(image_t const *img, int x, int y, int value)
{
@ -24,3 +26,5 @@ void image_set_pixel(image_t const *img, int x, int y, int value)
data_u8[x >> 1] = (data_u8[x >> 1] & 0x0f) | (value << 4);
}
}
#endif

View File

@ -3,6 +3,9 @@
#include <string.h>
#undef image_sub
#include <gint/config.h>
#if GINT_RENDER_RGB
static image_t image_sub_default;
image_t *image_sub(image_t const *src, int left, int top, int w, int h,
@ -39,3 +42,5 @@ image_t *image_sub(image_t const *src, int left, int top, int w, int h,
dst->palette = src->palette;
return dst;
}
#endif

View File

@ -1,6 +1,9 @@
#include <gint/image.h>
#undef image_target
#include <gint/config.h>
#if GINT_RENDER_RGB
bool image_target(image_t const *src, image_t *dst, ...)
{
if(!image_valid(src) || !image_valid(dst))
@ -37,3 +40,5 @@ bool image_target(image_t const *src, image_t *dst, ...)
va_end(args);
return true;
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
bool image_valid(image_t const *img)
{
@ -16,3 +18,5 @@ bool image_valid(image_t const *img)
/* Invalid format */
return false;
}
#endif

View File

@ -1,6 +1,8 @@
#include <gint/image.h>
#include <stdlib.h>
#include <string.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
static void copy_row_rgb16(uint16_t *src, uint16_t *dst, int src_alpha,
int dst_alpha, int width)
@ -60,3 +62,5 @@ void image_vflip(image_t const *src, image_t *dst, bool copy_alpha)
free(row);
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
image_t *image_vflip_alloc(image_t const *src)
{
@ -14,3 +16,5 @@ image_t *image_vflip_alloc(image_t const *src)
image_vflip(src, dst, true);
return dst;
}
#endif

View File

@ -5,6 +5,7 @@
#include <gint/kmalloc.h>
#include <gint/defs/attributes.h>
#include <gint/defs/util.h>
#include <gint/config.h>
#include <string.h>

View File

@ -9,6 +9,9 @@
#include <gint/drivers/states.h>
#include <gint/dma.h>
#include <gint/drivers/r61524.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
#define DMA SH7305_DMA
#define POWER SH7305_POWER
@ -217,3 +220,5 @@ gint_driver_t drv_r61524 = {
.state_size = sizeof(r61524_state_t),
};
GINT_DECLARE_DRIVER(26, drv_r61524);
#endif /* GINT_RENDER_RGB */

View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/dma.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dclear(uint16_t color)
{
@ -16,3 +18,5 @@ void dclear(uint16_t color)
dwindow.bottom - 1, color);
}
}
#endif

View File

@ -1,7 +1,11 @@
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
int dgetpixel(int x, int y)
{
if((uint)x >= DWIDTH || (uint)y >= DHEIGHT) return -1;
return gint_vram[DWIDTH * y + x];
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dpixel(int x, int y, int color)
{
@ -11,3 +13,5 @@ void dpixel(int x, int y, int color)
if(color == C_INVERT) gint_vram[index] ^= 0xffff;
else gint_vram[index] = color;
}
#endif

View File

@ -1,5 +1,7 @@
#include <gint/defs/util.h>
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void drect(int x1, int y1, int x2, int y2, int color)
{
@ -50,3 +52,5 @@ void drect(int x1, int y1, int x2, int y2, int color)
base += DWIDTH;
}
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
/* dsubimage(): Render a section of an image */
void dsubimage(int x, int y, image_t const *img, int left, int top,
@ -11,3 +13,5 @@ void dsubimage(int x, int y, image_t const *img, int left, int top,
else if(IMAGE_IS_P4(img->format))
return dsubimage_p4(x, y, img, left, top, w, h, flags);
}
#endif

View File

@ -1,6 +1,8 @@
#include <gint/display.h>
#include <gint/drivers/r61524.h>
#include "render-cg.h"
#include <gint/config.h>
#if GINT_RENDER_RGB
/* dupdate(): Push the video RAM to the display driver */
void dupdate(void)
@ -19,3 +21,5 @@ void dupdate(void)
}
__attribute__((alias("dupdate")))
void _WEAK_dupdate(void);
#endif

View File

@ -1,6 +1,7 @@
#include <gint/display.h>
#include <gint/kmalloc.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
/* Up to two VRAM pointers can be set, for triple buffering. */
static uint16_t *vram_1 = NULL, *vram_2 = NULL;
@ -67,3 +68,5 @@ void dvram_switch(void)
{
gint_vram = (gint_vram == vram_1) ? vram_2 : vram_1;
}
#endif

View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/defs/util.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
/* gint_dhline(): Optimized horizontal line */
void gint_dhline(int x1, int x2, int y, uint16_t color)
@ -43,3 +45,4 @@ void gint_dvline(int y1, int y2, int x, uint16_t color)
while(height-- > 0) *v = color, v += DWIDTH;
}
#endif

View File

@ -1,6 +1,8 @@
#include <gint/image.h>
#include <gint/display.h>
#include <gint/defs/util.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
bool gint_image_clip_input(image_t const *img, struct gint_image_box *b,
struct dwindow const *window)
@ -119,3 +121,5 @@ bool gint_image_mkcmd(struct gint_image_box *box, image_t const *img,
cmd->output = (void *)gint_vram + (DWIDTH * box->y + cmd->x) * 2;
return true;
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p4_loop
/* gint's image renderer: 4-bit indexed entry point
@ -81,3 +84,5 @@ _NO_VFLIP:
jmp @r9
subc r7, r4
#endif

View File

@ -1,5 +1,7 @@
#include <gint/image.h>
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_p4(int x, int y, image_t const *img, int eff)
{
@ -39,3 +41,5 @@ void dsubimage_p4_clearbg(int x, int y, image_t const *img,
cmd.loop = gint_image_p4_clearbg;
gint_image_p4_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p4_clearbg
#include "image_macros.S"
@ -95,3 +98,5 @@ _gint_image_p4_clearbg:
GEN_CLEARBG_LOOP 0, 2
9: GEN_CLEARBG_LOOP 1, -2
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p4_clearbg_alt
#include "image_macros.S"
@ -151,3 +154,5 @@ _gint_image_p4_clearbg_alt:
GEN_CLEARBG_LOOP 0, 4, r13, r14, 6, 4
9: GEN_CLEARBG_LOOP 1, -4, r13, r14, 0, 2
#endif

View File

@ -1,5 +1,7 @@
#include <gint/image.h>
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_p4_clearbg_alt(int x, int y, image_t const *img, int eff, int bg)
{
@ -19,3 +21,5 @@ void dsubimage_p4_clearbg_alt(int x, int y, image_t const *img,
cmd.loop = gint_image_p4_clearbg_alt;
gint_image_p4_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p4_dye
#include "image_macros.S"
@ -145,3 +148,5 @@ _gint_image_p4_dye:
GEN_DYE_LOOP 0, 4, r13, r14, 6, 4
9: GEN_DYE_LOOP 1, -4, r13, r14, 0, 2
#endif

View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_p4_dye(int x, int y, image_t const *img, int eff, int dye_color)
{
@ -20,3 +22,5 @@ void dsubimage_p4_dye(int x, int y, image_t const *img,
cmd.loop = gint_image_p4_dye;
gint_image_p4_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dsubimage_p4_effect(int x, int y, image_t const *img,
int left, int top, int w, int h, int eff, ...)
@ -30,3 +32,5 @@ void dsubimage_p4_effect(int x, int y, image_t const *img,
va_end(args);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p4_normal
#include "image_macros.S"
@ -123,3 +126,5 @@ _gint_image_p4_normal:
GEN_NORMAL_LOOP 0, 2, r7, r11, 4, 2
9: GEN_NORMAL_LOOP 1, -2, r7, r11, 2, 4
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p4_swapcolor
#include "image_macros.S"
@ -173,3 +176,5 @@ _gint_image_p4_swapcolor:
GEN_SWAPCOLOR_LOOP 0, 4, r13, r14, 6, 0
9: GEN_SWAPCOLOR_LOOP 1, -4, r13, r14, 0, 6
#endif

View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_p4_swapcolor(int x, int y, image_t const *img, int eff,
int old_color, int new_color)
@ -42,3 +44,5 @@ void dsubimage_p4_addbg(int x, int y, image_t const *img,
cmd.loop = gint_image_p4_swapcolor;
gint_image_p4_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p8_loop
/* gint's image renderer: 8-bit indexed entry point
@ -101,3 +104,5 @@ _VFLIP:
_NO_VFLIP:
jmp @r9
sub r2, r4
#endif

View File

@ -1,5 +1,7 @@
#include <gint/image.h>
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_p8(int x, int y, image_t const *img, int eff)
{
@ -39,3 +41,5 @@ void dsubimage_p8_clearbg(int x, int y, image_t const *img,
cmd.loop = gint_image_p8_clearbg;
gint_image_p8_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p8_clearbg
#include "image_macros.S"
@ -148,3 +151,5 @@ _gint_image_p8_clearbg:
GEN_CLEARBG_LOOP 0, 4, r13, r14, 4, 2
9: GEN_CLEARBG_LOOP 1, -4, r13, r14, 2, 4
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p8_dye
#include "image_macros.S"
@ -116,3 +119,5 @@ _gint_image_p8_dye:
GEN_DYE_LOOP 0, 4, r13, r14, 4, 2
9: GEN_DYE_LOOP 1, -4, r13, r14, 2, 4
#endif

View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_p8_dye(int x, int y, image_t const *img, int eff, int dye_color)
{
@ -20,3 +22,5 @@ void dsubimage_p8_dye(int x, int y, image_t const *img,
cmd.loop = gint_image_p8_dye;
gint_image_p8_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dsubimage_p8_effect(int x, int y, image_t const *img,
int left, int top, int w, int h, int eff, ...)
@ -30,3 +32,5 @@ void dsubimage_p8_effect(int x, int y, image_t const *img,
va_end(args);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p8_normal
#include "image_macros.S"
@ -40,3 +43,5 @@ _gint_image_p8_normal:
GEN_NORMAL_LOOP 0, 2
9: GEN_NORMAL_LOOP 1, -2
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_p8_swapcolor
#include "image_macros.S"
@ -75,3 +78,5 @@ _gint_image_p8_swapcolor:
GEN_SWAPCOLOR_LOOP 0, 2
9: GEN_SWAPCOLOR_LOOP 1, -2
#endif

View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_p8_swapcolor(int x, int y, image_t const *img, int eff,
int old_color, int new_color)
@ -42,3 +44,5 @@ void dsubimage_p8_addbg(int x, int y, image_t const *img,
cmd.loop = gint_image_p8_swapcolor;
gint_image_p8_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_rgb16_loop
/* gint's image renderer: 16-bit RGB entry point
@ -67,3 +70,5 @@ _NO_VFLIP:
jmp @r9
add r4, r4
#endif

View File

@ -1,5 +1,7 @@
#include <gint/image.h>
#include <gint/display.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_rgb16(int x, int y, image_t const *img, int eff)
{
@ -40,3 +42,5 @@ void dsubimage_rgb16_clearbg(int x, int y, image_t const *img,
cmd.loop = gint_image_rgb16_clearbg;
gint_image_rgb16_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_rgb16_clearbg
.global _gint_image_rgb16_dye
#include "image_macros.S"
@ -51,3 +54,5 @@ _gint_image_rgb16_dye:
GEN_CLEARBG_DYE_LOOP 0, 4, r7, r0
9: GEN_CLEARBG_DYE_LOOP 1, -4, r7, r0
#endif

View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_rgb16_dye(int x, int y, image_t const *img, int eff, int dye_color)
{
@ -20,3 +22,5 @@ void dsubimage_rgb16_dye(int x, int y, image_t const *img,
cmd.loop = gint_image_rgb16_dye;
gint_image_rgb16_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,4 +1,6 @@
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dsubimage_rgb16_effect(int x, int y, image_t const *img,
int left, int top, int w, int h, int eff, ...)
@ -30,3 +32,5 @@ void dsubimage_rgb16_effect(int x, int y, image_t const *img,
va_end(args);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_rgb16_normal
#include "image_macros.S"
@ -199,3 +202,5 @@ _BACKWARD_LONG_COPY:
3: mov.l r0, @-r5
END
EPILOGUE
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _gint_image_rgb16_swapcolor
#include "image_macros.S"
@ -43,3 +46,5 @@ _gint_image_rgb16_swapcolor:
GEN_SWAPCOLOR_LOOP 0, 2
9: GEN_SWAPCOLOR_LOOP 1, -2
#endif

View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/image.h>
#include <gint/config.h>
#if GINT_RENDER_RGB
void dimage_rgb16_swapcolor(int x, int y, image_t const *img, int eff,
int old_color, int new_color)
@ -42,3 +44,5 @@ void dsubimage_rgb16_addbg(int x, int y, image_t const *img,
cmd.loop = gint_image_rgb16_swapcolor;
gint_image_rgb16_loop(DWIDTH, &cmd);
}
#endif

View File

@ -1,3 +1,6 @@
#include <gint/config.h>
#if GINT_RENDER_RGB
.global _topti_glyph_fg_bg
.global _topti_glyph_fg
.global _topti_glyph_bg
@ -200,3 +203,5 @@ _topti_glyph_bg:
.align 4
1: .long 396*2
#endif

View File

@ -5,6 +5,9 @@
#ifndef GINT_RENDERCG_TOPTIASM
#define GINT_RENDERCG_TOPTIASM
#include <gint/config.h>
#if GINT_RENDER_RGB
/* Text rendering functions
@vram Pointer to VRAM, offset for subglyph position
@ -26,4 +29,6 @@ extern asm_text_t topti_glyph_bg;
/* Opaque foreground, opaque background */
extern asm_text_t topti_glyph_fg_bg;
#endif
#endif /* GINT_RENDERFX_TOPTIASM */

View File

@ -8,6 +8,9 @@
#include "../render/render.h"
#include "topti-asm.h"
#include <gint/config.h>
#if GINT_RENDER_RGB
/* Default font */
extern font_t gint_font8x9;
font_t const * gint_default_font = &gint_font8x9;
@ -136,3 +139,5 @@ void dtext_opt(int x, int y, int fg, int bg, int halign, int valign,
topti_render(x, y, str, topti_font, fg, bg, size);
}
#endif

View File

@ -0,0 +1,156 @@
#include <gint/config.h>
#if GINT_RENDER_MONO
.global _bopti_gasm_mono_scsp
.global _bopti_gasm_mono_alpha_scsp
.global _bopti_gasm_gray_scsp
.global _bopti_gasm_gray_alpha_scsp
/* REGISTER ALLOCATION:
r0: OR layer
r1: (temp)
r2: light vram longword
r3: dark vram longword
--
r4: light pointer
r5: layer pointer
r6: mask
r7: dark pointer
--
@r15: -(x&31) */
_bopti_gasm_mono_scsp:
/* Read layer longword and shift it */
mov.l @r5, r0
mov.l @r15, r1
shld r1, r0
/* Clear target VRAM and unwanted image data */
and r6, r0
mov.l @r4, r2
not r6, r6
mov.l @r7, r3
and r6, r2
and r6, r3
/* Blit and return */
or r0, r2
or r0, r3
mov.l r2, @r4
rts
mov.l r3, @r7
/* REGISTER ALLOCATION:
r0: AND layer
r1: (temp)
r2: light vram longword
r3: dark vram longword
--
r4: light pointer
r5: layer pointer, then OR layer
r6: mask
r7: dark pointer
--
@r15: -(x&31) */
_bopti_gasm_mono_alpha_scsp:
/* Read layer longwords and shift them */
mov.l @r5, r0
mov.l @r15, r1
mov.l @(4,r5), r5
shld r1, r0
shld r1, r5
/* Clear any unwanted image data */
and r6, r0
mov.l @r4, r2
and r6, r5
mov.l @r7, r3
/* Blit and return */
not r0, r0
and r0, r2
and r0, r3
or r5, r2
or r5, r3
mov.l r2, @r4
rts
mov.l r3, @r7
/* REGISTER ALLOCATION:
r0: LIGHT layer
r1: (temp)
r2: light vram longword
r3: dark vram longword
--
r4: light pointer
r5: layer pointer, then DARK layer
r6: mask
r7: dark pointer
--
@r15: -(x&31) */
_bopti_gasm_gray_scsp:
/* Read layer longwords and shift them */
mov.l @r5, r0
mov.l @r15, r1
mov.l @(4,r5), r5
shld r1, r0
shld r1, r5
/* Clear target VRAM and unapplied image data */
and r6, r0
mov.l @r4, r2
and r6, r5
mov.l @r7, r3
not r6, r6
and r6, r2
and r6, r3
/* Blit and return */
or r0, r2
or r5, r3
mov.l r2, @r4
rts
mov.l r3, @r7
/* REGISTER ALLOCATION:
r0: AND layer
r1: LIGHT layer
r2: (temp), then light vram longword
r3: dark vram longword
--
r4: light pointer
r5: layer pointer, then DARK layer
r6: mask
r7: dark pointer
--
@r15: -(x&31) */
_bopti_gasm_gray_alpha_scsp:
/* Read layer longwords and shift them */
mov.l @r5, r0
mov.l @(4,r5), r1
mov.l @(8,r5), r5
mov.l @r15, r2
shld r2, r0
shld r2, r1
shld r2, r5
/* Clear unappliqed image data */
and r6, r0
and r6, r1
and r6, r5
/* Blit the AND layer */
mov.l @r4, r2
not r0, r0
mov.l @r7, r3
and r0, r2
and r0, r3
/* Blit the LIGHT and DARY layers, and return */
or r1, r2
or r5, r3
mov.l r2, @r4
rts
mov.l r3, @r7
#endif /* GINT_RENDER_MONO */

View File

@ -1,152 +0,0 @@
.global _bopti_gasm_mono_scsp
.global _bopti_gasm_mono_alpha_scsp
.global _bopti_gasm_gray_scsp
.global _bopti_gasm_gray_alpha_scsp
# REGISTER ALLOCATION:
# r0: OR layer
# r1: (temp)
# r2: light vram longword
# r3: dark vram longword
# --
# r4: light pointer
# r5: layer pointer
# r6: mask
# r7: dark pointer
# --
# @r15: -(x&31)
_bopti_gasm_mono_scsp:
# Read layer longword and shift it
mov.l @r5, r0
mov.l @r15, r1
shld r1, r0
# Clear target VRAM and unwanted image data
and r6, r0
mov.l @r4, r2
not r6, r6
mov.l @r7, r3
and r6, r2
and r6, r3
# Blit and return
or r0, r2
or r0, r3
mov.l r2, @r4
rts
mov.l r3, @r7
# REGISTER ALLOCATION:
# r0: AND layer
# r1: (temp)
# r2: light vram longword
# r3: dark vram longword
# --
# r4: light pointer
# r5: layer pointer, then OR layer
# r6: mask
# r7: dark pointer
# --
# @r15: -(x&31)
_bopti_gasm_mono_alpha_scsp:
# Read layer longwords and shift them
mov.l @r5, r0
mov.l @r15, r1
mov.l @(4,r5), r5
shld r1, r0
shld r1, r5
# Clear any unwanted image data
and r6, r0
mov.l @r4, r2
and r6, r5
mov.l @r7, r3
# Blit and return
not r0, r0
and r0, r2
and r0, r3
or r5, r2
or r5, r3
mov.l r2, @r4
rts
mov.l r3, @r7
# REGISTER ALLOCATION:
# r0: LIGHT layer
# r1: (temp)
# r2: light vram longword
# r3: dark vram longword
# --
# r4: light pointer
# r5: layer pointer, then DARK layer
# r6: mask
# r7: dark pointer
# --
# @r15: -(x&31)
_bopti_gasm_gray_scsp:
# Read layer longwords and shift them
mov.l @r5, r0
mov.l @r15, r1
mov.l @(4,r5), r5
shld r1, r0
shld r1, r5
# Clear target VRAM and unapplied image data
and r6, r0
mov.l @r4, r2
and r6, r5
mov.l @r7, r3
not r6, r6
and r6, r2
and r6, r3
# Blit and return
or r0, r2
or r5, r3
mov.l r2, @r4
rts
mov.l r3, @r7
# REGISTER ALLOCATION:
# r0: AND layer
# r1: LIGHT layer
# r2: (temp), then light vram longword
# r3: dark vram longword
# --
# r4: light pointer
# r5: layer pointer, then DARK layer
# r6: mask
# r7: dark pointer
# --
# @r15: -(x&31)
_bopti_gasm_gray_alpha_scsp:
# Read layer longwords and shift them
mov.l @r5, r0
mov.l @(4,r5), r1
mov.l @(8,r5), r5
mov.l @r15, r2
shld r2, r0
shld r2, r1
shld r2, r5
# Clear unappliqed image data
and r6, r0
and r6, r1
and r6, r5
# Blit the AND layer
mov.l @r4, r2
not r0, r0
mov.l @r7, r3
and r0, r2
and r0, r3
# Blit the LIGHT and DARY layers, and return
or r1, r2
or r5, r3
mov.l r2, @r4
rts
mov.l r3, @r7

View File

@ -1,40 +1,42 @@
#include <gint/config.h>
#if GINT_RENDER_MONO
.global _bopti_gasm_mono
.global _bopti_gasm_mono_alpha
.global _bopti_gasm_gray
.global _bopti_gasm_gray_alpha
# REGISTER ALLOCATION
# r0: layer_1 (left)
# r1: layer_1 (right)
# r2: layer pointer and temp
# r3: mask pointer and temp
# --
# r4: vram light (left)
# r5: vram light (right)
# r6: vram dark (left)
# r7: vram dark (right)
# --
# @r15: layer pointer
# @(4,r15): mask pointer
# @(8,r15): -(x&31)
# @(12,r15): destination
/* REGISTER ALLOCATION
r0: layer_1 (left)
r1: layer_1 (right)
r2: layer pointer and temp
r3: mask pointer and temp
--
r4: vram light (left)
r5: vram light (right)
r6: vram dark (left)
r7: vram dark (right)
--
@r15: layer pointer
@(4,r15): mask pointer
@(8,r15): -(x&31)
@(12,r15): destination */
_bopti_gasm_mono:
# Read the data longword and update the layer address
/* Read the data longword and update the layer address */
mov.l @r15, r2
mov.l @r2, r3
mov.l @r3+, r0
mov.l r3, @r2
mov r0, r1
# Shift it
/* Shift it */
mov.l @(8, r15), r2
shld r2, r0
add #32, r2
shld r2, r1
# Clear target VRAM and unwanted image data
/* Clear target VRAM and unwanted image data */
mov.l @(4, r15), r3
mov.l @r3, r2
and r2, r0
@ -47,7 +49,7 @@ _bopti_gasm_mono:
and r2, r5
and r2, r7
# Join everything and return
/* Join everything and return */
or r0, r4
or r1, r5
or r0, r6
@ -59,30 +61,30 @@ _bopti_gasm_mono:
rts
mov.l r7, @(12, r2)
# REGISTER ALLOCATION
# r0: layer_1 (left)
# r1: layer_1 (right)
# r2: layer_2 (left)
# r3: layer_2 (right)
# --
# r4: vram light (left)
# r5: vram light (right)
# r6: vram dark (left)
# r7: vram dark (right)
# --
# r8: layer pointer and temp
# r9: mask pointer and temp
# --
# @(8,r15): layer pointer
# @(12,r15): mask pointer
# @(16,r15): -(x&31)
# @(20,r15): destination
/* REGISTER ALLOCATION
r0: layer_1 (left)
r1: layer_1 (right)
r2: layer_2 (left)
r3: layer_2 (right)
--
r4: vram light (left)
r5: vram light (right)
r6: vram dark (left)
r7: vram dark (right)
--
r8: layer pointer and temp
r9: mask pointer and temp
--
@(8,r15): layer pointer
@(12,r15): mask pointer
@(16,r15): -(x&31)
@(20,r15): destination */
_bopti_gasm_mono_alpha:
mov.l r8, @-r15
mov.l r9, @-r15
# Read data longwords
/* Read data longwords */
mov.l @(8, r15), r8
mov.l @r8, r9
mov.l @r9+, r0
@ -91,7 +93,7 @@ _bopti_gasm_mono_alpha:
mov r0, r1
mov r2, r3
# Shift all layer data
/* Shift all layer data */
mov.l @(16, r15), r8
shld r8, r0
shld r8, r2
@ -99,7 +101,7 @@ _bopti_gasm_mono_alpha:
shld r8, r1
shld r8, r3
# Apply masks on image data
/* Apply masks on image data */
mov.l @(12, r15), r9
mov.l @r9, r8
and r8, r0
@ -108,7 +110,7 @@ _bopti_gasm_mono_alpha:
and r8, r1
and r8, r3
# Render and leave
/* Render and leave */
not r0, r0
not r1, r1
and r0, r4
@ -129,30 +131,30 @@ _bopti_gasm_mono_alpha:
rts
mov.l @r15+, r8
# REGISTER ALLOCATION
# r0: layer_1 (left)
# r1: layer_1 (right)
# r2: layer_2 (left)
# r3: layer_2 (right)
# --
# r4: vram light (left)
# r5: vram light (right)
# r6: vram dark (left)
# r7: vram dark (right)
# --
# r8: layer pointer (also +- x&31)
# r9: mask pointer (also layer)
# --
# @(8,r15): layer pointer
# @(12,r15): mask pointer
# @(16,r15): -(x&31)
# @(20,r15): destination
/* REGISTER ALLOCATION
r0: layer_1 (left)
r1: layer_1 (right)
r2: layer_2 (left)
r3: layer_2 (right)
--
r4: vram light (left)
r5: vram light (right)
r6: vram dark (left)
r7: vram dark (right)
--
r8: layer pointer (also +- x&31)
r9: mask pointer (also layer)
--
@(8,r15): layer pointer
@(12,r15): mask pointer
@(16,r15): -(x&31)
@(20,r15): destination */
_bopti_gasm_gray:
mov.l r8, @-r15
mov.l r9, @-r15
# Read data longwords and update the layer address pointer
/* Read data longwords and update the layer address pointer */
mov.l @(8, r15), r8
mov.l @r8, r9
mov.l @r9+, r0
@ -161,7 +163,7 @@ _bopti_gasm_gray:
mov r0, r1
mov r2, r3
# Shift all layer data
/* Shift all layer data */
mov.l @(16, r15), r8
shld r8, r0
shld r8, r2
@ -169,8 +171,8 @@ _bopti_gasm_gray:
shld r8, r1
shld r8, r3
# On the left side, clear the VRAM which is about to be rewritten using
# the left mask, and also clear unwanted image data
/* On the left side, clear the VRAM which is about to be rewritten using
the left mask, and also clear unwanted image data */
mov.l @(12, r15), r9
mov.l @r9, r8
and r8, r0
@ -179,7 +181,7 @@ _bopti_gasm_gray:
and r8, r4
and r8, r6
# Same on the right side
/* Same on the right side */
mov.l @(4, r9), r8
and r8, r1
and r8, r3
@ -187,7 +189,7 @@ _bopti_gasm_gray:
and r8, r5
and r8, r7
# Render these together and store the result
/* Render these together and store the result */
or r0, r4
or r1, r5
or r2, r6
@ -203,26 +205,26 @@ _bopti_gasm_gray:
mov.l @r15+, r8
# REGISTER ALLOCATION
# r0: layer_1 (left)
# r1: layer_1 (right)
# r2: layer_2 (left)
# r3: layer_2 (right)
# --
# r4: vram light (left)
# r5: vram light (right)
# r6: vram dark (left)
# r7: vram dark (right)
# --
# r8: layer pointer (also +- x&31)
# r9: mask pointer (also layer)
# r10: layer_3 (left)
# r11: layer_3 (right)
# --
# @(16,r15): layer pointer
# @(20,r15): mask pointer
# @(24,r15): -(x&31)
# @(28,r15): destination
/* REGISTER ALLOCATION
r0: layer_1 (left)
r1: layer_1 (right)
r2: layer_2 (left)
r3: layer_2 (right)
--
r4: vram light (left)
r5: vram light (right)
r6: vram dark (left)
r7: vram dark (right)
--
r8: layer pointer (also +- x&31)
r9: mask pointer (also layer)
r10: layer_3 (left)
r11: layer_3 (right)
--
@(16,r15): layer pointer
@(20,r15): mask pointer
@(24,r15): -(x&31)
@(28,r15): destination */
.align 4
_bopti_gasm_gray_alpha:
@ -231,7 +233,7 @@ _bopti_gasm_gray_alpha:
mov.l r10, @-r15
mov.l r11, @-r15
# Load layer data
/* Load layer data */
mov.l @(16, r15), r8
mov.l @r8, r9
mov.l @r9+, r0
@ -242,7 +244,7 @@ _bopti_gasm_gray_alpha:
mov.l r9, @r8
mov r10, r11
# Shift layer data
/* Shift layer data */
mov.l @(24, r15), r8
shld r8, r0
shld r8, r2
@ -252,7 +254,7 @@ _bopti_gasm_gray_alpha:
shld r8, r3
shld r8, r11
# Clear unwanted layer bits
/* Clear unwanted layer bits */
mov.l @(20, r15), r9
mov.l @r9, r8
and r8, r0
@ -263,7 +265,7 @@ _bopti_gasm_gray_alpha:
and r8, r3
and r8, r11
# Blit everything
/* Blit everything */
not r0, r0
and r0, r4
and r0, r6
@ -275,7 +277,7 @@ _bopti_gasm_gray_alpha:
or r10, r6
or r11, r7
# Store results and leave
/* Store results and leave */
mov.l @(28, r15), r8
mov.l r4, @r8
mov.l r5, @(4, r8)
@ -286,3 +288,5 @@ _bopti_gasm_gray_alpha:
mov.l @r15+, r9
rts
mov.l @r15+, r8
#endif /* GINT_RENDER_MONO */

View File

@ -0,0 +1,64 @@
#include <gint/config.h>
#if GINT_RENDER_MONO
.global _bopti_asm_mono_scsp
.global _bopti_asm_mono_alpha_scsp
/* REGISTER ALLOCATION:
r0: layer
r1: -
r2: (temp)
r3: vram longword
--
r4: vram pointer
r5: layer pointer
r6: mask
r7: -(x&31) */
_bopti_asm_mono_scsp:
/* Read layer longword and shift it */
mov.l @r5, r0
shld r7, r0
/* Clear the target VRAM and unwanted image data */
mov.l @r4, r3
and r6, r0
not r6, r6
and r6, r3
/* Blit and return */
or r0, r3
rts
mov.l r3, @r4
/* REGISTER ALLOCATION:
r0: AND layer
r1: OR layer
r2: (temp)
r3: vram longword
--
r4: vram pointer
r5: layer pointer
r6: mask
r7: -(x&31) */
_bopti_asm_mono_alpha_scsp:
/* Read layer longwords and shift them */
mov.l @r5, r0
mov.l @(4,r5), r1
shld r7, r0
shld r7, r1
/* Apply masks to clear layer data */
and r6, r0
and r6, r1
/* Blit to VRAM */
mov.l @r4, r3
not r0, r0
and r0, r3
or r1, r3
rts
mov.l r3, @r4
#endif /* GINT_RENDER_MONO */

View File

@ -1,60 +0,0 @@
.global _bopti_asm_mono_scsp
.global _bopti_asm_mono_alpha_scsp
# REGISTER ALLOCATION:
# r0: layer
# r1: -
# r2: (temp)
# r3: vram longword
# --
# r4: vram pointer
# r5: layer pointer
# r6: mask
# r7: -(x&31)
_bopti_asm_mono_scsp:
# Read layer longword and shift it
mov.l @r5, r0
shld r7, r0
# Clear the target VRAM and unwanted image data
mov.l @r4, r3
and r6, r0
not r6, r6
and r6, r3
# Blit and return
or r0, r3
rts
mov.l r3, @r4
# REGISTER ALLOCATION:
# r0: AND layer
# r1: OR layer
# r2: (temp)
# r3: vram longword
# --
# r4: vram pointer
# r5: layer pointer
# r6: mask
# r7: -(x&31)
_bopti_asm_mono_alpha_scsp:
# Read layer longwords and shift them
mov.l @r5, r0
mov.l @(4,r5), r1
shld r7, r0
shld r7, r1
# Apply masks to clear layer data
and r6, r0
and r6, r1
# Blit to VRAM
mov.l @r4, r3
not r0, r0
and r0, r3
or r1, r3
rts
mov.l r3, @r4

97
src/render-fx/bopti-asm.S Normal file
View File

@ -0,0 +1,97 @@
#include <gint/config.h>
#if GINT_RENDER_MONO
.global _bopti_asm_mono
.global _bopti_asm_mono_alpha
/* REGISTER ALLOCATION:
r0: layer (left)
r1: layer (right)
r2: (temp)
r3: -
--
r4: vram (left)
r5: vram (right)
r6: layer pointer; f(x&31)
r7: mask pointer
--
@r15: -(x&31) */
_bopti_asm_mono:
/* Read data longword and update the layer address pointer */
mov.l @r6, r2
mov.l @r2+, r0
mov.l r2, @r6
mov r0, r1
/* Shift the layer data */
mov.l @r15, r6
shld r6, r0
add #32, r6
shld r6, r1
/* Get the masks and clear the target VRAM area and unwanted image data */
mov.l @r7, r2
and r2, r0
not r2, r2
and r2, r4
mov.l @(4, r7), r2
and r2, r1
not r2, r2
and r2, r5
/* Do the drawing by joining the two */
or r4, r0
rts
or r5, r1
/* REGISTER ALLOCATION
r0: layer_1 (left)
r1: layer_1 (right)
r2: layer_2 (left)
r3: layer_2 (right)
--
r4: vram (left)
r5: vram (right)
r6: layer pointer; f(x&31); mask (left); mask (right)
r7: mask pointer
--
@r15: -(x&31) */
_bopti_asm_mono_alpha:
/* Read data longwords and update the layer address pointer */
mov.l @r6, r2
mov.l @r2+, r0
mov.l @r2+, r3
mov.l r2, @r6
mov r0, r1
mov r3, r2
/* Shift all layer data */
mov.l @r15, r6
shld r6, r0
shld r6, r2
add #32, r6
shld r6, r1
shld r6, r3
/* Apply the masks on the layer data */
mov.l @r7, r6
and r6, r0
and r6, r2
mov.l @(4, r7), r6
and r6, r1
and r6, r3
/* Blit the clear on the VRAM */
not r0, r0
and r4, r0
not r1, r1
and r5, r1
/* Blit the write on the VRAM */
or r2, r0
rts
or r3, r1
#endif /* GINT_RENDER_MONO */

View File

@ -1,118 +0,0 @@
//---
// gint:render-fx:bopti-asm - Assembler drawing routines for bopti
//---
#ifndef GINT_RENDERFX_BOPTIASM
#define GINT_RENDERFX_BOPTIASM
#include <gint/defs/types.h>
#include <gint/defs/attributes.h>
/* pair_t: A pair of consecutive VRAM longwords */
typedef struct {
uint32_t l;
uint32_t r;
} pair_t;
/* quadr_t: Two pairs for light and gray VRAMs */
typedef struct {
uint32_t l1;
uint32_t r1;
uint32_t l2;
uint32_t r2;
} quadr_t;
/* Signature of mono rendering functions */
typedef pair_t asm_mono_t(pair_t p, void **layer, uint32_t *masks, int x);
/* Signature of gray rendering functions */
typedef void asm_gray_t(quadr_t q, void **layer, uint32_t *masks, int x,
quadr_t *ret);
/* Signature of mono single-column single-position rendering functions */
typedef void asm_mono_scsp_t(uint32_t *vram, uint32_t const *layer,
uint32_t mask, int x);
/* Signature of gray single-column single-position rendering functions */
typedef void asm_gray_scsp_t(uint32_t *v1, uint32_t const *layer,
uint32_t mask, uint32_t *v2, int x);
/* Type of any rendering function */
typedef union {
void *gen;
asm_mono_t *asm_mono;
asm_gray_t *asm_gray;
asm_mono_scsp_t *asm_mono_scsp;
asm_gray_scsp_t *asm_gray_scsp;
} bopti_asm_t;
/* Each of the following rendering functions:
1. Takes VRAM data for two longword positions of the screen.
2. Reads data for one longword position of the image from *layer. This
consists in n longwords where n is the number of layers in the image.
3. Increments *layer by 4*n.
4. Shifts the image data and apply it to the VRAM positions in accordance
with the two masks given in the masks argument. */
/* bopti_asm_mono(): Rendering function for the "mono" profile */
extern asm_mono_t bopti_asm_mono;
/* bopti_asm_mono_alpha(): Rendering function for the "mono alpha" profile */
extern asm_mono_t bopti_asm_mono_alpha;
/* bopti_gasm_mono(): "mono" profile on gray VRAMs */
extern asm_gray_t bopti_gasm_mono;
/* bopti_gasm_mono_alpha(): "mono_alpha" profile on gray VRAMs */
extern asm_gray_t bopti_gasm_mono_alpha;
/* bopti_asm_gray(): Rendering function for the "gray" profile */
extern asm_gray_t bopti_gasm_gray;
/* bpoti_asm_gray_alpha(): Rendering function for the "gray_alpha" profile */
extern asm_gray_t bopti_gasm_gray_alpha;
/* Each of the following rendering functions:
1. Takes VRAM data from one longword position of the screen.
2. Reads data from one longword position of the image from layer.
3. Shifts the image data and applies it to the VRAM position.
None update the layer pointer. */
/* bopti_asm_mono_scsp(): SCSP "mono" profile */
extern asm_mono_scsp_t bopti_asm_mono_scsp;
/* bopti_asm_mono_alpha_scsp(): SCSP "mono_alpha" profile */
extern asm_mono_scsp_t bopti_asm_mono_alpha_scsp;
/* bopti_gasm_mono_scsp(): SCSP "mono" profile on gray VRAMs */
extern asm_gray_scsp_t bopti_gasm_mono_scsp;
/* bopti_gasm_mono_scsp_alpha(): SCSP "mono_alpha" profile on gray VRAMs */
extern asm_gray_scsp_t bopti_gasm_mono_alpha_scsp;
/* bopti_asm_gray_scsp(): SCSP "gray" profile */
extern asm_gray_scsp_t bopti_gasm_gray_scsp;
/* bpoti_asm_gray_alpha_scsp(): SCSP "gray_alpha" profile */
extern asm_gray_scsp_t bopti_gasm_gray_alpha_scsp;
//---
// Renderer's data structures
//---
/* struct rbox: A rendering box (target coordinates and source rectangle)
Meaning of fields vary during the rendering process! */
struct rbox
{
/* General renderer:
On-screen location of the leftmost pixel of the leftmost rendered
column (this particular pixel might not be drawn but is of
importance in the positioning process)
SCSP renderer:
Shift value used to align columns with positions */
int x;
/* On-screen location of top-left corner; the (x,y) of dsubimage() */
int visual_x, y;
/* Width of rendered sub-image */
int width;
/* Before bopti_render{_scsp}():
Left-coordinate of the source box (included, in pixels)
In bopti_render{_scsp}():
Left-coordinate of the source box (included, in columns) */
int left;
/* Number of columns used in the source box */
int columns;
/* Vertical bounds of the box in the image (inc-excluded, in pixels) */
int top, height;
};
#endif /* GINT_RENDERFX_BOPTIASM */

View File

@ -1,93 +0,0 @@
.global _bopti_asm_mono
.global _bopti_asm_mono_alpha
# REGISTER ALLOCATION:
# r0: layer (left)
# r1: layer (right)
# r2: (temp)
# r3: -
# --
# r4: vram (left)
# r5: vram (right)
# r6: layer pointer; f(x&31)
# r7: mask pointer
# --
# @r15: -(x&31)
_bopti_asm_mono:
# Read data longword and update the layer address pointer
mov.l @r6, r2
mov.l @r2+, r0
mov.l r2, @r6
mov r0, r1
# Shift the layer data
mov.l @r15, r6
shld r6, r0
add #32, r6
shld r6, r1
# Get the masks and clear the target VRAM area and unwanted image data
mov.l @r7, r2
and r2, r0
not r2, r2
and r2, r4
mov.l @(4, r7), r2
and r2, r1
not r2, r2
and r2, r5
# Do the drawing by joining the two
or r4, r0
rts
or r5, r1
# REGISTER ALLOCATION
# r0: layer_1 (left)
# r1: layer_1 (right)
# r2: layer_2 (left)
# r3: layer_2 (right)
# --
# r4: vram (left)
# r5: vram (right)
# r6: layer pointer; f(x&31); mask (left); mask (right)
# r7: mask pointer
# --
# @r15: -(x&31)
_bopti_asm_mono_alpha:
# Read data longwords and update the layer address pointer
mov.l @r6, r2
mov.l @r2+, r0
mov.l @r2+, r3
mov.l r2, @r6
mov r0, r1
mov r3, r2
# Shift all layer data
mov.l @r15, r6
shld r6, r0
shld r6, r2
add #32, r6
shld r6, r1
shld r6, r3
# Apply the masks on the layer data
mov.l @r7, r6
and r6, r0
and r6, r2
mov.l @(4, r7), r6
and r6, r1
and r6, r3
# Blit the clear on the VRAM
not r0, r0
and r4, r0
not r1, r1
and r5, r1
# Blit the write on the VRAM
or r2, r0
rts
or r3, r1

View File

@ -2,7 +2,9 @@
#include <gint/defs/util.h>
#include <gint/display.h>
#include "render-fx.h"
#include "bopti-asm.h"
#include <gint/config.h>
#if GINT_RENDER_MONO
#pragma GCC optimize("O3")
@ -305,3 +307,5 @@ int bopti_clip(bopti_image_t const *img, struct rbox *r)
/* Return non-zero if the result is empty */
return (width <= 0 || height <= 0);
}
#endif /* GINT_RENDER_MONO */

View File

@ -1,6 +1,9 @@
#include <gint/display.h>
#include "../render/render.h"
#include <gint/config.h>
#if GINT_RENDER_MONO
/* dclear() - fill the screen with a single color */
void dclear(color_t color)
{
@ -46,3 +49,5 @@ void dclear(color_t color)
*--index = fill;
}
}
#endif /* GINT_RENDER_MONO */

View File

@ -2,6 +2,9 @@
#include <gint/defs/types.h>
#include "../render/render.h"
#include <gint/config.h>
#if GINT_RENDER_MONO
int dgetpixel(int x, int y)
{
if(x < dwindow.left || x >= dwindow.right) return -1;
@ -14,3 +17,5 @@ int dgetpixel(int x, int y)
return (gint_vram[offset] & mask) ? C_BLACK : C_WHITE;
}
#endif /* GINT_RENDER_MONO */

Some files were not shown because too many files have changed in this diff Show More