NESnake 2 version with correct controller reading ?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
Bregalad
Posts: 7884
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

NESnake 2 version with correct controller reading ?

Post by Bregalad » Mon Aug 25, 2008 11:00 am

Is there any out there yet ? As the game uses DMC and uses a one-pass controller read routine, I've heard there is phantom controller reads due to this.
Is there any corrected version arround ? Looks like the author has not been active on NESdev for a while. Also, the controller reading is a little complicated to be simply hacked, and there is almost no free space in the ROM (all I can find is a bunch of $ff at iNES adress 0x7542 (ROM adress $f532), so I guess that's better than nothing.
I should make the original controller routine jsr here and do Blargg's 3-pass controller reading routine.
Life is complex: it has both real and imaginary components.

Matrixz
Posts: 19
Joined: Sat Oct 23, 2004 4:25 pm
Location: Norway
Contact:

Post by Matrixz » Sat Aug 30, 2008 7:06 am

Hi there..
I would be grateful if you could explain what you mean by one-pass controller reads or 3-pass reads, and however DMC can influence controller reads. Or link to any available info on this.
I wasnt aware of anything like this when writing the game, your post caught my interest. :)

- Matrixz

Roth
Posts: 399
Joined: Wed Aug 03, 2005 3:15 pm
Contact:

Post by Roth » Sat Aug 30, 2008 8:06 am

Heya Matrixz, just wanna say that I love your game. Haven't gotten the cart yet because of other stuff I have to get, but I look forward to snagging a copy : )

Back to the topic, I'm thinking Bregalad is referring to the discussions in these topics:

DPCM generates extra $4016 read pulse
and
DMC-fortified controller read routine

User avatar
BMF54123
Posts: 409
Joined: Mon Aug 28, 2006 2:52 am
Contact:

Post by BMF54123 » Sat Aug 30, 2008 7:25 pm

Yeah, that's the problem. The game kept pausing when I tried to play it on my PowerPak. A fix would be great. :(

Matrixz
Posts: 19
Joined: Sat Oct 23, 2004 4:25 pm
Location: Norway
Contact:

Post by Matrixz » Sun Aug 31, 2008 12:21 am

I see. Actually on both my PAL Scandinavian NES and French NES, i have none of these problems. Which i guess means either the DMC does not coincide with the controller reads when playing the game on PAL units, or the DMC/4017 read phenomena does not happen on PAL units at all.

I lost the source code to NeSnake 2, so the game would have to be hacked or disassembled-assembled to fix it. Just maybe i'll go fix it if no one else does.

User avatar
Sivak
Posts: 316
Joined: Tue Jul 17, 2007 9:04 am
Location: Somewhere
Contact:

Post by Sivak » Sun Aug 31, 2008 11:53 am

The game has pausing bugs? Does this happen on the cart or on the rom or both? I don't have the cart or rom myself, but I am curious about it now that this has been brought to light.

This is something that's only an issue with DMC use yes? Regular controller routines will be fine if no DMC was used in a game?

User avatar
Hamtaro126
Posts: 770
Joined: Thu Jan 19, 2006 5:08 pm

Post by Hamtaro126 » Sun Aug 31, 2008 11:57 am

I am sorry to hear that, no wonder your website is down.

That is so sad concerning an update for your Universal NES ROM editor which uses a XML variant (can't think of the name right now)

Second time's the charm maybe?

User avatar
tokumaru
Posts: 11706
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru » Sun Aug 31, 2008 12:26 pm

Sivak wrote:Does this happen on the cart or on the rom or both?
Apparently, no emulators have this implemented (yet).

CartCollector
Posts: 122
Joined: Mon Oct 30, 2006 8:32 pm

Post by CartCollector » Sun Aug 31, 2008 12:47 pm

I've had problems with the controller with NESSnake 2 on Nestopia 1.40.

User avatar
Bregalad
Posts: 7884
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Sun Aug 31, 2008 1:26 pm

Well, I've made myself a hacked corrected version. Since I couldn't find any free zeropage variable, I used two variables at $7f0 and $7f1 (those seemed like unused but I'm not 100% sure, I've got some crash in two-player modes but they may be due to hardware fault).

Also the "fix" is for the PAL version so I doubt anyone would be very interested. I did think in an horribly hackish, slow and ugly way. I'd like the author to make a "good" fix of the game instead. Also I can't confirm no controller glitches happen in PAL, because I have a "fixed" version that I fixed pre-emptively.

And yes, the three-passes controller reading is needed only when DPCM is used. As long as you don't touch it there is (as far we know) no problems with one-pass controller reading.
Life is complex: it has both real and imaginary components.

Matrixz
Posts: 19
Joined: Sat Oct 23, 2004 4:25 pm
Location: Norway
Contact:

Post by Matrixz » Mon Sep 01, 2008 6:06 am

Alright, i'll try fix it. I'll post a link here upon the case of success.
Hamtaro126 wrote:I am sorry to hear that, no wonder your website is down.

That is so sad concerning an update for your Universal NES ROM editor which uses a XML variant (can't think of the name right now)

Second time's the charm maybe?
My last website disappeared suddenly due to something happening to the host, and i havent made an effort to put up a new one. I wouldn't get that depressed over losing the source code to NeSnake 2 :) Either way i still have the source to the enhanced version of it, which RetroZone's Super NeSnake 2 was based on.

When it comes to DRDHack (the XML-based romhacking utility).. the latest version is kind of powerful but due to the reason mentioned above i don't have the binary or the documentation hosted anywhere. Its discontinued, regardless, for various resons.

User avatar
Sivak
Posts: 316
Joined: Tue Jul 17, 2007 9:04 am
Location: Somewhere
Contact:

Post by Sivak » Mon Sep 01, 2008 9:26 am

After looking at this again... Is it just the basic version that has the bad controller reads or is it the enhanced one (with music and nicer graphics)? Or is it both?

I know the cart used AOROM and basically bank switched into the original version if you pick that on the title.

Matrixz
Posts: 19
Joined: Sat Oct 23, 2004 4:25 pm
Location: Norway
Contact:

Post by Matrixz » Mon Sep 01, 2008 10:03 am

Okay, to clear up, there are 3 main versions of NeSnake:

NeSnake - Basic version, should have no problems. Included with Super NeSnake 2
NeSnake 2 - The game in question with the problem. Not the same as Super NeSnake 2. Can be found on ROM sites.
Super NeSnake 2 - RetroZone cartridge version, it appears Bunnyboy fixed the game to have no problems.

User avatar
Sivak
Posts: 316
Joined: Tue Jul 17, 2007 9:04 am
Location: Somewhere
Contact:

Post by Sivak » Mon Sep 01, 2008 6:28 pm

Matrixz wrote:Super NeSnake 2 - RetroZone cartridge version, it appears Bunnyboy fixed the game to have no problems.
Ah, I see. Ok. I didn't know the "Super" meant it was something different. Thanks for the info.

Matrixz
Posts: 19
Joined: Sat Oct 23, 2004 4:25 pm
Location: Norway
Contact:

Post by Matrixz » Tue Sep 02, 2008 6:33 am

http://www.geocities.com/matrixz15/nn2_ntsc_13t.zip

There.

The controller read routine is now hacked to use a slightly faster version of Blargg's 4-pass controller read routines. (Meaning it also reads Famicom external controllers, i guess).

I tested this in Nestopia 1.40 and the problems that were before seems to be gone. If someone tests this on NTSC hardware, we'll know for sure. It seems to glitch more now, i guess becouse things take more CPU time.

Additionaly, a minor code error for the controller #2 was fixed, although it didnt seem to cause bugs before.

Post Reply