trunk/src/mame/drivers/wecleman.c
| r21024 | r21025 | |
| 1287 | 1287 | ROM_LOAD( "602a12.1a", 0x000000, 0x04000, CRC(77b9383d) SHA1(7cb970889677704d6324bb64aafc05326c4503ad) ) |
| 1288 | 1288 | ROM_END |
| 1289 | 1289 | |
| 1290 | | static void wecleman_unpack_sprites(running_machine &machine) |
| 1290 | void wecleman_state::wecleman_unpack_sprites() |
| 1291 | 1291 | { |
| 1292 | 1292 | const char *region = "gfx1"; // sprites |
| 1293 | 1293 | |
| 1294 | | const UINT32 len = machine.root_device().memregion(region)->bytes(); |
| 1295 | | UINT8 *src = machine.root_device().memregion(region)->base() + len / 2 - 1; |
| 1296 | | UINT8 *dst = machine.root_device().memregion(region)->base() + len - 1; |
| 1294 | const UINT32 len = machine().root_device().memregion(region)->bytes(); |
| 1295 | UINT8 *src = machine().root_device().memregion(region)->base() + len / 2 - 1; |
| 1296 | UINT8 *dst = machine().root_device().memregion(region)->base() + len - 1; |
| 1297 | 1297 | |
| 1298 | 1298 | while(dst > src) |
| 1299 | 1299 | { |
| r21024 | r21025 | |
| 1304 | 1304 | } |
| 1305 | 1305 | } |
| 1306 | 1306 | |
| 1307 | | static void bitswap(running_machine &machine,UINT8 *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0) |
| 1307 | void wecleman_state::bitswap(UINT8 *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0) |
| 1308 | 1308 | { |
| 1309 | | UINT8 *buffer = auto_alloc_array(machine, UINT8, len); |
| 1309 | UINT8 *buffer = auto_alloc_array(machine(), UINT8, len); |
| 1310 | 1310 | int i; |
| 1311 | 1311 | |
| 1312 | 1312 | memcpy(buffer,src,len); |
| r21024 | r21025 | |
| 1315 | 1315 | src[i] = |
| 1316 | 1316 | buffer[BITSWAP24(i,23,22,21,_14,_13,_12,_11,_10,_f,_e,_d,_c,_b,_a,_9,_8,_7,_6,_5,_4,_3,_2,_1,_0)]; |
| 1317 | 1317 | } |
| 1318 | | auto_free(machine, buffer); |
| 1318 | auto_free(machine(), buffer); |
| 1319 | 1319 | } |
| 1320 | 1320 | |
| 1321 | 1321 | /* Unpack sprites data and do some patching */ |
| r21024 | r21025 | |
| 1343 | 1343 | RAM[i] = BITSWAP8(RAM[i],7,0,1,2,3,4,5,6); |
| 1344 | 1344 | } |
| 1345 | 1345 | |
| 1346 | | bitswap(machine(), machine().root_device().memregion("gfx1")->base(), machine().root_device().memregion("gfx1")->bytes(), |
| 1346 | bitswap(machine().root_device().memregion("gfx1")->base(), machine().root_device().memregion("gfx1")->bytes(), |
| 1347 | 1347 | 0,1,20,19,18,17,14,9,16,6,4,7,8,15,10,11,13,5,12,3,2); |
| 1348 | 1348 | |
| 1349 | 1349 | /* Now we can unpack each nibble of the sprites into a pixel (one byte) */ |
| 1350 | | wecleman_unpack_sprites(machine()); |
| 1350 | wecleman_unpack_sprites(); |
| 1351 | 1351 | |
| 1352 | 1352 | /* Bg & Fg & Txt */ |
| 1353 | | bitswap(machine(), machine().root_device().memregion("gfx2")->base(), machine().root_device().memregion("gfx2")->bytes(), |
| 1353 | bitswap(machine().root_device().memregion("gfx2")->base(), machine().root_device().memregion("gfx2")->bytes(), |
| 1354 | 1354 | 20,19,18,17,16,15,12,7,14,4,2,5,6,13,8,9,11,3,10,1,0); |
| 1355 | 1355 | |
| 1356 | 1356 | /* Road */ |
| 1357 | | bitswap(machine(), machine().root_device().memregion("gfx3")->base(), machine().root_device().memregion("gfx3")->bytes(), |
| 1357 | bitswap(machine().root_device().memregion("gfx3")->base(), machine().root_device().memregion("gfx3")->bytes(), |
| 1358 | 1358 | 20,19,18,17,16,15,14,7,12,4,2,5,6,13,8,9,11,3,10,1,0); |
| 1359 | 1359 | |
| 1360 | 1360 | m_spr_color_offs = 0x40; |
| r21024 | r21025 | |
| 1414 | 1414 | in a ROM module definition. This routine unpacks each sprite nibble |
| 1415 | 1415 | into a byte, doubling the memory consumption. */ |
| 1416 | 1416 | |
| 1417 | | static void hotchase_sprite_decode( running_machine &machine, int num16_banks, int bank_size ) |
| 1417 | void wecleman_state::hotchase_sprite_decode( int num16_banks, int bank_size ) |
| 1418 | 1418 | { |
| 1419 | 1419 | UINT8 *base, *temp; |
| 1420 | 1420 | int i; |
| 1421 | 1421 | |
| 1422 | | base = machine.root_device().memregion("gfx1")->base(); // sprites |
| 1423 | | temp = auto_alloc_array(machine, UINT8, bank_size ); |
| 1422 | base = machine().root_device().memregion("gfx1")->base(); // sprites |
| 1423 | temp = auto_alloc_array(machine(), UINT8, bank_size ); |
| 1424 | 1424 | |
| 1425 | 1425 | for( i = num16_banks; i >0; i-- ){ |
| 1426 | 1426 | UINT8 *finish = base + 2*bank_size*i; |
| r21024 | r21025 | |
| 1458 | 1458 | *dest++ = data & 0xF; |
| 1459 | 1459 | } while( dest<finish ); |
| 1460 | 1460 | } |
| 1461 | | auto_free( machine, temp ); |
| 1461 | auto_free( machine(), temp ); |
| 1462 | 1462 | } |
| 1463 | 1463 | |
| 1464 | 1464 | /* Unpack sprites data and do some patching */ |
| r21024 | r21025 | |
| 1475 | 1475 | RAM = memregion("gfx1")->base(); |
| 1476 | 1476 | |
| 1477 | 1477 | /* Now we can unpack each nibble of the sprites into a pixel (one byte) */ |
| 1478 | | hotchase_sprite_decode(machine(),3,0x80000*2); // num banks, bank len |
| 1478 | hotchase_sprite_decode(3,0x80000*2); // num banks, bank len |
| 1479 | 1479 | |
| 1480 | 1480 | /* Let's copy the second half of the fg layer gfx (charset) over the first */ |
| 1481 | 1481 | RAM = memregion("gfx3")->base(); |
trunk/src/mame/drivers/xexex.c
| r21024 | r21025 | |
| 114 | 114 | #endif |
| 115 | 115 | |
| 116 | 116 | |
| 117 | | static void xexex_objdma( running_machine &machine, int limiter ) |
| 117 | void xexex_state::xexex_objdma( int limiter ) |
| 118 | 118 | { |
| 119 | | xexex_state *state = machine.driver_data<xexex_state>(); |
| 120 | 119 | int counter, num_inactive; |
| 121 | 120 | UINT16 *src, *dst; |
| 122 | 121 | |
| 123 | | counter = state->m_frame; |
| 124 | | state->m_frame = machine.primary_screen->frame_number(); |
| 125 | | if (limiter && counter == state->m_frame) |
| 122 | counter = m_frame; |
| 123 | m_frame = machine().primary_screen->frame_number(); |
| 124 | if (limiter && counter == m_frame) |
| 126 | 125 | return; // make sure we only do DMA transfer once per frame |
| 127 | 126 | |
| 128 | | k053247_get_ram(state->m_k053246, &dst); |
| 129 | | counter = k053247_get_dy(state->m_k053246); |
| 130 | | src = state->m_spriteram; |
| 127 | k053247_get_ram(m_k053246, &dst); |
| 128 | counter = k053247_get_dy(m_k053246); |
| 129 | src = m_spriteram; |
| 131 | 130 | num_inactive = counter = 256; |
| 132 | 131 | |
| 133 | 132 | do |
| r21024 | r21025 | |
| 170 | 169 | } |
| 171 | 170 | |
| 172 | 171 | |
| 173 | | static void parse_control2( running_machine &machine ) |
| 172 | void xexex_state::parse_control2( ) |
| 174 | 173 | { |
| 175 | | xexex_state *state = machine.driver_data<xexex_state>(); |
| 176 | | |
| 177 | 174 | /* bit 0 is data */ |
| 178 | 175 | /* bit 1 is cs (active low) */ |
| 179 | 176 | /* bit 2 is clock (active high) */ |
| 180 | 177 | /* bit 5 is enable irq 6 */ |
| 181 | 178 | /* bit 6 is enable irq 5 */ |
| 182 | 179 | /* bit 11 is watchdog */ |
| 183 | | state->ioport("EEPROMOUT")->write(state->m_cur_control2, 0xff); |
| 180 | ioport("EEPROMOUT")->write(m_cur_control2, 0xff); |
| 184 | 181 | |
| 185 | 182 | /* bit 8 = enable sprite ROM reading */ |
| 186 | | k053246_set_objcha_line(state->m_k053246, (state->m_cur_control2 & 0x0100) ? ASSERT_LINE : CLEAR_LINE); |
| 183 | k053246_set_objcha_line(m_k053246, (m_cur_control2 & 0x0100) ? ASSERT_LINE : CLEAR_LINE); |
| 187 | 184 | |
| 188 | 185 | /* bit 9 = disable alpha channel on K054157 plane 0 (under investigation) */ |
| 189 | | state->m_cur_alpha = !(state->m_cur_control2 & 0x200); |
| 186 | m_cur_alpha = !(m_cur_control2 & 0x200); |
| 190 | 187 | } |
| 191 | 188 | |
| 192 | 189 | READ16_MEMBER(xexex_state::control2_r) |
| r21024 | r21025 | |
| 197 | 194 | WRITE16_MEMBER(xexex_state::control2_w) |
| 198 | 195 | { |
| 199 | 196 | COMBINE_DATA(&m_cur_control2); |
| 200 | | parse_control2(machine()); |
| 197 | parse_control2(); |
| 201 | 198 | } |
| 202 | 199 | |
| 203 | 200 | |
| r21024 | r21025 | |
| 230 | 227 | return soundlatch3_byte_r(space, 0); |
| 231 | 228 | } |
| 232 | 229 | |
| 233 | | static void reset_sound_region(running_machine &machine) |
| 230 | void xexex_state::reset_sound_region() |
| 234 | 231 | { |
| 235 | | xexex_state *state = machine.driver_data<xexex_state>(); |
| 236 | | state->membank("bank2")->set_entry(state->m_cur_sound_region & 0x07); |
| 232 | membank("bank2")->set_entry(m_cur_sound_region & 0x07); |
| 237 | 233 | } |
| 238 | 234 | |
| 239 | 235 | WRITE8_MEMBER(xexex_state::sound_bankswitch_w) |
| 240 | 236 | { |
| 241 | 237 | m_cur_sound_region = data & 7; |
| 242 | | reset_sound_region(machine()); |
| 238 | reset_sound_region(); |
| 243 | 239 | } |
| 244 | 240 | |
| 245 | 241 | static void ym_set_mixing(device_t *device, double left, double right) |
| r21024 | r21025 | |
| 291 | 287 | if (k053246_is_irq_enabled(m_k053246)) |
| 292 | 288 | { |
| 293 | 289 | // OBJDMA starts at the beginning of V-blank |
| 294 | | xexex_objdma(machine(), 0); |
| 290 | xexex_objdma(0); |
| 295 | 291 | |
| 296 | 292 | // schedule DMA end interrupt |
| 297 | 293 | m_dmadelay_timer->adjust(XE_DMADELAY); |
| r21024 | r21025 | |
| 442 | 438 | |
| 443 | 439 | void xexex_state::xexex_postload() |
| 444 | 440 | { |
| 445 | | parse_control2(machine()); |
| 446 | | reset_sound_region(machine()); |
| 441 | parse_control2(); |
| 442 | reset_sound_region(); |
| 447 | 443 | } |
| 448 | 444 | |
| 449 | 445 | void xexex_state::machine_start() |
trunk/src/mame/drivers/xyonix.c
| r21024 | r21025 | |
| 33 | 33 | |
| 34 | 34 | /* Inputs ********************************************************************/ |
| 35 | 35 | |
| 36 | | static void handle_coins(running_machine &machine, int coin) |
| 36 | void xyonix_state::handle_coins(int coin) |
| 37 | 37 | { |
| 38 | 38 | static const int coinage_table[4][2] = {{2,3},{2,1},{1,2},{1,1}}; |
| 39 | | xyonix_state *state = machine.driver_data<xyonix_state>(); |
| 40 | 39 | int tmp = 0; |
| 41 | 40 | |
| 42 | | //popmessage("Coin %d", state->m_coin); |
| 41 | //popmessage("Coin %d", m_coin); |
| 43 | 42 | |
| 44 | 43 | if (coin & 1) // Coin 2 ! |
| 45 | 44 | { |
| 46 | | tmp = (state->ioport("DSW")->read() & 0xc0) >> 6; |
| 47 | | state->m_coins++; |
| 48 | | if (state->m_coins >= coinage_table[tmp][0]) |
| 45 | tmp = (ioport("DSW")->read() & 0xc0) >> 6; |
| 46 | m_coins++; |
| 47 | if (m_coins >= coinage_table[tmp][0]) |
| 49 | 48 | { |
| 50 | | state->m_credits += coinage_table[tmp][1]; |
| 51 | | state->m_coins -= coinage_table[tmp][0]; |
| 49 | m_credits += coinage_table[tmp][1]; |
| 50 | m_coins -= coinage_table[tmp][0]; |
| 52 | 51 | } |
| 53 | | coin_lockout_global_w(machine, 0); /* Unlock all coin slots */ |
| 54 | | coin_counter_w(machine,1,1); coin_counter_w(machine,1,0); /* Count slot B */ |
| 52 | coin_lockout_global_w(machine(), 0); /* Unlock all coin slots */ |
| 53 | coin_counter_w(machine(),1,1); coin_counter_w(machine(),1,0); /* Count slot B */ |
| 55 | 54 | } |
| 56 | 55 | |
| 57 | 56 | if (coin & 2) // Coin 1 ! |
| 58 | 57 | { |
| 59 | | tmp = (machine.root_device().ioport("DSW")->read() & 0x30) >> 4; |
| 60 | | state->m_coins++; |
| 61 | | if (state->m_coins >= coinage_table[tmp][0]) |
| 58 | tmp = (machine().root_device().ioport("DSW")->read() & 0x30) >> 4; |
| 59 | m_coins++; |
| 60 | if (m_coins >= coinage_table[tmp][0]) |
| 62 | 61 | { |
| 63 | | state->m_credits += coinage_table[tmp][1]; |
| 64 | | state->m_coins -= coinage_table[tmp][0]; |
| 62 | m_credits += coinage_table[tmp][1]; |
| 63 | m_coins -= coinage_table[tmp][0]; |
| 65 | 64 | } |
| 66 | | coin_lockout_global_w(machine, 0); /* Unlock all coin slots */ |
| 67 | | coin_counter_w(machine,0,1); coin_counter_w(machine,0,0); /* Count slot A */ |
| 65 | coin_lockout_global_w(machine(), 0); /* Unlock all coin slots */ |
| 66 | coin_counter_w(machine(),0,1); coin_counter_w(machine(),0,0); /* Count slot A */ |
| 68 | 67 | } |
| 69 | 68 | |
| 70 | | if (state->m_credits >= 9) |
| 71 | | state->m_credits = 9; |
| 69 | if (m_credits >= 9) |
| 70 | m_credits = 9; |
| 72 | 71 | } |
| 73 | 72 | |
| 74 | 73 | |
| r21024 | r21025 | |
| 97 | 96 | coin = ((ioport("P1")->read() & 0x80) >> 7) | ((ioport("P2")->read() & 0x80) >> 6); |
| 98 | 97 | if (coin ^ m_prev_coin && coin != 3) |
| 99 | 98 | { |
| 100 | | if (m_credits < 9) handle_coins(machine(), coin); |
| 99 | if (m_credits < 9) handle_coins(coin); |
| 101 | 100 | } |
| 102 | 101 | m_prev_coin = coin; |
| 103 | 102 | return m_credits; |
trunk/src/mame/video/zac2650.c
| r21024 | r21025 | |
| 48 | 48 | /* Check for Collision between 2 sprites */ |
| 49 | 49 | /*****************************************/ |
| 50 | 50 | |
| 51 | | static int SpriteCollision(running_machine &machine, int first,int second) |
| 51 | int zac2650_state::SpriteCollision(int first,int second) |
| 52 | 52 | { |
| 53 | | zac2650_state *state = machine.driver_data<zac2650_state>(); |
| 54 | 53 | int Checksum=0; |
| 55 | 54 | int x,y; |
| 56 | | const rectangle &visarea = machine.primary_screen->visible_area(); |
| 55 | const rectangle &visarea = machine().primary_screen->visible_area(); |
| 57 | 56 | |
| 58 | | if((state->m_s2636_0_ram[first * 0x10 + 10] < 0xf0) && (state->m_s2636_0_ram[second * 0x10 + 10] < 0xf0)) |
| 57 | if((m_s2636_0_ram[first * 0x10 + 10] < 0xf0) && (m_s2636_0_ram[second * 0x10 + 10] < 0xf0)) |
| 59 | 58 | { |
| 60 | | int fx = (state->m_s2636_0_ram[first * 0x10 + 10] * 4)-22; |
| 61 | | int fy = (state->m_s2636_0_ram[first * 0x10 + 12] * 3)+3; |
| 59 | int fx = (m_s2636_0_ram[first * 0x10 + 10] * 4)-22; |
| 60 | int fy = (m_s2636_0_ram[first * 0x10 + 12] * 3)+3; |
| 62 | 61 | int expand = (first==1) ? 2 : 1; |
| 63 | 62 | |
| 64 | 63 | /* Draw first sprite */ |
| 65 | 64 | |
| 66 | | drawgfx_opaque(state->m_spritebitmap,state->m_spritebitmap.cliprect(), machine.gfx[expand], |
| 65 | drawgfx_opaque(m_spritebitmap,m_spritebitmap.cliprect(), machine().gfx[expand], |
| 67 | 66 | first * 2, |
| 68 | 67 | 0, |
| 69 | 68 | 0,0, |
| r21024 | r21025 | |
| 71 | 70 | |
| 72 | 71 | /* Get fingerprint */ |
| 73 | 72 | |
| 74 | | for (x = fx; x < fx + machine.gfx[expand]->width(); x++) |
| 73 | for (x = fx; x < fx + machine().gfx[expand]->width(); x++) |
| 75 | 74 | { |
| 76 | | for (y = fy; y < fy + machine.gfx[expand]->height(); y++) |
| 75 | for (y = fy; y < fy + machine().gfx[expand]->height(); y++) |
| 77 | 76 | { |
| 78 | 77 | if (visarea.contains(x, y)) |
| 79 | | Checksum += state->m_spritebitmap.pix16(y, x); |
| 78 | Checksum += m_spritebitmap.pix16(y, x); |
| 80 | 79 | } |
| 81 | 80 | } |
| 82 | 81 | |
| 83 | 82 | /* Blackout second sprite */ |
| 84 | 83 | |
| 85 | | drawgfx_transpen(state->m_spritebitmap,state->m_spritebitmap.cliprect(), machine.gfx[1], |
| 84 | drawgfx_transpen(m_spritebitmap,m_spritebitmap.cliprect(), machine().gfx[1], |
| 86 | 85 | second * 2, |
| 87 | 86 | 1, |
| 88 | 87 | 0,0, |
| 89 | | (state->m_s2636_0_ram[second * 0x10 + 10] * 4)-22,(state->m_s2636_0_ram[second * 0x10 + 12] * 3) + 3, 0); |
| 88 | (m_s2636_0_ram[second * 0x10 + 10] * 4)-22,(m_s2636_0_ram[second * 0x10 + 12] * 3) + 3, 0); |
| 90 | 89 | |
| 91 | 90 | /* Remove fingerprint */ |
| 92 | 91 | |
| 93 | | for (x = fx; x < fx + machine.gfx[expand]->width(); x++) |
| 92 | for (x = fx; x < fx + machine().gfx[expand]->width(); x++) |
| 94 | 93 | { |
| 95 | | for (y = fy; y < fy + machine.gfx[expand]->height(); y++) |
| 94 | for (y = fy; y < fy + machine().gfx[expand]->height(); y++) |
| 96 | 95 | { |
| 97 | 96 | if (visarea.contains(x, y)) |
| 98 | | Checksum -= state->m_spritebitmap.pix16(y, x); |
| 97 | Checksum -= m_spritebitmap.pix16(y, x); |
| 99 | 98 | } |
| 100 | 99 | } |
| 101 | 100 | |
| 102 | 101 | /* Zero bitmap */ |
| 103 | 102 | |
| 104 | | drawgfx_opaque(state->m_spritebitmap,state->m_spritebitmap.cliprect(), machine.gfx[expand], |
| 103 | drawgfx_opaque(m_spritebitmap,m_spritebitmap.cliprect(), machine().gfx[expand], |
| 105 | 104 | first * 2, |
| 106 | 105 | 1, |
| 107 | 106 | 0,0, |
| r21024 | r21025 | |
| 131 | 130 | machine().gfx[2]->set_source(m_s2636_0_ram); |
| 132 | 131 | } |
| 133 | 132 | |
| 134 | | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 133 | void zac2650_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 135 | 134 | { |
| 136 | | zac2650_state *state = machine.driver_data<zac2650_state>(); |
| 137 | 135 | int offs; |
| 138 | | const rectangle &visarea = machine.primary_screen->visible_area(); |
| 136 | const rectangle &visarea = machine().primary_screen->visible_area(); |
| 139 | 137 | |
| 140 | 138 | /* -------------------------------------------------------------- */ |
| 141 | 139 | /* There seems to be a strange setup with this board, in that it */ |
| r21024 | r21025 | |
| 148 | 146 | /* does not seem to be a fault of the emulation! */ |
| 149 | 147 | /* -------------------------------------------------------------- */ |
| 150 | 148 | |
| 151 | | state->m_CollisionBackground = 0; /* Read from 0x1e80 bit 7 */ |
| 149 | m_CollisionBackground = 0; /* Read from 0x1e80 bit 7 */ |
| 152 | 150 | |
| 153 | 151 | // for collision detection checking |
| 154 | | copybitmap(state->m_bitmap,bitmap,0,0,0,0,visarea); |
| 152 | copybitmap(m_bitmap,bitmap,0,0,0,0,visarea); |
| 155 | 153 | |
| 156 | 154 | for(offs=0;offs<0x50;offs+=0x10) |
| 157 | 155 | { |
| 158 | | if((state->m_s2636_0_ram[offs+10]<0xF0) && (offs!=0x30)) |
| 156 | if((m_s2636_0_ram[offs+10]<0xF0) && (offs!=0x30)) |
| 159 | 157 | { |
| 160 | 158 | int spriteno = (offs / 8); |
| 161 | | int expand = ((state->m_s2636_0_ram[0xc0] & (spriteno*2))!=0) ? 2 : 1; |
| 162 | | int bx = (state->m_s2636_0_ram[offs+10] * 4) - 22; |
| 163 | | int by = (state->m_s2636_0_ram[offs+12] * 3) + 3; |
| 159 | int expand = ((m_s2636_0_ram[0xc0] & (spriteno*2))!=0) ? 2 : 1; |
| 160 | int bx = (m_s2636_0_ram[offs+10] * 4) - 22; |
| 161 | int by = (m_s2636_0_ram[offs+12] * 3) + 3; |
| 164 | 162 | int x,y; |
| 165 | 163 | |
| 166 | 164 | /* Sprite->Background collision detection */ |
| 167 | | drawgfx_transpen(bitmap,cliprect, machine.gfx[expand], |
| 165 | drawgfx_transpen(bitmap,cliprect, machine().gfx[expand], |
| 168 | 166 | spriteno, |
| 169 | 167 | 1, |
| 170 | 168 | 0,0, |
| 171 | 169 | bx,by, 0); |
| 172 | 170 | |
| 173 | | for (x = bx; x < bx + machine.gfx[expand]->width(); x++) |
| 171 | for (x = bx; x < bx + machine().gfx[expand]->width(); x++) |
| 174 | 172 | { |
| 175 | | for (y = by; y < by + machine.gfx[expand]->height(); y++) |
| 173 | for (y = by; y < by + machine().gfx[expand]->height(); y++) |
| 176 | 174 | { |
| 177 | 175 | if (visarea.contains(x, y)) |
| 178 | | if (bitmap.pix16(y, x) != state->m_bitmap.pix16(y, x)) |
| 176 | if (bitmap.pix16(y, x) != m_bitmap.pix16(y, x)) |
| 179 | 177 | { |
| 180 | | state->m_CollisionBackground = 0x80; |
| 178 | m_CollisionBackground = 0x80; |
| 181 | 179 | break; |
| 182 | 180 | } |
| 183 | 181 | } |
| 184 | 182 | } |
| 185 | 183 | |
| 186 | | drawgfx_transpen(bitmap,cliprect, machine.gfx[expand], |
| 184 | drawgfx_transpen(bitmap,cliprect, machine().gfx[expand], |
| 187 | 185 | spriteno, |
| 188 | 186 | 0, |
| 189 | 187 | 0,0, |
| r21024 | r21025 | |
| 192 | 190 | } |
| 193 | 191 | |
| 194 | 192 | /* Sprite->Sprite collision detection */ |
| 195 | | state->m_CollisionSprite = 0; |
| 196 | | // if(SpriteCollision(machine, 0,1)) state->m_CollisionSprite |= 0x20; /* Not Used */ |
| 197 | | if(SpriteCollision(machine, 0,2)) state->m_CollisionSprite |= 0x10; |
| 198 | | if(SpriteCollision(machine, 0,4)) state->m_CollisionSprite |= 0x08; |
| 199 | | if(SpriteCollision(machine, 1,2)) state->m_CollisionSprite |= 0x04; |
| 200 | | if(SpriteCollision(machine, 1,4)) state->m_CollisionSprite |= 0x02; |
| 201 | | // if(SpriteCollision(machine, 2,4)) state->m_CollisionSprite |= 0x01; /* Not Used */ |
| 193 | m_CollisionSprite = 0; |
| 194 | // if(SpriteCollision(0,1)) m_CollisionSprite |= 0x20; /* Not Used */ |
| 195 | if(SpriteCollision(0,2)) m_CollisionSprite |= 0x10; |
| 196 | if(SpriteCollision(0,4)) m_CollisionSprite |= 0x08; |
| 197 | if(SpriteCollision(1,2)) m_CollisionSprite |= 0x04; |
| 198 | if(SpriteCollision(1,4)) m_CollisionSprite |= 0x02; |
| 199 | // if(SpriteCollision(2,4)) m_CollisionSprite |= 0x01; /* Not Used */ |
| 202 | 200 | } |
| 203 | 201 | |
| 204 | 202 | UINT32 zac2650_state::screen_update_tinvader(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 205 | 203 | { |
| 206 | 204 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 207 | | draw_sprites(machine(), bitmap, cliprect); |
| 205 | draw_sprites(bitmap, cliprect); |
| 208 | 206 | return 0; |
| 209 | 207 | } |
trunk/src/mame/video/zaxxon.c
| r21024 | r21025 | |
| 114 | 114 | * |
| 115 | 115 | *************************************/ |
| 116 | 116 | |
| 117 | | static void video_start_common(running_machine &machine, tilemap_get_info_delegate fg_tile_info) |
| 117 | void zaxxon_state::video_start_common(tilemap_get_info_delegate fg_tile_info) |
| 118 | 118 | { |
| 119 | | zaxxon_state *state = machine.driver_data<zaxxon_state>(); |
| 120 | | |
| 121 | 119 | /* reset globals */ |
| 122 | | state->m_bg_enable = 0; |
| 123 | | state->m_bg_color = 0; |
| 124 | | state->m_bg_position = 0; |
| 125 | | state->m_fg_color = 0; |
| 126 | | state->m_congo_fg_bank = 0; |
| 127 | | state->m_congo_color_bank = 0; |
| 128 | | memset(state->m_congo_custom, 0, sizeof(state->m_congo_custom)); |
| 120 | m_bg_enable = 0; |
| 121 | m_bg_color = 0; |
| 122 | m_bg_position = 0; |
| 123 | m_fg_color = 0; |
| 124 | m_congo_fg_bank = 0; |
| 125 | m_congo_color_bank = 0; |
| 126 | memset(m_congo_custom, 0, sizeof(m_congo_custom)); |
| 129 | 127 | |
| 130 | 128 | /* create a background and foreground tilemap */ |
| 131 | | state->m_bg_tilemap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(zaxxon_state::get_bg_tile_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,512); |
| 132 | | state->m_fg_tilemap = &machine.tilemap().create(fg_tile_info, TILEMAP_SCAN_ROWS, 8,8, 32,32); |
| 129 | m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(zaxxon_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,512); |
| 130 | m_fg_tilemap = &machine().tilemap().create(fg_tile_info, TILEMAP_SCAN_ROWS, 8,8, 32,32); |
| 133 | 131 | |
| 134 | 132 | /* configure the foreground tilemap */ |
| 135 | | state->m_fg_tilemap->set_transparent_pen(0); |
| 136 | | state->m_fg_tilemap->set_scrolldx(0, machine.primary_screen->width() - 256); |
| 137 | | state->m_fg_tilemap->set_scrolldy(0, machine.primary_screen->height() - 256); |
| 133 | m_fg_tilemap->set_transparent_pen(0); |
| 134 | m_fg_tilemap->set_scrolldx(0, machine().primary_screen->width() - 256); |
| 135 | m_fg_tilemap->set_scrolldy(0, machine().primary_screen->height() - 256); |
| 138 | 136 | |
| 139 | 137 | /* register for save states */ |
| 140 | | state->save_item(NAME(state->m_bg_enable)); |
| 141 | | state->save_item(NAME(state->m_bg_color)); |
| 142 | | state->save_item(NAME(state->m_bg_position)); |
| 143 | | state->save_item(NAME(state->m_fg_color)); |
| 138 | save_item(NAME(m_bg_enable)); |
| 139 | save_item(NAME(m_bg_color)); |
| 140 | save_item(NAME(m_bg_position)); |
| 141 | save_item(NAME(m_fg_color)); |
| 144 | 142 | } |
| 145 | 143 | |
| 146 | 144 | |
| 147 | 145 | void zaxxon_state::video_start() |
| 148 | 146 | { |
| 149 | | video_start_common(machine(), tilemap_get_info_delegate(FUNC(zaxxon_state::zaxxon_get_fg_tile_info),this)); |
| 147 | video_start_common(tilemap_get_info_delegate(FUNC(zaxxon_state::zaxxon_get_fg_tile_info),this)); |
| 150 | 148 | } |
| 151 | 149 | |
| 152 | 150 | |
| 153 | 151 | VIDEO_START_MEMBER(zaxxon_state,razmataz) |
| 154 | 152 | { |
| 155 | | video_start_common(machine(), tilemap_get_info_delegate(FUNC(zaxxon_state::razmataz_get_fg_tile_info),this)); |
| 153 | video_start_common(tilemap_get_info_delegate(FUNC(zaxxon_state::razmataz_get_fg_tile_info),this)); |
| 156 | 154 | } |
| 157 | 155 | |
| 158 | 156 | |
| r21024 | r21025 | |
| 166 | 164 | save_item(NAME(m_congo_color_bank)); |
| 167 | 165 | save_item(NAME(m_congo_custom)); |
| 168 | 166 | |
| 169 | | video_start_common(machine(), tilemap_get_info_delegate(FUNC(zaxxon_state::congo_get_fg_tile_info),this)); |
| 167 | video_start_common(tilemap_get_info_delegate(FUNC(zaxxon_state::congo_get_fg_tile_info),this)); |
| 170 | 168 | } |
| 171 | 169 | |
| 172 | 170 | |
| r21024 | r21025 | |
| 297 | 295 | * |
| 298 | 296 | *************************************/ |
| 299 | 297 | |
| 300 | | static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int skew) |
| 298 | void zaxxon_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int skew) |
| 301 | 299 | { |
| 302 | | zaxxon_state *state = machine.driver_data<zaxxon_state>(); |
| 303 | | |
| 304 | 300 | /* only draw if enabled */ |
| 305 | | if (state->m_bg_enable) |
| 301 | if (m_bg_enable) |
| 306 | 302 | { |
| 307 | | bitmap_ind16 &pixmap = state->m_bg_tilemap->pixmap(); |
| 308 | | int colorbase = state->m_bg_color + (state->m_congo_color_bank << 8); |
| 303 | bitmap_ind16 &pixmap = m_bg_tilemap->pixmap(); |
| 304 | int colorbase = m_bg_color + (m_congo_color_bank << 8); |
| 309 | 305 | int xmask = pixmap.width() - 1; |
| 310 | 306 | int ymask = pixmap.height() - 1; |
| 311 | | int flipmask = state->flip_screen() ? 0xff : 0x00; |
| 312 | | int flipoffs = state->flip_screen() ? 0x38 : 0x40; |
| 307 | int flipmask = flip_screen() ? 0xff : 0x00; |
| 308 | int flipoffs = flip_screen() ? 0x38 : 0x40; |
| 313 | 309 | int x, y; |
| 314 | 310 | |
| 315 | 311 | /* the starting X value is offset by 1 pixel (normal) or 7 pixels */ |
| 316 | 312 | /* (flipped) due to a delay in the loading */ |
| 317 | | if (!state->flip_screen()) |
| 313 | if (!flip_screen()) |
| 318 | 314 | flipoffs -= 1; |
| 319 | 315 | else |
| 320 | 316 | flipoffs += 7; |
| r21024 | r21025 | |
| 331 | 327 | |
| 332 | 328 | /* base of the source row comes from VF plus the scroll value */ |
| 333 | 329 | /* this is done by the 3 4-bit adders at U56, U74, U75 */ |
| 334 | | srcy = vf + ((state->m_bg_position << 1) ^ 0xfff) + 1; |
| 330 | srcy = vf + ((m_bg_position << 1) ^ 0xfff) + 1; |
| 335 | 331 | src = &pixmap.pix16(srcy & ymask); |
| 336 | 332 | |
| 337 | 333 | /* loop over visible columns */ |
| r21024 | r21025 | |
| 359 | 355 | |
| 360 | 356 | /* if not enabled, fill the background with black */ |
| 361 | 357 | else |
| 362 | | bitmap.fill(get_black_pen(machine), cliprect); |
| 358 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 363 | 359 | } |
| 364 | 360 | |
| 365 | 361 | |
| r21024 | r21025 | |
| 370 | 366 | * |
| 371 | 367 | *************************************/ |
| 372 | 368 | |
| 373 | | INLINE int find_minimum_y(UINT8 value, int flip) |
| 369 | inline int zaxxon_state::find_minimum_y(UINT8 value, int flip) |
| 374 | 370 | { |
| 375 | 371 | int flipmask = flip ? 0xff : 0x00; |
| 376 | 372 | int flipconst = flip ? 0xef : 0xf1; |
| r21024 | r21025 | |
| 401 | 397 | } |
| 402 | 398 | |
| 403 | 399 | |
| 404 | | INLINE int find_minimum_x(UINT8 value, int flip) |
| 400 | inline int zaxxon_state::find_minimum_x(UINT8 value, int flip) |
| 405 | 401 | { |
| 406 | 402 | int flipmask = flip ? 0xff : 0x00; |
| 407 | 403 | int x; |
| r21024 | r21025 | |
| 415 | 411 | } |
| 416 | 412 | |
| 417 | 413 | |
| 418 | | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 flipxmask, UINT16 flipymask) |
| 414 | void zaxxon_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 flipxmask, UINT16 flipymask) |
| 419 | 415 | { |
| 420 | | zaxxon_state *state = machine.driver_data<zaxxon_state>(); |
| 421 | | UINT8 *spriteram = state->m_spriteram; |
| 422 | | gfx_element *gfx = machine.gfx[2]; |
| 423 | | int flip = state->flip_screen(); |
| 416 | UINT8 *spriteram = m_spriteram; |
| 417 | gfx_element *gfx = machine().gfx[2]; |
| 418 | int flip = flip_screen(); |
| 424 | 419 | int flipmask = flip ? 0xff : 0x00; |
| 425 | 420 | int offs; |
| 426 | 421 | |
| r21024 | r21025 | |
| 431 | 426 | int flipy = (spriteram[offs + (flipymask >> 8)] ^ flipmask) & flipymask; |
| 432 | 427 | int flipx = (spriteram[offs + (flipxmask >> 8)] ^ flipmask) & flipxmask; |
| 433 | 428 | int code = spriteram[offs + 1]; |
| 434 | | int color = (spriteram[offs + 2] & 0x1f) + (state->m_congo_color_bank << 5); |
| 429 | int color = (spriteram[offs + 2] & 0x1f) + (m_congo_color_bank << 5); |
| 435 | 430 | int sx = find_minimum_x(spriteram[offs + 3], flip); |
| 436 | 431 | |
| 437 | 432 | /* draw with 256 pixel offsets to ensure we wrap properly */ |
| r21024 | r21025 | |
| 452 | 447 | |
| 453 | 448 | UINT32 zaxxon_state::screen_update_zaxxon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 454 | 449 | { |
| 455 | | draw_background(machine(), bitmap, cliprect, TRUE); |
| 456 | | draw_sprites(machine(), bitmap, cliprect, 0x140, 0x180); |
| 450 | draw_background(bitmap, cliprect, TRUE); |
| 451 | draw_sprites(bitmap, cliprect, 0x140, 0x180); |
| 457 | 452 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 458 | 453 | return 0; |
| 459 | 454 | } |
| r21024 | r21025 | |
| 461 | 456 | |
| 462 | 457 | UINT32 zaxxon_state::screen_update_futspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 463 | 458 | { |
| 464 | | draw_background(machine(), bitmap, cliprect, TRUE); |
| 465 | | draw_sprites(machine(), bitmap, cliprect, 0x180, 0x180); |
| 459 | draw_background(bitmap, cliprect, TRUE); |
| 460 | draw_sprites(bitmap, cliprect, 0x180, 0x180); |
| 466 | 461 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 467 | 462 | return 0; |
| 468 | 463 | } |
| r21024 | r21025 | |
| 470 | 465 | |
| 471 | 466 | UINT32 zaxxon_state::screen_update_razmataz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 472 | 467 | { |
| 473 | | draw_background(machine(), bitmap, cliprect, FALSE); |
| 474 | | draw_sprites(machine(), bitmap, cliprect, 0x140, 0x180); |
| 468 | draw_background(bitmap, cliprect, FALSE); |
| 469 | draw_sprites(bitmap, cliprect, 0x140, 0x180); |
| 475 | 470 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 476 | 471 | return 0; |
| 477 | 472 | } |
| r21024 | r21025 | |
| 479 | 474 | |
| 480 | 475 | UINT32 zaxxon_state::screen_update_congo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 481 | 476 | { |
| 482 | | draw_background(machine(), bitmap, cliprect, TRUE); |
| 483 | | draw_sprites(machine(), bitmap, cliprect, 0x280, 0x180); |
| 477 | draw_background(bitmap, cliprect, TRUE); |
| 478 | draw_sprites(bitmap, cliprect, 0x280, 0x180); |
| 484 | 479 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 485 | 480 | return 0; |
| 486 | 481 | } |
trunk/src/mame/video/xain.c
| r21024 | r21025 | |
| 157 | 157 | |
| 158 | 158 | ***************************************************************************/ |
| 159 | 159 | |
| 160 | | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect) |
| 160 | void xain_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) |
| 161 | 161 | { |
| 162 | | xain_state *state = machine.driver_data<xain_state>(); |
| 163 | | UINT8 *spriteram = state->m_spriteram; |
| 162 | UINT8 *spriteram = m_spriteram; |
| 164 | 163 | int offs; |
| 165 | 164 | |
| 166 | | for (offs = 0; offs < state->m_spriteram.bytes();offs += 4) |
| 165 | for (offs = 0; offs < m_spriteram.bytes();offs += 4) |
| 167 | 166 | { |
| 168 | 167 | int sx,sy,flipx,flipy; |
| 169 | 168 | int attr = spriteram[offs+1]; |
| r21024 | r21025 | |
| 176 | 175 | if (sy <= -7) sy += 256; |
| 177 | 176 | flipx = attr & 0x40; |
| 178 | 177 | flipy = 0; |
| 179 | | if (state->flip_screen()) |
| 178 | if (flip_screen()) |
| 180 | 179 | { |
| 181 | 180 | sx = 238 - sx; |
| 182 | 181 | sy = 240 - sy; |
| r21024 | r21025 | |
| 186 | 185 | |
| 187 | 186 | if (attr & 0x80) /* double height */ |
| 188 | 187 | { |
| 189 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 188 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 190 | 189 | numtile, |
| 191 | 190 | color, |
| 192 | 191 | flipx,flipy, |
| 193 | 192 | sx,flipy ? sy+16:sy-16,0); |
| 194 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 193 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 195 | 194 | numtile+1, |
| 196 | 195 | color, |
| 197 | 196 | flipx,flipy, |
| r21024 | r21025 | |
| 199 | 198 | } |
| 200 | 199 | else |
| 201 | 200 | { |
| 202 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[3], |
| 201 | drawgfx_transpen(bitmap,cliprect,machine().gfx[3], |
| 203 | 202 | numtile, |
| 204 | 203 | color, |
| 205 | 204 | flipx,flipy, |
| r21024 | r21025 | |
| 215 | 214 | case 0: |
| 216 | 215 | m_bgram0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 217 | 216 | m_bgram1_tilemap->draw(bitmap, cliprect, 0,0); |
| 218 | | draw_sprites(machine(), bitmap,cliprect); |
| 217 | draw_sprites(bitmap,cliprect); |
| 219 | 218 | m_char_tilemap->draw(bitmap, cliprect, 0,0); |
| 220 | 219 | break; |
| 221 | 220 | case 1: |
| 222 | 221 | m_bgram1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 223 | 222 | m_bgram0_tilemap->draw(bitmap, cliprect, 0,0); |
| 224 | | draw_sprites(machine(), bitmap,cliprect); |
| 223 | draw_sprites(bitmap,cliprect); |
| 225 | 224 | m_char_tilemap->draw(bitmap, cliprect, 0,0); |
| 226 | 225 | break; |
| 227 | 226 | case 2: |
| 228 | 227 | m_char_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 229 | 228 | m_bgram0_tilemap->draw(bitmap, cliprect, 0,0); |
| 230 | | draw_sprites(machine(), bitmap,cliprect); |
| 229 | draw_sprites(bitmap,cliprect); |
| 231 | 230 | m_bgram1_tilemap->draw(bitmap, cliprect, 0,0); |
| 232 | 231 | break; |
| 233 | 232 | case 3: |
| 234 | 233 | m_char_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 235 | 234 | m_bgram1_tilemap->draw(bitmap, cliprect, 0,0); |
| 236 | | draw_sprites(machine(), bitmap,cliprect); |
| 235 | draw_sprites(bitmap,cliprect); |
| 237 | 236 | m_bgram0_tilemap->draw(bitmap, cliprect, 0,0); |
| 238 | 237 | break; |
| 239 | 238 | case 4: |
| 240 | 239 | m_bgram0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 241 | 240 | m_char_tilemap->draw(bitmap, cliprect, 0,0); |
| 242 | | draw_sprites(machine(), bitmap,cliprect); |
| 241 | draw_sprites(bitmap,cliprect); |
| 243 | 242 | m_bgram1_tilemap->draw(bitmap, cliprect, 0,0); |
| 244 | 243 | break; |
| 245 | 244 | case 5: |
| 246 | 245 | m_bgram1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 247 | 246 | m_char_tilemap->draw(bitmap, cliprect, 0,0); |
| 248 | | draw_sprites(machine(), bitmap,cliprect); |
| 247 | draw_sprites(bitmap,cliprect); |
| 249 | 248 | m_bgram0_tilemap->draw(bitmap, cliprect, 0,0); |
| 250 | 249 | break; |
| 251 | 250 | case 6: |
| 252 | 251 | m_bgram0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 253 | | draw_sprites(machine(), bitmap,cliprect); |
| 252 | draw_sprites(bitmap,cliprect); |
| 254 | 253 | m_bgram1_tilemap->draw(bitmap, cliprect, 0,0); |
| 255 | 254 | m_char_tilemap->draw(bitmap, cliprect, 0,0); |
| 256 | 255 | break; |
| 257 | 256 | case 7: |
| 258 | 257 | m_bgram1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 259 | | draw_sprites(machine(), bitmap,cliprect); |
| 258 | draw_sprites(bitmap,cliprect); |
| 260 | 259 | m_bgram0_tilemap->draw(bitmap, cliprect, 0,0); |
| 261 | 260 | m_char_tilemap->draw(bitmap, cliprect, 0,0); |
| 262 | 261 | break; |
trunk/src/mame/video/wwfwfest.c
| r21024 | r21025 | |
| 138 | 138 | sprite drawing could probably be improved a bit |
| 139 | 139 | *******************************************************************************/ |
| 140 | 140 | |
| 141 | | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 141 | void wwfwfest_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 142 | 142 | { |
| 143 | | wwfwfest_state *state = machine.driver_data<wwfwfest_state>(); |
| 144 | 143 | /*- SPR RAM Format -** |
| 145 | 144 | |
| 146 | 145 | 16 bytes per sprite |
| r21024 | r21025 | |
| 161 | 160 | |
| 162 | 161 | **- End of Comments -*/ |
| 163 | 162 | |
| 164 | | UINT16 *buffered_spriteram16 = state->m_spriteram->buffer(); |
| 165 | | gfx_element *gfx = machine.gfx[1]; |
| 163 | UINT16 *buffered_spriteram16 = m_spriteram->buffer(); |
| 164 | gfx_element *gfx = machine().gfx[1]; |
| 166 | 165 | UINT16 *source = buffered_spriteram16; |
| 167 | 166 | UINT16 *finish = source + 0x2000/2; |
| 168 | 167 | |
| r21024 | r21025 | |
| 175 | 174 | if (enable) { |
| 176 | 175 | xpos = +(source[5] & 0x00ff) | (source[1] & 0x0004) << 6; |
| 177 | 176 | if (xpos>512-16) xpos -=512; |
| 178 | | xpos += state->m_sprite_xoff; |
| 177 | xpos += m_sprite_xoff; |
| 179 | 178 | ypos = (source[0] & 0x00ff) | (source[1] & 0x0002) << 7; |
| 180 | 179 | ypos = (256 - ypos) & 0x1ff; |
| 181 | 180 | ypos -= 16 ; |
| r21024 | r21025 | |
| 186 | 185 | number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8; |
| 187 | 186 | colourbank = (source[4] & 0x000f); |
| 188 | 187 | |
| 189 | | if (state->flip_screen()) { |
| 188 | if (flip_screen()) { |
| 190 | 189 | if (flipy) flipy=0; else flipy=1; |
| 191 | 190 | if (flipx) flipx=0; else flipx=1; |
| 192 | | ypos=240-ypos-state->m_sprite_xoff; |
| 191 | ypos=240-ypos-m_sprite_xoff; |
| 193 | 192 | xpos=304-xpos; |
| 194 | 193 | } |
| 195 | 194 | |
| 196 | 195 | for (count=0;count<chain;count++) { |
| 197 | | if (state->flip_screen()) { |
| 196 | if (flip_screen()) { |
| 198 | 197 | if (!flipy) { |
| 199 | 198 | drawgfx_transpen(bitmap,cliprect,gfx,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),0); |
| 200 | 199 | } else { |
| r21024 | r21025 | |
| 266 | 265 | if (m_pri == 0x007b) { |
| 267 | 266 | m_bg0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 268 | 267 | m_bg1_tilemap->draw(bitmap, cliprect, 0,0); |
| 269 | | draw_sprites(machine(), bitmap,cliprect); |
| 268 | draw_sprites(bitmap,cliprect); |
| 270 | 269 | m_fg0_tilemap->draw(bitmap, cliprect, 0,0); |
| 271 | 270 | } |
| 272 | 271 | |
| 273 | 272 | if (m_pri == 0x007c) { |
| 274 | 273 | m_bg0_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 275 | | draw_sprites(machine(), bitmap,cliprect); |
| 274 | draw_sprites(bitmap,cliprect); |
| 276 | 275 | m_bg1_tilemap->draw(bitmap, cliprect, 0,0); |
| 277 | 276 | m_fg0_tilemap->draw(bitmap, cliprect, 0,0); |
| 278 | 277 | } |
| r21024 | r21025 | |
| 280 | 279 | if (m_pri == 0x0078) { |
| 281 | 280 | m_bg1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 282 | 281 | m_bg0_tilemap->draw(bitmap, cliprect, 0,0); |
| 283 | | draw_sprites(machine(), bitmap,cliprect); |
| 282 | draw_sprites(bitmap,cliprect); |
| 284 | 283 | m_fg0_tilemap->draw(bitmap, cliprect, 0,0); |
| 285 | 284 | } |
| 286 | 285 | return 0; |
trunk/src/mame/video/williams.c
| r21024 | r21025 | |
| 95 | 95 | #include "video/resnet.h" |
| 96 | 96 | #include "includes/williams.h" |
| 97 | 97 | |
| 98 | | |
| 99 | | |
| 100 | 98 | /************************************* |
| 101 | 99 | * |
| 102 | | * Prototypes |
| 103 | | * |
| 104 | | *************************************/ |
| 105 | | |
| 106 | | static void blitter_init(running_machine &machine, int blitter_config, const UINT8 *remap_prom); |
| 107 | | static void create_palette_lookup(running_machine &machine); |
| 108 | | |
| 109 | | static int blitter_core(address_space &space, int sstart, int dstart, int w, int h, int data); |
| 110 | | |
| 111 | | |
| 112 | | |
| 113 | | /************************************* |
| 114 | | * |
| 115 | 100 | * Williams video startup |
| 116 | 101 | * |
| 117 | 102 | *************************************/ |
| 118 | 103 | |
| 119 | | static void state_save_register(running_machine &machine) |
| 104 | void williams_state::state_save_register() |
| 120 | 105 | { |
| 121 | | williams_state *state = machine.driver_data<williams_state>(); |
| 122 | | state_save_register_global(machine, state->m_blitter_window_enable); |
| 123 | | state_save_register_global(machine, state->m_cocktail); |
| 124 | | state_save_register_global_array(machine, state->m_blitterram); |
| 125 | | state_save_register_global(machine, state->m_blitter_remap_index); |
| 126 | | state_save_register_global(machine, state->m_blaster_color0); |
| 127 | | state_save_register_global(machine, state->m_blaster_video_control); |
| 128 | | state_save_register_global(machine, state->m_tilemap_xscroll); |
| 129 | | state_save_register_global(machine, state->m_williams2_fg_color); |
| 106 | state_save_register_global(machine(), m_blitter_window_enable); |
| 107 | state_save_register_global(machine(), m_cocktail); |
| 108 | state_save_register_global_array(machine(), m_blitterram); |
| 109 | state_save_register_global(machine(), m_blitter_remap_index); |
| 110 | state_save_register_global(machine(), m_blaster_color0); |
| 111 | state_save_register_global(machine(), m_blaster_video_control); |
| 112 | state_save_register_global(machine(), m_tilemap_xscroll); |
| 113 | state_save_register_global(machine(), m_williams2_fg_color); |
| 130 | 114 | } |
| 131 | 115 | |
| 132 | 116 | |
| 133 | 117 | VIDEO_START_MEMBER(williams_state,williams) |
| 134 | 118 | { |
| 135 | | blitter_init(machine(), m_blitter_config, NULL); |
| 136 | | create_palette_lookup(machine()); |
| 137 | | state_save_register(machine()); |
| 119 | blitter_init(m_blitter_config, NULL); |
| 120 | create_palette_lookup(); |
| 121 | state_save_register(); |
| 138 | 122 | } |
| 139 | 123 | |
| 140 | 124 | |
| 141 | 125 | VIDEO_START_MEMBER(williams_state,blaster) |
| 142 | 126 | { |
| 143 | | blitter_init(machine(), m_blitter_config, memregion("proms")->base()); |
| 144 | | create_palette_lookup(machine()); |
| 145 | | state_save_register(machine()); |
| 127 | blitter_init(m_blitter_config, memregion("proms")->base()); |
| 128 | create_palette_lookup(); |
| 129 | state_save_register(); |
| 146 | 130 | } |
| 147 | 131 | |
| 148 | 132 | |
| 149 | 133 | VIDEO_START_MEMBER(williams_state,williams2) |
| 150 | 134 | { |
| 151 | | blitter_init(machine(), m_blitter_config, NULL); |
| 135 | blitter_init(m_blitter_config, NULL); |
| 152 | 136 | |
| 153 | 137 | /* allocate paletteram */ |
| 154 | 138 | m_generic_paletteram_8.allocate(0x400 * 2); |
| r21024 | r21025 | |
| 157 | 141 | m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(williams_state::get_tile_info),this), TILEMAP_SCAN_COLS, 24,16, 128,16); |
| 158 | 142 | m_bg_tilemap->set_scrolldx(2, 0); |
| 159 | 143 | |
| 160 | | state_save_register(machine()); |
| 144 | state_save_register(); |
| 161 | 145 | } |
| 162 | 146 | |
| 163 | 147 | |
| r21024 | r21025 | |
| 277 | 261 | * |
| 278 | 262 | *************************************/ |
| 279 | 263 | |
| 280 | | static void create_palette_lookup(running_machine &machine) |
| 264 | void williams_state::create_palette_lookup() |
| 281 | 265 | { |
| 282 | | williams_state *state = machine.driver_data<williams_state>(); |
| 283 | 266 | static const int resistances_rg[3] = { 1200, 560, 330 }; |
| 284 | 267 | static const int resistances_b[2] = { 560, 330 }; |
| 285 | 268 | double weights_r[3], weights_g[3], weights_b[2]; |
| r21024 | r21025 | |
| 294 | 277 | 2, resistances_b, weights_b, 0, 0); |
| 295 | 278 | |
| 296 | 279 | /* build a palette lookup */ |
| 297 | | state->m_palette_lookup = auto_alloc_array(machine, rgb_t, 256); |
| 280 | m_palette_lookup = auto_alloc_array(machine(), rgb_t, 256); |
| 298 | 281 | for (i = 0; i < 256; i++) |
| 299 | 282 | { |
| 300 | 283 | int r = combine_3_weights(weights_r, BIT(i,0), BIT(i,1), BIT(i,2)); |
| 301 | 284 | int g = combine_3_weights(weights_g, BIT(i,3), BIT(i,4), BIT(i,5)); |
| 302 | 285 | int b = combine_2_weights(weights_b, BIT(i,6), BIT(i,7)); |
| 303 | 286 | |
| 304 | | state->m_palette_lookup[i] = MAKE_RGB(r, g, b); |
| 287 | m_palette_lookup[i] = MAKE_RGB(r, g, b); |
| 305 | 288 | } |
| 306 | 289 | } |
| 307 | 290 | |
| r21024 | r21025 | |
| 476 | 459 | * |
| 477 | 460 | *************************************/ |
| 478 | 461 | |
| 479 | | static void blitter_init(running_machine &machine, int blitter_config, const UINT8 *remap_prom) |
| 462 | void williams_state::blitter_init(int blitter_config, const UINT8 *remap_prom) |
| 480 | 463 | { |
| 481 | | williams_state *state = machine.driver_data<williams_state>(); |
| 482 | 464 | static const UINT8 dummy_table[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }; |
| 483 | 465 | int i,j; |
| 484 | 466 | |
| 485 | 467 | /* by default, there is no clipping window - this will be touched only by games that have one */ |
| 486 | | state->m_blitter_window_enable = 0; |
| 468 | m_blitter_window_enable = 0; |
| 487 | 469 | |
| 488 | 470 | /* switch off the video config */ |
| 489 | | state->m_blitter_xor = (blitter_config == WILLIAMS_BLITTER_SC01) ? 4 : 0; |
| 471 | m_blitter_xor = (blitter_config == WILLIAMS_BLITTER_SC01) ? 4 : 0; |
| 490 | 472 | |
| 491 | 473 | /* create the remap table; if no PROM, make an identity remap table */ |
| 492 | | state->m_blitter_remap_lookup = auto_alloc_array(machine, UINT8, 256 * 256); |
| 493 | | state->m_blitter_remap_index = 0; |
| 494 | | state->m_blitter_remap = state->m_blitter_remap_lookup; |
| 474 | m_blitter_remap_lookup = auto_alloc_array(machine(), UINT8, 256 * 256); |
| 475 | m_blitter_remap_index = 0; |
| 476 | m_blitter_remap = m_blitter_remap_lookup; |
| 495 | 477 | for (i = 0; i < 256; i++) |
| 496 | 478 | { |
| 497 | 479 | const UINT8 *table = remap_prom ? (remap_prom + (i & 0x7f) * 16) : dummy_table; |
| 498 | 480 | for (j = 0; j < 256; j++) |
| 499 | | state->m_blitter_remap_lookup[i * 256 + j] = (table[j >> 4] << 4) | table[j & 0x0f]; |
| 481 | m_blitter_remap_lookup[i * 256 + j] = (table[j >> 4] << 4) | table[j & 0x0f]; |
| 500 | 482 | } |
| 501 | 483 | } |
| 502 | 484 | |
| r21024 | r21025 | |
| 559 | 541 | * |
| 560 | 542 | *************************************/ |
| 561 | 543 | |
| 562 | | INLINE void blit_pixel(address_space &space, int offset, int srcdata, int data, int mask, int solid) |
| 544 | inline void williams_state::blit_pixel(address_space &space, int offset, int srcdata, int data, int mask, int solid) |
| 563 | 545 | { |
| 564 | | williams_state *state = space.machine().driver_data<williams_state>(); |
| 565 | 546 | /* always read from video RAM regardless of the bank setting */ |
| 566 | | int pix = (offset < 0xc000) ? state->m_videoram[offset] : space.read_byte(offset); |
| 547 | int pix = (offset < 0xc000) ? m_videoram[offset] : space.read_byte(offset); |
| 567 | 548 | |
| 568 | 549 | /* handle transparency */ |
| 569 | 550 | if (data & 0x08) |
| r21024 | r21025 | |
| 582 | 563 | /* if the window is enabled, only blit to videoram below the clipping address */ |
| 583 | 564 | /* note that we have to allow blits to non-video RAM (e.g. tileram) because those */ |
| 584 | 565 | /* are not blocked by the window enable */ |
| 585 | | if (!state->m_blitter_window_enable || offset < state->m_blitter_clip_address || offset >= 0xc000) |
| 566 | if (!m_blitter_window_enable || offset < m_blitter_clip_address || offset >= 0xc000) |
| 586 | 567 | space.write_byte(offset, pix); |
| 587 | 568 | } |
| 588 | 569 | |
| 589 | 570 | |
| 590 | | static int blitter_core(address_space &space, int sstart, int dstart, int w, int h, int data) |
| 571 | int williams_state::blitter_core(address_space &space, int sstart, int dstart, int w, int h, int data) |
| 591 | 572 | { |
| 592 | | williams_state *state = space.machine().driver_data<williams_state>(); |
| 593 | 573 | int source, sxadv, syadv; |
| 594 | 574 | int dest, dxadv, dyadv; |
| 595 | 575 | int i, j, solid; |
| r21024 | r21025 | |
| 610 | 590 | return accesses; |
| 611 | 591 | |
| 612 | 592 | /* set the solid pixel value to the mask value */ |
| 613 | | solid = state->m_blitterram[1]; |
| 593 | solid = m_blitterram[1]; |
| 614 | 594 | |
| 615 | 595 | /* first case: no shifting */ |
| 616 | 596 | if (!(data & 0x20)) |
| r21024 | r21025 | |
| 624 | 604 | /* loop over the width */ |
| 625 | 605 | for (j = w; j > 0; j--) |
| 626 | 606 | { |
| 627 | | blit_pixel(space, dest, state->m_blitter_remap[space.read_byte(source)], data, keepmask, solid); |
| 607 | blit_pixel(space, dest, m_blitter_remap[space.read_byte(source)], data, keepmask, solid); |
| 628 | 608 | accesses += 2; |
| 629 | 609 | |
| 630 | 610 | /* advance */ |
| r21024 | r21025 | |
| 658 | 638 | dest = dstart & 0xffff; |
| 659 | 639 | |
| 660 | 640 | /* left edge case */ |
| 661 | | pixdata = state->m_blitter_remap[space.read_byte(source)]; |
| 641 | pixdata = m_blitter_remap[space.read_byte(source)]; |
| 662 | 642 | blit_pixel(space, dest, (pixdata >> 4) & 0x0f, data, keepmask | 0xf0, solid); |
| 663 | 643 | accesses += 2; |
| 664 | 644 | |
| r21024 | r21025 | |
| 668 | 648 | /* loop over the width */ |
| 669 | 649 | for (j = w - 1; j > 0; j--) |
| 670 | 650 | { |
| 671 | | pixdata = (pixdata << 8) | state->m_blitter_remap[space.read_byte(source)]; |
| 651 | pixdata = (pixdata << 8) | m_blitter_remap[space.read_byte(source)]; |
| 672 | 652 | blit_pixel(space, dest, (pixdata >> 4) & 0xff, data, keepmask, solid); |
| 673 | 653 | accesses += 2; |
| 674 | 654 | |
trunk/src/mame/video/wolfpack.c
| r21024 | r21025 | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| 121 | | static void draw_ship(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 121 | void wolfpack_state::draw_ship(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 122 | 122 | { |
| 123 | | wolfpack_state *state = machine.driver_data<wolfpack_state>(); |
| 124 | 123 | static const UINT32 scaler[] = |
| 125 | 124 | { |
| 126 | 125 | 0x00000, 0x00500, 0x00a00, 0x01000, |
| r21024 | r21025 | |
| 141 | 140 | 0x2c000, 0x2fa00, 0x33500, 0x37000 |
| 142 | 141 | }; |
| 143 | 142 | |
| 144 | | int chop = (scaler[state->m_ship_size >> 2] * state->m_ship_h_precess) >> 16; |
| 143 | int chop = (scaler[m_ship_size >> 2] * m_ship_h_precess) >> 16; |
| 145 | 144 | |
| 146 | 145 | drawgfxzoom_transpen(bitmap, cliprect, |
| 147 | | machine.gfx[1], |
| 148 | | state->m_ship_pic, |
| 146 | machine().gfx[1], |
| 147 | m_ship_pic, |
| 149 | 148 | 0, |
| 150 | | state->m_ship_reflect, 0, |
| 151 | | 2 * (state->m_ship_h - chop), |
| 149 | m_ship_reflect, 0, |
| 150 | 2 * (m_ship_h - chop), |
| 152 | 151 | 128, |
| 153 | | 2 * scaler[state->m_ship_size >> 2], scaler[state->m_ship_size >> 2], 0); |
| 152 | 2 * scaler[m_ship_size >> 2], scaler[m_ship_size >> 2], 0); |
| 154 | 153 | } |
| 155 | 154 | |
| 156 | 155 | |
| 157 | | static void draw_torpedo(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 156 | void wolfpack_state::draw_torpedo(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 158 | 157 | { |
| 159 | | wolfpack_state *state = machine.driver_data<wolfpack_state>(); |
| 160 | 158 | int count = 0; |
| 161 | 159 | |
| 162 | 160 | int x; |
| 163 | 161 | int y; |
| 164 | 162 | |
| 165 | 163 | drawgfx_transpen(bitmap, cliprect, |
| 166 | | machine.gfx[3], |
| 167 | | state->m_torpedo_pic, |
| 164 | machine().gfx[3], |
| 165 | m_torpedo_pic, |
| 168 | 166 | 0, |
| 169 | 167 | 0, 0, |
| 170 | | 2 * (244 - state->m_torpedo_h), |
| 171 | | 224 - state->m_torpedo_v, 0); |
| 168 | 2 * (244 - m_torpedo_h), |
| 169 | 224 - m_torpedo_v, 0); |
| 172 | 170 | |
| 173 | | for (y = 16; y < 224 - state->m_torpedo_v; y++) |
| 171 | for (y = 16; y < 224 - m_torpedo_v; y++) |
| 174 | 172 | { |
| 175 | 173 | int x1; |
| 176 | 174 | int x2; |
| r21024 | r21025 | |
| 178 | 176 | if (y % 16 == 1) |
| 179 | 177 | count = (count - 1) & 7; |
| 180 | 178 | |
| 181 | | x1 = 248 - state->m_torpedo_h - count; |
| 182 | | x2 = 248 - state->m_torpedo_h + count; |
| 179 | x1 = 248 - m_torpedo_h - count; |
| 180 | x2 = 248 - m_torpedo_h + count; |
| 183 | 181 | |
| 184 | 182 | for (x = 2 * x1; x < 2 * x2; x++) |
| 185 | | if (state->m_LFSR[(state->m_current_index + 0x300 * y + x) % 0x8000]) |
| 183 | if (m_LFSR[(m_current_index + 0x300 * y + x) % 0x8000]) |
| 186 | 184 | bitmap.pix16(y, x) = 1; |
| 187 | 185 | } |
| 188 | 186 | } |
| 189 | 187 | |
| 190 | 188 | |
| 191 | | static void draw_pt(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 189 | void wolfpack_state::draw_pt(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 192 | 190 | { |
| 193 | | wolfpack_state *state = machine.driver_data<wolfpack_state>(); |
| 194 | 191 | rectangle rect = cliprect; |
| 195 | 192 | |
| 196 | | if (!(state->m_pt_pic & 0x20)) |
| 193 | if (!(m_pt_pic & 0x20)) |
| 197 | 194 | rect.min_x = 256; |
| 198 | 195 | |
| 199 | | if (!(state->m_pt_pic & 0x10)) |
| 196 | if (!(m_pt_pic & 0x10)) |
| 200 | 197 | rect.max_x = 255; |
| 201 | 198 | |
| 202 | 199 | drawgfx_transpen(bitmap, rect, |
| 203 | | machine.gfx[2], |
| 204 | | state->m_pt_pic, |
| 200 | machine().gfx[2], |
| 201 | m_pt_pic, |
| 205 | 202 | 0, |
| 206 | 203 | 0, 0, |
| 207 | | 2 * state->m_pt_horz, |
| 208 | | state->m_pt_pos_select ? 0x70 : 0xA0, 0); |
| 204 | 2 * m_pt_horz, |
| 205 | m_pt_pos_select ? 0x70 : 0xA0, 0); |
| 209 | 206 | |
| 210 | 207 | drawgfx_transpen(bitmap, rect, |
| 211 | | machine.gfx[2], |
| 212 | | state->m_pt_pic, |
| 208 | machine().gfx[2], |
| 209 | m_pt_pic, |
| 213 | 210 | 0, |
| 214 | 211 | 0, 0, |
| 215 | | 2 * state->m_pt_horz - 512, |
| 216 | | state->m_pt_pos_select ? 0x70 : 0xA0, 0); |
| 212 | 2 * m_pt_horz - 512, |
| 213 | m_pt_pos_select ? 0x70 : 0xA0, 0); |
| 217 | 214 | } |
| 218 | 215 | |
| 219 | 216 | |
| 220 | | static void draw_water(colortable_t *colortable, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 217 | void wolfpack_state::draw_water(colortable_t *colortable, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 221 | 218 | { |
| 222 | 219 | rectangle rect = cliprect; |
| 223 | 220 | |
| r21024 | r21025 | |
| 269 | 266 | 192 + 8 * i); |
| 270 | 267 | } |
| 271 | 268 | |
| 272 | | draw_pt(machine(), bitmap, cliprect); |
| 273 | | draw_ship(machine(), bitmap, cliprect); |
| 274 | | draw_torpedo(machine(), bitmap, cliprect); |
| 269 | draw_pt(bitmap, cliprect); |
| 270 | draw_ship(bitmap, cliprect); |
| 271 | draw_torpedo(bitmap, cliprect); |
| 275 | 272 | draw_water(machine().colortable, bitmap, cliprect); |
| 276 | 273 | return 0; |
| 277 | 274 | } |
| r21024 | r21025 | |
| 287 | 284 | |
| 288 | 285 | m_helper.fill(0); |
| 289 | 286 | |
| 290 | | draw_ship(machine(), m_helper, m_helper.cliprect()); |
| 287 | draw_ship(m_helper, m_helper.cliprect()); |
| 291 | 288 | |
| 292 | 289 | for (y = 128; y < 224 - m_torpedo_v; y++) |
| 293 | 290 | { |
trunk/src/mame/video/wiz.c
| r21024 | r21025 | |
| 92 | 92 | m_flipy = data; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | | static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank, int colortype) |
| 95 | void wiz_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int bank, int colortype) |
| 96 | 96 | { |
| 97 | | wiz_state *state = machine.driver_data<wiz_state>(); |
| 98 | | UINT8 *videoram = state->m_videoram; |
| 97 | UINT8 *videoram = m_videoram; |
| 99 | 98 | int offs; |
| 100 | 99 | |
| 101 | 100 | /* for every character in the Video RAM, check if it has been modified */ |
| r21024 | r21025 | |
| 110 | 109 | |
| 111 | 110 | if (colortype) |
| 112 | 111 | { |
| 113 | | col = (state->m_attributesram[2 * sx + 1] & 0x07); |
| 112 | col = (m_attributesram[2 * sx + 1] & 0x07); |
| 114 | 113 | } |
| 115 | 114 | else |
| 116 | 115 | { |
| 117 | | col = (state->m_attributesram[2 * (offs % 32) + 1] & 0x04) + (videoram[offs] & 3); |
| 116 | col = (m_attributesram[2 * (offs % 32) + 1] & 0x04) + (videoram[offs] & 3); |
| 118 | 117 | } |
| 119 | 118 | |
| 120 | | scroll = (8*sy + 256 - state->m_attributesram[2 * sx]) % 256; |
| 121 | | if (state->m_flipy) |
| 119 | scroll = (8*sy + 256 - m_attributesram[2 * sx]) % 256; |
| 120 | if (m_flipy) |
| 122 | 121 | { |
| 123 | 122 | scroll = (248 - scroll) % 256; |
| 124 | 123 | } |
| 125 | | if (state->m_flipx) sx = 31 - sx; |
| 124 | if (m_flipx) sx = 31 - sx; |
| 126 | 125 | |
| 127 | 126 | |
| 128 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[bank], |
| 127 | drawgfx_transpen(bitmap,cliprect,machine().gfx[bank], |
| 129 | 128 | videoram[offs], |
| 130 | | col + 8 * state->m_palette_bank, |
| 131 | | state->m_flipx,state->m_flipy, |
| 129 | col + 8 * m_palette_bank, |
| 130 | m_flipx,m_flipy, |
| 132 | 131 | 8*sx,scroll,0); |
| 133 | 132 | } |
| 134 | 133 | } |
| 135 | 134 | |
| 136 | | static void draw_foreground(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int colortype) |
| 135 | void wiz_state::draw_foreground(bitmap_ind16 &bitmap, const rectangle &cliprect, int colortype) |
| 137 | 136 | { |
| 138 | | wiz_state *state = machine.driver_data<wiz_state>(); |
| 139 | 137 | int offs; |
| 140 | 138 | |
| 141 | 139 | /* draw the frontmost playfield. They are characters, but draw them as sprites. */ |
| r21024 | r21025 | |
| 149 | 147 | |
| 150 | 148 | if (colortype) |
| 151 | 149 | { |
| 152 | | col = (state->m_attributesram2[2 * sx + 1] & 0x07); |
| 150 | col = (m_attributesram2[2 * sx + 1] & 0x07); |
| 153 | 151 | } |
| 154 | 152 | else |
| 155 | 153 | { |
| 156 | | col = (state->m_colorram2[offs] & 0x07); |
| 154 | col = (m_colorram2[offs] & 0x07); |
| 157 | 155 | } |
| 158 | 156 | |
| 159 | | scroll = (8*sy + 256 - state->m_attributesram2[2 * sx]) % 256; |
| 160 | | if (state->m_flipy) |
| 157 | scroll = (8*sy + 256 - m_attributesram2[2 * sx]) % 256; |
| 158 | if (m_flipy) |
| 161 | 159 | { |
| 162 | 160 | scroll = (248 - scroll) % 256; |
| 163 | 161 | } |
| 164 | | if (state->m_flipx) sx = 31 - sx; |
| 162 | if (m_flipx) sx = 31 - sx; |
| 165 | 163 | |
| 166 | 164 | |
| 167 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[state->m_char_bank[1]], |
| 168 | | state->m_videoram2[offs], |
| 169 | | col + 8 * state->m_palette_bank, |
| 170 | | state->m_flipx,state->m_flipy, |
| 165 | drawgfx_transpen(bitmap,cliprect,machine().gfx[m_char_bank[1]], |
| 166 | m_videoram2[offs], |
| 167 | col + 8 * m_palette_bank, |
| 168 | m_flipx,m_flipy, |
| 171 | 169 | 8*sx,scroll,0); |
| 172 | 170 | } |
| 173 | 171 | } |
| 174 | 172 | |
| 175 | | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, |
| 176 | | const rectangle &cliprect, UINT8* sprite_ram, |
| 177 | | int bank) |
| 173 | void wiz_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, UINT8* sprite_ram,int bank) |
| 178 | 174 | { |
| 179 | | wiz_state *state = machine.driver_data<wiz_state>(); |
| 180 | 175 | int offs; |
| 181 | 176 | |
| 182 | | for (offs = state->m_spriteram.bytes() - 4;offs >= 0;offs -= 4) |
| 177 | for (offs = m_spriteram.bytes() - 4;offs >= 0;offs -= 4) |
| 183 | 178 | { |
| 184 | 179 | int sx,sy; |
| 185 | 180 | |
| r21024 | r21025 | |
| 189 | 184 | |
| 190 | 185 | if (!sx || !sy) continue; |
| 191 | 186 | |
| 192 | | if ( state->m_flipx) sx = 240 - sx; |
| 193 | | if (!state->m_flipy) sy = 240 - sy; |
| 187 | if ( m_flipx) sx = 240 - sx; |
| 188 | if (!m_flipy) sy = 240 - sy; |
| 194 | 189 | |
| 195 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[bank], |
| 190 | drawgfx_transpen(bitmap,cliprect,machine().gfx[bank], |
| 196 | 191 | sprite_ram[offs + 1], |
| 197 | | (sprite_ram[offs + 2] & 0x07) + 8 * state->m_palette_bank, |
| 198 | | state->m_flipx,state->m_flipy, |
| 192 | (sprite_ram[offs + 2] & 0x07) + 8 * m_palette_bank, |
| 193 | m_flipx,m_flipy, |
| 199 | 194 | sx,sy,0); |
| 200 | 195 | } |
| 201 | 196 | } |
| r21024 | r21025 | |
| 204 | 199 | UINT32 wiz_state::screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 205 | 200 | { |
| 206 | 201 | bitmap.fill(m_bgpen, cliprect); |
| 207 | | draw_background(machine(), bitmap, cliprect, 2 + m_char_bank[0] , 0); |
| 208 | | draw_foreground(machine(), bitmap, cliprect, 0); |
| 209 | | draw_sprites(machine(), bitmap, cliprect, m_spriteram2, 4); |
| 210 | | draw_sprites(machine(), bitmap, cliprect, m_spriteram , 5); |
| 202 | draw_background(bitmap, cliprect, 2 + m_char_bank[0] , 0); |
| 203 | draw_foreground(bitmap, cliprect, 0); |
| 204 | draw_sprites(bitmap, cliprect, m_spriteram2, 4); |
| 205 | draw_sprites(bitmap, cliprect, m_spriteram , 5); |
| 211 | 206 | return 0; |
| 212 | 207 | } |
| 213 | 208 | |
| r21024 | r21025 | |
| 216 | 211 | int bank; |
| 217 | 212 | |
| 218 | 213 | bitmap.fill(m_bgpen, cliprect); |
| 219 | | draw_background(machine(), bitmap, cliprect, 2 + ((m_char_bank[0] << 1) | m_char_bank[1]), 0); |
| 220 | | draw_foreground(machine(), bitmap, cliprect, 0); |
| 214 | draw_background(bitmap, cliprect, 2 + ((m_char_bank[0] << 1) | m_char_bank[1]), 0); |
| 215 | draw_foreground(bitmap, cliprect, 0); |
| 221 | 216 | |
| 222 | 217 | const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1); |
| 223 | 218 | const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1); |
| r21024 | r21025 | |
| 225 | 220 | |
| 226 | 221 | bank = 7 + *m_sprite_bank; |
| 227 | 222 | |
| 228 | | draw_sprites(machine(), bitmap, visible_area, m_spriteram2, 6); |
| 229 | | draw_sprites(machine(), bitmap, visible_area, m_spriteram , bank); |
| 223 | draw_sprites(bitmap, visible_area, m_spriteram2, 6); |
| 224 | draw_sprites(bitmap, visible_area, m_spriteram , bank); |
| 230 | 225 | return 0; |
| 231 | 226 | } |
| 232 | 227 | |
| r21024 | r21025 | |
| 234 | 229 | UINT32 wiz_state::screen_update_stinger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 235 | 230 | { |
| 236 | 231 | bitmap.fill(m_bgpen, cliprect); |
| 237 | | draw_background(machine(), bitmap, cliprect, 2 + m_char_bank[0], 1); |
| 238 | | draw_foreground(machine(), bitmap, cliprect, 1); |
| 239 | | draw_sprites(machine(), bitmap, cliprect, m_spriteram2, 4); |
| 240 | | draw_sprites(machine(), bitmap, cliprect, m_spriteram , 5); |
| 232 | draw_background(bitmap, cliprect, 2 + m_char_bank[0], 1); |
| 233 | draw_foreground(bitmap, cliprect, 1); |
| 234 | draw_sprites(bitmap, cliprect, m_spriteram2, 4); |
| 235 | draw_sprites(bitmap, cliprect, m_spriteram , 5); |
| 241 | 236 | return 0; |
| 242 | 237 | } |
trunk/src/mame/video/wc90.c
| r21024 | r21025 | |
| 126 | 126 | ***************************************************************************/ |
| 127 | 127 | |
| 128 | 128 | #define WC90_DRAW_SPRITE( code, sx, sy ) \ |
| 129 | | drawgfx_transpen( bitmap, cliprect, machine.gfx[3], code, flags >> 4, \ |
| 129 | drawgfx_transpen( bitmap, cliprect, machine().gfx[3], code, flags >> 4, \ |
| 130 | 130 | bank&1, bank&2, sx, sy, 0 ) |
| 131 | 131 | |
| 132 | 132 | static const char p32x32[4][4] = { |
| r21024 | r21025 | |
| 157 | 157 | { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } |
| 158 | 158 | }; |
| 159 | 159 | |
| 160 | | static void draw_sprite_16x16(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 161 | | int sx, int sy, int bank, int flags ) { |
| 160 | void wc90_state::draw_sprite_16x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ) |
| 161 | { |
| 162 | 162 | WC90_DRAW_SPRITE( code, sx, sy ); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | | static void draw_sprite_16x32(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 166 | | int sx, int sy, int bank, int flags ) { |
| 165 | void wc90_state::draw_sprite_16x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ) |
| 166 | { |
| 167 | 167 | if ( bank & 2 ) { |
| 168 | 168 | WC90_DRAW_SPRITE( code+1, sx, sy+16 ); |
| 169 | 169 | WC90_DRAW_SPRITE( code, sx, sy ); |
| r21024 | r21025 | |
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | | static void draw_sprite_16x64(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 177 | | int sx, int sy, int bank, int flags ) { |
| 176 | void wc90_state::draw_sprite_16x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ) |
| 177 | { |
| 178 | 178 | if ( bank & 2 ) { |
| 179 | 179 | WC90_DRAW_SPRITE( code+3, sx, sy+48 ); |
| 180 | 180 | WC90_DRAW_SPRITE( code+2, sx, sy+32 ); |
| r21024 | r21025 | |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | | static void draw_sprite_32x16(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 192 | | int sx, int sy, int bank, int flags ) { |
| 191 | void wc90_state::draw_sprite_32x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ) |
| 192 | { |
| 193 | 193 | if ( bank & 1 ) { |
| 194 | 194 | WC90_DRAW_SPRITE( code+1, sx+16, sy ); |
| 195 | 195 | WC90_DRAW_SPRITE( code, sx, sy ); |
| r21024 | r21025 | |
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | | static void draw_sprite_32x32(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 203 | | int sx, int sy, int bank, int flags ) { |
| 202 | void wc90_state::draw_sprite_32x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ) |
| 203 | { |
| 204 | 204 | const char *p = p32x32[ bank&3 ]; |
| 205 | 205 | |
| 206 | 206 | WC90_DRAW_SPRITE( code+p[0], sx, sy ); |
| r21024 | r21025 | |
| 209 | 209 | WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 ); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | | static void draw_sprite_32x64(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 213 | | int sx, int sy, int bank, int flags ) { |
| 212 | void wc90_state::draw_sprite_32x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code, int sx, int sy, int bank, int flags ) |
| 213 | { |
| 214 | 214 | const char *p = p32x64[ bank&3 ]; |
| 215 | 215 | |
| 216 | 216 | WC90_DRAW_SPRITE( code+p[0], sx, sy ); |
| r21024 | r21025 | |
| 223 | 223 | WC90_DRAW_SPRITE( code+p[7], sx+16, sy+48 ); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | | static void draw_sprite_64x16(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 227 | | int sx, int sy, int bank, int flags ) { |
| 226 | void wc90_state::draw_sprite_64x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ) |
| 227 | { |
| 228 | 228 | if ( bank & 1 ) { |
| 229 | 229 | WC90_DRAW_SPRITE( code+3, sx+48, sy ); |
| 230 | 230 | WC90_DRAW_SPRITE( code+2, sx+32, sy ); |
| r21024 | r21025 | |
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | | static void draw_sprite_64x32(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 242 | | int sx, int sy, int bank, int flags ) { |
| 241 | void wc90_state::draw_sprite_64x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ) |
| 242 | { |
| 243 | 243 | const char *p = p64x32[ bank&3 ]; |
| 244 | 244 | |
| 245 | 245 | WC90_DRAW_SPRITE( code+p[0], sx, sy ); |
| r21024 | r21025 | |
| 252 | 252 | WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 ); |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | | static void draw_sprite_64x64(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 256 | | int sx, int sy, int bank, int flags ) { |
| 255 | void wc90_state::draw_sprite_64x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ) |
| 256 | { |
| 257 | 257 | const char *p = p64x64[ bank&3 ]; |
| 258 | 258 | |
| 259 | 259 | WC90_DRAW_SPRITE( code+p[0], sx, sy ); |
| r21024 | r21025 | |
| 275 | 275 | WC90_DRAW_SPRITE( code+p[15], sx+48, sy+48 ); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | | static void draw_sprite_invalid(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int code, |
| 279 | | int sx, int sy, int bank, int flags ) { |
| 278 | void wc90_state::draw_sprite_invalid(bitmap_ind16 &bitmap, const rectangle &cliprect, int code, int sx, int sy, int bank, int flags ) |
| 279 | { |
| 280 | 280 | logerror("8 pixel sprite size not supported\n" ); |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | | typedef void (*draw_sprites_func)(running_machine &, bitmap_ind16 &, const rectangle &, int, int, int, int, int ); |
| 284 | | |
| 285 | | static const draw_sprites_func draw_sprites_proc[16] = { |
| 286 | | draw_sprite_invalid, /* 0000 = 08x08 */ |
| 287 | | draw_sprite_invalid, /* 0001 = 16x08 */ |
| 288 | | draw_sprite_invalid, /* 0010 = 32x08 */ |
| 289 | | draw_sprite_invalid, /* 0011 = 64x08 */ |
| 290 | | draw_sprite_invalid, /* 0100 = 08x16 */ |
| 291 | | draw_sprite_16x16, /* 0101 = 16x16 */ |
| 292 | | draw_sprite_32x16, /* 0110 = 32x16 */ |
| 293 | | draw_sprite_64x16, /* 0111 = 64x16 */ |
| 294 | | draw_sprite_invalid, /* 1000 = 08x32 */ |
| 295 | | draw_sprite_16x32, /* 1001 = 16x32 */ |
| 296 | | draw_sprite_32x32, /* 1010 = 32x32 */ |
| 297 | | draw_sprite_64x32, /* 1011 = 64x32 */ |
| 298 | | draw_sprite_invalid, /* 1100 = 08x64 */ |
| 299 | | draw_sprite_16x64, /* 1101 = 16x64 */ |
| 300 | | draw_sprite_32x64, /* 1110 = 32x64 */ |
| 301 | | draw_sprite_64x64 /* 1111 = 64x64 */ |
| 283 | static const wc90_state::draw_sprites_func draw_sprites_proc[16] = { |
| 284 | &wc90_state::draw_sprite_invalid, /* 0000 = 08x08 */ |
| 285 | &wc90_state::draw_sprite_invalid, /* 0001 = 16x08 */ |
| 286 | &wc90_state::draw_sprite_invalid, /* 0010 = 32x08 */ |
| 287 | &wc90_state::draw_sprite_invalid, /* 0011 = 64x08 */ |
| 288 | &wc90_state::draw_sprite_invalid, /* 0100 = 08x16 */ |
| 289 | &wc90_state::draw_sprite_16x16, /* 0101 = 16x16 */ |
| 290 | &wc90_state::draw_sprite_32x16, /* 0110 = 32x16 */ |
| 291 | &wc90_state::draw_sprite_64x16, /* 0111 = 64x16 */ |
| 292 | &wc90_state::draw_sprite_invalid, /* 1000 = 08x32 */ |
| 293 | &wc90_state::draw_sprite_16x32, /* 1001 = 16x32 */ |
| 294 | &wc90_state::draw_sprite_32x32, /* 1010 = 32x32 */ |
| 295 | &wc90_state::draw_sprite_64x32, /* 1011 = 64x32 */ |
| 296 | &wc90_state::draw_sprite_invalid, /* 1100 = 08x64 */ |
| 297 | &wc90_state::draw_sprite_16x64, /* 1101 = 16x64 */ |
| 298 | &wc90_state::draw_sprite_32x64, /* 1110 = 32x64 */ |
| 299 | &wc90_state::draw_sprite_64x64 /* 1111 = 64x64 */ |
| 302 | 300 | }; |
| 303 | 301 | |
| 304 | | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ) |
| 302 | void wc90_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ) |
| 305 | 303 | { |
| 306 | | wc90_state *state = machine.driver_data<wc90_state>(); |
| 307 | | UINT8 *spriteram = state->m_spriteram; |
| 304 | UINT8 *spriteram = m_spriteram; |
| 308 | 305 | int offs, sx,sy, flags, which; |
| 309 | 306 | |
| 310 | 307 | /* draw all visible sprites of specified priority */ |
| 311 | | for (offs = 0;offs < state->m_spriteram.bytes();offs += 16){ |
| 308 | for (offs = 0;offs < m_spriteram.bytes();offs += 16){ |
| 312 | 309 | int bank = spriteram[offs+0]; |
| 313 | 310 | |
| 314 | 311 | if ( ( bank >> 4 ) == priority ) { |
| r21024 | r21025 | |
| 321 | 318 | if (sx >= 0x0300) sx -= 0x0400; |
| 322 | 319 | |
| 323 | 320 | flags = spriteram[offs+4]; |
| 324 | | ( *( draw_sprites_proc[ flags & 0x0f ] ) )(machine, bitmap,cliprect, which, sx, sy, bank, flags ); |
| 321 | (this->*( draw_sprites_proc[ flags & 0x0f ] ) )(bitmap,cliprect, which, sx, sy, bank, flags ); |
| 325 | 322 | } |
| 326 | 323 | } |
| 327 | 324 | } |
| r21024 | r21025 | |
| 339 | 336 | m_tx_tilemap->set_scrollx(0,m_scroll0xlo[0] + 256 * m_scroll0xhi[0]); |
| 340 | 337 | m_tx_tilemap->set_scrolly(0,m_scroll0ylo[0] + 256 * m_scroll0yhi[0]); |
| 341 | 338 | |
| 342 | | // draw_sprites(machine(), bitmap,cliprect, 3 ); |
| 339 | // draw_sprites(bitmap,cliprect, 3 ); |
| 343 | 340 | m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 344 | | draw_sprites(machine(), bitmap,cliprect, 2 ); |
| 341 | draw_sprites(bitmap,cliprect, 2 ); |
| 345 | 342 | m_fg_tilemap->draw(bitmap, cliprect, 0,0); |
| 346 | | draw_sprites(machine(), bitmap,cliprect, 1 ); |
| 343 | draw_sprites(bitmap,cliprect, 1 ); |
| 347 | 344 | m_tx_tilemap->draw(bitmap, cliprect, 0,0); |
| 348 | | draw_sprites(machine(), bitmap,cliprect, 0 ); |
| 345 | draw_sprites(bitmap,cliprect, 0 ); |
| 349 | 346 | return 0; |
| 350 | 347 | } |
trunk/src/mame/video/wgp.c
| r21024 | r21025 | |
| 5 | 5 | |
| 6 | 6 | /*******************************************************************/ |
| 7 | 7 | |
| 8 | | INLINE void common_get_piv_tile_info( running_machine &machine, tile_data &tileinfo, int tile_index, int num ) |
| 8 | inline void wgp_state::common_get_piv_tile_info( tile_data &tileinfo, int tile_index, int num ) |
| 9 | 9 | { |
| 10 | | wgp_state *state = machine.driver_data<wgp_state>(); |
| 11 | | UINT16 tilenum = state->m_pivram[tile_index + num * 0x1000]; /* 3 blocks of $2000 */ |
| 12 | | UINT16 attr = state->m_pivram[tile_index + num * 0x1000 + 0x8000]; /* 3 blocks of $2000 */ |
| 10 | UINT16 tilenum = m_pivram[tile_index + num * 0x1000]; /* 3 blocks of $2000 */ |
| 11 | UINT16 attr = m_pivram[tile_index + num * 0x1000 + 0x8000]; /* 3 blocks of $2000 */ |
| 13 | 12 | |
| 14 | | SET_TILE_INFO( |
| 13 | SET_TILE_INFO_MEMBER( |
| 15 | 14 | 2, |
| 16 | 15 | tilenum & 0x3fff, |
| 17 | 16 | (attr & 0x3f), /* attr & 0x1 ?? */ |
| r21024 | r21025 | |
| 20 | 19 | |
| 21 | 20 | TILE_GET_INFO_MEMBER(wgp_state::get_piv0_tile_info) |
| 22 | 21 | { |
| 23 | | common_get_piv_tile_info(machine(), tileinfo, tile_index, 0); |
| 22 | common_get_piv_tile_info(tileinfo, tile_index, 0); |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | 25 | TILE_GET_INFO_MEMBER(wgp_state::get_piv1_tile_info) |
| 27 | 26 | { |
| 28 | | common_get_piv_tile_info(machine(), tileinfo, tile_index, 1); |
| 27 | common_get_piv_tile_info(tileinfo, tile_index, 1); |
| 29 | 28 | } |
| 30 | 29 | |
| 31 | 30 | TILE_GET_INFO_MEMBER(wgp_state::get_piv2_tile_info) |
| 32 | 31 | { |
| 33 | | common_get_piv_tile_info(machine(), tileinfo, tile_index, 2); |
| 32 | common_get_piv_tile_info(tileinfo, tile_index, 2); |
| 34 | 33 | } |
| 35 | 34 | |
| 36 | 35 | |
| 37 | | static void wgp_core_vh_start( running_machine &machine, int piv_xoffs, int piv_yoffs ) |
| 36 | void wgp_state::wgp_core_vh_start( int piv_xoffs, int piv_yoffs ) |
| 38 | 37 | { |
| 39 | | wgp_state *state = machine.driver_data<wgp_state>(); |
| 38 | m_piv_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wgp_state::get_piv0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 39 | m_piv_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wgp_state::get_piv1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 40 | m_piv_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(wgp_state::get_piv2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 40 | 41 | |
| 41 | | state->m_piv_tilemap[0] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wgp_state::get_piv0_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 42 | | state->m_piv_tilemap[1] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wgp_state::get_piv1_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 43 | | state->m_piv_tilemap[2] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(wgp_state::get_piv2_tile_info),state), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 42 | m_piv_xoffs = piv_xoffs; |
| 43 | m_piv_yoffs = piv_yoffs; |
| 44 | 44 | |
| 45 | | state->m_piv_xoffs = piv_xoffs; |
| 46 | | state->m_piv_yoffs = piv_yoffs; |
| 45 | m_piv_tilemap[0]->set_transparent_pen(0); |
| 46 | m_piv_tilemap[1]->set_transparent_pen(0); |
| 47 | m_piv_tilemap[2]->set_transparent_pen(0); |
| 47 | 48 | |
| 48 | | state->m_piv_tilemap[0]->set_transparent_pen(0); |
| 49 | | state->m_piv_tilemap[1]->set_transparent_pen(0); |
| 50 | | state->m_piv_tilemap[2]->set_transparent_pen(0); |
| 51 | | |
| 52 | 49 | /* flipscreen n/a */ |
| 53 | | state->m_piv_tilemap[0]->set_scrolldx(-piv_xoffs, 0); |
| 54 | | state->m_piv_tilemap[1]->set_scrolldx(-piv_xoffs, 0); |
| 55 | | state->m_piv_tilemap[2]->set_scrolldx(-piv_xoffs, 0); |
| 56 | | state->m_piv_tilemap[0]->set_scrolldy(-piv_yoffs, 0); |
| 57 | | state->m_piv_tilemap[1]->set_scrolldy(-piv_yoffs, 0); |
| 58 | | state->m_piv_tilemap[2]->set_scrolldy(-piv_yoffs, 0); |
| 50 | m_piv_tilemap[0]->set_scrolldx(-piv_xoffs, 0); |
| 51 | m_piv_tilemap[1]->set_scrolldx(-piv_xoffs, 0); |
| 52 | m_piv_tilemap[2]->set_scrolldx(-piv_xoffs, 0); |
| 53 | m_piv_tilemap[0]->set_scrolldy(-piv_yoffs, 0); |
| 54 | m_piv_tilemap[1]->set_scrolldy(-piv_yoffs, 0); |
| 55 | m_piv_tilemap[2]->set_scrolldy(-piv_yoffs, 0); |
| 59 | 56 | |
| 60 | 57 | /* We don't need tilemap_set_scroll_rows, as the custom draw routine applies rowscroll manually */ |
| 61 | | tc0100scn_set_colbanks(state->m_tc0100scn, 0x80, 0xc0, 0x40); |
| 58 | tc0100scn_set_colbanks(m_tc0100scn, 0x80, 0xc0, 0x40); |
| 62 | 59 | |
| 63 | | state->save_item(NAME(state->m_piv_ctrl_reg)); |
| 64 | | state->save_item(NAME(state->m_rotate_ctrl)); |
| 65 | | state->save_item(NAME(state->m_piv_zoom)); |
| 66 | | state->save_item(NAME(state->m_piv_scrollx)); |
| 67 | | state->save_item(NAME(state->m_piv_scrolly)); |
| 60 | save_item(NAME(m_piv_ctrl_reg)); |
| 61 | save_item(NAME(m_rotate_ctrl)); |
| 62 | save_item(NAME(m_piv_zoom)); |
| 63 | save_item(NAME(m_piv_scrollx)); |
| 64 | save_item(NAME(m_piv_scrolly)); |
| 68 | 65 | } |
| 69 | 66 | |
| 70 | 67 | void wgp_state::video_start() |
| 71 | 68 | { |
| 72 | | wgp_core_vh_start(machine(), 32, 16); |
| 69 | wgp_core_vh_start(32, 16); |
| 73 | 70 | } |
| 74 | 71 | |
| 75 | 72 | VIDEO_START_MEMBER(wgp_state,wgp2) |
| 76 | 73 | { |
| 77 | | wgp_core_vh_start(machine(), 32, 16); |
| 74 | wgp_core_vh_start(32, 16); |
| 78 | 75 | } |
| 79 | 76 | |
| 80 | 77 | |
| r21024 | r21025 | |
| 341 | 338 | 2, 2, 3, 3, |
| 342 | 339 | 2, 2, 3, 3 }; |
| 343 | 340 | |
| 344 | | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs ) |
| 341 | void wgp_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs ) |
| 345 | 342 | { |
| 346 | | wgp_state *state = machine.driver_data<wgp_state>(); |
| 347 | | UINT16 *spriteram = state->m_spriteram; |
| 343 | UINT16 *spriteram = m_spriteram; |
| 348 | 344 | int offs, i, j, k; |
| 349 | 345 | int x, y, curx, cury; |
| 350 | 346 | int zx, zy, zoomx, zoomy, priority = 0; |
| 351 | 347 | UINT8 small_sprite, col, flipx, flipy; |
| 352 | 348 | UINT16 code, bigsprite, map_index; |
| 353 | 349 | // UINT16 rotate = 0; |
| 354 | | UINT16 tile_mask = (machine.gfx[0]->elements()) - 1; |
| 350 | UINT16 tile_mask = (machine().gfx[0]->elements()) - 1; |
| 355 | 351 | static const int primasks[2] = {0x0, 0xfffc}; /* fff0 => under rhs of road only */ |
| 356 | 352 | |
| 357 | 353 | for (offs = 0x1ff; offs >= 0; offs--) |
| r21024 | r21025 | |
| 397 | 393 | |
| 398 | 394 | /* don't know what selects 2x2 sprites: we use a nasty kludge which seems to work */ |
| 399 | 395 | |
| 400 | | i = state->m_spritemap[map_index + 0xa]; |
| 401 | | j = state->m_spritemap[map_index + 0xc]; |
| 396 | i = m_spritemap[map_index + 0xa]; |
| 397 | j = m_spritemap[map_index + 0xc]; |
| 402 | 398 | small_sprite = ((i > 0) & (i <= 8) & (j > 0) & (j <= 8)); |
| 403 | 399 | |
| 404 | 400 | if (small_sprite) |
| 405 | 401 | { |
| 406 | 402 | for (i = 0; i < 4; i++) |
| 407 | 403 | { |
| 408 | | code = state->m_spritemap[(map_index + (i << 1))] & tile_mask; |
| 409 | | col = state->m_spritemap[(map_index + (i << 1) + 1)] & 0xf; |
| 404 | code = m_spritemap[(map_index + (i << 1))] & tile_mask; |
| 405 | col = m_spritemap[(map_index + (i << 1) + 1)] & 0xf; |
| 410 | 406 | |
| 411 | 407 | /* not known what controls priority */ |
| 412 | | priority = (state->m_spritemap[(map_index + (i << 1) + 1)] & 0x70) >> 4; |
| 408 | priority = (m_spritemap[(map_index + (i << 1) + 1)] & 0x70) >> 4; |
| 413 | 409 | |
| 414 | 410 | flipx = 0; // no flip xy? |
| 415 | 411 | flipy = 0; |
| r21024 | r21025 | |
| 423 | 419 | zx = x + (((k + 1) * zoomx) / 2) - curx; |
| 424 | 420 | zy = y + (((j + 1) * zoomy) / 2) - cury; |
| 425 | 421 | |
| 426 | | pdrawgfxzoom_transpen(bitmap, cliprect,machine.gfx[0], |
| 422 | pdrawgfxzoom_transpen(bitmap, cliprect,machine().gfx[0], |
| 427 | 423 | code, |
| 428 | 424 | col, |
| 429 | 425 | flipx, flipy, |
| 430 | 426 | curx,cury, |
| 431 | 427 | zx << 12, zy << 12, |
| 432 | | machine.priority_bitmap,primasks[((priority >> 1) &1)],0); /* maybe >> 2 or 0...? */ |
| 428 | machine().priority_bitmap,primasks[((priority >> 1) &1)],0); /* maybe >> 2 or 0...? */ |
| 433 | 429 | } |
| 434 | 430 | } |
| 435 | 431 | else |
| 436 | 432 | { |
| 437 | 433 | for (i = 0; i < 16; i++) |
| 438 | 434 | { |
| 439 | | code = state->m_spritemap[(map_index + (i << 1))] & tile_mask; |
| 440 | | col = state->m_spritemap[(map_index + (i << 1) + 1)] & 0xf; |
| 435 | code = m_spritemap[(map_index + (i << 1))] & tile_mask; |
| 436 | col = m_spritemap[(map_index + (i << 1) + 1)] & 0xf; |
| 441 | 437 | |
| 442 | 438 | /* not known what controls priority */ |
| 443 | | priority = (state->m_spritemap[(map_index + (i << 1) + 1)] & 0x70) >> 4; |
| 439 | priority = (m_spritemap[(map_index + (i << 1) + 1)] & 0x70) >> 4; |
| 444 | 440 | |
| 445 | 441 | flipx = 0; // no flip xy? |
| 446 | 442 | flipy = 0; |
| r21024 | r21025 | |
| 454 | 450 | zx = x + (((k + 1) * zoomx) / 4) - curx; |
| 455 | 451 | zy = y + (((j + 1) * zoomy) / 4) - cury; |
| 456 | 452 | |
| 457 | | pdrawgfxzoom_transpen(bitmap, cliprect,machine.gfx[0], |
| 453 | pdrawgfxzoom_transpen(bitmap, cliprect,machine().gfx[0], |
| 458 | 454 | code, |
| 459 | 455 | col, |
| 460 | 456 | flipx, flipy, |
| 461 | 457 | curx,cury, |
| 462 | 458 | zx << 12, zy << 12, |
| 463 | | machine.priority_bitmap,primasks[((priority >> 1) &1)],0); /* maybe >> 2 or 0...? */ |
| 459 | machine().priority_bitmap,primasks[((priority >> 1) &1)],0); /* maybe >> 2 or 0...? */ |
| 464 | 460 | } |
| 465 | 461 | } |
| 466 | 462 | } |
| r21024 | r21025 | |
| 513 | 509 | |
| 514 | 510 | |
| 515 | 511 | |
| 516 | | static void wgp_piv_layer_draw( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) |
| 512 | void wgp_state::wgp_piv_layer_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) |
| 517 | 513 | { |
| 518 | | wgp_state *state = machine.driver_data<wgp_state>(); |
| 519 | | bitmap_ind16 &srcbitmap = state->m_piv_tilemap[layer]->pixmap(); |
| 520 | | bitmap_ind8 &flagsbitmap = state->m_piv_tilemap[layer]->flagsmap(); |
| 514 | bitmap_ind16 &srcbitmap = m_piv_tilemap[layer]->pixmap(); |
| 515 | bitmap_ind8 &flagsbitmap = m_piv_tilemap[layer]->flagsmap(); |
| 521 | 516 | |
| 522 | 517 | UINT16 *dst16,*src16; |
| 523 | 518 | UINT8 *tsrc; |
| r21024 | r21025 | |
| 549 | 544 | In WGP2 see: road at big hill (default course) */ |
| 550 | 545 | |
| 551 | 546 | /* This calculation may be wrong, the y_index one too */ |
| 552 | | zoomy = 0x10000 - (((state->m_piv_ctrlram[0x08 + layer] & 0xff) - 0x7f) * 512); |
| 547 | zoomy = 0x10000 - (((m_piv_ctrlram[0x08 + layer] & 0xff) - 0x7f) * 512); |
| 553 | 548 | |
| 554 | 549 | if (!flipscreen) |
| 555 | 550 | { |
| 556 | | sx = ((state->m_piv_scrollx[layer]) << 16); |
| 557 | | sx += (state->m_piv_xoffs) * zoomx; /* may be imperfect */ |
| 551 | sx = ((m_piv_scrollx[layer]) << 16); |
| 552 | sx += (m_piv_xoffs) * zoomx; /* may be imperfect */ |
| 558 | 553 | |
| 559 | | y_index = (state->m_piv_scrolly[layer] << 16); |
| 560 | | y_index += (state->m_piv_yoffs + min_y) * zoomy; /* may be imperfect */ |
| 554 | y_index = (m_piv_scrolly[layer] << 16); |
| 555 | y_index += (m_piv_yoffs + min_y) * zoomy; /* may be imperfect */ |
| 561 | 556 | } |
| 562 | 557 | else /* piv tiles flipscreen n/a */ |
| 563 | 558 | { |
| r21024 | r21025 | |
| 577 | 572 | src_y_index = (y_index >> 16) & 0x3ff; |
| 578 | 573 | row_index = src_y_index; |
| 579 | 574 | |
| 580 | | row_zoom = state->m_pivram[row_index + layer * 0x400 + 0x3400] & 0xff; |
| 575 | row_zoom = m_pivram[row_index + layer * 0x400 + 0x3400] & 0xff; |
| 581 | 576 | |
| 582 | | row_colbank = state->m_pivram[row_index + layer * 0x400 + 0x3400] >> 8; |
| 577 | row_colbank = m_pivram[row_index + layer * 0x400 + 0x3400] >> 8; |
| 583 | 578 | a = (row_colbank & 0xe0); /* kill bit 4 */ |
| 584 | 579 | row_colbank = (((row_colbank & 0xf) << 1) | a) << 4; |
| 585 | 580 | |
| 586 | | row_scroll = state->m_pivram[row_index + layer * 0x1000 + 0x4000]; |
| 581 | row_scroll = m_pivram[row_index + layer * 0x1000 + 0x4000]; |
| 587 | 582 | a = (row_scroll & 0xffe0) >> 1; /* kill bit 4 */ |
| 588 | 583 | row_scroll = ((row_scroll & 0xf) | a) & width_mask; |
| 589 | 584 | |
| r21024 | r21025 | |
| 623 | 618 | } |
| 624 | 619 | } |
| 625 | 620 | |
| 626 | | bryan2_drawscanline(bitmap, 0, y, screen_width, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, machine.priority_bitmap, priority); |
| 621 | bryan2_drawscanline(bitmap, 0, y, screen_width, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, machine().priority_bitmap, priority); |
| 627 | 622 | |
| 628 | 623 | y_index += zoomy; |
| 629 | 624 | if (!machine_flip) y++; else y--; |
| r21024 | r21025 | |
| 694 | 689 | #ifdef MAME_DEBUG |
| 695 | 690 | if (m_dislayer[layer[0]] == 0) |
| 696 | 691 | #endif |
| 697 | | wgp_piv_layer_draw(machine(), bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 692 | wgp_piv_layer_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 698 | 693 | |
| 699 | 694 | #ifdef MAME_DEBUG |
| 700 | 695 | if (m_dislayer[layer[1]] == 0) |
| 701 | 696 | #endif |
| 702 | | wgp_piv_layer_draw(machine(), bitmap, cliprect, layer[1], 0, 2); |
| 697 | wgp_piv_layer_draw(bitmap, cliprect, layer[1], 0, 2); |
| 703 | 698 | |
| 704 | 699 | #ifdef MAME_DEBUG |
| 705 | 700 | if (m_dislayer[layer[2]] == 0) |
| 706 | 701 | #endif |
| 707 | | wgp_piv_layer_draw(machine(), bitmap, cliprect, layer[2], 0, 4); |
| 702 | wgp_piv_layer_draw(bitmap, cliprect, layer[2], 0, 4); |
| 708 | 703 | |
| 709 | | draw_sprites(machine(), bitmap, cliprect, 16); |
| 704 | draw_sprites(bitmap, cliprect, 16); |
| 710 | 705 | |
| 711 | 706 | /* ... then here we should apply rotation from wgp_sate_ctrl[] to the bitmap before we draw the TC0100SCN layers on it */ |
| 712 | 707 | layer[0] = tc0100scn_bottomlayer(m_tc0100scn); |
trunk/src/mame/video/warriorb.c
| r21024 | r21025 | |
| 15 | 15 | SPRITE DRAW ROUTINE |
| 16 | 16 | ************************************************************/ |
| 17 | 17 | |
| 18 | | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int x_offs, int y_offs ) |
| 18 | void warriorb_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int x_offs, int y_offs ) |
| 19 | 19 | { |
| 20 | | warriorb_state *state = machine.driver_data<warriorb_state>(); |
| 21 | | UINT16 *spriteram = state->m_spriteram; |
| 20 | UINT16 *spriteram = m_spriteram; |
| 22 | 21 | int offs, data, data2, tilenum, color, flipx, flipy; |
| 23 | 22 | int x, y, priority, pri_mask; |
| 24 | 23 | |
| r21024 | r21025 | |
| 27 | 26 | #endif |
| 28 | 27 | |
| 29 | 28 | /* pdrawgfx() needs us to draw sprites front to back */ |
| 30 | | for (offs = 0; offs < state->m_spriteram.bytes() / 2; offs += 4) |
| 29 | for (offs = 0; offs < m_spriteram.bytes() / 2; offs += 4) |
| 31 | 30 | { |
| 32 | 31 | data = spriteram[offs + 1]; |
| 33 | 32 | tilenum = data & 0x7fff; |
| r21024 | r21025 | |
| 63 | 62 | if (x > 0x3c0) x -= 0x400; |
| 64 | 63 | if (y > 0x180) y -= 0x200; |
| 65 | 64 | |
| 66 | | pdrawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 65 | pdrawgfx_transpen(bitmap,cliprect,machine().gfx[0], |
| 67 | 66 | tilenum, |
| 68 | 67 | color, |
| 69 | 68 | flipx,flipy, |
| 70 | 69 | x,y, |
| 71 | | machine.priority_bitmap,pri_mask,0); |
| 70 | machine().priority_bitmap,pri_mask,0); |
| 72 | 71 | } |
| 73 | 72 | |
| 74 | 73 | #ifdef MAME_DEBUG |
| r21024 | r21025 | |
| 82 | 81 | SCREEN REFRESH |
| 83 | 82 | **************************************************************/ |
| 84 | 83 | |
| 85 | | static UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs, device_t *tc0100scn) |
| 84 | UINT32 warriorb_state::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs, device_t *tc0100scn) |
| 86 | 85 | { |
| 87 | 86 | UINT8 layer[3], nodraw; |
| 88 | 87 | |
| r21024 | r21025 | |
| 101 | 100 | |
| 102 | 101 | /* Ensure screen blanked even when bottom layers not drawn due to disable bit */ |
| 103 | 102 | if (nodraw) |
| 104 | | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 103 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 105 | 104 | |
| 106 | 105 | // draw middle layer |
| 107 | 106 | tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1); |
| 108 | 107 | |
| 109 | 108 | /* Sprites can be under/over the layer below text layer */ |
| 110 | | draw_sprites(screen.machine(), bitmap, cliprect, xoffs, 8); // draw sprites |
| 109 | draw_sprites(bitmap, cliprect, xoffs, 8); // draw sprites |
| 111 | 110 | |
| 112 | 111 | // draw top(text) layer |
| 113 | 112 | tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 0); |
trunk/src/mame/includes/wc90.h
| r21024 | r21025 | |
| 20 | 20 | m_scroll2yhi(*this, "scroll2yhi"), |
| 21 | 21 | m_spriteram(*this, "spriteram"){ } |
| 22 | 22 | |
| 23 | typedef void (wc90_state::*draw_sprites_func)(bitmap_ind16 &, const rectangle &, int, int, int, int, int ); |
| 24 | |
| 23 | 25 | required_shared_ptr<UINT8> m_fgvideoram; |
| 24 | 26 | required_shared_ptr<UINT8> m_bgvideoram; |
| 25 | 27 | required_shared_ptr<UINT8> m_txvideoram; |
| r21024 | r21025 | |
| 53 | 55 | virtual void video_start(); |
| 54 | 56 | DECLARE_VIDEO_START(wc90t); |
| 55 | 57 | UINT32 screen_update_wc90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 58 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); |
| 59 | void draw_sprite_16x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ); |
| 60 | void draw_sprite_16x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ); |
| 61 | void draw_sprite_16x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ); |
| 62 | void draw_sprite_32x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ); |
| 63 | void draw_sprite_32x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ); |
| 64 | void draw_sprite_32x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code, int sx, int sy, int bank, int flags ); |
| 65 | void draw_sprite_64x16(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ); |
| 66 | void draw_sprite_64x32(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ); |
| 67 | void draw_sprite_64x64(bitmap_ind16 &bitmap, const rectangle &cliprect, int code,int sx, int sy, int bank, int flags ); |
| 68 | void draw_sprite_invalid(bitmap_ind16 &bitmap, const rectangle &cliprect, int code, int sx, int sy, int bank, int flags ); |
| 56 | 69 | }; |