English Amiga Board

Go Back   English Amiga Board > Support > support.WinUAE

Thread Tools
Old 08 August 2017, 00:18   #1
Registered User

Join Date: Jun 2017
Location: Paris
Posts: 51
Bug with the Copper SKIP instruction ?


There MAY be a nasty bug with the SKIP instruction of the Copper.

The attached file is the source of a copper effect which I am coding at this time using ASM-One on WinUAE. It runs on Amiga 500.

The effect runs as follows. A copper list is created :


Then a set of COPPER_DY blocks like this, starting with y = COPPER_Y :

WAIT (X=COPPER_X, Y=?) mask $00FE
COPPER_DX MOVE of a value in COLOR00
MOVE adress of previous WAIT in COP1LCH/COP1LCL
y = y +7
SKIP (X=0, Y=y)

This is a bit tricky, but I will try to explain. What it does is that the Copper waits for line y = COPPER_Y. It then moves COPPER_DX values into COLOR00, which produces a line made of 8 pixels wide segments, each one in a distinct color. Next, the Copper moves the adress of the previous WAIT in COP1LCH and COP1LCL. Then the Copper checks if line y+7 has been drawn, and if not it executes the COPJMP1 which leads it to repeat the set of MOVE next line.

The main purpose is to create a screen made of 8x8 "pixels" drawn by the Copper only.

As you will notice on the screen capture or by running the program, there is glitch. To be more precise, if you set COPPER_Y to 127, this is were the glitch begins.

I don't think there is a bug in the program, but I would be happy to learn this is the case.

Unfortunately, I cannot check it on a true Amiga 500. This is why I ask for help. May somebody test this code on its real Amiga 500 and report if it produces a picture without the glitch ? If there is not glitch, then there is a bug in the way WinUAE handles the Copper SKIP instruction (some overflow in the way WinUAE handles the Y part of the SKIP, to be more precise).
Attached Thumbnails
Click image for larger version

Name:	skipbug.png
Views:	112
Size:	4.6 KB
ID:	54077  
Attached Files
File Type: s skipbug.s (6.8 KB, 33 views)
Yragael is offline  
Old 08 August 2017, 00:41   #2
Registered User

Join Date: Feb 2017
Location: fastmem
Posts: 53
Not a bug. HWRM explains details: http://amigadev.elowar.com/read/ADCD.../node005B.html

2nd list is not necessary, but toggling vpos @ $80+ and $100+ is.
pants is offline  
Old 08 August 2017, 00:47   #3
Registered User

Join Date: Jun 2017
Location: Paris
Posts: 51
Many thanks !
Yragael is offline  
Old 08 August 2017, 16:38   #4
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,954
SKIP also only works as documented if following instruction is MOVE.
Toni Wilen is offline  
Old 08 August 2017, 19:31   #5
Registered User

Join Date: Jun 2017
Location: Paris
Posts: 51
I have been checking the documentation and my code. It is strange, because I do not rely on masking bits in the vertical position (the documentation describes a problem happening if you mask bits in the vertical position). The second WORD of my SKIP instruction is always $FFFF. So the problem described in the documentation should not occur. I will check further...

What follows the SKIP is a MOVE to COPJMP1.
Yragael is offline  
Old 08 August 2017, 20:13   #6
Registered User

Join Date: Jun 2017
Location: Paris
Posts: 51
Ok. Found it. This is not a problem with the SKIP but with the WAIT. I mask the Y position in the WAIT before the bunch of MOVE, since I want to wait for the beginning of the line whatever may be the Y position. But as in the SKIP instruction, bit 7 of the Y position cannot be masked. Therefore the WAIT is true when the current beam position reaches a Y value which bit 7 is 1 (128).
Yragael 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
Possible bug in Copper timing / emulation LaBodilsen support.WinUAE 11 19 January 2016 09:01
Copper SKIP after SKIP neoman support.WinUAE 3 29 June 2015 16:46
Avoiding copper strobe/blitter bug mc6809e Coders. Asm / Hardware 31 28 November 2013 08:09
Combining copper scrolling with copper background phx Coders. Asm / Hardware 14 16 June 2013 07:26
Copper/jit bug workarround Leandro support.WinUAE 11 17 September 2002 09:21

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 03:29.

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