Super Mario Land

Use this forum to share and discuss Uzebox games and demos.
User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Super Mario Land

Post by nicksen782 » Mon Jul 01, 2019 7:52 pm

I see the tilegen program. It appears to read the C output from GIMP. I've never had to work with a GIMP palette. I've been converting from canvas to the Uzebox colorspace by adjusting the rgba to be rgb332 and then converting that to text that is a c array.

So, VRAM isn't just a chunk and ram_tiles isn't just a chunk. They are both represented by a shared ram space?

I'm having problems understanding how the plane c code works. I'm seeing lots of configs and flags and bit masks.

So, tiles are 2bpp (4 colors total) and that is 16 bytes. The other 8 bytes of the 24 is only for sprites and acts as a bit mask? This changes the colors then?

Could you create a much more basic example for me to go off of? Something along the lines of a tutorial?

Code: Select all

/* Generate tile rows */

 for (i = 0U; i < tcnt; i ++ ){

  sp = (i * 8U);

  for (j = 0U; j < 8U; j ++){
   c  = ((header_data[sp + 0U] & 3U) << 6) |
        ((header_data[sp + 1U] & 3U) << 4) |
        ((header_data[sp + 2U] & 3U) << 2) |
        ((header_data[sp + 3U] & 3U)     );
   printf(" 0x%02XU,", c);
   c  = ((header_data[sp + 4U] & 3U) << 6) |
        ((header_data[sp + 5U] & 3U) << 4) |
        ((header_data[sp + 6U] & 3U) << 2) |
        ((header_data[sp + 7U] & 3U)     );
   printf(" 0x%02XU,", c);
   sp += width;
  }

  printf("\n");

 }

 printf("};\n");
You go through each tile and then do something 8 times per tile. Are these tiles 8x8 pixels? This appears to write 2 values for every iteration of the 8. That is 16 So, 16 bytes per tile? Then, you can specify a color mask to change the colors?
I intend to learn this mode and the best way is to get something on the screen and understand how I did it.

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Super Mario Land

Post by Jubatian » Tue Jul 09, 2019 8:47 am

Huh, sorry for not being around, I was preparing for a trip to Hungary, and now I am there, trying to sort out my relocation proper, visiting some friends and such. No much access to Uzebox stuff.

There is also a "junk" demo in there alongside with the plane which just throws some things on the screen after configuring some row modes.

VRAM is not a chunk as you set the pointer for every row to wherever you want it to be. You can set up a chunk of memory for it and use it in the rows, but you may also devise faster scrolling algorithms, row repeats or other sorts of trickery if you like so. RAM tile indices are simply multiplied by 16 to get their address, so RAM tile 255 would be located at RAM address 0x0FF0.

For 24 byte sprites, yes, the extra 8 bytes are mask. There is no change in color, the mask just allows you to use all 4 colors instead of only 3 (as without mask, one of the colors would have to be reserved for transparent pixels).

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests