The GEOS operating system managed to clone the Macintosh GUI on the Commodore 64, a computer with an 8 bit CPU and 64 KB of RAM. Based on Maciej Witkowiak's work, I created a reverse-engineered source version of the C64 GEOS 2.0 KERNAL for the cc65 compiler suite:
https://github.com/mist64/geos
- The source compiles into the exact same binary as shipped with GEOS 2.0.
- The source is well-structured and split up into 31 source files.
- Machine-specific code is marked up.
- Copy protection/trap mechanisms can be disabled.
- The build system makes sure binary layout requirements are met.
This makes the source a great starting point for
- adding (optional) optimized code paths or features
- integrating existing patches from various sources
- integrating versions for other computers
- porting it to different 6502-based computers
Just fork the project and send pull requests!
True stuff. Great work man. I am not an expert in 6502 neither C64 architecture, but found this stuff very interesting. Let’s see if people evolve it.
Keep the good work!
Wow, I didn’t know you have the owner of this blog, though I read this since a while 🙂 I made a few changes in my fork (as you know already), most notably maybe (other than the somewhat normalized C65 related stuffs) using ca65 itself to construct the final “combined” image so it can be even controlled by config.inc what kind of driver to be included in the resulted image.
Big thumbs up!
Is there any code and app support for 80 column screens in there, and operatingout of bank switching?
The developer of the Vic2 chip overlooked it to do 80 column text, as a proof they could do a next release 80 column version of the Commodore 64. Sadly the board turned him down. His vic1 chip alsohad registers for character widths beyond 80 columns, which wasn’t implemented, but I believe there was a protoype, of at least a 40 column Vic-20 successor.
Such as, if somebody overclocked a c64 or plus/4 to produce 80 columns+ display output, the geos and apps, could be put into and 80 column mode, or at least adjusted, also with driver for any 80 columns hires screen?
This is also very important for Atari computers, as Atari also had prototypes, one for and advanced 16 bit 6502 sprite based games machine. So, a similar thing would be setup, if anybody released that machine, or had an 80 column display adaptor.
If there is no support, can I suggest a simple universal driver for all machines? As a fail safe measure that a graphics adaptor maker could use, and users could set up to use their old 80 column graphics adaptors with, to use all geos software. It would not be as fast as the native custom drivers, or meant to play games (but you could add some hardware scroll and sprite feilds, timers, raster interrupts, blitter, window and draw command fields, if you wanted). They can always switch to bios mode to play native games.
It allows multiple coloured icons to be supported.
It allows geos and geos apps to be recompiled and used on many more home machines.
Why aren’t I doing this myself? I’ve been long too sick to do it. I no longer have a Commodore 64. But, it seems like a good idea fir everybody else. 😀
—
The following fields would have to be moved around and offset pointers used, to optimise code. But, the following are just feilds that can be used with a preferences panel, to set up a mode to put in a file geos translates registers into an optimal format. As such, most people who use it might only have 1 or 3 mode definitions, existing modes already being built into geos. But, it does allow a market for new graphics boards, that game could eventually run on.
—
Where for each chacter or graphics mode (totalled in a count, with offsettes to each mode):
(The driver simply receives a pointer to display memory for that mode. This maybe made into a range of values, with address and bitmask to change location, also for character screen location, character sets, and character attributes).
Or simply make a separate mode for each desired location), mode and parameters selection values and their memory location, with bitmasks to tell it which bits to change while protecting other settings in the memory word, if needed:
Modes:
– Number of screen modes
– Offsets to each mode
For each mode:
(Character size is derived by dividing character x,y into bitmapped x,y)
Setting up mode and it’s size and pixel bit depth:
– The bit depth+drgbi mask per bit (if mask is set on, there is no colour atrributes or palletes in this mode).
– bit map location (0 means none)
– count of locations plus values and masks to activate mode and deactivate other modes.
– x wide screen bitmap+location and value+ mask to activate
– y deep screen bitmap+location and value+ mask to activate.
Setting up character mode values:
– Character screen location (0 means no character screen)
– x wide screen character/colour attributes row+location and value+ mask to activate.
– y deep screen character/colour attributes column+location and value+ mask to activate.
Setting up universal colour pallete description:
(If the system software detects other attributes or pallete locations and masks matching the following universal colours, they will be assumed to be primarily these universal colours in function. Border used as border, background as background etc.)
– Universal character colour value location (if zero, then no univesal character colour), bit mask+Drgbi mask list per bit (as per following also).
– Universal background colour value location (if zero, then no univesal background colour), bit mask+Drgbi mask list per bit (as per following also).
– Universal border colour value location (if zero, then no univesal border colour), bit mask+Drgbi mask list per bit (as per following also).
– Universal alternative colour value location (if zero, then no universal alternative colour), bit mask+Drgbi mask list per bit (as per following also).
Setting up colour attributes descriptions:
– Character colour attribute location (if zero, there is none), size of each attrubute’s location in bits.
(The x and y size of the attributes field, is presumed to match the x and y of the character field above).
(In the following character colour attributes definition:
– If the Drgbi mask does not allow any values, then that means it is a pallet colour and there is no attrubute value).
– In the Drgbi mask, each bit the same colour or intesity, is presumed to be higher intensity then the last of that colour or intensity, in the direction set by D accross the value.)
– forehground character colour bit mask+Drgbi mask list for each bit of mask (as above).
– background character colour bit mask+drgbi mask list for each bit of mask (as above).
– alt character colour 1 mask+drgbi mask list for each bit of mask (as above).
– alt character colour 2 mask+drgbi mask list for each bit of mask (as above).
Setting up palletes description:
– Number of palletes.
– For each pallete: location set up, value, bit mask, location of pallete, count, size of each entry, bitmask+Drgbi for each bit of each entry.
This format presumes 0 to 4 unique colour attributes possible per chacter cell. If an attribute is off, the pixel value refers to a pallete entry. If all attributes are off, it refers to the bitmap Drgbi mask above. This allows for s variable range of bit depths. Such that 16+ colour bitmap modes and 640×400+ graphics adaptors.
Bank switching:
A universal registration file to describe the location size, type and control of bank switching. Such that, parts of geos and apps, can be stored in different banks and economically switched in as desired to jump to and run.
Somebody could make a custom ram cartridge with sd card support (new graphics, sound and usb) and store megabytes of code in banks. A bit like a file system, swap or paging, code is put in by geos where it fits, and swapped into execute. The sd card could store all the code, and apps be loaded into banks and left there when needed. Such that geos could treat it like a virtual memory having and resource storage and bank location execution list. A step further and the file on the sd card could be treated as memory and the banks like cache. In the early 80’s, who would need a PC, of this was about. I know that this takes memory, but if you have bank switching it no longer matters so much.
A few things will be missed here.