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 CARTRIDGEBUS_WIDGET_HXX
19#define CARTRIDGEBUS_WIDGET_HXX
20
21class CartridgeBUS;
22class PopUpWidget;
23class CheckboxWidget;
24class DataGridWidget;
25
26#include "CartDebugWidget.hxx"
27
28class CartridgeBUSWidget : public CartDebugWidget
29{
30 public:
31 CartridgeBUSWidget(GuiObject* boss, const GUI::Font& lfont,
32 const GUI::Font& nfont,
33 int x, int y, int w, int h,
34 CartridgeBUS& cart);
35 virtual ~CartridgeBUSWidget() = default;
36
37 private:
38 struct CartState {
39 ByteArray tops;
40 ByteArray bottoms;
41 IntArray datastreampointers;
42 IntArray datastreamincrements;
43 IntArray addressmaps;
44 IntArray mcounters;
45 IntArray mfreqs;
46 IntArray mwaves;
47 IntArray mwavesizes;
48 IntArray samplepointer;
49 uInt32 random;
50 ByteArray internalram;
51 };
52
53 CartridgeBUS& myCart;
54 PopUpWidget* myBank;
55
56 DataGridWidget* myDatastreamPointers;
57 DataGridWidget* myDatastreamIncrements;
58 DataGridWidget* myDatastreamPointers2;
59 DataGridWidget* myDatastreamIncrements2;
60 DataGridWidget* myAddressMaps;
61 DataGridWidget* myMusicCounters;
62 DataGridWidget* myMusicFrequencies;
63 DataGridWidget* myMusicWaveforms;
64 DataGridWidget* myMusicWaveformSizes;
65 DataGridWidget* mySamplePointer;
66 StaticTextWidget* myDatastreamLabels[6];
67 CheckboxWidget* myBusOverdrive;
68 CheckboxWidget* myDigitalSample;
69 CartState myOldState;
70
71 enum { kBankChanged = 'bkCH' };
72
73 private:
74 void saveOldState() override;
75
76 void loadConfig() override;
77 void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
78
79 string bankState() override;
80
81 // start of functions for Cartridge RAM tab
82 uInt32 internalRamSize() override;
83 uInt32 internalRamRPort(int start) override;
84 string internalRamDescription() override;
85 const ByteArray& internalRamOld(int start, int count) override;
86 const ByteArray& internalRamCurrent(int start, int count) override;
87 void internalRamSetValue(int addr, uInt8 value) override;
88 uInt8 internalRamGetValue(int addr) override;
89 // end of functions for Cartridge RAM tab
90
91 // Following constructors and assignment operators not supported
92 CartridgeBUSWidget() = delete;
93 CartridgeBUSWidget(const CartridgeBUSWidget&) = delete;
94 CartridgeBUSWidget(CartridgeBUSWidget&&) = delete;
95 CartridgeBUSWidget& operator=(const CartridgeBUSWidget&) = delete;
96 CartridgeBUSWidget& operator=(CartridgeBUSWidget&&) = delete;
97};
98
99#endif
100