2012-04-21 00:04:34 +00:00
|
|
|
/*
|
|
|
|
epple2
|
2015-07-29 01:14:58 +00:00
|
|
|
Copyright (C) 2008 by Christopher A. Mosher <cmosher01@gmail.com>
|
2012-04-21 00:04:34 +00:00
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY, without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef ADDRESSBUS_H
|
|
|
|
#define ADDRESSBUS_H
|
|
|
|
|
2019-01-27 06:41:23 +00:00
|
|
|
class ScreenImage;
|
2012-04-21 00:04:34 +00:00
|
|
|
class Memory;
|
2019-02-02 21:08:32 +00:00
|
|
|
class MemoryRandomAccess;
|
2012-04-21 00:04:34 +00:00
|
|
|
class Keyboard;
|
|
|
|
class VideoMode;
|
|
|
|
class Paddles;
|
|
|
|
class PaddleButtonStates;
|
|
|
|
class SpeakerClicker;
|
2019-01-21 05:12:47 +00:00
|
|
|
class CassetteIn;
|
|
|
|
class CassetteOut;
|
2012-04-21 00:04:34 +00:00
|
|
|
class Slots;
|
|
|
|
|
2019-01-27 06:41:23 +00:00
|
|
|
class AddressBus {
|
|
|
|
private:
|
|
|
|
ScreenImage& gui;
|
2019-06-24 03:25:09 +00:00
|
|
|
const int& revision;
|
2019-02-02 21:08:32 +00:00
|
|
|
MemoryRandomAccess& ram;
|
2019-06-24 03:25:09 +00:00
|
|
|
Memory& rom; // TODO fix ROM so it doesn't use deprecated Memory class
|
2019-01-27 06:41:23 +00:00
|
|
|
Keyboard& kbd;
|
|
|
|
VideoMode& vid;
|
|
|
|
Paddles& paddles;
|
|
|
|
PaddleButtonStates& paddleButtonStates;
|
|
|
|
SpeakerClicker& speaker;
|
2019-01-21 05:12:47 +00:00
|
|
|
CassetteIn& cassetteIn;
|
|
|
|
CassetteOut& cassetteOut;
|
|
|
|
Slots& slts;
|
2012-04-21 00:04:34 +00:00
|
|
|
|
2019-01-27 06:41:23 +00:00
|
|
|
unsigned char data; // this emulates the (floating) data bus
|
2012-04-21 00:04:34 +00:00
|
|
|
|
2022-12-11 07:07:28 +00:00
|
|
|
int debugoutpos;
|
|
|
|
bool debugfirst;
|
|
|
|
|
2019-06-24 03:25:09 +00:00
|
|
|
void setD7(const bool set);
|
|
|
|
void readSwitch(unsigned short address);
|
|
|
|
void writeSwitch(unsigned short address);
|
|
|
|
|
|
|
|
public:
|
2019-02-02 21:08:32 +00:00
|
|
|
AddressBus(ScreenImage& gui, int& revision, MemoryRandomAccess& ram, Memory& rom, Keyboard& kbd, VideoMode& vid, Paddles& paddles, PaddleButtonStates& paddleButtonStates, SpeakerClicker& speaker, CassetteIn& cassetteIn, CassetteOut& cassetteOut, Slots& slts);
|
2019-01-27 06:41:23 +00:00
|
|
|
~AddressBus();
|
2012-04-21 00:04:34 +00:00
|
|
|
|
2019-01-27 06:41:23 +00:00
|
|
|
unsigned char read(const unsigned short address);
|
|
|
|
void write(const unsigned short address, const unsigned char d);
|
2019-06-24 03:25:09 +00:00
|
|
|
|
|
|
|
static const int MOTHERBOARD_RAM_BAS = 0x00000;
|
|
|
|
static const int MOTHERBOARD_RAM_LIM = 0x0C000;
|
|
|
|
static const int MOTHERBOARD_RAM_SIZ = MOTHERBOARD_RAM_LIM-MOTHERBOARD_RAM_BAS;
|
|
|
|
|
|
|
|
static const int MOTHERBOARD_ROM_BAS = 0x0D000;
|
|
|
|
static const int MOTHERBOARD_ROM_LIM = 0x10000;
|
|
|
|
static const int MOTHERBOARD_ROM_SIZ = MOTHERBOARD_ROM_LIM-MOTHERBOARD_ROM_BAS;
|
2012-04-21 00:04:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|