summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/fcombat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/fcombat.cpp')
-rw-r--r--src/mame/drivers/fcombat.cpp51
1 files changed, 24 insertions, 27 deletions
diff --git a/src/mame/drivers/fcombat.cpp b/src/mame/drivers/fcombat.cpp
index 21354f7d161..344c338f2af 100644
--- a/src/mame/drivers/fcombat.cpp
+++ b/src/mame/drivers/fcombat.cpp
@@ -330,29 +330,26 @@ MACHINE_CONFIG_END
*
*************************************/
-DRIVER_INIT_MEMBER(fcombat_state,fcombat)
+void fcombat_state::init_fcombat()
{
- uint32_t oldaddr, newaddr, length;
- uint8_t *src, *dst;
-
/* allocate some temporary space */
std::vector<uint8_t> temp(0x10000);
/* make a temporary copy of the character data */
- src = &temp[0];
- dst = memregion("gfx1")->base();
- length = memregion("gfx1")->bytes();
+ uint8_t *src = &temp[0];
+ uint8_t *dst = memregion("gfx1")->base();
+ uint32_t length = memregion("gfx1")->bytes();
memcpy(src, dst, length);
/* decode the characters */
/* the bits in the ROM are ordered: n8-n7 n6 n5 n4-v2 v1 v0 n3-n2 n1 n0 h2 */
/* we want them ordered like this: n8-n7 n6 n5 n4-n3 n2 n1 n0-v2 v1 v0 h2 */
- for (oldaddr = 0; oldaddr < length; oldaddr++)
+ for (uint32_t oldaddr = 0; oldaddr < length; oldaddr++)
{
- newaddr = ((oldaddr ) & 0x1f00) | /* keep n8-n4 */
- ((oldaddr << 3) & 0x00f0) | /* move n3-n0 */
- ((oldaddr >> 4) & 0x000e) | /* move v2-v0 */
- ((oldaddr ) & 0x0001); /* keep h2 */
+ uint32_t newaddr = ((oldaddr ) & 0x1f00) | /* keep n8-n4 */
+ ((oldaddr << 3) & 0x00f0) | /* move n3-n0 */
+ ((oldaddr >> 4) & 0x000e) | /* move v2-v0 */
+ ((oldaddr ) & 0x0001); /* keep h2 */
dst[newaddr] = src[oldaddr];
}
@@ -366,13 +363,13 @@ DRIVER_INIT_MEMBER(fcombat_state,fcombat)
/* the bits in the ROMs are ordered: n9 n8 n3 n7-n6 n5 n4 v3-v2 v1 v0 n2-n1 n0 h3 h2 */
/* we want them ordered like this: n9 n8 n7 n6-n5 n4 n3 n2-n1 n0 v3 v2-v1 v0 h3 h2 */
- for (oldaddr = 0; oldaddr < length; oldaddr++)
+ for (uint32_t oldaddr = 0; oldaddr < length; oldaddr++)
{
- newaddr = ((oldaddr << 1) & 0x3c00) | /* move n7-n4 */
- ((oldaddr >> 4) & 0x0200) | /* move n3 */
- ((oldaddr << 4) & 0x01c0) | /* move n2-n0 */
- ((oldaddr >> 3) & 0x003c) | /* move v3-v0 */
- ((oldaddr ) & 0xc003); /* keep n9-n8 h3-h2 */
+ uint32_t newaddr = ((oldaddr << 1) & 0x3c00) | /* move n7-n4 */
+ ((oldaddr >> 4) & 0x0200) | /* move n3 */
+ ((oldaddr << 4) & 0x01c0) | /* move n2-n0 */
+ ((oldaddr >> 3) & 0x003c) | /* move v3-v0 */
+ ((oldaddr ) & 0xc003); /* keep n9-n8 h3-h2 */
dst[newaddr] = src[oldaddr];
}
@@ -387,13 +384,13 @@ DRIVER_INIT_MEMBER(fcombat_state,fcombat)
/* the bits in the ROM are ordered: n8-n7 n6 n5 n4-v2 v1 v0 n3-n2 n1 n0 h2 */
/* we want them ordered like this: n8-n7 n6 n5 n4-n3 n2 n1 n0-v2 v1 v0 h2 */
- for (oldaddr = 0; oldaddr < length; oldaddr++)
+ for (uint32_t oldaddr = 0; oldaddr < length; oldaddr++)
{
- newaddr = ((oldaddr << 1) & 0x3c00) | /* move n7-n4 */
- ((oldaddr >> 4) & 0x0200) | /* move n3 */
- ((oldaddr << 4) & 0x01c0) | /* move n2-n0 */
- ((oldaddr >> 3) & 0x003c) | /* move v3-v0 */
- ((oldaddr ) & 0xc003); /* keep n9-n8 h3-h2 */
+ uint32_t newaddr = ((oldaddr << 1) & 0x3c00) | /* move n7-n4 */
+ ((oldaddr >> 4) & 0x0200) | /* move n3 */
+ ((oldaddr << 4) & 0x01c0) | /* move n2-n0 */
+ ((oldaddr >> 3) & 0x003c) | /* move v3-v0 */
+ ((oldaddr ) & 0xc003); /* keep n9-n8 h3-h2 */
dst[newaddr] = src[oldaddr];
}
@@ -402,7 +399,7 @@ DRIVER_INIT_MEMBER(fcombat_state,fcombat)
length = memregion("user1")->bytes();
memcpy(src, dst, length);
- for (oldaddr = 0; oldaddr < 32; oldaddr++)
+ for (uint32_t oldaddr = 0; oldaddr < 32; oldaddr++)
{
memcpy(&dst[oldaddr * 32 * 8 * 2], &src[oldaddr * 32 * 8], 32 * 8);
memcpy(&dst[oldaddr * 32 * 8 * 2 + 32 * 8], &src[oldaddr * 32 * 8 + 0x2000], 32 * 8);
@@ -414,7 +411,7 @@ DRIVER_INIT_MEMBER(fcombat_state,fcombat)
length = memregion("user2")->bytes();
memcpy(src, dst, length);
- for (oldaddr = 0; oldaddr < 32; oldaddr++)
+ for (uint32_t oldaddr = 0; oldaddr < 32; oldaddr++)
{
memcpy(&dst[oldaddr * 32 * 8 * 2], &src[oldaddr * 32 * 8], 32 * 8);
memcpy(&dst[oldaddr * 32 * 8 * 2 + 32 * 8], &src[oldaddr * 32 * 8 + 0x2000], 32 * 8);
@@ -453,4 +450,4 @@ ROM_START( fcombat )
ROM_LOAD( "fcprom_c.a9", 0x0220, 0x0100, CRC(768ac120) SHA1(ceede1d6cbeae08da96ef52bdca2718a839d88ab) ) /* bg char mixer */
ROM_END
-GAME( 1985, fcombat, 0, fcombat, fcombat, fcombat_state, fcombat, ROT90, "Jaleco", "Field Combat", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE )
+GAME( 1985, fcombat, 0, fcombat, fcombat, fcombat_state, init_fcombat, ROT90, "Jaleco", "Field Combat", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE )