O2Hawk; Start cleaning up bugs

This commit is contained in:
alyosha-tas 2019-11-18 18:36:51 -05:00
parent 61038a13ae
commit 8b2150dbd3
5 changed files with 59 additions and 53 deletions

View File

@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"???", // 01
"OUT BUS,A", // 02
"ADD A,i8", // 03
"JP R0", // 04
"JP 2K 0,i8", // 04
"EI", // 05
"???", // 06
"DEC A", // 07
@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"INC @R1", // 11
"JPB 0", // 12
"ADC A,i8", // 13
"CALL @R0", // 14
"CALL 0,i8", // 14
"DI", // 15
"JP TF", // 16
"INC A", // 17
@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"XCH A,@R1", // 21
"???", // 22
"MOV A,i8", // 23
"JP R1", // 24
"JP 2K 1,i8", // 24
"EN", // 25
"JP !T0", // 26
"CLR A", // 27
@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"XCHD A,@R1", // 31
"JPB 1", // 32
"???", // 33
"CALL 1", // 34
"CALL 1,i8", // 34
"DN", // 35
"JP T0", // 36
"COM A", // 37
@ -76,7 +76,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"OR A,@R1", // 41
"MOV A,TIM", // 42
"OR A,i8", // 43
"JP 2K 2", // 44
"JP 2K 2,i8", // 44
"START CNT", // 45
"JP NT1", // 46
"SWP", // 47
@ -92,7 +92,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"AND A,@R1", // 51
"JPB 2", // 52
"AND A,i8", // 53
"CALL 2", // 54
"CALL 2,i8", // 54
"START TIM", // 55
"JP T1", // 56
"DAA", // 57
@ -108,7 +108,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"ADD A,@R1", // 61
"MOV TIM,A", // 62
"???", // 63
"JP 2K 3", // 64
"JP 2K 3,i8", // 64
"STOP CNT", // 65
"???", // 66
"RRC", // 67
@ -124,7 +124,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"ADC A,@R1", // 71
"JPB 3", // 72
"???", // 73
"CALL 3", // 74
"CALL 3,i8", // 74
"ENT0 CLK", // 75
"JP F1", // 76
"ROR", // 77
@ -140,7 +140,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"MOVX A,@R1", // 81
"???", // 82
"RET", // 83
"JP 2K 4", // 84
"JP 2K 4,i8", // 84
"CLR F0", // 85
"JP !IRQ", // 86
"???", // 87
@ -156,7 +156,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"MOVX @R1,A", // 91
"JPB 4", // 92
"RETR", // 93
"CALL 4", // 94
"CALL 4,i8", // 94
"COM F0", // 95
"JP A!=0", // 96
"CLR C", // 97
@ -172,7 +172,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"MOV @R1,A", // a1
"???", // a2
"MOV A,@A", // a3
"JP 2K 5", // a4
"JP 2K 5,i8", // a4
"CLR F1", // a5
"???", // a6
"COM C", // a7
@ -188,7 +188,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"???", // b1
"JPB 5", // b2
"JPP A", // b3
"CALL 5", // b4
"CALL 5,i8", // b4
"COM F1", // b5
"JP F0", // b6
"???", // b7
@ -204,7 +204,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"???", // c1
"???", // c2
"???", // c3
"JP 2K 6", // c4
"JP 2K 6,i8", // c4
"SEL RB 0", // c5
"JP A==0", // c6
"MOV A,PSW", // c7
@ -220,7 +220,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
"XOR A,@R1", // d1
"JPB 6", // d2
"XOR A,i8", // d3
"CALL 6", // d4
"CALL 6,i8", // d4
"SEL RB 1", // d5
"???", // d6
"MOV PSW,A", // d7
@ -236,23 +236,23 @@ namespace BizHawk.Emulation.Common.Components.I8048
"???", // e1
"???", // e2
"MOV3 A,@A", // e3
"JP 2K 7", // e4
"JP 2K 7,i8", // e4
"SEL MB 0", // e5
"JP NC", // e6
"ROL", // e7
"DJNZ R0", // e8
"DJNZ R1", // e9
"DJNZ R2", // ea
"DJNZ R3", // eb
"DJNZ R4", // ec
"DJNZ R5", // ed
"DJNZ R6", // ee
"DJNZ R7", // ef
"DJNZ R0,i8", // e8
"DJNZ R1,i8", // e9
"DJNZ R2,i8", // ea
"DJNZ R3,i8", // eb
"DJNZ R4,i8", // ec
"DJNZ R5,i8", // ed
"DJNZ R6,i8", // ee
"DJNZ R7,i8", // ef
"MOV A,@R0", // f0
"MOV A,@R1", // f1
"JPB 7", // f2
"???", // f3
"CALL 7", // f4
"CALL 7,i8", // f4
"SEL MB 1", // f5
"JP C", // f6
"RLC", // f7

View File

@ -191,14 +191,14 @@ namespace BizHawk.Emulation.Common.Components.I8048
case 0xA5: OP_IMP(CL1); break; // CLR F1
case 0xA6: ILLEGAL(); break; // ILLEGAL
case 0xA7: OP_IMP(CMC); break; // COM C
case 0xA8: OP_A_R(MOVT, R0); break; // MOV R0,A
case 0xA9: OP_A_R(MOVT, R1); break; // MOV R1,A
case 0xAA: OP_A_R(MOVT, R2); break; // MOV R2,A
case 0xAB: OP_A_R(MOVT, R3); break; // MOV R3,A
case 0xAC: OP_A_R(MOVT, R4); break; // MOV R4,A
case 0xAD: OP_A_R(MOVT, R5); break; // MOV R5,A
case 0xAE: OP_A_R(MOVT, R6); break; // MOV R6,A
case 0xAF: OP_A_R(MOVT, R7); break; // MOV R7,A
case 0xA8: OP_R_IMP(MOVAR, R0); break; // MOV R0,A
case 0xA9: OP_R_IMP(MOVAR, R1); break; // MOV R1,A
case 0xAA: OP_R_IMP(MOVAR, R2); break; // MOV R2,A
case 0xAB: OP_R_IMP(MOVAR, R3); break; // MOV R3,A
case 0xAC: OP_R_IMP(MOVAR, R4); break; // MOV R4,A
case 0xAD: OP_R_IMP(MOVAR, R5); break; // MOV R5,A
case 0xAE: OP_R_IMP(MOVAR, R6); break; // MOV R6,A
case 0xAF: OP_R_IMP(MOVAR, R7); break; // MOV R7,A
case 0xB0: ILLEGAL(); break; // ILLEGAL
case 0xB1: ILLEGAL(); break; // ILLEGAL
case 0xB2: JPB(5); break; // JPB 5

View File

@ -73,15 +73,16 @@ namespace BizHawk.Emulation.Common.Components.I8048
public const ushort RES_TF = 63;
public const ushort MOV = 64;
public const ushort MOVT = 65;
public const ushort MOVT_RAM = 66;
public const ushort ST_CNT = 67;
public const ushort STP_CNT = 68;
public const ushort ST_T = 69;
public const ushort SET_ADDR_8 = 70;
public const ushort MEM_ALU = 71;
public const ushort PUSH = 72;
public const ushort PULL = 73;
public const ushort PULL_PC = 74;
public const ushort MOVAR = 66;
public const ushort MOVT_RAM = 67;
public const ushort ST_CNT = 68;
public const ushort STP_CNT = 69;
public const ushort ST_T = 70;
public const ushort SET_ADDR_8 = 71;
public const ushort MEM_ALU = 72;
public const ushort PUSH = 73;
public const ushort PULL = 74;
public const ushort PULL_PC = 75;
public I8048()
{
@ -331,10 +332,15 @@ namespace BizHawk.Emulation.Common.Components.I8048
break;
case MOV:
Regs[cur_instr[instr_pntr++]] = Regs[cur_instr[instr_pntr++]];
reg_d_ad = cur_instr[instr_pntr++];
Regs[reg_d_ad] = Regs[cur_instr[instr_pntr++]];
break;
case MOVT:
reg_d_ad = cur_instr[instr_pntr++];
Regs[reg_d_ad] = Regs[cur_instr[instr_pntr++]];
break;
case MOVAR:
Regs[cur_instr[instr_pntr++]] = Regs[A];
break;
case MOVT_RAM:

View File

@ -263,7 +263,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
IDLE,
IDLE,
IDLE,
oper, reg, ALU);
oper, (ushort)(reg + RB), ALU);
IRQS = 9;
}
@ -317,13 +317,13 @@ namespace BizHawk.Emulation.Common.Components.I8048
public void DJNZ(ushort reg)
{
if ((Regs[reg] - 1) == 0)
if ((Regs[reg + RB] - 1) == 0)
{
PopulateCURINSTR(IDLE,
IDLE,
IDLE,
IDLE,
IDLE,
DEC8, (ushort)(reg + RB),
RD, ALU, PC,
INC11, PC,
IDLE,
IDLE,
IDLE,
@ -333,13 +333,13 @@ namespace BizHawk.Emulation.Common.Components.I8048
{
PopulateCURINSTR(IDLE,
IDLE,
DEC8, (ushort)(reg + RB),
RD, ALU, PC,
INC11, PC,
IDLE,
IDLE,
IDLE,
IDLE,
IDLE,
IDLE,
IDLE);
SET_ADDR_8, PC, ALU);
}
IRQS = 9;

View File

@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
public void do_frame(IController controller)
{
for (int i = 0; i < 100; i++)
for (int i = 0; i < 10000; i++)
{
audio.tick();
ppu.tick();