diff --git a/AppleWin/Applewin.vcproj b/AppleWin/Applewin.vcproj index 78872504..b7c43aed 100644 --- a/AppleWin/Applewin.vcproj +++ b/AppleWin/Applewin.vcproj @@ -469,7 +469,7 @@ Name="Uthernet" > + + + + + + - - - - @@ -552,10 +556,6 @@ RelativePath=".\source\Z80\z80emu.h" > - - diff --git a/AppleWin/Applewin71.vcproj b/AppleWin/Applewin71.vcproj index 70a00f22..9c7cc837 100644 --- a/AppleWin/Applewin71.vcproj +++ b/AppleWin/Applewin71.vcproj @@ -330,15 +330,18 @@ + + + + + + - - - - @@ -348,9 +351,6 @@ - - diff --git a/AppleWin/ApplewinExpress.vcproj b/AppleWin/ApplewinExpress.vcproj index 4357d34e..2460ae78 100644 --- a/AppleWin/ApplewinExpress.vcproj +++ b/AppleWin/ApplewinExpress.vcproj @@ -533,14 +533,46 @@ > + + + + + + + + + + + + + + + + + + - - @@ -562,16 +594,20 @@ Name="Resources" Filter=".txt,.ico,.bmp,.rc" > + + + + - - Thomas Stahl: TV emulation mode

Chris Foxwell: SSI263 phoneme samples

Robert Hoem: Harddisk card (source module & f/w)

-

- Spiro Trikaliotis: (VICE) whose code Glenn Jones adapted for Uthernet support

+

Spiro Trikaliotis: (VICE) whose code Glenn Jones adapted for Uthernet support

Kyle Kim: Mouse card support based on code from Apple in PC

+

MAME team: AY-3-8910, MC6821 PIA emulation modules

+

Marcel de Kogel: Z80Em code (http://www.komkon.org/~dekogel/misc.html)

+

Fábio Belavenuto: TK3000 //e clone (originally responsible for integrating Z80Em)

diff --git a/AppleWin/help/applewin-team.html b/AppleWin/help/applewin-team.html index 2553e6c0..5d5fda46 100644 --- a/AppleWin/help/applewin-team.html +++ b/AppleWin/help/applewin-team.html @@ -9,17 +9,12 @@

AppleWin team


-

- Tom Charlesworth (Project lead)

-

- Michael Pohoreski (Debugger rewrite)

-

- Nick Westgate (Floating bus support, Parallel printer)

-

- Linards Ticmanis (Illegal/undefined opcodes)

-

- Glenn Jones (Uthernet card)

-

- Stannev (Pravets - Bulgarian Apple][ clone)

+

Tom Charlesworth (Project lead)

+

Michael Pohoreski (Debugger rewrite)

+

Nick Westgate (Floating bus support, Parallel printer)

+

Linards Ticmanis (Illegal/undefined opcodes)

+

Glenn Jones (Uthernet card)

+

Stannev (Pravets - Bulgarian Apple][ clone)

+

Ken Wessen (porting CP/M support from Fábio Belavenuto's TK3000 //e emulator)

diff --git a/AppleWin/source/Applewin.cpp b/AppleWin/source/Applewin.cpp index fb288198..d77e52ea 100644 --- a/AppleWin/source/Applewin.cpp +++ b/AppleWin/source/Applewin.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #pragma hdrstop #include #include "MouseInterface.h" -#include "z80\z80cpu.h" +#include "z80\z80.h" char VERSIONSTRING[16] = "xx.yy.zz.ww"; diff --git a/AppleWin/source/CPU.cpp b/AppleWin/source/CPU.cpp index 233c7827..a7119bd7 100644 --- a/AppleWin/source/CPU.cpp +++ b/AppleWin/source/CPU.cpp @@ -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 diff --git a/AppleWin/source/Memory.cpp b/AppleWin/source/Memory.cpp index e4de58c3..2e552cf9 100644 --- a/AppleWin/source/Memory.cpp +++ b/AppleWin/source/Memory.cpp @@ -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" diff --git a/AppleWin/source/Z80/README.txt b/AppleWin/source/Z80/README.txt new file mode 100644 index 00000000..0a7894cd --- /dev/null +++ b/AppleWin/source/Z80/README.txt @@ -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 diff --git a/AppleWin/source/Z80/z80cpu.cpp b/AppleWin/source/Z80/z80.cpp similarity index 94% rename from AppleWin/source/Z80/z80cpu.cpp rename to AppleWin/source/Z80/z80.cpp index 94325e30..74615155 100644 --- a/AppleWin/source/Z80/z80cpu.cpp +++ b/AppleWin/source/Z80/z80.cpp @@ -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: //=========================================================================== diff --git a/AppleWin/source/Z80/z80cpu.h b/AppleWin/source/Z80/z80.h similarity index 82% rename from AppleWin/source/Z80/z80cpu.h rename to AppleWin/source/Z80/z80.h index 2db18e30..e6610455 100644 --- a/AppleWin/source/Z80/z80cpu.h +++ b/AppleWin/source/Z80/z80.h @@ -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 diff --git a/AppleWin/source/Z80/z80io.cpp b/AppleWin/source/Z80/z80io.cpp deleted file mode 100644 index 956a2386..00000000 --- a/AppleWin/source/Z80/z80io.cpp +++ /dev/null @@ -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" -