[stella] Common 2600 support files submission

Subject: [stella] Common 2600 support files submission
From: Manuel Rotschkar <cybergoth@xxxxxxxx>
Date: Fri, 14 Nov 2003 23:27:41 +0100
Hi there!

Andrew, please don't kill me for probably forcing you to 
update update the 2600 support files the third time in 
three days, but with this I'm done for this year. 
Promised. :-)

The attached ZIP files mainly contains a 4K template, 
which gives a perfect jumpstart for any 2600 
development. It does a safe, complete & working TV 
frame, yet it has very minimized overhead and is very 
small and it encapsulates all knowledge about the TV 
frame in working black-box macros.

To achieve this, I added basic PAL/NTSC support to VCS.H 
and the makros

START_VBLANK_TIMER
EXPIRE_VBLANK_TIMER
START_OVERSCAN_TIMER
EXPIRE_OVERSCAN_TIMER

to makro.h

As an appetizer, here comes the complete template source 
(All is in the ZIP again):

-------------------------------------------------------
; 4K Template
; Compiles with DASM and is tested Z26. 
; Done by Manuel Rotschkar (cybergoth@xxxxxxxx)

; Uncomment for PAL:
; COMPILE_VERSION         = PAL

    processor 6502
    include vcs.h
    include macro.h

    SEG.U   variables
    ORG     $80

frameCounter    ds 1
; Add more variable definitions here

    SEG     Bank0
    ORG     $F000

Start               
    CLEAN_START
    JSR Init

MainLoop
    VERTICAL_SYNC

    START_VBLANK_TIMER
; Add calculations during VBLANK TIME here
    EXPIRE_VBLANK_TIMER

    JSR MainScreen

    START_OVERSCAN_TIMER
; Add calculations during Overscan here
    EXPIRE_OVERSCAN_TIMER

    JMP MainLoop

Init
; Add Initialisation code here
    RTS

MainScreen
    STA WSYNC
    STA VBLANK          ; Stop vertical blank

; Replace with your own kernel code from here...

    LDX #190
DoScreen
    STA WSYNC
    STX COLUBK
    DEX
    BNE DoScreen

; to here...

    STA WSYNC
    LDA $02
    STA VBLANK          ; Start vertical blank
    RTS

; Reset Vector
    ORG        $FFFA
    .word Start
    .word Start
    .word Start
-------------------------------------------------------

Note: I did not change the version tags of vcs.h & 
macro.h, so please just take a look at all the stuff, 
but only use it after Andrew has approved and officially 
uploaded it. (If he does... at least I hope so :-))

BTW: The latest base adress fix works as intended!

Greetings,
	Manuel

Attachment: support.zip
Description: Zip archive

Current Thread