!!Con West 2020 - Wesley Aptekar-Cassels: Plotty Bird: Making Modern Games on Retro Pen Plotters!
Mar 20, 2020 18:51 · 1676 words · 8 minute read
Hey, everybody. So my name is Wesley. I use they/them pronouns, and today I’m going to be talking a little bit about pen plotters and some fun things that I found with pen plotters. You may be asking yourself: What is a pen plotter. And in the ‘80s, before printers really worked well at all – as if they work well today – if you wanted to print an image, what you would do is you would use a little robot that took a pen and it could move the pen in two directions and lift it up and put it down and it could select some other pens. This is how you could make graphics. If you were an engineer and you wanted to have drafting drawings or if you were a business person and you wanted to give presentations on your overhead transparencies, this is how you would do it. So why would you do it? That’s the reason.
01:15 - So of course, successful presentations use graphics. So this is from the HP Color Pro Pen Plotter. One thing I like about this image – you notice on the chart on the right we’re projecting far into the future, of the year 1987. So I bought this pen plotter and went looking for documentation. One thing that I found was the sales guide for this plotter. You can see it advertises itself as quality presentations for business leaders. Very fancy. So I found the instructions for how to sell this plotter. And so I do make presentations. Here I am! I don’t use an overhead projector. But I do want to make better presentations. So two out of three. It’s starting to look like I should buy this plotter.
02:10 - And in the Secrets to Closing, they say I should ask if I have a presentation upcoming in the next few weeks. Here I am. And finally my favorite is: You only pay for quality once. So who knows – could be using this plotter in the year 2020… So now that I bought this plotter, how do I actually use it? Luckily, the manual has some more instructions. They have this handy little chart. So you take a software package on a floppy disc, or a piece of paper with a graphics program on it, you stick that into your computer, and then out the squiggly little cable – I think this bend in the cable is very important.
02:54 - It goes into the plotter, and pictures come out. So what do these HP-GL instructions actually look like? So here is a very simple program that we’ll walk through. So first we initialize the plotter. That’s what the IN is. And select the first pen. Then we’ll move the pen to location 1000,1000, we’ll put the pen down, move it around more, draw a little square, and finally pick the pen up so it doesn’t bleed all over the paper. This is great. We’ve off drawn a square all over the place. Everything is good. But there’s actually a problem. So I go back and I look at the manual again.
03:36 - We can see I have the HP ColorPro on the right there. The buffer size is 60 bytes. So if you look at this program, this program is 86 bytes long. So these last 26 bytes are not having a good time. Not making it to the plotter. So that’s a problem. You know, I go back to the salesperson. I say… Hey, I can’t even draw a square! What am I supposed to do with this plotter? But he tells me: Don’t worry about it! I have the perfect solution for you. All you have to do is just buy the Hewlett-Packard graphics expansion cartridge.
04:11 - This will snap into the bottom of your plotter. It will give you a luxurious 1024 bytes. What more could you need? You could draw ten squares that way! It’s perfect. It turns out that the graphics extension cartridge is a little bit hard to come by these days. So I need to go and find a different solution. So what I did was I said… Well, we have all of these commands. And after each command, I can say: OA. And what OA does is it tells the plotter: Output the current position of the pen, and just let me read it back.
04:44 - So now what I can do is I can send the first command and I can wait until I see a response, and that will tell me that the plotter has finished taking the command and I can send the next one. I’ll send each in a row. I will be able to plot all sorts of pretty pictures. We figured out a solution. I don’t need to buy the graphics expansion cartridge. I can do it all on our own. So now we’re in business. We’re making all sorts of pretty pictures. Plotting all kinds of nice things. And most importantly, making some very serious presentations. You know, all sorts of serious stuff. So this is… I was showing my friends all of this. And they asked me…
05:32 - Oh, this is cool! Could you hook up a mouse to it? So can you take a mouse, and then use a computer mouse to draw on the plotter? And I thought about this for a moment. I was like… That shouldn’t be too hard. So I spent about an hour. I went in and typed up the code. And we had great fun playing around with this. And then of course, this opens up the possibility for all sorts of interesting plotter games. So the first idea that I had was: I’ll have the plotter generate a maze for you, and it’ll just draw out a maze and you can go in with the mouse, go through the maze, and solve it. So this was a little prototype of that. It turns out that just going through a maze isn’t that much fun. I don’t know.
06:13 - I mean, I guess when you’re a kid and you need something to do – but it didn’t really cut it for me. So what I decided to do instead was… Make Flappy Bird on the pen plotter. So what this will do is go and draw out a level with randomized pipes and everything like that. And then… Once it’s finished drawing out this level, you can go and play Flappy Bird on your vintage pen plotter. So it draws a little explosion when you don’t make it. And then when you finally do, it draws a little birdy for you. Just as a… So…
07:11 - Oh, this is a different one that we won’t play. So that was lots of fun. But there’s one problem. Which is: If you’ve played Flappy Bird, you know it goes on forever. Right? But my plotter is only 8.5x11. Which is not really a fun Flappy Bird size. So what can we do about this? Well, it turns out that if you try to draw past 11 inches, the plotter just won’t let you do that. So I was thinking about trying to solve this problem and the thing I can think of was…
07:42 - I can just take apart the plotter and go in and fix it myself. So luckily, the plotter actually comes with super nice documentation. So, for instance, they have all these beautiful line drawings and exploded diagrams. They also have circuit diagrams for the entire thing. This is the whole logic board of the plotter. So you can take it apart and know what every piece is. And so the ROM is on here. This is the little chip that holds all of the code that decides that you can’t draw past 11 inches. This is an 8051 system, which is pretty nice little architecture. So I can take apart my plotter, hook up my logic analyzer to it. It turns out that doing this with the logic analyzer is a pain in the ass.
08:27 - So what you can do instead is just desolder the chip, and then dump the ROM, and you have a bunch of Assembly. You have 16 kilobytes of this stuff. And so at this point, I ran out of time to reverse engineer this. So if you are interested in 8051 Assembly and vintage hardware and are enterprising, I have the ROM up on GitHub, and I am looking forward to diving into it more. This is about how far I got. And I just wanted to – before I leave – talk a little bit about sort of why I did this. And why I think this is interesting. Basically, when I was programming just for fun, and not as a job, I really enjoyed it.
09:15 - And then programming became my profession. And I was writing code at work. To make a bunch of executives richer and pay my rent. And that just wasn’t that fun. And then that sucked a lot of the joy out of programming in my personal life. And the way that I finally got back into it was just making art, and making things that are stupid, and pointless, and that make people smile. And this project has been really great for bringing a little bit of joy into people’s lives. And surprise.
09:46 - And finally, if you would like to play Plotty Bird, I’m going to be giving a demo of it in the break after this block of sections. Down there. I have the plotter here. And then one more note is: I came here from New York City. And I do not want to bring this plotter back. So if you would like me to practice my sales pitch that I have learned expertly from this manual, please do come talk to me after the talk. Thank you! .