some FPU added :)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@81
This commit is contained in:
parent
42e5d0b779
commit
5f69f14962
8 changed files with 359 additions and 27 deletions
|
@ -25,6 +25,7 @@ typedef unsigned short Bit16u;
|
|||
typedef signed short Bit16s;
|
||||
typedef unsigned long Bit32u;
|
||||
typedef signed long Bit32s;
|
||||
typedef double Real64;
|
||||
#if defined(_MSC_VER)
|
||||
typedef unsigned __int64 Bit64u;
|
||||
typedef signed __int64 Bit64s;
|
||||
|
|
|
@ -1 +1,67 @@
|
|||
/*
|
||||
* 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 __FPU_H
|
||||
#define __FPU_H
|
||||
|
||||
#include <dosbox.h>
|
||||
#include <regs.h>
|
||||
#include <mem.h>
|
||||
|
||||
enum { FPUREG_VALID=0, FPUREG_ZERO, FPUREG_PNAN, FPUREG_NNAN, FPUREG_EMPTY };
|
||||
|
||||
enum {
|
||||
t_FLD=0, t_FLDST, t_FDIV,
|
||||
t_FDIVP, t_FCHS, t_FCOMP,
|
||||
|
||||
t_FUNKNOWN,
|
||||
t_FNOTDONE,
|
||||
};
|
||||
|
||||
bool FPU_get_C3();
|
||||
bool FPU_get_C2();
|
||||
bool FPU_get_C1();
|
||||
bool FPU_get_C0();
|
||||
bool FPU_get_IR();
|
||||
bool FPU_get_SF();
|
||||
bool FPU_get_PF();
|
||||
bool FPU_get_UF();
|
||||
bool FPU_get_OF();
|
||||
bool FPU_get_ZF();
|
||||
bool FPU_get_DF();
|
||||
bool FPU_get_IN();
|
||||
|
||||
void FPU_ESC0_Normal(Bitu rm);
|
||||
void FPU_ESC0_EA(Bitu func,PhysPt ea);
|
||||
void FPU_ESC1_Normal(Bitu rm);
|
||||
void FPU_ESC1_EA(Bitu func,PhysPt ea);
|
||||
void FPU_ESC2_Normal(Bitu rm);
|
||||
void FPU_ESC2_EA(Bitu func,PhysPt ea);
|
||||
void FPU_ESC3_Normal(Bitu rm);
|
||||
void FPU_ESC3_EA(Bitu func,PhysPt ea);
|
||||
void FPU_ESC4_Normal(Bitu rm);
|
||||
void FPU_ESC4_EA(Bitu func,PhysPt ea);
|
||||
void FPU_ESC5_Normal(Bitu rm);
|
||||
void FPU_ESC5_EA(Bitu func,PhysPt ea);
|
||||
void FPU_ESC6_Normal(Bitu rm);
|
||||
void FPU_ESC6_EA(Bitu func,PhysPt ea);
|
||||
void FPU_ESC7_Normal(Bitu rm);
|
||||
void FPU_ESC7_EA(Bitu func,PhysPt ea);
|
||||
|
||||
|
||||
#endif
|
|
@ -35,6 +35,23 @@ struct Flag_Info {
|
|||
bool oldcf;
|
||||
};
|
||||
|
||||
struct FPU_Flag_Info {
|
||||
struct {
|
||||
Real64 r;
|
||||
Bit8u tag;
|
||||
} var1,var2, result;
|
||||
struct {
|
||||
bool bf,c3,c2,c1,c0,ir,sf,pf,uf,of,zf,df,in;
|
||||
Bit8s tos;
|
||||
} sw;
|
||||
struct {
|
||||
bool ic,ie,sf,pf,uf,of,zf,df,in;
|
||||
Bit8u rc,pc;
|
||||
} cw;
|
||||
Bitu type;
|
||||
Bitu prev_type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct Segment {
|
||||
|
@ -51,6 +68,7 @@ enum { cs=0,ds,es,fs,gs,ss};
|
|||
|
||||
extern Segment Segs[6];
|
||||
extern Flag_Info flags;
|
||||
extern FPU_Flag_Info fpu_flags;
|
||||
//extern Regs regs;
|
||||
|
||||
void SetSegment_16(Bit32u seg,Bit16u val);
|
||||
|
@ -66,6 +84,13 @@ struct CPU_Regs {
|
|||
} ax,bx,cx,dx,si,di,sp,bp,ip;
|
||||
};
|
||||
|
||||
struct FPU_Regs {
|
||||
struct {
|
||||
Real64 r;
|
||||
Bit8u tag;
|
||||
} st[8];
|
||||
};
|
||||
|
||||
extern CPU_Regs cpu_regs;
|
||||
|
||||
#define reg_al cpu_regs.ax.b.l
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue