Author Topic: Graphics and memory managment  (Read 1358 times)

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Graphics and memory managment
« on: October 29, 2017, 01:34:42 pm »
So i've been slowly porting over a game from another platform that i built years ago but never fully completed. Im optimizing image sizes currently and i've notice i'm using up the 1mb Vram quickly!

Is there any existing method to hold some of this image data in high or low ram and swap into vram when needed or have the vdp display the data that resides in high or low ram? I'm not entirely familiar with the hardware side of the saturn. If anyone has insight, please reply! I honestly just don't know the saturn hardware well enough to know if what i'm wanting to do is possible.
« Last Edit: October 29, 2017, 01:54:42 pm by b1tsh1ft3r »

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Graphics and memory managment
« Reply #1 on: October 30, 2017, 09:08:45 pm »
Yes you can : you can use the new jo engine cpu dma transfer function. That's how you can do your animations without storing all the frames in the 512 kb texture memory. You can also use paletted sprites (currently 8 bits only) to hold 2 times more textures. You should also use the vdp2 for background and foregrount elements since you have another 512 kb there and it's very powerful.

Mr. Potatobadger

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Graphics and memory managment
« Reply #2 on: November 17, 2017, 04:29:25 am »
I'm a bit late to the punch here, but I highly recommend using palettes graphics. It's limited to 256 colors I'm pretty sure, but that's realistically more than enough, and it saves a ton of memory. However, at the moment, there's not really a good way to convert images into the format without writing a simple script

I plan on making a fully fledged tool eventually than can convert images into the paletted format, and also help you manage the palette registers.

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Graphics and memory managment
« Reply #3 on: November 17, 2017, 07:07:50 am »
No need, I'm already working on it for 4 bits CLUT and/or CRAM. You will need to preprocess your images (like on Gimp, you convert it to a 16 colors palette but save it as 32 bits RGB image). Of course, the CRAM is limited to 2048 colors, so the CLUT is more useful for most situations.

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Re: Graphics and memory managment
« Reply #4 on: November 18, 2017, 02:31:39 pm »
Yes you can : you can use the new jo engine cpu dma transfer function. That's how you can do your animations without storing all the frames in the 512 kb texture memory. You can also use paletted sprites (currently 8 bits only) to hold 2 times more textures. You should also use the vdp2 for background and foregrount elements since you have another 512 kb there and it's very powerful.

Perhaps I'm missing something or the documentation is out of date here? Are there any good examples showing how to utilize the vdp2 for basic functionality such as you have described? (Setting background and foreground elements for display). Id like to try to utilize this for the MAP that is draw on screen and any UI stuff as well.
« Last Edit: November 18, 2017, 06:12:22 pm by b1tsh1ft3r »

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Graphics and memory managment
« Reply #5 on: November 18, 2017, 08:25:17 pm »
Right now Jo Engine doesn't support much the VDP2, so you would have to use SGL functions directly for everything except NBG0/1.
I'm not myself really good with the VDP2 as it's quite complicated, but it's really overpowered compared to the VDP1.
You can take a look at my old FPS demo or Dany's FPS/VDP2 demo to see how to use it.

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Re: Graphics and memory managment
« Reply #6 on: November 20, 2017, 02:20:39 am »
Right now Jo Engine doesn't support much the VDP2, so you would have to use SGL functions directly for everything except NBG0/1.
I'm not myself really good with the VDP2 as it's quite complicated, but it's really overpowered compared to the VDP1.
You can take a look at my old FPS demo or Dany's FPS/VDP2 demo to see how to use it.

Is there perhaps a way to utilize the VDP2 RAM for storage of graphics while still letting the VDP1 Access these graphics somehow? or due to hardware design is this impossible?

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Graphics and memory managment
« Reply #7 on: November 20, 2017, 12:09:07 pm »
You can use the color RAM (4 KB), other than that I don't think you really can. You might be able to store things in VDP2 RAM and just read them, but I'm not sure it's possible and it would probably not be very efficient anyway.

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Graphics and memory managment
« Reply #8 on: January 05, 2018, 03:57:43 am »
Here is the image converter app I created, enjoy!

http://forum.jo-engine.org/index.php?topic=855.msg1256#msg1256

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk