VOGONS


MartyPC

Topic actions

Reply 400 of 482, by GloriousCow

User metadata
Rank Member
Rank
Member

I've updated https://martypc.net with a new build.

You can jump directly to Area 5150
https://martypc.net/?mount=fd:0:Area%20 ... rsion).img

Or try an IBM PCjr
https://martypc.net/?machine_config_name=ibm_pcjr

No ROMS are directly downloadable, so I hope this doesn't break any rules.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 401 of 482, by superfury

User metadata
Rank l33t++
Rank
l33t++

Thinking about upgrading my Sound Blaster 2.o to a Sound Blaster Pro (CT1330) though. Just double the OPL2 chips and mixer support added (no tricky OPL3 stuff or custom MIDI synth required).

I'd need to make the existing OPL2 chip emulation modular (like the CPU) though, to make it emulate two chips simultaneously.

Edit: Got a SoundBlaster Pro full version ready to verify and commit. Don't have a PC on hand eight now, so it's still stored on my local storage. After compiler validation it can go into the git repo to verify against software.

The basic dual-OPL2 I've already implemented there. And I'll still need to implement the volume controls (mapping the register values to amplification factors and apply them to various hardware) and input/output filters of the card.

Oddly, Dosbox calls the MIDI volume control (register 26h) register in the mixer the FM volume control instead? Is that an error in the official documentation or an error in Dosbox?
Edit: Gotten a basic implementation implemented, with stereo support. Although stuff like volume and input control isn't implemented yet (registers not masking off unused bits and the registers having no effect), the basic Sound Blaster Pro should be implemented. All that's mainly left now is to verify it (and implement those volume controls ofc).
Edit: A small bugfix: stereo mode seems to require high speed mode (command 90h or 98h). Examples in documentation render a single mono sample before starting the stream with a high speed command, where stereo would fail if command 14h (in the example given in the documentation) would render a single byte buffer in stereo before the steam starts properly. So thus only high speed commands seem to be affected by these settings.
Edit: Managed to implement a basic mixer, calculating volumes for the different possible audio sources.
Although the actual multiplication factors that are calculated aren't applied to the various input/output devices audio inputs/outputs yet.
Edit: Most volume settings are applied now. Only sound input (unknown if it's Mic or Line in that's applied) and MIDI output (since it's a different device that's rendering) isn't applied. Master volume is now mapped onto all channels that are available (voice, FM, CD audio, Game Blaster (although not having a dedicated volume control, using the master volume only and a static 100% volume otherwise). So only inputs aren't applied, together with external hardware (Game Blaster card at an alternative address being applied master volume only).

Edit: I notice something odd though. The setup of the Sound Blaster Pro (not Pro 2!) reports the sound card as a Sound Blaster Pro 2 for some reason? The DSP version should be 3.00, so that's not a Pro 2? Various documentation I can find confirms that.
It's also the only command I see it executing during setup until that message appears?
Edit: I clearly see it executing just a DSP version command, which returns version 3.00. But the MS-DOS setup wizard still tells me it's detected a Pro 2 card?
Edit: Found a bug in the OPL2 chip emulation where the low status bits (lower 5 bits) were cleared. It's supposed to be reporting bits 1 and 2 set (according to Dosbox and 86box, just two emulators I cross-checked real quick). In this case looking at the code of the setup wizard that detects the sound card installed reads those ports and takes a different path if those aren't setup properly. Maybe that's the cause of the board being detected as a Pro 2 card?
Edit: Linux OPL2/3 drivers seem to agree?
https://android.googlesource.com/kernel/msm/+ … /opl3_lib.c#136
Edit: Fixing that, together with OPL2 left/right chip selection (for ports baseaddr+0 through baseaddr+3 as well as for port 388h/389h), the Sound Blaster Pro is now properly detected. 😁
Edit: Modified the Sound Blaster command/data registers to keep their own state seperated from the DMA modes. Thus it can always receive commands and send/receive data(parameters or actual data) on those ports. The DMA now keeps it's own track of it's active command, allowing pausing and resuming properly.
I did notice that before this improvement, Windows 9x seems to eventually halt DMA for some unknown reason (the halt DMA 8-bit Sound Blaster command), never receiving a continue or new DMA command it seems?
Edit: Fixed those issues. Now audio works fine in Windows 9x (also Doom 1/2 tested).
Only test-sbp.exe seems to oddly always crash on an ARPL instruction in real mode. So there's some weird CPU bug?
Edit: Went on the route of disassembling test-sbp.exe in much of it's entirety. Gotten most subroutines figured out already (the ones cerning the DSP and adlib at least). Just a small amount of functions left, but most seem to be some kind of text-parsing functions or data processing functions of some kind, which I don't know what they're doing. Also found various c-style functions too (figured they are memcmp, memcpy, strcpy, strcat) and duplicates of the sound blaster functions, but with a differently sourced I/O base port variable. One annoying thing is that it's assumed CS=DS, even though it can't because it seems to store code in some of the variable's storage locations.

Last edited by superfury on 2025-05-17, 22:33. Edited 2 times in total.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 402 of 482, by SoftCat

User metadata
Rank Member
Rank
Member
GloriousCow wrote on 2024-10-12, 01:22:
SoftCat wrote on 2024-10-12, 00:00:
EGA card Gemini VC-001. Multisync monitor is not needed here at all. Look: 14318000/114 ~= 16257000/129, 14318000/912 ~= 1625700 […]
Show full quote

EGA card Gemini VC-001. Multisync monitor is not needed here at all. Look:
14318000/114 ~= 16257000/129,
14318000/912 ~= 16257000/1032.
And otherwise everything is like CGA.

if you (or anyone else) can show me evidence of this working on an IBM 5154 or other dual-frequency EGA monitor of the era i will consider it a bug, but i'd have to rethink how i handle the display field entirely. I didn't consider a 16Mhz 15KHz mode.

if you look in the screenshot, "Field: 774x364" that is currently the maximum supported resolution with the 16Mhz clock.

I found a guy who tested 768x200 mode on a real EGA card with a real EGA monitor. Everything works, the result is here:
https://drive.google.com/drive/folders/1QAAxu … XPQ?usp=sharing

Reply 403 of 482, by GloriousCow

User metadata
Rank Member
Rank
Member
SoftCat wrote on 2025-05-09, 21:54:

I found a guy who tested 768x200 mode on a real EGA card with a real EGA monitor. Everything works, the result is here:
https://drive.google.com/drive/folders/1QAAxu … XPQ?usp=sharing

Cool, thanks.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 404 of 482, by SoftCat

User metadata
Rank Member
Rank
Member
GloriousCow wrote on 2025-05-09, 22:14:

Cool, thanks.

Thank you.
In fact, everything is much more interesting. On EGA video cards, in addition to the main 16.257 MHz quartz, there are several more quartz crystals. For example, on this video card there are two more quartz crystals: 25.000 MHz and 27.256 MHz. And each of them can set the pixel frequency in both 200-line and 350-line modes. But I don’t know how to use these additional quartz crystals. I only know how to switch 14.318 MHz (from the system bus) and 16.257 MHz.

Reply 405 of 482, by GloriousCow

User metadata
Rank Member
Rank
Member
SoftCat wrote on 2025-05-11, 22:37:

Thank you.
In fact, everything is much more interesting. On EGA video cards, in addition to the main 16.257 MHz quartz, there are several more quartz crystals. For example, on this video card there are two more quartz crystals: 25.000 MHz and 27.256 MHz. And each of them can set the pixel frequency in both 200-line and 350-line modes. But I don’t know how to use these additional quartz crystals. I only know how to switch 14.318 MHz (from the system bus) and 16.257 MHz.

Only the 14 and 16.257Mhz clocks are standard. You may have other crystals on a SuperEGA card, but they're not guaranteed to be there.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 407 of 482, by SoftCat

User metadata
Rank Member
Rank
Member
GloriousCow wrote on 2025-05-11, 22:57:

Only the 14 and 16.257Mhz clocks are standard. You may have other crystals on a SuperEGA card, but they're not guaranteed to be there.

Yes, I agree.
By the way, there were also CGA video cards that worked with TVs and monitors with PAL/SECAM frequencies. That is, with a line scan frequency of 15625 Hz and a frame scan frequency of 50 Hz. To maintain pixel proportions, their pixel frequency was 16.000 MHz.

Reply 408 of 482, by digger

User metadata
Rank Oldbie
Rank
Oldbie
SoftCat wrote on 2025-05-12, 14:08:
GloriousCow wrote on 2025-05-11, 22:57:

Only the 14 and 16.257Mhz clocks are standard. You may have other crystals on a SuperEGA card, but they're not guaranteed to be there.

Yes, I agree.
By the way, there were also CGA video cards that worked with TVs and monitors with PAL/SECAM frequencies. That is, with a line scan frequency of 15625 Hz and a frame scan frequency of 50 Hz. To maintain pixel proportions, their pixel frequency was 16.000 MHz.

I keep learning something new every day. Thanks for sharing. 🙂

Reply 409 of 482, by jal

User metadata
Rank Oldbie
Rank
Oldbie
SoftCat wrote on 2025-05-09, 21:54:

I found a guy who tested 768x200 mode on a real EGA card with a real EGA monitor.

I wouldn't call that a "real" EGA card. It has a PEGA2 chipset, which is the Paradise Autoswitch EGA 480. It is capable of displaying 640x480 16 colours (so basically VGA resolution, but with a digital monitor). It als has support for 132-column text, so it's capable of at least a horizontal resolution of 1056 pixels. I'll believe a standard EGA card can do 768x200 if I see it on an orginal IBM EGA card with a 5154 monitor attached.

JAL

Reply 410 of 482, by SoftCat

User metadata
Rank Member
Rank
Member
jal wrote on 2025-05-14, 08:24:

I wouldn't call that a "real" EGA card. It has a PEGA2 chipset, which is the Paradise Autoswitch EGA 480. It is capable of displaying 640x480 16 colours (so basically VGA resolution, but with a digital monitor). It als has support for 132-column text, so it's capable of at least a horizontal resolution of 1056 pixels. I'll believe a standard EGA card can do 768x200 if I see it on an orginal IBM EGA card with a 5154 monitor attached.

JAL

Earlier I tested the 768x200 mode on several EGA cards (about 10 of them, all different) with a scandoubler and an LCD monitor. Everything worked fine. In this mode, the standard EGA quartz at 16.257 MHz is used and no Super EGA capabilities are used. The only question that arose was about the EGA monitor. So I found a person with such a monitor and some with a PEGA2 video card.

Reply 411 of 482, by keenmaster486

User metadata
Rank l33t
Rank
l33t

Do you guys want me to settle this question? I have a real EGA card and a 5154. I can run whatever test you’re using to get this odd mode and see if it works there. Otherwise there’s no telling whether it’s because of some unknown capability of these clone EGA cards or these possibly multisync clone EGA monitors.

World's foremost 486 enjoyer.

Reply 412 of 482, by SoftCat

User metadata
Rank Member
Rank
Member
keenmaster486 wrote on 2025-05-14, 14:10:

Do you guys want me to settle this question? I have a real EGA card and a 5154. I can run whatever test you’re using to get this odd mode and see if it works there. Otherwise there’s no telling whether it’s because of some unknown capability of these clone EGA cards or these possibly multisync clone EGA monitors.

Yes, of course, I will be grateful to you. You can connect both the 5154 monitor and the 5153 monitor (if you have one) to the EGA video card.

Reply 413 of 482, by jk3one

User metadata
Rank Newbie
Rank
Newbie

Congratulations to GloriousCow for MartyPC v0.4.0! This is really nice. Working with td0 images is interesting.

Reply 414 of 482, by GloriousCow

User metadata
Rank Member
Rank
Member
jk3one wrote on 2025-05-14, 17:21:

Congratulations to GloriousCow for MartyPC v0.4.0! This is really nice. Working with td0 images is interesting.

Thanks! Let me know if you run into anything that doesn't work that you think should. It's a staggering amount of work trying to test all these different image formats.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 415 of 482, by GloriousCow

User metadata
Rank Member
Rank
Member

I've implemented support for the V20's 8080 mode.

Here's the CP/M-80 version of Zork I running in the 22nice CP/M emulator using PROCESSOR=V20.

The attachment 8080_zork.png is no longer available

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 416 of 482, by jal

User metadata
Rank Oldbie
Rank
Oldbie

The disassembly shows 8086 registers, instead of 8080 ones. Is that intentional?

Reply 417 of 482, by GloriousCow

User metadata
Rank Member
Rank
Member
jal wrote on 2025-05-19, 07:33:

The disassembly shows 8086 registers, instead of 8080 ones. Is that intentional?

Well, the V20 doesn't have a unique set of 8080 registers - they are mapped to the existing 8086 register set.

The attachment emulation_registers.png is no longer available

The CPU status window isn't going to switch to 8080 register names in emulation mode. So it's sort of a matter of deciding what is more confusing to look at.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 418 of 482, by reenigne

User metadata
Rank Oldbie
Rank
Oldbie
GloriousCow wrote on 2025-05-19, 14:24:

Well, the V20 doesn't have a unique set of 8080 registers - they are mapped to the existing 8086 register set.

That's interesting that BX/CX/DX are mapped to HL/BC/DE respectively because those are the same names that Intel's 8086 patent gives to those registers in their microcode snippets. I didn't realise that mapping was an (apparently canonical) 8086/8080 mapping.

Reply 419 of 482, by SoftCat

User metadata
Rank Member
Rank
Member

Can someone explain to me how the line "See ya!" is stretched horizontally in AREA 5150? How do the CRTC register values ​​change?