aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwinaphex2017-12-25 06:42:01 +0100
committertwinaphex2017-12-25 06:42:01 +0100
commite3dbf33f0a4c7e4256772b7c5da7e909e5424819 (patch)
tree1db4b6766fa33065ea5308b789a5893583e8e0ac
parente6cb60ee424a8efb237150f937b026eaffb3c2eb (diff)
downloadsnes9x2005-e3dbf33f0a4c7e4256772b7c5da7e909e5424819.tar.gz
snes9x2005-e3dbf33f0a4c7e4256772b7c5da7e909e5424819.tar.bz2
snes9x2005-e3dbf33f0a4c7e4256772b7c5da7e909e5424819.zip
Turn getset into C file
-rw-r--r--Makefile.common1
-rw-r--r--libretro-common/include/boolean.h39
-rw-r--r--source/getset.c (renamed from source/getset.h)20
-rw-r--r--source/memmap.c2
-rw-r--r--source/ppu.h2
5 files changed, 49 insertions, 15 deletions
diff --git a/Makefile.common b/Makefile.common
index 0a44db3..48256bb 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -17,6 +17,7 @@ SOURCES_C := \
$(CORE_DIR)/fxemu.c \
$(CORE_DIR)/fxinst.c \
$(CORE_DIR)/gfx.c \
+ $(CORE_DIR)/getset.c \
$(CORE_DIR)/globals.c \
$(CORE_DIR)/memmap.c \
$(CORE_DIR)/obc1.c \
diff --git a/libretro-common/include/boolean.h b/libretro-common/include/boolean.h
new file mode 100644
index 0000000..2c18ef7
--- /dev/null
+++ b/libretro-common/include/boolean.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2010-2017 The RetroArch team
+ *
+ * ---------------------------------------------------------------------------------------
+ * The following license statement only applies to this file (boolean.h).
+ * ---------------------------------------------------------------------------------------
+ *
+ * Permission is hereby granted, free of charge,
+ * to any person obtaining a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __LIBRETRO_SDK_BOOLEAN_H
+#define __LIBRETRO_SDK_BOOLEAN_H
+
+#ifndef __cplusplus
+
+#if defined(_MSC_VER) && !defined(SN_TARGET_PS3)
+/* Hack applied for MSVC when compiling in C89 mode as it isn't C99 compliant. */
+#define bool unsigned char
+#define true 1
+#define false 0
+#else
+#include <stdbool.h>
+#endif
+
+#endif
+
+#endif
diff --git a/source/getset.h b/source/getset.c
index 6c4142a..eefc5b5 100644
--- a/source/getset.h
+++ b/source/getset.c
@@ -1,8 +1,5 @@
#include "../copyright"
-#ifndef _GETSET_H_
-#define _GETSET_H_
-
#include "ppu.h"
#include "dsp1.h"
#include "cpuexec.h"
@@ -11,11 +8,9 @@
#include "obc1.h"
#include "seta.h"
-#include <retro_inline.h>
-
extern uint8_t OpenBus;
-static INLINE uint8_t S9xGetByte(uint32_t Address)
+uint8_t S9xGetByte(uint32_t Address)
{
int32_t block;
uint8_t* GetAddress = Memory.Map [block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
@@ -67,7 +62,7 @@ static INLINE uint8_t S9xGetByte(uint32_t Address)
}
}
-static INLINE uint16_t S9xGetWord(uint32_t Address)
+uint16_t S9xGetWord(uint32_t Address)
{
int32_t block;
uint8_t* GetAddress;
@@ -138,7 +133,7 @@ static INLINE uint16_t S9xGetWord(uint32_t Address)
}
}
-static INLINE void S9xSetByte(uint8_t Byte, uint32_t Address)
+void S9xSetByte(uint8_t Byte, uint32_t Address)
{
int32_t block;
uint8_t* SetAddress = Memory.WriteMap [block = ((Address >> MEMMAP_SHIFT) & MEMMAP_MASK)];
@@ -209,7 +204,7 @@ static INLINE void S9xSetByte(uint8_t Byte, uint32_t Address)
}
}
-static INLINE void S9xSetWord(uint16_t Word, uint32_t Address)
+void S9xSetWord(uint16_t Word, uint32_t Address)
{
int32_t block;
uint8_t* SetAddress;
@@ -313,7 +308,7 @@ static INLINE void S9xSetWord(uint16_t Word, uint32_t Address)
}
}
-static INLINE uint8_t* GetBasePointer(uint32_t Address)
+uint8_t* GetBasePointer(uint32_t Address)
{
uint8_t* GetAddress = Memory.Map [(Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
if (GetAddress >= (uint8_t*) MAP_LAST)
@@ -347,7 +342,7 @@ static INLINE uint8_t* GetBasePointer(uint32_t Address)
}
}
-static INLINE uint8_t* S9xGetMemPointer(uint32_t Address)
+uint8_t* S9xGetMemPointer(uint32_t Address)
{
uint8_t* GetAddress = Memory.Map [(Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
if (GetAddress >= (uint8_t*) MAP_LAST)
@@ -384,7 +379,7 @@ static INLINE uint8_t* S9xGetMemPointer(uint32_t Address)
}
}
-static INLINE void S9xSetPCBase(uint32_t Address)
+void S9xSetPCBase(uint32_t Address)
{
int32_t block;
uint8_t* GetAddress = Memory.Map [block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK];
@@ -421,4 +416,3 @@ static INLINE void S9xSetPCBase(uint32_t Address)
CPU.PC = CPU.PCBase + (Address & 0xffff);
}
-#endif
diff --git a/source/memmap.c b/source/memmap.c
index cfdc997..209b6cd 100644
--- a/source/memmap.c
+++ b/source/memmap.c
@@ -3044,5 +3044,3 @@ void ParseSNESHeader(uint8_t* RomHeader)
else
sprintf(Memory.CompanyId, "%02X", RomHeader[0x2A]);
}
-
-#include "getset.h"
diff --git a/source/ppu.h b/source/ppu.h
index e04c4ad..447f7f1 100644
--- a/source/ppu.h
+++ b/source/ppu.h
@@ -2,6 +2,8 @@
#define _PPU_H_
#include "../copyright"
+#include <stdint.h>
+#include <boolean.h>
#include <retro_inline.h>
#define FIRST_VISIBLE_LINE 1