Atari 2600 Program Development

Slides:



Advertisements
Similar presentations
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Advertisements

Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Microsoft®.
Photo Slideshow Instructions (delete before presenting or this page will show when slideshow loops) 1.Set PowerPoint to work in Outline. View/Normal click.
Our Digital World Second Edition
SE-292 High Performance Computing
Processor Data Path and Control Diana Palsetia UPenn
Copyright © 2007 Heathkit Company, Inc. All Rights Reserved PC Fundamentals Presentation 35 – Buses.
HARDWARE Rashedul Hasan..
Figure 12–1 Basic computer block diagram.
Gabriel Honoré 1. What is it? A collection of software emulators –A software emulator is a computer program that imitates an electronic device or another.
Mehdi Naghavi Spring 1386 Operating Systems Mehdi Naghavi Spring 1386.
Chapter 5 Computing Components.
Output Devices.
Debugging operating systems with time-traveling virtual machines Sam King George Dunlap Peter Chen CoVirt Project, University of Michigan.
Chapter 5 Computing Components. 5-2 Chapter Goals Read an ad for a computer and understand the jargon List the components and their function in a von.
Hardware-assisted Virtualization
DE2-115 Control Panel - Part I
Exercise 1: Install PC Software & NXT Firmware
Microprocessor & Interfacing
Multimedia Components (Develop & Delivery System)
©2004 Brooks/Cole FIGURES FOR CHAPTER 12 REGISTERS AND COUNTERS Click the mouse to move to the next page. Use the ESC key to exit this chapter. This chapter.
SE-292 High Performance Computing Memory Hierarchy R. Govindarajan
Installing Windows XP Professional Using Attended Installation Slide 1 of 30Session 8 Ver. 1.0 CompTIA A+ Certification: A Comprehensive Approach for all.
MC68HC11 System Overview. System block diagram (A8 version)
Programmable Interval Timer
Slide 1CPU Emulator Tutorial This program is part of the software suite that accompanies the book The Digital Core, by Noam Nisan and Shimon Schocken 2003,
3 Generations of Game Machine Architecture Joe Decuir alumnus of Atari & Amiga.
Team Monte Cristo Joseph Carrafa Sharon Clark Scott Hassett Alex Mason The Deep Fried Game Station.
Team Monte Cristo Joseph Carrafa Sharon Clark Scott Hassett Alex Mason The Deep Fried Game Station.
1 Color Discriminating Tracking System Lloyd Rochester Sam Duncan Ben Schulz Fernando Valentiner.
IC3 GS3 Standard Computing Fundamentals Module
Atari 2600: Stella Console Hardware & Combat Sample Game Software
Compact Flash for CoolRunner™-II CPLDs. Quick Start Training Agenda Introduction What is Compact Flash? CoolRunner-II Implementation Block Diagram Applications.
Atari 2600 Homebrew Darrell Spice, Jr..
INTRODUCTION TO MICROCONTROLLER. What is a Microcontroller A microcontroller is a complete microprocessor system, consisting of microprocessor, limited.
How Hardware and Software Work Together
© Paradigm Publishing Inc. 2-1 Chapter 2 Input and Processing.
MICE III 68000/20/30 MICETEK International Inc. CPU MICEIII MICEView Examples Contents Part 1: An introduction to the MC68000,MC68020 and Part.
XP Practical PC, 3e Chapter 16 1 Looking “Under the Hood”
Practical PC, 7th Edition Chapter 17: Looking Under the Hood
Understanding Computers, Ch.31 Chapter 3 The System Unit: Processing and Memory.
Organization of a computer: The motherboard and its components.
Lesson 2 — How Does A Computer Process Data?
Chapter 1 1.  The computer system consists of: 1. Hardware: Physical Components, like the system unit,monitor,keyboard, mouse, camera, printer … etc.
© Paradigm Publishing Inc. 2-1 Chapter 2 Input and Processing.
Eng.Abed Al Ghani H. Abu Jabal Introduction to computers.
Buses All devices in the computer are connected to the External Data Bus Extension to External Data Bus called Expansion Bus –Used for devices that might.
25 April 2000 SEESCOASEESCOA STWW - Programma Evaluation of on-chip debugging techniques Deliverable D5.1 Michiel Ronsse.
BMOW is a Custom CPU Design Like your PC’s Pentium, but much simpler Closest cousin is the MOS 6502 used in the Apple II, C-64, and Atari VCS =
Input and Processing Chapter 2 - Computers- Understanding Technology.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 5A Transforming Data Into Information.
Presented by Sadhish Prabhu
1 CHAPTER 2 Hardware. 2 CPU : Central Processing Unit -Every PC system unit contains at least one chip called microprocessor (cpu) attached on motherboard.
Hardware/Software Basics Test Get out your DIY Test Review.
Parts of a Computer Created by Carmen Garzes. An electronic device that manipulates information or data. It can store, retrieve or process data. There.
Submitted by:.  Project overview  Block diagram  Power supply  Microcontroller  MAX232 & DB9 Connector  Relay  Relay driver  Software requirements.
SEPTEMBER 8, 2015 Computer Hardware 1-1. HARDWARE TERMS CPU — Central Processing Unit RAM — Random-Access Memory  “random-access” means the CPU can read.
Computer Basics Just How Does a Computer Work?
COMPUTER COMPONENTS Ms Jennifer Computer Components.
GCSE Computing - The CPU
PC Mouse operated Electrical Load Control Using VB Application
Sega Dreamcast Visual Memory Unit FPGA Implementation
McGraw-Hill Technology Education
Operating Systems Chapter 5: Input/Output Management
McGraw-Hill Technology Education
McGraw-Hill Technology Education
GCSE Computing - The CPU
Presentation transcript:

Atari 2600 Program Development Joe Decuir jdecuir@ieee.org.com alumnus of Atari & Amiga

Agenda Goals and non-goals Why do this Requirements for Program Development Development Tools Hardware environment System programming model Example Game Design (Combat) Suggestions

Goals for today Audience understands what is required to develop game software for a production Atari 2600 VCS Some discussion about how that might apply to developing game software for successors, both hardware and emulator software. Not goal: demonstrations – I can’t do that without a video projector.

Why program for the VCS today? There is not a mass market to buy cartridges There is an emerging base of users who enjoy simpler games: Owners of original Atari 2600 VCS consoles PC owners running emulators To create games without the huge effort involved in creating modern graphics-intensive games. Summary: fun, education, impress your friends

Requirements for Program Development Target environment requirements Specifications for the hardware, registers, etc Program generation tools: assembler Target environment emulator, hard or soft Program debug tools Program distribution: ROM cartridges Binary image files for use on emulators

Objective of Program Development Produce a 6507 binary image: 2-4K bytes for use as a 2600 cartridge Possibly larger when used with a software emulator, particularly if it can emulate bank-switching techniques (e.g. PCAE 2.2)

Development Targets There are several development targets: Original Atari 2600 hardware VCS Hardware clones (e.g. Coleco) Modern hardware clones, e.g. LCD handheld models PC emulators (e.g PCAE 2.2, etc) The capabilities of the successive targets may exceed those of the original hardware, in memory, but they have to match some other limits to remain compatible with old games.

Original Production 2600 Hardware Resources 6507 at 1.2MHz (3.579545 / 3) 6502, 13 bit address space, no interrupts, RDY 128 bytes of RAM, mapped to 00XX, 01XX Space for ROM cartridges of up to 4KB Two joysticks, supported by TIA and 6532 TIA video and audio chip 6532 Timer

Original Production 2600 Hardware Limitations NO host development capabilities NO interrupts – single thread for everything NO DMA, 6507 does everything NO vertical support in hardware Very small RAM Small ROM, 8K address space Note: software emulators can remove these limitations, a boon for program debugging.

Original 2600 Program Development Environment 6502 Cross Assembler, based on host E.g. timesharing machine, or DEC PDP-11 Hardware Emulator, w/RAM in code space Debug monitor, for downloading and manipulating object code HP-1600 series symbolic logic analyzer Capture and disassemble bus traffic Pre-trigger or post-trigger on bus values

6502 Tools 6502 is 26 years old; current tools are scarce. Self-assemblers for 6502 code ran on Apple II, Atari 800/PCS or Commodore 64s Windows or Macintosh PCs have plenty of resources to run cross assemblers (or compilers) for 6502. They also exist for older machines: http://www.6502.org/crossdev/asm/index.htm. 6502-specific hardware logic analyzers are out of production They might be available used

Simple way to test game code Make a ROM image Burn a PROM Mount it on a cartridge Plug it into a production VCS See what happens Iterate until it works as intended

Easiest VCS Development Today Start in a soft environment: Use suitable PC Emulator (e.g. PCAE) Generate assembly code: PC Cross-assembler Run the code in the emulator, with Debug tools turned on

PCAE 2.2 Debug Features An example Atari VCS emulator for PCs Display and/or modify: Program code 6507 registers Zero page RAM TIA registers Current virtual beam position Online command and TIA register reference Breakpoints on conditions http://www.oneminuteleft.com/emuatari2600.html

Hardware environment: Testing ROMs The developer needs only two tools: PROM burner PC based Stand alone serial port devices PROM cartridge with socket 4KB DIP package PROMs are long obsolete Extra logic is needed to invert A12 as a chip select (e.g. an inverter)

Making a Hardware Debugger Get a 6502 evaluation board with a debug monitor: KIM-1 ; JOLT (using TIM 6530 chip; Rockwell AIM-65; Synertek SYM-1; EPE See: http://www.6502.org/oldmicro/trainers.htm Wire wrap a board with: 6507 socket, wired to the 6502 pins Decoder logic replacing the A12 pin on the 6507 At least 4KB of RAM for Code Serial connection to a host PC, if not on eval board Take apart a 2600 VCS, remove the motherboard, remove the 6507 chip, connect the 6507 motherboard socket to the debug board socket.

Hardware test system diagram Debug Board W/monitor RS- 232 Optional Hardware logic analyzer Host Assembler System Modified Atari VCS w/6507 socket TV Game controllers

Hardware vs Software Debug environments Software emulation wasn’t feasible until recently PCAE runs full speed on a 486/100 - 1996 Software debug has many advantages: The emulator knows the internal states of the CPU and the TIA The emulator can freeze the action anywhere, while maintaining the game screen Software emulation of game controls is tough No standard hardware that matches originals

Atari 2600 Programming Model System Block Diagram Graphics Controls TIA registers

Stella System Block Diagram

Stella System TIA video chip (see below) 6502-based processor, “6507”: 13 bit address, no interrupts, RDY line 1.2 MHz 6532 combo 128 bytes of RAM (all mapped into zero page) 16 bits of parallel I/O (joysticks and panel) timer (interrupt not used) cartridge slot for 2K or 4K ROMs (24 pins) 2 game control ports

Stella Graphics Fundamental pixel resolution is 1 color burst clock (280nsec, 160/line) by 1 line. Motion objects are 1, 2, 4 or 8 clocks/bit. Motion objects may be replicated in hardware. Playfield is 4 clocks per bit. Playfield bits are either repeated or reflected in hardware.

Other TIA chip features 4 7-bit palette registers 15 collision detection latches 2 channel sound system variable prescaler 4+5 bit polynomial counters volume registers trigger and potentiometer input ports trigger input could be used for light pens or light guns.

Human Input Requirements Console controls: Game select, and start switches Options: handicaps, color/monochrome Various types of game controls: For TANK, etc: a joystick with a “fire” button For PONG: a dual analog potentiometer For Driving: a rotary control For head games: a keyboard

HID implementation One power switch 5 bits of console parallel I/O, not scanned 5 + 5 bits of game control I/O, not scanned 2 bits in TIA, 8 bits in parallel ports 4 bits of potentiometer input, in TIA

TIA Register Map: 00-0A 00:0 Vertical Sync 00:1 Vertical Blank 02 Wait for Horizontal Sync 03 Reset Horizontal sync (testing) 04-05 Number and size of P0/M0, P1/M1 06-09 Color/lum registers 0A Playfield controls

TIA Register Map: 0B-1F 0B-0C:3 Player reflect bits 0D-0F Playfield graphics (7-4; 7-0; 7-0) 10-14 Horizontal reset, all 5 objects 15-16 Audio control 17-18 Audio frequency 19-1A Audio volume 1B-1C Player graphics (8 bits) 1D-1F Missile/ball enable (1 bit each)

TIA Register Map: 20-3F 20-24 Horizontal motion registers (7-4) 25-27 Vertical delay: P0, P1, Ball 28-29 Reset Missiles to Players 2A Horizontal Motion strobe 2B Horizontal motion clear 2C Clear collision latches 30-37 Collision detect latches 38-3D 4 pot inputs, 2 trigger inputs

Example Simple Game Design General architecture Display generation Game play Sounds

Combat Game Architecture The code has three components: Game play code Process game control and console control inputs Process game results (e.g. collisions) Decide next graphics and sounds Graphics display code Graphics tables

General VCS Game timing In Vertical Blank: detect collisions and control inputs decide new game conditions computer new game graphics pointers, as inputs to the display kernel In Display, for each line or two: step graphics pointers fetch graphics wait for horizontal blank, and write graphics

Combat Main loop VCNTRL: generate vertical sync GSGRCK: game select and reset LDSTEL: load Stella (TIA) registers CHKSW: read the joystick switches COLIS: Detect and process object collisions STPMPL: Move players and other objects ROT: generate & rotate object graphics SCROT: generate score graphics VOUT: display the game

Horizontal motion For each moving object: Given the horizontal position (0-159) Compute a loop count for a wait loop, mod 15 Compute the horizontal motion step, -7 to +7 Wait for horizontal sync Run the wait loop Reset the object motion counter Write the horizontal motion register Write HMOVE after all registers set up

Combat Display Kernel For pairs of horizontal lines: Compute indexes to playfield: move 2.5 bytes from ROM tables playfields are vertically reflected in software For each object that is on, copy graphics For 8 bit objects, copy graphics from RAM For 1 bit objects, enable/disable Use Wait-for-sync, and write graphics in horizontal blank

Concluding Suggestions Acquire or create an emulator-based toolkit Learn from existing code: Download old ROM images Disassemble them for study Experiment by patching them and observing the results Create original games, focused on game play: Easy to learn Difficult to master Good luck monetizing your work.

Web Resources Salon.com: “Atari Lives” Salon.com/tech/feature/2001/07/09/atari/index.html PC Atari Emulators, PCAE by Dullea: www.oneminuteleft.com/emuatari2600.html 6502 Tools: http://www.6502.org Atari Hardware Manual, scanned: www.atariarchives.org/dev/tia