English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 24 May 2019, 20:27   #41
zeGouky
Registered User
 
Join Date: Oct 2005
Location: Edinburgh
Age: 43
Posts: 84
Dunno when it stopped working; will try a few previous build.

Do you have the code snippet that do the save by anychance ?
zeGouky is offline  
Old 24 May 2019, 20:38   #42
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
Fixed. During write index pulses were not generated. It seems to have been broken at least since 3.0..

This is how game does the disk write:

Code:
00C1A106 1039 00bf dd00           MOVE.B $00bfdd00,D0
00C1A10C 1039 00bf dd00           MOVE.B $00bfdd00,D0
00C1A112 0800 0004                BTST.L #$0004,D0
00C1A116 67f4                     BEQ.B #$f4 == $00c1a10c
00C1A118 33fc d955 00df f024      MOVE.W #$d955,$00dff024
00C1A120 33fc d955 00df f024      MOVE.W #$d955,$00dff024
00C1A128 1039 00bf dd00           MOVE.B $00bfdd00,D0
00C1A12E 1039 00bf dd00           MOVE.B $00bfdd00,D0
00C1A134 0800 0004                BTST.L #$0004,D0
00C1A138 67f4                     BEQ.B #$f4 == $00c1a12e
00C1A13A 33fc 4000 00df f024      MOVE.W #$4000,$00dff024
00C1A142 33fc 0002 00df f09c      MOVE.W #$0002,$00dff09c
Value written to DSKLEN makes Paula write about 150 words too much (which would overwrite "beginning" of sector) if not aborted by disk sync check.
Toni Wilen is online now  
Old 24 May 2019, 20:48   #43
zeGouky
Registered User
 
Join Date: Oct 2005
Location: Edinburgh
Age: 43
Posts: 84
Thanks Toni!
zeGouky is offline  
Old 24 May 2019, 22:53   #44
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,174
Cadaver V1.0 (not v0.1) saves in standard format IIRC not the shitty format they used (why did they do that when the game itself uses Rob Northen standard format...), and doesn't have protection. Use that, or whdload install
jotd is offline  
Old 25 May 2019, 00:42   #45
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Quote:
Originally Posted by jotd View Post
Cadaver V1.0 (not v0.1) saves in standard format IIRC not the shitty format they used (why did they do that when the game itself uses Rob Northen standard format...), and doesn't have protection. Use that, or whdload install
Yeah, I too would recommend the WHDLoad install of any game, as most errors in original game code will have been fixed by then.
Foebane is offline  
Old 25 May 2019, 02:13   #46
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
This is how game does the disk write:

Code:
00C1A106 1039 00bf dd00           MOVE.B $00bfdd00,D0
00C1A10C 1039 00bf dd00           MOVE.B $00bfdd00,D0
00C1A112 0800 0004                BTST.L #$0004,D0
00C1A116 67f4                     BEQ.B #$f4 == $00c1a10c
00C1A118 33fc d955 00df f024      MOVE.W #$d955,$00dff024
00C1A120 33fc d955 00df f024      MOVE.W #$d955,$00dff024
00C1A128 1039 00bf dd00           MOVE.B $00bfdd00,D0
00C1A12E 1039 00bf dd00           MOVE.B $00bfdd00,D0
00C1A134 0800 0004                BTST.L #$0004,D0
00C1A138 67f4                     BEQ.B #$f4 == $00c1a12e
00C1A13A 33fc 4000 00df f024      MOVE.W #$4000,$00dff024
00C1A142 33fc 0002 00df f09c      MOVE.W #$0002,$00dff09c
Hi Toni, as known HRM recommends to set #$4000,DSKLEN for idle mode after a write (or to break DMA on disk as in this case).
But there would have been some difference using instead a MOVE.W #$0000,DSKLEN?
It is perhaps to avoid that assembler optimization uses clr.w (double access on 000) on this write only register?
Any differences using MOVE.W #$10,DMACON to forcibly stop DMA?
ross is offline  
Old 25 May 2019, 08:30   #47
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
Quote:
Originally Posted by ross View Post
Hi Toni, as known HRM recommends to set #$4000,DSKLEN for idle mode after a write (or to break DMA on disk as in this case).
But there would have been some difference using instead a MOVE.W #$0000,DSKLEN?
It is perhaps to avoid that assembler optimization uses clr.w (double access on 000) on this write only register?
DSKLEN write logic works like this:

If bit 15 was already set previously and new value also has bit 15 set: start DMA. Write enable also requires bit 14 being set in both writes or it becomes read DMA.
If bit 15 is not set (old value = don't care): stop DMA immediately.

I am not sure why HRM recommends $4000. Your guess may be true (read access counts as write with "random" contents or in worst case $ffff) or perhaps there was some Portia or pre-release Paula bug.
Quote:
Any differences using MOVE.W #$10,DMACON to forcibly stop DMA?
DMACON only "pauses" the DMA (Paula stops sending Agnus disk DMA requests and DSKLEN is not counted down), DMA would continue when re-enabled.
Toni Wilen is online now  
Old 25 May 2019, 09:45   #48
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
DSKLEN write logic works like this:
Thanks

Quote:
DMACON only "pauses" the DMA (Paula stops sending Agnus disk DMA requests and DSKLEN is not counted down), DMA would continue when re-enabled.
This is interesting.
So with some well crafted code and an untouched real blank floppy you can theoretically replicate some impossible to copy "weak bits" protection.
ross is offline  
Old 25 May 2019, 10:12   #49
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
Quote:
Originally Posted by ross View Post
So with some well crafted code and an untouched real blank floppy you can theoretically replicate some impossible to copy "weak bits" protection.
I don't think it works with DMACON because I am quite sure RW head is still being driven (floppy write gate signal is active). I assume it is bit 14 that controls it + DSKLEN being in "active" state.

But I guess you could stop writing temporarily by clearing bit 14 of DSKLEN (but keeping bit 15 set), if bit 15 is kept set, new DSKLEN value gets loaded in internal disk length counter without interrupting active disk DMA. EDIT: But switching read<>write on the fly probably causes other side-effects because afaik read and write uses different Paula internal fifo logic.
Toni Wilen is online now  
Old 25 May 2019, 10:48   #50
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
I don't think it works with DMACON because I am quite sure RW head is still being driven (floppy write gate signal is active). I assume it is bit 14 that controls it + DSKLEN being in "active" state.
Yes you are certainly right.
Have you ever found any code that you use directly DSKDAT ($26)?.

Quote:
But I guess you could stop writing temporarily by clearing bit 14 of DSKLEN (but keeping bit 15 set), if bit 15 is kept set, new DSKLEN value gets loaded in internal disk length counter without interrupting active disk DMA. EDIT: But switching read<>write on the fly probably causes other side-effects because afaik read and write uses different Paula internal fifo logic.
Maybe in the past someone tried it and failed? Who know..
Anyways are just free thoughts on a Saturday morning
ross is offline  
Old 25 May 2019, 13:55   #51
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
Quote:
Originally Posted by ross View Post
Yes you are certainly right.
Have you ever found any code that you use directly DSKDAT ($26)?.
None. I don't think CPU can access DSKDAT or DSKDATR. It probably works like AUDxDAT, Paula ignores all CPU accesses if channel's DMA is enabled. Disk part probably don't implement extra logic(?) needed to support CPU accesses because it would make no sense, there is no flag that tells when write buffer needs new data.
Toni Wilen is online now  
Old 04 August 2019, 13:46   #52
zeGouky
Registered User
 
Join Date: Oct 2005
Location: Edinburgh
Age: 43
Posts: 84
Hi Toni,

I was wondering if you were able to fix this bug? Seems to still happening in latest.

Thanks!
zeGouky is offline  
Old 11 January 2021, 23:51   #53
Octopus66
Registered User
 
Join Date: Feb 2016
Location: London
Posts: 335
FYI this is still occurring in WinUAE v4.4
Octopus66 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
Save disk question diablothe2nd support.FS-UAE 7 10 April 2013 11:10
Save disk Eng_RS support.Games 0 04 April 2008 17:15
Cadaver and save, help! Aery support.Games 7 14 March 2007 16:42
Trained save game or kick-butt RPG party save disk for Pool of Raidiance 7-Zark-7 request.Old Rare Games 1 16 June 2003 01:51
save disk on winuae corchians support.WinUAE 0 10 March 2003 00:43

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 20:10.

Top

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