|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
Author | Message |
---|---|
|
full screen 2bpp bitmap image
Posted: Thu Oct 26, 2017 1:20 pm
|
it's since some time this tickles me... a sort of 2bpp (4 colors) bitmap mode (all points addressable 'APA') to show still images exploiting the SMS dual palette system to somehow circumvent the tile limit (you know, you need 768 tiles to fill the screen...)
so I took the famous Lena (or Lenna) image and reduced it to a 768-tile 4 gray levels image (dithered, for best results!) and so split that image into two parts, 384 tiles each, and converted each part using Maxim's BMP2Tile. at runtime (but one could of course do that before!) I recombine the two parts reusing the same 384 tiles, two bytes from the upper part and two bytes from the lower part for each tile. carefully crafting the two palettes then I can show either the first or the second content of each tile, hiding completely the other part. I think the result is pretty good :) (and there's also some free tiles for, say, a few sprites) |
|
|
Posted: Thu Oct 26, 2017 1:25 pm |
Oh! I want to take a look when I'm at home! | |
|
Posted: Thu Oct 26, 2017 7:04 pm |
On one hand, we only have four greys anyway, but it's still a bit unhelpful for a game. Maybe you could do a Qix variant using this? | |
|
Posted: Thu Oct 26, 2017 8:37 pm |
Impressive! | |
|
Posted: Fri Oct 27, 2017 8:02 am |
Creative! | |
|
Posted: Fri Oct 27, 2017 8:17 am |
actually I can't think of any practical use... well, maybe Qix :) BTW it also supports color, albeit it's very limited... but somehow feasible for images with very few colors, such as this one: |
|
|
Posted: Mon Oct 30, 2017 12:35 am |
My SMS 3-D demo uses this technique to store about 2 screens' worth of bitmapped graphics. By rearranging the palettes, it can show either of the 2 images alternatingly, or with a blended red/cyan etc. palette for anaglyph 3-D glasses. | |
|
Posted: Thu Nov 02, 2017 9:31 am |
a friend told me that the method isn't clear enough from the posted screenshot, so I hope these new screenshots are better:
@ccovell: a link? :) |
|
|
Posted: Thu Nov 02, 2017 10:02 am |
http://www.smspower.org/Homebrew/SMS3DDemo-SMS | |
|
Posted: Thu Nov 02, 2017 3:19 pm |
Wow, I've never seen that before and it's 12 years old!
BTW it seems to me you're using a single palette (and always less than 448 different tiles) or am I doing something wrong? |
|
|
Posted: Thu Nov 02, 2017 4:37 pm |
I think it's the same technique applied to nearly fullscreen images to allow a palette swap to select between each half of the image, or a blended value for coloured glasses using a single palette. | |
|
Posted: Thu Nov 02, 2017 4:47 pm |
yeah, in that sense it's true, it's storing two different color for each pixel and it's using palette rewrites to show two different images. I'm instead using two palettes to show a single image, but what mattered to me was to achieve a true fullscreen APA mode. From here to port PC CGA games it's a breeze ;) | |
|
Posted: Thu Nov 02, 2017 4:52 pm |
Haha, maybe make a replacement drawing board ROM too? | |
|
Posted: Fri Nov 03, 2017 9:35 am |
Well, don't know... maybe?
The matter here is that for a single set pixel I'll have to read two bytes from VRAM, mask one bit each to remove the previous color, write the new value in those proper bits and write the two bytes back to VRAM. It would probably take some 300+ cycles -interrupt and VRAM safe of course- for a single pixel, which makes the whole thing almost useless. |
|
|
Posted: Fri Nov 03, 2017 10:26 am |
It's not much different to if you were doing APA any other way except for 1bpp, I think. It's just never going to be fast. | |
|
Posted: Fri Nov 03, 2017 2:44 pm |
APA set-pixel would be useless, but the technique can be anyway interesting for full screen B/W bitmaps, or for images with very few colors | |
|
Posted: Tue Dec 26, 2017 9:04 pm |
i can’t remember if years ago i shared here some kind of slideshow using similar technique (using 384 tiles as 768, with 4 colours), or if i just tried to code a picture converter using imagemagick from sdlbasic (as i usually do) (i think i tried to use photos shared at http://blog.iso50.com (i hope they wouldn’t mind? :D ) as test, mostly because they look really great as “quadritone”) (i had some idea of using colour palettes like from http://colourlovers.com/palettes/random , obviously using only 4 from those 5 colours, and having those colours “painfully” posterized! :D ) | |
|
Posted: Tue Dec 26, 2017 9:06 pm |
anyway, i wanted to use that for a kind of game, perhaps something like http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs#Walking_aroun... | |
|
Posted: Wed Dec 27, 2017 8:54 am |
You could use static b/w images and have 'tiled' text under that with little effort, addressing pixels directly would be painfully slow probably. | |
|
Posted: Wed Dec 27, 2017 8:24 pm |
i can’t remember if i posted this in this forum years ago... - the idea was to use pictures (perhaps compressed, Daniel Bienvenu made an amazing job at AtariAge forum sharing his experiences and compressing/decompressing tools and code on Colecovision) instead of that random testing noise
|
|
|
Posted: Fri Dec 29, 2017 12:11 pm |
I've been doing similar tests these days, but if you want to create a second layer using adjoining sprites you can only do that if the second layer's width is at most 64 pixel - or up to 128 pixel using zoomed sprites -as in the code you posted- which unfortunately means that the image will have half the resolution AND (and that's much worse IMHO) it won't be shown correctly on the SMS' first revision hardware, because of the infamous sprite zoom bug :|
edit: on the Game Gear it's totally doable. Screen width is just 160 pixel, thus 64 pixels is more than a third of that. Also there's not such thing as sprite zoom bug. |
|
|
Posted: Fri Jan 05, 2018 10:13 am Last edited by sverx on Fri Jan 05, 2018 1:38 pm; edited 2 times in total |
a small example - using sprites to create an upper static layer while doing raster effects on the background
(assets taken from Xeno Crisis Kickstarter page) edit: no, I'm not porting Xeno Crisis to GameGear |
|
|
Posted: Fri Jan 05, 2018 11:19 am |
Wow! I like it! | |