English Amiga Board


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

 
 
Thread Tools
Old 11 November 2019, 14:34   #1
geldo79
Registered User
geldo79's Avatar
 
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 39
Posts: 32
Copper wait

Hi,

short and maybe stupid question: Is it possible to tell the copper to change the bg color to a specific colour, but only inside my playfield? In my case the whole screen changes to the new colour.

Greetings Christian
geldo79 is offline  
Old 11 November 2019, 14:43   #2
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Quote:
Originally Posted by geldo79 View Post
Hi,

short and maybe stupid question: Is it possible to tell the copper to change the bg color to a specific colour, but only inside my playfield? In my case the whole screen changes to the new colour.

Greetings Christian
You could change it at the beginning and end of each line, maybe?
deimos is offline  
Old 11 November 2019, 15:03   #3
geldo79
Registered User
geldo79's Avatar
 
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 39
Posts: 32
How can i do that? I thought i could only wait for a line (y position)....
geldo79 is offline  
Old 11 November 2019, 15:11   #4
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Quote:
Originally Posted by geldo79 View Post
How can i do that? I thought i could only wait for a line (y position)....
No, you can wait for a horizontal position too. It's just a little bit more tricky because you have to take into account the time that each move takes as well.

http://eab.abime.net/attachment.php?...0&d=1572886472

In that picture I've reused the colours on the map in the round horizon thing to give 10 colours on an 8 colour display.

Edit: Here's the code I used for that. It's C with my own macros, but you'll get the idea.

Code:
        // this loop takes us past the rollover
        for (UWORD i = 0xe4; i < 0x124; i++) {
            COP_INSTR(i << 8 | 0x01, 0xfffe)
            COP_INSTR(COLOR04, BLUE_RGB)
            COP_INSTR(COLOR05, GREEN_RGB)
            
            COP_INSTR(i << 8 | 0xc7, 0xfffe)
            COP_INSTR(COLOR04, 0x005c)
            COP_INSTR(COLOR05, 0x0731)

            if (i == 0xff)
                COP_INSTR(0xffdf, 0xfffe) // handle rollover
        }
You have to calculate the horizontal position to wait till, it doesn't correspond to pixels, but given that I had to change multiple colours I ended up doing it by trial and error. A smarter person might tell you how to calculate it.

Your copper code might end up with a loop rather than many lines.

Edit: Actually, thank you, I hadn't considered reusing colour 0. I'm going to try and see if I can get an extra colour on my main screen like that.

Last edited by deimos; 11 November 2019 at 15:30.
deimos is offline  
Old 11 November 2019, 15:12   #5
mcgeezer
Registered User

 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 1,507
You can make the copper wait on horizontal positions as well.

Geezer
mcgeezer is offline  
Old 11 November 2019, 15:54   #6
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,229
Quote:
Originally Posted by deimos View Post
Edit: Actually, thank you, I hadn't considered reusing colour 0. I'm going to try and see if I can get an extra colour on my main screen like that.
Yes, it is possible, as many games did to get one more color back in the days (Beast, Agony, Lionheart, etc.).
You have to do it for every line, so used if you have lot of splits (as these games).
ross is offline  
Old 11 November 2019, 16:18   #7
mcgeezer
Registered User

 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 1,507
I did it in Rygar on the hi-score screen... it changes the colour for 18 lines lines at a specific start and end horizontal position.

Here's the code snippet...

Code:
  moveq   #$12,d7

        move.l  #$7201fffe,d2   ; Wait VPOS $72  HPOS 01
        move.l  #$7285fffe,d3   ; Wait VPOS $72  HPOS $85
        move.l  #$72a5fffe,d4   ; Wait VPOS $72  HPOS $a5

        move.l  a1,COPPTR_HISCORE_CYCLE(a4)
.cycle:
        move.l  d2,(a1)+                        ; 4
        move.l  #$01900800,(a1)+                ; 8
        move.l  #$01a00bbb,(a1)+                ; 12

        move.l  d3,(a1)+
        move.l  #$019000f0,(a1)+
        move.l  #$01a00f0f,(a1)+                ; 24

        move.l  d4,(a1)+
        move.l  #$01900800,(a1)+
        move.l  #$01a00bbb,(a1)+                ; 36

        add.l   #$01000000,d2
        add.l   #$01000000,d3
        add.l   #$01000000,d4
        dbf     d7,.cycle
mcgeezer is offline  
Old 11 November 2019, 23:04   #8
geldo79
Registered User
geldo79's Avatar
 
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 39
Posts: 32
Quote:
Originally Posted by ross View Post
You have to do it for every line, so used if you have lot of splits (as these games).

Thus, for waiting for a specific horizontal position, i have to insert some more moves into my copperlist....ok. But if i want to have my bg color black at both sides of the screen, and some other color in the playfield, i would have to insert a lot of moves, because i would have to change the color back to black at the right end of each line. And if i have to do that for each line as you mentioned........


Or did i miss something?
geldo79 is offline  
Old 11 November 2019, 23:44   #9
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,229
Quote:
Originally Posted by geldo79 View Post
Thus, for waiting for a specific horizontal position, i have to insert some more moves into my copperlist....ok. But if i want to have my bg color black at both sides of the screen, and some other color in the playfield, i would have to insert a lot of moves, because i would have to change the color back to black at the right end of each line. And if i have to do that for each line as you mentioned........


Or did i miss something?
Of course only on lines where you want a different COLOR00 in playfield.
But yes, a COLOR00 change at the left edge and a COLOR00 back to black at the right edge.
ross is offline  
Old 12 November 2019, 10:18   #10
geldo79
Registered User
geldo79's Avatar
 
Join Date: Oct 2019
Location: Eydelstedt / Germany
Age: 39
Posts: 32
Well, i would like to have it on every line
geldo79 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
Best way to mix blitting with copper and copper effects roondar Coders. Asm / Hardware 3 12 September 2016 14:12
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
Wait() mritter0 Coders. C/C++ 2 17 May 2014 20:14
Combining copper scrolling with copper background phx Coders. Asm / Hardware 14 16 June 2013 08:26

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 15:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.07352 seconds with 15 queries