summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2013-09-20 23:04:59 +0000
committerjoerg <joerg@pkgsrc.org>2013-09-20 23:04:59 +0000
commit5e87780fb1a70c363c13b8f736e917f25046ed3a (patch)
tree0a97149fa7d6a841cb6c4e1c310ff3029fa8ae8e
parentfd9f5f14d4132eda9dc55acd700ce759cd4b529b (diff)
downloadpkgsrc-5e87780fb1a70c363c13b8f736e917f25046ed3a.tar.gz
<cstdlib> is needed for rand(). Kill various inconsistent restricts.
-rw-r--r--emulators/openmsx/distinfo23
-rw-r--r--emulators/openmsx/patches/patch-src_sound_BlipBuffer.hh13
-rw-r--r--emulators/openmsx/patches/patch-src_sound_ResampleHQ.cc22
-rw-r--r--emulators/openmsx/patches/patch-src_sound_ResampleLQ.cc22
-rw-r--r--emulators/openmsx/patches/patch-src_utils_Math.cc13
-rw-r--r--emulators/openmsx/patches/patch-src_utils_SerializeBuffer.cc41
-rw-r--r--emulators/openmsx/patches/patch-src_utils_SerializeBuffer.hh41
-rw-r--r--emulators/openmsx/patches/patch-src_video_BitmapConverter.cc78
-rw-r--r--emulators/openmsx/patches/patch-src_video_CharacterConverter.cc87
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_HQ2xLiteScaler.cc38
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_HQ2xScaler.cc38
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_HQ3xLiteScaler.cc23
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_HQ3xScaler.cc23
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_LineScalers.hh217
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_RGBTriplet3xScaler.cc24
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_SaI2xScaler.cc34
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_SaI3xScaler.cc44
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_Scale2xScaler.cc30
-rw-r--r--emulators/openmsx/patches/patch-src_video_scalers_Scale3xScaler.cc30
-rw-r--r--emulators/openmsx/patches/patch-src_video_v9990_V9990BitmapConverter.cc123
-rw-r--r--emulators/openmsx/patches/patch-src_video_v9990_V9990P1Converter.cc35
-rw-r--r--emulators/openmsx/patches/patch-src_video_v9990_V9990P2Converter.cc35
22 files changed, 1033 insertions, 1 deletions
diff --git a/emulators/openmsx/distinfo b/emulators/openmsx/distinfo
index d4f391b4170..e41f6c67cb7 100644
--- a/emulators/openmsx/distinfo
+++ b/emulators/openmsx/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.11 2012/08/27 13:27:33 marino Exp $
+$NetBSD: distinfo,v 1.12 2013/09/20 23:04:59 joerg Exp $
SHA1 (openmsx-0.9.0.tar.gz) = a8e396d5feb60bd7df8fbef0b5e6d41e5b0e5826
RMD160 (openmsx-0.9.0.tar.gz) = 9b7f01ba3dcedf5ebba920983938a25db561c26d
@@ -7,4 +7,25 @@ SHA1 (patch-build_detectsys.py) = 9d88783a8c00a074e5dc149fce2dbeb20d12cb9e
SHA1 (patch-build_libraries.py) = 2981999e58e12986fd8b45df656cc898094ffe9b
SHA1 (patch-build_probe.py) = c083d5950dae95f12d4c0b5c7d1a2cac89ad786e
SHA1 (patch-build_version.py) = 2b3e53a0499befb8c18760e80fdbc279cc6aefc8
+SHA1 (patch-src_sound_BlipBuffer.hh) = a8a53144fe667f27a4f10318f05d314a9b867158
+SHA1 (patch-src_sound_ResampleHQ.cc) = a2a2584b981f16763f999440deb46fc2072ce49c
+SHA1 (patch-src_sound_ResampleLQ.cc) = d43ab34c5191e6b27bd979512920496a533b6824
+SHA1 (patch-src_utils_Math.cc) = e7443533c0ef2784cd236bb56bd4c60eca903511
+SHA1 (patch-src_utils_SerializeBuffer.cc) = 8872511a38ffb5fcaa84c77d96213e8f288b9109
+SHA1 (patch-src_utils_SerializeBuffer.hh) = 6624c3506503072a26ef4fb73123c0c4462624cc
SHA1 (patch-src_video_AviWriter.cc) = 5ea878e954ac4a6532c3618ed949c9de986ded33
+SHA1 (patch-src_video_BitmapConverter.cc) = c7cfea36acf44a4f4bf115d9d381159f03289ed5
+SHA1 (patch-src_video_CharacterConverter.cc) = 16c8c5177ae9bfc9375d325ad65f28165e511268
+SHA1 (patch-src_video_scalers_HQ2xLiteScaler.cc) = dccc3681e06d7187b15f67c451f1aa6ce21e1623
+SHA1 (patch-src_video_scalers_HQ2xScaler.cc) = baa459238ecb36fc6d8ae1967be25492e78a7bcc
+SHA1 (patch-src_video_scalers_HQ3xLiteScaler.cc) = eab9778d1753825be171b876ab140e5182422fdf
+SHA1 (patch-src_video_scalers_HQ3xScaler.cc) = 13a86e9bfceaf6f1d53519f363b16e27e8c86b2b
+SHA1 (patch-src_video_scalers_LineScalers.hh) = 98347f8055fc09c360b6f26b8b8b5406ffce9b1e
+SHA1 (patch-src_video_scalers_RGBTriplet3xScaler.cc) = 8fbd5c769434bc2b8f3e09a9435fe3cd73ea7857
+SHA1 (patch-src_video_scalers_SaI2xScaler.cc) = 4e40b70bb2344aa9e787305289063955e4458ebe
+SHA1 (patch-src_video_scalers_SaI3xScaler.cc) = 48b8f11d2b7b773e16c1bfd5f59206185bfc014c
+SHA1 (patch-src_video_scalers_Scale2xScaler.cc) = 5e859e89b096952417750089622f41be0e8a1b23
+SHA1 (patch-src_video_scalers_Scale3xScaler.cc) = 442efd426cd07ab15e6f6971ac623fa35ad3e53c
+SHA1 (patch-src_video_v9990_V9990BitmapConverter.cc) = 30f10ed56590166149cbe070f003932714c16163
+SHA1 (patch-src_video_v9990_V9990P1Converter.cc) = 7071864fe88c704d08954da1e38121ff2450f2f9
+SHA1 (patch-src_video_v9990_V9990P2Converter.cc) = 75cc389fefed81c3908a6363cbb94e96906d06db
diff --git a/emulators/openmsx/patches/patch-src_sound_BlipBuffer.hh b/emulators/openmsx/patches/patch-src_sound_BlipBuffer.hh
new file mode 100644
index 00000000000..943b866cf42
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_sound_BlipBuffer.hh
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_sound_BlipBuffer.hh,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/sound/BlipBuffer.hh.orig 2013-09-20 13:28:00.000000000 +0000
++++ src/sound/BlipBuffer.hh
+@@ -32,7 +32,7 @@ public:
+
+ private:
+ template <unsigned PITCH>
+- void readSamplesHelper(int* out, unsigned samples);
++ void readSamplesHelper(int* out, unsigned samples) __restrict;
+
+ static const unsigned BUFFER_SIZE = 1 << 14;
+ static const unsigned BUFFER_MASK = BUFFER_SIZE - 1;
diff --git a/emulators/openmsx/patches/patch-src_sound_ResampleHQ.cc b/emulators/openmsx/patches/patch-src_sound_ResampleHQ.cc
new file mode 100644
index 00000000000..24840e3cfb5
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_sound_ResampleHQ.cc
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_sound_ResampleHQ.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/sound/ResampleHQ.cc.orig 2013-09-20 13:34:58.000000000 +0000
++++ src/sound/ResampleHQ.cc
+@@ -205,7 +205,7 @@ ResampleHQ<CHANNELS>::~ResampleHQ()
+
+ template <unsigned CHANNELS>
+ void ResampleHQ<CHANNELS>::calcOutput(
+- float pos, int* __restrict output) __restrict
++ float pos, int* output)
+ {
+ assert((filterLen & 3) == 0);
+ int t = int(pos * TAB_LEN + 0.5f) % TAB_LEN;
+@@ -447,7 +447,7 @@ void ResampleHQ<CHANNELS>::prepareData(u
+
+ template <unsigned CHANNELS>
+ bool ResampleHQ<CHANNELS>::generateOutput(
+- int* __restrict dataOut, unsigned hostNum, EmuTime::param time) __restrict
++ int* dataOut, unsigned hostNum, EmuTime::param time)
+ {
+ unsigned emuNum = emuClock.getTicksTill(time);
+ if (emuNum > 0) {
diff --git a/emulators/openmsx/patches/patch-src_sound_ResampleLQ.cc b/emulators/openmsx/patches/patch-src_sound_ResampleLQ.cc
new file mode 100644
index 00000000000..a69584aa89c
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_sound_ResampleLQ.cc
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_sound_ResampleLQ.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/sound/ResampleLQ.cc.orig 2013-09-20 13:37:42.000000000 +0000
++++ src/sound/ResampleLQ.cc
+@@ -89,7 +89,7 @@ ResampleLQUp<CHANNELS>::ResampleLQUp(
+
+ template <unsigned CHANNELS>
+ bool ResampleLQUp<CHANNELS>::generateOutput(
+- int* __restrict dataOut, unsigned hostNum, EmuTime::param time) __restrict
++ int* dataOut, unsigned hostNum, EmuTime::param time)
+ {
+ EmuTime host1 = this->hostClock.getFastAdd(1);
+ assert(host1 > this->emuClock.getTime());
+@@ -129,7 +129,7 @@ ResampleLQDown<CHANNELS>::ResampleLQDown
+
+ template <unsigned CHANNELS>
+ bool ResampleLQDown<CHANNELS>::generateOutput(
+- int* __restrict dataOut, unsigned hostNum, EmuTime::param time) __restrict
++ int* dataOut, unsigned hostNum, EmuTime::param time)
+ {
+ EmuTime host1 = this->hostClock.getFastAdd(1);
+ assert(host1 > this->emuClock.getTime());
diff --git a/emulators/openmsx/patches/patch-src_utils_Math.cc b/emulators/openmsx/patches/patch-src_utils_Math.cc
new file mode 100644
index 00000000000..f1fffacccfd
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_utils_Math.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_utils_Math.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/utils/Math.cc.orig 2013-09-20 13:39:09.000000000 +0000
++++ src/utils/Math.cc
+@@ -6,6 +6,8 @@
+ #include <emmintrin.h>
+ #endif
+
++#include <cstdlib>
++
+ namespace openmsx {
+
+ #ifdef _MSC_VER
diff --git a/emulators/openmsx/patches/patch-src_utils_SerializeBuffer.cc b/emulators/openmsx/patches/patch-src_utils_SerializeBuffer.cc
new file mode 100644
index 00000000000..f6b0b840555
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_utils_SerializeBuffer.cc
@@ -0,0 +1,41 @@
+$NetBSD: patch-src_utils_SerializeBuffer.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/utils/SerializeBuffer.cc.orig 2013-09-20 13:40:59.000000000 +0000
++++ src/utils/SerializeBuffer.cc
+@@ -21,7 +21,7 @@ OutputBuffer::~OutputBuffer()
+ }
+
+ #ifdef __GNUC__
+-template<unsigned LEN> void OutputBuffer::insertN(const void* __restrict data) __restrict
++template<unsigned LEN> void OutputBuffer::insertN(const void* data)
+ {
+ byte* newEnd = end + LEN;
+ if (likely(newEnd <= finish)) {
+@@ -32,13 +32,13 @@ template<unsigned LEN> void OutputBuffer
+ }
+ }
+ // Force template instantiation
+-template void OutputBuffer::insertN<1>(const void* __restrict data) __restrict;
+-template void OutputBuffer::insertN<2>(const void* __restrict data) __restrict;
+-template void OutputBuffer::insertN<4>(const void* __restrict data) __restrict;
+-template void OutputBuffer::insertN<8>(const void* __restrict data) __restrict;
++template void OutputBuffer::insertN<1>(const void* data);
++template void OutputBuffer::insertN<2>(const void* data);
++template void OutputBuffer::insertN<4>(const void* data);
++template void OutputBuffer::insertN<8>(const void* data);
+ #endif
+
+-void OutputBuffer::insertN(const void* __restrict data, unsigned len) __restrict
++void OutputBuffer::insertN(const void* data, unsigned len)
+ {
+ byte* newEnd = end + len;
+ if (likely(newEnd <= finish)) {
+@@ -76,7 +76,7 @@ byte* OutputBuffer::release(unsigned& si
+ return result;
+ }
+
+-void OutputBuffer::insertGrow(const void* __restrict data, unsigned len) __restrict
++void OutputBuffer::insertGrow(const void* data, unsigned len)
+ {
+ byte* pos = allocateGrow(len);
+ memcpy(pos, data, len);
diff --git a/emulators/openmsx/patches/patch-src_utils_SerializeBuffer.hh b/emulators/openmsx/patches/patch-src_utils_SerializeBuffer.hh
new file mode 100644
index 00000000000..a2805233bce
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_utils_SerializeBuffer.hh
@@ -0,0 +1,41 @@
+$NetBSD: patch-src_utils_SerializeBuffer.hh,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/utils/SerializeBuffer.hh.orig 2013-09-20 13:17:27.000000000 +0000
++++ src/utils/SerializeBuffer.hh
+@@ -37,7 +37,7 @@ public:
+ /** Insert data at the end of this buffer.
+ * This will automatically grow this buffer.
+ */
+- void insert(const void* __restrict data, unsigned len) __restrict
++ void insert(const void* data, unsigned len)
+ {
+ #ifdef __GNUC__
+ if (__builtin_constant_p(len)) {
+@@ -55,15 +55,15 @@ public:
+ insertN(data, len);
+ }
+ #ifdef __GNUC__
+- template<unsigned N> void insertN(const void* __restrict data);
++ template<unsigned N> void insertN(const void* data);
+ #endif
+- void insertN(const void* __restrict data, unsigned len);
++ void insertN(const void* data, unsigned len);
+
+ /** Insert data at a given position. This will overwrite the old data.
+ * It's not possible to grow the buffer via this method (so the buffer
+ * must already be big enough to hold the new data).
+ */
+- void insertAt(unsigned pos, const void* __restrict data, unsigned len) __restrict
++ void insertAt(unsigned pos, const void* data, unsigned len)
+ {
+ assert(begin + pos + len <= finish);
+ memcpy(begin + pos, data, len);
+@@ -105,7 +105,7 @@ public:
+ byte* release(unsigned& size);
+
+ private:
+- void insertGrow(const void* __restrict data, unsigned len);
++ void insertGrow(const void* data, unsigned len);
+ byte* allocateGrow(unsigned len);
+
+ byte* begin; // begin of allocated memory
diff --git a/emulators/openmsx/patches/patch-src_video_BitmapConverter.cc b/emulators/openmsx/patches/patch-src_video_BitmapConverter.cc
new file mode 100644
index 00000000000..3461a112825
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_BitmapConverter.cc
@@ -0,0 +1,78 @@
+$NetBSD: patch-src_video_BitmapConverter.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/BitmapConverter.cc.orig 2013-09-20 13:46:13.000000000 +0000
++++ src/video/BitmapConverter.cc
+@@ -102,8 +102,8 @@ void BitmapConverter<Pixel>::convertLine
+
+ template <class Pixel>
+ void BitmapConverter<Pixel>::renderGraphic4(
+- Pixel* __restrict pixelPtr,
+- const byte* __restrict vramPtr0) __restrict
++ Pixel* pixelPtr,
++ const byte* vramPtr0)
+ {
+ /*for (unsigned i = 0; i < 128; i += 2) {
+ unsigned data0 = vramPtr0[i + 0];
+@@ -180,8 +180,8 @@ void BitmapConverter<Pixel>::renderGraph
+
+ template <class Pixel>
+ void BitmapConverter<Pixel>::renderGraphic5(
+- Pixel* __restrict pixelPtr,
+- const byte* __restrict vramPtr0) __restrict
++ Pixel* pixelPtr,
++ const byte* vramPtr0)
+ {
+ for (unsigned i = 0; i < 128; ++i) {
+ unsigned data = vramPtr0[i];
+@@ -194,9 +194,9 @@ void BitmapConverter<Pixel>::renderGraph
+
+ template <class Pixel>
+ void BitmapConverter<Pixel>::renderGraphic6(
+- Pixel* __restrict pixelPtr,
+- const byte* __restrict vramPtr0,
+- const byte* __restrict vramPtr1) __restrict
++ Pixel* pixelPtr,
++ const byte* vramPtr0,
++ const byte* vramPtr1)
+ {
+ /*for (unsigned i = 0; i < 128; ++i) {
+ unsigned data0 = vramPtr0[i];
+@@ -240,9 +240,9 @@ void BitmapConverter<Pixel>::renderGraph
+
+ template <class Pixel>
+ void BitmapConverter<Pixel>::renderGraphic7(
+- Pixel* __restrict pixelPtr,
+- const byte* __restrict vramPtr0,
+- const byte* __restrict vramPtr1) __restrict
++ Pixel* pixelPtr,
++ const byte* vramPtr0,
++ const byte* vramPtr1)
+ {
+ for (unsigned i = 0; i < 128; ++i) {
+ pixelPtr[2 * i + 0] = palette256[vramPtr0[i]];
+@@ -252,9 +252,9 @@ void BitmapConverter<Pixel>::renderGraph
+
+ template <class Pixel>
+ void BitmapConverter<Pixel>::renderYJK(
+- Pixel* __restrict pixelPtr,
+- const byte* __restrict vramPtr0,
+- const byte* __restrict vramPtr1) __restrict
++ Pixel* pixelPtr,
++ const byte* vramPtr0,
++ const byte* vramPtr1)
+ {
+ for (unsigned i = 0; i < 64; ++i) {
+ unsigned p[4];
+@@ -279,9 +279,9 @@ void BitmapConverter<Pixel>::renderYJK(
+
+ template <class Pixel>
+ void BitmapConverter<Pixel>::renderYAE(
+- Pixel* __restrict pixelPtr,
+- const byte* __restrict vramPtr0,
+- const byte* __restrict vramPtr1) __restrict
++ Pixel* pixelPtr,
++ const byte* vramPtr0,
++ const byte* vramPtr1)
+ {
+ for (unsigned i = 0; i < 64; ++i) {
+ unsigned p[4];
diff --git a/emulators/openmsx/patches/patch-src_video_CharacterConverter.cc b/emulators/openmsx/patches/patch-src_video_CharacterConverter.cc
new file mode 100644
index 00000000000..b203197fdb8
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_CharacterConverter.cc
@@ -0,0 +1,87 @@
+$NetBSD: patch-src_video_CharacterConverter.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/CharacterConverter.cc.orig 2013-09-20 13:45:16.000000000 +0000
++++ src/video/CharacterConverter.cc
+@@ -59,7 +59,7 @@ void CharacterConverter<Pixel>::convertL
+
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderText1(
+- Pixel* __restrict pixelPtr, int line) __restrict
++ Pixel* pixelPtr, int line)
+ {
+ Pixel fg = palFg[vdp.getForegroundColor()];
+ Pixel bg = palFg[vdp.getBackgroundColor()];
+@@ -88,7 +88,7 @@ void CharacterConverter<Pixel>::renderTe
+
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderText1Q(
+- Pixel* __restrict pixelPtr, int line) __restrict
++ Pixel* pixelPtr, int line)
+ {
+ Pixel fg = palFg[vdp.getForegroundColor()];
+ Pixel bg = palFg[vdp.getBackgroundColor()];
+@@ -118,7 +118,7 @@ void CharacterConverter<Pixel>::renderTe
+
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderText2(
+- Pixel* __restrict pixelPtr, int line) __restrict
++ Pixel* pixelPtr, int line)
+ {
+ Pixel plainFg = palFg[vdp.getForegroundColor()];
+ Pixel plainBg = palFg[vdp.getBackgroundColor()];
+@@ -238,7 +238,7 @@ const byte* CharacterConverter<Pixel>::g
+ }
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderGraphic1(
+- Pixel* __restrict pixelPtr, int line) __restrict
++ Pixel* pixelPtr, int line)
+ {
+ const byte* patternArea = vram.patternTable.getReadArea(0, 256 * 8);
+ patternArea += line & 7;
+@@ -268,7 +268,7 @@ void CharacterConverter<Pixel>::renderGr
+
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderGraphic2(
+- Pixel* __restrict pixelPtr, int line) __restrict
++ Pixel* pixelPtr, int line)
+ {
+ int quarter = ((line / 8) * 32) & ~0xFF;
+ int baseLine = (-1 << 13) | (quarter * 8) | (line & 7);
+@@ -351,8 +351,8 @@ void CharacterConverter<Pixel>::renderGr
+
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderMultiHelper(
+- Pixel* __restrict pixelPtr, int line,
+- int mask, int patternQuarter) __restrict
++ Pixel* pixelPtr, int line,
++ int mask, int patternQuarter)
+ {
+ unsigned baseLine = mask | ((line / 4) & 7);
+ unsigned scroll = vdp.getHorizontalScrollHigh();
+@@ -372,7 +372,7 @@ void CharacterConverter<Pixel>::renderMu
+ }
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderMulti(
+- Pixel* __restrict pixelPtr, int line) __restrict
++ Pixel* pixelPtr, int line)
+ {
+ int mask = (-1 << 11);
+ renderMultiHelper(pixelPtr, line, mask, 0);
+@@ -380,7 +380,7 @@ void CharacterConverter<Pixel>::renderMu
+
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderMultiQ(
+- Pixel* __restrict pixelPtr, int line) __restrict
++ Pixel* pixelPtr, int line)
+ {
+ int mask = (-1 << 13);
+ int patternQuarter = (line * 4) & ~0xFF; // (line / 8) * 32
+@@ -389,7 +389,7 @@ void CharacterConverter<Pixel>::renderMu
+
+ template <class Pixel>
+ void CharacterConverter<Pixel>::renderBogus(
+- Pixel* __restrict pixelPtr) __restrict
++ Pixel* pixelPtr)
+ {
+ Pixel fg = palFg[vdp.getForegroundColor()];
+ Pixel bg = palFg[vdp.getBackgroundColor()];
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_HQ2xLiteScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_HQ2xLiteScaler.cc
new file mode 100644
index 00000000000..9fbd0456daa
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_HQ2xLiteScaler.cc
@@ -0,0 +1,38 @@
+$NetBSD: patch-src_video_scalers_HQ2xLiteScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/HQ2xLiteScaler.cc.orig 2013-09-20 13:50:21.000000000 +0000
++++ src/video/scalers/HQ2xLiteScaler.cc
+@@ -37,11 +37,11 @@ template <typename Pixel> struct HQLite_
+
+ template <typename Pixel>
+ void HQLite_1x1on2x2<Pixel>::operator()(
+- const Pixel* __restrict in0, const Pixel* __restrict in1,
+- const Pixel* __restrict in2,
+- Pixel* __restrict out0, Pixel* __restrict out1,
+- unsigned srcWidth, unsigned* __restrict edgeBuf,
+- EdgeHQLite /*edgeOp*/) __restrict
++ const Pixel* in0, const Pixel* in1,
++ const Pixel* in2,
++ Pixel* out0, Pixel* out1,
++ unsigned srcWidth, unsigned* edgeBuf,
++ EdgeHQLite /*edgeOp*/)
+ {
+ unsigned c2, c4, c5, c6, c8, c9;
+ c2 = readPixel(in0[0]);
+@@ -93,11 +93,11 @@ void HQLite_1x1on2x2<Pixel>::operator()(
+
+ template <typename Pixel>
+ void HQLite_1x1on1x2<Pixel>::operator()(
+- const Pixel* __restrict in0, const Pixel* __restrict in1,
+- const Pixel* __restrict in2,
+- Pixel* __restrict out0, Pixel* __restrict out1,
+- unsigned srcWidth, unsigned* __restrict edgeBuf,
+- EdgeHQLite /*edgeOp*/) __restrict
++ const Pixel* in0, const Pixel* in1,
++ const Pixel* in2,
++ Pixel* out0, Pixel* out1,
++ unsigned srcWidth, unsigned* edgeBuf,
++ EdgeHQLite /*edgeOp*/)
+ {
+ // +---+---+---+
+ // | 1 | 2 | 3 |
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_HQ2xScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_HQ2xScaler.cc
new file mode 100644
index 00000000000..5b5c4491c5e
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_HQ2xScaler.cc
@@ -0,0 +1,38 @@
+$NetBSD: patch-src_video_scalers_HQ2xScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/HQ2xScaler.cc.orig 2013-09-20 13:49:58.000000000 +0000
++++ src/video/scalers/HQ2xScaler.cc
+@@ -35,11 +35,11 @@ template <typename Pixel> struct HQ_1x1o
+
+ template <typename Pixel>
+ void HQ_1x1on2x2<Pixel>::operator()(
+- const Pixel* __restrict in0, const Pixel* __restrict in1,
+- const Pixel* __restrict in2,
+- Pixel* __restrict out0, Pixel* __restrict out1,
+- unsigned srcWidth, unsigned* __restrict edgeBuf,
+- EdgeHQ edgeOp) __restrict
++ const Pixel* in0, const Pixel* in1,
++ const Pixel* in2,
++ Pixel* out0, Pixel* out1,
++ unsigned srcWidth, unsigned* edgeBuf,
++ EdgeHQ edgeOp)
+ {
+ unsigned c1, c2, c3, c4, c5, c6, c7, c8, c9;
+ c2 = c3 = readPixel(in0[0]);
+@@ -93,11 +93,11 @@ void HQ_1x1on2x2<Pixel>::operator()(
+
+ template <typename Pixel>
+ void HQ_1x1on1x2<Pixel>::operator()(
+- const Pixel* __restrict in0, const Pixel* __restrict in1,
+- const Pixel* __restrict in2,
+- Pixel* __restrict out0, Pixel* __restrict out1,
+- unsigned srcWidth, unsigned* __restrict edgeBuf,
+- EdgeHQ edgeOp) __restrict
++ const Pixel* in0, const Pixel* in1,
++ const Pixel* in2,
++ Pixel* out0, Pixel* out1,
++ unsigned srcWidth, unsigned* edgeBuf,
++ EdgeHQ edgeOp)
+ {
+ // +---+---+---+
+ // | 1 | 2 | 3 |
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_HQ3xLiteScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_HQ3xLiteScaler.cc
new file mode 100644
index 00000000000..3eed9a2b283
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_HQ3xLiteScaler.cc
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_video_scalers_HQ3xLiteScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/HQ3xLiteScaler.cc.orig 2013-09-20 13:50:31.000000000 +0000
++++ src/video/scalers/HQ3xLiteScaler.cc
+@@ -28,12 +28,12 @@ template <typename Pixel> struct HQLite_
+
+ template <typename Pixel>
+ void HQLite_1x1on3x3<Pixel>::operator()(
+- const Pixel* __restrict in0, const Pixel* __restrict in1,
+- const Pixel* __restrict in2,
+- Pixel* __restrict out0, Pixel* __restrict out1,
+- Pixel* __restrict out2,
+- unsigned srcWidth, unsigned* __restrict edgeBuf,
+- EdgeHQLite /*edgeOp*/) __restrict
++ const Pixel* in0, const Pixel* in1,
++ const Pixel* in2,
++ Pixel* out0, Pixel* out1,
++ Pixel* out2,
++ unsigned srcWidth, unsigned* edgeBuf,
++ EdgeHQLite /*edgeOp*/)
+ {
+ unsigned c2, c4, c5, c6, c8, c9;
+ c2 = readPixel(in0[0]);
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_HQ3xScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_HQ3xScaler.cc
new file mode 100644
index 00000000000..8fc3bda9264
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_HQ3xScaler.cc
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_video_scalers_HQ3xScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/HQ3xScaler.cc.orig 2013-09-20 13:50:47.000000000 +0000
++++ src/video/scalers/HQ3xScaler.cc
+@@ -28,12 +28,12 @@ template <typename Pixel> struct HQ_1x1o
+
+ template <typename Pixel>
+ void HQ_1x1on3x3<Pixel>::operator()(
+- const Pixel* __restrict in0, const Pixel* __restrict in1,
+- const Pixel* __restrict in2,
+- Pixel* __restrict out0, Pixel* __restrict out1,
+- Pixel* __restrict out2,
+- unsigned srcWidth, unsigned* __restrict edgeBuf,
+- EdgeHQ edgeOp) __restrict
++ const Pixel* in0, const Pixel* in1,
++ const Pixel* in2,
++ Pixel* out0, Pixel* out1,
++ Pixel* out2,
++ unsigned srcWidth, unsigned* edgeBuf,
++ EdgeHQ edgeOp)
+ {
+ unsigned c1, c2, c3, c4, c5, c6, c7, c8, c9;
+ c2 = c3 = readPixel(in0[0]);
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_LineScalers.hh b/emulators/openmsx/patches/patch-src_video_scalers_LineScalers.hh
new file mode 100644
index 00000000000..51f8b443728
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_LineScalers.hh
@@ -0,0 +1,217 @@
+$NetBSD: patch-src_video_scalers_LineScalers.hh,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/LineScalers.hh.orig 2013-09-20 13:46:48.000000000 +0000
++++ src/video/scalers/LineScalers.hh
+@@ -402,7 +402,7 @@ extern "C"
+
+ template <typename Pixel, unsigned N>
+ static inline void scale_1onN(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width)
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - (N - 1)); i += N, j += 1) {
+@@ -437,7 +437,7 @@ void Scale_1on6<Pixel>::operator()(const
+
+ template <typename Pixel, bool streaming>
+ void Scale_1on2<Pixel, streaming>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned long width2 = 0;
+
+@@ -674,7 +674,7 @@ void Scale_1on2<Pixel, streaming>::opera
+
+ template <typename Pixel, bool streaming>
+ void Scale_1on1<Pixel, streaming>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned long nBytes = width * sizeof(Pixel);
+ unsigned long nBytes2 = 0;
+@@ -826,7 +826,7 @@ Scale_2on1<Pixel>::Scale_2on1(PixelOpera
+
+ template <typename Pixel>
+ void Scale_2on1<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned long width2 = 0;
+
+@@ -1084,7 +1084,7 @@ Scale_6on1<Pixel>::Scale_6on1(PixelOpera
+
+ template <typename Pixel>
+ void Scale_6on1<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ for (unsigned i = 0; i < width; ++i) {
+ out[i] = pixelOps.template blend6<1, 1, 1, 1, 1, 1>(&in[6 * i]);
+@@ -1100,7 +1100,7 @@ Scale_4on1<Pixel>::Scale_4on1(PixelOpera
+
+ template <typename Pixel>
+ void Scale_4on1<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ for (unsigned i = 0; i < width; ++i) {
+ out[i] = pixelOps.template blend4<1, 1, 1, 1>(&in[4 * i]);
+@@ -1116,7 +1116,7 @@ Scale_3on1<Pixel>::Scale_3on1(PixelOpera
+
+ template <typename Pixel>
+ void Scale_3on1<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ for (unsigned i = 0; i < width; ++i) {
+ out[i] = pixelOps.template blend3<1, 1, 1>(&in[3 * i]);
+@@ -1132,7 +1132,7 @@ Scale_3on2<Pixel>::Scale_3on2(PixelOpera
+
+ template <typename Pixel>
+ void Scale_3on2<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - 1); i += 2, j += 3) {
+@@ -1151,7 +1151,7 @@ Scale_3on4<Pixel>::Scale_3on4(PixelOpera
+
+ template <typename Pixel>
+ void Scale_3on4<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - 3); i += 4, j += 3) {
+@@ -1174,7 +1174,7 @@ Scale_3on8<Pixel>::Scale_3on8(PixelOpera
+
+ template <typename Pixel>
+ void Scale_3on8<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - 7); i += 8, j += 3) {
+@@ -1201,7 +1201,7 @@ Scale_2on3<Pixel>::Scale_2on3(PixelOpera
+
+ template <typename Pixel>
+ void Scale_2on3<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - 2); i += 3, j += 2) {
+@@ -1222,7 +1222,7 @@ Scale_4on3<Pixel>::Scale_4on3(PixelOpera
+
+ template <typename Pixel>
+ void Scale_4on3<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - 2); i += 3, j += 4) {
+@@ -1243,7 +1243,7 @@ Scale_8on3<Pixel>::Scale_8on3(PixelOpera
+
+ template <typename Pixel>
+ void Scale_8on3<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - 2); i += 3, j += 8) {
+@@ -1264,7 +1264,7 @@ Scale_2on9<Pixel>::Scale_2on9(PixelOpera
+
+ template <typename Pixel>
+ void Scale_2on9<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - 8); i += 9, j += 2) {
+@@ -1297,7 +1297,7 @@ Scale_4on9<Pixel>::Scale_4on9(PixelOpera
+
+ template <typename Pixel>
+ void Scale_4on9<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < (width - 8); i += 9, j += 4) {
+@@ -1330,7 +1330,7 @@ Scale_8on9<Pixel>::Scale_8on9(PixelOpera
+
+ template <typename Pixel>
+ void Scale_8on9<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ unsigned i = 0, j = 0;
+ for (/* */; i < width; i += 9, j += 8) {
+@@ -1363,7 +1363,7 @@ Scale_4on5<Pixel>::Scale_4on5(PixelOpera
+
+ template <typename Pixel>
+ void Scale_4on5<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ assert((width % 5) == 0);
+ for (unsigned i = 0, j = 0; i < width; i += 5, j += 4) {
+@@ -1384,7 +1384,7 @@ Scale_7on8<Pixel>::Scale_7on8(PixelOpera
+
+ template <typename Pixel>
+ void Scale_7on8<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ assert((width % 8) == 0);
+ for (unsigned i = 0, j = 0; i < width; i += 8, j += 7) {
+@@ -1408,7 +1408,7 @@ Scale_17on20<Pixel>::Scale_17on20(PixelO
+
+ template <typename Pixel>
+ void Scale_17on20<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ assert((width % 20) == 0);
+ for (unsigned i = 0, j = 0; i < width; i += 20, j += 17) {
+@@ -1444,7 +1444,7 @@ Scale_9on10<Pixel>::Scale_9on10(PixelOpe
+
+ template <typename Pixel>
+ void Scale_9on10<Pixel>::operator()(
+- const Pixel* __restrict in, Pixel* __restrict out, unsigned long width) __restrict
++ const Pixel* in, Pixel* out, unsigned long width)
+ {
+ assert((width % 10) == 0);
+ for (unsigned i = 0, j = 0; i < width; i += 10, j += 9) {
+@@ -1470,8 +1470,8 @@ BlendLines<Pixel, w1, w2>::BlendLines(Pi
+
+ template <typename Pixel, unsigned w1, unsigned w2>
+ void BlendLines<Pixel, w1, w2>::operator()(
+- const Pixel* __restrict in1, const Pixel* __restrict in2,
+- Pixel* __restrict out, unsigned width) __restrict
++ const Pixel* in1, const Pixel* in2,
++ Pixel* out, unsigned width)
+ {
+ // TODO MMX/SSE optimizations
+ // pure C++ version
+@@ -1513,8 +1513,8 @@ AlphaBlendLines<Pixel>::AlphaBlendLines(
+
+ template <typename Pixel>
+ void AlphaBlendLines<Pixel>::operator()(
+- const Pixel* __restrict in1, const Pixel* __restrict in2,
+- Pixel* __restrict out, unsigned width) __restrict
++ const Pixel* in1, const Pixel* in2,
++ Pixel* out, unsigned width)
+ {
+ for (unsigned i = 0; i < width; ++i) {
+ out[i] = pixelOps.alphaBlend(in1[i], in2[i]);
+@@ -1523,8 +1523,8 @@ void AlphaBlendLines<Pixel>::operator()(
+
+ template <typename Pixel>
+ void AlphaBlendLines<Pixel>::operator()(
+- Pixel in1, const Pixel* __restrict in2,
+- Pixel* __restrict out, unsigned width) __restrict
++ Pixel in1, const Pixel* in2,
++ Pixel* out, unsigned width)
+ {
+ // ATM this routine is only called when 'in1' is not fully opaque nor
+ // fully transparent. This cannot happen in 16bpp modes.
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_RGBTriplet3xScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_RGBTriplet3xScaler.cc
new file mode 100644
index 00000000000..3a5e0578051
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_RGBTriplet3xScaler.cc
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_video_scalers_RGBTriplet3xScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/RGBTriplet3xScaler.cc.orig 2013-09-20 13:51:07.000000000 +0000
++++ src/video/scalers/RGBTriplet3xScaler.cc
+@@ -42,8 +42,8 @@ void RGBTriplet3xScaler<Pixel>::calcSpil
+
+ template <class Pixel>
+ void RGBTriplet3xScaler<Pixel>::rgbify(
+- const Pixel* __restrict in, Pixel* __restrict out,
+- unsigned inwidth) __restrict
++ const Pixel* in, Pixel* out,
++ unsigned inwidth)
+ {
+ unsigned r, g, b, rs, gs, bs;
+ unsigned i = 0;
+@@ -290,7 +290,7 @@ void RGBTriplet3xScaler<Pixel>::scale4x2
+ }
+
+ template <typename Pixel>
+-static void fillLoop(const Pixel* __restrict in, Pixel* __restrict out,
++static void fillLoop(const Pixel* in, Pixel* out,
+ unsigned dstWidth)
+ {
+ out[0] = in[0];
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_SaI2xScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_SaI2xScaler.cc
new file mode 100644
index 00000000000..d997780b2ab
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_SaI2xScaler.cc
@@ -0,0 +1,34 @@
+$NetBSD: patch-src_video_scalers_SaI2xScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/SaI2xScaler.cc.orig 2013-09-20 13:51:18.000000000 +0000
++++ src/video/scalers/SaI2xScaler.cc
+@@ -53,10 +53,10 @@ inline Pixel SaI2xScaler<Pixel>::blend(P
+
+ template <class Pixel>
+ void SaI2xScaler<Pixel>::scaleLine1on2(
+- const Pixel* __restrict srcLine0, const Pixel* __restrict srcLine1,
+- const Pixel* __restrict srcLine2, const Pixel* __restrict srcLine3,
+- Pixel* __restrict dstUpper, Pixel* __restrict dstLower,
+- unsigned srcWidth) __restrict
++ const Pixel* srcLine0, const Pixel* srcLine1,
++ const Pixel* srcLine2, const Pixel* srcLine3,
++ Pixel* dstUpper, Pixel* dstLower,
++ unsigned srcWidth)
+ {
+ // TODO: Scale border pixels as well.
+ for (unsigned x = 0; x < srcWidth; x++) {
+@@ -188,10 +188,10 @@ void SaI2xScaler<Pixel>::scaleLine1on2(
+
+ template <class Pixel>
+ void SaI2xScaler<Pixel>::scaleLine1on1(
+- const Pixel* __restrict srcLine0, const Pixel* __restrict srcLine1,
+- const Pixel* __restrict srcLine2, const Pixel* __restrict srcLine3,
+- Pixel* __restrict dstUpper, Pixel* __restrict dstLower,
+- unsigned srcWidth) __restrict
++ const Pixel* srcLine0, const Pixel* srcLine1,
++ const Pixel* srcLine2, const Pixel* srcLine3,
++ Pixel* dstUpper, Pixel* dstLower,
++ unsigned srcWidth)
+ {
+ // Apply 2xSaI and keep the bottom-left pixel.
+ // It's not great, but at least it looks better than doubling the pixel
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_SaI3xScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_SaI3xScaler.cc
new file mode 100644
index 00000000000..45673a7bceb
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_SaI3xScaler.cc
@@ -0,0 +1,44 @@
+$NetBSD: patch-src_video_scalers_SaI3xScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/SaI3xScaler.cc.orig 2013-09-20 13:51:36.000000000 +0000
++++ src/video/scalers/SaI3xScaler.cc
+@@ -323,8 +323,8 @@ class LineRepeater
+ public:
+ template <unsigned NX, unsigned NY, typename Pixel>
+ inline static void scaleFixedLine(
+- const Pixel* __restrict src0, const Pixel* __restrict src1,
+- const Pixel* __restrict src2, const Pixel* __restrict src3,
++ const Pixel* src0, const Pixel* src1,
++ const Pixel* src2, const Pixel* src3,
+ unsigned srcWidth, ScalerOutput<Pixel>& dst, unsigned& dstY)
+ {
+ Pixel* dp = dst.acquireLine(dstY);
+@@ -413,7 +413,7 @@ void SaI3xScaler<Pixel>::scaleFixed(Fram
+ template <typename Pixel>
+ void SaI3xScaler<Pixel>::scaleAny(FrameSource& src,
+ unsigned srcStartY, unsigned /*srcEndY*/, unsigned srcWidth,
+- ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY) __restrict
++ ScalerOutput<Pixel>& dst, unsigned dstStartY, unsigned dstEndY)
+ {
+ // Calculate fixed point end coordinates and deltas.
+ const unsigned wfinish = (srcWidth - 1) << 16;
+@@ -426,14 +426,14 @@ void SaI3xScaler<Pixel>::scaleAny(FrameS
+ // Get source line pointers.
+ int line = srcStartY + (h >> 16);
+ // TODO possible optimization: reuse srcN from previous step
+- const Pixel* __restrict src0 = src.getLinePtr<Pixel>(line - 1, srcWidth);
+- const Pixel* __restrict src1 = src.getLinePtr<Pixel>(line + 0, srcWidth);
+- const Pixel* __restrict src2 = src.getLinePtr<Pixel>(line + 1, srcWidth);
+- const Pixel* __restrict src3 = src.getLinePtr<Pixel>(line + 2, srcWidth);
++ const Pixel* src0 = src.getLinePtr<Pixel>(line - 1, srcWidth);
++ const Pixel* src1 = src.getLinePtr<Pixel>(line + 0, srcWidth);
++ const Pixel* src2 = src.getLinePtr<Pixel>(line + 1, srcWidth);
++ const Pixel* src3 = src.getLinePtr<Pixel>(line + 2, srcWidth);
+
+ // Get destination line pointer.
+ Pixel* dstLine = dst.acquireLine(dstY);
+- Pixel* __restrict dp = dstLine;
++ Pixel* dp = dstLine;
+
+ // Fractional parts of the fixed point Y coordinates.
+ const unsigned y1 = h & 0xffff;
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_Scale2xScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_Scale2xScaler.cc
new file mode 100644
index 00000000000..de914b892ee
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_Scale2xScaler.cc
@@ -0,0 +1,30 @@
+$NetBSD: patch-src_video_scalers_Scale2xScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/Scale2xScaler.cc.orig 2013-09-20 13:51:42.000000000 +0000
++++ src/video/scalers/Scale2xScaler.cc
+@@ -38,9 +38,9 @@ Scale2xScaler<Pixel>::Scale2xScaler(cons
+
+ template <class Pixel>
+ void Scale2xScaler<Pixel>::scaleLineHalf_1on2(
+- Pixel* __restrict dst, const Pixel* __restrict src0,
+- const Pixel* __restrict src1, const Pixel* __restrict src2,
+- unsigned long srcWidth) __restrict
++ Pixel* dst, const Pixel* src0,
++ const Pixel* src1, const Pixel* src2,
++ unsigned long srcWidth)
+ {
+ // n m is expaned to a b
+ // w m e c d
+@@ -634,9 +634,9 @@ void Scale2xScaler<Pixel>::scaleLineHalf
+
+ template <class Pixel>
+ void Scale2xScaler<Pixel>::scaleLineHalf_1on1(
+- Pixel* __restrict dst, const Pixel* __restrict src0,
+- const Pixel* __restrict src1, const Pixel* __restrict src2,
+- unsigned long srcWidth) __restrict
++ Pixel* dst, const Pixel* src0,
++ const Pixel* src1, const Pixel* src2,
++ unsigned long srcWidth)
+ {
+ // ab ef
+ // x0 12 34 5x
diff --git a/emulators/openmsx/patches/patch-src_video_scalers_Scale3xScaler.cc b/emulators/openmsx/patches/patch-src_video_scalers_Scale3xScaler.cc
new file mode 100644
index 00000000000..9d72f5de745
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_scalers_Scale3xScaler.cc
@@ -0,0 +1,30 @@
+$NetBSD: patch-src_video_scalers_Scale3xScaler.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/scalers/Scale3xScaler.cc.orig 2013-09-20 13:51:47.000000000 +0000
++++ src/video/scalers/Scale3xScaler.cc
+@@ -28,9 +28,9 @@ Scale3xScaler<Pixel>::Scale3xScaler(cons
+
+ template <class Pixel>
+ void Scale3xScaler<Pixel>::scaleLine1on3Half(
+- Pixel* __restrict dst, const Pixel* __restrict src0,
+- const Pixel* __restrict src1, const Pixel* __restrict src2,
+- unsigned srcWidth) __restrict
++ Pixel* dst, const Pixel* src0,
++ const Pixel* src1, const Pixel* src2,
++ unsigned srcWidth)
+ {
+ /* A B C
+ * D E F
+@@ -91,9 +91,9 @@ void Scale3xScaler<Pixel>::scaleLine1on3
+
+ template <class Pixel>
+ void Scale3xScaler<Pixel>::scaleLine1on3Mid(
+- Pixel* __restrict dst, const Pixel* __restrict src0,
+- const Pixel* __restrict src1, const Pixel* __restrict src2,
+- unsigned srcWidth) __restrict
++ Pixel* dst, const Pixel* src0,
++ const Pixel* src1, const Pixel* src2,
++ unsigned srcWidth)
+ {
+ /*
+ * A B C
diff --git a/emulators/openmsx/patches/patch-src_video_v9990_V9990BitmapConverter.cc b/emulators/openmsx/patches/patch-src_video_v9990_V9990BitmapConverter.cc
new file mode 100644
index 00000000000..89b1d4bba71
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_v9990_V9990BitmapConverter.cc
@@ -0,0 +1,123 @@
+$NetBSD: patch-src_video_v9990_V9990BitmapConverter.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/v9990/V9990BitmapConverter.cc.orig 2013-09-20 13:47:57.000000000 +0000
++++ src/video/v9990/V9990BitmapConverter.cc
+@@ -27,8 +27,8 @@ V9990BitmapConverter<Pixel>::V9990Bitmap
+ template<bool YJK, bool PAL, bool SKIP, typename Pixel>
+ static inline void draw_YJK_YUV_PAL(
+ V9990VRAM& vram,
+- const Pixel* __restrict palette64, const Pixel* __restrict palette32768,
+- Pixel* __restrict pixelPtr, unsigned& address, int firstX = 0)
++ const Pixel* palette64, const Pixel* palette32768,
++ Pixel* pixelPtr, unsigned& address, int firstX = 0)
+ {
+ byte data[4];
+ for (int i = 0; i < 4; ++i) {
+@@ -56,7 +56,7 @@ static inline void draw_YJK_YUV_PAL(
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBYUV(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ unsigned address = (x & ~3) + y * vdp.getImageWidth();
+ if (x & 3) {
+@@ -73,7 +73,7 @@ void V9990BitmapConverter<Pixel>::raster
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBYUVP(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ // TODO this mode cannot be shown in B4 and higher resolution modes
+ // (So the dual palette for B4 modes is not an issue here.)
+@@ -92,7 +92,7 @@ void V9990BitmapConverter<Pixel>::raster
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBYJK(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ unsigned address = (x & ~3)+ y * vdp.getImageWidth();
+ if (x & 3) {
+@@ -109,7 +109,7 @@ void V9990BitmapConverter<Pixel>::raster
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBYJKP(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ // TODO this mode cannot be shown in B4 and higher resolution modes
+ // (So the dual palette for B4 modes is not an issue here.)
+@@ -128,7 +128,7 @@ void V9990BitmapConverter<Pixel>::raster
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBD16(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ unsigned address = 2 * (x + y * vdp.getImageWidth());
+ if (vdp.isSuperimposing()) {
+@@ -155,7 +155,7 @@ void V9990BitmapConverter<Pixel>::raster
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBD8(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ unsigned address = x + y * vdp.getImageWidth();
+ for (/**/; nrPixels > 0; --nrPixels) {
+@@ -165,7 +165,7 @@ void V9990BitmapConverter<Pixel>::raster
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBP6(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ unsigned address = x + y * vdp.getImageWidth();
+ for (/**/; nrPixels > 0; --nrPixels) {
+@@ -175,7 +175,7 @@ void V9990BitmapConverter<Pixel>::raster
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBP4(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ assert(nrPixels > 0);
+ unsigned address = (x + y * vdp.getImageWidth()) / 2;
+@@ -195,7 +195,7 @@ void V9990BitmapConverter<Pixel>::raster
+ }
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBP4HiRes(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ // Verified on real HW:
+ // Bit PLT05 in palette offset is ignored, instead for even pixels
+@@ -219,7 +219,7 @@ void V9990BitmapConverter<Pixel>::raster
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBP2(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ assert(nrPixels > 0);
+ unsigned address = (x + y * vdp.getImageWidth()) / 4;
+@@ -243,7 +243,7 @@ void V9990BitmapConverter<Pixel>::raster
+ }
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::rasterBP2HiRes(
+- Pixel* __restrict pixelPtr, unsigned x, unsigned y, int nrPixels) __restrict
++ Pixel* pixelPtr, unsigned x, unsigned y, int nrPixels)
+ {
+ // Verified on real HW:
+ // Bit PLT05 in palette offset is ignored, instead for even pixels
+@@ -308,7 +308,7 @@ void V9990BitmapConverter<Pixel>::setCol
+
+ template <class Pixel>
+ void V9990BitmapConverter<Pixel>::drawCursor(
+- Pixel* __restrict buffer, int displayY, unsigned attrAddr, unsigned patAddr) __restrict
++ Pixel* buffer, int displayY, unsigned attrAddr, unsigned patAddr)
+ {
+ int cursorY = vram.readVRAMBx(attrAddr + 0) +
+ (vram.readVRAMBx(attrAddr + 2) & 1) * 256;
diff --git a/emulators/openmsx/patches/patch-src_video_v9990_V9990P1Converter.cc b/emulators/openmsx/patches/patch-src_video_v9990_V9990P1Converter.cc
new file mode 100644
index 00000000000..282651b87b9
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_v9990_V9990P1Converter.cc
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_video_v9990_V9990P1Converter.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/v9990/V9990P1Converter.cc.orig 2013-09-20 13:48:36.000000000 +0000
++++ src/video/v9990/V9990P1Converter.cc
+@@ -94,8 +94,8 @@ void V9990P1Converter<Pixel>::renderPatt
+
+ template <class Pixel>
+ void V9990P1Converter<Pixel>::renderPattern2(
+- Pixel* __restrict buffer, unsigned width, unsigned x, unsigned y,
+- unsigned nameTable, unsigned patternTable, byte pal) __restrict
++ Pixel* buffer, unsigned width, unsigned x, unsigned y,
++ unsigned nameTable, unsigned patternTable, byte pal)
+ {
+ x &= 511;
+ const Pixel* palette = palette64 + pal;
+@@ -186,7 +186,7 @@ void V9990P1Converter<Pixel>::renderPatt
+
+ template <class Pixel>
+ void V9990P1Converter<Pixel>::determineVisibleSprites(
+- int* __restrict visibleSprites, unsigned displayY) __restrict
++ int* visibleSprites, unsigned displayY)
+ {
+ static const unsigned spriteTable = 0x3FE00;
+
+@@ -211,8 +211,8 @@ void V9990P1Converter<Pixel>::determineV
+
+ template <class Pixel>
+ void V9990P1Converter<Pixel>::renderSprites(
+- Pixel* __restrict buffer, int displayX, int displayEnd, unsigned displayY,
+- int* __restrict visibleSprites, bool front) __restrict
++ Pixel* buffer, int displayX, int displayEnd, unsigned displayY,
++ int* visibleSprites, bool front)
+ {
+ static const unsigned spriteTable = 0x3FE00;
+ unsigned spritePatternTable = vdp.getSpritePatternAddress(P1);
diff --git a/emulators/openmsx/patches/patch-src_video_v9990_V9990P2Converter.cc b/emulators/openmsx/patches/patch-src_video_v9990_V9990P2Converter.cc
new file mode 100644
index 00000000000..97f3102a39d
--- /dev/null
+++ b/emulators/openmsx/patches/patch-src_video_v9990_V9990P2Converter.cc
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_video_v9990_V9990P2Converter.cc,v 1.1 2013/09/20 23:04:59 joerg Exp $
+
+--- src/video/v9990/V9990P2Converter.cc.orig 2013-09-20 13:48:18.000000000 +0000
++++ src/video/v9990/V9990P2Converter.cc
+@@ -58,8 +58,8 @@ void V9990P2Converter<Pixel>::convertLin
+
+ template <class Pixel>
+ void V9990P2Converter<Pixel>::renderPattern(
+- Pixel* __restrict buffer, unsigned width, unsigned x, unsigned y,
+- byte pal) __restrict
++ Pixel* buffer, unsigned width, unsigned x, unsigned y,
++ byte pal)
+ {
+ static const unsigned patternTable = 0x00000;
+ static const unsigned nameTable = 0x7C000;
+@@ -153,7 +153,7 @@ void V9990P2Converter<Pixel>::renderPatt
+
+ template <class Pixel>
+ void V9990P2Converter<Pixel>::determineVisibleSprites(
+- int* __restrict visibleSprites, int displayY) __restrict
++ int* visibleSprites, int displayY)
+ {
+ static const unsigned spriteTable = 0x3FE00;
+
+@@ -179,8 +179,8 @@ void V9990P2Converter<Pixel>::determineV
+
+ template <class Pixel>
+ void V9990P2Converter<Pixel>::renderSprites(
+- Pixel* __restrict buffer, int displayX, int displayEnd, unsigned displayY,
+- int* __restrict visibleSprites, bool front) __restrict
++ Pixel* buffer, int displayX, int displayEnd, unsigned displayY,
++ int* visibleSprites, bool front)
+ {
+ static const unsigned spriteTable = 0x3FE00;
+ unsigned spritePatternTable = vdp.getSpritePatternAddress(P1);