1
//============================================================================
5
// SS tttttt eeee ll ll aaaa
6
// SSSS tt ee ee ll ll aa
7
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
8
// SS SS tt ee ll ll aa aa
9
// SSSS ttt eeeee llll llll aaaaa
11
// Copyright (c) 1995-2013 by Bradford W. Mott, Stephen Anthony
12
// and the Stella Team
14
// See the file "License.txt" for information on usage and redistribution of
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
17
// $Id: CartEFSCWidget.cxx 2743 2013-05-29 16:27:12Z stephena $
18
//============================================================================
20
#include "CartEFSC.hxx"
21
#include "PopUpWidget.hxx"
22
#include "CartEFSCWidget.hxx"
24
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
25
CartridgeEFSCWidget::CartridgeEFSCWidget(
26
GuiObject* boss, const GUI::Font& font,
27
int x, int y, int w, int h, CartridgeEFSC& cart)
28
: CartDebugWidget(boss, font, x, y, w, h),
31
uInt32 size = 16 * 4096;
34
info << "64K H. Runner EFSC + RAM, 16 4K banks\n"
35
<< "128 bytes RAM @ $F000 - $F0FF\n"
36
<< " $F080 - $F0FF (R), $F000 - $F07F (W)\n"
37
<< "Startup bank = " << cart.myStartBank << "\n";
39
// Eventually, we should query this from the debugger/disassembler
40
for(uInt32 i = 0, offset = 0xFFC, spot = 0xFE0; i < 16; ++i, offset += 0x1000)
42
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
43
start -= start % 0x1000;
44
info << "Bank " << dec << i << " @ $" << HEX4 << (start + 0x100) << " - "
45
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
49
ypos = addBaseInformation(size, "Paul Slocum / Homestar Runner",
50
info.str()) + myLineHeight;
53
items.push_back(" 0 ($FE0)");
54
items.push_back(" 1 ($FE1)");
55
items.push_back(" 2 ($FE2)");
56
items.push_back(" 3 ($FE3)");
57
items.push_back(" 4 ($FE4)");
58
items.push_back(" 5 ($FE5)");
59
items.push_back(" 6 ($FE6)");
60
items.push_back(" 7 ($FE7)");
61
items.push_back(" 8 ($FE8)");
62
items.push_back(" 9 ($FE9)");
63
items.push_back("10 ($FEA)");
64
items.push_back("11 ($FEB)");
65
items.push_back("12 ($FEC)");
66
items.push_back("13 ($FED)");
67
items.push_back("14 ($FEE)");
68
items.push_back("15 ($FEF)");
70
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("15 ($FE0) "),
71
myLineHeight, items, "Set bank: ",
72
font.getStringWidth("Set bank: "), kBankChanged);
73
myBank->setTarget(this);
74
addFocusWidget(myBank);
77
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
78
void CartridgeEFSCWidget::loadConfig()
80
myBank->setSelected(myCart.myCurrentBank);
82
CartDebugWidget::loadConfig();
85
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
86
void CartridgeEFSCWidget::handleCommand(CommandSender* sender,
87
int cmd, int data, int id)
89
if(cmd == kBankChanged)
92
myCart.bank(myBank->getSelected());
98
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
99
string CartridgeEFSCWidget::bankState()
101
ostringstream& buf = buffer();
103
static const char* spot[] = {
104
"$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7",
105
"$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF"
107
buf << "Bank = " << myCart.myCurrentBank
108
<< ", hotspot = " << spot[myCart.myCurrentBank];