summaryrefslogtreecommitdiff
path: root/emulators/vba
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/vba')
-rw-r--r--emulators/vba/Makefile3
-rw-r--r--emulators/vba/distinfo12
-rw-r--r--emulators/vba/patches/patch-aa4
-rw-r--r--emulators/vba/patches/patch-ab15
-rw-r--r--emulators/vba/patches/patch-ac271
5 files changed, 296 insertions, 9 deletions
diff --git a/emulators/vba/Makefile b/emulators/vba/Makefile
index cd62174d64e..24dfa5af839 100644
--- a/emulators/vba/Makefile
+++ b/emulators/vba/Makefile
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.17 2006/04/17 13:46:23 wiz Exp $
+# $NetBSD: Makefile,v 1.18 2006/04/17 14:50:47 wiz Exp $
DISTNAME= VisualBoyAdvance-src-1.7.2
PKGNAME= vba-1.7.2
-PKGREVISION= 1
CATEGORIES= emulators
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=vba/}
diff --git a/emulators/vba/distinfo b/emulators/vba/distinfo
index 34e39657c3e..bb97ebee3b0 100644
--- a/emulators/vba/distinfo
+++ b/emulators/vba/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.2 2005/02/23 18:49:21 agc Exp $
+$NetBSD: distinfo,v 1.3 2006/04/17 14:50:47 wiz Exp $
-SHA1 (VisualBoyAdvance-src-1.6a.zip) = 81e6763d0a7f9cadfedfb8053fea5f5a9028916a
-RMD160 (VisualBoyAdvance-src-1.6a.zip) = 5d47f194b8df5a5f4f84785283ba449277d7188d
-Size (VisualBoyAdvance-src-1.6a.zip) = 1206080 bytes
-SHA1 (patch-aa) = 75a970fb59926a299830c2823c5094ff56523ee7
+SHA1 (VisualBoyAdvance-src-1.7.2.tar.gz) = 04d82406079563fd17cda07f72488185e9152f51
+RMD160 (VisualBoyAdvance-src-1.7.2.tar.gz) = 44f94a4f270f2cda25879681c52892f6978caf99
+Size (VisualBoyAdvance-src-1.7.2.tar.gz) = 1410762 bytes
+SHA1 (patch-aa) = 2871ea4cf2451d489d1afe72af4abb86f1a58ca0
+SHA1 (patch-ab) = 55e1084d1cc48cff28b98a7fa68213d97f1f3d7e
+SHA1 (patch-ac) = 33158335dc12f335471d10962b4552082b589d25
diff --git a/emulators/vba/patches/patch-aa b/emulators/vba/patches/patch-aa
index 83037172ec7..a1df988ea8f 100644
--- a/emulators/vba/patches/patch-aa
+++ b/emulators/vba/patches/patch-aa
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.1.1.1 2003/12/03 23:34:46 xtraeme Exp $
+$NetBSD: patch-aa,v 1.2 2006/04/17 14:50:47 wiz Exp $
--- src/unzip.h.orig Sun Oct 20 06:03:12 2002
+++ src/unzip.h Mon Jun 30 23:45:30 2003
-@@ -67,6 +67,15 @@
+@@ -68,6 +68,15 @@
#include "zlib.h"
#endif
diff --git a/emulators/vba/patches/patch-ab b/emulators/vba/patches/patch-ab
new file mode 100644
index 00000000000..0459bba5bc9
--- /dev/null
+++ b/emulators/vba/patches/patch-ab
@@ -0,0 +1,15 @@
+$NetBSD: patch-ab,v 1.1 2006/04/17 14:50:47 wiz Exp $
+
+--- win32/include/zlib/zutil.h.orig 2004-01-18 00:07:32.000000000 +0100
++++ win32/include/zlib/zutil.h
+@@ -26,6 +26,10 @@
+ # include <errno.h>
+ #endif
+
++#ifndef OF
++#define OF(X) X
++#endif
++
+ #ifndef local
+ # define local static
+ #endif
diff --git a/emulators/vba/patches/patch-ac b/emulators/vba/patches/patch-ac
new file mode 100644
index 00000000000..b40d1c28bd5
--- /dev/null
+++ b/emulators/vba/patches/patch-ac
@@ -0,0 +1,271 @@
+$NetBSD: patch-ac,v 1.1 2006/04/17 14:50:47 wiz Exp $
+
+--- src/sdl/SDL.cpp.orig 2004-05-21 22:16:58.000000000 +0200
++++ src/sdl/SDL.cpp
+@@ -98,6 +98,7 @@ extern void MotionBlurIB32(u8*,u32,int,i
+ void Init_Overlay(SDL_Surface *surface, int overlaytype);
+ void Quit_Overlay(void);
+ void Draw_Overlay(SDL_Surface *surface, int size);
++SDL_Surface *Set_Video(bool first);
+
+ extern void remoteInit();
+ extern void remoteCleanUp();
+@@ -248,8 +249,12 @@ bool screenMessage = false;
+ char screenMessageBuffer[21];
+ u32 screenMessageTime = 0;
+
++#if 0
+ SDL_cond *cond = NULL;
+ SDL_mutex *mutex = NULL;
++#else
++SDL_sem *rsem, *wsem;
++#endif
+ u8 sdlBuffer[4096];
+ int sdlSoundLen = 0;
+
+@@ -886,8 +891,8 @@ FILE *sdlFindFile(const char *name)
+ char *home = getenv("HOME");
+
+ if(home != NULL) {
+- fprintf(stderr, "Searching home directory: %s\n", home);
+- sprintf(path, "%s%c%s", home, FILE_SEP, name);
++ fprintf(stderr, "Searching home directory: %s%c.vba\n", home, FILE_SEP);
++ sprintf(path, "%s%c.vba%c%s", home, FILE_SEP, FILE_SEP, name);
+ f = fopen(path, "r");
+ if(f != NULL)
+ return f;
+@@ -1744,11 +1749,8 @@ void sdlPollEvents()
+ case SDLK_f:
+ if(!(event.key.keysym.mod & MOD_NOCTRL) &&
+ (event.key.keysym.mod & KMOD_CTRL)) {
+- int flags = 0;
+ fullscreen = !fullscreen;
+- if(fullscreen)
+- flags |= SDL_FULLSCREEN;
+- SDL_SetVideoMode(destWidth, destHeight, systemColorDepth, flags);
++ Set_Video(false);
+ // if(SDL_WM_ToggleFullScreen(surface))
+ // fullscreen = !fullscreen;
+ }
+@@ -2320,9 +2322,7 @@ int main(int argc, char **argv)
+ destWidth = (sizeOption+1)*srcWidth;
+ destHeight = (sizeOption+1)*srcHeight;
+
+- surface = SDL_SetVideoMode(destWidth, destHeight, 16,
+- SDL_ANYFORMAT|SDL_HWSURFACE|SDL_DOUBLEBUF|
+- (fullscreen ? SDL_FULLSCREEN : 0));
++ surface = Set_Video(true);
+
+ if(surface == NULL) {
+ systemMessage(0, "Failed to set video mode");
+@@ -2916,6 +2916,7 @@ void soundCallback(void *,u8 *stream,int
+ {
+ if(!emulating)
+ return;
++#if 0
+ SDL_mutexP(mutex);
+ // printf("Locked mutex\n");
+ if(!speedup && !throttle) {
+@@ -2926,19 +2927,27 @@ void soundCallback(void *,u8 *stream,int
+ break;
+ }
+ }
++#else
++ SDL_SemWait(rsem);
++#endif
+ if(emulating) {
+ // printf("Copying data\n");
+ memcpy(stream, sdlBuffer, len);
+ }
+ sdlSoundLen = 0;
++#if 0
+ if(mutex)
+ SDL_mutexV(mutex);
++#else
++ SDL_SemPost(wsem);
++#endif
+ }
+
+ void systemWriteDataToSoundBuffer()
+ {
+ if(SDL_GetAudioStatus() != SDL_AUDIO_PLAYING)
+ SDL_PauseAudio(0);
++#if 0
+ bool cont = true;
+ while(cont && !speedup && !throttle) {
+ SDL_mutexP(mutex);
+@@ -2976,6 +2985,11 @@ soundBufferLen);
+ memcpy(&sdlBuffer[sdlSoundLen], soundFinalWave, soundBufferLen);
+ sdlSoundLen += soundBufferLen;
+ }
++#else
++ memcpy(sdlBuffer, soundFinalWave, soundBufferLen);
++ SDL_SemPost(rsem);
++ SDL_SemWait(wsem);
++#endif
+ }
+
+ bool systemSoundInit()
+@@ -2998,7 +3012,7 @@ bool systemSoundInit()
+ }
+ audio.format=AUDIO_S16SYS;
+ audio.channels = 2;
+- audio.samples = 1024;
++ audio.samples = soundBufferLen/4;
+ audio.callback = soundCallback;
+ audio.userdata = NULL;
+ if(SDL_OpenAudio(&audio, NULL)) {
+@@ -3006,8 +3020,13 @@ bool systemSoundInit()
+ return false;
+ }
+ soundBufferTotalLen = soundBufferLen*10;
++#if 0
+ cond = SDL_CreateCond();
+ mutex = SDL_CreateMutex();
++#else
++ rsem = SDL_CreateSemaphore(0);
++ wsem = SDL_CreateSemaphore(0);
++#endif
+ sdlSoundLen = 0;
+ systemSoundOn = true;
+ return true;
+@@ -3015,6 +3034,7 @@ bool systemSoundInit()
+
+ void systemSoundShutdown()
+ {
++#if 0
+ SDL_mutexP(mutex);
+ SDL_CondSignal(cond);
+ SDL_mutexV(mutex);
+@@ -3022,7 +3042,15 @@ void systemSoundShutdown()
+ cond = NULL;
+ SDL_DestroyMutex(mutex);
+ mutex = NULL;
++#else
++ SDL_SemPost(rsem);
++#endif
+ SDL_CloseAudio();
++#if 0
++#else
++ SDL_DestroySemaphore(rsem);
++ SDL_DestroySemaphore(wsem);
++#endif
+ }
+
+ void systemSoundPause()
+@@ -3139,9 +3167,15 @@ bool systemPauseOnFrame()
+
+ void Init_Overlay(SDL_Surface *gbascreen, int overlaytype)
+ {
+-
+- overlay = SDL_CreateYUVOverlay( GBA_WIDTH,
+- GBA_HEIGHT,
++ int width;
++
++ if (overlaytype == SDL_YUY2_OVERLAY)
++ width = srcWidth *2;
++ else
++ width = srcWidth;
++
++ overlay = SDL_CreateYUVOverlay( width,
++ srcHeight,
+ overlaytype, gbascreen);
+ fprintf(stderr, "Created %dx%dx%d %s %s overlay\n",
+ overlay->w,overlay->h,overlay->planes,
+@@ -3304,19 +3338,15 @@ inline void ConvertRGBtoYUY2(SDL_Overlay
+
+ SDL_LockYUVOverlay(o);
+
+- for(y=0; y<160 && y<o->h; y++) {
++ for(y=0; y<srcHeight && y<o->h; y++) {
+ p=(Uint8 *)pix+srcPitch*y;
+ op=o->pixels[0]+o->pitches[0]*y;
+- for(x=0; x<240 && x<o->w; x++) {
++ for(x=0; x<srcWidth && x<o->w; x++) {
+ RGBtoYUV(p,yuv);
+- if(x%2==0) {
+- *(op++)=yuv[0];
+- *(op++)=yuv[1];
+- op[1]=yuv[2];
+- } else {
+- *op=yuv[0];
+- op+=2;
+- }
++ *(op++)=yuv[0];
++ *(op++)=yuv[1];
++ *(op++)=yuv[0];
++ *(op++)=yuv[2];
+
+ p+=4; //s->format->BytesPerPixel;
+ }
+@@ -3358,11 +3388,6 @@ inline void Draw_Overlay(SDL_Surface *di
+
+ Convert32bit(display);
+
+- overlay_rect.x = 0;
+- overlay_rect.y = 0;
+- overlay_rect.w = GBA_WIDTH * size;
+- overlay_rect.h = GBA_HEIGHT * size;
+-
+ SDL_DisplayYUVOverlay(overlay, &overlay_rect);
+ SDL_UnlockYUVOverlay(overlay);
+ }
+@@ -3378,9 +3403,8 @@ void systemGbBorderOn()
+ destWidth = (sizeOption+1)*srcWidth;
+ destHeight = (sizeOption+1)*srcHeight;
+
+- surface = SDL_SetVideoMode(destWidth, destHeight, 16,
+- SDL_ANYFORMAT|SDL_HWSURFACE|SDL_DOUBLEBUF|
+- (fullscreen ? SDL_FULLSCREEN : 0));
++ surface = Set_Video(true);
++
+ #ifndef C_CORE
+ sdlMakeStretcher(srcWidth);
+ #else
+@@ -3440,3 +3464,46 @@ void systemGbBorderOn()
+ srcPitch = srcWidth*3;
+ }
+ }
++
++SDL_Surface *
++Set_Video(bool first)
++{
++ int flags;
++
++ flags = SDL_HWSURFACE|SDL_DOUBLEBUF;
++ if (first) {
++ flags |= SDL_ANYFORMAT;
++ systemColorDepth = 16;
++ }
++
++ if(fullscreen)
++ flags |= SDL_FULLSCREEN;
++
++ destWidth = srcWidth*(sizeOption+1);
++ destHeight = srcHeight*(sizeOption+1);
++
++ if (yuv) {
++ double mul, mul2;
++
++ if (fullscreen) {
++ SDL_Rect **mode;
++ if ((mode=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE))
++ != NULL) {
++ destWidth = mode[0]->w;
++ destHeight = mode[0]->h;
++ }
++ }
++
++ mul = (double)destWidth/srcWidth;
++ mul2 = (double)destHeight/srcHeight;
++ if (mul2 < mul)
++ mul = mul2;
++
++ overlay_rect.w = (Uint16)(srcWidth*mul);
++ overlay_rect.h = (Uint16)(srcHeight*mul);
++ overlay_rect.x = (destWidth-overlay_rect.w)/2;
++ overlay_rect.y = (destHeight-overlay_rect.h)/2;
++ }
++
++ return SDL_SetVideoMode(destWidth, destHeight, systemColorDepth, flags);
++}