1 //============================================================================
2 //
3 //   SSSS    tt          lll  lll
4 //  SS  SS   tt           ll   ll
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
10 //
11 // Copyright (c) 1995-2021 by Bradford W. Mott, Stephen Anthony
12 // and the Stella Team
13 //
14 // See the file "License.txt" for information on usage and redistribution of
15 // this file, and for a DISCLAIMER OF ALL WARRANTIES.
16 //============================================================================
17 
18 #include "CartWD.hxx"
19 #include "CartWDWidget.hxx"
20 
21 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeWDWidget(GuiObject * boss,const GUI::Font & lfont,const GUI::Font & nfont,int x,int y,int w,int h,CartridgeWD & cart)22 CartridgeWDWidget::CartridgeWDWidget(
23       GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
24       int x, int y, int w, int h, CartridgeWD& cart)
25   : CartridgeEnhancedWidget(boss, lfont, nfont, x, y, w, h, cart),
26     myCartWD{cart}
27 {
28   initialize();
29 }
30 
31 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
description()32 string CartridgeWDWidget::description()
33 {
34   ostringstream info;
35 
36   info << "8K + RAM Wickstead Design cartridge, \n"
37     << "  eight 1K banks, mapped into four segments\n"
38     << "Hotspots $" << Common::Base::HEX1 << myCart.hotspot() << " - $" << (myCart.hotspot() + 7) << ", "
39     << "each hotspot selects a [predefined bank mapping]\n";
40   info << ramDescription();
41 
42   return info.str();
43 }
44 
45 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hotspotStr(int bank,int segment,bool prefix)46 string CartridgeWDWidget::hotspotStr(int bank, int segment, bool prefix)
47 {
48   ostringstream info;
49   CartridgeWD::BankOrg banks = myCartWD.ourBankOrg[bank];
50 
51   info << "(" << (prefix ? "hotspot " : "")
52     << "$" << Common::Base::HEX1 << (myCart.hotspot() + bank) << ") ["
53     << uInt16(banks.zero) << ", "
54     << uInt16(banks.one) << ", "
55     << uInt16(banks.two) << ", "
56     << uInt16(banks.three) << "]";
57 
58   return info.str();
59 }
60