#include "emu.h" #include "video/konicdev.h" #include "includes/bottom9.h" /*************************************************************************** Callbacks for the K052109 ***************************************************************************/ void bottom9_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority ) { bottom9_state *state = machine.driver_data(); *code |= (*color & 0x3f) << 8; *color = state->m_layer_colorbase[layer] + ((*color & 0xc0) >> 6); } /*************************************************************************** Callbacks for the K051960 ***************************************************************************/ void bottom9_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow ) { /* bit 4 = priority over zoom (0 = have priority) */ /* bit 5 = priority over B (1 = have priority) */ bottom9_state *state = machine.driver_data(); *priority = (*color & 0x30) >> 4; *color = state->m_sprite_colorbase + (*color & 0x0f); } /*************************************************************************** Callbacks for the K051316 ***************************************************************************/ void bottom9_zoom_callback( running_machine &machine, int *code, int *color, int *flags ) { bottom9_state *state = machine.driver_data(); *flags = (*color & 0x40) ? TILE_FLIPX : 0; *code |= ((*color & 0x03) << 8); *color = state->m_zoom_colorbase + ((*color & 0x3c) >> 2); } /*************************************************************************** Start the video hardware emulation. ***************************************************************************/ VIDEO_START( bottom9 ) { bottom9_state *state = machine.driver_data(); state->m_layer_colorbase[0] = 0; /* not used */ state->m_layer_colorbase[1] = 0; state->m_layer_colorbase[2] = 16; state->m_sprite_colorbase = 32; state->m_zoom_colorbase = 48; } /*************************************************************************** Display refresh ***************************************************************************/ SCREEN_UPDATE( bottom9 ) { bottom9_state *state = screen->machine().driver_data(); k052109_tilemap_update(state->m_k052109); /* note: FIX layer is not used */ bitmap_fill(bitmap, cliprect, state->m_layer_colorbase[1]); // if (state->m_video_enable) { k051960_sprites_draw(state->m_k051960, bitmap, cliprect, 1, 1); k051316_zoom_draw(state->m_k051316, bitmap, cliprect, 0, 0); k051960_sprites_draw(state->m_k051960, bitmap, cliprect, 0, 0); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 0); /* note that priority 3 is opposite to the basic layer priority! */ /* (it IS used, but hopefully has no effect) */ k051960_sprites_draw(state->m_k051960, bitmap, cliprect, 2, 3); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, 0, 0); } return 0; }