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