Skip to content

Commit

Permalink
applen: add some help with the most important F keys.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
  • Loading branch information
audetto committed Dec 31, 2021
1 parent b48893f commit d6e9a58
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
40 changes: 36 additions & 4 deletions source/frontends/ncurses/nframe.cpp
Expand Up @@ -6,6 +6,9 @@
#include "Interface.h"
#include "Memory.h"
#include "Log.h"
#include "Core.h"
#include "CardManager.h"
#include "Disk.h"

#include <signal.h>
#include <locale.h>
Expand Down Expand Up @@ -107,11 +110,9 @@ namespace na2
keypad(myFrame.get(), true);
wrefresh(myFrame.get());

myStatus.reset(newwin(4, width, 1 + myRows + 1, left), delwin);
box(myStatus.get(), 0 , 0);
wrefresh(myStatus.get());
myStatus.reset(newwin(8, width, 1 + myRows + 1, left), delwin);
FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES | DRAW_DISK_STATUS);
}

}

WINDOW * NFrame::GetWindow()
Expand Down Expand Up @@ -196,6 +197,37 @@ namespace na2
wrefresh(myFrame.get());
}

void NFrame::FrameRefreshStatus(int drawflags)
{
werase(myStatus.get());
box(myStatus.get(), 0 , 0);

int row = 0;

CardManager& cardManager = GetCardMgr();
if (cardManager.QuerySlot(SLOT6) == CT_Disk2)
{
Disk2InterfaceCard& disk2 = dynamic_cast<Disk2InterfaceCard&>(cardManager.GetRef(SLOT6));
const size_t maximumWidth = myColumns - 6; // 6 is the width of "S6D1: "
for (UINT i = DRIVE_1; i <= DRIVE_2; ++i)
{
const std::string name = disk2.GetBaseName(i).substr(0, maximumWidth);
mvwprintw(myStatus.get(), ++row, 1, "S6D%d: %s", 1 + i, name.c_str());
}
}
else
{
row += DRIVE_2 - DRIVE_1 + 1;
}

++row;

mvwprintw(myStatus.get(), ++row, 1, "F2: ResetMachine / Shift-F2: CtrlReset");
mvwprintw(myStatus.get(), ++row, 1, "F3: Exit / F5: Swap");
mvwprintw(myStatus.get(), ++row, 1, "F11: Load State / F12: Save State");
wrefresh(myStatus.get());
}

void NFrame::VideoUpdateFlash()
{
++myTextFlashCounter;
Expand Down
1 change: 1 addition & 0 deletions source/frontends/ncurses/nframe.h
Expand Up @@ -25,6 +25,7 @@ namespace na2
void Destroy() override;
void VideoPresentScreen() override;
int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) override;
void FrameRefreshStatus(int drawflags);

void ProcessEvDev();

Expand Down

0 comments on commit d6e9a58

Please sign in to comment.