Announcing relaunch of Nezulator - now written in Javascript

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
Zelex
Posts: 268
Joined: Fri Apr 29, 2011 9:44 pm

Post by Zelex »

Bregalad wrote:I tried on rekonq and Firefox (both linux) too. On rekonq, like in Opera, the drag and drop doesn't even have any effect and the google search is not working so I don't know how it works.

In firefox, it runs even 1000 times slower than in Opera (where it was already slow), the whole computer slowed down completely and the mouse was barely moving anymore, I'm glad it didn't crash.
Yeah, in order for drag and drop to work, they have to implement the HTML5 file api. I haven't really looked into other browsers support of the file api as performance is so horrible in anything non-chrome.

I'll temporarily re-enable the search real quick, but I have to turn it off until I can assert the legal status of it. Some people over at emulation collective said it could be construed as hotlinking and as such be illegal. I'm not too sure about that assertion, but for a $100,000 lawsuit... I'll stay on the conservative side till my IP lawyer gets back to me.

(Specifically, the reason I do not think its hot-linking is that it requires user-action in order to actually load the rom -- therefore not hot linking. Hot linking is where the user has no choice but to download the content.)

Turning Search back off in a few hours btw.
3gengames
Formerly 65024U
Posts: 2281
Joined: Sat Mar 27, 2010 12:57 pm

Post by 3gengames »

Well have you talked to them about using their mirrors?
Zelex
Posts: 268
Joined: Fri Apr 29, 2011 9:44 pm

Post by Zelex »

Dwedit wrote:Sprite character fetches happen during "hblank time", not during background render time.
That sounds pretty likely then. I'll take a look at that a bit later today. Thanks for the tip! :)
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

The joypad problem:
Chu Chu Rocket writes 1 to 4016 strobe the joystick, then immediately reads from 4016, which reads the state of the first button of the joystick without shifting it. Then it writes 0 to 4016 to allow shifting. If emulated incorrectly, the joystick reads will be wrong.

You can download Chu Chu Rocket from my website.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

So, in Reqonk it runs about the same as in opera, very slow but now nearly as bad as Firefox (3.6)
Useless, lumbering half-wits don't scare us.
3gengames
Formerly 65024U
Posts: 2281
Joined: Sat Mar 27, 2010 12:57 pm

Post by 3gengames »

Why don't you just upgrade to Chrome? It's your browsers problems you keep complaining about. Switch from the browser you're using that apparently sucks at javascript processing. If your using Opera, you'll probably like Chrome.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Again, how slow is it in Firefox 4?
Zelex
Posts: 268
Joined: Fri Apr 29, 2011 9:44 pm

Post by Zelex »

tepples wrote:Again, how slow is it in Firefox 4?
still very slow. I've spoken to one of the js performance guys at Mozilla about it and he opened a ticket (bug 654410 on b.m.o) so that he can track it. He's going to analyze the perf of the program in his tools and give some suggestions and more than likely that he will put improvements into the next firefox revision for it.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Good deal. Feel free to create a b.m.o account (if you haven't), zip up a copy of the emulator, and attach it to the ticket. This way they can test even if your site is down.
Zelex
Posts: 268
Joined: Fri Apr 29, 2011 9:44 pm

Post by Zelex »

Dwedit wrote:The joypad problem:
Chu Chu Rocket writes 1 to 4016 strobe the joystick, then immediately reads from 4016, which reads the state of the first button of the joystick without shifting it. Then it writes 0 to 4016 to allow shifting. If emulated incorrectly, the joystick reads will be wrong.

You can download Chu Chu Rocket from my website.
I know whats going on now. The joystick reads as 0x40 for no button pressed and 0x41 for button pressed. I believe your code doesn't mask off the lowest bit. Is it standard functionality to just return a 1 or 0 without bit 7 set?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

On an NES with an ordinary Game Pak[1] inserted, bits 4-0 (mask $1F) come from the controller port, while bits 7-5 (mask $E0) come from the last byte that was on the data bus (due to capacitance of the wires, commonly called "open bus"). In the vast majority of cases, this previous byte will be $40, so you'd return 0x40 | control_bits for reads.


[1] Some developer boards such as the PowerPak have resistors on the data bus, which pull the voltages toward one value. A few Mindscape games rely on the open bus behavior and need patches to work on the PowerPak.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

I'm using this code to read the joystick:

Code: Select all

	ldx #1
	stx $4016 ;strobe joypad
	lda $4016 ;test read, should not shift joypad value
	dex
	stx $4016 ;clear strobe, now it's okay to shift joypad value
	and #$FC
	tax
	cpx $4016
	ror a
	cpx $4016
	ror a
	cpx $4016
	ror a
	cpx $4016
	ror a
	cpx $4016
	ror a
	cpx $4016
	ror a
	cpx $4016
	ror a
	cpx $4016
	ror a
	eor #$FF
Not your typical code, since it uses CPX instead of LDA to read the register.
But it should still work even if $4016 reads as 0 or 1, since it did a test read, then masks that off to see what it needs to compare with.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Zelex
Posts: 268
Joined: Fri Apr 29, 2011 9:44 pm

Post by Zelex »

I added support to specify a ROM to load on the URL. so you can give people a direct link to play your game! :)

http://zelex.net/nezulator/?rom=www.dwe ... item%3D298

PS. Also fixed the emulator to not have bit 7 set.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox »

tepples wrote:[1] Some developer boards such as the PowerPak have resistors on the data bus, which pull the voltages toward one value. A few Mindscape games rely on the open bus behavior and need patches to work on the PowerPak.
This was fixed in the latest beta mappers.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

Zelex wrote:I added support to specify a ROM to load on the URL. so you can give people a direct link to play your game! :)

http://zelex.net/nezulator/?rom=www.dwe ... item%3D298

PS. Also fixed the emulator to not have bit 7 set.
FCEU and Nintendulator set bit #6 (#$40) when reading from 4016, and the game runs perfectly on those emulators. Something else must be up.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Post Reply