Hello,
I have tried different methods to implement undo feature in LIZARDPAINT(.com, please give it a try).
One requires a little bit more RAM than what is available (I store canvas tiles values in u32[8]).
Even after I adapted DMA buffer size as well as sprite init to the bare minimum.
My solution could work with a smaller canvas, but I believe this would be detrimental to user.
So... I wondered if I could use SRAM to store what I need.
I would need to write info there as often as user draws something.
Is it a good idea? Would not it imply a significantly faster battery wear?
SRAM to tackle lack of RAM?
Moderator: Stef
-
- Interested
- Posts: 17
- Joined: Fri Feb 01, 2019 10:06 am
- Location: On a sunny rock
- Contact:
SRAM to tackle lack of RAM?
Brewing "LIZARDPAINT" and "Perlin & Pinpin" for your SEGA Genesis / Megadrive - #pixelart by @iamgunpog
www.lizardrive.com
www.lizardrive.com
Re: SRAM to tackle lack of RAM?
The battery is not used when the console is on. It's for keeping power when the console is off.
You might also use a command undo queue, instead of storing pixel-level changes.
"plot black at 12,23"
"fill area at 15,5 with green"
You'd just store the inverse commands, taking very little ram.
You might also use a command undo queue, instead of storing pixel-level changes.
"plot black at 12,23"
"fill area at 15,5 with green"
You'd just store the inverse commands, taking very little ram.
-
- Interested
- Posts: 17
- Joined: Fri Feb 01, 2019 10:06 am
- Location: On a sunny rock
- Contact:
Re: SRAM to tackle lack of RAM?
Thank you cero for your answer, I will try this approach then!
I also considered storing actions in a stack... But it was not covering filling properly.
Imagine drawing a black circle with a certain brush size, then filling it with the same black colour. You end up with a totally black hole.
Then how can you tell what was the initial circle state when reverting the filling operation? At least I could not!
I also considered storing actions in a stack... But it was not covering filling properly.
Imagine drawing a black circle with a certain brush size, then filling it with the same black colour. You end up with a totally black hole.
Then how can you tell what was the initial circle state when reverting the filling operation? At least I could not!
Brewing "LIZARDPAINT" and "Perlin & Pinpin" for your SEGA Genesis / Megadrive - #pixelart by @iamgunpog
www.lizardrive.com
www.lizardrive.com
Re: SRAM to tackle lack of RAM?
Store a list of the filled pixels. As ranges, very little space taken.
-
- Very interested
- Posts: 118
- Joined: Mon Feb 19, 2018 7:31 pm
Re: SRAM to tackle lack of RAM?
I want to use sram as ram too.