MEGA65 FORUM

Text-only yet up-to-date tutorial

append delete Ralph Egas

Hey guys,

A new tutorial would be appreciated. Text-only is fine. The current video seems out-dated or a bit flakey.

I've read all the blog articles from the very beginning (retro-actively).

I've made it past flashing from SD and getting all required files on it. The kickstart 0.3 (embedded) boots fine. Then it says it fails to mount a partition and can find the root dir ('/'). I expected to see a familiar C64 like display with the rainbow logo.

I'd love to contribute, mostly on tools written in assembly, but I first need to be able to get the party started! ;)

Cheers,
Ralph

Reply RSS

Replies

append delete #1. Deft

Hi Ralph,

I sent you an email. Please consider writing a tutorial and putting it her yourself once you get it done. I will support you on the process of getting everything to work. However our time makes it hard to write a better tutorial atm so we need to rely on the community to do so :)

append delete #2. denti

Hi Ralph

have you managed to solve the problem?

Cheers,
Ruediger

append delete #3. Ralph Egas

Nope, after some e-mail communication it turns out the problem is with the SD card I'm using. It's a 4GB SDHC which should work but doesn't. I've ordered a bunch of old 2GB cards on eBay just now and I'll check back in when everything is working. I'd be happy to write a text based tutorial as Deft suggested when I'm at that point.

Cheers,
Ralph

append delete #4. Deft

Please see thread "Monted 00 Partitions". If you succeed please write a tutorial and put it somewhere here. We are super busy building the cases, the keyboards and the pcbs right now so it is impossible to put time into a better tutorial atm.

append delete #5. Ralph Egas

Sure, no problem. I'll write a tutorial like I said I would. Still in the process of establishing all ins and outs regarding creating a compatible partition. Once that's done I'll write a step-by-step-in-a-way-a-monkey-can-do-it tutorial ;)

append delete #6. Ralph Egas

And here's the long anticipated MEGA65 Prelease Starter's Manual!

http://www.dropbox.com/s/3b6a1amm0eusqqj/MEGA65%20Prerelease%20Starter%E2%80%99s%20Manual.txt?dl=0

Enjoy!

:: @Ralph Egas added on 25 Aug ’15 · 00:35

MEGA65 Prerelease Starter’s Manual
- By Ralph Egas

Version 0.1

// ================================================================================

Contents

// ================================================================================

1. Prerequisites
1.1 Nexys(tm)4 DDR board
1.2 USB Keyboard
1.3 VGA Monitor
1.4 SD Micro card
1.5 A Windows PC and SD Micro card reader
1.6 DirMaster software
1.7 The MEGA65 FPGA bitstream

2. Configuring the Nexys(tm)4 DDR board
2.1 Jumper settings
2.2 Hooking up power and peripherals

3. Preparing a SD Micro card
3.1 SD Micro card types
3.2 Partitioning and formatting
3.3 Mandatory and optional files
3.4 Obtaining a D81 virtual disk file

4. Booting
4.1 Power on
4.2 Program
4.3 Reset

5. Using the MEGA65
5.1 C65 mode
5.2 C64 mode

// ================================================================================

1. Prerequisites

// ================================================================================

1.1 Nexys(tm)4 DDR board

------------------------

The MEGA65 is based on the Nexys(tm)4 DDR FPGA board from Digilent and carries an Artix-7(tm) Field Programmable Gate Array (FPGA) from Xilinx. This component is used to host MEGA65’s circuits like the GS4510 CPU, VIC-IV Video Controller and other circuits. Apart from the FPGA, the board sports various IO ports like VGA, USB, Ethernet, Mono audio and other connectors that will be used in the final MEGA65 design in an appropriate form factor.

The board can be ordered at various online shops like http://shop.trenz-electronic.de in Europe for around EUR 300 and http://www.digilentinc.com themselves in the US for around USD 320 at the time of writing.

The board comes with a USB to micro USB cable to power it using a computer or a USB wall socket.

1.2 USB Keyboard

----------------

In order to type on the MEGA65 (and do anything, really) you need to attach a USB keyboard to the USB socket that sits between the power connector and the Ethernet port.

The Nexys(tm)4 DDR board has a limited load capacity on its internal USB bus however and as a result USB keyboards with embedded USB hubs tend to drain too much power. It’s strongly advised to use a simple / old PC (Windows) keyboard without active LEDs or any other parts that consume any power at all.

1.3 VGA Monitor

---------------

Although the final design will probably (also) generate a more mainstream 1080p HD signal, at least for now it’s important to either use a monitor that supports 1920 x 1200 or alternatively a 1080p capable TV / monitor and a separate VGA to HDMI converter (like the Atlona AT-HD500 for example) that converts the signal into the 1080p signal your HD TV / monitor supports.

Some TVs / monitors that output 1080p are capable of handling the higher vertical scan frequency necessary for 1920 x 1200 but most will not.

Optionally a Mono audio cable can be used to connect to the line-in of your monitor if it has audio support. Make sure one end of you cable fits the monitor line-in and the other end is a male Mono mini jack plug.

1.4 SD Micro card

-----------------

Plain SD Micro cards up until 4GB are currently officially supported. Some 4GB cards are known not to play nice though, so right now the safest bet is an (old) SD Micro up till 2GB. Cards like that may be hard to get by in your local store but there’s a ton of opportunity to get them from eBay. Most importantly, the card should not be of the newer SDHC or SDXC kind that support higher capacities, at least not for the time being.

1.5 A Windows PC and SD Micro card reader

-----------------------------------------

At the time of writing a Windows PC / laptop with an internal or external SD Micro card reader is needed to populate an SD Micro card with data in order for it to be successfully read by the MEGA65 due to the current SD card driver in the MEGA65 being sensitive to a specific partition and layout. This means that an Apple Mac will not be capable of formatting an SD Micro card the right way for the MEGA65 to read its contents currently.

1.6 DirMaster software

----------------------

This Windows software can be acquired from Style’s website here: http://style64.org/dirmaster. With DirMaster it’s possible to populate a D81 image with C64 / C65 files like games and pictures or whatever contents you’d like to access on the MEGA65. Although mounting D81 disks is optional, there’s not a lot one can do on a MEGA65 without loading software and / or saving work to disk. The D81 file format stems from the old 1581 disk drive that was a much sought after (expensive) item back in the day whereas most people with drives had 1541’s supporting 5.25” floppy disks. The 1581 chewed on the then more modern 3.5” instead.

1.7 The MEGA65 FPGA bitstream

-----------------------------

Last, but not least, a prebuilt bitstream file can be acquired by getting registered at http://mega65.org after donating at least EUR 5. By contributing to the project you’ll help ongoing development and to provide this service. After registration you’ll be kept updated with the latest core files and necessary information. The bitstream is basically the footprint for programming the FPGA on the Nexys4 DDR board, the single-most important component on the board and where the MEGA65 computer circuitry is hosted.

// ================================================================================

2. Configuring the Nexys(tm)4 DDR board

// ================================================================================

2.1 Jumper settings

-------------------

Please locate the following jumpers on the Nexys4 DDR board and adjust them where necessary:

JP1 - Located near the VGA port. In order to boot the MEGA65 FPGA bitstream and configure the FPGA to host the MEGA65 circuitry, this jumper will need to cover the 2 pins labeled ‘USD/SD’. By default this jumper is set to ‘QSPI’ instead so it’s necessary to make this change to boot from SD where the bitstream shall reside. This will be explained in Chapter 3 later.

JP2 - Located closest to the ‘XILINX’ and ‘ANALOG DEVICES’ logo on the Nexys4 DDR board. Set this jumper to ‘SD’ in order for the bitstream to be loaded and configured from SD card rather than from a USB stick. At the time of writing the core files only support booting from SD. You’ll need to hook up a keyboard to the USB port anyway.

JP3 - Located near the +5V DC power connector. Set this jumper to ‘USB’ in order to power the Nexys4 DDR board over a USB cable, for instance by connecting the packaged cable to a PC or laptop. In this case you should hook up your USB power cable to the USB micro connector close to the +5V DC power connector just around the closest corner on your board. Alternatively, by setting the jumper to ‘WALL’ the board gets powered by the +5V DC power connecter instead. For the latter please acquire and connect a power adaptor capable of providing +5V DC on the core pin and GND on the shield. Please refer to Digilent’s website for more specs on power consumption specifics and resulting adaptor needs.

2.2 Hooking up power and peripherals

------------------------------------

Please hook up a USB keyboard without bells and whistles to the USB port that sits between the power connector and the Ethernet port.

Please hook up a VGA cable to the VGA port located on the other side of the Ethernet port.

Optionally hook up a Mono mini jack plug to the mini jack port that sits next to the VGA port on the other side of the Ethernet port. Hook up the other end to an audio receiver like a line-in on your monitor.

After populating your 2GB - 4GB SD Micro card with the necessary files, please it into the SD Micro card slot that is located on the bottom of the Nexys4 DDR board.

Please hook up a power supply according to the JP3 jumper setting as described above.

You are now ready to turn the power switch that sits next to the +5V DC power connector and the MEGA65 should be ready to go!

// ================================================================================

3. Preparing a SD Micro card

// ================================================================================

3.1 SD Micro card types

-----------------------

As stated in Chapter 1, the SD Micro card needs to be 4GB tops and should be plain SD rather than SDHC or SDXC as the latter are not supported by the SD drivers and software. Support for different SD Micro card brands is a work in progress.

3.2 Partitioning and formatting

-------------------------------

On Windows in Windows Explorer, locate the volume / drive letter that corresponds to your SD Micro card and issue a formatting command by right clicking on the volume / drive letter and selecting ‘Format...'. In the Format dialog that gets brought up, leave ‘Capacity’ unchanged, set ‘File system’ to ‘FAT32’ (by default it selects FAT instead), set ‘Allocation unit size’ to ‘Default allocation size’ and type your ‘Volume Label’ of choice (for instance, ‘MEGA65’), uncheck ‘Quick Format’ and click the ’Start’ button. Click the ‘OK’ button to dismiss the warning dialog and the formatting process will kick off.

3.3 Mandatory and optional files

--------------------------------

Once properly formatted, please copy the below files to your SD Micro card in the following order:

- The bitstream file, e.g. ‘20150716ddr.bit’

- A C65 ROM that got extracted from a 1991 prototype C65, e.g. ‘910111.bin’ that can be obtained here for instance: ftp://www.zimmers.net/pub/cbm/firmware/computers/c65/index.html. Please rename this file to ‘C65GS.ROM’ after downloading first and put it under that name on the SD.

- [OPTIONAL] A C64 character rom file of 4KB that got extracted from a C64 or emulator or got custom made, e.g. ‘c64.bin’ that can be obtained here: ftp://www.zimmers.net/pub/cbm/firmware/characters/index.html. Please rename this file to ‘CHARROM.G65’ after downloading first and put it under that name on the SD. The bitstream has an alternative C64-like character set embedded so this file is entirely optional and will mostly be used to provide custom character sets for personalising your MEGA65.

- [OPTIONAL] A boot logo file if you have one available. In a future a tool will be provided to create custom logos. Bitstream updates however are occasionally packed with a boot logo you can use freely. If you have such file available please make sure it is named ‘BOOTLOGO.G65’ before uploading it to your SD.

- [OPTIONAL] A D81 disk file that can be mounted on the MEGA65. To automatically have the system mount your favourite D81 disk file, please make sure it is named ‘C65GS.D81’ before uploading it to your SD.

** After putting the files on SD don’t forget to eject it safely first especially since the SD drivers are sensitive to any kind of anomalies which is also why it’s important to stick to the order of files as presented above.

3.4 Obtaining a D81 virtual disk file

-------------------------------------

Many D81 disk files can be found on the internet. Simply Googleing ‘d81 disk files’ will surely get you plentiful. An alternative way to obtain a D81 file is create one of your own using DirMaster. It features a simple drag-and-drop interface that allows you to copy C64 / C65 specific file to your virtual disk. It’s entirely possible to download C64 games or applications that are in the public domain or that were commercially abandoned and run them on your MEGA65 in C64 mode. At the time of writing probably not all software is working 100% yet but we’re getting close.

// ================================================================================

4. Booting

// ================================================================================

4.1 Power

---------

After all peripherals are hooked up and you’ve got your SD Micro card properly populated with mandatory and maybe some optional files it is time to turn that power switch!

If all goes well the Nexys4 DDR board will get the bitstream from SD, configure the FPGA, fire up the custom circuits in it, effectively booting the MEGA65 computer and run its initial Kickstart software (the OS, basically).

When Kickstart is booting the initial OS bootstrap code it will display the Kickstart version at the top, e.g. ‘C65GS KICKSTART V00.03’. If this doesn’t happen chances are there’s something wrong with the bitstream file, the SD card isn’t inserted or any or all jumpers are in the wrong positions.

Once it succeeds Kickstart will dynamically show what it’s up to until it successfully loads and switches to the code in the mandatory ’C65GS.ROM’ file that in turn shows a familiar C64-like start screen. In the process in will have optionally loaded the ‘BOOTLOGO.G65’ (and displayed it to the left of the Kickstart version text), mounted the C65GS.D81 file if present and overwritten its internal character rom with ‘CHARROM.G65’ if such file is present.

In case Kickstart doesn’t make it to the C65 start screen then either a proper ‘C65GS.ROM’ is missing or the SD Micro card wasn’t properly formatted as discussed in Chapter 3. The partitioning and formatting has to be carried out *exactly* as described earlier due to the sensitive nature of the SD handling in the system while the MEGA65 is a work in progress.

4.2 Program

-----------

There are two buttons located on the Nexys4 DDR board right above the ‘DIGILENT’ logo. The right-most button has a label underneath it called ‘PROG’. When you hold down and release this button the whole board will be reset and the whole bootstrap procedure will start over as if the power was just turned on.

4.3 Reset

---------

The button next to the program button has a label underneath it called ‘CPU RESET’. This button actually resets the MEGA65 that is hosted already on the FPGA. The FPGA will not be reprogrammed in this case, it’s just Kickstart that will carry out it’s initial bootstrap procedure. Basically this comes close to resetting an original C64 or C65 back in the day and the FPGA instead can be seen as a ‘host’ a virtual computer like a C64 lives in.

// ================================================================================

5. Using the MEGA65

// ================================================================================

5.1 C65 mode

------------

From the C65 startup screen you can now issue BASIC commands. Please check Chapter 3.1 of the unofficial C65 manual for a BASIC 10 reference. At the time of writing a copy is located here: http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt.

In order to load files from a mounted D81 it’s necessary to first switch to C64 mode by typing ‘GO64’ followed by ‘RETURN’ / ‘ENTER’. An alternative to invoke the C64 is by resetting the CPU while holding the ‘C=‘ key, currently mapped to the left ’CTRL’ on the USB PC keyboard. Resetting can be done by pressing the hardware button on the Nexys4 DDR board as described in Chapter 4. Alternatively a CPU reset is also carried out by holding the ‘RESTORE’ key, which is mapped to ‘Page Up’ on a USB PC keyboard, for 2 seconds before letting it go.

5.2 C64 mode

------------

In this mode you can play some of the greatest games of all time! Before that happens you’ll have to mount a D81 disk file to become available as a disk in the C64 environment.

Type SYS49152 to invoke the Disk Chooser routine that stays resident in the C64 RAM by default and until it is overwritten. If you’ve provided a C65GS.D81 file on the SD it will show some lines of text on the screen followed by ‘MOUNT C65GS ?’. Press ‘Y’ on your keyboard and the text ‘DISK MOUNTED’ should appear underneath.

At this point you can keep working in the C64 mode or reset the machine (without holding the ‘C=‘ key) and go back to C65 mode.

In either mode you can now show the disk’s contents by typing ‘LOAD”$”,8’ and ‘RETURN’ / ‘ENTER’, followed by ‘LIST’ and ‘RETURN’ / ‘ENTER.

To load a specific file on your disk type ‘LOAD”<filename>”,8’ and ‘RETURN’ / ‘ENTER’, where <filename> is replaced with the actual name of the file you’d like to load. The specific file name will be enclosed by “” and in order to load a file it needs to be of the ‘PRG’ type.

Once loaded you can type ‘LIST’ followed by ‘RETURN’ / ‘ENTER’ to see the BASIC code of the program. In case you loaded a game the BASIC program will typically consist of just one line containing a ‘SYS’ keyword followed by an address.

Type ‘RUN’ followed by ‘RETURN’ / ‘ENTER’ to execute the BASIC program and presto!

The above is just a typical example of a first encounter with the system. The internet however is flooded with ideas and concepts behind the C65 and even more so C64 in case you’re not familiar with the systems. The C64 community is actually pretty alive and there are still people inventing new tricks that people never deemed possible on the C64. This is also where a big part of the fun of working with 8-bit machines comes from. Constantly pushing the boundaries of hardware that in itself does not, only this time with amazing speed thanks to the MEGA65.

Happy adventuring!

append delete #7. Deft

Always up-to-date installation/prerelease starter's manual:
https://docs.google.com/document/d/1mJCqgq311dfQ-uCoNw4VYrjtSRSicyzAKr6txUIOh1Y/edit?usp=sharing

ATTENTION: New bitstream has new filenames!

charset: CHARROM.M65
boot logo: BOOTOGO.M65
c65 rom: MEGA65.ROM
automount: MEGA65.D81

cheers,
Deft

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Deft, gardners, MARCOM