Posts

Hello VERA (BASIC vs C vs Assembly)

Image
This short tutorial is a very simple comparison of three main languages used to develop software on Commander X16. Instead of printing standard Hello World message, let’s do something more interesting and specific to the platform but still try to keep it as simple as possible. There is nothing more unique to Commander X16 than using VERA and let's throw in reading a mouse . I will not go into details on how to install development tools and what editor to use etc. but will focus on coding to highlight differences between approaches to make it easier to choose or transition between languages regardless of what your background is. The only background required is a basic understanding of VERA (Versatile Embedded Retro Adapter). If you need a quick overview, I wrote a post  here . Goal We will write simple drawing programs in default text mode. We will use the mouse for drawing and pressing the left mouse button will draw by filling the character over which we are hovering and t

Direct VERA Access

Image
*** Mostly obsolete, valid for Emulator versions before R.37 - Check the VERA Overview instead *** In this short post we will discuss access to graphics using direct access. We will explain the memory organization and test it with Basic and later translate it into Assembly program When programing in Basic we have few handy commands that make access to graphics simple and seamless. For example using VPOKE and VPEEK we can write and read to and from any address in video memory. With VLOAD we can load chunks of data directly into Video memory. So why would accessing it with machine code be any different? To explain let’s look at the (simplified) memory map of Commander X16. The CPU is using 16 bit address bus and therefore can directly access 64 Kbytes of memory. We call it CPU memory. Commander X16 actually has more memory which CPU can access through “banking switching” however it can still only address 64 at any given time. On the other hand we 128K of Video mem

Commander X16 Premium Keyboard

Image
It comes in simple and rather small box that was heavier than I expected. I like it, if keyboard has some weight to it and is not empty plastic thing. Opened lid reveals the keyboard neatly wrapped in a foam. Keyboard is out and looking very pretty, here with all the accessories that were in the box: The keyboard itself USB cable Two USB-PS/2 adapters Keycap removal tool Users Guide Couple of stickers Backside of the keyboard reveals channels that allow us to guide the connecting cable to either side or down the middle (five possibilities in total). Closeup of the USB C connector and DIP swicthes for setting desired configuartion. Users Guide is a tiny sheet of paper but probably contain everythin we need to know about the product and how to use. Closeup of the keys and print. And of course the logo. And finally for those who are interested in the clicking sound of Cherry MX blue switches, here is a short demonstration:

Default Palette

Image
Commander X16 uses 256 color palette, each of the component colors (R, G and B) gets 4 bits therefore we can choose from total of 16*16*16 = 4096 combinations. At startup we get pretty good collection of default colors. First 16 colors are similar to Commodore 64 colors, the next 16 are all possible clean gray colors followed by spread of other colors of different hues and intensities. Below are the table of defaults. I exported these colors directly from Commander X16 emulator using a simple Basic program that can be downloaded below. I also included links to two versions of bitmaps that can be used to import into paint programs or sprite design tools. Please note that Color 0 in 256 color mode is actually replaced by transparent "color" and black indexed 16 can be used instead. Index R G B 0 0 0 0 1 15 15 15 2 8 0 0 3 10 15 14 4 12 4 12 5 0 12 5 6 0 0 10 7 14 14 7 8 13 8 5 9 6 4 0 10 15 7 7 1