Skip to content

Commit b12e775

Browse files
authored
Add files via upload
1 parent 60554ea commit b12e775

File tree

8 files changed

+1293
-275
lines changed

8 files changed

+1293
-275
lines changed

Source/Firmware/dirscan.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{_________ {______________ Expansion Unit
1010
1111
RADExp - A framework for DMA interfacing with Commodore C64/C128 computers using a Raspberry Pi Zero 2 or 3A+/3B+
12-
Copyright (c) 2022 Carsten Dachsbacher <[email protected]>
12+
Copyright (c) 2022-2025 Carsten Dachsbacher <[email protected]>
1313
1414
This program is free software: you can redistribute it and/or modify
1515
it under the terms of the GNU General Public License as published by
@@ -44,6 +44,7 @@ extern CLogger *logger;
4444
#define REUDIR_DIRECTORY 0x08
4545
#define REUDIR_DUMMYNEW 0x10
4646
#define REUDIR_TOPARENT 0x20
47+
#define REUDIR_VSFIMAGE 0x40
4748

4849
u32 rdSectionFirst, rdSectionLast;
4950

@@ -117,6 +118,8 @@ void makeFormattedName( REUDIRENTRY *d )
117118
if ( strstr( (char*)fn_up, ".PRG" ) ||
118119
strstr( (char*)fn_up, ".REU" ) )
119120
filename[ strlen( filename ) - 4 ] = 0;
121+
if ( strstr( (char*)fn_up, ".VSF" ) )
122+
filename[ strlen( filename ) - 4 ] = 0;
120123
if ( strstr( (char*)fn_up, ".GEORAM" ) )
121124
filename[ strlen( filename ) - 7 ] = 0;
122125

@@ -217,6 +220,14 @@ bool ListDirectoryContents( const char *sDir, REUDIRENTRY *d, u32 *n, u32 *nElem
217220
sort[ sortCur++ ].f = REUDIR_REUIMAGE;
218221
nAdditionalEntries ++;
219222
}
223+
if ( strstr( FileInfo.fname, ".vsf" ) > 0 || strstr( FileInfo.fname, ".VSF" ) > 0 )
224+
{
225+
strcpy( (char*)sort[sortCur].path, sDir );
226+
strcpy( (char*)sort[sortCur].filename, FileInfo.fname );
227+
sort[ sortCur ].size = FileInfo.fsize;
228+
sort[ sortCur++ ].f = REUDIR_VSFIMAGE;
229+
nAdditionalEntries ++;
230+
}
220231
if ( strstr( FileInfo.fname, ".georam" ) > 0 || strstr( FileInfo.fname, ".GEORAM" ) > 0 )
221232
{
222233
strcpy( (char*)sort[sortCur].path, sDir );
@@ -484,6 +495,7 @@ void saveCurrentCursor()
484495

485496
REUDIRENTRY *e = &files[ curPosition ];
486497
if ( e->f & REUDIR_REUIMAGE ||
498+
e->f & REUDIR_VSFIMAGE ||
487499
e->f & REUDIR_GEOIMAGE ||
488500
e->f & REUDIR_PRG )
489501
{
@@ -550,6 +562,7 @@ u32 handleKey( int k )
550562
saveCurrentCursor();
551563
} else
552564
if ( e->f & REUDIR_REUIMAGE ||
565+
e->f & REUDIR_VSFIMAGE ||
553566
e->f & REUDIR_GEOIMAGE ||
554567
e->f & REUDIR_PRG )
555568
{
@@ -571,6 +584,11 @@ u32 handleKey( int k )
571584

572585
if ( e->f & REUDIR_REUIMAGE )
573586
return REUMENU_SELECT_FILE_REU; else
587+
if ( e->f & REUDIR_VSFIMAGE )
588+
{
589+
k = VK_SHIFT_RETURN;
590+
return REUMENU_SELECT_FILE_VSF;
591+
} else
574592
if ( e->f & REUDIR_GEOIMAGE )
575593
return REUMENU_SELECT_FILE_GEO; else
576594
return REUMENU_SELECT_FILE_PRG;

Source/Firmware/dirscan.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{_________ {______________ Expansion Unit
1010
1111
RADExp - A framework for DMA interfacing with Commodore C64/C128 computers using a Raspberry Pi Zero 2 or 3A+/3B+
12-
Copyright (c) 2022 Carsten Dachsbacher <[email protected]>
12+
Copyright (c) 2022-2025 Carsten Dachsbacher <[email protected]>
1313
1414
This program is free software: you can redistribute it and/or modify
1515
it under the terms of the GNU General Public License as published by
@@ -76,8 +76,9 @@ extern void unmarkAllFiles();
7676
#define REUMENU_SELECT_FILE_GEO (2<<24)
7777
#define REUMENU_SELECT_FILE_PRG (3<<24)
7878
#define REUMENU_PLAY_NUVIE_REU (4<<24)
79-
#define REUMENU_START_GEORAM (5<<24)
80-
#define REUMENU_CREATE_IMAGE (1<<26)
79+
#define REUMENU_START_GEORAM (5<<24)
80+
#define REUMENU_SELECT_FILE_VSF (6<<24)
81+
#define REUMENU_CREATE_IMAGE (1<<26)
8182

8283
extern char dirSelectedFile[ 1024 ];
8384
extern char dirSelectedName[ 1024 ];

Source/Firmware/handle_transfer.h

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{_________ {______________ Expansion Unit
1010
1111
RADExp - A framework for DMA interfacing with Commodore C64/C128 computers using a Raspberry Pi Zero 2 or 3A+/3B+
12-
Copyright (c) 2022 Carsten Dachsbacher <[email protected]>
12+
Copyright (c) 2022-2025 Carsten Dachsbacher <[email protected]>
1313
1414
This program is free software: you can redistribute it and/or modify
1515
it under the terms of the GNU General Public License as published by
@@ -25,6 +25,9 @@
2525
along with this program. If not, see <http://www.gnu.org/licenses/>.
2626
2727
*/
28+
29+
//#define USE_OLD_CACHE_PRELOADING_SCHEME
30+
2831
#define COMMON_ENTRY_IN_TRANSFER
2932

3033
#pragma GCC diagnostic push
@@ -45,7 +48,11 @@ reu.incrC64 = reu.addrREUCtrl & REU_ADDR_FIX_C64 ? 0 : 1;
4548
reu.incrREU = reu.addrREUCtrl & REU_ADDR_FIX_REU ? 0 : 1;
4649

4750
register u32 next_r_a, temp_r_a;
48-
register u8 newStatus = 0, x, y, tmp;
51+
register u8 newStatus = 0, x, y;
52+
53+
#ifdef USE_OLD_CACHE_PRELOADING_SCHEME
54+
register u8 tmp;
55+
#endif
4956

5057
//#define REU_PROTOCOL
5158
#ifdef REU_PROTOCOL
@@ -86,15 +93,18 @@ case REU_COMMAND_TRANSFER_TO_REU: // stash: c64->reu
8693
while ( l )
8794
{
8895
reuPrefetchW( r_a );
89-
emuReadByteREU_p1( g2, c_a );
90-
emuReadByteREU_p2( g2 );
96+
//emuReadByteREU_p1( g2, c_a );
97+
//emuReadByteREU_p2( g2 );
98+
DMA_READBYTE_P1( c_a );
99+
DMA_READBYTE_P2();
91100
if ( l < length )
92101
reuStore( temp_r_a, x );
93102
l --;
94103
temp_r_a = r_a; REU_INCREMENT_ADDRESS( r_a );
95104
reuPrefetchW( r_a + 64 );
96105
REU_INCREMENT_C64ADDRESS( c_a );
97-
emuReadByteREU_p3( g2, x, (l==0) );
106+
//emuReadByteREU_p3( g2, x, (l==0) );
107+
DMA_READBYTE_P3( x, (l==0) );
98108
}
99109
reuStore( temp_r_a, x );
100110

@@ -130,25 +140,36 @@ case REU_COMMAND_TRANSFER_TO_C64: // fetch: c64<-reu
130140
CACHE_PRELOADL1STRM( &reuMemory[ r_a & ( reu.wrapAroundDRAM - 1 ) ] );
131141
for ( int i = 0; i < 8; i++ )
132142
{
143+
#ifdef USE_OLD_CACHE_PRELOADING_SCHEME
133144
reu.nextREUByte = reuLoad( r_a );
145+
#endif
134146
WAIT_FOR_CPU_HALFCYCLE
135147
WAIT_FOR_VIC_HALFCYCLE
136148
RESTART_CYCLE_COUNTER
137149
}
138150
} else
139151
#endif
140152
{
153+
#ifdef USE_OLD_CACHE_PRELOADING_SCHEME
141154
reu.nextREUByte = reuLoad( r_a );
155+
#endif
142156
}
143157

144158
while ( l )
145159
{
146160
next_r_a = REU_GET_NEXT_ADDRESS( r_a );
147161
reuPrefetchL1( next_r_a );
148162
l --;
149-
emuWriteByteREU_p1( g2, c_a, reu.nextREUByte );
150-
reu.nextREUByte = reuLoad( next_r_a ); r_a = next_r_a; reuPrefetchL1( r_a ); reuPrefetchL1( r_a + 64 );
151-
emuWriteByteREU_p2( g2, (l==0) );
163+
//emuWriteByteREU_p1( g2, c_a, reu.nextREUByte );
164+
#ifdef USE_OLD_CACHE_PRELOADING_SCHEME
165+
DMA_WRITEBYTE_P1( c_a, reu.nextREUByte );
166+
reu.nextREUByte = reuLoad( next_r_a );
167+
#else
168+
DMA_WRITEBYTE_P1( c_a, ( ( ( r_a & (reu.wrapAroundDRAM - 1) ) < reu.reuSize ) ? reuMemory[ ( r_a & (reu.wrapAroundDRAM - 1) ) ] : 0xff ) );
169+
#endif
170+
r_a = next_r_a; reuPrefetchL1( r_a ); reuPrefetchL1( r_a + 64 );
171+
//emuWriteByteREU_p2( g2, (l==0) );
172+
DMA_WRITEBYTE_P2( (l==0) );
152173

153174
REU_INCREMENT_C64ADDRESS( c_a );
154175
}
@@ -171,14 +192,26 @@ case REU_COMMAND_TRANSFER_SWAP: // swap: c64<->reu
171192
while ( l )
172193
{
173194
reuPrefetchL1( r_a );
174-
emuReadByteREU_p1( g2, c_a );
175-
emuReadByteREU_p2( g2 );
176-
{tmp = reuLoad( r_a ); next_r_a = REU_GET_NEXT_ADDRESS( r_a ); reuPrefetchL1( next_r_a );l --; reuPrefetchL1( r_a + 64 ); }
177-
emuReadByteREU_p3( g2, x, false );
178-
179-
emuWriteByteREU_p1( g2, c_a, tmp );
195+
//emuReadByteREU_p1( g2, c_a );
196+
//emuReadByteREU_p2( g2 );
197+
DMA_READBYTE_P1( c_a );
198+
DMA_READBYTE_P2();
199+
#ifdef USE_OLD_CACHE_PRELOADING_SCHEME
200+
tmp = reuLoad( r_a );
201+
#endif
202+
next_r_a = REU_GET_NEXT_ADDRESS( r_a ); reuPrefetchL1( next_r_a );l --; reuPrefetchL1( r_a + 64 );
203+
//emuReadByteREU_p3( g2, x, false );
204+
DMA_READBYTE_P3( x, false );
205+
206+
//emuWriteByteREU_p1( g2, c_a, tmp );
207+
#ifdef USE_OLD_CACHE_PRELOADING_SCHEME
208+
DMA_WRITEBYTE_P1( c_a, tmp );
209+
#else
210+
DMA_WRITEBYTE_P1( c_a, ( ( ( r_a & (reu.wrapAroundDRAM - 1) ) < reu.reuSize ) ? reuMemory[ ( r_a & (reu.wrapAroundDRAM - 1) ) ] : 0xff ) );
211+
#endif
180212
{reuStore( r_a, x ); r_a = next_r_a; REU_INCREMENT_C64ADDRESS( c_a ); }
181-
emuWriteByteREU_p2( g2, (l==0) );
213+
//emuWriteByteREU_p2( g2, (l==0) );
214+
DMA_WRITEBYTE_P2( (l==0) );
182215

183216
}
184217

0 commit comments

Comments
 (0)