How to use directBitmap()?

ok my bad, question about overlapping direct images, they do flicker on hardware right?

They flicker because of the drawing order. It depends which one gets drawn first.

If you turn display persistence on and do a directBitmap on every update, the result should be the output of the buffer & directBitmap (or directText) on top of it.

I will check what combination makes it work. A bit busy at the moment.

Right, game.update(true) just skips drawing Pokitto buffer to the screen, but still does everything else, like key events, updates audio, etc.

Huh, I had been having issues with the HelloWorld_win target as well. The game wasn’t using high-resolution mode.

I reinstalled the simulator and it’s working fine now. The simulator code in the directory I copy to make new projects must’ve been corrupted or something.

Hopefully everything should go smoothly now :slight_smile:

oh yea, if you change target, its best to do a full rebuild

Okay, I’ve got a direct image world, and a player. The player is also a direct image, and flickers as can be seen here. Any ideas as to how I might go about resolving the flicker?

I wouldn’t worry about it right now, as none of us have Pokittos yet for testing. The issue might not be noticeable on hardware.

Actually, I am going to have to do something about this directBitmap craziness that you all have gotten involved in :grin: directBitmap is not optimized at all and I’m gonna be in major trouble if this trend continues.

But do not be worried, because I have calculated and come up with an idea how to boost the performance. That will address your games @spinal and yours @epicdude312 as well as whatever @crait is cooking

2 Likes

We need the LCD init/draw routine you’ve code for the hardware to check some idea for a new draw lib in directmode (no buffer)

1 Like

I noticed. I will put it up for you. At the moment the HW lib is in heavy edit, but I will share the init routine. Its quite simple, I will just copy-paste it as an answer to you.

2 Likes

Is something involving HIGH RES + HIGH COLOR buffer mode? I believe we are all using this direct mode to override the poor palette limit (4 colors) at full resolution.
Also someone mention a tiles mode, or am I wrong?

It would be my guess that there might not really be enough RAM to buffer a 220x176 screen and a higher pit depth. Personally I’m happy with not having an image buffer for high colour stuff if we can draw tile-by-tile or line-by-line at a good enough speed.

Maybe I’m wrong, but 220x176x4bit (16 colors) are about 20Kb.
We’ll still have about 12Kb of ram for game stuff, not so much but not so bad.

1 Like

I’m kind of doing that…however, that’s simply because I can’t seem to figure out how to disable full resolution. Whatever I do, it just wants to stay at 220x176…

What I’m really using it for is to have 16 colors per sprite, not just for the entire screen. Hopefully if I can get it into low-res mode, it’ll stop flashing…

Make sure you have PROJ_HIRES=0 in “project/build options/#defines” in CodeBlocks. Then use normal drawBitmap() for drawing and display.update(false) for your drawing loop.

Thx for the share Jonne :wink:

If the idea of my friend work as we espect this lib could be awesome for the pokitto :wink:

@epicdude312 please consider trying to fit your graphics to 16 colors. I know it can be done, with a careful selection of colors. Pico-8 games manage, and they have a fixed palette

If you use only 16 colors, you can use the ahem buffered mode that will soon be available :grin:

1 Like

I’m having a new problem. It has absolutely nothing to do with intersections, because I do not have any overlapping bitmaps on my new hotbar.

However, it seems that there are black lines flashing in my hotbar:

It happens frequently with the item selected, and occasionally with the energy bar…

The bar is NOT intersecting with the world. I made a special function called directBlockBitmap() that ensures that not blocks draw past where the hotbar is.

Do you have any idea what is going on? If you need the source code, I can release it, but I don’t want to have to upload everything to GitHub if I don’t need to…

EDIT: Fixed! Turned out I was drawing things in the wrong order :stuck_out_tongue:

1 Like

If possible, show me your code somehow. I have a feeling you’re using a lot of resources and I am not sure how it would work on the hardware. I will look at it 100% confidentially and you can release when/if you want. IMHO this project looks awesome and I want to support your efforts to get it done.

1 Like

I’m fairly confident that it’s using too much memory, but I know some ways to optimize it which I’ll do before I release the game.