]> Shamusworld >> Repos - thunder/blob - src/fileio.cpp
Added save states; updated application icon.
[thunder] / src / fileio.cpp
1 //
2 // fileio.cpp: File I/O functions
3 //
4 // by James Hammons
5 // (C) 2023 Underground Software
6 //
7
8 #include "fileio.h"
9
10 uint32_t ReadLong(FILE * file)
11 {
12         uint32_t r = 0;
13
14         for(int i=0; i<4; i++)
15                 r = (r << 8) | fgetc(file);
16
17         return r;
18 }
19
20 void WriteLong(FILE * file, uint32_t l)
21 {
22         for(int i=0; i<4; i++)
23         {
24                 fputc((l >> 24) & 0xFF, file);
25                 l = l << 8;
26         }
27 }
28