Skip to content

Commit

Permalink
- Remove obsolete globals.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Jul 31, 2020
1 parent 5a8f279 commit 87aaf7e
Show file tree
Hide file tree
Showing 18 changed files with 310 additions and 459 deletions.
36 changes: 7 additions & 29 deletions cube/patches/base/blockdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <stdint.h>
#include <stdbool.h>
#include "common.h"
#include "dolphin/exi.h"
#include "dolphin/os.h"
#include "emulator.h"

Expand All @@ -32,28 +31,6 @@ static struct {

OSAlarm read_alarm = {0};

bool exi_probe(int32_t chan)
{
if (chan == EXI_CHANNEL_2)
return false;
if (chan == *VAR_EXI_SLOT)
return false;

return true;
}

bool exi_try_lock(int32_t chan, uint32_t dev, EXIControl *exi)
{
if (!(exi->state & EXI_STATE_LOCKED) || exi->dev != dev)
return false;
if (chan == *VAR_EXI_SLOT && dev == EXI_DEVICE_0)
return false;
if (chan == *VAR_EXI_SLOT)
end_read();

return true;
}

void schedule_read(OSTick ticks)
{
#ifdef ASYNC_READ
Expand Down Expand Up @@ -85,7 +62,7 @@ void perform_read(uint32_t address, uint32_t length, uint32_t offset)
{
dvd.buffer = OSPhysicalToUncached(address);
dvd.length = length;
dvd.offset = offset | *(uint32_t *)VAR_CURRENT_DISC << 31;
dvd.offset = offset | *VAR_CURRENT_DISC << 31;

schedule_read(OSMicrosecondsToTicks(300));
}
Expand Down Expand Up @@ -115,11 +92,12 @@ void device_reset(void)
end_read();
}

void change_disc(void)
bool change_disc(void)
{
*(uint32_t *)VAR_CURRENT_DISC = !*(uint32_t *)VAR_CURRENT_DISC;
if (*VAR_SECOND_DISC) {
*VAR_CURRENT_DISC ^= 1;
return true;
}

(*DI_EMU)[1] &= ~0b001;
(*DI_EMU)[1] |= 0b100;
di_update_interrupts();
return false;
}
2 changes: 0 additions & 2 deletions cube/patches/base/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ typedef volatile f64 vf64;
asm volatile ("mtmsr %0" :: "r" (msr)); \
})

static u32(*const DI_EMU)[9] = (u32(*)[])VAR_DI_REGS;

extern volatile u32 PI[13];
extern volatile u16 MI[46];
extern volatile u32 DSP[15];
Expand Down

0 comments on commit 87aaf7e

Please sign in to comment.