Archive for the ‘Snes’ Category

Working back on NSF Replayer

Thursday, March 26th, 2009

Too long again without any post. I’m really sorry about this. Since I have buy our house in october my mind have been a bit somewhere else.

It’s been now 2 weeks that I’m working agin on the port and cleaning of the nsf player for the snes originally made by memblers.  I have made good advancementlately and most of the code is stable now. Still got minor problems with the direct page register when comming back from nes code execution.

So at the moment no sound output yet but get me a couple of weeks and I’m sure everything will run smooth.I will try to keep you updated as soon as possible, and when project it’s I will release a packeged version of the source code so anyone will be able to use it.

See ya, Lint

Fosdem and stats

Wednesday, February 4th, 2009

Every year since about 5 years now I attend the Fosdem. This year again there is no exception. So if you attend Fosdem and want to discuss about some Snes stuff, just let me a comment.

Last month I had a bit more than 1100 unique visitors for this blog. Thanks all for reading me.

++ Lint

A new wiki discovered … again …

Wednesday, January 28th, 2009

While reading the usual blogs and forums as every morning i just landed on Neviksti wiki. It mostly contains the usual docs. The most interesting part is the Schematic page, where you can find the Snes pcb schematics.

Enjoy,

++ Lint

Snes Cart Project …

Monday, January 26th, 2009

I got an email last week from someone that is deigning a Snes cart that will allow to load roms from an SD card.

Here is the blog abot the project : HACKING THE SUPER NINTENDO

The project is already well advanced and he’s talking about doing some USB communication to a PC possible. This will open the world of debugging on the real hardware too since the developper seems to be interested to integrate such facilities in the cart.

See ya, Lint

Snes Basic Project

Wednesday, January 21st, 2009

I just uploaded a Snes Basic Project to use with my Eclipse CDT tutorial. It’s mostly an empty project with a makefile and the basic to compile your code. In the main.c there is an example that setup the screen orange.

It’s been a few days that I’m configuring a SVN repository for my code. So to be sure to have the last version go check out : http://snesdev.antihero.org/svn/SNES_BaseProject/ . If any of you have project that he want to put on the SVN just post a comment and I will get in touch with you.This code repository is not only for SNES dev with a C compiler, I will also accept pure asm code.

See ya, Lint

Macro definition in WDC tools with embedded asm …

Wednesday, January 21st, 2009

Hi all … I have been working on various stuff lately. On of the thing I’m working on is speed optimisation. For doing that I decided to start to make inline assembler into my code. Take a sneak peek at what i’m doing :

#ifdef __C_MACROS__

#define v_20    #$20
#define v_80    #$80

#define VRAMByteWrite(value,vramdst) \
        __VRAMByteWrite(value,vramdst,v_20,v_80)

#define __VRAMByteWrite(value,vramdst,v_20,v_80) asm { \
    sep        v_20;        \
    longa      off;         \
    lda        v_80;        \
    sta        $2115;       \
    rep        v_20;        \
    longa      on;          \
    lda        %%vramdst;   \
    sta        $2116;       \
    sep        v_20;        \
    longa      off;         \
    lda        %%value;     \
    sta        $2118;       \
    rep        v_20;        \
    longa      on;          \
}

#endif

This is an abstract of my new PPU.h include file. The usage of v_20 and v_80 is due to some limitation of the preprocessor comprared to what is possible with GCC by example. If you have an other syntax that work with WDC to include #$20 directly in the asm {} directive, shoot me a comment.

My 2k limit bug is still bugging me, the Eclipse howto might be finished this week since I’m almost done with the SNES_BaseProject. Something else is coming soon too.

++ Lint

2k limit is there …

Thursday, January 15th, 2009

And it’s totally bugging me …

My sprite control routine for the upcomming source release i finnaly got the 2k limit issue. The freesdk only  allow you to compile object that are going to be less than 2k. And here my function alone is more than 2K so I need to refactor it. This will delay the source code release.

An other issue that I have been facing for a few week now was compiler warning about function that were not prototyped but they were. When you prototype a function with no arguments like :

void ennemyInit();

This will return a warning during compilation. The right syntax to use is :

void ennemyInit(void);

In parallel to the source release, I’m working on the Eclipse CDT Install tutorial. It’s still work in progress but should be finalized by next week.

See ya, Lint

Rom release with enemies.

Thursday, 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 …

Tuesday, 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

Tuesday, 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