Skip to content

Commit

Permalink
CPU refers to IDT in the real mode. Experiment on a real FM TOWNS 2MX…
Browse files Browse the repository at this point in the history
… confirmed that 80486 looks at IDT even in the real mode. Return I/O 208H bit 1 FREADY=0 if motor is off to align with the observation from a real FM TOWNS 2MX.
  • Loading branch information
captainys committed Jan 4, 2025
1 parent b01aac9 commit 81eef7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cpu/i486templatefunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ inline void i486DXFidelityLayer <FIDELITY>::Interrupt(unsigned int INTNum,Memory
// Push(mem,16,state.EIP+numInstBytesForReturn);

auto intVecAddr=(INTNum&0xFF)*4;
uint32_t CSIP=mem.FetchDword(intVecAddr);
uint32_t CSIP=mem.FetchDword(state.IDTR.linearBaseAddr+intVecAddr); // Experiment on real FM TOWNS 2MX confirmed that IDTR is valid even in the real mode.
auto destIP=cpputil::LowWord(CSIP);
auto destCS=cpputil::HighWord(CSIP);
if(true==enableCallStack)
Expand Down
9 changes: 8 additions & 1 deletion src/towns/fdc/fdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,14 @@ void TownsFDC::MakeReady(void)
// 0421:00000BE6 C3 RET
// Therefore, the timing to clear DSKCHG flag is not status-read.
// Maybe when a command is written?
data|=(DriveReady(townsPtr->state.townsTime) ? 2 : 0);

// Looks like FREADY flag should be zero when the motor is off.
// Based on the observation of real FM TOWNS 2MX.
if(true==state.drive[DriveSelect()].motor &&
true==DriveReady(townsPtr->state.townsTime))
{
data|=2;
}
data|=0b01100; // 3-mode drive. [2] pp.809
data|=0x80; // 2 internal drives. [2] pp.773
break;
Expand Down

0 comments on commit 81eef7b

Please sign in to comment.