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.
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…
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)
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.
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 :
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 :
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).
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.
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 :
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 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 …
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.
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.