1

Ok, heres the problem. I've been playing around with Genlib and Tigcc, and I can get all the other major aspects of genlib to work right, except the plane functions. I used SNESConverter to make a map(used the image that came as examples), and basically outputted stuff just like it would have been in the screen shot. I imported the data, but when it displays it looks like there is a 16x16 block of black in between most of the sprites on the map.

Heres the code(minus the bin files, but as I said, its pretty much the exact examples given with the snes converter): #define OPTIMIZE_ROM_CALLS #include "genlib.h" extern     SPRITE_16     tiles[];     // Import reference extern     char          map[];     // Import reference import_binary("room2.lvl",map); import_binary("room2.bin",tiles); //extern     SPRITE_16     tiles2[];     // Import reference //extern     char          map2[];     // Import reference //import_binary("room1.lvl",map2); //import_binary("room1.bin",tiles2); DSCREEN     *DScr[2] = {NULL, NULL };      int     ts = 0;      // Double-buffer function      void     SwapBuffer()      {           gl_set_dscreen_int(DScr[ts]);           ts ^= 1;           gl_set_dscreen_function(DScr[ts]);      }            // Constant speed 30Hz function      void     Wait30()      {           gl_timer = 0;           while     (gl_frame_timer < 1)                idle();           gl_frame_timer = 0;      }      // Constant speed 15Hz function      void     Wait15()      {           gl_timer = 0;           while     (gl_frame_timer < 2)                idle();           gl_frame_timer = 0;      } void     _main(void) {      PLANE     *P1/*,*P2*/;      JOYPAD     j;      HANDLE     hd;      // init Genlib   gl_init();   // init dscreen      gl_init_dscreen(&DScr[0], &hd);      if (hd == 0) goto exit;      gl_push_hd(hd);      gl_init_dscreen(&DScr[1], &hd);      if (hd == 0) goto exit;      gl_push_hd(hd);      gl_set_dscreen_int(DScr[0]);      gl_set_dscreen_function(DScr[0]);      gl_cls();      gl_change_update();     /* Use real size X for the plane */      P1 = gl_init_plane(map, tiles, 16);      if (P1 == NULL)     goto exit;      gl_push_hd(P1->handle);      //P2 = gl_init_plane(map2, tiles2, 16);      //if (P2 == NULL)     goto exit;      //gl_push_hd(P2->handle);      P1->xs = 100;      P1->ys = 100;      //P2->xs = 100;      //P2->ys = 100;   j = gl_read_joypad();      while     (j.exit_key) {           j = gl_read_joypad();           if (!j.left_key) P1->xs --/*, P2->xs --*/;           if (!j.right_key) P1->xs ++/*, P2->xs ++*/;           if (!j.up_key) P1->ys --/*, P2->ys --*/;           if (!j.down_key) P1->ys ++/*,P2->ys ++*/;           gl_update_vscreen_16(P1); //          gl_update_vscreen_16(P2);           gl_put_plane_89(P1);      //          gl_put_fgrd_plane_89(P2);           SwapBuffer();           Wait30();      }      exit:      gl_cls();      gl_free_hd();      gl_quit(); }

Anywho, room was the name I used for the dat files(Im guessing by how the map looks in hex that the second file was the background).

What am I doing wrong(if you need the bin files, Ill upload them)

2

Could you upload the binary files? I suspect they are wrong.

3

room1.bin
room1.lvl
room2.bin
room2.lvl

What I did to make them whas open up snesconv
Click "Charge le plan de sprites" and put "Plan de sprites.bmp" as it
Click "Charger l'arrière-plan" and put "Arrière-plan.bmp" as it
Click "Carger le plan complet" and put "plan complet.bmp" as it
I then click "Détourage des sprites"
Click "Couleur -> NG4"
Click "Application du masque virtuel" while leaving the radio button on "M. Noir"
I click "Ti89"(thi probably doesnt matter)
I then click "Création Cartes + Sprites" with the radio button still on "16x16"
After its done parsing the sprites and map, I thin change the text box labeled "Nom du fichier" from "Demo" to "Room" and I hit "Sauvegarde"

I believe I did everything right, but I believe the data is wrong after looking at the hex dump...maybe its just a problem with snesconv>.<

4

I can't download the files.

5

Sorry, I made a typo with the urls>.<(Caps for first letter, here are the real urls)
Room1.bin
Room1.lvl
Room2.bin
Room2.lvl

6

I see exactly whats wrong, and it is a problem with SNESConv and me>.<

SNESConv allos for flipping in the maps, which Im guessing by looking at the hex with and without flipping adds a byte after each byte(and after looking at the documentaion this is how it is suppose to be done) of the matrix to say if the sprite has been flipped in any way. It does this even if you tell it not to allow sprite flipping. So no matter how you convert using SNESConv, you have to use the matrix of words version of the plane.

Maybe its just an oversight with SNESConv, seeing as though I guess you only use flipping, but the data can be smaller if you have huge maps with fewer sprites to flip, thus Id like to use the byte version. It's all dependant on how large the maps are and how many sprites you have to flip(example, a map of 20x20 would take about 13 more sprites to be more effecient for flipping while a 200x200 map would take 1250 extra sprites over flipping)

Looking even further at the data SNESConv still doesnt show up in the format genlib has, heres what it says is the format:
a matrix of words (Big Endian format): the 10 highest bits are the index in the tile array, the bit 1 if the Horizontal flipping bit, the bit 2 is the Vertical flipping bit, the bits 5-4-3 are the bits of the palette to use (Default 0) and finally the bit 0 isn't used (aka TILE_INDEX structure):

typedef struct {
unsigned int tile : 10;
unsigned int pal : 3;
unsigned int flipv : 1;
unsigned int fliph : 1;
unsigned int nothing : 1;
} TILE_INDEX;


Heres a line of hex for one line of the map:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 00 1C 00 17 08 00 00 00 00 00 00 00 00 00 00 00 00

Heres the matrix snesconv shows in its gui:
0 0 0 0 0 0 0 23 28 23 0 0 0 0 0 0

Now, ignoring the zeros, heres what the 23 28 23(horiz flipping) should look like in hex(in Genlib format):
05 C0 07 00 05 C4
or in binary
00000101 11000000 00000111 00000000 00000101 11000010

What its outputting is:
00010111 00000000 00011100 00000000 00010111 00001000

Meaning that the data is all shifted to the left two bits, thus why even if I graphed it with the word vscreen, it still wont work.