30 July 2022, 20:18 | #61 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
30 July 2022, 22:47 | #62 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,856
|
|
30 July 2022, 23:54 | #63 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Ok, I'm late so it does not really count, but here it goes (56 bytes) :
Code:
moveq #1,d5 ; ~fe tst.w d2 bne.s .fe and.w d5,d3 moveq #3,d5 ; ~fc .fe or.w d5,d0 ; d1-d0 -> b0 (b1) =0 or.w d5,d1 ; lsr.w #2,d2 ; non-aga : d2.w=0 bcc.s .naga lsr.b #1,d4 addx.b d2,d2 ; ok (d2.b=0) lsl.b #8,d4 ; -> d4.b=0, x=b0 addx.b d4,d2 ; d2=fetch .naga moveq #3,d4 ; 3+large sub.w d3,d2 ; d2 = d2-d3 bcs.s .ii ; -> d3=nc / d4=3 add.w d2,d3 : d3 = d3 + d2-d3 (= d2) add.w d2,d4 ; d4 = d2-d3 (+3) .ii addq.w #4,d3 ; +4 sub.w d0,d1 ; stop-strt moveq #1,d0 ; d0=pad lsl.w d4,d0 subq.w #1,d0 add.w d1,d0 ; +pad lsr.w d4,d0 ; d0=blocks addq.w #1,d0 ; +1 lsl.w d3,d0 rts It assumes d0/d1 in range 0000-00ff, perhaps shouldn't. |
31 July 2022, 00:19 | #64 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
|
31 July 2022, 08:33 | #65 | ||
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Yep, code mask out the bit unused in real DDF registers (like for FMODE). So no 0000-00ff range This made the proposed solutions much more interesting. Quote:
|
||
31 July 2022, 09:19 | #66 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
|
Sorry for propagating the 00-ff myth. Couldn't even beat a/b with that doping in my version (it can be fixed w/o increasing size though).
|
01 August 2022, 10:12 | #67 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
By the way, the hardware DDF registers have H8 bit, so shouldn't range be 0000-01ff instead ? I think i've spotted a way to do it in 50 bytes. |
|
01 August 2022, 11:35 | #68 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Code:
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 ECS/AGA: xx xx xx xx xx xx xx xx H8 H7 H6 H5 H4 H3 H2 xx OCS: xx xx xx xx xx xx xx xx H8 H7 H6 H5 H4 H3 xx xx Agnus has an 8-bit counter while Denise has a 9-bit counter. As for other (Denise') registers we have H8/H1 + a separate H0 they thought of doing the same thing.. This way the bit positioning is exactly the same as Agnus internal counter and the hw comparison is straightforward. |
|
01 August 2022, 11:56 | #69 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Actually this is even more 'twisted' in AGA/Lisa where they separated, in some case, the bit differently.
The funniest are the HB registers where the lower bits are in the upper byte: Code:
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 xx xx xx xx xx H2 H1 H0 HA H9 H8 H7 H6 H5 H4 H3 Notice they changed 'bit names' because of lisa 11 bit counter With this new numbering AGA DDF registers should be: Code:
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 xx xx xx xx xx xx xx xx HA H9 H8 H7 H6 H5 H4 xx |
01 August 2022, 11:58 | #70 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
So the doc i have is wrong, as it says :
Code:
BIT# 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 USE XX X X X X X X H8 H7 H6 H5 H4 H3 H2 X |
01 August 2022, 12:07 | #71 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
01 August 2022, 15:47 | #72 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
|
01 August 2022, 15:51 | #73 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
|
01 August 2022, 16:15 | #74 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
So, for the annals, the ultimate* version:
*EDITED Code:
fetchWidth: add.w d2,d2 ; separate chipset moveq #0,d5 subq.b #4,d2 bne.b .0 lsr.w #1,d4 ; extract FMODE addx.w d2,d5 lsr.w #1,d4 addx.w d2,d5 subq.b #2,d2 .0 and.w d2,d0 ; mask DDF and.w d2,d1 addq.b #5,d2 ; trick for res mask and.b d2,d3 moveq #3,d4 ; large = 3 sub.w d3,d5 ; fetch -= res ble.b .1 add.w d5,d4 ; large += fetch (=> 3 | 3+fetch-res) add.w d5,d3 ; res += fetch .1 addq.w #4,d3 ; sub = (res += 4) (=> 4+res | 4+fetch) sub.w d1,d0 ; ddfstrt-ddfstop (<= 0), automatic asr.w d4,d0 ; ceiling for negatives neg.w d0 addq.w #1,d0 ; blocks = 1-((ddfstrt-ddfstop)>>large) lsl.w d3,d0 ; width = blocks<<sub rts Last edited by ross; 02 August 2022 at 09:01. |
02 August 2022, 08:28 | #75 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,039
|
I have to disagree :P, 48 bytes:
Code:
.Begin moveq #3,d5 ; large = 3 subq.b #2,d2 ; -2/-1/0 (OCS/ECS/AGA) blt.b .NoAGA and.w d5,d4 ; fetch &= 3 moveq #1,d2 subq.b #2,d4 addx.b d2,d4 ; fetch = 0/1/1/2 sub.w d3,d4 ; fetch -= res ble.b .LowFetch add.w d4,d5 ; large += fetch (=> 3 | 3+fetch-res) add.w d4,d3 ; res += fetch .LowFetch st d2 ; -1 (AGA) .NoAGA add.b d2,d2 ; mask = 0xfc (OCS) | 0xfe (ECS/AGA) and.w d2,d0 ; ddfstrt &= mask and.w d2,d1 ; ddfstop &= mask addq.b #5,d2 ; mask = 1 (OCS) | 3 (ECS/AGA) and.w d2,d3 ; res &= mask addq.w #4,d3 ; sub = (res += 4) (=> 4+res | 4+fetch) sub.w d1,d0 ; ddfstrt-ddfstop (<= 0), automatic asr.w d5,d0 ; ceiling for negatives neg.w d0 addq.w #1,d0 ; blocks = 1-((ddfstrt-ddfstop)>>large) lsl.w d3,d0 ; width = blocks<<sub rts .End PRINTV .End-.Begin |
02 August 2022, 08:57 | #76 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Wonderful. Great job a/b! |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Exact functioning of DDFSTRT & STOP? | TommoH | Coders. Asm / Hardware | 19 | 04 July 2023 21:31 |
OCS + DDFSTRT=$30 - Losing spr6? | Antiriad_UK | Coders. Asm / Hardware | 5 | 18 December 2019 14:43 |
diwstrt, ddfstrt and hires | leonard | Coders. Asm / Hardware | 6 | 02 December 2019 00:38 |
7th sprite corrupt with DDFSTRT of 0x30 | FSizzle | Coders. Asm / Hardware | 9 | 11 November 2017 17:36 |
DDFSTOP question | FrenchShark | Coders. General | 5 | 08 August 2009 20:42 |
|
|