Join us on Discord!
You can help CodeWalrus stay online by donating here.

Graphics and other system routines

Started by DarkestEx, October 19, 2015, 10:31:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dream of Omnimaga

By the way, will there be commands to draw rectangles with customizeable opacity, within the palette limits, like on the HP Prime? That would be handy for some special effects.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

novenary

It's not very easy to do with paletted colors. Alpha blending requires access to the raw colors.

DarkestEx

Quote from: DJ Omnimaga on November 13, 2015, 08:27:29 AM
By the way, will there be commands to draw rectangles with customizeable opacity, within the palette limits, like on the HP Prime? That would be handy for some special effects.
Well memory use is a big concern so we went for palettes as you know. We aren't using RGB. Sprites and the graphic functions have access to the screen buffer which is using these global palette colors.
But as you know we have 4 different pixel formats being 1bpp (transparent + 1 color), 2bpp (transparent + 3 colors), 4bpp (transparent + 15 colors) and 8bpp (which has all palette colors). The global palette has 216 colors that are predefined and cannot be changed at all. Then we also have a transparent color which, when used in sprites or graphic functions not drawn to the screen buffer. And the special thing is that we also have a dynamic set of 39 custom RGB colors that can be changed by any game at any point. These colors can be used in any graphics function or sprite. When the screen is synced the next time (which games need to do manually by calling a command) after the colors have been altered, the screen can look entirely different. But back to your question, no I doubt we will do such alpha blending as its hard and basically wouldn't work to well.

Quote from: Streetwalrus on November 13, 2015, 09:05:46 AM
It's not very easy to do with paletted colors. Alpha blending requires access to the raw colors.
Yes. Maybe using the dynamic colors it's possible to do so but I really doubt it will work.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

I see. I guess for fade-in effects I'll just create extra copies of my sprites then make them go darker by switching colors to the nearest available darker color in the palette. :P
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

adekto

Quote from: DJ Omnimaga on November 15, 2015, 06:30:43 AM
I see. I guess for fade-in effects I'll just create extra copies of my sprites then make them go darker by switching colors to the nearest available darker color in the palette. :P
wel there are other ways to do that replacing the variable color pallet part could do a fade to a set color (no blending, but sorta what you want)
also if you use a custom pallet and use say only grey's, you could in theory do a adetive color blend but its a bit complicated

semiprocoder

I know that you said you don't support 16 bit color mode anymore, but couldn't you just leave it as an option instead of completely removing it? Maybe with that mode you would have half of the screen rendered at a time. Also could you support 12 bit color mode? Its unconventional but I think it could work.
  • Calculators owned: ti nspire, ti 84 plus se
My cemetech username is awesommee333.

DarkestEx

Quote from: semiprocoder on November 15, 2015, 03:08:15 PM
I know that you said you don't support 16 bit color mode anymore, but couldn't you just leave it as an option instead of completely removing it? Maybe with that mode you would have half of the screen rendered at a time. Also could you support 12 bit color mode? Its unconventional but I think it could work.
No, sorry but supporting any of these is not really possible. You can directly talk to the OLED, but this is very discouraged. You won't end up using 16 bit colors anyways. I don't see any use for them really. And if the 216 colors don't contain the colors you like, then you can always use the 39 16 bit colors that can be defined at runtime.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

adekto

an alternative system to acheave a blend is true overlaped ditered sprites, or some sort of mask
here is a 3D example from pico8 (they do some neat stuff) but the thing i would like you take notice of is that they use a 16 color pallet and use 2 textures and use ditering to achive the lighting
http://www.lexaloffle.com/bbs/?tid=2688&autoplay=1#pp
its not perfect but in theory it can work

Dream of Omnimaga

If we can change the color palette we are currently using for the sprites on screen refresh, then I guess that can be used for special effects too. I could live without it, but it was nice to be able to do it on the NES. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

DarkestEx

Quote from: DJ Omnimaga on November 22, 2015, 07:39:30 AM
If we can change the color palette we are currently using for the sprites on screen refresh, then I guess that can be used for special effects too. I could live without it, but it was nice to be able to do it on the NES. :)
You can change 39 colors of the palette.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

That's good enough to me. Just as long as making sprites is as easy as just using Paint. :P I got plenty of 8*8 sprites at low color depth.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

semiprocoder

Can you only change the value of the 39 extra colors each frame or each time you draw something?
  • Calculators owned: ti nspire, ti 84 plus se
My cemetech username is awesommee333.

DarkestEx

Quote from: semiprocoder on November 23, 2015, 12:38:07 AM
Can you only change the value of the 39 extra colors each frame or each time you draw something?
Well each frame. The screen buffer is global so is the palette. If you change the dynamic colors, everything that has been drawn using these dynamic colors and is currently visible on the screen will be changed.
Drawing does not show anything on the screen. The buffer need to be swapped in order to see the newly generated image from the buffer. When generating it, the current dynamic palette and the static palette is used to resolve the RGB colors sent to the screen (OLED).
Quote from: DJ Omnimaga on November 22, 2015, 11:15:03 PM
That's good enough to me. Just as long as making sprites is as easy as just using Paint. [emoji14] I got plenty of 8*8 sprites at low color depth.
Well you can't use the 39 dynamic colors in paint. We will come up with a way to use them at some point.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

Oh I meant in general. One major issue with individual sprites in Doors CSE is that there is no way to edit them other than typing the hexadecimal by hand. Entire sprite sheets are editable, but not individual sprites (DCSE supports inline sprites). Even SourceCoder lacks that feature.

This is definitively something that needs to be avoided with Microcat and claw. I'm confident that you'll find a way to make sprite editing/importing easy, though.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Dream of Omnimaga

So I am curious about what the following sprites would look like in Microcat format and how much space they would take:



Would the sprite sheet need to be split into multiple files and only one part loaded at a time?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal