2018-02-07 15:20:26 +00:00
|
|
|
#ifndef __BIOS_H
|
|
|
|
#define __BIOS_H
|
|
|
|
|
|
|
|
#ifdef TEENSYDUINO
|
|
|
|
#include <Arduino.h>
|
|
|
|
#else
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define BIOS_MAXFILES 10 // number of files in a page of listing
|
2020-07-13 21:27:07 +00:00
|
|
|
#define BIOS_MAXPATH 60 // maximum length of a single filename that we'll support
|
2018-02-07 15:20:26 +00:00
|
|
|
|
|
|
|
class BIOS {
|
|
|
|
public:
|
|
|
|
BIOS();
|
|
|
|
~BIOS();
|
|
|
|
|
2020-12-28 19:23:47 +00:00
|
|
|
// return true as long as it's still running
|
|
|
|
bool loop();
|
2018-02-07 15:20:26 +00:00
|
|
|
|
|
|
|
private:
|
2020-12-28 19:23:47 +00:00
|
|
|
uint16_t MainMenuHandler();
|
|
|
|
|
2018-02-07 15:20:26 +00:00
|
|
|
void DrawMenuBar();
|
|
|
|
void DrawCurrentMenu();
|
2018-02-07 18:13:07 +00:00
|
|
|
void DrawAiieMenu();
|
2018-02-07 15:20:26 +00:00
|
|
|
void DrawVMMenu();
|
|
|
|
void DrawHardwareMenu();
|
|
|
|
void DrawDisksMenu();
|
|
|
|
|
2020-12-28 19:23:47 +00:00
|
|
|
uint16_t AiieMenuHandler(bool needsRedraw, bool performAction);
|
|
|
|
uint16_t VmMenuHandler(bool needsRedraw, bool performAction);
|
|
|
|
uint16_t HardwareMenuHandler(bool needsRedraw, bool performAction);
|
|
|
|
uint16_t DisksMenuHandler(bool needsRedraw, bool performAction);
|
|
|
|
uint16_t AboutScreenHandler(bool needsRedraw, bool performAction);
|
|
|
|
uint16_t PaddlesScreenHandler(bool needsRedraw, bool performAction);
|
|
|
|
uint16_t SelectFileScreenHandler(bool needsRedraw, bool performAction);
|
|
|
|
|
2018-02-07 15:20:26 +00:00
|
|
|
uint8_t GetAction(int8_t prevAction);
|
|
|
|
bool isActionActive(int8_t action);
|
|
|
|
|
|
|
|
int8_t getCurrentMenuAction();
|
|
|
|
|
|
|
|
void WarmReset();
|
|
|
|
void ColdReboot();
|
|
|
|
|
2020-07-11 11:39:56 +00:00
|
|
|
uint16_t DrawDiskNames(uint8_t page, int8_t selection, const char *filter);
|
|
|
|
uint16_t GatherFilenames(uint8_t pageOffset, const char *filter);
|
2018-02-07 15:20:26 +00:00
|
|
|
|
|
|
|
void stripDirectory();
|
|
|
|
|
2020-07-11 11:39:56 +00:00
|
|
|
uint16_t cacheAllEntries(const char *filter);
|
2020-07-11 23:43:00 +00:00
|
|
|
void sortCachedEntries();
|
|
|
|
void swapCacheEntries(int a, int b);
|
2020-07-11 11:39:56 +00:00
|
|
|
|
2018-02-07 15:20:26 +00:00
|
|
|
private:
|
|
|
|
int8_t selectedFile;
|
|
|
|
char fileDirectory[BIOS_MAXFILES][BIOS_MAXPATH+1];
|
|
|
|
|
|
|
|
char rootPath[255-BIOS_MAXPATH];
|
|
|
|
|
|
|
|
int8_t selectedMenu;
|
|
|
|
int8_t selectedMenuItem;
|
|
|
|
uint8_t currentCPUSpeedIndex;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|