| 1 |
/* |
| 2 |
* Copyright (C) 2002-2010 The DOSBox Team |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation; either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 |
*/ |
| 18 |
|
| 19 |
#include "dosbox.h" |
| 20 |
|
| 21 |
#include "pic.h" |
| 22 |
#include "regs.h" |
| 23 |
#include "cpu.h" |
| 24 |
#include "lazyflags.h" |
| 25 |
#include "paging.h" |
| 26 |
#include "fpu.h" |
| 27 |
#include "debug.h" |
| 28 |
#include "inout.h" |
| 29 |
#include "callback.h" |
| 30 |
|
| 31 |
|
| 32 |
typedef PhysPt EAPoint; |
| 33 |
#define SegBase(c) SegPhys(c) |
| 34 |
|
| 35 |
#define LoadMb(off) mem_readb_inline(off) |
| 36 |
#define LoadMw(off) mem_readw_inline(off) |
| 37 |
#define LoadMd(off) mem_readd_inline(off) |
| 38 |
|
| 39 |
#define LoadMbs(off) (Bit8s)(LoadMb(off)) |
| 40 |
#define LoadMws(off) (Bit16s)(LoadMw(off)) |
| 41 |
#define LoadMds(off) (Bit32s)(LoadMd(off)) |
| 42 |
|
| 43 |
#define SaveMb(off,val) mem_writeb_inline(off,val) |
| 44 |
#define SaveMw(off,val) mem_writew_inline(off,val) |
| 45 |
#define SaveMd(off,val) mem_writed_inline(off,val) |
| 46 |
|
| 47 |
#define LoadD(reg) reg |
| 48 |
#define SaveD(reg,val) reg=val |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
#include "core_full/loadwrite.h" |
| 53 |
#include "core_full/support.h" |
| 54 |
#include "core_full/optable.h" |
| 55 |
#include "instructions.h" |
| 56 |
|
| 57 |
#define EXCEPTION(blah) \ |
| 58 |
{ \ |
| 59 |
Bit8u new_num=blah; \ |
| 60 |
CPU_Exception(new_num,0); \ |
| 61 |
continue; \ |
| 62 |
} |
| 63 |
|
| 64 |
Bits CPU_Core_Full_Run(void) { |
| 65 |
FullData inst; |
| 66 |
while (CPU_Cycles-->0) { |
| 67 |
#if C_DEBUG |
| 68 |
cycle_count++; |
| 69 |
#if C_HEAVY_DEBUG |
| 70 |
if (DEBUG_HeavyIsBreakpoint()) { |
| 71 |
FillFlags(); |
| 72 |
return debugCallback; |
| 73 |
}; |
| 74 |
#endif |
| 75 |
#endif |
| 76 |
LoadIP(); |
| 77 |
inst.entry=cpu.code.big*0x200; |
| 78 |
inst.prefix=cpu.code.big; |
| 79 |
restartopcode: |
| 80 |
inst.entry=(inst.entry & 0xffffff00) | Fetchb(); |
| 81 |
inst.code=OpCodeTable[inst.entry]; |
| 82 |
#include "core_full/load.h" |
| 83 |
#include "core_full/op.h" |
| 84 |
#include "core_full/save.h" |
| 85 |
nextopcode:; |
| 86 |
SaveIP(); |
| 87 |
continue; |
| 88 |
illegalopcode: |
| 89 |
LOG(LOG_CPU,LOG_NORMAL)("Illegal opcode"); |
| 90 |
CPU_Exception(0x6,0); |
| 91 |
} |
| 92 |
FillFlags(); |
| 93 |
return CBRET_NONE; |
| 94 |
} |
| 95 |
|
| 96 |
|
| 97 |
void CPU_Core_Full_Init(void) { |
| 98 |
|
| 99 |
} |