Commit 7a7857f4 authored by aliaspider's avatar aliaspider
Browse files

C++ --> C99

parent 5339c79e
...@@ -79,7 +79,7 @@ OBJECTS := $(OBJECTS:.cpp=.o) ...@@ -79,7 +79,7 @@ OBJECTS := $(OBJECTS:.cpp=.o)
OBJECTS := $(OBJECTS:.S=.o) OBJECTS := $(OBJECTS:.S=.o)
OBJECTS := $(OBJECTS:.s=.o) OBJECTS := $(OBJECTS:.s=.o)
CFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) CFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) --std=c99
all: $(TARGET) all: $(TARGET)
......
...@@ -6,61 +6,61 @@ DEFINES += -O3 -DNDEBUG=1 ...@@ -6,61 +6,61 @@ DEFINES += -O3 -DNDEBUG=1
endif endif
SOURCES := SOURCES :=
SOURCES += $(CORE_DIR)/apu.cpp SOURCES += $(CORE_DIR)/apu.c
SOURCES += $(CORE_DIR)/apuaux.c SOURCES += $(CORE_DIR)/apuaux.c
SOURCES += $(CORE_DIR)/c4.cpp SOURCES += $(CORE_DIR)/c4.c
SOURCES += $(CORE_DIR)/c4emu.cpp SOURCES += $(CORE_DIR)/c4emu.c
SOURCES += $(CORE_DIR)/cheats.cpp SOURCES += $(CORE_DIR)/cheats.c
SOURCES += $(CORE_DIR)/cheats2.cpp SOURCES += $(CORE_DIR)/cheats2.c
SOURCES += $(CORE_DIR)/clip.cpp SOURCES += $(CORE_DIR)/clip.c
SOURCES += $(CORE_DIR)/data.cpp SOURCES += $(CORE_DIR)/data.c
SOURCES += $(CORE_DIR)/dsp1.cpp SOURCES += $(CORE_DIR)/dsp1.c
SOURCES += $(CORE_DIR)/fxemu.cpp SOURCES += $(CORE_DIR)/fxemu.c
SOURCES += $(CORE_DIR)/fxinst.cpp SOURCES += $(CORE_DIR)/fxinst.c
SOURCES += $(CORE_DIR)/globals.cpp SOURCES += $(CORE_DIR)/globals.c
SOURCES += $(CORE_DIR)/ppu.cpp SOURCES += $(CORE_DIR)/ppu.c
SOURCES += $(CORE_DIR)/dma.cpp SOURCES += $(CORE_DIR)/dma.c
SOURCES += $(CORE_DIR)/memmap.cpp SOURCES += $(CORE_DIR)/memmap.c
SOURCES += $(CORE_DIR)/cpu.cpp SOURCES += $(CORE_DIR)/cpu.c
SOURCES += $(CORE_DIR)/cpuexec.cpp SOURCES += $(CORE_DIR)/cpuexec.c
SOURCES += $(CORE_DIR)/cpuops.cpp SOURCES += $(CORE_DIR)/cpuops.c
SOURCES += $(CORE_DIR)/sa1.cpp SOURCES += $(CORE_DIR)/sa1.c
SOURCES += $(CORE_DIR)/sa1cpu.cpp SOURCES += $(CORE_DIR)/sa1cpu.c
SOURCES += $(CORE_DIR)/sdd1.cpp SOURCES += $(CORE_DIR)/sdd1.c
SOURCES += $(CORE_DIR)/sdd1emu.cpp SOURCES += $(CORE_DIR)/sdd1emu.c
SOURCES += $(CORE_DIR)/snapshot.cpp SOURCES += $(CORE_DIR)/snapshot.c
SOURCES += $(CORE_DIR)/soundux.cpp SOURCES += $(CORE_DIR)/soundux.c
SOURCES += $(CORE_DIR)/spc700.cpp SOURCES += $(CORE_DIR)/spc700.c
SOURCES += $(CORE_DIR)/srtc.cpp SOURCES += $(CORE_DIR)/srtc.c
SOURCES += $(CORE_DIR)/mode7new.cpp SOURCES += $(CORE_DIR)/mode7new.c
SOURCES += $(CORE_DIR)/mode7.cpp SOURCES += $(CORE_DIR)/mode7.c
SOURCES += $(CORE_DIR)/mode7add.cpp SOURCES += $(CORE_DIR)/mode7add.c
SOURCES += $(CORE_DIR)/mode7add1_2.cpp SOURCES += $(CORE_DIR)/mode7add1_2.c
SOURCES += $(CORE_DIR)/mode7sub.cpp SOURCES += $(CORE_DIR)/mode7sub.c
SOURCES += $(CORE_DIR)/mode7sub1_2.cpp SOURCES += $(CORE_DIR)/mode7sub1_2.c
SOURCES += $(CORE_DIR)/mode7prio.cpp SOURCES += $(CORE_DIR)/mode7prio.c
SOURCES += $(CORE_DIR)/mode7addprio.cpp SOURCES += $(CORE_DIR)/mode7addprio.c
SOURCES += $(CORE_DIR)/mode7add1_2prio.cpp SOURCES += $(CORE_DIR)/mode7add1_2prio.c
SOURCES += $(CORE_DIR)/mode7subprio.cpp SOURCES += $(CORE_DIR)/mode7subprio.c
SOURCES += $(CORE_DIR)/mode7sub1_2prio.cpp SOURCES += $(CORE_DIR)/mode7sub1_2prio.c
SOURCES += $(CORE_DIR)/gfx16.cpp SOURCES += $(CORE_DIR)/gfx16.c
SOURCES += $(CORE_DIR)/rops.cpp SOURCES += $(CORE_DIR)/rops.c
SOURCES += $(LIBRETRO_DIR)/libretro.cpp SOURCES += $(LIBRETRO_DIR)/libretro.c
SOURCES += $(LIBRETRO_DIR)/memstream.c SOURCES += $(LIBRETRO_DIR)/memstream.c
ifeq ($(ARM_ASM), 1) ifeq ($(ARM_ASM), 1)
SOURCES += $(CORE_DIR)/spc700a.s \ SOURCES += $(CORE_DIR)/spc700a.s \
$(CORE_DIR)/spc_decode.S $(CORE_DIR)/spc_decode.S
SOURCES += $(CORE_DIR)/tile16.cpp SOURCES += $(CORE_DIR)/tile16.c
SOURCES += $(CORE_DIR)/tile16add.cpp SOURCES += $(CORE_DIR)/tile16add.c
SOURCES += $(CORE_DIR)/tile16add1_2.cpp SOURCES += $(CORE_DIR)/tile16add1_2.c
SOURCES += $(CORE_DIR)/tile16fadd1_2.cpp SOURCES += $(CORE_DIR)/tile16fadd1_2.c
SOURCES += $(CORE_DIR)/tile16sub.cpp SOURCES += $(CORE_DIR)/tile16sub.c
SOURCES += $(CORE_DIR)/tile16sub1_2.cpp SOURCES += $(CORE_DIR)/tile16sub1_2.c
SOURCES += $(CORE_DIR)/tile16fsub1_2.cpp SOURCES += $(CORE_DIR)/tile16fsub1_2.c
else else
SOURCES += $(CORE_DIR)/tile_c.cpp SOURCES += $(CORE_DIR)/tile_c.c
endif endif
SOURCES += $(CORE_DIR)/os9x_65c816_global.s SOURCES += $(CORE_DIR)/os9x_65c816_global.s
...@@ -69,7 +69,7 @@ SOURCES += $(CORE_DIR)/os9x_65c816_spcc.s ...@@ -69,7 +69,7 @@ SOURCES += $(CORE_DIR)/os9x_65c816_spcc.s
#SOURCES += $(CORE_DIR)/os9x_65c816.s #SOURCES += $(CORE_DIR)/os9x_65c816.s
SOURCES += $(CORE_DIR)/os9x_asm_cpu.cpp SOURCES += $(CORE_DIR)/os9x_asm_cpu.c
#DEFINES += -D__GP2X__ #DEFINES += -D__GP2X__
#DEFINES += -DASMCPU #DEFINES += -DASMCPU
...@@ -88,11 +88,13 @@ DEFINES += -ffast-math -funroll-loops -fomit-frame-pointer ...@@ -88,11 +88,13 @@ DEFINES += -ffast-math -funroll-loops -fomit-frame-pointer
INCLUDES = -I$(LIBRETRO_DIR) -I$(CORE_DIR) -I. INCLUDES = -I$(LIBRETRO_DIR) -I$(CORE_DIR) -I.
DEFINES += -DHAVE_STRINGS_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -D__LIBRETRO__ -DINLINE=inline DEFINES += -DHAVE_STRINGS_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -D__LIBRETRO__ -DINLINE=inline
#DEFINES += -DRIGHTSHIFT_IS_SAR
DEFINES += -DUSE_SA1 DEFINES += -DUSE_SA1
ifeq ($(ARM_ASM), 1) ifeq ($(ARM_ASM), 1)
DEFINES += -mstructure-size-boundary=32 DEFINES += -mstructure-size-boundary=32
DEFINES += -DARM_ASM DEFINES += -DARM_ASM
DEFINES += -DRIGHTSHIFT_IS_SAR
endif endif
ifeq ($(platform), sncps3) ifeq ($(platform), sncps3)
......
...@@ -28,7 +28,7 @@ LIBRETRO_DIR := ../libretro ...@@ -28,7 +28,7 @@ LIBRETRO_DIR := ../libretro
include ../Makefile.common include ../Makefile.common
LOCAL_SRC_FILES := $(SOURCES) LOCAL_SRC_FILES := $(SOURCES)
LOCAL_CFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) LOCAL_CFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) --std=c99
LOCAL_ASFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) LOCAL_ASFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES)
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
...@@ -291,9 +291,9 @@ static void snes_init (void) ...@@ -291,9 +291,9 @@ static void snes_init (void)
CPU.Flags = 0; CPU.Flags = 0;
if (!Memory.Init() || !S9xInitAPU()) if (!MemoryInit() || !S9xInitAPU())
{ {
Memory.Deinit(); MemoryDeinit();
S9xDeinitAPU(); S9xDeinitAPU();
fprintf(stderr, "[libsnes]: Failed to init Memory or APU.\n"); fprintf(stderr, "[libsnes]: Failed to init Memory or APU.\n");
exit(1); exit(1);
...@@ -351,7 +351,7 @@ void retro_init (void) ...@@ -351,7 +351,7 @@ void retro_init (void)
void retro_deinit(void) void retro_deinit(void)
{ {
S9xDeinitAPU(); S9xDeinitAPU();
Memory.Deinit(); MemoryDeinit();
S9xGraphicsDeinit(); S9xGraphicsDeinit();
//S9xUnmapAllControls(); //S9xUnmapAllControls();
if(GFX.Screen) if(GFX.Screen)
...@@ -466,9 +466,9 @@ void retro_cheat_set(unsigned index, bool enable, const char* in_code) ...@@ -466,9 +466,9 @@ void retro_cheat_set(unsigned index, bool enable, const char* in_code)
uint32 address; uint32 address;
uint8 byte; uint8 byte;
if ( S9xProActionReplayToRaw(clean_code, address, byte) == NULL) if ( S9xProActionReplayToRaw(clean_code, &address, &byte) == NULL)
S9xAddCheat(true, true, address, byte); S9xAddCheat(true, true, address, byte);
else if ( S9xGameGenieToRaw(clean_code, address, byte) == NULL) else if ( S9xGameGenieToRaw(clean_code, &address, &byte) == NULL)
S9xAddCheat(true, true, address, byte); S9xAddCheat(true, true, address, byte);
// else, silently ignore // else, silently ignore
} }
...@@ -487,7 +487,7 @@ bool retro_load_game(const struct retro_game_info *game) ...@@ -487,7 +487,7 @@ bool retro_load_game(const struct retro_game_info *game)
/* Hack. S9x cannot do stuff from RAM. <_< */ /* Hack. S9x cannot do stuff from RAM. <_< */
memstream_set_buffer((uint8_t*)game->data, game->size); memstream_set_buffer((uint8_t*)game->data, game->size);
loaded = Memory.LoadROM(""); loaded = LoadROM("");
if (!loaded) if (!loaded)
{ {
fprintf(stderr, "[libretro]: Rom loading failed...\n"); fprintf(stderr, "[libretro]: Rom loading failed...\n");
...@@ -576,9 +576,8 @@ bool8 S9xContinueUpdate(int width, int height) { return TRUE; } ...@@ -576,9 +576,8 @@ bool8 S9xContinueUpdate(int width, int height) { return TRUE; }
void S9xSetPalette() {} void S9xSetPalette() {}
void S9xAutoSaveSRAM() {} void S9xAutoSaveSRAM() {}
void S9xLoadSDD1Data() {} void S9xLoadSDD1Data() {}
bool8 S9xReadMousePosition (int which1_0_to_1, int &x, int &y, uint32 &buttons) { return FALSE; } bool8 S9xReadMousePosition (int which1_0_to_1, int* x, int* y, uint32* buttons) { return FALSE; }
bool8 S9xReadSuperScopePosition (int &x, int &y, uint32 &buttons) { return FALSE; } bool8 S9xReadSuperScopePosition (int* x, int* y, uint32* buttons) { return FALSE; }
void JustifierButtons(uint32& x) {}
bool JustifierOffscreen() { return false; } bool JustifierOffscreen() { return false; }
START_EXTERN_C START_EXTERN_C
......
...@@ -188,7 +188,7 @@ static uint8 region_map[6][6] = ...@@ -188,7 +188,7 @@ static uint8 region_map[6][6] =
}; };
static inline uint8 CalcWindowMask (int, uint8, uint8); static inline uint8 CalcWindowMask (int, uint8, uint8);
static inline void StoreWindowRegions (uint8, struct ClipData *, int, int16 *, uint8 *, bool8, bool8 s = FALSE); static inline void StoreWindowRegions (uint8, ClipData *, int, int16 *, uint8 *, bool8, bool8 s = FALSE);
static inline uint8 CalcWindowMask (int i, uint8 W1, uint8 W2) static inline uint8 CalcWindowMask (int i, uint8 W1, uint8 W2)
...@@ -240,7 +240,7 @@ static inline uint8 CalcWindowMask (int i, uint8 W1, uint8 W2) ...@@ -240,7 +240,7 @@ static inline uint8 CalcWindowMask (int i, uint8 W1, uint8 W2)
return (0); return (0);
} }
static inline void StoreWindowRegions (uint8 Mask, struct ClipData *Clip, int n_regions, int16 *windows, uint8 *drawing_modes, bool8 sub, bool8 StoreMode0) static inline void StoreWindowRegions (uint8 Mask, ClipData *Clip, int n_regions, int16 *windows, uint8 *drawing_modes, bool8 sub, bool8 StoreMode0)
{ {
int ct = 0; int ct = 0;
......
...@@ -110,10 +110,10 @@ extern NormalTileRenderer DrawHiResTilePtr; ...@@ -110,10 +110,10 @@ extern NormalTileRenderer DrawHiResTilePtr;
extern ClippedTileRenderer DrawHiResClippedTilePtr; extern ClippedTileRenderer DrawHiResClippedTilePtr;
extern LargePixelRenderer DrawLargePixelPtr; extern LargePixelRenderer DrawLargePixelPtr;
extern struct SBG BG; extern SBG BG;
extern struct SLineData LineData[240]; extern SLineData LineData[240];
extern struct SLineMatrixData LineMatrixData [240]; extern SLineMatrixData LineMatrixData [240];
extern uint8 Mode7Depths [2]; extern uint8 Mode7Depths [2];
...@@ -581,7 +581,7 @@ void RenderLine (uint8 C) ...@@ -581,7 +581,7 @@ void RenderLine (uint8 C)
if (PPU.BGMode == 7) if (PPU.BGMode == 7)
{ {
struct SLineMatrixData *p = &LineMatrixData [C]; SLineMatrixData *p = &LineMatrixData [C];
p->MatrixA = PPU.MatrixA; p->MatrixA = PPU.MatrixA;
p->MatrixB = PPU.MatrixB; p->MatrixB = PPU.MatrixB;
p->MatrixC = PPU.MatrixC; p->MatrixC = PPU.MatrixC;
...@@ -699,7 +699,7 @@ TileRendererSet TileRenderersNoZ[] = { ...@@ -699,7 +699,7 @@ TileRendererSet TileRenderersNoZ[] = {
{DrawNoZTile16Sub1_2, DrawClippedTile16Sub1_2, DrawLargePixel16Sub1_2}, // 7 -> GFX.r2131:7 = 1, GFX.r2131:6 = 1, GFX.r2130:1 = 1 {DrawNoZTile16Sub1_2, DrawClippedTile16Sub1_2, DrawLargePixel16Sub1_2}, // 7 -> GFX.r2131:7 = 1, GFX.r2131:6 = 1, GFX.r2130:1 = 1
{DrawNoZTile16, DrawClippedTile16, DrawLargePixel16} // 8 -> normal {DrawNoZTile16, DrawClippedTile16, DrawLargePixel16} // 8 -> normal
}; };
INLINE void SelectTileRenderer (bool8_32 normal, bool NoZ = false) static INLINE void SelectTileRenderer (bool8_32 normal, bool NoZ = false)
{ {
if (normal) { if (normal) {
TileRenderer = 8; TileRenderer = 8;
...@@ -2226,23 +2226,23 @@ void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D) ...@@ -2226,23 +2226,23 @@ void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D)
} }
if (BG0) if (BG0)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(0)); SelectTileRenderer (sub || !SUB_OR_ADD(0), false);
DrawBackground (PPU.BGMode, 0, D + 10, D + 14); DrawBackground (PPU.BGMode, 0, D + 10, D + 14);
} }
if (BG1) if (BG1)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(1)); SelectTileRenderer (sub || !SUB_OR_ADD(1), false);
DrawBackground (PPU.BGMode, 1, D + 9, D + 13); DrawBackground (PPU.BGMode, 1, D + 9, D + 13);
} }
if (BG2) if (BG2)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(2)); SelectTileRenderer (sub || !SUB_OR_ADD(2), false);
DrawBackground (PPU.BGMode, 2, D + 3, DrawBackground (PPU.BGMode, 2, D + 3,
PPU.BG3Priority ? D + 17 : D + 6); PPU.BG3Priority ? D + 17 : D + 6);
} }
if (BG3 && PPU.BGMode == 0) if (BG3 && PPU.BGMode == 0)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(3)); SelectTileRenderer (sub || !SUB_OR_ADD(3), false);
DrawBackground (PPU.BGMode, 3, D + 2, D + 5); DrawBackground (PPU.BGMode, 3, D + 2, D + 5);
} }
} }
...@@ -2255,12 +2255,12 @@ void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D) ...@@ -2255,12 +2255,12 @@ void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D)
} }
if (BG0) if (BG0)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(0)); SelectTileRenderer (sub || !SUB_OR_ADD(0), false);
DrawBackground (PPU.BGMode, 0, D + 5, D + 13); DrawBackground (PPU.BGMode, 0, D + 5, D + 13);
} }
if (PPU.BGMode != 6 && BG1) if (PPU.BGMode != 6 && BG1)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(1)); SelectTileRenderer (sub || !SUB_OR_ADD(1), false);
DrawBackground (PPU.BGMode, 1, D + 2, D + 9); DrawBackground (PPU.BGMode, 1, D + 2, D + 9);
} }
} }
...@@ -2472,7 +2472,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW()) ...@@ -2472,7 +2472,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW())
!((GFX.r2130 & 0x30) == 0x10 && IPPU.Clip[1].Count[5] == 0)) !((GFX.r2130 & 0x30) == 0x10 && IPPU.Clip[1].Count[5] == 0))
{ {
// transparency effects in use, so lets get busy! // transparency effects in use, so lets get busy!
struct ClipData *pClip; ClipData *pClip;
uint32 fixedColour; uint32 fixedColour;
GFX.FixedColour = BUILD_PIXEL (IPPU.XB [PPU.FixedColourRed], GFX.FixedColour = BUILD_PIXEL (IPPU.XB [PPU.FixedColourRed],
IPPU.XB [PPU.FixedColourGreen], IPPU.XB [PPU.FixedColourGreen],
...@@ -2517,7 +2517,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW()) ...@@ -2517,7 +2517,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW())
register unsigned int width = pClip->Right [c][5] - pClip->Left [c][5]; register unsigned int width = pClip->Right [c][5] - pClip->Left [c][5];
if (width > 0) { if (width > 0) {
asm volatile ( __asm__ volatile (
" mov r0, %[fixedcolour] \n" " mov r0, %[fixedcolour] \n"
" subs %[width], %[width], #4 \n" " subs %[width], %[width], #4 \n"
" bmi 2f \n" " bmi 2f \n"
...@@ -2575,7 +2575,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW()) ...@@ -2575,7 +2575,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW())
if (IPPU.Clip [0].Count [5]) if (IPPU.Clip [0].Count [5])
{ {
asm volatile ( __asm__ volatile (
"1: \n" "1: \n"
" mov r1, #(256 >> 2) \n" " mov r1, #(256 >> 2) \n"
...@@ -2655,7 +2655,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW()) ...@@ -2655,7 +2655,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW())
} }
#define SUBSCREEN_BG(rop, half) \ #define SUBSCREEN_BG(rop, half) \
\ \
asm volatile (\ __asm__ volatile (\
" ldrb r0, [%[d]], #1 \n"\ " ldrb r0, [%[d]], #1 \n"\
"71: \n"\ "71: \n"\
\ \
...@@ -2722,7 +2722,7 @@ ROP_##rop##half (r0, r1)\ ...@@ -2722,7 +2722,7 @@ ROP_##rop##half (r0, r1)\
// copy the sub-screen to the main screen // copy the sub-screen to the main screen
// or fill it with the back-drop colour if the // or fill it with the back-drop colour if the
// sub-screen is clear. // sub-screen is clear.
asm volatile ( __asm__ volatile (
" ldrb r0, [%[d]], #1 \n" " ldrb r0, [%[d]], #1 \n"
"31: \n" "31: \n"
...@@ -2775,7 +2775,7 @@ ROP_##rop##half (r0, r1)\ ...@@ -2775,7 +2775,7 @@ ROP_##rop##half (r0, r1)\
uint32 Left = pClip->Left [b][5]; uint32 Left = pClip->Left [b][5];
uint32 Right = pClip->Right [b][5]; uint32 Right = pClip->Right [b][5];
if (Left >= Right) continue; if (Left >= Right) continue;
asm volatile ( __asm__ volatile (
" tst %[c], #1 \n" " tst %[c], #1 \n"
" bne 21f \n" " bne 21f \n"
...@@ -2815,7 +2815,7 @@ ROP_##rop##half (r0, r1)\ ...@@ -2815,7 +2815,7 @@ ROP_##rop##half (r0, r1)\
} }
else else
{ {
asm volatile ( __asm__ volatile (
"@ -- SubScreen clear \n" "@ -- SubScreen clear \n"
"1113: \n" "1113: \n"
" mov r1, #(256/8) \n" " mov r1, #(256/8) \n"
...@@ -2902,7 +2902,7 @@ ROP_##rop##half (r0, r1)\ ...@@ -2902,7 +2902,7 @@ ROP_##rop##half (r0, r1)\
{ {
register unsigned int width = IPPU.Clip [0].Right [c][5] - IPPU.Clip [0].Left [c][5]; register unsigned int width = IPPU.Clip [0].Right [c][5] - IPPU.Clip [0].Left [c][5];
if (width > 0) { if (width > 0) {
asm volatile ( __asm__ volatile (
" mov r0, %[back] \n" " mov r0, %[back] \n"
" subs %[width], %[width], #4 \n" " subs %[width], %[width], #4 \n"
" bmi 2f \n" " bmi 2f \n"
...@@ -3063,7 +3063,7 @@ else \ ...@@ -3063,7 +3063,7 @@ else \
if (OB) if (OB)
{ {
FIXCLIP(4); FIXCLIP(4);
DrawOBJS (); DrawOBJS (FALSE, 0);
} }
if (BG0) if (BG0)
{ {
...@@ -3093,7 +3093,7 @@ else \ ...@@ -3093,7 +3093,7 @@ else \
if (OB) if (OB)
{ {
FIXCLIP(4); FIXCLIP(4);
DrawOBJS (); DrawOBJS (FALSE, 0);
} }
if (BG0) if (BG0)
{ {
...@@ -3113,7 +3113,7 @@ else \ ...@@ -3113,7 +3113,7 @@ else \
if (OB) if (OB)
{ {
FIXCLIP(4); FIXCLIP(4);
DrawOBJS (); DrawOBJS (FALSE, 0);
} }
} }
} }
......
...@@ -115,10 +115,10 @@ extern NormalTileRenderer DrawHiResTilePtr; ...@@ -115,10 +115,10 @@ extern NormalTileRenderer DrawHiResTilePtr;
extern ClippedTileRenderer DrawHiResClippedTilePtr; extern ClippedTileRenderer DrawHiResClippedTilePtr;
extern LargePixelRenderer DrawLargePixelPtr; extern LargePixelRenderer DrawLargePixelPtr;
extern struct SBG BG; extern SBG BG;
extern struct SLineData LineData[240]; extern SLineData LineData[240];
extern struct SLineMatrixData LineMatrixData [240]; extern SLineMatrixData LineMatrixData [240];
extern uint8 Mode7Depths [2]; extern uint8 Mode7Depths [2];
...@@ -586,7 +586,7 @@ void RenderLine (uint8 C) ...@@ -586,7 +586,7 @@ void RenderLine (uint8 C)
if (PPU.BGMode == 7) if (PPU.BGMode == 7)
{ {
struct SLineMatrixData *p = &LineMatrixData [C]; SLineMatrixData *p = &LineMatrixData [C];
p->MatrixA = PPU.MatrixA; p->MatrixA = PPU.MatrixA;
p->MatrixB = PPU.MatrixB; p->MatrixB = PPU.MatrixB;
p->MatrixC = PPU.MatrixC; p->MatrixC = PPU.MatrixC;
...@@ -704,7 +704,7 @@ TileRendererSet TileRenderersNoZ[] = { ...@@ -704,7 +704,7 @@ TileRendererSet TileRenderersNoZ[] = {
{DrawNoZTile16Sub1_2, DrawClippedTile16Sub1_2, DrawLargePixel16Sub1_2}, // 7 -> GFX.r2131:7 = 1, GFX.r2131:6 = 1, GFX.r2130:1 = 1 {DrawNoZTile16Sub1_2, DrawClippedTile16Sub1_2, DrawLargePixel16Sub1_2}, // 7 -> GFX.r2131:7 = 1, GFX.r2131:6 = 1, GFX.r2130:1 = 1
{DrawNoZTile16, DrawClippedTile16, DrawLargePixel16} // 8 -> normal {DrawNoZTile16, DrawClippedTile16, DrawLargePixel16} // 8 -> normal
}; };
INLINE void SelectTileRenderer (bool8_32 normal, bool NoZ = false) static INLINE void SelectTileRenderer (bool8_32 normal, bool NoZ = false)
{ {
if (normal) { if (normal) {
TileRenderer = 8; TileRenderer = 8;
...@@ -2242,23 +2242,23 @@ void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D) ...@@ -2242,23 +2242,23 @@ void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D)
} }
if (BG0) if (BG0)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(0)); SelectTileRenderer (sub || !SUB_OR_ADD(0), false);
DrawBackground (PPU.BGMode, 0, D + 10, D + 14); DrawBackground (PPU.BGMode, 0, D + 10, D + 14);
} }
if (BG1) if (BG1)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(1)); SelectTileRenderer (sub || !SUB_OR_ADD(1), false);
DrawBackground (PPU.BGMode, 1, D + 9, D + 13); DrawBackground (PPU.BGMode, 1, D + 9, D + 13);
} }
if (BG2) if (BG2)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(2)); SelectTileRenderer (sub || !SUB_OR_ADD(2), false);
DrawBackground (PPU.BGMode, 2, D + 3, DrawBackground (PPU.BGMode, 2, D + 3,
PPU.BG3Priority ? D + 17 : D + 6); PPU.BG3Priority ? D + 17 : D + 6);
} }
if (BG3 && PPU.BGMode == 0) if (BG3 && PPU.BGMode == 0)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(3)); SelectTileRenderer (sub || !SUB_OR_ADD(3), false);
DrawBackground (PPU.BGMode, 3, D + 2, D + 5); DrawBackground (PPU.BGMode, 3, D + 2, D + 5);
} }
} }
...@@ -2271,12 +2271,12 @@ void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D) ...@@ -2271,12 +2271,12 @@ void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D)
} }
if (BG0) if (BG0)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(0)); SelectTileRenderer (sub || !SUB_OR_ADD(0), false);
DrawBackground (PPU.BGMode, 0, D + 5, D + 13); DrawBackground (PPU.BGMode, 0, D + 5, D + 13);
} }
if (PPU.BGMode != 6 && BG1) if (PPU.BGMode != 6 && BG1)
{ {
SelectTileRenderer (sub || !SUB_OR_ADD(1)); SelectTileRenderer (sub || !SUB_OR_ADD(1), false);
DrawBackground (PPU.BGMode, 1, D + 2, D + 9); DrawBackground (PPU.BGMode, 1, D + 2, D + 9);
} }
} }
...@@ -2488,7 +2488,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW()) ...@@ -2488,7 +2488,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW())
!((GFX.r2130 & 0x30) == 0x10 && IPPU.Clip[1].Count[5] == 0)) !((GFX.r2130 & 0x30) == 0x10 && IPPU.Clip[1].Count[5] == 0))
{ {
// transparency effects in use, so lets get busy! // transparency effects in use, so lets get busy!