English Amiga Board


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

 
 
Thread Tools
Old 22 October 2020, 14:57   #1
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 743
Keyboard int (PORTS)

I saw few times following situation in PORTS int ($68 + vbr).
1. read keycode from $bfec01
2. clear or set $ff to $bfec01
Mean
Code:
intPORTS:
        moveq #0,d0
        move.b $bfec01,d0
        clr.b $bfec01  ; move.b #$ff,$bfec01

        ....
        rte
I've no idea why somebody clear or set $ff to $bfec01. Is there any explanation of it ?. Is it ok do this ?
Asman is online now  
Old 22 October 2020, 15:20   #2
Exodous
Registered User

 
Join Date: Sep 2019
Location: Leicester / England
Posts: 80
After reading the value, one of the bits needs setting to acknowledge they key has been read. See this thread http://eab.abime.net/showthread.php?t=102943 for more details.
Exodous is offline  
Old 22 October 2020, 15:35   #3
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,874
Hi Asman,
you can overwrite keycode in $bfec01 (CIA registers are r/w).
So if an external code (out of IRQ) get it, a $00 or $ff is read.
ross is offline  
Old 22 October 2020, 15:39   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,317
Looks like too simple key read code. If new code is zero or ff = no new key, skip. Checking CIA interrupt bits is too difficult
Toni Wilen is online now  
Old 22 October 2020, 15:42   #5
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,874
Quote:
Originally Posted by Toni Wilen View Post
Looks like too simple key read code. If new code is zero or ff = no new key, skip. Checking CIA interrupt bits is too difficult
it is normally used this way.
Lazy coders
ross is offline  
Old 22 October 2020, 15:48   #6
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 2,318
All coders are a bit lazy, right?
Otherwise why spend all that effort to get the computer to do stuff for us instead of doing it ourself?
roondar is offline  
Old 22 October 2020, 16:03   #7
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 50
Posts: 2,874
Quote:
Originally Posted by roondar View Post
All coders are a bit lazy, right?
Otherwise why spend all that effort to get the computer to do stuff for us instead of doing it ourself?
And as the AtariST coders always say, the Amiga ones are especially so
ross 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
VBCC: complain about static int (*calltrap)(...) = (int (*)(...))0xF0FF60; mbergmann-sh Coders. C/C++ 3 17 March 2017 02:19
asm game - how implement exit to OS via PORTS int Asman Coders. General 4 28 June 2011 12:07
ASM: false int vector ($60) Asman Coders. General 2 13 September 2010 10:22
ASM: VERTB int and 16 colored sprites. Asman Coders. Tutorials 5 28 April 2010 15:18
INT-2 modification on Cyberstorm boards? astuermer support.Hardware 2 06 October 2005 16:23

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 12:54.


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