1
- /* Arduino wrapper for DoomGeneric
2
- * Mouse and keyboard controls are not implemented at the moment;
3
- * to use the internal QSPI flash as storage, force the board in bootloader mode
4
- * by double clicking the reset button and upload doom.fat.dump (from doom/utils folder)
5
- * with this command
6
- *
7
- * dfu-util -a1 --device 0x2341:0x035b -D doom.fat.dump --dfuse-address=0x90000000
8
- */
1
+ /*
2
+ Arduino wrapper for DoomGeneric
3
+ Mouse and keyboard controls are not implemented at the moment.
4
+
5
+ To use the internal QSPI flash as storage, run Portenta_WiFiFirmwareUpdater
6
+ sketch once to create the partitions, AccessFlashAsUSBDisk to expose the QSPI flash
7
+ as a USB disk, copy DOOM1.WAD in the biggest partition, flash this sketch and you are ready to go :)
8
+ */
9
9
10
10
#include " QSPIFBlockDevice.h"
11
11
#include " FATFileSystem.h"
12
+ #include " MBRBlockDevice.h"
12
13
#include " doomgeneric.h"
13
14
14
- QSPIFBlockDevice block_device (PD_11, PD_12, PF_7, PD_13, PF_10, PG_6, QSPIF_POLARITY_MODE_1, 40000000 ) ;
15
+ QSPIFBlockDevice block_device;
15
16
// Comment previous line and uncomment these two if you want to store DOOM.WAD in an external SD card (FAT32 formatted)
16
17
// #include "SDMMCBlockDevice.h"
17
18
// SDMMCBlockDevice block_device;
18
19
19
- mbed::FATFileSystem fs (" fs" );
20
+ mbed::MBRBlockDevice fs_data (&block_device, 2 );
21
+ static mbed::FATFileSystem fs (" fs" );
20
22
21
23
extern " C" int main_wrapper (int argc, char **argv);
22
24
char *argv[] = {" /fs/doom" , " -iwad" , " /fs/DOOM1.WAD" };
23
25
24
26
void setup () {
25
- // put your setup code here, to run once:
26
- delay (2000 );
27
- int err = fs.mount (&block_device);
27
+ int err = fs.mount (&fs_data);
28
28
if (err) {
29
- // Reformat if we can't mount the filesystem
30
- // this should only happen on the first boot
31
- printf (" No filesystem found, formatting... " );
32
- fflush (stdout);
33
- err = fs.reformat (&block_device);
29
+ printf (" No filesystem found, please run AccessFlashAsUSBDisk sketch and copy DOOM1.WAD in the big partition" );
30
+ pinMode (LEDB, OUTPUT);
31
+ while (1 ) {
32
+ digitalWrite (LEDB, LOW);
33
+ delay (100 );
34
+ digitalWrite (LEDB, HIGH);
35
+ delay (100 );
36
+ }
34
37
}
35
38
DIR *dir;
36
39
struct dirent *ent;
@@ -51,4 +54,4 @@ void setup() {
51
54
void loop () {
52
55
// put your main code here, to run repeatedly:
53
56
54
- }
57
+ }
0 commit comments