09 August 2024, 19:52 | #21 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,451
|
Quote:
However, how these cycles relate to the custom chip cycles depends on the CPU speed, and thus the time may not be sufficient. |
|
09 August 2024, 21:07 | #22 | |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,089
|
Quote:
Another thing, I'd also do interrupt acknowledge prior to reading SERDAT, which would then act as a chipmem bus flush, so you don't have to worry about double interrupts on newer CPUs. As Thomas pointed out already. |
|
10 August 2024, 01:54 | #23 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,102
|
Quote:
From my memory a0 is set as $dff000 and a1 as pointer to data or vice versa. Then programmed interrupt code can be very short. Perhaps D0/D1/A0/A1 are scratch registers too, then not need to put on stack. But better check this because, I worked only for audio/timer interrupts. And it can works different for serial interrupts. |
|
10 August 2024, 03:46 | #24 |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,102
|
Code:
_Comm_Write_Byte: lea $dff018,a0 ; set SERDATR as base A0 EOR.B D0,_comm_tx_checksum OR.W #$0100,D0 .wait_serdatr_ready: MOVE.W (a0),D1 ; SERDATR AND.W #$2000,D1 BEQ.S .wait_serdatr_ready MOVE.W D0,$30-$18(a0) ; SERDAT CMP.W #$01d5,D0 ; if a 0xD5 is sent, then immediately send a 0x5D BEQ.S .send_5d RTS .send_5d MOVE.W #$015d,D0 .wait_serdatr_ready2: MOVE.W (a0),D1 ; SERDATR AND.W #$2000, D1 BEQ.S .wait_serdatr_ready2 MOVE.W D0,$30-$18(a0) ; SERDAT RTS Then You can try this. Code:
_Comm_Write_Byte: lea $dff018,a0 ; set SERDATR as base A0 EOR.B D0,_comm_tx_checksum OR.W #$0100,D0 .wait_serdatr_ready: btst #13-8,(a0) ; SERDATR BEQ.S .wait_serdatr_ready MOVE.W D0,$30-$18(a0) ; SERDAT CMP.W #$01d5,D0 ; if a 0xD5 is sent, then immediately send a 0x5D bne.b .skipsend_5d .wait_serdatr_ready2: btst #13-8,(a0) ; SERDATR BEQ.S .wait_serdatr_ready2 MOVE.W #$015d,$30-$18(a0) ; SERDAT .skipsend_5d RTS |
10 August 2024, 11:09 | #25 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,659
|
|
Yesterday, 00:08 | #26 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,451
|
Not only that. d0-d1/a0-a1/a5-a6 are all scratch registers. See exec/AddIntServer(). No, that the custom chip base register $dff000 is in a0 is *not* part of the specification, you need to do that yourself. In particular, because if interrupt servers are called before your code, a0 will be used *there* as scratch. See also the autodocs.
|
Currently Active Users Viewing This Thread: 2 (1 members and 1 guests) | |
remz |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Serial communication? | MickGyver | Coders. Blitz Basic | 4 | 10 April 2020 16:40 |
serial communication between Amiga and PC | TCH | support.Amiga Forever | 6 | 24 March 2020 00:00 |
CD32 Accelerator reliability .. | leonk | support.Hardware | 4 | 30 April 2019 19:35 |
Serial Port <--> Tablet: no communication | ral-clan | support.WinUAE | 0 | 02 February 2011 19:51 |
Supercars 2 communication screens | jotd | Retrogaming General Discussion | 11 | 04 December 2006 18:06 |
|
|