From 83711af6713989e98bd0d1c8fc89f1ad68bf69e0 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Wed, 14 Jan 2004 17:20:28 +0000 Subject: [PATCH] Use CPU_Push/CPU_Pop functions for pushing and popping Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1586 --- src/cpu/core_full/loadwrite.h | 18 +++++++++++++----- src/cpu/core_normal/support.h | 11 +++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/cpu/core_full/loadwrite.h b/src/cpu/core_full/loadwrite.h index 2a9bdb09..d26e7b23 100644 --- a/src/cpu/core_full/loadwrite.h +++ b/src/cpu/core_full/loadwrite.h @@ -27,26 +27,34 @@ static INLINE Bit32u the_Fetchd(EAPoint & loc) { #define Fetchws() (Bit16s)the_Fetchw(IPPoint) #define Fetchds() (Bit32s)the_Fetchd(IPPoint) - +#if 0 static INLINE void Push_16(Bit16u blah) { reg_esp-=2; - SaveMw(SegBase(ss) + (reg_esp & cpu.stack.mask),blah); + SaveMw(SegBase(ss)+(reg_esp & cpu.stack.mask),blah); } static INLINE void Push_32(Bit32u blah) { reg_esp-=4; - SaveMd(SegBase(ss) + (reg_esp & cpu.stack.mask),blah); + SaveMd(SegBase(ss)+(reg_esp & cpu.stack.mask),blah); } static INLINE Bit16u Pop_16(void) { - Bit16u temp=LoadMw(SegBase(ss) + (reg_esp & cpu.stack.mask)); + Bit16u temp=LoadMw(SegBase(ss)+(reg_esp & cpu.stack.mask)); reg_esp+=2; return temp; } static INLINE Bit32u Pop_32(void) { - Bit32u temp=LoadMd(SegBase(ss) + (reg_esp & cpu.stack.mask)); + Bit32u temp=LoadMd(SegBase(ss)+(reg_esp & cpu.stack.mask)); reg_esp+=4; return temp; } +#else + +#define Push_16 CPU_Push16 +#define Push_32 CPU_Push32 +#define Pop_16 CPU_Pop16 +#define Pop_32 CPU_Pop32 + +#endif diff --git a/src/cpu/core_normal/support.h b/src/cpu/core_normal/support.h index 0ef11b6e..24470736 100644 --- a/src/cpu/core_normal/support.h +++ b/src/cpu/core_normal/support.h @@ -79,6 +79,8 @@ static INLINE Bit32s Fetchds() { return Fetchd(); } +#if 0 + static INLINE void Push_16(Bit16u blah) { reg_esp-=2; SaveMw(SegBase(ss)+(reg_esp & cpu.stack.mask),blah); @@ -101,6 +103,15 @@ static INLINE Bit32u Pop_32() { return temp; }; +#else + +#define Push_16 CPU_Push16 +#define Push_32 CPU_Push32 +#define Pop_16 CPU_Pop16 +#define Pop_32 CPU_Pop32 + +#endif + #define JumpSIb(blah) \ if (blah) { \ ADDIPFAST(Fetchbs()); \