Merge pull request #82 from penfold42/hexoptions

3 small things
This commit is contained in:
Stephen White 2018-08-30 21:41:56 +10:00 committed by GitHub
commit 756bbe2a02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 26 deletions

View file

@ -1159,6 +1159,12 @@ bool FileBrowser::MakeLST(const char* filenameLST)
}
}
f_write(&fp
, roms->ROMNames[roms->currentROMIndex]
, strlen(roms->ROMNames[roms->currentROMIndex])
, &bytes);
f_write(&fp, "\r\n", 2, &bytes);
f_close(&fp);
}
else

View file

@ -23,8 +23,8 @@
extern "C"
{
#include "rpi-aux.h"
extern void reboot_now(void);
}
extern void Reboot_Pi(void);
// If disk swaps can be done via multiple cores then directDiskSwapRequest needs to be volatile. WARNING: volatile acesses can be very expensive.
//volatile unsigned InputMappings::directDiskSwapRequest = 0;
@ -204,7 +204,7 @@ bool InputMappings::CheckKeyboardBrowseMode()
}
if (keyboard->KeyHeld(KEY_DELETE) && keyboard->KeyLCtrlAlt() )
reboot_now();
Reboot_Pi();
if (keyboard->KeyHeld(KEY_ESC))
SetKeyboardFlag(ESC_FLAG);
@ -295,7 +295,7 @@ void InputMappings::CheckKeyboardEmulationMode(unsigned numberOfImages, unsigned
return;
if (keyboard->KeyHeld(KEY_DELETE) && keyboard->KeyLCtrlAlt() )
reboot_now();
Reboot_Pi();
if (keyboard->KeyHeld(KEY_ESC))
SetKeyboardFlag(ESC_FLAG);

View file

@ -47,9 +47,7 @@
extern unsigned versionMajor;
extern unsigned versionMinor;
extern "C" {
extern void reboot_now(void);
}
extern void Reboot_Pi();
#define WaitWhile(checkStatus) \
do\
@ -1232,7 +1230,7 @@ void IEC_Commands::User(void)
break;
case 202:
// Really hard reset - reboot Pi
reboot_now();
Reboot_Pi();
break;
case '0':
//OPEN1,8,15,"U0>"+CHR$(9):CLOSE1

View file

@ -1291,6 +1291,13 @@ static void CheckOptions()
}
}
void Reboot_Pi()
{
if (screenLCD)
screenLCD->ClearInit(0);
reboot_now();
}
extern "C"
{
void kernel_main(unsigned int r0, unsigned int r1, unsigned int atags)

View file

@ -299,26 +299,9 @@ void Options::Process(char* buffer)
unsigned Options::GetDecimal(char* pString)
{
if (pString == 0 || *pString == '\0')
return INVALID_VALUE;
return 0;
unsigned nResult = 0;
char chChar = *pString++;
while (chChar != '\0' && chChar != 13)
{
if (!('0' <= chChar && chChar <= '9'))
return INVALID_VALUE;
unsigned nPrevResult = nResult;
nResult = nResult * 10 + (chChar - '0');
if (nResult < nPrevResult || nResult == INVALID_VALUE)
return INVALID_VALUE;
chChar = *pString++;
}
return nResult;
return strtol(pString, NULL, 0);
}
float Options::GetFloat(char* pString)