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
14 changes: 7 additions & 7 deletions lib/bus/drivewire/drivewire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ void systemBus::op_reset()
Debug_printv("op_reset()");

// When a reset transaction occurs, set the mounted disk image to the CONFIG disk image.
theFuji.boot_config = true;
theFuji.insert_boot_device(Config.get_general_boot_mode());
theFuji->boot_config = true;
theFuji->insert_boot_device(Config.get_general_boot_mode());
if (pNamedObjFp != NULL)
{
fclose(pNamedObjFp);
Expand Down Expand Up @@ -182,10 +182,10 @@ void systemBus::op_readex()
if (true==bDragon && drive_num>=5) drive_num = drive_num-5;
Debug_printf("OP_READ: DRIVE %3u - SECTOR %8lu\n", drive_num, lsn);

if (theFuji.boot_config && drive_num == 0)
d = theFuji.bootdisk();
if (theFuji->boot_config && drive_num == 0)
d = theFuji->bootdisk();
else
d = &theFuji.get_disks(drive_num)->disk_dev;
d = &theFuji->get_disk(drive_num)->disk_dev;

if (!d)
{
Expand Down Expand Up @@ -306,7 +306,7 @@ void systemBus::op_write()

Debug_printf("OP_WRITE DRIVE %3u - SECTOR %8lu\n", drive_num, lsn);

d = &theFuji.get_disks(drive_num)->disk_dev;
d = &theFuji->get_disk(drive_num)->disk_dev;

if (!d)
{
Expand Down Expand Up @@ -334,7 +334,7 @@ void systemBus::op_write()

void systemBus::op_fuji()
{
theFuji.process();
theFuji->process();
}

void systemBus::op_cpm()
Expand Down
2 changes: 1 addition & 1 deletion lib/bus/iec/iec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void systemBus::service()
bool error = false, active = false;
for(int i = 0; i < MAX_DISK_DEVICES; i++)
{
iecDrive *d = &(theFuji.get_disks(i)->disk_dev);
iecDrive *d = &(theFuji->get_disk(i)->disk_dev);
error |= d->hasError();
active |= d->getNumOpenChannels()>0;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/bus/iwm/iwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,6 @@ class systemBus

extern systemBus SYSTEM_BUS;

#define IWM_ACTIVE_DISK2 ((iwmDisk2 *) theFuji.get_disk_dev(MAX_SPDISK_DEVICES + diskii_xface.iwm_active_drive() - 1))
#define IWM_ACTIVE_DISK2 ((iwmDisk2 *) theFuji->get_disk_dev(MAX_SPDISK_DEVICES + diskii_xface.iwm_active_drive() - 1))
#endif // guard
#endif /* BUILD_APPLE */
18 changes: 9 additions & 9 deletions lib/bus/mac/mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ void systemBus::service(void)
case 0:
// set direction to increase track number
Debug_printf("%c", 'I');
theFuji.get_disks(4)->disk_dev.set_dir(+1);
theFuji->get_disk(4)->disk_dev.set_dir(+1);
// fnUartBUS.write('I');
// fnUartBUS.flush();
break;
case 4:
// set direction to decrease track number
Debug_printf("%c", 'D');
theFuji.get_disks(4)->disk_dev.set_dir(-1);
theFuji->get_disk(4)->disk_dev.set_dir(-1);
// fnUartBUS.write('D');
// fnUartBUS.flush();
break;
Expand All @@ -81,7 +81,7 @@ void systemBus::service(void)
{
t0 = fnSystem.micros();
track_not_copied = true;
int track_position = theFuji.get_disks(4)->disk_dev.step();
int track_position = theFuji->get_disk(4)->disk_dev.step();
if (track_position < 0)
{
fnUartBUS.write('N');
Expand Down Expand Up @@ -110,7 +110,7 @@ void systemBus::service(void)
// eject
Debug_printf("\neject - unmounting");
floppy_ll.stop();
theFuji.get_disks(4)->disk_dev.unmount();
theFuji->get_disk(4)->disk_dev.unmount();
fnUartBUS.write('E');
// fnUartBUS.flush();
break;
Expand All @@ -136,7 +136,7 @@ void systemBus::service(void)
case 'R':
case 'T':
case 'W':
theFuji.get_disks(_active_DCD_disk)->disk_dev.process(c);
theFuji->get_disk(_active_DCD_disk)->disk_dev.process(c);
break;
default:
break;
Expand All @@ -145,7 +145,7 @@ void systemBus::service(void)
}
if (track_not_copied && stepper_timeout())
{
theFuji.get_disks(4)->disk_dev.update_track_buffers();
theFuji->get_disk(4)->disk_dev.update_track_buffers();
track_not_copied = false;
fnUartBUS.write('S');
}
Expand Down Expand Up @@ -733,7 +733,7 @@ void IRAM_ATTR iwmBus::service()
break;
case iwm_enable_state_t::off2on:
// need to start a counter and wait to turn on enable output after 1 ms only iff enable state is on
if (theFuji._fnDisk2s[diskii_xface.iwm_enable_states() - 1].device_active)
if (theFuji->_fnDisk2s[diskii_xface.iwm_enable_states() - 1].device_active)
{
fnSystem.delay(1); // need a better way to figure out persistence
if (iwm_drive_enabled() == iwm_enable_state_t::on)
Expand All @@ -750,7 +750,7 @@ void IRAM_ATTR iwmBus::service()
return; // return so the SP code doesn't get checked
case iwm_enable_state_t::on:
#ifdef DEBUG
new_track = theFuji._fnDisk2s[diskii_xface.iwm_enable_states() - 1].get_track_pos();
new_track = theFuji->_fnDisk2s[diskii_xface.iwm_enable_states() - 1].get_track_pos();
if (old_track != new_track)
{
Debug_printf("\ntrk pos %03d on d%d", new_track, diskii_xface.iwm_enable_states());
Expand Down Expand Up @@ -817,7 +817,7 @@ void iwmBus::handle_init()
// tell the Fuji it's device no.
if (it == _daisyChain.begin())
{
theFuji._devnum = command_packet.dest;
theFuji->_devnum = command_packet.dest;
}
// assign dev numbers
pDevice = (*it);
Expand Down
2 changes: 1 addition & 1 deletion lib/console/Commands/VFSCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ int mount(int argc, char **argv)
int did = atoi(argv[1]);
fprintf(stdout, "Mounted %d -> %s\r\n", did, argv[2]);

theFuji.mount_all();
theFuji->mount_all();

return EXIT_SUCCESS;
}
Expand Down
5 changes: 3 additions & 2 deletions lib/device/adamnet/adamFuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

#define COPY_SIZE 532

adamFuji theFuji; // global fuji device object
adamFuji platformFuji;
adamFuji *theFuji = &platformFuji; // global fuji device object
adamNetwork *theNetwork; // global network device object (temporary)
adamNetwork *theNetwork2; // another network device
adamPrinter *thePrinter; // global printer
Expand Down Expand Up @@ -1308,7 +1309,7 @@ void adamFuji::setup()
theSerial = new adamSerial();
SYSTEM_BUS.addDevice(theNetwork, 0x09); // temporary.
SYSTEM_BUS.addDevice(theNetwork2, 0x0A); // temporary
SYSTEM_BUS.addDevice(&theFuji, 0x0F); // Fuji becomes the gateway device.
SYSTEM_BUS.addDevice(theFuji, 0x0F); // Fuji becomes the gateway device.
}

// Mount all
Expand Down
6 changes: 3 additions & 3 deletions lib/device/adamnet/adamFuji.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class adamFuji : public virtualDevice
int get_disk_id(int drive_slot);
std::string get_host_prefix(int host_slot);

fujiHost *get_hosts(int i) { return &_fnHosts[i]; }
fujiDisk *get_disks(int i) { return &_fnDisks[i]; }
fujiHost *get_host(int i) { return &_fnHosts[i]; }
fujiDisk *get_disk(int i) { return &_fnDisks[i]; }
fujiHost *set_slot_hostname(int host_slot, char *hostname);

void _populate_slots_from_config();
Expand All @@ -133,7 +133,7 @@ class adamFuji : public virtualDevice
TaskHandle_t copy_task_handle;
};

extern adamFuji theFuji;
extern adamFuji *theFuji;
extern adamSerial *theSerial;

#endif // FUJI_H
5 changes: 3 additions & 2 deletions lib/device/comlynx/lynxFuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

#define COPY_SIZE 532

lynxFuji theFuji; // global fuji device object
lynxFuji platformFuji;
lynxFuji *theFuji = &platformFuji; // global fuji device object
lynxNetwork *theNetwork; // global network device object (temporary)
lynxPrinter *thePrinter; // global printer
lynxSerial *theSerial; // global serial
Expand Down Expand Up @@ -1351,7 +1352,7 @@ void lynxFuji::setup()
// Disable status_wait if our settings say to turn it off
status_wait_enabled = false;
SYSTEM_BUS.addDevice(&_fnDisks[0].disk_dev, 4);
SYSTEM_BUS.addDevice(&theFuji, 0x0F); // Fuji becomes the gateway device.
SYSTEM_BUS.addDevice(theFuji, 0x0F); // Fuji becomes the gateway device.
theNetwork = new lynxNetwork();
SYSTEM_BUS.addDevice(theNetwork, 0x09); // temporary.
}
Expand Down
6 changes: 3 additions & 3 deletions lib/device/comlynx/lynxFuji.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class lynxFuji : public virtualDevice
int get_disk_id(int drive_slot);
std::string get_host_prefix(int host_slot);

fujiHost *get_hosts(int i) { return &_fnHosts[i]; }
fujiDisk *get_disks(int i) { return &_fnDisks[i]; }
fujiHost *get_host(int i) { return &_fnHosts[i]; }
fujiDisk *get_disk(int i) { return &_fnDisks[i]; }
fujiHost *set_slot_hostname(int host_slot, char *hostname);

void _populate_slots_from_config();
Expand All @@ -133,7 +133,7 @@ class lynxFuji : public virtualDevice
TaskHandle_t copy_task_handle;
};

extern lynxFuji theFuji;
extern lynxFuji *theFuji;
extern lynxSerial *theSerial;

#endif // FUJI_H
3 changes: 2 additions & 1 deletion lib/device/cx16_i2c/cx16Fuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#include "utils.h"
#include "string_utils.h"

cx16Fuji theFuji; // global fuji device object
cx16Fuji platformFuji;
cx16Fuji *theFuji = &platformFuji; // global fuji device object

using namespace std;

Expand Down
6 changes: 3 additions & 3 deletions lib/device/cx16_i2c/cx16Fuji.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class cx16Fuji : public virtualDevice
int get_disk_id(int drive_slot);
std::string get_host_prefix(int host_slot);

fujiHost *get_hosts(int i) { return &_fnHosts[i]; }
fujiDisk *get_disks(int i) { return &_fnDisks[i]; }
fujiHost *get_host(int i) { return &_fnHosts[i]; }
fujiDisk *get_disk(int i) { return &_fnDisks[i]; }
fujiHost *set_slot_hostname(int host_slot, char *hostname);

void _populate_slots_from_config();
Expand All @@ -97,6 +97,6 @@ class cx16Fuji : public virtualDevice
cx16Fuji();
};

extern cx16Fuji theFuji;
extern cx16Fuji *theFuji;

#endif /* FUJI_H */
5 changes: 1 addition & 4 deletions lib/device/cx16_i2c/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#define SIO_DISKCMD_PERCOM_READ 0x4E
#define SIO_DISKCMD_PERCOM_WRITE 0x4F

// External ref to fuji object.
extern cx16Fuji theFuji;

cx16Disk::cx16Disk()
{
device_active = false;
Expand Down Expand Up @@ -195,7 +192,7 @@ void cx16Disk::process(uint32_t commanddata, uint8_t checksum)
case SIO_DISKCMD_HSIO_STATUS:
if (is_config_device == true)
{
if (theFuji.boot_config == true)
if (theFuji->boot_config == true)
{
}
}
Expand Down
3 changes: 0 additions & 3 deletions lib/device/drivewire/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#include "fujiDevice.h"
#include "utils.h"

// External ref to fuji object.
extern drivewireFuji theFuji;

drivewireDisk::drivewireDisk()
{
device_active = false;
Expand Down
5 changes: 3 additions & 2 deletions lib/device/drivewire/drivewireFuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

#define ADDITIONAL_DETAILS_BYTES 13

drivewireFuji theFuji; // global fuji device object
drivewireFuji platformFuji;
drivewireFuji *theFuji = &platformFuji; // global fuji device object

// drivewireDisk drivewireDiskDevs[MAX_HOSTS];
drivewireNetwork drivewireNetDevs[MAX_NETWORK_DEVICES];
Expand Down Expand Up @@ -1660,7 +1661,7 @@ void drivewireFuji::hash_clear()
// Initializes base settings and adds our devices to the DRIVEWIRE bus
void drivewireFuji::setup()
{
Debug_printf("theFuji.setup()\n");
Debug_printf("theFuji->setup()\n");
// set up Fuji device
_populate_slots_from_config();

Expand Down
6 changes: 3 additions & 3 deletions lib/device/drivewire/drivewireFuji.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ class drivewireFuji : public virtualDevice
int get_disk_id(int drive_slot);
std::string get_host_prefix(int host_slot);

fujiHost *get_hosts(int i) { return &_fnHosts[i]; }
fujiDisk *get_disks(int i) { return &_fnDisks[i]; }
fujiHost *get_host(int i) { return &_fnHosts[i]; }
fujiDisk *get_disk(int i) { return &_fnDisks[i]; }
fujiHost *set_slot_hostname(int host_slot, char *hostname);

void _populate_slots_from_config();
Expand All @@ -146,6 +146,6 @@ class drivewireFuji : public virtualDevice
drivewireFuji();
};

extern drivewireFuji theFuji;
extern drivewireFuji *theFuji;

#endif // FUJI_H
3 changes: 2 additions & 1 deletion lib/device/h89/H89Fuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

#define ADDITIONAL_DETAILS_BYTES 12

H89Fuji theFuji; // global fuji device object
H89Fuji platformFuji;
H89Fuji *theFuji = &platformFuji; // global fuji device object
H89Network *theNetwork; // global network device object (temporary)
H89Printer *thePrinter; // global printer

Expand Down
6 changes: 3 additions & 3 deletions lib/device/h89/H89Fuji.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class H89Fuji : public virtualDevice
int get_disk_id(int drive_slot);
std::string get_host_prefix(int host_slot);

fujiHost *get_hosts(int i) { return &_fnHosts[i]; }
fujiDisk *get_disks(int i) { return &_fnDisks[i]; }
fujiHost *get_host(int i) { return &_fnHosts[i]; }
fujiDisk *get_disk(int i) { return &_fnDisks[i]; }
fujiHost *set_slot_hostname(int host_slot, char *hostname);

void _populate_slots_from_config();
Expand All @@ -111,6 +111,6 @@ class H89Fuji : public virtualDevice
H89Fuji();
};

extern H89Fuji theFuji;
extern H89Fuji *theFuji;

#endif // FUJI_H
3 changes: 2 additions & 1 deletion lib/device/iec/iecFuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
#define FF_DIR 0x01
#define FF_TRUNC 0x02

iecFuji theFuji; // global fuji device object
iecFuji platformFuji;
iecFuji *theFuji = &platformFuji; // global fuji device object
// iecNetwork sioNetDevs[MAX_NETWORK_DEVICES];

bool _validate_host_slot(uint8_t slot, const char *dmsg = nullptr);
Expand Down
6 changes: 3 additions & 3 deletions lib/device/iec/iecFuji.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ class iecFuji : public IECDevice
int get_disk_id(int drive_slot);
std::string get_host_prefix(int host_slot);

fujiHost *get_hosts(int i) { return &_fnHosts[i]; }
fujiDisk *get_disks(int i) { return &_fnDisks[i]; }
fujiHost *get_host(int i) { return &_fnHosts[i]; }
fujiDisk *get_disk(int i) { return &_fnDisks[i]; }
fujiHost *set_slot_hostname(int host_slot, char *hostname);

void _populate_slots_from_config();
Expand All @@ -392,7 +392,7 @@ class iecFuji : public IECDevice
iecFuji();
};

extern iecFuji theFuji;
extern iecFuji *theFuji;

#endif // FUJI_H
#endif
Loading
Loading