]> Shamusworld >> Repos - stargem2/blobdiff - src/dis6809.cpp
Converted to SDL 2, added fullscreen support (F12 to toggle).
[stargem2] / src / dis6809.cpp
index dbeeedab774006091318b3ac7fc95131433f5d5f..5f42c5c102567d0467960b31493ffa9958ed519d 100755 (executable)
@@ -191,7 +191,7 @@ iregs[4][2] = {"X", "Y", "U", "S" };
 //
 // 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];
 
@@ -201,7 +201,7 @@ static void DisplayBytes(uint16 src, uint32 dst)
        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);
@@ -213,15 +213,15 @@ static void DisplayBytes(uint16 src, uint32 dst)
 //
 // 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?
@@ -254,13 +254,13 @@ int Decode6809(uint16 pc)
        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;
@@ -289,9 +289,9 @@ int Decode6809(uint16 pc)
        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