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
|
|
|
|
2018-02-24 15:12:40 +00:00
|
|
|
#include "Applewin.h"
|
2016-02-14 16:01:30 +00:00
|
|
|
#include "CPU.h"
|
2014-08-13 20:30:35 +00:00
|
|
|
#include "Memory.h"
|
2008-08-19 21:36:31 +00:00
|
|
|
#include "z80emu.h"
|
|
|
|
|
|
|
|
// Variaveis
|
2009-04-16 21:18:13 +00:00
|
|
|
static int g_uCPMZ80Slot = 0;
|
2008-08-19 21:36:31 +00:00
|
|
|
|
2018-03-03 21:27:50 +00:00
|
|
|
BYTE __stdcall CPMZ80_IONull(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles)
|
2008-08-19 21:36:31 +00:00
|
|
|
{
|
2018-03-03 21:27:50 +00:00
|
|
|
return IO_Null(PC, uAddr, bWrite, uValue, nExecutedCycles);
|
2008-08-19 21:36:31 +00:00
|
|
|
}
|
|
|
|
|
2018-03-03 21:27:50 +00:00
|
|
|
BYTE __stdcall CPMZ80_IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles)
|
2008-08-19 21:36:31 +00:00
|
|
|
{
|
2009-04-16 21:18:13 +00:00
|
|
|
if ((uAddr & 0xFF00) == (0xC000 + (g_uCPMZ80Slot << 8)))
|
2016-02-14 16:01:30 +00:00
|
|
|
SetActiveCpu( GetActiveCpu() == CPU_Z80 ? GetMainCpu() : CPU_Z80 );
|
2009-04-16 21:18:13 +00:00
|
|
|
|
2018-03-03 21:27:50 +00:00
|
|
|
return IO_Null(PC, uAddr, bWrite, uValue, nExecutedCycles);
|
2008-08-19 21:36:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
2009-04-16 21:18:13 +00:00
|
|
|
|
2012-01-22 13:46:36 +00:00
|
|
|
void ConfigureSoftcard(LPBYTE pCxRomPeripheral, UINT uSlot)
|
2008-08-19 21:36:31 +00:00
|
|
|
{
|
2009-04-16 21:18:13 +00:00
|
|
|
memset(pCxRomPeripheral + (uSlot << 8), 0xFF, APPLE_SLOT_SIZE);
|
2008-08-19 21:36:31 +00:00
|
|
|
|
2009-04-16 21:18:13 +00:00
|
|
|
g_uCPMZ80Slot = uSlot;
|
2008-08-19 21:36:31 +00:00
|
|
|
|
2012-01-22 13:46:36 +00:00
|
|
|
RegisterIoHandler(uSlot, CPMZ80_IONull, CPMZ80_IONull, CPMZ80_IONull, CPMZ80_IOWrite, NULL, NULL);
|
2008-08-19 21:36:31 +00:00
|
|
|
}
|