Commit 1ec18c1d authored by Stephen Kitt's avatar Stephen Kitt

Imported Upstream version 3.6

parent 48a120f8
......@@ -9,7 +9,7 @@
SSSS ttt eeeee llll llll aaaaa
===========================================================================
Release 3.5.5 for Linux, MacOSX and Windows
Release 3.6 for Linux, MacOSX and Windows
===========================================================================
The Atari 2600 Video Computer System (VCS), introduced in 1977, was the
......@@ -21,31 +21,31 @@ all of your favourite Atari 2600 games again! Stella was originally
developed for Linux by Bradford W. Mott, however, it has been ported to a
number of other platforms and is currently maintained by Stephen Anthony.
This is the 3.5.5 release of Stella for Linux, Mac OSX and Windows. The
This is the 3.6 release of Stella for Linux, Mac OSX and Windows. The
distributions currently available are:
* Binaries for Windows XP/Vista/7 :
Stella-3.5.5-win32.exe (32-bit EXE installer)
Stella-3.5.5-x64.exe (64-bit EXE installer)
Stella-3.5.5-windows.zip (32/64 bit versions)
Stella-3.6-win32.exe (32-bit EXE installer)
Stella-3.6-x64.exe (64-bit EXE installer)
Stella-3.6-windows.zip (32/64 bit versions)
* Binaries for Windows 98/2000 :
Stella-3.5.5_98_2k-windows.zip (32-bit for Windows 98/2000)
Stella-3.6_98_2k-windows.zip (32-bit for Windows 98/2000)
* Binary distribution for MacOSX 32-bit & 64-bit :
Stella-3.5.5-macosx.dmg (32-bit Universal Binary)
Stella-3.5.5_intel_10.6-macosx.dmg (32/64-bit Intel/Snow-Leopard only)
Stella-3.6-macosx.dmg (32-bit Universal Binary)
Stella-3.6_intel-macosx.dmg (32/64-bit Intel/OSX 10.6+)
* Binary distribution in 32-bit & 64-bit Ubuntu DEB format :
stella_3.5.5-1_i386.deb
stella_3.5.5-1_amd64.deb
stella_3.6-1_i386.deb
stella_3.6-1_amd64.deb
* Binary distribution in 32-bit & 64-bit RPM format :
stella-3.5.5-2.i386.rpm
stella-3.5.5-2.x86_64.rpm
stella-3.6-2.i386.rpm
stella-3.6-2.x86_64.rpm
* Source code distribution for all platforms :
stella-3.5.5-src.tar.gz
stella-3.6-src.tar.gz
PLEASE DO NOT WRITE ASKING FOR ROM IMAGES TO USE WITH STELLA! ALL SUCH
REQUESTS WILL BE IGNORED!
......
......@@ -12,6 +12,37 @@
Release History
===========================================================================
3.5.5 to 3.6: (March 16, 2012)
* Added support for 2600-daptor II device, including native support
for 7800 controllers, BoosterGrip and Keypad controllers. Special
thanks go to Tom Hafner for a complimentary test sample of this
device, and also for donating a BoosterGrip controller.
* Added ability to dynamically swap the port order of Stelladaptor/
2600-daptor devices with the 'Control-1' key combo (useful if you
have only one 2600-daptor and want to use it as a left port
normally, but as a right port for Star Raiders, etc).
* Added CompuMate bankswitching/controller support to the emulation
core; the Spectravideo CompuMate ROMs (NTSC and PAL) now work.
Frequently used keys on the CompuMate are directly mapped to your
keyboard (ie, Func-Space for backspace is mapped to Backspace, etc).
Loading/saving from the cassette player is not yet supported, and
will come in a future release.
* Fixed bug in BoosterGrip controller emulation; the functionality
of the booster and trigger buttons was reversed. Related to this,
renamed these actions in the Event Mapping dialog to be more clear.
* Reverted to SDL 1.2.14 for the Windows 98/2k release, since SDL
1.2.15 isn't supported in that environment.
* Updated included PNG library to latest stable version.
-Have fun!
3.5 to 3.5.5: (February 4, 2012)
* Due to changes in the debugger, old state files will not work with
......@@ -71,8 +102,6 @@
* Updated included PNG library to latest stable version.
-Have fun!
3.4.1 to 3.5: (December 29, 2011)
......
......@@ -12,7 +12,7 @@
License Information and Copyright Notice
===========================================================================
Copyright (C) 1995-2010 Bradford W. Mott, Stephen Anthony and the
Copyright (C) 1995-2012 Bradford W. Mott, Stephen Anthony and the
Stella Team
This program is free software; you can redistribute it and/or modify it
......
......@@ -95,7 +95,8 @@ MODULES := $(MODULES)
MODULES += \
src/emucore \
src/gui \
src/common
src/common \
src/common/tv_filters
######################################################################
# The build rules follow - normally you should have no need to
......
This is release 3.5.5 of Stella. Stella is a multi-platform Atari 2600 VCS
This is release 3.6 of Stella. Stella is a multi-platform Atari 2600 VCS
emulator which allows you to play all of your favourite Atari 2600 games
on your PC. You'll find the Stella Users Manual in the docs subdirectory.
If you'd like to verify that you have the latest release of Stella visit
......@@ -9,4 +9,4 @@ the Stella Website at:
Enjoy,
The Stella Team
February 4, 2012
March 16, 2012
......@@ -737,6 +737,7 @@ find_sdlconfig
SRC="src"
CORE="$SRC/emucore"
COMMON="$SRC/common"
TV="$SRC/common/tv_filters"
GUI="$SRC/gui"
DBG="$SRC/debugger"
DBGGUI="$SRC/debugger/gui"
......@@ -745,7 +746,7 @@ CHEAT="$SRC/cheat"
LIBPNG="$SRC/libpng"
ZLIB="$SRC/zlib"
INCLUDES="-I$CORE -I$COMMON -I$GUI"
INCLUDES="-I$CORE -I$COMMON -I$TV -I$GUI"
INCLUDES="$INCLUDES `$_sdlconfig --cflags`"
if test "$_build_static" = yes ; then
......
stella (3.6-1) stable; urgency=high
* Version 3.6 release
-- Stephen Anthony <stephena@users.sf.net> Fri, 16 Mar 2012 18:38:25 +0200
stella (3.5.5-1) stable; urgency=high
* Version 3.5.5 release
......
This diff is collapsed.
......@@ -14,12 +14,14 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: StellaKeys.hxx 2356 2012-01-14 22:00:54Z stephena $
// $Id: StellaKeys.hxx 2423 2012-03-16 21:02:01Z stephena $
//============================================================================
#ifndef STELLA_KEYS_HXX
#define STELLA_KEYS_HXX
#include <SDL.h>
/**
This class implements a thin wrapper around the SDL keysym enumerations,
such that SDL-specific code doesn't have to go into the internal parts of
......@@ -310,4 +312,16 @@ typedef enum {
// The underlying code doesn't need to know how it's implemented
typedef int StellaMod;
// Wrapper around the SDL_GetKeyState function
// This can be used as-is since KBDK keys and SDL keys are the same
class StellaKeys
{
public:
static uInt8* GetKeyState()
{
SDL_PumpEvents();
return SDL_GetKeyState(NULL);
}
};
#endif /* StellaKeys */
......@@ -14,7 +14,7 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Version.hxx 2384 2012-02-04 20:07:13Z stephena $
// $Id: Version.hxx 2423 2012-03-16 21:02:01Z stephena $
//============================================================================
#ifndef VERSION_HXX
......@@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "3.5.5"
#define STELLA_BUILD atoi("$Rev: 2384 $" + 6)
#define STELLA_VERSION "3.6"
#define STELLA_BUILD atoi("$Rev: 2423 $" + 6)
#endif
This diff is collapsed.
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-2012 by Bradford W. Mott, Stephen Anthony
// and the Stella Team
//
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: NTSCFilter.hxx 2396 2012-02-26 20:11:59Z stephena $
//============================================================================
#ifndef NTSC_FILTER_HXX
#define NTSC_FILTER_HXX
#include "bspf.hxx"
#include "Array.hxx"
#include "atari_ntsc.h"
// Limits for the adjustable values.
#define FILTER_NTSC_SHARPNESS_MIN -1.0
#define FILTER_NTSC_SHARPNESS_MAX 1.0
#define FILTER_NTSC_RESOLUTION_MIN -1.0
#define FILTER_NTSC_RESOLUTION_MAX 1.0
#define FILTER_NTSC_ARTIFACTS_MIN -1.0
#define FILTER_NTSC_ARTIFACTS_MAX 1.0
#define FILTER_NTSC_FRINGING_MIN -1.0
#define FILTER_NTSC_FRINGING_MAX 1.0
#define FILTER_NTSC_BLEED_MIN -1.0
#define FILTER_NTSC_BLEED_MAX 1.0
#define FILTER_NTSC_BURST_PHASE_MIN -1.0
#define FILTER_NTSC_BURST_PHASE_MAX 1.0
/**
This class is based on the Blargg NTSC filter code from Atari800,
and is derived from 'filter_ntsc.(h|c)'.
Original code based on implementation from http://www.slack.net/~ant.
Atari TIA NTSC composite video to RGB emulator/blitter.
*/
class NTSCFilter
{
public:
NTSCFilter();
virtual ~NTSCFilter();
/* Set/get one of the available preset adjustments: Composite, S-Video, RGB,
Monochrome. */
enum {
PRESET_COMPOSITE,
PRESET_SVIDEO,
PRESET_RGB,
PRESET_MONOCHROME,
PRESET_CUSTOM,
/* Number of "normal" (not including CUSTOM) values in enumerator */
PRESET_SIZE = PRESET_CUSTOM
};
public:
/* Informs the NTSC filter about the current TIA palette. The filter
uses this as a baseline for calculating its own internal palette
in YIQ format.
*/
void setTIAPalette(const uInt32* palette);
/* Restores default values for NTSC-filter-specific colour controls.
updateFilter should be called afterwards to apply changes. */
void restoreDefaults();
/* updateFilter should be called afterwards these functions to apply changes. */
void setPreset(int preset);
int getPreset();
void nextPreset();
#if 0 // FIXME
/* Read/write to configuration file. */
int FILTER_NTSC_ReadConfig(char *option, char *ptr);
void FILTER_NTSC_WriteConfig(FILE *fp);
/* NTSC filter initialisation and processing of command-line arguments. */
int FILTER_NTSC_Initialise(int *argc, char *argv[]);
#endif
private:
/* Reinitialises the an NTSC filter. Should be called after changing
palette setup or loading/unloading an external palette. */
void updateFilter();
// The following function is originally from colours_ntsc.
/* Creates YIQ_TABLE from external palette. START_ANGLE and START_SATURATIION
are provided as parameters, because NTSC_FILTER needs to set these values
according to its internal setup (burst_phase etc).
*/
void updateYIQTable(double yiq_table[768], double start_angle);
private:
// Pointer to the NTSC filter structure
atari_ntsc_t myFilter;
// Contains controls used to adjust the palette in the NTSC filter
atari_ntsc_setup_t mySetup;
uInt8 myTIAPalette[384]; // 128 colours by 3 components per colour
int myCurrentModeNum;
Common::Array<atari_ntsc_setup_t> myModeList;
static atari_ntsc_setup_t const * const presets[PRESET_SIZE];
static char const * const preset_cfg_strings[PRESET_SIZE];
};
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
MODULE := src/common/tv_filters
MODULE_OBJS := \
src/common/tv_filters/NTSCFilter.o \
src/common/tv_filters/atari_ntsc.o
MODULE_DIRS += \
src/common/tv_filters
# Include common rules
include $(srcdir)/common.rules
......@@ -14,7 +14,7 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: DiStella.cxx 2371 2012-01-29 17:08:51Z stephena $
// $Id: DiStella.cxx 2417 2012-03-16 13:19:29Z stephena $
//============================================================================
#include "bspf.hxx"
......@@ -818,7 +818,7 @@ int DiStella::mark(uInt32 address, uInt8 mask, bool directive)
if(directive) myDirectives[address-myOffset] = mask;
return 1;
}
else if (address >= 0 && address <= 0x3f)
else if (address <= 0x3f)
{
return 2;
}
......
......@@ -14,7 +14,7 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: DataGridWidget.cxx 2356 2012-01-14 22:00:54Z stephena $
// $Id: DataGridWidget.cxx 2417 2012-03-16 13:19:29Z stephena $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
......@@ -637,7 +637,7 @@ void DataGridWidget::startEditMode()
if (_editable && !_editMode && _selectedItem >= 0)
{
_editMode = true;
setEditString(""); // Erase current entry when starting editing
setEditString("", true ); // Erase current entry when starting editing
}
}
......
......@@ -14,7 +14,7 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Booster.cxx 2373 2012-01-29 18:44:45Z stephena $
// $Id: Booster.cxx 2405 2012-03-04 19:20:29Z stephena $
//============================================================================
#include "Event.hxx"
......@@ -31,9 +31,9 @@ BoosterGrip::BoosterGrip(Jack jack, const Event& event, const System& system)
myDownEvent = Event::JoystickZeroDown;
myLeftEvent = Event::JoystickZeroLeft;
myRightEvent = Event::JoystickZeroRight;
myFireEvent = Event::JoystickZeroFire1;
myTriggerEvent = Event::JoystickZeroFire2;
myBoosterEvent = Event::JoystickZeroFire3;
myFireEvent = Event::JoystickZeroFire;
myTriggerEvent = Event::JoystickZeroFire5;
myBoosterEvent = Event::JoystickZeroFire9;
myXAxisValue = Event::SALeftAxis0Value;
myYAxisValue = Event::SALeftAxis1Value;
}
......@@ -43,9 +43,9 @@ BoosterGrip::BoosterGrip(Jack jack, const Event& event, const System& system)
myDownEvent = Event::JoystickOneDown;
myLeftEvent = Event::JoystickOneLeft;
myRightEvent = Event::JoystickOneRight;
myFireEvent = Event::JoystickOneFire1;
myTriggerEvent = Event::JoystickOneFire2;
myBoosterEvent = Event::JoystickOneFire3;
myFireEvent = Event::JoystickOneFire;
myTriggerEvent = Event::JoystickOneFire5;
myBoosterEvent = Event::JoystickOneFire9;
myXAxisValue = Event::SARightAxis0Value;
myYAxisValue = Event::SARightAxis1Value;
}
......@@ -68,9 +68,9 @@ void BoosterGrip::update()
// The CBS Booster-grip has two more buttons on it. These buttons are
// connected to the inputs usually used by paddles.
myAnalogPinValue[Five] = (myEvent.get(myBoosterEvent) != 0) ?
myAnalogPinValue[Five] = (myEvent.get(myTriggerEvent) != 0) ?
minimumResistance : maximumResistance;
myAnalogPinValue[Nine] = (myEvent.get(myTriggerEvent) != 0) ?
myAnalogPinValue[Nine] = (myEvent.get(myBoosterEvent) != 0) ?
minimumResistance : maximumResistance;
// Axis events (usually generated by the Stelladaptor)
......@@ -121,9 +121,10 @@ void BoosterGrip::update()
}
}
// Get mouse button state
if(myEvent.get(Event::MouseButtonLeftValue) ||
myEvent.get(Event::MouseButtonRightValue))
if(myEvent.get(Event::MouseButtonLeftValue))
myDigitalPinState[Six] = false;
if(myEvent.get(Event::MouseButtonRightValue))
myAnalogPinValue[Nine] = minimumResistance;
}
}
......
......@@ -14,7 +14,7 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Cart.cxx 2361 2012-01-21 13:11:08Z stephena $
// $Id: Cart.cxx 2410 2012-03-12 20:45:24Z stephena $
//============================================================================
#include <cassert>
......@@ -641,14 +641,17 @@ bool Cartridge::isProbablyEF(const uInt8* image, uInt32 size)
// EF cart bankswitching switches banks by accessing addresses 0xFE0
// to 0xFEF, usually with either a NOP or LDA
// It's likely that the code will switch to bank 0, so that's what is tested
uInt8 signature[2][3] = {
uInt8 signature[4][3] = {
{ 0x0C, 0xE0, 0xFF }, // NOP $FFE0
{ 0xAD, 0xE0, 0xFF } // LDA $FFE0
{ 0xAD, 0xE0, 0xFF }, // LDA $FFE0
{ 0x0C, 0xE0, 0x1F }, // NOP $1FE0
{ 0xAD, 0xE0, 0x1F } // LDA $1FE0
};
if(searchForBytes(image, size, signature[0], 3, 1))
return true;
else
return searchForBytes(image, size, signature[1], 3, 1);
for(uInt32 i = 0; i < 4; ++i)
if(searchForBytes(image, size, signature[i], 3, 1))
return true;
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......
......@@ -14,13 +14,14 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: CartCM.cxx 2325 2012-01-02 20:31:42Z stephena $
// $Id: CartCM.cxx 2414 2012-03-15 15:22:57Z stephena $
//============================================================================
#include <cassert>
#include <cstring>
#include "System.hxx"
#include "M6532.hxx"
#include "CartCM.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......@@ -30,6 +31,15 @@ CartridgeCM::CartridgeCM(const uInt8* image, uInt32 size, const Settings& settin
// Copy the ROM image into my buffer
memcpy(myImage, image, BSPF_min(16384u, size));
createCodeAccessBase(16384);
// This cart contains 2048 bytes extended RAM @ 0x1800
// This RAM scheme is unique in that it doesn't require separate read/write ports
registerRamArea(0x1800, 2048, 0x00, 0x00);
// On powerup, portA is all 1's, so the last bank of ROM is enabled and
// RAM is disabled
myStartBank = 3;
myRamState = 0x10;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......@@ -40,47 +50,143 @@ CartridgeCM::~CartridgeCM()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCM::reset()
{
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 2048; ++i)
myRAM[i] = mySystem->randGenerator().next();
else
memset(myRAM, 0, 2048);
// Upon reset we switch to the startup bank
bank(myStartBank);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCM::install(System& system)
{
mySystem = &system;
uInt16 mask = mySystem->pageMask();
// Make sure the system we're being installed in has a page size that'll work
assert((0x1000 & mask) == 0);
// Mirror all access in RIOT; by doing so we're taking responsibility
// for that address space in peek and poke below.
mySystem->m6532().install(system, *this);
// Install pages for the startup bank
bank(myStartBank);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 CartridgeCM::peek(uInt16 address)
{
return 0;
// NOTE: This does not handle accessing cart ROM/RAM, however, this function
// should never be called for ROM/RAM because of the way page accessing
// has been setup (it will only ever be called for RIOT reads)
return mySystem->m6532().peek(address);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCM::poke(uInt16 address, uInt8)
bool CartridgeCM::poke(uInt16 address, uInt8 value)
{
return false;
// NOTE: This could be called for RIOT writes or cart ROM writes
// In the latter case, the write is ignored
if(!(address & 0x1000))
{
// RIOT mirroring, check bankswitch
if(address == 0x280)
{
myRamState = value;
bank(myRamState & 0x3);
if(value & 0x20) myColumn = 0;
if(value & 0x40) myColumn = (myColumn + 1) % 10;
}
mySystem->m6532().poke(address, value);
}
return myBankChanged;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCM::bank(uInt16 bank)
{
return false;
{
if(bankLocked()) return false;
// Remember what bank we're in
myCurrentBank = bank;
uInt16 offset = myCurrentBank << 12;
uInt16 shift = mySystem->pageShift();
// Although this scheme contains four 4K ROM banks and one 2K RAM bank,
// it's easier to think of things in terms of 2K slices, as follows:
//
// The lower 2K of cart address space always points to the lower 2K of the
// current ROM bank
// The upper 2K of cart address space can point to either the 2K of RAM or
// the upper 2K of the current ROM bank
System::PageAccess access(0, 0, 0, this, System::PA_READ);
// Lower 2K (always ROM)
for(uInt32 address = 0x1000; address < 0x1800; address += (1 << shift))
{
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[offset + (address & 0x0FFF)];
mySystem->setPageAccess(address >> shift, access);
}
// Upper 2K (RAM or ROM)
for(uInt32 address = 0x1800; address < 0x2000; address += (1 << shift))
{
access.type = System::PA_READWRITE;
if(myRamState & 0x10)
{
access.directPeekBase = &myImage[offset + (address & 0x0FFF)];
access.codeAccessBase = &myCodeAccessBase[offset + (address & 0x0FFF)];
}
else
{
access.directPeekBase = &myRAM[address & 0x7FF];
access.codeAccessBase = &myCodeAccessBase[offset + (address & 0x07FF)];
}
if((myRamState & 0x30) == 0x20)
access.directPokeBase = &myRAM[address & 0x7FF];
else
access.directPokeBase = 0;
mySystem->setPageAccess(address >> shift, access);
}
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt16 CartridgeCM::bank() const
{
return 0;
return myCurrentBank;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt16 CartridgeCM::bankCount() const
{
// We report 4 banks (of ROM), even though RAM can overlap the upper 2K
// of cart address space at some times
// However, this RAM isn't enabled in the normal way that bankswitching
// works, so it is ignored here
return 4;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCM::patch(uInt16 address, uInt8 value)
{
return false;
if((myRamState & 0x30) == 0x20)
myRAM[address & 0x7FF] = value;
else
myImage[(myCurrentBank << 12) + address] = value;
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
......@@ -93,11 +199,53 @@ const uInt8* CartridgeCM::getImage(int& size) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCM::save(Serializer& out) const
{
return false;
try
{
out.putString(name());
out.putInt(myCurrentBank);
out.putByte(myRamState);
out.putByte(myColumn);
// The 2048 bytes of RAM
out.putInt(2048);
for(uInt32 i = 0; i < 2048; ++i)
out.putByte((char)myRAM[i]);
}
catch(const char* msg)
{
cerr << "ERROR: CartridgeCM::save" << endl << " " << msg << endl;
return false;
}
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCM::load(Serializer& in)
{
return false;
try
{
if(in.getString() != name())
return false;
myCurrentBank = (uInt16) in.getInt();
myRamState = (uInt8) in.getByte();
myColumn = (uInt8) in.getByte();
// The 2048 bytes of RAM
uInt32 limit = (uInt32) in.getInt();
for(uInt32 i = 0; i < limit; ++i)
myRAM[i] = (uInt8) in.getByte();
}
catch(const char* msg)
{
cerr << "ERROR: CartridgeCM::load" << endl << " " << msg << endl;
return false;
}
// Remember what bank we were in
bank(myCurrentBank);
return true;
}
......@@ -14,7 +14,7 @@
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: CartCM.hxx 2325 2012-01-02 20:31:42Z stephena $
// $Id: CartCM.hxx 2422 2012-03-16 20:31:31Z stephena $
//============================================================================
#ifndef CARTRIDGECM_HXX
......@@ -27,39 +27,81 @@ class System;