2008-08-19 21:36:31 +00:00
|
|
|
/* Emulador do computador TK3000 //e (Microdigital)
|
2019-02-07 18:08:53 +00:00
|
|
|
* por Fábio Belavenuto - Copyright (C) 2004
|
2008-08-19 21:36:31 +00:00
|
|
|
*
|
|
|
|
* Adaptado do emulador Applewin por Michael O'Brien
|
|
|
|
* Part of code is Copyright (C) 2003-2004 Tom Charlesworth
|
|
|
|
*
|
2019-02-07 18:08:53 +00:00
|
|
|
* Este arquivo é distribuido pela Licença Pública Geral GNU.
|
2008-08-19 21:36:31 +00:00
|
|
|
* Veja o arquivo Licenca.txt distribuido com este software.
|
|
|
|
*
|
2019-02-07 18:08:53 +00:00
|
|
|
* ESTE SOFTWARE NÃO OFERECE NENHUMA GARANTIA
|
2008-08-19 21:36:31 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Emula a CPU Z80
|
|
|
|
|
2009-01-09 23:27:29 +00:00
|
|
|
#include "StdAfx.h"
|
2014-08-13 20:30:35 +00:00
|
|
|
|
2020-11-11 21:15:27 +00:00
|
|
|
#include "z80emu.h"
|
2016-02-14 16:01:30 +00:00
|
|
|
#include "CPU.h"
|
2014-08-13 20:30:35 +00:00
|
|
|
#include "Memory.h"
|
2023-01-28 19:58:12 +00:00
|
|
|
#include "Z80VICE/z80.h"
|
2008-08-19 21:36:31 +00:00
|
|
|
|
|
|
|
|
2023-01-28 19:58:12 +00:00
|
|
|
BYTE __stdcall Z80Card::IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles)
|
2008-08-19 21:36:31 +00:00
|
|
|
{
|
2023-01-28 19:58:12 +00:00
|
|
|
const UINT slot = (addr >> 8) & 0x7;
|
2008-08-19 21:36:31 +00:00
|
|
|
|
2023-01-28 19:58:12 +00:00
|
|
|
if ((addr & 0xFF00) == (0xC000 + (slot << 8)))
|
2016-02-14 16:01:30 +00:00
|
|
|
SetActiveCpu( GetActiveCpu() == CPU_Z80 ? GetMainCpu() : CPU_Z80 );
|
2009-04-16 21:18:13 +00:00
|
|
|
|
2023-01-28 19:58:12 +00:00
|
|
|
return IO_Null(pc, addr, bWrite, value, nExecutedCycles);
|
2008-08-19 21:36:31 +00:00
|
|
|
}
|
|
|
|
|
2023-01-28 19:58:12 +00:00
|
|
|
void Z80Card::InitializeIO(LPBYTE pCxRomPeripheral)
|
2008-08-19 21:36:31 +00:00
|
|
|
{
|
2023-01-28 19:58:12 +00:00
|
|
|
memset(pCxRomPeripheral + (m_slot << 8), 0xFF, APPLE_SLOT_SIZE);
|
2008-08-19 21:36:31 +00:00
|
|
|
|
2023-01-28 19:58:12 +00:00
|
|
|
RegisterIoHandler(m_slot, IO_Null, IO_Null, IO_Null, &Z80Card::IOWrite, this, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
2008-08-19 21:36:31 +00:00
|
|
|
|
2023-01-28 19:58:12 +00:00
|
|
|
const std::string& Z80Card::GetSnapshotCardName(void)
|
|
|
|
{
|
|
|
|
return Z80_GetSnapshotCardName();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Z80Card::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
|
|
|
{
|
|
|
|
return Z80_SaveSnapshot(yamlSaveHelper, m_slot);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Z80Card::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)
|
|
|
|
{
|
|
|
|
return Z80_LoadSnapshot(yamlLoadHelper, m_slot, version);
|
2008-08-19 21:36:31 +00:00
|
|
|
}
|