Added long descriptions to opcode tool tips.

This commit is contained in:
mjbudd77 2021-07-07 18:40:39 -04:00
parent edb167ab2a
commit 15f799beff
2 changed files with 114 additions and 25 deletions

View File

@ -3686,7 +3686,8 @@ bool QAsmView::event(QEvent *event)
line = lineOffset + c.y(); line = lineOffset + c.y();
showOpcodeDesc = (c.x() >= 22) && (c.x() < 25) && showOpcodeDesc = (c.x() >= 22) && (c.x() < 25) &&
(line < asmEntry.size()) && (asmEntry[line]->type == dbg_asm_entry_t::ASM_TEXT); (line < asmEntry.size()) && (asmEntry[line]->size > 0) &&
(asmEntry[line]->type == dbg_asm_entry_t::ASM_TEXT);
if ( showOpcodeDesc ) if ( showOpcodeDesc )
{ {

View File

@ -456,6 +456,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
addrMode = "Immediate"; addrMode = "Immediate";
} }
synopsis = "A,Z,C,N = A+M+C"; synopsis = "A,Z,C,N = A+M+C";
longDesc = "Add the value at the specified memory address to the accumulator + the carry bit. On overflow, the carry bit is set.";
break; break;
// AND - Logical AND // AND - Logical AND
case 0x29: case 0x29:
@ -473,6 +475,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
addrMode = "Immediate"; addrMode = "Immediate";
} }
synopsis = "A,Z,N = A&M"; synopsis = "A,Z,N = A&M";
longDesc = "Perform an AND operation between the accumulator and the value at the specified memory address.";
break; break;
// ASL - Arithmetic Shift Left // ASL - Arithmetic Shift Left
case 0x0A: case 0x0A:
@ -487,6 +491,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
addrMode = "Accumulator"; addrMode = "Accumulator";
} }
synopsis = "A,Z,C,N = M*2 or M,Z,C,N = M*2"; synopsis = "A,Z,C,N = M*2 or M,Z,C,N = M*2";
longDesc = "Shifts all the bits of the accumulator (or the byte at the specified memory address) by 1 bit to the left. Bit 0 will be set to 0 and the carry flag (C) will take the value of bit 7 (before the shift).";
break; break;
// BCC - Branch if Carry Clear // BCC - Branch if Carry Clear
case 0x90: case 0x90:
@ -496,24 +502,30 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Relative"; addrMode = "Relative";
} }
longDesc = "If the carry flag (C) is clear, jump to location specified.";
break; break;
// BCS - Branch if Carry Set // BCS - Branch if Carry Set
case 0xB0: case 0xB0:
title = "BCC - Branch if Carry Set"; title = "BCS - Branch if Carry Set";
if ( opcode[0] == 0xB0 ) if ( opcode[0] == 0xB0 )
{ {
addrMode = "Relative"; addrMode = "Relative";
} }
longDesc = "If the carry flag (C) is set, jump to the location specified.";
break; break;
// BEQ - Branch if Equal // BEQ - Branch if Equal
case 0xF0: case 0xF0:
title = "BCC - Branch if Equal"; title = "BEQ - Branch if Equal";
if ( opcode[0] == 0xF0 ) if ( opcode[0] == 0xF0 )
{ {
addrMode = "Relative"; addrMode = "Relative";
} }
longDesc = "If the zero flag (Z) is set, jump to the location specified.";
break; break;
// BIT - Bit Test // BIT - Bit Test
case 0x24: case 0x24:
@ -529,66 +541,71 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
case 0x30: case 0x30:
title = "BMI - Branch if Minus"; title = "BMI - Branch if Minus";
if ( opcode[0] == 0x30 )
{
addrMode = "Relative"; addrMode = "Relative";
}
longDesc = "If the negative flag (N) is set, jump to the location specified.";
break; break;
// BNE - Branch if Not Equal // BNE - Branch if Not Equal
case 0xD0: case 0xD0:
title = "BNE - Branch if Not Equal"; title = "BNE - Branch if Not Equal";
if ( opcode[0] == 0xD0 )
{
addrMode = "Relative"; addrMode = "Relative";
}
longDesc = "If the zero flag (Z) is clear, jump to the location specified.";
break; break;
// BPL - Branch if Positive // BPL - Branch if Positive
case 0x10: case 0x10:
title = "BPL - Branch if Positive"; title = "BPL - Branch if Positive";
if ( opcode[0] == 0x10 )
{
addrMode = "Relative"; addrMode = "Relative";
}
longDesc = "If the negative flag (N) is clear, jump to the location specified.";
break; break;
// BRK - Force Interrupt // BRK - Force Interrupt
case 0x00: case 0x00:
title = "BRK - Force Interrupt"; title = "BRK - Force Interrupt";
longDesc = "The BRK instruction causes the CPU to jump to its IRQ vector, as if an interrupt had occurred. The PC and status flags are pushed on the stack.";
break; break;
// BVC - Branch if Overflow Clear // BVC - Branch if Overflow Clear
case 0x50: case 0x50:
title = "BVC - Branch if Overflow Clear"; title = "BVC - Branch if Overflow Clear";
if ( opcode[0] == 0x50 )
{
addrMode = "Relative"; addrMode = "Relative";
}
longDesc = "If the overflow flag (V) is clear, jump to the location specified.";
break; break;
// BVS - Branch if Overflow Set // BVS - Branch if Overflow Set
case 0x70: case 0x70:
title = "BVS - Branch if Overflow Set"; title = "BVS - Branch if Overflow Set";
if ( opcode[0] == 0x70 )
{
addrMode = "Relative"; addrMode = "Relative";
}
longDesc = "If the overflow flag (V) is set then, jump to the location specified.";
break; break;
// CLC - Clear Carry Flag // CLC - Clear Carry Flag
case 0x18: case 0x18:
title = "CLC - Clear Carry Flag"; title = "CLC - Clear Carry Flag";
longDesc = "Clears the carry flag (C).";
break; break;
// CLD - Clear Decimal Mode // CLD - Clear Decimal Mode
case 0xD8: case 0xD8:
title = "CLD - Clear Decimal Mode"; title = "CLD - Clear Decimal Mode";
longDesc = "Clears the decimal mode flag (D).";
break; break;
// CLI - Clear Interrupt Disable // CLI - Clear Interrupt Disable
case 0x58: case 0x58:
title = "CLI - Clear Interrupt Disable"; title = "CLI - Clear Interrupt Disable";
longDesc = "Clears the interrupt disable flag (I).";
break; break;
// CLV - Clear Overflow Flag // CLV - Clear Overflow Flag
case 0xB8: case 0xB8:
title = "CLV - Clear Overflow Flag"; title = "CLV - Clear Overflow Flag";
longDesc = "Clears the overflow flag (V).";
break; break;
// CMP - Compare // CMP - Compare
case 0xC9: case 0xC9:
@ -605,6 +622,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Compares the accumulator with the byte at the specified memory address..";
break; break;
// CPX - Compare X Register // CPX - Compare X Register
case 0xE0: case 0xE0:
@ -616,6 +635,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Compares the X register with the byte at the specified memory address.";
break; break;
// CPY - Compare Y Register // CPY - Compare Y Register
case 0xC0: case 0xC0:
@ -627,6 +648,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Compares the Y register with the byte at the specified memory address.";
break; break;
// DEC - Decrement Memory // DEC - Decrement Memory
case 0xC6: case 0xC6:
@ -634,14 +657,20 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
case 0xCE: case 0xCE:
case 0xDE: case 0xDE:
title = "DEC - Decrement Memory"; title = "DEC - Decrement Memory";
longDesc = "Subtracts one from the byte at the specified memory address.";
break; break;
// DEX - Decrement X Register // DEX - Decrement X Register
case 0xCA: case 0xCA:
title = "DEX - Decrement X Register"; title = "DEX - Decrement X Register";
longDesc = "Subtracts one from the X register.";
break; break;
// DEY - Decrement Y Register // DEY - Decrement Y Register
case 0x88: case 0x88:
title = "DEY - Decrement Y Register"; title = "DEY - Decrement Y Register";
longDesc = "Subtracts one from the Y register.";
break; break;
// EOR - Exclusive OR // EOR - Exclusive OR
case 0x49: case 0x49:
@ -658,6 +687,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Performs an exclusive OR operation between the accumulator and the byte at the specified memory address.";
break; break;
// INC - Increment Memory // INC - Increment Memory
case 0xE6: case 0xE6:
@ -665,23 +696,33 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
case 0xEE: case 0xEE:
case 0xFE: case 0xFE:
title = "INC - Decrement Memory"; title = "INC - Decrement Memory";
longDesc = "Adds one to the the byte at the specified memory address.";
break; break;
// INX - Increment X Register // INX - Increment X Register
case 0xE8: case 0xE8:
title = "INX - Increment X Register"; title = "INX - Increment X Register";
longDesc = "Adds one to the X register.";
break; break;
// INY - Increment Y Register // INY - Increment Y Register
case 0xC8: case 0xC8:
title = "INY - Increment Y Register"; title = "INY - Increment Y Register";
longDesc = "Adds one to the Y register.";
break; break;
// JMP - Jump // JMP - Jump
case 0x4C: case 0x4C:
case 0x6C: case 0x6C:
title = "JMP - Jump"; title = "JMP - Jump";
longDesc = "Jumps to the specified location (alters the program counter)";
break; break;
// JSR - Jump to Subroutine // JSR - Jump to Subroutine
case 0x20: case 0x20:
title = "JSR - Jump to Subroutine"; title = "JSR - Jump to Subroutine";
longDesc = "Pushes the address (minus one) of the next instruction to the stack and then jumps to the target address.";
break; break;
// LDA - Load Accumulator // LDA - Load Accumulator
case 0xA9: case 0xA9:
@ -698,6 +739,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Loads a byte from the specified memory address into the accumulator.";
break; break;
// LDX - Load X Register // LDX - Load X Register
case 0xA2: case 0xA2:
@ -711,6 +754,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Loads a byte from the specified memory address into the X register.";
break; break;
// LDY - Load Y Register // LDY - Load Y Register
case 0xA0: case 0xA0:
@ -724,6 +769,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Loads a byte from the specified memory address into the Y register.";
break; break;
// LSR - Logical Shift Right // LSR - Logical Shift Right
case 0x4A: case 0x4A:
@ -742,6 +789,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
// NOP - No Operation // NOP - No Operation
case 0xEA: case 0xEA:
title = "NOP - No Operation"; title = "NOP - No Operation";
longDesc = "Performs no operation other than delaying execution of the next instruction by 2 cycles.";
break; break;
// ORA - Logical Inclusive OR // ORA - Logical Inclusive OR
case 0x09: case 0x09:
@ -758,22 +807,32 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Performs an inclusive OR operation between the accumulator and the byte at the specified memory address.";
break; break;
// PHA - Push Accumulator // PHA - Push Accumulator
case 0x48: case 0x48:
title = "PHA - Push Accumulator"; title = "PHA - Push Accumulator";
longDesc = "Pushes the value of the accumulator to the stack.";
break; break;
// PHP - Push Processor Status // PHP - Push Processor Status
case 0x08: case 0x08:
title = "PHP - Push Processor Status"; title = "PHP - Push Processor Status";
longDesc = "Pushes the value of the status flags to the stack.";
break; break;
// PLA - Pull Accumulator // PLA - Pull Accumulator
case 0x68: case 0x68:
title = "PLA - Pull Accumulator"; title = "PLA - Pull Accumulator";
longDesc = "Pulls a byte from the stack and stores it into the accumulator.";
break; break;
// PLP - Pull Processor Status // PLP - Pull Processor Status
case 0x28: case 0x28:
title = "PLP - Pull Processor Status"; title = "PLP - Pull Processor Status";
longDesc = "Pulls a byte from the stack and stores it into the processor flags. The flags will be modified based on the value pulled.";
break; break;
// ROL - Rotate Left // ROL - Rotate Left
case 0x2A: case 0x2A:
@ -787,6 +846,8 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Accumulator"; addrMode = "Accumulator";
} }
longDesc = "Shifts all bits 1 position to the left. The right-most bit takes the current value of the carry flag (C). The left-most bit is stored into the carry flag (C).";
break; break;
// ROR - Rotate Right // ROR - Rotate Right
case 0x6A: case 0x6A:
@ -800,14 +861,20 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Accumulator"; addrMode = "Accumulator";
} }
longDesc = "Shifts all bits 1 position to the right. The left-most bit takes the current value of the carry flag (C). The right-most bit is stored into the carry flag (C).";
break; break;
// RTI - Return from Interrupt // RTI - Return from Interrupt
case 0x40: case 0x40:
title = "RTI - Return from Interrupt"; title = "RTI - Return from Interrupt";
longDesc = "The RTI instruction is used at the end of the interrupt handler to return execution to its original location. It pulls the status flags and program counter from the stack.";
break; break;
// RTS - Return from Subroutine // RTS - Return from Subroutine
case 0x60: case 0x60:
title = "RTS - Return from Subroutine"; title = "RTS - Return from Subroutine";
longDesc = "The RTS instruction is used at the end of a subroutine to return execution to the calling function. It pulls the status flags and program counter (minus 1) from the stack.";
break; break;
// SBC - Subtract with Carry // SBC - Subtract with Carry
case 0xE9: case 0xE9:
@ -824,18 +891,26 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
{ {
addrMode = "Immediate"; addrMode = "Immediate";
} }
longDesc = "Substracts the byte at the specified memory address from the value of the accumulator (affected by the carry flag (C)).";
break; break;
// SEC - Set Carry Flag // SEC - Set Carry Flag
case 0x38: case 0x38:
title = "SEC - Set Carry Flag"; title = "SEC - Set Carry Flag";
longDesc = "Sets the carry flag (C).";
break; break;
// SED - Set Decimal Flag // SED - Set Decimal Flag
case 0xF8: case 0xF8:
title = "SED - Set Decimal Flag"; title = "SED - Set Decimal Flag";
longDesc = "Sets the decimal mode flag (D).";
break; break;
// SEI - Set Interrupt Disable // SEI - Set Interrupt Disable
case 0x78: case 0x78:
title = "SEI - Set Interrupt Disable"; title = "SEI - Set Interrupt Disable";
longDesc = "Sets the interrupt disable flag (I).";
break; break;
// STA - Store Accumulator // STA - Store Accumulator
case 0x85: case 0x85:
@ -854,39 +929,52 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
case 0x96: case 0x96:
case 0x8E: case 0x8E:
title = "STX - Store X Register"; title = "STX - Store X Register";
longDesc = "Stores the value of the X register into memory.";
break; break;
// STY - Store Y Register // STY - Store Y Register
case 0x84: case 0x84:
case 0x94: case 0x94:
case 0x8C: case 0x8C:
title = "STY - Store Y Register"; title = "STY - Store Y Register";
longDesc = "Stores the value of the Y register into memory.";
break; break;
// TAX - Transfer Accumulator to X Register // TAX - Transfer Accumulator to X Register
case 0xAA: case 0xAA:
title = "TAX - Transfer Accumulator to X Register"; title = "TAX - Transfer Accumulator to X Register";
longDesc = "Copies the current contents of the accumulator into the X register" longDesc = "Copies the accumulator into the X register.";
"and sets the zero and negative flags as appropriate.";
break; break;
// TAY - Transfer Accumulator to Y Register // TAY - Transfer Accumulator to Y Register
case 0xA8: case 0xA8:
title = "TAY - Transfer Accumulator to Y Register"; title = "TAY - Transfer Accumulator to Y Register";
longDesc = "Copies the accumulator into the Y register.";
break; break;
// TSX - Transfer Stack Pointer to X Register // TSX - Transfer Stack Pointer to X Register
case 0xBA: case 0xBA:
title = "TSX - Transfer Stack Pointer to X Register"; title = "TSX - Transfer Stack Pointer to X Register";
longDesc = "Copies the stack pointer into the X register.";
break; break;
// TXA - Transfer X Register to Accumulator // TXA - Transfer X Register to Accumulator
case 0x8A: case 0x8A:
title = "TXA - Transfer X Register to Accumulator"; title = "TXA - Transfer X Register to Accumulator";
longDesc = "Copies the X register into the accumulator.";
break; break;
// TXS - Transfer X Register to Stack Pointer // TXS - Transfer X Register to Stack Pointer
case 0x9A: case 0x9A:
title = "TXS - Transfer X Register to Stack Pointer"; title = "TXS - Transfer X Register to Stack Pointer";
longDesc = "Copies the X register into the stack pointer.";
break; break;
// TYA - Transfer Y Register to Accumulator // TYA - Transfer Y Register to Accumulator
case 0x98: case 0x98:
title = "TYA - Transfer Y Register to Accumulator"; title = "TYA - Transfer Y Register to Accumulator";
longDesc = "Copies the Y register into the accumulator.";
break; break;
default: default:
title = "Undefined"; title = "Undefined";