Finally got Win32 port working again. Still TODO is contact the OSX

maintainer and see how hard it will be to update that port.

I just found some problems in the OpenGL code in Win32; the colors are
off.  I don't know if it's a Win32 thing, or it affects all ports.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@432 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-05-19 18:42:39 +00:00
parent 891ad6f7fe
commit 0a7a36bede
8 changed files with 237 additions and 46 deletions

View File

@ -13,7 +13,7 @@
## See the file "license" for information on usage and redistribution of
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
##
## $Id: makefile,v 1.81 2005-05-18 16:02:53 stephena Exp $
## $Id: makefile,v 1.82 2005-05-19 18:42:36 stephena Exp $
##============================================================================
##============================================================================
@ -147,7 +147,7 @@ win32-gl:
EXE_NAME="stella.exe" \
LDLIBS="$(LDLIBS) -lopengl32" \
OPTIONS="$(OPTIONS) -DBSPF_WIN32 -DWIN32 -DDISPLAY_OPENGL -DTEXTURES_ARE_LOST" \
OBJS="$(OBJECTS) FrameBufferGL.o SettingsWin32.o FSNodeWin32.o"
OBJS="$(OBJECTS) FrameBufferGL.o SettingsWin32.o OSystemWin32.o FSNodeWin32.o"
###############################################################################

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: EventHandler.cxx,v 1.57 2005-05-17 18:42:22 stephena Exp $
// $Id: EventHandler.cxx,v 1.58 2005-05-19 18:42:37 stephena Exp $
//============================================================================
#include <algorithm>
@ -858,12 +858,14 @@ void EventHandler::setDefaultKeymap()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::setDefaultJoymap()
{
uInt32 i;
// Erase all mappings
for(Int32 i = 0; i < StellaEvent::LastJSTICK*StellaEvent::LastJCODE; ++i)
for(i = 0; i < StellaEvent::LastJSTICK*StellaEvent::LastJCODE; ++i)
myJoyTable[i] = Event::NoType;
// Left joystick
uInt32 i = StellaEvent::JSTICK_0 * StellaEvent::LastJCODE;
i = StellaEvent::JSTICK_0 * StellaEvent::LastJCODE;
myJoyTable[i + StellaEvent::JAXIS_UP] = Event::JoystickZeroUp;
myJoyTable[i + StellaEvent::JAXIS_DOWN] = Event::JoystickZeroDown;
myJoyTable[i + StellaEvent::JAXIS_LEFT] = Event::JoystickZeroLeft;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: FSNode.hxx,v 1.2 2005-05-10 19:20:40 stephena Exp $
// $Id: FSNode.hxx,v 1.3 2005-05-19 18:42:37 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -22,6 +22,8 @@
#ifndef FS_NODE_HXX
#define FS_NODE_HXX
#include <algorithm>
/*
* The API described in this header is meant to allow for file system browsing in a
* portable fashions. To this ends, multiple or single roots have to be supported

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Settings.cxx,v 1.44 2005-05-17 18:42:23 stephena Exp $
// $Id: Settings.cxx,v 1.45 2005-05-19 18:42:37 stephena Exp $
//============================================================================
#include <cassert>
@ -178,7 +178,7 @@ void Settings::validate()
set("gl_filter", "nearest");
f = getFloat("gl_aspect");
if(f < 1.1 or f > 2.0)
if(f < 1.1 || f > 2.0)
set("gl_aspect", "2.0");
#endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: VideoDialog.cxx,v 1.12 2005-05-13 18:28:06 stephena Exp $
// $Id: VideoDialog.cxx,v 1.13 2005-05-19 18:42:38 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -148,7 +148,7 @@ void VideoDialog::loadConfig()
string s;
bool b;
int i;
float f;
double f;
// Driver setting
myDriverPopup->setSelectedTag(0); // FIXME

View File

@ -13,13 +13,12 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: FSNodeWin32.cxx,v 1.1 2005-05-19 13:52:55 stephena Exp $
// $Id: FSNodeWin32.cxx,v 1.2 2005-05-19 18:42:38 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
//============================================================================
//#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
@ -60,6 +59,18 @@ class WindowsFilesystemNode : public AbstractFilesystemNode
const char* base, WIN32_FIND_DATA* find_data);
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const char* lastPathComponent(const string& str)
{
const char* start = str.c_str();
const char* cur = start + str.size() - 2;
while (cur > start && *cur != '\\')
--cur;
return cur + 1;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
char* WindowsFilesystemNode::toAscii(TCHAR* x)
{
@ -115,11 +126,17 @@ void WindowsFilesystemNode::addFile(FSList& list, ListMode mode,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AbstractFilesystemNode *FilesystemNode::getRoot()
AbstractFilesystemNode* FilesystemNode::getRoot()
{
return new WindowsFilesystemNode();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AbstractFilesystemNode* FilesystemNode::getNodeForPath(const string& path)
{
return new WindowsFilesystemNode(path);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WindowsFilesystemNode::WindowsFilesystemNode()
{
@ -131,6 +148,16 @@ WindowsFilesystemNode::WindowsFilesystemNode()
_isPseudoRoot = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WindowsFilesystemNode::WindowsFilesystemNode(const string& path)
{
_path = path;
_displayName = lastPathComponent(path);
_isValid = true;
_isDirectory = true;
_isPseudoRoot = false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WindowsFilesystemNode::WindowsFilesystemNode(const WindowsFilesystemNode* node)
{
@ -193,18 +220,6 @@ FSList WindowsFilesystemNode::listDir(ListMode mode) const
return myList;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const char* lastPathComponent(const string& str)
{
const char* start = str.c_str();
const char* cur = start + str.size() - 2;
while (cur > start && *cur != '\\')
--cur;
return cur + 1;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AbstractFilesystemNode* WindowsFilesystemNode::parent() const
{
@ -219,7 +234,7 @@ AbstractFilesystemNode* WindowsFilesystemNode::parent() const
const char *end = lastPathComponent(_path);
p = new WindowsFilesystemNode();
p->_path = String(start, end - start);
p->_path = string(start, end - start);
p->_isValid = true;
p->_isDirectory = true;
p->_displayName = lastPathComponent(p->_path);

View File

@ -20,8 +20,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\emucore\m6502\src\bspf\src;..\..\emucore\m6502\src;..\..\emucore;..\..\common;..\..\win32"
PreprocessorDefinitions="BSPF_WIN32;WIN32;_DEBUG;JOYSTICK_SUPPORT;DEVELOPER_SUPPORT;SNAPSHOT_SUPPORT;DISPLAY_OPENGL;TEXTURES_ARE_LOST"
AdditionalIncludeDirectories="..\..\gui;..\..\emucore\m6502\src\bspf\src;..\..\emucore\m6502\src;..\..\emucore;..\..\common;..\..\win32"
PreprocessorDefinitions="BSPF_WIN32;WIN32;_DEBUG;JOYSTICK_SUPPORT;DEVELOPER_SUPPORT;SNAPSHOT_SUPPORT;DISPLAY_OPENGL;TEXTURES_ARE_LOST;SOUND_SUPPORT"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="2"
@ -73,8 +73,8 @@ opengl32.lib"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\emucore\m6502\src\bspf\src;..\..\emucore\m6502\src;..\..\emucore;..\..\common;..\..\win32"
PreprocessorDefinitions="BSPF_WIN32;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEVELOPER_SUPPORT;SNAPSHOT_SUPPORT;DISPLAY_OPENGL;TEXTURES_ARE_LOST"
AdditionalIncludeDirectories="..\..\emucore\m6502\src\bspf\src;..\..\emucore\m6502\src;..\..\emucore;..\..\common;..\..\gui;..\..\win32"
PreprocessorDefinitions="BSPF_WIN32;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEVELOPER_SUPPORT;SNAPSHOT_SUPPORT;DISPLAY_OPENGL;TEXTURES_ARE_LOST;SOUND_SUPPORT"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="2"
@ -88,7 +88,7 @@ opengl32.lib"
SDLmain.lib
libpng.lib
opengl32.lib"
AdditionalDependencies="sdl.lib sdlmain.lib libpng.lib opengl32.lib"
AdditionalDependencies="sdl.lib sdlmain.lib libpng.lib opengl32.lib zdll.lib"
OutputFile="$(OutDir)/Stella.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
@ -125,9 +125,18 @@ opengl32.lib"
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\..\gui\AboutDialog.cxx">
</File>
<File
RelativePath="..\..\gui\AudioDialog.cxx">
</File>
<File
RelativePath="..\..\emucore\Booster.cxx">
</File>
<File
RelativePath="..\..\gui\BrowserDialog.cxx">
</File>
<File
RelativePath="..\..\emucore\Cart.cxx">
</File>
@ -203,6 +212,12 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\m6502\src\Device.cxx">
</File>
<File
RelativePath="..\..\gui\Dialog.cxx">
</File>
<File
RelativePath="..\..\gui\DialogContainer.cxx">
</File>
<File
RelativePath="..\..\emucore\Driving.cxx">
</File>
@ -212,6 +227,9 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\EventHandler.cxx">
</File>
<File
RelativePath="..\..\gui\EventMappingDialog.cxx">
</File>
<File
RelativePath="..\..\emucore\FrameBuffer.cxx">
</File>
@ -219,10 +237,22 @@ opengl32.lib"
RelativePath="..\..\common\FrameBufferGL.cxx">
</File>
<File
RelativePath="..\..\common\FrameBufferSDL.cxx">
RelativePath="..\..\common\FrameBufferSoft.cxx">
</File>
<File
RelativePath="..\..\common\FrameBufferSoft.cxx">
RelativePath="..\..\emucore\FSNode.cxx">
</File>
<File
RelativePath="..\FSNodeWin32.cxx">
</File>
<File
RelativePath="..\..\gui\GameInfoDialog.cxx">
</File>
<File
RelativePath="..\..\gui\GameList.cxx">
</File>
<File
RelativePath="..\..\gui\HelpDialog.cxx">
</File>
<File
RelativePath="..\..\emucore\Joystick.cxx">
@ -230,6 +260,18 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\Keyboard.cxx">
</File>
<File
RelativePath="..\..\gui\Launcher.cxx">
</File>
<File
RelativePath="..\..\gui\LauncherDialog.cxx">
</File>
<File
RelativePath="..\..\gui\LauncherOptionsDialog.cxx">
</File>
<File
RelativePath="..\..\gui\ListWidget.cxx">
</File>
<File
RelativePath="..\..\emucore\m6502\src\M6502.cxx">
</File>
@ -251,12 +293,30 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\MediaSrc.cxx">
</File>
<File
RelativePath="..\..\gui\Menu.cxx">
</File>
<File
RelativePath="..\..\emucore\m6502\src\NullDev.cxx">
</File>
<File
RelativePath="..\..\gui\OptionsDialog.cxx">
</File>
<File
RelativePath="..\..\emucore\OSystem.cxx">
</File>
<File
RelativePath="..\OSystemWin32.cxx">
</File>
<File
RelativePath="..\..\emucore\Paddles.cxx">
</File>
<File
RelativePath="..\..\gui\PopUpWidget.cxx">
</File>
<File
RelativePath="..\..\gui\ProgressDialog.cxx">
</File>
<File
RelativePath="..\..\emucore\Props.cxx">
</File>
@ -266,6 +326,9 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\Random.cxx">
</File>
<File
RelativePath="..\..\gui\ScrollBarWidget.cxx">
</File>
<File
RelativePath="..\..\emucore\Serializer.cxx">
</File>
@ -279,31 +342,58 @@ opengl32.lib"
RelativePath="..\..\common\Snapshot.cxx">
</File>
<File
RelativePath="..\..\emucore\Sound.cxx">
RelativePath="..\..\common\SoundNull.cxx">
</File>
<File
RelativePath="..\..\common\SoundSDL.cxx">
</File>
<File
RelativePath="..\..\gui\StellaFont.cxx">
</File>
<File
RelativePath="..\..\emucore\Switches.cxx">
</File>
<File
RelativePath="..\..\emucore\m6502\src\System.cxx">
</File>
<File
RelativePath="..\..\gui\TabWidget.cxx">
</File>
<File
RelativePath="..\..\emucore\TIA.cxx">
</File>
<File
RelativePath="..\..\emucore\TIASound.c">
</File>
<File
RelativePath="..\..\emucore\unzip.c">
</File>
<File
RelativePath="..\..\gui\VideoDialog.cxx">
</File>
<File
RelativePath="..\..\gui\Widget.cxx">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\..\gui\AboutDialog.hxx">
</File>
<File
RelativePath="..\..\gui\Array.hxx">
</File>
<File
RelativePath="..\..\gui\AudioDialog.hxx">
</File>
<File
RelativePath="..\..\emucore\Booster.hxx">
</File>
<File
RelativePath="..\..\gui\BrowserDialog.hxx">
</File>
<File
RelativePath="..\..\emucore\m6502\src\bspf\src\bspf.hxx">
</File>
@ -367,6 +457,9 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\CartUA.hxx">
</File>
<File
RelativePath="..\..\gui\Command.hxx">
</File>
<File
RelativePath="..\..\emucore\Console.hxx">
</File>
@ -382,6 +475,12 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\m6502\src\Device.hxx">
</File>
<File
RelativePath="..\..\gui\Dialog.hxx">
</File>
<File
RelativePath="..\..\gui\DialogContainer.hxx">
</File>
<File
RelativePath="..\..\emucore\Driving.hxx">
</File>
@ -391,6 +490,12 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\EventHandler.hxx">
</File>
<File
RelativePath="..\..\gui\EventMappingDialog.hxx">
</File>
<File
RelativePath="..\..\gui\FontData.hxx">
</File>
<File
RelativePath="..\..\emucore\FrameBuffer.hxx">
</File>
@ -398,10 +503,25 @@ opengl32.lib"
RelativePath="..\..\common\FrameBufferGL.hxx">
</File>
<File
RelativePath="..\..\common\FrameBufferSDL.hxx">
RelativePath="..\..\common\FrameBufferSoft.hxx">
</File>
<File
RelativePath="..\..\common\FrameBufferSoft.hxx">
RelativePath="..\..\emucore\FSNode.hxx">
</File>
<File
RelativePath="..\..\gui\GameInfoDialog.hxx">
</File>
<File
RelativePath="..\..\gui\GameList.hxx">
</File>
<File
RelativePath="..\..\gui\GuiObject.hxx">
</File>
<File
RelativePath="..\..\gui\GuiUtils.hxx">
</File>
<File
RelativePath="..\..\gui\HelpDialog.hxx">
</File>
<File
RelativePath="..\..\emucore\Joystick.hxx">
@ -409,6 +529,18 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\Keyboard.hxx">
</File>
<File
RelativePath="..\..\gui\Launcher.hxx">
</File>
<File
RelativePath="..\..\gui\LauncherDialog.hxx">
</File>
<File
RelativePath="..\..\gui\LauncherOptionsDialog.hxx">
</File>
<File
RelativePath="..\..\gui\ListWidget.hxx">
</File>
<File
RelativePath="..\..\emucore\m6502\src\M6502.hxx">
</File>
@ -427,12 +559,30 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\MediaSrc.hxx">
</File>
<File
RelativePath="..\..\gui\Menu.hxx">
</File>
<File
RelativePath="..\..\emucore\m6502\src\NullDev.hxx">
</File>
<File
RelativePath="..\..\gui\OptionsDialog.hxx">
</File>
<File
RelativePath="..\..\emucore\OSystem.hxx">
</File>
<File
RelativePath="..\OSystemWin32.hxx">
</File>
<File
RelativePath="..\..\emucore\Paddles.hxx">
</File>
<File
RelativePath="..\..\gui\PopUpWidget.hxx">
</File>
<File
RelativePath="..\..\gui\ProgressDialog.hxx">
</File>
<File
RelativePath="..\..\emucore\Props.hxx">
</File>
@ -442,6 +592,9 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\Random.hxx">
</File>
<File
RelativePath="..\..\gui\ScrollBarWidget.hxx">
</File>
<File
RelativePath="..\..\emucore\Serializer.hxx">
</File>
@ -457,24 +610,51 @@ opengl32.lib"
<File
RelativePath="..\..\emucore\Sound.hxx">
</File>
<File
RelativePath="..\..\common\SoundNull.hxx">
</File>
<File
RelativePath="..\..\common\SoundSDL.hxx">
</File>
<File
RelativePath="..\..\gui\Stack.hxx">
</File>
<File
RelativePath="..\..\emucore\StellaEvent.hxx">
</File>
<File
RelativePath="..\..\gui\StellaFont.hxx">
</File>
<File
RelativePath="..\..\gui\StringList.hxx">
</File>
<File
RelativePath="..\..\emucore\Switches.hxx">
</File>
<File
RelativePath="..\..\emucore\m6502\src\System.hxx">
</File>
<File
RelativePath="..\..\gui\TabWidget.hxx">
</File>
<File
RelativePath="..\..\emucore\TIA.hxx">
</File>
<File
RelativePath="..\..\emucore\TIASound.h">
</File>
<File
RelativePath="..\..\emucore\unzip.h">
</File>
<File
RelativePath="..\..\common\Version.hxx">
</File>
<File
RelativePath="..\..\gui\VideoDialog.hxx">
</File>
<File
RelativePath="..\..\gui\Widget.hxx">
</File>
</Filter>
<Filter
Name="Resource Files"

View File

@ -1,8 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StellaX", "StellaX\StellaX.vcproj", "{EB852944-92EA-4A83-B13F-E800ADA48A4D}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Stella", "Stella\Stella.vcproj", "{45875C96-4084-4C54-B570-FC92F8791A2F}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
@ -13,10 +9,6 @@ Global
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{EB852944-92EA-4A83-B13F-E800ADA48A4D}.Debug.ActiveCfg = Debug|Win32
{EB852944-92EA-4A83-B13F-E800ADA48A4D}.Debug.Build.0 = Debug|Win32
{EB852944-92EA-4A83-B13F-E800ADA48A4D}.Release.ActiveCfg = Release|Win32
{EB852944-92EA-4A83-B13F-E800ADA48A4D}.Release.Build.0 = Release|Win32
{45875C96-4084-4C54-B570-FC92F8791A2F}.Debug.ActiveCfg = Debug|Win32
{45875C96-4084-4C54-B570-FC92F8791A2F}.Debug.Build.0 = Debug|Win32
{45875C96-4084-4C54-B570-FC92F8791A2F}.Release.ActiveCfg = Release|Win32