Phantom 8 BitA head to head comparison of several BASIC programs running on the original MC-10 Factory ROM vs my my rewrite of the interpreter. Optimizations include: Optimizations to the CHRGET/CHRGOT code parsing Optimizations to the main interpreter loop Doesn't test for BREAK & SHIFT-0 every token, and performs faster test A rewrite of the math library to use the hardware multiply & 16 bits 16 bit memory moves 16 bit screen scroll 16 bit screen clear 16 bit string compare Storing the current line pointer instead of the current line number to allow many faster operations (finding next line being the biggest improvement) Reorganizing code so it doesn't have to jump around as much
Comparison of MC-10 Factory BASIC vs My optimized BASIC 2020 08 19 10 14 43Phantom 8 Bit2020-08-19 | A head to head comparison of several BASIC programs running on the original MC-10 Factory ROM vs my my rewrite of the interpreter. Optimizations include: Optimizations to the CHRGET/CHRGOT code parsing Optimizations to the main interpreter loop Doesn't test for BREAK & SHIFT-0 every token, and performs faster test A rewrite of the math library to use the hardware multiply & 16 bits 16 bit memory moves 16 bit screen scroll 16 bit screen clear 16 bit string compare Storing the current line pointer instead of the current line number to allow many faster operations (finding next line being the biggest improvement) Reorganizing code so it doesn't have to jump around as much2026 10 19 11 50 26Phantom 8 Bit2026-10-19 | Tandy CoCo 3 Omega Race Arcade game2026 10 17 04 43 16Phantom 8 Bit2026-10-17 | OBS muted the colors, so I'll have to figure out what happened but this will do for now2023 12 27 13 40 04Phantom 8 Bit2023-12-27 | Demo of the current state of the MC-10 chess program. Still some work to do2023 10 27 17 47 54Phantom 8 Bit2023-10-27 | Work in progress of Chess for the MC-10 This is almost totally written in C. Drawing the chess board would be much faster in assembly, but this is pretty fast and more portable.2023 03 20 14 22 17Phantom 8 Bit2023-03-21 | Super Extended BASIC version of the running cat animation2023 01 17 13 41 47Phantom 8 Bit2023-01-17 | Cat animation using Extend Color BASIC on the Tandy Color Computer The original source for GW-BASIC was posted in the BASIC Programming Language group on facebook.Rotating a 3D image in BASICPhantom 8 Bit2021-10-11 | The old Utah Teapot 3D model from 1975 displayed by a BASIC program on the CoCo 3 The only difference between the left and right programs, is the one on the right uses the BASIC hardware multiply patch. Even though the left one was started slightly ahead of the right one, after the first rotation the one on the right takes a clear lead.Fourier2021 04 07 00 18 05Phantom 8 Bit2021-04-11 | This shows the original unoptimized Fourier code vs the code with my optimizations and hardware multiply patch. I didn't start the new code for a second or two after the original code, but the new version is about twice as fast as the original.2021 04 10 23 43 26Phantom 8 Bit2021-04-11 | Now the optimized code vs the same code with the hardware multiply patch2021 04 09 17 29 16Phantom 8 Bit2021-04-09 | Same program as the last video with a couple of the most used variables declared at the top so they will be in the interpreter's variable list towards the start. This version will finish displaying the graphic at about the time the last version starts to draw it. More importantly, it's getting close to twice as fast as the original without any changes to the interpreter.
Note that the original code is from a book, so I don't want to share the code on my channelBASIC Fourier code 2021 04 07 00 18 05Phantom 8 Bit2021-04-07 | This is some Fourier code written in BASIC On the left is the original published code with some additions to run on the CoCo written by R. Allen Murphey The code on the right is after I printed only what was needed, placed constants in variables, and optimized the math somewhat. This required no changes to the ROM.C64 VS MC-10 BASIC Solitaire Solver 2020 09 17 08 14 19Phantom 8 Bit2020-09-17 | Solitaire Solver BASIC program on the CCS64 C64 emulator, and VMC-10 MC-10 emulator (new ROM) after running all night. This was what I captured in the morning. The C64 program was started right before the MC-10 version, and I left the CCS64 emulator window active, but I can't guarantee the C64 results are accurate until this can be run it on real hardware. VICE gave less consistent results when I tried it. This is a greater difference that I was expecting, so it's possible CCS64 is loosing cycles. That or there really is this much difference. The random number generation is different between the two BASICs, so they were solving different decks of cards. Different decks take different amounts of time, but over a long run like this, it should average out so that isn't a factor here. The C64 port only has changes for printing at a location on the screen, what characters are used for the cards, and for the random # generation, so that shouldn't be an issue. If anything, the C64 version should have an advantage due to the taller screen, as the discard pile doesn't have to scroll as often. The machine this was tested on has an AMD 2700X with 16GB of RAM, and it was showing low CPU activity. *edit*
I've tried running longer benchmark runs since the difference swings back and forth a bit depending on how the random number generators shuffle the deck for a period of time. CCS64 ended up crashing some time during the night, so it has a bug. I also hate that it doesn't update the window if it isn't active. This may seem clever, but it makes bechmarking multiple machines at once. You should be able to disable this feature. I'm awaiting results on real hardware to see if the speed of CCS64 matches a real machine.Factory BASIC vs New ROM 2020 08 18 11 16 33Phantom 8 Bit2020-08-18 | Factorial Program There is a cut at around 26 socounds so you don't have to sit through several minutes of boring video.2019 07 30 Plus4SortTestPhantom 8 Bit2019-07-30 | The BASIC sort test running on the Plus/4. It takes about 8 minutes do to the way it supports up to 52K of RAM, but this would also let it load, and sort the entire list of 1000 names where the other machines couldn't.2019 07 30 11 AppleSortTestPhantom 8 Bit2019-07-30 | After a slight code update, and some minor changes to run on the Apple II, here is the sort test running on AppleWin. It takes about 6:31 to complete. That's at least 30 seconds slower than a standard MC-10, and over a minute slower than my new BASIC. There seemed to be some inconsistency with the MC-10 timing when testing on emulators head to head, so I recorded them separate.AtariVSMC10Sort1Phantom 8 Bit2019-07-27 | The Atari code has not been optimized, and the cute busy indicator steals a lot of clock time, so don't take this too seriously. The Atari does completely skip the scan to see how large the data set is though. At least it's not nuclear green.String array sort. 2019 07 25 22 07 13Phantom 8 Bit2019-07-26 | An update to the string compare test using the latest version of the ROM. This gives several parts of the interpreter a workout. The parser Reading through data statements Converting ASCII to variables (we still read the numeric data even if it's not used, and copy strings) Array indexing Comparing strings etc... The test uses data for the first 891 (the most RAM will hold with it in data statements) most common sir names. ordered from most to least common, along with some other data not currently used. An index is sorted by alphabetical order using a comb sort. You can see the code at the start of the video, and I can make the data available if someone wants to try it.TRS-80 Color Computer BASIC SpherePhantom 8 Bit2019-07-15 | A video of a Commodore Plus/4 drawing a sphere like object from BASIC was posted in the facebook COMMODORE 16/+4 group. I wrote a rough equivalent of the program for the Tandy Color Computer. I used a LINE statement to duplicate the vertical line of the Plus/4 version.SolitareSolver0719Phantom 8 Bit2019-07-07 | July 6, 2019 The Solitaire Solver program I'm used as a benchmark before. The original ROM on the left, latest Beta ROM on the right. This shows over a 10% speed increase.
The tool I used to create it, seems to have wrapped the end of the video around over the start.AnotherPlotMC10Phantom 8 Bit2019-07-06 | July 6, 2019.
Just a little before, and after comparison of the current WIP of the BASIC interpreter using the same code I used to compare vs the Apple II in a previous video. . The most recent changes, changing SIN/COS code from divide by a constant to multiply by 1/constant, and switching from tracking current line number to pointer to a current line pushes most programs to over an 8% speed increase, but math intensive code like this... runs almost 44% faster.
There is one more speedup I'm going to implement that should help before moving to more radical changes that might break compatibility.Apple II vs MC-10 3D PlotPhantom 8 Bit2018-12-13 | A little comparison of the speed difference between the Apple II and the MC-10 using the current version of optimized BASIC.
The images may look very different, but it's the same program on both machines. The scale and center of the screen are different, but the number of calculations and pixels being set are the same.
The program is based on one used to compare the Apple II vs the C64 in another video, but some repetitive calculations were moved outside the loops. This really helped the Apple II since the math is much slower on it.PrimesMC10DEC10 2018Phantom 8 Bit2018-12-11 | MC-10 Microcolor BASIC vs New ROM Calculating Prime NumbersCoCo 3 vs MC-10Phantom 8 Bit2018-12-06 | Tandy CoCo 3 in high speed mode (1.77MHz) vs MC-10 with new ROM. The MC-10 does pretty well here for a computer the Color Computer community calls a doorstop.SortTestNov2018BetaPhantom 8 Bit2018-11-24 | This BASIC program loads a list of the most common sir names, sorts it, etc... The original MC-10 ROM is on the left, the current test ROM is on the right.FedoraNov2018Phantom 8 Bit2018-11-22 | Here is an updated video of the Fedora 3D plot comparing the original MC-10 ROM, vs my latest stable version. There are a lot of other speedups I'm going to gradually migrate in as they are debugged.
This ROM version includes faster SIN(), COS() TAN() , and string compare functions.FastCircles3Phantom 8 Bit2018-11-13 | A test of a new MC-10 ROM with faster SIN() function vs the original ROM on the left.Patch13DPlotPhantom 8 Bit2018-04-23 | TRS-80 Color Computer 3. On the left is the regular BASIC, and on the right with my patch that replaces the floating point multiply with one that uses the hardware MUL instruction. Both are running using the high speed poke.
Source code:
0 TIMER=0:POKE65497,0 10 PMODE4,1:PCLS0:SCREEN1,1 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) 110 NEXT:NEXT 115 T=TIMER/60 120 A$=INKEY$:IFA$=""THEN120 130 PRINT"TIME:",TCircles3 30 18Phantom 8 Bit2018-03-30 | MC-10 Optimized ROM comparison for 3-30-2018 Microcolor BASIC on the left, the new ROM is on the right. ASCII to from Binary conversion used a divide by 10, this replaces that with a multiplication by the constant 1 divided by 10, which takes advantage of the hardware multiply used in the new floating point code. The code also divided a couple numbers by constants, and those calculations were altered to multiply by 1 divided by constant.SolitairPhantom 8 Bit2018-01-30 | Testing a new MC-10 ROM build using Jim Gerrie's Solitair program. Solitair seems to have a bug and I have to track down one of my own... but this should give you an idea of how much faster the latest ROM build is.FedoraMC10Phantom 8 Bit2017-09-13 | Plotting a 3D function that draws a "Fedora" hat on the MC-10. The original version of Microcolor BASIC is on the left and my enhanced version is on the right.Circles2Phantom 8 Bit2017-08-07 | This is the same circles program as the previous one, but now the new MC-10 BASIC ROM only tests for the BREAK key every 64 passes through the main interpreter loop. There's a little bit of a delay between pressing BREAK and having the program stop, so I'll have to try some numbers between that and 32 which wasn't bad.0805171153Phantom 8 Bit2017-08-05 | The Nebrask 150 Express, UP E9 949, pulling into Sidney, NebraskacirclesPhantom 8 Bit2017-08-05 | This is a simple comparison of the original Tandy MC-10 ROM (on the left) and my updated MC-10 ROM (on the right) running the same program. The speed difference is obvious here.DSCN0116Phantom 8 Bit2016-09-09 | The original Atari version of the 64 column graphics text driver (grey) Used the 65816 MVN instruction to scroll the screen (green) The same unrolled loop from the 6502 version but using the 65816's 16 bit A register for the LDA/STA pairs. The only difference in the loop is incrementing the counter/index register twice instead of once per loop. On the right is the VZ200 version which is now slower than the fastest Atari version, but then it has to copy 1024 more bytes due to the paged graphics RAM.DSCN0112Phantom 8 Bit2016-08-27 | 64 column text code on a 256 x 192 graphics screen running under emulation. Computers from Left to right... Acorn Atom, Atari 8 bit, MC-10, and VZ-200. All CPU emulation is set to normal speed. The Atom is set to PAL but NTSC seems about the same. The Atari is set to NTSC. The MC-10 is NTSC The VZ-200 is set to PAL but NTSC seems to be about the same.
The Atari and Atom are running the same code except for setup, some different memory addresses for Page 0 variables and the screen location.DSCN0096Phantom 8 Bit2016-02-18 | Comparison of the speed of my 64 column graphics text code running on 3 different CPUs under emulation. This was taken with a camera rather than video capture so it doesn't suffer the jerky video quality of my previous videos. There are a couple jerks due to the emulators but that can't be helped.
All these machines use the MC6847 VDG and have no wait states accessing video RAM. From left to right, slowest to fastest: Acorn Atom with 1MHz 6502 Radio Shack MC-10 with .89MHz 6803 Dick Smith VZ200 with 3.58MHz Z80
The 6803 is the fastest per MHz and it took the least amount of time to write. Other 680X code will be similar but requires fewer instructions in the character generator code and scroll. The 6502 has to be clocked around 30% faster in the emulator to keep up with the 6803 even though it is optimized to eliminate a multiply the other two versions still have. The font data is completely rearranged to suit 6502 addressing in place of the multiply, so technically, the 6502 is doing less work than the other CPUs. The 6502 also scrolls the screen in columns rather than rows because the addressing ends up faster that way, and I don't mean by a little. The screen can look a little odd during a lot of scrolling but for real world use you probably won't notice. I can unroll the scroll loop a little more but it would only save a couple hundred clock cycles and it needs thousands to catch the 6803. The VZ200 Z80 is fastest but it is running at 4 times the clock speed of the 6803. Since it's the oldest code I've spent the most time optimizing it. I think the first version was as about as slow as the initial 6502 version. Finding the best use of registers took multiple rewrites but it was key to getting the most speed out of the code.
All CPU versions print 2 characters to the screen at the same time whenever possible. This significantly reduces the number of screen accesses and logic operations.Before&AfterAtomPhantom 8 Bit2015-10-07 | Sorry for the jerky video, I recorded it on my laptop which doesn't seem to be fast enough to keep up.
On the left is Atomulator running the first version of the 64 column font code for the Atom & 6502. On the right is a majorly optimized version that uses a new scroll which clears the last line at the same time, the code prints two characters at a time when possible, and it uses pre-shifted/masked character font. It's still not as fast as the MC-10 but it's much closer than it was.AtomVSMC 10Phantom 8 Bit2015-09-30 | A comparison of the 64 column graphics text code on the 1 MHz 6502 Atom vs the .89 MHz 6803 MC-10TunnelPhantom 8 Bit2015-09-19 | ...FirePhantom 8 Bit2015-09-18 | MC-10 Fire animation. The video is very poor compared to the real thingVZ200Print64Phantom 8 Bit2015-09-07 | Updated 64 column text code for the VZ200. Faster and includes a bug fix.VZ20064ColumnTextPhantom 8 Bit2015-09-04 | Printing 64 column text in 256x192 graphics mode on the VTech/Dick Smith VZ200. The text driver emulates a 64 column x 24 line display. To run this on the real machine would require the Australian hardware hack that added to the video RAM. Sadly, as with the MC-10 version, the video recording software couldn't keep up with the display and youtube degraded the quality further so it doesn't look as good as the real thing.MC1064ColumnTextPhantom 8 Bit2015-09-04 | Printing 64 column text in 256x192 graphics mode on the Tandy MC-10. The text driver emulates a 64 column x 24 line display. The demo is printing the entire 96 character font over and over. When it gets to the end of the last line on the display it scrolls the display, clears the last text line and then continues printing. You can't see what is happening at the bottom because the emulator is mirroring the top 1/3 of the screen like the original unmodified machine but the software will use the entire display if you hack the real machine to have 8K of internal RAM.. Sadly, the video recording software couldn't keep up with the display and youtube degraded the quality further so it doesn't look as good as the real thing. .100_0287.MOVPhantom 8 Bit2010-09-30 | Union Pacific Engine 3985 Steam Locomotive Stopped in Lodgepole, NE for grease and fuel oil September 30, 2010 Panning the camera along the locomotive100_0286.MOVPhantom 8 Bit2010-09-30 | Union Pacific Engine 3985 Steam Locomotive Stopped in Lodgepole, NE for grease and fuel oil September 30, 2010 Greasing the Locomotive100_0262.MOVPhantom 8 Bit2010-09-30 | Union Pacific Engine 3985 Steam Locomotive Stopped in Lodgepole, NE for grease and fuel oil September 30, 2010 Arrival100_0299.MOVPhantom 8 Bit2010-09-30 | Union Pacific Engine 3985 Steam Locomotive Stopped in Lodgepole, NE for grease and fuel oil September 30, 2010 Coming to the next crossing as it leaves100_0298.MOVPhantom 8 Bit2010-09-30 | Union Pacific Engine 3985 Steam Locomotive Stopped in Lodgepole, NE for grease and fuel oil September 30, 2010 Pulling away
This is for the train fanatic that was standing near by. He said he had been crazy about trains since he was little. He's 4 now. :)video00.aviPhantom 8 Bit2010-04-08 | Sample Oric music player running on Oricutron.