src/mame/drivers/warpsped.c
| r12047 | r12048 | |
| 2 | 2 | |
| 3 | 3 | Meadows Warp Speed |
| 4 | 4 | |
| 5 | | Preliminary driver by Mariusz Wojcieszek |
| 5 | Driver by Mariusz Wojcieszek |
| 6 | 6 | |
| 7 | Notes: |
| 8 | - Circles drawing does not follow the hardware. Roms which come in pairs four times |
| 9 | on the board are used by circle generators. These roms are thought to contain cosine tables, |
| 10 | 16 bits wide, with g17 being the MSB and g18 being the LSB |
| 11 | - Circles colors are probably not correct |
| 12 | - Starfield is wrong. It is done with tilemap fixed in rom, but rom mapping is not correct. |
| 13 | Starfield scrolling is missing too |
| 14 | - What are unknown roms used for? |
| 15 | |
| 7 | 16 | Hardware registers: |
| 8 | | 0x00 - 0x1f control register for discs generator (8 bytes each) |
| 9 | | 0x00, 0x01 disc radius (?) |
| 10 | | 0x02, 0x03 disc middle point |
| 11 | | 0x04, 0x05 disc middle point |
| 12 | | 0x06 disc colour (0-7) |
| 13 | | 0x07 unused |
| 14 | | 0x20 ? |
| 15 | | 0x21 sound (intro screens have bit 1 toggled for click effect) |
| 16 | | 0x22 ? |
| 17 | | 0x23 ? |
| 18 | | 0x24 ? |
| 19 | | 0x25 ? |
| 20 | | 0x26 ? |
| 21 | | 0x27 ? |
| 17 | 0x00 - 0x1f control register for circles generator (8 bytes each) |
| 18 | 0x00, 0x01 circle radius |
| 19 | 0x02, 0x03 circle middle point |
| 20 | 0x04, 0x05 circle middle point |
| 21 | 0x06 circle colour (0-7) |
| 22 | 0x07 unused |
| 23 | 0x20 ? |
| 24 | 0x21 sound (intro screens have bit 1 toggled for click effect) |
| 25 | 0x22 ? |
| 26 | 0x23 ? |
| 27 | 0x24 ? |
| 28 | 0x25 ? |
| 29 | 0x26 ? |
| 30 | 0x27 ? |
| 22 | 31 | |
| 23 | | |
| 24 | 32 | Board etched... |
| 25 | | MEADOWS 024-0084 |
| 26 | | MADE IN USA |
| 33 | MEADOWS 024-0084 |
| 34 | MADE IN USA |
| 27 | 35 | |
| 28 | 36 | Empty socket at .E3 |
| 29 | 37 | Z80 processor |
| r12047 | r12048 | |
| 32 | 40 | 5Mhz crystal |
| 33 | 41 | All PROMS are SN74s474 |
| 34 | 42 | |
| 35 | | .L18 no sticker |
| 36 | | .L17 stickered L9, L13 |
| 37 | | L17, G17 |
| 38 | | .L15 stickered L10, L15 |
| 39 | | L18, G18 |
| 40 | | .L13 stickered L9, L13 |
| 41 | | L17, G17 |
| 42 | | .L10 stickered L10, L15 |
| 43 | | L18, G18 |
| 44 | | .L9 stickered (damaged) xxx, L13 |
| 45 | | xxx, G1y |
| 46 | | .K1 stickered K1 |
| 47 | | .G2 no sticker K1 |
| 48 | | .E4 no sticker |
| 49 | | .E5 stickered M16 |
| 50 | | PRO |
| 51 | | 1 |
| 52 | | .E6 stickered M16 |
| 53 | | PRO |
| 54 | | 3 |
| 55 | | .C3 can't read |
| 56 | | .C4 stickered M16 |
| 57 | | PRO |
| 58 | | 4 |
| 59 | | .C5 stickered M16 |
| 60 | | PRO |
| 61 | | 0 |
| 62 | | .C6 stickered M16 |
| 63 | | PRO |
| 64 | | 2 |
| 65 | | .E8 stickered E8 |
| 66 | | .E10 stickered E10 |
| 67 | | .C12 stickered C12 |
| 68 | | .G17 stickered L9, L13 |
| 69 | | L17, G17 |
| 70 | | .G18 stickered L10, L15 |
| 71 | | L18, G18 |
| 43 | .L18 no sticker |
| 44 | .L17 stickered L9, L13 |
| 45 | L17, G17 |
| 46 | .L15 stickered L10, L15 |
| 47 | L18, G18 |
| 48 | .L13 stickered L9, L13 |
| 49 | L17, G17 |
| 50 | .L10 stickered L10, L15 |
| 51 | L18, G18 |
| 52 | .L9 stickered (damaged) xxx, L13 |
| 53 | xxx, G1y |
| 54 | .K1 stickered K1 |
| 55 | .G2 no sticker K1 |
| 56 | .E4 no sticker |
| 57 | .E5 stickered M16 |
| 58 | PRO |
| 59 | 1 |
| 60 | .E6 stickered M16 |
| 61 | PRO |
| 62 | 3 |
| 63 | .C3 can't read |
| 64 | .C4 stickered M16 |
| 65 | PRO |
| 66 | 4 |
| 67 | .C5 stickered M16 |
| 68 | PRO |
| 69 | 0 |
| 70 | .C6 stickered M16 |
| 71 | PRO |
| 72 | 2 |
| 73 | .E8 stickered E8 |
| 74 | .E10 stickered E10 |
| 75 | .C12 stickered C12 |
| 76 | .G17 stickered L9, L13 |
| 77 | L17, G17 |
| 78 | .G18 stickered L10, L15 |
| 79 | L18, G18 |
| 72 | 80 | |
| 73 | 81 | L9, L13, L17 and G17 all read the same |
| 74 | 82 | L10, L15, L18 and G18 all read the same |
| r12047 | r12048 | |
| 91 | 99 | UINT8 m_regs[0x28]; |
| 92 | 100 | }; |
| 93 | 101 | |
| 94 | | static READ8_HANDLER( warpspeed_hardware_r ) |
| 95 | | { |
| 96 | | // warpspeed_state *state = space->machine().driver_data<warpspeed_state>(); |
| 97 | | |
| 98 | | switch( offset ) |
| 99 | | { |
| 100 | | case 0: return input_port_read(space->machine(), "IN1" ); |
| 101 | | /* dipswitches? bit 6 when set causes jump to $e01 during vblank (rom missing) is this test mode? */ |
| 102 | | case 2: return 0; |
| 103 | | case 3: return input_port_read(space->machine(), "IN0" ); |
| 104 | | } |
| 105 | | return 0; |
| 106 | | } |
| 107 | | |
| 108 | 102 | static WRITE8_HANDLER( warpspeed_hardware_w ) |
| 109 | 103 | { |
| 110 | 104 | warpspeed_state *state = space->machine().driver_data<warpspeed_state>(); |
| r12047 | r12048 | |
| 146 | 140 | tilemap_mark_all_tiles_dirty(state->m_starfield_tilemap); |
| 147 | 141 | } |
| 148 | 142 | |
| 143 | static void draw_circle_line(bitmap_t *bitmap, int x, int y, int l, int color) |
| 144 | { |
| 145 | if (y >= 0 && y <= bitmap->height - 1) |
| 146 | { |
| 147 | UINT16* pLine = BITMAP_ADDR16(bitmap, y, 0); |
| 148 | |
| 149 | int h1 = x - l; |
| 150 | int h2 = x + l; |
| 151 | |
| 152 | if (h1 < 0) |
| 153 | h1 = 0; |
| 154 | if (h2 > bitmap->width - 1) |
| 155 | h2 = bitmap->width - 1; |
| 156 | |
| 157 | for (x = h1; x <= h2; x++) |
| 158 | pLine[x] = color; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | static void warpspeed_draw_circle(bitmap_t *bitmap, INT16 cx, INT16 cy, UINT16 radius, UINT8 color ) |
| 163 | { |
| 164 | /* Bresenham's circle algorithm */ |
| 165 | |
| 166 | int x = 0; |
| 167 | int y = radius; |
| 168 | |
| 169 | int d = 3 - 2 * radius; |
| 170 | |
| 171 | while (x <= y) |
| 172 | { |
| 173 | draw_circle_line(bitmap, cx, cy - x, y, color); |
| 174 | draw_circle_line(bitmap, cx, cy + x, y, color); |
| 175 | draw_circle_line(bitmap, cx, cy - y, x, color); |
| 176 | draw_circle_line(bitmap, cx, cy + y, x, color); |
| 177 | |
| 178 | x++; |
| 179 | |
| 180 | if (d < 0) |
| 181 | d += 4 * x + 6; |
| 182 | else |
| 183 | d += 4 * (x - y--) + 10; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | static void warpspeed_draw_circles(bitmap_t *bitmap, warpspeed_state *state) |
| 188 | { |
| 189 | for (int i = 0; i < 4; i++) |
| 190 | { |
| 191 | UINT16 radius = state->m_regs[i*8] + state->m_regs[i*8 + 1]*256; |
| 192 | radius = 0xffff - radius; |
| 193 | radius = sqrt((float)radius); |
| 194 | INT16 midx = state->m_regs[i*8 + 2] + state->m_regs[i*8 + 3]*256; |
| 195 | midx -= 0xe70; |
| 196 | INT16 midy = state->m_regs[i*8 + 4] + state->m_regs[i*8 + 5]*256; |
| 197 | midy -= 0xe70; |
| 198 | if ( radius == 0 || radius == 0xffff ) |
| 199 | { |
| 200 | continue; |
| 201 | } |
| 202 | warpspeed_draw_circle(bitmap, midx + 128 + 16, midy + 128 + 16, radius, (state->m_regs[i*8 + 6] & 0x07) + 2); |
| 203 | } |
| 204 | } |
| 205 | |
| 149 | 206 | static SCREEN_UPDATE( warpspeed ) |
| 150 | 207 | { |
| 151 | 208 | warpspeed_state *state = screen->machine().driver_data<warpspeed_state>(); |
| 152 | 209 | |
| 153 | 210 | tilemap_draw(bitmap, cliprect, state->m_starfield_tilemap, 0, 0); |
| 211 | warpspeed_draw_circles(bitmap, state); |
| 154 | 212 | tilemap_draw(bitmap, cliprect, state->m_text_tilemap, 0, 0); |
| 155 | 213 | return 0; |
| 156 | 214 | } |
| r12047 | r12048 | |
| 163 | 221 | |
| 164 | 222 | static ADDRESS_MAP_START ( warpspeed_io_map, AS_IO, 8) |
| 165 | 223 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 166 | | AM_RANGE(0x00, 0x03) AM_READ( warpspeed_hardware_r ) |
| 224 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") |
| 225 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") |
| 226 | AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW") |
| 227 | AM_RANGE(0x03, 0x03) AM_READ_PORT("IN2") |
| 167 | 228 | AM_RANGE(0x00, 0x27) AM_WRITE( warpspeed_hardware_w ) |
| 168 | 229 | ADDRESS_MAP_END |
| 169 | 230 | |
| 170 | 231 | static INPUT_PORTS_START( warpspeed ) |
| 171 | 232 | PORT_START("IN0") |
| 233 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Accelerate" ) |
| 234 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Brake" ) |
| 235 | PORT_BIT( 0x3f, 0x20, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(20) PORT_KEYDELTA(5) PORT_CENTERDELTA(0) PORT_REVERSE |
| 236 | |
| 237 | PORT_START("IN1") |
| 238 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 239 | PORT_BIT( 0x3f, 0x20, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(20) PORT_KEYDELTA(5) PORT_CENTERDELTA(0) PORT_REVERSE |
| 240 | |
| 241 | PORT_START("IN2") |
| 172 | 242 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 173 | 243 | PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 174 | 244 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 175 | 245 | |
| 176 | | PORT_START("IN1") |
| 177 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Accelerate" ) |
| 178 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Brake" ) |
| 179 | | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 246 | PORT_START("DSW") |
| 247 | PORT_DIPNAME( 0x07, 0x00, "Coin/Time" ) |
| 248 | PORT_DIPSETTING( 0x00, "50 sec" ) |
| 249 | PORT_DIPSETTING( 0x01, "75 sec" ) |
| 250 | PORT_DIPSETTING( 0x02, "100 sec" ) |
| 251 | PORT_DIPSETTING( 0x03, "125 sec" ) |
| 252 | PORT_DIPSETTING( 0x04, "150 sec" ) |
| 253 | PORT_DIPSETTING( 0x05, "175 sec" ) |
| 254 | PORT_DIPSETTING( 0x06, "200 sec" ) |
| 255 | PORT_DIPSETTING( 0x07, "225 sec" ) |
| 256 | |
| 257 | PORT_DIPUNKNOWN( 0x08, 0x00 ) |
| 258 | |
| 259 | PORT_DIPUNKNOWN( 0x10, 0x00 ) |
| 260 | |
| 261 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Coinage ) ) |
| 262 | PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) |
| 263 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 264 | |
| 265 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Service_Mode ) ) |
| 266 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 267 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 268 | |
| 269 | PORT_DIPUNUSED( 0x80, 0x00 ) |
| 180 | 270 | INPUT_PORTS_END |
| 181 | 271 | |
| 182 | 272 | static const gfx_layout warpspeed_charlayout = |
| r12047 | r12048 | |
| 195 | 285 | GFXDECODE_ENTRY( "gfx2", 0, warpspeed_charlayout, 0, 1 ) |
| 196 | 286 | GFXDECODE_END |
| 197 | 287 | |
| 288 | static PALETTE_INIT( warpspeed ) |
| 289 | { |
| 290 | // tilemaps |
| 291 | palette_set_color(machine,0,RGB_BLACK); /* black */ |
| 292 | palette_set_color(machine,1,RGB_WHITE); /* white */ |
| 293 | |
| 294 | // circles |
| 295 | for ( int i = 0; i < 8; i++ ) |
| 296 | { |
| 297 | palette_set_color_rgb(machine, 2 + i, 0xff*BIT(i,0), 0xff*BIT(i,1), 0xff*BIT(i,2)); |
| 298 | } |
| 299 | } |
| 300 | |
| 198 | 301 | static MACHINE_CONFIG_START( warpspeed, warpspeed_state ) |
| 199 | 302 | /* basic machine hardware */ |
| 200 | 303 | MCFG_CPU_ADD("maincpu", Z80, XTAL_5MHz/2) |
| r12047 | r12048 | |
| 207 | 310 | MCFG_SCREEN_ADD("screen", RASTER) |
| 208 | 311 | MCFG_SCREEN_REFRESH_RATE(60) |
| 209 | 312 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) |
| 210 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 313 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 211 | 314 | MCFG_SCREEN_SIZE((32)*8, (32)*8) |
| 212 | 315 | MCFG_SCREEN_VISIBLE_AREA(4*8, 32*8-1, 8*8, 32*8-1) |
| 213 | 316 | |
| r12047 | r12048 | |
| 215 | 318 | MCFG_SCREEN_UPDATE(warpspeed) |
| 216 | 319 | |
| 217 | 320 | MCFG_GFXDECODE(warpspeed) |
| 218 | | MCFG_PALETTE_LENGTH(2) |
| 219 | | MCFG_PALETTE_INIT(black_and_white) |
| 321 | MCFG_PALETTE_LENGTH(2+8) |
| 322 | MCFG_PALETTE_INIT(warpspeed) |
| 220 | 323 | |
| 221 | 324 | MACHINE_CONFIG_END |
| 222 | 325 | |
| r12047 | r12048 | |
| 259 | 362 | { |
| 260 | 363 | } |
| 261 | 364 | |
| 262 | | GAME( 197?, warpsped, 0, warpspeed, warpspeed, warpspeed, ROT0, "Meadows Games, Inc.", "Warp Speed (prototype)", GAME_NO_SOUND | GAME_NOT_WORKING ) |
| 365 | GAME( 197?, warpsped, 0, warpspeed, warpspeed, warpspeed, ROT0, "Meadows Games, Inc.", "Warp Speed (prototype)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_NO_SOUND ) |
src/mame/drivers/armedf.c
| r12047 | r12048 | |
| 1631 | 1631 | |
| 1632 | 1632 | ROM_START( terraf ) |
| 1633 | 1633 | ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */ |
| 1634 | | ROM_LOAD16_BYTE( "tf-014.6e", 0x00000, 0x10000, CRC(8e5f557f) SHA1(3462a58146c3f33bf8686adbd2ead25dae3804a8) ) |
| 1635 | | ROM_LOAD16_BYTE( "tf-011.6h", 0x00001, 0x10000, CRC(5320162a) SHA1(eaffafcaf146cdddb03f40f92ce23dfd096eb89e) ) |
| 1636 | | ROM_LOAD16_BYTE( "tf-013.4e", 0x20000, 0x10000, CRC(a86951e0) SHA1(804cc6f143993f5a9d5f3798e971d7abfe94c3a8) ) |
| 1637 | | ROM_LOAD16_BYTE( "tf-010.4h", 0x20001, 0x10000, CRC(58b5f43b) SHA1(9df77235c0b7ac5af4258c04bd90d0a86ccc86b0) ) |
| 1638 | | ROM_LOAD16_BYTE( "tf-012.3e", 0x40000, 0x08000, CRC(4f0e1d76) SHA1(b8636acde7547358663b94bdc8d49b5cc6b596eb) ) |
| 1639 | | ROM_LOAD16_BYTE( "tf-009.3h", 0x40001, 0x08000, CRC(d1014280) SHA1(5ee8d71d77b31b25cce2bf1953c0a5166313a857) ) |
| 1634 | ROM_LOAD16_BYTE( "8.6e", 0x00000, 0x10000, CRC(fd58fa06) SHA1(f1f5fbd153be5fd5669aada66134baedfeac5d32) ) |
| 1635 | ROM_LOAD16_BYTE( "3.6h", 0x00001, 0x10000, CRC(54823a7d) SHA1(bdf67890428710470a622ea48383b3fae8de8cbd) ) |
| 1636 | ROM_LOAD16_BYTE( "7.4e", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) ) |
| 1637 | ROM_LOAD16_BYTE( "2.4h", 0x20001, 0x10000, CRC(db987414) SHA1(0a1734794c626cf9083d7854c9000c5daadfc3fd) ) |
| 1638 | ROM_LOAD16_BYTE( "6.3e", 0x40000, 0x10000, CRC(a5bb8c3b) SHA1(36730b1a4a686de7251b80eb084a00f64bd7b40d) ) |
| 1639 | ROM_LOAD16_BYTE( "1.3h", 0x40001, 0x10000, CRC(d2de6d28) SHA1(0371b5bf8e6105aaf8847c4b6d0d2d7d105079c1) ) |
| 1640 | 1640 | |
| 1641 | 1641 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ |
| 1642 | ROM_LOAD( "11.17k", 0x00000, 0x10000, CRC(4407d475) SHA1(96e86c7ef4dc997812436f7d0ddea332b4e6cb2b) ) |
| 1643 | |
| 1644 | ROM_REGION( 0x08000, "gfx1", 0 ) |
| 1645 | ROM_LOAD( "9.11e", 0x00000, 0x08000, CRC(bc6f7cbc) SHA1(20b8a34de4bfa0c2fdcd2f7743a0ab35141f4bf9) ) /* characters */ |
| 1646 | |
| 1647 | ROM_REGION( 0x20000, "gfx2", 0 ) |
| 1648 | ROM_LOAD( "5.15h", 0x00000, 0x10000, CRC(25d23dfd) SHA1(da32895c1aca403209b7fb181fa4fa23a8e74d32) ) /* foreground tiles */ |
| 1649 | ROM_LOAD( "4.13h", 0x10000, 0x10000, CRC(b9b0fe27) SHA1(983c48239ba1524b517f89f281f2b70564bea1e9) ) |
| 1650 | |
| 1651 | ROM_REGION( 0x20000, "gfx3", 0 ) |
| 1652 | ROM_LOAD( "15.8a", 0x00000, 0x10000, CRC(2144d8e0) SHA1(ed89da11abf3d79753b478603009970c2600ab60) ) /* background tiles */ |
| 1653 | ROM_LOAD( "14.6a", 0x10000, 0x10000, CRC(744f5c9e) SHA1(696223a087bb575c7cfaba11e682b221ada461e4) ) |
| 1654 | |
| 1655 | ROM_REGION( 0x20000, "gfx4", 0 ) |
| 1656 | ROM_LOAD( "12.7d", 0x00000, 0x10000, CRC(2d1f2ceb) SHA1(77544e1c4bda06feac135a96bb76af7c79278dc0) ) /* sprites */ |
| 1657 | ROM_LOAD( "13.9d", 0x10000, 0x10000, CRC(1d2f92d6) SHA1(e842c6bf95a5958a6ca2c85e68b9bc3cc15211a4) ) |
| 1658 | |
| 1659 | ROM_REGION( 0x4000, "blit_data", 0 ) /* data for mcu/blitter */ |
| 1660 | ROM_LOAD( "10.11c", 0x0000, 0x4000, CRC(ac705812) SHA1(65be46ee959d8478cb6dffb25e61f7742276997b) ) |
| 1661 | |
| 1662 | ROM_REGION( 0x0100, "proms", 0 ) /* Unknown use */ |
| 1663 | ROM_LOAD( "n82s129an.11j", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* N82S129AN or compatible labled "TF" */ |
| 1664 | ROM_END |
| 1665 | |
| 1666 | ROM_START( terrafu ) /* Bootleg of the USA version?, uses some roms common to bootlegs that differ to the orginal board sets */ |
| 1667 | ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */ |
| 1668 | ROM_LOAD16_BYTE( "tf-8.6e", 0x00000, 0x10000, CRC(fea6dd64) SHA1(682eae338ce14808f134897f594fae1c69e75a1a) ) |
| 1669 | ROM_LOAD16_BYTE( "tf-3.6h", 0x00001, 0x10000, CRC(02f9d05a) SHA1(88985373bc3cffbc838e0b701ecd732a417975a1) ) |
| 1670 | ROM_LOAD16_BYTE( "tf-7.4e", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) ) |
| 1671 | ROM_LOAD16_BYTE( "tf-2.4h", 0x20001, 0x10000, CRC(db987414) SHA1(0a1734794c626cf9083d7854c9000c5daadfc3fd) ) |
| 1672 | ROM_LOAD16_BYTE( "tf-6.3e", 0x40000, 0x08000, CRC(b91e9ba3) SHA1(33e5272d1691859a2bb1f340eb4bdfdd5d73a5d4) ) /* Half the size of World & Japan sets?? */ |
| 1673 | ROM_LOAD16_BYTE( "tf-1.3h", 0x40001, 0x08000, CRC(d6e22375) SHA1(c84fc19700b65ee36b0c7d75cd7c97f86c7f719d) ) /* bootlegs use this size rom for 1 & 6 */ |
| 1674 | |
| 1675 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ |
| 1642 | 1676 | ROM_LOAD( "tf-001.17k", 0x00000, 0x10000, CRC(eb6b4138) SHA1(04c53bf46d87a156d3fad86f051985d0df79bd20) ) |
| 1643 | 1677 | |
| 1644 | 1678 | ROM_REGION( 0x08000, "gfx1", 0 ) |
| r12047 | r12048 | |
| 1656 | 1690 | ROM_LOAD( "tf-003.7d", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ |
| 1657 | 1691 | ROM_LOAD( "tf-002.9d", 0x10000, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) |
| 1658 | 1692 | |
| 1659 | | ROM_REGION( 0x4000, "blit_data", 0 ) /* data for mcu/blitter, shouldn't be loaded? */ |
| 1693 | ROM_REGION( 0x4000, "blit_data", 0 ) /* data for mcu/blitter */ |
| 1660 | 1694 | ROM_LOAD( "tf-10.11c", 0x0000, 0x4000, CRC(ac705812) SHA1(65be46ee959d8478cb6dffb25e61f7742276997b) ) |
| 1661 | 1695 | |
| 1662 | 1696 | ROM_REGION( 0x0100, "proms", 0 ) /* Unknown use */ |
| 1663 | 1697 | ROM_LOAD( "n82s129an.11j", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* N82S129AN or compatible labled "TF" */ |
| 1664 | 1698 | ROM_END |
| 1665 | 1699 | |
| 1700 | ROM_START( terrafj ) |
| 1701 | ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */ |
| 1702 | ROM_LOAD16_BYTE( "tfj-8.bin", 0x00000, 0x10000, CRC(b11a6fa7) SHA1(7bb2b98be02d8913796a6d4fa20eed16226ce6b9) ) |
| 1703 | ROM_LOAD16_BYTE( "tfj-3.bin", 0x00001, 0x10000, CRC(6c6aa7ed) SHA1(ee5fdeb5411034ce0fd1c883ee25bf1fe9a3ec52) ) |
| 1704 | ROM_LOAD16_BYTE( "tfj-7.bin", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) ) |
| 1705 | ROM_LOAD16_BYTE( "tfj-2.bin", 0x20001, 0x10000, CRC(db987414) SHA1(0a1734794c626cf9083d7854c9000c5daadfc3fd) ) |
| 1706 | ROM_LOAD16_BYTE( "tfj-6.bin", 0x40000, 0x10000, CRC(4911dfbf) SHA1(91d3607e98e2e746cebddd20a10a033a5557c017) ) |
| 1707 | ROM_LOAD16_BYTE( "tfj-1.bin", 0x40001, 0x10000, CRC(93063d9a) SHA1(58321e18865a0a72b74beab969b7ea5e010be16a) ) |
| 1708 | |
| 1709 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ |
| 1710 | ROM_LOAD( "11.17k", 0x00000, 0x10000, CRC(4407d475) SHA1(96e86c7ef4dc997812436f7d0ddea332b4e6cb2b) ) |
| 1711 | |
| 1712 | ROM_REGION( 0x08000, "gfx1", 0 ) |
| 1713 | ROM_LOAD( "9.11e", 0x00000, 0x08000, CRC(bc6f7cbc) SHA1(20b8a34de4bfa0c2fdcd2f7743a0ab35141f4bf9) ) /* characters */ |
| 1714 | |
| 1715 | ROM_REGION( 0x20000, "gfx2", 0 ) |
| 1716 | ROM_LOAD( "5.15h", 0x00000, 0x10000, CRC(25d23dfd) SHA1(da32895c1aca403209b7fb181fa4fa23a8e74d32) ) /* foreground tiles */ |
| 1717 | ROM_LOAD( "4.13h", 0x10000, 0x10000, CRC(b9b0fe27) SHA1(983c48239ba1524b517f89f281f2b70564bea1e9) ) |
| 1718 | |
| 1719 | ROM_REGION( 0x20000, "gfx3", 0 ) |
| 1720 | ROM_LOAD( "15.8a", 0x00000, 0x10000, CRC(2144d8e0) SHA1(ed89da11abf3d79753b478603009970c2600ab60) ) /* background tiles */ |
| 1721 | ROM_LOAD( "14.6a", 0x10000, 0x10000, CRC(744f5c9e) SHA1(696223a087bb575c7cfaba11e682b221ada461e4) ) |
| 1722 | |
| 1723 | ROM_REGION( 0x20000, "gfx4", 0 ) |
| 1724 | ROM_LOAD( "12.7d", 0x00000, 0x10000, CRC(2d1f2ceb) SHA1(77544e1c4bda06feac135a96bb76af7c79278dc0) ) /* sprites */ |
| 1725 | ROM_LOAD( "13.9d", 0x10000, 0x10000, CRC(1d2f92d6) SHA1(e842c6bf95a5958a6ca2c85e68b9bc3cc15211a4) ) |
| 1726 | |
| 1727 | ROM_REGION( 0x4000, "blit_data", 0 ) /* data for mcu/blitter */ |
| 1728 | ROM_LOAD( "10.11c", 0x0000, 0x4000, CRC(ac705812) SHA1(65be46ee959d8478cb6dffb25e61f7742276997b) ) |
| 1729 | |
| 1730 | ROM_REGION( 0x0100, "proms", 0 ) /* Unknown use */ |
| 1731 | ROM_LOAD( "n82s129an.11j", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* N82S129AN or compatible labled "TF" */ |
| 1732 | ROM_END |
| 1733 | |
| 1666 | 1734 | /* |
| 1667 | 1735 | |
| 1668 | 1736 | CPU |
| r12047 | r12048 | |
| 1693 | 1761 | */ |
| 1694 | 1762 | |
| 1695 | 1763 | |
| 1696 | | ROM_START( terrafb ) |
| 1764 | ROM_START( terrafjb ) |
| 1697 | 1765 | ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */ |
| 1698 | | ROM_LOAD16_BYTE( "tfb-8.bin", 0x00000, 0x10000, CRC(b11a6fa7) SHA1(7bb2b98be02d8913796a6d4fa20eed16226ce6b9) ) |
| 1699 | | ROM_LOAD16_BYTE( "tfb-3.bin", 0x00001, 0x10000, CRC(6c6aa7ed) SHA1(ee5fdeb5411034ce0fd1c883ee25bf1fe9a3ec52) ) |
| 1700 | | ROM_LOAD16_BYTE( "tfb-7.bin", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) ) |
| 1701 | | ROM_LOAD16_BYTE( "tfb-2.bin", 0x20001, 0x10000, CRC(db987414) SHA1(0a1734794c626cf9083d7854c9000c5daadfc3fd) ) |
| 1766 | ROM_LOAD16_BYTE( "tfj-8.bin", 0x00000, 0x10000, CRC(b11a6fa7) SHA1(7bb2b98be02d8913796a6d4fa20eed16226ce6b9) ) |
| 1767 | ROM_LOAD16_BYTE( "tfj-3.bin", 0x00001, 0x10000, CRC(6c6aa7ed) SHA1(ee5fdeb5411034ce0fd1c883ee25bf1fe9a3ec52) ) |
| 1768 | ROM_LOAD16_BYTE( "tfj-7.bin", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) ) |
| 1769 | ROM_LOAD16_BYTE( "tfj-2.bin", 0x20001, 0x10000, CRC(db987414) SHA1(0a1734794c626cf9083d7854c9000c5daadfc3fd) ) |
| 1702 | 1770 | ROM_LOAD16_BYTE( "tfb-6.bin", 0x40000, 0x08000, CRC(552c3c63) SHA1(82d930b7fcdf4879c4644c47ecce58fd2645f10f) ) |
| 1703 | 1771 | ROM_LOAD16_BYTE( "tfb-1.bin", 0x40001, 0x08000, CRC(6a0b94c7) SHA1(55fb32ab859bf51a1c79bf962bb677fa557216ed) ) |
| 1704 | 1772 | |
| r12047 | r12048 | |
| 1728 | 1796 | ROM_LOAD( "n82s129an.11j", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* N82S129AN or compatible labled "TF" */ |
| 1729 | 1797 | ROM_END |
| 1730 | 1798 | |
| 1731 | | |
| 1732 | | ROM_START( terrafu ) |
| 1799 | ROM_START( terrafb ) /* Seems to be a bootleg of the Japanese version with the region warning screen hacked to just say "WAIT" */ |
| 1733 | 1800 | ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */ |
| 1734 | | ROM_LOAD16_BYTE( "tf-8.6e", 0x00000, 0x10000, CRC(fea6dd64) SHA1(682eae338ce14808f134897f594fae1c69e75a1a) ) |
| 1735 | | ROM_LOAD16_BYTE( "tf-3.6h", 0x00001, 0x10000, CRC(02f9d05a) SHA1(88985373bc3cffbc838e0b701ecd732a417975a1) ) |
| 1736 | | ROM_LOAD16_BYTE( "tf-7.4e", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) ) |
| 1737 | | ROM_LOAD16_BYTE( "tf-2.4h", 0x20001, 0x10000, CRC(db987414) SHA1(0a1734794c626cf9083d7854c9000c5daadfc3fd) ) |
| 1738 | | ROM_LOAD16_BYTE( "tf-6.3e", 0x40000, 0x08000, CRC(b91e9ba3) SHA1(33e5272d1691859a2bb1f340eb4bdfdd5d73a5d4) ) |
| 1739 | | ROM_LOAD16_BYTE( "tf-1.3h", 0x40001, 0x08000, CRC(d6e22375) SHA1(c84fc19700b65ee36b0c7d75cd7c97f86c7f719d) ) |
| 1801 | ROM_LOAD16_BYTE( "tf-014.6e", 0x00000, 0x10000, CRC(8e5f557f) SHA1(3462a58146c3f33bf8686adbd2ead25dae3804a8) ) |
| 1802 | ROM_LOAD16_BYTE( "tf-011.6h", 0x00001, 0x10000, CRC(5320162a) SHA1(eaffafcaf146cdddb03f40f92ce23dfd096eb89e) ) |
| 1803 | ROM_LOAD16_BYTE( "tf-013.4e", 0x20000, 0x10000, CRC(a86951e0) SHA1(804cc6f143993f5a9d5f3798e971d7abfe94c3a8) ) |
| 1804 | ROM_LOAD16_BYTE( "tf-010.4h", 0x20001, 0x10000, CRC(58b5f43b) SHA1(9df77235c0b7ac5af4258c04bd90d0a86ccc86b0) ) |
| 1805 | ROM_LOAD16_BYTE( "tf-012.3e", 0x40000, 0x08000, CRC(4f0e1d76) SHA1(b8636acde7547358663b94bdc8d49b5cc6b596eb) ) |
| 1806 | ROM_LOAD16_BYTE( "tf-009.3h", 0x40001, 0x08000, CRC(d1014280) SHA1(5ee8d71d77b31b25cce2bf1953c0a5166313a857) ) |
| 1740 | 1807 | |
| 1741 | 1808 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ |
| 1742 | 1809 | ROM_LOAD( "tf-001.17k", 0x00000, 0x10000, CRC(eb6b4138) SHA1(04c53bf46d87a156d3fad86f051985d0df79bd20) ) |
| r12047 | r12048 | |
| 1756 | 1823 | ROM_LOAD( "tf-003.7d", 0x00000, 0x10000, CRC(d74085a1) SHA1(3f6ba85dbd6e48a502c115b2d322a586fc4f56c9) ) /* sprites */ |
| 1757 | 1824 | ROM_LOAD( "tf-002.9d", 0x10000, 0x10000, CRC(148aa0c5) SHA1(8d8a565540e91b384a9c154522501921b7da4d4e) ) |
| 1758 | 1825 | |
| 1759 | | ROM_REGION( 0x4000, "blit_data", 0 ) /* data for mcu/blitter */ |
| 1826 | ROM_REGION( 0x4000, "blit_data", 0 ) /* data for mcu/blitter, shouldn't be loaded? */ |
| 1760 | 1827 | ROM_LOAD( "tf-10.11c", 0x0000, 0x4000, CRC(ac705812) SHA1(65be46ee959d8478cb6dffb25e61f7742276997b) ) |
| 1761 | 1828 | |
| 1762 | 1829 | ROM_REGION( 0x0100, "proms", 0 ) /* Unknown use */ |
| 1763 | 1830 | ROM_LOAD( "n82s129an.11j", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* N82S129AN or compatible labled "TF" */ |
| 1764 | 1831 | ROM_END |
| 1765 | 1832 | |
| 1766 | | ROM_START( terrafa ) |
| 1767 | | ROM_REGION( 0x60000, "maincpu", ROMREGION_ERASEFF ) /* 64K*8 for 68000 code */ |
| 1768 | | ROM_LOAD16_BYTE( "8.6e", 0x00000, 0x10000, CRC(fd58fa06) SHA1(f1f5fbd153be5fd5669aada66134baedfeac5d32) ) |
| 1769 | | ROM_LOAD16_BYTE( "3.6h", 0x00001, 0x10000, CRC(54823a7d) SHA1(bdf67890428710470a622ea48383b3fae8de8cbd) ) |
| 1770 | | ROM_LOAD16_BYTE( "7.4e", 0x20000, 0x10000, CRC(fde8de7e) SHA1(6b0d27ec49c8c0609c110ad97938bec8c077ad18) ) |
| 1771 | | ROM_LOAD16_BYTE( "2.4h", 0x20001, 0x10000, CRC(db987414) SHA1(0a1734794c626cf9083d7854c9000c5daadfc3fd) ) |
| 1772 | | ROM_LOAD16_BYTE( "6.3e", 0x40000, 0x10000, CRC(a5bb8c3b) SHA1(36730b1a4a686de7251b80eb084a00f64bd7b40d) ) |
| 1773 | | ROM_LOAD16_BYTE( "1.3h", 0x40001, 0x10000, CRC(d2de6d28) SHA1(0371b5bf8e6105aaf8847c4b6d0d2d7d105079c1) ) |
| 1774 | | |
| 1775 | | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code (sound) */ |
| 1776 | | ROM_LOAD( "11.17k", 0x00000, 0x10000, CRC(4407d475) SHA1(96e86c7ef4dc997812436f7d0ddea332b4e6cb2b) ) |
| 1777 | | |
| 1778 | | ROM_REGION( 0x08000, "gfx1", 0 ) |
| 1779 | | ROM_LOAD( "9.11e", 0x00000, 0x08000, CRC(bc6f7cbc) SHA1(20b8a34de4bfa0c2fdcd2f7743a0ab35141f4bf9) ) /* characters */ |
| 1780 | | |
| 1781 | | ROM_REGION( 0x20000, "gfx2", 0 ) |
| 1782 | | ROM_LOAD( "5.15h", 0x00000, 0x10000, CRC(25d23dfd) SHA1(da32895c1aca403209b7fb181fa4fa23a8e74d32) ) /* foreground tiles */ |
| 1783 | | ROM_LOAD( "4.13h", 0x10000, 0x10000, CRC(b9b0fe27) SHA1(983c48239ba1524b517f89f281f2b70564bea1e9) ) |
| 1784 | | |
| 1785 | | ROM_REGION( 0x20000, "gfx3", 0 ) |
| 1786 | | ROM_LOAD( "15.8a", 0x00000, 0x10000, CRC(2144d8e0) SHA1(ed89da11abf3d79753b478603009970c2600ab60) ) /* background tiles */ |
| 1787 | | ROM_LOAD( "14.6a", 0x10000, 0x10000, CRC(744f5c9e) SHA1(696223a087bb575c7cfaba11e682b221ada461e4) ) |
| 1788 | | |
| 1789 | | ROM_REGION( 0x20000, "gfx4", 0 ) |
| 1790 | | ROM_LOAD( "12.7d", 0x00000, 0x10000, CRC(2d1f2ceb) SHA1(77544e1c4bda06feac135a96bb76af7c79278dc0) ) /* sprites */ |
| 1791 | | ROM_LOAD( "13.9d", 0x10000, 0x10000, CRC(1d2f92d6) SHA1(e842c6bf95a5958a6ca2c85e68b9bc3cc15211a4) ) |
| 1792 | | |
| 1793 | | ROM_REGION( 0x4000, "blit_data", 0 ) /* data for mcu/blitter */ |
| 1794 | | ROM_LOAD( "tf-10.11c", 0x0000, 0x4000, CRC(ac705812) SHA1(65be46ee959d8478cb6dffb25e61f7742276997b) ) |
| 1795 | | |
| 1796 | | ROM_REGION( 0x0100, "proms", 0 ) /* Unknown use */ |
| 1797 | | ROM_LOAD( "n82s129an.11j", 0x0000, 0x0100, CRC(81244757) SHA1(6324f63e571f0f7a0bb9eb97f9994809db79493f) ) /* N82S129AN or compatible labled "TF" */ |
| 1798 | | ROM_END |
| 1799 | | |
| 1800 | 1833 | ROM_START( kozure ) |
| 1801 | 1834 | ROM_REGION( 0x60000, "maincpu", 0 ) /* 64K*8 for 68000 code */ |
| 1802 | 1835 | ROM_LOAD16_BYTE( "kozure8.6e", 0x00000, 0x10000, CRC(6bbfb1e6) SHA1(ffc8f835e28ff5f5b11f826b74ac2712c3018178) ) |
| r12047 | r12048 | |
| 2121 | 2154 | * |
| 2122 | 2155 | *************************************/ |
| 2123 | 2156 | |
| 2124 | | /* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */ |
| 2125 | | GAME( 1987, legion, 0, legion, legion, legion, ROT270, "Nichibutsu", "Legion - Spinner-87 (World ver 2.03)", GAME_SUPPORTS_SAVE ) |
| 2126 | | GAME( 1987, legiono, legion, legiono, legion, legiono, ROT270, "Nichibutsu", "Chouji Meikyuu Legion (Japan bootleg ver 1.05)", GAME_SUPPORTS_SAVE ) /* bootleg? */ |
| 2127 | | GAME( 1987, terraf, 0, terraf, terraf, terraf, ROT0, "bootleg", "Terra Force (bootleg)", GAME_SUPPORTS_SAVE ) //world bootleg? |
| 2128 | | GAME( 1987, terrafb, terraf, terrafb, terraf, terrafb, ROT0, "bootleg", "Terra Force (Japan bootleg with additional Z80)", GAME_SUPPORTS_SAVE ) |
| 2129 | | GAME( 1987, terrafu, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu USA", "Terra Force (US set 1)", GAME_SUPPORTS_SAVE ) |
| 2130 | | GAME( 1987, terrafa, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu USA", "Terra Force (US set 2)", GAME_SUPPORTS_SAVE ) //world? |
| 2131 | | GAME( 1987, kozure, 0, kozure, kozure, kozure, ROT0, "Nichibutsu", "Kozure Ookami (Japan)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| 2132 | | GAME( 1988, cclimbr2, 0, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan)", GAME_SUPPORTS_SAVE ) |
| 2133 | | GAME( 1988, cclimbr2a,cclimbr2, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan, Harder)", GAME_SUPPORTS_SAVE ) |
| 2134 | | GAME( 1988, armedf, 0, armedf, armedf, armedf, ROT270, "Nichibutsu", "Armed Formation", GAME_SUPPORTS_SAVE ) |
| 2157 | /* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */ |
| 2158 | GAME( 1987, legion, 0, legion, legion, legion, ROT270, "Nichibutsu", "Legion - Spinner-87 (World ver 2.03)", GAME_SUPPORTS_SAVE ) |
| 2159 | GAME( 1987, legiono, legion, legiono, legion, legiono, ROT270, "Nichibutsu", "Chouji Meikyuu Legion (Japan bootleg ver 1.05)", GAME_SUPPORTS_SAVE ) /* bootleg? */ |
| 2160 | GAME( 1987, terraf, 0, terraf, terraf, terrafu, ROT0, "Nichibutsu", "Terra Force", GAME_SUPPORTS_SAVE ) |
| 2161 | GAME( 1987, terrafu, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu USA", "Terra Force (US)", GAME_SUPPORTS_SAVE ) |
| 2162 | GAME( 1987, terrafj, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu Japan", "Terra Force (Japan)", GAME_SUPPORTS_SAVE ) |
| 2163 | GAME( 1987, terrafjb, terraf, terrafb, terraf, terrafb, ROT0, "bootleg", "Terra Force (Japan bootleg with additional Z80)", GAME_SUPPORTS_SAVE ) |
| 2164 | GAME( 1987, terrafb, terraf, terraf, terraf, terraf, ROT0, "bootleg", "Terra Force (bootleg)", GAME_SUPPORTS_SAVE ) //bootleg of Japan with warning screen hacked |
| 2165 | GAME( 1987, kozure, 0, kozure, kozure, kozure, ROT0, "Nichibutsu", "Kozure Ookami (Japan)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| 2166 | GAME( 1988, cclimbr2, 0, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan)", GAME_SUPPORTS_SAVE ) |
| 2167 | GAME( 1988, cclimbr2a,cclimbr2, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan, Harder)", GAME_SUPPORTS_SAVE ) |
| 2168 | GAME( 1988, armedf, 0, armedf, armedf, armedf, ROT270, "Nichibutsu", "Armed Formation", GAME_SUPPORTS_SAVE ) |
| 2135 | 2169 | GAME( 1988, armedff, armedf, armedf, armedf, armedf, ROT270, "Nichibutsu (Fillmore license)", "Armed Formation (Fillmore license)", GAME_SUPPORTS_SAVE ) |
| 2136 | | GAME( 1989, skyrobo, 0, bigfghtr, bigfghtr, bigfghtr, ROT0, "Nichibutsu", "Sky Robo", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) |
| 2137 | | GAME( 1989, bigfghtr, skyrobo, bigfghtr, bigfghtr, bigfghtr, ROT0, "Nichibutsu", "Tatakae! Big Fighter (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) |
| 2170 | GAME( 1989, skyrobo, 0, bigfghtr, bigfghtr, bigfghtr, ROT0, "Nichibutsu", "Sky Robo", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) |
| 2171 | GAME( 1989, bigfghtr, skyrobo, bigfghtr, bigfghtr, bigfghtr, ROT0, "Nichibutsu", "Tatakae! Big Fighter (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) |
src/mame/drivers/midvunit.c
| r12047 | r12048 | |
| 1073 | 1073 | *************************************/ |
| 1074 | 1074 | |
| 1075 | 1075 | /* |
| 1076 | | Cruis'n USA |
| 1076 | Cruis'n USA & Offroad Challenge (Midway V-Unit) |
| 1077 | 1077 | Midway, 1994 |
| 1078 | 1078 | |
| 1079 | 1079 | PCB Layout |
| 1080 | 1080 | ---------- |
| 1081 | 1081 | |
| 1082 | | 5770-14365-02 (C) 1994 NINTENDO |
| 1082 | 5770-14365-02 (C) 1994 NINTENDO (for Cruisin USA) |
| 1083 | 5770-14365-05 WILLIAMS ELECTRONICS GAMES INC. (for Offroad Challenge) |
| 1083 | 1084 | |-------------------------------------------------------------------------------| |
| 1084 | | | SOUND.U5 SOUND.U9 BATTERY GAME.U26 GAME.U27 GAME.U28 GAME.U29 | |
| 1085 | | SOUND.U5 SOUND.U9 BATTERY MAX691 GAME.U26 GAME.U27 GAME.U28 GAME.U29 | |
| 1085 | 1086 | | SOUND.U4 SOUND.U8 GAME.U22 GAME.U23 GAME.U24 GAME.U25 | |
| 1086 | 1087 | | SOUND.U3 SOUND.U7 6264 RESET_SW GAME.U18 GAME.U19 GAME.U20 GAME.U21 | |
| 1087 | | | SOUND.U2 SOUND.U6 GAME.U14 GAME.U15 GAME.U16 GAME.U17 | |
| 1088 | | SOUND.U2 SOUND.U6 PIC16C57 GAME.U14 GAME.U15 GAME.U16 GAME.U17 | |
| 1088 | 1089 | | GAME.U10 GAME.U11 GAME.U12 GAME.U13 | |
| 1089 | 1090 | | 6116 PAL2 IDT7204 IDT7204 | |
| 1090 | 1091 | | LH521007 LH521007 LH521007 LH521007| |
| r12047 | r12048 | |
| 1113 | 1114 | 6264 - 8k x8 SRAM (battery-backed) |
| 1114 | 1115 | 6116 - 2k x8 SRAM |
| 1115 | 1116 | AD1851 - Analog Devices AD1851 16 bit PCM Audio DAC |
| 1117 | MAX691 - Maxim MAX691 Master Reset IC (DIP16) |
| 1116 | 1118 | TDA2030 - ST TDA2030 Audio AMP |
| 1117 | 1119 | TL084 - Texas Instruments TL084 JFET-Input Operational Amplifier |
| 1118 | 1120 | ADC0844 - National Semiconductor ADC0844 8-Bit Microprocessor Compatible A/D Converter with Multiplexer Option |
| 1121 | PIC16C57 - Microchip PIC16C57 |
| 1122 | - not populated for Cruis'n USA |
| 1123 | - labelled 'Offroad 25" U904' for Offroad Challenge |
| 1119 | 1124 | PAL1 - GAL20V8 labelled 'A-19668' |
| 1120 | | PAL2 - PALC22V10 (no label) |
| 1121 | | PAL3 - TIBPAL20L8 labelled 'A-19670' |
| 1122 | | PAL4 - TIBPAL22V10 labelled 'A-19671' |
| 1123 | | PAL5 - TIBPAL22V10 labelled 'A-19672' |
| 1124 | | PAL6 - TIBPAL22V10 labelled 'A-19673' |
| 1125 | PAL2 - PALC22V10 |
| 1126 | - no label for Cruisin USA |
| 1127 | - labelled 'A-21883 U38' for Offroad Challenge |
| 1128 | PAL3 - TIBPAL20L8 |
| 1129 | - labelled 'A-19670' for Cruis'n USA |
| 1130 | - labelled 'A-21170 U43' for Offroad Challenge |
| 1131 | PAL4 - TIBPAL22V10 |
| 1132 | - labelled 'A-19671' for Cruis'n USA |
| 1133 | - labelled 'A-21171 U54' for Offroad Challenge |
| 1134 | PAL5 - TIBPAL22V10 |
| 1135 | - labelled 'A-19672' for Cruis'n USA |
| 1136 | - labelled 'A-21884 U114' for Offroad Challenge |
| 1137 | PAL6 - TIBPAL22V10 |
| 1138 | - labelled 'A-19673' for Cruis'n USA |
| 1139 | - no label for Offroad Challenge |
| 1125 | 1140 | P3 - P11 - various connectors for controls |
| 1126 | 1141 | VSync - 57.7090Hz \ |
| 1127 | | HSync - 15.3544kHz / measured via EL4583 |
| 1128 | | ROMs - All ROMs 27C040 |
| 1142 | HSync - 24.807kHz / measured via EL4583 |
| 1143 | ROMs - All ROMs 27C040 or 27C801 |
| 1129 | 1144 | SOUND.Uxx - Sound ROMs |
| 1130 | 1145 | GAME.Uxx - PROGRAM ROMs (including GFX) |
| 1131 | 1146 | */ |
| r12047 | r12048 | |
| 1429 | 1444 | ROM_END |
| 1430 | 1445 | |
| 1431 | 1446 | |
| 1447 | ROM_START( offroadc5 ) /* Version 1.50, Tue 10-21-97 */ |
| 1448 | ROM_REGION16_LE( 0x1000000, "dcs", ROMREGION_ERASEFF ) /* sound data */ |
| 1449 | ROM_LOAD16_BYTE( "offroadc.u2", 0x000000, 0x80000, CRC(69976e9d) SHA1(63c886ac2563c43a10840f49f929f8613cd94de2) ) |
| 1450 | ROM_LOAD16_BYTE( "offroadc.u3", 0x200000, 0x80000, CRC(2db9b548) SHA1(4f454a3e6a8851b0ef5d325dd28102d57ea11a11) ) |
| 1451 | ROM_LOAD16_BYTE( "offroadc.u4", 0x400000, 0x80000, CRC(42bdf9d0) SHA1(04add0f0ee7fa61de1913cc0b988345d3d430cde) ) |
| 1452 | ROM_LOAD16_BYTE( "offroadc.u5", 0x600000, 0x80000, CRC(569cc84b) SHA1(08b917cc41fae6b6a3e9d9461a783d3d2865e72a) ) |
| 1453 | ROM_LOAD16_BYTE( "offroadc.u6", 0x800000, 0x80000, CRC(0896f679) SHA1(dde39ef17834256909ef2c9fcd5b5fb9939d5178) ) |
| 1454 | ROM_LOAD16_BYTE( "offroadc.u7", 0xa00000, 0x80000, CRC(fe242d6a) SHA1(8fbac22ed23044841f309ce58c5b1affcdd5d114) ) |
| 1455 | ROM_LOAD16_BYTE( "offroadc.u8", 0xc00000, 0x80000, CRC(5da13f12) SHA1(2bb5e929e8bc6c70cb4475024a6b0bb07ac25244) ) |
| 1456 | ROM_LOAD16_BYTE( "offroadc.u9", 0xe00000, 0x80000, CRC(7ad27f69) SHA1(b33665d0593a95b58d529720aae49e90449bf714) ) |
| 1457 | |
| 1458 | ROM_REGION32_LE( 0x1000000, "user1", 0 ) |
| 1459 | ROM_LOAD32_BYTE( "orc-1_5.u10", 0x0000000, 0x100000, CRC(f464be4f) SHA1(da6c04ae49d033f92cdd62f997841365c4a08616) ) /* Version 1.50 program roms */ |
| 1460 | ROM_LOAD32_BYTE( "orc-1_5.u11", 0x0000001, 0x100000, CRC(eaddc9ac) SHA1(a6b810bf7460e3257bf6acdc3b79c532fb71ad68) ) |
| 1461 | ROM_LOAD32_BYTE( "orc-1_5.u12", 0x0000002, 0x100000, CRC(a2da68da) SHA1(b8dcc042b9926055bff9020599c1c218f08b1727) ) |
| 1462 | ROM_LOAD32_BYTE( "orc-1_5.u13", 0x0000003, 0x100000, CRC(b4755ee2) SHA1(1c4cde7ca60a6e8bff12aed348e7148e20a8caba) ) |
| 1463 | ROM_LOAD32_BYTE( "offroadc.u14", 0x0400000, 0x100000, CRC(1e41d14b) SHA1(3f7c5fae1f8b82ddd811720837fa298785a8dd27) ) |
| 1464 | ROM_LOAD32_BYTE( "offroadc.u15", 0x0400001, 0x100000, CRC(654d623d) SHA1(a944b8f8d71b099d7b5bbd7df6effb90afc3aec8) ) |
| 1465 | ROM_LOAD32_BYTE( "offroadc.u16", 0x0400002, 0x100000, CRC(259774d8) SHA1(90cdf659324b84b3c2c59497cc5611e8f12629a6) ) |
| 1466 | ROM_LOAD32_BYTE( "offroadc.u17", 0x0400003, 0x100000, CRC(50c61434) SHA1(52bc603101b4f88b7d892af683b7c8358cabbf4a) ) |
| 1467 | ROM_LOAD32_BYTE( "offroadc.u18", 0x0800000, 0x100000, CRC(015be91c) SHA1(1624537068c6bc5fa6235bf0b0343347c337e8d8) ) |
| 1468 | ROM_LOAD32_BYTE( "offroadc.u19", 0x0800001, 0x100000, CRC(cfc6b70e) SHA1(8c5ad84c50ca142726db0595153cf04caaabec9c) ) |
| 1469 | ROM_LOAD32_BYTE( "offroadc.u20", 0x0800002, 0x100000, CRC(f48d6e33) SHA1(8b9c205e24f217ac110cdd82388c056ebbbb09b0) ) |
| 1470 | ROM_LOAD32_BYTE( "offroadc.u21", 0x0800003, 0x100000, CRC(17794b56) SHA1(8bfd8f5b43056bfe7f62524bb8c3a8564a3a9413) ) |
| 1471 | ROM_LOAD32_BYTE( "offroadc.u22", 0x0c00000, 0x100000, CRC(f2a6e622) SHA1(a7d7004e95b058124cc02e8073dab8fbed8813c5) ) |
| 1472 | ROM_LOAD32_BYTE( "offroadc.u23", 0x0c00001, 0x100000, CRC(1cba6e20) SHA1(a7c9c58bfc4d26decb08979d83cccedb27528eb6) ) |
| 1473 | ROM_LOAD32_BYTE( "offroadc.u24", 0x0c00002, 0x100000, CRC(fd3ce11f) SHA1(78c65267712488784bc6dc14eef98a90494a9553) ) |
| 1474 | ROM_LOAD32_BYTE( "offroadc.u25", 0x0c00003, 0x100000, CRC(78f8e5db) SHA1(7ec2a5add27d66c43ba5cb7182554321007f5798) ) |
| 1475 | ROM_END |
| 1476 | |
| 1477 | |
| 1432 | 1478 | ROM_START( offroadc4 ) /* Version 1.40, Mon 10-06-97 */ |
| 1433 | 1479 | ROM_REGION16_LE( 0x1000000, "dcs", ROMREGION_ERASEFF ) /* sound data */ |
| 1434 | 1480 | ROM_LOAD16_BYTE( "offroadc.u2", 0x000000, 0x80000, CRC(69976e9d) SHA1(63c886ac2563c43a10840f49f929f8613cd94de2) ) |
| r12047 | r12048 | |
| 1699 | 1745 | GAME( 1996, crusnwld13, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.3)", GAME_SUPPORTS_SAVE ) |
| 1700 | 1746 | |
| 1701 | 1747 | GAME( 1997, offroadc, 0, midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge (v1.63)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 1748 | GAME( 1997, offroadc5, offroadc, midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge (v1.50)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 1702 | 1749 | GAME( 1997, offroadc4, offroadc, midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge (v1.40)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 1703 | 1750 | GAME( 1997, offroadc3, offroadc, midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge (v1.30)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 1704 | 1751 | GAME( 1997, offroadc1, offroadc, midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge (v1.10)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
src/lib/cothread/ppc.c
| r0 | r12048 | |
| 1 | /* |
| 2 | libco.ppc (2010-10-17) |
| 3 | author: blargg |
| 4 | license: public domain |
| 5 | */ |
| 6 | |
| 7 | /* PowerPC 32/64 using embedded or external asm, with optional |
| 8 | floating-point and AltiVec save/restore */ |
| 9 | |
| 10 | #define LIBCO_C |
| 11 | #include "libco.h" |
| 12 | #include <stdlib.h> |
| 13 | #include <stdint.h> |
| 14 | #include <string.h> |
| 15 | |
| 16 | #define LIBCO_MPROTECT (__unix__ && !LIBCO_PPC_ASM) |
| 17 | |
| 18 | #if LIBCO_MPROTECT |
| 19 | #include <unistd.h> |
| 20 | #include <sys/mman.h> |
| 21 | #endif |
| 22 | |
| 23 | /* State format (offsets in 32-bit words) |
| 24 | |
| 25 | +0 Pointer to swap code |
| 26 | Rest of function descriptor for entry function |
| 27 | +8 PC |
| 28 | +10 SP |
| 29 | Special regs |
| 30 | GPRs |
| 31 | FPRs |
| 32 | VRs |
| 33 | stack |
| 34 | */ |
| 35 | |
| 36 | enum { state_size = 1024 }; |
| 37 | enum { above_stack = 2048 }; |
| 38 | enum { stack_align = 256 }; |
| 39 | |
| 40 | static thread_local cothread_t co_active_handle = 0; |
| 41 | |
| 42 | /**** Determine environment ****/ |
| 43 | |
| 44 | #define LIBCO_PPC64 (_ARCH_PPC64 || __PPC64__ || __ppc64__ || __powerpc64__) |
| 45 | |
| 46 | /* Whether function calls are indirect through a descriptor, |
| 47 | or are directly to function */ |
| 48 | #ifndef LIBCO_PPCDESC |
| 49 | #if !_CALL_SYSV && (_CALL_AIX || _CALL_AIXDESC || LIBCO_PPC64) |
| 50 | #define LIBCO_PPCDESC 1 |
| 51 | #endif |
| 52 | #endif |
| 53 | |
| 54 | #ifdef LIBCO_PPC_ASM |
| 55 | |
| 56 | #ifdef __cplusplus |
| 57 | extern "C" |
| 58 | #endif |
| 59 | |
| 60 | /* Swap code is in ppc.S */ |
| 61 | void co_swap_asm( cothread_t, cothread_t ); |
| 62 | #define CO_SWAP_ASM( x, y ) co_swap_asm( x, y ) |
| 63 | |
| 64 | #else |
| 65 | |
| 66 | /* Swap code is here in array. Please leave dieassembly comments, |
| 67 | as they make it easy to see what it does, and reorder instructions |
| 68 | if one wants to see whether that improves performance. */ |
| 69 | static const uint32_t libco_ppc_code [] = { |
| 70 | #if LIBCO_PPC64 |
| 71 | 0x7d000026, /* mfcr r8 */ |
| 72 | 0xf8240028, /* std r1,40(r4) */ |
| 73 | 0x7d2802a6, /* mflr r9 */ |
| 74 | 0xf9c40048, /* std r14,72(r4) */ |
| 75 | 0xf9e40050, /* std r15,80(r4) */ |
| 76 | 0xfa040058, /* std r16,88(r4) */ |
| 77 | 0xfa240060, /* std r17,96(r4) */ |
| 78 | 0xfa440068, /* std r18,104(r4) */ |
| 79 | 0xfa640070, /* std r19,112(r4) */ |
| 80 | 0xfa840078, /* std r20,120(r4) */ |
| 81 | 0xfaa40080, /* std r21,128(r4) */ |
| 82 | 0xfac40088, /* std r22,136(r4) */ |
| 83 | 0xfae40090, /* std r23,144(r4) */ |
| 84 | 0xfb040098, /* std r24,152(r4) */ |
| 85 | 0xfb2400a0, /* std r25,160(r4) */ |
| 86 | 0xfb4400a8, /* std r26,168(r4) */ |
| 87 | 0xfb6400b0, /* std r27,176(r4) */ |
| 88 | 0xfb8400b8, /* std r28,184(r4) */ |
| 89 | 0xfba400c0, /* std r29,192(r4) */ |
| 90 | 0xfbc400c8, /* std r30,200(r4) */ |
| 91 | 0xfbe400d0, /* std r31,208(r4) */ |
| 92 | 0xf9240020, /* std r9,32(r4) */ |
| 93 | 0xe8e30020, /* ld r7,32(r3) */ |
| 94 | 0xe8230028, /* ld r1,40(r3) */ |
| 95 | 0x48000009, /* bl 1 */ |
| 96 | 0x7fe00008, /* trap */ |
| 97 | 0x91040030,/*1:stw r8,48(r4) */ |
| 98 | 0x80c30030, /* lwz r6,48(r3) */ |
| 99 | 0x7ce903a6, /* mtctr r7 */ |
| 100 | 0xe9c30048, /* ld r14,72(r3) */ |
| 101 | 0xe9e30050, /* ld r15,80(r3) */ |
| 102 | 0xea030058, /* ld r16,88(r3) */ |
| 103 | 0xea230060, /* ld r17,96(r3) */ |
| 104 | 0xea430068, /* ld r18,104(r3) */ |
| 105 | 0xea630070, /* ld r19,112(r3) */ |
| 106 | 0xea830078, /* ld r20,120(r3) */ |
| 107 | 0xeaa30080, /* ld r21,128(r3) */ |
| 108 | 0xeac30088, /* ld r22,136(r3) */ |
| 109 | 0xeae30090, /* ld r23,144(r3) */ |
| 110 | 0xeb030098, /* ld r24,152(r3) */ |
| 111 | 0xeb2300a0, /* ld r25,160(r3) */ |
| 112 | 0xeb4300a8, /* ld r26,168(r3) */ |
| 113 | 0xeb6300b0, /* ld r27,176(r3) */ |
| 114 | 0xeb8300b8, /* ld r28,184(r3) */ |
| 115 | 0xeba300c0, /* ld r29,192(r3) */ |
| 116 | 0xebc300c8, /* ld r30,200(r3) */ |
| 117 | 0xebe300d0, /* ld r31,208(r3) */ |
| 118 | 0x7ccff120, /* mtcr r6 */ |
| 119 | #else |
| 120 | 0x7d000026, /* mfcr r8 */ |
| 121 | 0x90240028, /* stw r1,40(r4) */ |
| 122 | 0x7d2802a6, /* mflr r9 */ |
| 123 | 0x91a4003c, /* stw r13,60(r4) */ |
| 124 | 0x91c40040, /* stw r14,64(r4) */ |
| 125 | 0x91e40044, /* stw r15,68(r4) */ |
| 126 | 0x92040048, /* stw r16,72(r4) */ |
| 127 | 0x9224004c, /* stw r17,76(r4) */ |
| 128 | 0x92440050, /* stw r18,80(r4) */ |
| 129 | 0x92640054, /* stw r19,84(r4) */ |
| 130 | 0x92840058, /* stw r20,88(r4) */ |
| 131 | 0x92a4005c, /* stw r21,92(r4) */ |
| 132 | 0x92c40060, /* stw r22,96(r4) */ |
| 133 | 0x92e40064, /* stw r23,100(r4) */ |
| 134 | 0x93040068, /* stw r24,104(r4) */ |
| 135 | 0x9324006c, /* stw r25,108(r4) */ |
| 136 | 0x93440070, /* stw r26,112(r4) */ |
| 137 | 0x93640074, /* stw r27,116(r4) */ |
| 138 | 0x93840078, /* stw r28,120(r4) */ |
| 139 | 0x93a4007c, /* stw r29,124(r4) */ |
| 140 | 0x93c40080, /* stw r30,128(r4) */ |
| 141 | 0x93e40084, /* stw r31,132(r4) */ |
| 142 | 0x91240020, /* stw r9,32(r4) */ |
| 143 | 0x80e30020, /* lwz r7,32(r3) */ |
| 144 | 0x80230028, /* lwz r1,40(r3) */ |
| 145 | 0x48000009, /* bl 1 */ |
| 146 | 0x7fe00008, /* trap */ |
| 147 | 0x91040030,/*1:stw r8,48(r4) */ |
| 148 | 0x80c30030, /* lwz r6,48(r3) */ |
| 149 | 0x7ce903a6, /* mtctr r7 */ |
| 150 | 0x81a3003c, /* lwz r13,60(r3) */ |
| 151 | 0x81c30040, /* lwz r14,64(r3) */ |
| 152 | 0x81e30044, /* lwz r15,68(r3) */ |
| 153 | 0x82030048, /* lwz r16,72(r3) */ |
| 154 | 0x8223004c, /* lwz r17,76(r3) */ |
| 155 | 0x82430050, /* lwz r18,80(r3) */ |
| 156 | 0x82630054, /* lwz r19,84(r3) */ |
| 157 | 0x82830058, /* lwz r20,88(r3) */ |
| 158 | 0x82a3005c, /* lwz r21,92(r3) */ |
| 159 | 0x82c30060, /* lwz r22,96(r3) */ |
| 160 | 0x82e30064, /* lwz r23,100(r3) */ |
| 161 | 0x83030068, /* lwz r24,104(r3) */ |
| 162 | 0x8323006c, /* lwz r25,108(r3) */ |
| 163 | 0x83430070, /* lwz r26,112(r3) */ |
| 164 | 0x83630074, /* lwz r27,116(r3) */ |
| 165 | 0x83830078, /* lwz r28,120(r3) */ |
| 166 | 0x83a3007c, /* lwz r29,124(r3) */ |
| 167 | 0x83c30080, /* lwz r30,128(r3) */ |
| 168 | 0x83e30084, /* lwz r31,132(r3) */ |
| 169 | 0x7ccff120, /* mtcr r6 */ |
| 170 | #endif |
| 171 | |
| 172 | #ifndef LIBCO_PPC_NOFP |
| 173 | 0xd9c400e0, /* stfd f14,224(r4) */ |
| 174 | 0xd9e400e8, /* stfd f15,232(r4) */ |
| 175 | 0xda0400f0, /* stfd f16,240(r4) */ |
| 176 | 0xda2400f8, /* stfd f17,248(r4) */ |
| 177 | 0xda440100, /* stfd f18,256(r4) */ |
| 178 | 0xda640108, /* stfd f19,264(r4) */ |
| 179 | 0xda840110, /* stfd f20,272(r4) */ |
| 180 | 0xdaa40118, /* stfd f21,280(r4) */ |
| 181 | 0xdac40120, /* stfd f22,288(r4) */ |
| 182 | 0xdae40128, /* stfd f23,296(r4) */ |
| 183 | 0xdb040130, /* stfd f24,304(r4) */ |
| 184 | 0xdb240138, /* stfd f25,312(r4) */ |
| 185 | 0xdb440140, /* stfd f26,320(r4) */ |
| 186 | 0xdb640148, /* stfd f27,328(r4) */ |
| 187 | 0xdb840150, /* stfd f28,336(r4) */ |
| 188 | 0xdba40158, /* stfd f29,344(r4) */ |
| 189 | 0xdbc40160, /* stfd f30,352(r4) */ |
| 190 | 0xdbe40168, /* stfd f31,360(r4) */ |
| 191 | 0xc9c300e0, /* lfd f14,224(r3) */ |
| 192 | 0xc9e300e8, /* lfd f15,232(r3) */ |
| 193 | 0xca0300f0, /* lfd f16,240(r3) */ |
| 194 | 0xca2300f8, /* lfd f17,248(r3) */ |
| 195 | 0xca430100, /* lfd f18,256(r3) */ |
| 196 | 0xca630108, /* lfd f19,264(r3) */ |
| 197 | 0xca830110, /* lfd f20,272(r3) */ |
| 198 | 0xcaa30118, /* lfd f21,280(r3) */ |
| 199 | 0xcac30120, /* lfd f22,288(r3) */ |
| 200 | 0xcae30128, /* lfd f23,296(r3) */ |
| 201 | 0xcb030130, /* lfd f24,304(r3) */ |
| 202 | 0xcb230138, /* lfd f25,312(r3) */ |
| 203 | 0xcb430140, /* lfd f26,320(r3) */ |
| 204 | 0xcb630148, /* lfd f27,328(r3) */ |
| 205 | 0xcb830150, /* lfd f28,336(r3) */ |
| 206 | 0xcba30158, /* lfd f29,344(r3) */ |
| 207 | 0xcbc30160, /* lfd f30,352(r3) */ |
| 208 | 0xcbe30168, /* lfd f31,360(r3) */ |
| 209 | #endif |
| 210 | |
| 211 | #ifdef __ALTIVEC__ |
| 212 | 0x7ca042a6, /* mfvrsave r5 */ |
| 213 | 0x39040180, /* addi r8,r4,384 */ |
| 214 | 0x39240190, /* addi r9,r4,400 */ |
| 215 | 0x70a00fff, /* andi. r0,r5,4095 */ |
| 216 | 0x90a40034, /* stw r5,52(r4) */ |
| 217 | 0x4182005c, /* beq- 2 */ |
| 218 | 0x7e8041ce, /* stvx v20,r0,r8 */ |
| 219 | 0x39080020, /* addi r8,r8,32 */ |
| 220 | 0x7ea049ce, /* stvx v21,r0,r9 */ |
| 221 | 0x39290020, /* addi r9,r9,32 */ |
| 222 | 0x7ec041ce, /* stvx v22,r0,r8 */ |
| 223 | 0x39080020, /* addi r8,r8,32 */ |
| 224 | 0x7ee049ce, /* stvx v23,r0,r9 */ |
| 225 | 0x39290020, /* addi r9,r9,32 */ |
| 226 | 0x7f0041ce, /* stvx v24,r0,r8 */ |
| 227 | 0x39080020, /* addi r8,r8,32 */ |
| 228 | 0x7f2049ce, /* stvx v25,r0,r9 */ |
| 229 | 0x39290020, /* addi r9,r9,32 */ |
| 230 | 0x7f4041ce, /* stvx v26,r0,r8 */ |
| 231 | 0x39080020, /* addi r8,r8,32 */ |
| 232 | 0x7f6049ce, /* stvx v27,r0,r9 */ |
| 233 | 0x39290020, /* addi r9,r9,32 */ |
| 234 | 0x7f8041ce, /* stvx v28,r0,r8 */ |
| 235 | 0x39080020, /* addi r8,r8,32 */ |
| 236 | 0x7fa049ce, /* stvx v29,r0,r9 */ |
| 237 | 0x39290020, /* addi r9,r9,32 */ |
| 238 | 0x7fc041ce, /* stvx v30,r0,r8 */ |
| 239 | 0x7fe049ce, /* stvx v31,r0,r9 */ |
| 240 | 0x80a30034,/*2:lwz r5,52(r3) */ |
| 241 | 0x39030180, /* addi r8,r3,384 */ |
| 242 | 0x39230190, /* addi r9,r3,400 */ |
| 243 | 0x70a00fff, /* andi. r0,r5,4095 */ |
| 244 | 0x7ca043a6, /* mtvrsave r5 */ |
| 245 | 0x4d820420, /* beqctr */ |
| 246 | 0x7e8040ce, /* lvx v20,r0,r8 */ |
| 247 | 0x39080020, /* addi r8,r8,32 */ |
| 248 | 0x7ea048ce, /* lvx v21,r0,r9 */ |
| 249 | 0x39290020, /* addi r9,r9,32 */ |
| 250 | 0x7ec040ce, /* lvx v22,r0,r8 */ |
| 251 | 0x39080020, /* addi r8,r8,32 */ |
| 252 | 0x7ee048ce, /* lvx v23,r0,r9 */ |
| 253 | 0x39290020, /* addi r9,r9,32 */ |
| 254 | 0x7f0040ce, /* lvx v24,r0,r8 */ |
| 255 | 0x39080020, /* addi r8,r8,32 */ |
| 256 | 0x7f2048ce, /* lvx v25,r0,r9 */ |
| 257 | 0x39290020, /* addi r9,r9,32 */ |
| 258 | 0x7f4040ce, /* lvx v26,r0,r8 */ |
| 259 | 0x39080020, /* addi r8,r8,32 */ |
| 260 | 0x7f6048ce, /* lvx v27,r0,r9 */ |
| 261 | 0x39290020, /* addi r9,r9,32 */ |
| 262 | 0x7f8040ce, /* lvx v28,r0,r8 */ |
| 263 | 0x39080020, /* addi r8,r8,32 */ |
| 264 | 0x7fa048ce, /* lvx v29,r0,r9 */ |
| 265 | 0x39290020, /* addi r9,r9,32 */ |
| 266 | 0x7fc040ce, /* lvx v30,r0,r8 */ |
| 267 | 0x7fe048ce, /* lvx v31,r0,r9 */ |
| 268 | #endif |
| 269 | |
| 270 | 0x4e800420, /* bctr */ |
| 271 | }; |
| 272 | |
| 273 | #if LIBCO_PPCDESC |
| 274 | /* Function call goes through indirect descriptor */ |
| 275 | #define CO_SWAP_ASM( x, y ) \ |
| 276 | ((void (*)( cothread_t, cothread_t )) (uintptr_t) x)( x, y ) |
| 277 | #else |
| 278 | /* Function call goes directly to code */ |
| 279 | #define CO_SWAP_ASM( x, y ) \ |
| 280 | ((void (*)( cothread_t, cothread_t )) (uintptr_t) libco_ppc_code)( x, y ) |
| 281 | #endif |
| 282 | |
| 283 | #endif |
| 284 | |
| 285 | static uint32_t* co_create_( unsigned size, uintptr_t entry ) |
| 286 | { |
| 287 | uint32_t* t = (uint32_t*) malloc( size ); |
| 288 | |
| 289 | (void) entry; |
| 290 | |
| 291 | #if LIBCO_PPCDESC |
| 292 | if ( t ) |
| 293 | { |
| 294 | /* Copy entry's descriptor */ |
| 295 | memcpy( t, (void*) entry, sizeof (void*) * 3 ); |
| 296 | |
| 297 | /* Set function pointer to swap routine */ |
| 298 | #ifdef LIBCO_PPC_ASM |
| 299 | *(const void**) t = *(void**) &co_swap_asm; |
| 300 | #else |
| 301 | *(const void**) t = libco_ppc_code; |
| 302 | #endif |
| 303 | } |
| 304 | #endif |
| 305 | |
| 306 | return t; |
| 307 | } |
| 308 | |
| 309 | cothread_t co_create( unsigned int size, void (*entry_)( void ) ) |
| 310 | { |
| 311 | uintptr_t entry = (uintptr_t) entry_; |
| 312 | uint32_t* t = NULL; |
| 313 | |
| 314 | /* Be sure main thread was successfully allocated */ |
| 315 | if ( co_active() ) |
| 316 | { |
| 317 | size += state_size + above_stack + stack_align; |
| 318 | t = co_create_( size, entry ); |
| 319 | } |
| 320 | |
| 321 | if ( t ) |
| 322 | { |
| 323 | uintptr_t sp; |
| 324 | int shift; |
| 325 | |
| 326 | /* Save current registers into new thread, so that any special ones will |
| 327 | have proper values when thread is begun */ |
| 328 | CO_SWAP_ASM( t, t ); |
| 329 | |
| 330 | #if LIBCO_PPCDESC |
| 331 | /* Get real address */ |
| 332 | entry = (uintptr_t) *(void**) entry; |
| 333 | #endif |
| 334 | |
| 335 | /* Put stack near end of block, and align */ |
| 336 | sp = (uintptr_t) t + size - above_stack; |
| 337 | sp -= sp % stack_align; |
| 338 | |
| 339 | /* On PPC32, we save and restore GPRs as 32 bits. For PPC64, we |
| 340 | save and restore them as 64 bits, regardless of the size the ABI |
| 341 | uses. So, we manually write pointers at the proper size. We always |
| 342 | save and restore at the same address, and since PPC is big-endian, |
| 343 | we must put the low byte first on PPC32. */ |
| 344 | |
| 345 | /* If uintptr_t is 32 bits, >>32 is undefined behavior, so we do two shifts |
| 346 | and don't have to care how many bits uintptr_t is. */ |
| 347 | #if LIBCO_PPC64 |
| 348 | shift = 16; |
| 349 | #else |
| 350 | shift = 0; |
| 351 | #endif |
| 352 | |
| 353 | /* Set up so entry will be called on next swap */ |
| 354 | t [8] = (uint32_t) (entry >> shift >> shift); |
| 355 | t [9] = (uint32_t) entry; |
| 356 | |
| 357 | t [10] = (uint32_t) (sp >> shift >> shift); |
| 358 | t [11] = (uint32_t) sp; |
| 359 | } |
| 360 | |
| 361 | return t; |
| 362 | } |
| 363 | |
| 364 | void co_delete( cothread_t t ) |
| 365 | { |
| 366 | free( t ); |
| 367 | } |
| 368 | |
| 369 | static void co_init_( void ) |
| 370 | { |
| 371 | #if LIBCO_MPROTECT |
| 372 | /* TODO: pre- and post-pad PPC code so that this doesn't make other |
| 373 | data executable and writable */ |
| 374 | long page_size = sysconf( _SC_PAGESIZE ); |
| 375 | if ( page_size > 0 ) |
| 376 | { |
| 377 | uintptr_t align = page_size; |
| 378 | uintptr_t begin = (uintptr_t) libco_ppc_code; |
| 379 | uintptr_t end = begin + sizeof libco_ppc_code; |
| 380 | |
| 381 | /* Align beginning and end */ |
| 382 | end += align - 1; |
| 383 | end -= end % align; |
| 384 | begin -= begin % align; |
| 385 | |
| 386 | mprotect( (void*) begin, end - begin, PROT_READ | PROT_WRITE | PROT_EXEC ); |
| 387 | } |
| 388 | #endif |
| 389 | |
| 390 | co_active_handle = co_create_( state_size, (uintptr_t) &co_switch ); |
| 391 | } |
| 392 | |
| 393 | cothread_t co_active() |
| 394 | { |
| 395 | if ( !co_active_handle ) |
| 396 | co_init_(); |
| 397 | |
| 398 | return co_active_handle; |
| 399 | } |
| 400 | |
| 401 | void co_switch( cothread_t t ) |
| 402 | { |
| 403 | cothread_t old = co_active_handle; |
| 404 | co_active_handle = t; |
| 405 | |
| 406 | CO_SWAP_ASM( t, old ); |
| 407 | } |
src/lib/cothread/amd64.c
| r0 | r12048 | |
| 1 | /* |
| 2 | libco.amd64 (2009-10-12) |
| 3 | author: byuu |
| 4 | license: public domain |
| 5 | */ |
| 6 | |
| 7 | #define LIBCO_C |
| 8 | #include "libco.h" |
| 9 | #include <assert.h> |
| 10 | #include <stdlib.h> |
| 11 | |
| 12 | #ifdef __cplusplus |
| 13 | extern "C" { |
| 14 | #endif |
| 15 | |
| 16 | static thread_local long long co_active_buffer[64]; |
| 17 | static thread_local cothread_t co_active_handle = 0; |
| 18 | static void (*co_swap)(cothread_t, cothread_t) = 0; |
| 19 | |
| 20 | #ifdef _WIN32 |
| 21 | //ABI: Win64 |
| 22 | static unsigned char co_swap_function[] = { |
| 23 | 0x48, 0x89, 0x22, 0x48, 0x8B, 0x21, 0x58, 0x48, 0x89, 0x6A, 0x08, 0x48, 0x89, 0x72, 0x10, 0x48, |
| 24 | 0x89, 0x7A, 0x18, 0x48, 0x89, 0x5A, 0x20, 0x4C, 0x89, 0x62, 0x28, 0x4C, 0x89, 0x6A, 0x30, 0x4C, |
| 25 | 0x89, 0x72, 0x38, 0x4C, 0x89, 0x7A, 0x40, 0x48, 0x81, 0xC2, 0x80, 0x00, 0x00, 0x00, 0x48, 0x83, |
| 26 | 0xE2, 0xF0, 0x0F, 0x29, 0x32, 0x0F, 0x29, 0x7A, 0x10, 0x44, 0x0F, 0x29, 0x42, 0x20, 0x44, 0x0F, |
| 27 | 0x29, 0x4A, 0x30, 0x44, 0x0F, 0x29, 0x52, 0x40, 0x44, 0x0F, 0x29, 0x5A, 0x50, 0x44, 0x0F, 0x29, |
| 28 | 0x62, 0x60, 0x44, 0x0F, 0x29, 0x6A, 0x70, 0x44, 0x0F, 0x29, 0xB2, 0x80, 0x00, 0x00, 0x00, 0x44, |
| 29 | 0x0F, 0x29, 0xBA, 0x90, 0x00, 0x00, 0x00, 0x48, 0x8B, 0x69, 0x08, 0x48, 0x8B, 0x71, 0x10, 0x48, |
| 30 | 0x8B, 0x79, 0x18, 0x48, 0x8B, 0x59, 0x20, 0x4C, 0x8B, 0x61, 0x28, 0x4C, 0x8B, 0x69, 0x30, 0x4C, |
| 31 | 0x8B, 0x71, 0x38, 0x4C, 0x8B, 0x79, 0x40, 0x48, 0x81, 0xC1, 0x80, 0x00, 0x00, 0x00, 0x48, 0x83, |
| 32 | 0xE1, 0xF0, 0x0F, 0x29, 0x31, 0x0F, 0x29, 0x79, 0x10, 0x44, 0x0F, 0x29, 0x41, 0x20, 0x44, 0x0F, |
| 33 | 0x29, 0x49, 0x30, 0x44, 0x0F, 0x29, 0x51, 0x40, 0x44, 0x0F, 0x29, 0x59, 0x50, 0x44, 0x0F, 0x29, |
| 34 | 0x61, 0x60, 0x44, 0x0F, 0x29, 0x69, 0x70, 0x44, 0x0F, 0x29, 0xB1, 0x80, 0x00, 0x00, 0x00, 0x44, |
| 35 | 0x0F, 0x29, 0xB9, 0x90, 0x00, 0x00, 0x00, 0xFF, 0xE0, |
| 36 | }; |
| 37 | |
| 38 | #include <windows.h> |
| 39 | |
| 40 | void co_init() { |
| 41 | DWORD old_privileges; |
| 42 | VirtualProtect(co_swap_function, sizeof co_swap_function, PAGE_EXECUTE_READWRITE, &old_privileges); |
| 43 | } |
| 44 | #else |
| 45 | //ABI: SystemV |
| 46 | static unsigned char co_swap_function[] = { |
| 47 | 0x48, 0x89, 0x26, 0x48, 0x8B, 0x27, 0x58, 0x48, 0x89, 0x6E, 0x08, 0x48, 0x89, 0x5E, 0x10, 0x4C, |
| 48 | 0x89, 0x66, 0x18, 0x4C, 0x89, 0x6E, 0x20, 0x4C, 0x89, 0x76, 0x28, 0x4C, 0x89, 0x7E, 0x30, 0x48, |
| 49 | 0x8B, 0x6F, 0x08, 0x48, 0x8B, 0x5F, 0x10, 0x4C, 0x8B, 0x67, 0x18, 0x4C, 0x8B, 0x6F, 0x20, 0x4C, |
| 50 | 0x8B, 0x77, 0x28, 0x4C, 0x8B, 0x7F, 0x30, 0xFF, 0xE0, |
| 51 | }; |
| 52 | |
| 53 | #include <unistd.h> |
| 54 | #include <sys/mman.h> |
| 55 | |
| 56 | void co_init() { |
| 57 | unsigned long long addr = (unsigned long long)co_swap_function; |
| 58 | unsigned long long base = addr - (addr % sysconf(_SC_PAGESIZE)); |
| 59 | unsigned long long size = (addr - base) + sizeof co_swap_function; |
| 60 | mprotect((void*)base, size, PROT_READ | PROT_WRITE | PROT_EXEC); |
| 61 | } |
| 62 | #endif |
| 63 | |
| 64 | static void crash() { |
| 65 | assert(0); /* called only if cothread_t entrypoint returns */ |
| 66 | } |
| 67 | |
| 68 | cothread_t co_active() { |
| 69 | if(!co_active_handle) co_active_handle = &co_active_buffer; |
| 70 | return co_active_handle; |
| 71 | } |
| 72 | |
| 73 | cothread_t co_create(unsigned int size, void (*entrypoint)(void)) { |
| 74 | cothread_t handle; |
| 75 | if(!co_swap) { |
| 76 | co_init(); |
| 77 | co_swap = (void (*)(cothread_t, cothread_t))co_swap_function; |
| 78 | } |
| 79 | if(!co_active_handle) co_active_handle = &co_active_buffer; |
| 80 | size += 512; /* allocate additional space for storage */ |
| 81 | size &= ~15; /* align stack to 16-byte boundary */ |
| 82 | |
| 83 | if(handle = (cothread_t)malloc(size)) { |
| 84 | long long *p = (long long*)((char*)handle + size); /* seek to top of stack */ |
| 85 | *--p = (long long)crash; /* crash if entrypoint returns */ |
| 86 | *--p = (long long)entrypoint; /* start of function */ |
| 87 | *(long long*)handle = (long long)p; /* stack pointer */ |
| 88 | } |
| 89 | |
| 90 | return handle; |
| 91 | } |
| 92 | |
| 93 | void co_delete(cothread_t handle) { |
| 94 | free(handle); |
| 95 | } |
| 96 | |
| 97 | void co_switch(cothread_t handle) { |
| 98 | register cothread_t co_previous_handle = co_active_handle; |
| 99 | co_swap(co_active_handle = handle, co_previous_handle); |
| 100 | } |
| 101 | |
| 102 | #ifdef __cplusplus |
| 103 | } |
| 104 | #endif |