gyurco / Next186

GNU General Public License v3.0
13 stars 10 forks source link

Freeze occurs with some games #2

Open squidrpi opened 3 years ago

squidrpi commented 3 years ago

Discussion moved from #1

Freezing with some games such as Monkey Island 1, Civilisation, Underworld 2, Goldenaxe. "Secret of Monkey Island, The (VGA) (1990)(Lucasfilm Games LLC) [Adventure]" from Total DOS Collection release 13 starts OK though. un-cracked italian version (VGA 256, floppy) freezes amongs other versions of Monkey 1.

gyurco commented 3 years ago

Is there a good PC emulator with debugger available? As I was able to debug some issues with CodeView, but an out-of-machine debugger would be better, as CV doesn't allow to see the peripheral status, and tricky software can easily foul it or make it unstable. Actually I've debugged one freeze in Ironman Super Off-Road alredy, copying from atari-forums:

Make Ironman Off Road start:
Search for 75 F8 CB in game.exe, replace with 90 90 CB (JNZ ..., RETF to NOP, NOP, RETF). (DOS Navigator has a great hex editor)
Cause:
This routine test for [40]:40 to zero (but sets it to 1 before). It's in the BIOS data area, and should be decremented by the BIOS timer ISR, as it represents a disk motor timeout counter. Another solution could be to add the required decrementation to the BIOS code.

Maybe other software also relies on the BIOS decremented disk motor counter, too.

squidrpi commented 3 years ago

I don't know of a PC debugger. Search for that hex code in those games I listed but couldn't find it. With Civilisation and Underworld2 the freeze appears to occur when the screen is going to change, i.e. mode. UW2 plays fine until you go to the dungeon after the character creation. CIV freezes just after the introduction screen.

gyurco commented 3 years ago

The sequence is specific for that game.

gyurco commented 3 years ago

Monkey Island and Civ work for me, even with AdLib. I've added the counter checked by Ironman to the BIOS, maybe that helped on Civ? I didn't check it with the old BIOS. Attached the updated one. Next186_BIOS.zip

squidrpi commented 3 years ago

Yes it fixed Civ for me too.

alessioscand commented 3 years ago

OK, so I'm still with the first release/bios and I managed to get Monkey Island to run: I simply used the "CPU speed: /3" option of the core. I hope this helps.

alessioscand commented 3 years ago

Many games runs better with the /3 CPU speed option: Speedball 2 does not freeze, Stellar 7 has correct Adlib audio. No luck for Golden Axe still.

gyurco commented 3 years ago

Golden Axe - done. Need another BIOS update, too. UW2 - no idea yet. It goes into an infinite loop, like

l1: jmp l1

with interrupts disabled

squidrpi commented 3 years ago

I wonder if UW2 requires a 386? Original install docs says 386 requirement https://www.mocagh.org/origin/uuw2-install.pdf

gyurco commented 3 years ago

I wonder if UW2 requires a 386? Original install docs says 386 requirement https://www.mocagh.org/origin/uuw2-install.pdf

Might be, but I don't have a proof.

gyurco commented 3 years ago

I have a proof now: an illegal instruction exception thrown at the sequence of 66 0F B7 04 66 C1 E0 08, where 66 means an operand size prefix - which is available on 386+. Looks like lot of '66' in the EXE file around this place, looks like it uses a lot of 32-bit registers. I have EMU386 installed, and the CPU jumps into it, but seems it fails to emulate.

squidrpi commented 3 years ago

Nice find. 286 is a 16bit cpu, 386 32bit. Doubt there would be a chance to get that to work. I’ll get a spreadsheet together to list problem games.

alessioscand commented 3 years ago

Thank you SO MUCH for your efforts. May I ask if the title screen of Commander Keen 4 is "corrupted" also on your systems? The game works properly, it's only the title screen. Any chance to get Jazz Jackrabbit working? Thanks

gyurco commented 3 years ago

Jazz Jackrabbit is for 386. Usually if you look into the exe file with a simple viewer, you can get some hints, like: "memory manager does not support DPMI or VCPI" or "must be run on a 386 processor".

alessioscand commented 3 years ago

OK thank you. Meanwhile it seems that Blake Stone also freezes, but only when the 3D engine is loaded (title, menus etc. are OK).

EDIT: I'd like to contribute to the spreadsheet, if that's possibile. "Alley Cat" and "Sokoban" graphics are corrupted (while they seem working), "Catacomb 3-D" serie games are working at half-screen in the 3D engine, and in "Commander Keen 4" only the title screen is garbled. On the other hand, "Speedball 2" freezes with the CPU at maximum speed, but works very well with CPU /3, and the "Dangerous Dave" serie (Haunted House, Risky Woods and Goes Nutz) work perfecly with the /COMP parameter (e.g. HAUNTED /COMP) that avoids some vertical scrolling problems.

squidrpi commented 3 years ago

I've started a game compatibility spreadsheet anyone can edit [https://docs.google.com/spreadsheets/d/1r07Ubfzquz2FxnKp4GROk8_Kq6kTlVW7YxVTmBDR_c4/edit?usp=sharing]() It might help. Can you put it in the core readme when you release the new version?

gyurco commented 3 years ago

Ok, I'll add it. If you want to filter out i386 games, you can set up SignalTap II to record ICODE, IFETCH and INSTR on the CPU. if ICODE==56(dec), then it means an illegal instruction encountered, and you can check INSTR[7:0] for the opcode. Looks like for example MicroProse simulators are i386 (M1 Tank Platoon as an exception). Luckily most of them are available on Amiga or ST.

alessioscand commented 3 years ago

I've started a game compatibility spreadsheet anyone can edit https://docs.google.com/spreadsheets/d/1r07Ubfzquz2FxnKp4GROk8_Kq6kTlVW7YxVTmBDR_c4/edit?usp=sharing

Hi, I've updated the sheet with my tests. May I ask if you see the title screen of Commander Keen 4 correctly? Thank you.

squidrpi commented 3 years ago

@gyurco how do you get it to fit with SignalTap. I've used sample depth of 64 and reduced the signals but it won't fit when compiling. Based on clk_cpu.

squidrpi commented 3 years ago

@alessioscand Keen 4 has no title screen corruption but there's lots of flickering in the demo mode. Same with old and new cores/bios.

gyurco commented 3 years ago

@gyurco how do you get it to fit with SignalTap. I've used sample depth of 64 and reduced the signals but it won't fit when compiling. Based on clk_cpu.

Comment out opl3 module during test.

alessioscand commented 3 years ago

@alessioscand Keen 4 has no title screen corruption but there's lots of flickering in the demo mode. Same with old and new cores/bios.

Hmm that's strange, gameplay and demo on my system are perfect. I'll check again.

squidrpi commented 3 years ago

Hmm that's strange, gameplay and demo on my system are perfect. I'll check again.

I tried this one link

alessioscand commented 3 years ago

Hmm that's strange, gameplay and demo on my system are perfect. I'll check again.

I tried this one link

@squidrpi if in the video options of Keen you have "SVGA compatibility", enable it and the scrolling will be perfect. I have updated the sheet (also with more titles). Corrupted title screen is probably an issue of my executable, since both episodes 5 and 6 are OK.