Generate the Atari Rainbow Effect
One of the amazing things about the 8-bit Atari computers was how they could rewrite their display list on the fly, changing video modes every scan line. My favorite application of this was the rainbow effect. I've always wanted to know how to do this, and some searching led me to Alan Watson's example in Compute!'s Second Book of Atari. I trimmed it down a bit to come up with this BASIC code, which you can run on a real Atari computer or in your favorite emulator:
110 FOR I=0 TO 17
120 READ B
130 POKE 1536+I,B
140 NEXT I
200 POKE 512,0:POKE 513,6
210 GRAPHICS 8
220 START=PEEK(560)+256*PEEK(561)
300 POKE START+3,78
310 FOR I=34 TO 98:POKE START+I,14+128:NEXT I
320 POKE START+99,78+128
330 FOR I=102 TO 164:POKE START+I,14+128:NEXT I
400 POKE 54286,192
410 DATA 72,173,198,2,24,105,2,141
420 DATA 10,212,141,198,2,141,26
430 DATA 208,104,64
In case you're wondering about what's going on in those data statements, here's my attempt at a translation:
72 PHA ; Push A(ccumulator)
173,198,2 LDA 710 ; Load A with playfield 2 color luminance
24 CLC ; Clear carry
105, 2 ADC #2 ; Add 2
141,10,212 STA WSYNC ; Wait for horizontal sync
141,198,2 STA 710 ; Playfield 2 color luminance
141,26,208 STA $D01A ; Background color register
104 PLA ; Restore A
64 RTI ; Return from interrupt
Related:
- Retro Gaming Hacks
- Display List chapter in Assembly Language Programming for the Atari Computers
- 6502 opcodes
Posted by Brian Jepson |
Dec 31, 2006 04:04 PM
Retro Computing |
Permalink
| Comments (0)
Recent Entries
Bloggers
Welcome to the Hacks Blog!
Categories
- Ajax
- Amazon
- AppleTV
- Astronomy
- BlackBerry
- Blogging
- Body
- Cars
- Cryptography
- Data
- Education
- Electronics
- Energy
- Events
- Excel
- Excerpts
- Firefox
- Flash
- Flickr
- Flying Things
- Food
- Gaming
- Gmail
- Google Earth
- Google Maps
- Government
- Greasemonkey
- Hacks Series
- Hackszine Podcast
- Halo
- Hardware
- Home
- Home Theater
- iPhone
- iPod
- IRC
- iTunes
- Java
- Kindle
- Knoppix
- Language
- LEGO
- Life
- Lifehacker
- Linux
- Linux Desktop
- Linux Multimedia
- Linux Server
- Mac
- Mapping
- Math
- Microsoft Office
- Mind
- Mind Performance
- Mobile Phones
- Music
- MySpace
- MySQL
- NetFlix
- Network Security
- olpc
- OpenOffice
- Outdoor
- Parenting
- PDAs
- Perl
- Philosophy
- Photography
- PHP
- Pleo
- Podcast
- Podcasting
- Productivity
- PSP
- Retro Computing
- Retro Gaming
- Science
- Screencasts
- Shopping
- Skype
- Smart Home
- Software Engineering
- Sports
- SQL
- Statistics
- Survival
- TiVo
- Transportation
- Travel
- Ubuntu
- Video
- Virtualization
- Visual Studio
- VoIP
- Web
- Web Site Measurement
- Windows
- Windows Server
- Wireless
- Word
- World
- Xbox
- Yahoo!
- YouTube
Archives
Recent Posts
- Poromenos' hello world curve
- USB CapsLocker and Sun keyboard simulation
- Robosapien has a coil gun
- Faster Windows shutdown
- Assign USB drives to a folder
- Little drummer bot
- CSS ad blocking for Firefox and Safari
- Design Coding: web standards rap
- Shredz64: Guitar Hero for C64
- BATMAN: adhoc mesh routing
www.flickr.com
|





Leave a comment