Pages

Thursday, 3 October 2019

Retrochallenge 2019/10: Akalabeth for the TRS-80 MC-10 MCX

Well, as usual, the projects that I described in my entry for this month's Retrochallenge have very little to do with what I have actually ended up doing.

I really can’t take much credit for this one project. The well-known retro programmer Oscar Toledo G. aka nanochess ported the Apple II source of Akalabeth World of Doom to MSX Basic.  This game was the forerunner to the Ultima Series and was programmed by Richard Garriott aka Lord British. I stumbled across a posting that Nanochess made about his project. Since the MSX1 standard, graphically speaking, works on 256 X 192 resolution and is pretty close in syntax to Extended Color Basic, it was pretty easy for me to fix up the source for running under the MCX (i.e. extended color basic) for the MC-10.  Here’s the link to Nanochess’s  page:

Here’s the link my Github dir for Akalabeth:
Akalabeth_MCX8.TXT is my latest as of this posting version.

The most important change that I had to make was to create a high-res text routine since MCX/Extended Color Basic has no built-in way for printing text on the screen.  The MSX graphic standard uses a later standard of Microsoft Basic that provides for printing text on the graphic screen.  My routine went through many iterations, of course, in which I tried to squeeze more and more speed out of Basic.  Hard to discern, but you might be able to notice a slight uptick in rendering from each of the following videos:


Here is a listing of the final routine:
0 CLS:CLEAR500:DIMT,A,G,A$,B$,A$(58),I,J,M$:I=64:J=47:GOTO15
1 DRAW"BD6":FORG=1TOLEN(M$):A=ASC(MID$(M$,G)):IFA>ITHENA=(A-I)*9:FORT=ATOA+8:DRAWA$(ASC(MID$(A$,T))):NEXT:DRAW"BR8":NEXT:DRAW"BL255BD2":RETURN
2 IFA>JTHENA=(A-J)*9:FORT=ATOA+8:DRAWA$(ASC(MID$(B$,T))):NEXT:DRAW"BR8":NEXT:DRAW"BL255BD2":RETURN
3 DRAW"BR8":NEXT:DRAW"BL255BD2":RETURN
REM         123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789
REM         A        B        C        D        E        F        G        H        I        J        K        L        M        N        O        P        Q        R        S        T        U        V        W        X        Y        Z
15 A$="        103456700120056700123006000100456700123406700123000700023456700120050700000000009100456000120050780000000089123450080123450000123456000123400700023450700123400000023056700000000789120456000020400709120456009020050789020456700103406700"
16 B$="        123456000000000089103406700003456700020450700023056700123056700003450000123456700023450700003400009000000700"
17 A$(48)="":A$(49)="NU3":A$(50)="BU3U3BD6":A$(51)="BU6NR5BD6":A$(52)="BR5BU3U3BD6BL5":A$(53)="BR5NU3BL5":A$(54)="NR5":A$(55)="BU3NR5BD3":A$(56)="BU6BR3D3BD3BL3":A$(57)="BR3NU3BL3"
This routine should be useful for Coco or MC-10. It's meant to render in PMODE2, which is the highest resolution available in the MC-10.  Not sure how it will look in other modes (PMODE 3 or PMODE 4).  It's a bit chunky and still a bit slow, but it gets the job done without having to resort to M/L code.

Curtis Boyle has contacted me about getting the source to try a conversion to Basic09.  This should be possible since the GFX module has all the routines you would need.  However, I think the X index is reversed, if I recall, from that of Extended Color Basic so that coordinate numbers do not go from top to bottom but bottom to top.

No comments:

Post a Comment