AppleWin/source/z80emu.cpp
tomch f24971f582 Merge from Tom: r683
Added Speech API support:
. Capture char output to COUT
. Enable speech via -speech cmd-line
. Ctrl+Reset and FullSpeed mode purge the speech buffers
Removed #pragma hdrstop from all .cpp files except AppleWin.cpp (which is the PCH create file)
2010-02-14 21:11:26 +00:00

45 lines
1.3 KiB
C++

/* Emulador do computador TK3000 //e (Microdigital)
* por Fábio Belavenuto - Copyright (C) 2004
*
* Adaptado do emulador Applewin por Michael O'Brien
* Part of code is Copyright (C) 2003-2004 Tom Charlesworth
*
* Este arquivo é distribuido pela Licença Pública Geral GNU.
* Veja o arquivo Licenca.txt distribuido com este software.
*
* ESTE SOFTWARE NÃO OFERECE NENHUMA GARANTIA
*
*/
// Emula a CPU Z80
#include "StdAfx.h"
#include "z80emu.h"
// Variaveis
static int g_uCPMZ80Slot = 0;
BYTE __stdcall CPMZ80_IONull(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nCyclesLeft)
{
return IO_Null(PC, uAddr, bWrite, uValue, nCyclesLeft);
}
BYTE __stdcall CPMZ80_IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nCyclesLeft)
{
if ((uAddr & 0xFF00) == (0xC000 + (g_uCPMZ80Slot << 8)))
g_ActiveCPU = (g_ActiveCPU == CPU_6502) ? CPU_Z80 : CPU_6502;
return IO_Null(PC, uAddr, bWrite, uValue, nCyclesLeft);
}
//===========================================================================
void ConfigureSoftcard(LPBYTE pCxRomPeripheral, UINT uSlot, UINT bEnable)
{
memset(pCxRomPeripheral + (uSlot << 8), 0xFF, APPLE_SLOT_SIZE);
g_uCPMZ80Slot = uSlot;
RegisterIoHandler(uSlot, CPMZ80_IONull, CPMZ80_IONull, CPMZ80_IONull, bEnable ? CPMZ80_IOWrite : NULL, NULL, NULL);
}