Duckstation/src/core/dma.h

44 lines
711 B
C
Raw Normal View History

// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
2019-09-09 07:01:26 +00:00
#pragma once
#include "types.h"
2019-09-14 10:28:47 +00:00
class StateWrapper;
2023-01-11 08:51:38 +00:00
namespace DMA {
2019-09-09 07:01:26 +00:00
2023-01-11 08:51:38 +00:00
enum : u32
2019-09-09 07:01:26 +00:00
{
2023-01-11 08:51:38 +00:00
NUM_CHANNELS = 7
};
2019-09-09 07:01:26 +00:00
2023-01-11 08:51:38 +00:00
enum class Channel : u32
{
MDECin = 0,
MDECout = 1,
GPU = 2,
CDROM = 3,
SPU = 4,
PIO = 5,
OTC = 6
};
2019-09-24 09:43:10 +00:00
2023-01-11 08:51:38 +00:00
void Initialize();
void Shutdown();
void Reset();
bool DoState(StateWrapper& sw);
2019-09-24 09:43:10 +00:00
2023-01-11 08:51:38 +00:00
u32 ReadRegister(u32 offset);
void WriteRegister(u32 offset, u32 value);
2019-09-24 09:43:10 +00:00
2023-01-11 08:51:38 +00:00
void SetRequest(Channel channel, bool request);
2019-09-24 09:43:10 +00:00
2023-01-11 08:51:38 +00:00
// changing interfaces
void SetMaxSliceTicks(TickCount ticks);
void SetHaltTicks(TickCount ticks);
2019-09-24 09:43:10 +00:00
2023-01-11 08:51:38 +00:00
void DrawDebugStateWindow();
JIT optimizations and refactoring (#675) * CPU/Recompiler: Use rel32 call where possible for no-args * JitCodeBuffer: Support using preallocated buffer * CPU/Recompiler/AArch64: Use bl instead of blr for short branches * CPU/CodeCache: Allocate recompiler buffer in program space This means we don't need 64-bit moves for every call out of the recompiler. * GTE: Don't store as u16 and load as u32 * CPU/Recompiler: Add methods to emit global load/stores * GTE: Convert class to namespace * CPU/Recompiler: Call GTE functions directly * Settings: Turn into a global variable * GPU: Replace local pointers with global * InterruptController: Turn into a global pointer * System: Replace local pointers with global * Timers: Turn into a global instance * DMA: Turn into a global instance * SPU: Turn into a global instance * CDROM: Turn into a global instance * MDEC: Turn into a global instance * Pad: Turn into a global instance * SIO: Turn into a global instance * CDROM: Move audio FIFO to the heap * CPU/Recompiler: Drop ASMFunctions No longer needed since we have code in the same 4GB window. * CPUCodeCache: Turn class into namespace * Bus: Local pointer -> global pointers * CPU: Turn class into namespace * Bus: Turn into namespace * GTE: Store registers in CPU state struct Allows relative addressing on ARM. * CPU/Recompiler: Align code storage to page size * CPU/Recompiler: Fix relative branches on A64 * HostInterface: Local references to global * System: Turn into a namespace, move events out * Add guard pages * Android: Fix build
2020-07-31 07:09:18 +00:00
2023-01-11 08:51:38 +00:00
} // namespace DMA