Jump to content

Summary from old forums


TheChuckster

Recommended Posts

TheChuckster:

New web site! http://thechuckster.homelinux.com/stellads/

 

I am working on a port of the Atari 2600 emulator Stella. So far almost the entire code base has been ported. Download a ROM and put it in the data directory. Name it "pacman.bin" and recompile. The emulator will load, MD5 sum, and execute it.

 

What's left? I am having problems with the frame buffer so no visuals. It's a problem with the ported emulator code, not the DS framebuffer because I can write to the DS framebuffer fine. The source code is in the zip; perhaps, you could take a look. Namely, the TIA.cpp file is what handles the Atari's framebuffer. I honestly don't know what's the matter, but then again, this is my first real DS project.

 

Also, sound and controls need to be implemented. Shouldn't be too hard -- at least the controls. I am not going to start on these features until I get framebuffer working though.

 

Download the source code and binaries at:

http://thechuckster.homelinux.com/atarids.zip

Consider this the alpha version.

 

EDIT: Update with added debug info -- registers and instructions just to prove that the dang thing works!

 

GPFerror:

replace your updateframebuffer() function with the below code works on hardware. just needs to be seriously optimized <_<

 

Code:

void updateframebuffer()

{

int i = 0;

int j = 0;

uInt8* buffer=theConsole->myMediaSource->currentFrameBuffer();

uInt16* buffer2=VRAM_A;

int x=0,y=0;

int x2=0,y2=0;

int h=210;

int w=160;

uInt8* line;

uInt16* l2;

buffer += y * w + x;

buffer2 += y2 * 256 + x2;

for(i = 0; i < h; ++i) {

line = buffer + (w * i);

l2 = buffer2 + (256 * i);

for(j = 0; j < w; ++j) {

uInt8 v = *line++;

*l2++=RGB15(myPaletteR[v],myPaletteG[v],myPaletteB[v]);

 

}

}

 

 

 

}

 

TheChuckster:

You're getting visuals from the emulated game? iDeaS just displays all black. Thank you for the function.

 

EDIT: Got somebody to test it on their hardware. It works! I wish I could do more but it won't work in emulators and Neo Flash won't replace my defective Slim Loader which is a shame because I'll never get to enjoy my work. Guess the community will just have to wait for sound, scaling, optimizations, controls.

 

Even with it as an extended rotation background instead of a framebuffer it's still not showing up in iDeaS. Dualis crashes and DSEmu won't display anything at all.

 

http://thechuckster.homelinux.com/atarids.jpg

 

Wraggster:

Awesome stuff, i mirrored your release and posted news here --> http://nintendo-ds.dcemu.co.uk/

 

TheChuckster:

You can actually play ET now! http://thechuckster.homelinux.com/chuck.jpg

 

So as you can see, I got controls working but the framebuffer still needs optimized. I will work on that now. Hopefully, the framebuffer is what's slowing things down. My plan is to only draw the updated portions each frame and to use an extended rotation background on Mode 5 instead of the FB0.

 

If the emulated processor or the C++ emulator core code are the bottlenecks and the code needs a drastic rewrite, this project will surely grind to a halt. I have no experience whatsoever with optimizing for embedded systems or even with ARM assembly for that matter.

 

By the way, the latest ROM can be found at http://thechuckster.homelinux.com/atarids.nds

 

Forget the old source code zip. I will update it once my framebuffer optimizations are in place.

 

UPDATE:

The emulator has been quite optimized and plays at a smooth playable speed now thanks to a faster framebuffer drawing routine. I will continue to work on it though and add sound.

 

I need to order a Wifi card to do more complete experimentation because there's pretty much no hope at all of getting a replacement Neo Flash.

 

As promised, I have released the source code:

http://thechuckster.homelinux.com/atarids.zip

 

Feel free to try some optimization of your own! :shootem:

 

GPFerror:

cool, glad it helped.

 

Yeah I wasn't able to get it to work in the emulators either, so I had someone on irc test it on hardware before I posted my code :D

 

I run into the same problem with my neo pocket emulator, but it now works in dsemu.

 

One thing to try is to make the emulated frame buffer, have a width of 256 and apply the color directly as its being created. then you can just use a dmacopy or a swifastcopy to copy it to vram, which might speed it up some.

 

Troy

 

Wraggster:

awesome work, ive once again mirrored the release and screens here --> http://nintendo-ds.dcemu.co.uk/stellads.shtml

 

I also submitted this news to Joystiq.com and they posted it, so your famous :D

 

i do have one request could you number your releases or date them as for all emu sites its easier to see whats new etc :D

 

mrnull:

I don't see any binaries, just source!

 

I recently moved and don't have access to my ol' computer. Please help!

 

TheChuckster:

Try the new web site for binaries. http://thechuckster.homelinux.com/stellads/

 

I managed to get it to work in Dualis by removing -mthumb from the Makefile. Problem is it's still running slower than the actual games -- at least in the emulator. Can anyone else that has the hardware confirm if it's running quite a bit slower in the emulator than the hardware or if it's running just as slowly on both?

 

Looks like even more optimization work is necessary.

 

Also, a Mode 5 hardware scale factor of 3 << 7 seems to make it smaller even though it SHOULD make it 1.5x larger. Is this true only to Dualis or does it malfunction on the hardware as well? Perhaps I'm using the wrong scale factor. Is 3 << 7 correct for a factor 1.5?

 

gladius:

The scale factors are actually the amount the DS adds after each pixel to the x and y co-ordinates. To get a scale factor of 1.5, you actually want to add ~0.66667 each pixel. Or converting to fixed point (1/1.5 * 256) you want 171.

 

Tepples:

And you might want to change the horizontal constant offset each frame by a fraction of a pixel so that the player doesn't see an obvious pattern of 2, 1, 2, 1, 2, 1 repeated pixels in the A2600's two bitmapped objects. This technique, used (albeit in the other direction) by PocketNES, may look flickery on emulators, but it'll look OK on a real DS.

Link to comment
Share on other sites

There is clear documentation on the web site about the controls, and don't forget R and L control the switches.

 

Paddle emulation doesn't work yet, but I'm going to see about interfacing real Atari paddles to the GBA port (I use WMB).

 

Try recompiling with other ROMs. Since I abide by the forum rules, I cannot give out links or any more information.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...