A few minor corrections to 808x.c.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* 2 clocks - fetch opcode 1 2 clocks - execute
|
||||
* 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>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -189,20 +189,6 @@ int prefetchw=0;
|
||||
static __inline uint8_t FETCH()
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -224,8 +210,10 @@ static __inline uint8_t FETCH()
|
||||
prefetchqueue[0]=prefetchqueue[1];
|
||||
prefetchqueue[1]=prefetchqueue[2];
|
||||
prefetchqueue[2]=prefetchqueue[3];
|
||||
prefetchqueue[3]=prefetchqueue[4];
|
||||
prefetchqueue[4]=prefetchqueue[5];
|
||||
if (is8086) {
|
||||
prefetchqueue[3]=prefetchqueue[4];
|
||||
prefetchqueue[4]=prefetchqueue[5];
|
||||
}
|
||||
prefetchw--;
|
||||
fetchcycles-=4;
|
||||
cpu_state.pc++;
|
||||
@@ -237,7 +225,7 @@ static __inline void FETCHADD(int c)
|
||||
{
|
||||
int d;
|
||||
if (c<0) return;
|
||||
if (prefetchw>((is8086)?4:3)) return;
|
||||
if (prefetchw>((is8086)?5:3)) return;
|
||||
d=c+(fetchcycles&3);
|
||||
while (d>3 && prefetchw<((is8086)?6:4))
|
||||
{
|
||||
@@ -248,7 +236,7 @@ static __inline void FETCHADD(int c)
|
||||
prefetchpc++;
|
||||
prefetchw++;
|
||||
}
|
||||
if (prefetchw<6)
|
||||
if (prefetchw<((is8086)?6:4))
|
||||
{
|
||||
prefetchqueue[prefetchw]=readmembf(cs+prefetchpc);
|
||||
prefetchpc++;
|
||||
@@ -262,7 +250,7 @@ static __inline void FETCHADD(int c)
|
||||
void FETCHCOMPLETE()
|
||||
{
|
||||
if (!(fetchcycles&3)) return;
|
||||
if (prefetchw>((is8086)?4:3)) return;
|
||||
if (prefetchw>((is8086)?5:3)) return;
|
||||
if (!prefetchw) nextcyc=(4-(fetchcycles&3));
|
||||
cycles-=(4-(fetchcycles&3));
|
||||
fetchclocks+=(4-(fetchcycles&3));
|
||||
@@ -272,7 +260,7 @@ void FETCHCOMPLETE()
|
||||
prefetchpc++;
|
||||
prefetchw++;
|
||||
}
|
||||
if (prefetchw<6)
|
||||
if (prefetchw<((is8086)?6:4))
|
||||
{
|
||||
prefetchqueue[prefetchw]=readmembf(cs+prefetchpc);
|
||||
prefetchpc++;
|
||||
|
Reference in New Issue
Block a user