News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Recent posts

#1
avatar_Cwiiis
Programming / Re: Plus sprite upload tips
Last post by Cwiiis - Today at 18:18
Quote from: roudoudou on Today at 18:13absurd branch : when you already have a register for the data, use the register, do not explore other cases
there is many cases when you do not have the register ready to use but you can be smart ;)
and use some auto-purge if needed, you will gain speed+memory

Right, this isn't brute-force at this point, this is a heuristic :) Limited depth, breadth-first and pruning the least successful branches might be a good way of limiting the search space. I wonder how much more efficient it would be vs what I'm doing at the moment though...
#2
avatar_roudoudou
Programming / Re: Plus sprite upload tips
Last post by roudoudou - Today at 18:13
absurd branch : when you already have a register for the data, use the register, do not explore other cases
there is many cases when you do not have the register ready to use but you can be smart ;)
and use some auto-purge if needed, you will gain speed+memory
#3
avatar_Cwiiis
Programming / Re: Plus sprite upload tips
Last post by Cwiiis - Today at 18:11
Quote from: roudoudou on Today at 18:09
Quote from: Cwiiis on Today at 18:01
Quote from: roudoudou on Today at 17:56
Quote from: Cwiiis on Today at 15:33Think I got my powers mixed up, you can't brute-force this :laugh:  Well, maybe you could with a GPU, but that's getting extreme - I'm going to try to devise a few strategies and perhaps I can pick the best one depending on the input.
"you can't brut force this"

why?


Because of combinatorial explosion? I may have gotten my numbers wrong and/or my code wrong of course, but it seemed that way.

if you avoid creating absurd branches, the combinatory is small (and we have a tremendous amount of memory for that small sprites)


What do you consider an absurd branch? Obviously you only create branches when pixels change and aren't covered in existing registers, but even then the combinations are huge...
#4
avatar_roudoudou
Programming / Re: Plus sprite upload tips
Last post by roudoudou - Today at 18:09
Quote from: Cwiiis on Today at 18:01
Quote from: roudoudou on Today at 17:56
Quote from: Cwiiis on Today at 15:33Think I got my powers mixed up, you can't brute-force this :laugh:  Well, maybe you could with a GPU, but that's getting extreme - I'm going to try to devise a few strategies and perhaps I can pick the best one depending on the input.
"you can't brut force this"

why?


Because of combinatorial explosion? I may have gotten my numbers wrong and/or my code wrong of course, but it seemed that way.

if you avoid creating absurd branches, the combinatory is small (and we have a tremendous amount of memory for that small sprites)
#5
avatar_Cwiiis
Programming / Re: Plus sprite upload tips
Last post by Cwiiis - Today at 18:01
Quote from: roudoudou on Today at 17:56
Quote from: Cwiiis on Today at 15:33Think I got my powers mixed up, you can't brute-force this :laugh:  Well, maybe you could with a GPU, but that's getting extreme - I'm going to try to devise a few strategies and perhaps I can pick the best one depending on the input.
"you can't brut force this"

why?


Because of combinatorial explosion? I may have gotten my numbers wrong and/or my code wrong of course, but it seemed that way.
#6
avatar_roudoudou
Programming / Re: Plus sprite upload tips
Last post by roudoudou - Today at 17:56
Quote from: Cwiiis on Today at 15:33Think I got my powers mixed up, you can't brute-force this :laugh:  Well, maybe you could with a GPU, but that's getting extreme - I'm going to try to devise a few strategies and perhaps I can pick the best one depending on the input.
"you can't brut force this"

why?
#7
I got fed up with misbehaving membranes in my 6128 and ordered a couple from sintech last month.
They are decent quality and so happy that my fave bit of tech lives on.
#8
avatar_Cwiiis
Programming / Re: Plus sprite upload tips
Last post by Cwiiis - Today at 16:17
I added the option in my sprite compiler to reserve 1 or 2 registers for the most frequently occurring pixels in a sprite, then I compare all 3 and choose the strategy that ends up with the smallest sprite in memory - with my dataset, that brings average sprite size down from 335 bytes to 287 bytes - a pretty decent saving :)

I expect a better algorithm would involve doing a forward-search to decide if saving a register is worthwhile or not, which I will attempt to eke out a few more bytes/nops...

edit: Implemented forward-search and fixed a bug that I was reserving registers before actually encountering the pixel - down from 287 average to 282. Every little counts, I suppose :)
#9
avatar_norecess464
Programming / Re: Plus sprite upload tips
Last post by norecess464 - Today at 16:12
With Sonic GX, I noticed that there isn't a universal method for managing sprites on the GX-4000.

For example, in the Bonus Stages, I relied on DIFF (delta) because it was the fastest approach, with uninterrupted sprite animations.

However, during the main gameplay (the platformer section), the situation is different. Here, sprite animations can be interrupted at any moment, so we can't wait for the current animation to complete its sequence, making the Delta approach unsuitable.

For certain elements, I use generated code, as @roudoudou mentioned. However, it consumes memory quickly, so it must be used with care.

If you are living in France, make sure to have a look later this year at the next issue of CPC FANZ BZH #3, as I wrote an article for it about a convenient way of handling sprites in games. (Of course, I don't want to approach/spoil its content here in this post).
#10
Quote from: GUNHED on Today at 14:46Sure, Z80B works without a problem. One of my CPCs runs well at 6 MHz.  :)
and it also runs properly at 4MHz and plays Arkos Tracker music (at 4MHz)? I guess it does and would be surprised if not but just to make sure...
Powered by SMFPacks Menu Editor Mod