Page 3 of 7

Re: Frank the Fruit Fly

Posted: February 16th, 2019, 02:05
by VirtualChris
How do I do 3 colors?
If I had to choose a version, I'd do this one:
http://www.atari2600land.com/pokemonmin ... 190212.zip

Re: Frank the Fruit Fly

Posted: February 16th, 2019, 02:46
by RazorLeafAttack
VirtualChris wrote:How do I do 3 colors?
Here's my basic understanding, which I think is just what zoranc was describing earlier...
The LCD can only refresh so quickly, so by flickering between 2 slightly different graphics where blacks are present in both and areas to be colored grey are black in only one version of sprite, so as it switches between the two, the pixels that are not black in both end up looking grey.

I made a sprite of a cute little egg with the two frames (left and center) that make up the artwork as it displays (right)
Egg Sprite - 3 colors.png
Egg Sprite - 3 colors.png (1.96 KiB) Viewed 20223 times

Re: Frank the Fruit Fly

Posted: February 16th, 2019, 03:45
by VirtualChris
I tried to make it switch between two screens like you said but the result was disastrous.

Re: Frank the Fruit Fly

Posted: February 16th, 2019, 04:42
by RazorLeafAttack
I don’t know the technical details from a developer’s perspective, but I’d check out some source code in the homebrew or demos section. You can prob find some code to work off of.

I’ll check out disaster.min shortly

Also, your game is now up on the homebrew page. Would you be able to provide a screenshot that exemplifies the glory of Frank?

Re: Frank the Fruit Fly

Posted: February 16th, 2019, 05:35
by VirtualChris
Here is the Pokemon Mini file and code.
Is it okay to wait on the title screen in case I get gray working?

Re: Frank the Fruit Fly

Posted: February 17th, 2019, 14:32
by zoranc
Regarding the three colors the graphical explanation above was very good I think, so no need to add anything to it.

Now the implementation is little tricky, not much but still... So, 36 times per frame (maximum) the rendering chip copies video data to the LCD. That includes rendering sprites and tiles to the VRAM and copy of the VRAM to the LCD by driving LCD registers. Once this is done it safe to change the graphics data before the next PRC copy starts. The interrupt #1 (PRC Copy Complete) will trigger once it is safe to do the change.

What I do is set the flag in the interrupt handling routine and check the flag in my main loop (you also need to clear the interrupt flag ). The best practice is to spend as little time possible in the interrupt routines. Also writing to the VRAM directly takes lot of time hence best visual results are when you use tiles and sprites. They both can have two sets and the mentioned switch can just involve swapping their base address back and forth.

I don't feel like writing this in assembly. I intend to release the C compiler soon and the provide examples such as this in C. You can look at some of the examples in the homebrew section too.

Re: Frank the Fruit Fly

Posted: February 18th, 2019, 13:53
by VirtualChris
I tried to do it and got it working, but it kept doing weird stupid things like beginning when it wasn't supposed to, so I give up.

Re: Frank the Fruit Fly

Posted: February 18th, 2019, 14:04
by VirtualChris
Here's the screenshot I want in the FTFF page.

Re: Frank the Fruit Fly

Posted: February 19th, 2019, 21:15
by RazorLeafAttack
VirtualChris wrote:Here's the screenshot I want in the FTFF page.
I got the screenshot up there now. If you want to provide a description/controls/anything else in the text on that page let me know. I just have a stupid one in there right now lol.

I hope you'll try getting 3 shades again at some point! I'm sure somebody here can take a look at the code and help correct whatever it was causing the sprite/tile swapping to act like that.

Re: Frank the Fruit Fly

Posted: February 20th, 2019, 02:10
by VirtualChris
Here is the code and .pm file for the three colors if anyone wants to take a look.