summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Zsolt Vasvari <zsoltvas@mamedev.org>2008-03-04 03:51:03 +0000
committer Zsolt Vasvari <zsoltvas@mamedev.org>2008-03-04 03:51:03 +0000
commit77ed3a81efa2e0179cb7fbc28ff1d7eebb094538 (patch)
tree44d7831af05504ed920be962a2500950bcb7dd0f
parent4ce1310abbd1f944ff4d90c76f80b568a69d4626 (diff)
Uses PORT_CHANGED
Cheeky Mouse: tilemap conversion
-rw-r--r--src/mame/drivers/astrof.c62
-rw-r--r--src/mame/drivers/cheekyms.c55
-rw-r--r--src/mame/video/cheekyms.c214
3 files changed, 165 insertions, 166 deletions
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index d024e2d08bf..303319c2150 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -123,21 +123,18 @@ static void start_irq_timer(void)
*
*************************************/
-static INTERRUPT_GEN( coin_nmi )
+static INPUT_CHANGED( coin_inserted )
{
- UINT32 coin = readinputportbytag("COIN");
- UINT32 service = readinputportbytag("SERVICE");
+ /* coin insertion causes an NMI */
+ cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
+ coin_counter_w(0, newval);
+}
- /* both the coin input and the serice credit generates an NMI */
- if (coin || service)
- cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
- /* the coin input is also connected to the coin counter */
- if (coin)
- {
- coin_counter_w(0, 1);
- coin_counter_w(0, 0);
- }
+static INPUT_CHANGED( service_coin_inserted )
+{
+ /* service coin insertion causes an NMI */
+ cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
}
@@ -614,11 +611,8 @@ static INPUT_PORTS_START( astrof )
PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
- PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
-
- PORT_START_TAG("SERVICE")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0)
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("FLIP")
@@ -676,11 +670,8 @@ static INPUT_PORTS_START( abattle )
PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
- PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
-
- PORT_START_TAG("SERVICE")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0)
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("FLIP")
@@ -739,11 +730,8 @@ static INPUT_PORTS_START( spfghmk2 )
PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
- PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
-
- PORT_START_TAG("SERVICE")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0)
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("FLIP")
@@ -802,11 +790,8 @@ static INPUT_PORTS_START( spfgmk22 )
PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
- PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
-
- PORT_START_TAG("SERVICE")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0)
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("FLIP")
@@ -856,11 +841,8 @@ static INPUT_PORTS_START( tomahawk )
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
PORT_START_TAG("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
- PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
-
- PORT_START_TAG("SERVICE")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_CHANGED(service_coin_inserted, 0)
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START_TAG("FLIP")
@@ -882,7 +864,6 @@ static MACHINE_DRIVER_START( base )
/* basic machine hardware */
MDRV_CPU_ADD_TAG("main", M6502, MAIN_CPU_CLOCK)
- MDRV_CPU_VBLANK_INT("main", coin_nmi)
MDRV_MACHINE_RESET(astrof)
@@ -892,7 +873,6 @@ static MACHINE_DRIVER_START( base )
MDRV_SCREEN_ADD("main", RASTER)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
-
MACHINE_DRIVER_END
@@ -910,7 +890,6 @@ static MACHINE_DRIVER_START( astrof )
/* audio hardware */
MDRV_IMPORT_FROM(astrof_audio)
-
MACHINE_DRIVER_END
@@ -921,7 +900,6 @@ static MACHINE_DRIVER_START( abattle )
MDRV_MACHINE_START(abattle)
MDRV_MACHINE_RESET(abattle)
-
MACHINE_DRIVER_END
@@ -939,7 +917,6 @@ static MACHINE_DRIVER_START( spfghmk2 )
/* audio hardware */
MDRV_IMPORT_FROM(spfghmk2_audio)
-
MACHINE_DRIVER_END
@@ -957,7 +934,6 @@ static MACHINE_DRIVER_START( tomahawk )
/* audio hardware */
MDRV_IMPORT_FROM(tomahawk_audio)
-
MACHINE_DRIVER_END
diff --git a/src/mame/drivers/cheekyms.c b/src/mame/drivers/cheekyms.c
index 31f2c85db1c..c263c18fa84 100644
--- a/src/mame/drivers/cheekyms.c
+++ b/src/mame/drivers/cheekyms.c
@@ -2,7 +2,7 @@
Universal Cheeky Mouse Driver
(c)Lee Taylor May/June 1998, All rights reserved.
- For use only in offical Mame releases.
+ For use only in offical MAME releases.
Not to be distributed as part of any commerical work.
**************************************************************************/
@@ -10,39 +10,42 @@
#include "sound/dac.h"
+extern UINT8 *cheekyms_videoram;
+extern UINT8 *cheekyms_spriteram;
+extern UINT8 *cheekyms_port_80;
PALETTE_INIT( cheekyms );
+VIDEO_START( cheekyms );
VIDEO_UPDATE( cheekyms );
-WRITE8_HANDLER( cheekyms_sprite_w );
WRITE8_HANDLER( cheekyms_port_40_w );
WRITE8_HANDLER( cheekyms_port_80_w );
-static ADDRESS_MAP_START( addressmap, ADDRESS_SPACE_PROGRAM, 8 )
+
+static INPUT_CHANGED( coin_inserted )
+{
+ /* this starts a 556 one-shot timer (and triggers a sound effect) */
+ if (newval)
+ cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
+}
+
+
+static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x3000, 0x33ff) AM_RAM
- AM_RANGE(0x3800, 0x3bff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
+ AM_RANGE(0x3800, 0x3bff) AM_RAM AM_BASE(&cheekyms_videoram)
ADDRESS_MAP_END
-static ADDRESS_MAP_START( portmap, ADDRESS_SPACE_IO, 8 )
+static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
- AM_RANGE(0x20, 0x3f) AM_WRITE(cheekyms_sprite_w)
+ AM_RANGE(0x20, 0x3f) AM_WRITE(MWA8_RAM) AM_BASE(&cheekyms_spriteram)
AM_RANGE(0x40, 0x40) AM_WRITE(cheekyms_port_40_w)
- AM_RANGE(0x80, 0x80) AM_WRITE(cheekyms_port_80_w)
+ AM_RANGE(0x80, 0x80) AM_WRITE(cheekyms_port_80_w) AM_BASE(&cheekyms_port_80)
ADDRESS_MAP_END
-static INTERRUPT_GEN( cheekyms_interrupt )
-{
- if (readinputport(2) & 1) /* Coin */
- nmi_line_pulse(machine, cpunum);
- else
- irq0_line_hold(machine, cpunum);
-}
-
-
static INPUT_PORTS_START( cheekyms )
PORT_START /* IN0 */
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
@@ -54,7 +57,7 @@ static INPUT_PORTS_START( cheekyms )
PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) )
-//PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
+ //PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x10, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
@@ -78,12 +81,7 @@ static INPUT_PORTS_START( cheekyms )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_START /* FAKE */
- /* The coin slots are not memory mapped. Coin causes a NMI, */
- /* This fake input port is used by the interrupt */
- /* handler to be notified of coin insertions. We use IMPULSE to */
- /* trigger exactly one interrupt, without having to check when the */
- /* user releases the key. */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
INPUT_PORTS_END
@@ -123,9 +121,9 @@ static MACHINE_DRIVER_START( cheekyms )
/* basic machine hardware */
MDRV_CPU_ADD(Z80,5000000/2) /* 2.5 MHz */
- MDRV_CPU_PROGRAM_MAP(addressmap,0)
- MDRV_CPU_IO_MAP(portmap,0)
- MDRV_CPU_VBLANK_INT("main", cheekyms_interrupt)
+ MDRV_CPU_PROGRAM_MAP(main_map,0)
+ MDRV_CPU_IO_MAP(io_map,0)
+ MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
@@ -139,9 +137,10 @@ static MACHINE_DRIVER_START( cheekyms )
MDRV_PALETTE_LENGTH(0xc0)
MDRV_PALETTE_INIT(cheekyms)
+ MDRV_VIDEO_START(cheekyms)
MDRV_VIDEO_UPDATE(cheekyms)
- /* sound hardware */
+ /* audio hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
MDRV_SOUND_ADD(DAC, 0)
@@ -180,4 +179,4 @@ ROM_END
-GAME( 1980?, cheekyms, 0, cheekyms, cheekyms, 0, ROT270, "Universal", "Cheeky Mouse", GAME_IMPERFECT_SOUND )
+GAME( 1980, cheekyms, 0, cheekyms, cheekyms, 0, ROT270, "Universal", "Cheeky Mouse", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/video/cheekyms.c b/src/mame/video/cheekyms.c
index d950690f1c8..4aa3c3c5316 100644
--- a/src/mame/video/cheekyms.c
+++ b/src/mame/video/cheekyms.c
@@ -2,7 +2,7 @@
Universal Cheeky Mouse Driver
(c)Lee Taylor May 1998, All rights reserved.
- For use only in offical Mame releases.
+ For use only in offical MAME releases.
Not to be distrabuted as part of any commerical work.
***************************************************************************
Functions to emulate the video hardware of the machine.
@@ -12,10 +12,15 @@ Functions to emulate the video hardware of the machine.
#include "sound/dac.h"
-static int man_scroll = -1;
-static UINT8 sprites[0x20];
-static int char_palette = 0;
+UINT8 *cheekyms_videoram;
+UINT8 *cheekyms_spriteram;
+UINT8 *cheekyms_port_80;
+static tilemap *cheekyms_tilemap;
+
+
+/* bit 3 and 7 of the char color PROMs are used for something -- not currently emulated -
+ thus GAME_IMPERFECT_GRAPHICS */
PALETTE_INIT( cheekyms )
{
@@ -41,137 +46,156 @@ PALETTE_INIT( cheekyms )
}
-WRITE8_HANDLER( cheekyms_sprite_w )
-{
- sprites[offset] = data;
-}
-
-
WRITE8_HANDLER( cheekyms_port_40_w )
{
- static int last_dac = -1;
+ /* the lower bits probably trigger sound samples */
- /* The lower bits probably trigger sound samples */
-
- if (last_dac != (data & 0x80))
- {
- last_dac = data & 0x80;
-
- DAC_data_w(0, last_dac ? 0x80 : 0);
- }
+ DAC_data_w(0, data ? 0x80 : 0);
}
WRITE8_HANDLER( cheekyms_port_80_w )
{
- /* Bits 0-1 Sound enables, not sure which bit is which */
+ /* d0-d1 - sound enables, not sure which bit is which */
+ /* d3-d5 - man scroll amount */
+ /* d6 - palette select (selects either 0 = PROM M9, 1 = PROM M8) */
+ /* d7 - screen flip */
+ *cheekyms_port_80 = data;
- /* Bit 2 is interrupt enable */
+ /* d2 - interrupt enable */
interrupt_enable_w(offset, data & 0x04);
+}
- /* Bit 3-5 Man scroll amount */
- man_scroll = (data >> 3) & 0x07;
- /* Bit 6 is palette select (Selects either 0 = PROM M9, 1 = PROM M8) */
- char_palette = (data >> 2) & 0x10;
- /* Bit 7 is screen flip */
- flip_screen_set(data & 0x80);
-}
+static TILE_GET_INFO( cheekyms_get_tile_info )
+{
+ int color;
+
+ int x = tile_index & 0x1f;
+ int y = tile_index >> 5;
+ int code = cheekyms_videoram[tile_index];
+ int palette = (*cheekyms_port_80 >> 2) & 0x10;
+
+ if (x >= 0x1e)
+ {
+ if (y < 0x0c)
+ color = 0x15;
+ else if (y < 0x14)
+ color = 0x16;
+ else
+ color = 0x14;
+ }
+ else
+ {
+ if ((y == 0x04) || (y == 0x1b))
+ color = palette | 0x0c;
+ else
+ color = palette | (x >> 1);
+ }
+ SET_TILE_INFO(0, code, color, 0);
+}
-VIDEO_UPDATE( cheekyms )
+VIDEO_START( cheekyms )
{
- int offs;
+ cheekyms_tilemap = tilemap_create(cheekyms_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
+ tilemap_set_transparent_pen(cheekyms_tilemap, 0);
+}
- fillbitmap(bitmap,0,cliprect);
+static void draw_sprites(gfx_element **gfx, bitmap_t *bitmap, const rectangle *cliprect, int flip)
+{
+ offs_t offs;
- /* Draw the sprites first, because they're supposed to appear below
- the characters */
- for (offs = 0; offs < sizeof(sprites)/sizeof(sprites[0]); offs += 4)
+ for (offs = 0; offs < 0x20; offs += 4)
{
- int v1, sx, sy, col, code;
-
- v1 = sprites[offs + 0];
- sy = sprites[offs + 1];
- sx = 256 - sprites[offs + 2];
- col = (~sprites[offs + 3] & 0x07);
+ int x, y, code, color;
- if (!(sprites[offs + 3] & 0x08)) continue;
+ if ((cheekyms_spriteram[offs + 3] & 0x08) == 0x00) continue;
- code = (~v1 << 1) & 0x1f;
+ x = 256 - cheekyms_spriteram[offs + 2];
+ y = cheekyms_spriteram[offs + 1];
+ code = (~cheekyms_spriteram[offs + 0] & 0x0f) << 1;
+ color = (~cheekyms_spriteram[offs + 3] & 0x07);
- if (v1 & 0x80)
+ if (cheekyms_spriteram[offs + 0] & 0x80)
{
- if (!flip_screen_get())
+ if (!flip)
code++;
- drawgfx(bitmap,machine->gfx[1],
- code,
- col,
- 0,0,
- sx,sy,
- cliprect,TRANSPARENCY_PEN,0);
+ drawgfx(bitmap, gfx[1], code, color, 0, 0, x, y, cliprect, TRANSPARENCY_PEN, 0);
}
else
{
- drawgfx(bitmap,machine->gfx[1],
- code + 0x20,
- col,
- 0,0,
- sx,sy,
- cliprect,TRANSPARENCY_PEN,0);
-
- drawgfx(bitmap,machine->gfx[1],
- code + 0x21,
- col,
- 0,0,
- sx + 8*(v1 & 2),sy + 8*(~v1 & 2),
- cliprect,TRANSPARENCY_PEN,0);
+ if (cheekyms_spriteram[offs + 0] & 0x02)
+ {
+ drawgfx(bitmap, gfx[1], code | 0x20, color, 0, 0, x, y, cliprect, TRANSPARENCY_PEN, 0);
+ drawgfx(bitmap, gfx[1], code | 0x21, color, 0, 0, 0x10 + x, y, cliprect, TRANSPARENCY_PEN, 0);
+ }
+ else
+ {
+ drawgfx(bitmap, gfx[1], code | 0x20, color, 0, 0, x, y, cliprect, TRANSPARENCY_PEN, 0);
+ drawgfx(bitmap, gfx[1], code | 0x21, color, 0, 0, x, 0x10 + y, cliprect, TRANSPARENCY_PEN, 0);
+ }
}
}
+}
- for (offs = videoram_size - 1;offs >= 0;offs--)
- {
- int sx,sy,man_area,color;
+VIDEO_UPDATE( cheekyms )
+{
+ #define SCROLL_X_MIN 8
+ #define SCROLL_X_MAX 12
+ #define SCROLL_Y_MIN 6
+ #define SCROLL_Y_MAX 25
- sx = offs % 32;
- sy = offs / 32;
+ const rectangle clip_no_scroll_top = { 0*8, 32*8-1, 0*8, SCROLL_Y_MIN*8-1 };
+ const rectangle clip_no_scroll_bottom = { 0*8, 32*8-1, (SCROLL_Y_MAX+1)*8, 32*8-1 };
+ const rectangle clip_no_scroll_left_nf = { 0*8, SCROLL_X_MIN*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
+ const rectangle clip_no_scroll_right_nf = { (SCROLL_X_MAX+1)*8, 32*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
+ const rectangle clip_no_scroll_left_f = { (32-SCROLL_X_MIN)*8, 32*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
+ const rectangle clip_no_scroll_right_f = { 0*8, (32-SCROLL_X_MAX-1)*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
+ const rectangle clip_scroll_nf = { SCROLL_X_MIN*8, 13*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
+ const rectangle clip_scroll_f = { (32-SCROLL_X_MAX-1)*8, (32-SCROLL_X_MIN)*8-1, SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
+ int flip = *cheekyms_port_80 & 0x80;
- man_area = ((sy >= 6) && (sy <= 26) && (sx >= 8) && (sx <= 12));
+ tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
+ tilemap_set_flip(ALL_TILEMAPS, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
- if (sx >= 30)
- {
- if (sy < 12)
- color = 0x15;
- else if (sy < 20)
- color = 0x16;
- else
- color = 0x14;
- }
- else
- {
- color = ((sx >> 1) & 0x0f) + char_palette;
- if (sy == 4 || sy == 27)
- color = 0xc + char_palette;
- }
+ fillbitmap(bitmap, 0, cliprect);
- if (flip_screen_get())
- {
- sx = 31 - sx;
- sy = 31 - sy;
- }
+ /* sprites go under the playfield */
+ draw_sprites(machine->gfx, bitmap, cliprect, flip);
+
+ /* draw the non-scrolling parts of the playfield first */
+ tilemap_set_scrolly(cheekyms_tilemap, 0, 0);
+ tilemap_draw(bitmap, &clip_no_scroll_top, cheekyms_tilemap, 0, 0);
+ tilemap_draw(bitmap, &clip_no_scroll_bottom, cheekyms_tilemap, 0, 0);
+
+ if (flip)
+ {
+ tilemap_draw(bitmap, &clip_no_scroll_left_f, cheekyms_tilemap, 0, 0);
+ tilemap_draw(bitmap, &clip_no_scroll_right_f, cheekyms_tilemap, 0, 0);
+ }
+ else
+ {
+ tilemap_draw(bitmap, &clip_no_scroll_left_nf, cheekyms_tilemap, 0, 0);
+ tilemap_draw(bitmap, &clip_no_scroll_right_nf, cheekyms_tilemap, 0, 0);
+ }
- drawgfx(bitmap,machine->gfx[0],
- videoram[offs],
- color,
- flip_screen_get(),flip_screen_get(),
- 8*sx, 8*sy - (man_area ? man_scroll : 0),
- cliprect,TRANSPARENCY_PEN,0);
+ /* now the scrolling part */
+ if (flip)
+ {
+ tilemap_set_scrolly(cheekyms_tilemap, 0, -((*cheekyms_port_80 >> 3) & 0x07));
+ tilemap_draw(bitmap, &clip_scroll_f, cheekyms_tilemap, 0, 0);
+ }
+ else
+ {
+ tilemap_set_scrolly(cheekyms_tilemap, 0, (*cheekyms_port_80 >> 3) & 0x07);
+ tilemap_draw(bitmap, &clip_scroll_nf, cheekyms_tilemap, 0, 0);
}
return 0;