Something went wrong. Try again.
This repo contains stub files for use in a talk on Atari 2600 development at the Buffalo Game Space.
Something went wrong. Try again.
3.0 kB · 131 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Exercise 5; In this exercise you will draw a top and bottom border using ; playfield graphics;; Written for use with 8bitworkshop.com. ; Code included there and "Making Games For The Atari 2600"; by Steven Hugg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; Header;;;; Needed at top of all your source files ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
processor 6502 include "vcs.h"
;;;;;;;;;;;;;;;;;; VARIABLE SEGMENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;
seg.u Variables org $80
;;;;;;;;;;;;;;;;;; CODE SEGMENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
seg Code org $f000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; GENERAL INIT;;;; This code is necessary for initialization ;;;; but you can ignore it until you get curious;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Start sei cld ldx #$ff txs lda #0 ; ldx #$ffZeroZP sta $0,X dex bne ZeroZP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
NextFrame ; next two lines turn off beam lda #2 sta VBLANK ; now three lines of vsync per spec sta VSYNC sta WSYNC sta WSYNC sta WSYNC ; turn off vsync lda #0 sta VSYNC ; now loop through 36 vertical blank lines ldx #36VBlankLoop sta WSYNC dex bne VBlankLoop ;;; INSERT YOUR CODE BELOW THIS - BLOCK 1 ;;; AND ABOVE THIS ;;; now turn beam back on and draw 192 lines lda #0 sta VBLANK
;;; Draw 10 lines ldx #10ScanLoopTop sta WSYNC dex bne ScanLoopTop ;;; INSERT YOUR CODE BELOW THIS - BLOCK 2 ;;; AND ABOVE THIS ;;; Skip 172 lines ldx #172ScanLoopMiddle sta WSYNC dex bne ScanLoopMiddle ;;; INSERT YOUR CODE BELOW THIS - BLOCK 3 ;;; AND ABOVE THIS ;;; Draw another 10 lines ldx #10ScanLoopBottom sta WSYNC dex bne ScanLoopBottom ;;; Add up the above and we're at 192 ; now draw 30 lines of overscan after ; turning beam off again lda #2 sta VBLANK ldx #30OverscanLoop sta WSYNC dex bne OverscanLoop ;;; Now we've drawn our ;;; 3 VSYNC lines ;;; 37 VBLANK lines ;;; 192 scan lines ;;; 30 overscan lines
jmp NextFrame ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; Footer;;;; Needed at bottom of all your source files ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org $fffc .word Start .word Start