mirror of
https://github.com/simh/simh.git
synced 2026-02-26 16:54:22 +00:00
Fix AltairZ80 compilation with Visual Studio 2008 (#85)
* AltairZ80: SS1: Fix disable after reset. The CompuPro System Support 1 could not be disabled after enabled and used due to timers causing it to be busy. Reset properly so that "set ss1 disabled" works after reset. * AltairZ80: wd179x: Properly reset 179x state. * AltairZ80: M68K: Fix compile with VS2008. * Musashi: Fix compilation with Visual Studio 2008. * AltairZ80: M68K: Resolve warnings in softfloat. * AltairZ80: Add headers to .vcproj
This commit is contained in:
committed by
Mark Pizzolato
parent
7b4bfeca06
commit
e65a35d429
@@ -43,6 +43,10 @@
|
||||
#define OPT_ON 1
|
||||
#define OPT_SPECIFY_HANDLER 2
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
/* Disable MSVC warning 4146: Unary minus. */
|
||||
#pragma warning (disable: 4146)
|
||||
#endif
|
||||
|
||||
/* ======================================================================== */
|
||||
/* ============================== MAME STUFF ============================== */
|
||||
|
||||
@@ -1911,6 +1911,7 @@ extern jmp_buf m68ki_bus_error_jmp_buf;
|
||||
/* Exception for bus error */
|
||||
static inline void m68ki_exception_bus_error(void)
|
||||
{
|
||||
uint sr;
|
||||
int i;
|
||||
uint sr;
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ static int32 roundAndPackInt32( flag zSign, bits64 absZ )
|
||||
roundBits = absZ & 0x7F;
|
||||
absZ = ( absZ + roundIncrement )>>7;
|
||||
absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
|
||||
z = absZ;
|
||||
z = (int32)absZ;
|
||||
if ( zSign ) z = - z;
|
||||
if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) {
|
||||
float_raise( float_flag_invalid );
|
||||
@@ -905,7 +905,7 @@ float32 int64_to_float32( int64 a )
|
||||
absA = zSign ? - a : a;
|
||||
shiftCount = countLeadingZeros64( absA ) - 40;
|
||||
if ( 0 <= shiftCount ) {
|
||||
return packFloat32( zSign, 0x95 - shiftCount, absA<<shiftCount );
|
||||
return packFloat32( zSign, 0x95 - shiftCount, (bits32)(absA<<shiftCount ));
|
||||
}
|
||||
else {
|
||||
shiftCount += 7;
|
||||
@@ -915,7 +915,7 @@ float32 int64_to_float32( int64 a )
|
||||
else {
|
||||
absA <<= shiftCount;
|
||||
}
|
||||
return roundAndPackFloat32( zSign, 0x9C - shiftCount, absA );
|
||||
return roundAndPackFloat32( zSign, 0x9C - shiftCount, (bits32)absA );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1548,7 +1548,7 @@ float32 float32_mul( float32 a, float32 b )
|
||||
aSig = ( aSig | 0x00800000 )<<7;
|
||||
bSig = ( bSig | 0x00800000 )<<8;
|
||||
shift64RightJamming( ( (bits64) aSig ) * bSig, 32, &zSig64 );
|
||||
zSig = zSig64;
|
||||
zSig = (bits32)zSig64;
|
||||
if ( 0 <= (sbits32) ( zSig<<1 ) ) {
|
||||
zSig <<= 1;
|
||||
--zExp;
|
||||
@@ -1700,7 +1700,7 @@ float32 float32_rem( float32 a, float32 b )
|
||||
expDiff += 64;
|
||||
q64 = estimateDiv128To64( aSig64, 0, bSig64 );
|
||||
q64 = ( 2 < q64 ) ? q64 - 2 : 0;
|
||||
q = q64>>( 64 - expDiff );
|
||||
q = (bits32)(q64>>( 64 - expDiff ));
|
||||
bSig <<= 6;
|
||||
aSig = ( ( aSig64>>33 )<<( expDiff - 1 ) ) - bSig * q;
|
||||
}
|
||||
@@ -1971,7 +1971,7 @@ int32 float64_to_int32_round_to_zero( float64 a )
|
||||
shiftCount = 0x433 - aExp;
|
||||
savedASig = aSig;
|
||||
aSig >>= shiftCount;
|
||||
z = aSig;
|
||||
z = (int32)aSig;
|
||||
if ( aSign ) z = - z;
|
||||
if ( ( z < 0 ) ^ aSign ) {
|
||||
invalid:
|
||||
@@ -2101,7 +2101,7 @@ float32 float64_to_float32( float64 a )
|
||||
return packFloat32( aSign, 0xFF, 0 );
|
||||
}
|
||||
shift64RightJamming( aSig, 22, &aSig );
|
||||
zSig = aSig;
|
||||
zSig = (bits32)aSig;
|
||||
if ( aExp || zSig ) {
|
||||
zSig |= 0x40000000;
|
||||
aExp -= 0x381;
|
||||
@@ -2673,7 +2673,7 @@ float64 float64_sqrt( float64 a )
|
||||
}
|
||||
zExp = ( ( aExp - 0x3FF )>>1 ) + 0x3FE;
|
||||
aSig |= LIT64( 0x0010000000000000 );
|
||||
zSig = estimateSqrt32( aExp, aSig>>21 );
|
||||
zSig = estimateSqrt32( aExp, (bits32)(aSig>>21) );
|
||||
aSig <<= 9 - ( aExp & 1 );
|
||||
zSig = estimateDiv128To64( aSig, 0, zSig<<32 ) + ( zSig<<30 );
|
||||
if ( ( zSig & 0x1FF ) <= 5 ) {
|
||||
@@ -2890,7 +2890,7 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a )
|
||||
shiftCount = 0x403E - aExp;
|
||||
savedASig = aSig;
|
||||
aSig >>= shiftCount;
|
||||
z = aSig;
|
||||
z = (int32)aSig;
|
||||
if ( aSign ) z = - z;
|
||||
if ( ( z < 0 ) ^ aSign ) {
|
||||
invalid:
|
||||
@@ -3012,7 +3012,7 @@ float32 floatx80_to_float32( floatx80 a )
|
||||
}
|
||||
shift64RightJamming( aSig, 33, &aSig );
|
||||
if ( aExp || aSig ) aExp -= 0x3F81;
|
||||
return roundAndPackFloat32( aSign, aExp, aSig );
|
||||
return roundAndPackFloat32( aSign, aExp, (bits32)aSig );
|
||||
|
||||
}
|
||||
|
||||
@@ -3887,7 +3887,7 @@ int32 float128_to_int32_round_to_zero( float128 a )
|
||||
shiftCount = 0x402F - aExp;
|
||||
savedASig = aSig0;
|
||||
aSig0 >>= shiftCount;
|
||||
z = aSig0;
|
||||
z = (int32)aSig0;
|
||||
if ( aSign ) z = - z;
|
||||
if ( ( z < 0 ) ^ aSign ) {
|
||||
invalid:
|
||||
@@ -4031,7 +4031,7 @@ float32 float128_to_float32( float128 a )
|
||||
}
|
||||
aSig0 |= ( aSig1 != 0 );
|
||||
shift64RightJamming( aSig0, 18, &aSig0 );
|
||||
zSig = aSig0;
|
||||
zSig = (bits32)aSig0;
|
||||
if ( aExp || zSig ) {
|
||||
zSig |= 0x40000000;
|
||||
aExp -= 0x3F81;
|
||||
@@ -4714,7 +4714,7 @@ float128 float128_sqrt( float128 a )
|
||||
}
|
||||
zExp = ( ( aExp - 0x3FFF )>>1 ) + 0x3FFE;
|
||||
aSig0 |= LIT64( 0x0001000000000000 );
|
||||
zSig0 = estimateSqrt32( aExp, aSig0>>17 );
|
||||
zSig0 = estimateSqrt32( aExp, (bits32)(aSig0>>17 ));
|
||||
shortShift128Left( aSig0, aSig1, 13 - ( aExp & 1 ), &aSig0, &aSig1 );
|
||||
zSig0 = estimateDiv128To64( aSig0, aSig1, zSig0<<32 ) + ( zSig0<<30 );
|
||||
doubleZSig0 = zSig0<<1;
|
||||
|
||||
@@ -81,7 +81,7 @@ static void setClockSS1(void);
|
||||
|
||||
/* SS1 Interrupt Controller notes:
|
||||
*
|
||||
* Msster 8259:
|
||||
* Master 8259:
|
||||
* IRQ0 = VI0
|
||||
* IRQ1 = VI1 - DISK3 Interrupt
|
||||
* IRQ2 = VI2 - IF3 Rx Interrupt
|
||||
@@ -178,10 +178,10 @@ typedef struct {
|
||||
RTC_REGS ss1_rtc[1] = { { 0 } };
|
||||
|
||||
static UNIT ss1_unit[] = {
|
||||
{ UDATA (&ss1_svc, UNIT_FIX | UNIT_DISABLE | UNIT_ROABLE, 0) },
|
||||
{ UDATA (&ss1_svc, UNIT_FIX | UNIT_DISABLE | UNIT_ROABLE, 0) },
|
||||
{ UDATA (&ss1_svc, UNIT_FIX | UNIT_DISABLE | UNIT_ROABLE, 0) },
|
||||
{ UDATA (&ss1_svc, UNIT_FIX | UNIT_DISABLE | UNIT_ROABLE, 0) }
|
||||
{ UDATA (&ss1_svc, UNIT_FIX | UNIT_DISABLE | UNIT_DIS | UNIT_ROABLE, 0) },
|
||||
{ UDATA (&ss1_svc, UNIT_FIX | UNIT_DISABLE | UNIT_DIS | UNIT_ROABLE, 0) },
|
||||
{ UDATA (&ss1_svc, UNIT_FIX | UNIT_DISABLE | UNIT_DIS | UNIT_ROABLE, 0) },
|
||||
{ UDATA (&ss1_svc, UNIT_FIX | UNIT_DISABLE | UNIT_DIS | UNIT_ROABLE, 0) }
|
||||
};
|
||||
|
||||
static REG ss1_reg[] = {
|
||||
@@ -262,6 +262,11 @@ static t_stat ss1_reset(DEVICE *dptr)
|
||||
{
|
||||
PNP_INFO *pnp = (PNP_INFO *)dptr->ctxt;
|
||||
|
||||
sim_cancel(&dptr->units[0]);
|
||||
sim_cancel(&dptr->units[1]);
|
||||
sim_cancel(&dptr->units[2]);
|
||||
sim_cancel(&dptr->units[3]);
|
||||
|
||||
if(dptr->flags & DEV_DIS) { /* Disconnect I/O Ports */
|
||||
sim_map_resource(pnp->io_base, pnp->io_size, RESOURCE_TYPE_IO, &ss1dev, "ss1dev", TRUE);
|
||||
} else {
|
||||
|
||||
@@ -309,6 +309,8 @@ static t_stat wd179x_reset(DEVICE *dptr)
|
||||
}
|
||||
}
|
||||
|
||||
wd179x_info->cmdtype = 0;
|
||||
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -281,10 +281,6 @@
|
||||
RelativePath="..\AltairZ80\m68k\m68kops.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\softfloat\softfloat.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68ksim.c"
|
||||
>
|
||||
@@ -338,11 +334,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\s100_if3.c"
|
||||
RelativePath="..\AltairZ80\s100_icom.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\s100_icom.c"
|
||||
RelativePath="..\AltairZ80\s100_if3.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -429,6 +425,10 @@
|
||||
RelativePath="..\sim_video.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\softfloat\softfloat.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\vfdhd.c"
|
||||
>
|
||||
@@ -510,6 +510,58 @@
|
||||
RelativePath="..\AltairZ80\altairz80_defs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\i8272.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\i86.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\insns.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\m68k.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\m68kconf.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\m68kcpu.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\m68kmmu.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\m68kops.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68ksim.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\softfloat\mamesf.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\mfdc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\softfloat\milieu.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\nasm.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scp.h"
|
||||
>
|
||||
@@ -566,6 +618,18 @@
|
||||
RelativePath="..\sim_video.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\m68k\softfloat\softfloat.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\vfdhd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\AltairZ80\wd179x.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
|
||||
Reference in New Issue
Block a user