Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
MOS Technology VIC-II
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Raster interrupts=== Utilization of raster interrupts is an essential part of C64 game programming. In the computer's power-on default state, the first [[MOS Technology CIA]] chip generates a [[Interrupts in 65xx processors|maskable interrupt]] (IRQ) 60 times per second (whether NTSC or PAL, this is unrelated to video refresh) which sends the CPU to the kernel IRQ handler at {{mono|$EA31}}. The handler acknowledges the CIA's IRQ, updates the clock, scans the keyboard, and blinks the cursor in BASIC. Games normally disable the CIA's interrupt and instead set up the VIC-II to generate interrupts when a specific scanline is reached, which is necessary for split-screen scrolling and playing music. The game remaps the [[interrupt vector|IRQ vector]] at {{mono|$0314}}/{{mono|$0315}} to its raster handler which performs these functions and then optionally executes a JMP {{mono|$EA31}} instruction to return control to the kernel. Some games use only one IRQ; however, chained IRQs are more common and improve program stability. In this setup, the IRQ is remapped to the second routine and so forth for each one until the last one restores it to the address of the first IRQ. When chained IRQs are used, only one JMP {{mono|$EA31}} instruction is needed in the chain and the others can be ended with JMP {{mono|$EA81}}, which simply goes to the end of the kernel handler. Also it is not uncommon for games to switch out the kernal and use their own IRQ handler instead. The NMI can be used for an additional interrupt thread, although undesirable side effects can result from accidentally pressing the Restore key as it triggers an NMI if pressed. The VIC-II may also generate a raster interrupt from the collision registers, but this feature is rarely used as it provides insufficient information to the program in most cases.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)