It is currently Mon Jan 22, 2018 1:26 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Sat May 02, 2015 11:57 pm 
Offline
User avatar

Joined: Mon Dec 22, 2008 10:45 pm
Posts: 311
Location: Argentina
I've compared my emulator's disassembly to nestest's log and fixed every difference until I hit an illegal opcode, of which I haven't implemented any yet.
Since my phase 1 goal is making the emulator work with mapper 0 games, I'd like to know if implementing all the illegal codes is a must or if I can avoid them for now.


Top
 Profile  
 
PostPosted: Sun May 03, 2015 1:16 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2986
Location: Tampere, Finland
Practically no games use them. So yes, you can skip them when you're just getting started.

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


Top
 Profile  
 
PostPosted: Sun May 03, 2015 11:52 am 
Offline
User avatar

Joined: Mon Dec 22, 2008 10:45 pm
Posts: 311
Location: Argentina
Yay! thanks.


Top
 Profile  
 
PostPosted: Sun May 03, 2015 12:53 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
I think Nintendo had imposed a ban on them, hadn't they? That doesn't mean some didn't slip past them but it explains why they're so rare in general. (I imagine they were concerned a later revision of the system would break them - this happened between the C64 and C128 because of the switch to CMOS 6502, after all)


Top
 Profile  
 
PostPosted: Sun May 03, 2015 2:09 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 953
None of the games we have listed as using unofficial opcodes that are in Bootgod's database use NROM=mapper 0. (Not sure about Beauty and the Beast (E) 036.)
Of the homebrew games mentioned, Driar uses MMC1, STREEMERZ uses UxROM, Attribute Zone uses Color Dreams, and I expect zzo's Zork port is going to use a custom mapper therefor: so none of them use mapper 0 either.

Mind, implementing unofficial NOPs and the alternate SBC aren't going to cost you very much...


Top
 Profile  
 
PostPosted: Sun May 03, 2015 2:47 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19497
Location: NE Indiana, USA (NTSC)
Driar was ported to NROM for the multicart. That's the only NROM game I know of that uses unofficial opcodes. The rest are opcode tests.


Top
 Profile  
 
PostPosted: Sun May 03, 2015 6:25 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 952
Nevertheless, for the implementation to be correct (even if you are only implementing mapper 0) you still have to implement the stable unofficial opcodes even if no mapper 0 games currently used them; however, you need not implement them now; you can implement other stuff first and then add it later on to make it complete.

What Myask (and tepples) said is probably correct though. So, unless you want it to run the NROM version of Driar even before you complete the implementation, you do not need to implement these opcodes right now.

_________________
.


Top
 Profile  
 
PostPosted: Sun May 03, 2015 7:41 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2986
Location: Tampere, Finland
Sik wrote:
I think Nintendo had imposed a ban on them, hadn't they?

It's possible, but as far as I know it's just speculation. We could find out by asking some of the programmers from back in the day whether such a restriction was in place.

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


Top
 Profile  
 
PostPosted: Sun May 03, 2015 7:51 pm 
Online
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3984
Puzznic is CNROM, that's pretty close...

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sun May 03, 2015 9:09 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5986
Location: Canada
thefox wrote:
It's possible, but as far as I know it's just speculation. We could find out by asking some of the programmers from back in the day whether such a restriction was in place.


1. I would highly suspect that they were forbidden in documentation given by Nintendo to licensed developers, and of course, also undocumented.

2. I sincerely doubt they had any practical test to verify whether illegal opcodes were being used, so whether or not they were "forbidden" is a moot issue.

3. Licensed games do end up executing illegal opcodes now and then due to programming bugs that end up running non-code data as code. It's rare, and usually leads to an unrecoverable crash anyway, but it happens.


Top
 Profile  
 
PostPosted: Mon May 04, 2015 12:22 am 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1248
The reason Nintendo would've discouraged the use of undocumented opcodes is for situations where NES games might be running on a revision of the NES that didn't use the same 6502 core, and thus, had incompatible undocumented opcodes. The SNES would've been a great example of this, but Nintendo scrapped the NES backwards compatibility they originally wanted it to have.

Given this information, I would speculate that the NES library contains very little in the way of undocumented opcodes. It'll be mainly unlicensed games and homebrews that use them, very few licensed games.


Top
 Profile  
 
PostPosted: Mon May 04, 2015 8:12 am 
Offline
User avatar

Joined: Mon Dec 22, 2008 10:45 pm
Posts: 311
Location: Argentina
rainwarrior wrote:
1. I would highly suspect that they were forbidden in documentation given by Nintendo to licensed developers, and of course, also undocumented.

Is such a documentation available somewhere? Is there any Nintendo official programming reference for the NES?


Top
 Profile  
 
PostPosted: Mon May 04, 2015 8:34 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19497
Location: NE Indiana, USA (NTSC)
I'm not privy to any official NES docs. But the fact that unofficial opcodes other than $89 mostly appeared in games released after the Super Famicom came out (fourth quarter 1990) might be part of it. Opcode $89 (BIT #ii) works identically on all 6502 versions except that it doesn't affect the Z flag on the original 6502.

The 1-byte NOPs in Dynowarz, on the other hand, pose a problem to this hypothesis.


Top
 Profile  
 
PostPosted: Mon May 04, 2015 9:27 am 
Offline

Joined: Mon Sep 27, 2004 2:57 pm
Posts: 1248
Yeah, that's what I was thinking, if any licensed games used unofficial opcodes (other than NOPs and stuff), it would've likely been after the SNES was released, which is when developers would've known Nintendo scrapped the NES backwards compatibility.


Top
 Profile  
 
PostPosted: Tue May 05, 2015 1:59 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
rainwarrior wrote:
1. I would highly suspect that they were forbidden in documentation given by Nintendo to licensed developers, and of course, also undocumented.

When did undocumented opcodes become commonplace in the C64 demoscene? (as far as I know it's based off the same 6502 core, ergo the same undocumented opcodes)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 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