Skip to content

Commit

Permalink
- Enable support for Serial Port 1 in hypervisor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Dec 22, 2024
1 parent e6e2273 commit 128f792
Show file tree
Hide file tree
Showing 21 changed files with 131 additions and 99 deletions.
12 changes: 6 additions & 6 deletions cube/patches/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ sd-v1.eth.bin:
@$(CC) -Os $(OPTS) -c base/emulator.c -DASYNC_READ -DBBA -DETH_EMULATOR -DNO_VIDEO
@$(CC) -Os $(OPTS) -c base/emulator_eth.c
@$(CC) -Os $(OPTS) -c base/frag.c
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000011011001000000001000000
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000011011011000000001000000
@$(CC) -Os $(OPTS) -c base/ipl.c
@$(CC) -Os $(OPTS) -c base/blockdevice.c -DASYNC_READ
@$(CC) -Os $(OPTS) -c sdgecko/sd.c -DDMA_READ=0 -DISR_READ=1 -DWRITE=0
Expand Down Expand Up @@ -250,7 +250,7 @@ sd-v2.eth.bin:
@$(CC) -Os $(OPTS) -c base/emulator.c -DASYNC_READ -DBBA -DETH_EMULATOR -DNO_VIDEO
@$(CC) -Os $(OPTS) -c base/emulator_eth.c
@$(CC) -Os $(OPTS) -c base/frag.c
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000011011001000000001000000
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000011011011000000001000000
@$(CC) -Os $(OPTS) -c base/ipl.c
@$(CC) -Os $(OPTS) -c base/blockdevice.c -DASYNC_READ
@$(CC) -Os $(OPTS) -c sdgecko/sd.c -DDMA_READ=1 -DISR_READ=1 -DWRITE=0
Expand Down Expand Up @@ -349,7 +349,7 @@ ideexi-v1.eth.bin:
@$(CC) -Os $(OPTS) -c base/emulator.c -DASYNC_READ -DBBA -DETH_EMULATOR -DNO_VIDEO
@$(CC) -Os $(OPTS) -c base/emulator_eth.c
@$(CC) -Os $(OPTS) -c base/frag.c
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000011011000000000001000000
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000011011010000000001000000
@$(CC) -Os $(OPTS) -c base/ipl.c
@$(CC) -Os $(OPTS) -c base/blockdevice.c -DASYNC_READ
@$(CC) -Os $(OPTS) -c ide-exi/ata.c -DDMA_READ=0 -DISR_READ=1 -DWRITE=0
Expand Down Expand Up @@ -448,7 +448,7 @@ ideexi-v2.eth.bin:
@$(CC) -Os $(OPTS) -c base/emulator.c -DASYNC_READ -DBBA -DETH_EMULATOR -DNO_VIDEO
@$(CC) -Os $(OPTS) -c base/emulator_eth.c
@$(CC) -Os $(OPTS) -c base/frag.c
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000011011000000000001000000
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000011011010000000001000000
@$(CC) -Os $(OPTS) -c base/ipl.c
@$(CC) -Os $(OPTS) -c base/blockdevice.c -DASYNC_READ
@$(CC) -Os $(OPTS) -c ide-exi/ata.c -DDMA_READ=1 -DISR_READ=1 -DWRITE=0
Expand Down Expand Up @@ -772,7 +772,7 @@ gcloader-v2.eth.bin:
@$(CC) -Os $(OPTS) -c base/emulator.c -DASYNC_READ -DBBA -DETH_EMULATOR -DGCODE -DNO_VIDEO
@$(CC) -Os $(OPTS) -c base/emulator_eth.c
@$(CC) -Os $(OPTS) -c base/frag.c -DDEVICE_PATCHES=1
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000010010000000010001000000
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000010010010000010001000000
@$(CC) -Os $(OPTS) -c base/ipl.c
@$(CC) -Os $(OPTS) -c gcloader/gcloader.c
@$(CC) -Os $(OPTS) -c bba/enc28j60.c
Expand Down Expand Up @@ -843,7 +843,7 @@ flippy.eth.bin:
@$(CC) -Os $(OPTS) -c base/emulator.c -DASYNC_READ -DBBA -DETH_EMULATOR -DFLIPPY -DNO_VIDEO
@$(CC) -Os $(OPTS) -c base/emulator_eth.c
@$(CC) -Os $(OPTS) -c base/frag.c -DDEVICE_PATCHES=1
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000010010000000010001000000
@$(CC) -Os $(OPTS) -c base/interrupt.c -DIRQ_MASK=0b00000000010010010000010001000000
@$(CC) -Os $(OPTS) -c base/ipl.c
@$(CC) -Os $(OPTS) -c flippydrive/flippy.c
@$(CC) -Os $(OPTS) -c bba/enc28j60.c
Expand Down
6 changes: 3 additions & 3 deletions cube/patches/base/blockdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ void schedule_read(OSTick ticks)

void perform_read(uint32_t address, uint32_t length, uint32_t offset)
{
if ((*VAR_IGR_TYPE & 0x80) && offset == 0x2440) {
if ((*VAR_DRIVE_FLAGS & 0b0010) && offset == 0x2440) {
*VAR_DRIVE_FLAGS &= ~0b0011;
*VAR_CURRENT_DISC = FRAGS_APPLOADER;
*VAR_SECOND_DISC = 0;
}

dvd.buffer = OSPhysicalToUncached(address);
Expand Down Expand Up @@ -118,7 +118,7 @@ void trickle_read()

bool change_disc(void)
{
if (*VAR_SECOND_DISC) {
if (*VAR_DRIVE_FLAGS & 0b0001) {
*VAR_CURRENT_DISC ^= 1;
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion cube/patches/base/emulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ static void pi_write(unsigned index, uint32_t value)
PI[index] = ((value << 2) & 0b100) | (value & ~0b100);
break;
#else
if (*VAR_DRIVE_FLAGS & 0b01) {
if (*VAR_DRIVE_FLAGS & 0b0100) {
PI[index] = ((value << 2) & 0b100) | (value & ~0b100);

if (!di.reset && !(value & 0b100))
Expand Down
5 changes: 3 additions & 2 deletions cube/patches/base/pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ void CheckStatus(s32 chan, PADStatus *status)
}
}

u8 igr_type = *VAR_IGR_TYPE & ~0x80;
u8 igr_type = *VAR_IGR_TYPE;

if (igr_type != IGR_OFF) {
if ((status->button & PAD_COMBO_EXIT1) == PAD_COMBO_EXIT1 ||
(status->button & PAD_COMBO_EXIT2) == PAD_COMBO_EXIT2) {
if (OSResetSystem) {
*VAR_DRIVE_FLAGS |= 0b0010;
*VAR_IGR_TYPE = IGR_OFF;
enable_interrupts();
*VAR_IGR_TYPE = IGR_OFF | 0x80;
if (igr_type == IGR_APPLOADER)
OSResetSystem(OS_RESET_RESTART, 0, 0);
else
Expand Down
6 changes: 3 additions & 3 deletions cube/patches/bba/bba.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ void schedule_read(OSTick ticks)

void perform_read(uint32_t address, uint32_t length, uint32_t offset)
{
if ((*VAR_IGR_TYPE & 0x80) && offset == 0x2440) {
if ((*VAR_DRIVE_FLAGS & 0b0010) && offset == 0x2440) {
*VAR_DRIVE_FLAGS &= ~0b0011;
*VAR_CURRENT_DISC = FRAGS_APPLOADER;
*VAR_SECOND_DISC = 0;
}

dvd.buffer = OSPhysicalToUncached(address);
Expand Down Expand Up @@ -381,7 +381,7 @@ void trickle_read()

bool change_disc(void)
{
if (*VAR_SECOND_DISC) {
if (*VAR_DRIVE_FLAGS & 0b0001) {
*VAR_CURRENT_DISC ^= 1;
return true;
}
Expand Down
23 changes: 13 additions & 10 deletions cube/patches/bba/enc28j60.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
#include "enc28j60.h"
#include "interrupt.h"

#define exi_channel ((*VAR_EXI_SLOT & 0x30) >> 4)
#define exi_device ((*VAR_EXI_SLOT & 0xC0) >> 6)
#define exi_regs (*(volatile uint32_t **)VAR_EXI2_REGS)
#define exi_cpr (*VAR_EXI2_CPR)
#define exi_channel ((*VAR_EXI_SLOT & 0x30) >> 4)
#define exi_device ((*VAR_EXI_SLOT & 0xC0) >> 6)
#define exi_interrupt ((*VAR_EXI2_CPR & 0xC0) >> 6)
#define exi_regs (*(volatile uint32_t **)VAR_EXI2_REGS)

static struct {
uint8_t bank;
Expand All @@ -44,14 +46,14 @@ static struct {
} output;
} enc28j60;

static void exi_clear_interrupts(bool exi, bool tc, bool ext)
static void exi_clear_interrupts(int32_t chan, bool exi, bool tc, bool ext)
{
exi_regs[0] = (exi_regs[0] & (0x3FFF & ~0x80A)) | (ext << 11) | (tc << 3) | (exi << 1);
EXI[chan][0] = (EXI[chan][0] & (0x3FFF & ~0x80A)) | (ext << 11) | (tc << 3) | (exi << 1);
}

static void exi_select(void)
{
exi_regs[0] = (exi_regs[0] & 0x405) | ((1 << EXI_DEVICE_0) << 7) | (EXI_SPEED_32MHZ << 4);
exi_regs[0] = (exi_regs[0] & 0x405) | ((exi_cpr << 4) & 0x3F0);
}

static void exi_deselect(void)
Expand Down Expand Up @@ -194,7 +196,8 @@ static void exi_callback()

static void exi_interrupt_handler(OSInterrupt interrupt, OSContext *context)
{
exi_clear_interrupts(true, false, false);
int32_t chan = (interrupt - OS_INTERRUPT_EXI_0_EXI) / 3;
exi_clear_interrupts(chan, true, false, false);
enc28j60.interrupt = true;
exi_callback();
}
Expand Down Expand Up @@ -240,10 +243,10 @@ void bba_init(void **arenaLo, void **arenaHi)

*arenaHi -= sizeof(*enc28j60.page); enc28j60.page = *arenaHi;

if (exi_channel < EXI_CHANNEL_2) {
OSInterrupt interrupt = OS_INTERRUPT_EXI_0_EXI + (3 * exi_channel);
if (exi_interrupt < EXI_CHANNEL_MAX) {
OSInterrupt interrupt = OS_INTERRUPT_EXI_0_EXI + (3 * exi_interrupt);
set_interrupt_handler(interrupt, exi_interrupt_handler);
unmask_interrupts(OS_INTERRUPTMASK(interrupt) & (OS_INTERRUPTMASK_EXI_0_EXI | OS_INTERRUPTMASK_EXI_1_EXI));
unmask_interrupts(OS_INTERRUPTMASK(interrupt) & (OS_INTERRUPTMASK_EXI_0_EXI | OS_INTERRUPTMASK_EXI_1_EXI | OS_INTERRUPTMASK_EXI_2_EXI));
} else {
set_interrupt_handler(OS_INTERRUPT_PI_DEBUG, debug_interrupt_handler);
unmask_interrupts(OS_INTERRUPTMASK_PI_DEBUG);
Expand Down
2 changes: 1 addition & 1 deletion cube/patches/bba/enc28j60.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define ENC28J60_CMD_BFC(x) ((0xA0 | ((x) & 0x1F)) << 24) // Bit Field Clear
#define ENC28J60_CMD_SRC ((0xFF) << 24) // System Reset Command

#define ENC28J60_EXI_SPEED(cmd) (((cmd) == ENC28J60_CMD_SRC) ? EXI_SPEED1MHZ : EXI_SPEED32MHZ)
#define ENC28J60_EXI_SPEED(cmd) (((cmd) == ENC28J60_CMD_SRC) ? EXI_SPEED1MHZ : EXI_SPEED16MHZ)
#define ENC28J60_EXI_DUMMY(cmd) ((((cmd) >> 24) & 0x1F) < 0x1A)

#define ENC28J60_INIT_ERXST (0)
Expand Down
23 changes: 13 additions & 10 deletions cube/patches/bba/w5500.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
#include "interrupt.h"
#include "w5500.h"

#define exi_channel ((*VAR_EXI_SLOT & 0x30) >> 4)
#define exi_device ((*VAR_EXI_SLOT & 0xC0) >> 6)
#define exi_regs (*(volatile uint32_t **)VAR_EXI2_REGS)
#define exi_cpr (*VAR_EXI2_CPR)
#define exi_channel ((*VAR_EXI_SLOT & 0x30) >> 4)
#define exi_device ((*VAR_EXI_SLOT & 0xC0) >> 6)
#define exi_interrupt ((*VAR_EXI2_CPR & 0xC0) >> 6)
#define exi_regs (*(volatile uint32_t **)VAR_EXI2_REGS)

static struct {
bool sendok;
Expand All @@ -46,14 +48,14 @@ static struct {
} output;
} w5500;

static void exi_clear_interrupts(bool exi, bool tc, bool ext)
static void exi_clear_interrupts(int32_t chan, bool exi, bool tc, bool ext)
{
exi_regs[0] = (exi_regs[0] & (0x3FFF & ~0x80A)) | (ext << 11) | (tc << 3) | (exi << 1);
EXI[chan][0] = (EXI[chan][0] & (0x3FFF & ~0x80A)) | (ext << 11) | (tc << 3) | (exi << 1);
}

static void exi_select(void)
{
exi_regs[0] = (exi_regs[0] & 0x405) | ((1 << EXI_DEVICE_0) << 7) | (EXI_SPEED_32MHZ << 4);
exi_regs[0] = (exi_regs[0] & 0x405) | ((exi_cpr << 4) & 0x3F0);
}

static void exi_deselect(void)
Expand Down Expand Up @@ -224,7 +226,8 @@ static void exi_callback()

static void exi_interrupt_handler(OSInterrupt interrupt, OSContext *context)
{
exi_clear_interrupts(true, false, false);
int32_t chan = (interrupt - OS_INTERRUPT_EXI_0_EXI) / 3;
exi_clear_interrupts(chan, true, false, false);
w5500.interrupt = true;
exi_callback();
}
Expand Down Expand Up @@ -265,10 +268,10 @@ void bba_init(void **arenaLo, void **arenaHi)

*arenaHi -= sizeof(*w5500.page); w5500.page = *arenaHi;

if (exi_channel < EXI_CHANNEL_2) {
OSInterrupt interrupt = OS_INTERRUPT_EXI_0_EXI + (3 * exi_channel);
if (exi_interrupt < EXI_CHANNEL_MAX) {
OSInterrupt interrupt = OS_INTERRUPT_EXI_0_EXI + (3 * exi_interrupt);
set_interrupt_handler(interrupt, exi_interrupt_handler);
unmask_interrupts(OS_INTERRUPTMASK(interrupt) & (OS_INTERRUPTMASK_EXI_0_EXI | OS_INTERRUPTMASK_EXI_1_EXI));
unmask_interrupts(OS_INTERRUPTMASK(interrupt) & (OS_INTERRUPTMASK_EXI_0_EXI | OS_INTERRUPTMASK_EXI_1_EXI | OS_INTERRUPTMASK_EXI_2_EXI));
} else {
set_interrupt_handler(OS_INTERRUPT_PI_DEBUG, debug_interrupt_handler);
unmask_interrupts(OS_INTERRUPTMASK_PI_DEBUG);
Expand Down
23 changes: 13 additions & 10 deletions cube/patches/bba/w6100.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
#include "interrupt.h"
#include "w6100.h"

#define exi_channel ((*VAR_EXI_SLOT & 0x30) >> 4)
#define exi_device ((*VAR_EXI_SLOT & 0xC0) >> 6)
#define exi_regs (*(volatile uint32_t **)VAR_EXI2_REGS)
#define exi_cpr (*VAR_EXI2_CPR)
#define exi_channel ((*VAR_EXI_SLOT & 0x30) >> 4)
#define exi_device ((*VAR_EXI_SLOT & 0xC0) >> 6)
#define exi_interrupt ((*VAR_EXI2_CPR & 0xC0) >> 6)
#define exi_regs (*(volatile uint32_t **)VAR_EXI2_REGS)

static struct {
bool sendok;
Expand All @@ -46,14 +48,14 @@ static struct {
} output;
} w6100;

static void exi_clear_interrupts(bool exi, bool tc, bool ext)
static void exi_clear_interrupts(int32_t chan, bool exi, bool tc, bool ext)
{
exi_regs[0] = (exi_regs[0] & (0x3FFF & ~0x80A)) | (ext << 11) | (tc << 3) | (exi << 1);
EXI[chan][0] = (EXI[chan][0] & (0x3FFF & ~0x80A)) | (ext << 11) | (tc << 3) | (exi << 1);
}

static void exi_select(void)
{
exi_regs[0] = (exi_regs[0] & 0x405) | ((1 << EXI_DEVICE_0) << 7) | (EXI_SPEED_32MHZ << 4);
exi_regs[0] = (exi_regs[0] & 0x405) | ((exi_cpr << 4) & 0x3F0);
}

static void exi_deselect(void)
Expand Down Expand Up @@ -224,7 +226,8 @@ static void exi_callback()

static void exi_interrupt_handler(OSInterrupt interrupt, OSContext *context)
{
exi_clear_interrupts(true, false, false);
int32_t chan = (interrupt - OS_INTERRUPT_EXI_0_EXI) / 3;
exi_clear_interrupts(chan, true, false, false);
w6100.interrupt = true;
exi_callback();
}
Expand Down Expand Up @@ -265,10 +268,10 @@ void bba_init(void **arenaLo, void **arenaHi)

*arenaHi -= sizeof(*w6100.page); w6100.page = *arenaHi;

if (exi_channel < EXI_CHANNEL_2) {
OSInterrupt interrupt = OS_INTERRUPT_EXI_0_EXI + (3 * exi_channel);
if (exi_interrupt < EXI_CHANNEL_MAX) {
OSInterrupt interrupt = OS_INTERRUPT_EXI_0_EXI + (3 * exi_interrupt);
set_interrupt_handler(interrupt, exi_interrupt_handler);
unmask_interrupts(OS_INTERRUPTMASK(interrupt) & (OS_INTERRUPTMASK_EXI_0_EXI | OS_INTERRUPTMASK_EXI_1_EXI));
unmask_interrupts(OS_INTERRUPTMASK(interrupt) & (OS_INTERRUPTMASK_EXI_0_EXI | OS_INTERRUPTMASK_EXI_1_EXI | OS_INTERRUPTMASK_EXI_2_EXI));
} else {
set_interrupt_handler(OS_INTERRUPT_PI_DEBUG, debug_interrupt_handler);
unmask_interrupts(OS_INTERRUPTMASK_PI_DEBUG);
Expand Down
6 changes: 3 additions & 3 deletions cube/patches/dvd/dvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ static bool memeq(const void *a, const void *b, size_t size)

void perform_read(uint32_t address, uint32_t length, uint32_t offset)
{
if ((*VAR_IGR_TYPE & 0x80) && offset == 0x2440) {
if ((*VAR_DRIVE_FLAGS & 0b0010) && offset == 0x2440) {
*VAR_DRIVE_FLAGS &= ~0b0011;
*VAR_CURRENT_DISC = FRAGS_APPLOADER;
*VAR_SECOND_DISC = 0;
} else {
switch (*VAR_CURRENT_DISC) {
case FRAGS_DISC_1:
Expand Down Expand Up @@ -251,7 +251,7 @@ void reset_devices(void)
gcode_set_disc_frags(0, frag, fragnum);
gcode_set_disc_number(0);
#else
if (*VAR_DRIVE_FLAGS & 0b10) {
if (*VAR_DRIVE_FLAGS & 0b1000) {
flippy_bypass(false);
flippy_reset();
}
Expand Down
6 changes: 3 additions & 3 deletions cube/patches/flippydrive/flippy.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ void schedule_read(OSTick ticks)

void perform_read(uint32_t address, uint32_t length, uint32_t offset)
{
if ((*VAR_IGR_TYPE & 0x80) && offset == 0x2440) {
if ((*VAR_DRIVE_FLAGS & 0b0010) && offset == 0x2440) {
*VAR_DRIVE_FLAGS &= ~0b0011;
*VAR_CURRENT_DISC = FRAGS_APPLOADER;
*VAR_SECOND_DISC = 0;
}

dvd.buffer = OSPhysicalToUncached(address);
Expand Down Expand Up @@ -284,7 +284,7 @@ bool change_disc(void)
OSSetAlarm(&cover_alarm, OSSecondsToTicks(1.5), di_close_cover);
}

if (*VAR_SECOND_DISC) {
if (*VAR_DRIVE_FLAGS & 0b0001) {
const frag_t *frag = NULL;
int fragnum = frag_get_list(*VAR_CURRENT_DISC ^ 1, &frag);

Expand Down
6 changes: 3 additions & 3 deletions cube/patches/gcloader/gcloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ void schedule_read(OSTick ticks)

void perform_read(uint32_t address, uint32_t length, uint32_t offset)
{
if ((*VAR_IGR_TYPE & 0x80) && offset == 0x2440) {
if ((*VAR_DRIVE_FLAGS & 0b0010) && offset == 0x2440) {
*VAR_DRIVE_FLAGS &= ~0b0011;
*VAR_CURRENT_DISC = FRAGS_APPLOADER;
*VAR_SECOND_DISC = 0;
}

dvd.buffer = OSPhysicalToUncached(address);
Expand Down Expand Up @@ -360,7 +360,7 @@ bool change_disc(void)
OSSetAlarm(&cover_alarm, OSSecondsToTicks(1.5), di_close_cover);
}

if (*VAR_SECOND_DISC) {
if (*VAR_DRIVE_FLAGS & 0b0001) {
const frag_t *frag = NULL;
int fragnum = frag_get_list(*VAR_CURRENT_DISC ^ 1, &frag);

Expand Down
6 changes: 3 additions & 3 deletions cube/patches/usbgecko/usbgecko.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ void schedule_read(OSTick ticks)

void perform_read(uint32_t address, uint32_t length, uint32_t offset)
{
if ((*VAR_IGR_TYPE & 0x80) && offset == 0x2440) {
if ((*VAR_DRIVE_FLAGS & 0b0010) && offset == 0x2440) {
*VAR_DRIVE_FLAGS &= ~0b0011;
*VAR_CURRENT_DISC = FRAGS_APPLOADER;
*VAR_SECOND_DISC = 0;
}

dvd.buffer = OSPhysicalToUncached(address);
Expand Down Expand Up @@ -262,7 +262,7 @@ void trickle_read()

bool change_disc(void)
{
if (*VAR_SECOND_DISC) {
if (*VAR_DRIVE_FLAGS & 0b0001) {
usb_unlock_file();
*VAR_CURRENT_DISC ^= 1;
return usb_serve_file() && usb_lock_file();
Expand Down
Loading

0 comments on commit 128f792

Please sign in to comment.