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


Forums > C64 Coding > Spacebar interrupt
2017-09-29 20:14
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.
2017-09-29 20:35
chatGPZ

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

Registered: Oct 2006
Posts: 168
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: 1627
Great! :) I hope this means more megademos in the future.
2017-09-30 08:46
Oswald

Registered: Apr 2002
Posts: 5017
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: 1702
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: 62
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
Matt
lucadip
MCM/ONSLAUGHT
Sentinel/Excess/TREX
Mason/Unicess
csabanw
Acidchild/Padua
St0rmfr0nt/Quantum
t0m3000/ibex-crew
Freeze/Blazon
Didi/Laxity
Guests online: 194
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Logo Graphicians
1 Sander  (10)
2 Facet  (9.7)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.048 sec.