mirror of https://github.com/stella-emu/stella.git
First pass at reworking the way auto-detect information is presented to
the user. Previously, the only way to see certain info was at the commandline (a bias on my part, as I always launch Stella from the console and view the output there). Now, we can see bankswitch type and cart display format as part of the 'stats' message in TIA emulation. Reporting this info to the commandline is currently broken. Also todo is start on the cart random startup bank infrastructure, and also show this in the stats message. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1589 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
bbdac2b646
commit
d1379b54bb
|
@ -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: Cart.cxx,v 1.44 2008-11-24 18:02:19 stephena Exp $
|
||||
// $Id: Cart.cxx,v 1.45 2009-01-01 00:08:59 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <cassert>
|
||||
|
@ -73,21 +73,19 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size,
|
|||
|
||||
// Collect some info about the ROM
|
||||
ostringstream buf;
|
||||
buf << " ROM Size: " << size << endl
|
||||
<< " Bankswitch Type: " << type;
|
||||
|
||||
// See if we should try to auto-detect the cartridge type
|
||||
// If we ask for extended info, always do an autodetect
|
||||
if(type == "AUTO-DETECT" || settings.getBool("rominfo"))
|
||||
{
|
||||
string detected = autodetectType(image, size);
|
||||
buf << " ==> " << detected;
|
||||
buf << "AUTO => ";
|
||||
if(type != "AUTO-DETECT" && type != detected)
|
||||
buf << " (auto-detection not consistent)";
|
||||
cerr << "Auto-detection not consistent: " << type << ", " << detected << endl;
|
||||
|
||||
type = detected;
|
||||
}
|
||||
buf << endl;
|
||||
buf << type << " (" << (size/1024) << "K) ";
|
||||
myAboutString = buf.str();
|
||||
|
||||
// We should know the cart's type by now so let's create it
|
||||
|
|
|
@ -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: Console.cxx,v 1.149 2008-06-20 12:19:42 stephena Exp $
|
||||
// $Id: Console.cxx,v 1.150 2009-01-01 00:08:59 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <cassert>
|
||||
|
@ -126,7 +126,6 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
|
|||
|
||||
// Auto-detect NTSC/PAL mode if it's requested
|
||||
myDisplayFormat = myProperties.get(Display_Format);
|
||||
vidinfo << " Display Format: " << myDisplayFormat;
|
||||
if(myDisplayFormat == "AUTO-DETECT" ||
|
||||
myOSystem->settings().getBool("rominfo"))
|
||||
{
|
||||
|
@ -145,8 +144,9 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
|
|||
}
|
||||
myDisplayFormat = (palCount >= 15) ? "PAL" : "NTSC";
|
||||
if(myProperties.get(Display_Format) == "AUTO-DETECT")
|
||||
vidinfo << " ==> " << myDisplayFormat;
|
||||
myConsoleInfo.DisplayFormat = "AUTO => ";
|
||||
}
|
||||
myConsoleInfo.DisplayFormat += myDisplayFormat;
|
||||
|
||||
// Set up the correct properties used when toggling format
|
||||
// Note that this can be overridden if a format is forced
|
||||
|
@ -178,18 +178,14 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
|
|||
myOSystem->eventHandler().allowAllDirections(allow);
|
||||
|
||||
// Reset the system to its power-on state
|
||||
// TODO - a reset still isn't completely working with Boulderdash
|
||||
mySystem->reset();
|
||||
|
||||
// Finally, show some info about the console
|
||||
about << " Cart Name: " << myProperties.get(Cartridge_Name) << endl
|
||||
<< " Cart MD5: " << myProperties.get(Cartridge_MD5) << endl
|
||||
<< " Controller 0: " << myControllers[0]->about() << endl
|
||||
<< " Controller 1: " << myControllers[1]->about() << endl
|
||||
<< vidinfo.str() << endl
|
||||
<< cart->about();
|
||||
|
||||
myAboutString = about.str();
|
||||
// Finally, add remaining info about the console
|
||||
myConsoleInfo.CartName = myProperties.get(Cartridge_Name);
|
||||
myConsoleInfo.CartMD5 = myProperties.get(Cartridge_MD5);
|
||||
myConsoleInfo.Control0 = myControllers[0]->about();
|
||||
myConsoleInfo.Control1 = myControllers[1]->about();
|
||||
myConsoleInfo.BankSwitch = cart->about();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -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: Console.hxx,v 1.69 2008-05-30 19:07:55 stephena Exp $
|
||||
// $Id: Console.hxx,v 1.70 2009-01-01 00:08:59 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#ifndef CONSOLE_HXX
|
||||
|
@ -35,11 +35,24 @@ class System;
|
|||
#include "AtariVox.hxx"
|
||||
#include "Serializable.hxx"
|
||||
|
||||
/**
|
||||
Contains detailed info about a console.
|
||||
*/
|
||||
struct ConsoleInfo
|
||||
{
|
||||
string BankSwitch;
|
||||
string CartName;
|
||||
string CartMD5;
|
||||
string Control0;
|
||||
string Control1;
|
||||
string DisplayFormat;
|
||||
};
|
||||
|
||||
/**
|
||||
This class represents the entire game console.
|
||||
|
||||
@author Bradford W. Mott
|
||||
@version $Id: Console.hxx,v 1.69 2008-05-30 19:07:55 stephena Exp $
|
||||
@version $Id: Console.hxx,v 1.70 2009-01-01 00:08:59 stephena Exp $
|
||||
*/
|
||||
class Console : public Serializable
|
||||
{
|
||||
|
@ -150,9 +163,9 @@ class Console : public Serializable
|
|||
void setProperties(const Properties& props);
|
||||
|
||||
/**
|
||||
Query some information about this console.
|
||||
Query detailed information about this console.
|
||||
*/
|
||||
const string& about() const { return myAboutString; }
|
||||
inline const ConsoleInfo& about() const { return myConsoleInfo; }
|
||||
|
||||
public:
|
||||
/**
|
||||
|
@ -320,8 +333,8 @@ class Console : public Serializable
|
|||
// successfully loaded
|
||||
bool myUserPaletteDefined;
|
||||
|
||||
// Contains info about this console in string format
|
||||
string myAboutString;
|
||||
// Contains detailed info about this console
|
||||
ConsoleInfo myConsoleInfo;
|
||||
|
||||
// Table of RGB values for NTSC, PAL and SECAM
|
||||
static uInt32 ourNTSCPalette[256];
|
||||
|
|
|
@ -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: FrameBuffer.cxx,v 1.150 2008-12-29 20:42:15 stephena Exp $
|
||||
// $Id: FrameBuffer.cxx,v 1.151 2009-01-01 00:08:59 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -125,8 +125,8 @@ bool FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
|
|||
|
||||
// Create surfaces for TIA statistics and general messages
|
||||
myStatsMsg.color = kBtnTextColor;
|
||||
myStatsMsg.w = myOSystem->consoleFont().getStringWidth("000 LINES %00.00 FPS");
|
||||
myStatsMsg.h = myOSystem->consoleFont().getFontHeight();
|
||||
myStatsMsg.w = myOSystem->consoleFont().getMaxCharWidth() * 21;
|
||||
myStatsMsg.h = (myOSystem->consoleFont().getFontHeight() + 2) * 3;
|
||||
|
||||
if(myStatsMsg.surface == NULL)
|
||||
{
|
||||
|
@ -169,13 +169,18 @@ void FrameBuffer::update()
|
|||
if(myStatsMsg.enabled)
|
||||
{
|
||||
// FIXME - sizes hardcoded for now; fix during UI refactoring
|
||||
const ConsoleInfo& info = myOSystem->console().about();
|
||||
char msg[30];
|
||||
sprintf(msg, "%u LINES %2.2f FPS",
|
||||
myOSystem->console().mediaSource().scanlines(),
|
||||
myOSystem->console().getFramerate());
|
||||
myStatsMsg.surface->fillRect(0, 0, myStatsMsg.w, myStatsMsg.h, kBGColor);
|
||||
myStatsMsg.surface->drawString(&myOSystem->consoleFont(), msg, 1, 1,
|
||||
myStatsMsg.w, myStatsMsg.color, kTextAlignLeft);
|
||||
myStatsMsg.surface->drawString(&myOSystem->consoleFont(),
|
||||
msg, 1, 1, myStatsMsg.w, myStatsMsg.color, kTextAlignLeft);
|
||||
myStatsMsg.surface->drawString(&myOSystem->consoleFont(),
|
||||
info.DisplayFormat, 1, 15, myStatsMsg.w, myStatsMsg.color, kTextAlignLeft);
|
||||
myStatsMsg.surface->drawString(&myOSystem->consoleFont(),
|
||||
info.BankSwitch, 1, 30, myStatsMsg.w, myStatsMsg.color, kTextAlignLeft);
|
||||
myStatsMsg.surface->addDirtyRect(0, 0, 0, 0); // force a full draw
|
||||
myStatsMsg.surface->setPos(myImageRect.x() + 3, myImageRect.y() + 3);
|
||||
myStatsMsg.surface->update();
|
||||
|
|
|
@ -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.136 2008-12-29 20:42:15 stephena Exp $
|
||||
// $Id: OSystem.cxx,v 1.137 2009-01-01 00:08:59 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <cassert>
|
||||
|
@ -412,7 +412,7 @@ bool OSystem::createConsole(const string& romfile, const string& md5sum)
|
|||
if(mySettings->getBool("showinfo"))
|
||||
cout << "Game console created:" << endl
|
||||
<< " ROM file: " << myRomFile << endl << endl
|
||||
<< myConsole->about() << endl;
|
||||
<< " FIXME : myConsole->about()" << endl;
|
||||
|
||||
// Update the timing info for a new console run
|
||||
resetLoopTiming();
|
||||
|
@ -613,6 +613,21 @@ string OSystem::MD5FromFile(const string& filename)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string OSystem::getROMInfo(const string& romfile)
|
||||
{
|
||||
// FIXME - convert this into a string
|
||||
// also, combine this method with ::createConsole(), as there's
|
||||
// quite a bit of redundant code
|
||||
/*
|
||||
about << " Cart Name: " << myProperties.get(Cartridge_Name) << endl
|
||||
<< " Cart MD5: " << myProperties.get(Cartridge_MD5) << endl
|
||||
<< " Controller 0: " << myControllers[0]->about() << endl
|
||||
<< " Controller 1: " << myControllers[1]->about() << endl
|
||||
<< vidinfo.str() << endl
|
||||
<< cart->about();
|
||||
|
||||
myAboutString = about.str();
|
||||
*/
|
||||
|
||||
|
||||
ostringstream buf;
|
||||
|
||||
// Open the cartridge image and read it in
|
||||
|
@ -628,7 +643,7 @@ string OSystem::getROMInfo(const string& romfile)
|
|||
{
|
||||
Console* console = new Console(this, cart, props);
|
||||
if(console)
|
||||
buf << console->about();
|
||||
buf << "FIXME : console->about()\n";
|
||||
else
|
||||
buf << "ERROR: Couldn't get ROM info for " << romfile << " ..." << endl;
|
||||
|
||||
|
|
Loading…
Reference in New Issue