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 EMULATOR_H
|
|
|
|
#define EMULATOR_H
|
|
|
|
|
|
|
|
#include "keyboard.h"
|
|
|
|
#include "paddlebuttonstates.h"
|
|
|
|
#include "apple2.h"
|
|
|
|
#include "videostaticgenerator.h"
|
|
|
|
#include "screenimage.h"
|
|
|
|
#include "analogtv.h"
|
|
|
|
#include "keyboardbuffermode.h"
|
|
|
|
#include "clipboardhandler.h"
|
2022-11-02 19:07:31 +00:00
|
|
|
#include <SDL.h>
|
2022-12-13 03:34:13 +00:00
|
|
|
#include <wx/string.h>
|
2012-04-21 00:04:34 +00:00
|
|
|
|
|
|
|
class Timable;
|
2022-12-12 01:13:39 +00:00
|
|
|
class E2Config;
|
2012-04-21 00:04:34 +00:00
|
|
|
|
2022-12-12 05:52:19 +00:00
|
|
|
class Emulator {
|
2022-11-03 03:50:54 +00:00
|
|
|
PaddleButtonStates paddleButtonStates;
|
|
|
|
KeypressQueue keypresses;
|
|
|
|
|
|
|
|
KeyboardBufferMode buffered;
|
|
|
|
ScreenImage screenImage;
|
|
|
|
AnalogTV display;
|
|
|
|
VideoStaticGenerator videoStatic;
|
|
|
|
Apple2 apple2;
|
|
|
|
ClipboardHandler clip;
|
|
|
|
|
|
|
|
Timable* timable;
|
|
|
|
|
|
|
|
bool repeat;
|
|
|
|
int keysDown;
|
|
|
|
int rept;
|
|
|
|
unsigned char lastKeyDown;
|
2022-12-06 18:30:35 +00:00
|
|
|
Uint32 prev_ms;
|
2022-11-03 03:50:54 +00:00
|
|
|
|
2022-12-13 02:47:10 +00:00
|
|
|
void dispatchKeyDown(const SDL_KeyboardEvent& keyEvent);
|
2022-11-03 03:50:54 +00:00
|
|
|
void dispatchKeyUp(const SDL_KeyboardEvent& keyEvent);
|
2022-12-12 18:03:30 +00:00
|
|
|
void powerOnComputer();
|
|
|
|
void powerOffComputer();
|
2012-04-21 00:04:34 +00:00
|
|
|
|
2022-12-06 03:19:24 +00:00
|
|
|
void handleRepeatKey();
|
|
|
|
void handleAnyPendingEvents();
|
|
|
|
|
2012-04-21 00:04:34 +00:00
|
|
|
public:
|
2022-11-03 03:50:54 +00:00
|
|
|
Emulator();
|
|
|
|
virtual ~Emulator();
|
2012-04-21 00:04:34 +00:00
|
|
|
|
2022-12-12 01:13:39 +00:00
|
|
|
void config(E2Config& cfg);
|
2022-12-12 18:03:30 +00:00
|
|
|
void tick50ms();
|
2022-12-13 03:34:13 +00:00
|
|
|
void cmd(const wxString& c);
|
2022-12-13 02:47:10 +00:00
|
|
|
bool isSafeToQuit();
|
2012-04-21 00:04:34 +00:00
|
|
|
|
2022-11-03 03:50:54 +00:00
|
|
|
void toggleComputerPower();
|
2022-12-13 02:47:10 +00:00
|
|
|
void monitorCycle();
|
|
|
|
void paste();
|
|
|
|
void reset();
|
|
|
|
void toggleBuffered();
|
|
|
|
void toggleFullScreen();
|
|
|
|
void screenshot();
|
2012-04-21 00:04:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|