VOGONS


First post, by NooN

User metadata
Rank Newbie
Rank
Newbie

Hey there,

I'm that guy behind that elaborate DOS sound card article on crossfire-designs... meanwhile I also develop software.

I published Tetris II in 2001, which was an advanced - still - DOS game, with Hi-/Truecolor support, Alphablending, MODule music and several effects. Most of that stuff has been written by me (game is based my on GX2, SoundLib 2 for Borland Pascal). It needed some tinkering though - sound wasn't working for everyone in DOS, it was too slow on older machines (developed on a K6-3 400 and partially Athlon 1 GHz). I made some fixes for DOS and also speed improvements for the game itself.

You can watch the update development here:
https://www.youtube.com/watch?v=FigKXTx_mME

tetris2_3.jpg
The game itself is available here:
https://crossfire-designs.de/index.php?lang=en&what=software

I hope you'll like it. Let me know your feedback, either here or on Youtube. Thanks!

Reply 1 of 29, by Stretch

User metadata
Rank Member
Rank
Member

Nice graphics, music, and game play. I went up to level 8 before losing.

I did encounter one glitch when I entered I think level 5 or 6. The piece didn't move down until I pressed the down key on the keyboard.

Win 11 - Intel i7-1360p - 32 GB - Intel Iris Xe - Sound BlasterX G5

Reply 2 of 29, by NooN

User metadata
Rank Newbie
Rank
Newbie
Stretch wrote on 2022-03-13, 06:17:

Nice graphics, music, and game play. I went up to level 8 before losing.

I did encounter one glitch when I entered I think level 5 or 6. The piece didn't move down until I pressed the down key on the keyboard.

Thanks, and thanks for the info! I'll keep an eye on that problem...

Reply 3 of 29, by Gmlb256

User metadata
Rank l33t
Rank
l33t

Tried the game and looks nice!

On a real machine equipped with AMD K6-2+/450 CPU however I got runtime error 200 (divide by zero) after selecting the "About" option and occasionally while playing. Neither the utilities used to deal with that runtime error nor the slowdown utilities did help.

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS

Reply 4 of 29, by NooN

User metadata
Rank Newbie
Rank
Newbie
Gmlb256 wrote on 2022-03-13, 20:03:

Tried the game and looks nice!

On a real machine equipped with AMD K6-2+/450 CPU however I got runtime error 200 (divide by zero) after selecting the "About" option and occasionally while playing. Neither the utilities used to deal with that runtime error nor the slowdown utilities did help.

Could you send me the crash addresses shown?
There's no CRT unit in it (which often causes this crash), or at least there shouldn't (had it temporarily for debug purposes), so slowing down doesn't address the issue.

Reply 5 of 29, by Gmlb256

User metadata
Rank l33t
Rank
l33t
NooN wrote on 2022-03-13, 21:03:

Could you send me the crash addresses shown?
There's no CRT unit in it (which often causes this crash), or at least there shouldn't (had it temporarily for debug purposes), so slowing down doesn't address the issue.

The runtime error 200 address displayed after selecting "About" is 000A:2C34.

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS

Reply 6 of 29, by zyzzle

User metadata
Rank Member
Rank
Member

This DOS game of Tetris 2 looks Fabulous. However, I can't even get to the point Gmlb256 mentions where he encouters "Runtime 200 Errors". For me, the only thing that loads is the initial title screen, and the program then freezes hard and I can't play the game, and must hard-reboot. So, so frustrating. I tried several options like -nosound, -nonet, and -VTrue all to no avail. Also several memory configurations (limit XMS to 16M, 64M, or 2048M). Still hard freezes after displaying title page, with no further progress possible into the game itself. I am using bare metal DOS on an intel core i5 laptop with DOS version 7.1, and VBE 3 Intel onboard graphics, which does support framebuffer and MTRR speedup. Do you have any other suggestions? Very bummed out that I can't try this best-looking Tetris game I've ever seen for DOS.

The runtime 200 errors suggest the "Turbo Pascal"-like speed bug, where Turbo pascal programs wouldn't run on systems above ~200 Mhz due to an overflow bug. However, I do not know which language Tetris 2 is written in, but it looks like C.

NB: Also I can't run your original tetris1.exe program, either! Same configurations. This program progresses not even to a title screen before the system hard-freezes! It just gives a black screen, with hard freeze. Extremely frustrating. Does Tetris1 have any commandline options which I may try? Everything I tried failed.

Reply 7 of 29, by NooN

User metadata
Rank Newbie
Rank
Newbie
zyzzle wrote on 2022-03-14, 05:23:

This DOS game of Tetris 2 looks Fabulous. However, I can't even get to the point Gmlb256 mentions where he encouters "Runtime 200 Errors". For me, the only thing that loads is the initial title screen, and the program then freezes hard and I can't play the game, and must hard-reboot. So, so frustrating. I tried several options like -nosound, -nonet, and -VTrue all to no avail. Also several memory configurations (limit XMS to 16M, 64M, or 2048M). Still hard freezes after displaying title page, with no further progress possible into the game itself. I am using bare metal DOS on an intel core i5 laptop with DOS version 7.1, and VBE 3 Intel onboard graphics, which does support framebuffer and MTRR speedup. Do you have any other suggestions? Very bummed out that I can't try this best-looking Tetris game I've ever seen for DOS.

The runtime 200 errors suggest the "Turbo Pascal"-like speed bug, where Turbo pascal programs wouldn't run on systems above ~200 Mhz due to an overflow bug. However, I do not know which language Tetris 2 is written in, but it looks like C.

NB: Also I can't run your original tetris1.exe program, either! Same configurations. This program progresses not even to a title screen before the system hard-freezes! It just gives a black screen, with hard freeze. Extremely frustrating. Does Tetris1 have any commandline options which I may try? Everything I tried failed.

Hey, I'm sorry to hear that. I haven't tested it on such new machines, they are not expected for a DOS environment, and this might be the problem. Your machine may not be supported, and I can't tell at the moment whether I can do that at any point, as I don't have such a machine for testing. The only thing right now you can do is to write down the specific model number of the CPU, so I can try it when such a thing happens.

As said in the previous post, the RTE 200 is not due to the unit CRT and hence not due to the processor's speed. My personal guess is that your problem happens due to processor extensions not tested on your CPU. It's Borland Pascal, but think of it as a very advanced way to use it. It does things that are close to bare metal of the CPU and DOS.
My only suggestion is to try it on older hardware or DosBox at the moment.

I can't offer support for the older Tetris. It hasn't been part of my publication, and It's almost 25 years ago that I wrote and tested it.

Edit: If you're experienced in Pascal and Assembler, I could give you the part that I suspect could cause the issue for debugging purposes. The game uses the CPU time stamp counter (present on Pentium and above), and as you're on a more modern AND mobile CPU, it might behave differently than originally designed.

Reply 8 of 29, by NooN

User metadata
Rank Newbie
Rank
Newbie
Gmlb256 wrote on 2022-03-13, 21:48:

The runtime error 200 address displayed after selecting "About" is 000A:2C34.

Found it... at least the code line, but don't understand it at the moment. Do you have a sound card installed and was it playing any music?
Edit: You obviously have one, if you liked the music... what kind of card is it? If not original, which SB does it emulate?

Reply 9 of 29, by Gmlb256

User metadata
Rank l33t
Rank
l33t
NooN wrote on 2022-03-14, 20:55:

Found it... at least the code line, but don't understand it at the moment. Do you have a sound card installed and was it playing any music?
Edit: You obviously have one, if you liked the music... what kind of card is it? If not original, which SB does it emulate?

The sound card used was the Sound Blaster AWE64 CT4520 which is compatible with the SB16. And yes, I liked the tracker music 😁.

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS

Reply 10 of 29, by NooN

User metadata
Rank Newbie
Rank
Newbie
Gmlb256 wrote on 2022-03-14, 21:16:
NooN wrote on 2022-03-14, 20:55:

Found it... at least the code line, but don't understand it at the moment. Do you have a sound card installed and was it playing any music?
Edit: You obviously have one, if you liked the music... what kind of card is it? If not original, which SB does it emulate?

The sound card used was the Sound Blaster AWE64 CT4520 which is compatible with the SB16. And yes, I liked the tracker music 😁.

Have that one, but not at my hands right now. Not sure why this happens, but I've added a workaround for the issue. If samples are missing somewhere, then the cause might be somewhere else. Simply download the game again and overwrite with the new .exe. Let me know your results!

Reply 11 of 29, by Gmlb256

User metadata
Rank l33t
Rank
l33t
NooN wrote on 2022-03-15, 00:10:

Have that one, but not at my hands right now. Not sure why this happens, but I've added a workaround for the issue. If samples are missing somewhere, then the cause might be somewhere else. Simply download the game again and overwrite with the new .exe. Let me know your results!

Downloaded once again the game and replaced the exe with the one dated 03/15/2022.

The runtime error 200 is still there after selecting the "About" option, this time the address was 000A:2C3B. While playing the after several minutes I got a different runtime error which is 205 at 0009:679B and happened when playing K_ARYX.XM.

Seems that the problem happens with certain tracker music because I replaced them with a different one and no runtime error happened.

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS

Reply 12 of 29, by NooN

User metadata
Rank Newbie
Rank
Newbie
Gmlb256 wrote on 2022-03-15, 01:06:
Downloaded once again the game and replaced the exe with the one dated 03/15/2022. […]
Show full quote
NooN wrote on 2022-03-15, 00:10:

Have that one, but not at my hands right now. Not sure why this happens, but I've added a workaround for the issue. If samples are missing somewhere, then the cause might be somewhere else. Simply download the game again and overwrite with the new .exe. Let me know your results!

Downloaded once again the game and replaced the exe with the one dated 03/15/2022.

The runtime error 200 is still there after selecting the "About" option, this time the address was 000A:2C3B. While playing the after several minutes I got a different runtime error which is 205 at 0009:679B and happened when playing K_ARYX.XM.

Seems that the problem happens with certain tracker music because I replaced them with a different one and no runtime error happened.

Thanks for the feedback! The issues appear to happen in conjunction with the MOD playback. I can't tell at the moment why, as the player is working here on several machines. Is anything on your machine run out of specs? CPU or mem overdlocked/run with tight timings? Are there any issues with the storage medium, or is it run under tight timings or unfitting cable? (UDMA 66+ requires 80 wire cable)

I can check back on my K6-III, but your input would also shed some light on it.

Reply 13 of 29, by Gmlb256

User metadata
Rank l33t
Rank
l33t
NooN wrote on 2022-03-17, 13:30:

Thanks for the feedback! The issues appear to happen in conjunction with the MOD playback. I can't tell at the moment why, as the player is working here on several machines. Is anything on your machine run out of specs? CPU or mem overdlocked/run with tight timings? Are there any issues with the storage medium, or is it run under tight timings or unfitting cable? (UDMA 66+ requires 80 wire cable)

I can check back on my K6-III, but your input would also shed some light on it.

The only thing that is out of spec on my system is the FSB running at 75 MHz on a motherboard with an Intel 430VX chipset (no UDMA). It also has a "turbo" switch to slow the FSB down to 50 MHz but that does nothing to deal with the runtime error.

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS

Reply 14 of 29, by NooN

User metadata
Rank Newbie
Rank
Newbie
Gmlb256 wrote on 2022-03-17, 15:54:
NooN wrote on 2022-03-17, 13:30:

Thanks for the feedback! The issues appear to happen in conjunction with the MOD playback. I can't tell at the moment why, as the player is working here on several machines. Is anything on your machine run out of specs? CPU or mem overdlocked/run with tight timings? Are there any issues with the storage medium, or is it run under tight timings or unfitting cable? (UDMA 66+ requires 80 wire cable)

I can check back on my K6-III, but your input would also shed some light on it.

The only thing that is out of spec on my system is the FSB running at 75 MHz on a motherboard with an Intel 430VX chipset (no UDMA). It also has a "turbo" switch to slow the FSB down to 50 MHz but that does nothing to deal with the runtime error.

Okay... I have the suspicion that there might be some memory corruption. Unfortunately it's hard to debug it in any way. BUT the SoundLib version I used there (and hence the MOD player) were improved under Windows, where I actually had proper debugging tools. I ported back many changes from these versions (there are 2, one for Delphi, a newer for C++), which also added several safety checks to the player. Might not work better, but was worth the shot. It also adds XM player improvements, so some XMs will sound more correct, depending on which (extended) features they were using.
Simply download it again and overwrite Tetris2.exe. If there are crashes, let me know. I'll take notes for another round.

Reply 15 of 29, by Gmlb256

User metadata
Rank l33t
Rank
l33t
NooN wrote on 2022-04-09, 22:28:

Okay... I have the suspicion that there might be some memory corruption. Unfortunately it's hard to debug it in any way. BUT the SoundLib version I used there (and hence the MOD player) were improved under Windows, where I actually had proper debugging tools. I ported back many changes from these versions (there are 2, one for Delphi, a newer for C++), which also added several safety checks to the player. Might not work better, but was worth the shot. It also adds XM player improvements, so some XMs will sound more correct, depending on which (extended) features they were using.
Simply download it again and overwrite Tetris2.exe. If there are crashes, let me know. I'll take notes for another round.

Replaced TETRIS2.EXE with the new executable and it still crashes with the same runtime error codes at the same location I mentioned prior. 🙁

It seems that the runtime error code 200 and 205 happens when playing S3M and XM respectively.

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS

Reply 16 of 29, by NooN

User metadata
Rank Newbie
Rank
Newbie
Gmlb256 wrote on 2022-04-10, 00:16:
NooN wrote on 2022-04-09, 22:28:

Okay... I have the suspicion that there might be some memory corruption. Unfortunately it's hard to debug it in any way. BUT the SoundLib version I used there (and hence the MOD player) were improved under Windows, where I actually had proper debugging tools. I ported back many changes from these versions (there are 2, one for Delphi, a newer for C++), which also added several safety checks to the player. Might not work better, but was worth the shot. It also adds XM player improvements, so some XMs will sound more correct, depending on which (extended) features they were using.
Simply download it again and overwrite Tetris2.exe. If there are crashes, let me know. I'll take notes for another round.

Replaced TETRIS2.EXE with the new executable and it still crashes with the same runtime error codes at the same location I mentioned prior. 🙁

It seems that the runtime error code 200 and 205 happens when playing S3M and XM respectively.

Got it! Sorry, I'm only sporadically doing this..
So basically the issue was only on MMX machines, and I wasn't using one at the time of refreshing the project. MMX works on the FPU on these older CPUS, and when an interrupt of the sound card interrupts an MMX operation, and FPU operations are done, the crash occurs.

You could currently resolve it if you can turn off CPUID in the BIOS or turn off the MMX extensions.
Will issue an update soon, as I'm preparing some more improvements...

Reply 17 of 29, by Gmlb256

User metadata
Rank l33t
Rank
l33t
NooN wrote on 2023-02-15, 21:58:
Got it! Sorry, I'm only sporadically doing this.. So basically the issue was only on MMX machines, and I wasn't using one at the […]
Show full quote
Gmlb256 wrote on 2022-04-10, 00:16:
NooN wrote on 2022-04-09, 22:28:

Okay... I have the suspicion that there might be some memory corruption. Unfortunately it's hard to debug it in any way. BUT the SoundLib version I used there (and hence the MOD player) were improved under Windows, where I actually had proper debugging tools. I ported back many changes from these versions (there are 2, one for Delphi, a newer for C++), which also added several safety checks to the player. Might not work better, but was worth the shot. It also adds XM player improvements, so some XMs will sound more correct, depending on which (extended) features they were using.
Simply download it again and overwrite Tetris2.exe. If there are crashes, let me know. I'll take notes for another round.

Replaced TETRIS2.EXE with the new executable and it still crashes with the same runtime error codes at the same location I mentioned prior. 🙁

It seems that the runtime error code 200 and 205 happens when playing S3M and XM respectively.

Got it! Sorry, I'm only sporadically doing this..
So basically the issue was only on MMX machines, and I wasn't using one at the time of refreshing the project. MMX works on the FPU on these older CPUS, and when an interrupt of the sound card interrupts an MMX operation, and FPU operations are done, the crash occurs.

You could currently resolve it if you can turn off CPUID in the BIOS or turn off the MMX extensions.
Will issue an update soon, as I'm preparing some more improvements...

That did it! 😁

Since I'm unable to turn off CPUID or the MMX instructions, I had to hexedit the executable to disable the detection of the latter. It worked flawlessly afterwards.

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS

Reply 18 of 29, by zyzzle

User metadata
Rank Member
Rank
Member
Gmlb256 wrote on 2023-02-16, 01:04:

Since I'm unable to turn off CPUID or the MMX instructions, I had to hexedit the executable to disable the detection of the latter. It worked flawlessly afterwards.

Please list which hexedits you manually made to the TETRIS2 executable to disable MMX instructions.

Reply 19 of 29, by Gmlb256

User metadata
Rank l33t
Rank
l33t
zyzzle wrote on 2023-02-16, 11:58:
Gmlb256 wrote on 2023-02-16, 01:04:

Since I'm unable to turn off CPUID or the MMX instructions, I had to hexedit the executable to disable the detection of the latter. It worked flawlessly afterwards.

Please list which hexedits you manually made to the TETRIS2 executable to disable MMX instructions.

It is in offset 599F8h in TETRIS2.EXE and looks like this:

599F8h 66 B8 01 00 00 00     mov eax, 1
599FEh 0F A2 cpuid
59A00h 66 F7 C2 00 00 80 00 test edx, 800000h
59A07h 75 06 jnz 59A0Fh
59A09h 90 nop
59A0Ah 90 nop
59A0Bh B0 00 mov al, 0
59A0Dh F9 stc
59A0Eh CB retf
59A0Fh B0 01 mov al, 1
59A11h F8 clc
59A12h CB retf

Just change the value from 1 to 0 from the "mov al" instruction in offset 59A0Fh.

For convenience, I uploaded the hexedited executable.

Attachments

  • Filename
    TETRIS2.ZIP
    File size
    154.91 KiB
    Downloads
    56 downloads
    File comment
    TETRIS2.EXE with MMX detection disabled.
    File license
    Fair use/fair dealing exception

VIA C3 Nehemiah 1.2A @ 1.46 GHz | ASUS P2-99 | 256 MB PC133 SDRAM | GeForce3 Ti 200 64 MB | Voodoo2 12 MB | SBLive! | AWE64 | SBPro2 | GUS