Live data from Hacker News

Donkey.bas is 45 Years Old – 131 line of Glory

donkeybas.com

141–150 of 153 posts

Re: Donkey.bas is 45 Years Old – 131 line of Glory

#142
post #23

I once heard the rumor that DONKEY.BAS was the last piece of code Bill Gates wrote himself at Microsoft. I wonder if it's true.

That has all the hall marks of urban legend, but why let the truth get in the way of a great story. I have said it for a very long time, Gates wasn't innovative in technology but he absolutely innovated in bringing the most ruthless business practices into software.

Feel free to correct the Wikipedia entry (which does not say anything about it being his last contribution though): https://en.wikipedia.org/wiki/DONKEY.BAS

And you may also want to correct this one about the Pancake Sorting algorithm he invented as a student that was not improved for another 30 years: https://en.wikipedia.org/wiki/Pancake_sorting#The_original_p...

Re: Donkey.bas is 45 Years Old – 131 line of Glory

#143

Earlier quoted context omitted.

Amazing. This is nostalgia heroin for me. How far does the HAL go? Screen 12 and 13, and writing directly to VRAM? WAIT for vsync? Call absolute for mouse usage?

Thanks! I went so far with it that I was honestly questioning my own sanity. The HAL has a virtualized CPU, and I spent more time than I’d care to admit precisely timing instructions on various period-accurate hardware (386SX, 486DX). I even tuned it to the point where programs that take advantage of it actually run faster on the 486 because of the built‑in math coprocessor. > Writing directly to VRAM? WAIT for vsync…

Wow, I didn’t expect this kind of reply at all. What a labor of love. Can’t wait to try it out! What made you decide to emulate things at this level instead of using a more off the shelf hardware stack?

Re: Donkey.bas is 45 Years Old – 131 line of Glory

#145
post #85
post #7

Nice job. The sound effects are a bit too advanced because early IBM computers shipped with pretty simple, magnetically driven dynamic speakers. On a related note, I’ve actually spent the last four months working on a 100% faithful adaptation of both QBasic and QuickBasic 4.5 that runs entirely in the browser on a virtual CPU and hardware abstraction layer. It’s a love letter to everyone who learned to program on Mic…

You used to be able to do surprising things with those old speakers using a timer interrupt: on an IBM XT it was possible to get 8kHz quality out of it, enough to make 4-channel MOD playback sound about as good as hearing it over a phone. But your more typical use case was to play a single tone for some significant fraction of a second.

[dead]

Re: Donkey.bas is 45 Years Old – 131 line of Glory

#146
post #23

I once heard the rumor that DONKEY.BAS was the last piece of code Bill Gates wrote himself at Microsoft. I wonder if it's true.

That has all the hall marks of urban legend, but why let the truth get in the way of a great story. I have said it for a very long time, Gates wasn't innovative in technology but he absolutely innovated in bringing the most ruthless business practices into software.

It really sounds like an urban legend, but apparently, Bill Gates admits it here himself. Not sure if it was the last piece of code he wrote though: https://web.archive.org/web/20120213015238/http://www.micros...

Re: Donkey.bas is 45 Years Old – 131 line of Glory

#147

Earlier quoted context omitted.

Thanks! I went so far with it that I was honestly questioning my own sanity. The HAL has a virtualized CPU, and I spent more time than I’d care to admit precisely timing instructions on various period-accurate hardware (386SX, 486DX). I even tuned it to the point where programs that take advantage of it actually run faster on the 486 because of the built‑in math coprocessor. > Writing directly to VRAM? WAIT for vsync…

Wow, I didn’t expect this kind of reply at all. What a labor of love. Can’t wait to try it out! What made you decide to emulate things at this level instead of using a more off the shelf hardware stack?

So I wanted to build more than just a simple online QuickBasic simulator - I've seen a few of them but they all kind of fall apart at the last mile.

You really can't create a QuickBasic interpreter with any expectation of accuracy unless you also flesh out the corresponding hardware that would have accompanied it back in the day.

What I’m really aiming for is to recreate the world we grew up with as kids in the late ’80s and ’90s. I want to tap into that feeling of discovering QuickBASIC on a computer for the first time and realizing you could bring your own creations to life.

For me, and I bet a lot of kids back then, QuickBASIC was the closest thing to sorcery: you could conjure whatever was in your imagination and watch it traced out pixel by pixel on your 14-inch VGA monitor.

Re: Donkey.bas is 45 Years Old – 131 line of Glory

#148
post #29
post #10

It says something about what a thoughtful development environment these early BASICs were, that you could make a full simple little game like this in only 131 lines even though they're ostensibly far less powerful than modern languages. I'm not sure if you could even get an SDL window open and game loop running in 131 lines of (non-golfed) C. Never mind how compact, beginner-friendly, and just plain fun they were to…

It was really cool! The ease of getting started was definitely one of the selling points for the “home computers” of that era (GW-BASIC ran on IBM compatible PCs instead, but the appeal of BASIC was the same). Brevity was an important feature since a lot of people obtained programs by typing them over from a magazine or recording them from the radio. And of course, there was no such thing as auto-complete (let alone…

SDL is incredibly terrible based on that example - I imagine it would be about five lines of qbasic?

Re: Donkey.bas is 45 Years Old – 131 line of Glory

#149
post #29

Earlier quoted context omitted.

It was really cool! The ease of getting started was definitely one of the selling points for the “home computers” of that era (GW-BASIC ran on IBM compatible PCs instead, but the appeal of BASIC was the same). Brevity was an important feature since a lot of people obtained programs by typing them over from a magazine or recording them from the radio. And of course, there was no such thing as auto-complete (let alone…

SDL is incredibly terrible based on that example - I imagine it would be about five lines of qbasic?

Yeah for the rendering a smooth set of RGB shifting colors using SIN you could do it in a few lines of QBASIC.

The only thing is that since the SDL example uses a 640x480 resolution, which corresponds to SCREEN 12, and in QBASIC it only gives you access to 16 indexed colors at once.

So you have to "cheat" by redefining a single entry (like index 1) throughout the loop with calculated RGB using the PALETTE command. It's basically the equivalent of palette color cycling used in some older games.

Re: Donkey.bas is 45 Years Old – 131 line of Glory

#150
post #135
post #7

Nice job. The sound effects are a bit too advanced because early IBM computers shipped with pretty simple, magnetically driven dynamic speakers. On a related note, I’ve actually spent the last four months working on a 100% faithful adaptation of both QBasic and QuickBasic 4.5 that runs entirely in the browser on a virtual CPU and hardware abstraction layer. It’s a love letter to everyone who learned to program on Mic…

> early IBM computers shipped with pretty simple, magnetically driven dynamic speakers Yes the PC & donkey.bas were monophonic design, but the PCjr shipped with 3-channel polyphonic sound plus a noise generator. It might have been capable of doing the sounds in this port of donkey that took “some liberties”. ;) I remember some sound demos on the PC that emulated polyphonic sound by fast/audible switching between note…

> ... fast/audible switching between notes in a chord ...

https://en.wikipedia.org/wiki/Arpeggio

Many of my favorite chiptunes use this technique.

Post reply on HN