diff --git a/src/mame/drivers/kopunch.c b/src/mame/drivers/kopunch.c index 3104232ca6e..25af44b96ca 100644 --- a/src/mame/drivers/kopunch.c +++ b/src/mame/drivers/kopunch.c @@ -156,16 +156,27 @@ static const gfx_layout charlayout = 8*8 }; +static const gfx_layout charlayoutbig = +{ + 16,16, + RGN_FRAC(1,3), + 3, + { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) }, + { 7,7, 6,6, 5,5, 4,4, 3,3, 2,2, 1,1, 0,0 }, + { 0*8,0*8, 1*8,1*8, 2*8,2*8, 3*8,3*8, 4*8,4*8, 5*8,5*8, 6*8,6*8, 7*8,7*8 }, + 8*8 +}; + static GFXDECODE_START( kopunch ) GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) - GFXDECODE_ENTRY( "gfx2", 0, charlayout, 0, 1 ) + GFXDECODE_ENTRY( "gfx2", 0, charlayoutbig, 0, 1 ) GFXDECODE_END static MACHINE_DRIVER_START( kopunch ) /* basic machine hardware */ - MDRV_CPU_ADD("main", 8080, 4000000) /* 4 MHz ???? appears to use 8080 instructions, not z80 */ + MDRV_CPU_ADD("main", 8080, 4000000) /* 4 MHz ???? uses 8080 instructions, not z80 */ MDRV_CPU_PROGRAM_MAP(kopunch_map,0) MDRV_CPU_IO_MAP(kopunch_io_map,0) MDRV_CPU_VBLANK_INT_HACK(kopunch_interrupt,4) /* ??? */ @@ -219,24 +230,4 @@ ROM_START( kopunch ) ROM_LOAD( "epr1100", 0x0040, 0x0020, CRC(bedb66b1) SHA1(8e78bb205d900075b761e1baa5f5813174ff28ba) ) /* unknown */ ROM_END - -static DRIVER_INIT( kopunch ) -{ -// UINT8 *rom = memory_region(machine, "main"); - - /* It looks like there is a security chip, that changes instruction of the form: - 0334: 3E 0C ld a,$0C - 0336: 30 FB jr nc,$0333 - into something else (maybe just a nop) with the effect of resuming execution - from the operand of the JR NC instruction (in the example above, 0337). - For now, I'm just patching the affected instructions. */ - -/* rom[0x119] = 0; - rom[0x336] = 0; - rom[0x381] = 0; - rom[0xf0b] = 0; - rom[0xf33] = 0;*/ -} - - -GAME( 1981, kopunch, 0, kopunch, kopunch, kopunch, ROT270, "Sega", "KO Punch", GAME_NO_SOUND | GAME_NOT_WORKING) +GAME( 1981, kopunch, 0, kopunch, kopunch, 0, ROT270, "Sega", "KO Punch", GAME_NO_SOUND | GAME_NOT_WORKING) diff --git a/src/mame/video/kopunch.c b/src/mame/video/kopunch.c index 9d1c19a25ac..515e15b7d98 100644 --- a/src/mame/video/kopunch.c +++ b/src/mame/video/kopunch.c @@ -2,8 +2,7 @@ UINT8 *kopunch_videoram2; -static INT8 scroll[2]; // REMOVE -static int gfxbank, gfxflip; +static int gfxbank; static tilemap *bg_tilemap, *fg_tilemap; @@ -40,25 +39,23 @@ PALETTE_INIT( kopunch ) WRITE8_HANDLER( kopunch_videoram_w ) { videoram[offset] = data; - tilemap_mark_tile_dirty(bg_tilemap, offset); + tilemap_mark_tile_dirty(fg_tilemap, offset); } WRITE8_HANDLER( kopunch_videoram2_w ) { kopunch_videoram2[offset] = data; - tilemap_mark_tile_dirty(fg_tilemap, offset); + tilemap_mark_tile_dirty(bg_tilemap, offset); } WRITE8_HANDLER( kopunch_scroll_x_w ) { - scroll[0] = data; // REMOVE - tilemap_set_scrollx(fg_tilemap, 0, data); + tilemap_set_scrollx(bg_tilemap, 0, data); } WRITE8_HANDLER( kopunch_scroll_y_w ) { - scroll[1] = data; // REMOVE - tilemap_set_scrolly(fg_tilemap, 0, data); + tilemap_set_scrolly(bg_tilemap, 0, data); } WRITE8_HANDLER( kopunch_gfxbank_w ) @@ -66,22 +63,20 @@ WRITE8_HANDLER( kopunch_gfxbank_w ) if (gfxbank != (data & 0x07)) { gfxbank = data & 0x07; - tilemap_mark_all_tiles_dirty(fg_tilemap); + tilemap_mark_all_tiles_dirty(bg_tilemap); } - gfxflip = data & 0x08; // REMOVE - - tilemap_set_flip(fg_tilemap, (data & 0x08) ? TILEMAP_FLIPY : 0); + tilemap_set_flip(bg_tilemap, (data & 0x08) ? TILEMAP_FLIPY : 0); } -static TILE_GET_INFO( get_bg_tile_info ) +static TILE_GET_INFO( get_fg_tile_info ) { int code = videoram[tile_index]; SET_TILE_INFO(0, code, 0, 0); } -static TILE_GET_INFO( get_fg_tile_info ) +static TILE_GET_INFO( get_bg_tile_info ) { int code = (kopunch_videoram2[tile_index] & 0x7f) + 128 * gfxbank; @@ -90,35 +85,18 @@ static TILE_GET_INFO( get_fg_tile_info ) VIDEO_START( kopunch ) { - bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, - 8, 8, 32, 32); - - fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, - 8, 8, 16, 16); + fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); + bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 16, 16, 16, 16); tilemap_set_transparent_pen(fg_tilemap, 0); + + tilemap_set_scrolldx(bg_tilemap, 16, 16); } VIDEO_UPDATE( kopunch ) { - int offs; - tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); - //tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); + tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); - for (offs = 1023;offs >= 0;offs--) - { - int sx,sy; - - sx = offs % 16; - sy = offs / 16; - - drawgfx(bitmap,screen->machine->gfx[1], - (kopunch_videoram2[offs] & 0x7f) + 128 * gfxbank, - 0, - 0,gfxflip, - 8*(sx+8)+scroll[0],8*(8+(gfxflip ? 15-sy : sy))+scroll[1], - cliprect,TRANSPARENCY_PEN,0); - } return 0; }