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: 11386
you are basically using the stable-raster-with-lightpen-trigger - backwards? funny idea
2017-09-29 20:46
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
2017-09-29 20:52
Frantic

Registered: Mar 2003
Posts: 1648
Great! :) I hope this means more megademos in the future.
2017-09-30 08:46
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 :)
2017-09-30 09:25
tlr

Registered: Sep 2003
Posts: 1790
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: 63
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
Dr.j/Delysid
Vent
wacek/arise
t0m3000/hf^boom!^ibx
Guests online: 94
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

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