[Disk] Handle Sector & Sector Size in AddressBlock function (for future D64 support)
This commit is contained in:
parent
444a8a6d1a
commit
db35bd6518
|
@ -261,13 +261,11 @@ void DiskBMUpdate()
|
||||||
void DiskBMRead()
|
void DiskBMRead()
|
||||||
{
|
{
|
||||||
DiskBMReadWrite(false);
|
DiskBMReadWrite(false);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiskBMWrite()
|
void DiskBMWrite()
|
||||||
{
|
{
|
||||||
DiskBMReadWrite(true);
|
DiskBMReadWrite(true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiskBMReadWrite(bool write)
|
void DiskBMReadWrite(bool write)
|
||||||
|
@ -278,7 +276,7 @@ void DiskBMReadWrite(bool write)
|
||||||
uint16_t sector = dd_current;
|
uint16_t sector = dd_current;
|
||||||
uint16_t sectorsize = (((g_Reg->ASIC_HOST_SECBYTE & 0x00FF0000) >> 16) + 1);
|
uint16_t sectorsize = (((g_Reg->ASIC_HOST_SECBYTE & 0x00FF0000) >> 16) + 1);
|
||||||
|
|
||||||
uint32_t addr = g_Disk->GetDiskAddressBlock(head, track, block) + (sector * sectorsize);
|
uint32_t addr = g_Disk->GetDiskAddressBlock(head, track, block, sector, sectorsize);
|
||||||
g_Disk->SetDiskAddressBuffer(addr);
|
g_Disk->SetDiskAddressBuffer(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -392,7 +392,7 @@ void CN64Disk::UnallocateDiskImage()
|
||||||
m_DiskImage = NULL;
|
m_DiskImage = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t CN64Disk::GetDiskAddressBlock(uint16_t head, uint16_t track, uint16_t block)
|
uint32_t CN64Disk::GetDiskAddressBlock(uint16_t head, uint16_t track, uint16_t block, uint16_t sector, uint16_t sectorsize)
|
||||||
{
|
{
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
if (m_DiskFormat == DiskFormatMAME)
|
if (m_DiskFormat == DiskFormatMAME)
|
||||||
|
@ -441,11 +441,11 @@ uint32_t CN64Disk::GetDiskAddressBlock(uint16_t head, uint16_t track, uint16_t b
|
||||||
tr_off = track;
|
tr_off = track;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = MAMEStartOffset[dd_zone] + tr_off * TRACKSIZE(dd_zone) + block * BLOCKSIZE(dd_zone);
|
offset = MAMEStartOffset[dd_zone] + tr_off * TRACKSIZE(dd_zone) + block * BLOCKSIZE(dd_zone) + sector * sectorsize;
|
||||||
}
|
}
|
||||||
else if (m_DiskFormat == DiskFormatSDK)
|
else if (m_DiskFormat == DiskFormatSDK)
|
||||||
{
|
{
|
||||||
offset = LBAToByte(0, PhysToLBA(head, track, block));
|
offset = LBAToByte(0, PhysToLBA(head, track, block)) + sector * sectorsize;
|
||||||
}
|
}
|
||||||
//WriteTrace(TraceN64System, TraceDebug, "Head %d Track %d Block %d - LBA %d - Address %08X", head, track, block, PhysToLBA(head, track, block), offset);
|
//WriteTrace(TraceN64System, TraceDebug, "Head %d Track %d Block %d - LBA %d - Address %08X", head, track, block, PhysToLBA(head, track, block), offset);
|
||||||
return offset;
|
return offset;
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
uint8_t * GetDiskAddressSys() { return m_DiskImage; }
|
uint8_t * GetDiskAddressSys() { return m_DiskImage; }
|
||||||
uint8_t * GetDiskHeader() { return m_DiskHeader; }
|
uint8_t * GetDiskHeader() { return m_DiskHeader; }
|
||||||
void SetDiskAddressBuffer(uint32_t address) { m_DiskBufAddress = address; }
|
void SetDiskAddressBuffer(uint32_t address) { m_DiskBufAddress = address; }
|
||||||
uint32_t GetDiskAddressBlock(uint16_t head, uint16_t track, uint16_t block);
|
uint32_t GetDiskAddressBlock(uint16_t head, uint16_t track, uint16_t block, uint16_t sector, uint16_t sectorsize);
|
||||||
stdstr GetRomName() const { return m_RomName; }
|
stdstr GetRomName() const { return m_RomName; }
|
||||||
stdstr GetFileName() const { return m_FileName; }
|
stdstr GetFileName() const { return m_FileName; }
|
||||||
stdstr GetDiskIdent() const { return m_DiskIdent; }
|
stdstr GetDiskIdent() const { return m_DiskIdent; }
|
||||||
|
|
Loading…
Reference in New Issue