Skip to content

Commit f4541c7

Browse files
authored
minor changes (for EOTB fix)
1 parent d69a190 commit f4541c7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Source/Firmware/crt.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131

3232
#define CONSOLE_DEBUG
3333

34+
u8 tempRAWCRTBuffer[ 1032 * 1024 ];
35+
36+
static u8 *rawCRT = tempRAWCRTBuffer;
37+
3438
u32 swapBytesU32( u8 *buf )
3539
{
3640
return buf[ 3 ] | ( buf[ 2 ] << 8 ) | ( buf[ 1 ] << 16 ) | ( buf[ 0 ] << 24 );
@@ -79,7 +83,7 @@ int readCRTHeader( CLogger *logger, CRT_HEADER *crtHeader, const char *DRIVE, co
7983

8084
// read data in one big chunk
8185
u32 nBytesRead;
82-
u8 rawCRT[ 64 ];
86+
memset( rawCRT, 0, filesize );
8387
result = f_read( &file, rawCRT, 64, &nBytesRead );
8488

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

162166
// read data in one big chunk
163167
u32 nBytesRead;
164-
u8 rawCRT[ 1032 * 1024 ];
168+
memset( rawCRT, 0, filesize );
165169
result = f_read( &file, rawCRT, filesize, &nBytesRead );
166170

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

548552
// read data in one big chunk
549553
u32 nBytesRead;
550-
u8 rawCRT[ 1032 * 1024 ];
554+
memset( rawCRT, 0, filesize );
551555
result = f_read( &file, rawCRT, filesize, &nBytesRead );
552556

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

700704
// read data in one big chunk
701705
u32 nBytesRead;
702-
u8 rawCRT[ 1025 * 1024 ];
706+
memset( rawCRT, 0, filesize );
703707
result = f_read( &file, rawCRT, filesize, &nBytesRead );
704708

705709
if ( result != FR_OK )

0 commit comments

Comments
 (0)