Error in F-1 Race (1984)

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

tepples
Posts: 21752
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Error in F-1 Race (1984)

Post by tepples » Mon Jan 06, 2014 9:44 am

Is this true of $41 as well? $41 includes bits from CPU open bus.

And can someone verify this on hardware by holding the input low until the strobe is asserted?

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Re: Error in F-1 Race (1984)

Post by WedNESday » Mon Jan 06, 2014 12:09 pm

tepples wrote:Is this true of $41 as well? $41 includes bits from CPU open bus.
Forcing $4016 to read back $01, $40 or $41 from reset also results in a grey screen.

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Error in F-1 Race (1984)

Post by Zepper » Mon Jan 06, 2014 1:05 pm

It does AND #$03 after LDA $6C. This bug is probably a debug access code left, removed from the final version.

I don't get a green (or gray) screen, but that on screenshot I posted, and a square wave tune plays. Plus, if I force $2002:$40, it plays the pause music slowly while the screen flashes.

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Re: Error in F-1 Race (1984)

Post by WedNESday » Mon Jan 06, 2014 4:53 pm

Zepper wrote:It does AND #$03 after LDA $6C. This bug is probably a debug access code left, removed from the final version.
Final version? Which version are you using then?
Zepper wrote:I don't get a green (or gray) screen, but that on screenshot I posted, and a square wave tune plays. Plus, if I force $2002:$40, it plays the pause music slowly while the screen flashes
Then something is very wrong with your emulator.

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Re: Error in F-1 Race (1984)

Post by WedNESday » Mon Jan 06, 2014 4:55 pm

Zepper, tepples and I would really like to help you with your emulator.

Could you please download, test and report on the most popular test ROMs available so that we can get a better picture of how accurate RockNES is?

tepples
Posts: 21752
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Error in F-1 Race (1984)

Post by tepples » Mon Jan 06, 2014 5:13 pm

Results for RockNES 5.074 are on tasvideos.org's emulator test result page. (Some of those tests can be ignored, as I described here.)

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Error in F-1 Race (1984)

Post by Zepper » Mon Jan 06, 2014 5:49 pm

Wait a minute. I believe there's some confusion here. Let me recap the things:

1. There is a bug in F-1 Race (1984). If $4016 AND 3 is non zero, the game hangs on startup. On RockNES 5.11, a blue screen filled up with zeroes (except in a rectangular portion at top right) and a tune plays. By the way, it would be great if such bug appears on NES too.
2. I couldn't test such behaviour in other emulators because I'm unable to force $4016 to return a specific value, or I don't know how to do it.
3. This isn't an emulator test accuracy. In fact, I though it would be an error in my PPU code, since the game hangs in an infinite $2002:$40 poll loop.
4. I'm going to post the ASM code from the game, where the bug occurs.
5. I'm over 15 years working in this emulator. Feel free to point me bugs or problems, but do not underestimate it.
6. I already found the problem. It's not related with the emulator accuracy.

Now, where am I wrong, please? If you believe there's a problem with the emulator, point out where.

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Error in F-1 Race (1984)

Post by Zepper » Mon Jan 06, 2014 5:52 pm

WedNESday wrote:
Zepper wrote:It does AND #$03 after LDA $6C. This bug is probably a debug access code left, removed from the final version.
Final version? Which version are you using then?
Zepper wrote:I don't get a green (or gray) screen, but that on screenshot I posted, and a square wave tune plays. Plus, if I force $2002:$40, it plays the pause music slowly while the screen flashes
Then something is very wrong with your emulator.
1. Probably it's a leftover from developers, a way to access a debug menu or something, I'm NOT sure. I said PROBABLY.
2. There's NOTHING wrong with my emu. Too hard for understanding it's a bug in the game code?

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Error in F-1 Race (1984)

Post by Zepper » Mon Jan 06, 2014 6:17 pm

ASM code. Note that I'm ORing $4016 with $01 to trigger the bug.

Code: Select all

 ;see line 17811
;bad code
(17785) C06B LDA #$00				A=01,X=FF,Y=01,S=F5,P=35
(17786) C06D STA $2003			A=00,X=FF,Y=01,S=F5,P=37
(17787) C070 LDA $4F			A=00,X=FF,Y=01,S=F5,P=37
(17788) C072 AND #$01				A=00,X=FF,Y=01,S=F5,P=37
(17789) C074 ORA #$02				A=00,X=FF,Y=01,S=F5,P=37
(17790) C076 STA $4014			A=02,X=FF,Y=01,S=F5,P=35
(17791) C079 LDY #$01				A=02,X=FF,Y=01,S=F5,P=35
(17792) C07B STY $4016			A=02,X=FF,Y=01,S=F5,P=35
(17793) C07E DEY 				A=02,X=FF,Y=01,S=F5,P=35
(17794) C07F STY $4016			A=02,X=FF,Y=00,S=F5,P=37
(17795) C082 LDA $4016			A=02,X=FF,Y=00,S=F5,P=37
(17796) C085 AND #$03				A=01,X=FF,Y=00,S=F5,P=35
(17797) C087 STA $6D			A=01,X=FF,Y=00,S=F5,P=35
(17798) C089 LDA $4016			A=01,X=FF,Y=00,S=F5,P=35
(17799) C08C AND #$03				A=01,X=FF,Y=00,S=F5,P=35
(17800) C08E STA $6E			A=01,X=FF,Y=00,S=F5,P=35
(17801) C090 LDA $4016			A=01,X=FF,Y=00,S=F5,P=35
(17802) C093 AND #$03				A=01,X=FF,Y=00,S=F5,P=35
(17803) C095 STA $6B			A=01,X=FF,Y=00,S=F5,P=35
(17804) C097 LDA $4016			A=01,X=FF,Y=00,S=F5,P=35
(17805) C09A AND #$03				A=01,X=FF,Y=00,S=F5,P=35
(17806) C09C STA $6C			A=01,X=FF,Y=00,S=F5,P=35
(17807) C09E LDY #$01				A=01,X=FF,Y=00,S=F5,P=35
(17808) C0A0 LDA $4016			A=01,X=FF,Y=01,S=F5,P=35
(17809) C0A3 AND #$03				A=01,X=FF,Y=01,S=F5,P=35
(17810) C0A5 BNE #$03				A=01,X=FF,Y=01,S=F5,P=35
(17811) C0AA STY $6F			A=01,X=FF,Y=01,S=F5,P=35
(17812) C0AC LDY #$01				A=01,X=FF,Y=01,S=F5,P=35

Code: Select all

;good code
(17785) C06B LDA #$00				A=01,X=FF,Y=01,S=F5,P=35
(17786) C06D STA $2003			A=00,X=FF,Y=01,S=F5,P=37
(17787) C070 LDA $4F			A=00,X=FF,Y=01,S=F5,P=37
(17788) C072 AND #$01				A=00,X=FF,Y=01,S=F5,P=37
(17789) C074 ORA #$02				A=00,X=FF,Y=01,S=F5,P=37
(17790) C076 STA $4014			A=02,X=FF,Y=01,S=F5,P=35
(17791) C079 LDY #$01				A=02,X=FF,Y=01,S=F5,P=35
(17792) C07B STY $4016			A=02,X=FF,Y=01,S=F5,P=35
(17793) C07E DEY 				A=02,X=FF,Y=01,S=F5,P=35
(17794) C07F STY $4016			A=02,X=FF,Y=00,S=F5,P=37
(17795) C082 LDA $4016			A=02,X=FF,Y=00,S=F5,P=37
(17796) C085 AND #$03				A=00,X=FF,Y=00,S=F5,P=37
(17797) C087 STA $6D			A=00,X=FF,Y=00,S=F5,P=37
(17798) C089 LDA $4016			A=00,X=FF,Y=00,S=F5,P=37
(17799) C08C AND #$03				A=00,X=FF,Y=00,S=F5,P=37
(17800) C08E STA $6E			A=00,X=FF,Y=00,S=F5,P=37
(17801) C090 LDA $4016			A=00,X=FF,Y=00,S=F5,P=37
(17802) C093 AND #$03				A=00,X=FF,Y=00,S=F5,P=37
(17803) C095 STA $6B			A=00,X=FF,Y=00,S=F5,P=37
(17804) C097 LDA $4016			A=00,X=FF,Y=00,S=F5,P=37
(17805) C09A AND #$03				A=00,X=FF,Y=00,S=F5,P=37
(17806) C09C STA $6C			A=00,X=FF,Y=00,S=F5,P=37
(17807) C09E LDY #$01				A=00,X=FF,Y=00,S=F5,P=37
(17808) C0A0 LDA $4016			A=00,X=FF,Y=01,S=F5,P=35
(17809) C0A3 AND #$03				A=00,X=FF,Y=01,S=F5,P=37
(17810) C0A5 BNE #$03				A=00,X=FF,Y=01,S=F5,P=37
(17811) C0A7 DEY 				A=00,X=FF,Y=01,S=F5,P=37
(17812) C0A8 BPL #$F6				A=00,X=FF,Y=00,S=F5,P=37
(17813) C0A0 LDA $4016			A=00,X=FF,Y=00,S=F5,P=37

tepples
Posts: 21752
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Roll a JOINT and press Reset

Post by tepples » Mon Jan 06, 2014 6:17 pm

Reading an authentic standard controller produces a stream of 1's starting on the ninth read. If you press the Reset button on the Control Deck, the controller will most likely have just been read 8 times, and you'll probably get a nonzero output from the controller's shift register.

Has anyone here tried this cassette on a Famicom or on an NES through an NES-JOINT? (No, you don't have to be in Colorado.)

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Error in F-1 Race (1984)

Post by Zepper » Mon Jan 06, 2014 6:20 pm

I wonder what occurs if you hold A or B (or both) on power-on/RESET in a NES, with F-1 Race there.

EDIT: would the NES play an original Famicom game using a 60-72 pin adaptor, or must have the lockout chip disabled?

lidnariq
Posts: 8786
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Error in F-1 Race (1984)

Post by lidnariq » Mon Jan 06, 2014 6:53 pm

If I use a cheat code that pins address $6C to 1 in FCEUX, it immediately goes to the racetrack and hangs there. I think you've got something else funny going on.
If I hack up fceu to always press start, on boot it hangs on a grey screen.
Last edited by lidnariq on Mon Jan 06, 2014 7:01 pm, edited 1 time in total.

tepples
Posts: 21752
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Error in F-1 Race (1984)

Post by tepples » Mon Jan 06, 2014 6:55 pm

Zepper wrote:would the NES play an original Famicom game using a 60-72 pin adaptor, or must have the lockout chip disabled?
NES-JOINT is a 60- to 72-pin adapter that includes a key chip.

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Error in F-1 Race (1984)

Post by Zepper » Mon Jan 06, 2014 7:04 pm

lidnariq wrote:If I use a cheat code that pins address $6C to 1 in FCEUX, it immediately goes to the racetrack and hangs there. I think you've got something else funny going on.
If I hack up fceu to always press start, on boot it hangs on a grey screen.
My first look was a LDA $6C then AND 3, but now it's different. It's LDA $4016 instead. Weird. o.O

EDIT: I bought the original cartridge, just waiting for arrival here. So, I'll test it on my Famiclone, since I don't own that NES-JOINT adaptor for the NES. :( Yup, I have an adaptor, but Famicom carts don't work on my NES. :( :(

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Re: Error in F-1 Race (1984)

Post by WedNESday » Tue Jan 07, 2014 8:42 am

Zepper wrote:2. There's NOTHING wrong with my emu. Too hard for understanding it's a bug in the game code?
Too hard to understand that it doesn't happen on a real NES? Or on anyone else's emulator? Then there IS something wrong with your emulator. Stop trying to pin this on the game's developer.

Post Reply