-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sprite system #5
Comments
I will look into the sprites. Regarding the "decrease refresh blinking " you can increase the speed of SPI maybe that will help
Try increasing this 8000 to 12000 or 16000 or higher |
Hi I have added a new function 'TFTdrawSpriteData' which draws sprites with a transparent background regards |
I have just implemented a simple tilesystem and found what happens, and figured out a way to "fix it" (sorta, for now, as there are few layers for the moment). When sprite background is deleted, its replaces with the last drawn thing inside. I fixed it by filling the screen just before mario and putting the delay before the fill so everything seem visible at the same time to the human eye. Code before: Code after: PS: I will update you if I encounter problems as I implement more tiles and entities. |
I just added more entities and its not fixable anymore. If I keep doing this way then the entities appear ahead of Mario. If I put them before Mario then they appear in background. If I add a screen fill between them then it becomes blinky. |
Hi I have changed the 'TFTdrawSpriteData' function. with new commit. The first version used 'Malloc' to create a buffer and then drew to this buffer the data and then sent that buffer in one SPI transaction to device. I believe the use of malloc was causing memory fragmentation and optimisations with pico reusing the same block of data. The second version uses 'TFTdrawPixel' function to directly write the sprite into the VRAM of ST7735. pixel by pixel. See if it works and see if it is fast enough. regards |
Hi I have a library for the St7789 as well https://github.com/gavinlyonsrepo/ST7789_TFT_PICO I will add the sprite function to it. RE the refresh rate How are you drawing the background, TFTfillRectangle or TFTfillRect. or TFTFillscreen? |
This gave me an idea. I will fill the screen with rectangles only in sections where there are no tiles tile by tile. Btw I realized when I draw tiles with bitmap function, when they are sliding from right to left, they come distorted. But then I changed them to sprites and they come clean but makes fps worse. I know I askee a lot from you already, but can you implement a tile function too that uses the same drawing technique but without background filling as in sprites? Here are some screenshots of before and after to elaborate what I mean (focus on the far right of the screen): |
Hi Working on the assumption that MALLOC is the problem and the resulting heap memory fragmentation. Dec 2024 V1.72
See how it works now on your demo. Regards |
Hi, I returned to my home country and left it behind as I was scared that they don't allow such stuff on airport. I will do it after 9 January and let you know. |
Yay, it works! Thank you! I will upload the code on a github repo and let you know when the game becomes playable. |
Hi @gavinlyonsrepo, I just realized a bug in the new bitmap drawing function. Its not visible on grass but very much so on luck/rotation blocks when approached from left |
Hi I am busy at moment , might be able to look at this in 1-2 weeks . |
Hi Have you made any progress since last week? |
Hi! First of all thanks for the library, its very helpful. I am trying to make a Super Mario demo from scratch using your library. I would ask for 2 features:
-Some solution to decrease refresh blinking (maybe already doable with the current state of the library, I am a bit newbie to this so help is appreciated)
Both you can see in the photos
Have a good rest of your day!
The text was updated successfully, but these errors were encountered: