![]() |
![]() |
#1 |
Registered User
Join Date: Apr 2023
Location: "Hamcastle"
Posts: 30
|
LSPlayer (CIA version) by Leonard
As far as I understand the two subroutines LSP_MainIrq and LSP_DMAconIrq are called in turns, i.e., the 1st one sets int6 to the 2nd one and vice versa.
I am curious about the first line in both subroutines: .LSP_MainIrq: btst.b #0,$bfdd00 int6 triggered by timerA LSP_DMAconIrq: btst.b #1,$bfdd00 int6 triggered by timerB First I thought - since we have to read out $bfdd00 anyway for clearing the pending of the CIA int - that this may be a kind of extra check for ensuring that both subroutines are called in the correct order (killing two birds with one stone), but on second thought I am not sure about this. Okay, to make a long story short: What is the btst check good for and why not a simple tst.b $bfdd00 w/o branch? |
![]() |
![]() |
#2 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,664
|
As you may have noticed, they check different bits - one for each timer.
This verifies that it's the correct interrupt source that triggered the ISR. |
![]() |
![]() |
#3 |
Registered User
Join Date: Apr 2023
Location: "Hamcastle"
Posts: 30
|
sure, but isn't it redundant here
![]() |
![]() |
![]() |
#4 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,097
|
It's redundant if you only use timers A and B, and nothing else that can trigger CIAB interrupts. Those 2 timer callbacks are serialized so no problem there, but if something else is running in parallel (enabled after your call to player init) and triggers an interrupt then you have a problem.
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
JOIN THE ZOOM CHAT: Leonard Tramiel - April 20, 2023 - Commodore, Atari, and Science! | Marcio D. | Amiga scene | 1 | 30 April 2023 05:22 |
Interesting Leonard Tramiel interviews fresh on youtube | ImmortalA1000 | Nostalgia & memories | 8 | 12 December 2022 09:46 |
Leonard Tramiel TED talk about Commodore etc.. | eXeler0 | Nostalgia & memories | 1 | 17 March 2017 13:20 |
example of a CIA timer interrupt in assembler using cia.resource | Apollo | Coders. Asm / Hardware | 3 | 05 July 2013 08:40 |
CIA test | Toni Wilen | Coders. General | 13 | 03 March 2007 22:14 |
|
|