![]() |
![]() |
#121 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
WB, RB, WS, WT and CC are *invaluable* tools. |
|
![]() |
![]() |
#122 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
![]() |
|
![]() |
![]() |
#123 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Starting to stray a bit off topic this but a quick couple of questions about ASM-One:
I've been using v1.48 This version crashes as soon as it's run on 68000 ECS emulated Amiga - I have to use it on a > 68020 RTG emulated Amiga for it to work. Anything I can do about this...? Also, this version seems to hang when I do CC. It calculates the bootblock checksum OK but just sits there and never dumps me back to a command line prompt. Is this a bug in this verson...? Bearing in mind the above issues, any better version of ASM-One to use...? |
![]() |
![]() |
#124 | |||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
![]() Quote:
Quote:
![]() |
|||
![]() |
![]() |
#125 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
OK cool.
Quote:
![]() |
|
![]() |
![]() |
#126 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
If you can't, here's some code:
Code:
; calc bootblock checksum lea DISK,a0 lea 4(a0),a1 clr.l (a1) move.w #1024/4-1,d7 moveq #0,d0 moveq #0,d1 .calc add.l (a0)+,d0 addx.l d1,d0 dbf d7,.calc not.l d0 move.l d0,(a1) |
![]() |
![]() |
#127 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
BTW, did somebody try the trackloader yet?
I'm not sure if it really can find the correct track (the hardcoded track 2 in the source will work though). When looking at the stepping routine: Code:
.move_to_trk: btst.l #0,d4 bne.s .odd_track bsr.s .lower_head bra.s .do_move .odd_track: subq.b #1,d4 bsr.s .upper_head cmp.b d4,d5 beq.s .correct_trk .do_move: addq.b #1,d5 cmp.b d5,d4 beq.s .read_trk bsr.s .step_heads bra.s .do_move .correct_trk: addq.b #1,d4 I have rewritten that part to fix it and save another six bytes ![]() Code:
.move_to_trk: move.w d4,d0 sub.w d5,d0 lsr.w #1,d0 bcs.s .odd_track bsr.s .lower_head bra.s .do_move .odd_track: bsr.s .upper_head bra.s .do_move .seek_loop: bsr.s .step_heads addq.w #2,d5 .do_move: dbra d0,.seek_loop |
![]() |
![]() |
#128 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
It doesn't step a cylinder phx.
If track is even and d5 != d4 it steps a cylinder and selects lower head. If track is odd and d5 != d4, it steps to one track less (ie. to the even track) and selects the upper head. Well, that's how it's supposed to work. ![]() And it does seems to work - I have successfully tested and been loading things with each version of the trackloader I've posted before posting. You have got me thinking though - I'll do more testing. ![]() PS - six byte saving is nice. ![]() Last edited by pmc; 23 March 2010 at 15:54. |
![]() |
![]() |
#129 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
Quote:
Quote:
|
||
![]() |
![]() |
#130 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
![]() Your doubts is why you've now got me thinking. It's supposed to read from the start track sequentially like this: move to start track, modifying for odd if necessary by track minus one and select upper head. Read one track at a time (only plus one to current required track number in d5) Each time performing the is it odd / is it even check and either stepping the heads and selecting the lower head (for even tracks) or only swapping to the upper head as necessary (for odd tracks). |
|
![]() |
![]() |
#131 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
Quote:
But what happens when your start track is track 20 instead of track 2? It has to step ten times in your loop and IMHO you will step nearly 20 times (maybe 19?) instead. |
|
![]() |
![]() |
#132 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@ phx - you have a point, up to a point.
I went away and did some testing. If the start track is *any* even track, it works fine. But, if the start track == an odd numbered track, the trackloader fails. I think I can see the reason for this in the debugger so I should be able to implement a fix. Last edited by pmc; 24 March 2010 at 08:21. Reason: Removed the inaccurate stuff I posted when I'd been looking at code so long I'd gone cross eyed :-D |
![]() |
![]() |
#133 |
Registered User
Join Date: Mar 2010
Location: Lkpg/Swe
Posts: 12
|
Can I join this intellectual game? I was once quite interested in making 68k programs short and I enjoyed reading the discussion up to now.
This is so obvious that I think I must have missed something: Code:
move.w sr,d0 andi.w #%1101111111111111,d0 ;restore user mode move.w d0,sr Code:
andi.w #%1101111111111111,sr ;restore user mode Next, I wonder if it's worth 6 bytes to preserve the SPMODE bit of CIA B? I think it's in fact not used: Code:
.wait_timer: andi.b #%11000000,ciabcra-ciabprb(a6) ori.b #%00001000,ciabcra-ciabprb(a6) Code:
move.b #%00001000,ciabcra-ciabprb(a6) Code:
start: dc.b "DOS",0 ;DOS disk identifier dc.l 0 ;room for bootblock chksum dc.l 0 ;room for rootblock pointer ... move.l #$7fff7fff,d0 Code:
start: dc.b "DOS",0 ;DOS disk identifier dc.l 0 ;room for bootblock chksum rootblkp: dc.l $7fff7fff ... move.l rootblkp(pc),d0 Code:
move.l d0,intena(a5) move.w d0,dmacon(a5) ... move.b #%01111111,ciabicr-ciabprb(a6) Code:
move.l d0,intena(a5) move.w d0,dmacon(a5) move.w d0,ciabicr-ciabprb(a6) ... ![]() |
![]() |
![]() |
#134 | |||||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
![]() Quote:
![]() Quote:
![]() Quote:
![]() Quote:
![]() ![]() Last edited by StingRay; 24 March 2010 at 09:39. Reason: quote fixed |
|||||
![]() |
![]() |
#135 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
According to phx idea with two bset maybe we can do the same things with two bclr. Mean
Code:
bclr.b #7,(a6) ;dskmotor low bclr.b #3,(a6) ;select df0: with dskmotor low to start motor Code:
andi.b #01110111,(a6) |
![]() |
![]() |
#136 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Hey zaz, nice to see you here.
![]() Quote:
Manipulating the sr is privileged - I thought only a move to or from sr was allowed - hence move, and, move rather than just and. At least I thought I read that somewhere, maybe I was wrong and anding the sr is OK...? EDIT - my mistake - andi sr looks to be OK. Last edited by pmc; 24 March 2010 at 10:52. |
|
![]() |
![]() |
#137 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,575
|
Do not do this. Motor state must be set before activating select. (select is latch signal for motor flipflop, changing both will not work with all hardware implementations)
|
![]() |
![]() |
#138 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,575
|
Quote:
![]() Technically it will work but I don't think it will work with all models. (like some 68060 accelerators) Please, don't do this ![]() High byte (0x7f) goes to ciabicr, low byte (0xff) goes nowhere. |
|
![]() |
![]() |
#139 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
Quote:
![]() |
||
![]() |
![]() |
#140 |
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 |
|
|