anyone know what it does?
from what I managed to dig up:
from spc document:
XCN A 9F 1 5 A(7-1) <-> A(3-0) N......Z.
from snes9x source:
// XCN A
areg->YA.B.A = (areg->YA.B.A >> 4) | (areg->YA.B.A << 4);
so from what I can understand.. it exchange the upper nibble with the lower?
i.e.:
mov a, #%00001111
xcn a
a = 11110000
is this correct?
I'll see what I can dig up on this opcode and post here later today (I'm at work right now).
koitsu wrote:
I'll see what I can dig up on this opcode and post here later today (I'm at work right now).
thanks. but I'm pretty sure i was correct asuming that..
atleast my code works.
edit:
now I've tried it on hardware too, and my code seems to work.. but I got alittle disappointed, because it didn't sound like on emu.. don't know if it's because of the TV having crappy speakers or if it is because the emus can't emulate the spc good enough yet.
What differences between the real hardware and emus ??
I know sound emulation can go VERY wrong and VERY innacurate in some cases (Chrono Trigger's sound effects for example) or be just fine (music of most games).
The problem with CT is that there is particular sample that loops on themselves while overflow from the normal 16-bit range trough BRR compression to output particular noisy sound. Some "normal" sampes also sometimes get pretty different, especailly be carefull with sampling rate. The real hardware mix all thing at 32kHz, but most emus/player doesn't (or at least not by default), and this can make a difference.
well the differnece was that the sample sounded all smered out (think thats the right word) and the pitch changes wasn't as noticable as on a emu.
what I simply did for the demo was to have a sample that I played and changed the pitch on with small delays creating a little melody.. but it didn't sound as good on my tv as on the emu.. but I guess it's probably because of the tv:s speakers
Well, the 32kHz limit of the real hardware should be the cause of that, possibly along with your speakers.
Pitch change is less noticable ? Scince it's the good pitch, I can't see what would be less noticable.
This conversation is just beyond me so i am out, best of luck.
The official SPC700 docs I have say this:
Mneumonic: XCN
Operand: A
Opcode: 9F
Bytes: 1
Cycles: 5
Operation: A (7-4) <--> A (3-0)
Flags modified: N and Z
A == A register
N == Negative flag
Z == Zero flag
Based upon the fact that the directional flow is labelled <-->, I assume that means bits 3-0 of A are exchanged/swapped with bits 7-4 of A.
Again, these are official docs, so...
This looks like a SWAP command in z80 (at least I think it was swap --- it's been a while).
Perhaps XCN stands for 'eXChange Nybbles'?
Disch wrote:
Perhaps XCN stands for 'eXChange Nybbles'?
My vote is on eXChaNge.