From 1c58629b5fa5b89dd3982991efa15decde7dc823 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Thu, 13 Aug 2009 13:55:41 +0000 Subject: [PATCH] Added missing files... D'oh! --- src/dis6809.cpp | 393 ++++++++++++++++++++++++++++++++++++++++++++++++ src/dis6809.h | 17 +++ src/thunder.cpp | 57 ++++--- 3 files changed, 436 insertions(+), 31 deletions(-) create mode 100755 src/dis6809.cpp create mode 100755 src/dis6809.h diff --git a/src/dis6809.cpp b/src/dis6809.cpp new file mode 100755 index 0000000..d598e2c --- /dev/null +++ b/src/dis6809.cpp @@ -0,0 +1,393 @@ +// +// 6809 disassembler +// +// by James L. Hammons +// +// (c) 2004 Underground Software +// + +#include "dis6809.h" + +#include +#include +//#include "v6809.h" +#include "log.h" + +using namespace std; + +// External shit + +//NO MORE!!! extern V6809REGS mainCPU;//Hm. + +static char op_mat1[256] = { + 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 0, 0, 5, 5, 0, 0, 4, 4, 0, 5, 8, 0, 8, 5, 6, 6, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 7, 7, 7, 7, 6, 6, 6, 6, 0, 5, 5, 5, 8, 5, 5, 5, + 5, 0, 0, 5, 5, 0, 5, 5, 5, 5, 5, 0, 5, 5, 0, 5, + 5, 0, 0, 5, 5, 0, 5, 5, 5, 5, 5, 0, 5, 5, 0, 5, + 7, 0, 0, 7, 7, 0, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, + 2, 0, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, + 8, 8, 8, 9, 8, 8, 8, 0, 8, 8, 8, 8, 9, 3, 9, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 8, 8, 8, 9, 8, 8, 8, 0, 8, 8, 8, 8, 9, 0, 9, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}, + +op_mat2[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 9, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, + 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 7, + 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2 +}, + +op_mat3[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static char mnemonics[256][6] = { + "NEG ","??? ","??? ","COM ","LSR ","??? ","ROR ","ASR ", + "LSL ","ROL ","DEC ","??? ","INC ","TST ","JMP ","CLR ", + "PAGE1","PAGE2","NOP ","SYNC ","??? ","??? ","LBRA ","LBSR ", + "??? ","DAA ","ORCC ","??? ","ANDCC","SEX ","EXG ","TFR ", + "BRA ","BRN ","BHI ","BLS ","BHS ","BLO ","BNE ","BEQ ", + "BVC ","BVS ","BPL ","BMI ","BGE ","BLT ","BGT ","BLE ", + "LEAX ","LEAY ","LEAS ","LEAU ","PSHS ","PULS ","PSHU ","PULU ", + "??? ","RTS ","ABX ","RTI ","CWAI ","MUL ","RESET","SWI ", + "NEGA ","??? ","??? ","COMA ","LSRA ","??? ","RORA ","ASRA ", + "LSLA ","ROLA ","DECA ","??? ","INCA ","TSTA ","??? ","CLRA ", + "NEGB ","??? ","??? ","COMB ","LSRB ","??? ","RORB ","ASRB ", + "LSLB ","ROLB ","DECB ","??? ","INCB ","TSTB ","??? ","CLRB ", + "NEG ","??? ","??? ","COM ","LSR ","??? ","ROR ","ASR ", + "LSL ","ROL ","DEC ","??? ","INC ","TST ","JMP ","CLR ", + "NEG ","??? ","??? ","COM ","LSR ","??? ","ROR ","ASR ", + "LSL ","ROL ","DEC ","??? ","INC ","TST ","JMP ","CLR ", + "SUBA ","CMPA ","SCBA ","SUBD ","ANDA ","BITA ","LDA ","??? ", + "EORA ","ADCA ","ORA ","ADDA ","CMPX ","BSR ","LDX ","??? ", + "SUBA ","CMPA ","SBCA ","SUBD ","ANDA ","BITA ","LDA ","STA ", + "EORA ","ADCA ","ORA ","ADDA ","CMPX ","JSR ","LDX ","STX ", + "SUBA ","CMPA ","SBCA ","SUBD ","ANDA ","BITA ","LDA ","STA ", + "EORA ","ADCA ","ORA ","ADDA ","CMPX ","JSR ","LDX ","STX ", + "SUBA ","CMPA ","SBCA ","SUBD ","ANDA ","BITA ","LDA ","STA ", + "EORA ","ADCA ","ORA ","ADDA ","CMPX ","JSR ","LDX ","STX ", + "SUBB ","CMPB ","SCBB ","ADDD ","ANDB ","BITB ","LDB ","??? ", + "EORB ","ADCB ","ORB ","ADDB ","LDD ","??? ","LDU ","??? ", + "SUBB ","CMPB ","SBCB ","ADDD ","ANDB ","BITB ","LDB ","STB ", + "EORB ","ADCB ","ORB ","ADDB ","LDD ","STD ","LDU ","STU ", + "SUBB ","CMPB ","SBCB ","ADDD ","ANDB ","BITB ","LDB ","STB ", + "EORB ","ADCB ","ORB ","ADDB ","LDD ","STD ","LDU ","STU ", + "SUBB ","CMPB ","SBCB ","ADDD ","ANDB ","BITB ","LDB ","STB ", + "EORB ","ADCB ","ORB ","ADDB ","LDD ","STD ","LDU ","STU " +}, + +mnemonics2[256][6] = { + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","LBRN ","LBHI ","LBLS ","LBHS ","LBLO ","LBNE ","LBEQ ", + "LBVC ","LBVS ","LBPL ","LBMI ","LBGE ","LBLT ","LBGT ","LBLE ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","SWI2 ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","CMPD ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","CMPY ","??? ","LDY ","??? ", + "??? ","??? ","??? ","CMPD ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","CMPY ","??? ","LDY ","STY ", + "??? ","??? ","??? ","CMPD ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","CMPY ","??? ","LDY ","STY ", + "??? ","??? ","??? ","CMPD ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","CMPY ","??? ","LDY ","STY ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","LDS ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","LDS ","STS ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","LDS ","STS ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","LDS ","STS " +}, + +mnemonics3[256][6] = { + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","SWI3 ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","CMPU ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","CMPS ","??? ","??? ","??? ", + "??? ","??? ","??? ","CMPU ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","CMPS ","??? ","??? ","??? ", + "??? ","??? ","??? ","CMPU ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","CMPS ","??? ","??? ","??? ", + "??? ","??? ","??? ","CMPU ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","CMPS ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? ", + "??? ","??? ","??? ","??? ","??? ","??? ","??? ","??? " +}, + +tregs[16][3] = { + "D", "X", "Y", "U", "S", "PC", "??", "??", + "A", "B", "CC", "DP", "??", "??", "??", "??" +}, + +iregs[4][2] = {"X", "Y", "U", "S" }; + +// +// Display bytes in mem in hex +// +static void DisplayBytes(V6809REGS regs, uint16 src, uint32 dst) +{ + WriteLog("%04X: ", src); + uint8 cnt = 0; // Init counter... + + if (src > dst) + dst += 0x10000; // That should fix the FFFF bug... + + for(uint32 i=src; i> 4], tregs[operand & 0x0F]); + else + { + tmp[0] = 0; + if (operand & 0x01) strcat(tmp, "CC "); + if (operand & 0x02) strcat(tmp, "A "); + if (operand & 0x04) strcat(tmp, "B "); + if (operand & 0x08) strcat(tmp, "DP "); + if (operand & 0x10) strcat(tmp, "X "); + if (operand & 0x20) strcat(tmp, "Y "); + if (operand & 0x40) (((opcode == 0x34) || (opcode == 0x35)) ? strcat(tmp, "U ") : strcat(tmp, "S ")); + if (operand & 0x80) strcat(tmp, "PC"); + } + + sprintf(outbuf, "%s %s", mnem, tmp); + break; + case 7: // Indexed (the tough one!) + { + operand = regs.RdMem(addr++); // Get IDX byte + uint8 reg = ((operand & 0x60) >> 5), idxind = ((operand & 0x10) >> 4), + lo_nyb = (operand & 0x0F), boff; + uint16 woff; + + strcpy(tmp, "??"); + if (!(operand & 0x80)) // Hi bit set? Then decode 4 bit offset + sprintf(tmp, "(%d),%s", (idxind ? -(16-lo_nyb) : lo_nyb), iregs[reg]); + else // Add the ($nnnn,R) code dude... + { + if (idxind) + { + switch(lo_nyb) + { + case 1: sprintf(tmp, "(,%s++)", iregs[reg]); break; + case 3: sprintf(tmp, "(,--%s)", iregs[reg]); break; + case 4: sprintf(tmp, "(,%s)", iregs[reg]); break; + case 5: sprintf(tmp, "(B,%s)", iregs[reg]); break; + case 6: sprintf(tmp, "(A,%s)", iregs[reg]); break; + case 8: + boff = regs.RdMem(addr++); + sprintf(tmp, "($%02X,%s)", boff, iregs[reg]); + break; + case 9: + woff = (regs.RdMem(addr) << 8) | regs.RdMem(addr + 1); + addr += 2; + sprintf(tmp, "($%04X,%s)", woff, iregs[reg]); + break; + case 11: sprintf(tmp, "(D,%s)", iregs[reg]); break; + case 12: + boff = regs.RdMem(addr++); + sprintf(tmp, "($%02X,PC)", boff); + break; + case 13: + woff = (regs.RdMem(addr) << 8) | regs.RdMem(addr + 1); + addr += 2; + sprintf(tmp, "($%04X,PC)", woff); + break; + case 15: + woff = (regs.RdMem(addr) << 8) | regs.RdMem(addr + 1); + addr += 2; + sprintf(tmp, "[$%04X]", woff); + break; + default: + strcpy(tmp, "??"); + } + } + else + { + switch(lo_nyb) + { + case 0: sprintf(tmp, ",%s+", iregs[reg]); break; + case 1: sprintf(tmp, ",%s++", iregs[reg]); break; + case 2: sprintf(tmp, ",-%s", iregs[reg]); break; + case 3: sprintf(tmp, ",--%s", iregs[reg]); break; + case 4: sprintf(tmp, ",%s", iregs[reg]); break; + case 5: sprintf(tmp, "(B),%s", iregs[reg]); break; + case 6: sprintf(tmp, "(A),%s", iregs[reg]); break; + case 8: + boff = regs.RdMem(addr++); + sprintf(tmp, "($%02X),%s", boff, iregs[reg]); + break; + case 9: + woff = (regs.RdMem(addr) << 8) | regs.RdMem(addr + 1); + addr += 2; + sprintf(tmp, "($%04X),%s", woff, iregs[reg]); + break; + case 11: + sprintf(tmp, "(D),%s", iregs[reg]); + break; + case 12: + boff = regs.RdMem(addr++); + sprintf(tmp, "($%02X),PC", boff); + break; + case 13: + woff = (regs.RdMem(addr) << 8) | regs.RdMem(addr + 1); + addr += 2; + sprintf(tmp, "($%04X),PC", woff); + break; + default: + strcpy(tmp, "??"); + } + } + } + sprintf(outbuf, "%s %s", mnem, tmp); + break; + } + case 8: // Immediate + sprintf(outbuf, "%s #$%02X", mnem, regs.RdMem(addr++)); + break; + case 9: // Long Immediate +// sprintf(outbuf, "%s #$%04X", mnem, (regs.RdMem(addr++) << 8) | regs.RdMem(addr++)); + offset = (regs.RdMem(addr) << 8) | regs.RdMem(addr + 1); + addr += 2; + sprintf(outbuf, "%s #$%04X", mnem, offset); + break; + } + + DisplayBytes(regs, regs.pc, addr); // Show bytes + WriteLog("%s", outbuf); // Display opcode & addressing, etc. + + return addr - regs.pc; +} diff --git a/src/dis6809.h b/src/dis6809.h new file mode 100755 index 0000000..04d2e6c --- /dev/null +++ b/src/dis6809.h @@ -0,0 +1,17 @@ +// +// DIS6809.H +// +// by James L. Hammons +// (C) 2004 Underground Software +// + +#ifndef __DIS6809_H__ +#define __DIS6809_H__ + +//#include "types.h" +#include "v6809.h" + +//int Decode6809(uint16); +int Decode6809(V6809REGS); + +#endif // __DIS6809_H__ diff --git a/src/thunder.cpp b/src/thunder.cpp index 17ea566..8ee60f5 100755 --- a/src/thunder.cpp +++ b/src/thunder.cpp @@ -9,9 +9,10 @@ // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ // JLH 07/23/2009 Added changelog ;-) +// JLH 08/12/2009 Stabilized emulation so that it works // -#define THUNDER_VERSION "0.9.9" +#define THUNDER_VERSION "0.9.9" #include #include @@ -23,14 +24,14 @@ //#include // For getch() #include // For getch() #include -#include "SDL.h" // Get yer SDL out...! +#include "SDL.h" // Get yer SDL out...! #include "types.h" #include "v6809.h" #include "screen.h" #include "gui.h" #include "log.h" -using namespace std; // Yes! +using namespace std; // Yes! #if 0 #define ROM1 "RT3-1B.ROM" @@ -102,17 +103,17 @@ uint8 chr_rom[0x60000]; // Character ROM pointer V6809REGS cpu1, cpu2; -bool trace1 = false; // ditto... -bool looking_at_rom = true; // true = R1, false = R2 -uint32 banksw1, banksw2; // Bank switch addresses -uint16 game_over_switch; // Game over delay -uint16 dpc; // Debug pc reg... -bool show_scr = true; // Whether or not to show background -bool enable_cpu = true; // Whether or not to enable CPUs -bool irqGoA = true; // IRQ switch for CPU #1 -bool irqGoB = true; // IRQ switch for CPU #2 - -uint16 refresh_ = 0; // Crappy global screen stuff... +bool trace1 = false; // ditto... +bool looking_at_rom = true; // true = R1, false = R2 +uint32 banksw1, banksw2; // Bank switch addresses +uint16 game_over_switch; // Game over delay +uint16 dpc; // Debug pc reg... +bool show_scr = true; // Whether or not to show background +bool enable_cpu = true; // Whether or not to enable CPUs +bool irqGoA = true; // IRQ switch for CPU #1 +bool irqGoB = true; // IRQ switch for CPU #2 + +uint16 refresh_ = 0; // Crappy global screen stuff... bool refresh2 = true; uint32 psg_lens[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -124,7 +125,7 @@ uint32 fm_lens[14] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; uint8 * fm_adrs[14]; fstream tr; // Tracelog hook -uint16 pcx; // Where we at? +uint16 pcx; // Where we at? static uint8 * keys; // SDL raw keyboard matrix @@ -324,7 +325,7 @@ void WrMem(uint16 addr, uint8 b) //} tr << endl; }//*/ -#if 1 +#if 0 if (addr == 0x4182) { WriteLog("\nWriteMem: CPU #1 writing $%02X to $4182!\n\n", b); @@ -358,16 +359,13 @@ void WrMem(uint16 addr, uint8 b) BlitChar(screen, chr_rom, gram1); refresh_ = (refresh2 ? 1 : 0); // 60/30 Hz... } -//Seems they're more regular than this... -// irqGoA = true; // Will this work??? no... -// cpu1.cpuFlags |= V6809_ASSERT_LINE_IRQ;//wil wok??? + // IRQ Ack (may also be frame go... -// cpu1.cpuFlags &= ~V6809_ASSERT_LINE_IRQ; + ClearLineOfCurrentV6809(V6809_ASSERT_LINE_IRQ); #if 1 if (disasm) WriteLog("WriteMem: CPU #1 Acknowledging IRQ...\n", b); #endif - ClearLineOfCurrentV6809(V6809_ASSERT_LINE_IRQ); } } @@ -420,17 +418,13 @@ void WrMemB(uint16 addr, uint8 b) //} tr << endl; }//*/ -#if 1 +#if 0 if (addr == 0x0182) { WriteLog("\nWriteMem: CPU #2 writing $%02X to $0182 ($4182)!\n\n", b); } #endif -// Bah. Dunno if this is accurate or not! -// if (addr == 0x8800) -// irqGoB = true; // Will it work??? no... -// cpu2.cpuFlags |= V6809_ASSERT_LINE_IRQ;//wil wok??? if (addr == 0x6000) SpawnSound(GAMESOUND, gram1[0x6200], 0); // Do voice chan 1 if (addr == 0x6400) @@ -457,12 +451,11 @@ void WrMemB(uint16 addr, uint8 b) if (addr == 0x8800) { // IRQ Ack (may also be frame go...) -// cpu2.cpuFlags &= ~V6809_ASSERT_LINE_IRQ; + ClearLineOfCurrentV6809(V6809_ASSERT_LINE_IRQ); #if 1 if (disasm) WriteLog("WriteMem: CPU #2 Acknowledging IRQ...\n", b); #endif - ClearLineOfCurrentV6809(V6809_ASSERT_LINE_IRQ); } } @@ -893,7 +886,6 @@ void LoadPSGs(void) if (fp) { len = GetWAVLength(fp); // Get WAV data length... - psg_adrs[i] = new uint8[len]; // Attempt to allocate space... if (psg_adrs[i] != NULL) @@ -935,7 +927,6 @@ void LoadFMs(void) if (fp) { len = GetWAVLength(fp); // Get WAV length... - fm_adrs[i] = new uint8[len]; // Attempt to allocate space... if (fm_adrs[i] != NULL) @@ -1554,7 +1545,7 @@ WriteLog("About to enter main loop...\n"); // refresh_ = (refresh2 ? 1 : 0); // 60/30 Hz... // } -#if 1 +#if 0 //temp, for testing... BlitChar(screen, chr_rom, gram1); #endif @@ -1687,6 +1678,10 @@ BlitChar(screen, chr_rom, gram1); } #if 0 +Hitachi uC runs at 6.144 MHz +YM2151 runs at 3.579580 MHz + + Rolling Thunder Memory map -------------------------- Most of the decoding is done by custom chips (CUS47 and CUS41), so the memory -- 2.37.2