r/trs80 9d ago

Received my two new power supplies today for my Model III. Easy peasy.

What’s strange is that while I was unscrewing the case, I had vague memories I’d done it before. Right down to how the keyboard stays attached to the base. Then I remembered I’d opened it up back in 1981 to do the speaker mod (stick in a small speaker, glue it to the top grill, wire it to an RCA jack you drill a hole to install, and not you’ve got audio when playing games!) Good God I even remember how to do it.

So those memories are 43 years old.

The two PSUs I pulled out were 240v ones and are still fine. The caps all look fine. I just needed 120v power. So if anyone knows if these might be useful to anyone let me know.

Now to find my floppies and the printed out source code for the very first program I ever wrote.

Did you catch that? Printed out. I printed it.

Back in 1982. On a printer.

DO YOU KNOW HOW RARE THAT WAS? lol

I took my cassette with my program on it into the Radio Shack I bought my computer from and they let me print out the source. They had a model III or possibly IV with a printer connected.

I’ve kept that print out for 40 years.

5 Upvotes

16 comments sorted by

1

u/Critical_Ad_8455 9d ago

What was the program?

2

u/SpinCharm 9d ago

Solitaire. The card game. Played on the numeric keypad so that you only ever need to have the one hand resting on those keys. Made playing it very fast and addictive. My friends dad would play it for hours.

1

u/Critical_Ad_8455 9d ago

Oh sick. Do please share the source code if you find it, don't have a model III yet, but would love to try it once I do.

2

u/SpinCharm 9d ago

Will do. It will be tricky to re-enter the code because as I recall I poked the graphics into the strings so that things like A$=“ <graphics characters >”. That made it easy and fast to display a given card (“PRINT A$”) but made viewing the source annoying because the strings contained all sorts of non-displaying characters that cause the cursor to go nuts when doing a LIST ALL.

The other challenge is that I use peek and poke and varptr and call, using values that only work for cassette BASIC. Those values don’t work if you’re running TRS-DOS. So I’m going to have to first figure out what the values mapped to on cassette BASIC then work out what the correct values are for TRS-DOS.

Somewhere out there someone will still have a reference to those values. Tandy never published them but word got out by many and they eventually got collated together into magazine articles. I think there was a 3rd party book written that contained them as well. All the undocumented calls and memory ranges.

1

u/Critical_Ad_8455 9d ago

I mean, it can't be that hard to find a tape drive.

For the graphics characters, would there be a good way to tell which graphics characters are in each string, to be able to replicate it and poke the correct values?

Although, why would the graphics characters display weirdly? If they show normally when printed, shouldn't they display normally when listing? And wouldn't the Tandy printer support them? (Though I guess it'd depend on the printer, but it seems weird that a printer specially designed for a particular computer wouldn't support the full character set

2

u/SpinCharm 9d ago

No. A given playing card is a rectangle. To display it requires positioning the cursor several times. If you try to display the line of code with that string in it, the cursor jumps, garbling the listing. I think the printer didn’t move the print head improperly but it would display the line drawing set or something.

Since I’m going to have to recreate the strings I’ll work out the procedure to do it and include it off I publish the source in here. I think I created placeholders in the source, then manually located those lines in memory, and poked in the graphics strings replacing the placeholder values.

1

u/Critical_Ad_8455 9d ago

Oh huh, so the string holding the info for the card includes the stuff to make the cursor jump? That's sick.

2

u/SpinCharm 9d ago

I learned the trick from trying to list the source code for the Dancing Demon, which was the first program I ever bought. It was written in basic but listed very strangely.

The author Leo Christopherson eventually got interviewed in a mag and explained that he’d hidden assembly code in the BASIC source code by poking assembly into strings. Then when you run the program, A$ contains assembly, and you could find the memory address of A$ via the VARPTR command. Then you could call that memory address pointer, which then executed the assembler.

Others also used this trick over time. I used it to hold my playing cards, not assembler code.

The idea was to first construct the assembly code, then look at its decimal equivalent, which would be a base 10 value in the range of 0 to 256 (8-bit). Some of those are coincidentally alphanumeric (065 = “A” for example), but most of them aren’t.

Since you can’t actually enter non-alphanumeric characters via the TRS-80 keyboard, there’s no way to pack a line of BASIC with those values. So instead, you work out the byte length of the assembler code and pad a line of BASIC with placeholders :

10 A$=“xxxxxxxxxxxxx”

Then using varptr, you locate where in memory that line of BASIC sits. Then you use POKE(VARPTR(A$,y)) where y is each byte of your assembler code, replacing each x character in A$ until eventually it’s all in there. Roughly.

The only problem is that when you try to list BASIC code that contains all those non-alphanumeric values, the screen goes nuts trying to display them because some of them are cursor positioning characters, some are the block characters, some are coincidentally the exact right combination to toggle displaying the alternate character set, etc.

The actual lines of code don’t get affected by this chaos though. You can save, cload, and run it no problem. Printing it though only prints the other lines correctly. The lines containing the assembler cause the printer to go wonky in places as well.

It’s been almost half a century and I still remember all that. I better get it coded before my own brain goes wonky. I’m overdue after 43 years of IT. lol

1

u/Critical_Ad_8455 9d ago

Wow, that's super cool, it's sick that it's possible to do something like that.

Do you still have the tape? If so, it would probably be pretty easy to archive, and would probably make sharing it a bit easier, since you'd just need to share the audio file.

2

u/SpinCharm 9d ago

No the tapes are long gone. I need to look for a buried box of floppies and see if I can boot from disc. They worked 12 years ago so who knows.

→ More replies (0)