trunk/src/mame/video/fastfred.c
| r20822 | r20823 | |
| 230 | 230 | * |
| 231 | 231 | *************************************/ |
| 232 | 232 | |
| 233 | | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 233 | void fastfred_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 234 | 234 | { |
| 235 | 235 | const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1); |
| 236 | 236 | const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1); |
| 237 | | fastfred_state *state = machine.driver_data<fastfred_state>(); |
| 237 | //OBRISI.ME |
| 238 | 238 | int offs; |
| 239 | 239 | |
| 240 | | for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
| 240 | for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
| 241 | 241 | { |
| 242 | 242 | UINT8 code,sx,sy; |
| 243 | 243 | int flipx,flipy; |
| 244 | 244 | |
| 245 | | sx = state->m_spriteram[offs + 3]; |
| 246 | | sy = 240 - state->m_spriteram[offs]; |
| 245 | sx = m_spriteram[offs + 3]; |
| 246 | sy = 240 - m_spriteram[offs]; |
| 247 | 247 | |
| 248 | | if (state->m_hardware_type == 3) |
| 248 | if (m_hardware_type == 3) |
| 249 | 249 | { |
| 250 | 250 | // Imago |
| 251 | | code = (state->m_spriteram[offs + 1]) & 0x3f; |
| 251 | code = (m_spriteram[offs + 1]) & 0x3f; |
| 252 | 252 | flipx = 0; |
| 253 | 253 | flipy = 0; |
| 254 | 254 | } |
| 255 | | else if (state->m_hardware_type == 2) |
| 255 | else if (m_hardware_type == 2) |
| 256 | 256 | { |
| 257 | 257 | // Boggy 84 |
| 258 | | code = state->m_spriteram[offs + 1] & 0x7f; |
| 258 | code = m_spriteram[offs + 1] & 0x7f; |
| 259 | 259 | flipx = 0; |
| 260 | | flipy = state->m_spriteram[offs + 1] & 0x80; |
| 260 | flipy = m_spriteram[offs + 1] & 0x80; |
| 261 | 261 | } |
| 262 | | else if (state->m_hardware_type == 1) |
| 262 | else if (m_hardware_type == 1) |
| 263 | 263 | { |
| 264 | 264 | // Fly-Boy/Fast Freddie/Red Robin |
| 265 | | code = state->m_spriteram[offs + 1] & 0x7f; |
| 265 | code = m_spriteram[offs + 1] & 0x7f; |
| 266 | 266 | flipx = 0; |
| 267 | | flipy = ~state->m_spriteram[offs + 1] & 0x80; |
| 267 | flipy = ~m_spriteram[offs + 1] & 0x80; |
| 268 | 268 | } |
| 269 | 269 | else |
| 270 | 270 | { |
| 271 | 271 | // Jump Coaster |
| 272 | | code = (state->m_spriteram[offs + 1] & 0x3f) | 0x40; |
| 273 | | flipx = ~state->m_spriteram[offs + 1] & 0x40; |
| 274 | | flipy = state->m_spriteram[offs + 1] & 0x80; |
| 272 | code = (m_spriteram[offs + 1] & 0x3f) | 0x40; |
| 273 | flipx = ~m_spriteram[offs + 1] & 0x40; |
| 274 | flipy = m_spriteram[offs + 1] & 0x80; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | | if (state->flip_screen_x()) |
| 278 | if (flip_screen_x()) |
| 279 | 279 | { |
| 280 | 280 | sx = 240 - sx; |
| 281 | 281 | flipx = !flipx; |
| 282 | 282 | } |
| 283 | | if (state->flip_screen_y()) |
| 283 | if (flip_screen_y()) |
| 284 | 284 | { |
| 285 | 285 | sy = 240 - sy; |
| 286 | 286 | flipy = !flipy; |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | | drawgfx_transpen(bitmap,state->flip_screen_x() ? spritevisibleareaflipx : spritevisiblearea,machine.gfx[1], |
| 289 | drawgfx_transpen(bitmap,flip_screen_x() ? spritevisibleareaflipx : spritevisiblearea,machine().gfx[1], |
| 290 | 290 | code, |
| 291 | | state->m_colorbank | (state->m_spriteram[offs + 2] & 0x07), |
| 291 | m_colorbank | (m_spriteram[offs + 2] & 0x07), |
| 292 | 292 | flipx,flipy, |
| 293 | 293 | sx,sy,0); |
| 294 | 294 | } |
| r20822 | r20823 | |
| 299 | 299 | { |
| 300 | 300 | bitmap.fill(*m_background_color, cliprect); |
| 301 | 301 | m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 302 | | draw_sprites(machine(), bitmap, cliprect); |
| 302 | draw_sprites(bitmap, cliprect); |
| 303 | 303 | |
| 304 | 304 | return 0; |
| 305 | 305 | } |
| r20822 | r20823 | |
| 366 | 366 | m_web_tilemap->draw(bitmap, cliprect, 0,0); |
| 367 | 367 | galaxold_draw_stars(machine(), bitmap, cliprect); |
| 368 | 368 | m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 369 | | draw_sprites(machine(), bitmap, cliprect); |
| 369 | draw_sprites(bitmap, cliprect); |
| 370 | 370 | m_fg_tilemap->draw(bitmap, cliprect, 0,0); |
| 371 | 371 | |
| 372 | 372 | return 0; |
trunk/src/mame/video/funkybee.c
| r20822 | r20823 | |
| 90 | 90 | m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(funkybee_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(funkybee_state::funkybee_tilemap_scan),this), 8, 8, 32, 32); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 93 | void funkybee_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 94 | 94 | { |
| 95 | | funkybee_state *state = machine.driver_data<funkybee_state>(); |
| 95 | //OBRISI.ME |
| 96 | 96 | int offs; |
| 97 | 97 | |
| 98 | 98 | for (offs = 0x0f; offs >= 0; offs--) |
| 99 | 99 | { |
| 100 | 100 | int offs2 = offs + 0x1e00; |
| 101 | | int attr = state->m_videoram[offs2]; |
| 101 | int attr = m_videoram[offs2]; |
| 102 | 102 | int code = (attr >> 2) | ((attr & 2) << 5); |
| 103 | | int color = state->m_colorram[offs2 + 0x10]; |
| 103 | int color = m_colorram[offs2 + 0x10]; |
| 104 | 104 | int flipx = 0; |
| 105 | 105 | int flipy = attr & 0x01; |
| 106 | | int sx = state->m_videoram[offs2 + 0x10]; |
| 107 | | int sy = 224 - state->m_colorram[offs2]; |
| 106 | int sx = m_videoram[offs2 + 0x10]; |
| 107 | int sy = 224 - m_colorram[offs2]; |
| 108 | 108 | |
| 109 | | if (state->flip_screen()) |
| 109 | if (flip_screen()) |
| 110 | 110 | { |
| 111 | 111 | sy += 32; |
| 112 | 112 | flipx = !flipx; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | | drawgfx_transpen(bitmap,cliprect, machine.gfx[2 + state->m_gfx_bank], |
| 115 | drawgfx_transpen(bitmap,cliprect, machine().gfx[2 + m_gfx_bank], |
| 116 | 116 | code, color, |
| 117 | 117 | flipx, flipy, |
| 118 | 118 | sx, sy, 0); |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | | static void draw_columns( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 122 | void funkybee_state::draw_columns( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 123 | 123 | { |
| 124 | | funkybee_state *state = machine.driver_data<funkybee_state>(); |
| 124 | //OBRISI.ME |
| 125 | 125 | int offs; |
| 126 | 126 | |
| 127 | 127 | for (offs = 0x1f; offs >= 0; offs--) |
| 128 | 128 | { |
| 129 | | int const flip = state->flip_screen(); |
| 130 | | int code = state->m_videoram[0x1c00 + offs]; |
| 131 | | int color = state->m_colorram[0x1f10] & 0x03; |
| 132 | | int sx = flip ? state->m_videoram[0x1f1f] : state->m_videoram[0x1f10]; |
| 129 | int const flip = flip_screen(); |
| 130 | int code = m_videoram[0x1c00 + offs]; |
| 131 | int color = m_colorram[0x1f10] & 0x03; |
| 132 | int sx = flip ? m_videoram[0x1f1f] : m_videoram[0x1f10]; |
| 133 | 133 | int sy = offs * 8; |
| 134 | 134 | |
| 135 | 135 | if (flip) |
| 136 | 136 | sy = 248 - sy; |
| 137 | 137 | |
| 138 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[state->m_gfx_bank], |
| 138 | drawgfx_transpen(bitmap,cliprect,machine().gfx[m_gfx_bank], |
| 139 | 139 | code, color, |
| 140 | 140 | flip, flip, |
| 141 | 141 | sx, sy,0); |
| 142 | 142 | |
| 143 | | code = state->m_videoram[0x1d00 + offs]; |
| 144 | | color = state->m_colorram[0x1f11] & 0x03; |
| 145 | | sx = flip ? state->m_videoram[0x1f1e] : state->m_videoram[0x1f11]; |
| 143 | code = m_videoram[0x1d00 + offs]; |
| 144 | color = m_colorram[0x1f11] & 0x03; |
| 145 | sx = flip ? m_videoram[0x1f1e] : m_videoram[0x1f11]; |
| 146 | 146 | sy = offs * 8; |
| 147 | 147 | |
| 148 | 148 | if (flip) |
| 149 | 149 | sy = 248 - sy; |
| 150 | 150 | |
| 151 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[state->m_gfx_bank], |
| 151 | drawgfx_transpen(bitmap,cliprect,machine().gfx[m_gfx_bank], |
| 152 | 152 | code, color, |
| 153 | 153 | flip, flip, |
| 154 | 154 | sx, sy,0); |
| r20822 | r20823 | |
| 158 | 158 | UINT32 funkybee_state::screen_update_funkybee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 159 | 159 | { |
| 160 | 160 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 161 | | draw_sprites(machine(), bitmap, cliprect); |
| 162 | | draw_columns(machine(), bitmap, cliprect); |
| 161 | draw_sprites(bitmap, cliprect); |
| 162 | draw_columns(bitmap, cliprect); |
| 163 | 163 | return 0; |
| 164 | 164 | } |
trunk/src/mame/video/freekick.c
| r20822 | r20823 | |
| 26 | 26 | m_freek_tilemap->mark_tile_dirty(offset & 0x3ff); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | | static void gigas_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 29 | void freekick_state::gigas_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 30 | 30 | { |
| 31 | | freekick_state *state = machine.driver_data<freekick_state>(); |
| 31 | //OBRISI.ME |
| 32 | 32 | int offs; |
| 33 | 33 | |
| 34 | | for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4) |
| 34 | for (offs = 0; offs < m_spriteram.bytes(); offs += 4) |
| 35 | 35 | { |
| 36 | | int xpos = state->m_spriteram[offs + 3]; |
| 37 | | int ypos = state->m_spriteram[offs + 2]; |
| 38 | | int code = state->m_spriteram[offs + 0] | ((state->m_spriteram[offs + 1] & 0x20) << 3); |
| 36 | int xpos = m_spriteram[offs + 3]; |
| 37 | int ypos = m_spriteram[offs + 2]; |
| 38 | int code = m_spriteram[offs + 0] | ((m_spriteram[offs + 1] & 0x20) << 3); |
| 39 | 39 | |
| 40 | 40 | int flipx = 0; |
| 41 | 41 | int flipy = 0; |
| 42 | | int color = state->m_spriteram[offs + 1] & 0x1f; |
| 42 | int color = m_spriteram[offs + 1] & 0x1f; |
| 43 | 43 | |
| 44 | | if (state->flip_screen_x()) |
| 44 | if (flip_screen_x()) |
| 45 | 45 | { |
| 46 | 46 | xpos = 240 - xpos; |
| 47 | 47 | flipx = !flipx; |
| 48 | 48 | } |
| 49 | | if (state->flip_screen_y()) |
| 49 | if (flip_screen_y()) |
| 50 | 50 | { |
| 51 | 51 | ypos = 256 - ypos; |
| 52 | 52 | flipy = !flipy; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 55 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 56 | 56 | code, |
| 57 | 57 | color, |
| 58 | 58 | flipx,flipy, |
| r20822 | r20823 | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | | static void pbillrd_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 64 | void freekick_state::pbillrd_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 65 | 65 | { |
| 66 | | freekick_state *state = machine.driver_data<freekick_state>(); |
| 66 | //OBRISI.ME |
| 67 | 67 | int offs; |
| 68 | 68 | |
| 69 | | for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4) |
| 69 | for (offs = 0; offs < m_spriteram.bytes(); offs += 4) |
| 70 | 70 | { |
| 71 | | int xpos = state->m_spriteram[offs + 3]; |
| 72 | | int ypos = state->m_spriteram[offs + 2]; |
| 73 | | int code = state->m_spriteram[offs + 0]; |
| 71 | int xpos = m_spriteram[offs + 3]; |
| 72 | int ypos = m_spriteram[offs + 2]; |
| 73 | int code = m_spriteram[offs + 0]; |
| 74 | 74 | |
| 75 | | int flipx = 0;//state->m_spriteram[offs + 0] & 0x80; //?? unused ? |
| 76 | | int flipy = 0;//state->m_spriteram[offs + 0] & 0x40; |
| 77 | | int color = state->m_spriteram[offs + 1] & 0x0f; |
| 75 | int flipx = 0;//m_spriteram[offs + 0] & 0x80; //?? unused ? |
| 76 | int flipy = 0;//m_spriteram[offs + 0] & 0x40; |
| 77 | int color = m_spriteram[offs + 1] & 0x0f; |
| 78 | 78 | |
| 79 | | if (state->flip_screen_x()) |
| 79 | if (flip_screen_x()) |
| 80 | 80 | { |
| 81 | 81 | xpos = 240 - xpos; |
| 82 | 82 | flipx = !flipx; |
| 83 | 83 | } |
| 84 | | if (state->flip_screen_y()) |
| 84 | if (flip_screen_y()) |
| 85 | 85 | { |
| 86 | 86 | ypos = 256 - ypos; |
| 87 | 87 | flipy = !flipy; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 90 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 91 | 91 | code, |
| 92 | 92 | color, |
| 93 | 93 | flipx,flipy, |
| r20822 | r20823 | |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | |
| 100 | | static void freekick_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 100 | void freekick_state::freekick_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 101 | 101 | { |
| 102 | | freekick_state *state = machine.driver_data<freekick_state>(); |
| 102 | //OBRISI.ME |
| 103 | 103 | int offs; |
| 104 | 104 | |
| 105 | | for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4) |
| 105 | for (offs = 0; offs < m_spriteram.bytes(); offs += 4) |
| 106 | 106 | { |
| 107 | | int xpos = state->m_spriteram[offs + 3]; |
| 108 | | int ypos = state->m_spriteram[offs + 0]; |
| 109 | | int code = state->m_spriteram[offs + 1] + ((state->m_spriteram[offs + 2] & 0x20) << 3); |
| 107 | int xpos = m_spriteram[offs + 3]; |
| 108 | int ypos = m_spriteram[offs + 0]; |
| 109 | int code = m_spriteram[offs + 1] + ((m_spriteram[offs + 2] & 0x20) << 3); |
| 110 | 110 | |
| 111 | | int flipx = state->m_spriteram[offs + 2] & 0x80; //?? unused ? |
| 112 | | int flipy = state->m_spriteram[offs + 2] & 0x40; |
| 113 | | int color = state->m_spriteram[offs + 2] & 0x1f; |
| 111 | int flipx = m_spriteram[offs + 2] & 0x80; //?? unused ? |
| 112 | int flipy = m_spriteram[offs + 2] & 0x40; |
| 113 | int color = m_spriteram[offs + 2] & 0x1f; |
| 114 | 114 | |
| 115 | | if (state->flip_screen_x()) |
| 115 | if (flip_screen_x()) |
| 116 | 116 | { |
| 117 | 117 | xpos = 240 - xpos; |
| 118 | 118 | flipx = !flipx; |
| 119 | 119 | } |
| 120 | | if (state->flip_screen_y()) |
| 120 | if (flip_screen_y()) |
| 121 | 121 | { |
| 122 | 122 | ypos = 256 - ypos; |
| 123 | 123 | flipy = !flipy; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 126 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 127 | 127 | code, |
| 128 | 128 | color, |
| 129 | 129 | flipx,flipy, |
| r20822 | r20823 | |
| 134 | 134 | UINT32 freekick_state::screen_update_gigas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 135 | 135 | { |
| 136 | 136 | m_freek_tilemap->draw(bitmap, cliprect, 0, 0); |
| 137 | | gigas_draw_sprites(machine(), bitmap, cliprect); |
| 137 | gigas_draw_sprites(bitmap, cliprect); |
| 138 | 138 | return 0; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | UINT32 freekick_state::screen_update_pbillrd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 142 | 142 | { |
| 143 | 143 | m_freek_tilemap->draw(bitmap, cliprect, 0, 0); |
| 144 | | pbillrd_draw_sprites(machine(), bitmap, cliprect); |
| 144 | pbillrd_draw_sprites(bitmap, cliprect); |
| 145 | 145 | return 0; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | UINT32 freekick_state::screen_update_freekick(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 149 | 149 | { |
| 150 | 150 | m_freek_tilemap->draw(bitmap, cliprect, 0, 0); |
| 151 | | freekick_draw_sprites(machine(), bitmap, cliprect); |
| 151 | freekick_draw_sprites(bitmap, cliprect); |
| 152 | 152 | return 0; |
| 153 | 153 | } |
trunk/src/mame/video/firetrk.c
| r20822 | r20823 | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | | static void prom_to_palette(running_machine &machine, int number, UINT8 val) |
| 59 | void firetrk_state::prom_to_palette(int number, UINT8 val) |
| 60 | 60 | { |
| 61 | | palette_set_color(machine, number, MAKE_RGB(pal1bit(val >> 2), pal1bit(val >> 1), pal1bit(val >> 0))); |
| 61 | palette_set_color(machine(), number, MAKE_RGB(pal1bit(val >> 2), pal1bit(val >> 1), pal1bit(val >> 0))); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
| r20822 | r20823 | |
| 111 | 111 | else if (color == 2) |
| 112 | 112 | m_color2_mask |= 1 << i; |
| 113 | 113 | |
| 114 | | prom_to_palette(machine(), i, color_prom[0x100 + colortable_source[i]]); |
| 114 | prom_to_palette(i, color_prom[0x100 + colortable_source[i]]); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | palette_set_color(machine(), ARRAY_LENGTH(colortable_source) + 0, RGB_BLACK); |
| r20822 | r20823 | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | |
| 248 | | static void firetrk_draw_car(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element **gfx, int which, int flash) |
| 248 | void firetrk_state::firetrk_draw_car(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element **gfx, int which, int flash) |
| 249 | 249 | { |
| 250 | | firetrk_state *state = machine.driver_data<firetrk_state>(); |
| 250 | //OBRISI.ME |
| 251 | 251 | int gfx_bank, code, color, flip_x, flip_y, x, y; |
| 252 | 252 | |
| 253 | 253 | if (which) |
| 254 | 254 | { |
| 255 | 255 | gfx_bank = 5; |
| 256 | | code = *state->m_drone_rot & 0x07; |
| 256 | code = *m_drone_rot & 0x07; |
| 257 | 257 | color = flash ? 1 : 0; |
| 258 | | flip_x = *state->m_drone_rot & 0x08; |
| 259 | | flip_y = *state->m_drone_rot & 0x10; |
| 260 | | x = (flip_x ? *state->m_drone_x - 63 : 192 - *state->m_drone_x) + 36; |
| 261 | | y = flip_y ? *state->m_drone_y - 63 : 192 - *state->m_drone_y; |
| 258 | flip_x = *m_drone_rot & 0x08; |
| 259 | flip_y = *m_drone_rot & 0x10; |
| 260 | x = (flip_x ? *m_drone_x - 63 : 192 - *m_drone_x) + 36; |
| 261 | y = flip_y ? *m_drone_y - 63 : 192 - *m_drone_y; |
| 262 | 262 | } |
| 263 | 263 | else |
| 264 | 264 | { |
| 265 | | gfx_bank = (*state->m_car_rot & 0x10) ? 4 : 3; |
| 266 | | code = *state->m_car_rot & 0x03; |
| 265 | gfx_bank = (*m_car_rot & 0x10) ? 4 : 3; |
| 266 | code = *m_car_rot & 0x03; |
| 267 | 267 | color = flash ? 1 : 0; |
| 268 | | flip_x = *state->m_car_rot & 0x04; |
| 269 | | flip_y = *state->m_car_rot & 0x08; |
| 268 | flip_x = *m_car_rot & 0x04; |
| 269 | flip_y = *m_car_rot & 0x08; |
| 270 | 270 | x = 144; |
| 271 | 271 | y = 104; |
| 272 | 272 | } |
| r20822 | r20823 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | | static void superbug_draw_car(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element **gfx, int flash) |
| 278 | void firetrk_state::superbug_draw_car(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element **gfx, int flash) |
| 279 | 279 | { |
| 280 | | firetrk_state *state = machine.driver_data<firetrk_state>(); |
| 281 | | int gfx_bank = (*state->m_car_rot & 0x10) ? 4 : 3; |
| 282 | | int code = ~*state->m_car_rot & 0x03; |
| 280 | //OBRISI.ME |
| 281 | int gfx_bank = (*m_car_rot & 0x10) ? 4 : 3; |
| 282 | int code = ~*m_car_rot & 0x03; |
| 283 | 283 | int color = flash ? 1 : 0; |
| 284 | | int flip_x = *state->m_car_rot & 0x04; |
| 285 | | int flip_y = *state->m_car_rot & 0x08; |
| 284 | int flip_x = *m_car_rot & 0x04; |
| 285 | int flip_y = *m_car_rot & 0x08; |
| 286 | 286 | |
| 287 | 287 | drawgfx_transpen(bitmap, cliprect, gfx[gfx_bank], code, color, flip_x, flip_y, 144, 104, 0); |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | |
| 291 | | static void montecar_draw_car(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element **gfx, int which, int is_collision_detection) |
| 291 | void firetrk_state::montecar_draw_car(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element **gfx, int which, int is_collision_detection) |
| 292 | 292 | { |
| 293 | | firetrk_state *state = machine.driver_data<firetrk_state>(); |
| 293 | //OBRISI.ME |
| 294 | 294 | int gfx_bank, code, color, flip_x, flip_y, x, y; |
| 295 | 295 | |
| 296 | 296 | if (which) |
| 297 | 297 | { |
| 298 | 298 | gfx_bank = 4; |
| 299 | | code = *state->m_drone_rot & 0x07; |
| 300 | | color = is_collision_detection ? 0 : (((*state->m_car_rot & 0x80) >> 6) | ((*state->m_drone_rot & 0x80) >> 7)); |
| 301 | | flip_x = *state->m_drone_rot & 0x10; |
| 302 | | flip_y = *state->m_drone_rot & 0x08; |
| 303 | | x = (flip_x ? *state->m_drone_x - 31 : 224 - *state->m_drone_x) + 34; |
| 304 | | y = flip_y ? *state->m_drone_y - 31 : 224 - *state->m_drone_y; |
| 299 | code = *m_drone_rot & 0x07; |
| 300 | color = is_collision_detection ? 0 : (((*m_car_rot & 0x80) >> 6) | ((*m_drone_rot & 0x80) >> 7)); |
| 301 | flip_x = *m_drone_rot & 0x10; |
| 302 | flip_y = *m_drone_rot & 0x08; |
| 303 | x = (flip_x ? *m_drone_x - 31 : 224 - *m_drone_x) + 34; |
| 304 | y = flip_y ? *m_drone_y - 31 : 224 - *m_drone_y; |
| 305 | 305 | } |
| 306 | 306 | else |
| 307 | 307 | { |
| 308 | 308 | gfx_bank = 3; |
| 309 | | code = *state->m_car_rot & 0x07; |
| 309 | code = *m_car_rot & 0x07; |
| 310 | 310 | color = 0; |
| 311 | | flip_x = *state->m_car_rot & 0x10; |
| 312 | | flip_y = *state->m_car_rot & 0x08; |
| 311 | flip_x = *m_car_rot & 0x10; |
| 312 | flip_y = *m_car_rot & 0x08; |
| 313 | 313 | x = 144; |
| 314 | 314 | y = 104; |
| 315 | 315 | } |
| r20822 | r20823 | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
| 331 | | static void check_collision(firetrk_state *state, int which) |
| 331 | void firetrk_state::check_collision(firetrk_state *state, int which) |
| 332 | 332 | { |
| 333 | 333 | int y, x; |
| 334 | 334 | |
| 335 | 335 | for (y = playfield_window.min_y; y <= playfield_window.max_y; y++) |
| 336 | 336 | for (x = playfield_window.min_x; x <= playfield_window.max_x; x++) |
| 337 | 337 | { |
| 338 | | pen_t a = state->m_helper1.pix16(y, x); |
| 339 | | pen_t b = state->m_helper2.pix16(y, x); |
| 338 | pen_t a = m_helper1.pix16(y, x); |
| 339 | pen_t b = m_helper2.pix16(y, x); |
| 340 | 340 | |
| 341 | | if (b != 0xff && (state->m_color1_mask >> a) & 1) |
| 342 | | state->m_crash[which] = 1; |
| 341 | if (b != 0xff && (m_color1_mask >> a) & 1) |
| 342 | m_crash[which] = 1; |
| 343 | 343 | |
| 344 | | if (b != 0xff && (state->m_color2_mask >> a) & 1) |
| 345 | | state->m_skid[which] = 1; |
| 344 | if (b != 0xff && (m_color2_mask >> a) & 1) |
| 345 | m_skid[which] = 1; |
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
| r20822 | r20823 | |
| 357 | 357 | |
| 358 | 358 | bitmap.fill(0, cliprect); |
| 359 | 359 | m_tilemap1->draw(bitmap, playfield_window, 0, 0); |
| 360 | | firetrk_draw_car(machine(), bitmap, playfield_window, machine().gfx, 0, m_flash); |
| 361 | | firetrk_draw_car(machine(), bitmap, playfield_window, machine().gfx, 1, m_flash); |
| 360 | firetrk_draw_car(bitmap, playfield_window, machine().gfx, 0, m_flash); |
| 361 | firetrk_draw_car(bitmap, playfield_window, machine().gfx, 1, m_flash); |
| 362 | 362 | draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x00, 296, 0x10, 0x10); |
| 363 | 363 | draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x10, 8, 0x10, 0x10); |
| 364 | 364 | |
| r20822 | r20823 | |
| 367 | 367 | m_tilemap2->draw(m_helper1, playfield_window, 0, 0); |
| 368 | 368 | |
| 369 | 369 | m_helper2.fill(0xff, playfield_window); |
| 370 | | firetrk_draw_car(machine(), m_helper2, playfield_window, machine().gfx, 0, FALSE); |
| 370 | firetrk_draw_car(m_helper2, playfield_window, machine().gfx, 0, FALSE); |
| 371 | 371 | check_collision(this, 0); |
| 372 | 372 | |
| 373 | 373 | m_helper2.fill(0xff, playfield_window); |
| 374 | | firetrk_draw_car(machine(), m_helper2, playfield_window, machine().gfx, 1, FALSE); |
| 374 | firetrk_draw_car(m_helper2, playfield_window, machine().gfx, 1, FALSE); |
| 375 | 375 | check_collision(this, 1); |
| 376 | 376 | |
| 377 | 377 | *m_blink = FALSE; |
| r20822 | r20823 | |
| 391 | 391 | |
| 392 | 392 | bitmap.fill(0, cliprect); |
| 393 | 393 | m_tilemap1->draw(bitmap, playfield_window, 0, 0); |
| 394 | | superbug_draw_car(machine(), bitmap, playfield_window, machine().gfx, m_flash); |
| 394 | superbug_draw_car(bitmap, playfield_window, machine().gfx, m_flash); |
| 395 | 395 | draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x00, 296, 0x10, 0x10); |
| 396 | 396 | draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x10, 8, 0x10, 0x10); |
| 397 | 397 | |
| r20822 | r20823 | |
| 400 | 400 | m_tilemap2->draw(m_helper1, playfield_window, 0, 0); |
| 401 | 401 | |
| 402 | 402 | m_helper2.fill(0xff, playfield_window); |
| 403 | | superbug_draw_car(machine(), m_helper2, playfield_window, machine().gfx, FALSE); |
| 403 | superbug_draw_car(m_helper2, playfield_window, machine().gfx, FALSE); |
| 404 | 404 | check_collision(this, 0); |
| 405 | 405 | |
| 406 | 406 | *m_blink = FALSE; |
| r20822 | r20823 | |
| 420 | 420 | |
| 421 | 421 | bitmap.fill(0x2c, cliprect); |
| 422 | 422 | m_tilemap1->draw(bitmap, playfield_window, 0, 0); |
| 423 | | montecar_draw_car(machine(), bitmap, playfield_window, machine().gfx, 0, FALSE); |
| 424 | | montecar_draw_car(machine(), bitmap, playfield_window, machine().gfx, 1, FALSE); |
| 423 | montecar_draw_car(bitmap, playfield_window, machine().gfx, 0, FALSE); |
| 424 | montecar_draw_car(bitmap, playfield_window, machine().gfx, 1, FALSE); |
| 425 | 425 | draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x00, 24, 0x20, 0x08); |
| 426 | 426 | draw_text(bitmap, cliprect, machine().gfx, m_alpha_num_ram + 0x20, 16, 0x20, 0x08); |
| 427 | 427 | |
| r20822 | r20823 | |
| 430 | 430 | m_tilemap2->draw(m_helper1, playfield_window, 0, 0); |
| 431 | 431 | |
| 432 | 432 | m_helper2.fill(0xff, playfield_window); |
| 433 | | montecar_draw_car(machine(), m_helper2, playfield_window, machine().gfx, 0, TRUE); |
| 433 | montecar_draw_car(m_helper2, playfield_window, machine().gfx, 0, TRUE); |
| 434 | 434 | check_collision(this, 0); |
| 435 | 435 | |
| 436 | 436 | m_helper2.fill(0xff, playfield_window); |
| 437 | | montecar_draw_car(machine(), m_helper2, playfield_window, machine().gfx, 1, TRUE); |
| 437 | montecar_draw_car(m_helper2, playfield_window, machine().gfx, 1, TRUE); |
| 438 | 438 | check_collision(this, 1); |
| 439 | 439 | } |
| 440 | 440 | |
trunk/src/mame/video/fromanc2.c
| r20822 | r20823 | |
| 15 | 15 | |
| 16 | 16 | ******************************************************************************/ |
| 17 | 17 | |
| 18 | | INLINE void fromanc2_get_tile_info( running_machine &machine, tile_data &tileinfo, int tile_index, int vram, int layer ) |
| 18 | inline void fromanc2_state::fromanc2_get_tile_info( tile_data &tileinfo, int tile_index, int vram, int layer ) |
| 19 | 19 | { |
| 20 | | fromanc2_state *state = machine.driver_data<fromanc2_state>(); |
| 20 | //OBRISI.ME |
| 21 | 21 | int tile, color; |
| 22 | 22 | |
| 23 | | tile = (state->m_videoram[vram][layer][tile_index] & 0x3fff) | (state->m_gfxbank[vram][layer] << 14); |
| 24 | | color = ((state->m_videoram[vram][layer][tile_index] & 0xc000) >> 14) | (0x10 * vram); |
| 23 | tile = (m_videoram[vram][layer][tile_index] & 0x3fff) | (m_gfxbank[vram][layer] << 14); |
| 24 | color = ((m_videoram[vram][layer][tile_index] & 0xc000) >> 14) | (0x10 * vram); |
| 25 | 25 | |
| 26 | | SET_TILE_INFO(layer, tile, color, 0); |
| 26 | SET_TILE_INFO_MEMBER(layer, tile, color, 0); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v0_l0_tile_info){ fromanc2_get_tile_info(machine(), tileinfo, tile_index, 0, 0); } |
| 30 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v0_l1_tile_info){ fromanc2_get_tile_info(machine(), tileinfo, tile_index, 0, 1); } |
| 31 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v0_l2_tile_info){ fromanc2_get_tile_info(machine(), tileinfo, tile_index, 0, 2); } |
| 32 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v0_l3_tile_info){ fromanc2_get_tile_info(machine(), tileinfo, tile_index, 0, 3); } |
| 33 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v1_l0_tile_info){ fromanc2_get_tile_info(machine(), tileinfo, tile_index, 1, 0); } |
| 34 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v1_l1_tile_info){ fromanc2_get_tile_info(machine(), tileinfo, tile_index, 1, 1); } |
| 35 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v1_l2_tile_info){ fromanc2_get_tile_info(machine(), tileinfo, tile_index, 1, 2); } |
| 36 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v1_l3_tile_info){ fromanc2_get_tile_info(machine(), tileinfo, tile_index, 1, 3); } |
| 29 | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v0_l0_tile_info){ fromanc2_get_tile_info(tileinfo, tile_index, 0, 0); } |
| 30 | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v0_l1_tile_info){ fromanc2_get_tile_info(tileinfo, tile_index, 0, 1); } |
| 31 | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v0_l2_tile_info){ fromanc2_get_tile_info(tileinfo, tile_index, 0, 2); } |
| 32 | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v0_l3_tile_info){ fromanc2_get_tile_info(tileinfo, tile_index, 0, 3); } |
| 33 | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v1_l0_tile_info){ fromanc2_get_tile_info(tileinfo, tile_index, 1, 0); } |
| 34 | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v1_l1_tile_info){ fromanc2_get_tile_info(tileinfo, tile_index, 1, 1); } |
| 35 | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v1_l2_tile_info){ fromanc2_get_tile_info(tileinfo, tile_index, 1, 2); } |
| 36 | TILE_GET_INFO_MEMBER(fromanc2_state::fromanc2_get_v1_l3_tile_info){ fromanc2_get_tile_info(tileinfo, tile_index, 1, 3); } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | | INLINE void fromancr_get_tile_info( running_machine &machine, tile_data &tileinfo, int tile_index, int vram, int layer ) |
| 39 | inline void fromanc2_state::fromancr_get_tile_info( tile_data &tileinfo, int tile_index, int vram, int layer ) |
| 40 | 40 | { |
| 41 | | fromanc2_state *state = machine.driver_data<fromanc2_state>(); |
| 41 | //OBRISI.ME |
| 42 | 42 | int tile, color; |
| 43 | 43 | |
| 44 | | tile = state->m_videoram[vram][layer][tile_index] | (state->m_gfxbank[vram][layer] << 16); |
| 44 | tile = m_videoram[vram][layer][tile_index] | (m_gfxbank[vram][layer] << 16); |
| 45 | 45 | color = vram; |
| 46 | 46 | |
| 47 | | SET_TILE_INFO(layer, tile, color, 0); |
| 47 | SET_TILE_INFO_MEMBER(layer, tile, color, 0); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v0_l0_tile_info){ fromancr_get_tile_info(machine(), tileinfo, tile_index, 0, 0); } |
| 51 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v0_l1_tile_info){ fromancr_get_tile_info(machine(), tileinfo, tile_index, 0, 1); } |
| 52 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v0_l2_tile_info){ fromancr_get_tile_info(machine(), tileinfo, tile_index, 0, 2); } |
| 53 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v1_l0_tile_info){ fromancr_get_tile_info(machine(), tileinfo, tile_index, 1, 0); } |
| 54 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v1_l1_tile_info){ fromancr_get_tile_info(machine(), tileinfo, tile_index, 1, 1); } |
| 55 | | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v1_l2_tile_info){ fromancr_get_tile_info(machine(), tileinfo, tile_index, 1, 2); } |
| 50 | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v0_l0_tile_info){ fromancr_get_tile_info(tileinfo, tile_index, 0, 0); } |
| 51 | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v0_l1_tile_info){ fromancr_get_tile_info(tileinfo, tile_index, 0, 1); } |
| 52 | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v0_l2_tile_info){ fromancr_get_tile_info(tileinfo, tile_index, 0, 2); } |
| 53 | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v1_l0_tile_info){ fromancr_get_tile_info(tileinfo, tile_index, 1, 0); } |
| 54 | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v1_l1_tile_info){ fromancr_get_tile_info(tileinfo, tile_index, 1, 1); } |
| 55 | TILE_GET_INFO_MEMBER(fromanc2_state::fromancr_get_v1_l2_tile_info){ fromancr_get_tile_info(tileinfo, tile_index, 1, 2); } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | /****************************************************************************** |
| r20822 | r20823 | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| 163 | | INLINE void fromanc2_dispvram_w( running_machine &machine, offs_t offset, UINT16 data, UINT16 mem_mask, int vram, int layer ) |
| 163 | inline void fromanc2_state::fromanc2_dispvram_w( offs_t offset, UINT16 data, UINT16 mem_mask, int vram, int layer ) |
| 164 | 164 | { |
| 165 | | fromanc2_state *state = machine.driver_data<fromanc2_state>(); |
| 165 | //OBRISI.ME |
| 166 | 166 | layer += (offset < 0x1000) ? 0 : 1; |
| 167 | 167 | |
| 168 | | COMBINE_DATA(&state->m_videoram[vram][layer][offset & 0x0fff]); |
| 169 | | state->m_tilemap[vram][layer]->mark_tile_dirty(offset & 0x0fff); |
| 168 | COMBINE_DATA(&m_videoram[vram][layer][offset & 0x0fff]); |
| 169 | m_tilemap[vram][layer]->mark_tile_dirty(offset & 0x0fff); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | | WRITE16_MEMBER(fromanc2_state::fromanc2_videoram_0_w){ fromanc2_dispvram_w(machine(), offset, data, mem_mask, 0, 0); } |
| 173 | | WRITE16_MEMBER(fromanc2_state::fromanc2_videoram_1_w){ fromanc2_dispvram_w(machine(), offset, data, mem_mask, 0, 2); } |
| 174 | | WRITE16_MEMBER(fromanc2_state::fromanc2_videoram_2_w){ fromanc2_dispvram_w(machine(), offset, data, mem_mask, 1, 0); } |
| 175 | | WRITE16_MEMBER(fromanc2_state::fromanc2_videoram_3_w){ fromanc2_dispvram_w(machine(), offset, data, mem_mask, 1, 2); } |
| 172 | WRITE16_MEMBER(fromanc2_state::fromanc2_videoram_0_w){ fromanc2_dispvram_w(offset, data, mem_mask, 0, 0); } |
| 173 | WRITE16_MEMBER(fromanc2_state::fromanc2_videoram_1_w){ fromanc2_dispvram_w(offset, data, mem_mask, 0, 2); } |
| 174 | WRITE16_MEMBER(fromanc2_state::fromanc2_videoram_2_w){ fromanc2_dispvram_w(offset, data, mem_mask, 1, 0); } |
| 175 | WRITE16_MEMBER(fromanc2_state::fromanc2_videoram_3_w){ fromanc2_dispvram_w(offset, data, mem_mask, 1, 2); } |
| 176 | 176 | |
| 177 | 177 | WRITE16_MEMBER(fromanc2_state::fromanc2_gfxreg_0_w) |
| 178 | 178 | { |
| r20822 | r20823 | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
| 254 | | INLINE void fromancr_vram_w(running_machine &machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer ) |
| 254 | inline void fromanc2_state::fromancr_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int layer ) |
| 255 | 255 | { |
| 256 | | fromanc2_state *state = machine.driver_data<fromanc2_state>(); |
| 256 | //OBRISI.ME |
| 257 | 257 | int vram = (offset < 0x1000) ? 0 : 1; |
| 258 | 258 | |
| 259 | | COMBINE_DATA(&state->m_videoram[vram][layer][offset & 0x0fff]); |
| 260 | | state->m_tilemap[vram][layer]->mark_tile_dirty(offset & 0x0fff); |
| 259 | COMBINE_DATA(&m_videoram[vram][layer][offset & 0x0fff]); |
| 260 | m_tilemap[vram][layer]->mark_tile_dirty(offset & 0x0fff); |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | | WRITE16_MEMBER(fromanc2_state::fromancr_videoram_0_w){ fromancr_vram_w(machine(), offset, data, mem_mask, 1); } |
| 264 | | WRITE16_MEMBER(fromanc2_state::fromancr_videoram_1_w){ fromancr_vram_w(machine(), offset, data, mem_mask, 0); } |
| 265 | | WRITE16_MEMBER(fromanc2_state::fromancr_videoram_2_w){ fromancr_vram_w(machine(), offset, data, mem_mask, 2); } |
| 263 | WRITE16_MEMBER(fromanc2_state::fromancr_videoram_0_w){ fromancr_vram_w(offset, data, mem_mask, 1); } |
| 264 | WRITE16_MEMBER(fromanc2_state::fromancr_videoram_1_w){ fromancr_vram_w(offset, data, mem_mask, 0); } |
| 265 | WRITE16_MEMBER(fromanc2_state::fromancr_videoram_2_w){ fromancr_vram_w(offset, data, mem_mask, 2); } |
| 266 | 266 | |
| 267 | 267 | WRITE16_MEMBER(fromanc2_state::fromancr_gfxreg_0_w) |
| 268 | 268 | { |
| r20822 | r20823 | |
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | | void fromancr_gfxbank_w( running_machine &machine, int data ) |
| 293 | void fromanc2_state::fromancr_gfxbank_w( int data ) |
| 294 | 294 | { |
| 295 | | fromanc2_state *state = machine.driver_data<fromanc2_state>(); |
| 295 | //OBRISI.ME |
| 296 | 296 | |
| 297 | | state->m_gfxbank[0][0] = (data & 0x0010) >> 4; // BG (1P) |
| 298 | | state->m_gfxbank[0][1] = (data & 0xf000) >> 12; // FG (1P) |
| 299 | | state->m_gfxbank[1][0] = (data & 0x0008) >> 3; // BG (2P) |
| 300 | | state->m_gfxbank[1][1] = (data & 0x0f00) >> 8; // FG (2P) |
| 301 | | state->m_tilemap[0][0]->mark_all_dirty(); |
| 302 | | state->m_tilemap[0][1]->mark_all_dirty(); |
| 303 | | state->m_tilemap[1][0]->mark_all_dirty(); |
| 304 | | state->m_tilemap[1][1]->mark_all_dirty(); |
| 297 | m_gfxbank[0][0] = (data & 0x0010) >> 4; // BG (1P) |
| 298 | m_gfxbank[0][1] = (data & 0xf000) >> 12; // FG (1P) |
| 299 | m_gfxbank[1][0] = (data & 0x0008) >> 3; // BG (2P) |
| 300 | m_gfxbank[1][1] = (data & 0x0f00) >> 8; // FG (2P) |
| 301 | m_tilemap[0][0]->mark_all_dirty(); |
| 302 | m_tilemap[0][1]->mark_all_dirty(); |
| 303 | m_tilemap[1][0]->mark_all_dirty(); |
| 304 | m_tilemap[1][1]->mark_all_dirty(); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
| 308 | | INLINE void fromanc4_vram_w( running_machine &machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer ) |
| 308 | inline void fromanc2_state::fromanc4_vram_w( offs_t offset, UINT16 data, UINT16 mem_mask, int layer ) |
| 309 | 309 | { |
| 310 | | fromanc2_state *state = machine.driver_data<fromanc2_state>(); |
| 310 | //OBRISI.ME |
| 311 | 311 | int vram = (offset < 0x4000) ? 0 : 1; |
| 312 | 312 | |
| 313 | | COMBINE_DATA(&state->m_videoram[vram][layer][offset & 0x3fff]); |
| 314 | | state->m_tilemap[vram][layer]->mark_tile_dirty(offset & 0x3fff); |
| 313 | COMBINE_DATA(&m_videoram[vram][layer][offset & 0x3fff]); |
| 314 | m_tilemap[vram][layer]->mark_tile_dirty(offset & 0x3fff); |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | | WRITE16_MEMBER(fromanc2_state::fromanc4_videoram_0_w){ fromanc4_vram_w(machine(), offset, data, mem_mask, 2); } |
| 318 | | WRITE16_MEMBER(fromanc2_state::fromanc4_videoram_1_w){ fromanc4_vram_w(machine(), offset, data, mem_mask, 1); } |
| 319 | | WRITE16_MEMBER(fromanc2_state::fromanc4_videoram_2_w){ fromanc4_vram_w(machine(), offset, data, mem_mask, 0); } |
| 317 | WRITE16_MEMBER(fromanc2_state::fromanc4_videoram_0_w){ fromanc4_vram_w(offset, data, mem_mask, 2); } |
| 318 | WRITE16_MEMBER(fromanc2_state::fromanc4_videoram_1_w){ fromanc4_vram_w(offset, data, mem_mask, 1); } |
| 319 | WRITE16_MEMBER(fromanc2_state::fromanc4_videoram_2_w){ fromanc4_vram_w(offset, data, mem_mask, 0); } |
| 320 | 320 | |
| 321 | 321 | WRITE16_MEMBER(fromanc2_state::fromanc4_gfxreg_0_w) |
| 322 | 322 | { |
trunk/src/mame/video/firetrap.c
| r20822 | r20823 | |
| 95 | 95 | 0); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | | INLINE void get_bg_tile_info(running_machine &machine, tile_data &tileinfo, int tile_index, UINT8 *bgvideoram, int gfx_region) |
| 98 | inline void firetrap_state::get_bg_tile_info(tile_data &tileinfo, int tile_index, UINT8 *bgvideoram, int gfx_region) |
| 99 | 99 | { |
| 100 | 100 | int code = bgvideoram[tile_index]; |
| 101 | 101 | int color = bgvideoram[tile_index + 0x100]; |
| 102 | | SET_TILE_INFO( |
| 102 | SET_TILE_INFO_MEMBER( |
| 103 | 103 | gfx_region, |
| 104 | 104 | code + ((color & 0x03) << 8), |
| 105 | 105 | (color & 0x30) >> 4, |
| r20822 | r20823 | |
| 108 | 108 | |
| 109 | 109 | TILE_GET_INFO_MEMBER(firetrap_state::get_bg1_tile_info) |
| 110 | 110 | { |
| 111 | | get_bg_tile_info(machine(), tileinfo, tile_index, m_bg1videoram, 1); |
| 111 | get_bg_tile_info(tileinfo, tile_index, m_bg1videoram, 1); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | TILE_GET_INFO_MEMBER(firetrap_state::get_bg2_tile_info) |
| 115 | 115 | { |
| 116 | | get_bg_tile_info(machine(), tileinfo, tile_index, m_bg2videoram, 2); |
| 116 | get_bg_tile_info(tileinfo, tile_index, m_bg2videoram, 2); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
| r20822 | r20823 | |
| 190 | 190 | |
| 191 | 191 | ***************************************************************************/ |
| 192 | 192 | |
| 193 | | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 193 | void firetrap_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 194 | 194 | { |
| 195 | | firetrap_state *state = machine.driver_data<firetrap_state>(); |
| 195 | //OBRISI.ME |
| 196 | 196 | int offs; |
| 197 | 197 | |
| 198 | | for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4) |
| 198 | for (offs = 0; offs < m_spriteram.bytes(); offs += 4) |
| 199 | 199 | { |
| 200 | 200 | int sx, sy, flipx, flipy, code, color; |
| 201 | 201 | |
| 202 | 202 | |
| 203 | 203 | /* the meaning of bit 3 of [offs] is unknown */ |
| 204 | 204 | |
| 205 | | sy = state->m_spriteram[offs]; |
| 206 | | sx = state->m_spriteram[offs + 2]; |
| 207 | | code = state->m_spriteram[offs + 3] + 4 * (state->m_spriteram[offs + 1] & 0xc0); |
| 208 | | color = ((state->m_spriteram[offs + 1] & 0x08) >> 2) | (state->m_spriteram[offs + 1] & 0x01); |
| 209 | | flipx = state->m_spriteram[offs + 1] & 0x04; |
| 210 | | flipy = state->m_spriteram[offs + 1] & 0x02; |
| 211 | | if (state->flip_screen()) |
| 205 | sy = m_spriteram[offs]; |
| 206 | sx = m_spriteram[offs + 2]; |
| 207 | code = m_spriteram[offs + 3] + 4 * (m_spriteram[offs + 1] & 0xc0); |
| 208 | color = ((m_spriteram[offs + 1] & 0x08) >> 2) | (m_spriteram[offs + 1] & 0x01); |
| 209 | flipx = m_spriteram[offs + 1] & 0x04; |
| 210 | flipy = m_spriteram[offs + 1] & 0x02; |
| 211 | if (flip_screen()) |
| 212 | 212 | { |
| 213 | 213 | sx = 240 - sx; |
| 214 | 214 | sy = 240 - sy; |
| r20822 | r20823 | |
| 216 | 216 | flipy = !flipy; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | | if (state->m_spriteram[offs + 1] & 0x10) /* double width */ |
| 219 | if (m_spriteram[offs + 1] & 0x10) /* double width */ |
| 220 | 220 | { |
| 221 | | if (state->flip_screen()) sy -= 16; |
| 221 | if (flip_screen()) sy -= 16; |
| 222 | 222 | |
| 223 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 223 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 224 | 224 | code & ~1, |
| 225 | 225 | color, |
| 226 | 226 | flipx,flipy, |
| 227 | 227 | sx,flipy ? sy : sy + 16,0); |
| 228 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 228 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 229 | 229 | code | 1, |
| 230 | 230 | color, |
| 231 | 231 | flipx,flipy, |
| 232 | 232 | sx,flipy ? sy + 16 : sy,0); |
| 233 | 233 | |
| 234 | 234 | /* redraw with wraparound */ |
| 235 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 235 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 236 | 236 | code & ~1, |
| 237 | 237 | color, |
| 238 | 238 | flipx,flipy, |
| 239 | 239 | sx - 256,flipy ? sy : sy + 16,0); |
| 240 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 240 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 241 | 241 | code | 1, |
| 242 | 242 | color, |
| 243 | 243 | flipx,flipy, |
| r20822 | r20823 | |
| 245 | 245 | } |
| 246 | 246 | else |
| 247 | 247 | { |
| 248 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 248 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 249 | 249 | code, |
| 250 | 250 | color, |
| 251 | 251 | flipx,flipy, |
| 252 | 252 | sx,sy,0); |
| 253 | 253 | |
| 254 | 254 | /* redraw with wraparound */ |
| 255 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 255 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 256 | 256 | code, |
| 257 | 257 | color, |
| 258 | 258 | flipx,flipy, |
| r20822 | r20823 | |
| 265 | 265 | { |
| 266 | 266 | m_bg2_tilemap->draw(bitmap, cliprect, 0, 0); |
| 267 | 267 | m_bg1_tilemap->draw(bitmap, cliprect, 0, 0); |
| 268 | | draw_sprites(machine(), bitmap, cliprect); |
| 268 | draw_sprites(bitmap, cliprect); |
| 269 | 269 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 270 | 270 | return 0; |
| 271 | 271 | } |
trunk/src/mame/video/fromance.c
| r20822 | r20823 | |
| 19 | 19 | * |
| 20 | 20 | *************************************/ |
| 21 | 21 | |
| 22 | | INLINE void get_fromance_tile_info( running_machine &machine, tile_data &tileinfo, int tile_index, int layer ) |
| 22 | inline void fromance_state::get_fromance_tile_info( tile_data &tileinfo, int tile_index, int layer ) |
| 23 | 23 | { |
| 24 | | fromance_state *state = machine.driver_data<fromance_state>(); |
| 25 | | int tile = ((state->m_local_videoram[layer][0x0000 + tile_index] & 0x80) << 9) | |
| 26 | | (state->m_local_videoram[layer][0x1000 + tile_index] << 8) | |
| 27 | | state->m_local_videoram[layer][0x2000 + tile_index]; |
| 28 | | int color = state->m_local_videoram[layer][tile_index] & 0x7f; |
| 24 | //OBRISI.ME |
| 25 | int tile = ((m_local_videoram[layer][0x0000 + tile_index] & 0x80) << 9) | |
| 26 | (m_local_videoram[layer][0x1000 + tile_index] << 8) | |
| 27 | m_local_videoram[layer][0x2000 + tile_index]; |
| 28 | int color = m_local_videoram[layer][tile_index] & 0x7f; |
| 29 | 29 | |
| 30 | | SET_TILE_INFO(layer, tile, color, 0); |
| 30 | SET_TILE_INFO_MEMBER(layer, tile, color, 0); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | | TILE_GET_INFO_MEMBER(fromance_state::get_fromance_bg_tile_info){ get_fromance_tile_info(machine(), tileinfo, tile_index, 0); } |
| 34 | | TILE_GET_INFO_MEMBER(fromance_state::get_fromance_fg_tile_info){ get_fromance_tile_info(machine(), tileinfo, tile_index, 1); } |
| 33 | TILE_GET_INFO_MEMBER(fromance_state::get_fromance_bg_tile_info){ get_fromance_tile_info(tileinfo, tile_index, 0); } |
| 34 | TILE_GET_INFO_MEMBER(fromance_state::get_fromance_fg_tile_info){ get_fromance_tile_info(tileinfo, tile_index, 1); } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | | INLINE void get_nekkyoku_tile_info( running_machine &machine, tile_data &tileinfo, int tile_index, int layer ) |
| 37 | inline void fromance_state::get_nekkyoku_tile_info( tile_data &tileinfo, int tile_index, int layer ) |
| 38 | 38 | { |
| 39 | | fromance_state *state = machine.driver_data<fromance_state>(); |
| 40 | | int tile = (state->m_local_videoram[layer][0x0000 + tile_index] << 8) | |
| 41 | | state->m_local_videoram[layer][0x1000 + tile_index]; |
| 42 | | int color = state->m_local_videoram[layer][tile_index + 0x2000] & 0x3f; |
| 39 | //OBRISI.ME |
| 40 | int tile = (m_local_videoram[layer][0x0000 + tile_index] << 8) | |
| 41 | m_local_videoram[layer][0x1000 + tile_index]; |
| 42 | int color = m_local_videoram[layer][tile_index + 0x2000] & 0x3f; |
| 43 | 43 | |
| 44 | | SET_TILE_INFO(layer, tile, color, 0); |
| 44 | SET_TILE_INFO_MEMBER(layer, tile, color, 0); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | | TILE_GET_INFO_MEMBER(fromance_state::get_nekkyoku_bg_tile_info){ get_nekkyoku_tile_info(machine(), tileinfo, tile_index, 0); } |
| 48 | | TILE_GET_INFO_MEMBER(fromance_state::get_nekkyoku_fg_tile_info){ get_nekkyoku_tile_info(machine(), tileinfo, tile_index, 1); } |
| 47 | TILE_GET_INFO_MEMBER(fromance_state::get_nekkyoku_bg_tile_info){ get_nekkyoku_tile_info(tileinfo, tile_index, 0); } |
| 48 | TILE_GET_INFO_MEMBER(fromance_state::get_nekkyoku_fg_tile_info){ get_nekkyoku_tile_info(tileinfo, tile_index, 1); } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | |
| r20822 | r20823 | |
| 55 | 55 | * |
| 56 | 56 | *************************************/ |
| 57 | 57 | |
| 58 | | static void init_common( running_machine &machine ) |
| 58 | void fromance_state::init_common( ) |
| 59 | 59 | { |
| 60 | | fromance_state *state = machine.driver_data<fromance_state>(); |
| 60 | //OBRISI.ME |
| 61 | 61 | |
| 62 | 62 | /* allocate local videoram */ |
| 63 | | state->m_local_videoram[0] = auto_alloc_array(machine, UINT8, 0x1000 * 3); |
| 64 | | state->m_local_videoram[1] = auto_alloc_array(machine, UINT8, 0x1000 * 3); |
| 63 | m_local_videoram[0] = auto_alloc_array(machine(), UINT8, 0x1000 * 3); |
| 64 | m_local_videoram[1] = auto_alloc_array(machine(), UINT8, 0x1000 * 3); |
| 65 | 65 | |
| 66 | 66 | /* allocate local palette RAM */ |
| 67 | | state->m_local_paletteram = auto_alloc_array(machine, UINT8, 0x800 * 2); |
| 67 | m_local_paletteram = auto_alloc_array(machine(), UINT8, 0x800 * 2); |
| 68 | 68 | |
| 69 | 69 | /* configure tilemaps */ |
| 70 | | state->m_fg_tilemap->set_transparent_pen(15); |
| 70 | m_fg_tilemap->set_transparent_pen(15); |
| 71 | 71 | |
| 72 | 72 | /* reset the timer */ |
| 73 | | state->m_crtc_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(fromance_state::crtc_interrupt_gen),state)); |
| 73 | m_crtc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fromance_state::crtc_interrupt_gen),this)); |
| 74 | 74 | |
| 75 | 75 | /* state save */ |
| 76 | | state->save_item(NAME(state->m_selected_videoram)); |
| 77 | | state->save_pointer(NAME(state->m_local_videoram[0]), 0x1000 * 3); |
| 78 | | state->save_pointer(NAME(state->m_local_videoram[1]), 0x1000 * 3); |
| 79 | | state->save_item(NAME(state->m_selected_paletteram)); |
| 80 | | state->save_item(NAME(state->m_scrollx)); |
| 81 | | state->save_item(NAME(state->m_scrolly)); |
| 82 | | state->save_item(NAME(state->m_gfxreg)); |
| 83 | | state->save_item(NAME(state->m_flipscreen)); |
| 84 | | state->save_item(NAME(state->m_flipscreen_old)); |
| 85 | | state->save_item(NAME(state->m_scrollx_ofs)); |
| 86 | | state->save_item(NAME(state->m_scrolly_ofs)); |
| 87 | | state->save_item(NAME(state->m_crtc_register)); |
| 88 | | state->save_item(NAME(state->m_crtc_data)); |
| 89 | | state->save_pointer(NAME(state->m_local_paletteram), 0x800 * 2); |
| 76 | save_item(NAME(m_selected_videoram)); |
| 77 | save_pointer(NAME(m_local_videoram[0]), 0x1000 * 3); |
| 78 | save_pointer(NAME(m_local_videoram[1]), 0x1000 * 3); |
| 79 | save_item(NAME(m_selected_paletteram)); |
| 80 | save_item(NAME(m_scrollx)); |
| 81 | save_item(NAME(m_scrolly)); |
| 82 | save_item(NAME(m_gfxreg)); |
| 83 | save_item(NAME(m_flipscreen)); |
| 84 | save_item(NAME(m_flipscreen_old)); |
| 85 | save_item(NAME(m_scrollx_ofs)); |
| 86 | save_item(NAME(m_scrolly_ofs)); |
| 87 | save_item(NAME(m_crtc_register)); |
| 88 | save_item(NAME(m_crtc_data)); |
| 89 | save_pointer(NAME(m_local_paletteram), 0x800 * 2); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | VIDEO_START_MEMBER(fromance_state,fromance) |
| r20822 | r20823 | |
| 95 | 95 | m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_fromance_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64); |
| 96 | 96 | m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_fromance_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64); |
| 97 | 97 | |
| 98 | | init_common(machine()); |
| 98 | init_common(); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | VIDEO_START_MEMBER(fromance_state,nekkyoku) |
| r20822 | r20823 | |
| 104 | 104 | m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_nekkyoku_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64); |
| 105 | 105 | m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fromance_state::get_nekkyoku_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 4, 64, 64); |
| 106 | 106 | |
| 107 | | init_common(machine()); |
| 107 | init_common(); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | VIDEO_START_MEMBER(fromance_state,pipedrm) |
trunk/src/mame/video/fuukifg2.c
| r20822 | r20823 | |
| 44 | 44 | |
| 45 | 45 | ***************************************************************************/ |
| 46 | 46 | |
| 47 | | INLINE void get_tile_info(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, int _N_) |
| 47 | inline void fuuki16_state::get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_) |
| 48 | 48 | { |
| 49 | | fuuki16_state *state = machine.driver_data<fuuki16_state>(); |
| 50 | | UINT16 code = state->m_vram[_N_][2 * tile_index + 0]; |
| 51 | | UINT16 attr = state->m_vram[_N_][2 * tile_index + 1]; |
| 52 | | SET_TILE_INFO(1 + _N_, code, attr & 0x3f, TILE_FLIPYX((attr >> 6) & 3)); |
| 49 | //OBRISI.ME |
| 50 | UINT16 code = m_vram[_N_][2 * tile_index + 0]; |
| 51 | UINT16 attr = m_vram[_N_][2 * tile_index + 1]; |
| 52 | SET_TILE_INFO_MEMBER(1 + _N_, code, attr & 0x3f, TILE_FLIPYX((attr >> 6) & 3)); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | | TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_0){ get_tile_info(machine(), tileinfo, tile_index, 0); } |
| 56 | | TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_1){ get_tile_info(machine(), tileinfo, tile_index, 1); } |
| 57 | | TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_2){ get_tile_info(machine(), tileinfo, tile_index, 2); } |
| 58 | | TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_3){ get_tile_info(machine(), tileinfo, tile_index, 3); } |
| 55 | TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_0){ get_tile_info(tileinfo, tile_index, 0); } |
| 56 | TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_1){ get_tile_info(tileinfo, tile_index, 1); } |
| 57 | TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_2){ get_tile_info(tileinfo, tile_index, 2); } |
| 58 | TILE_GET_INFO_MEMBER(fuuki16_state::get_tile_info_3){ get_tile_info(tileinfo, tile_index, 3); } |
| 59 | 59 | |
| 60 | | INLINE void fuuki16_vram_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int _N_) |
| 60 | inline void fuuki16_state::fuuki16_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_) |
| 61 | 61 | { |
| 62 | | fuuki16_state *state = space.machine().driver_data<fuuki16_state>(); |
| 63 | | COMBINE_DATA(&state->m_vram[_N_][offset]); |
| 64 | | state->m_tilemap[_N_]->mark_tile_dirty(offset / 2); |
| 62 | COMBINE_DATA(&m_vram[_N_][offset]); |
| 63 | m_tilemap[_N_]->mark_tile_dirty(offset / 2); |
| 65 | 64 | } |
| 66 | 65 | |
| 67 | | WRITE16_MEMBER(fuuki16_state::fuuki16_vram_0_w){ fuuki16_vram_w(space, offset, data, mem_mask, 0); } |
| 68 | | WRITE16_MEMBER(fuuki16_state::fuuki16_vram_1_w){ fuuki16_vram_w(space, offset, data, mem_mask, 1); } |
| 69 | | WRITE16_MEMBER(fuuki16_state::fuuki16_vram_2_w){ fuuki16_vram_w(space, offset, data, mem_mask, 2); } |
| 70 | | WRITE16_MEMBER(fuuki16_state::fuuki16_vram_3_w){ fuuki16_vram_w(space, offset, data, mem_mask, 3); } |
| 66 | WRITE16_MEMBER(fuuki16_state::fuuki16_vram_0_w){ fuuki16_vram_w(offset, data, mem_mask, 0); } |
| 67 | WRITE16_MEMBER(fuuki16_state::fuuki16_vram_1_w){ fuuki16_vram_w(offset, data, mem_mask, 1); } |
| 68 | WRITE16_MEMBER(fuuki16_state::fuuki16_vram_2_w){ fuuki16_vram_w(offset, data, mem_mask, 2); } |
| 69 | WRITE16_MEMBER(fuuki16_state::fuuki16_vram_3_w){ fuuki16_vram_w(offset, data, mem_mask, 3); } |
| 71 | 70 | |
| 72 | 71 | |
| 73 | 72 | /*************************************************************************** |
| r20822 | r20823 | |
| 135 | 134 | |
| 136 | 135 | ***************************************************************************/ |
| 137 | 136 | |
| 138 | | static void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 137 | void fuuki16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 139 | 138 | { |
| 140 | | fuuki16_state *state = screen.machine().driver_data<fuuki16_state>(); |
| 141 | 139 | int offs; |
| 142 | 140 | gfx_element *gfx = screen.machine().gfx[0]; |
| 143 | 141 | bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap; |
| 144 | 142 | const rectangle &visarea = screen.visible_area(); |
| 145 | | UINT16 *spriteram16 = state->m_spriteram; |
| 143 | UINT16 *spriteram16 = m_spriteram; |
| 146 | 144 | int max_x = visarea.max_x + 1; |
| 147 | 145 | int max_y = visarea.max_y + 1; |
| 148 | 146 | |
| 149 | 147 | /* Draw them backwards, for pdrawgfx */ |
| 150 | | for ( offs = (state->m_spriteram.bytes() - 8) / 2; offs >=0; offs -= 8 / 2 ) |
| 148 | for ( offs = (m_spriteram.bytes() - 8) / 2; offs >=0; offs -= 8 / 2 ) |
| 151 | 149 | { |
| 152 | 150 | int x, y, xstart, ystart, xend, yend, xinc, yinc; |
| 153 | 151 | int xnum, ynum, xzoom, yzoom, flipx, flipy; |
| r20822 | r20823 | |
| 182 | 180 | sx = (sx & 0x1ff) - (sx & 0x200); |
| 183 | 181 | sy = (sy & 0x1ff) - (sy & 0x200); |
| 184 | 182 | |
| 185 | | if (state->flip_screen()) |
| 183 | if (flip_screen()) |
| 186 | 184 | { |
| 187 | 185 | flipx = !flipx; sx = max_x - sx - xnum * 16; |
| 188 | 186 | flipy = !flipy; sy = max_y - sy - ynum * 16; |
| r20822 | r20823 | |
| 265 | 263 | ***************************************************************************/ |
| 266 | 264 | |
| 267 | 265 | /* Wrapper to handle bg and bg2 ttogether */ |
| 268 | | static void fuuki16_draw_layer( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri ) |
| 266 | void fuuki16_state::fuuki16_draw_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri ) |
| 269 | 267 | { |
| 270 | | fuuki16_state *state = machine.driver_data<fuuki16_state>(); |
| 271 | | int buffer = (state->m_vregs[0x1e / 2] & 0x40); |
| 268 | //OBRISI.ME |
| 269 | int buffer = (m_vregs[0x1e / 2] & 0x40); |
| 272 | 270 | |
| 273 | 271 | switch( i ) |
| 274 | 272 | { |
| 275 | | case 2: if (buffer) state->m_tilemap[3]->draw(bitmap, cliprect, flag, pri); |
| 276 | | else state->m_tilemap[2]->draw(bitmap, cliprect, flag, pri); |
| 273 | case 2: if (buffer) m_tilemap[3]->draw(bitmap, cliprect, flag, pri); |
| 274 | else m_tilemap[2]->draw(bitmap, cliprect, flag, pri); |
| 277 | 275 | return; |
| 278 | | case 1: state->m_tilemap[1]->draw(bitmap, cliprect, flag, pri); |
| 276 | case 1: m_tilemap[1]->draw(bitmap, cliprect, flag, pri); |
| 279 | 277 | return; |
| 280 | | case 0: state->m_tilemap[0]->draw(bitmap, cliprect, flag, pri); |
| 278 | case 0: m_tilemap[0]->draw(bitmap, cliprect, flag, pri); |
| 281 | 279 | return; |
| 282 | 280 | } |
| 283 | 281 | } |
| r20822 | r20823 | |
| 339 | 337 | bitmap.fill((0x800 * 4) - 1, cliprect); |
| 340 | 338 | machine().priority_bitmap.fill(0, cliprect); |
| 341 | 339 | |
| 342 | | fuuki16_draw_layer(machine(), bitmap, cliprect, tm_back, 0, 1); |
| 343 | | fuuki16_draw_layer(machine(), bitmap, cliprect, tm_middle, 0, 2); |
| 344 | | fuuki16_draw_layer(machine(), bitmap, cliprect, tm_front, 0, 4); |
| 340 | fuuki16_draw_layer(bitmap, cliprect, tm_back, 0, 1); |
| 341 | fuuki16_draw_layer(bitmap, cliprect, tm_middle, 0, 2); |
| 342 | fuuki16_draw_layer(bitmap, cliprect, tm_front, 0, 4); |
| 345 | 343 | |
| 346 | 344 | draw_sprites(screen, bitmap, cliprect); |
| 347 | 345 | |
trunk/src/mame/video/flstory.c
| r20822 | r20823 | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| 162 | | static void flstory_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ) |
| 162 | void flstory_state::flstory_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ) |
| 163 | 163 | { |
| 164 | | flstory_state *state = machine.driver_data<flstory_state>(); |
| 164 | //OBRISI.ME |
| 165 | 165 | int i; |
| 166 | 166 | |
| 167 | 167 | for (i = 0; i < 0x20; i++) |
| 168 | 168 | { |
| 169 | | int pr = state->m_spriteram[state->m_spriteram.bytes() - 1 - i]; |
| 169 | int pr = m_spriteram[m_spriteram.bytes() - 1 - i]; |
| 170 | 170 | int offs = (pr & 0x1f) * 4; |
| 171 | 171 | |
| 172 | 172 | if ((pr & 0x80) == pri) |
| 173 | 173 | { |
| 174 | 174 | int code, sx, sy, flipx, flipy; |
| 175 | 175 | |
| 176 | | code = state->m_spriteram[offs + 2] + ((state->m_spriteram[offs + 1] & 0x30) << 4); |
| 177 | | sx = state->m_spriteram[offs + 3]; |
| 178 | | sy = state->m_spriteram[offs + 0]; |
| 176 | code = m_spriteram[offs + 2] + ((m_spriteram[offs + 1] & 0x30) << 4); |
| 177 | sx = m_spriteram[offs + 3]; |
| 178 | sy = m_spriteram[offs + 0]; |
| 179 | 179 | |
| 180 | | if (state->m_flipscreen) |
| 180 | if (m_flipscreen) |
| 181 | 181 | { |
| 182 | 182 | sx = (240 - sx) & 0xff ; |
| 183 | 183 | sy = sy - 1 ; |
| r20822 | r20823 | |
| 185 | 185 | else |
| 186 | 186 | sy = 240 - sy - 1 ; |
| 187 | 187 | |
| 188 | | flipx = ((state->m_spriteram[offs + 1] & 0x40) >> 6) ^ state->m_flipscreen; |
| 189 | | flipy = ((state->m_spriteram[offs + 1] & 0x80) >> 7) ^ state->m_flipscreen; |
| 188 | flipx = ((m_spriteram[offs + 1] & 0x40) >> 6) ^ m_flipscreen; |
| 189 | flipy = ((m_spriteram[offs + 1] & 0x80) >> 7) ^ m_flipscreen; |
| 190 | 190 | |
| 191 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 191 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 192 | 192 | code, |
| 193 | | state->m_spriteram[offs + 1] & 0x0f, |
| 193 | m_spriteram[offs + 1] & 0x0f, |
| 194 | 194 | flipx,flipy, |
| 195 | 195 | sx,sy,15); |
| 196 | 196 | /* wrap around */ |
| 197 | 197 | if (sx > 240) |
| 198 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 198 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 199 | 199 | code, |
| 200 | | state->m_spriteram[offs + 1] & 0x0f, |
| 200 | m_spriteram[offs + 1] & 0x0f, |
| 201 | 201 | flipx,flipy, |
| 202 | 202 | sx-256,sy,15); |
| 203 | 203 | } |
| r20822 | r20823 | |
| 208 | 208 | { |
| 209 | 209 | m_bg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER1, 0); |
| 210 | 210 | m_bg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER1, 0); |
| 211 | | flstory_draw_sprites(machine(), bitmap, cliprect, 0x00); |
| 211 | flstory_draw_sprites(bitmap, cliprect, 0x00); |
| 212 | 212 | m_bg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER0, 0); |
| 213 | | flstory_draw_sprites(machine(), bitmap, cliprect, 0x80); |
| 213 | flstory_draw_sprites(bitmap, cliprect, 0x80); |
| 214 | 214 | m_bg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER0, 0); |
| 215 | 215 | return 0; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | | static void victnine_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 218 | void flstory_state::victnine_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 219 | 219 | { |
| 220 | | flstory_state *state = machine.driver_data<flstory_state>(); |
| 220 | //OBRISI.ME |
| 221 | 221 | int i; |
| 222 | 222 | |
| 223 | 223 | for (i = 0; i < 0x20; i++) |
| 224 | 224 | { |
| 225 | | int pr = state->m_spriteram[state->m_spriteram.bytes() - 1 - i]; |
| 225 | int pr = m_spriteram[m_spriteram.bytes() - 1 - i]; |
| 226 | 226 | int offs = (pr & 0x1f) * 4; |
| 227 | 227 | |
| 228 | 228 | //if ((pr & 0x80) == pri) |
| 229 | 229 | { |
| 230 | 230 | int code, sx, sy, flipx, flipy; |
| 231 | 231 | |
| 232 | | code = state->m_spriteram[offs + 2] + ((state->m_spriteram[offs + 1] & 0x20) << 3); |
| 233 | | sx = state->m_spriteram[offs + 3]; |
| 234 | | sy = state->m_spriteram[offs + 0]; |
| 232 | code = m_spriteram[offs + 2] + ((m_spriteram[offs + 1] & 0x20) << 3); |
| 233 | sx = m_spriteram[offs + 3]; |
| 234 | sy = m_spriteram[offs + 0]; |
| 235 | 235 | |
| 236 | | if (state->m_flipscreen) |
| 236 | if (m_flipscreen) |
| 237 | 237 | { |
| 238 | 238 | sx = (240 - sx + 1) & 0xff ; |
| 239 | 239 | sy = sy + 1 ; |
| r20822 | r20823 | |
| 241 | 241 | else |
| 242 | 242 | sy = 240 - sy + 1 ; |
| 243 | 243 | |
| 244 | | flipx = ((state->m_spriteram[offs + 1] & 0x40) >> 6) ^ state->m_flipscreen; |
| 245 | | flipy = ((state->m_spriteram[offs + 1] & 0x80) >> 7) ^ state->m_flipscreen; |
| 244 | flipx = ((m_spriteram[offs + 1] & 0x40) >> 6) ^ m_flipscreen; |
| 245 | flipy = ((m_spriteram[offs + 1] & 0x80) >> 7) ^ m_flipscreen; |
| 246 | 246 | |
| 247 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 247 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 248 | 248 | code, |
| 249 | | state->m_spriteram[offs + 1] & 0x0f, |
| 249 | m_spriteram[offs + 1] & 0x0f, |
| 250 | 250 | flipx,flipy, |
| 251 | 251 | sx,sy,15); |
| 252 | 252 | /* wrap around */ |
| 253 | 253 | if (sx > 240) |
| 254 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 254 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 255 | 255 | code, |
| 256 | | state->m_spriteram[offs + 1] & 0x0f, |
| 256 | m_spriteram[offs + 1] & 0x0f, |
| 257 | 257 | flipx,flipy, |
| 258 | 258 | sx-256,sy,15); |
| 259 | 259 | } |
| r20822 | r20823 | |
| 263 | 263 | UINT32 flstory_state::screen_update_victnine(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 264 | 264 | { |
| 265 | 265 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 266 | | victnine_draw_sprites(machine(), bitmap, cliprect); |
| 266 | victnine_draw_sprites(bitmap, cliprect); |
| 267 | 267 | return 0; |
| 268 | 268 | } |
| 269 | 269 | |
| r20822 | r20823 | |
| 271 | 271 | { |
| 272 | 272 | m_bg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER1, 0); |
| 273 | 273 | m_bg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER1, 0); |
| 274 | | victnine_draw_sprites(machine(), bitmap, cliprect); |
| 274 | victnine_draw_sprites(bitmap, cliprect); |
| 275 | 275 | m_bg_tilemap->draw(bitmap, cliprect, 0 | TILEMAP_DRAW_LAYER0, 0); |
| 276 | | victnine_draw_sprites(machine(), bitmap, cliprect); |
| 276 | victnine_draw_sprites(bitmap, cliprect); |
| 277 | 277 | m_bg_tilemap->draw(bitmap, cliprect, 1 | TILEMAP_DRAW_LAYER0, 0); |
| 278 | 278 | return 0; |
| 279 | 279 | } |
trunk/src/mame/video/fuukifg3.c
| r20822 | r20823 | |
| 48 | 48 | |
| 49 | 49 | ***************************************************************************/ |
| 50 | 50 | |
| 51 | | INLINE void get_tile_info8bpp(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, int _N_) |
| 51 | inline void fuuki32_state::get_tile_info8bpp(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_) |
| 52 | 52 | { |
| 53 | | fuuki32_state *state = machine.driver_data<fuuki32_state>(); |
| 54 | | UINT16 code = (state->m_vram[_N_][tile_index] & 0xffff0000) >> 16; |
| 55 | | UINT16 attr = (state->m_vram[_N_][tile_index] & 0x0000ffff); |
| 56 | | SET_TILE_INFO(1 + _N_, code, (attr & 0x3f) >> 4, TILE_FLIPYX((attr >> 6) & 3)); |
| 53 | //OBRISI.ME |
| 54 | UINT16 code = (m_vram[_N_][tile_index] & 0xffff0000) >> 16; |
| 55 | UINT16 attr = (m_vram[_N_][tile_index] & 0x0000ffff); |
| 56 | SET_TILE_INFO_MEMBER(1 + _N_, code, (attr & 0x3f) >> 4, TILE_FLIPYX((attr >> 6) & 3)); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | | TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_0){ get_tile_info8bpp(machine(), tileinfo, tile_index, 0); } |
| 60 | | TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_1){ get_tile_info8bpp(machine(), tileinfo, tile_index, 1); } |
| 59 | TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_0){ get_tile_info8bpp(tileinfo, tile_index, 0); } |
| 60 | TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_1){ get_tile_info8bpp(tileinfo, tile_index, 1); } |
| 61 | 61 | |
| 62 | | INLINE void get_tile_info4bpp(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, int _N_) |
| 62 | inline void fuuki32_state::get_tile_info4bpp(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_) |
| 63 | 63 | { |
| 64 | | fuuki32_state *state = machine.driver_data<fuuki32_state>(); |
| 65 | | UINT16 code = (state->m_vram[_N_][tile_index] & 0xffff0000) >> 16; |
| 66 | | UINT16 attr = (state->m_vram[_N_][tile_index] & 0x0000ffff); |
| 67 | | SET_TILE_INFO(1 + _N_, code, attr & 0x3f, TILE_FLIPYX((attr >> 6) & 3)); |
| 64 | //OBRISI.ME |
| 65 | UINT16 code = (m_vram[_N_][tile_index] & 0xffff0000) >> 16; |
| 66 | UINT16 attr = (m_vram[_N_][tile_index] & 0x0000ffff); |
| 67 | SET_TILE_INFO_MEMBER(1 + _N_, code, attr & 0x3f, TILE_FLIPYX((attr >> 6) & 3)); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | | TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_2){ get_tile_info4bpp(machine(), tileinfo, tile_index, 2); } |
| 71 | | TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_3){ get_tile_info4bpp(machine(), tileinfo, tile_index, 3); } |
| 70 | TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_2){ get_tile_info4bpp(tileinfo, tile_index, 2); } |
| 71 | TILE_GET_INFO_MEMBER(fuuki32_state::get_tile_info_3){ get_tile_info4bpp(tileinfo, tile_index, 3); } |
| 72 | 72 | |
| 73 | | INLINE void fuuki32_vram_w(address_space &space, offs_t offset, UINT32 data, UINT32 mem_mask, int _N_) |
| 73 | inline void fuuki32_state::fuuki32_vram_w(offs_t offset, UINT32 data, UINT32 mem_mask, int _N_) |
| 74 | 74 | { |
| 75 | | fuuki32_state *state = space.machine().driver_data<fuuki32_state>(); |
| 76 | | COMBINE_DATA(&state->m_vram[_N_][offset]); |
| 77 | | state->m_tilemap[_N_]->mark_tile_dirty(offset); |
| 75 | COMBINE_DATA(&m_vram[_N_][offset]); |
| 76 | m_tilemap[_N_]->mark_tile_dirty(offset); |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | | WRITE32_MEMBER(fuuki32_state::fuuki32_vram_0_w){ fuuki32_vram_w(space, offset, data, mem_mask, 0); } |
| 81 | | WRITE32_MEMBER(fuuki32_state::fuuki32_vram_1_w){ fuuki32_vram_w(space, offset, data, mem_mask, 1); } |
| 82 | | WRITE32_MEMBER(fuuki32_state::fuuki32_vram_2_w){ fuuki32_vram_w(space, offset, data, mem_mask, 2); } |
| 83 | | WRITE32_MEMBER(fuuki32_state::fuuki32_vram_3_w){ fuuki32_vram_w(space, offset, data, mem_mask, 3); } |
| 79 | WRITE32_MEMBER(fuuki32_state::fuuki32_vram_0_w){ fuuki32_vram_w(offset, data, mem_mask, 0); } |
| 80 | WRITE32_MEMBER(fuuki32_state::fuuki32_vram_1_w){ fuuki32_vram_w(offset, data, mem_mask, 1); } |
| 81 | WRITE32_MEMBER(fuuki32_state::fuuki32_vram_2_w){ fuuki32_vram_w(offset, data, mem_mask, 2); } |
| 82 | WRITE32_MEMBER(fuuki32_state::fuuki32_vram_3_w){ fuuki32_vram_w(offset, data, mem_mask, 3); } |
| 84 | 83 | |
| 85 | 84 | |
| 86 | 85 | /*************************************************************************** |
| r20822 | r20823 | |
| 142 | 141 | |
| 143 | 142 | ***************************************************************************/ |
| 144 | 143 | |
| 145 | | static void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 144 | void fuuki32_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 146 | 145 | { |
| 147 | | fuuki32_state *state = screen.machine().driver_data<fuuki32_state>(); |
| 148 | 146 | int offs; |
| 149 | 147 | gfx_element *gfx = screen.machine().gfx[0]; |
| 150 | 148 | bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap; |
| r20822 | r20823 | |
| 152 | 150 | int max_x = visarea.max_x + 1; |
| 153 | 151 | int max_y = visarea.max_y + 1; |
| 154 | 152 | |
| 155 | | UINT32 *src = state->m_buf_spriteram2; /* Use spriteram buffered by 2 frames, need palette buffered by one frame? */ |
| 153 | UINT32 *src = m_buf_spriteram2; /* Use spriteram buffered by 2 frames, need palette buffered by one frame? */ |
| 156 | 154 | |
| 157 | 155 | /* Draw them backwards, for pdrawgfx */ |
| 158 | | for (offs = (state->m_spriteram.bytes() - 8) / 4; offs >= 0; offs -= 8/4) |
| 156 | for (offs = (m_spriteram.bytes() - 8) / 4; offs >= 0; offs -= 8/4) |
| 159 | 157 | { |
| 160 | 158 | int x, y, xstart, ystart, xend, yend, xinc, yinc; |
| 161 | 159 | int xnum, ynum, xzoom, yzoom, flipx, flipy; |
| r20822 | r20823 | |
| 169 | 167 | int bank = (code & 0xc000) >> 14; |
| 170 | 168 | int bank_lookedup; |
| 171 | 169 | |
| 172 | | bank_lookedup = ((state->m_spr_buffered_tilebank[1] & 0xffff0000) >> (16 + bank * 4)) & 0xf; |
| 170 | bank_lookedup = ((m_spr_buffered_tilebank[1] & 0xffff0000) >> (16 + bank * 4)) & 0xf; |
| 173 | 171 | code &= 0x3fff; |
| 174 | 172 | code += bank_lookedup * 0x4000; |
| 175 | 173 | |
| r20822 | r20823 | |
| 197 | 195 | sx = (sx & 0x1ff) - (sx & 0x200); |
| 198 | 196 | sy = (sy & 0x1ff) - (sy & 0x200); |
| 199 | 197 | |
| 200 | | if (state->flip_screen()) |
| 198 | if (flip_screen()) |
| 201 | 199 | { |
| 202 | 200 | flipx = !flipx; sx = max_x - sx - xnum * 16; |
| 203 | 201 | flipy = !flipy; sy = max_y - sy - ynum * 16; |
| r20822 | r20823 | |
| 288 | 286 | ***************************************************************************/ |
| 289 | 287 | |
| 290 | 288 | /* Wrapper to handle bg and bg2 ttogether */ |
| 291 | | static void fuuki32_draw_layer( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri ) |
| 289 | void fuuki32_state::fuuki32_draw_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri ) |
| 292 | 290 | { |
| 293 | | fuuki32_state *state = machine.driver_data<fuuki32_state>(); |
| 294 | | int buffer = ((state->m_vregs[0x1e / 4] & 0x0000ffff) & 0x40); |
| 291 | //OBRISI.ME |
| 292 | int buffer = ((m_vregs[0x1e / 4] & 0x0000ffff) & 0x40); |
| 295 | 293 | |
| 296 | 294 | switch( i ) |
| 297 | 295 | { |
| 298 | | case 2: if (buffer) state->m_tilemap[3]->draw(bitmap, cliprect, flag, pri); |
| 299 | | else state->m_tilemap[2]->draw(bitmap, cliprect, flag, pri); |
| 296 | case 2: if (buffer) m_tilemap[3]->draw(bitmap, cliprect, flag, pri); |
| 297 | else m_tilemap[2]->draw(bitmap, cliprect, flag, pri); |
| 300 | 298 | return; |
| 301 | | case 1: state->m_tilemap[1]->draw(bitmap, cliprect, flag, pri); |
| 299 | case 1: m_tilemap[1]->draw(bitmap, cliprect, flag, pri); |
| 302 | 300 | return; |
| 303 | | case 0: state->m_tilemap[0]->draw(bitmap, cliprect, flag, pri); |
| 301 | case 0: m_tilemap[0]->draw(bitmap, cliprect, flag, pri); |
| 304 | 302 | return; |
| 305 | 303 | } |
| 306 | 304 | } |
| r20822 | r20823 | |
| 357 | 355 | bitmap.fill((0x800 * 4) - 1, cliprect); |
| 358 | 356 | machine().priority_bitmap.fill(0, cliprect); |
| 359 | 357 | |
| 360 | | fuuki32_draw_layer(machine(), bitmap, cliprect, tm_back, 0, 1); |
| 361 | | fuuki32_draw_layer(machine(), bitmap, cliprect, tm_middle, 0, 2); |
| 362 | | fuuki32_draw_layer(machine(), bitmap, cliprect, tm_front, 0, 4); |
| 358 | fuuki32_draw_layer(bitmap, cliprect, tm_back, 0, 1); |
| 359 | fuuki32_draw_layer(bitmap, cliprect, tm_middle, 0, 2); |
| 360 | fuuki32_draw_layer(bitmap, cliprect, tm_front, 0, 4); |
| 363 | 361 | |
| 364 | 362 | draw_sprites(screen, bitmap, cliprect); |
| 365 | 363 | return 0; |