In order to make the compiled code as efficient as possible, the MIDRES library introduces the fewest possible abstractions. In particular, it tries to exploit the similarities between different chipsets and architectures. One of the similarities is the memory mapping of the various features.
Therefore, here below we give a series of functional mapping primitives and their relative in-memory deployment for the various architectures.
Each architecture has a starting address where the compiled C code (the assembly code) begins. As a rule, it begins at the start of the equivalent BASIC program. In fact, the cc65 compiler generates the appropriate “loader” which is nothing more than a “SYS” towards the first assembly instruction.
Sometimes, due to the overlap between the graphics memory and the BASIC program, it was necessary to relocate the starting address to a different location. In this case, a small loader (written in BASIC) is attached, which takes care of loading from disk the assembly in the correct location before starting it.
This type of memory maps a surface of letters (or “tiles”) made up of a certain number of rows and columns. Each letter (or “tile”) is represented by an 8-bit unsigned number. This number represents an index in the special memory (see below).
This type of memory contains the pixel-by-pixel and monochrome representation of each letter (or “tile”) indicated by the 8-bit unsigned number, as present in video (text) memory (see above).
This type of memory can be used by displacement primitives (or “bitblits”), and does not necessarily correspond to anything visible on the screen.