It is currently Tue Dec 12, 2017 4:59 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Apr 17, 2015 9:34 pm 
Offline

Joined: Sat Mar 08, 2014 12:59 pm
Posts: 16
I've noticed a few other games seem to use unofficial opcodes other than the ones mentioned here:

http://wiki.nesdev.com/w/index.php/Tricky-to-emulate_games
http://wiki.nesdev.com/w/index.php/CPU_unofficial_opcodes#Games_using_unofficial_opcodes

Dynowarz uses $DA and $FA (one byte NOPs) - you can see this happen on the first level when your dino throws his fist.
F-117A Stealth Fighter uses $89 (two byte NOP) - you can see this happen when your stealth fighter first takes off and gets to the top of the screen before switching to the interior cockpit view
Infiltrator also uses $89 (two byte NOP) - on the title screen

We should probably update the wiki page(s) to mention these other usages of unofficial opcodes.

Are there more that anyone is aware of? I suspect Rollergames uses $03...but I'm still investigating that one...


Top
 Profile  
 
PostPosted: Fri Apr 17, 2015 11:48 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2982
Location: Tampere, Finland
isosceles wrote:
Dynowarz uses $DA and $FA (one byte NOPs) - you can see this happen on the first level when your dino throws his fist.

Confirmed on Nintendulator:
Code:
Invalid opcode $DA (NOP) encountered at $E56D
Invalid opcode $FA (NOP) encountered at $E57D

(Note that "throws his fist" literally means that the fist goes flying, so have to pick up a powerup for that to happen.)

isosceles wrote:
F-117A Stealth Fighter uses $89 (two byte NOP) - you can see this happen when your stealth fighter first takes off and gets to the top of the screen before switching to the interior cockpit view

Also confirmed:
Code:
Invalid opcode $89 (NOP) encountered at $B702
Invalid opcode $89 (NOP) encountered at $B753
Invalid opcode $89 (NOP) encountered at $B9AA

isosceles wrote:
Infiltrator also uses $89 (two byte NOP) - on the title screen

And this one also:
Code:
Invalid opcode $89 (NOP) encountered at $8939

(Seems to be in sound code, and funnily enough it's also in sync with the "tick tick tick" sound being played.)

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sat Apr 18, 2015 2:46 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
isosceles wrote:
We should probably update the wiki page(s) to mention these other usages of unofficial opcodes.

So what's stopping you? Did you make an account on the wiki? If so, do you need us to grant you edit access? (Tepples or I can do this no problem, just drop one of us a PM with your Wiki username and we'll make it happen).

The wiki is a collaborate effort -- in other words, this post here on the forum is totally cool and appreciated, but you effectively could have done the same thing by editing the wiki in the first place. "We should probably update it" implies that for some reason you can't or won't, so let's work together to make sure you can and will!


Top
 Profile  
 
PostPosted: Sat Apr 18, 2015 4:01 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
It'd be also interesting to see if the usage of those unofficial opcodes is the result of a program flow bug that miraculously didn't make the game crash (so the developers never fixed it), or if it is really the result of using them on purpose.
I really see no advantage in using unofficial multi-bytes nop as opposed to real nops.


Top
 Profile  
 
PostPosted: Sat Apr 18, 2015 4:55 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
...or a bad dump.


Top
 Profile  
 
PostPosted: Sat Apr 18, 2015 6:11 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
$89 can be the result of a mistaken BIT in code originally intended for a TurboGrafx, Lynx, or Super NES. The 65C02 interprets $89 as BIT #ii, which sets the Z flag based on A & ii. The 6502 interprets it as a 2-byte NOP, which is exactly the same except flags aren't affected.

Bregalad wrote:
I really see no advantage in using unofficial multi-bytes nop as opposed to real nops.

Do any of these games use the 2-byte NOP as a clockslide? Besides, now that flash memory has replaced mask ROM, 2-byte NOPs are useful for making each copy identifiably unique.


Top
 Profile  
 
PostPosted: Sat Apr 18, 2015 6:55 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
tepples wrote:

Heh, interesting way to play with the opcodes.


Top
 Profile  
 
PostPosted: Sun Apr 19, 2015 2:47 pm 
Offline

Joined: Sat Mar 08, 2014 12:59 pm
Posts: 16
It appears Rollergames uses $03 (SLO), at $C7EE - this happens almost immediately upon the start of the first level, and periodically thereafter.


Top
 Profile  
 
PostPosted: Sun Apr 19, 2015 3:16 pm 
Offline

Joined: Sat Mar 08, 2014 12:59 pm
Posts: 16
...and The Simpsons: Bart vs The World uses $0B (ANC) at $F126. You can see this happen on the China boat level, when Bart throws his ball.


Top
 Profile  
 
PostPosted: Sun Apr 19, 2015 4:23 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2982
Location: Tampere, Finland
Couldn't reproduce either one of those.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sun Apr 19, 2015 4:31 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Noting here: now that you (isosceles) have wiki edit access, please be careful in adding entries for these games. If folks can reproduce + verify the behaviour, then thumbs up, but don't be hasty with your additions. We don't want to send emulator authors on wild goose chases if we can avoid it.


Top
 Profile  
 
PostPosted: Sun Apr 19, 2015 5:51 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
tepples wrote:
Do any of these games use the 2-byte NOP as a clockslide?

This was my first thought, either that or for doing cycle-exact timing of hardware accesses without needlessly messing with the CPU state (I know I have used otherwise inefficient opcodes in the past because they happen to give me the perfect timing for the hardware).


Top
 Profile  
 
PostPosted: Sun Apr 19, 2015 6:14 pm 
Offline

Joined: Sat Mar 08, 2014 12:59 pm
Posts: 16
thefox wrote:
Couldn't reproduce either one of those.


Oops - my apologies - Turns out I had bad dumps of both Rollergames and Bart Vs. The World. There is no unofficial opcode use in either. :oops:


Top
 Profile  
 
PostPosted: Sun Apr 19, 2015 6:49 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
isosceles wrote:
thefox wrote:
Couldn't reproduce either one of those.


Oops - my apologies - Turns out I had bad dumps of both Rollergames and Bart Vs. The World. There is no unofficial opcode use in either. :oops:


That's what I had warned... and ignored.


Top
 Profile  
 
PostPosted: Mon Apr 20, 2015 2:07 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2982
Location: Tampere, Finland
The first three games mentioned in the thread are unlikely to be bad dumps. When I made my first post I verified their CRC32 against those from bootgod's NES cart database. At least one of the games had been dumped twice by different people. I'm not sure what's the likelihood that some of the dumps I have originate from bootgod. In any case, I believe bootgod has been fairly careful about getting the dumps right on his site.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group