English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 21 October 2021, 21:03   #1
DanielAllsopp
Registered User

DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 167
CIA interrupt for reading keyboard

Hey!

I'm busy implementing some code to read keypresses via a Level2 interrupt, which roughly follows the code from this example:

https://github.com/Sakura-IT/Amiga-p...merAndScreen.s

Everything works great, I can read the keypresses just fine however when my program quits and returns to the CLI, the prompt doesn't appear and keyboard entry obviously no longer works.

Has anyone got any ideas why installing this interrupt would cause a problem like this?

Shout if you need some example code and I'll put something together.

Cheers,
Daniel
DanielAllsopp is offline  
Old 21 October 2021, 22:13   #2
ross
Defendit numerus

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 51
Posts: 3,561
Please post an exe, maybe is a tiny careless mistake
ross is offline  
Old 21 October 2021, 22:29   #3
Rock'n Roll
German Translator

Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 47
Posts: 44
in my short test, the program works
A1200 configuration, with asmone >r, pass1, pass2 >a, wo prg
then in shell >prg
a black screen opens, now you can leave the program with 'ESC'
the cursor is now standing behind the prompt
Rock'n Roll is offline  
Old 21 October 2021, 23:33   #4
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 783
Ooo it's my piece of code .
As ross said perhaps there is a mistake. Hm.... Perhaps I should restore cia registers first and then restore PORTS int (in code is opposite).
Asman is offline  
Old 22 October 2021, 00:40   #5
DanielAllsopp
Registered User

DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 167
Your wish is my command ross:

Robocop

Obviously AGA only. Should run as-is. Press ESC key to quit (and freeze).

Thanks.

Yeah, no doubt I've missed something really simple here as it works for the most part!
DanielAllsopp is offline  
Old 22 October 2021, 01:13   #6
ross
Defendit numerus

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 51
Posts: 3,561
Quote:
Originally Posted by DanielAllsopp View Post
Yeah, no doubt I've missed something really simple here as it works for the most part!
You do not restore the Lev2 IRQ vector at exit

move.l	oldIntPorts(a4),$68(a0)
ross is offline  
Old 22 October 2021, 01:21   #7
DanielAllsopp
Registered User

DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 167
Quote:
Originally Posted by ross View Post
You do not restore the Lev2 IRQ vector at exit

move.l	oldIntPorts(a4),$68(a0)
Tremendous ross, how on earth did I miss that one?! I've been looking at that code for the last hour!

Thanks for pointing that out, nice spot and all fixed now! Thanks to Asman for the original code, and to Rock'n Roll for testing that original code too!

Now I can go and enjoy a glass of beer! Cheers guys!
DanielAllsopp is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
CIA or vertical blank/copper interrupt for playing music in an intro? pushead Coders. Asm / Hardware 25 24 April 2021 12:40
Keyboard interrupt hang Muzza Coders. Asm / Hardware 15 28 January 2021 15:58
CIA periodic interrupt jotd Coders. Asm / Hardware 12 02 January 2021 22:22
example of a CIA timer interrupt in assembler using cia.resource Apollo Coders. Asm / Hardware 3 05 July 2013 09:40
CIA timer interrupt handler called twice during mod playback absence Coders. General 5 16 March 2009 19:55

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.09141 seconds with 13 queries