1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-24 05:18:36 +00:00

Adds output for modified CPC DSKs.

This commit is contained in:
Thomas Harte
2017-11-03 21:10:22 -04:00
parent e384c50580
commit 5a3ca0e447
4 changed files with 137 additions and 3 deletions
+18
View File
@@ -92,6 +92,24 @@ uint8_t FileHolder::get8() {
return static_cast<uint8_t>(fgetc(file_));
}
void FileHolder::put16be(uint16_t value) {
fputc(value >> 8, file_);
fputc(value, file_);
}
void FileHolder::put16le(uint16_t value) {
fputc(value, file_);
fputc(value >> 8, file_);
}
void FileHolder::put8(uint8_t value) {
fputc(value, file_);
}
void FileHolder::putn(size_t repeats, uint8_t value) {
while(repeats--) put8(value);
}
std::vector<uint8_t> FileHolder::read(size_t size) {
std::vector<uint8_t> result(size);
fread(result.data(), 1, size, file_);