English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 17 September 2010, 16:42   #1
CmdrVimes
Badge 177
 
CmdrVimes's Avatar
 
Join Date: Aug 2010
Location: Mirfield / UK
Posts: 77
Recoverable Alert

Hi chaps,

I have run the attached MyCopperList.s several times and it has worked ok each time - one orange/yellow stripe moving up and down the screen.

I then modified it to MyCopperList1.s and it ran ok until I pressed the left-mouse-button. Then the screen went black and I got the message:

Recoverable Alert
Error 0100 000C Task 003AA2C0

In a flashing orange box.

Can anyone suggest why? All I did was move a code block and add a bsr and rts combination.

EDIT: Of course, it helps to attach the files
Attached Files
File Type: s MyCopperList.s (11.6 KB, 224 views)
File Type: s MyCopperList1.s (11.7 KB, 226 views)

Last edited by CmdrVimes; 17 September 2010 at 16:44. Reason: Incomplete uploads
CmdrVimes is offline  
Old 17 September 2010, 18:07   #2
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Hmmm...

I ran "MyCopperList1.s" on WinUAE 2.0.1 emulating an A600 (CPU: 68000, Chipset: ECS, 2MB RAM, 8MB Fast RAM). I didn't get the recoverable error message, but the copperlist failed dramatically (nothing at all visible but garbage) until I pressed the mouse button.
What is the target hardware (your settings)?


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 17 September 2010, 18:11   #3
CmdrVimes
Badge 177
 
CmdrVimes's Avatar
 
Join Date: Aug 2010
Location: Mirfield / UK
Posts: 77
@LoneWolf
Best if I just do this...
Attached Files
File Type: uae A1200_KS3.1_AGA_2MChip_8MFast.uae (12.9 KB, 233 views)
CmdrVimes is offline  
Old 17 September 2010, 18:12   #4
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Most likely because you're clearing more colored lines than you have allocated in your copper program. I counted 216 lines but you're clearing 239 and so you could be poking in memory that is in use by the system or another program.
Leffmann is offline  
Old 17 September 2010, 18:14   #5
CmdrVimes
Badge 177
 
CmdrVimes's Avatar
 
Join Date: Aug 2010
Location: Mirfield / UK
Posts: 77
@Leffmann

Thank you, thank you, thank you. I knew it'd be something blindingly obvious. Now all I have to do is learn to count...
CmdrVimes is offline  
Old 17 September 2010, 18:18   #6
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
You replied too quick!


I compiled both using Devpac 2 (minus the chip ram bit) and they both failed.

I compiled both using Devpac 3 (WITH the chip ram bit) and they both worked - no error. It must be something specific to your settings. Perhaps AGA specific? *shrugs*



Edit: No reply for several hours, then multiple replies at once! typical!!

Regards,
Lonewolf10
Lonewolf10 is offline  
Old 17 September 2010, 18:58   #7
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by CmdrVimes View Post
@Leffmann

Thank you, thank you, thank you. I knew it'd be something blindingly obvious. Now all I have to do is learn to count...
In this example you could do it like this: Create a label at the beginning of the copperlist and one at the end and then just let the assembler calculate the correct amount of lines.

Code:
    ;move.w    #239-1,d1        ;Counter
    move.w    #(clearend-clearstart)/8-1,d1

.........

copperlist:
    dc.w    $0100,$0200        ;No bitplane
    dc.w    $0180,$0000        ;Backcolour -> black
    dc.w    $1a07,$fffe            
clearstart
    dc.w    $0180,$0000
    dc.w    $1b07,$fffe            
    dc.w    $0180,$0000
    dc.w    $1c07,$fffe            
    .....
    dc.w    $0180,$0000
    dc.w    $ef07,$fffe
    dc.w    $0180,$0000
    dc.w    $f007,$fffe
    dc.w    $0180,$0000
    dc.w    $f107,$fffe
    dc.w    $0180,$0000                                        
clearend
    dc.w    $ffff,$fffe        ;End of copperlist
    dc.w    $0180,$0000        ;Set it to black
Also, please try to avoid these hardcoded offsets otherwise you'll spend a lot of time searching for bugs once you change/update the code. What I mean is code like this f.e.:

lea copperlist(pc),a0
add.w #14,a0

Now, what happens if you decide you need some other copper instructions in your copperlist? There are several ways to avoid problems like that, easiest approach is to just create a label and then use that, e.g.
lea clearstart+2(pc),a0 ; +2 to skip the dc.w $180 word

Hope it's clear what I mean otherwise just ask!
StingRay is offline  
Old 20 September 2010, 11:03   #8
CmdrVimes
Badge 177
 
CmdrVimes's Avatar
 
Join Date: Aug 2010
Location: Mirfield / UK
Posts: 77
Morning Everyone.

Quote:
Originally Posted by StingRay View Post
Hope it's clear what I mean otherwise just ask!
I would not have considered that - I didn't even know it was possible. I have to try and change the way I think about this. If you read/write past the 'end' of a specific location you just end up in the next one which, although perfectly valid as far as the compiler is concerned, may cause all sorts of problems with the code. Alternatively, following your example, you can use it to label specific items within a list without affecting the list itself.

I need to stop thinking in terms of traditional-style variables and arrays. Many thanks for the insight.
CmdrVimes is offline  
Old 21 September 2010, 18:20   #9
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
stingray why do you divide by 7 on this line

Code:
move.w    #(clearend-clearstart)/8-1,d1
BippyM is offline  
Old 21 September 2010, 18:56   #10
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
@ bippym - he doesn't

He divides by 8 and then minuses one for the dbra loop.
pmc is offline  
Old 21 September 2010, 18:57   #11
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,188
@bippym

Dividing by 8 and then subtracting 1 is not the same as dividing by 7. Check your order of operations. Even in the assemblers that don't support order of operations, they still go from left-to-right.
Samurai_Crow is offline  
Old 21 September 2010, 18:57   #12
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
okay so why divide by 8??
BippyM is offline  
Old 21 September 2010, 19:06   #13
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
A copper colour change goes:

Code:
dc.w wait_pos,wait_mask
dc.w colour_reg,colour_val
that's four words. Four words = eight bytes

Eight bytes per line of copper colour change, minus one for the dbra loop.
pmc is offline  
Old 21 September 2010, 19:07   #14
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,188
@bippym

A copper wait instruction + a copper move instruction = 8 bytes?

-edit-
Ninja'd twice in one thread!

Last edited by Samurai_Crow; 21 September 2010 at 19:09. Reason: Ninja'd
Samurai_Crow is offline  
Old 21 September 2010, 19:08   #15
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
We seem to be on the same wavelength tonight Samurai Crow!
pmc is offline  
Old 21 September 2010, 19:15   #16
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
Cheers chaps, I guess if I had read the source completely and the thread I'd have had a better understanding anyway.. Laziness
BippyM 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
SPAM alert andreas project.EAB 18 24 August 2010 23:54
A4000t Alert!!!!! Firthy2002 MarketPlace 1 02 May 2005 19:38

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 13:12.

Top

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