Rom release with enemies.

January 8th, 2009

It’s been too long I’m promising new stuff. So here is a new rom preview with enemies. The collision system is not done completly so you can’t yet kick the enemies out. One other thing that is yet to be done is the fall of the enemies after you get rid of them when they catch you. So the only thing in this rom are the enemies walking, grabing you and making you loosing energy.

Rom 7 teaser

There is still some work in sprite animation when the hero is facing right.This release is more for the impatient.You can get it here. It was tested on snes9x 1.43 and bsnes 0.037 emulators. If someone can confirm me it’s working on the real hardware that would be nice.Lint ++PS : Eclipse CDT setup is coming real soon…

Happy new year …

January 6th, 2009

A bit late as usual…

I wish you all an happy new year 2009. I have great hope that the snes dev scene will move this year, for the last months I see more and more people getting interested in developping for the Snes. So if you already code the snes please support them. I have also met a few guys on the net that have more or less similar projects : a cart that support sd for playing games. Well playing games or developping games. Now an SD is not going to be really practical but once it’s done I guess I can dream about a USB connection to upload code and maybe even debug feature.

I’m also in the process of switching my IDE. Since I’m working with Eclipse for my Php and Java dev at work, I tought that i should use it too for my snes deving. I installed CDT component. Everything is ok except for the Build process with the makefile I was using with VC Express 2008 that I was using before (getting rid of a microsft software from my computer is also a reason to the Eclipse switch). My problem is that WDC816CC.exe that is the C compiler from WDC always return -1 as return code even if compilation is ok. Here is an example :

C:\65xx_FreeSDK\bin\wdc816cc -wl -wp -sop -MS pad.c
WDC 65816 C   Version Evaluation  Mar 27 2006 16:41:28
       Copyright (C) 1992-2006 by The Western Design Center, Inc.
make: [compile] Error -1 (ignored)

On a real error the return code is 254.

...
D:\JDus\workspace\KFM Snes\main.c:105:
ERROR 34: undefined symbol: counter2 1 errors
make: [compile] Error 254 (ignored)

So this is a call to someone that is familiar with windows programming (thing that I’m not at all). I need either a wrapper that ouput an other return code (translate them) so i can use GNU Make with eclipse. Or even maybe patch WDC816CC.exe (even if i prefer the first solution so we keep WDC binaries intact from distribution.Shout a comment if you need to get in touch with me.

++ Lint

PS : It seems that the free version of the sdk is not more available from WDC. Get in touch with me if you need a copy.

SNES Gfx Tools Part I

December 30th, 2008

It’s been awhile again since I haven’t posted anything. I have made nice improvement in my code and now the ennemies are running and grabing the main character, make him loose energy. The player can escape from the hands by shaking left to right. I still need to implement the collision checking process so I can kick them out of the screen. So until then non new rom or source code release.Today I had a question from a reader regarding  the fx tools available on SNES. To say everything it’s not like there that much choice. There is mainly 2 dedicated tools that I use : Pcx2Snes and MappyWin32 with custom lua script to export to snes format. The latter is mainly used for the design of the level. Pcx2Snes is a tool that exists now for a very long time and that is working pretty good. It will do the gfx transformations for basics need. Here are some usage samples taken out of my current project :

Convert full screen in 16 color mode :

tools\Pcx2Snes.exe ressource/kungfu -n -c16 -screen

The -screen flag is for specifying that we want to convert to whole screen, so it will ouput a .pic file with optimised tiles and a .map file with the mapping of the full screen.  The -c option allow to tell how many color you want to use, in our case we want to convert a 16 color image. This flag can be set to 8, 16, 128 or 256 to match the different graphical modes that the Snes is allowing. The -n is for removing border detection.

Convert Sprite in 16 color with block size of 16×16 :

tools\Pcx2Snes.exe ressource/sprite -n -c16 -s32 -o16

You can notice the introduction of two new parameters the -s and the -o. The -s is spefifying block size that you want to use. For a basic background you should forget that parameter so it will use the default of 8 (or you can specify -s8). In my case since I’m converting gfx data for sprite usage i can specify with sprite block size I will use (32×32 here). Then the -o16 parameters is to specify to only ouput the 16 colors i need in the .clr file. Without specifying this parameter it will ouput a file with 256 color entries. I think you have now have all in hands to do all your basics gfx needs. If you still have problems don’t hesitate to let me comment with your problem, and if possible send the source code used to display your gfx (80% of the time it’s the code that is faulty).In one of my next I will expose how i use mappy with customs lua script to extract data of my levels since Pcx2Snes is not good for very large data (more than a screen or two in width).

See ya,

Lint

Finally a new teaser release …

November 14th, 2008

I know it’s been a long time now that I’m promising new stuff …


The rom is available here.

Source code still need a bit of cleanup, so you need to wait a bit more… Don’t hesitate to report bug or any comments.

See ya, Lint

A new wiki discovered …

October 16th, 2008

I just landed on this site while looking for software debugging info on the 65816

http://6502org.wikidot.com/software-65816

The wiki  is more about the 6502 but is some pages dedicated to the 65816.

++ Lint

Real life …

October 6th, 2008

Currently my real life is taking me a lot of time … We are gooing to move to another home soon, so we need to put everything in boxes and prepare for the transportation of them.

I just discovered a nice blog today from someone that did a lot of C64 and a bit of SNES : http://dailly.blogspot.com/

I will try to start coding again in the train … currently I use that time to play Metal slug 7 and Dragon Quest IV on my DS fat.

See ya,

Lint

First big optimisation in sprite functions.

September 16th, 2008

It’s been a while that I’m working on various optimisation to some functions to copy tables of data. I found out that the C compiler wasnt optimizing it at all. Here is the original piece of code :

    counter = data[frame].spriteNum;
    for(i=0; i<counter; i++) {
        //x = data[frame].data[i].nameLow & 0x0f;
        //y = data[frame].data[i].nameLow >> 4;

        spriteData.data[i+offset].HPos =
            data[frame].data[i].HPos + 0x76;
        spriteData.data[i+offset].VPos =
            data[frame].data[i].VPos + 0x80;
        spriteData.data[i+offset].nameLow =
            data[frame].data[i].nameLow;
        spriteData.data[i+offset].priority =
            data[frame].data[i].priority;
        spriteData.data[i+offset].color =
            data[frame].data[i].color;
    }

    // set big sprite
    spriteData.prop[offset].properties = 0xaa;
    spriteData.prop[offset+1].properties = 0xaa;

This was consuming almost 25% of the cpu time between each Vblank. The new code is going about 30 times faster :

    heroPreparedSpriteData *myData;
    OBJECTData *myObjectData;
    OBJECTData *currentSpriteData
    OBJECTProp *currentSpriteProp;

    // init with base address
    myData = data;
    // set to current frame
    for(i=0; i<frame; i++) {
        myData++;
    }

    // init with base address
    currentSpriteData = (OBJECTData*) &spriteData.data;
    currentSpriteProp = (OBJECTProp*) &spriteData.prop;
    // set to current frame
    for(i=0; i<offset; i++) {
        currentSpriteData ++;
    }

    counter = myData->spriteNum;

    // init start of the data array
    // we assume we always starts at 0 index
    myObjectData = (OBJECTData*) &(myData->data);

    for(i=0; i<counter; i++) {
        currentSpriteData->HPos = myObjectData->HPos + 0x76;
	currentSpriteData->VPos = myObjectData->VPos + 0x80;
	currentSpriteData->nameLow = myObjectData->nameLow;
	currentSpriteData->priority = myObjectData->priority;
	currentSpriteData->color = myObjectData->color;

	// update myObjectData Adress
	myObjectData++;
	currentSpriteData ++;
    }

    // set big sprite for the 8 first sprites
    currentSpriteProp->properties = 0xaa;
    currentSpriteProp++;
    currentSpriteProp->properties = 0xaa;

C compilers seems to something really handle the table really badly.

So now I’m going to finish writing the sprite routines since now I have acceptable performance going on. Why acceptable ? Because I’m sure there is a relly more effecient way to perform all this. It’s basically just copying data, so I should get myDta in ROM and DMA it to RAM and from there just updating some values like HPos and VPos.

I keep you updated anyway …

See ya, Lint

Source code of a commercial SNES game leaked …

September 15th, 2008

I have found yesterday a site that give a link to the source code of a commercial SNES game. I hadn’t have a close look yet but me for me I thinks it’s the first time that the source code of a full game is available on the net. If I’m wrong don’t hesitate to contact me …

Here is the link the the blog.

++ Lint

F-Zero VS

September 14th, 2008

I discovered a few days ago a blog explaining how to play a multiplayer mode in F-Zero running in a modified version of snes9x.

I hope that one day such feature will be possible on hardware with a action replay like device to patch the game and a way to communicate between two SNES.

Here is the F-Zero VS blog.

++ Lint

Back from vacation …

September 3rd, 2008

It’s been almost 5 days that I’m back from vacation.I have almost no time for myself …

Hard time at work since we have a major release on next wednesday. I’m still able to find some time while on the train. So I’m still optimising sprite stuff. I dicovered that the WDC Compiler is very bad at handling structure and tables. It’s don’t optimize the code at all and it’s a real loss of CPU cycle for nothing and finally always recalcaulating the exact same memory offsets.

I’m in the process to completely rewrite that code in pure ASM.

++ Lint