Wednesday, June 6, 2018


To take a break from CoCo/MC-10 stuff, I decided to spend some time on the sed script that comments the VZ ROM disassembly I've been working on.  The comments are mostly done, I just need to update the VZ script.  Turns out the environment I had to install to build MAME has a broken version of sed, and it's conflicting with my cygwin install.  😡

Monday, May 21, 2018

6303 speed notes

The speedup the 6303 provides over the 6803 will probably be smaller than the 6309 vs 6809.  Several of the 6803 opcodes were a clock cycle faster than the 6809 to begin with, and many opcodes aren't any faster at all.  But somewhere between 10% and 20% would still be pretty significant, especially when that is combined with the new ROM.

Sunday, May 20, 2018

MESS is a mess

I had hoped to post some videos comparing the M6803 and HD6303 on the MESS MC-10 emulation.  That doesn't seem to be an option at the moment as MESS locks up the machine after a few minutes.  It turns out that the recent build is doing this even without of my any changes.  This may be an issue with the current Windows 10 update I'm running.  The MESS timing also appeared to be off, as the 6303 was running slower than the 6803.  That should never be the case.  I could see less of a speedup than originally expected, but it should never be slower running BASIC.

Friday, April 27, 2018

Patching the CoCo ROM, where to go from here.

There are several more patches I'm going to release.

The CHRGET/CHRGOT patch and changing the code that divides by 10 used for ASCII conversion are about ready to go.  They should speed up all programs somewhere between 2% and 4% if the results on the MC-10 are any indicator.  These could cause a few programs to act differently or even fail depending on what they do.  That's unlikely, but possible.  So the patch will be designed so it can be assembled with or without that code.

There is a 16x16 multiply that can be replaced.  This speeds up array indexing if I remember right.  The code should be easily ported from the MC-10.

There are a series of 6309 patches that can be easily implemented.  Screen scrolling and memory moves are the easiest to implement and the new code should fit over the old code in memory. 
A fast divide and faster multiply can be implemented.  The 6309 divide and larger multiply instructions are signed, so that will require a work around, but it's doable.  Those will probably offer the greatest improvement for the least work.  There are little patches that can go here and there, but those will require a lot of testing to be sure they don't break anything.  Many of these will even work on a CoCo 1 & 2 since they will fit in the original ROM space.  The fast multiply might even fit.

New square root code.  (SQR).  There wasn't enough space for this in the MC-10 ROM, but this will sit in RAM above ROM so it won't be an issue with the CoCo 3.  Most of the code has already been worked out on the MC-10, but there was one lingering issue.  The new code depends on a "magic" constant.  The existing one only works for double precision numbers and the appropriate number for the CoCo/MC-10 floating point format will have to be generated.  It may also impact precision.  *IF* I get this working, it should run about 20% faster.  This should drop Ahl's benchmark numbers down close to an IBM PC and SQR is also used in the fractal generator code I've been tinkering with.
This mod may take some time to work out.

Monday, April 23, 2018

Code for the higher resolution 3D Fedora Plot I posted a snapshot of on Facebook. This is the original Atari code followed by the changes to run on the CoCo 3.
100 SX=144:SY=56:SZ=64:CX=320:CY=192
110 C1=2.2*SY:C2=1.6*SY
120 DIM RR(CX)
150 CX=CX*0.5:CY=CY*0.46875:FX=SX/64:FZ=SZ/64
160 XF=4.71238905/SX
170 FOR ZI=64 TO -64 STEP -1
190   XL=INT(SQR(SX*SX-ZS)+0.5)
210   FOR XI=0 TO XL
220     A=SIN(SQR(XI*XI+ZS)*XF)
230     Y1=ZY-A*(C1-C2*A*A)
240     X1=XI+ZX
250     IF RR(X1)>Y1 THEN RR(X1)=Y1:PLOT X1,Y1
260     X1=ZX-XI
270     IF RR(X1)>Y1 THEN RR(X1)=Y1:PLOT X1,Y1
280   NEXT XI

80 TIMER=0
90 POKE 65497,0
250 IF RR(X1)>Y1 THEN RR(X1)=Y1:HSET(X1,Y1)
270 IF RR(X1)>Y1 THEN RR(X1)=Y1:HSET(X1,Y1)

Computer timing shows a 25.6% speed increase over the factory ROM.
Just remember this is only because the program uses a lot of multiplication.

0 TIMER=0:POKE65497,0
20 DR=3.1415/180:DS=SIN(15*DR):DC=COS(15*DR)
30 FORR=5TO330STEP10
40 FORT=0TO360STEP10
50 X=R*COS(T*DR)*.25
60 Y=R*SIN(R*DR)*.25
70 Z=R*SIN(T*DR)*.25
80 XP=X+(DC*Z)
90 YP=Y+(DS*Z)
92 XP=128+XP
95 YP=80-YP
100 PSET(XP,YP,1)
115 T=TIMER/60
120 A$=INKEY$:IFA$=""THEN120

Sunday, April 22, 2018

Patching the CoCo ROM, patch #1

In honor of CoCofest, I give you patch #1.  This just patches the multiply and it only uses 6809 code.
Don't bother disassembling it, the source code will get posted once I patch a few more things.

Yeah, I can get away with patching the CoCo 3 ROM from BASIC on this one.  Other patches will have to be an executable.  ONLY FOR THE COCO 3!

1 POKE 65497,0
2 AD=VAL("&HFA0C")
10 FORI=0 TO 64:READ B$:A=VAL("&H"+B$)

20 POKE VAL("&HBB02"),VAL("&H7E"):POKE VAL("&HBB03"),VAL("&HFA"):POKE VAL("&HBB04"),VAL("&H0C")

30 DATA 32,79,E7,60,96,60,3D,ED,63,E6,60,96,5E,3D,ED,61,E6,60,96,5D
40 DATA 3D,ED,65,E6,60,96,5F,3D,E3,62,ED,62,EC,65,E9,61,89,00,ED,60
50 DATA EC,63,D3,15,97,16,D7,63,EC,61,D9,14,99,13,DD,14,A6,60,89,00
60 DATA 97,13,32,67,39