Skip to content

Commit 01f306d

Browse files
committed
Spectranet comes with a rom by default
1 parent e525388 commit 01f306d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

peripherals/spectranet.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "peripherals/ula.h"
3939
#include "settings.h"
4040
#include "spectranet.h"
41+
#include "utils.h"
4142
#include "ui/ui.h"
4243

4344
#ifdef BUILD_SPECTRANET
@@ -241,6 +242,13 @@ spectranet_activate( void )
241242

242243
/* Pages 0xc0 to 0xff are the RAM */
243244
ram = memory_pool_allocate_persistent( SPECTRANET_RAM_LENGTH, 1 );
245+
246+
utils_file spectranet_rom;
247+
if( utils_read_auxiliary_file( "spectranet.rom", &spectranet_rom, UTILS_AUXILIARY_ROM ) != -1 ) {
248+
memcpy(rom, spectranet_rom.buffer, SPECTRANET_ROM_LENGTH);
249+
memcpy(ram, spectranet_rom.buffer + SPECTRANET_ROM_LENGTH, SPECTRANET_RAM_LENGTH);
250+
utils_close_file(&spectranet_rom);
251+
}
244252

245253
for( i = 0; i < SPECTRANET_RAM_LENGTH / SPECTRANET_PAGE_LENGTH; i++ ) {
246254
int base = (SPECTRANET_RAM_BASE + i) * MEMORY_PAGES_IN_4K;

roms/spectranet.rom

128 KB
Binary file not shown.

0 commit comments

Comments
 (0)