project64/Source/Project64-core/N64System/Mips/Disk.h

28 lines
986 B
C
Raw Normal View History

// Based on MAME's N64DD driver code by Happy_
2016-01-19 18:53:18 +00:00
#pragma once
2021-04-12 06:34:26 +00:00
#include <stdint.h>
2016-01-20 13:31:29 +00:00
2016-01-19 18:53:18 +00:00
void DiskCommand(void);
void DiskReset(void);
void DiskBMControl(void);
2016-01-20 13:31:29 +00:00
void DiskGapSectorCheck(void);
void DiskBMUpdate(void);
2019-08-11 16:13:52 +00:00
bool DiskBMReadWrite(bool write);
void DiskDMACheck(void);
2016-01-20 13:31:29 +00:00
extern bool dd_write;
extern bool dd_reset_hold;
extern uint32_t dd_track_offset, dd_zone;
2016-01-20 16:43:23 +00:00
extern uint32_t dd_start_block, dd_current;
2016-01-20 13:31:29 +00:00
2022-10-10 00:22:17 +00:00
const uint32_t ddZoneSecSize[16] = {232, 216, 208, 192, 176, 160, 144, 128,
216, 208, 192, 176, 160, 144, 128, 112};
const uint32_t ddZoneTrackSize[16] = {158, 158, 149, 149, 149, 149, 149, 114,
158, 158, 149, 149, 149, 149, 149, 114};
2016-01-20 13:31:29 +00:00
const uint32_t ddStartOffset[16] =
2022-10-10 00:22:17 +00:00
{0x0, 0x5F15E0, 0xB79D00, 0x10801A0, 0x1523720, 0x1963D80, 0x1D414C0, 0x20BBCE0,
0x23196E0, 0x28A1E00, 0x2DF5DC0, 0x3299340, 0x36D99A0, 0x3AB70E0, 0x3E31900, 0x4149200};
2016-01-20 13:31:29 +00:00
2022-10-10 00:22:17 +00:00
#define SECTORS_PER_BLOCK 85
#define BLOCKS_PER_TRACK 2