I ported Zsnes to the Xbox. I have a few questions

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

snes6502
Rookie
Posts: 21
Joined: Wed Mar 15, 2006 3:37 pm

I ported Zsnes to the Xbox. I have a few questions

Post by snes6502 »

I figured I ask here since the people with the most knowledge of the code read/post here. I have ported Zsnes to the Xbox and I have several questions.

I'm trying to determine what "startup" variables to set since I won't be using the Zsnes.cfg file. Setting the sound information is easy, but I'm not sure how to correctly setup the graphics for 640x480.

My goal is a stretched 640x480 display. Right now my TV display is still not filling the entire screen. I am using Direct3d and copying the buffer returned by the draw640by480b() (or something) method to a texture.

Currently, I am not doing anything with windowwidth/height settings If I set the WindowWidth/Height variables to 640 and 480 (as well as surfaceX and surfaceY) and send in my buffer of 640x480 unsigned short to the copy640by480 method, is that the best (or even correct) method? Should the fullscreen variable allways be set to 1?

I'm trying to determine if my problems are from my Direct3D code or the state of video variables before I call the Zsnes copy video method. I'm not sure of what the correct variable settings should be.

Also, if anyone can think of anything that would be neccesary/beneficial (i.e you won't need such and such code, etc...) I'd love to here any suggestions. Thanks
Aaron
Lurker
Posts: 157
Joined: Sat Dec 31, 2005 7:26 am

Post by Aaron »

I have one question: are you using CVS code or the 1.43 release? The CVS has improvements on the 1.43.

[edit] Or, if you don't want to use CVS, you can use a wip at Ipher's WIP site.
snes6502
Rookie
Posts: 21
Joined: Wed Mar 15, 2006 3:37 pm

Post by snes6502 »

I grabbed the CVS code somewhere around March 12th.
Jipcy
Veteran
Posts: 768
Joined: Thu Feb 03, 2005 8:18 pm
Contact:

Post by Jipcy »

Aaron wrote:I have one question: are you using CVS code or the 1.43 release? The CVS has improvements on the 1.43.
There is no ZSNES v1.43. The last official release was v1.42.

snes6502, you might be able to get some help on the IRC channel. It is: irc.freenode.net#zsnes
[url=http://zsnes-docs.sf.net]Official ZSNES Docs[/url] | [url=http://zsnes-docs.sf.net/nsrt]NSRT Guide[/url] | [url=http://endoftransmission.net/phpBB3/viewtopic.php?t=394]Using a Wiimote w/ emulators[/url]
tetsuo55
Regular
Posts: 307
Joined: Sat Mar 04, 2006 3:17 pm

Post by tetsuo55 »

snes6502,

Could i get a copy of your compiled XBE when your done??

i have been unable to port it myself

TIA
Marmitt
New Member
Posts: 6
Joined: Tue Feb 08, 2005 8:02 pm
Location: The Nest

Post by Marmitt »

I would also be VERY interested in a copy of the xbe... do you need any beta testers?
mog123
Hazed
Posts: 62
Joined: Sat Apr 01, 2006 11:33 pm

Post by mog123 »

how r u gonna call that emu?

SNESBOX? xd
Marmitt
New Member
Posts: 6
Joined: Tue Feb 08, 2005 8:02 pm
Location: The Nest

Post by Marmitt »

That would be ZSNESBOX, wouldn't it?
XBox v1.0 TSOP X2 5035 0.2
PS2 v12 DMS4Pro S.E. ToxicOS 0.41
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Post by Ichinisan »

Uh, we already have a naming convention:

ZSNES [DOS]
ZSNESW
ZSNESL

ZSNESX

or "ZSNES for XBOX"
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

Any plans to implement the NTSC filter?


Minus the scanlines, which the TV would already output, of course.
DOLLS (J) [!]
ZNES Developer
Posts: 215
Joined: Mon Aug 02, 2004 11:22 pm

Post by DOLLS (J) [!] »

ICEknight wrote:Any plans to implement the NTSC filter?
Hahaha.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

ICEknight wrote:Any plans to implement the NTSC filter?


Minus the scanlines, which the TV would already output, of course.
Um.. for the record.. why would you need such a feature when you can make a fair assumption that if you will probably be connecting a NTSC TV to the XBOX (unless you don't live in the NTSC regions or using an HDTV I guess).. so the why the hell would you need to emulate something that does it naturally is beyond me.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
SquareHead
Veteran
Posts: 970
Joined: Fri Jan 21, 2005 11:15 am
Location: Montana, United States

Post by SquareHead »

Deathlike2 wrote:
ICEknight wrote:Any plans to implement the NTSC filter?


Minus the scanlines, which the TV would already output, of course.
Um.. for the record.. why would you need such a feature when you can make a fair assumption that if you will probably be connecting a NTSC TV to the XBOX (unless you don't live in the NTSC regions or using an HDTV I guess).. so the why the hell would you need to emulate something that does it naturally is beyond me.
I could be wrong (and usually am), but wasnt he joking?
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

SquareHead wrote:
Deathlike2 wrote:
ICEknight wrote:Any plans to implement the NTSC filter?


Minus the scanlines, which the TV would already output, of course.
Um.. for the record.. why would you need such a feature when you can make a fair assumption that if you will probably be connecting a NTSC TV to the XBOX (unless you don't live in the NTSC regions or using an HDTV I guess).. so the why the hell would you need to emulate something that does it naturally is beyond me.
I could be wrong (and usually am), but wasnt he joking?
Mmm.. no.

Though I was discussing this a little with TRAC and this might have merit.. right now it sounds silly.. but I wouldn't really know the actual usefulness of such a feature when enabled on the XBOX.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
SquareHead
Veteran
Posts: 970
Joined: Fri Jan 21, 2005 11:15 am
Location: Montana, United States

Post by SquareHead »

Deathlike2 wrote:
SquareHead wrote:
Deathlike2 wrote:
ICEknight wrote:Any plans to implement the NTSC filter?


Minus the scanlines, which the TV would already output, of course.
Um.. for the record.. why would you need such a feature when you can make a fair assumption that if you will probably be connecting a NTSC TV to the XBOX (unless you don't live in the NTSC regions or using an HDTV I guess).. so the why the hell would you need to emulate something that does it naturally is beyond me.
I could be wrong (and usually am), but wasnt he joking?
Mmm.. no.

Though I was discussing this a little with TRAC and this might have merit.. right now it sounds silly.. but I wouldn't really know the actual usefulness of such a feature when enabled on the XBOX.
You know, I was joking when I said I wanted to pipe the NTSC filtered video over to my TV, maybe I actually should and see what happens.
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

First of all, congrats for porting, you beat me to it :) The code has been cleaned up over the months to make this easier, the only step remaining that I could see was changing the DirectDraw code to Direct3D.

We can't distribute binaries of this of course but I don't see any problems with keeping the source around since there is nothing wrong with that as long as we don't include any XDK code.

If you want to PM me we can work out some any problems/concerns you have and I could possibly help you get this working better on a console environment.
snes6502
Rookie
Posts: 21
Joined: Wed Mar 15, 2006 3:37 pm

Post by snes6502 »

do you need any beta testers?
Thanks, but I plan on releasing a beta for the masses to test somewhere around the 17th

how r u gonna call that emu?
ZsnexBox


Any plans to implement the NTSC filter?
I doubt it. Don't think there would be any point since I beleive the requirements are far higher than a 733 megahertz cpu.


The code has been cleaned up over the months to make this easier, the only step remaining that I could see was changing the DirectDraw code to Direct3D.
It wasn't "too" bad porting. There was and still are a few issues I have to sort out.

Examples:
None of the Directsound code could be used. The Directsound imlemented on the Xbox is far different than that for the PC.

No support for many C runtimne functions (like chdir)

and others. I sent you a PM with some questions/concerns. I would really appreciate any ideas you might have on them. Thanks
snes6502
Rookie
Posts: 21
Joined: Wed Mar 15, 2006 3:37 pm

Post by snes6502 »

Anyone interested can read about the current progress here.

http://forums.xbox-scene.com/index.php?showtopic=499989
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

Deathlike2 wrote:
ICEknight wrote:Any plans to implement the NTSC filter?


Minus the scanlines, which the TV would already output, of course.
Um.. for the record.. why would you need such a feature when you can make a fair assumption that if you will probably be connecting a NTSC TV to the XBOX (unless you don't live in the NTSC regions or using an HDTV I guess).. so the why the hell would you need to emulate something that does it naturally is beyond me.
Erm... To simulate the irregularities in the SNES output, obviously. The X-Box will output a crystal clear image unlike the SNES did (and even an incorrect aspect ratio, perhaps?).
snes6502 wrote:
Any plans to implement the NTSC filter?
I doubt it. Don't think there would be any point since I beleive the requirements are far higher than a 733 megahertz cpu.
Oh well.
Jipcy
Veteran
Posts: 768
Joined: Thu Feb 03, 2005 8:18 pm
Contact:

Post by Jipcy »

ICEknight wrote:Erm... To simulate the irregularities in the SNES output, obviously. The X-Box will output a crystal clear image unlike the SNES did (and even an incorrect aspect ratio, perhaps?).
What are you talking about?

The NTSC filter has nothing to do with raw SNES output. It has to do with the analogue-ness of an NTSC television.

Incorrect aspect ratio? Excuse me? The SNES internal ratio is 256x224, which on an NTSC television is generally intended to be viewed at a 4:3 ratio.

"Obviously."
[url=http://zsnes-docs.sf.net]Official ZSNES Docs[/url] | [url=http://zsnes-docs.sf.net/nsrt]NSRT Guide[/url] | [url=http://endoftransmission.net/phpBB3/viewtopic.php?t=394]Using a Wiimote w/ emulators[/url]
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

I'm talking about the irregularities you can see when you connect a SNES to a TV card. I believe those are also simulated in the NTSC filter, besides the "NTSC TV" effect itself.
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

someone's retarded. the snes outputs a crystal clear picture as well. it's just that your NTSC television does things to the image. Enter the NTSC filter. Your PC monitor is vastly superior to an NTSC television, and will maintain the crystal clear image. The filter dirties the image up so it looks like it's being piped through an NTSC television.

Now, the fact that your xbox is most likely hooked up to an NTSC television already makes the filter useless, since YOU'RE PLAYING ON THE ENVIRONMENT THAT THE FILTER IS SUPPOSED TO SIMULATE. The image will get dirtied up without the filter just fine.
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

it be useful to those xbox owners that have rich daddies and a 52 inch plasma widescreen that has component(or VGA, does the original xbox support VGA).
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
ICEknight
Rookie
Posts: 33
Joined: Sun Mar 12, 2006 7:15 pm

Post by ICEknight »

sweener2001 wrote:someone's retarded. the snes outputs a crystal clear picture as well.
Looks like someone needs a lesson or two.
Nightcrawler wrote:
It emulates both the artifacts inherent in the SNES NTSC composite output circuitry and the way an NTSC TV decodes the signal.
You mind expanding on this. Exactly what artifacts does the SNES output circuitry produce? I can handle a technical explanation too.
blargg wrote:Until I write a complete description, I'll only summarize. NTSC represents luma (brightness basically) by the amplitude of the video signal. It represents chroma (color) by adding a ~3.58 MHz waveform to the luma signal, whose phase is the hue and amplitude is the saturation. In the TV the signal is filtered back into the luma (lower frequency) and chroma (the region around 3.58 MHz). SNES pixels are generated at a rate of ~5.37 MHz, or ~186 nanoseconds (ns) per pixel. If you have a single pixel of some color with black around it, there's not enough time to establish a complete cycle of the color waveform (~279 ns per cycle), so the TV decoder sees something at a different phase and amplitude than the SNES intends. ASCII art, engage!

Code: Select all

  ,-~-,
 /     \
/       \       /
         \     /
          '-_-'
|----------------| 279 ns

One color cycle

  ,-~-,
 /     \
/       \ ,-------
         \|
          '
|---------| 186 ns

One SNES pixel possibility

                  ,-.
                 /  |
----------,     /   '--
          |    /
          '-_-'
          |---------| 186 ns
          
Another SNES pixel possibility
If you put multiple SNES pixels of the same color together, you get enough of the color wave that the color is properly represented. You get artifacts even for lone gray/white pixels because they are narrow enough to contain significant harmonics in the color range.

It's just not possible to represent the color of a pixel narrower than around a color cycle, nor to switch colors faster than that, due to the inherent amount of information that can be encoded.
Look, it's the NTSC filter (sans the TV stuff) compared to the non-crystal-clear SNES output!
Image
And here's the filter in a form that could be used with the Xbox emu so it would look just like the real thing when output through an NTSC TV (which is what I've asked for in this topic):
Image



Wow someone's retarded omglawl!!!1 :roll:
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

All comments aside, the main point here is xbox isn't fast enough to run it even if you had a valid reason for putting it in.
Post Reply