Monday, 21 October 2019

BASIC 10 Reference

Today we have a guest post from Edilbert, one of our great volunteers in the MEGA65 team, who has been working on documentation for BASIC 10. As you will discover, this was no small task.  But I'll stop here, and hand over to Edilbert...

I followed the MEGA-65 for some years and wondered how long it would take until I could buy this fascinating machine. Then I read Paul's post in the Forum64, where he asked for support. So I thought, it would be nice to join the team and contribute. 

Initially I thought, I could do some assembly programming for the operating system or the BASIC interprenter, but they needed writers for the user's guide. So I proposed to write the chapter: BASIC-10 command summary. I really underestimated the work, that would be needed. First, I had to write the stuff new with my own words - no copy and paste from existing sources. Preliminary versions of the Commodore C65 exist, but they cannot be used for copyright reasons. 

Then I got access to the repository with the stuff, that was created already. It was a bunch of LaTeX files with some text, some program generated tables and templates for all planned chapters. Well, I thought to be an expert in LaTeX, because I wrote all my scientific papers with that program, but then I always got layout templates from the journal editors and had to insert text, figures and citations. This one was a completely different beast. It was a snake pit. First I had to install some extra packages, that were unknown to me. After the first successfull LaTeX run I got a pdf (hurrah) but also a log file with more than 6000 lines of errors and warnings. I thinks, this was due to the effect, that different contributors used packages, that were sometimes incompatible. So I decided, that I should first read through the log file and eliminate as much errors and warnings as I could. This was not easy, but I managed to find solutions and workarounds in most cases. 

The next problem was the screen font, that was used to illustrate example programs. The used font was for 40 column screens and not free of copyrights. So I created my own true type font for this purpose for a 40 column and a 80 column screen. 

Now I started to fill in the contents for the BASIC-10 chapter. I took the syntax from existing sources but wrote a new text for the description and tried to find a compromise between mathematical correct and user friendly formulation, which is sometimes difficult. I wrote 190 pages of text, thought about example code, tested this code on a Commodore 128, where possible and tried to make it readable.  

The result is a page like this for every BASIC 10 keyword, with the nice screen font for showing how examples would be typed:

The LaTeX source for a page like this would be:

Now after 6 months and more than 150 work hours the chapter is written. We need probably some revision, to improve the English, make some text clearer and insert better code snippets, but the first version is done. 

Now I'll focus on the screen font (add graphic symbols) and layout. But working with the MEGA-65 team is a great pleasure and motivation. I'll continue and am looking forward to get in some future my own MEGA-65 hardware.

Thursday, 19 September 2019

(Even) More Assembly

 Assembly of the pre-series machines continues to march ahead.  Here for your viewing pleasure are 12 beautiful MEGA65 pre-series machines.  The majority of the pre-series machines have now been built.

You can also see a short flyover video of the machines, accompanied by random animal noises for no apparent reason:

Sunday, 15 September 2019

Changing the drive number of the internal drives

A number of people have asked in the past how to change the drive numbers of the C65's internal 3.5" drive.  By default it sits on both device 8 and 9 (for the optional 2nd 3.5" drive via the little round PS/2 style plug on the C65).  Until now, I didn't know.  But Falk who is working on GEOS for the MEGA65 figured it out:

You just have to set the contents of $10113 and $10114 to the device numbers.  Note that these are 20-bit C65-style addresses, so you have to do some jiggery-pokery to swap them if you are in C64 mode on a C65, since there is no 20-bit monitor in C64 mode.

You can work around this by using the OPEN command to command the device number changes, e.g.:

However, if you are on a MEGA65, life is much simpler:  Long-press the RESTORE key to enter the Freeze Menu, and then press 8 to toggle the drive number of the first internal drive between 8 and 10, and 9 to toggle the second between 9 and 11, as you can see in these shots:

With this, you can easily have an external 1541 or similar on device 8, and do things like, say, load Sam's Journey:

Anton assures me that Sam's Journey is VERY smooth on the MEGA65.

Or better yet, see it in action:

Actually, one of the really great things about this post, is that all I did was a 5 minute fix to the Freeze Menu based on information that others had worked out, and the result was then tested by Anton.  That is, this is more of a post by the community and for the community, than it is a usual "what has Paul been making lately" post.  I hope that we see more and more of this kind of post, as the pre-series and then dev-kits and then retail versions of the MEGA65 get used more over time.

Friday, 13 September 2019

More Assembling of MEGA65 Pre-Series Machines

Just a quick post with some eye-candy of the growing number of fully assembled MEGA65 pre-series machines:

So much 8-bit fun in so little space!

Meanwhile, we continue to work to assemble the rest, and to figure out a good solution for financing the creation of the injection moulds for the cases for mass-production (the pre-series machines were produced using a very expensive per unit vacuum form process, that is much too expensive for mass production).

This is really the biggest remaining barrier. While we have some ideas we are exploring, now would be a great time for any wealthy sheiks in the audience to offer us their patronage ;) Or people willing to run sausage sizzles at their local home improvement stores, or whatever. We estimate the total cost of this stage to be around 65,000 €.  We'd naturally be happy to talk about appropriate ways to recognise any such support.

Of course this is the frustrating part where we need actual money, rather than being able to use volunteer labour. If I tried to calculate the value of the volunteer labour, I'd have to guess somewhere between 500K and 1M €, if we had to pay folks to have done the work.  This really is a labour of love on the part of many -- and from which we all benefit, since if we had to fund this project "properly" from the start, then (a) it probably wouldn't have happened; and (b) if it had happened, it would have had to have cut so many corners that it wouldn't be recognised. It is only through the voluntary efforts of so many that we have managed to re-create this lost unicorn of computers.

We really want to get this last hurdle settled before we move forward, because how we fund this is really the greatest uncertainty left in the process of determining what is a possible price, and thus to start moving towards being able to offer a pre-order mechanism for everyone who is longing to hold their very own MEGA65 in their hands.

Thursday, 12 September 2019

MEGAphone rev2 PCB assembly work

While I have been flat out teaching, and thus lamenting the lack of time to work on the MEGA65, the same has not been true for my faithful students who have been doing great work on the MEGAphone. More specifically, on preparing the 2nd revision of the MEGAphone PCB to fix all the problems we found in the first revision.

The new PCBs arrived while I was in Germany at the CCC Camp.  But yesterday and today was time to by hand put all the surface-mount components onto the board and bake it in the oven to get all the components to solder down.

The following two shots show the board after they had been through the oven:

The hole-through components still need to be added, and we had only one of the LoRa radios on hand, so the other has been left vacant.

More news when we have put the hole-through components, and can start trying to bring the machine up.  Hopefully we won't need to do too many changes to the VHDL, as the boards are logically very similar.

Wednesday, 4 September 2019

Assembing the next few Pre-Series Machines

Keen MEGA65 watchers will know that the first two pre-series machines have already been assembled and are with me here in Australia.

However, all has not been quiet on the western front, with a couple of assembly nights, first to fit the missing pull-up resistors (this was while I was in Germany for the CCC Camp), and then again this week, to begin assembling several machines.  There will be similar gatherings each week until the remaining units have been assembled and our little packets of 8-bit perfection is ready to face the world.

We thought you might like to see a time-lapse of these first two evenings.  For the first one, we didn't have a proper camera handy, so we just put a phone on a convenient light-fitting, hence the slightly funny view from above.  You can also see my legs as I try to get some much needed sleep while waiting for FPGA synthesis to complete ;)

Then this week, the guys got together (sadly in my absence, as I am now back in Australia) and completed the assembly of the next four machines:

Tuesday, 2 July 2019

Last day of current MEGA65 development sprint

Okay, so today is the last day of the current MEGA65 sprint.  I am currently trying to get the following things working:

1. UUID serial EEPROM for MAC address etc
2. Real-Time Clock + onboard SRAM
3. Ethernet
4. HyperRAM

And currently having only limited luck with most of them.

The UUID EEPROM has 256 bytes of memory, the first 128 are writable, and the last 8 provide a globally unique identifier that can be used for generating a MAC address for ethernet. This was the easy one: Adapt the I2C peripheral code I wrote for the MEGAphone, and change the I2C addresses, and voila*, I was able to read it.

* Where voila actually means synthesising probably 3 or 4 times to track down all the little errors.

Then it's currently all a bit down-hill.

The real-time clock and its SRAM I have also mapped, and I can read and write the SRAM, which is great, and I can read and write MOST of the RTC registers, which is not so great. Specifically, I can do anything I like, except for set the clock.  Now, there is a register that controls this, and a WRTC bit that must be 1, before the registers can be written to.  And I know I can write to this device, because I can set the register with that bit, and I can even set the RTC alarm, and all sorts of other things -- but what I cannot get it to do, is to set the actual time.  The only clue I have found so far is in an example driver, which sets all 6 bytes at the same time.  So I might have to modify my code so that it does the same, to see if it helps.

Then we have the ethernet adapter.  Ethernet really shouldn't be a problem, as we have had it working in the past.  What I can confirm so far, is that the reset line works, because I can stop and start the ethernet, in so far as I can make the link LED go away, and then when I start it again, it reappears after a couple of seconds.  However, there is no hint whatsoever that the ethernet is actually transmitting or receiving anything to/from the FPGA.  Again, there really aren't any good places to probe with the oscilloscope, to see what is going on.  I'll have to keep thinking about it.
Then finally we have the 8MB HyperRAM that will be the expansion RAM of the MEGA65. The HyperRAM is not responding to read requests, and I am not yet sure why. I have switched to using a known-working open-source HyperRAM driver, and have it synthesising (which was a bit of an adventure due to a silly mistake on my part).  It is just timing out when reading, which could mean one of many things.  The chip is a little BGA, so I can't easily probe its pins to see what is happening.  So that's currently stuck.

So the current situation is quite frustrating. I guess I will start with trying to get the RTC working, and think about the others at the same time.

But, the day has got away from us, so these will have to wait until I am home in Australia, and have time to attack them.  But even with these little frustrating bits at the end, it is really pleasing just how much we have managed to achieve: the MEGA65 now runs on real hardware, and is super fun and pleasing to use.  We are currently making a series of short show-and-tell videos showing off the system, which can be found at:

They are well worth the look, so hop on over and have a look!