Previous 199869 Revisions Next

r34055 Wednesday 24th December, 2014 at 14:56:17 UTC by David Haywood
and so we arrive at some code trying to set up hardware loops (nw)
[src/emu/cpu/arcompact]arcompact_execute.c
[src/mess/drivers]leapster.c

trunk/src/emu/cpu/arcompact/arcompact_execute.c
r242566r242567
8080      int S_temp = (op & 0x0000003f) >> 0; \
8181      int s_temp = (op & 0x00000fc0) >> 6; \
8282      INT32 S = s_temp | (S_temp<<6); \
83      if (S & 0x800) S = -0x800 + (S&0x7ff) /* sign extend */ \
83      if (S & 0x800) S = -0x800 + (S&0x7ff); /* sign extend */ \
8484
8585#define COMMON32_GET_CONDITION \
8686      UINT8 condition = op & 0x0000001f;
r242566r242567
17841784   /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */ \
17851785
17861786
1787#define SETUP_HANDLE04_0x_P10 \
1788   int size = 4; \
1789   UINT32 limm = 0; \
1790/*   int got_limm = 0; */ \
1791    \
1792   COMMON32_GET_breg; \
1793   COMMON32_GET_F; \
1794   COMMON32_GET_s12; \
1795   COMMON32_GET_areg; \
1796   \
1797   UINT32 b, c; \
1798   \
1799   /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */ \
1800   if (breg == LIMM_REG) \
1801   { \
1802      GET_LIMM_32; \
1803      size = 8; \
1804/*      got_limm = 1; */ \
1805      b = limm; \
1806   } \
1807   else \
1808   { \
1809      b = m_regs[breg]; \
1810   } \
1811    \
1812    c = (UINT32)S; \
1813   \
1814   /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */ \
17871815
1816
17881817ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p00(OPS_32)
17891818{
17901819   SETUP_HANDLE04_0x_P00
r242566r242567
18801909
18811910ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_04_p10(OPS_32)
18821911{
1883   int size = 4;
1884   arcompact_fatal("arcompact_handle04_04_p10 (AND)\n");
1912   SETUP_HANDLE04_0x_P10
1913   m_regs[areg] = b & c;
1914
1915   if (F)
1916   {
1917      arcompact_fatal("arcompact_handle04_04_p10 (AND) (F set)\n"); // not yet supported
1918   }
1919
18851920   return m_pc + (size >> 0);
18861921}
18871922
r242566r242567
19171952
19181953ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p01(OPS_32)
19191954{
1920   int size = 4;
1921   arcompact_fatal("arcompact_handle04_05_p01 (OR)\n");
1922   return m_pc + (size >> 0);
1923}
1955   SETUP_HANDLE04_0x_P01
19241956
1957   m_regs[areg] = b | c;
1958
1959   if (F)
1960   {
1961      arcompact_fatal("arcompact_handle04_05_p01 (OR) (F set)\n"); // not yet supported
1962   }
1963
1964   return m_pc + (size >> 0);}
1965
19251966ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p10(OPS_32)
19261967{
19271968   int size = 4;
r242566r242567
21192160ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p10(OPS_32)
21202161{
21212162   int size = 4;
2122   arcompact_fatal("arcompact_handle04_0a_p10\n");
2123   return m_pc + (size >> 0);
2124}
21252163
2164   COMMON32_GET_breg;
2165   COMMON32_GET_s12;
2166   COMMON32_GET_F;
2167
2168   m_regs[breg] = S;
2169
2170   if (F)
2171   { // currently not supported
2172      arcompact_fatal("unimplemented MOV.F b <- s12 %08x", op);
2173   }
2174
2175   return m_pc + (size>>0);}
2176
21262177ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p11_m0(OPS_32)
21272178{
21282179   int size = 4;
r242566r242567
32183269   return m_pc + (2 >> 0);
32193270}
32203271
3221ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_05(OPS_16)  { return arcompact_handle0f_0x_helper(PARAMS, "OR_S",0);   }
3272ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_05(OPS_16) // OR_S b <- b,c
3273{
3274   int breg, creg;
3275
3276   COMMON16_GET_breg;
3277   COMMON16_GET_creg;
3278
3279   REG_16BIT_RANGE(breg);
3280   REG_16BIT_RANGE(creg);
3281
3282   m_regs[breg] = m_regs[breg] | m_regs[creg];
3283
3284   return m_pc + (2 >> 0);
3285}
3286
3287
32223288ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_06(OPS_16)  { return arcompact_handle0f_0x_helper(PARAMS, "BIC_S",0);  }
32233289ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_07(OPS_16)  { return arcompact_handle0f_0x_helper(PARAMS, "XOR_S",0);  }
32243290ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0b(OPS_16)  { return arcompact_handle0f_0x_helper(PARAMS, "TST_S",1);  }
r242566r242567
34883554   return arcompact_handle_l7_0x_helper(PARAMS, "BCLR_S");
34893555}
34903556
3491ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_06(OPS_16)
3557ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_06(OPS_16) // BMSK b,b,u5
34923558{
3493   return arcompact_handle_l7_0x_helper(PARAMS, "BSMK_S");
3559   int breg, u;
3560
3561   COMMON16_GET_breg;
3562   COMMON16_GET_u5;
3563
3564   REG_16BIT_RANGE(breg);
3565
3566   u &= 0x1f;
3567
3568   m_regs[breg] = m_regs[breg] | ((1 << (u + 1)) - 1);
3569
3570   return m_pc + (2 >> 0);
34943571}
34953572
34963573ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_07(OPS_16)
trunk/src/mess/drivers/leapster.c
r242566r242567
227227   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(leapster_cart);
228228   DECLARE_DRIVER_INIT(leapster);
229229
230   DECLARE_READ32_MEMBER(leapster_random_r)
231   {
232      return rand() | (rand()<<16); // there is a loop checking that this is above a certain value
233   }
234
230235protected:
231236   required_device<cpu_device> m_maincpu;
232237   required_device<generic_slot_device> m_cart;
r242566r242567
277282
278283static ADDRESS_MAP_START( leapster_map, AS_PROGRAM, 32, leapster_state )
279284   AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_MIRROR(0x40000000) // pointers in the bios region seem to be to the 40xxxxxx region, either we mirror there or something (real bios?) is acutally missing
285   AM_RANGE(0x0180D800, 0x0180D803) AM_READ(leapster_random_r)
280286   AM_RANGE(0x03000000, 0x030007ff) AM_RAM // puts stack here, writes a pointer @ 0x03000000 on startup
281287//   AM_RANGE(0x80000000, 0x807fffff) AM_ROMBANK("cartrom") // game ROM pointers are all to the 80xxxxxx region, so I assume it maps here - installed if a cart is present
282288ADDRESS_MAP_END


Previous 199869 Revisions Next


© 1997-2024 The MAME Team