My first attempt at compiling Stella under an x86_64 system with gcc 4.0.

System is Fedore Core 4 test 3.  There were surprisingly few issues,
considering I've never used 64bit mode before.  Thanks to Brian Watson
for initially pointing out potential problems.

Fixed some 32/64 bit pointer to int problems.  Fixed some C++ warnings,
since gcc 4.0 is much stricter about that type of thing.

Made the GUI scrollbar move two lines at a time when using the mouse
scrollwheel.

Now I have to see if this broke anything in 32bit mode.  Note that sound
is a bit scratchy under this distro, and seeing how it's on the same
hardware (as the 32bit development box) I don't know what could be happening.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@434 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-05-21 16:12:13 +00:00
parent 628a1e53ab
commit 0572e86e9e
7 changed files with 64 additions and 49 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: EventHandler.cxx,v 1.58 2005-05-19 18:42:37 stephena Exp $
// $Id: EventHandler.cxx,v 1.59 2005-05-21 16:12:12 stephena Exp $
//============================================================================
#include <algorithm>
@ -1355,10 +1355,10 @@ Event::Type EventHandler::Paddle_Button[4] = {
#ifdef JOYSTICK_SUPPORT
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Event::Type EventHandler::SA_Axis[2][2][3] = {
Event::JoystickZeroLeft, Event::JoystickZeroRight, Event::PaddleZeroResistance,
Event::JoystickZeroUp, Event::JoystickZeroDown, Event::PaddleOneResistance,
Event::JoystickOneLeft, Event::JoystickOneRight, Event::PaddleTwoResistance,
Event::JoystickOneUp, Event::JoystickOneDown, Event::PaddleThreeResistance
{ {Event::JoystickZeroLeft, Event::JoystickZeroRight, Event::PaddleZeroResistance},
{Event::JoystickZeroUp, Event::JoystickZeroDown, Event::PaddleOneResistance } },
{ {Event::JoystickOneLeft, Event::JoystickOneRight, Event::PaddleTwoResistance},
{Event::JoystickOneUp, Event::JoystickOneDown, Event::PaddleThreeResistance} }
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: OSystem.cxx,v 1.18 2005-05-18 22:35:36 stephena Exp $
// $Id: OSystem.cxx,v 1.19 2005-05-21 16:12:13 stephena Exp $
//============================================================================
#include <cassert>
@ -275,7 +275,7 @@ bool OSystem::createConsole(const string& romfile)
// Open the cartridge image and read it in
uInt8* image;
int size;
int size = -1;
if(openROM(myRomFile, &image, &size))
{
delete myConsole; myConsole = NULL;
@ -284,9 +284,6 @@ bool OSystem::createConsole(const string& romfile)
// The Console c'tor takes care of updating the eventhandler state
myConsole = new Console(image, size, this);
// Free the image since we don't need it any longer
delete[] image;
if(showmessage)
myFrameBuffer->showMessage("New console created");
if(mySettings->getBool("showinfo"))
@ -303,6 +300,10 @@ bool OSystem::createConsole(const string& romfile)
retval = false;
}
// Free the image since we don't need it any longer
if(size != -1)
delete[] image;
return retval;
}

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: TIA.cxx,v 1.41 2005-05-06 22:50:15 stephena Exp $
// $Id: TIA.cxx,v 1.42 2005-05-21 16:12:13 stephena Exp $
//============================================================================
#include <cassert>
@ -21,6 +21,8 @@
#include <cstring>
#include <iostream>
#include <inttypes.h>
#include "Console.hxx"
#include "Control.hxx"
#include "M6502.hxx"
@ -1098,7 +1100,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
uInt32* mask = &myCurrentPFMask[hpos];
// Update a uInt8 at a time until reaching a uInt32 boundary
for(; ((int)myFramePointer & 0x03) && (myFramePointer < ending);
for(; ((uintptr_t)myFramePointer & 0x03) && (myFramePointer < ending);
++myFramePointer, ++mask)
{
*myFramePointer = (myPF & *mask) ? myCOLUPF : myCOLUBK;
@ -1119,7 +1121,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
uInt32* mask = &myCurrentPFMask[hpos];
// Update a uInt8 at a time until reaching a uInt32 boundary
for(; ((int)myFramePointer & 0x03) && (myFramePointer < ending);
for(; ((uintptr_t)myFramePointer & 0x03) && (myFramePointer < ending);
++myFramePointer, ++mask, ++hpos)
{
*myFramePointer = (myPF & *mask) ?
@ -1146,7 +1148,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP0)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP0)
{
*(uInt32*)myFramePointer = myCOLUBK;
mP0 += 4; myFramePointer += 4;
@ -1170,7 +1172,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP1)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP1)
{
*(uInt32*)myFramePointer = myCOLUBK;
mP1 += 4; myFramePointer += 4;
@ -1195,7 +1197,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP0 &&
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP0 &&
!*(uInt32*)mP1)
{
*(uInt32*)myFramePointer = myCOLUBK;
@ -1225,7 +1227,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mM0)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mM0)
{
*(uInt32*)myFramePointer = myCOLUBK;
mM0 += 4; myFramePointer += 4;
@ -1249,7 +1251,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mM1)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mM1)
{
*(uInt32*)myFramePointer = myCOLUBK;
mM1 += 4; myFramePointer += 4;
@ -1273,7 +1275,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mBL)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mBL)
{
*(uInt32*)myFramePointer = myCOLUBK;
mBL += 4; myFramePointer += 4;
@ -1298,7 +1300,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mM0 && !*(uInt32*)mM1)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mM0 && !*(uInt32*)mM1)
{
*(uInt32*)myFramePointer = myCOLUBK;
mM0 += 4; mM1 += 4; myFramePointer += 4;
@ -1325,7 +1327,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mBL && !*(uInt32*)mM0)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mBL && !*(uInt32*)mM0)
{
*(uInt32*)myFramePointer = myCOLUBK;
mBL += 4; mM0 += 4; myFramePointer += 4;
@ -1352,7 +1354,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mBL && !*(uInt32*)mM0)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mBL && !*(uInt32*)mM0)
{
*(uInt32*)myFramePointer = myCOLUBK;
mBL += 4; mM0 += 4; myFramePointer += 4;
@ -1379,7 +1381,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mBL &&
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mBL &&
!*(uInt32*)mM1)
{
*(uInt32*)myFramePointer = myCOLUBK;
@ -1407,7 +1409,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mBL &&
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mBL &&
!*(uInt32*)mM1)
{
*(uInt32*)myFramePointer = myCOLUBK;
@ -1435,7 +1437,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP1 && !*(uInt32*)mBL)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP1 && !*(uInt32*)mBL)
{
*(uInt32*)myFramePointer = myCOLUBK;
mBL += 4; mP1 += 4; myFramePointer += 4;
@ -1463,7 +1465,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP1 && !*(uInt32*)mBL)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP1 && !*(uInt32*)mBL)
{
*(uInt32*)myFramePointer = myCOLUBK;
mBL += 4; mP1 += 4; myFramePointer += 4;
@ -1490,7 +1492,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP0)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP0)
{
*(uInt32*)myFramePointer = (myPF & *mPF) ? myCOLUPF : myCOLUBK;
mPF += 4; mP0 += 4; myFramePointer += 4;
@ -1518,7 +1520,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP0)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP0)
{
*(uInt32*)myFramePointer = (myPF & *mPF) ? myCOLUPF : myCOLUBK;
mPF += 4; mP0 += 4; myFramePointer += 4;
@ -1546,7 +1548,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP1)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP1)
{
*(uInt32*)myFramePointer = (myPF & *mPF) ? myCOLUPF : myCOLUBK;
mPF += 4; mP1 += 4; myFramePointer += 4;
@ -1574,7 +1576,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mP1)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mP1)
{
*(uInt32*)myFramePointer = (myPF & *mPF) ? myCOLUPF : myCOLUBK;
mPF += 4; mP1 += 4; myFramePointer += 4;
@ -1603,7 +1605,7 @@ inline void TIA::updateFrameScanline(uInt32 clocksToUpdate, uInt32 hpos)
while(myFramePointer < ending)
{
if(!((int)myFramePointer & 0x03) && !*(uInt32*)mBL)
if(!((uintptr_t)myFramePointer & 0x03) && !*(uInt32*)mBL)
{
*(uInt32*)myFramePointer = (myPF & *mPF) ? myCOLUPF : myCOLUBK;
mPF += 4; mBL += 4; myFramePointer += 4;

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: Command.hxx,v 1.2 2005-05-13 18:28:05 stephena Exp $
// $Id: Command.hxx,v 1.3 2005-05-21 16:12:13 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -28,7 +28,7 @@
Allows base GUI objects to send and receive commands.
@author Stephen Anthony
@version $Id: Command.hxx,v 1.2 2005-05-13 18:28:05 stephena Exp $
@version $Id: Command.hxx,v 1.3 2005-05-21 16:12:13 stephena Exp $
*/
class CommandReceiver;
class CommandSender;
@ -37,6 +37,9 @@ class CommandReceiver
{
friend class CommandSender;
public:
virtual ~CommandReceiver() {}
protected:
virtual void handleCommand(CommandSender* sender, int cmd, int data) {}
};
@ -49,6 +52,8 @@ class CommandSender
CommandSender(CommandReceiver* target)
: _target(target) {}
virtual ~CommandSender() {}
void setTarget(CommandReceiver* target) { _target = target; }
CommandReceiver* getTarget() const { return _target; }

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: GuiObject.hxx,v 1.8 2005-05-14 03:26:29 stephena Exp $
// $Id: GuiObject.hxx,v 1.9 2005-05-21 16:12:13 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -33,7 +33,7 @@ class Widget;
This is the base class for all GUI objects/widgets.
@author Stephen Anthony
@version $Id: GuiObject.hxx,v 1.8 2005-05-14 03:26:29 stephena Exp $
@version $Id: GuiObject.hxx,v 1.9 2005-05-21 16:12:13 stephena Exp $
*/
class GuiObject : public CommandReceiver
{
@ -50,6 +50,8 @@ class GuiObject : public CommandReceiver
_h(h),
_firstWidget(0) { }
virtual ~GuiObject() { }
OSystem* instance() { return myOSystem; }
DialogContainer* parent() { return myParent; }

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: LauncherDialog.cxx,v 1.15 2005-05-17 18:42:23 stephena Exp $
// $Id: LauncherDialog.cxx,v 1.16 2005-05-21 16:12:13 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -322,16 +322,16 @@ void LauncherDialog::createListCache()
string LauncherDialog::MD5FromFile(const string& path)
{
uInt8* image;
int size;
int size = -1;
string md5 = "";
if(instance()->openROM(path, &image, &size))
{
string md5 = MD5(image, size);
md5 = MD5(image, size);
if(size != -1)
delete[] image;
return md5;
}
else
return "";
return md5;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -348,9 +348,13 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, int data)
if(item >= 0)
{
string s = myList->getSelectedString();
instance()->createConsole(myGameList->rom(item));
instance()->settings().setString("lastrom", s);
close();
// Make sure the console creation actually succeeded
if(instance()->createConsole(myGameList->rom(item)))
{
instance()->settings().setString("lastrom", s);
close();
}
}
break;

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: ScrollBarWidget.cxx,v 1.4 2005-05-13 18:28:06 stephena Exp $
// $Id: ScrollBarWidget.cxx,v 1.5 2005-05-21 16:12:13 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -36,6 +36,7 @@
*/
#define UP_DOWN_BOX_HEIGHT 10
#define WHEEL_LINES 2
// Up arrow
static unsigned int up_arrow[8] = {
@ -136,9 +137,9 @@ void ScrollBarWidget::handleMouseWheel(int x, int y, int direction)
return;
if(direction < 0)
_currentPos--;
_currentPos -= WHEEL_LINES;
else
_currentPos++;
_currentPos += WHEEL_LINES;
// Make sure that _currentPos is still inside the bounds
checkBounds(old_pos);