It is currently Mon Dec 11, 2017 2:07 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: illegal opcodes?
PostPosted: Mon Jan 31, 2005 6:07 am 
Offline
User avatar

Joined: Fri Nov 26, 2004 5:50 am
Posts: 79
From Nesdev mainsite i see these documents "undocumented opcodes"
and "Extra instructions".

My question is, are these opcodes present NES CPU?
"undocumented opcodes" document suggests that they are only
available at Atari 8-bit CPU.

- Sepi


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 31, 2005 9:44 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3487
Location: Indianapolis
They're in the NES, I remember someone a while back saying they tested the ones from the Atari docs and they worked. I doubt every single instruction was tested (many of them aren't too useful anyways), but I'd imagine they'd all work the same.


Top
 Profile  
 
 Post subject: illegal opcodes
PostPosted: Mon Jan 31, 2005 4:39 pm 
Offline
User avatar

Joined: Fri Nov 26, 2004 5:50 am
Posts: 79
Could this be a worth of research? as far as i know, not many emulators
(if any) supports illegal opcodes.

I see that many illegal opcodes are equivalent to valid opcodes,
i guess it would not matter if they are there or not.

I've been looking for a subject for my NES program for a quite awhile,
maybe this might be worth of a developement? perhaps a program similar
to NEStress might be usefull for emulator developement?

- Sepi


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 31, 2005 5:32 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Most 'big' emus probably do emulate the illegal ops somewhat... although I doubt they're super accurate about it since the information available is questionable at best.

But I know at least the Nester family of emus and FCEU emulate them.

I heard rumors that some GG codes make use of invalid opcodes, but I find that a little far fetched.


Top
 Profile  
 
 Post subject: They're all there.
PostPosted: Tue Feb 01, 2005 5:04 am 
Offline
User avatar

Joined: Thu Nov 11, 2004 5:30 am
Posts: 121
Location: San Francisco, CA
I tested all of them; they are all there. There were some subtle differences (relating to lack of decimal mode in ADC/SBC and derived), but the undocumented set was nearly identical to those found in the C64 6510.

_________________
...patience...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 6:12 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
The only undocummented opcodes being executed were found in a few asian pirate carts, such as "Donkey Kong Country" (well, double-NOPs to be precise) and in an original japanese title too. Invalid opcodes help to detect bad dumps and/or bugs in an emulator. So, I can't see a reason to get all them emulated, unless an original game requires it (as said before).

Like Matt said, they are all there, but it doesn't mean your emu will be f*cking accurate... perhaps the oppositive side. ;) Heh, once an UO is executed, something weird might happen.

Well, the idea is - emulate when required by a game.

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 7:44 pm 
Offline
User avatar

Joined: Thu Nov 11, 2004 5:30 am
Posts: 121
Location: San Francisco, CA
Having worked (officially) on 3 Nintendo platforms now (GBC, GBA, DS), i can pretty safely assume that NCL/NOA probably did not allow any games to use invalid instructions, else they would fail Lot Check. Usually they mark these kinds of things as "Reserved" in the programming manuals, stating they are prohibited because they are subject to change in future hardware revisions.

I wrote some silly voxel rendering code for a game based on a certain Disney aquatic character that used the GBA's SWP instruction as an optimization, and had to ultimately remove it because "its functionality could not be guaranteed by the hardware manufacturer." :x

_________________
...patience...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 9:49 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19329
Location: NE Indiana, USA (NTSC)
A certain Disney aquatic character...

Too bad that name was taken.


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

All times are UTC - 7 hours


Who is online

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