Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More explicit actions when IEC reset #72

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,25 @@ scrollHighlightRate = 0.07

//ChargenFont = chargen // 8 bit font file

// REMOVED! INSTEAD USE: onResetEmulator = cd/1541
// If using CBMFileBrowser then it is best to specify this option. When the computer resets the Pi will always revert back to the root folder ready to load CBMFileBrowser again.
OnResetChangeToStartingFolder = 1
// OnResetChangeToStartingFolder = 1
// REMOVED!

// When in Browser mode and IEC bus reset happens do what?
// ignore - ignore it
// cd/1541 - change to starting folder
// autoload - attempt to use AutoMountImage
onResetBrowser = autoload

// When in Emulator mode and IEC bus reset happens do what?
// ignore - ignore it
// resetCPU - just reset the drive CPU
// cd/1541 - exit emulator, change to starting folder
// exit - exit emulator, stay in folder
// autoload - attempt to use AutoMountImage
onResetEmulator = ignore


// If you use FB64 (CBMFileBrowser) and want to use a fast loader cartridge (AR6, EFL, FC3) to load it then use this option to autmatically mount it.
//AutoMountImage = fb.d64 // You MUST have a disk image in \1541 with this filename
Expand Down
4 changes: 2 additions & 2 deletions src/FileBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern Options options;
#define PNG_HEIGHT 200

extern void GlobalSetDeviceID(u8 id);
extern void CheckAutoMountImage(EXIT_TYPE reset_reason , FileBrowser* fileBrowser);
extern void CheckAutoMountImage(FileBrowser* fileBrowser);

unsigned char FileBrowser::LSTBuffer[FileBrowser::LSTBuffer_size];

Expand Down Expand Up @@ -1081,7 +1081,7 @@ void FileBrowser::UpdateInputFolders()
}
else if (inputMappings->BrowseAutoLoad())
{
CheckAutoMountImage(EXIT_RESET, this);
CheckAutoMountImage(this);
}
else if (inputMappings->MakeLSTFile())
{
Expand Down
7 changes: 4 additions & 3 deletions src/iec_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ bool IEC_Bus::Resetting = false;
bool IEC_Bus::splitIECLines = false;
bool IEC_Bus::invertIECInputs = false;
bool IEC_Bus::invertIECOutputs = true;
bool IEC_Bus::ignoreReset = false;
bool IEC_Bus::ignoreResetEmulator = false;
bool IEC_Bus::ignoreResetBrowser = false;

u32 IEC_Bus::myOutsGPFSEL1 = 0;
u32 IEC_Bus::myOutsGPFSEL0 = 0;
Expand Down Expand Up @@ -108,7 +109,7 @@ void IEC_Bus::ReadBrowseMode(void)
PI_Clock = true;
}

Resetting = !ignoreReset && ((gplev0 & PIGPIO_MASK_IN_RESET) == (invertIECInputs ? PIGPIO_MASK_IN_RESET : 0));
Resetting = !ignoreResetBrowser && ((gplev0 & PIGPIO_MASK_IN_RESET) == (invertIECInputs ? PIGPIO_MASK_IN_RESET : 0));
}

void IEC_Bus::ReadEmulationMode(void)
Expand Down Expand Up @@ -180,5 +181,5 @@ void IEC_Bus::ReadEmulationMode(void)
portB->SetInput(VIAPORTPINS_CLOCKIN, true); // simulate the read in software
}

Resetting = !ignoreReset && ((gplev0 & PIGPIO_MASK_IN_RESET) == (invertIECInputs ? PIGPIO_MASK_IN_RESET : 0));
Resetting = !ignoreResetEmulator && ((gplev0 & PIGPIO_MASK_IN_RESET) == (invertIECInputs ? PIGPIO_MASK_IN_RESET : 0));
}
14 changes: 10 additions & 4 deletions src/iec_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class IEC_Bus
do
{
gplev0 = read32(ARM_GPIO_GPLEV0);
Resetting = !ignoreReset && ((gplev0 & PIGPIO_MASK_IN_RESET) == \
Resetting = !ignoreResetBrowser && ((gplev0 & PIGPIO_MASK_IN_RESET) == \
(invertIECInputs ? PIGPIO_MASK_IN_RESET : 0));

if (Resetting)
Expand Down Expand Up @@ -549,9 +549,14 @@ class IEC_Bus
invertIECOutputs = value;
}

static inline void SetIgnoreReset(bool value)
static inline void SetIgnoreResetBrowser(bool value)
{
ignoreReset = value;
ignoreResetBrowser = value;
}

static inline void SetIgnoreResetEmulator(bool value)
{
ignoreResetEmulator = value;
}

// CA1 input ATN
Expand Down Expand Up @@ -600,7 +605,8 @@ class IEC_Bus
static bool splitIECLines;
static bool invertIECInputs;
static bool invertIECOutputs;
static bool ignoreReset;
static bool ignoreResetBrowser;
static bool ignoreResetEmulator;

static u32 PIGPIO_MASK_IN_ATN;
static u32 PIGPIO_MASK_IN_DATA;
Expand Down
Loading