C64 haikus

Anything relating to non Sinclair computers from the 1980's, 90's or even before.
Post Reply
akeley
Dynamite Dan
Posts: 1025
Joined: Sat Feb 01, 2020 5:47 pm

C64 haikus

Post by akeley »

Image

Image

https://archive.org/details/Computer_Haiku_1983_CES

"Sullen screen". So fabulous. Can you challenge this old program with a haiku nearly as cool?
User avatar
TMD2003
Rick Dangerous
Posts: 2032
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: C64 haikus

Post by TMD2003 »

Hmmm. I've loaded it into WinVICE, hit Quit, LIST... what do you know, it's written in BASIC. I spy a challenge...

EASY: port it to the Spectrum.
NOT SO EASY: port it to the ZX81.
AAAARGH: port it to the ZX80.

Now to figure out what all the POKEs and C64 control characters do... and also if there's such a thing as a Bread Bin equivalent of LLIST.

So far my attempts at Spectrum ports from another machine haven't been terribly successful. Would you believe, the machine in question was the Dragon 32... it's the (standard) way it handles string arrays that had me floored. Must try harder next time...

EDIT: *cracks knuckles* Right, I'm going to do it. Give me a day or two and Supekutorumu-san will bring shame and dishonour upon Komodoru-san while the dreaded dojo of MSX samurai sharpen their katanas in the background.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
TMD2003
Rick Dangerous
Posts: 2032
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: C64 haikus

Post by TMD2003 »

Gaaaaaaaaaah! Curse all those Commodore users and their bizarre array of POKEs!

I took a look through the C64 manual and it's about as bare-bones as it gets - it's more of a "let's get you started" job, rather than a complete user guide to everything that BASIC offers the way the Spectrum did (even including what to do with something as near-useless as VAL$). I can't get WinVICE to accept a printer (even if it looks like I know how to operate it), so the only way I can list the program is with a load of screenshots pasted into GIMP.

Andthenthere'stheridiculouswaythattheBreadBindoesn'tneedspacesinitsBASIClinesanditgetsveryhardtoread. It is far from being the only computer of its day that was guilty of that - the BBC Micro was another.

The way the program works to generate the haiku might not be too tough to crack, but deciphering all those POKES, some of which are shoved into variables and sent all over the place, will take longer to untangle than a month's supply of ramen covered in very sticky teriyaki sauce.

"A day or two" was very optimistic...
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
+3code

Re: C64 haikus

Post by +3code »

I think in a Harnell's book came a similar program, can't remember the name.
User avatar
PeterJ
Site Admin
Posts: 6858
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: C64 haikus

Post by PeterJ »

TMD2003 wrote: Sun Sep 13, 2020 11:50 pm Gaaaaaaaaaah! Curse all those Commodore users and their bizarre array of POKEs!
Commodore BASIC is just terrible. I can't remember which user told me, but apparently Microsoft wanted a fee for each machine sold to include their BASIC so it ended up like it is.

The Peeking & Poking is for all the screen work (colours, paper, border, UDGs etc).
User avatar
1024MAK
Bugaboo
Posts: 3104
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: C64 haikus

Post by 1024MAK »

PeterJ wrote: Mon Sep 14, 2020 7:06 am The Peeking & Poking is for all the screen work (colours, paper, border, UDGs etc).
Some of the POKEs and PEEKs will be to screen memory. Some for the VIC registers. And often some for the SID for sound control.

Compile a list of POKE / PEEK addresses used, next to each listed address, list the values that are POKEed. That makes it easier when trying to work out what they are doing.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
TMD2003
Rick Dangerous
Posts: 2032
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: C64 haikus

Post by TMD2003 »

PeterJ wrote: Mon Sep 14, 2020 7:06 am The Peeking & Poking is for all the screen work (colours, paper, border, UDGs etc).
I thought as much - I have at least been through the manual briefly and found all the equivalents of INK, PAPER, BORDER, the display file and attributes, so I'm hoping not to find anything outside those ranges. Of course, using POKE to set the colours means the same addresses can be PEEKed, which might be troublesome for a Spectrum conversion. I suppose there's a way round this for the ink and paper colours with some heavy manipulation of ATTR in a fairly chunky subroutine to separate the ink and paper values from it. I suspect this involves converting to binary in a string, taking the three characters, and... crikey! Would it be something like "BIN VAL$..." to get it back to decimal? Is that an actual use of VAL$ that does something?
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
PeterJ
Site Admin
Posts: 6858
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: C64 haikus

Post by PeterJ »

If you have any problems identifying the pokes or strange control codes in print statements (Such as the heart for cls), drop me a PM [mention]TMD2003[/mention].

I'm not a C64 expert but have been playing with the BASIC over lockdown.

PS. I do have some BASIC which does the equivalent of Print At if that is useful?
User avatar
TMD2003
Rick Dangerous
Posts: 2032
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: C64 haikus

Post by TMD2003 »

I think this program is better off with a complete rewrite.

Even the initial menu input flies off on a massive tangent changing its colours and then trying to do something that is best described as "INPUT, but with every key except 1, 2, 3, 4 and H disabled". Drop in an INKEY$, check that it's 1-4 (the H for "help" appears to just return to the menu...), job done.

I think the huge amount of error-checking routines are to ensure that this program runs on a PET as well as a C64, seeing as the Teacher Instructions says it should do so. There are bits of machine code in there, there are SYS commands that will address the processor in Motorola language instead of Z80...

Essentially, it's all the lines from 1000 onwards that actually generate the haiku which need a direct translation - everything else is just decoration.

Cracking on with BASin...
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
akeley
Dynamite Dan
Posts: 1025
Joined: Sat Feb 01, 2020 5:47 pm

Re: C64 haikus

Post by akeley »

Well, what I had in mind psoting this was if you could write some retro-computing haikus, not rewrite this program, but, hell, why not :) So...WHAT! EXECUTE!

I might have a go later myself. It's something like 5-7-5 syllables I think.
User avatar
TMD2003
Rick Dangerous
Posts: 2032
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: C64 haikus

Post by TMD2003 »

Dragon 32
It's just a Tandy CoCo
With a Welsh accent


I'm going to have to pause my conversion of the C64 program as the house move has just moved from "simmering gently" to "ALL SYSTEMS GO!" If nobody else has a crack in the meantime, I'll pick it up where I left off. I've done the student/teacher instructions and the title page, all that's required is the actual bit of the program that writes the haiku...
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
+3code

Re: C64 haikus

Post by +3code »

I remember now, the book is
https://spectrumcomputing.co.uk/entry/2 ... rocomputer
and the program is called "Hanshan", it makes too haiku-like poems.
User avatar
TMD2003
Rick Dangerous
Posts: 2032
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: C64 haikus

Post by TMD2003 »

The ZX80
Keyboard is like surgery
With gardening gloves


Banzai! I've gone back to the haiku program today, and the meat of it that produces the actual haiku wasn't too hard to crack once I'd worked out that "TI" is a Commie command dealing with the system timer, and there was really no need to PEEK 23672 and make that part of the randomising routine.

It was all ready to go, then I found 8,788 bytes is apparently too much to load on the 16K machine (by 28 bytes), so "4 Out of memory" appears on loading from tape, as soon as the header is displayed. However, deleting all the REMs and using the old ZX81 technique of NOT/SGN/INT PI and a ton of VALs, I've made it fit into the much-more-limited-than-I-thought memory of the 16K model. It doesn't seem to have slowed it down, either, at least not that I notice. It's more colourful than the C64 version (well, obviously), and I'd say my intro screen is far better than the original.

Image Image

Download the program
Write computing-based haiku
You have much honour.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Post Reply