2016-01-05 04:12:47 +00:00
|
|
|
//
|
|
|
|
// Electron.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 03/01/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Electron_hpp
|
|
|
|
#define Electron_hpp
|
|
|
|
|
|
|
|
#include "../../Processors/6502/CPU6502.hpp"
|
|
|
|
#include "../../Outputs/CRT.hpp"
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "Atari2600Inputs.h"
|
|
|
|
|
|
|
|
namespace Electron {
|
|
|
|
|
2016-01-08 02:01:13 +00:00
|
|
|
enum ROMSlot: uint8_t {
|
2016-01-08 03:26:49 +00:00
|
|
|
ROMSlot0 = 0,
|
|
|
|
ROMSlot1, ROMSlot2, ROMSlot3,
|
|
|
|
ROMSlot4, ROMSlot5, ROMSlot6, ROMSlot7,
|
2016-01-08 02:01:13 +00:00
|
|
|
|
|
|
|
ROMSlotKeyboard = 8, ROMSlot9,
|
|
|
|
ROMSlotBASIC = 10, ROMSlot11,
|
|
|
|
|
2016-01-08 03:26:49 +00:00
|
|
|
ROMSlot12, ROMSlot13, ROMSlot14, ROMSlot15,
|
2016-01-08 02:01:13 +00:00
|
|
|
|
|
|
|
ROMSlotOS
|
2016-01-07 02:09:49 +00:00
|
|
|
};
|
|
|
|
|
2016-01-05 04:12:47 +00:00
|
|
|
class Machine: public CPU6502::Processor<Machine> {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
Machine();
|
|
|
|
~Machine();
|
|
|
|
|
|
|
|
unsigned int perform_bus_operation(CPU6502::BusOperation operation, uint16_t address, uint8_t *value);
|
|
|
|
|
2016-01-07 02:09:49 +00:00
|
|
|
void set_rom(ROMSlot slot, size_t length, const uint8_t *data);
|
|
|
|
|
2016-01-08 03:26:49 +00:00
|
|
|
Outputs::CRT *get_crt() { return _crt; }
|
|
|
|
|
2016-01-07 02:09:49 +00:00
|
|
|
private:
|
2016-01-08 03:26:49 +00:00
|
|
|
uint8_t _os[16384], _basic[16384], _ram[32768];
|
2016-01-08 02:01:13 +00:00
|
|
|
uint8_t _interruptStatus, _interruptControl;
|
|
|
|
uint16_t _screenStartAddress;
|
|
|
|
ROMSlot _activeRom;
|
2016-01-08 03:26:49 +00:00
|
|
|
|
|
|
|
Outputs::CRT *_crt;
|
2016-01-05 04:12:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Electron_hpp */
|