Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.27.9.0 stops early while booting Ultima V .do image with the Authentic Speed disk access setting #599

Closed
rbrtck opened this issue Nov 28, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@rbrtck
Copy link

commented Nov 28, 2018

Version 1.27.9.0 stops early while booting Ultima V .do image with the Authentic Speed disk access setting--before the second drive is checked. Seems to work OK with the Enhanced Speed setting. Previous versions including 1.27.8.0 work fine with either setting.

@tomcw tomcw added the bug label Dec 1, 2018

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2018

Thanks for reporting this.
I've confirm this (and also that 1.27.12.0 fails in the same way).

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Dec 2, 2018

@sicklittlemonkey / Hi Nick,

The boot-strap code in Ultima V is waiting until reading the Disk II's data latch's returns the same value, ie. motor off, then wait until the drive has stopped spinning.

AppleWin ignores the spinning state.

For enhanced speed mode:

  • if the number of cycles since the last latch read is <= 6 cycles then it returns a partial nibble.
  • else it returns the next nibble, then moves the nibble pointer on by 1

For authentic speed mode:

  • if the number of cycles since the last latch read is <= 31 cycles then it returns a partial nibble.
  • else it returns the next nibble, then moves the nibble pointer on by 1

For the Ultima V case, the cycles between latch reads is 7,39,7,39,...
(So enhanced always returns full nibbles, but authentic alternates between partial and full nibbles.)

Since the drive has stopped spinning, then shouldn't the latch read value be constant?

But you also have a comment in the AppleWin's latch r/w code about Sherwood Forest:

// Should really test for drive off - after 1 second drive off delay (UTAIIe page 9-13)
// but Sherwood Forest sets shift mode and reads with the drive off, so don't check for now

So I want to ensure that any fix also takes this comment into account.

@sicklittlemonkey

This comment has been minimized.

Copy link
Contributor

commented Dec 2, 2018

@tomcw tomcw closed this in 5504d28 Dec 3, 2018

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2018

Thanks Nick - I (more or less) made the changes you suggested.

And found + added the Sather reference for drive off relating to the data latch:
"DRIVES OFF forces the data register to hold its present state." (UTAIIe page 9-12)

EDIT: I also had to commit 5ddff0d as my original fix introduced an issue with reading write protect.

@sicklittlemonkey

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2018

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2018

Hi Nick,

BTW, I don't think the latch will hold it's current value if in load mode when the drives are off. It would be interesting to check.

Yes, it'd be good to check that.

For reference the Ultima V boot code (that waits for the drive to stop spinning) is:

2194:
 LDA DATASTROBE,X ; $C0EC
 NOP
 JSR 2184
2184:
   JSR 2187
   RTS
   RTS ; execute RTS twice
219B:
 CMP DATASTROBE,X ; $C0EC
 BNE 2194

And I also checked "Sherwood Forest.nib" (from Asimov) which still works.
For completeness I temporarily re-instated the floppy motor off check (*) to see it failing to load too...

	if (!floppywritemode)
	{
		if (!floppymotoron) // (*)
			return;
@tomcw

This comment has been minimized.

Copy link
Contributor

commented Dec 8, 2018

@rbrtck : there's a new build 1.27.13, here which fixes this issue.

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Dec 8, 2018

Added regression tests for Ultima 5 booting & Sherwood Forest here: AppleWin/AppleWin-Test@843412f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.