English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 27 August 2021, 17:17   #41
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
I've a solution, using only sprites and no copper tricks or dual playfields or more colors:

Blinky (red)
Pinky (pink)
Inky (cyan)
Clyde (orange)
eyes: blu, white

COLOR registers:
16 null
17 red
18 blue (normal +ATT)
19 white (normal +ATT)
20 cyan (null for Pinky) (+ATT)
21 pink
22 blue
23 white
24 black (+ATT)
25 black (+ATT)
26 black (+ATT)
27 black (+ATT)
28 orange (+ATT)
29 null
30 null
31 null

sprite 0 Blinky
sprite 1 black tunnel at right (ATT bit)
sprite 2 Pinky
sprite 3 null
sprite 4/5 Inky (ATT bit)
sprite 6/7 Clyde (ATT bit)

So main idea:
- use sprite 1, ATT=1, DATA=0, DATB=$FFFF, position right of screen (tunnel)
- use sprite 4/5 and 6/7 as 16 colors sprites
- COLOR24,25,26,27=0 to make Blinky disappears when 'overlaid'/'mixed' by the tunnel (other ghosts disappear in tunnel by sprites auto-priority)

EDIT: but i guess this has nothing to do with sprite multiplexing, this question and answer should be moved to your Pacman thread

Last edited by ross; 27 August 2021 at 17:46.
ross is offline  
Old 27 August 2021, 19:05   #42
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
I'm not too familiar with attached sprites but I get it now. It looks a lot like my original idea, only better

It's however complicated and non-symmetric. I'd have to redo everything sprite from the start, where it works perfectly now, except for that clipping part.

I have enough CPU power to shift sprite images.

Thanks anyway.

Last edited by jotd; 27 August 2021 at 19:11.
jotd is offline  
Old 27 August 2021, 22:18   #43
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Another way to do it would be to use one of your in game colours for the clipping, but horizontally change the colour to Black at the borders.

Geezer
mcgeezer is online now  
Old 27 August 2021, 23:01   #44
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
I was planning to do that, but problem is: the color I'm changing to black and which must be restored is variable too (depending on the enemy state). So I'm going to have to write to 16 words each time the enemy changes state (only the enemy using the other sprite though)

In the end, shifting the data is simple & generic. I'll go for that.
jotd is offline  
Old 12 April 2023, 11:44   #45
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Due to a recent discussion I need confirmation for this statement again:
Quote:
Originally Posted by Toni Wilen View Post
They have fixed positions but if DMA channel is not needed for current line (even if DMA channel is enabled), it's slot(s) can be used by other lower priority channels, including CPU.
The last two words still surprise me. Even the HRM states that the 68000 can only use every second cycle for memory access. Let's call them "odd cycles". Most custom chip DMA is peformed during even cycles - including Sprite DMA we were talking about.

How can such an unused DMA slot, which is on an even cycle, ever be used by the 68000? I don't get it...
phx is offline  
Old 12 April 2023, 12:06   #46
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,410
Quote:
Originally Posted by phx View Post
Due to a recent discussion I need confirmation for this statement again:


The last two words still surprise me. Even the HRM states that the 68000 can only use every second cycle for memory access. Let's call them "odd cycles". Most custom chip DMA is peformed during even cycles - including Sprite DMA we were talking about.
The HRM simplifies things a bit for clarity, but the CPU can actually access any cycle on the bus - it just can't access two bus cycles in a row.
Quote:
How can such an unused DMA slot, which is on an even cycle, ever be used by the 68000? I don't get it...
Normally, the 68000 gets pushed into the 'odd' cycles, but if you use a 68000 instruction that has a cycles count that is not divisible by 4, you can actually get CPU cycles on the 'even' cycles as well.

This is usually not permanent, as DMA sources tend to push the CPU back onto the 'odd' cycles shortly afterwards, but it's still possible.
roondar is online now  
Old 12 April 2023, 17:38   #47
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by roondar View Post
Normally, the 68000 gets pushed into the 'odd' cycles, but if you use a 68000 instruction that has a cycles count that is not divisible by 4, you can actually get CPU cycles on the 'even' cycles as well.
Ok, I see.

Quote:
This is usually not permanent, as DMA sources tend to push the CPU back onto the 'odd' cycles shortly afterwards, but it's still possible.
There are quite some instructions and addressing modes, which have a cycle count which is not divisable by 4. Does it mean that the CPU is constantly blocked and pushed back into the odd cycles? That would be less than ideal.
phx is offline  
Old 12 April 2023, 18:01   #48
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by phx View Post
There are quite some instructions and addressing modes, which have a cycle count which is not divisable by 4. Does it mean that the CPU is constantly blocked and pushed back into the odd cycles? That would be less than ideal.
No, it depends on DMA bus usage.
The CPU cycle is 'delayed' only if Agnus requires it for its purposes.

Odd cycles are usually the most used by DMA channels because they have priority in the fixed allocations (refresh, audio, disk, sprites, bitplanes..), but, for example, copper (or blitter or >4bpls) use possibly even cycles.

So in the 'grand scheme' of bus usage, it doesn't really matter if the CPU requests a 'misaligned' cycle.

EDIT:
If I'm not mistaken this is one of the big differences between Amiga and AtariST (but I ask the ST experts for confirmation!) where what you said always happens.
For instance, an instruction like
lsl.w #4,d0
is often two cycles faster on the Amiga .

Last edited by ross; 12 April 2023 at 18:27.
ross is offline  
Old 12 April 2023, 21:20   #49
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by ross View Post
So in the 'grand scheme' of bus usage, it doesn't really matter if the CPU requests a 'misaligned' cycle.
Agreed. Although for me this is still a shock, because I was always convinced that the CPU would never be blocked from Chip RAM access, as long as I don't use blitter, copper or more than four bitplanes.

Thanks for the explanation.
phx is offline  
Old 27 April 2023, 02:08   #50
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Personally I've never used sprites, I usually have everything in memory and just use the blitter (I have a kind of multitasking interface for the blitter that I've developed).
Steam Ranger is offline  
Old 27 April 2023, 10:25   #51
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by ross View Post
For instance, an instruction like
lsl.w #4,d0
is often two cycles faster on the Amiga .
This example only uses the bus for fetching the instruction, so how would it take longer on an ST? Is it because the following instruction is delayed to 2 cycles (for alignment), so it isn't actually this instruction that takes longer?
hooverphonique is offline  
Old 27 April 2023, 11:06   #52
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by hooverphonique View Post
Is it because the following instruction is delayed to 2 cycles (for alignment), so it isn't actually this instruction that takes longer?
This.
It is only an indirect effect of the 'delay' on next fetch.
ross 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
Settlers sprite zdechlak project.Sprites 1 02 March 2019 10:55
Best sprite scaling/Doom style engines on Amiga? ImmortalA1000 Amiga scene 95 23 July 2018 00:17
Amiga Sprite/Tile Cross-Platform Software? diablothe2nd Amiga scene 16 12 July 2013 17:29
sprite overscan jamiejamie Coders. General 11 02 February 2011 16:59
DIWSTART and sprite Camionsauro Coders. Tutorials 3 22 April 2009 13:24

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 11:20.

Top

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