A few minor corrections to 808x.c.

This commit is contained in:
OBattler
2018-09-20 18:04:46 +02:00
parent 55afa5e2ac
commit 93fb8d538f

View File

@@ -18,7 +18,7 @@
* 2 clocks - fetch opcode 1 2 clocks - execute * 2 clocks - fetch opcode 1 2 clocks - execute
* 2 clocks - fetch opcode 2 etc * 2 clocks - fetch opcode 2 etc
* *
* Version: @(#)808x.c 1.0.5 2018/04/29 * Version: @(#)808x.c 1.0.6 2018/09/20
* *
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk> * Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -189,20 +189,6 @@ int prefetchw=0;
static __inline uint8_t FETCH() static __inline uint8_t FETCH()
{ {
uint8_t temp; uint8_t temp;
/* temp=prefetchqueue[0];
prefetchqueue[0]=prefetchqueue[1];
prefetchqueue[1]=prefetchqueue[2];
prefetchqueue[2]=prefetchqueue[3];
prefetchqueue[3]=prefetchqueue[4];
prefetchqueue[4]=prefetchqueue[5];
if (prefetchw<=((is8086)?4:3))
{
prefetchqueue[prefetchw++]=readmembf(cs+prefetchpc); prefetchpc++;
if (is8086 && (prefetchpc&1))
{
prefetchqueue[prefetchw++]=readmembf(cs+prefetchpc); prefetchpc++;
}
}*/
if (prefetchw==0) if (prefetchw==0)
{ {
@@ -224,8 +210,10 @@ static __inline uint8_t FETCH()
prefetchqueue[0]=prefetchqueue[1]; prefetchqueue[0]=prefetchqueue[1];
prefetchqueue[1]=prefetchqueue[2]; prefetchqueue[1]=prefetchqueue[2];
prefetchqueue[2]=prefetchqueue[3]; prefetchqueue[2]=prefetchqueue[3];
prefetchqueue[3]=prefetchqueue[4]; if (is8086) {
prefetchqueue[4]=prefetchqueue[5]; prefetchqueue[3]=prefetchqueue[4];
prefetchqueue[4]=prefetchqueue[5];
}
prefetchw--; prefetchw--;
fetchcycles-=4; fetchcycles-=4;
cpu_state.pc++; cpu_state.pc++;
@@ -237,7 +225,7 @@ static __inline void FETCHADD(int c)
{ {
int d; int d;
if (c<0) return; if (c<0) return;
if (prefetchw>((is8086)?4:3)) return; if (prefetchw>((is8086)?5:3)) return;
d=c+(fetchcycles&3); d=c+(fetchcycles&3);
while (d>3 && prefetchw<((is8086)?6:4)) while (d>3 && prefetchw<((is8086)?6:4))
{ {
@@ -248,7 +236,7 @@ static __inline void FETCHADD(int c)
prefetchpc++; prefetchpc++;
prefetchw++; prefetchw++;
} }
if (prefetchw<6) if (prefetchw<((is8086)?6:4))
{ {
prefetchqueue[prefetchw]=readmembf(cs+prefetchpc); prefetchqueue[prefetchw]=readmembf(cs+prefetchpc);
prefetchpc++; prefetchpc++;
@@ -262,7 +250,7 @@ static __inline void FETCHADD(int c)
void FETCHCOMPLETE() void FETCHCOMPLETE()
{ {
if (!(fetchcycles&3)) return; if (!(fetchcycles&3)) return;
if (prefetchw>((is8086)?4:3)) return; if (prefetchw>((is8086)?5:3)) return;
if (!prefetchw) nextcyc=(4-(fetchcycles&3)); if (!prefetchw) nextcyc=(4-(fetchcycles&3));
cycles-=(4-(fetchcycles&3)); cycles-=(4-(fetchcycles&3));
fetchclocks+=(4-(fetchcycles&3)); fetchclocks+=(4-(fetchcycles&3));
@@ -272,7 +260,7 @@ void FETCHCOMPLETE()
prefetchpc++; prefetchpc++;
prefetchw++; prefetchw++;
} }
if (prefetchw<6) if (prefetchw<((is8086)?6:4))
{ {
prefetchqueue[prefetchw]=readmembf(cs+prefetchpc); prefetchqueue[prefetchw]=readmembf(cs+prefetchpc);
prefetchpc++; prefetchpc++;