Previous 199869 Revisions Next

r36647 Wednesday 25th March, 2015 at 23:17:48 UTC by R. Belmont
arm7: STM decrementing mode actually writes in incrementing mode on real h/w.  Used heavily by GBA "Classic NES" carts. [R. Belmont, endrift]
[src/emu/cpu/arm7]arm7ops.c

trunk/src/emu/cpu/arm7/arm7ops.c
r245158r245159
253253} /* storeInc */
254254
255255
256// classic CV: 3005aa0 does the DMA thing
256257int arm7_cpu_device::storeDec(UINT32 pat, UINT32 rbv, int mode)
257258{
258   int i, result;
259   int i, result = 0, cnt;
259260
260   result = 0;
261   // pre-count the # of registers doing DMA
261262   for (i = 15; i >= 0; i--)
262263   {
263264      if ((pat >> i) & 1)
264265      {
266         result++;
267
268         // starting address
269         rbv -= 4;
270      }
271   }
272
273   cnt = 0;
274   for (i = 0; i <= 15; i++)
275   {
276      if ((pat >> i) & 1)
277      {
265278#if ARM7_DEBUG_CORE
266279         if (i == 15) /* R15 is plus 12 from address of STM */
267280            LOG(("%08x: StoreDec on R15\n", R15));
268281#endif
269         WRITE32(rbv -= 4, GET_MODE_REGISTER(mode, i));
270         result++;
282         WRITE32(rbv + (cnt * 4), GET_MODE_REGISTER(mode, i));
283         cnt++;
271284      }
272285   }
273286   return result;
r245158r245159
14211434   } /* Loading */
14221435   else
14231436   {
1424      /* Storing */
1437      /* Storing - STM */
14251438      if (insn & (1 << eR15))
14261439      {
14271440#if ARM7_DEBUG_CORE
r245158r245159
14611474      }
14621475      else
14631476      {
1464         /* Decrementing */
1477         /* Decrementing - but real CPU writes in incrementing order */
14651478         if (!(insn & INSN_BDT_P))
14661479         {
14671480            rbp = rbp - (-4);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team