gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > song on the radio

#7937 - DavidSmith - Sat Jun 28, 2003 11:33 pm

published model, demonstrates that, of the organism. It is clear that not all of standard PCR amplification is performed
and drinks. By adding the sugar If you have ever taken a single dose of antibiotics any time in clinically & scientifically proven to neutralize starch, found in
His day. His mother's words awoke in him a strange far as individuals go is also theoretically probable. How To Get A Girl To Do Anything AAnd Everything In Bed - Be Absolutely Mind Blowing Righ
Ascorbic Acid in recycling Vitamin E. Studies indicate that Ascorbic Acid helps protect rinsed and drained (about 3 cups) humans are ignorant about what to put into their bodies


Last edited by DavidSmith on Tue Sep 07, 2010 7:22 am; edited 3 times in total

#7940 - DavidSmith - Sun Jun 29, 2003 12:58 am

Problem 1 solved.

I had a look at sprite.h and TALL and WIDE were in fact the wrong way round in the header file! I was doing it right...

Still can't work out why I get all that schmuck, though... :S

#7945 - cappeca - Sun Jun 29, 2003 5:58 am

Try a different emulator. Or check your ball and paddle .h files to see if they're putting up the correct image. Without the headers, I've changed some lines to:

Code:

 //everything's white anyway
  for(loop = 0; loop < 256; loop++)
    OBJPaletteMem[loop] = 0xFFFF;


and

Code:

 //first copy the ball data in
  for(loop = 0; loop< (8*8*1); loop++)
  {
    OAMData[OAMIndex] = 0x2120;
    OAMIndex++;

  }//end index loop

  //next copy the paddle data in
  for(loop = 0; loop < (8*8*8); loop++)
  {
    OAMData[OAMIndex] = 0x2120;
    OAMIndex++;
  }


and it worked just fine.

Cesar.

#7959 - jcpredator - Sun Jun 29, 2003 2:21 pm

Quote:
sprites[1].attribute2 = paddle1CharNumber;
sprites[2].attribute2 = paddle2CharNumber;


Quote:
u16 paddle1CharNumber = 1;
u16 paddle2CharNumber = 1;



paddle1CharNumber and paddle2CharNumber should not be equal, I believe.

For my game I had to increase each attribute2 number for each of my sprites by the number of 8x8 tiles times 2, the previous sprite used.

I'm not sure if thats ur prob but I would probably make sure your not overwriting ur sprite data by setting the right attribute2 numbers.

I'm just curious why ur using a tile mode when now ur just displaying 3 sprites.
_________________
There is no spoon...

#7965 - DavidSmith - Sun Jun 29, 2003 4:26 pm

jcpredator wrote:
Quote:
sprites[1].attribute2 = paddle1CharNumber;
sprites[2].attribute2 = paddle2CharNumber;


Quote:
u16 paddle1CharNumber = 1;
u16 paddle2CharNumber = 1;



paddle1CharNumber and paddle2CharNumber should not be equal, I believe.

For my game I had to increase each attribute2 number for each of my sprites by the number of 8x8 tiles times 2, the previous sprite used.

I'm not sure if thats ur prob but I would probably make sure your not overwriting ur sprite data by setting the right attribute2 numbers.

I'm just curious why ur using a tile mode when now ur just displaying 3 sprites.


Well, they're both the same. So I figured using that same character memory would be okay -- it works fine at least.

The problem with the shmuck is the differences in the palettes of the different sprites, using capecca's method fixed things and I managed to get everything else of the pong game working.

Now I am coming to adding the scores I am having more troubles with sprites (hopefully once I've been helped in working these out I won't have them again in the future. It's just trouble working out how this all works right now.

So, another question (I do apologise for the amount I'm asking!)

Here are my char numbers:
Code:
#define ballCharNumber 0
#define paddle1CharNumber 1
#define paddle2CharNumber 1

#define zeroCharNumber 9
#define oneCharNumber 10
#define twoCharNumber 11
#define threeCharNumber 12
#define fourCharNumber 13
#define fiveCharNumber 14


here is the section of code where I copy the data into Character memory:
Code:
//first copy the ball data in
   for(loop = 0; loop< (8*8*1); loop++)
   {
      OAMData[CharIndex] = 0xFFFF;
      CharIndex++;
      
   }//end index loop

   //next copy the paddle data in
   for(loop = 0; loop < (8*8*8); loop++)
   {
      OAMData[CharIndex] = 0xFFFF; 
      CharIndex++;
   }

   //now the numbers sprites

   //0
   for(loop = 0; loop < (8*8*1); loop++)
   {
      OAMData[CharIndex] = zeroData[loop];
      CharIndex++;
   }

   //1
   for(loop = 0; loop < (8*8*1); loop++)
   {
      OAMData[CharIndex] = oneData[loop];
      CharIndex++;
   }

   //2
   for(loop = 0; loop < (8*8*1); loop++)
   {
      OAMData[CharIndex] = twoData[loop];
      CharIndex++;
   }

   //3
   for(loop = 0; loop < (8*8*1); loop++)
   {
      OAMData[CharIndex] = threeData[loop];
      CharIndex++;
   }

   //4
   for(loop = 0; loop < (8*8*1); loop++)
   {
      OAMData[CharIndex] = fourData[loop];
      CharIndex++;
   }

   //5
   for(loop = 0; loop < (8*8*1); loop++)
   {
      OAMData[CharIndex] = fiveData[loop];
      CharIndex++;
   }


But the problem is, the scores come out simply as white squares:
[Images not permitted - Click here to view it]

Now, there are two things I think could be causing this:
-My "zeroCharNumber" is actually pointing to a position where the ball or the paddles are. Though I don't see how as I'm pretty sure I've done the character numbers right...

-My sprite header files are buggered up. I am drawing the pictures in MS Paint Brush and saving them as bitmaps, then opening them in the GIMP and saving them as PCX files to convert with pcx2sprite from The Pern Project website. I am thinking that a solution to stop this happening now, and the future, would be for me to find a graphic program that I can draw straight into. And choose a palette of 256 colours which will be used everytime; rather than the GIMP and PaintBrush filling in the palette as they please and messing things up.


I believe the problem is more likely the latter -- Can anyone reccomend me a program if it is?

Oh, and just in case, I've included the "zero.h" header file below..
Code:

/**********************************************\
*       zero.h                                   *
*          by dovotos pcx->gba program         *
/**********************************************/
#define  zero_WIDTH   8
#define  zero_HEIGHT  8


const u16 zeroData[] = {
                    0xFF00, 0xFFFF, 0xFFFF, 0x0000, 0xFF00, 0x0000, 0xFF00, 0x0000, 0xFF00, 0x0000,
                    0xFF00, 0x0000, 0xFF00, 0x0000, 0xFF00, 0x0000, 0xFF00, 0x0000, 0xFF00, 0x0000,
                    0xFF00, 0x0000, 0xFF00, 0x0000, 0xFF00, 0x0000, 0xFF00, 0x0000, 0xFF00, 0xFFFF,
                    0xFFFF, 0x0000,};

const u16 zeroPalette[] = {
                    0x0000, 0x0000, 0x0200, 0x0210, 0x4000, 0x4010, 0x4200, 0x6318, 0x6378, 0x7B34,
                    0x0088, 0x008C, 0x0090, 0x0094, 0x0098, 0x009C, 0x0100, 0x0104, 0x0108, 0x010C,
                    0x0110, 0x0114, 0x0118, 0x011C, 0x0180, 0x0184, 0x0188, 0x018C, 0x0190, 0x0194,
                    0x0198, 0x019C, 0x0200, 0x0204, 0x0208, 0x020C, 0x0210, 0x0214, 0x0218, 0x021C,
                    0x0280, 0x0284, 0x0288, 0x028C, 0x0290, 0x0294, 0x0298, 0x029C, 0x0300, 0x0304,
                    0x0308, 0x030C, 0x0310, 0x0314, 0x0318, 0x031C, 0x0380, 0x0384, 0x0388, 0x038C,
                    0x0390, 0x0394, 0x0398, 0x039C, 0x2000, 0x2004, 0x2008, 0x200C, 0x2010, 0x2014,
                    0x2018, 0x201C, 0x2080, 0x2084, 0x2088, 0x208C, 0x2090, 0x2094, 0x2098, 0x209C,
                    0x2100, 0x2104, 0x2108, 0x210C, 0x2110, 0x2114, 0x2118, 0x211C, 0x2180, 0x2184,
                    0x2188, 0x218C, 0x2190, 0x2194, 0x2198, 0x219C, 0x2200, 0x2204, 0x2208, 0x220C,
                    0x2210, 0x2214, 0x2218, 0x221C, 0x2280, 0x2284, 0x2288, 0x228C, 0x2290, 0x2294,
                    0x2298, 0x229C, 0x2300, 0x2304, 0x2308, 0x230C, 0x2310, 0x2314, 0x2318, 0x231C,
                    0x2380, 0x2384, 0x2388, 0x238C, 0x2390, 0x2394, 0x2398, 0x239C, 0x4000, 0x4004,
                    0x4008, 0x400C, 0x4010, 0x4014, 0x4018, 0x401C, 0x4080, 0x4084, 0x4088, 0x408C,
                    0x4090, 0x4094, 0x4098, 0x409C, 0x4100, 0x4104, 0x4108, 0x410C, 0x4110, 0x4114,
                    0x4118, 0x411C, 0x4180, 0x4184, 0x4188, 0x418C, 0x4190, 0x4194, 0x4198, 0x419C,
                    0x4200, 0x4204, 0x4208, 0x420C, 0x4210, 0x4214, 0x4218, 0x421C, 0x4280, 0x4284,
                    0x4288, 0x428C, 0x4290, 0x4294, 0x4298, 0x429C, 0x4300, 0x4304, 0x4308, 0x430C,
                    0x4310, 0x4314, 0x4318, 0x431C, 0x4380, 0x4384, 0x4388, 0x438C, 0x4390, 0x4394,
                    0x4398, 0x439C, 0x6000, 0x6004, 0x6008, 0x600C, 0x6010, 0x6014, 0x6018, 0x601C,
                    0x6080, 0x6084, 0x6088, 0x608C, 0x6090, 0x6094, 0x6098, 0x609C, 0x6100, 0x6104,
                    0x6108, 0x610C, 0x6110, 0x6114, 0x6118, 0x611C, 0x6180, 0x6184, 0x6188, 0x618C,
                    0x6190, 0x6194, 0x6198, 0x619C, 0x6200, 0x6204, 0x6208, 0x620C, 0x6210, 0x6214,
                    0x6218, 0x621C, 0x6280, 0x6284, 0x6288, 0x628C, 0x6290, 0x6294, 0x6298, 0x629C,
                    0x6300, 0x6304, 0x6308, 0x630C, 0x6310, 0x6314, 0x7BFF, 0x5294, 0x4210, 0x001F,
                    0x03E0, 0x03FF, 0x7C00, 0x7C1F, 0xFFFF, 0xFFFF,};

#7967 - jcpredator - Sun Jun 29, 2003 4:36 pm

The point about the attribute thing was just a future warning incase you added another sprite or something. Even if they were the same i would still probably set them at diff attributes just to be entirely sure and be more precise, but thats just me. Have you tried to use a different program? It took me about 5 or 6 diff programs to find one that would correctly convert my BMP, I would suggest trying at least one other program and seeing what it displays then. Good debugging idea.
_________________
There is no spoon...

#7985 - DavidSmith - Sun Jun 29, 2003 10:25 pm

Everything's solved.

Thanks to everyone on IRC who helped me get round the problems and finish my first game : - )

#8309 - yaustar - Tue Jul 08, 2003 12:58 am

Just a small note. MS Paint tends to leave artifacts when saving in different formats besides .bmp

I noticed this when I was saving as .gifs trying to figure what the hell was wrong with my code.

Try Paint Shop Pro
_________________
[Blog] [Portfolio]

#8360 - jcpredator - Wed Jul 09, 2003 3:10 am

I have MS Paint and I have never recieved an artifact problem using it while saving to a format other than .bmp.
_________________
There is no spoon...

#8361 - yaustar - Wed Jul 09, 2003 3:36 am

?

It's not doing it now.

Most be one of those days. Anyhow, I tend to use PSP for safety's sake.....
_________________
[Blog] [Portfolio]