The C programming language has had one feature for a very long time, which almost nobody uses: bitfields. However they seem to be a great idea for modelling hardware I/O registers. Instead of clunky bitwise manipulations, you can simply address individual bits with names. But what are the downsides, and how can you use it for MS DOS hardware programming?
Tag: retrocomputing
The C64 goes Internet!
Using a very cheap ESP8266 controller and a simple PCB, we can lift the C64 into the modern era of having internet access. We evaluate two different WiFi modem firmware solutions, and I will show you how to connect to a BBS with gateways to modern websites. You can now read the news, look up things on Wikipedia, and most importantly: download software for your C64!
Let’s Code MS DOS 0x39: Samples on the PC Speaker
The PC speaker is known for loud, harsh beeping noises. However with a little bit of trickery we can coerce it into producing almost arbitrary sounds. By manipulating it with the built in time chip, we can simulate a pulse width modulation, that allows us to play pulse code modulated digitized sounds, such as voice recordings.
Let’s Code MS DOS 0x38: Huge Pointers in Turbo C
In MS DOS you can only access up to one Megabyte of memory easily, on an original PC or XT. This memory in turn is segmented, so accessing more than 64K at a time becomes a bit more tricky. This is why languages like Turbo C and Pascal introduced near and far pointers to the programmer. However there are also huge pointers, which we will investigate in this episode.
FPGATED for C16 and Plus/4
The Commodore 264 line of computers included the C116, C16 and Plus/4. They were build around the TED video and I/O chip. Also known as the MOS 7360 and MOS 8360, the early revisions of the chip were plagued with production issues. Many of the early R1 chips are broken by now. Replacements are hard to come by and often expensive. Now there is a modern replacement: The FPGATED by Istvan Hegedus promises high compatibility, together with additional features. HDMI output for modern screens, as well as ROM replacements and SID emulation in future firmware updates. Let’s test it and see how compatible it is!
Commodore 4040 Disk Drive Refurb
Another Commodore 4040 dual floppy disk drive ended up in my hands, but only temporarily for repairs and refurbishing. This drive didn’t boot up in the beginning and had other small issues. I will show in great detail how to take these things apart and how to clean them and get them up to speed again.
TND232 Tandy Serial Port Soundcard
The Tandy 1000 and IBM PC Jr utilized the cheap Texas Instriuments SN76489 programmable sound generator. While it never caught on as a sound standard outside of these machines, many DOS games from the 1980s still supported this chip. What if you wanted to listen to video game music using the original chip, no emulation, but you had only a serial or USB port? Well, now there is a solution for you!
Floppy Disk Punch
Back in the 1980s floppy disks were expensive. And many early floppy disk drives were only single sided, which means they only had one read/write head and would only use one disk side. Both Commodore and Apple-II users quickly figured out that you could flip the disk around, if you punched a hole into the other side of the disk. This is a quick explanation on why this helped to double your disk capacity and some other differences between Commodore and IBM disk drives.
Let’s Code MS DOS 0x36: Sprites & Occlusion
In the last video we learned how to make 2D sprites with transparency and scaling. This time around we also make our Guybrush automatically scale with the background, limit his ability to move into nonsensical parts of the scene, and most important: Walk in front and behind objects.
Source Code: https://codeberg.org/root42/VSPRITES/src/branch/feature/mask-and-scaling
Let’s Code MS DOS 0x35: Sprites & Scaling
Adventure games like Monkey Island utilized sprites that could be moved and scaled arbitrarily on the screen. How does this work on a machine that doesn’t have support hardware sprites? We will work our way from simple sprites with no transparency, to ones that are clipped, have transparency and can be scaled down arbitrarily.