Sunday, 5 January 2020

The Night of the Vampire Bunnies


There is a text adventure program that I have been wanting to convert to MC-10 for some times. It's by Jason Dyer. The name of the game, "The Night of the Vampire Bunnies" is what intrigued me. Such a playful title. I was able to get my hands on the BASIC source fairly easily. There were versions in Microsoft GW Basic in various places on the Net. GW BASIC is very similar to Microsoft Micro Color BASIC for the MC-10. It's usually fairly easy to translate such programs. I was able to get the slight differences between BASICs fixed up without much fuss.

Then I converted most of the print statements to use my standard 32 character word-wrap subroutine, so that things would print nicely on the small 32X16 screen of the MC-10. The problem was, I needed to use the maximum extended memory of the MC-10 emulator to test and run the program. Depending how you configure things on VMC10 you can get up to almost 32K of emulated RAM memory.  In other words, more than 12K more than an MC-10 with the standard memory pack. I did this all a few years back.  The program was running, but not able to run on a standard machine. I was daunted by the prospect of paring it down by more than 12K, so I put it aside as a specialty program and promised myself to get back to it to defeat the demonic bunny I assumed lurked at its heart.

Well as things go, of course, I got distracted by the endless number of other BASIC programming projects that I have going at any time.  In the meantime I learned all kinds of techniques, many I have written about in this blog, for condensing programs, especially text intensive programs such as text adventures. In my last project I translated a classic Hungarian Language text adventure "A Hos Lovag."  It whetted my appetite for working on text adventures again.  So I thought I would return to Vampire Bunnies.

The most basic technique I have found for making text adventures smaller so they will fit in the 20K of the ordinary MC-10, is to simplify the text messages. These messages can often be boiled down to something much less complex. The trade-off is losing some of the unique flourish of the original author's writing.  Often this is not a terrible loss as many of these games were written by very young programmers back in the early 80s. As a result they are often filled bad grammar and spelling mistakes. I can report that this was not the case with Bunnies. But there was quite a bit of repetition of the same messages or similar messages in different parts of the code. This was likely a result of the larger memory that a PC provides under GW BASIC. Programmers in the late 80s had room that those of the early 80s using simpler 8-bit home computers did not.  So I was able to consolidate a lot of those messages into a subroutine and then simply GOTO or GOSUB to it.

Another technique I have found useful is to consolidate very common sequences of subroutine calls into their own subroutines. Then you simply have to make a single call to a routine that runs multiple subroutines. This is common in text adventures, in which you often have a bunch of actions being done at the end of player command sequences. It might be to reset variables, check player status, tally scores, display formatting, such as lines on the screen to demarcate a new turn etc.  Jason (again likely because of the memory largess of GW BASIC) had lots of places where multiple subroutines sequences occurred at the end of the different possible player command sequences. This programming technique would have been prohibitive in 16K or 32K machines of the early 80s, but as I discovered later, Jason was inspired by the these early 80's BASIC games but was not creating his own games until the end of the 80s-- when he was 11! (I later found out he went on to become one of the most influential bloggers on early IF fiction with his well respected Renga in Blue blog). Bunnies is interesting because it plays like an early Greg HassettScott Adams or Tim Hartnell adventure, but Jason was writing it in 1989. My technique of creating subroutines of subroutines can be even further improved (and make for more speedy execution) by putting the routines at the top of the program.  So a line like this,

GOSUB 12000:GOSUB13000:GOSUB950:GOTO100

which might occur multiple times throughout the program (at the end of IF statements or command sequences) could be replaced by a single call to a subroutine containing all those routines:

6 GOSUB 12000:GOSUB13000:GOSUB950:GOTO100

And all references to these sequences can be triggered by:
GOTO6
or
THEN6

That's a lot of memory savings when you are counting your bytes. Sometimes these routines were not in the exact same sequence, so I did a little reordering (where it made no difference) before doing a global search and replace.

The real damage done to Jason's program, beyond condensing his descriptions, was that he had a fairly complex parser which I removed.  It is clear that he did not simply use a standard existing two-word parser example program like "Tower of Mystery" from Compute't Guide to Text Adventures (1984).  He created his own unique system for parsing command input. He had a complex system for removing extra article words like THE and ON and TO.  He had ways of breaking the sentences input not just into VERB NOUN, but also W1$ and W2$.  He had the ambition to have his players type in more complete English sentences and then to try to parse the input into coherent instructions that could be handled by the program.

This ambition would bite him in the buttocks when it came to the reception of his program years later in the hostile era of the Internet. The reviews of the program on various retro IF sites tend to complain about its departure from the standards of two word VERB-NOUN parsing.  Some of the puzzles involved having to figure out 4 word command sequences. For example JUMP OVER THE RIVER rather than JUMP RIVER. To be fair, in the context of 80s hobby BASIC programming, this convention was not sacrosanct. It was with a little regret that I stripped out this unique parsing engine and put in its place an extremely simple 2-word parser.  However, it did allow me the get the program down to about 20K. Then all I had to do was replace some multi-character variables with single or double variable names, take out extra spaces between commands, and renumber the program by an increment of 2, to get rid of the large line numbers, which just hog memory in interpreted versions of BASIC.

I now have a working version of "The Night of the Vampire Bunnies." I spiffed up the title page a little by adding an ASCII text graphic of a Vampire Bunny. I originally used a W to symbolize the nose and fangs but switched to an M, which I thought worked better. Then I also added some screen flickering using the different SG4 screen color sets in an attempt to evoke lightning flashes, which I think is in keeping with the B-horror movie feel Jason was attempting to evoke (along with Monty Python's Quest for the Holy Grail). Hopefully that will make up a little for the loss of his more detailed location descriptions.

Bunny now with downward pointing fangs
I've play tested the game using various walkthroughs from the the CASA IF Solution Archive.  I haven't run into any errors, but my edited version only requires two word command sequences, so it is slightly different.

Next project: I'm currently working on a BASIC program called "X-Rated Adventure" by V. K. Supersoft (1984), which was recently posted on the Coco Archive. So far, I've got it working on the MC-10.  Not sure if I am going to release it.  Have to try to play through and test it, both for function, and for appropriateness.  Still it might be useful for psychologists to gain insight into an aspect of macho (teenage boy) culture in the early 80s.


Saturday, 28 December 2019

A Hös Lovag: An Early Hungarian Text Adventure in BASIC


The author of the Rosetta Interactive Fiction blog writes (translation from Hungarian courtesy of Chrome):
In 1986, the Hungarian translation of the book: The Adventures of Writing an Adventure Program - or How to Write an Adventure Program on a School Computer in the BASIC Language (Technical Publisher,Budapest), author F. DaCosta. (We've been guessing for a long time what the "F" is ... I just found out that it is "Frank.") Frank DaCosta's work (the original English edition) was published in 1982 by TAB Books Inc. under the title Writing BASIC Adventure Programs for the TRS-80. (or other sources according to the McGraw-Hill School Education Group) and is still available at Amazon along with the writer's other book of 1979 (How To Build Your Own Working Robot Pet - to my knowledge, has not been translated into Hungarian). The original book is still available today in PDF form.
The Rosetta Interactive Fiction blogger continues:
The Hungarian appearance of the book roughly coincides with the beginning of the advent of literary adventure writing in Hungary as a kind of "popular movement." It's only roughly because the first (documented) works came sooner: In '84 the English language Eureka! (Domark-Andromeda-Novotrade), and in '85 some Hungarian-language programs (games by Miklós Tihor, András Laczi and István Rátkai). So it wasn't the book that started the movement-- but it undoubtedly had a very strong impact on it (and in many ways was seminal).
The first two commercial adventure games (both already on the domestic retail market), launched by Novotrade Rt. In '86 (both on the official school computer Plus / 4 and C16, respectively) were already having an effect. The Treasure Hunter game used a version of  imperative expression imposed by Peter Ban the translator, which was simply a direct translation of the English sentence structure. Luckily this rather stilted way of presenting hungarian did not catch on; although it was used in another game called A Hös Lovag (Hero Knight). The author's explanation of the format in the manual for that game tells it all:
"You have to know that this type of game also comes from English, where the structure of the language is particularly suited to adventure games: the imperative expression is the same as the infinitive expression you find in the dictionary. This is not the case in Hungarian-- in our case, the imperative has a special expression that the program does not understand. Therefore, the player can only chat with the machine in a specific, terrible form of the Hungarian language.
For example, if the hero knight feels his power is low but he has bread, we don't have to type EAT BREAD, but EAT BREAD. It needs to be worded as if expressed by someone who is just beginning to study and speak our mother tongue... Over time, this type of program may be able to use correct Hungarian and recognize the suffixes, but for the time being it can only process the vocabulary of words. This is an unfortunate circumstance, but the game may be so interesting that we can forgive this handicap."
It is intriguing to consider the complexities of language that the translated phrase "EAT BREAD, but EAT BREAD" obscures. Hungarian is an agglutinative language, which uses many word prefixes and suffixes to express subtle details of meaning and grammatical structure. Check out this neat video about the language by Langfocus. Certainly when I would put sentences into Google translate you would get nothing but word salad back. For example "hiaba van kardod, egy eleteros sarkany" produced "hiaba you have a sword, a misfit stub."  I eventually translated this as "YOU HAVE A SWORD, BUT YOUR ATTACK IS IN VAIN!"  I was greatly aided in this task by my son Charlie, who showed me the trick of separating each word onto its own line, or of leaving certain words together on a line, to get different suggestions of meaning from Google.

I have now completed an English language version of this interesting early Hungarian text adventure. The following video provides a complete walkthrough, so beware of spoilers:


I want to thank the author of the Rosetta Interactive Fiction blog for making me aware of this program and with sharing his thoughts on the challenges faced by early Hungarian BASIC programmers. I also appreciate his discussion of the DaCosta book and hope in the near future to try creating a working copy of its example program "Mazies and Crazies."  There doesn't seem to be a working copy in any of the TRS-80 program databases that I am aware of.  This is a shame, as  DaCosta's book seems to have had a significant influence on early BASIC programming in a number of countries.
Screenshot of C16 game

Walkthrough for A Hos Lovag (Hero Knight) English Language version by Jim Gerrie 2019

GET STAFF, GET BREAD
LEAVE,E
GET STONE
E,JUMP,N
KILL SPIDER
S,E,S,W,W
PULL MAN
E,S,E,S,W
GET SHOVEL
E,S,S,ENTER
PLAY FLUTE
GET FLASK
LEAVE,N,E,E
DIG
GET CHEST
UNLOCK CHEST,GET GOLD
W,N,N,LEAVE,E
GET BIRD
UP
DROP BIRD
DOWN,E
BUY SWORD
N,E
GIVE BREAD
LEAVE,S,E,S
THROW STONE
E
WEAR RING
UP,E
MOVE ROCK
W,S
WEAR ARMOUR
E
KILL DRAGON
USE FLASK
E,S,W,N,W,N,UP


The following are some translations of the verbs:

10000 data e,d,k,ny,fel,le  ,be   ,ki   ,fog ,felvesz,dob  ,letesz,l,lista ,n,nez ,v,vizsgal,huz
10000 DATA N,S,E,W ,UP ,DOWN,ENTER,LEAVE,TAKE,GET    ,THROW,DROP  ,I,INVENT,L,LOOK,V,EXAMINE,PULL


10010 data eszik,%,maszik,visel,hord,vag,nyit  ,zar ,nyom  ,felad,szol ,mond,as
10010 DATA EAT,   ,CLIMB ,WEAR ,DON ,CUT,UNLOCK,LOCK,SEARCH,QUIT ,SPEAK,SAY ,DIG


10020 data fuj ,ol  ,ut  ,hasznal,megment,ad  ,vesz,mozdit,lok ,ugrik
10020 DATA BLOW,KILL,BEAT,USE    ,SAVE   ,GIVE,BUY ,MOVE  ,PUSH,JUMP


10050 data bot  ,pogacsa,ko   ,gyuru,sip  ,kulcs,ladiko,arany,aso   ,eletviz,kard ,pancel,szikla
10050 DATA STAFF,BREAD  ,STONE,RING ,FLUTE,KEY  ,CHEST ,GOLD ,SHOVEL,FLASK  ,SWORD,ARMOUR,ROCK

10060 data kismadarka,fuldoklo,fa  ,boszorkany,utonallo,sarkany,pok   ,kiralylany
10060 DATA BIRD      ,MAN     ,TREE,WITCH     ,ROGUE   ,DRAGON ,SPIDER,PRINCESS

Tuesday, 19 November 2019

The Maze of Argon

I'm really quite proud of how this game port came out. David Maunder recovered this game for the Dick Smith VZ-200 computer from an old cassette tape. The machine language portion of the game that draws the 3D maze was corrupted.


However, the BASIC part, which handles all the other functions of the game, was ok. So I rewrote the wall rendering in BASIC and it came up very speedy.


I had to change how the maze data was stored too. It was set/reset into hires graphic screen area, but that area was never displayed. It was just used to store the 2D map info from each level that were read by the wall rendering subroutine.  Values for the maze in the sightline of the virtual player (represented in the following by "^") were poked into memory before a call was made to the USR M/L subroutine:

  8
  6
 475
  3
 1^2

I had to recreate the maps and store them as strings into which I POKEd the various items you can find (Pits, Energy packs, exit). This was greatly aided by David, who was able to halt the program and display the graphic screen to show the maps.



I used the screenshot that he provided to redraw the maps as a string array using # symbols to represent the walls, ! symbols for pits, % symbols for energy packs and $ for the secret exit.  These latter items had to poked into the strings  rather than using BASIC string handling commands (MID$, LEFT$, RIGHT$) because otherwise, the strings would be reallocated to string space, and there wasn't enough memory for that to be possible.  I had to readjust the offsets used to perform operations on the maps.  In the VZ each of the 3 levels takes a 40 wide space in the x axis and are set down from the top of the graphic screen by 24 pixels.  In my versions the levels each have 32 spaces in the X axis and only a 4 space offset from the top of the string array:

7001 M$(01)="                                                                                                 "
7002 M$(02)="                                                                                                 "
7003 M$(03)="                                                                                                 "
7004 M$(04)="   ###########################     ###########################     ###########################   "
7005 M$(05)="   #           #   #   #   # #     #                         #     #       #       # #   #   #   "
7006 M$(06)="   # # ### ### # # # # # # # #     # ########### ### ### ### #     # # ### # # ### # # ### # #   "
7007 M$(07)="   #   #   # #   #   #   #   #     # #         #   # #     # #     # #   #   #             # #   "
7008 M$(08)="   # ### # # ### # ### # #####     # # ####### # # # # # # # #     # ### # # ##### # ##### # #   "
7009 M$(09)="   #     #       #     #   # #     # # #     # #   # # # #   #     #     # # #   # # #   #   #   "
7010 M$(10)="   ### # ### # # # # ##### # #     # # ##### # # # # # # ### #     ### # # # # # # # # # # # #   "
7011 M$(11)="   #   # # # # # #   #   # # #     # #       # # #   # #     #     # # # # # # # # # # # # # #   "
7012 M$(12)="   # # # # # # # # # # # # # #     # ######### # # # # ##### #     # # # # # # # # # # # # # #   "
7013 M$(13)="   # # #     #   # #   #     #     #           # #   #   # # #     # # # # # # # # # # # # # #   "
7014 M$(14)="   # # ### ##### # # ##### ###     ######### ### ### ### # # #     # # # # # # # # # # # # # #   "
7015 M$(15)="   #   #   #     #     #     #     #     #   #         #     #     #   #   #   #   #   #   # #   "
7016 M$(16)="   ### # # # ### # # # # # ###     # ### # ### # ### # ##### #     # ### ### ### ### ### ### #   "
7017 M$(17)="   #     #       # # #   #   #     # #   #     #   # #       #     # #   #   #   #   #   #   #   "
7018 M$(18)="   # ### ### ##### # ### # # #     # # # # # ####### # ##### #     # # # # # # # # # # # # # #   "
7019 M$(19)="   #   #   #     #         # #     # # #   # #       # #     #     # # # #   # #   # # # # # #   "
7020 M$(20)="   ### ### # # # # # ##### # #     ########### ####### # #####     # # # # # # # # # # # # # #   "
7021 M$(21)="   #         # # # #       # #     #                   #   # #     #   # # #   # # #   #     #   "
7022 M$(22)="   # # ### # # # # ### ### # #     # ### ########### # ##### #     ##### # ##### # ###########   "
7023 M$(23)="   # #     #   # # #     #   #     # #   #   #   #   #       #     #     # #   # # #         #   "
7024 M$(24)="   # # # # ### # # # ### #####     # # # # # # # # # ##### ###     # # # # # # # # # ####### #   "
7025 M$(25)="   #   # # #         #       #     # # # # # #   # #   # #   #     #   #       # #   #     # #   "
7026 M$(26)="   ### # # # # # # # # ##### #     # ### # # # # # ### # ### #     ### ### # # # # ### # # # #   "
7027 M$(27)="   #     #   #   #   #       #     #   #   #   #   #   #     #     #   #   #     #     # #   #   "
7028 M$(28)="   ###########################     ###########################     ###########################   "
7029 M$(29)="                                                                                                 "
7030 M$(30)="                                                                                                 "
7031 M$(31)="                                                                                                 "


The game is pretty fun and very challenging.  The original starts you with a countdown timer of 10000, but I bumped this to 12000 for the MC-10 because I think it runs a little faster than the VZ.  The VZ version also has a funky musical interlude at the end of the game ("Lara's Theme" from Doctor Zhivago), which also had to be dropped for memory reasons.  I did preserve the other fanfares for losing and winning.  I just use the VZ BASIC manual to convert the note numbers from VZs SOUND command to their equivalent values for the  MC-10 SOUND command.

I used James the Animal Tamer's JVZ_021 emulator to load the original program and the to LLIST it to a text file for editing.  Thanks James!

Saturday, 26 October 2019

RetroChallenge 2019/10: Akalabeth Converted to TRS-80 Coco



I've finished condensing the code of my MC-10 MCX conversion of the Akalabeth source code and have edited it so it will work on the Coco. It is running in the video above on VCC using the high speed poke, which is line 415 (the end of the program):
415 GOSUB11:NEXT:POKE65497,0:GOTO14
For the coco 2 use POKE 65495,0 instead.

The box fill routine is slower on the Coco than in MCX Basic. Looks a bit like a cinematic wipe. Curtis Boyle mentioned in a comment on Youtube that it might be possible to speed up the screen clear by poking a small assembly routine into the cassette buffer area to do "a stack blast clear or two." If anyone wants to try to hack the code, the upper screen clear routine is on line 7:
7 IFG1 THENLINE(0,0)-(255,159),PRESET,BF:RETURN
I used  my son Charlie's idea for converting the LINE statements for drawing the monsters to DATA  statements and then just using a single draw routine.  After doing this I was able to get Akalabeth to fit in the 25K left on a Coco after it is configured for a PMODE2 graphics screen. Thanks Charlie!

The problem was that LINE statements on the Coco require using the PSET command to designate the color attribute rather than a number literal like "1", which would have taken up even more space.  Since I was already maxed out, this would have been a disaster.  But using DATA statements allowed me to shrink everything down to a point that I even had almost 1000 bytes to spare.

I used a routine provided to me by Pippa (from the IF Solutions Archive) that allows me to PEEK and POKE back in the address pointer for the READ statement used with DATA. This allowed me to simply move the pointer to the beginning of the DATA that needed to be read for each monster. On the MC-10 the pointer address is stored at 173 and 174, but I was able to look up the equivalent locations in a Coco ROM Disassembly, which are 51 and 52.  Here is a little demo of Pippa's routines:
1 GOSUB8:PRINTJ:GOSUB9:GOTO1
8 OD=PEEK(173)+256*PEEK(174):READJ:RETURN
9 POKE174,INT(OD/256):POKE173,OD-256*PEEK(174):RETURN
10 DATA 1
The following table clearly shows how much memory is saved by switching to DATA statements:

Here’s a test routine that uses the DATA
Here’s the original routine
0 B=100:C=127:D=1:PMODE2,1:SCREEN1,1:
1 FORZZ=1TO10:PCLS:GOSUB9
2 IFINKEY$=""THEN2
3 NEXT:
4 GOTO4

9 READT,A,G,Q:IFT=99THENRETURN
10 LINE(C+T/D,B+A/D)-(C+G/D,B+Q/D),PSET:GOTO9

74 DATA-23,,-15,,-15,,-15,-15,-15,-15,-8,-30,-8,-30,8,-30,8,-30,15,-15,15,-15,15,,15,,23,,,-26,,-65,-2,-38,2,-38,-3,-45,3,-45,-5,-53,5,-53,-23,-56,-30,-53,-30,-53,-23,-45,-23,-45,-23,-53,-23,-53,-8,-38,-15,-45,-8,-60,-8,-60,8
75 DATA-60,8,-60,15,-45,15,-42,15,-57,12,-45,20,-45,,-75,-5,-80,-5,-80,-8,-75,-8,-75,-5,-65,-5,-65,5,-65,5,-65,5,-68,5,-68,-5,-68,-5,-68,-5,-65,-5,-65,5,-65,5,-65,8,-75,8,-75,5,-80,5,-80,-5,-80,-3,-72,-2,-72,3,-72,4,-72,99,,,

80 DATA,-56,,-8,,-8,10,,10,,30,,30,,30,-45,30,-45,10,-64,10,-64,,-56,,-56,-10,-64,-10,-64,-30,-45,-30,-45,-30,,-30,,-10,,-10,,,-8,-10,-64,-10,-75,-10,-75,,-83,,-83,10,-75
81 DATA10,-75,,-79,,-79,-10,-75,-10,-75,,-60,,-60,10,-75,10,-75,10,-64,99,,,

82 DATA5,-30,,-25,,-25,-5,-30,-5,-30,-15,-5,-15,-5,-10,,-10,,10,,10,,15,-5,15,-5,20,-5,20,-5,10,,10,,15,-5,15,-5,5,-30,5,-30,10,-40,10,-40,3,-35,3,-35,-3,-35,-3,-35,-10,-40,-10,-40,-5,-30
84 DATA-5,-33,-3,-30,5,-33,3,-30,-5,-20,-5,-15,5,-20,5,-15,-7,-20,-7,-15,7,-20,7,-15,99,,,

86 DATA,,-15,,-15,,-8,-8,-8,-8,-8,-15,-8,-15,-15,-23,-15,-23,-15,-15,-15,-15,-23,-23,-23,-23,-23,-45,-23,-45,-15,-53,-15,-53,-8,-53,-8,-53,-15,-68,-15,-68,-8,-75,-8,-75,,-75
88 DATA,,15,,15,,8,-8,8,-8,8,-15,8,-15,15,-23,15,-23,15,-15,15,-15,23,-23,23,-23,23,-45,23,-45,15,-53,15,-53,8,-53,8,-53,15,-68,15,-68,8,-75,8,-75,,-75
90 DATA-15,-68,15,-68,-8,-53,8,-53,-23,-15,8,-45,-8,-68,,-60,,-60,8,-68,8,-68,8,-60,8,-60,-8,-60,-8,-60,-8,-68,,-38,-8,-38,-8,-38,8,-53,8,-53,8,-45,8,-45,15,-45,15,-45,,-30,,-30,,-38,99,,,

93 DATA-10,-15,-10,-30,-10,-30,-15,-20,-15,-20,-15,-1,-15,-1,-15,,-15,,15,,15,,15,-15,15,-15,-15,-15,-15,-10,15,-10,-15,-5,15,-5,,-15,-5,-20,-5,-20,-5,-35,-5,-35,5,-35,5,-35,5,-20,5,-20,10,-15,-5,-20,5,-20,-5,-25,5,-25
97 DATA-5,-30,5,-30,-10,-35,-10,-40,-10,-40,-5,-45,-5,-45,5,-45,5,-45,10,-40,10,-40,10,-35,-10,-40,,-45,,-45,10,-40,-5,-40,5,-40,5,-40,15,-30,15,-30,,-40,,-40,-15,-30,-15,-30,-5,-40,99,,,

101 DATA-20,-88,-30,-83,-30,-83,-30,-78,20,-88,30,-83,30,-83,40,-83,-15,-86,-20,-83,-20,-83,-20,-78,-20,-78,-30,-73,-30,-73,-30,-68,-30,-68,-20,-63,-10,-83,-10,-58,-10,-58,,-50,10,-83,10,-78,10,-78,20,-73,20,-73,20,-40
104 DATA15,-85,20,-78,20,-78,30,-76,30,-76,30,-60,,-83,,-73,,-73,10,-68,10,-68,10,-63,10,-63,,-58,99,,,

106 DATA5,-10,-5,-10,-5,-10,,-15,,-15,10,-20,10,-20,5,-15,5,-15,5,-10,5,-10,7,-6,7,-6,5,-3,5,-3,-5,-3,-5,-3,-7,-6,-7,-6,-5,-10,2,-3,5,,5,,8,,-2,-3,-5,,-5,,-8,,3,-8,3,-8,-3,-8,-3,-8,3,-5,-3,-5,99,,,

111 DATA99,,,

112 DATA-14,-46,-12,-37,-12,-37,-20,-32,-20,-32,-30,-32,-30,-32,-22,-24,-22,-24,-40,-17,-40,-17,-40,-7,-40,-7,-38,-5,-38,-5,-40,-3,-40,-3,-40,,-40,,-36,,-36,,-34,-2,-34,-2,-32,,-32
113 DATA,-28,,-28,,-28,-3,-28,-3,-30,-5,-30,-5,-28,-7,-28,-7,-28,-15,-28,-15,,-27,14,-46,12,-37,12,-37,20,-32,20,-32,30,-32,30,-32,22,-24,22,-24,40,-17,40,-17,40,-7,40,-7,38,-5,38,-5,40,-3,40,-3,40,
115 DATA40,,36,,36,,34,-2,34,-2,32,,32,,28,,28,,28,-3,28,-3,30,-5,30,-5,28,-7,28,-7,28,-15,28,-15,,-27,6,-48,38,-41,38,-41,40,-42,40,-42,18,-56,18,-56,12,-56,12,-56,10,-57,10,-57,8,-56,8,-56,-8,-56,-8,-56,-10,-58
116 DATA-10,-58,14,-58,14,-58,16,-59,16,-59,8,-63,8,-63,6,-63,6,-63,2,-70,2,-70,2,-63,2,-63,-2,-63,-2,-63,-2,-70,-2,-70,-6,-63,-6,-63,-8,-63,-8,-63,-16,-59,-16,-59,-14,-58,-14,-58,10,-57,10,-57,-12,-56,-12,-56,-18,-56,-18
117 DATA-56,-36,-47,-36,-47,-36,-39,-36,-39,-28,-41,-28,-41,-28,-46,-28,-46,-20,-50,-20,-50,-18,-50,-18,-50,-14,-46,-28,-41,30,-55,28,-58,22,-56,22,-56,22,-53,22,-53,28,-52,28,-52,34,-54,34,-54,20,-50,20,-50,26,-47
118 DATA10,-58,10,-61,10,-61,4,-58,-10,-58,-10,-61,-10,-61,-4,-58,40,-9,50,-12,50,-12,40,-7,-8,-25,6,-7,6,-7,28,-7,28,-7,28,-9,28,-9,20,-9,20,-9,6,-25,99,,,

120 DATA6,-60,30,-90,30,-90,60,-30,60,-30,60,-10,60,-10,30,-40,30,-40,15,-40,-6,-60,-30,-90,-30,-90,-60,-30,-60,-30,-60,-10,-60,-10,-30,-40,-30,-40,-15,-40,,-25,6,-25,6,-25,10,-20,10,-20,12,-10,12,-10
122 DATA10,-6,10,-6,10,,10,,14,,14,,15,-5,15,-5,16,,16,,20,,20,,20,-6,20,-6,18,-10,18,-10,18,-20,18,-20,15,-30,15,-30,15,-45,15,-45,40,-60,40,-60,40,-70,40,-70,10,-55,10,-55,6,-60,6,-60,10,-74,10,-74,6,-80,6,-80
124 DATA4,-80,4,-80,3,-82,3,-82,2,-80,2,-80,,-80,,-25,-6,-25,-6,-25,-10,-20,-10,-20,-12,-10,-12,-10,-10,-6,-10,-6,-10,,-10,,-14,,-14,,-15,-5,-15,-5,-16,,-16,,-20,,-20,,-20,-6,-20,-6,-18,-10,-18,-10
126 DATA-18,-20,-18,-20,-15,-30,-15,-30,-15,-45,-15,-45,-40,-60,-40,-60,-40,-70,-40,-70,-10,-55,-10,-55,-6,-60,-6,-60,-10,-74,-10,-74,-6,-80,-6,-80,-4,-80,-4,-80,-3,-82,-3,-82,-2,-80,-2,-80,,-80
128 DATA-6,-25,,-6,,-6,10,,10,,4,-8,4,-8,6,-25,-40,-64,-40,-90,-40,-90,-52,-80,-52,-80,-52,-40,40,-86,38,-92,38,-92,42,-92,42,-92,40,-86,40,-86,40,-50,4,-70,6,-74,-4,-70,-6,-74,,-64,,-60,99,,,


73 LINE(C-23/D,B)-(C-15/D,B),1:LINE-(C-15/D,B-15/D),1:LINE-(C-8/D,B-30/D),1:LINE-(C+8/D,B-30/D),1:LINE-(C+15/D,B-15/D),1:LINE-(C+15/D,B),1:LINE-(C+23/D,B),1
74 LINE(C,B-26/D)-(C,B-65/D),1:LINE(C-2/D+.5,B-38/D)-(C+2/D+.5,B-38/D),1:LINE(C-3/D+.5,B-45/D)-(C+3/D+.5,B-45/D),1:LINE(C-5/D+.5,B-53/D)-(C+5/D+.5,B-53/D),1
75 LINE(C-23/D,B-56/D)-(C-30/D,B-53/D),1:LINE-(C-23/D,B-45/D),1:LINE-(C-23/D,B-53/D),1:LINE-(C-8/D,B-38/D),1
76 LINE(C-15/D,B-45/D)-(C-8/D,B-60/D),1:LINE-(C+8/D,B-60/D),1:LINE-(C+15/D,B-45/D),1:LINE(C+15/D,B-42/D)-(C+15/D,B-57/D),1:LINE(C+12/D,B-45/D)-(C+20/D,B-45/D),1
77 LINE(C,B-75/D)-(C-5/D+.5,B-80/D),1:LINE-(C-8/D,B-75/D),1:LINE-(C-5/D+.5,B-65/D),1:LINE-(C+5/D+.5,B-65/D),1:LINE-(C+5/D+.5,B-68/D),1:LINE-(C-5/D+.5,B-68/D),1:LINE-(C-5/D+.5,B-65/D),1
78 LINE-(C+5/D+.5,B-65/D),1:LINE-(C+8/D,B-75/D),1:LINE-(C+5/D+.5,B-80/D),1:LINE-(C-5/D+.5,B-80/D),1:PSET(C-5/D+.5,B-72/D):PSET(C+5/D+.5,B-72/D):GOTO131
79 LINE(C,B-56/D)-(C,B-8/D),1:LINE-(C+10/D,B),1:LINE-(C+30/D,B),1:LINE-(C+30/D,B-45/D),1:LINE-(C+10/D,B-64/D),1:LINE-(C,B-56/D),1
80 LINE-(C-10/D,B-64/D),1:LINE-(C-30/D,B-45/D),1:LINE-(C-30/D,B),1:LINE-(C-10/D,B),1:LINE-(C,B-8/D),1:LINE(C-10/D,B-64/D)-(C-10/D,B-75/D),1:LINE-(C,B-83/D),1:LINE-(C+10/D,B-75/D),1
81 LINE-(C,B-79/D),1:LINE-(C-10/D,B-75/D),1:LINE-(C,B-60/D),1:LINE-(C+10/D,B-75/D),1:LINE-(C+10/D,B-64/D),1:GOTO131
82 LINE(C+5/D,B-30/D)-(C,B-25/D),1:LINE-(C-5/D,B-30/D),1:LINE-(C-15/D,B-5/D),1:LINE-(C-10/D,B),1:LINE-(C+10/D,B),1:LINE-(C+15/D,B-5/D),1
83 LINE-(C+20/D,B-5/D),1:LINE-(C+10/D,B),1:LINE-(C+15/D,B-5/D),1:LINE-(C+5/D,B-30/D),1:LINE-(C+10/D,B-40/D),1:LINE-(C+3/D+.5,B-35/D),1:LINE-(C-3/D+.5,B-35/D),1:LINE-(C-10/D,B-40/D),1:LINE-(C-5/D,B-30/D),1
84 LINE(C-5/D,B-33/D)-(C-3/D+.5,B-30/D),1:LINE(C+5/D,B-33/D)-(C+3/D+.5,B-30/D),1:LINE(C-5/D,B-20/D)-(C-5/D,B-15/D),1
85 LINE(C+5/D,B-20/D)-(C+5/D,B-15/D),1:LINE(C-7+D,B-20/D)-(C-7/D,B-15/D),1:LINE(C+7/D,B-20/D)-(C+7/D,B-15/D),1:GOTO131
86 LINE(C,B)-(C-15/D,B),1:LINE-(C-8/D,B-8/D),1:LINE-(C-8/D,B-15/D),1:LINE-(C-15/D,B-23/D),1:LINE-(C-15/D,B-15/D),1:LINE-(C-23/D,B-23/D),1
87 LINE-(C-23/D,B-45/D),1:LINE-(C-15/D,B-53/D),1:LINE-(C-8/D,B-53/D),1:LINE-(C-15/D,B-68/D),1:LINE-(C-8/D,B-75/D),1:LINE-(C,B-75/D),1
88 LINE(C,B)-(C+15/D,B),1:LINE-(C+8/D,B-8/D),1:LINE-(C+8/D,B-15/D),1:LINE-(C+15/D,B-23/D),1:LINE-(C+15/D,B-15/D),1:LINE-(C+23/D,B-23/D),1
89 LINE-(C+23/D,B-45/D),1:LINE-(C+15/D,B-53/D),1:LINE-(C+8/D,B-53/D),1:LINE-(C+15/D,B-68/D),1:LINE-(C+8/D,B-75/D),1:LINE-(C,B-75/D),1
90 LINE(C-15/D,B-68/D)-(C+15/D,B-68/D),1:LINE(C-8/D,B-53/D)-(C+8/D,B-53/D),1:LINE(C-23/D,B-15/D)-(C+8/D,B-45/D),1
91 LINE(C-8/D,B-68/D)-(C,B-60/D),1:LINE-(C+8/D,B-68/D),1:LINE-(C+8/D,B-60/D),1:LINE-(C-8/D,B-60/D),1:LINE-(C-8/D,B-68/D),1
92 LINE(C,B-38/D)-(C-8/D,B-38/D),1:LINE-(C+8/D,B-53/D),1:LINE-(C+8/D,B-45/D),1:LINE-(C+15/D,B-45/D),1:LINE-(C,B-30/D),1:LINE-(C,B-38/D),1:GOTO131
93 LINE(C-10/D,B-15/D)-(C-10/D,B-30/D),1:LINE-(C-15/D,B-20/D),1:LINE-(C-15/D,B-15/D),1:LINE-(C-15/D,B),1:LINE-(C+15/D,B),1:LINE-(C+15/D,B-15/D),1:LINE  -(C-15/D,B-15/D),1
94 LINE(C-15/D,B-10/D)-(C+15/D,B-10/D),1:LINE(C-15/D,B-5/D)-(C+15/D,B-5/D),1
95 LINE(C,B-15/D)-(C-5/D,B-20/D),1:LINE-(C-5/D,B-35/D),1:LINE-(C+5/D,B-35/D),1:LINE-(C+5/D,B-20/D),1:LINE-(C+10/D,B-15/D),1
96 LINE(C-5/D,B-20/D)-(C+5/D,B-20/D),1:LINE(C-5/D,B-25/D)-(C+5/D,B-25/D),1:LINE(C-5/D,B-30/D)-(C+5/D,B-30/D),1
97 LINE(C-10/D,B-35/D)-(C-10/D,B-40/D),1:LINE-(C-5/D,B-45/D),1:LINE-(C+5/D,B-45/D),1:LINE-(C+10/D,B-40/D),1:LINE-(C+10/D,B-35/D),1
98 LINE(C-10/D,B-40/D)-(C,B-45/D),1:LINE-(C+10/D,B-40/D),1
99 LINE(C-5/D,B-40/D)-(C+5/D,B-40/D),1:LINE-(C+15/D,B-30/D),1:LINE-(C,B-40/D),1:LINE-(C-15/D,B-30/D),1:LINE-(C-5/D+.5,B-40/D),1:GOTO131
100 LINE(C-20/D,79-Y(D))-(C-20/D,B-88/D),1:LINE-(C-10/D,B-83/D),1:LINE-(C+10/D,B-83/D),1:LINE-(C+20/D,B-88/D),1:LINE-(C+20/D,79-Y(D)),1:LINE-(C-20/D,79-Y(D)),1
101 LINE(C-20/D,B-88/D)-(C-30/D,B-83/D),1:LINE-(C-30/D,B-78/D),1:LINE(C+20/D,B-88/D)-(C+30/D,B-83/D),1:LINE-(C+40/D,B-83/D),1
102 LINE(C-15/D,B-86/D)-(C-20/D,B-83/D),1:LINE-(C-20/D,B-78/D),1:LINE-(C-30/D,B-73/D),1:LINE-(C-30/D,B-68/D),1:LINE-(C-20/D,B-63/D),1
103 LINE(C-10/D,B-83/D)-(C-10/D,B-58/D),1:LINE-(C,B-50/D),1:LINE(C+10/D,B-83/D)-(C+10/D,B-78/D),1:LINE-(C+20/D,B-73/D),1:LINE-(C+20/D,B-40/D),1
104 LINE(C+15/D,B-85/D)-(C+20/D,B-78/D),1:LINE-(C+30/D,B-76/D),1:LINE-(C+30/D,B-60/D),1
105 LINE(C,B-83/D)-(C,B-73/D),1:LINE-(C+10/D,B-68/D),1:LINE-(C+10/D,B-63/D),1:LINE-(C,B-58/D),1:GOTO131
106 LINE(C+5/D+.5,B-10/D)-(C-5/D+.5,B-10/D),1:LINE-(C,B-15/D),1:LINE-(C+10/D,B-20/D),1:LINE-(C+5/D+.5,B-15/D),1:LINE-(C+5/D+.5,B-10/D),1
107 LINE-(C+7/D+.5,B-6/D),1:LINE-(C+5/D+.5,B-3/D),1:LINE-(C-5/D+.5,B-3/D),1:LINE-(C-7/D+.5,B-6/D),1:LINE-(C-5/D+.5,B-10/D),1:LINE(C+2/D+.5,B-3/D)-(C+5/D+.5,B),1:LINE-(C+8/D,B),1
108 LINE(C-2/D+.5,B-3/D)-(C-5/D+.5,B),1:LINE-(C-8/D,B),1:PSET(C+3/D+.5,B-8/D):PSET(C-3/D+.5,B-8/D):LINE(C+3/D+.5,B-5/D)-(C-3/D+.5,B-5/D),1:GOTO131
109 LINE(127-10/D,E(D,3))-(127-10/D,E(D,3)-10/D),1:LINE-(127+10/D,E(D,3)-10/D),1:LINE-(127+10/D,E(D,3)),1:LINE-(127-10/D,E(D,3)),1
110 LINE(127-10/D,E(D,3)-10/D)-(127-5/D,E(D,3)-15/D),1:LINE-(127+15/D,E(D,3)-15/D),1:LINE-(127+15/D,E(D,3)-5/D),1:LINE-(127+10/D,E(D,3)),1
111 LINE(127+10/D,E(D,3)-10/D)-(127+15/D,E(D,3)-15/D),1:GOTO131
112 LINE(C-14/D,B-46/D)-(C-12/D,B-37/D),1:LINE-(C-20/D,B-32/D),1:LINE-(C-30/D,B-32/D),1:LINE-(C-22/D,B-24/D),1:LINE-(C-40/D,B-17/D),1:LINE-(C-40/D,B-7/D),1:LINE-(C-38/D,B-5/D),1:LINE-(C-40/D,B-3/D),1:LINE-(C-40/D,B),1
113 LINE-(C-36/D,B),1:LINE-(C-34/D,B-2/D),1:LINE-(C-32/D,B),1:LINE-(C-28/D,B),1:LINE-(C-28/D,B-3/D),1:LINE-(C-30/D,B-5/D),1:LINE-(C-28/D,B-7/D),1:LINE-(C-28/D,B-15/D),1:LINE-(C,B-27/D),1
114 LINE(C+14/D,B-46/D)-(C+12/D,B-37/D),1:LINE-(C+20/D,B-32/D),1:LINE-(C+30/D,B-32/D),1:LINE-(C+22/D,B-24/D),1:LINE-(C+40/D,B-17/D),1:LINE-(C+40/D,B-7/D),1:LINE-(C+38/D,B-5/D),1:LINE-(C+40/D,B-3/D),1:LINE-(C+40/D,B),1
115 LINE-(C+36/D,B),1:LINE-(C+34/D,B-2/D),1:LINE-(C+32/D,B),1:LINE-(C+28/D,B),1:LINE-(C+28/D,B-3/D),1:LINE-(C+30/D,B-5/D),1:LINE-(C+28/D,B-7/D),1:LINE-(C+28/D,B-15/D),1:LINE-(C,B-27/D),1
116 LINE(C+6/D,B-48/D)-(C+38/D,B-41/D),1:LINE-(C+40/D,B-42/D),1:LINE-(C+18/D,B-56/D),1:LINE-(C+12/D,B-56/D),1:LINE-(C+10/D,B-57/D),1:LINE-(C+8/D,B-56/D),1:LINE-(C-8/D,B-56/D),1:LINE-(C-10/D,B-58/D),1:LINE-(C+14/D,B-58/D),1
117 LINE-(C+16/D,B-59/D),1:LINE-(C+8/D,B-63/D),1:LINE-(C+6/D,B-63/D),1:LINE-(C+2/D+.5,B-70/D),1:LINE-(C+2/D+.5,B-63/D),1:LINE-(C-2/D+.5,B-63/D),1:LINE-(C-2/D+.5,B-70/D),1:LINE-(C-6/D,B-63/D),1:LINE-(C-8/D,B-63/D),1
118 LINE-(C-16/D,B-59/D),1:LINE-(C-14/D,B-58/D),1:LINE-(C+10/D,B-57/D),1:LINE-(C-12/D,B-56/D),1:LINE-(C-18/D,B-56/D),1:LINE-(C-36/D,B-47/D),1:LINE-(C-36/D,B-39/D),1:LINE-(C-28/D,B-41/D),1:LINE-(C-28/D,B-46/D),1
119 LINE-(C-20/D,B-50/D),1:LINE-(C-18/D,B-50/D),1:LINE-(C-14/D,B-46/D),1:GOTO242
120 LINE(C+6/D,B-60/D)-(C+30/D,B-90/D),1:LINE-(C+60/D,B-30/D),1:LINE-(C+60/D,B-10/D),1:LINE-(C+30/D,B-40/D),1:LINE-(C+15/D,B-40/D),1
121 LINE(C-6/D,B-60/D)-(C-30/D,B-90/D),1:LINE-(C-60/D,B-30/D),1:LINE-(C-60/D,B-10/D),1:LINE-(C-30/D,B-40/D),1:LINE-(C-15/D,B-40/D),1
122 LINE(C,B-25/D)-(C+6/D,B-25/D),1:LINE-(C+10/D,B-20/D),1:LINE-(C+12/D,B-10/D),1:LINE-(C+10/D,B-6/D),1:LINE-(C+10/D,B),1:LINE-(C+14/D,B),1:LINE-(C+15/D,B-5/D),1:LINE-(C+16/D,B),1:LINE-(C+20/D,B),1
123 LINE-(C+20/D,B-6/D),1:LINE-(C+18/D,B-10/D),1:LINE-(C+18/D,B-20/D),1:LINE-(C+15/D,B-30/D),1:LINE-(C+15/D,B-45/D),1:LINE-(C+40/D,B-60/D),1:LINE-(C+40/D,B-70/D),1
124 LINE-(C+10/D,B-55/D),1:LINE-(C+6/D,B-60/D),1:LINE-(C+10/D,B-74/D),1:LINE-(C+6/D,B-80/D),1:LINE-(C+4/D+.5,B-80/D),1:LINE-(C+3/D+.5,B-82/D),1:LINE-(C+2/D+.5,B-80/D),1:LINE-(C,B-80/D),1
125 LINE(C,B-25/D)-(C-6/D,B-25/D),1:LINE-(C-10/D,B-20/D),1:LINE-(C-12/D,B-10/D),1:LINE-(C-10/D,B-6/D),1:LINE-(C-10/D,B),1:LINE-(C-14/D,B),1:LINE-(C-15/D,B-5/D),1:LINE-(C-16/D,B),1:LINE-(C-20/D,B),1
126 LINE-(C-20/D,B-6/D),1:LINE-(C-18/D,B-10/D),1:LINE-(C-18/D,B-20/D),1:LINE-(C-15/D,B-30/D),1:LINE-(C-15/D,B-45/D),1:LINE-(C-40/D,B-60/D),1:LINE-(C-40/D,B-70/D),1
127 LINE-(C-10/D,B-55/D),1:LINE-(C-6/D,B-60/D),1:LINE-(C-10/D,B-74/D),1:LINE-(C-6/D,B-80/D),1:LINE-(C-4/D+.5,B-80/D),1:LINE-(C-3/D+.5,B-82/D),1:LINE-(C-2/D+.5,B-80/D),1:LINE-(C,B-80/D),1
128 LINE(C-6/D,B-25/D)-(C,B-6/D),1:LINE-(C+10/D,B),1:LINE-(C+4/D+.5,B-8/D),1:LINE-(C+6/D,B-25/D),1:LINE(C-40/D,B-64/D)-(C-40/D,B-90/D),1:LINE-(C-52/D,B-80/D),1:LINE-(C-52/D,B-40/D),1
129 LINE(C+40/D,B-86/D)-(C+38/D,B-92/D),1:LINE-(C+42/D,B-92/D),1:LINE-(C+40/D,B-86/D),1:LINE-(C+40/D,B-50/D),1
130 LINE(C+4/D+.5,B-70/D)-(C+6/D,B-74/D),1:LINE(C-4/D+.5,B-70/D)-(C-6/D,B-74/D),1:LINE(C,B-64/D)-(C,B-60/D),1


I think this is the end of my main RetroChallenge activity for this month. I also did a little work on another classic dungeon crawl game "Stronghold of the Dwarven Lords" from Tim Hartnell's book Giant Book of Computer Games (1984), subtitled "For most popular home computers that use BASIC."  I used OCR from a version of the book for the VZ200 computer, but it was missing a page, so I had to use another version for the TI99/4a to type in what was missing.  After some correcting and adjustments for the MC-10 it seemed to work fine.


Maybe next year I will try converting Akalabeth to BASIC09 under NitrsOS9.

Working directory on Github for this project: https://github.com/jggames/trs80mc10/tree/master/quicktype/MCX/Akalabeth

Sunday, 13 October 2019

RetroChallenge 2019/10: Akalabeth fully functional on MCX


Listened to Stevie Strowbridge's webcast yesterday. Curtis reported on my progress. He suggested that I was having trouble fitting the full program into the MCX.  I think he might be thinking of some of my prior posts about the game Telengard, where I had to make some edits that cut out a few features of the program (Mysterious Cubes and thrones, for example) to get it to fit in the regular 20K expansion pack. But the only compromises I have made in the MCX expansion pack version of Akalabeth is to shorten some messages. This was done in the name of speed and also memory conservation, but otherwise the program is fully functional. I don't think anything of major importance was lost in terms of information, except a few aspects of the ye-olde medieval flavour of some of the messages.  Otherwise, the 28K memory space provided by MCX (as implemented on the VMC10 emulator) is sufficient.

I have taken the much slimmed version I developed for the Coco and ported it back to MC-10, and I can report that it is now even faster in its screen drawing. I also now have 1K to spare after all the variables are declared.  I'll post it shortly after having my son go at it a little for bug testing.  My son also helped me figure out a way to slim the program even further, which will I hope allow it to fit in the more confined 25K space of Extended Color Basic (after PCLEAR2). The routine for drawing the creatures is the biggest chunk of drawing commands:

73 LINE(C-23/D,B)-(C-15/D,B),1:LINE-(C-15/D,B-15/D),1:LINE-(C-8/D,B-30/D),1:LINE-(C+8/D,B-30/D),1:LINE-(C+15/D,B-15/D),1:LINE-(C+15/D,B),1:LINE-(C+23/D,B),1
74 LINE(C,B-26/D)-(C,B-65/D),1:LINE(C-2/D+.5,B-38/D)-(C+2/D+.5,B-38/D),1:LINE(C-3/D+.5,B-45/D)-(C+3/D+.5,B-45/D),1:LINE(C-5/D+.5,B-53/D)-(C+5/D+.5,B-53/D),1
75 LINE(C-23/D,B-56/D)-(C-30/D,B-53/D),1:LINE-(C-23/D,B-45/D),1:LINE-(C-23/D,B-53/D),1:LINE-(C-8/D,B-38/D),1
76 LINE(C-15/D,B-45/D)-(C-8/D,B-60/D),1:LINE-(C+8/D,B-60/D),1:LINE-(C+15/D,B-45/D),1:LINE(C+15/D,B-42/D)-(C+15/D,B-57/D),1:LINE(C+12/D,B-45/D)-(C+20/D,B-45/D),1
77 LINE(C,B-75/D)-(C-5/D+.5,B-80/D),1:LINE-(C-8/D,B-75/D),1:LINE-(C-5/D+.5,B-65/D),1:LINE-(C+5/D+.5,B-65/D),1:LINE-(C+5/D+.5,B-68/D),1:LINE-(C-5/D+.5,B-68/D),1:LINE-(C-5/D+.5,B-65/D),1
78 LINE-(C+5/D+.5,B-65/D),1:LINE-(C+8/D,B-75/D),1:LINE-(C+5/D+.5,B-80/D),1:LINE-(C-5/D+.5,B-80/D),1:PSET(C-5/D+.5,B-72/D):PSET(C+5/D+.5,B-72/D):GOTO131
79 LINE(C,B-56/D)-(C,B-8/D),1:LINE-(C+10/D,B),1:LINE-(C+30/D,B),1:LINE-(C+30/D,B-45/D),1:LINE-(C+10/D,B-64/D),1:LINE-(C,B-56/D),1
80 LINE-(C-10/D,B-64/D),1:LINE-(C-30/D,B-45/D),1:LINE-(C-30/D,B),1:LINE-(C-10/D,B),1:LINE-(C,B-8/D),1:LINE(C-10/D,B-64/D)-(C-10/D,B-75/D),1:LINE-(C,B-83/D),1:LINE-(C+10/D,B-75/D),1
81 LINE-(C,B-79/D),1:LINE-(C-10/D,B-75/D),1:LINE-(C,B-60/D),1:LINE-(C+10/D,B-75/D),1:LINE-(C+10/D,B-64/D),1:GOTO131
82 LINE(C+5/D,B-30/D)-(C,B-25/D),1:LINE-(C-5/D,B-30/D),1:LINE-(C-15/D,B-5/D),1:LINE-(C-10/D,B),1:LINE-(C+10/D,B),1:LINE-(C+15/D,B-5/D),1
83 LINE-(C+20/D,B-5/D),1:LINE-(C+10/D,B),1:LINE-(C+15/D,B-5/D),1:LINE-(C+5/D,B-30/D),1:LINE-(C+10/D,B-40/D),1:LINE-(C+3/D+.5,B-35/D),1:LINE-(C-3/D+.5,B-35/D),1:LINE-(C-10/D,B-40/D),1:LINE-(C-5/D,B-30/D),1
84 LINE(C-5/D,B-33/D)-(C-3/D+.5,B-30/D),1:LINE(C+5/D,B-33/D)-(C+3/D+.5,B-30/D),1:LINE(C-5/D,B-20/D)-(C-5/D,B-15/D),1
85 LINE(C+5/D,B-20/D)-(C+5/D,B-15/D),1:LINE(C-7+D,B-20/D)-(C-7/D,B-15/D),1:LINE(C+7/D,B-20/D)-(C+7/D,B-15/D),1:GOTO131
86 LINE(C,B)-(C-15/D,B),1:LINE-(C-8/D,B-8/D),1:LINE-(C-8/D,B-15/D),1:LINE-(C-15/D,B-23/D),1:LINE-(C-15/D,B-15/D),1:LINE-(C-23/D,B-23/D),1
87 LINE-(C-23/D,B-45/D),1:LINE-(C-15/D,B-53/D),1:LINE-(C-8/D,B-53/D),1:LINE-(C-15/D,B-68/D),1:LINE-(C-8/D,B-75/D),1:LINE-(C,B-75/D),1
88 LINE(C,B)-(C+15/D,B),1:LINE-(C+8/D,B-8/D),1:LINE-(C+8/D,B-15/D),1:LINE-(C+15/D,B-23/D),1:LINE-(C+15/D,B-15/D),1:LINE-(C+23/D,B-23/D),1
89 LINE-(C+23/D,B-45/D),1:LINE-(C+15/D,B-53/D),1:LINE-(C+8/D,B-53/D),1:LINE-(C+15/D,B-68/D),1:LINE-(C+8/D,B-75/D),1:LINE-(C,B-75/D),1
90 LINE(C-15/D,B-68/D)-(C+15/D,B-68/D),1:LINE(C-8/D,B-53/D)-(C+8/D,B-53/D),1:LINE(C-23/D,B-15/D)-(C+8/D,B-45/D),1
91 LINE(C-8/D,B-68/D)-(C,B-60/D),1:LINE-(C+8/D,B-68/D),1:LINE-(C+8/D,B-60/D),1:LINE-(C-8/D,B-60/D),1:LINE-(C-8/D,B-68/D),1
92 LINE(C,B-38/D)-(C-8/D,B-38/D),1:LINE-(C+8/D,B-53/D),1:LINE-(C+8/D,B-45/D),1:LINE-(C+15/D,B-45/D),1:LINE-(C,B-30/D),1:LINE-(C,B-38/D),1:GOTO131
93 LINE(C-10/D,B-15/D)-(C-10/D,B-30/D),1:LINE-(C-15/D,B-20/D),1:LINE-(C-15/D,B-15/D),1:LINE-(C-15/D,B),1:LINE-(C+15/D,B),1:LINE-(C+15/D,B-15/D),1:LINE  -(C-15/D,B-15/D),1
94 LINE(C-15/D,B-10/D)-(C+15/D,B-10/D),1:LINE(C-15/D,B-5/D)-(C+15/D,B-5/D),1
95 LINE(C,B-15/D)-(C-5/D,B-20/D),1:LINE-(C-5/D,B-35/D),1:LINE-(C+5/D,B-35/D),1:LINE-(C+5/D,B-20/D),1:LINE-(C+10/D,B-15/D),1
96 LINE(C-5/D,B-20/D)-(C+5/D,B-20/D),1:LINE(C-5/D,B-25/D)-(C+5/D,B-25/D),1:LINE(C-5/D,B-30/D)-(C+5/D,B-30/D),1
97 LINE(C-10/D,B-35/D)-(C-10/D,B-40/D),1:LINE-(C-5/D,B-45/D),1:LINE-(C+5/D,B-45/D),1:LINE-(C+10/D,B-40/D),1:LINE-(C+10/D,B-35/D),1
98 LINE(C-10/D,B-40/D)-(C,B-45/D),1:LINE-(C+10/D,B-40/D),1
99 LINE(C-5/D,B-40/D)-(C+5/D,B-40/D),1:LINE-(C+15/D,B-30/D),1:LINE-(C,B-40/D),1:LINE-(C-15/D,B-30/D),1:LINE-(C-5/D+.5,B-40/D),1:GOTO131
100 LINE(C-20/D,79-Y(D))-(C-20/D,B-88/D),1:LINE-(C-10/D,B-83/D),1:LINE-(C+10/D,B-83/D),1:LINE-(C+20/D,B-88/D),1:LINE-(C+20/D,79-Y(D)),1:LINE-(C-20/D,79-Y(D)),1
101 LINE(C-20/D,B-88/D)-(C-30/D,B-83/D),1:LINE-(C-30/D,B-78/D),1:LINE(C+20/D,B-88/D)-(C+30/D,B-83/D),1:LINE-(C+40/D,B-83/D),1
102 LINE(C-15/D,B-86/D)-(C-20/D,B-83/D),1:LINE-(C-20/D,B-78/D),1:LINE-(C-30/D,B-73/D),1:LINE-(C-30/D,B-68/D),1:LINE-(C-20/D,B-63/D),1
103 LINE(C-10/D,B-83/D)-(C-10/D,B-58/D),1:LINE-(C,B-50/D),1:LINE(C+10/D,B-83/D)-(C+10/D,B-78/D),1:LINE-(C+20/D,B-73/D),1:LINE-(C+20/D,B-40/D),1
104 LINE(C+15/D,B-85/D)-(C+20/D,B-78/D),1:LINE-(C+30/D,B-76/D),1:LINE-(C+30/D,B-60/D),1
105 LINE(C,B-83/D)-(C,B-73/D),1:LINE-(C+10/D,B-68/D),1:LINE-(C+10/D,B-63/D),1:LINE-(C,B-58/D),1:GOTO131
106 LINE(C+5/D+.5,B-10/D)-(C-5/D+.5,B-10/D),1:LINE-(C,B-15/D),1:LINE-(C+10/D,B-20/D),1:LINE-(C+5/D+.5,B-15/D),1:LINE-(C+5/D+.5,B-10/D),1
107 LINE-(C+7/D+.5,B-6/D),1:LINE-(C+5/D+.5,B-3/D),1:LINE-(C-5/D+.5,B-3/D),1:LINE-(C-7/D+.5,B-6/D),1:LINE-(C-5/D+.5,B-10/D),1:LINE(C+2/D+.5,B-3/D)-(C+5/D+.5,B),1:LINE-(C+8/D,B),1
108 LINE(C-2/D+.5,B-3/D)-(C-5/D+.5,B),1:LINE-(C-8/D,B),1:PSET(C+3/D+.5,B-8/D):PSET(C-3/D+.5,B-8/D):LINE(C+3/D+.5,B-5/D)-(C-3/D+.5,B-5/D),1:GOTO131
109 LINE(127-10/D,E(D,3))-(127-10/D,E(D,3)-10/D),1:LINE-(127+10/D,E(D,3)-10/D),1:LINE-(127+10/D,E(D,3)),1:LINE-(127-10/D,E(D,3)),1
110 LINE(127-10/D,E(D,3)-10/D)-(127-5/D,E(D,3)-15/D),1:LINE-(127+15/D,E(D,3)-15/D),1:LINE-(127+15/D,E(D,3)-5/D),1:LINE-(127+10/D,E(D,3)),1
111 LINE(127+10/D,E(D,3)-10/D)-(127+15/D,E(D,3)-15/D),1:GOTO131
112 LINE(C-14/D,B-46/D)-(C-12/D,B-37/D),1:LINE-(C-20/D,B-32/D),1:LINE-(C-30/D,B-32/D),1:LINE-(C-22/D,B-24/D),1:LINE-(C-40/D,B-17/D),1:LINE-(C-40/D,B-7/D),1:LINE-(C-38/D,B-5/D),1:LINE-(C-40/D,B-3/D),1:LINE-(C-40/D,B),1
113 LINE-(C-36/D,B),1:LINE-(C-34/D,B-2/D),1:LINE-(C-32/D,B),1:LINE-(C-28/D,B),1:LINE-(C-28/D,B-3/D),1:LINE-(C-30/D,B-5/D),1:LINE-(C-28/D,B-7/D),1:LINE-(C-28/D,B-15/D),1:LINE-(C,B-27/D),1
114 LINE(C+14/D,B-46/D)-(C+12/D,B-37/D),1:LINE-(C+20/D,B-32/D),1:LINE-(C+30/D,B-32/D),1:LINE-(C+22/D,B-24/D),1:LINE-(C+40/D,B-17/D),1:LINE-(C+40/D,B-7/D),1:LINE-(C+38/D,B-5/D),1:LINE-(C+40/D,B-3/D),1:LINE-(C+40/D,B),1
115 LINE-(C+36/D,B),1:LINE-(C+34/D,B-2/D),1:LINE-(C+32/D,B),1:LINE-(C+28/D,B),1:LINE-(C+28/D,B-3/D),1:LINE-(C+30/D,B-5/D),1:LINE-(C+28/D,B-7/D),1:LINE-(C+28/D,B-15/D),1:LINE-(C,B-27/D),1
116 LINE(C+6/D,B-48/D)-(C+38/D,B-41/D),1:LINE-(C+40/D,B-42/D),1:LINE-(C+18/D,B-56/D),1:LINE-(C+12/D,B-56/D),1:LINE-(C+10/D,B-57/D),1:LINE-(C+8/D,B-56/D),1:LINE-(C-8/D,B-56/D),1:LINE-(C-10/D,B-58/D),1:LINE-(C+14/D,B-58/D),1
117 LINE-(C+16/D,B-59/D),1:LINE-(C+8/D,B-63/D),1:LINE-(C+6/D,B-63/D),1:LINE-(C+2/D+.5,B-70/D),1:LINE-(C+2/D+.5,B-63/D),1:LINE-(C-2/D+.5,B-63/D),1:LINE-(C-2/D+.5,B-70/D),1:LINE-(C-6/D,B-63/D),1:LINE-(C-8/D,B-63/D),1
118 LINE-(C-16/D,B-59/D),1:LINE-(C-14/D,B-58/D),1:LINE-(C+10/D,B-57/D),1:LINE-(C-12/D,B-56/D),1:LINE-(C-18/D,B-56/D),1:LINE-(C-36/D,B-47/D),1:LINE-(C-36/D,B-39/D),1:LINE-(C-28/D,B-41/D),1:LINE-(C-28/D,B-46/D),1
119 LINE-(C-20/D,B-50/D),1:LINE-(C-18/D,B-50/D),1:LINE-(C-14/D,B-46/D),1:GOTO242
120 LINE(C+6/D,B-60/D)-(C+30/D,B-90/D),1:LINE-(C+60/D,B-30/D),1:LINE-(C+60/D,B-10/D),1:LINE-(C+30/D,B-40/D),1:LINE-(C+15/D,B-40/D),1
121 LINE(C-6/D,B-60/D)-(C-30/D,B-90/D),1:LINE-(C-60/D,B-30/D),1:LINE-(C-60/D,B-10/D),1:LINE-(C-30/D,B-40/D),1:LINE-(C-15/D,B-40/D),1
122 LINE(C,B-25/D)-(C+6/D,B-25/D),1:LINE-(C+10/D,B-20/D),1:LINE-(C+12/D,B-10/D),1:LINE-(C+10/D,B-6/D),1:LINE-(C+10/D,B),1:LINE-(C+14/D,B),1:LINE-(C+15/D,B-5/D),1:LINE-(C+16/D,B),1:LINE-(C+20/D,B),1
123 LINE-(C+20/D,B-6/D),1:LINE-(C+18/D,B-10/D),1:LINE-(C+18/D,B-20/D),1:LINE-(C+15/D,B-30/D),1:LINE-(C+15/D,B-45/D),1:LINE-(C+40/D,B-60/D),1:LINE-(C+40/D,B-70/D),1
124 LINE-(C+10/D,B-55/D),1:LINE-(C+6/D,B-60/D),1:LINE-(C+10/D,B-74/D),1:LINE-(C+6/D,B-80/D),1:LINE-(C+4/D+.5,B-80/D),1:LINE-(C+3/D+.5,B-82/D),1:LINE-(C+2/D+.5,B-80/D),1:LINE-(C,B-80/D),1
125 LINE(C,B-25/D)-(C-6/D,B-25/D),1:LINE-(C-10/D,B-20/D),1:LINE-(C-12/D,B-10/D),1:LINE-(C-10/D,B-6/D),1:LINE-(C-10/D,B),1:LINE-(C-14/D,B),1:LINE-(C-15/D,B-5/D),1:LINE-(C-16/D,B),1:LINE-(C-20/D,B),1
126 LINE-(C-20/D,B-6/D),1:LINE-(C-18/D,B-10/D),1:LINE-(C-18/D,B-20/D),1:LINE-(C-15/D,B-30/D),1:LINE-(C-15/D,B-45/D),1:LINE-(C-40/D,B-60/D),1:LINE-(C-40/D,B-70/D),1
127 LINE-(C-10/D,B-55/D),1:LINE-(C-6/D,B-60/D),1:LINE-(C-10/D,B-74/D),1:LINE-(C-6/D,B-80/D),1:LINE-(C-4/D+.5,B-80/D),1:LINE-(C-3/D+.5,B-82/D),1:LINE-(C-2/D+.5,B-80/D),1:LINE-(C,B-80/D),1
128 LINE(C-6/D,B-25/D)-(C,B-6/D),1:LINE-(C+10/D,B),1:LINE-(C+4/D+.5,B-8/D),1:LINE-(C+6/D,B-25/D),1:LINE(C-40/D,B-64/D)-(C-40/D,B-90/D),1:LINE-(C-52/D,B-80/D),1:LINE-(C-52/D,B-40/D),1
129 LINE(C+40/D,B-86/D)-(C+38/D,B-92/D),1:LINE-(C+42/D,B-92/D),1:LINE-(C+40/D,B-86/D),1:LINE-(C+40/D,B-50/D),1
130 LINE(C+4/D+.5,B-70/D)-(C+6/D,B-74/D),1:LINE(C-4/D+.5,B-70/D)-(C-6/D,B-74/D),1:LINE(C,B-64/D)-(C,B-60/D),1

Charlie pointed out that it probably represents 7K+ of repeated draw commands.  His idea is to turn all those commands into lists of DATA for each creature that can then just get processed with a subroutine to process and display the line draw vectors.  Here's an example of a line I have converted:

73 LINE(C-23/D,B)-(C-15/D,B),1:LINE-(C-15/D,B-15/D),1:LINE-(C-8/D,B-30/D),1:LINE-(C+8/D,B-30/D),1:LINE-(C+15/D,B-15/D),1
:LINE-(C+15/D,B),1:LINE-(C+23/D,B),1

73 DATA-23,,-15,,-15,,-15,-15,-15,-15,-8,-30,-8,-30,8,-30,8,-30,15,-15,15,-15,15,,15,0,23,0,99,99,99,99

Then I can just use some kind of simple subroutine to plot these 2 groups of 2 coordinates for each LINE command like this:

10 READW,X,Y,Z:IFW=999THEN131
20 LINE(C+W/D,B+X/D)-(C+Y/D,B+Z/D),PSET:GOTO50

This will be critical in pairing down all the individual LINE commands. This is especially important because I discovered that unlike MCX Basic, ECB doesn't allow a literal number for the line color argument. You have to specify PSET, or PRESET and then set the color beforehand using the COLOR command. This means I'll have to swap a bunch of 1s for PSETs.  This would be fatal if I had to do it for the chunk of code above.

Hopefully with Charlie's idea.  I'll get it all to work in 25K on a Coco.

Stay tuned.


Addendum

This game will not fit into the new MCX Micro32 SD expansion card for the MC-10.

Saturday, 12 October 2019

RetroChallenge 2019/10: Extended Color Basic Akalabeth a Possibility


Akalabeth being played on real MCX Hardware

I was perhaps a little hasty in predicting that a Extended Color Basic version of Akalabeth might not be possible.  With a little coaxing and some suggestions from L. Curtis Boyle, I looked into some "slimming" techniques that could be used on the code.  By replacing some heavily used double character variables for single character variables, and renumbering the program using an increment of 1 for lines numbers, I was able to get the code down to about 25K.  Here are some of the main switches in variable names:

MM==>M
X1==>P
Y1==>O
DI==>D
GO==>G1 (this is just because Extended Color Basic doesn't like the word "GO" being used)

It also turned out to be fairly easy finding and inserting the places where Extended Color requires spaces before Basic keywords.  These didn't turn out to be needed in too many places, so the code only grew a little after doing this.  I was able to move the text of the source onto a Coco .DSK image and load it up.  However, it produced an OM error when it hit the array variable declarations.  I might need to find a few more K.

One possibility will be to remove the "Adventurer Shop" section and then chain the programs together and then load any shared variables needed between them.  However, the Shop component already doubles as the Items report, so this tactic might not be possible, or save as much memory as I expect.  I'll have to do some careful testing to get a better sense of how much more memory I need for variables.  But at least things are looking a little more positive than my last post.


Thursday, 10 October 2019

RetroChallenge 2019/10 Coco Version Akalabeth on the Rocks?

On to a new project?
The amount of memory reported by MCX Basic running on the emulator is 28703.  I think you get even more memory on real hardware. And you don't have to clear memory for use by hires commands.  It's just reserved automatically. The amount of memory reported by Coco Basic if I PCLEAR 2 (2 X 1.5 memory pages), which is needed for the PMODE2 screen leaves only 25889 bytes.  I'm starting to fear that the program won't fit on the Coco.

I have only a few hundred bytes free after all the array variables and other variables are declared in the MCX version.  In the Coco version I will also have to insert spaces in all the following instances of variable names touching directly on Basic command keywords:
ON T_GOSUB
FORT=D_TO10
IF A>D_THEN
IF P_ANDP_OR
B_STEP
The MC-10's Basic is fixed to be able to search in a way that it can differentiate between variable names and Basic keywords.  This means you don't need to put any spaces between commands and variables, which is really handy for saving memory and squeezing programs into the MC-10.

I don't think 25K will be enough to run this very large program.  This will leave it to Curtis to bring the game to Coco in the form of a Basic09 program. There might be some troubles here too, as I remember that memory management, as least on level 1 Basic09 can be a little tricky.  I think the largest program I ever compiled was one that needed me to use the #32 argument when running Basic09.  Probably easier in level 2 to get all the Graphics routines loaded up.  Hope so. I'd really like to see this game ported to a windowed program running under Nitros09.

So this might be the end of my Akalabeth porting project. I've been play testing a bit, and the program seems pretty stable.  However, my son Charlie is coming home this weekend for Canadian Thanksgiving, so I'll abuse my fatherly authority and position as family cook to extort some game testing out of him.  He's always really good at sniffing out bugs and takes great relish in pushing programs into situations where conditions are generated that reveal bugs.  I think it's his way of getting some revenge for me making him do beta testing of my crappy old Basic games.

So it might be onto the next project for me. I'm thinking of taking the example program "Mazies and Crazies" for the TRS-80 and typing it in and porting it to MC-10.  I haven't found a working version available anywhere on the Net.  Just the scan of the book by Frank De Costa, "Writing Basic Adventure Programs for the TRS-80" in which it appears.  Or maybe a text adventure of some kind.  Hmmm....