English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 17 October 2018, 23:06   #1
prb28
Registered User

 
Join Date: May 2018
Location: France
Posts: 27
What should look like a disassembled copper list ?

What is the best way to show a copper list to help to understand/debug it ?
In the actual version of the Amiga Assembly for vscode it looks like the attached image.
Looking around I found this example (http://codetapper.com/amiga/sprite-tricks/agony/):
Code:
0005f18e: 010a 0502       ;BPL2MOD := 0x0502 
0005f192: 9fd7 fffe       ;Wait for vpos >= 0x9f and hpos >= 0xd6. 
0005f196: 0180 0000       ;COLOR00 := 0x0000
For a noob what visualisation can help ?
For a confirmed dev, what could help to detect a bug ?
Attached Thumbnails
Click image for larger version

Name:	Copperlistvscode.png
Views:	76
Size:	52.1 KB
ID:	60319  
prb28 is offline  
Old 18 October 2018, 15:24   #2
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,589
Maybe you're asking, "how do I learn to read Copper list from hex words"? Well I can read them just as they are, and when I write them, I just use dc.w. But if you want you can translate them to MOVE and WAIT macros, and look up register names. So the list would be,

Code:
CMOVE BPL2MOD,$502
CWAIT $9fd7[,$fffe]
CMOVE COLOR00,0
or whatever the official macro names are. Both are basically just synonyms for "dc.w", so...

Resource should be able to symbolize just the offsets? If it knows it's in a Copper list. As for detecting the last bit of the first word to switch between macros, I'm not sure it can. But there might be a tool on Aminet. It should be dead simple to make one, if not.
Photon is offline  
Old 18 October 2018, 19:42   #3
prb28
Registered User

 
Join Date: May 2018
Location: France
Posts: 27
Thanks Photon,
what I understand is: with some practice, a copper list in hex is self explanatory.
So there is no really need to explain it, maybe only for the new amiga assembly programmers (like me).
Is there some bugs/mistakes that are hard to see in hex form ?
prb28 is offline  
Old 18 October 2018, 21:50   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,022
Copper list "disassembly" is from UAE debugger (o-command, with od you also get timing information)

Quote:
Is there some bugs/mistakes that are hard to see in hex form ?
IMO most common is badly timed MOVEs to registers that can cause conflicts if it happens exactly at wrong time. It can cause very unexpected bugs when/if later you add/remove other copper list instructions and "conflicting" (or previously non conflicting) MOVE gets executed few cycles later or earlier..

These kinds of bugs are not easily noticed even from "disassembly" unless you know exactly what are you looking for.
Toni Wilen is offline  
Old 19 October 2018, 19:47   #5
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,589
Prb28, it depends. If you're relatively new to Asm/Hardware programming, some things are maybe not so obvious.

Things like knowing $2c at the start of a WAIT corresponds to the top line of a standard 320x256 screen, and $ac is then in the middle and $(1)2c is the bottom. What horizontal positions are left and right edge, and that a few of the custom registers must be written at the correct time, as Toni describes.

Knowing some common values could help you interpret the Copper list. Like $fffe being the standard last word of WAIT commands (that's why you can replace it with a constant, like in your screenshot).

If you already know how the raster works, sweeping down line by line from the top left corner to the bottom right corner, then maybe thinking of the Copper as a list of stops that split the screen into slices is a good visualization.

Or maybe you could imagine it as a vertical accordion that is compressed down to a short list, and when it's executed, it expands to cover the screen.

In other words, maybe it's the function of the Copper you have to visualize, and then the syntax won't matter?

If you're coming from high level languages, the WAIT command is a REPEAT UNTIL VHPOSR>=myPos, and the MOVE commands are POKEs.

Here is episode 5 [ Show youtube player ] and 6 [ Show youtube player ] from my tutorial series. If you already know this stuff then ignore.
Photon is offline  
Old 19 October 2018, 20:04   #6
prb28
Registered User

 
Join Date: May 2018
Location: France
Posts: 27
I understand...
The problem is space (screen location) and timing.
In an editor we just have text, so maybe a representation in ascii if the screen with colors and a popup on certain pixels to see the register pokes may be useful.
prb28 is offline  
Old 20 October 2018, 00:47   #7
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,589
That sounds like an emulator, so... just run it in an emulator?

Code:
RunCopper:
	move.w #$4000,$dff09a
	move.l #$5f18e,$dff080 ;copper address
waitmouse: btst #6,$bfe001
	bne.s waitmouse
	move.w #$c000,$dff09a
	rts
Photon is offline  
Old 20 October 2018, 09:54   #8
prb28
Registered User

 
Join Date: May 2018
Location: France
Posts: 27
You’re right...
prb28 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
Copper List Rainbow - Sorry, but where do I begin? Marle Coders. Blitz Basic 4 26 August 2018 15:44
Copper list assistance mcgeezer Coders. General 6 29 December 2017 01:14
Updating copper list every frame carrion Coders. Blitz Basic 12 02 October 2017 12:31
Copper list execution start. nandius_c Coders. Asm / Hardware 11 14 August 2014 23:28
Copper list setup for runtime library Samurai_Crow Coders. General 7 26 August 2010 17:14

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 02:26.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06919 seconds with 16 queries