|
|
1.1 ! root 1: /* Multi-Z80 32 Bit emulator */ ! 2: ! 3: /* Copyright 1999, Neil Bradley, All rights reserved ! 4: * ! 5: * License agreement: ! 6: * ! 7: * The mZ80 emulator may be distributed in unmodified form to any medium. ! 8: * ! 9: * mZ80 May not be sold, or sold as a part of a commercial package without ! 10: * the express written permission of Neil Bradley ([email protected]). This ! 11: * includes shareware. ! 12: * ! 13: * Modified versions of mZ80 may not be publicly redistributed without author ! 14: * approval ([email protected]). This includes distributing via a publicly ! 15: * accessible LAN. You may make your own source modifications and distribute ! 16: * mZ80 in object only form. ! 17: * ! 18: * mZ80 Licensing for commercial applications is available. Please email ! 19: * [email protected] for details. ! 20: * ! 21: * Synthcom Systems, Inc, and Neil Bradley will not be held responsible for ! 22: * any damage done by the use of mZ80. It is purely "as-is". ! 23: * ! 24: * If you use mZ80 in a freeware application, credit in the following text: ! 25: * ! 26: * "Multi-Z80 CPU emulator by Neil Bradley ([email protected])" ! 27: * ! 28: * must accompany the freeware application within the application itself or ! 29: * in the documentation. ! 30: * ! 31: * Legal stuff aside: ! 32: * ! 33: * If you find problems with mZ80, please email the author so they can get ! 34: * resolved. If you find a bug and fix it, please also email the author so ! 35: * that those bug fixes can be propogated to the installed base of mZ80 ! 36: * users. If you find performance improvements or problems with mZ80, please ! 37: * email the author with your changes/suggestions and they will be rolled in ! 38: * with subsequent releases of mZ80. ! 39: * ! 40: * The whole idea of this emulator is to have the fastest available 32 bit ! 41: * Multi-z80 emulator for the PC, giving maximum performance. ! 42: */ ! 43: ! 44: /* General z80 based defines */ ! 45: ! 46: //#include "rccore/types.h" ! 47: ! 48: #ifndef _MZ80_H_ ! 49: #define _MZ80_H_ ! 50: ! 51: #ifndef UINT32 ! 52: #define UINT32 unsigned long int ! 53: #endif ! 54: ! 55: #ifndef UINT16 ! 56: #define UINT16 unsigned short int ! 57: #endif ! 58: ! 59: #ifndef UINT8 ! 60: #define UINT8 unsigned char ! 61: #endif ! 62: ! 63: #ifdef __cplusplus ! 64: extern "C" { ! 65: #endif ! 66: ! 67: #ifndef _MEMORYREADWRITEBYTE_ ! 68: #define _MEMORYREADWRITEBYTE_ ! 69: ! 70: struct MemoryWriteByte ! 71: { ! 72: UINT32 lowAddr; ! 73: UINT32 highAddr; ! 74: void (*memoryCall)(UINT32, UINT8, struct MemoryWriteByte *); ! 75: void *pUserArea; ! 76: }; ! 77: ! 78: struct MemoryReadByte ! 79: { ! 80: UINT32 lowAddr; ! 81: UINT32 highAddr; ! 82: UINT8 (*memoryCall)(UINT32, struct MemoryReadByte *); ! 83: void *pUserArea; ! 84: }; ! 85: ! 86: #endif // _MEMORYREADWRITEBYTE_ ! 87: ! 88: struct z80PortWrite ! 89: { ! 90: UINT16 lowIoAddr; ! 91: UINT16 highIoAddr; ! 92: void (*IOCall)(UINT16, UINT8, struct z80PortWrite *); ! 93: void *pUserArea; ! 94: }; ! 95: ! 96: struct z80PortRead ! 97: { ! 98: UINT16 lowIoAddr; ! 99: UINT16 highIoAddr; ! 100: UINT16 (*IOCall)(UINT16, struct z80PortRead *); ! 101: void *pUserArea; ! 102: }; ! 103: ! 104: struct z80TrapRec ! 105: { ! 106: UINT16 trapAddr; ! 107: UINT8 skipCnt; ! 108: UINT8 origIns; ! 109: }; ! 110: ! 111: struct mz80context ! 112: { ! 113: UINT8 *z80Base; ! 114: struct MemoryReadByte *z80MemRead; ! 115: struct MemoryWriteByte *z80MemWrite; ! 116: struct z80PortRead *z80IoRead; ! 117: struct z80PortWrite *z80IoWrite; ! 118: UINT32 z80clockticks; ! 119: UINT32 z80inInterrupt; ! 120: UINT32 z80interruptMode; ! 121: UINT32 z80interruptState; ! 122: UINT32 z80halted; ! 123: UINT16 z80af; ! 124: UINT16 z80bc; ! 125: UINT16 z80de; ! 126: UINT16 z80hl; ! 127: UINT16 z80afprime; ! 128: UINT16 z80bcprime; ! 129: UINT16 z80deprime; ! 130: UINT16 z80hlprime; ! 131: UINT16 z80ix; ! 132: UINT16 z80iy; ! 133: UINT16 z80sp; ! 134: UINT16 z80pc; ! 135: UINT16 z80nmiAddr; ! 136: UINT16 z80intAddr; ! 137: UINT8 z80i; ! 138: UINT8 z80r; ! 139: } /* RETRO_PACKED */ ; ! 140: ! 141: extern UINT8 *mz80Base; ! 142: extern UINT32 mz80exec(unsigned long int); ! 143: extern UINT32 mz80GetContextSize(void); ! 144: extern UINT32 mz80GetElapsedTicks(UINT32); ! 145: extern void mz80ReleaseTimeslice(void); ! 146: extern void mz80GetContext(void *); ! 147: extern void mz80SetContext(void *); ! 148: extern void mz80reset(void); ! 149: extern UINT32 mz80int(UINT32); ! 150: extern UINT32 mz80nmi(void); ! 151: extern UINT16 z80intAddr; ! 152: extern UINT16 z80nmiAddr; ! 153: extern UINT16 z80pc; ! 154: ! 155: typedef struct mz80context CONTEXTMZ80; ! 156: ! 157: #ifdef __cplusplus ! 158: }; ! 159: #endif ! 160: ! 161: #endif // _MZ80_H_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.