Skip to content

Commit

Permalink
Add hide_console option to cmdline.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
randyrossi committed Feb 4, 2019
1 parent 4a8d665 commit 27d7e24
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 14 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BMC64 v1.0.2
# BMC64 v1.0.3

BMC64 is a bare metal C64 emulator for the Raspberry Pi with true 50hz/60hz smooth scrolling and low latency between input & video/audio.

Expand Down Expand Up @@ -73,6 +73,9 @@ In the menu, select either GPIO1 or GPIO2 and assign it to one of the emulated p
## 1.0.2
* GPIO joystick was broken in 1.0.1 - FIXED

## 1.0.3
* Add hide_console=0 option in cmdline.txt to diagnose startup issues

# Q&A

Q: Can I switch the machine to NTSC?
Expand Down
2 changes: 1 addition & 1 deletion cmdline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fast=true canvas_width=384 canvas_height=272 machine_timing=pal
hide_console=1 fast=true canvas_width=384 canvas_height=272 machine_timing=pal
2 changes: 1 addition & 1 deletion third_party/vice-3.2/src/arch/raspi/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void show_files(int filter, int menu_id) {
static void show_about() {
struct menu_item* file_root = ui_get_file_menu();
ui_clear_menu(1);
ui_menu_add_button(MENU_TEXT, file_root, "BMC64 v1.0.1");
ui_menu_add_button(MENU_TEXT, file_root, "BMC64 v1.0.3");
ui_menu_add_button(MENU_TEXT, file_root, "A Bare Metal C64 Emulator");
ui_menu_add_button(MENU_TEXT, file_root, "For the Rasbperry Pi 2/3");
ui_menu_add_divider(file_root);
Expand Down
23 changes: 22 additions & 1 deletion viceoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ ViceOptions *ViceOptions::s_pThis = 0;
ViceOptions::ViceOptions (void) :
m_nCanvasWidth (DEFAULT_CANVAS_WIDTH),
m_nCanvasHeight (DEFAULT_CANVAS_HEIGHT),
m_nMachineTiming (MACHINE_TIMING_PAL)
m_nMachineTiming (MACHINE_TIMING_PAL),
m_bHideConsole(true)
{
s_pThis = this;

Expand Down Expand Up @@ -78,6 +79,16 @@ ViceOptions::ViceOptions (void) :
m_nMachineTiming = MACHINE_TIMING_PAL;
}
}
else if (strcmp (pOption, "hide_console") == 0)
{
if (strcmp(pValue, "1") == 0)
{
m_bHideConsole = true;
}
else {
m_bHideConsole = false;
}
}
}
}

Expand All @@ -101,6 +112,16 @@ unsigned ViceOptions::GetMachineTiming (void) const
return m_nMachineTiming;
}

bool ViceOptions::GetHideConsole (void) const
{
return m_bHideConsole;
}

void ViceOptions::SetHideConsole (bool value)
{
m_bHideConsole = value;
}

ViceOptions *ViceOptions::Get (void)
{
return s_pThis;
Expand Down
3 changes: 3 additions & 0 deletions viceoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class ViceOptions
unsigned GetCanvasWidth (void) const;
unsigned GetCanvasHeight (void) const;
unsigned GetMachineTiming (void) const;
bool GetHideConsole (void) const;
void SetHideConsole (bool value);

static ViceOptions *Get (void);

Expand All @@ -56,6 +58,7 @@ class ViceOptions
unsigned m_nCanvasWidth;
unsigned m_nCanvasHeight;
unsigned m_nMachineTiming;
bool m_bHideConsole;

static ViceOptions *s_pThis;
};
Expand Down
12 changes: 4 additions & 8 deletions vicescreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

#include "vicescreen.h"
#include "viceoptions.h"
#include <circle/devicenameservice.h>
#include <circle/synchronize.h>
#include <circle/sysconfig.h>
Expand Down Expand Up @@ -46,8 +47,7 @@ CViceScreenDevice::CViceScreenDevice (unsigned nWidth, unsigned nHeight, boolean
m_bCursorOn (TRUE),
m_Color (NORMAL_COLOR),
m_bInsertOn (FALSE),
m_bUpdated (FALSE),
m_bHideConsole (TRUE)
m_bUpdated (FALSE)
#ifdef REALTIME
, m_SpinLock (TASK_LEVEL)
#endif
Expand Down Expand Up @@ -722,7 +722,7 @@ void CViceScreenDevice::Tabulator (void)

void CViceScreenDevice::Scroll (void)
{
if (m_bHideConsole) { return; }
if (ViceOptions::Get()->GetHideConsole()) { return; }

unsigned nLines = m_CharGen.GetCharHeight ();

Expand Down Expand Up @@ -799,7 +799,7 @@ void CViceScreenDevice::SetPixel (unsigned nPosX, unsigned nPosY, TScreenColor C
if ( nPosX < m_nWidth
&& nPosY < m_nHeight)
{
if (!m_bHideConsole) {
if (!ViceOptions::Get()->GetHideConsole()) {
m_pBuffer[m_nPitch * nPosY + nPosX] = Color;
}
}
Expand Down Expand Up @@ -843,7 +843,3 @@ void CViceScreenDevice::SetVirtualOffset(u32 x, u32 y) {
void CViceScreenDevice::WaitForVerticalSync() {
m_pFrameBuffer->WaitForVerticalSync();
}

void CViceScreenDevice::SetHideConsole(boolean v) {
m_bHideConsole = v;
}
2 changes: 0 additions & 2 deletions vicescreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class CViceScreenDevice : public CDevice /// Writing characters to screen
void UpdatePalette();
void SetVirtualOffset(u32 x, u32 y);
void WaitForVerticalSync();
void SetHideConsole (boolean v);

private:
void Write (char chChar);
Expand Down Expand Up @@ -197,7 +196,6 @@ class CViceScreenDevice : public CDevice /// Writing characters to screen
unsigned m_nParam2;
boolean m_bUpdated;
CSpinLock m_SpinLock;
boolean m_bHideConsole;
};

#endif
Expand Down

0 comments on commit 27d7e24

Please sign in to comment.