2009-05-02 23:03:37 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2002 The DOSBox Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CPU_H
|
|
|
|
#define __CPU_H
|
|
|
|
|
2009-05-02 23:27:47 +02:00
|
|
|
#include "dosbox.h"
|
|
|
|
#include "regs.h"
|
|
|
|
#include "mem.h"
|
2009-05-02 23:03:37 +02:00
|
|
|
|
|
|
|
/* Some common Defines */
|
|
|
|
/* A CPU Handler */
|
2009-05-02 23:27:47 +02:00
|
|
|
typedef Bitu (CPU_Decoder)(void);
|
2009-05-02 23:03:37 +02:00
|
|
|
extern CPU_Decoder * cpudecoder;
|
2009-05-02 23:27:47 +02:00
|
|
|
|
|
|
|
/* CPU Cycle Timing */
|
|
|
|
extern Bits CPU_Cycles;
|
|
|
|
extern Bits CPU_CycleLeft;
|
|
|
|
extern Bits CPU_CycleMax;
|
2009-05-02 23:03:37 +02:00
|
|
|
|
|
|
|
//CPU Stuff
|
|
|
|
void SetCPU16bit();
|
|
|
|
|
|
|
|
//Types of Flag changing instructions
|
|
|
|
enum {
|
|
|
|
t_ADDb=0,t_ADDw,t_ADDd,
|
|
|
|
t_ORb,t_ORw,t_ORd,
|
|
|
|
t_ADCb,t_ADCw,t_ADCd,
|
|
|
|
t_SBBb,t_SBBw,t_SBBd,
|
|
|
|
t_ANDb,t_ANDw,t_ANDd,
|
|
|
|
t_SUBb,t_SUBw,t_SUBd,
|
|
|
|
t_XORb,t_XORw,t_XORd,
|
|
|
|
t_CMPb,t_CMPw,t_CMPd,
|
|
|
|
t_INCb,t_INCw,t_INCd,
|
|
|
|
t_DECb,t_DECw,t_DECd,
|
|
|
|
t_TESTb,t_TESTw,t_TESTd,
|
|
|
|
t_SHLb,t_SHLw,t_SHLd,
|
|
|
|
t_SHRb,t_SHRw,t_SHRd,
|
|
|
|
t_SARb,t_SARw,t_SARd,
|
|
|
|
t_ROLb,t_ROLw,t_ROLd,
|
|
|
|
t_RORb,t_RORw,t_RORd,
|
|
|
|
t_RCLb,t_RCLw,t_RCLd,
|
|
|
|
t_RCRb,t_RCRw,t_RCRd,
|
|
|
|
t_NEGb,t_NEGw,t_NEGd,
|
|
|
|
t_CF,t_ZF,
|
|
|
|
|
|
|
|
t_DSHLw,t_DSHLd,
|
|
|
|
t_DSHRw,t_DSHRd,
|
|
|
|
t_MUL,t_DIV,
|
|
|
|
t_UNKNOWN,
|
|
|
|
t_NOTDONE,
|
|
|
|
};
|
|
|
|
|
|
|
|
void Interrupt(Bit8u num);
|
|
|
|
|
|
|
|
//Flag Handling
|
|
|
|
bool get_CF(void);
|
|
|
|
bool get_AF(void);
|
|
|
|
bool get_ZF(void);
|
|
|
|
bool get_SF(void);
|
|
|
|
bool get_OF(void);
|
|
|
|
bool get_PF(void);
|
|
|
|
|
|
|
|
#define LoadCF flags.cf=get_CF();
|
|
|
|
#define LoadZF flags.zf=get_ZF();
|
|
|
|
#define LoadSF flags.sf=get_SF();
|
|
|
|
#define LoadOF flags.of=get_OF();
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|