Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
frntc authored Apr 20, 2021
1 parent 37483b5 commit 0646b50
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
6 changes: 3 additions & 3 deletions crt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ void readCRTFile( CLogger *logger, CRT_HEADER *crtHeader, const char *DRIVE, con
if ( result != FR_OK )
logger->Write( "RaspiFlash", LogPanic, "Cannot open file: %s", FILENAME );

if ( filesize > 1025 * 1024 )
filesize = 1025 * 1024;
if ( filesize > 1032 * 1024 )
filesize = 1032 * 1024;

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

if ( result != FR_OK )
Expand Down
25 changes: 15 additions & 10 deletions kernel_ef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ typedef struct
static unsigned char kernalROM[ 8192 ] AAA;

// ... flash
u8 flash_cacheoptimized_pool[ 1024 * 1024 + 1024 ] AAA;
u8 flash_cacheoptimized_pool[ 1024 * 1024 + 8 * 1024 ] AAA;

static volatile EFSTATE ef AAA;

Expand Down Expand Up @@ -315,7 +315,7 @@ void initEF()
}
if ( ef.bankswitchType == BS_MAGICDESK )
{
ef.reg2 = 4 + 2;
ef.reg2 = 128 + 4 + 2;
}

ef.flashBank = &ef.flash_cacheoptimized[ ef.reg0 * 8192 * 2 ];
Expand Down Expand Up @@ -1717,9 +1717,18 @@ void CKernelEF::FIQHandler (void *pParam)
} else
{
// Magic Desk
if ( ef.nBanks <= 64 )
ef.reg0 = (u8)( D & 63 ); else
ef.reg0 = (u8)( D & 127 );
if( GET_IO12_ADDRESS == 0 )
{
if ( !( D & 128 ) )
{
if ( ef.nBanks <= 64 )
ef.reg0 = (u8)( D & 63 ); else
ef.reg0 = (u8)( D & 127 );
ef.reg2 = 128 + 4 + 2;
} else
ef.reg2 = 4 + 0;
}

ef.flashBank = &ef.flash_cacheoptimized[ ef.reg0 * 8192 ];

// if the EF-ROM does not fit into the RPi's cache: stall the CPU with a DMA and prefetch the data
Expand All @@ -1731,18 +1740,14 @@ void CKernelEF::FIQHandler (void *pParam)
prefetchHeuristic();
}

if ( !(D & 128) )
ef.reg2 = 128 + 4 + 2; else
ef.reg2 = 4 + 0;

setGAMEEXROM();
}

setLatchFIQ( LED_IO1 );
goto cleanup;
}

if ( CPU_WRITES_TO_BUS && IO2_ACCESS )
if ( CPU_WRITES_TO_BUS && IO2_ACCESS && ef.bankswitchType == BS_EASYFLASH )
{
READ_D0to7_FROM_BUS( D )
ef.ram[ GET_IO12_ADDRESS ] = D;
Expand Down
2 changes: 1 addition & 1 deletion lowlevel_arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern u32 hasSIDKick;
extern u32 machine264;

// #cycles the C64 is delayed for prefetching data (a little bit less should be OK)
#define NUM_DMA_CYCLES (2)
#define NUM_DMA_CYCLES (10)


#define PMCCFILTR_NSH_EN_BIT 27
Expand Down

0 comments on commit 0646b50

Please sign in to comment.