VOGONS


First post, by appiah4

User metadata
Rank l33t++
Rank
l33t++

I'm trying to get Indy256 and Monkey Island to work with my K5-PR166 system and the patched EXEs still return divide by zero errors.. Has anyone gotten these to work with a AMD K5?

Retronautics: A digital gallery of my retro computers, hardware and projects.

Reply 1 of 9, by TheFiend

User metadata
Rank Newbie
Rank
Newbie

I've tried the SoMI patch and kept getting divide errors. The solution I use for making these games work under MS-DOS is by using a utility called Setmul. You can use Setmul to disable the L1 Cache of your CPU which will slow things down enough to let you play these games properly.

You can also use a program called MySlow under Windows 9x which will also allow you to play them without having to boot into DOS.

Reply 2 of 9, by appiah4

User metadata
Rank l33t++
Rank
l33t++

I will give setmul a try but I am not sure it works with K5, we will see..

Last edited by appiah4 on 2020-02-10, 05:06. Edited 1 time in total.

Retronautics: A digital gallery of my retro computers, hardware and projects.

Reply 5 of 9, by Dochartaigh

User metadata
Rank Member
Rank
Member
appiah4 wrote on 2020-02-09, 08:39:

I will give setmul a try but I am not sure it works with K5, we will see..

I also thought these slow-down utilities which can disable caches only work on certain processors....maybe I should try it on my P3 700mhz (which has zero hardware slowdown/BIOS-enabled type stuff from what I can see on my 440bx MB's bios).

Also, BTW, I'm still able to play Monkey Island 1 and 2 at the seemingly correct speed on my P3 - I didn't patch the .EXE or anything. (I've tried them both through Win98, and exiting to pure DOS mode as well).

Reply 6 of 9, by K1n9_Duk3

User metadata
Rank Member
Rank
Member

The divide error in Indy 3 and Monkey 1 are part of the AdLib-related code. There are no other CPU speed related issues in the code that I'm aware of. If you force these games into pure PC Speaker mode by running them with the "i" parameter, the games should work perfectly fine regardless of the CPU speed.

Later releases of Monkey 1 don't have that divide error and I think that by the time Monkey 2 came out the problem in the AdLib code was fixed for good.

It's possible to apply a custom patch to the executable that fixes the divide error. I've created such a patch for the EGA version of Monkey 1 last year. And I think I also created patches for the VGA floppy versions of Indy 3 and Monkey 1. If you want to create fully fixed executables for these games so that you don't have to rely on slowdown utilities anymore, let me know.

Reply 7 of 9, by appiah4

User metadata
Rank l33t++
Rank
l33t++

I'd be more than happy to have fully patched executables for INDY256 and MONKEY (VGA) 😀

Monkey2 has no problems, as you pointed out. I haven't tried LOOM out but that will probably also have issues..

Retronautics: A digital gallery of my retro computers, hardware and projects.

Reply 8 of 9, by K1n9_Duk3

User metadata
Rank Member
Rank
Member

These are the patches for the versions available to me. Just run the game with the "?" parameter and it should tell you the version number.

  • Monkey 1 EGA (versions 4.0.62 and 4.0.64)
    #----------------------------------------
    # patches for Interpreter Version 4.0.62
    #----------------------------------------

    %exefile monkey.exe 116209

    #avoid the divide error (this may cause timing issues with AdLib music):
    %patch $125F7
    $B1 $03 # mov cl, 3
    $D3 $E8 # shr ax, cl
    $90 $90 # nop nop

    #avoid timing issues with the AdLib music:
    %patch $12DAE
    $50 # push ax
    $86 $E0 # xchg al, ah
    $BA $0388w # mov dx, 388h
    $EE # out dx, al
    $B9 6w # mov cx, 6
    $EC #l1: in dx, al
    $E2 $FD # loop l1
    $86 $E0 # xchg al, ah
    $42 # inc dx
    $EE # out dx, al
    $4A # dec dx
    $B9 35w # mov cx, 35
    $EC #l2: in al, dx
    $E2 $FD # loop l2
    $58 # pop ax
    $90 # nop

    #fix timing issues in AdLib detection code:
    %patch $132CA #cs:3D0A
    $53 # push bx
    $51 # push cx
    $B8 $0100w # mov ax, 100h
    $E8 $FAD1w # call AL_Out (at cs:37E3)
    $B8 $0460w # mov ax, 460h
    $E8 $FACBw # call AL_Out
    $B8 $0480w # mov ax, 480h
    $E8 $FAC5w # call AL_Out
    $BA $0388w # mov dx, 388h
    $EC # in al, dx
    $88 $C3 # mov bl, al
    $B8 $02FFw # mov ax, 2FFh
    $E8 $FAB9w # call AL_Out
    $B8 $0421w # mov ax, 421h
    $E8 $FAB3w # call AL_Out
    $B9 100w # mov cx, 100
    $EC #l1: in al, dx
    $E2 $FD # loop l1
    $88 $C7 # mov bh, al
    $B8 $0460w # mov ax, 460h
    $E8 $FAA5w # call AL_Out
    $B8 $0480w # mov ax, 480h
    $E8 $FA9Fw # call AL_Out
    $33 $C0 # xor ax, ax
    $F6 $C3 $E0 # test bl, 0E0h
    $75 $0A # jnz nope
    $80 $E7 $E0 # and bh, 0E0h
    Show last 90 lines
    	$80 $FF $C0	#	cmp	bh, 0C0h
    $75 $02 # jne nope
    $B0 $01 # mov al, 1
    $59 #nope: pop cx
    $5B # pop bx
    $1F # pop ds
    $CB # retf

    #disable GameBlaster detection:
    %patch $120BF
    $33 $C0 # xor ax, ax
    $CB # retf


    #----------------------------------------
    # patches for Interpreter Version 4.0.64
    #----------------------------------------

    %exefile monkey.exe 115357

    #avoid the divide error (this may cause timing issues with AdLib music):
    %patch $12487
    $B1 $03 # mov cl, 3
    $D3 $E8 # shr ax, cl
    $90 $90 # nop nop

    #avoid timing issues with the AdLib music:
    %patch $12C3E
    $50 # push ax
    $86 $E0 # xchg al, ah
    $BA $0388w # mov dx, 388h
    $EE # out dx, al
    $B9 6w # mov cx, 6
    $EC #l1: in dx, al
    $E2 $FD # loop l1
    $86 $E0 # xchg al, ah
    $42 # inc dx
    $EE # out dx, al
    $4A # dec dx
    $B9 35w # mov cx, 35
    $EC #l2: in al, dx
    $E2 $FD # loop l2
    $58 # pop ax
    $90 # nop

    #fix timing issues in AdLib detection code:
    %patch $1315A #cs:3B5A
    $53 # push bx
    $51 # push cx
    $B8 $0100w # mov ax, 100h
    $E8 $FAD1w # call AL_Out (at cs:3633)
    $B8 $0460w # mov ax, 460h
    $E8 $FACBw # call AL_Out
    $B8 $0480w # mov ax, 480h
    $E8 $FAC5w # call AL_Out
    $BA $0388w # mov dx, 388h
    $EC # in al, dx
    $88 $C3 # mov bl, al
    $B8 $02FFw # mov ax, 2FFh
    $E8 $FAB9w # call AL_Out
    $B8 $0421w # mov ax, 421h
    $E8 $FAB3w # call AL_Out
    $B9 100w # mov cx, 100
    $EC #l1: in al, dx
    $E2 $FD # loop l1
    $88 $C7 # mov bh, al
    $B8 $0460w # mov ax, 460h
    $E8 $FAA5w # call AL_Out
    $B8 $0480w # mov ax, 480h
    $E8 $FA9Fw # call AL_Out
    $33 $C0 # xor ax, ax
    $F6 $C3 $E0 # test bl, 0E0h
    $75 $0A # jnz nope
    $80 $E7 $E0 # and bh, 0E0h
    $80 $FF $C0 # cmp bh, 0C0h
    $75 $02 # jne nope
    $B0 $01 # mov al, 1
    $59 #nope: pop cx
    $5B # pop bx
    $1F # pop ds
    $CB # retf

    #disable GameBlaster detection:
    %patch $11F54
    $33 $C0 # xor ax, ax
    $CB # retf


    %end
  • Monkey 1 VGA (version 5.0.18)
    %exefile monkey.exe 111817
    %patch $12A2A $72
    %end
  • Monkey 1 VGA (version 5.0.19)
    %exefile monkey.exe 112107
    %patch $12B5A $72
    %end
  • Indy 3 VGA (version 3.0.22 and 3.0.23)
    %exefile indy256.exe 108124
    %patch $1E3A $72
    %end
  • Loom VGA CD (version 5.1.42)
    %exefile loom.exe 114529
    %patch $126EA $72
    %end

My copy of Loom EGA (version 3.5.37) doesn't have the problem with the divide eror.

Monkey 1 VGA and Indy 3 VGA are basically 1-byte fixes, the fixes for Monkey 1 EGA are a bit more complicated. If you have a different version, I would need you to send me the executables.

Edit: corrected the patches for Monkey 1 VGA and Indy 3 and added Loom VGA/CD as well as another version of Monkey 1 VGA
Edit 2: corrected the version number for Loom

Last edited by K1n9_Duk3 on 2021-04-23, 22:23. Edited 1 time in total.