From faca71ace763a1fa2e3781cccd2494af4dc6dc57 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Wed, 30 Dec 2020 18:28:27 +0000 Subject: [PATCH] Incorporate changes to FrameBase and Video. Signed-off-by: Andrea Odetti --- source/frontends/ncurses/world.cpp | 105 ----------------------------- source/frontends/sdl/main.cpp | 12 ---- source/linux/linuxframe.cpp | 10 --- source/linux/linuxframe.h | 1 - source/linux/linuxvideo.cpp | 15 +---- source/linux/linuxvideo.h | 5 +- 6 files changed, 3 insertions(+), 145 deletions(-) diff --git a/source/frontends/ncurses/world.cpp b/source/frontends/ncurses/world.cpp index 534d158d..b7ca8029 100644 --- a/source/frontends/ncurses/world.cpp +++ b/source/frontends/ncurses/world.cpp @@ -233,110 +233,6 @@ namespace double g_relativeSpeed = 1.0; bool g_stop = false; -void FrameRefresh() -{ - WINDOW * status = frame->getStatus(); - - if (status) - { - mvwprintw(status, 1, 2, "D1: %d, %s, %s", g_eStatusDrive1, g_sTrackDrive1, g_sSectorDrive1); - mvwprintw(status, 2, 2, "D2: %d, %s, %s", g_eStatusDrive2, g_sTrackDrive2, g_sSectorDrive2); - } -} - -void FrameDrawDiskLEDS(HDC x) -{ - CardManager & cardManager = GetCardMgr(); - if (cardManager.QuerySlot(SLOT6) != CT_Disk2) - return; - - dynamic_cast(cardManager.GetObj(SLOT6))->GetLightStatus(&g_eStatusDrive1, &g_eStatusDrive2); - - FrameRefresh(); -} - -void FrameDrawDiskStatus(HDC x) -{ - if (mem == NULL) - return; - - CardManager & cardManager = GetCardMgr(); - if (cardManager.QuerySlot(SLOT6) != CT_Disk2) - return; - - Disk2InterfaceCard* pDisk2Card = dynamic_cast(cardManager.GetObj(SLOT6)); - - // We use the actual drive since probing from memory doesn't tell us anything we don't already know. - // DOS3.3 ProDOS - // Drive $B7EA $BE3D - // Track $B7EC LC1 $D356 - // Sector $B7ED LC1 $D357 - // RWTS LC1 $D300 - - int nActiveFloppy = pDisk2Card->GetCurrentDrive(); - - int nDisk1Track = pDisk2Card->GetTrack(0); - int nDisk2Track = pDisk2Card->GetTrack(1); - - // Probe known OS's for Track/Sector - int isProDOS = mem[ 0xBF00 ] == 0x4C; - bool isValid = true; - - // Try DOS3.3 Sector - if ( !isProDOS ) - { - int nDOS33track = mem[ 0xB7EC ]; - int nDOS33sector = mem[ 0xB7ED ]; - - if ((nDOS33track >= 0 && nDOS33track < 40) - && (nDOS33sector >= 0 && nDOS33sector < 16)) - { - - /**/ if (nActiveFloppy == 0) g_nSectorDrive1 = nDOS33sector; - else if (nActiveFloppy == 1) g_nSectorDrive2 = nDOS33sector; - } - else - isValid = false; - } - else // isProDOS - { - // we can't just read from mem[ 0xD357 ] since it might be bank-switched from ROM - // and we need the Language Card RAM - // memrom[ 0xD350 ] = " ERROR\x07\x00" Applesoft error message - // T S - int nProDOStrack = *MemGetMainPtr( 0xC356 ); // LC1 $D356 - int nProDOSsector = *MemGetMainPtr( 0xC357 ); // LC1 $D357 - - if ((nProDOStrack >= 0 && nProDOStrack < 40) - && (nProDOSsector >= 0 && nProDOSsector < 16)) - { - /**/ if (nActiveFloppy == 0) g_nSectorDrive1 = nProDOSsector; - else if (nActiveFloppy == 1) g_nSectorDrive2 = nProDOSsector; - } - else - isValid = false; - } - - g_nTrackDrive1 = nDisk1Track; - g_nTrackDrive2 = nDisk2Track; - - if( !isValid ) - { - if (nActiveFloppy == 0) g_nSectorDrive1 = -1; - else g_nSectorDrive2 = -1; - } - - snprintf( g_sTrackDrive1 , sizeof(g_sTrackDrive1 ), "%2d", g_nTrackDrive1 ); - if (g_nSectorDrive1 < 0) snprintf( g_sSectorDrive1, sizeof(g_sSectorDrive1), "??" ); - else snprintf( g_sSectorDrive1, sizeof(g_sSectorDrive1), "%2d", g_nSectorDrive1 ); - - snprintf( g_sTrackDrive2 , sizeof(g_sTrackDrive2), "%2d", g_nTrackDrive2 ); - if (g_nSectorDrive2 < 0) snprintf( g_sSectorDrive2, sizeof(g_sSectorDrive2), "??" ); - else snprintf( g_sSectorDrive2, sizeof(g_sSectorDrive2), "%2d", g_nSectorDrive2 ); - - FrameRefresh(); -} - int MessageBox(HWND, const char * text, const char * caption, UINT) { LogFileOutput("MessageBox:\n%s\n%s\n\n", caption, text); @@ -366,7 +262,6 @@ void NVideoInitialize(const bool headless) void NVideoRedrawScreen() { VideoUpdateFlash(); - FrameRefresh(); Video & video = GetVideo(); diff --git a/source/frontends/sdl/main.cpp b/source/frontends/sdl/main.cpp index 16aaed9b..0456e646 100644 --- a/source/frontends/sdl/main.cpp +++ b/source/frontends/sdl/main.cpp @@ -85,18 +85,6 @@ int MessageBox(HWND, const char * text, const char * caption, UINT type) return IDOK; } -void FrameDrawDiskLEDS(HDC x) -{ -} - -void FrameDrawDiskStatus(HDC x) -{ -} - -void FrameRefreshStatus(int x, bool) -{ -} - void run_sdl(int argc, const char * argv []) { EmulatorOptions options; diff --git a/source/linux/linuxframe.cpp b/source/linux/linuxframe.cpp index 5fe7d746..3a8905f2 100644 --- a/source/linux/linuxframe.cpp +++ b/source/linux/linuxframe.cpp @@ -1,10 +1,6 @@ #include "StdAfx.h" #include "linux/linuxframe.h" -#include "Video.h" -#include "Interface.h" -#include "NTSC.h" - void LinuxFrame::FrameDrawDiskLEDS(HDC hdc) { } @@ -25,12 +21,6 @@ void LinuxFrame::FrameSetCursorPosByMousePos() { } -void LinuxFrame::VideoRedrawScreen() -{ - // NB. Can't rely on g_uVideoMode being non-zero (ie. so it can double up as a flag) since 'GR,PAGE1,non-mixed' mode == 0x00. - GetVideo().VideoRefreshScreen(GetVideo().GetVideoMode(), true); -} - void LinuxFrame::SetFullScreenShowSubunitStatus(bool /* bShow */) { } diff --git a/source/linux/linuxframe.h b/source/linux/linuxframe.h index 54393c2a..3ab9a2b2 100644 --- a/source/linux/linuxframe.h +++ b/source/linux/linuxframe.h @@ -11,7 +11,6 @@ public: virtual void FrameUpdateApple2Type(); virtual void FrameSetCursorPosByMousePos(); - virtual void VideoRedrawScreen(); virtual void SetFullScreenShowSubunitStatus(bool bShow); virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0); virtual int SetViewportScale(int nNewScale, bool bForce = false); diff --git a/source/linux/linuxvideo.cpp b/source/linux/linuxvideo.cpp index 922a0e80..f1d2c245 100644 --- a/source/linux/linuxvideo.cpp +++ b/source/linux/linuxvideo.cpp @@ -20,20 +20,9 @@ void LinuxVideo::Destroy() NTSC_Destroy(); } -void LinuxVideo::VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit) -{ -} - -void LinuxVideo::VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame) -{ -} - -void LinuxVideo::VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen) -{ -} - -void LinuxVideo::Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename) +void LinuxVideo::VideoPresentScreen() { + // TODO we should really implement this } void LinuxVideo::ChooseMonochromeColor() diff --git a/source/linux/linuxvideo.h b/source/linux/linuxvideo.h index 3653cad2..7315bf79 100644 --- a/source/linux/linuxvideo.h +++ b/source/linux/linuxvideo.h @@ -8,10 +8,7 @@ public: virtual void Initialize(); virtual void Destroy(); - virtual void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false); - virtual void VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame); - virtual void VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode = 0, bool bRedrawWholeScreen = false); - virtual void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename); + virtual void VideoPresentScreen(); virtual void ChooseMonochromeColor(); virtual void Benchmark(); virtual void DisplayLogo();