mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-23 08:33:24 +00:00
Found source of Z80 emulation (z80em by Marcel de Kogel) & reverted (as close as possible) to his distro.
Updated Help html (team & ack's).
This commit is contained in:
parent
c071aa75c8
commit
c5d83f2340
@ -469,7 +469,7 @@
|
||||
Name="Uthernet"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\source\Tfe\bittypes.h"
|
||||
RelativePath=".\source\Tfe\Bittypes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -528,18 +528,22 @@
|
||||
<Filter
|
||||
Name="Z80"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\source\Z80\README.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80codes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80cpu.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80cpu.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80daa.h"
|
||||
>
|
||||
@ -552,10 +556,6 @@
|
||||
RelativePath=".\source\Z80\z80emu.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80io.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80io.h"
|
||||
>
|
||||
|
@ -330,15 +330,18 @@
|
||||
<Filter
|
||||
Name="Z80"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\source\Z80\README.txt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80codes.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80cpu.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80cpu.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80daa.h">
|
||||
</File>
|
||||
@ -348,9 +351,6 @@
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80emu.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80io.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80io.h">
|
||||
</File>
|
||||
|
@ -533,14 +533,46 @@
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Z80"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\source\Z80\README.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80codes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80daa.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80emu.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80emu.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\Z80\z80io.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Docs"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\docs\Bugs.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\docs\CodingConventions.txt"
|
||||
>
|
||||
@ -562,16 +594,20 @@
|
||||
Name="Resources"
|
||||
Filter=".txt,.ico,.bmp,.rc"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\resource\Apple2.rom"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\resource\Apple2_Plus.rom"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\resource\Apple2e.rom"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\resource\Apple2orig.rom"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\resource\Apple2plus.rom"
|
||||
RelativePath=".\resource\Apple2e_Enhanced.rom"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -12,8 +12,10 @@
|
||||
<p style="MARGIN-LEFT: 40px">Thomas Stahl: TV emulation mode</p>
|
||||
<p style="MARGIN-LEFT: 40px">Chris Foxwell: SSI263 phoneme samples</p>
|
||||
<p style="MARGIN-LEFT: 40px">Robert Hoem: Harddisk card (source module & f/w)</p>
|
||||
<P style="MARGIN-LEFT: 40px">
|
||||
Spiro Trikaliotis: (VICE) whose code Glenn Jones adapted for Uthernet support</P>
|
||||
<P style="MARGIN-LEFT: 40px">Spiro Trikaliotis: (VICE) whose code Glenn Jones adapted for Uthernet support</P>
|
||||
<p style="MARGIN-LEFT: 40px">Kyle Kim: Mouse card support based on code from Apple in PC</p>
|
||||
<p style="MARGIN-LEFT: 40px">MAME team: AY-3-8910, MC6821 PIA emulation modules</p>
|
||||
<p style="MARGIN-LEFT: 40px">Marcel de Kogel: Z80Em code (http://www.komkon.org/~dekogel/misc.html)</p>
|
||||
<p style="MARGIN-LEFT: 40px">Fábio Belavenuto: TK3000 //e clone (originally responsible for integrating Z80Em)</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -9,17 +9,12 @@
|
||||
<h2 style="COLOR: rgb(0,128,0)">
|
||||
AppleWin team</h2>
|
||||
<hr size="4">
|
||||
<p>
|
||||
Tom Charlesworth (Project lead)</p>
|
||||
<p>
|
||||
Michael Pohoreski (Debugger rewrite)</p>
|
||||
<p>
|
||||
Nick Westgate (Floating bus support, Parallel printer)</p>
|
||||
<p>
|
||||
Linards Ticmanis (Illegal/undefined opcodes)</p>
|
||||
<p>
|
||||
Glenn Jones (Uthernet card)</p>
|
||||
<p>
|
||||
Stannev (Pravets - Bulgarian Apple][ clone)</p>
|
||||
<p>Tom Charlesworth (Project lead)</p>
|
||||
<p>Michael Pohoreski (Debugger rewrite)</p>
|
||||
<p>Nick Westgate (Floating bus support, Parallel printer)</p>
|
||||
<p>Linards Ticmanis (Illegal/undefined opcodes)</p>
|
||||
<p>Glenn Jones (Uthernet card)</p>
|
||||
<p>Stannev (Pravets - Bulgarian Apple][ clone)</p>
|
||||
<p>Ken Wessen (porting CP/M support from Fábio Belavenuto's TK3000 //e emulator)</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#pragma hdrstop
|
||||
#include <objbase.h>
|
||||
#include "MouseInterface.h"
|
||||
#include "z80\z80cpu.h"
|
||||
#include "z80\z80.h"
|
||||
|
||||
char VERSIONSTRING[16] = "xx.yy.zz.ww";
|
||||
|
||||
|
@ -89,7 +89,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "MouseInterface.h"
|
||||
|
||||
#ifdef SUPPORT_CPM
|
||||
#include "z80\z80cpu.h"
|
||||
#include "z80\z80.h"
|
||||
#include "z80\z80emu.h"
|
||||
#include "z80\z80io.h"
|
||||
#endif
|
||||
|
@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "MouseInterface.h"
|
||||
#ifdef SUPPORT_CPM
|
||||
#include "z80\z80emu.h"
|
||||
#include "z80\z80cpu.h"
|
||||
#include "z80\z80.h"
|
||||
#endif
|
||||
#include "..\resource\resource.h"
|
||||
|
||||
|
35
AppleWin/source/Z80/README.txt
Normal file
35
AppleWin/source/Z80/README.txt
Normal file
@ -0,0 +1,35 @@
|
||||
******* Z80Em *******
|
||||
Portable Zilog Z80 Emulator
|
||||
Version 1.2 (04-09-1997)
|
||||
|
||||
Copyright (C) Marcel de Kogel 1996,1997
|
||||
|
||||
|
||||
This package contains a portable Z80 emulator. It includes two engines: One
|
||||
written in pure C, which can be used on just about every 32+ bit system, and
|
||||
one optimised for GCC/x86 (DJGPP, Linux, FreeBSD). It can be used to emulate
|
||||
systems with multiple Z80s and systems with several different CPUs
|
||||
You can use in your own applications, as long as proper credit is given,
|
||||
no profit is made and I am notified. If you want to use this code for
|
||||
commercial purposes, e.g. using it in commercial projects, selling it, etc.,
|
||||
please contact me
|
||||
|
||||
To use the code, check the system dependent part of Z80.h, write your own
|
||||
memory and I/O functions, which are declared in Z80IO.h, write your own
|
||||
Interrupt(), Z80_Patch(), Z80_Reti() and Z80_Retn() functions, initialise
|
||||
the Z80_IPeriod and Z80_IRQ variables, call Z80_Reset() to reset all registers
|
||||
to their initial values or call Z80_SetRegs() to set all of them to pre-loaded
|
||||
ones, and finally call Z80() or repeatedly call Z80_Execute(), the latter
|
||||
option should be used in multi-processor emulations
|
||||
|
||||
For updates and examples on how to use this engine, check my homepage at
|
||||
http://www.komkon.org/~dekogel/
|
||||
|
||||
History
|
||||
-------
|
||||
1.2 04-09-97 Fixed some more bugs
|
||||
1.1 13-02-97 Fixed several bugs and compatibility problems
|
||||
1.0 31-01-97 Initial release
|
||||
|
||||
Please send your comments and bug reports to
|
||||
m.dekogel@student.utwente.nl
|
@ -1,5 +1,16 @@
|
||||
/*** Z80Em: Portable Z80 emulator *******************************************/
|
||||
/*** ***/
|
||||
/*** Z80.c ***/
|
||||
/*** ***/
|
||||
/*** This file contains the emulation code ***/
|
||||
/*** ***/
|
||||
/*** Copyright (C) Marcel de Kogel 1996,1997 ***/
|
||||
/*** You are not allowed to distribute this software commercially ***/
|
||||
/*** Please, notify me, if you make any changes to this file ***/
|
||||
/****************************************************************************/
|
||||
|
||||
#include "..\stdafx.h"
|
||||
#include "z80cpu.h"
|
||||
#include "z80.h"
|
||||
|
||||
int Z80_ICount = 0;
|
||||
|
||||
@ -402,7 +413,7 @@ static void halt(void)
|
||||
{
|
||||
--R.PC.W.l;
|
||||
R.HALT=1;
|
||||
//if (Z80_ICount>0) Z80_ICount=0;
|
||||
//if (Z80_ICount>0) Z80_ICount=0; // [AppleWin] Commented out
|
||||
}
|
||||
|
||||
static void im_0(void) { R.IM=0; }
|
||||
@ -2243,9 +2254,9 @@ static void ei(void)
|
||||
void Z80_Reset (void)
|
||||
{
|
||||
memset (&R,0,sizeof(Z80_Regs));
|
||||
R.SP.D=0x0000; // Modificado de 0xF000 para 0x0000
|
||||
R.SP.D=0x0000; // [AppleWin] Modified from 0xF000 to 0x0000
|
||||
R.R=rand();
|
||||
Z80_ICount = 0;
|
||||
Z80_ICount = 0; // [AppleWin] Modified from Z80_IPeriod to 0
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@ -2369,6 +2380,48 @@ unsigned Z80_GetPC (void)
|
||||
return R.PC.D;
|
||||
}
|
||||
|
||||
#if 0 // [AppleWin] Not used
|
||||
/****************************************************************************/
|
||||
/* Execute IPeriod T-States. Return 0 if emulation should be stopped */
|
||||
/****************************************************************************/
|
||||
int Z80_Execute (void)
|
||||
{
|
||||
unsigned opcode;
|
||||
Z80_Running=1;
|
||||
InitTables ();
|
||||
do
|
||||
{
|
||||
#ifdef TRACE
|
||||
pc_trace[pc_count]=R.PC.D;
|
||||
pc_count=(pc_count+1)&255;
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
if (R.PC.D==Z80_Trap) Z80_Trace=1;
|
||||
if (Z80_Trace) Z80_Debug(&R);
|
||||
if (!Z80_Running) break;
|
||||
#endif
|
||||
++R.R;
|
||||
opcode=M_RDOP(R.PC.D);
|
||||
R.PC.W.l++;
|
||||
Z80_ICount-=cycles_main[opcode];
|
||||
(*(opcode_main[opcode]))();
|
||||
}
|
||||
while (Z80_ICount>0);
|
||||
Z80_ICount+=Z80_IPeriod;
|
||||
Interrupt (Z80_Interrupt());
|
||||
return Z80_Running;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* Interpret Z80 code */
|
||||
/****************************************************************************/
|
||||
word Z80 (void)
|
||||
{
|
||||
while (Z80_Execute());
|
||||
return(R.PC.W.l);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
/* Dump register contents and (optionally) a PC trace to stdout */
|
||||
/****************************************************************************/
|
||||
@ -2405,13 +2458,7 @@ void Z80_SetWaitStates (int n)
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* OPCODE TABLE
|
||||
*
|
||||
***/
|
||||
// AppleWin additions:
|
||||
|
||||
//===========================================================================
|
||||
|
@ -1,11 +1,30 @@
|
||||
/*** Z80Em: Portable Z80 emulator *******************************************/
|
||||
/*** ***/
|
||||
/*** Z80.h ***/
|
||||
/*** ***/
|
||||
/*** This file contains the function prototypes and variable declarations ***/
|
||||
/*** ***/
|
||||
/*** Copyright (C) Marcel de Kogel 1996,1997 ***/
|
||||
/*** You are not allowed to distribute this software commercially ***/
|
||||
/*** Please, notify me, if you make any changes to this file ***/
|
||||
/****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
/****************************************************************************/
|
||||
/*** Machine dependent definitions ***/
|
||||
/****************************************************************************/
|
||||
/* #define DEBUG */ /* Compile debugging version */
|
||||
/* #define X86_ASM */ /* Compile optimised GCC/x86 version */
|
||||
#define LSB_FIRST /* Compile for low-endian CPU */
|
||||
/* #define __64BIT__ */ /* Compile for 64 bit machines */
|
||||
/* #define __128BIT__ */ /* Compile for 128 bit machines */
|
||||
|
||||
/****************************************************************************/
|
||||
/* If your compiler doesn't know about inlined functions, uncomment this */
|
||||
/****************************************************************************/
|
||||
/* #define INLINE static */
|
||||
|
||||
#ifndef EMU_TYPES
|
||||
#define EMU_TYPES
|
||||
|
@ -1,17 +0,0 @@
|
||||
/* Emulador do computador TK3000 //e (Microdigital)
|
||||
* por Fábio Belavenuto - Copyright (C) 2004
|
||||
*
|
||||
* Adaptado do emulador Applewin por Michael O'Brien
|
||||
*
|
||||
* 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 "Z80IO.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user