VOGONS


Reply 860 of 1140, by 7F20

User metadata
Rank Member
Rank
Member
ViTi95 wrote on 2023-10-11, 10:55:

I had the idea to implement it in the past, but the realtime conversion from a linear backbuffer to planes is so slow (even in ASM) that is nowhere usable. Also it requires moving lot's of data through the ISA bus (128kb per frame maximum), which limits the framerate to 6-7 fps. That's why I removed the dithered EGA and ATI 640x200 16 color modes, it was cool but basically unusable.

It's just too much for the 8-bit ISA bus.

https://youtu.be/3m85czNLL-8?si=1_ZSY09l_1CQxuIw

Would it be possible to do a VGA resolution mode with the EGA palette if it didn't use dithering?

Reply 861 of 1140, by ViTi95

User metadata
Rank Oldbie
Rank
Oldbie

Dithering itself doesn't take much CPU time as all needed data is stored in a LUT table, the issue here is the chunky to planar conversion and limited bus bandwidth. Same issue as Doom running on Amiga computers. So it's possible to create a VGA/SuperEGA 640x480 16 color executable, but it will be slow for sure on correct era PC hardware.

https://www.youtube.com/@viti95

Reply 862 of 1140, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

I was watching that IBM EGA FantasyLand demo on PCJS, and that seems really fast in text mode and redefining fonts on the fly, dunno how many font primitives you'd have to design though to get something seeming to be a decent resolution.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 863 of 1140, by ViTi95

User metadata
Rank Oldbie
Rank
Oldbie
BitWrangler wrote on 2023-10-13, 03:48:

I was watching that IBM EGA FantasyLand demo on PCJS, and that seems really fast in text mode and redefining fonts on the fly, dunno how many font primitives you'd have to design though to get something seeming to be a decent resolution.

I've been thinking in this idea, and it's possible to create a very fast text mode for EGA cards with modified fonts, that has more resolution but with color clash. There are 256 characters available, so it's possible to generate a font with all permutations of 4x2 pixels with 2 colors (foreground + background). For example the 80x100 text mode (2 scanlines per character), becomes virtually 320x200 but with only two colors per group of 8 pixels. I really like the idea as is very similar to ZX Spectrum video. The main issue here is the real time conversion from a group of 8 pixels to a single character + foreground/background color. A lookup table is just too big in this case (4Gb), so real time conversion is needed. Maybe someone here has an idea of a fast way to process these blocks in real time.

https://www.youtube.com/@viti95

Reply 864 of 1140, by b_w

User metadata
Rank Newbie
Rank
Newbie

ViTi95, here is a sample code how to deal with Bayer dithering in DOS text mode (Borland/Turbo Pascal).

Reply 865 of 1140, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++
ViTi95 wrote on 2023-10-17, 07:25:
BitWrangler wrote on 2023-10-13, 03:48:

I was watching that IBM EGA FantasyLand demo on PCJS, and that seems really fast in text mode and redefining fonts on the fly, dunno how many font primitives you'd have to design though to get something seeming to be a decent resolution.

I've been thinking in this idea, and it's possible to create a very fast text mode for EGA cards with modified fonts, that has more resolution but with color clash. There are 256 characters available, so it's possible to generate a font with all permutations of 4x2 pixels with 2 colors (foreground + background). For example the 80x100 text mode (2 scanlines per character), becomes virtually 320x200 but with only two colors per group of 8 pixels. I really like the idea as is very similar to ZX Spectrum video. The main issue here is the real time conversion from a group of 8 pixels to a single character + foreground/background color. A lookup table is just too big in this case (4Gb), so real time conversion is needed. Maybe someone here has an idea of a fast way to process these blocks in real time.

I have vaguely got an idea of something. For purposes of example, assume a 5x9 character bitmap. Instead of storing 40 unique character bitmaps, one could store a master bitmap that reading it in 5x9 chunks with offsets would make 40 unique bitmaps. Imagine a single pixel set, 1, in a 9x17 bitmap, the middle pixel. Then reading the top left 5x9 gives a character bitmap with bottom right pixel lit, or reading top right it's the bottom left pixel in the char, or any frame of 5x9 in the 9x17 gives you single pixel. I think this halves the space, since sets of 40 characters can be stored as 9x17s where all the characters are overlaid at positions in it. They need not be 9x17 either, could be larger with multiple patterns. Also, if you could read half the character at one position and the bottom half at another position, using the first example bitmap you could have many more unique characters with one pixel lit in each half. Then some sort of binary tree and procedural generation, might give a way to fold that a few more times into itself and yay, we only need a 286 with 256Mb of RAM to run it 🤣 IDK that might be the right direction and get further optimised, it might not.

Edit: oh yah, some of the old ZX spectrum tricks might not apply since I think some of the situations where it seemed like there were 80k of custom bitmaps in a 48kb game when 30k was the game logic is because they were doing crap like treating machine code in ROM and from other parts of the program as arrays and using bits of it that were the right shape/pattern.

EditII: also remember they would leverage the fastest instructions like ADD and if two locations run through the instruction made the pattern they wanted, used that.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 866 of 1140, by maxtherabbit

User metadata
Rank l33t
Rank
l33t

I noticed that fast doom setup doesn't have a controller option for joystick, while vanilla does. Was this removed on purpose?

Reply 867 of 1140, by ishadow

User metadata
Rank Newbie
Rank
Newbie
ViTi95 wrote on 2023-10-17, 07:25:

A lookup table is just too big in this case (4Gb), so real time conversion is needed. Maybe someone here has an idea of a fast way to process these blocks in real time.

You can arrange char set as a binary tree. Similar to how Heap Sort does. Then process every 4x2 block of the original image.
Psuedocode:

currentChar = 0
For pixel from 1 to 8 do
if(screen[pixel].color!=block[pixel].color) then currentChar=GoDeeper(currentChar, pixel)
end
// currentChar now contains correct character for a given 4x2 block of original image

EDIT: I had to change pseudo code. It should only go deeper when color is different. GoDeeper function should know which pixel is currently calculated to move down the tree accordingly.

To compare colors you can use lookup table that marks each color from 256 color DOOM palette as 'white' or 'black'. Additional function can be used to set character foreground and background color.
For example you can sum R, G and B values separately for all pixels from a block and you'll get three int values 0-512 value for each channel. Using bit shifting you'll get direct color from 64-color EGA palette.

Then you can use lookup table to convert 64-colors to regular 16-color palette or write code that would pick new 16-colors from 64-color palette every frame.

I don't if such approach is fast enough to get playable FPS, but it will allow to update only 4KB of EGA memory every frame. Anyway such approach uses only comparison, addition, multiplication and bit shifting. However doing all of this on every pixel from 320x200 image per frame is heavy even for 100+ MHz CPUs.

Last edited by ishadow on 2023-11-05, 18:08. Edited 1 time in total.

Reply 868 of 1140, by rasz_pl

User metadata
Rank l33t
Rank
l33t
maxtherabbit wrote on 2023-11-04, 13:56:

I noticed that fast doom setup doesn't have a controller option for joystick, while vanilla does. Was this removed on purpose?

I would guess removed because pooling joystick is very CPU intensive

AT&T Globalyst/FIC 486-GAC-2 Cache Module reproduction
Zenith Data Systems (ZDS) ZBIOS 'MFM-300 Monitor' reverse engineering

Reply 869 of 1140, by ViTi95

User metadata
Rank Oldbie
Rank
Oldbie
maxtherabbit wrote on 2023-11-04, 13:56:

I noticed that fast doom setup doesn't have a controller option for joystick, while vanilla does. Was this removed on purpose?

Yep, I removed it because joystick pooling is slow and takes lot's of CPU time as the Doom engine checks whenever possible any controller input. Even mouse code takes quite some time from the CPU (that's why I asked in the past if people played Doom with the mouse)

https://www.youtube.com/@viti95

Reply 870 of 1140, by Bondi

User metadata
Rank Oldbie
Rank
Oldbie
ViTi95 wrote on 2023-11-09, 15:19:
maxtherabbit wrote on 2023-11-04, 13:56:

I noticed that fast doom setup doesn't have a controller option for joystick, while vanilla does. Was this removed on purpose?

Yep, I removed it because joystick pooling is slow and takes lot's of CPU time as the Doom engine checks whenever possible any controller input. Even mouse code takes quite some time from the CPU (that's why I asked in the past if people played Doom with the mouse)

Hey ViTi95! FastDoom ended up with a very impressive list of supported sound devices. Was very cool to discover it now supports Adlib for PCM sound. However if it's selected the Adlib FM doesn't work. Is it possible to have both Adlib music and FX at the same time?

And it just occuretd to me that there is a very useful feature that you could add - MIDI to serial(COM) port output. That's waht SoftMPU can do for real mode games. For protected mode Cloudschatze has made patches for many games (Re: MPU-232 : RS-232 MIDI interface, compatible with SoftMPU)
This would be very useful for laptops that usually lack a gameport. One needs a 8-pin Mini-DIN to DE9 cable like Hosa DBK-103 which is compatible with Roland, Yamaha and Korg synthesizers. I have this cable and can do testing if you decide to take this up.
Details of the cable https://hosatech.com/wp-content/uploads/2013/ … -100_Pinout.pdf

PCMCIA Sound Cards chart
archive.org: PCMCIA software, manuals, drivers

Reply 871 of 1140, by ViTi95

User metadata
Rank Oldbie
Rank
Oldbie

Well it's not possible to use Adlib music and FX at the same time due to technical reasons, basically Adlib FX is bitbanging one single OPL register as fast as possible, and that makes impossible to use other OPL registers at the same time. However it's possible to use Adlib FX + PCM music at the same time.

And yeah, Serial-Midi support would be awesome, I've recently bought a Roland SC-88, just need to buy the cable and start coding. This will take some time since I have to finish first sorting and documenting all my retro hardware collection. Basically I need more space in the house and I've decided to sell part of it.

https://www.youtube.com/@viti95

Reply 872 of 1140, by Bondi

User metadata
Rank Oldbie
Rank
Oldbie
ViTi95 wrote on 2023-11-10, 10:00:

Well it's not possible to use Adlib music and FX at the same time due to technical reasons, basically Adlib FX is bitbanging one single OPL register as fast as possible, and that makes impossible to use other OPL registers at the same time. However it's possible to use Adlib FX + PCM music at the same time.

And yeah, Serial-Midi support would be awesome, I've recently bought a Roland SC-88, just need to buy the cable and start coding. This will take some time since I have to finish first sorting and documenting all my retro hardware collection. Basically I need more space in the house and I've decided to sell part of it.

Re Adlib, I see, I was suspecting something like this. And how does the PCM option work? I've seen it it, but didn't quite understand what it was.
Looking forward to serial MIDI 👍 The cable is available on ebay right now for usd 11, don't miss it 😁

PCMCIA Sound Cards chart
archive.org: PCMCIA software, manuals, drivers

Reply 873 of 1140, by ViTi95

User metadata
Rank Oldbie
Rank
Oldbie

PCM option basically plays raw audio files in one extra channel (like an MP3). This allows any FX device to play music (even the speaker). It has some limitations though:

- Only 8-bit mono music is supported. I still have to think a way to add stereo support, as the Apogee Sound System doesn't support 2 channel sound files. 16-bit support won't be added as I removed support code (Doom only uses 8-bit sounds)
- Whole music files are stored in RAM, so more than 16Mb of RAM is required. The idea is to add an option to stream music from the HDD, but haven't made it stable enough yet.
- Due to technical reasons using high frequency music (>22KHz) files is quite CPU intensive

https://www.youtube.com/@viti95

Reply 874 of 1140, by Bondi

User metadata
Rank Oldbie
Rank
Oldbie
ViTi95 wrote on 2023-11-10, 10:30:
PCM option basically plays raw audio files in one extra channel (like an MP3). This allows any FX device to play music (even the […]
Show full quote

PCM option basically plays raw audio files in one extra channel (like an MP3). This allows any FX device to play music (even the speaker). It has some limitations though:

- Only 8-bit mono music is supported. I still have to think a way to add stereo support, as the Apogee Sound System doesn't support 2 channel sound files. 16-bit support won't be added as I removed support code (Doom only uses 8-bit sounds)
- Whole music files are stored in RAM, so more than 16Mb of RAM is required. The idea is to add an option to stream music from the HDD, but haven't made it stable enough yet.
- Due to technical reasons using high frequency music (>22KHz) files is quite CPU intensive

Okay, got it. Are the .raw files available somewhere? Or I have to find the tracks and convert them?

PCMCIA Sound Cards chart
archive.org: PCMCIA software, manuals, drivers

Reply 875 of 1140, by digger

User metadata
Rank Oldbie
Rank
Oldbie
ViTi95 wrote on 2023-11-10, 10:30:
PCM option basically plays raw audio files in one extra channel (like an MP3). This allows any FX device to play music (even the […]
Show full quote

PCM option basically plays raw audio files in one extra channel (like an MP3). This allows any FX device to play music (even the speaker). It has some limitations though:

- Only 8-bit mono music is supported. I still have to think a way to add stereo support, as the Apogee Sound System doesn't support 2 channel sound files. 16-bit support won't be added as I removed support code (Doom only uses 8-bit sounds)
- Whole music files are stored in RAM, so more than 16Mb of RAM is required. The idea is to add an option to stream music from the HDD, but haven't made it stable enough yet.
- Due to technical reasons using high frequency music (>22KHz) files is quite CPU intensive

We were wondering if it were possible to have both PCM playback and OPL2-compatible FM playback, at least on an OPL3 chip. The reasons being that the OPL3 chip has more channels than OPL2 and could use one of the extra channels for the (pseudo) PCM output, plus the fact that the OPL3 doesn't require the timer delays that the OPL2 chip needs, which might make it easier to combine and mix the PCM and FM streams being sent to the chip.

Reply 876 of 1140, by ViTi95

User metadata
Rank Oldbie
Rank
Oldbie
Bondi wrote on 2023-11-10, 10:41:

Okay, got it. Are the .raw files available somewhere? Or I have to find the tracks and convert them?

Not yet, maybe I should upload an example. I use SOX to convert the music to the correct format:

sox D_E1M1.ogg -r 44100 -e unsigned -b 8 -c 1 MUS_1.RAW

The allowed audio frequencies are 11KHz, 22KHz and 44KHz.

https://www.youtube.com/@viti95

Reply 878 of 1140, by ViTi95

User metadata
Rank Oldbie
Rank
Oldbie

I removed all support for variable sound pitch, even in the original Apogee Sound System, so no support for it. If I remember correctly John Romero said that he wasn't a fan of it.

https://www.youtube.com/@viti95