| |
lft
Registered: Jul 2007 Posts: 369 |
Spacebar interrupt
I just realised that you can get an interrupt when the user presses space. That could be useful for instance if you're making a megademo and you have a sample-player part that uses every single clock cycle, but you don't want to put it at the very end of the demo.
The idea is to set $dc00 to $7f to enable the keyboard row that has the spacebar in it. Space is in bit #4, and keys are active-low. But bit #4 is also the fire-button of gameport 1. And the fire-button of gameport 1 is also the lightpen input. And you can configure VIC to generate an interrupt when there is a negative edge on the lightpen input.
Has anybody used this trick before? It works on real hardware, and vice emulates it correctly. |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
you are basically using the stable-raster-with-lightpen-trigger - backwards? funny idea |
| |
Stone
Registered: Oct 2006 Posts: 172 |
Haha that's awesome. Still we learn new tricks from this machine :)
My main machine has a Shift Lock non-maskable interrupt. Nah ok, the Restore key broke, so I rewired it to the only useless key on the keyboard :P |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Great! :) I hope this means more megademos in the future. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
this was already discovered by someone, remember of hearing (seeing?) a trick of using the VICII to read the spacebar somehow, finally I know how it is done :) |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Brilliant! Then we can finally have spacebar exit for intros like this: Frankie Goes to Hollywood :) |
| |
Slajerek
Registered: May 2015 Posts: 63 |
Lol. Awesome idea :) |