From 4a8e6794a00e4f676aaa28b07aefee34cc124738 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 12 Feb 2013 10:06:05 +0000 Subject: [PATCH] Modernization of drivers part 16 (no whatsnew) --- src/mame/drivers/qix.c | 6 +++--- src/mame/includes/qix.h | 4 ++++ src/mame/includes/quizdna.h | 1 + src/mame/video/qix.c | 8 ++++---- src/mame/video/quizdna.c | 14 +++++++------- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/mame/drivers/qix.c b/src/mame/drivers/qix.c index a1161b5e214..c5b066bbee1 100644 --- a/src/mame/drivers/qix.c +++ b/src/mame/drivers/qix.c @@ -1195,7 +1195,7 @@ static const UINT8 xor2_table[] = 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,11, 6,99, }; -static int kram3_permut1(int idx, int value) +int qix_state::kram3_permut1(int idx, int value) { switch (idx) { @@ -1207,7 +1207,7 @@ static int kram3_permut1(int idx, int value) } } -static int kram3_permut2(int tbl_index, int idx, const UINT8 *xor_table) +int qix_state::kram3_permut2(int tbl_index, int idx, const UINT8 *xor_table) { int xorval = 0; @@ -1228,7 +1228,7 @@ static int kram3_permut2(int tbl_index, int idx, const UINT8 *xor_table) return xorval; } -static int kram3_decrypt(int address, int value) +int qix_state::kram3_decrypt(int address, int value) { int indx1 = (BIT(address,1) << 1) | BIT(address,5); int indx2 = (BIT(address,7) << 1) | BIT(address,3); diff --git a/src/mame/includes/qix.h b/src/mame/includes/qix.h index f7ceac5cc9f..45a92c8697f 100644 --- a/src/mame/includes/qix.h +++ b/src/mame/includes/qix.h @@ -124,6 +124,10 @@ public: DECLARE_WRITE8_MEMBER(slither_coinctl_w); DECLARE_WRITE_LINE_MEMBER(qix_pia_dint); DECLARE_WRITE_LINE_MEMBER(qix_pia_sint); + void get_pens(pen_t *pens); + int kram3_permut1(int idx, int value); + int kram3_permut2(int tbl_index, int idx, const UINT8 *xor_table); + int kram3_decrypt(int address, int value); }; diff --git a/src/mame/includes/quizdna.h b/src/mame/includes/quizdna.h index 396a559c4be..c9ee2c1b6cf 100644 --- a/src/mame/includes/quizdna.h +++ b/src/mame/includes/quizdna.h @@ -25,4 +25,5 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void video_start(); UINT32 screen_update_quizdna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c index 70a7ba9dce3..d98250db596 100644 --- a/src/mame/video/qix.c +++ b/src/mame/video/qix.c @@ -225,7 +225,7 @@ WRITE8_MEMBER(qix_state::qix_palettebank_w) } -static void get_pens(qix_state *state, pen_t *pens) +void qix_state::get_pens( pen_t *pens) { offs_t offs; @@ -252,11 +252,11 @@ static void get_pens(qix_state *state, pen_t *pens) 0xff /* value = 3, intensity = 3 */ }; - for (offs = state->m_palette_bank << 8; offs < (state->m_palette_bank << 8) + NUM_PENS; offs++) + for (offs = m_palette_bank << 8; offs < (m_palette_bank << 8) + NUM_PENS; offs++) { int bits, intensity, r, g, b; - UINT8 data = state->m_paletteram[offs]; + UINT8 data = m_paletteram[offs]; /* compute R, G, B from the table */ intensity = (data >> 0) & 0x03; @@ -291,7 +291,7 @@ static MC6845_BEGIN_UPDATE( begin_update ) #endif /* create the pens */ - get_pens(state, state->m_pens); + state->get_pens(state->m_pens); return state->m_pens; } diff --git a/src/mame/video/quizdna.c b/src/mame/video/quizdna.c index b81ea6d0ded..5ee6b450b83 100644 --- a/src/mame/video/quizdna.c +++ b/src/mame/video/quizdna.c @@ -130,13 +130,13 @@ WRITE8_MEMBER(quizdna_state::paletteram_xBGR_RRRR_GGGG_BBBB_w) palette_set_color_rgb(machine(),offs/2,pal5bit(r),pal5bit(g),pal5bit(b)); } -static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) +void quizdna_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - quizdna_state *state = machine.driver_data(); - UINT8 *spriteram = state->m_spriteram; +//OBRISI.ME + UINT8 *spriteram = m_spriteram; int offs; - for (offs = 0; offsm_spriteram.bytes(); offs+=8) + for (offs = 0; offsm_flipscreen) + if (m_flipscreen) { x -= 7; y += 1; @@ -173,7 +173,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r { y &= 0x1ff; - drawgfx_transpen(bitmap,cliprect,machine.gfx[2], + drawgfx_transpen(bitmap,cliprect,machine().gfx[2], code ^ i, col, fx,fy, @@ -189,7 +189,7 @@ UINT32 quizdna_state::screen_update_quizdna(screen_device &screen, bitmap_ind16 if (m_video_enable) { m_bg_tilemap->draw(bitmap, cliprect, 0, 0); - draw_sprites(machine(), bitmap, cliprect); + draw_sprites(bitmap, cliprect); m_fg_tilemap->draw(bitmap, cliprect, 0, 0); } else