Jump to content
  • entries
    13
  • comments
    39
  • views
    8,991

2600 Display Kernels


splendidnut

232 views

Welcome to the wonderful world of 2600 display kernel writing.

 

Here's a quick overview of some of the display kernels I've written:

 

-----

Chaotic Grill


Chaotic Grill uses a 5-line display kernel... similar to the M-Network version.  It uses DPC+ to gain access to RAM

and Data Fetchers with Fast Fetch capability.  It uses half of the 4kb DPC+ display RAM as a graphics buffer for

the displaying the burger pieces.

 

The main 5-line kernel is broken into two parts:

    - Lines 1-4 = Draw Burger pieces

        - Draw 2 multi-colored single-line resolution sprites (GRP0, GRP1, COLUP0, COLUP1)
            - Draw 32 pix wide (PF1/PF2) asymmetric playfield that is multi-colored (4 COLUPF updates)
        - Check for split point
                OR
        - Draw Pepper (enable/disable: ENAM0 / move: HMM0 + HMOVE)
                OR
        - Draw Pepper (enable/disable: ENAM0), and reset COLUPF for level drawing, WSYNC

        (upto 15 TIA updates -- which requires DPC+ Fast Fetch to accomplish)

 

    - Line  5   = Draw Level platforms and ladders

        - Draw 2 multi-colored single-line resolution sprites (player objects)
        - Draw 36 pix wide (PF0/PF1/PF2) asymmetric playfield, single color
        - Clear-out Pepper drawing -> disable ENAM0
        - Spare time (8 cycles)

 

In addition to that, there's 18 variants of the above to handle repositioning P0 and P1 (one or the other, not

both).  There are that many variants because the respositioning has to be interleaved with drawing the burger

pieces.

 

-----

Congo Bongo POC

 

Congo Bongo uses multiple 2-line kernels:

    - Draw 32pix wide (PF1/PF2) asymmetric playfield (single-line resolution) and set color for each line (COLUPF)
    - Draw 2 multi-colored double-line resolution sprites (player objects)
    - Draw a coconut using the missile (just enough time to enable/disable: ENAM0 and resize: NUSIZ0)
    - Ability to exit the kernel at a specified split-point and move on to the next kernel

 

    The drawing method for sprites uses "illegal"/undocumented 6502 CPU instructions:  
      DCP (decrement and compare)
      LAX (load A and X)

 

Drawing Bongo's head uses it's own 2-line kernel.


-------

Paint The City

 

Paint The City's Display Kernel is a bit complicated.  It uses a LOT of RAM and the code has been heavily unrolled to

handle interleaving road graphics preparation logic while drawing the sprites + buildings.

 

The simple breakdown is the display kernel uses 2 different types of 1-line kernels:

* Draw Buildings kernel:

    - Draw 40pix wide repeated playfield (20pix repeated playfield)
    - Draw 2 single color single-line resolution sprites (player objects)
    - Road graphics preparation (read level and painted road from RAM and use it to prepare 18 bytes of playfield

data)

* Draw Road kernel:

    - Draw 40pix wide asymmetric playfield (40pix .. so 6 TIA updates per line)
    - Draw 2 single color single-line resolution sprites (player objects)


Since the kernels are split into 8 and 16 line rows, the sprite graphics are basically padded out with enough zeros

to fill that amount of space.  Each row has it's own sprite pointer for loading data into GRP1.

 

  • Like 5

1 Comment


Recommended Comments

Someday I'll be a man and create a display kernel.  Always wondered if you could solve the flickering issue by interleaving sprites between scanlines.  Probably look horrible unless using very bright colors and very fine resolution via bus stuffing.  I guess.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...