Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


Forums > C64 Coding > Spacebar interrupt
2017-09-29 20:14
lft

Registered: Jul 2007
Posts: 355
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.
2017-09-29 20:35
Groepaz

Registered: Dec 2001
Posts: 8586
you are basically using the stable-raster-with-lightpen-trigger - backwards? funny idea
2017-09-29 20:46
Stone

Registered: Oct 2006
Posts: 124
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
2017-09-29 20:52
Frantic

Registered: Mar 2003
Posts: 1342
Great! :) I hope this means more megademos in the future.
2017-09-30 08:46
Oswald

Registered: Apr 2002
Posts: 4255
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 :)
2017-09-30 09:25
tlr

Registered: Sep 2003
Posts: 1168
Brilliant! Then we can finally have spacebar exit for intros like this: Frankie Goes to Hollywood :)
2017-10-06 17:57
Slajerek

Registered: May 2015
Posts: 28
Lol. Awesome idea :)
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
TMA/Abyss-Connection
Jucke
Raistlin/Genesis*Pro..
Heavy Stylus/RGCD
Dymo/G★P
Guests online: 41
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 Comaland 100%  (9.6)
5 The Shores of Reflec..  (9.6)
6 Wonderland XII  (9.6)
7 Lunatico  (9.6)
8 We Come in Peace  (9.5)
9 Incoherent Nightmare  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Daah, Those Acid Pil..  (9.5)
3 Pandemoniac Part 2 o..  (9.5)
4 Treu Love [reu]  (9.5)
5 Merry Xmas 2017  (9.4)
6 Arok 20 Invitation  (9.4)
7 Dawnfall V1.1  (9.4)
8 In Memoriam BHF  (9.4)
9 Dawnfall  (9.4)
10 Synthesis  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.4)
5 Crest  (9.3)
Top Mega Swappers
1 Aslive  (9.4)
2 R.C.S.  (9.3)
3 Dishy  (9.2)
4 Nightshade  (9.1)
5 Calypso  (9.0)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.056 sec.