English Amiga Board


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

 
 
Thread Tools
Old 22 June 2024, 16:49   #1
Rotschi
Registered User
 
Join Date: Apr 2023
Location: "Hamcastle"
Posts: 25
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?
Rotschi is offline  
Old 22 June 2024, 17:45   #2
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,643
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.
hooverphonique is offline  
Old 25 June 2024, 15:02   #3
Rotschi
Registered User
 
Join Date: Apr 2023
Location: "Hamcastle"
Posts: 25
sure, but isn't it redundant here
Rotschi is offline  
Old 25 June 2024, 16:18   #4
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,066
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.
a/b 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
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

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 20:05.

Top

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