Dan Cogliano
S06:E52

Dan Cogliano

Episode description

Dan Cogliano joins Paul and they discuss Dan’s work with the Z Machine, which allows you to play Zork and other text adventure games.

Follow the show on Mastodon or Bluesky.

Show Notes

00:30 Dan’s start with computers

3:05 The EZ Make Oven

4:53 The Z-Machine

7:59 Challenges in creating the CP Z Machine

9:08 The game of Zork

11:00 CP Z Machine Learn Guide

11:15 Dan’s next game

12:29 Challenges working with graphics

13:37 Where to learn more about Dan

14:27 Which board?

15:13 Wrap-up

Download transcript (.srt)
0:00

(soft music)

0:05

- Welcome to the CircuitPython Show.

0:07

I'm your host, Paul Cutler.

0:09

This episode, I welcome Dan Cogliano.

0:11

Dan is a developer whose interests include

0:13

internet calendar standards, programming,

0:16

retro tech and games, the internet of things,

0:18

ventriloquism, and magic.

0:22

Dan, welcome to the show.

0:24

- Thank you for having me.

0:25

This is my first podcast, so it's a special time for me.

0:29

(laughs)

0:30

- How did you first get started

0:31

with computers and electronics?

0:34

- Well, my first experience with a computer

0:36

was in high school.

0:38

I'm a little bit old, so the programming class

0:42

they had in high school was Fortran.

0:44

This was back in the '70s, and we had one computer

0:49

throughout the whole county

0:50

that would run Fortran programs,

0:52

and it wasn't my school.

0:54

What we'd have to do is we'd have to code our programs

0:58

and send it to the school.

1:00

They'd run the program and then they'd send it back.

1:03

So it was like a three day turnaround.

1:05

In fact, we didn't even have punch cards.

1:07

We didn't even have money for punch card machines.

1:10

So we had holo with cards with bubbles on them.

1:14

So you would code using a Sharpie for Fortran statements

1:18

and that sort of thing.

1:19

So yeah, so it would take literally three days

1:24

to put in a program and get your output back.

1:27

So we had to double, triple check our code

1:31

before we'd send it out,

1:32

'cause we won't see it for three days.

1:34

So that was kind of my first step into programming.

1:39

And then in college, I took some classes.

1:42

I took a Pascal class.

1:44

I took an assembly class,

1:46

which was on the Motorola 6502,

1:49

which is the chip that was used on the early Macintoshes

1:53

and Apple IIs, I believe.

1:56

And so I learned machine assembly language

1:59

with that class, which I thought was really good.

2:03

I had a programmable calculator.

2:04

Those were getting very popular at the time.

2:07

So I had an HP 41 calculator.

2:10

So that was a good learning experience.

2:13

And then after college, I got an Amiga computer

2:17

and I started writing shareware programs on the Amiga.

2:22

So then I got into C and C++.

2:25

And then later I started getting into Arduino.

2:30

And funny story, I didn't get into Arduino

2:33

'cause I didn't know if I wanted to learn another language

2:35

and I realized, oh, that's C.

2:37

(laughs)

2:37

I didn't, it took me like a year, I think,

2:40

before I realized, oh, that Arduino is C and C++.

2:43

So that's kind of like how I got started.

2:47

- How did you discover CircuitPython?

2:51

- Well, CircuitPython, I got into Arduino

2:55

And a lot of the processors that worked with Arduino

3:00

also worked with CircuitPython.

3:02

I dabbled in that and one of my first projects

3:07

was something called the EasyMake Oven,

3:12

which it's a reflow oven.

3:15

And I was looking at reflow ovens at the time

3:18

and we had a lot of Chinese manufacturers

3:23

And we had all these reviews and they were using paper insulation and they were not very

3:31

high quality.

3:31

I thought, "Well, what if I made my own?"

3:33

And I kind of looked around.

3:34

I looked at the Adafruit store and I said, "Hey, they've got all the parts I need except

3:38

for the toaster oven."

3:39

I basically converted a toaster oven into a reflow oven.

3:43

So I took the toaster oven, Pi Portal, which was an Adafruit product that had just come

3:48

out. I had a thermocouple, which is kind of like measures the temperature inside the toaster oven.

3:54

Then there was a switch, basically a, looked like a power strip, but you can program this power

4:00

strip to turn on and off. And I didn't want to do any kind of high voltage wiring. So I thought,

4:05

hey, I can just regulate this by just programmatically turning the toaster oven on and

4:10

off. And I can graph it, you know, the temperature versus time. And I, that's how I came up with the

4:16

the EasyMake oven. So it's actually one of my favorite projects and I still use it.

4:22

I love the name of it. And that was my next question was actually if you were still using it,

4:26

so it's good to hear that it's still around. Yeah, yeah. I mean, and for people who don't

4:31

know what a reflow oven is, it's basically, you know, you could do through-hole soldering, but

4:36

if you want to get into PCBs and smaller components, then that's where you would use a

4:42

a reflow oven. So yeah, I have some things that have some small parts that the reflow

4:48

oven is ideal for making components like that.

4:53

You've created the Z-Machine, which can run classic Zork games. How did that first start

4:58

for you?

4:59

It started out with Arduino. I wrote a, or I ported a Z-Machine to Arduino on an Adafruit

5:08

itsy-bitsy device, which is really like the size of your thumb. And I ported that using Arduino NC.

5:18

And I thought at the time, I'd like to do that in CircuitPython too at some point. But back then,

5:24

the hardware, you basically needed a screen, enough memory. And so what I did was,

5:34

I kind of put that on the side and then when I saw the fruit jam come out, I said, "Oh, this would be perfect for that."

5:42

It's got the keyboard, it's got the screen, it's got memory, enough memory, you can save files to it.

5:51

So it had basically all the parts that I needed for the Z machine.

5:54

So I guess the only question I had was how the performance would be,

5:59

since you've got an interpreted language running an interpreted computer.

6:05

So I thought, well, I want to go with this and see how far I get with it.

6:10

And that's kind of how it came about.

6:12

And I think the performance turned out great.

6:15

I was really impressed with the performance.

6:19

What are some of the features of CPZMachine?

6:20

How does someone get started with it?

6:23

Well, we have, you can run it either standalone or there's something called

6:29

which is a way you can run pre-packaged CircuitPython games and applications.

6:37

So you can run it either way.

6:41

So the performance was one thing I was looking at, and that turned out really nice.

6:46

The save game, there's an issue with CircuitPython where you have one operating system that can read and write,

6:54

and the other operating system can only do read-only.

6:58

So the nice thing about CircuitPython version 10 is that they have a saves or

7:03

cpsaves folder which allows you to have the CircuitPython operating system read

7:11

and write those files in that saves folder while the host computer has

7:18

read and write access so you can copy files and you can copy the CircuitPython

7:22

libraries, you know, the CPZ machine, the game files, so you can do all that and still

7:29

have rewrite access for the save games.

7:34

Save is really important when you're playing Zork and Z machine games, because you can

7:38

die and you lose what you have.

7:43

So that was one nice thing that came out with CircuitPython 10 recently, so that was a big

7:49

help too.

7:50

Yeah, that CP saves partition is pretty neat for creating games now. You're not the first one to take advantage of that.

7:57

Mm-hmm.

7:59

Were there any challenges in creating the CPZ machine?

8:02

Yeah, well, it's an interpreted, almost like assembly language. So I kind of

8:09

resurrected my skills from college days,

8:12

assembly language, and

8:13

basically, there's a bunch of machine codes that you have to emulate and then you have to debug them.

8:19

And so the debugging part is the hard part where you have to step through and say,

8:23

you know, is this what it's supposed to be doing? So that took the most amount of time, was

8:29

writing the machine codes and debugging them. And so what I did was, you know, since ZMachine's

8:36

been around forever, there's other implementations of it. So I took a ZMachine that someone else

8:42

wrote in C, and I put some debug statements so I could follow that version and compare it to the

8:50

version I was writing and see when they diverged and say, "Oh, you know what? Why is my program

8:54

diverging at this point? I'll go back to the reference C machine that I'm working with."

8:59

And I said, "Oh, okay. I forgot something or whatever." So, yeah. So, that was very helpful.

9:08

So, for those that might be a little younger than us, can you take a minute to explain what

9:12

game Zork is?

9:13

>> The Zork came out in the '80s. It was developed by staff and students at MIT. It came off of a, I believe it was a PDP-11

9:26

computer, and they decided to commercialize it. Back in the '80s, you know, the computers were not very powerful, but there was a lot of

9:42

different computers out there, they all ran different software.

9:45

And so they thought, well, we're going to try to write something that will work on all

9:49

these devices.

9:51

And they decided to split the program in two.

9:55

They took one part of it, which was the story, basically the data that had all the text and

10:03

the logic.

10:04

That was one part of it.

10:06

And that part could run on any of the computers that were out there in the day.

10:09

only part they had to write was the machine codes for that particular operating system.

10:18

So that way they were able to maximize their stories and the logic there and just have to

10:25

write what they call the Z machine, which is the program that runs the Zork game.

10:32

And they came out with other games too, not just Zork, but they have Zork 2, Zork 3, and there's

10:38

probably several dozen ZMachine type games that you could run on it.

10:43

And the CPZMachine supports all those games?

10:46

It supports version 3, which was the first version that came out. I'm probably going to look at

10:53

supporting other versions in the future, but I think the majority of them are version 3,

10:56

so you get most of them with that. And I'm also working on a learn guide for the

11:04

CPC machine and Zwork and all that. So hopefully that'll be out by the time this airs.

11:11

Yeah, I'll make sure that if it is, I'll link to it in the show notes as well.

11:15

Tell me about the latest game you've been working on, a Moonlander type game.

11:20

Yeah, so once I finished with the Z-Machine, I thought, well,

11:25

now I think get something a little bit more graphical. Zwork and Z-Machine's all text-based,

11:30

there's no graphics. In fact, the only graphics is I have a blinking cursor. It's a little square

11:36

that I turn on and off. So that was that was the extent of my graphics with the Z machine. But

11:42

I thought I want to try to get a little more fancy. And one of the games I liked when I was

11:45

in college was this lunar lander game where you take the lunar module and you try to land it on

11:51

the moon. And I thought, well, I'm going to make a version of that and see what I can do in Circuit

11:56

Python. So I've been working on that. It's basically a physics-based game where you're

12:02

trying to land without crashing on the moon, and so you have to deal with gravity thrust from the

12:10

rocket angles. And you want to land vertically, you don't want to land on your side, which

12:17

is happening on the moon recently. So I thought, "Yeah, this will be something nice to do." And

12:26

at some point in the near future.

12:29

- What's your experience been working with graphics

12:31

and display IO?

12:32

Has it been a challenge?

12:34

- And CircuitPython, it's great for a lot of things,

12:37

but sometimes, heavy graphics,

12:40

it's particularly real-time graphics, it's hard to do.

12:44

So sometimes I have to change my mind on what I wanna do.

12:49

Like I originally wanted to have a scrolling background

12:52

with my Lunar Lander scrolling,

12:55

looking at the lunar surface.

12:57

And I thought, well, I took a look at trying that.

13:01

And I was using a high resolution,

13:03

which is also what I wanted to do.

13:05

And so higher resolution means, you know,

13:08

you got more bits to work with and it slows things down.

13:11

So the trade-off was, you know,

13:13

either lower resolution and higher,

13:16

you know, scrolling or higher resolution.

13:19

And then, so I kind of do is I just page,

13:21

I go from one page to the next.

13:22

I don't do the scrolling.

13:24

So that was fine.

13:30

I think it works great, and you just

13:33

get a slight delay when you go from one screen to the next.

13:37

If anyone wants to learn more about you and your work,

13:39

where should they go?

13:41

Well, I'm on Blue Sky at Cogliano.

13:45

My last name's C-O-G-L-I-A-N-O. And I

13:49

do have some Learn Guides up there on the Adafruit site,

13:51

so you can check out some other Learn Guides.

13:54

I've got a few other CircuitPython learn guides there.

13:57

I have one where I, related to the EasyMakeOven,

14:02

I use the PyPortal.

14:04

And I didn't, in that case, I did not use the feature

14:07

where you'd be able to get to the internet,

14:09

'cause I didn't need the internet for that.

14:11

But I do have another project where I pull artwork down

14:15

from the Museum of Art in Cleveland.

14:18

So it kind of cycles through images there.

14:24

I'll make sure to link to those in the show notes as well.

14:27

Last question I ask each guest,

14:29

you're starting a new project or prototype,

14:31

which board do you reach for?

14:33

Well, right now it's the Fruit Jam.

14:36

I'm really excited about the Fruit Jam.

14:39

I think there's a lot of potential there,

14:41

and I've seen some of the emulators that have come out.

14:45

There's the Mac emulator,

14:47

which is something I want to try.

14:49

It's not just CircuitPython or Arduino,

14:51

but you know, you have these emulators. So it's got the gamut of options there for you.

14:58

I'll probably be sticking with CircuitPython, but I do want to try some of these emulators.

15:03

Yeah, I agree. There's a new 286 emulator that just came out, and Apple II,

15:06

Sega Genesis. It's just crazy how much support is coming out for the Fruit Jam.

15:13

Dan, thanks so much for coming on the show.

15:15

Oh, I appreciate it. I love being here and I appreciate getting invited. Thank you.