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: CartX07Widget.cxx 2743 2013-05-29 16:27:12Z stephena $
18
//============================================================================
20
#include "CartX07.hxx"
21
#include "PopUpWidget.hxx"
22
#include "CartX07Widget.hxx"
24
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
25
CartridgeX07Widget::CartridgeX07Widget(
26
GuiObject* boss, const GUI::Font& font,
27
int x, int y, int w, int h, CartridgeX07& cart)
28
: CartDebugWidget(boss, font, x, y, w, h),
31
uInt32 size = 16 * 4096;
34
info << "64K X07 cartridge, 16 4K banks\n"
35
<< "Startup bank = " << cart.myStartBank << "\n"
36
<< "Multiple hotspots, all below $1000\n"
37
<< "See documentation for further details\n";
39
// Eventually, we should query this from the debugger/disassembler
40
for(uInt32 i = 0, offset = 0xFFC; 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 << " - "
45
<< "$" << (start + 0xFFF) << "\n";
49
ypos = addBaseInformation(size, "AtariAge / John Payson / Fred Quimby",
50
info.str()) + myLineHeight;
53
items.push_back(" 0");
54
items.push_back(" 1");
55
items.push_back(" 2");
56
items.push_back(" 3");
57
items.push_back(" 4");
58
items.push_back(" 5");
59
items.push_back(" 6");
60
items.push_back(" 7");
61
items.push_back(" 8");
62
items.push_back(" 9");
63
items.push_back(" 10");
64
items.push_back(" 11");
65
items.push_back(" 12");
66
items.push_back(" 13");
67
items.push_back(" 14");
68
items.push_back(" 15");
70
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" 15 "),
71
myLineHeight, items, "Set bank: ",
72
font.getStringWidth("Set bank: "), kBankChanged);
73
myBank->setTarget(this);
74
addFocusWidget(myBank);
77
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
78
void CartridgeX07Widget::loadConfig()
80
myBank->setSelected(myCart.myCurrentBank);
82
CartDebugWidget::loadConfig();
85
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
86
void CartridgeX07Widget::handleCommand(CommandSender* sender,
87
int cmd, int data, int id)
89
if(cmd == kBankChanged)
92
myCart.bank(myBank->getSelected());
98
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
99
string CartridgeX07Widget::bankState()
101
ostringstream& buf = buffer();
103
buf << "Bank = " << myCart.myCurrentBank;