English Amiga Board


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

 
 
Thread Tools
Old 27 July 2022, 07:10   #21
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
My first version (no wicked optimizations...): 2x30=60 bytes.
a/b is offline  
Old 27 July 2022, 13:05   #22
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Bah... 68 byte
ross is offline  
Old 27 July 2022, 16:28   #23
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Also 60 bytes, but unlike a/b it's not because I'm saving my good tricks for round 2...
Still have an annoying andi.w #3,d4 in there that I haven't found a space saving way of avoiding.
paraj is offline  
Old 27 July 2022, 16:53   #24
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by ross View Post
Bah... 68 byte
You're not alone. 66 here
meynaf is offline  
Old 27 July 2022, 17:08   #25
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by paraj View Post
Still have an annoying andi.w #3,d4 in there that I haven't found a space saving way of avoiding.
Found a way to remove it, but...
ross is offline  
Old 27 July 2022, 17:18   #26
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Quote:
Originally Posted by ross View Post
Found a way to remove it, but...

Actually, so did I, 58 bytes
paraj is offline  
Old 27 July 2022, 17:48   #27
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Actually not saving anyhthing, just haven't found any great optimizations ;p.
Now I'm having another look, validation changed a little... it's down to 58 bytes (no, it wasn't #3 ;p).
a/b is offline  
Old 27 July 2022, 17:53   #28
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
62..
ross is offline  
Old 27 July 2022, 18:13   #29
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Ok, now i've definitely missed something important...
meynaf is offline  
Old 27 July 2022, 18:19   #30
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Ok, 58, but I'm not sure it is right because my brain stopped working
ross is offline  
Old 27 July 2022, 18:38   #31
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Quote:
Originally Posted by ross View Post
Ok, 58, but I'm not sure it is right because my brain stopped working

Aren't you testing it?
Attached is what I'm using (harness is in C since I only have so much code golfing time ) Compile with vc +kick13 -O2 -o test.exe main.c fetch.s
Attached Files
File Type: zip fetchWidthTest.zip (1.2 KB, 42 views)
paraj is offline  
Old 27 July 2022, 19:06   #32
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by paraj View Post
Attached is what I'm using (harness is in C since I only have so much code golfing time ) Compile with vc +kick13 -O2 -o test.exe main.c fetch.s
I see your loop for FMODE goes from 0 to 5. But valid FMODE values are 0 to 15 ; bits 14-15 also have a meaning.
Besides, is DDFSTRT/DDFSTOP high byte always guaranteed to be 0 ?
meynaf is offline  
Old 27 July 2022, 19:38   #33
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Quote:
Originally Posted by meynaf View Post
I see your loop for FMODE goes from 0 to 5. But valid FMODE values are 0 to 15 ; bits 14-15 also have a meaning.
Besides, is DDFSTRT/DDFSTOP high byte always guaranteed to be 0 ?
It doesn't run through all possible values to limit runtime to something reasonable while testing. From Ross' initial challenge I would expected DDF* high bytes to be clear at least ("the DDF registers with usual values") but FMODE to have "any value", so it just checks a few FMODE >3.

I.e. in my code I expect FMODE=$0..$FFFF, DDFSTRT=$0.$FF,DDFSTOP=$0.$FF, chipset=$0..$2, res=$0..$2.

Ultimately it's just for fun, but I'll let Ross decide the true boundary conditions. Personally I'm fine if somebody gets a good result by assuming DDFSTRT <= 0x10 <= DDFSTOP <= 0xf0 or whatever.
paraj is offline  
Old 27 July 2022, 19:40   #34
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
I'm using bad ddfstart/ddfstop upper byte (testing with start from $ff18 to $ffe0, and end from start to $ffe0, vs. original c code). Fmode I set to $fffc|<0-3>. The rest is expected to be valid (res/chipset 0-2).
a/b is offline  
Old 27 July 2022, 20:14   #35
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by paraj View Post
so it just checks a few FMODE >3.
Wait, this is not the proper way.
FMODE lower two bits should always work, like the 'real' FMODE.

So a value = $8007 is valid and set 'fetch' or that which is =2.
ross is offline  
Old 27 July 2022, 20:32   #36
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Quote:
Originally Posted by ross View Post
Wait, this is not the proper way.
FMODE lower two bits should always work, like the 'real' FMODE.

So a value = $8007 is valid and set 'fetch' or that which is =2.
This should be checked properly by the test code (should check 0..5) if I didn't make another mistake.
Anyway, that's just how I tested my 58B version (testing now for $0.$FFFF FMODE since y'all be critical :P), not saying this is the proper way to judge it
paraj is offline  
Old 27 July 2022, 20:39   #37
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by paraj View Post
This should be checked properly by the test code (should check 0..5)
Is it a typo? 0..3
ross is offline  
Old 27 July 2022, 21:01   #38
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Quote:
Originally Posted by ross View Post
Is it a typo? 0..3
What I meant: Test code checks FMODE=0, FMODE=1, ... FMODE=5. So it should check $8007 implicitly if code handles FMODE=2 the same as (FMODE&3). It wasn't meant to catch all cases and decide a winner, just do quick validation of my own code
paraj is offline  
Old 27 July 2022, 21:06   #39
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Down to 56 bytes. This one I would classify as wicked.
a/b is offline  
Old 28 July 2022, 13:30   #40
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by a/b View Post
Down to 56 bytes. This one I would classify as wicked.
I re-observed the 58 byte routine and there are so many similar values and bit positions that it makes you think that something can be 'recycled', but I can't think of anything obvious, so is it possible that you completely refactored the original routine?

Anyway I will soon give up and I will declare you the winner


Is the word 'wicked' that scares me, I dare not imagine what you have done
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
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

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 23:23.

Top

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