News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Retro Computer Environment

Started by kevin, February 05, 2014, 12:44:41 AM

Previous topic - Next topic

kevin

  Retro Computer Environment

    RCE is a small library of PlayBASIC functions that gives the programmer a chance to experience retro 8bit styled graphics programming in a modern environment.   8bit systems used some notoriously difficult display hardware in them, making programming even the most trivial things (like drawing dot) an exercise in frustration. However there is great value for the modern programmer in learning about them, in particular in working with bit level (binary) operations and understanding bare bones memory access.  Which is one of those things that seems to be a mystery to many today.

   Retro computers generally used planar styled displays.  In such displays,  8 on screen pixels are represented by a single byte.  Where each bit within the byte is an individual pixel on screen.    This can be pretty efficient in terms of memory usage, but it raises the complexity of drawing bitmap graphics.    To make matters worse, retro systems often didn't have a linear frame buffer.   Meaning that display memory wasn't set out in an and easy to understand row by row format like it is today,  rather consecutive bytes could be in all sorts of patterns.

   The library creates a 2 bit planar frame buffer, that's 640 by 400 in size,  since each byte is 8pixels, then a row of pixels is 80 bytes (640/8).  To make life easier the buffer is linear. So scan line two of the buffer starts at +80 bytes into video memory, line 3 starts at +160 bytes into video memory.   The library includes some functionality such as simple DOT and BOX routine. Neither are that optimal, in particular the BOX function.  


   It works by using the palette mapping features added to PlayBASIC V1.64O last year.   There's a few helper functions included also to get the programmer started, but really the library acts as a way of testing the programmers understanding of memory and bit level operations in practical way.   ie.. learn by doing.

       
  Learn More: Challenge #27 -  Learn binary operations through Retro Computer Graphics    (source codes)