Skip to content

Commit

Permalink
minor changes (for EOTB fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
frntc committed Dec 4, 2022
1 parent d69a190 commit f4541c7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Source/Firmware/crt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

#define CONSOLE_DEBUG

u8 tempRAWCRTBuffer[ 1032 * 1024 ];

static u8 *rawCRT = tempRAWCRTBuffer;

u32 swapBytesU32( u8 *buf )
{
return buf[ 3 ] | ( buf[ 2 ] << 8 ) | ( buf[ 1 ] << 16 ) | ( buf[ 0 ] << 24 );
Expand Down Expand Up @@ -79,7 +83,7 @@ int readCRTHeader( CLogger *logger, CRT_HEADER *crtHeader, const char *DRIVE, co

// read data in one big chunk
u32 nBytesRead;
u8 rawCRT[ 64 ];
memset( rawCRT, 0, filesize );
result = f_read( &file, rawCRT, 64, &nBytesRead );

if ( result != FR_OK )
Expand Down Expand Up @@ -161,7 +165,7 @@ void readCRTFile( CLogger *logger, CRT_HEADER *crtHeader, const char *DRIVE, con

// read data in one big chunk
u32 nBytesRead;
u8 rawCRT[ 1032 * 1024 ];
memset( rawCRT, 0, filesize );
result = f_read( &file, rawCRT, filesize, &nBytesRead );

if ( result != FR_OK )
Expand Down Expand Up @@ -547,7 +551,7 @@ int getVIC20CRTFileStartEndAddr( CLogger *logger, const char *FILENAME, u32 *ad

// read data in one big chunk
u32 nBytesRead;
u8 rawCRT[ 1032 * 1024 ];
memset( rawCRT, 0, filesize );
result = f_read( &file, rawCRT, filesize, &nBytesRead );

if ( result != FR_OK )
Expand Down Expand Up @@ -699,7 +703,7 @@ void writeChanges2CRTFile( CLogger *logger, const char *DRIVE, const char *FILEN

// read data in one big chunk
u32 nBytesRead;
u8 rawCRT[ 1025 * 1024 ];
memset( rawCRT, 0, filesize );
result = f_read( &file, rawCRT, filesize, &nBytesRead );

if ( result != FR_OK )
Expand Down

0 comments on commit f4541c7

Please sign in to comment.