English Amiga Board

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

Thread Tools
Old 02 October 2020, 20:52   #1
Registered User

Join Date: Jan 2019
Location: Malmö / Sweden
Posts: 10
Copper start problem

Hi all,

I have a hard time understanding the output from the DMA debugger, regarding the copper.

Here's parts of my copper list - it ends with a wait, and is followed by a sine table (this becomes important in the following).

  dc.w	$2001,$fffe  ; wait for VP >= $20 and HP >= $00
  dc.w	$0104,$0000  ; move $0000 to $dff104 BPLCON2 video
  dc.w	$0108,$0000  ; move $0000 to $dff108 BPL1MOD modulus odd planes
  dc.w	$010a,$0000  ; move $0000 to $dff10a BPL2MOD modulus even planes
  dc.w	$008e,$2c81  ; move $2c81 to $dff08e DIWSTRT upper left corner ($81,$2c)
  dc.w	$0090,$f4c1  ; move $f4c1 to $dff090 DIWSTOP (enable PAL trick)
  dc.w	$0090,$38c1  ; move $38c1 to $dff090 DIWSTOP (PAL trick) lower right corner ($1c1,$12c)
  dc.w	$0092,$0038  ; move $0038 to $dff092 DDFSTRT data fetch start at $38
  dc.w	$0094,$00d0  ; move $00d0 to $dff094 DDFSTOP data fetch stop at $d0

  dc.w	$2c01,$fffe  ; wait for VP >= $2c and HP >= $00
  dc.w	$0100,$2200  ; BPLCON0 enable 2 bitplanes, enable color burst

  dc.w	$00e0,$0000  ; BPL1PTH (high bit 16-31)
  dc.w	$00e2,$0000  ; BPL1PTL (low  bit 0-15)
  dc.w	$00e4,$0000  ; BPL2PTH (high bit 16-31)
  dc.w	$00e6,$0000  ; BPL2PTL (low bit 0-15)

  blk.w	1600/2,0     ; allocate 800 words

  dc.w	$2c01,$fffe  ; wait for VP >= $12c and HP >= $00
  dc.w	$0100,$0200  ; BPLCON0 disable bitplane - older PAL chips.
  dc.w	$ffff,$fffe  ; wait indefinitely - until next vertical blanking

  blk.w	656/2,0
When I enter the debugger and get the DMA output for scanline 0, I see that at HP=0, the copper has fetched 0x0077, which is the first word from the sine table.

Line: 00   0 HPOS 00   0:
 [00   0]  [01   1]  [02   2]  [03   3]  [04   4]  [05   5]  [06   6]  [07   7] 
 COP  1FE  RFS  1FE  COP  08C  RFS  1FE  COP  08C  RFS  1FE    CPU-RW           
     0077      FFFF      2001      FFFF      FFFE      FFFF      0C40           
 0001D954            0001D2CC            0001D2CE            0001D258           
 4620AA00  4620AC00  4620AE00  4620B000  4620B200  4620B400  4620B600  4620B800
As I understand it, a wait will require three bus cycles. Two for the command words, and an additional cycle when the beam position is reached.

However, I thought that after vertical blanking, the program counter for the copper would be reset back to COP1LCx.

So why do I see 0x0077 at HP=0x00 and not 0x2001?

Last edited by Markowitch; 02 October 2020 at 21:12.
Markowitch is offline  
Old 02 October 2020, 21:59   #2
Defendit numerus

ross's Avatar
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 52
Posts: 3,846
Wrong section, you need to post to Coder.Asm/Hardware or Support.WinUAE (being related to WinUAE DMA debugger).

Copper start (hpos=0,vpos=0) need one extra cycle before first instruction fetch.
As you can see 0077 go to NIL (COP 1FE)
ross is offline  
Old 02 October 2020, 22:00   #3
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 47
Posts: 25,563
Thats what real hardware does, it first reads from last address + 2 before it jumps to first address.
Toni Wilen is online now  
Old 02 October 2020, 22:04   #4
Registered User

Join Date: Jan 2019
Location: Malmö / Sweden
Posts: 10
Thank you both - and sorry for posting in the wrong section.
(maybe a mod can move it?)
Markowitch 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 display problem mcgeezer Coders. Asm / Hardware 14 14 December 2018 23:32
Copper Wait Problem sandruzzo support.WinUAE 13 18 May 2016 22:54
Copper Wait Problem sandruzzo Coders. Asm / Hardware 2 17 May 2016 11:30
Copper list execution start. nandius_c Coders. Asm / Hardware 11 14 August 2014 23:28
Copper effect problem Steve support.WinUAE 3 25 June 2011 15:05

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:34.

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