CONF_BUILD_ASM_SPC700?=0
CONF_BUILD_ASM_SA1?=0
CONF_BUILD_MISC_ROUTINES?=misc_i386
+else ifeq ($(ARCH),amd64)
+ CONF_BUILD_ASM_CPU?=0
+ CONF_BUILD_ASM_SPC700?=0
+ CONF_BUILD_ASM_SA1?=0
+ CONF_BUILD_MISC_ROUTINES?=misc_amd64
endif
# Hardware pixel doubling (in N8x0)
CONF_XSP?=0
clean:
rm -f drnoksnes *.o *.d platform/*.o platform/*.d
rm -f build-stamp configure-stamp
+ echo "$(OBJS)"
remake: clean deps all
+++ /dev/null
-#ifndef _ASMMEMFUNCS_H_
-#define _ASMMEMFUNCS_H_
-
-#define memset32(_dst, _c, _count) \
-({ uint32_t *dst = (_dst); uint32_t c = (_c); int count = (_count); uint32_t dummy0, dummy1, dummy2; \
- __asm__ __volatile__ ( \
- " cmp %[count], #4\n" \
- " blt 2f\n" \
- " mov %[dummy0], %[c]\n" \
- " tst %[dst], #4\n" \
- " strne %[c], [%[dst]], #4\n" \
- " subne %[count], %[count], #1\n" \
- " tst %[dst], #8\n" \
- " stmneia %[dst]!, {%[dummy0], %[c]}\n" \
- " subne %[count], %[count], #2\n" \
- " mov %[dummy1], %[c]\n" \
- " mov %[dummy2], %[c]\n" \
- "1:\n"\
- " subs %[count], %[count], #4\n" \
- " stmgeia %[dst]!, {%[dummy0], %[dummy1], %[dummy2], %[c]}\n" \
- " bge 1b\n" \
- " add %[count], %[count], #4\n" \
- "2:\n"\
- " subs %[count], %[count], #1\n" \
- " strge %[c], [%[dst]], #4\n" \
- " subs %[count], %[count], #1\n" \
- " strge %[c], [%[dst]], #4\n" \
- " subs %[count], %[count], #1\n" \
- " strge %[c], [%[dst]], #4\n" \
- "\n" \
- : [dst] "+&r" (dst), [count] "+&r" (count), [dummy0] "=&r" (dummy0), [dummy1] "=&r" (dummy1), [dummy2] "=&r" (dummy2), [c] "+&r" (c) \
- : \
- : "cc", "memory" \
- ); _dst; \
-})
-
-#define memset16(_dst, _c, _count) \
-({ uint16_t *dst = (_dst); uint16_t c = (_c); int count = (_count); uint32_t dummy0, dummy1, dummy2; \
- __asm__ __volatile__ ( \
- " cmp %[count], #2\n" \
- " blt 3f\n" \
- /* Alignment is known to be at least 16-bit */ \
- " tst %[dst], #2\n" \
- " strneh %[c], [%[dst]], #2\n" \
- " subne %[count], %[count], #1\n" \
- /* Now we are 32-bit aligned (need to upgrade 'c' to 32-bit )*/ \
- " orr %[c], %[c], %[c], asl #16\n" \
- " mov %[dummy0], %[c]\n" \
- " cmp %[count], #8\n" \
- " blt 2f\n" \
- " tst %[dst], #4\n" \
- " strne %[c], [%[dst]], #4\n" \
- " subne %[count], %[count], #2\n" \
- " tst %[dst], #8\n" \
- " stmneia %[dst]!, {%[dummy0], %[c]}\n" \
- " subne %[count], %[count], #4\n" \
- /* Now we are 128-bit aligned */ \
- " mov %[dummy1], %[c]\n" \
- " mov %[dummy2], %[c]\n" \
- "1:\n" /* Copy 4 32-bit values per loop iteration */ \
- " subs %[count], %[count], #8\n" \
- " stmgeia %[dst]!, {%[dummy0], %[dummy1], %[dummy2], %[c]}\n" \
- " bge 1b\n" \
- " add %[count], %[count], #8\n" \
- "2:\n" /* Copy up to 3 remaining 32-bit values */ \
- " tst %[count], #4\n" \
- " stmneia %[dst]!, {%[dummy0], %[c]}\n" \
- " tst %[count], #2\n" \
- " strne %[c], [%[dst]], #4\n" \
- " and %[count], %[count], #1\n" \
- "3:\n" /* Copy up to 1 remaining 16-bit value */ \
- " subs %[count], %[count], #1\n" \
- " strgeh %[c], [%[dst]], #2\n" \
- "\n" \
- : [dst] "+&r" (dst), [count] "+&r" (count), [dummy0] "=&r" (dummy0), [dummy1] "=&r" (dummy1), [dummy2] "=&r" (dummy2), [c] "+&r" (c) \
- : \
- : "cc", "memory" \
- ); _dst;\
-})
-
-#define memcpy32(_dst, _src, _count) \
-({ uint32_t *dst = (_dst); uint32_t *src = (_src); int count = (_count); \
- __asm__ __volatile__ ( \
- " cmp %[count], #4\n" \
- " blt 2f\n" \
- " tst %[dst], #4\n" \
- " ldrne r4, [%[src]], #4\n" \
- " strne r4, [%[dst]], #4\n" \
- " subne %[count], %[count], #1\n" \
- " tst %[dst], #8\n" \
- " ldmneia %[src]!, {r4-r5}\n" \
- " stmneia %[dst]!, {r4-r5}\n" \
- " subne %[count], %[count], #2\n" \
- "1:\n" \
- " subs %[count], %[count], #4\n" \
- " ldmgeia %[src]!, {r4-r7}\n" \
- " stmgeia %[dst]!, {r4-r7}\n" \
- " bge 1b\n" \
- " add %[count], %[count], #4\n" \
- "2:\n" \
- " tst %[count], #2\n" \
- " ldmneia %[src]!, {r4-r5}\n" \
- " stmneia %[dst]!, {r4-r5}\n" \
- " tst %[count], #1\n" \
- " ldrne r4, [%[src]], #4\n" \
- " strne r4, [%[dst]], #4\n" \
- "\n" \
- : [dst] "+&r" (dst), [src] "+&r" (src), [count] "+&r" (count) \
- : \
- : "r4", "r5", "r6", "r7", "cc", "memory" \
- ); _dst; \
-})
-
-#define memcpy16(_dst, _src, _count) \
-({ uint16_t *dst = (_dst); uint16_t *src = (_src); int count = (_count); uint32_t dummy0; \
- __asm__ __volatile__ ( \
- " cmp %[count], #2\n" \
- " blt 6f\n" \
- /* Alignment is known to be at least 16-bit */ \
- " tst %[dst], #2\n" \
- " ldrneh r4, [%[src]], #2\n" \
- " strneh r4, [%[dst]], #2\n" \
- " subne %[count], %[count], #1\n" \
- /* Now destination address is 32-bit aligned, still need to check whether */ \
- /* source is 32-bit aligned or not */ \
- " tst %[src], #2\n" \
- " bne 3f\n" \
- /* Both destination and source are 32-bit aligned */ \
- " cmp %[count], #8\n" \
- " blt 2f\n" \
- " tst %[dst], #4\n" \
- " ldrne r4, [%[src]], #4\n" \
- " strne r4, [%[dst]], #4\n" \
- " subne %[count], %[count], #2\n" \
- " tst %[dst], #8\n" \
- " ldmneia %[src]!, {r4-r5}\n" \
- " stmneia %[dst]!, {r4-r5}\n" \
- " subne %[count], %[count], #4\n" \
- /* Destination address is 128-bit aligned, source address is 32-bit aligned */ \
- "1: subs %[count], %[count], #8\n" \
- " ldmgeia %[src]!, {r4-r7}\n" \
- " stmgeia %[dst]!, {r4-r7}\n" \
- " bge 1b\n" \
- " add %[count], %[count], #8\n" \
- /* Copy up to 3 remaining aligned 32-bit values */ \
- "2: tst %[count], #4\n" \
- " ldmneia %[src]!, {r4-r5}\n" \
- " stmneia %[dst]!, {r4-r5}\n" \
- " tst %[count], #2\n" \
- " ldrne r4, [%[src]], #4\n" \
- " strne r4, [%[dst]], #4\n" \
- " and %[count], %[count], #1\n" \
- " b 6f\n" \
- /* Destination is 32-bit aligned, but source is only 16-bit aligned */ \
- "3: cmp %[count], #8\n" \
- " blt 5f\n" \
- " tst %[dst], #4\n" \
- " ldrneh r4, [%[src]], #2\n" \
- " ldrneh r5, [%[src]], #2\n" \
- " orrne r4, r4, r5, asl #16\n" \
- " strne r4, [%[dst]], #4\n" \
- " subne %[count], %[count], #2\n" \
- " tst %[dst], #8\n" \
- " ldrneh r4, [%[src]], #2\n" \
- " ldrne r5, [%[src]], #4\n" \
- " ldrneh r6, [%[src]], #2\n" \
- " orrne r4, r4, r5, asl #16\n" \
- " movne r5, r5, lsr #16\n" \
- " orrne r5, r5, r6, asl #16\n" \
- " stmneia %[dst]!, {r4-r5}\n" \
- " subne %[count], %[count], #4\n" \
- /* Destination is 128-bit aligned, but source is only 16-bit aligned */ \
- "4: subs %[count], %[count], #8\n" \
- " ldrgeh r4, [%[src]], #2\n" \
- " ldmgeia %[src]!, {r5-r7}\n" \
- " ldrgeh %[dummy0], [%[src]], #2\n" \
- " orrge r4, r4, r5, asl #16\n" \
- " movge r5, r5, lsr #16\n" \
- " orrge r5, r5, r6, asl #16\n" \
- " movge r6, r6, lsr #16\n" \
- " orrge r6, r6, r7, asl #16\n" \
- " movge r7, r7, lsr #16\n" \
- " orrge r7, r7, %[dummy0], asl #16\n" \
- " stmgeia %[dst]!, {r4-r7}\n" \
- " bge 4b\n" \
- " add %[count], %[count], #8\n" \
- /* Copy up to 6 remaining 16-bit values (to 32-bit aligned destination) */ \
- "5: subs %[count], %[count], #2\n" \
- " ldrgeh r4, [%[src]], #2\n" \
- " ldrgeh r5, [%[src]], #2\n" \
- " orrge r4, r4, r5, asl #16\n" \
- " strge r4, [%[dst]], #4\n" \
- " bge 5b\n" \
- " add %[count], %[count], #2\n" \
- /* Copy the last remaining 16-bit value if any */ \
- "6: subs %[count], %[count], #1\n" \
- " ldrgeh r4, [%[src]], #2\n" \
- " strgeh r4, [%[dst]], #2\n" \
- "\n" \
- : [dst] "+&r" (dst), [src] "+&r" (src), [count] "+&r" (count), [dummy0] "=&r" (dummy0) \
- : \
- : "r4", "r5", "r6", "r7", "cc", "memory" \
- ); _dst; \
-})
-
-#endif
#ifdef __memcheck__
mem_check+=(Address>>16)+Address;
#endif
-#if defined(VAR_CYCLES) || defined(CPU_SHUTDOWN)
- int block;
- uint8 *GetAddress = Memory.Map [block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
-#else
- uint8 *GetAddress = Memory.Map [(Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
-#endif
- if (GetAddress >= (uint8 *) CMemory::MAP_LAST)
- {
+ const int block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK;
+ uint8 *GetAddress = Memory.Map[block];
+
+ if (GetAddress >= (uint8 *) CMemory::MAP_LAST)
+ {
#ifdef VAR_CYCLES
- CPU.Cycles += Memory.MemorySpeed [block];
+ CPU.Cycles += Memory.MemorySpeed [block];
#endif
#ifdef CPU_SHUTDOWN
- if (Memory.BlockIsRAM [block])
- CPU.WaitAddress = CPU.PCAtOpcodeStart;
+ if (Memory.BlockIsRAM [block])
+ CPU.WaitAddress = CPU.PCAtOpcodeStart;
#endif
- return (*(GetAddress + (Address & 0xffff)));
- }
+ return (*(GetAddress + (Address & 0xffff)));
+ }
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
#ifdef VAR_CYCLES
#ifdef __memcheck__
mem_check+=(Address>>16)+Address;
#endif
- if ((Address & 0x1fff) == 0x1fff)
- {
- return (S9xGetByte (Address) | (S9xGetByte (Address + 1) << 8));
- }
-#if defined(VAR_CYCLES) || defined(CPU_SHUTDOWN)
- int block;
- uint8 *GetAddress = Memory.Map [block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
-#else
- uint8 *GetAddress = Memory.Map [(Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
-#endif
+ if ((Address & 0x1fff) == 0x1fff)
+ {
+ return (S9xGetByte (Address) | (S9xGetByte (Address + 1) << 8));
+ }
+
+ const int block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK;
+ uint8 *GetAddress = Memory.Map[block];
+
if (GetAddress >= (uint8 *) CMemory::MAP_LAST)
{
#ifdef VAR_CYCLES
#endif
}
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
#ifdef VAR_CYCLES
#if defined(CPU_SHUTDOWN)
CPU.WaitAddress = NULL;
#endif
-#if defined(VAR_CYCLES)
- int block;
- uint8 *SetAddress = Memory.WriteMap [block = ((Address >> MEMMAP_SHIFT) & MEMMAP_MASK)];
-#else
- uint8 *SetAddress = Memory.WriteMap [(Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
-#endif
+ const int block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK;
+ uint8 *SetAddress = Memory.WriteMap[block];
if (SetAddress >= (uint8 *) CMemory::MAP_LAST)
{
return;
}
- switch ((int) SetAddress)
+ switch ((CMemory::Types)(intptr_t) SetAddress)
{
case CMemory::MAP_PPU:
#ifdef VAR_CYCLES
#if defined(CPU_SHUTDOWN)
CPU.WaitAddress = NULL;
#endif
-#if defined (VAR_CYCLES)
- int block;
- uint8 *SetAddress = Memory.WriteMap [block = ((Address >> MEMMAP_SHIFT) & MEMMAP_MASK)];
-#else
- uint8 *SetAddress = Memory.WriteMap [(Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
-#endif
+ const int block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK;
+ uint8 *SetAddress = Memory.WriteMap[block];
if (SetAddress >= (uint8 *) CMemory::MAP_LAST)
{
return;
}
- switch ((int) SetAddress)
+ switch ((CMemory::Types)(intptr_t) SetAddress)
{
case CMemory::MAP_PPU:
#ifdef VAR_CYCLES
if (GetAddress >= (uint8 *) CMemory::MAP_LAST)
return (GetAddress);
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
return (Memory.FillRAM - 0x2000);
if (GetAddress >= (uint8 *) CMemory::MAP_LAST)
return (GetAddress + (Address & 0xffff));
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
return (Memory.FillRAM - 0x2000 + (Address & 0xffff));
return;
}
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
#ifdef VAR_CYCLES
Count = 8 - Offset;
if (Count > Width)
Count = Width;
- s -= Offset * GFX_PIX_SIZE;
+ s -= Offset * GFX_PIX_SIZE;
Tile = READ_2BYTES(t);
GFX.Z1 = GFX.Z2 = depths [(Tile & 0x2000) >> 13];
#include <string.h>
#include <ctype.h>
-#ifdef __linux
-//#include <unistd.h>
-#endif
+/* Do not reencode this file. There are special chars on it. */
#include "snes9x.h"
#include "memmap.h"
bool8_32 CMemory::SaveSRAM (const char *filename)
{
- int size = Memory.SRAMSize ?
- (1 << (Memory.SRAMSize + 3)) * 128 : 0;
- if (Settings.SRTC)
- {
- size += SRTC_SRAM_PAD;
- S9xSRTCPreSaveState ();
- }
+ size_t size = Memory.SRAMSize ?
+ (1 << (Memory.SRAMSize + 3)) * 128 : 0;
- if (Settings.SDD1)
- S9xSDD1SaveLoggedData ();
+ if (Settings.SRTC)
+ {
+ size += SRTC_SRAM_PAD;
+ S9xSRTCPreSaveState ();
+ }
- if (size > 0x20000)
- size = 0x20000;
+ if (Settings.SDD1) S9xSDD1SaveLoggedData ();
- if (size && *Memory.ROMFilename)
- {
- FILE *file;
- if ((file = fopen (filename, "wb")))
+ if (size > 0x20000) size = 0x20000;
+
+ if (size && *Memory.ROMFilename)
{
- fwrite ((char *) ::SRAM, size, 1, file);
- fclose (file);
-#if defined(__linux)
- chown (filename, getuid (), getgid ());
-#endif
- return (TRUE);
- }
+ FILE *file;
+ if ((file = fopen (filename, "wb")))
+ {
+ if (fwrite((char *) ::SRAM, size, 1, file) == size) {
+ fclose(file);
+ return TRUE;
+ }
+ fclose(file);
+ return FALSE;
+ }
}
- return (FALSE);
+
+ return FALSE;
}
void CMemory::FixROMSpeed ()
const char *ROMID ();
const char *CompanyID ();
- enum {
+ enum Types {
MAP_PPU, MAP_CPU, MAP_DSP, MAP_LOROM_SRAM, MAP_HIROM_SRAM,
MAP_NONE, MAP_DEBUG, MAP_C4, MAP_BWRAM, MAP_BWRAM_BITMAP,
MAP_BWRAM_BITMAP2, MAP_SA1RAM, MAP_LAST
if (GetAddress >= (uint8 *) CMemory::MAP_LAST)
return (*(GetAddress + (address & 0xffff)));
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
return (S9xGetSA1 (address & 0xffff));
void S9xSA1SetByte (uint8 byte, uint32 address)
{
- uint8 *Setaddress = SA1.WriteMap [(address >> MEMMAP_SHIFT) & MEMMAP_MASK];
+ uint8 *SetAddress = SA1.WriteMap [(address >> MEMMAP_SHIFT) & MEMMAP_MASK];
- if (Setaddress >= (uint8 *) CMemory::MAP_LAST)
+ if (SetAddress >= (uint8 *) CMemory::MAP_LAST)
{
- *(Setaddress + (address & 0xffff)) = byte;
+ *(SetAddress + (address & 0xffff)) = byte;
return;
}
- switch ((int) Setaddress)
+ switch ((CMemory::Types)(intptr_t) SetAddress)
{
case CMemory::MAP_PPU:
S9xSetSA1 (byte, address & 0xffff);
return;
}
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
SA1.PCBase = Memory.FillRAM - 0x2000;
#undef FN
}
-INLINE void WRITE_4PIXELSx2 (uint32 Offset, uint8 *Pixels)
-{
- register uint8 Pixel;
- uint8 *Screen = GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
-
-#define FN(N) \
- if (GFX.Z1 > Depth [0] && (Pixel = Pixels[N])) \
- { \
- Screen [N * 2] = Screen [N * 2 + 1] = (uint8) GFX.ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; \
- }
-
- FN(0)
- FN(1)
- FN(2)
- FN(3)
-#undef FN
-}
-
-INLINE void WRITE_4PIXELS_FLIPPEDx2 (uint32 Offset, uint8 *Pixels)
-{
- register uint8 Pixel;
- uint8 *Screen = GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
-
-#define FN(N) \
- if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
- { \
- Screen [N * 2] = Screen [N * 2 + 1] = (uint8) GFX.ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; \
- }
-
- FN(0)
- FN(1)
- FN(2)
- FN(3)
-#undef FN
-}
-
-INLINE void WRITE_4PIXELSx2x2 (uint32 Offset, uint8 *Pixels)
-{
- register uint8 Pixel;
- uint8 *Screen = GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
-
-#define FN(N) \
- if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
- { \
- Screen [N * 2] = Screen [N * 2 + 1] = Screen [GFX.Pitch + N * 2] = \
- Screen [GFX.Pitch + N * 2 + 1] = (uint8) GFX.ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = Depth [GFX.Pitch + N * 2] = \
- Depth [GFX.Pitch + N * 2 + 1] = GFX.Z2; \
- }
-
- FN(0)
- FN(1)
- FN(2)
- FN(3)
-#undef FN
-}
-
-INLINE void WRITE_4PIXELS_FLIPPEDx2x2 (uint32 Offset, uint8 *Pixels)
-{
- register uint8 Pixel;
- uint8 *Screen = GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
-
-#define FN(N) \
- if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
- { \
- Screen [N * 2] = Screen [N * 2 + 1] = Screen [GFX.Pitch + N * 2] = \
- Screen [GFX.Pitch + N * 2 + 1] = (uint8) GFX.ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = Depth [GFX.Pitch + N * 2] = \
- Depth [GFX.Pitch + N * 2 + 1] = GFX.Z2; \
- }
-
- FN(0)
- FN(1)
- FN(2)
- FN(3)
-#undef FN
-}
-
void DrawTile(uint32 Tile, uint32 Offset, uint32 StartLine, uint32 LineCount)
{
TILE_PREAMBLE
RENDER_CLIPPED_TILE(WRITE_4PIXELS, WRITE_4PIXELS_FLIPPED, 4)
}
-void DrawTilex2 (uint32 Tile, uint32 Offset, uint32 StartLine, uint32 LineCount)
-{
- TILE_PREAMBLE
-
- register uint8 *bp;
-
- RENDER_TILE(WRITE_4PIXELSx2, WRITE_4PIXELS_FLIPPEDx2, 8)
-}
-
-void DrawClippedTilex2 (uint32 Tile, uint32 Offset,
- uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount)
-{
- TILE_PREAMBLE
- register uint8 *bp;
-
- TILE_CLIP_PREAMBLE
- RENDER_CLIPPED_TILE(WRITE_4PIXELSx2, WRITE_4PIXELS_FLIPPEDx2, 8)
-}
-
-void DrawTilex2x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount)
-{
- TILE_PREAMBLE
-
- register uint8 *bp;
-
- RENDER_TILE(WRITE_4PIXELSx2x2, WRITE_4PIXELS_FLIPPEDx2x2, 8)
-}
-
-void DrawClippedTilex2x2 (uint32 Tile, uint32 Offset,
- uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount)
-{
- TILE_PREAMBLE
- register uint8 *bp;
-
- TILE_CLIP_PREAMBLE
- RENDER_CLIPPED_TILE(WRITE_4PIXELSx2x2, WRITE_4PIXELS_FLIPPEDx2x2, 8)
-}
-
void DrawLargePixel (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
uint32 StartLine, uint32 LineCount)
RENDER_TILE_LARGE (((uint8) GFX.ScreenColors [pixel]), PLOT_PIXEL)
}
-INLINE void WRITE_4PIXELS16 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_FLIPPED (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16x2 (uint32 Offset, uint8 *Pixels)
-{
- register uint32 Pixel;
- uint16 *Screen = (uint16 *) GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
-
-#define FN(N) \
- if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
- { \
- Screen [N * 2] = Screen [N * 2 + 1] = GFX.ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; \
- }
-
- FN(0)
- FN(1)
- FN(2)
- FN(3)
-#undef FN
-}
-
-INLINE void WRITE_4PIXELS16_FLIPPEDx2 (uint32 Offset, uint8 *Pixels)
-{
- register uint32 Pixel;
- uint16 *Screen = (uint16 *) GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
-
-#define FN(N) \
- if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
- { \
- Screen [N * 2] = Screen [N * 2 + 1] = GFX.ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; \
- }
-
- FN(0)
- FN(1)
- FN(2)
- FN(3)
-#undef FN
-}
-
-INLINE void WRITE_4PIXELS16x2x2 (uint32 Offset, uint8 *Pixels)
-{
- register uint32 Pixel;
- uint16 *Screen = (uint16 *) GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
-
-#define FN(N) \
- if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[N])) \
- { \
- Screen [N * 2] = Screen [N * 2 + 1] = Screen [(GFX.Pitch >> 1) + N * 2] = \
- Screen [(GFX.Pitch >> 1) + N * 2 + 1] = GFX.ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = Depth [(GFX.Pitch >> 1) + N * 2] = \
- Depth [(GFX.Pitch >> 1) + N * 2 + 1] = GFX.Z2; \
- }
-
- FN(0)
- FN(1)
- FN(2)
- FN(3)
-#undef FN
-}
-
-INLINE void WRITE_4PIXELS16_FLIPPEDx2x2 (uint32 Offset, uint8 *Pixels)
-{
- register uint32 Pixel;
- uint16 *Screen = (uint16 *) GFX.S + Offset;
- uint8 *Depth = GFX.DB + Offset;
-
-#define FN(N) \
- if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) \
- { \
- Screen [N * 2] = Screen [N * 2 + 1] = Screen [(GFX.Pitch >> 1) + N * 2] = \
- Screen [(GFX.Pitch >> 1) + N * 2 + 1] = GFX.ScreenColors [Pixel]; \
- Depth [N * 2] = Depth [N * 2 + 1] = Depth [(GFX.Pitch >> 1) + N * 2] = \
- Depth [(GFX.Pitch >> 1) + N * 2 + 1] = GFX.Z2; \
- }
-
- FN(0)
- FN(1)
- FN(2)
- FN(3)
-#undef FN
-}
-
void DrawTile16 (uint32 Tile, uint32 Offset, uint32 StartLine,
uint32 LineCount)
{
RENDER_CLIPPED_TILE(WRITE_4PIXELS16, WRITE_4PIXELS16_FLIPPED, 4)
}
-void DrawTile16x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount)
-{
- TILE_PREAMBLE
- register uint8 *bp;
-
- RENDER_TILE(WRITE_4PIXELS16x2, WRITE_4PIXELS16_FLIPPEDx2, 8)
-}
-
-void DrawClippedTile16x2 (uint32 Tile, uint32 Offset,
- uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount)
-{
- TILE_PREAMBLE
- register uint8 *bp;
-
- TILE_CLIP_PREAMBLE
- RENDER_CLIPPED_TILE(WRITE_4PIXELS16x2, WRITE_4PIXELS16_FLIPPEDx2, 8)
-}
-
-void DrawTile16x2x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount)
-{
- TILE_PREAMBLE
- register uint8 *bp;
-
- RENDER_TILE(WRITE_4PIXELS16x2x2, WRITE_4PIXELS16_FLIPPEDx2x2, 8)
-}
-
-void DrawClippedTile16x2x2 (uint32 Tile, uint32 Offset,
- uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount)
-{
- TILE_PREAMBLE
- register uint8 *bp;
-
- TILE_CLIP_PREAMBLE
- RENDER_CLIPPED_TILE(WRITE_4PIXELS16x2x2, WRITE_4PIXELS16_FLIPPEDx2x2, 8)
-}
-
void DrawLargePixel16 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
uint32 StartLine, uint32 LineCount)
RENDER_TILE_LARGE (GFX.ScreenColors [pixel], PLOT_PIXEL)
}
-INLINE void WRITE_4PIXELS16_ADD (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_ADD (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_ADD (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_FLIPPED_ADD (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_ADD1_2 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_ADD1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_ADD1_2 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_FLIPPED_ADD1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_SUB (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_SUB (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_SUB (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_FLIPPED_SUB (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_SUB1_2 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_SUB1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_SUB1_2 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_FLIPPED_SUB1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
RENDER_CLIPPED_TILE(WRITE_4PIXELS16_SUB1_2, WRITE_4PIXELS16_FLIPPED_SUB1_2, 4)
}
-INLINE void WRITE_4PIXELS16_ADDF1_2 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_ADDF1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_ADDF1_2 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_FLIPPED_ADDF1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_SUBF1_2 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_SUBF1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
#undef FN
}
-INLINE void WRITE_4PIXELS16_FLIPPED_SUBF1_2 (uint32 Offset, uint8 *Pixels)
+STATIC INLINE void WRITE_4PIXELS16_FLIPPED_SUBF1_2 (uint32 Offset, uint8 *Pixels)
{
register uint32 Pixel;
uint16 *Screen = (uint16 *) GFX.S + Offset;
void DrawClippedTile (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
uint32 StartLine, uint32 LineCount);
-void DrawTilex2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount);
-void DrawClippedTilex2 (uint32 Tile, uint32 Offset,
- uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount);
-void DrawTilex2x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount);
-void DrawClippedTilex2x2 (uint32 Tile, uint32 Offset,
- uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount);
void DrawLargePixel (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
uint32 StartLine, uint32 LineCount);
void DrawClippedTile16 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Width,
uint32 StartLine, uint32 LineCount);
-void DrawTile16x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount);
-void DrawClippedTile16x2 (uint32 Tile, uint32 Offset,
- uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount);
-void DrawTile16x2x2 (uint32 Tile, uint32 Offset, uint32 StartLine,
- uint32 LineCount);
-void DrawClippedTile16x2x2 (uint32 Tile, uint32 Offset,
- uint32 StartPixel, uint32 Width,
- uint32 StartLine, uint32 LineCount);
void DrawLargePixel16 (uint32 Tile, uint32 Offset,
uint32 StartPixel, uint32 Pixels,
uint32 StartLine, uint32 LineCount);