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-2019 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#ifndef CARTRIDGEDPC_WIDGET_HXX
19#define CARTRIDGEDPC_WIDGET_HXX
20
21class CartridgeDPC;
22class PopUpWidget;
23class DataGridWidget;
24
25#include "CartDebugWidget.hxx"
26
27class CartridgeDPCWidget : public CartDebugWidget
28{
29 public:
30 CartridgeDPCWidget(GuiObject* boss, const GUI::Font& lfont,
31 const GUI::Font& nfont,
32 int x, int y, int w, int h,
33 CartridgeDPC& cart);
34 virtual ~CartridgeDPCWidget() = default;
35
36 private:
37 struct CartState {
38 ByteArray tops;
39 ByteArray bottoms;
40 IntArray counters;
41 ByteArray flags;
42 BoolArray music;
43 uInt8 random;
44 ByteArray internalram;
45 uInt16 bank;
46 };
47
48 CartridgeDPC& myCart;
49 PopUpWidget* myBank;
50
51 DataGridWidget* myTops;
52 DataGridWidget* myBottoms;
53 DataGridWidget* myCounters;
54 DataGridWidget* myFlags;
55 DataGridWidget* myMusicMode;
56 DataGridWidget* myRandom;
57
58 CartState myOldState;
59
60 enum { kBankChanged = 'bkCH' };
61
62 private:
63 void saveOldState() override;
64
65 void loadConfig() override;
66 void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
67
68 string bankState() override;
69
70 // start of functions for Cartridge RAM tab
71 uInt32 internalRamSize() override;
72 uInt32 internalRamRPort(int start) override;
73 string internalRamDescription() override;
74 const ByteArray& internalRamOld(int start, int count) override;
75 const ByteArray& internalRamCurrent(int start, int count) override;
76 void internalRamSetValue(int addr, uInt8 value) override;
77 uInt8 internalRamGetValue(int addr) override;
78 // end of functions for Cartridge RAM tab
79
80 // Following constructors and assignment operators not supported
81 CartridgeDPCWidget() = delete;
82 CartridgeDPCWidget(const CartridgeDPCWidget&) = delete;
83 CartridgeDPCWidget(CartridgeDPCWidget&&) = delete;
84 CartridgeDPCWidget& operator=(const CartridgeDPCWidget&) = delete;
85 CartridgeDPCWidget& operator=(CartridgeDPCWidget&&) = delete;
86};
87
88#endif
89