1 ; Atari VCS 2600 startup code for cc65
3 ; Florent Flament (contact@florentflament.com), 2017
6 .export __STARTUP__ : absolute = 1
8 .import __RAM_START__, __RAM_SIZE__
12 .include "zeropage.inc"
20 ; Initialization Loop:
21 ; * Clears Atari 2600 whole memory (128 bytes) including BSS segment
22 ; * Clears TIA registers
23 ; * Sets system stack pointer to $ff (i.e top of zero-page)
35 ; Initialize C stack pointer
36 lda #<(__RAM_START__ + __RAM_SIZE__)
37 ldx #>(__RAM_START__ + __RAM_SIZE__)