Add compiler testing for always_inline attribute
Add compiler testing for fastcall attribute Add the FASTCALL define to visual c Remove some overkill inline routines Make sure that all the inline routines in headers are static Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3355
This commit is contained in:
parent
5f6236ee35
commit
88caf1dc71
20 changed files with 182 additions and 147 deletions
13
acinclude.m4
13
acinclude.m4
|
@ -323,7 +323,18 @@ AH_TOP([
|
|||
*/
|
||||
])
|
||||
|
||||
AH_BOTTOM([#define INLINE inline])
|
||||
AH_BOTTOM([#if C_ATTRIBUTE_ALWAYS_INLINE
|
||||
#define INLINE __attribute__((always_inline))
|
||||
#else
|
||||
#define INLINE inline
|
||||
#endif])
|
||||
|
||||
AH_BOTTOM([#if C_ATTRIBUTE_FASTCALL
|
||||
#define DB_FASTCALL __attribute__((fastcall))
|
||||
#else
|
||||
#define DB_FASTCALL
|
||||
#endif])
|
||||
|
||||
|
||||
AH_BOTTOM([#if C_HAS_ATTRIBUTE
|
||||
#define GCC_ATTRIBUTE(x) __attribute__ ((x))
|
||||
|
|
19
configure.in
19
configure.in
|
@ -142,6 +142,25 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|||
typedef struct { } __attribute__((packed)) junk;]],
|
||||
[[ ]])],[ AC_MSG_RESULT(yes);AC_DEFINE(C_HAS_ATTRIBUTE)],AC_MSG_RESULT(no))
|
||||
|
||||
|
||||
#Check if the compiler supports certain attributes
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="-Werror"
|
||||
|
||||
AH_TEMPLATE([C_ATTRIBUTE_ALWAYS_INLINE],[Determines if the compilers supports always_inline attribute.])
|
||||
AC_MSG_CHECKING(if compiler allows __attribute__((always_inline)) )
|
||||
AC_COMPILE_IFELSE([ void __attribute__((always_inline)) test(){}
|
||||
],[ AC_MSG_RESULT(yes);AC_DEFINE(C_ATTRIBUTE_ALWAYS_INLINE)],AC_MSG_RESULT(no))
|
||||
|
||||
AH_TEMPLATE([C_ATTRIBUTE_FASTCALL],[Determines if the compilers supports fastcall attribute.])
|
||||
AC_MSG_CHECKING(if compiler allows __attribute__((fastcall)) )
|
||||
AC_COMPILE_IFELSE([ void __attribute__((fastcall)) test(){}
|
||||
],[ AC_MSG_RESULT(yes);AC_DEFINE(C_ATTRIBUTE_FASTCALL)],AC_MSG_RESULT(no))
|
||||
|
||||
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
|
||||
#Check if the compiler supports __builtin_expect
|
||||
#Switch language to c++
|
||||
AC_LANG_PUSH(C++)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: callback.h,v 1.22 2009-01-14 22:16:00 qbix79 Exp $ */
|
||||
/* $Id: callback.h,v 1.23 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSBOX_CALLBACK_H
|
||||
#define DOSBOX_CALLBACK_H
|
||||
|
@ -43,14 +43,14 @@ enum {
|
|||
|
||||
extern Bit8u lastint;
|
||||
|
||||
INLINE RealPt CALLBACK_RealPointer(Bitu callback) {
|
||||
static INLINE RealPt CALLBACK_RealPointer(Bitu callback) {
|
||||
return RealMake(CB_SEG,(Bit16u)(callback*CB_SIZE));
|
||||
}
|
||||
INLINE PhysPt CALLBACK_PhysPointer(Bitu callback) {
|
||||
static INLINE PhysPt CALLBACK_PhysPointer(Bitu callback) {
|
||||
return PhysMake(CB_SEG,(Bit16u)(callback*CB_SIZE));
|
||||
}
|
||||
|
||||
INLINE PhysPt CALLBACK_GetBase(void) {
|
||||
static INLINE PhysPt CALLBACK_GetBase(void) {
|
||||
return CB_SEG << 4;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: cpu.h,v 1.55 2008-08-24 16:43:06 qbix79 Exp $ */
|
||||
/* $Id: cpu.h,v 1.56 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSBOX_CPU_H
|
||||
#define DOSBOX_CPU_H
|
||||
|
@ -144,13 +144,13 @@ void CPU_ENTER(bool use32,Bitu bytes,Bitu level);
|
|||
#define CPU_INT_NOIOPLCHECK 0x8
|
||||
|
||||
void CPU_Interrupt(Bitu num,Bitu type,Bitu oldeip);
|
||||
INLINE void CPU_HW_Interrupt(Bitu num) {
|
||||
static INLINE void CPU_HW_Interrupt(Bitu num) {
|
||||
CPU_Interrupt(num,0,reg_eip);
|
||||
}
|
||||
INLINE void CPU_SW_Interrupt(Bitu num,Bitu oldeip) {
|
||||
static INLINE void CPU_SW_Interrupt(Bitu num,Bitu oldeip) {
|
||||
CPU_Interrupt(num,CPU_INT_SOFTWARE,oldeip);
|
||||
}
|
||||
INLINE void CPU_SW_Interrupt_NoIOPLCheck(Bitu num,Bitu oldeip) {
|
||||
static INLINE void CPU_SW_Interrupt_NoIOPLCheck(Bitu num,Bitu oldeip) {
|
||||
CPU_Interrupt(num,CPU_INT_SOFTWARE|CPU_INT_NOIOPLCHECK,oldeip);
|
||||
}
|
||||
|
||||
|
@ -478,12 +478,12 @@ struct CPUBlock {
|
|||
|
||||
extern CPUBlock cpu;
|
||||
|
||||
INLINE void CPU_SetFlagsd(Bitu word) {
|
||||
static INLINE void CPU_SetFlagsd(Bitu word) {
|
||||
Bitu mask=cpu.cpl ? FMASK_NORMAL : FMASK_ALL;
|
||||
CPU_SetFlags(word,mask);
|
||||
}
|
||||
|
||||
INLINE void CPU_SetFlagsw(Bitu word) {
|
||||
static INLINE void CPU_SetFlagsw(Bitu word) {
|
||||
Bitu mask=(cpu.cpl ? FMASK_NORMAL : FMASK_ALL) & 0xffff;
|
||||
CPU_SetFlags(word,mask);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_inc.h,v 1.76 2008-09-06 14:47:02 c2woody Exp $ */
|
||||
/* $Id: dos_inc.h,v 1.77 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSBOX_DOS_INC_H
|
||||
#define DOSBOX_DOS_INC_H
|
||||
|
@ -208,18 +208,18 @@ enum {
|
|||
};
|
||||
|
||||
|
||||
INLINE Bit16u long2para(Bit32u size) {
|
||||
static INLINE Bit16u long2para(Bit32u size) {
|
||||
if (size>0xFFFF0) return 0xffff;
|
||||
if (size&0xf) return (Bit16u)((size>>4)+1);
|
||||
else return (Bit16u)(size>>4);
|
||||
}
|
||||
|
||||
|
||||
INLINE Bit16u DOS_PackTime(Bit16u hour,Bit16u min,Bit16u sec) {
|
||||
static INLINE Bit16u DOS_PackTime(Bit16u hour,Bit16u min,Bit16u sec) {
|
||||
return (hour&0x1f)<<11 | (min&0x3f) << 5 | ((sec/2)&0x1f);
|
||||
}
|
||||
|
||||
INLINE Bit16u DOS_PackDate(Bit16u year,Bit16u mon,Bit16u day) {
|
||||
static INLINE Bit16u DOS_PackDate(Bit16u year,Bit16u mon,Bit16u day) {
|
||||
return ((year-1980)&0x7f)<<9 | (mon&0x3f) << 5 | (day&0x1f);
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ INLINE Bit16u DOS_PackDate(Bit16u year,Bit16u mon,Bit16u day) {
|
|||
|
||||
class MemStruct {
|
||||
public:
|
||||
INLINE Bitu GetIt(Bitu size,PhysPt addr) {
|
||||
Bitu GetIt(Bitu size,PhysPt addr) {
|
||||
switch (size) {
|
||||
case 1:return mem_readb(pt+addr);
|
||||
case 2:return mem_readw(pt+addr);
|
||||
|
@ -262,16 +262,16 @@ public:
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
INLINE void SaveIt(Bitu size,PhysPt addr,Bitu val) {
|
||||
void SaveIt(Bitu size,PhysPt addr,Bitu val) {
|
||||
switch (size) {
|
||||
case 1:mem_writeb(pt+addr,(Bit8u)val);break;
|
||||
case 2:mem_writew(pt+addr,(Bit16u)val);break;
|
||||
case 4:mem_writed(pt+addr,(Bit32u)val);break;
|
||||
}
|
||||
}
|
||||
INLINE void SetPt(Bit16u seg) { pt=PhysMake(seg,0);}
|
||||
INLINE void SetPt(Bit16u seg,Bit16u off) { pt=PhysMake(seg,off);}
|
||||
INLINE void SetPt(RealPt addr) { pt=Real2Phys(addr);}
|
||||
void SetPt(Bit16u seg) { pt=PhysMake(seg,0);}
|
||||
void SetPt(Bit16u seg,Bit16u off) { pt=PhysMake(seg,off);}
|
||||
void SetPt(RealPt addr) { pt=Real2Phys(addr);}
|
||||
protected:
|
||||
PhysPt pt;
|
||||
};
|
||||
|
@ -635,7 +635,7 @@ struct DOS_Block {
|
|||
|
||||
extern DOS_Block dos;
|
||||
|
||||
INLINE Bit8u RealHandle(Bit16u handle) {
|
||||
static Bit8u RealHandle(Bit16u handle) {
|
||||
DOS_PSP psp(dos.psp());
|
||||
return psp.GetFileHandle(handle);
|
||||
}
|
||||
|
|
|
@ -108,44 +108,44 @@ extern FPU_rec fpu;
|
|||
Bit16u FPU_GetTag(void);
|
||||
void FPU_FLDCW(PhysPt addr);
|
||||
|
||||
INLINE void FPU_SetTag(Bit16u tag){
|
||||
static INLINE void FPU_SetTag(Bit16u tag){
|
||||
for(Bitu i=0;i<8;i++)
|
||||
fpu.tags[i] = static_cast<FPU_Tag>((tag >>(2*i))&3);
|
||||
}
|
||||
|
||||
INLINE void FPU_SetCW(Bitu word){
|
||||
static INLINE void FPU_SetCW(Bitu word){
|
||||
fpu.cw = (Bit16u)word;
|
||||
fpu.cw_mask_all = (Bit16u)(word | 0x3f);
|
||||
fpu.round = (FPU_Round)((word >> 10) & 3);
|
||||
}
|
||||
|
||||
|
||||
INLINE Bitu FPU_GET_TOP(void) {
|
||||
static INLINE Bitu FPU_GET_TOP(void) {
|
||||
return (fpu.sw & 0x3800)>>11;
|
||||
}
|
||||
|
||||
INLINE void FPU_SET_TOP(Bitu val){
|
||||
static INLINE void FPU_SET_TOP(Bitu val){
|
||||
fpu.sw &= ~0x3800;
|
||||
fpu.sw |= (val&7)<<11;
|
||||
}
|
||||
|
||||
|
||||
INLINE void FPU_SET_C0(Bitu C){
|
||||
static INLINE void FPU_SET_C0(Bitu C){
|
||||
fpu.sw &= ~0x0100;
|
||||
if(C) fpu.sw |= 0x0100;
|
||||
}
|
||||
|
||||
INLINE void FPU_SET_C1(Bitu C){
|
||||
static INLINE void FPU_SET_C1(Bitu C){
|
||||
fpu.sw &= ~0x0200;
|
||||
if(C) fpu.sw |= 0x0200;
|
||||
}
|
||||
|
||||
INLINE void FPU_SET_C2(Bitu C){
|
||||
static INLINE void FPU_SET_C2(Bitu C){
|
||||
fpu.sw &= ~0x0400;
|
||||
if(C) fpu.sw |= 0x0400;
|
||||
}
|
||||
|
||||
INLINE void FPU_SET_C3(Bitu C){
|
||||
static INLINE void FPU_SET_C3(Bitu C){
|
||||
fpu.sw &= ~0x4000;
|
||||
if(C) fpu.sw |= 0x4000;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: inout.h,v 1.11 2007-06-12 20:22:07 c2woody Exp $ */
|
||||
/* $Id: inout.h,v 1.12 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSBOX_INOUT_H
|
||||
#define DOSBOX_INOUT_H
|
||||
|
@ -68,10 +68,10 @@ public:
|
|||
~IO_WriteHandleObject();
|
||||
};
|
||||
|
||||
INLINE void IO_Write(Bitu port,Bit8u val) {
|
||||
static INLINE void IO_Write(Bitu port,Bit8u val) {
|
||||
IO_WriteB(port,val);
|
||||
}
|
||||
INLINE Bit8u IO_Read(Bitu port){
|
||||
static INLINE Bit8u IO_Read(Bitu port){
|
||||
return (Bit8u)IO_ReadB(port);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,23 +59,23 @@ MemHandle MEM_NextHandleAt(MemHandle handle,Bitu where);
|
|||
|
||||
#if defined(WORDS_BIGENDIAN) || !defined(C_UNALIGNED_MEMORY)
|
||||
|
||||
INLINE Bit8u host_readb(HostPt off) {
|
||||
static 4/25/2009INLINE Bit8u host_readb(HostPt off) {
|
||||
return off[0];
|
||||
}
|
||||
INLINE Bit16u host_readw(HostPt off) {
|
||||
static INLINE Bit16u host_readw(HostPt off) {
|
||||
return off[0] | (off[1] << 8);
|
||||
}
|
||||
INLINE Bit32u host_readd(HostPt off) {
|
||||
static INLINE Bit32u host_readd(HostPt off) {
|
||||
return off[0] | (off[1] << 8) | (off[2] << 16) | (off[3] << 24);
|
||||
}
|
||||
INLINE void host_writeb(HostPt off,Bit8u val) {
|
||||
static INLINE void host_writeb(HostPt off,Bit8u val) {
|
||||
off[0]=val;
|
||||
}
|
||||
INLINE void host_writew(HostPt off,Bit16u val) {
|
||||
static INLINE void host_writew(HostPt off,Bit16u val) {
|
||||
off[0]=(Bit8u)(val);
|
||||
off[1]=(Bit8u)(val >> 8);
|
||||
}
|
||||
INLINE void host_writed(HostPt off,Bit32u val) {
|
||||
static INLINE void host_writed(HostPt off,Bit32u val) {
|
||||
off[0]=(Bit8u)(val);
|
||||
off[1]=(Bit8u)(val >> 8);
|
||||
off[2]=(Bit8u)(val >> 16);
|
||||
|
@ -84,37 +84,37 @@ INLINE void host_writed(HostPt off,Bit32u val) {
|
|||
|
||||
#else
|
||||
|
||||
INLINE Bit8u host_readb(HostPt off) {
|
||||
static INLINE Bit8u host_readb(HostPt off) {
|
||||
return *(Bit8u *)off;
|
||||
}
|
||||
INLINE Bit16u host_readw(HostPt off) {
|
||||
static INLINE Bit16u host_readw(HostPt off) {
|
||||
return *(Bit16u *)off;
|
||||
}
|
||||
INLINE Bit32u host_readd(HostPt off) {
|
||||
static INLINE Bit32u host_readd(HostPt off) {
|
||||
return *(Bit32u *)off;
|
||||
}
|
||||
INLINE void host_writeb(HostPt off,Bit8u val) {
|
||||
static INLINE void host_writeb(HostPt off,Bit8u val) {
|
||||
*(Bit8u *)(off)=val;
|
||||
}
|
||||
INLINE void host_writew(HostPt off,Bit16u val) {
|
||||
static INLINE void host_writew(HostPt off,Bit16u val) {
|
||||
*(Bit16u *)(off)=val;
|
||||
}
|
||||
INLINE void host_writed(HostPt off,Bit32u val) {
|
||||
static INLINE void host_writed(HostPt off,Bit32u val) {
|
||||
*(Bit32u *)(off)=val;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
INLINE void var_write(Bit8u * var, Bit8u val) {
|
||||
static INLINE void var_write(Bit8u * var, Bit8u val) {
|
||||
host_writeb((HostPt)var, val);
|
||||
}
|
||||
|
||||
INLINE void var_write(Bit16u * var, Bit16u val) {
|
||||
static INLINE void var_write(Bit16u * var, Bit16u val) {
|
||||
host_writew((HostPt)var, val);
|
||||
}
|
||||
|
||||
INLINE void var_write(Bit32u * var, Bit32u val) {
|
||||
static INLINE void var_write(Bit32u * var, Bit32u val) {
|
||||
host_writed((HostPt)var, val);
|
||||
}
|
||||
|
||||
|
@ -128,23 +128,23 @@ void mem_writeb(PhysPt pt,Bit8u val);
|
|||
void mem_writew(PhysPt pt,Bit16u val);
|
||||
void mem_writed(PhysPt pt,Bit32u val);
|
||||
|
||||
INLINE void phys_writeb(PhysPt addr,Bit8u val) {
|
||||
static INLINE void phys_writeb(PhysPt addr,Bit8u val) {
|
||||
host_writeb(MemBase+addr,val);
|
||||
}
|
||||
INLINE void phys_writew(PhysPt addr,Bit16u val){
|
||||
static INLINE void phys_writew(PhysPt addr,Bit16u val){
|
||||
host_writew(MemBase+addr,val);
|
||||
}
|
||||
INLINE void phys_writed(PhysPt addr,Bit32u val){
|
||||
static INLINE void phys_writed(PhysPt addr,Bit32u val){
|
||||
host_writed(MemBase+addr,val);
|
||||
}
|
||||
|
||||
INLINE Bit8u phys_readb(PhysPt addr) {
|
||||
static INLINE Bit8u phys_readb(PhysPt addr) {
|
||||
return host_readb(MemBase+addr);
|
||||
}
|
||||
INLINE Bit16u phys_readw(PhysPt addr){
|
||||
static INLINE Bit16u phys_readw(PhysPt addr){
|
||||
return host_readw(MemBase+addr);
|
||||
}
|
||||
INLINE Bit32u phys_readd(PhysPt addr){
|
||||
static INLINE Bit32u phys_readd(PhysPt addr){
|
||||
return host_readd(MemBase+addr);
|
||||
}
|
||||
|
||||
|
@ -161,57 +161,57 @@ void mem_strcpy(PhysPt dest,PhysPt src);
|
|||
|
||||
/* The folowing functions are all shortcuts to the above functions using physical addressing */
|
||||
|
||||
INLINE Bit8u real_readb(Bit16u seg,Bit16u off) {
|
||||
static INLINE Bit8u real_readb(Bit16u seg,Bit16u off) {
|
||||
return mem_readb((seg<<4)+off);
|
||||
}
|
||||
INLINE Bit16u real_readw(Bit16u seg,Bit16u off) {
|
||||
static INLINE Bit16u real_readw(Bit16u seg,Bit16u off) {
|
||||
return mem_readw((seg<<4)+off);
|
||||
}
|
||||
INLINE Bit32u real_readd(Bit16u seg,Bit16u off) {
|
||||
static INLINE Bit32u real_readd(Bit16u seg,Bit16u off) {
|
||||
return mem_readd((seg<<4)+off);
|
||||
}
|
||||
|
||||
INLINE void real_writeb(Bit16u seg,Bit16u off,Bit8u val) {
|
||||
static INLINE void real_writeb(Bit16u seg,Bit16u off,Bit8u val) {
|
||||
mem_writeb(((seg<<4)+off),val);
|
||||
}
|
||||
INLINE void real_writew(Bit16u seg,Bit16u off,Bit16u val) {
|
||||
static INLINE void real_writew(Bit16u seg,Bit16u off,Bit16u val) {
|
||||
mem_writew(((seg<<4)+off),val);
|
||||
}
|
||||
INLINE void real_writed(Bit16u seg,Bit16u off,Bit32u val) {
|
||||
static INLINE void real_writed(Bit16u seg,Bit16u off,Bit32u val) {
|
||||
mem_writed(((seg<<4)+off),val);
|
||||
}
|
||||
|
||||
|
||||
INLINE Bit16u RealSeg(RealPt pt) {
|
||||
static INLINE Bit16u RealSeg(RealPt pt) {
|
||||
return (Bit16u)(pt>>16);
|
||||
}
|
||||
|
||||
INLINE Bit16u RealOff(RealPt pt) {
|
||||
static INLINE Bit16u RealOff(RealPt pt) {
|
||||
return (Bit16u)(pt&0xffff);
|
||||
}
|
||||
|
||||
INLINE PhysPt Real2Phys(RealPt pt) {
|
||||
static INLINE PhysPt Real2Phys(RealPt pt) {
|
||||
return (RealSeg(pt)<<4) +RealOff(pt);
|
||||
}
|
||||
|
||||
INLINE PhysPt PhysMake(Bit16u seg,Bit16u off) {
|
||||
static INLINE PhysPt PhysMake(Bit16u seg,Bit16u off) {
|
||||
return (seg<<4)+off;
|
||||
}
|
||||
|
||||
INLINE RealPt RealMake(Bit16u seg,Bit16u off) {
|
||||
static INLINE RealPt RealMake(Bit16u seg,Bit16u off) {
|
||||
return (seg<<16)+off;
|
||||
}
|
||||
|
||||
INLINE void RealSetVec(Bit8u vec,RealPt pt) {
|
||||
static INLINE void RealSetVec(Bit8u vec,RealPt pt) {
|
||||
mem_writed(vec<<2,pt);
|
||||
}
|
||||
|
||||
INLINE void RealSetVec(Bit8u vec,RealPt pt,RealPt &old) {
|
||||
static INLINE void RealSetVec(Bit8u vec,RealPt pt,RealPt &old) {
|
||||
old = mem_readd(vec<<2);
|
||||
mem_writed(vec<<2,pt);
|
||||
}
|
||||
|
||||
INLINE RealPt RealGetVec(Bit8u vec) {
|
||||
static INLINE RealPt RealGetVec(Bit8u vec) {
|
||||
return mem_readd(vec<<2);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: mixer.h,v 1.17 2009-03-19 20:45:42 c2woody Exp $ */
|
||||
/* $Id: mixer.h,v 1.18 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSBOX_MIXER_H
|
||||
#define DOSBOX_MIXER_H
|
||||
|
@ -52,8 +52,10 @@ public:
|
|||
void SetFreq(Bitu _freq);
|
||||
void Mix(Bitu _needed);
|
||||
void AddSilence(void); //Fill up until needed
|
||||
|
||||
template<class Type,bool stereo,bool signeddata,bool nativeorder>
|
||||
void AddSamples(Bitu len, const Type* data);
|
||||
|
||||
void AddSamples_m8(Bitu len, const Bit8u * data);
|
||||
void AddSamples_s8(Bitu len, const Bit8u * data);
|
||||
void AddSamples_m8s(Bitu len, const Bit8s * data);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: paging.h,v 1.31 2008-01-05 21:04:43 c2woody Exp $ */
|
||||
/* $Id: paging.h,v 1.32 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSBOX_PAGING_H
|
||||
#define DOSBOX_PAGING_H
|
||||
|
@ -197,25 +197,25 @@ bool mem_unalignedwrited_checked(PhysPt address,Bit32u val);
|
|||
|
||||
#if defined(USE_FULL_TLB)
|
||||
|
||||
INLINE HostPt get_tlb_read(PhysPt address) {
|
||||
static INLINE HostPt get_tlb_read(PhysPt address) {
|
||||
return paging.tlb.read[address>>12];
|
||||
}
|
||||
INLINE HostPt get_tlb_write(PhysPt address) {
|
||||
static INLINE HostPt get_tlb_write(PhysPt address) {
|
||||
return paging.tlb.write[address>>12];
|
||||
}
|
||||
INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
|
||||
static INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
|
||||
return paging.tlb.readhandler[address>>12];
|
||||
}
|
||||
INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
|
||||
static INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
|
||||
return paging.tlb.writehandler[address>>12];
|
||||
}
|
||||
|
||||
/* Use these helper functions to access linear addresses in readX/writeX functions */
|
||||
INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||
static INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||
return (paging.tlb.phys_page[linePage>>12]<<12);
|
||||
}
|
||||
|
||||
INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||
static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||
return (paging.tlb.phys_page[linAddr>>12]<<12)|(linAddr&0xfff);
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
|||
|
||||
void PAGING_InitTLBBank(tlb_entry **bank);
|
||||
|
||||
INLINE tlb_entry *get_tlb_entry(PhysPt address) {
|
||||
static INLINE tlb_entry *get_tlb_entry(PhysPt address) {
|
||||
Bitu index=(address>>12);
|
||||
if (TLB_BANKS && (index > TLB_SIZE)) {
|
||||
Bitu bank=(address>>BANK_SHIFT) - 1;
|
||||
|
@ -234,26 +234,26 @@ INLINE tlb_entry *get_tlb_entry(PhysPt address) {
|
|||
return &paging.tlbh[index];
|
||||
}
|
||||
|
||||
INLINE HostPt get_tlb_read(PhysPt address) {
|
||||
static INLINE HostPt get_tlb_read(PhysPt address) {
|
||||
return get_tlb_entry(address)->read;
|
||||
}
|
||||
INLINE HostPt get_tlb_write(PhysPt address) {
|
||||
static INLINE HostPt get_tlb_write(PhysPt address) {
|
||||
return get_tlb_entry(address)->write;
|
||||
}
|
||||
INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
|
||||
static INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
|
||||
return get_tlb_entry(address)->readhandler;
|
||||
}
|
||||
INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
|
||||
static INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
|
||||
return get_tlb_entry(address)->writehandler;
|
||||
}
|
||||
|
||||
/* Use these helper functions to access linear addresses in readX/writeX functions */
|
||||
INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||
static INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||
tlb_entry *entry = get_tlb_entry(linePage);
|
||||
return (entry->phys_page<<12);
|
||||
}
|
||||
|
||||
INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||
static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||
tlb_entry *entry = get_tlb_entry(linAddr);
|
||||
return (entry->phys_page<<12)|(linAddr&0xfff);
|
||||
}
|
||||
|
@ -261,13 +261,13 @@ INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
|||
|
||||
/* Special inlined memory reading/writing */
|
||||
|
||||
INLINE Bit8u mem_readb_inline(PhysPt address) {
|
||||
static INLINE Bit8u mem_readb_inline(PhysPt address) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) return host_readb(tlb_addr+address);
|
||||
else return (Bit8u)(get_tlb_readhandler(address))->readb(address);
|
||||
}
|
||||
|
||||
INLINE Bit16u mem_readw_inline(PhysPt address) {
|
||||
static INLINE Bit16u mem_readw_inline(PhysPt address) {
|
||||
if ((address & 0xfff)<0xfff) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) return host_readw(tlb_addr+address);
|
||||
|
@ -275,7 +275,7 @@ INLINE Bit16u mem_readw_inline(PhysPt address) {
|
|||
} else return mem_unalignedreadw(address);
|
||||
}
|
||||
|
||||
INLINE Bit32u mem_readd_inline(PhysPt address) {
|
||||
static INLINE Bit32u mem_readd_inline(PhysPt address) {
|
||||
if ((address & 0xfff)<0xffd) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) return host_readd(tlb_addr+address);
|
||||
|
@ -283,13 +283,13 @@ INLINE Bit32u mem_readd_inline(PhysPt address) {
|
|||
} else return mem_unalignedreadd(address);
|
||||
}
|
||||
|
||||
INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
|
||||
static INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) host_writeb(tlb_addr+address,val);
|
||||
else (get_tlb_writehandler(address))->writeb(address,val);
|
||||
}
|
||||
|
||||
INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
|
||||
static INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
|
||||
if ((address & 0xfff)<0xfff) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) host_writew(tlb_addr+address,val);
|
||||
|
@ -297,7 +297,7 @@ INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
|
|||
} else mem_unalignedwritew(address,val);
|
||||
}
|
||||
|
||||
INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
|
||||
static INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
|
||||
if ((address & 0xfff)<0xffd) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) host_writed(tlb_addr+address,val);
|
||||
|
@ -306,7 +306,7 @@ INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
|
|||
}
|
||||
|
||||
|
||||
INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
|
||||
static INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) {
|
||||
*val=host_readb(tlb_addr+address);
|
||||
|
@ -314,7 +314,7 @@ INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
|
|||
} else return (get_tlb_readhandler(address))->readb_checked(address, val);
|
||||
}
|
||||
|
||||
INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
|
||||
static INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
|
||||
if ((address & 0xfff)<0xfff) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) {
|
||||
|
@ -324,7 +324,7 @@ INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
|
|||
} else return mem_unalignedreadw_checked(address, val);
|
||||
}
|
||||
|
||||
INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
|
||||
static INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
|
||||
if ((address & 0xfff)<0xffd) {
|
||||
HostPt tlb_addr=get_tlb_read(address);
|
||||
if (tlb_addr) {
|
||||
|
@ -334,7 +334,7 @@ INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
|
|||
} else return mem_unalignedreadd_checked(address, val);
|
||||
}
|
||||
|
||||
INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
|
||||
static INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) {
|
||||
host_writeb(tlb_addr+address,val);
|
||||
|
@ -342,7 +342,7 @@ INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
|
|||
} else return (get_tlb_writehandler(address))->writeb_checked(address,val);
|
||||
}
|
||||
|
||||
INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
|
||||
static INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
|
||||
if ((address & 0xfff)<0xfff) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) {
|
||||
|
@ -352,7 +352,7 @@ INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
|
|||
} else return mem_unalignedwritew_checked(address,val);
|
||||
}
|
||||
|
||||
INLINE bool mem_writed_checked(PhysPt address,Bit32u val) {
|
||||
static INLINE bool mem_writed_checked(PhysPt address,Bit32u val) {
|
||||
if ((address & 0xfff)<0xffd) {
|
||||
HostPt tlb_addr=get_tlb_write(address);
|
||||
if (tlb_addr) {
|
||||
|
|
|
@ -36,19 +36,19 @@ extern Bitu PIC_IRQCheck;
|
|||
extern Bitu PIC_IRQActive;
|
||||
extern Bitu PIC_Ticks;
|
||||
|
||||
INLINE float PIC_TickIndex(void) {
|
||||
static INLINE float PIC_TickIndex(void) {
|
||||
return (CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)/(float)CPU_CycleMax;
|
||||
}
|
||||
|
||||
INLINE Bits PIC_TickIndexND(void) {
|
||||
static INLINE Bits PIC_TickIndexND(void) {
|
||||
return CPU_CycleMax-CPU_CycleLeft-CPU_Cycles;
|
||||
}
|
||||
|
||||
INLINE Bits PIC_MakeCycles(double amount) {
|
||||
static INLINE Bits PIC_MakeCycles(double amount) {
|
||||
return (Bits)(CPU_CycleMax*amount);
|
||||
}
|
||||
|
||||
INLINE double PIC_FullIndex(void) {
|
||||
static INLINE double PIC_FullIndex(void) {
|
||||
return PIC_Ticks+(double)PIC_TickIndex();
|
||||
}
|
||||
|
||||
|
|
|
@ -93,20 +93,20 @@ struct CPU_Regs {
|
|||
extern Segments Segs;
|
||||
extern CPU_Regs cpu_regs;
|
||||
|
||||
INLINE PhysPt SegPhys(SegNames index) {
|
||||
static INLINE PhysPt SegPhys(SegNames index) {
|
||||
return Segs.phys[index];
|
||||
}
|
||||
|
||||
INLINE Bit16u SegValue(SegNames index) {
|
||||
static INLINE Bit16u SegValue(SegNames index) {
|
||||
return (Bit16u)Segs.val[index];
|
||||
}
|
||||
|
||||
INLINE RealPt RealMakeSeg(SegNames index,Bit16u off) {
|
||||
static INLINE RealPt RealMakeSeg(SegNames index,Bit16u off) {
|
||||
return RealMake(SegValue(index),off);
|
||||
}
|
||||
|
||||
|
||||
INLINE void SegSet16(Bitu index,Bit16u val) {
|
||||
static INLINE void SegSet16(Bitu index,Bit16u val) {
|
||||
Segs.val[index]=val;
|
||||
Segs.phys[index]=val << 4;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: support.h,v 1.16 2008-01-13 11:28:41 qbix79 Exp $ */
|
||||
/* $Id: support.h,v 1.17 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#ifndef DOSBOX_SUPPORT_H
|
||||
#define DOSBOX_SUPPORT_H
|
||||
|
@ -43,6 +43,8 @@ void strreplace(char * str,char o,char n);
|
|||
char *ltrim(char *str);
|
||||
char *rtrim(char *str);
|
||||
char *trim(char * str);
|
||||
char * upcase(char * str);
|
||||
char * lowcase(char * str);
|
||||
|
||||
bool ScanCMDBool(char * cmd,char const * const check);
|
||||
char * ScanCMDRemain(char * cmd);
|
||||
|
@ -52,16 +54,6 @@ bool IsHexWord(char * word);
|
|||
Bits ConvDecWord(char * word);
|
||||
Bits ConvHexWord(char * word);
|
||||
|
||||
INLINE char * upcase(char * str) {
|
||||
for (char* idx = str; *idx ; idx++) *idx = toupper(*reinterpret_cast<unsigned char*>(idx));
|
||||
return str;
|
||||
}
|
||||
|
||||
INLINE char * lowcase(char * str) {
|
||||
for(char* idx = str; *idx ; idx++) *idx = tolower(*reinterpret_cast<unsigned char*>(idx));
|
||||
return str;
|
||||
}
|
||||
|
||||
void upcase(std::string &str);
|
||||
void lowcase(std::string &str);
|
||||
|
||||
|
|
|
@ -218,26 +218,26 @@ static inline Bits MakeVolume( Bitu wave, Bitu volume ) {
|
|||
return (sig >> exp);
|
||||
};
|
||||
|
||||
static Bits FASTCALL WaveForm0( Bitu i, Bitu volume ) {
|
||||
static Bits DB_FASTCALL WaveForm0( Bitu i, Bitu volume ) {
|
||||
Bits neg = 0 - (( i >> 9) & 1);//Create ~0 or 0
|
||||
Bitu wave = SinTable[i & 511];
|
||||
return (MakeVolume( wave, volume ) ^ neg) - neg;
|
||||
}
|
||||
static Bits FASTCALL WaveForm1( Bitu i, Bitu volume ) {
|
||||
static Bits DB_FASTCALL WaveForm1( Bitu i, Bitu volume ) {
|
||||
Bit32u wave = SinTable[i & 511];
|
||||
wave |= ( ( (i ^ 512 ) & 512) - 1) >> ( 32 - 12 );
|
||||
return MakeVolume( wave, volume );
|
||||
}
|
||||
static Bits FASTCALL WaveForm2( Bitu i, Bitu volume ) {
|
||||
static Bits DB_FASTCALL WaveForm2( Bitu i, Bitu volume ) {
|
||||
Bitu wave = SinTable[i & 511];
|
||||
return MakeVolume( wave, volume );
|
||||
}
|
||||
static Bits FASTCALL WaveForm3( Bitu i, Bitu volume ) {
|
||||
static Bits DB_FASTCALL WaveForm3( Bitu i, Bitu volume ) {
|
||||
Bitu wave = SinTable[i & 255];
|
||||
wave |= ( ( (i ^ 256 ) & 256) - 1) >> ( 32 - 12 );
|
||||
return MakeVolume( wave, volume );
|
||||
}
|
||||
static Bits FASTCALL WaveForm4( Bitu i, Bitu volume ) {
|
||||
static Bits DB_FASTCALL WaveForm4( Bitu i, Bitu volume ) {
|
||||
//Twice as fast
|
||||
i <<= 1;
|
||||
Bits neg = 0 - (( i >> 9) & 1);//Create ~0 or 0
|
||||
|
@ -245,18 +245,18 @@ static Bits FASTCALL WaveForm4( Bitu i, Bitu volume ) {
|
|||
wave |= ( ( (i ^ 512 ) & 512) - 1) >> ( 32 - 12 );
|
||||
return (MakeVolume( wave, volume ) ^ neg) - neg;
|
||||
}
|
||||
static Bits FASTCALL WaveForm5( Bitu i, Bitu volume ) {
|
||||
static Bits DB_FASTCALL WaveForm5( Bitu i, Bitu volume ) {
|
||||
//Twice as fast
|
||||
i <<= 1;
|
||||
Bitu wave = SinTable[i & 511];
|
||||
wave |= ( ( (i ^ 512 ) & 512) - 1) >> ( 32 - 12 );
|
||||
return MakeVolume( wave, volume );
|
||||
}
|
||||
static Bits FASTCALL WaveForm6( Bitu i, Bitu volume ) {
|
||||
static Bits DB_FASTCALL WaveForm6( Bitu i, Bitu volume ) {
|
||||
Bits neg = 0 - (( i >> 9) & 1);//Create ~0 or 0
|
||||
return (MakeVolume( 0, volume ) ^ neg) - neg;
|
||||
}
|
||||
static Bits FASTCALL WaveForm7( Bitu i, Bitu volume ) {
|
||||
static Bits DB_FASTCALL WaveForm7( Bitu i, Bitu volume ) {
|
||||
//Negative is reversed here
|
||||
Bits neg = (( i >> 9) & 1) - 1;
|
||||
Bitu wave = (i << 3);
|
||||
|
|
|
@ -40,7 +40,7 @@ struct Operator;
|
|||
struct Channel;
|
||||
|
||||
#if (DBOPL_WAVE == WAVE_HANDLER)
|
||||
typedef Bits ( FASTCALL *WaveHandler) ( Bitu i, Bitu volume );
|
||||
typedef Bits ( DB_FASTCALL *WaveHandler) ( Bitu i, Bitu volume );
|
||||
#endif
|
||||
|
||||
typedef Bits ( DBOPL::Operator::*VolumeHandler) ( );
|
||||
|
@ -247,4 +247,4 @@ struct Handler : public Adlib::Handler {
|
|||
};
|
||||
|
||||
|
||||
}; //Namespace
|
||||
}; //Namespace
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: mixer.cpp,v 1.50 2009-03-19 20:45:42 c2woody Exp $ */
|
||||
/* $Id: mixer.cpp,v 1.51 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
/*
|
||||
Remove the sdl code from here and have it handeld in the sdlmain.
|
||||
|
@ -55,7 +55,7 @@
|
|||
#define MIXER_REMAIN ((1<<MIXER_SHIFT)-1)
|
||||
#define MIXER_VOLSHIFT 13
|
||||
|
||||
static inline Bit16s MIXER_CLIP(Bits SAMP) {
|
||||
static INLINE Bit16s MIXER_CLIP(Bits SAMP) {
|
||||
if (SAMP < MAX_AUDIO) {
|
||||
if (SAMP > MIN_AUDIO)
|
||||
return SAMP;
|
||||
|
@ -175,7 +175,7 @@ void MixerChannel::AddSilence(void) {
|
|||
}
|
||||
|
||||
template<class Type,bool stereo,bool signeddata,bool nativeorder>
|
||||
INLINE void MixerChannel::AddSamples(Bitu len, const Type* data) {
|
||||
inline void MixerChannel::AddSamples(Bitu len, const Type* data) {
|
||||
Bits diff[2];
|
||||
Bitu mixpos=mixer.pos+done;
|
||||
freq_index&=MIXER_REMAIN;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: int10.h,v 1.37 2009-04-11 07:58:39 qbix79 Exp $ */
|
||||
/* $Id: int10.h,v 1.38 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#include "vga.h"
|
||||
|
||||
|
@ -146,11 +146,11 @@ typedef struct {
|
|||
|
||||
extern Int10Data int10;
|
||||
|
||||
INLINE Bit8u CURSOR_POS_COL(Bit8u page) {
|
||||
static Bit8u CURSOR_POS_COL(Bit8u page) {
|
||||
return real_readb(BIOSMEM_SEG,BIOSMEM_CURSOR_POS+page*2);
|
||||
}
|
||||
|
||||
INLINE Bit8u CURSOR_POS_ROW(Bit8u page) {
|
||||
static Bit8u CURSOR_POS_ROW(Bit8u page) {
|
||||
return real_readb(BIOSMEM_SEG,BIOSMEM_CURSOR_POS+page*2+1);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: int10_char.cpp,v 1.56 2008-11-09 11:22:03 qbix79 Exp $ */
|
||||
/* $Id: int10_char.cpp,v 1.57 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
/* Character displaying moving functions */
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
|||
#include "inout.h"
|
||||
#include "int10.h"
|
||||
|
||||
static INLINE void CGA2_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
static void CGA2_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
PhysPt dest=base+((CurMode->twidth*rnew)*(cheight/2)+cleft);
|
||||
PhysPt src=base+((CurMode->twidth*rold)*(cheight/2)+cleft);
|
||||
|
@ -39,7 +39,7 @@ static INLINE void CGA2_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,P
|
|||
}
|
||||
}
|
||||
|
||||
static INLINE void CGA4_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
static void CGA4_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
PhysPt dest=base+((CurMode->twidth*rnew)*(cheight/2)+cleft)*2;
|
||||
PhysPt src=base+((CurMode->twidth*rold)*(cheight/2)+cleft)*2;
|
||||
|
@ -51,7 +51,7 @@ static INLINE void CGA4_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,P
|
|||
}
|
||||
}
|
||||
|
||||
static INLINE void TANDY16_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
static void TANDY16_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
PhysPt dest=base+((CurMode->twidth*rnew)*(cheight/4)+cleft)*4;
|
||||
PhysPt src=base+((CurMode->twidth*rold)*(cheight/4)+cleft)*4;
|
||||
|
@ -65,7 +65,7 @@ static INLINE void TANDY16_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rne
|
|||
}
|
||||
}
|
||||
|
||||
static INLINE void EGA16_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
static void EGA16_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
PhysPt src,dest;Bitu copy;
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
dest=base+(CurMode->twidth*rnew)*cheight+cleft;
|
||||
|
@ -85,7 +85,7 @@ static INLINE void EGA16_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,
|
|||
IO_Write(0x3ce,5);IO_Write(0x3cf,0); /* Normal transfer mode */
|
||||
}
|
||||
|
||||
static INLINE void VGA_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
static void VGA_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
PhysPt src,dest;Bitu copy;
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
dest=base+8*((CurMode->twidth*rnew)*cheight+cleft);
|
||||
|
@ -99,14 +99,14 @@ static INLINE void VGA_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,Ph
|
|||
}
|
||||
}
|
||||
|
||||
static INLINE void TEXT_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
static void TEXT_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
|
||||
PhysPt src,dest;
|
||||
src=base+(rold*CurMode->twidth+cleft)*2;
|
||||
dest=base+(rnew*CurMode->twidth+cleft)*2;
|
||||
MEM_BlockCopy(dest,src,(cright-cleft)*2);
|
||||
}
|
||||
|
||||
static INLINE void CGA2_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
static void CGA2_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
PhysPt dest=base+((CurMode->twidth*row)*(cheight/2)+cleft);
|
||||
Bitu copy=(cright-cleft);
|
||||
|
@ -122,7 +122,7 @@ static INLINE void CGA2_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,B
|
|||
}
|
||||
|
||||
|
||||
static INLINE void CGA4_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
static void CGA4_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
PhysPt dest=base+((CurMode->twidth*row)*(cheight/2)+cleft)*2;
|
||||
Bitu copy=(cright-cleft)*2;Bitu nextline=CurMode->twidth*2;
|
||||
|
@ -136,7 +136,7 @@ static INLINE void CGA4_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,B
|
|||
}
|
||||
}
|
||||
|
||||
static INLINE void TANDY16_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
static void TANDY16_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
PhysPt dest=base+((CurMode->twidth*row)*(cheight/4)+cleft)*4;
|
||||
Bitu copy=(cright-cleft)*4;Bitu nextline=CurMode->twidth*4;
|
||||
|
@ -152,7 +152,7 @@ static INLINE void TANDY16_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt bas
|
|||
}
|
||||
}
|
||||
|
||||
static INLINE void EGA16_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
static void EGA16_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
/* Set Bitmask / Color / Full Set Reset */
|
||||
IO_Write(0x3ce,0x8);IO_Write(0x3cf,0xff);
|
||||
IO_Write(0x3ce,0x0);IO_Write(0x3cf,attr);
|
||||
|
@ -169,7 +169,7 @@ static INLINE void EGA16_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,
|
|||
IO_Write(0x3cf,0);
|
||||
}
|
||||
|
||||
static INLINE void VGA_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
static void VGA_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
/* Write some bytes */
|
||||
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
|
||||
PhysPt dest=base+8*((CurMode->twidth*row)*cheight+cleft);
|
||||
|
@ -181,7 +181,7 @@ static INLINE void VGA_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bi
|
|||
}
|
||||
}
|
||||
|
||||
static INLINE void TEXT_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
static void TEXT_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
|
||||
/* Do some filing */
|
||||
PhysPt dest;
|
||||
dest=base+(row*CurMode->twidth+cleft)*2;
|
||||
|
@ -549,7 +549,7 @@ void INT10_WriteChar(Bit8u chr,Bit8u attr,Bit8u page,Bit16u count,bool showattr)
|
|||
}
|
||||
}
|
||||
|
||||
static INLINE void INT10_TeletypeOutputAttr(Bit8u chr,Bit8u attr,bool useattr,Bit8u page) {
|
||||
static void INT10_TeletypeOutputAttr(Bit8u chr,Bit8u attr,bool useattr,Bit8u page) {
|
||||
BIOS_NCOLS;BIOS_NROWS;
|
||||
Bit8u cur_row=CURSOR_POS_ROW(page);
|
||||
Bit8u cur_col=CURSOR_POS_COL(page);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: support.cpp,v 1.35 2008-08-06 18:32:35 c2woody Exp $ */
|
||||
/* $Id: support.cpp,v 1.36 2009-04-25 16:25:03 harekiet Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -80,6 +80,17 @@ char *trim(char *str) {
|
|||
return ltrim(rtrim(str));
|
||||
}
|
||||
|
||||
char * upcase(char * str) {
|
||||
for (char* idx = str; *idx ; idx++) *idx = toupper(*reinterpret_cast<unsigned char*>(idx));
|
||||
return str;
|
||||
}
|
||||
|
||||
char * lowcase(char * str) {
|
||||
for(char* idx = str; *idx ; idx++) *idx = tolower(*reinterpret_cast<unsigned char*>(idx));
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool ScanCMDBool(char * cmd,char const * const check) {
|
||||
char * scan=cmd;size_t c_len=strlen(check);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
#define INLINE __forceinline
|
||||
|
||||
#define VERSION "0.72"
|
||||
|
||||
|
||||
/* Define to 1 to enable internal debugger, requires libcurses */
|
||||
#define C_DEBUG 0
|
||||
|
||||
|
@ -58,6 +55,9 @@
|
|||
#define GCC_ATTRIBUTE(x) /* attribute not supported */
|
||||
#define GCC_UNLIKELY(x) (x)
|
||||
|
||||
#define INLINE __forceinline
|
||||
#define DB_FASTCALL __fastcall
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue