Today I accessed my analytic web system and I see so much visitors... the first question "from where? to what?" so the google analytics answers me: From http://forums.thedailywtf.com/members/Quietust.aspx ;
Let's see what you have been discussed...
"or by dynamically adding opcodes at runtime via reflection to support user extension and other fluff like that..."
I try to do it before (I mean via reflection) but someone alerts me it could let the core slower.
"It's brillant. That way if the NES architecture ever changes you only need to change a few classes and everything will work again!"
So sarcastic, next one! (but it mades me laugh, could you imagine NES changing every day)
"WTF is an instruciton? "
Is one way (not the better I know, I could have use the array struct) to get current instruction given an opcode.
This project http://code.google.com/p/juicynes/source/browse/trunk/src/juicynes/hardware/Cpu.java makes me see WTF I made putting the separeted file for each class.
Look his approach:
switch (opcode)
{
case 0xA9: lda(immediate()); cycles += 2; break;
case 0xA5: lda(zeropage()); cycles += 3; break;
case 0xB5: lda(zeropageX()); cycles += 4; break;
case 0xAD: lda(absolute()); cycles += 4; break;
case 0xBD: lda(absoluteX()); cycles += pageCrossed?5:4; break;
case 0xB9: lda(absoluteY()); cycles += pageCrossed?5:4; break;
case 0xA1: lda(indirectX()); cycles += 6; break;
case 0xB1: lda(indirectY()); cycles += pageCrossed?6:5; break;
case 0xA2: ldx(immediate()); cycles += 2; break;
case 0xA6: ldx(zeropage()); cycles += 3; break;
case 0xB6: ldx(zeropageY()); cycles += 4; break;
case 0xAE: ldx(absolute()); cycles += 4; break;
case 0xBE: ldx(absoluteY()); cycles += pageCrossed?5:4; break;
....
I simply loved it!
You've got the points in many "places" and some "places" I disagree with you.
A last question... how did you http://forums.thedailywtf.com/members/Quietust.aspx did reach on the project?
best regards,