05 February 2018, 23:47 | #1 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Copper HALT
I'm patching an old game to make it fully system compliant and found some strange copper behaviour.
After the LoadView(NULL) i used AddIntServer(VBL) to setup my first copper list.. but do not have worked properly. So after investiganting i've found that COPJMP2 is set to execute a 'void' copper list. I was expecting total garbage on screen but nothing.. screen clean. I remembered reading something about the copper that stops in some situation and writing to "dangerous register" (with COPCON zeroed) is one of these. But what amazed me is that it is used by the system! So is it considered a feature? or is it just a huge bug? |
06 February 2018, 08:30 | #2 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
Quote:
Quote:
Have you checked this in main coplist ? Quote:
Quote:
It doesn't need to. Simple CEND is enough. I see no reason why the system would do something really not clever like this. Did you verify that : - copper DMA is activated - screen bitplane DMA is activated |
||||
06 February 2018, 09:38 | #3 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Quote:
What does the first copperlist look like? |
||
06 February 2018, 10:05 | #4 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
A better description, sorry.
System: bare A1200, KS3.0, boot from floppy with no SetPatch. Some init then LoadView(NULL). AddIntServer is really not significative, i've noticed the problem using it because i've used high priority (20) so copper is still on the first video lines executing the instructions launched by COP1LC. I've used COP1 but.. strangeness, so investigated. Situation (setup by LoadView): COPI1LC = $BF8, COP2LC -= $CA0 00000BF8 00E0 0000 0100 8201 0106 0C00 0180 0AAA -- cut -- 00000C88 013C 0000 013E 0CA4 0C01 FFFE 0C01 FFFE 00000C98 008A 0000 FFFF FFFE, 0000 0000 0000 0000 ; 00000CA0 0000 0000 0000 0000 0000 0000 0000 0000 You can see that after $0c01 CWAIT COP2JMP is triggered and copper continue to the illegal $0000,$0000 and ... HALT No more instruction executed, all stuck (restart next VB logically). Screen clear |
06 February 2018, 10:28 | #5 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
Odd, some internal voice tells me the secret lies in the -- cut -- part
|
06 February 2018, 10:42 | #6 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Nah, in the --cut-- part only some boring CMOVE
But solved! It's really a bug! On KS3.1 the copper list is the same but: COP1LC=$C00, COP2LC=$CA4 00000C00 00E0 0000 0100 8201 0106 0C00 0180 0AAA --cut-- 00000C90 013C 0000 013E 0CB0 0C01 FFFE 0C01 FFFE 00000CA0 008A 0000, 0106 0C00 FFFF FFFE 0000 0000 -> 00000CA4 0106 0C00 FFFF FFFE 0000 0000 0000 0000 Now i need to support the bugged KS3.0 copper list Thanks Maynaf and StingRay for the interest |
06 February 2018, 14:15 | #7 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
|
Copper stops (until next frame) when it attempts to write "dangerous register" and CDANG=0. (even if it is "skipped" move to dangerous register)
|
06 February 2018, 15:30 | #8 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Ok Toni, thanks.
What surprised me is that this "feature" (read: bug) is in system copper list in this particular situation. I've not tried in a Setpatched system or KS <3.0. Well, i'll check it [EDIT: mixed results 2.x and 3.1 is working properly, 1.3 and 3.0 copper HALT, <=1.2 same as 1.3/3.0 but different HALT code. Actually if you use full compliant code (OpenScreen and company) or a full takeover you don't get this corner case. But i'm constrained to a different solution. Anyway the patch is simple ] Last edited by ross; 06 February 2018 at 16:30. |
06 February 2018, 18:04 | #9 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 260
|
Quote:
|
|
06 February 2018, 18:30 | #10 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Thanks Dissident!
This thing happened to me a few minutes ago (LoadView (NULL), KS1.2 -> Guru) and I wondered why it happened! Only in particular conditions (repeatable), not normally.. Now I need a different solution. [EDIT: the problem seem not in LoadView(0) per-se but on successive WaitTOF, however I will try to understand more] Last edited by ross; 06 February 2018 at 18:39. |
07 February 2018, 09:54 | #11 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 260
|
Quote:
To make it clearer, here's the view-structure of KS 1.3: Code:
STRUCTURE View,0 LONG v_ViewPort LONG v_LOFCprList LONG v_SHFCprList WORD v_DyOffset WORD v_DxOffset WORD v_Modes LABEL v_SIZEOF I hope this may help you solving your problem. Last edited by dissident; 07 February 2018 at 12:28. |
|
07 February 2018, 13:09 | #12 | |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,630
|
Quote:
|
|
07 February 2018, 13:28 | #13 |
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,154
|
The simplest answer is probably just to skip the LoadView(NULL) under KS1.3 or earlier. It should be reasonably safe to assume that KS1.3 won't have left the chipset in a non-compatible state.
|
07 February 2018, 14:52 | #14 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,630
|
|
07 February 2018, 14:58 | #15 |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 260
|
Yes hooverphonique, I know this, but ross seems to want a blank display also on KS 1.2/1.3. That's why I made this suggestion.
|
07 February 2018, 15:02 | #16 |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 260
|
I agree with you, robinsonb5. For KS 1.2/1.3 you don't need a LoadView(NULL) to reset CUSTOM CHIP registers. It's superfluous. Checking the KS version before LoadView(NULL) is called would be a smarter solution.
|
13 February 2018, 21:42 | #17 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Quote:
Code:
;a5 - _custom ;a6 - gfx base ;reset display sub.l a1,a1 move.w #DMAF_RASTER,dmacon(a5) bsr OsViewLoad ... OsViewLoad: jsr -222(a6) ;gfx LoadView(a1 - view) jsr -270(a6) ;gfx WaitTOF() jmp -270(a6) ;gfx WaitTOF() |
|
13 February 2018, 23:37 | #18 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Thanks Asman, maybe this can be useful on KS1.x because a bug leave in the first frame BPLxPT uninitialized and garbage on screen.
But at the end i've understood why a guru on my routine and why on WaitTOF(). There is another bug, only on KS1.2, in AddIntServer().. Code:
When the system calls the specified interrupt code, the registers are setup as follows: D0 - scratch D1 - scratch (on entry: active interrupts -> equals INTENA & INTREQ) A0 - scratch (on entry: pointer to base of custom chips for fast indexing) A1 - scratch (on entry: Interrupt's IS_DATA pointer) A5 - jump vector register (scratch on call) A6 - Exec library base pointer (scratch on call) all other registers must be preserved And this is clearly specified. At some point i've changed from high to low priority. But i'm "transparent" to A0 so i'm not expecting problems (I use it but I do not change it). My priority is so low that i'm last in chain and ... last system service in KS1.2do not propagate A0! (all ok in successive release) So at the WaitTOF() I have already performed my routine and corrupted some system data and GURU! Phew.. at the end i've solved everything but so many bugs! Patches was for: http://eab.abime.net/showpost.php?p=...7&postcount=45 |
14 February 2018, 07:34 | #19 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 260
|
Quote:
|
|
14 February 2018, 08:22 | #20 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
That was idea behind this code - to omit garbage on screen when I overtake system - but you must remember to set DMAF_RASTER when system is restored. I really hate this garbage on screen which sometimes occurs.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Combining copper scrolling with copper background | phx | Coders. Asm / Hardware | 16 | 13 February 2021 12:41 |
Copper ASM | LeCaravage | Coders. Asm / Hardware | 5 | 30 January 2018 12:35 |
Using the Copper | guy lateur | Coders. C/C++ | 22 | 26 July 2017 19:29 |
Best way to mix blitting with copper and copper effects | roondar | Coders. Asm / Hardware | 3 | 12 September 2016 13:12 |
copper ? | turrican3 | Coders. Asm / Hardware | 10 | 27 January 2016 09:10 |
|
|