![]() |
![]() |
#101 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
![]() That's why I was being dumb - I didn't even realise sf.b was a valid mnemonic!! I'd never come across it before! You're still the man Sting. ![]() |
![]() |
![]() |
#102 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Tested as working 410 byte version attached.
StingRay is officially a legend. ![]() Last edited by pmc; 23 March 2010 at 20:11. |
![]() |
![]() |
#103 |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 43
Posts: 2,351
|
Code:
move.w #%0111111111111111,d0 move.w d0,intena(a5) move.w d0,dmacon(a5) move.w d0,intreq(a5) Code:
move.l #%01111111111111110111111111111111,d0 move.l d0,intena(a5) move.w d0,dmacon(a5) ![]() ![]() Asman could be onto something with his $4489 in a register idea, but it might just trade off ? Damn, my kingdom for an assembler ![]() |
![]() |
![]() |
#104 |
TDI
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
|
Best thread ever
![]() |
![]() |
![]() |
#105 | ||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
![]() Are you aiming to take the "legend" crown?! ![]() Quote:
In an address registers $4489 means something very different, no? |
||
![]() |
![]() |
#106 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
Quote:
Code:
; Setup disk controls move.w #$4489,a1 move.w a1,dsksync(a5) ;MFM sync mark ... .seek_hdr_strt: cmp.w a1,(a3)+ ;find start of sector bne.s .seek_hdr_strt cmp.w a1,(a3) |
|
![]() |
![]() |
#107 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
OK guys - musashi5150's extra two byte saving has been implemented - trackloader now standing at 408 bytes.
![]() I'll investigate Asman's suggestion after I've eaten some lunch. ![]() New version to come... |
![]() |
![]() |
#108 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,574
|
Disk DMA enable/disable and DSKLEN $4000 writes can be removed. (Perhaps it is recommend somewhere but there really isn't any difference unless you need to abort active DMA)
|
![]() |
![]() |
#109 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
I have a "clean" (i.e. Disk DMA still enabled etc) 402 bytes version.
![]() ![]() |
![]() |
![]() |
#110 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
398 bytes version attached. More can be done but I think I did my fair share of killing bytes.
![]() Edit: just noticed there was a small bug in the init part (move.l/move.w) which I introduced when I applied Musashi's optimization. ![]() Last edited by StingRay; 23 March 2010 at 14:58. |
![]() |
![]() |
#111 | ||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
The king wants to keep his crown! ![]() Edit: Quote:
![]() Even more power! |
||
![]() |
![]() |
#112 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
We can do another one dirty trick to save some bytes (probably). Just replace
Code:
lea cust_regs,a5 Code:
lea cust_regs+dsklen,a5 ![]() |
![]() |
![]() |
#113 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
|
![]() |
![]() |
#114 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
Ahhhhh..... Yeeaah. You did that. Awesome
![]() |
![]() |
![]() |
#115 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Almost.
![]() ![]() |
![]() |
![]() |
#116 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,549
|
Quote:
![]() Great stuff! I didn't expect that to go lower than 400 bytes! Some more. You can deselect and disable the diskmotor bit at once: Code:
trkld_done: bset.b #3,(a6) ;deselect df0: bset.b #7,(a6) ;dskmotor high --> trkld_done: or.b #%10001000,(a6) |
|
![]() |
![]() |
#117 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
Quote:
![]() ![]() |
|
![]() |
![]() |
#118 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
This has been a really interesting experience for me.
I'm starting to see now that once you get right down to trying to wring every last space saving out of a piece of code that you start getting into a trade off for those size decreases in terms of both readability of the code and also speed of execution of that code. As a middle way I think that the version of this code I actually use going forward will be the one I think has the right balance of these trade offs for me personally. ![]() |
![]() |
![]() |
#119 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
![]() |
![]() |
![]() |
#120 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
HD loader example | st! | Coders. General | 4 | 16 October 2012 21:56 |
Game loader stuck on certain track after save state restore | andreas | support.WinUAE | 2 | 26 March 2011 19:59 |
Can't transfer Supaplex cause of CSL track loader ! | Vollldo | support.Games | 4 | 12 March 2011 21:51 |
Hardware File Loader | h0ffman | Coders. General | 9 | 02 December 2010 16:40 |
mfm/custom regs/track loader | snyp | Coders. General | 9 | 06 June 2006 19:42 |
|
|