Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified data/webui/device_specific/BUILD_COCO/autorun.dsk
Binary file not shown.
5 changes: 5 additions & 0 deletions lib/FileSystem/fnFsTNFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ bool FileSystemTNFS::start(const char *host, uint16_t port, const char * mountpa
return true;
}

bool FileSystemTNFS::is_started()
{
return _started;
}

bool FileSystemTNFS::exists(const char* path)
{
tnfsStat tstat;
Expand Down
1 change: 1 addition & 0 deletions lib/FileSystem/fnFsTNFS.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class FileSystemTNFS : public FileSystem
FileHandler * filehandler_open(const char* path, const char* mode = FILE_READ) override;
#endif

bool is_started();
bool exists(const char* path) override;

bool remove(const char* path) override;
Expand Down
32 changes: 28 additions & 4 deletions lib/device/drivewire/fuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "fnSystem.h"
#include "fnConfig.h"
#include "fsFlash.h"
#include "fnFsTNFS.h"
#include "fnWiFi.h"

#include "led.h"
Expand Down Expand Up @@ -1355,6 +1356,7 @@ void drivewireFuji::insert_boot_device(uint8_t d)
bIsDragon = (fnSystem.digital_read(PIN_EPROM_A14) == DIGI_HIGH && fnSystem.digital_read(PIN_EPROM_A15) == DIGI_HIGH);
#endif /* ESP_PLATFORM */

const char *boot_img = nullptr;
fnFile *fBoot = NULL;
size_t sz = 0;

Expand All @@ -1365,24 +1367,46 @@ void drivewireFuji::insert_boot_device(uint8_t d)
case 0:
if (bIsDragon)
{
fBoot = fsFlash.fnfile_open(config_atr_dragon);
boot_img = config_atr_dragon;
}
else
{
fBoot = fsFlash.fnfile_open(config_atr_coco);
boot_img = config_atr_coco;
}
fBoot = fsFlash.fnfile_open(boot_img);
break;
case 1:
fBoot = fsFlash.fnfile_open(mount_and_boot_atr);
boot_img = mount_and_boot_atr;
fBoot = fsFlash.fnfile_open(boot_img);
break;
case 2:
Debug_printf("Mounting lobby server\n");
if (!fnTNFS.is_started())
{
Debug_printf("Starting TNFS connection\n");
if (!fnTNFS.start("tnfs.fujinet.online"))
{
Debug_printf("TNFS failed to start.\n");
fBoot = NULL;
return;
}
}

Debug_printf("Opening lobby.\n");
boot_img = "/COCO/lobby.dsk";
fBoot = fnTNFS.fnfile_open(boot_img);
break;
default:
Debug_printf("Invalid boot mode: %d\n", d);
return;
}

if (fBoot)
{
fnio::fseek(fBoot, 0, SEEK_END);
sz = fnio::ftell(fBoot);
fnio::fseek(fBoot, 0, SEEK_SET);
_bootDisk.mount(fBoot, bIsDragon ? config_atr_dragon : config_atr_coco, sz);
_bootDisk.mount(fBoot, boot_img, sz);

_bootDisk.is_config_device = true;
_bootDisk.device_active = true;
Expand Down
15 changes: 11 additions & 4 deletions lib/device/iwm/fuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,12 +1282,19 @@ void iwmFuji::insert_boot_device(uint8_t d)
break;
case 2:
Debug_printf("Mounting lobby server\n");
if (fnTNFS.start("tnfs.fujinet.online"))
if (!fnTNFS.is_started())
{
Debug_printf("opening lobby.\n");
boot_img = "/APPLE2/_lobby.po";
fBoot = fnTNFS.fnfile_open(boot_img);
Debug_printf("Starting TNFS connection\n");
if (!fnTNFS.start("tnfs.fujinet.online"))
{
Debug_printf("TNFS failed to start.\n");
return;
}
}

Debug_printf("opening lobby.\n");
boot_img = "/APPLE2/_lobby.po";
fBoot = fnTNFS.fnfile_open(boot_img);
break;
default:
Debug_printf("Invalid boot mode: %d\n", d);
Expand Down
15 changes: 11 additions & 4 deletions lib/device/sio/fuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2051,12 +2051,19 @@ void sioFuji::insert_boot_device(uint8_t d)
break;
case 2:
Debug_printf("Mounting lobby server\n");
if (fnTNFS.start("tnfs.fujinet.online"))
if (!fnTNFS.is_started())
{
Debug_printf("opening lobby.\n");
fBoot = fnTNFS.fnfile_open("/ATARI/_lobby.xex");
_bootDisk.mount(fBoot, "/ATARI/_lobby.xex", 0);
Debug_printf("Starting TNFS connection\n");
if (!fnTNFS.start("tnfs.fujinet.online"))
{
Debug_printf("TNFS failed to start.\n");
return;
}
}

Debug_printf("opening lobby.\n");
fBoot = fnTNFS.fnfile_open("/ATARI/_lobby.xex");
_bootDisk.mount(fBoot, "/ATARI/_lobby.xex", 0);
break;
}
#else
Expand Down
Loading