English Amiga Board


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

 
 
Thread Tools
Old 22 October 2020, 13:57   #1
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
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 offline  
Old 22 October 2020, 14:20   #2
Exodous
Registered User
 
Join Date: Sep 2019
Location: Leicester / England
Posts: 201
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, 14:35   #3
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
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, 14:39   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,503
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, 14:42   #5
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
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, 14:48   #6
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
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, 15:03   #7
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
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 01:19
asm game - how implement exit to OS via PORTS int Asman Coders. General 4 28 June 2011 11:07
ASM: false int vector ($60) Asman Coders. General 2 13 September 2010 09:22
ASM: VERTB int and 16 colored sprites. Asman Coders. Tutorials 5 28 April 2010 14:18
INT-2 modification on Cyberstorm boards? astuermer support.Hardware 2 06 October 2005 15: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 18:17.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07367 seconds with 15 queries