-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Log to core and split Fileops
- Loading branch information
Showing
73 changed files
with
6,022 additions
and
6,519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 60 additions & 63 deletions
123
fellow/SRC/WinFellow/INCLUDE/uart.h → fellow/SRC/WinFellow.Core/IO/Uart.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,60 @@ | ||
#pragma once | ||
|
||
#include "DEFS.H" | ||
#include <string> | ||
|
||
class UART | ||
{ | ||
private: | ||
std::string _outputFileName; | ||
FILE *_outputFile; | ||
|
||
uint16_t _serper; | ||
|
||
uint16_t _transmitBuffer; | ||
uint16_t _transmitShiftRegister; | ||
uint32_t _transmitDoneTime; | ||
bool _transmitBufferEmpty; | ||
bool _transmitShiftRegisterEmpty; | ||
|
||
uint16_t _receiveBuffer; | ||
uint16_t _receiveShiftRegister; | ||
uint32_t _receiveDoneTime; | ||
bool _receiveBufferFull; | ||
bool _receiveBufferOverrun; | ||
|
||
void InstallIOHandlers(); | ||
|
||
void ClearState(); | ||
void LoadState(FILE *F); | ||
void SaveState(FILE *F); | ||
|
||
void OpenOutputFile(); | ||
void CloseOutputFile(); | ||
|
||
bool Is8BitMode(); | ||
uint16_t GetBitPeriod(); | ||
|
||
void CopyReceiveShiftRegisterToBuffer(); | ||
void CopyTransmitBufferToShiftRegister(); | ||
uint32_t GetTransmitDoneTime(); | ||
|
||
public: | ||
static void wserper(uint16_t data, uint32_t address); | ||
static void wserdat(uint16_t data, uint32_t address); | ||
static uint16_t rserdat(uint32_t address); | ||
|
||
uint16_t ReadSerdatRegister(); | ||
void WriteSerdatRegister(uint16_t data); | ||
void WriteSerperRegister(uint16_t data); | ||
|
||
void NotifyInterruptRequestBitsChanged(uint16_t intreq); | ||
|
||
void EndOfLine(); | ||
void EndOfFrame(); | ||
|
||
void EmulationStart(); | ||
void EmulationStop(); | ||
|
||
UART(); | ||
~UART(); | ||
}; | ||
|
||
extern UART uart; | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
class Uart | ||
{ | ||
private: | ||
std::string _outputFileName; | ||
FILE *_outputFile; | ||
|
||
uint16_t _serper; | ||
|
||
uint16_t _transmitBuffer; | ||
uint16_t _transmitShiftRegister; | ||
uint32_t _transmitDoneTime; | ||
bool _transmitBufferEmpty; | ||
bool _transmitShiftRegisterEmpty; | ||
|
||
uint16_t _receiveBuffer; | ||
uint16_t _receiveShiftRegister; | ||
uint32_t _receiveDoneTime; | ||
bool _receiveBufferFull; | ||
bool _receiveBufferOverrun; | ||
|
||
void InstallIOHandlers(); | ||
|
||
void ClearState(); | ||
void LoadState(FILE *F); | ||
void SaveState(FILE *F); | ||
|
||
void OpenOutputFile(); | ||
void CloseOutputFile(); | ||
|
||
bool Is8BitMode(); | ||
uint16_t GetBitPeriod(); | ||
|
||
void CopyReceiveShiftRegisterToBuffer(); | ||
void CopyTransmitBufferToShiftRegister(); | ||
uint32_t GetTransmitDoneTime(); | ||
|
||
public: | ||
static void wserper(uint16_t data, uint32_t address); | ||
static void wserdat(uint16_t data, uint32_t address); | ||
static uint16_t rserdat(uint32_t address); | ||
|
||
uint16_t ReadSerdatRegister(); | ||
void WriteSerdatRegister(uint16_t data); | ||
void WriteSerperRegister(uint16_t data); | ||
|
||
void NotifyInterruptRequestBitsChanged(uint16_t intreq); | ||
|
||
void EndOfLine(); | ||
void EndOfFrame(); | ||
|
||
void EmulationStart(); | ||
void EmulationStop(); | ||
|
||
Uart(); | ||
~Uart(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
namespace Service | ||
{ | ||
constexpr auto FILEOPS_MAX_FILE_PATH = 260; | ||
|
||
class IFileops | ||
{ | ||
public: | ||
|
||
virtual bool GetFellowLogfileName(char*) = 0; | ||
virtual bool GetGenericFileName(char*, const char*, const char*) = 0; | ||
virtual bool GetDefaultConfigFileName(char*) = 0; | ||
virtual bool ResolveVariables(const char*, char*) = 0; | ||
virtual bool GetWinFellowPresetPath(char*, const uint32_t) = 0; | ||
virtual bool GetScreenshotFileName(char*) = 0; | ||
virtual char* GetTemporaryFilename() = 0; | ||
virtual bool GetWinFellowInstallationPath(char*, const uint32_t) = 0; | ||
virtual bool GetKickstartByCRC32(const char*, const uint32_t, char*, const uint32_t) = 0; | ||
|
||
IFileops() = default; | ||
virtual ~IFileops() = default; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <list> | ||
|
||
namespace Service | ||
{ | ||
class ILog | ||
{ | ||
public: | ||
virtual void AddLogDebug(const char* format, ...) = 0; | ||
virtual void AddLog(const char*, ...) = 0; | ||
virtual void AddLogList(const std::list<std::string>& messages) = 0; | ||
virtual void AddLog2(char* msg) = 0; | ||
|
||
ILog() = default; | ||
virtual ~ILog() = default; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.