//
// Display bytes in mem in hex
//
-static void DisplayBytes(uint16 src, uint32 dst)
+static void DisplayBytes(uint16_t src, uint32_t dst)
{
char buf[20], buf2[20];
if (src > dst)
dst += 0x10000; // That should fix the FFFF bug...
- for(uint32 i=src; i<dst; i++)
+ for(uint32_t i=src; i<dst; i++)
{
sprintf(buf2, "%02X ", mainCPU.RdMem(i));
strcat(buf, buf2);
//
// Decode a 6809 instruction at 'addr'
//
-int Decode6809(uint16 pc)
+int Decode6809(uint16_t pc)
{
char outbuf[80], mnem[6], tmp[30];
- uint8 opcode2, operand;
+ uint8_t opcode2, operand;
- uint16 addr = pc, offset;
+ uint16_t addr = pc, offset;
- uint8 opcode = mainCPU.RdMem(addr++); // Get the opcode
- uint8 admode = op_mat1[opcode]; // addressing mode
+ uint8_t opcode = mainCPU.RdMem(addr++); // Get the opcode
+ uint8_t admode = op_mat1[opcode]; // addressing mode
strcpy(mnem, mnemonics[opcode]); // Copy page 1 opcode
if (opcode == 0x10) // Extended opcode?
case 3: // Relative
//DISNOWOK--FIX
// sprintf(outbuf, "%s $%04X", mnem, ++addr + (int16)((int8)mainCPU.RdMem(addr)));
- offset = addr + 1 + (int16)(int8)mainCPU.RdMem(addr);
+ offset = addr + 1 + (int16_t)(int8_t)mainCPU.RdMem(addr);
addr++;
sprintf(outbuf, "%s $%04X", mnem, offset);
break;
case 4: // Long Relative
// sprintf(outbuf, "%s $%04X", mnem, addr + (int16)((mainCPU.RdMem(addr++) << 8) | mainCPU.RdMem(addr++)) + 2);
- offset = addr + (int16)((mainCPU.RdMem(addr) << 8) | mainCPU.RdMem(addr + 1)) + 2;
+ offset = addr + (int16_t)((mainCPU.RdMem(addr) << 8) | mainCPU.RdMem(addr + 1)) + 2;
addr += 2;
sprintf(outbuf, "%s $%04X", mnem, offset);
break;
case 7: // Indexed (the tough one!)
{
operand = mainCPU.RdMem(addr++); // Get IDX byte
- uint8 reg = ((operand & 0x60) >> 5), idxind = ((operand & 0x10) >> 4),
+ uint8_t reg = ((operand & 0x60) >> 5), idxind = ((operand & 0x10) >> 4),
lo_nyb = (operand & 0x0F), boff;
- uint16 woff;
+ uint16_t woff;
strcpy(tmp, "??");
if (!(operand & 0x80)) // Hi bit set? Then decode 4 bit offset