Oldskooler Ramblings

the unlikely child born of the home computer wars

Archive for the ‘Demoscene’ Category

My experience is killing me

Posted by Trixter on February 2, 2008

I taught myself Pascal in high school. I was not admitted to the AP course my high school was offering due to my overall GPA, so I taught myself to 1. spite the arrogant jerk of a teacher who denied me, and 2. follow along with the course so I could spend time with my friends. I had been taught other languages (LOGO when I was 12, and BASIC when I was 13) so I wasn’t a stranger to programming. What I was a stranger to, however, was discipline.

My early code, which includes my early demo coding, is sloppy. Oh, the code is nice to look at and doesn’t contain spelling errors, but it is incredibly sloppy. Instead of using REP MOVSW to copy memory around, or even Turbo Pascal’s move() procedure, I would copy one array to another byte by byte. Instead of sorting an array by inserting an array set into a sorted binary tree and then copying it back to the array (heapsort), I would loop through the array and swap crap as necessary (bubblesort). Instead of learning how to use pointers, I would try to trick the compiler into giving me multiple data segments (which had the side effect of bloating the executable). Essentially, I lacked experience, insight, and wisdom — and my programs were buggy and slow as a result.

Today, nearly 20 years later, that is not the case. I still program in Turbo Pascal, but I use pointers/heap, objects, inheritance, and especially in-line assembler in places that need it. I understand proper data structures a lot better now (still struggling with tries, but I’ll get it eventually).  I write my code as if I am delivering it to someone else to maintain.  I can’t say that I am ashamed of anything I’ve written past 1997.

I mention all this because the PC Speaker tracker, something that most people bang out in a day, has taken over two weeks and I haven’t written more than 50 lines of code.   What I have done, however, is:

  • Spent 3 hours writing up various design and structure ideas in a notes file
  • Spent 2 hours last night laying in bed trying to visualize object-oriented tracker design while preventing playback performance from turning to shit (answer: a Song object that controls entering and retrieving note/effect data into the song, and a Player object that retrieves song data one row at a time… still thinking about this one, since a single object makes more sense, but would be harder to virtualize playback methods for other output devices)
  • Spent an hour researching the frequency and amplitude characteristics of Vibrato (not just the human voice, but woodwinds and stringed instruments) so I could be sure to make the best use of the effect bits I have available (answer: most pleasing vibrato has a frequency within 4 to 7Hz and amplitude of about 10 cents)
  • Spent an hour revisiting various tracker formats, looking for ideas on how to pack notes+volume+effects into two bytes (answer: 7 bits for note, 3 bits for effect, 3 for effect 1st parm, 3 for effect 2nd parm)

…but no code.  Yet.

I believe it was the demogroup Silents who proclaimed, “If you can’t do it better, why do it at all?”  That is simultaneously democoding’s greatest motto, motivator, and curse.

Posted in Demoscene, Programming | 5 Comments »

Back to the Future

Posted by Trixter on January 25, 2008

I couldn’t save my old XT keyboard (enter key died, and that’s pretty much the #1 most important key on the damn thing) so it has been tossed into the spare parts bin. My remaining keyboard, however, survived my pokings and I have a functional XT keyboard again. My last, but beggars can’t be choosers.

Thanks to a functional keyboard, I started working on MONOTONE again, starting with the interface (the design docs are done — yes, design docs — hey, stop laughing!) except that I was immediately sidelined by my custom keyboard handler.

A keyboard handler, for the uninitiated, is a little routine that “replaces” the “hold-key-down-and-watch-it-repeat-after-a-short-delay” behavior with “hold-key-down-and-it-stays-down-without-beeping-incessantly” behavior. This is good behavior, if you want to make your keyboard act like a piano. But my trusted old handler code locked up the machine after the first keypress.

Here is the code in question, which I had been using since 1994:

Procedure New9handler; Interrupt;
Var
  b: Byte;
Begin
  port [$20] := $20; {send end-of-interrupt to PIC}
  b := port [$60];   {read scancode from keyboard}
  If b < 128
    Then kbd [b] := True
    Else kbd [b And 127] := False;
End;

On keyboard interrupt, grab a friggin’ character and stuff it in a bitmask array. Easy as pie. Yet the XT locked up, so I am clearly doing something that the XT is allergic to (or, more likely, forgetting to do something). So now I get to research early XT keyboards/signals and try to figure out what I’m doing wrong. Luckily, I have a lot of programming books to consult; here are the ones I’m going to take to bed:

  • Compute’s Mapping the IBM PC and PCjr by Russ Davies
  • The Undocumented PC by Frank Van Gilluwe (founder of V Communications — thanks for Sourcer, Frank!)
  • Sam’s IBM PCjr Assembler Language by David C. Willen (why a PCjr-only book? Because eventually monotone will support PCjr — ssh, keep it a secret!)
  • Compute’s Beginner’s Guide to Machine Language on the IBM PC and PCjr by Christopher D. Metcalf and Marc. B. Sugiyama
  • Assembly Language Primer for the IBM PC & XT by Robert Lafore

Overkill, but I want to check them all so that I can get all the info on handling a keyboard interrupt and then pick out what I need.

I know all this seems stupid and unnecessary, and makes me seem like a freak, but honestly it is the reason over the years I have gravitated towards older and slower platforms to code for fun on. It’s the same reason people still code demos on the Commodore 64 and other legacy platforms: They are fixed in nature, which means you can truly discover the absolute fastest way to accomplish a particular task on them. It’s impossible to do this on a modern winbox, because winboxen are moving targets. It also explains perfectly why modern demos have evolved in the last decade the way they have, but that’s a topic for another day.

PS: The last book by Robert Lafore is the best book you can read to learn assembler on an IBM PC. It teaches you the basics by making you assemble, by hand, in DEBUG. It sounds incredibly scary and hardcore, but it’s actually very fun!

Posted in Demoscene, Programming, Vintage Computing | 6 Comments »

Sweating the small stuff

Posted by Trixter on January 13, 2008

I formally committed to a talk at Block Party 2008 and informally committed to a wild compo entry.  The former I must deliver on; the latter I want to deliver on.  I’m just so high-strung about both that I’m not so sure about the latter.

My idea for a wild compo entry was an old-school style megademo for a stock IBM PC with CGA.  (To date, there has been only one, by Sourcerers, back in 1989.)  By “stock”, I mean no hard drive, no sound blaster… just a floppy drive and the PC speaker.  But nothing is as simple as it sounds, and so I find myself in the following thought process:

  1. A megademo will need sound, or else it will not impress.
  2. The sound engine must not impact the onscreen full-framerate effects, and must use the PC speaker.
  3. The only type of sound engine that could do such a thing is a simple arpeggiator.
  4. There are no trackers that can write or play such music, especially using 60Hz as a timebase (most MOD-style trackers use 50Hz).
  5. I will have to create such a playback engine, and hope I can optimize it to work in a handful of scanlines.
  6. I must write a tracker to create the data that will be used to test such an engine.

So tonight I found myself writing a PC Speaker tracker.  I’m calling it “BeeperTracker” so that the initials can be “bt” to deliberately avoid being called “st” because that would be sacrilegious. Tonight’s accomplishment? Spending 2 hours writing docs (planning) and 1 hour populating a frequency table with the twelfth root of 2.

I’m so screwed.

Posted in Demoscene | 2 Comments »

My love/hate relationship with the demoscene

Posted by Trixter on September 1, 2007

I haven’t watched many modern demos in the last 10 years; I usually watch maybe 1 or 2 a year.  My demoscene friends are always shocked when I tell them that, given my past involvement with all things sceneish.  In fact, they’re always shocked, no matter how many times it comes up.  I’m going to try to explain why, briefly, and then hopefully either I will change, or it will never come up again.

In a nutshell, I feel shame and self-loathing when I watch modern Windows demos.   Before that completely confuses you, I’ll hurriedly explain that I always regretted not having the time, skill, intelligence (my math has always been poor), and inclination to create Windows demos.  So when I watch one, I am reminded of how I have failed at that particular aspiration.  I have succeeded at others, but watching a 64K from Fairlight or Farbrausch just gets me depressed.  Yes, I’m screwed up.  The better and more impressive the demo/intro/4k is, the worse I feel.  I know it’s not rational.

So now you know.  This also conveniently explains why I have actually gone backwards in my democoding (I started out on 386+SB+VGA and my latest efforts are geared toward an 8088+PC speaker+CGA) instead of most people, who go forwards.  For example, I’m writing a small utility as a favor to a friend, but it needs to support long filenames in Windows XP and memory over 640K.  Regardless, I’m writing it in DOS, on the XT, because I feel safe and comfortable doing so.  Once it runs within the restrictions of DOS, I’m going to port the code over to WinXP and compile it with a WinXP compiler.

Related topic change: We’ve started talking about MindCandy volume 3.

Posted in Demoscene, Programming | 5 Comments »

8088 Videos

Posted by Trixter on June 25, 2007

Just a quick note that I’ve rewritten the 8088 Corruption page substantially, posted a new video player, and posted all of the sample videos in my talk along with a few extra ones.

I appreciate all of the nice comments I’ve gotten regarding my lack of motivation (ie. possible depression); again, thanks.  I’m battling it now with a mixture of work, playing Worms with the kids, trying to speed up 8088flex even more, and a mystery fourth ingredient.  What could it be?  Why, it’s mysterious!  When I finish ingesting the fourth ingredient, I’ll post about it here.  It’s… immersing.

Posted in Demoscene, Programming, Vintage Computing | 11 Comments »

8088 Corruption Explained

Posted by Trixter on May 13, 2007

I had hoped to completely update the 8088 Corruption webpages before posting this, but it’s going to be at least another week and people have been asking me for it, so: An edited video of my NOTACON/Block Party 8088 Corruption Explained talk is available at archive.org. All of the embarrassing and missing parts have been fixed, added, edited, massaged, spindled, and mutilated, and it should be completely watchable. I replaced most of the bad video-camera-aimed-at-the-monitor footage with the actual conversion footage, filled in the hey-where’d-my-electricity-go? missing section with a voiceover, replaced all filmed slides with the actual slides, and took out two embarrassing swears (embarrassing not because they were swear words, but because I was nervous and stumbled over them).

While it is tempting to watch the flash version in a browser, I went through a great deal of trouble to make the MPEG-2 version perfect, including true 60Hz video in places. If you can spare the time, grab the MPEG-2 version and watch it on a real set-top dvd player for full effect. (Or a software player that isn’t broken; for example, use my favorite MPEG-2 player, VLC, with Deinterlace set to Linear.)

Work and home have been particularly busy this week and will be next week, so I apologize in advance for not having the extra movies, updated 8088 player, full source code, etc. available on the website yet. When I do, I’ll make a note of it in this blog.

Posted in Demoscene, Programming, Technology, Vintage Computing | 6 Comments »

Block Party: A quick encapsulation of the NA scene

Posted by Trixter on May 3, 2007

For the funniest and most honest party report I’ve read in half a decade, go here:

http://www.pouet.net/topic.php?which=3868&page=4&x=36&y=2

…then search for the text “Pil05 was pil04 without the good parts”. Read Guybrush’s party report. Laugh until fluid comes out of your nostrils.

And it’s completely true! It’s not cool to slam party organizers, but man, what a relief that most of us who where there felt the same way (both the good (Block Party) and the bad (Pilgrimage ’05 and “’06”)).

Also, scroll down to check out some of the picture links.

Posted in Demoscene | Leave a Comment »

Block Party: Transportation

Posted by Trixter on May 1, 2007

I drove from Chicagoland to Cleveland, OH for Block Party. Necros flew. We both arrived at the same time because of the weather. So which was cheaper?

A plane ticket, priced via priceline 2 months in advance, is about $133. My costs were $129 in gas + oil change before heading out. So I win, right?

Wrong. On the way home, I locked my keys in the car at a rest stop. Cost to have the car jimmied open? $45.

Yeah, I’ll be flying next time.

Posted in Demoscene, Uncategorized | 11 Comments »

Block Party: Hops!

Posted by Trixter on April 30, 2007

So here’s the deal with the Hops! inside joke.

As Phoenix reported, Necros, Phoenix, The Finn, and Inspired Chaos drank beer and chilled for a few hours, after which it seemed like a good idea at the time to create a beertro. They came back to the Block Party lounge and started to work on it. The high point of this was Inspired Chaos screaming “Water! Yeast! Sugar! Hops!” into a microphone as samples for the tune. All standard practice, I’m sure, except that at one point he wasn’t happy with his rendition of “Hops!” and decided to record multiple renditions of it. After 30 seconds of “Hops. Hops! Hops? Hops!! HOPS!!” etc. the entire room started to crack up, and it cracked up again when Necros started adding reverb/echo to it (“HOPS Hops hops…”).

They didn’t finish, but Necros made the mistake of giving the unfinished tune to Phoenix, who made it presentable and submitted it to the music compo where it amazingly didn’t come in last place :)

Posted in Demoscene | 7 Comments »

Block Party: Phoenix’s Report

Posted by Trixter on April 30, 2007

Just a quick post to direct you to Phoenix’s party report.

I agree with most of what Phoenix writes. I disagree with the part about 3 minute song length; if we extended it to four minutes, then we’d have to do jury pre-selection to toss stuff out to limit the length of the compo, and that has its own set of pros and cons.

I wholeheartedly agree with $15 per speaker DVD… $10 is a little more reasonable. Since mine in particular is nearly complete garbage because of the power loss and poor recording, I feel mine shouldn’t have been sold at all. (Yes, I’m still working on editing together a watchable version of mine.)

Posted in Demoscene | Leave a Comment »