Game programming in C

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: Game programming in C

Post by ry755 »

diegzumillo wrote: Sun Sep 09, 2018 3:48 pm Oh, there's 64k for the program? that's more than I remember! I have to take a look at the wiki again. I guess it's entirely plausible to put every level and every sprite as an 'include' at the top then.
Well, the flash is 64k, but 4k is taken up by the bootloader so you only have 60k for the game.
User avatar
Jubatian
Posts: 1563
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Game programming in C

Post by Jubatian »

diegzumillo wrote: Sun Sep 09, 2018 3:48 pmOh, there's 64k for the program? that's more than I remember! I have to take a look at the wiki again. I guess it's entirely plausible to put every level and every sprite as an 'include' at the top then.
If you like such low color low-res modes like Mode 8, then definitely you can most likely have everything you needed for even a larger game in the flash. However if you need more for some reason, and using the SPI RAM is OK for you, it is possible to have sprite data in it. Currently Mode 74 and Mode 748 have support for this, and outputting sprites from the SPI RAM is nearly as fast as outputting them from ROM. In theory the same would be perfectly possible for 2bpp modes too (including Mode 8), but there is no such mode designed so far.

Mode 8 uses a lot of RAM, but being a simple bitmapped mode it also gives you an opportunity to display pictures loaded from the SD card, which could be nice for a larger game, to provide a title screen and other static screens between game levels, so you might be able to spare flash for in-game material.
diegzumillo
Posts: 31
Joined: Sat Apr 28, 2018 3:16 am

Re: Game programming in C

Post by diegzumillo »

Actually I ran some early stress tests and I'm reconsidering mode 8. I do enjoy that flexibility of manipulating the screen but it would have to be limited to a very tiny window in the center. It would be an interesting game design experiment, making a game in a 50x50 window, but I think I'll try other modes. Maybe mode 3, since it's the most well documented. I haven't settled on a project either, which makes choosing a starting point a little harder.
User avatar
Jubatian
Posts: 1563
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Game programming in C

Post by Jubatian »

diegzumillo wrote: Sun Sep 09, 2018 8:59 pm Actually I ran some early stress tests and I'm reconsidering mode 8. I do enjoy that flexibility of manipulating the screen but it would have to be limited to a very tiny window in the center. It would be an interesting game design experiment, making a game in a 50x50 window, but I think I'll try other modes. Maybe mode 3, since it's the most well documented. I haven't settled on a project either, which makes choosing a starting point a little harder.
Unless you already found it, you may take a look at SetRenderingParameters() then, which can be used to reduce the height, freeing up CPU time for your game. It can also free up RAM by the way as the video RAM of those lines which don't show due to this setting may be used for other things. If interested, I can patch Mode 8 for you for any combination of dimensions you prefer (the advantage of this would be that it would only take as much Video RAM as actually required for those dimensions).
diegzumillo
Posts: 31
Joined: Sat Apr 28, 2018 3:16 am

Re: Game programming in C

Post by diegzumillo »

I found the render settings. I mean, I know it exists but I haven't touched it yet :P
If interested, I can patch Mode 8 for you for any combination of dimensions you prefer (the advantage of this would be that it would only take as much Video RAM as actually required for those dimensions).
Oh no, don't worry. I don't have any project that simply cannot exist without a bitmap mode or anything. In fact I don't have any solid project at all, I'm just messing around. But thanks for offering :D
Post Reply