From 027248a002b719616fa720911a536bb795ff57ce Mon Sep 17 00:00:00 2001 From: "Christopher A. Mosher" Date: Mon, 12 Dec 2022 23:30:24 -0500 Subject: [PATCH] remove hyper setting --- CMakeLists.txt | 1 - src/apple2.cpp | 4 ++-- src/apple2.h | 2 +- src/emulator.cpp | 2 +- src/emulator.h | 2 -- src/hypermode.cpp | 18 ------------------ src/hypermode.h | 45 --------------------------------------------- src/keyboard.cpp | 30 +----------------------------- src/keyboard.h | 6 +----- src/screenimage.cpp | 13 ++----------- src/screenimage.h | 2 -- 11 files changed, 8 insertions(+), 117 deletions(-) delete mode 100644 src/hypermode.cpp delete mode 100644 src/hypermode.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ead972c..8484731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,6 @@ filterchroma.cpp filterluma.cpp firmwarecard.cpp gui.cpp -hypermode.cpp keyboardbuffermode.cpp keyboard.cpp languagecard.cpp diff --git a/src/apple2.cpp b/src/apple2.cpp index 5d21eba..0a3d4ea 100644 --- a/src/apple2.cpp +++ b/src/apple2.cpp @@ -38,9 +38,9 @@ #include #include -Apple2::Apple2(KeypressQueue& keypresses, PaddleButtonStates& paddleButtonStates, AnalogTV& tv, HyperMode& fhyper, KeyboardBufferMode& buffered, ScreenImage& gui) : +Apple2::Apple2(KeypressQueue& keypresses, PaddleButtonStates& paddleButtonStates, AnalogTV& tv, KeyboardBufferMode& buffered, ScreenImage& gui) : slts(gui), -kbd(keypresses, fhyper, buffered), +kbd(keypresses, buffered), rom(AddressBus::MOTHERBOARD_ROM_SIZ), ram(revision), cassetteIn(gui), diff --git a/src/apple2.h b/src/apple2.h index 4d9d64c..5de3ce9 100644 --- a/src/apple2.h +++ b/src/apple2.h @@ -63,7 +63,7 @@ class Apple2 : public Timable int revision; public: - Apple2(KeypressQueue& keypresses, PaddleButtonStates& paddleButtonStates, AnalogTV& tv, HyperMode& fhyper, KeyboardBufferMode& buffered, ScreenImage& gui); + Apple2(KeypressQueue& keypresses, PaddleButtonStates& paddleButtonStates, AnalogTV& tv, KeyboardBufferMode& buffered, ScreenImage& gui); ~Apple2(); void useEpple2Cpu(); diff --git a/src/emulator.cpp b/src/emulator.cpp index b09b1e9..35b7395 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -47,7 +47,7 @@ static bool isKeyDown(const SDL_Keycode sym, const SDL_Keymod mod) { Emulator::Emulator() : display(screenImage), videoStatic(display), - apple2(keypresses, paddleButtonStates, display, fhyper, buffered, screenImage), + apple2(keypresses, paddleButtonStates, display, buffered, screenImage), timable(nullptr), // No ticked object (NULL pointer) repeat(false), keysDown(0), diff --git a/src/emulator.h b/src/emulator.h index e93da97..28a57a7 100644 --- a/src/emulator.h +++ b/src/emulator.h @@ -25,7 +25,6 @@ #include "screenimage.h" #include "analogtv.h" #include "keyboardbuffermode.h" -#include "hypermode.h" #include "clipboardhandler.h" #include #include @@ -37,7 +36,6 @@ class Emulator { PaddleButtonStates paddleButtonStates; KeypressQueue keypresses; - HyperMode fhyper; KeyboardBufferMode buffered; ScreenImage screenImage; AnalogTV display; diff --git a/src/hypermode.cpp b/src/hypermode.cpp deleted file mode 100644 index 8aa5636..0000000 --- a/src/hypermode.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - epple2 - Copyright (C) 2008 by Christopher A. Mosher - - 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 . -*/ -#include "hypermode.h" diff --git a/src/hypermode.h b/src/hypermode.h deleted file mode 100644 index fd5abca..0000000 --- a/src/hypermode.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - epple2 - Copyright (C) 2008 by Christopher A. Mosher - - 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 . -*/ -#ifndef HYPERMODE_H -#define HYPERMODE_H - -class HyperMode -{ -private: - bool fhyper; - -public: - HyperMode(): fhyper(false) { } - ~HyperMode() { } - bool isHyper() - { - return this->fhyper; - } - - void setHyper(bool isHyper) - { - this->fhyper = isHyper; - } - - void toggleHyper() - { - this->fhyper = !this->fhyper; - } -}; - -#endif diff --git a/src/keyboard.cpp b/src/keyboard.cpp index 0cf739c..79e2e55 100644 --- a/src/keyboard.cpp +++ b/src/keyboard.cpp @@ -16,15 +16,13 @@ along with this program. If not, see . */ #include "keyboard.h" -#include "hypermode.h" #include "keyboardbuffermode.h" #include -Keyboard::Keyboard(KeypressQueue& q, HyperMode& fhyper, KeyboardBufferMode& buffered) : +Keyboard::Keyboard(KeypressQueue& q, KeyboardBufferMode& buffered) : keys(q), - fhyper(fhyper), buffered(buffered), latch(0), cGet(0) { @@ -39,7 +37,6 @@ void Keyboard::clear() { } unsigned char Keyboard::get() { - waitIfTooFast(); if (!this->buffered.isBuffered() || !(this->latch & 0x80)) { if (!this->keys.empty()) { this->latch = this->keys.front() | 0x80; @@ -48,28 +45,3 @@ unsigned char Keyboard::get() { } return this->latch; } - -void Keyboard::waitIfTooFast() { - // TODO remove all hyper stuff; it doesn't do anything anymore, - // since the new architecture with wxTimer - -// if (this->fhyper.isHyper()) { -// return; -// } -// -// ++this->cGet; -// if (!this->cGet) { -// if (SDL_GetTicks() - this->lastGet <= 1000) { -// /* -// * Check every 256 gets to see if they are -// * happening too fast (within one second). -// * If so, it means we are probably just -// * looping waiting for a keypress, so -// * wait a millisecond (or so) just to -// * prevent us from using 100% of CPU time. -// */ -// SDL_Delay(1); -// } -// } -// this->lastGet = SDL_GetTicks(); -} diff --git a/src/keyboard.h b/src/keyboard.h index c2d1ead..ca99a57 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -23,22 +23,18 @@ typedef std::queue KeypressQueue; -class HyperMode; class KeyboardBufferMode; class Keyboard { KeypressQueue& keys; - HyperMode& fhyper; KeyboardBufferMode& buffered; unsigned char latch; unsigned char cGet; Uint32 lastGet; - void waitIfTooFast(); - public: - Keyboard(KeypressQueue& q, HyperMode& fhyper, KeyboardBufferMode& buffered); + Keyboard(KeypressQueue& q, KeyboardBufferMode& buffered); void powerOn(); void clear(); unsigned char get(); diff --git a/src/screenimage.cpp b/src/screenimage.cpp index e8187e3..feeedc8 100644 --- a/src/screenimage.cpp +++ b/src/screenimage.cpp @@ -56,7 +56,6 @@ class ScreenException { ScreenImage::ScreenImage() : fullscreen(false), -hyper_a2_speed(false), buffer(true), fillLines(true), display(AnalogTV::TV_OLD_COLOR), @@ -167,9 +166,9 @@ void ScreenImage::drawFnKeys() { drawText( " FULLSCRN SCAN-LINES KEYBOARD", r++, c); drawText( - " XXXXXXXXXXXXXX WINDOW FILL-LINES CMD RESET PASTE SAVE BMP QUIT! REPT HYPER BUFFER ", r++, c); + " XXXXXXXXXXXXXX WINDOW FILL-LINES CMD RESET PASTE SAVE BMP QUIT! REPT BUFFER ", r++, c); drawText( - " F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 ", r++, c); + " F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F12 ", r++, c); if (this->fullscreen) invertText(76, 32, 42); // FULLSCRN @@ -181,9 +180,6 @@ void ScreenImage::drawFnKeys() { else invertText(76, 43, 55); // SCAN-LINES - if (this->hyper_a2_speed) - invertText(77, 102, 109); // HYPER - if (this->buffer) invertText(77, 110, 118); // BUFFER @@ -206,11 +202,6 @@ void ScreenImage::cycleDisplayLabel() { drawDisplayLabel(); } -void ScreenImage::toggleHyperLabel() { - this->hyper_a2_speed = !this->hyper_a2_speed; - invertText(77, 102, 109); // HYPER -} - void ScreenImage::toggleKdbBufferLabel() { this->buffer = !this->buffer; invertText(77, 110, 118); // BUFFER diff --git a/src/screenimage.h b/src/screenimage.h index 48fb5b6..d504844 100644 --- a/src/screenimage.h +++ b/src/screenimage.h @@ -36,7 +36,6 @@ private: unsigned int* pixels; int screen_pitch; bool fullscreen; - bool hyper_a2_speed; bool buffer; bool fillLines; AnalogTV::DisplayType display; @@ -66,7 +65,6 @@ public: void drawSlot(int slot, int r, int c); void drawCassette(); void drawFnKeys(); - void toggleHyperLabel(); void toggleKdbBufferLabel(); void cycleDisplayLabel(); void displayHz(int hz);