diff options
| author | StapleButter <thetotalworm@gmail.com> | 2018-12-18 01:56:21 +0100 | 
|---|---|---|
| committer | StapleButter <thetotalworm@gmail.com> | 2018-12-18 01:56:21 +0100 | 
| commit | 694d6cafa2a7fc63878bc17b2f2cee4ed6b945d5 (patch) | |
| tree | 38695af41dcc01e729976e666a467d6624a4d1f1 /src | |
| parent | 4a36193cabc86fbe07b6b5807e4441ffd72ed5c3 (diff) | |
fix STRD_POST (dumbest copypaste bug of the year)
fixes #276
Diffstat (limited to 'src')
| -rw-r--r-- | src/ARMInterpreter_LoadStore.cpp | 13 | ||||
| -rw-r--r-- | src/NDS.cpp | 6 | 
2 files changed, 10 insertions, 9 deletions
diff --git a/src/ARMInterpreter_LoadStore.cpp b/src/ARMInterpreter_LoadStore.cpp index 5a1b88d..be4084f 100644 --- a/src/ARMInterpreter_LoadStore.cpp +++ b/src/ARMInterpreter_LoadStore.cpp @@ -236,7 +236,7 @@ A_IMPLEMENT_WB_LDRSTR(LDRB)      offset += cpu->R[(cpu->CurInstr>>16) & 0xF]; \      if (cpu->CurInstr & (1<<21)) cpu->R[(cpu->CurInstr>>16) & 0xF] = offset; \      u32 r = (cpu->CurInstr>>12) & 0xF; \ -    if (r&1) { r--; printf("!! MISALIGNED LDRD_POST %d\n", r); } \ +    if (r&1) { r--; printf("!! MISALIGNED LDRD %d\n", r+1); } \      cpu->DataRead32 (offset  , &cpu->R[r  ]); \      cpu->DataRead32S(offset+4, &cpu->R[r+1]); \      cpu->AddCycles_CDI(); @@ -246,7 +246,7 @@ A_IMPLEMENT_WB_LDRSTR(LDRB)      u32 addr = cpu->R[(cpu->CurInstr>>16) & 0xF]; \      cpu->R[(cpu->CurInstr>>16) & 0xF] += offset; \      u32 r = (cpu->CurInstr>>12) & 0xF; \ -    if (r&1) { r--; printf("!! MISALIGNED LDRD_POST %d\n", r); } \ +    if (r&1) { r--; printf("!! MISALIGNED LDRD_POST %d\n", r+1); } \      cpu->DataRead32 (addr  , &cpu->R[r  ]); \      cpu->DataRead32S(addr+4, &cpu->R[r+1]); \      cpu->AddCycles_CDI(); @@ -256,18 +256,19 @@ A_IMPLEMENT_WB_LDRSTR(LDRB)      offset += cpu->R[(cpu->CurInstr>>16) & 0xF]; \      if (cpu->CurInstr & (1<<21)) cpu->R[(cpu->CurInstr>>16) & 0xF] = offset; \      u32 r = (cpu->CurInstr>>12) & 0xF; \ -    if (r&1) { r--; printf("!! MISALIGNED LDRD_POST %d\n", r); } \ +    if (r&1) { r--; printf("!! MISALIGNED STRD %d\n", r+1); } \      cpu->DataWrite32 (offset  , cpu->R[r  ]); \      cpu->DataWrite32S(offset+4, cpu->R[r+1]); \      cpu->AddCycles_CD();  #define A_STRD_POST \      if (cpu->Num != 0) return; \ +    u32 addr = cpu->R[(cpu->CurInstr>>16) & 0xF]; \      cpu->R[(cpu->CurInstr>>16) & 0xF] += offset; \      u32 r = (cpu->CurInstr>>12) & 0xF; \ -    if (r&1) { r--; printf("!! MISALIGNED LDRD_POST %d\n", r); } \ -    cpu->DataWrite32 (offset  , cpu->R[r  ]); \ -    cpu->DataWrite32S(offset+4, cpu->R[r+1]); \ +    if (r&1) { r--; printf("!! MISALIGNED STRD_POST %d\n", r+1); } \ +    cpu->DataWrite32 (addr  , cpu->R[r  ]); \ +    cpu->DataWrite32S(addr+4, cpu->R[r+1]); \      cpu->AddCycles_CD();  #define A_LDRH \ diff --git a/src/NDS.cpp b/src/NDS.cpp index 98c2924..5112e78 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -1576,7 +1576,7 @@ void debug(u32 param)      //    printf("VRAM %c: %02X\n", 'A'+i, GPU::VRAMCNT[i]);      /*FILE* -    shit = fopen("debug/jam.bin", "wb"); +    shit = fopen("debug/justbeep.bin", "wb");      for (u32 i = 0x02000000; i < 0x02400000; i+=4)      {          u32 val = ARM7Read32(i); @@ -1840,7 +1840,7 @@ void ARM9Write16(u32 addr, u16 val)  }  void ARM9Write32(u32 addr, u32 val) -{ +{if (addr==0x02FE2E60) printf("!!!! %08X->%08X, %08X\n", addr, val, ARM9->R[15]);      switch (addr & 0xFF000000)      {      case 0x02000000: @@ -2469,7 +2469,7 @@ u16 ARM9IORead16(u32 addr)          return GPU3D::Read16(addr);      } -    printf("unknown ARM9 IO read16 %08X %08X\n", addr, ARM9->R[15]); +    //printf("unknown ARM9 IO read16 %08X %08X\n", addr, ARM9->R[15]);      return 0;  }  |