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

Wizardry IV and V: how to make scenario diskettes? #748

Closed
tomcw opened this issue Jan 12, 2020 · 3 comments
Closed

Wizardry IV and V: how to make scenario diskettes? #748

tomcw opened this issue Jan 12, 2020 · 3 comments
Labels
Milestone

Comments

@tomcw
Copy link
Contributor

tomcw commented Jan 12, 2020

Before you can play, you need to make copies of the 6 (or 9 for Wiz-V!) scenario disks.

After booting, at the menu, select (M)ake, then 2) Disk Drives... but there appears to be a bug? (in the game) where if you didn't boot with a disk in the 2nd drive, then it never enables it (via $C0EB). EG. With drive-2 empty, put a Visual Studio conditional BP in Disk2InterfaceCard::Enable() after m_currDrive has been set... it only triggers once during boot.

During the (M)ake process, it even says "Formatting blank Diskette..." then "Writing to blank Diskette...", but again never enables drive-2.

Also if you boot with a blank.dsk (ie. type=DSK) (which is 140K of sectors with all 0x00's) then again it ignores this "blank" disk.

Workaround: put a blank.nib in the drive-2, then boot with that. Then use this as your blank disk for a copy of the master disk. And then either create a blank .DSK or .NIB images and make copies of the other master disks.

Alternative Workaround: just say you have 1 Disk Drive (but that's a lot of disk swapping!)

@tomcw tomcw added the question label Jan 12, 2020
@tomcw
Copy link
Contributor Author

tomcw commented Jan 12, 2020

During "Formatting blank Diskette..." it is erroneously accessing $C18B instead of $C0EC to read the data latch (and all other $C08n addresses):
E152:BD 8C C0 LDA $C08C,X ; C18B, X=FF

X is loaded with 0xFF from $FB at $E145.

And $FB is set to 0xFF earlier at $E39B.

@tomcw tomcw changed the title Wizardry IV: how to make scenario diskettes? Wizardry IV and V: how to make scenario diskettes? Jan 12, 2020
@tomcw tomcw added bug and removed question labels Jan 12, 2020
@tomcw
Copy link
Contributor Author

tomcw commented Jan 12, 2020

Actually it's a bug in AppleWin: @kerthunk asked:

Is it searching for a drive being connected? Several enable the drive and make sure that bits (or noise) flow in to know that a drive is connected. If the latch remains 00, then there is no drive connected.

Disk2InterfaceCard::ReadWrite() returns 0xFF when no disk is in the drive. I tried changing to rand() and now I can start with drive-2 empty, and insert a blank DSK during the "(M)ake" process, and it works.

@tomcw
Copy link
Contributor Author

tomcw commented Jan 12, 2020

Wizardry V

BEA6: LDA $C089,X ; $C0E9: motor on
      LDX $FB     ; X = #$60
      LDA $C08E,X ; $C0EE: write=0...
      LDA $C08C,X ; $C0EC: and load=0 = readSequencing mode
      LDY $0C     ; Y= #$60 or #$61
      LDA $C08A,Y ; enable drive-1 or 2
      LDY #$0D    ; retry count = $D30
      STY $09
      LDY #$30
      STY $0A
BEBE:

Here's the inner-loop of the code to detect if a drive-2 is connected:

  • Drive-1(or2) connected if 9 consecutive ($C0EC) != ($C0EC)
BEBE:A0 09             LDY #$09               
BEC0:BD 8C C0          LDA LCBANK1+1,X ;C0EC
BEC3:88                DEY                    
BEC4:F0 24             BEQ $BEEA ; success = drive connected
BEC6:48                PHA                    
BEC7:68                PLA                    
BEC8:48                PHA                    
BEC9:68                PLA                    
BECA:DD 8C C0          CMP LCBANK1+1,X ;C0EC
BECD:D0 F1             BNE $BEC0              
BECF:              DEC $0A
                   BNE BEBE
                   DEC $09
                   BNE BEBE
; timed out = no drive connected
BED7: LDA $C088,X ; $C0E8: motor off
      ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant