trunk/src/mame/includes/snk.h
| r32577 | r32578 | |
| 9 | 9 | public: |
| 10 | 10 | snk_state(const machine_config &mconfig, device_type type, const char *tag) |
| 11 | 11 | : driver_device(mconfig, type, tag), |
| 12 | | m_spriteram(*this, "spriteram"), |
| 13 | | m_fg_videoram(*this, "fg_videoram"), |
| 14 | | m_bg_videoram(*this, "bg_videoram"), |
| 15 | | m_tx_videoram(*this, "tx_videoram"), |
| 16 | 12 | m_maincpu(*this, "maincpu"), |
| 17 | 13 | m_audiocpu(*this, "audiocpu"), |
| 18 | 14 | m_subcpu(*this, "sub"), |
| 19 | 15 | m_gfxdecode(*this, "gfxdecode"), |
| 20 | 16 | m_screen(*this, "screen"), |
| 21 | | m_palette(*this, "palette") { } |
| 17 | m_palette(*this, "palette"), |
| 18 | m_spriteram(*this, "spriteram"), |
| 19 | m_fg_videoram(*this, "fg_videoram"), |
| 20 | m_bg_videoram(*this, "bg_videoram"), |
| 21 | m_tx_videoram(*this, "tx_videoram") { } |
| 22 | 22 | |
| 23 | required_device<cpu_device> m_maincpu; |
| 24 | required_device<cpu_device> m_audiocpu; |
| 25 | required_device<cpu_device> m_subcpu; |
| 26 | required_device<gfxdecode_device> m_gfxdecode; |
| 27 | required_device<screen_device> m_screen; |
| 28 | required_device<palette_device> m_palette; |
| 29 | |
| 30 | required_shared_ptr<UINT8> m_spriteram; |
| 31 | optional_shared_ptr<UINT8> m_fg_videoram; |
| 32 | required_shared_ptr<UINT8> m_bg_videoram; |
| 33 | required_shared_ptr<UINT8> m_tx_videoram; |
| 34 | |
| 23 | 35 | int m_countryc_trackball; |
| 24 | 36 | int m_last_value[2]; |
| 25 | 37 | int m_cp_count[2]; |
| r32577 | r32578 | |
| 27 | 39 | int m_marvins_sound_busy_flag; |
| 28 | 40 | // FIXME this should be initialised on machine reset |
| 29 | 41 | int m_sound_status; |
| 30 | | |
| 31 | | required_shared_ptr<UINT8> m_spriteram; |
| 32 | | optional_shared_ptr<UINT8> m_fg_videoram; |
| 33 | | required_shared_ptr<UINT8> m_bg_videoram; |
| 34 | | required_shared_ptr<UINT8> m_tx_videoram; |
| 35 | | |
| 42 | |
| 36 | 43 | tilemap_t *m_tx_tilemap; |
| 37 | 44 | tilemap_t *m_fg_tilemap; |
| 38 | 45 | tilemap_t *m_bg_tilemap; |
| r32577 | r32578 | |
| 174 | 181 | UINT32 screen_update_tnk3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 175 | 182 | UINT32 screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 176 | 183 | UINT32 screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 177 | | UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 184 | UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 178 | 185 | TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback); |
| 179 | 186 | TIMER_CALLBACK_MEMBER(sndirq_update_callback); |
| 180 | 187 | DECLARE_WRITE_LINE_MEMBER(ymirq_callback_2); |
| 188 | void marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to); |
| 181 | 189 | void tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll); |
| 190 | void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ); |
| 191 | void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to); |
| 182 | 192 | int hardflags_check(int num); |
| 183 | 193 | int hardflags_check8(int num); |
| 184 | 194 | int turbofront_check(int small, int num); |
| 185 | 195 | int turbofront_check8(int small, int num); |
| 186 | 196 | DECLARE_WRITE_LINE_MEMBER(ymirq_callback_1); |
| 187 | | required_device<cpu_device> m_maincpu; |
| 188 | | required_device<cpu_device> m_audiocpu; |
| 189 | | required_device<cpu_device> m_subcpu; |
| 190 | | required_device<gfxdecode_device> m_gfxdecode; |
| 191 | | required_device<screen_device> m_screen; |
| 192 | | required_device<palette_device> m_palette; |
| 193 | 197 | }; |
trunk/src/mame/includes/tatsumi.h
| r32577 | r32578 | |
| 6 | 6 | public: |
| 7 | 7 | tatsumi_state(const machine_config &mconfig, device_type type, const char *tag) |
| 8 | 8 | : driver_device(mconfig, type, tag), |
| 9 | m_maincpu(*this, "maincpu"), |
| 10 | m_audiocpu(*this, "audiocpu"), |
| 11 | m_subcpu(*this, "sub"), |
| 12 | m_subcpu2(*this, "sub2"), |
| 13 | m_oki(*this, "oki"), |
| 14 | m_gfxdecode(*this, "gfxdecode"), |
| 15 | m_palette(*this, "palette"), |
| 9 | 16 | m_videoram(*this, "videoram"), |
| 10 | 17 | m_cyclwarr_cpua_ram(*this, "cw_cpua_ram"), |
| 11 | 18 | m_cyclwarr_cpub_ram(*this, "cw_cpub_ram"), |
| r32577 | r32578 | |
| 23 | 30 | m_roundup_r_ram(*this, "roundup_r_ram"), |
| 24 | 31 | m_roundup_p_ram(*this, "roundup_p_ram"), |
| 25 | 32 | m_roundup_l_ram(*this, "roundup_l_ram"), |
| 26 | | m_spriteram(*this, "spriteram") , |
| 27 | | m_maincpu(*this, "maincpu"), |
| 28 | | m_audiocpu(*this, "audiocpu"), |
| 29 | | m_subcpu(*this, "sub"), |
| 30 | | m_subcpu2(*this, "sub2"), |
| 31 | | m_oki(*this, "oki"), |
| 32 | | m_gfxdecode(*this, "gfxdecode"), |
| 33 | | m_palette(*this, "palette") { } |
| 33 | m_spriteram(*this, "spriteram") { } |
| 34 | 34 | |
| 35 | required_device<cpu_device> m_maincpu; |
| 36 | required_device<cpu_device> m_audiocpu; |
| 37 | required_device<m68000_base_device> m_subcpu; |
| 38 | optional_device<cpu_device> m_subcpu2; |
| 39 | required_device<okim6295_device> m_oki; |
| 40 | required_device<gfxdecode_device> m_gfxdecode; |
| 41 | required_device<palette_device> m_palette; |
| 42 | |
| 35 | 43 | optional_shared_ptr<UINT16> m_videoram; |
| 36 | 44 | optional_shared_ptr<UINT16> m_cyclwarr_cpua_ram; |
| 37 | 45 | optional_shared_ptr<UINT16> m_cyclwarr_cpub_ram; |
| 38 | | UINT16 m_bigfight_a20000[8]; |
| 39 | | UINT16 m_bigfight_a60000[2]; |
| 40 | 46 | optional_shared_ptr<UINT16> m_apache3_g_ram; |
| 41 | | UINT16 m_bigfight_a40000[2]; |
| 42 | | UINT8 *m_rom_sprite_lookup1; |
| 43 | | UINT8 *m_rom_sprite_lookup2; |
| 44 | | UINT8 *m_rom_clut0; |
| 45 | | UINT8 *m_rom_clut1; |
| 46 | 47 | optional_shared_ptr<UINT16> m_roundup5_d0000_ram; |
| 47 | 48 | optional_shared_ptr<UINT16> m_roundup5_e0000_ram; |
| 48 | 49 | optional_shared_ptr<UINT16> m_roundup5_unknown0; |
| r32577 | r32578 | |
| 50 | 51 | optional_shared_ptr<UINT16> m_roundup5_unknown2; |
| 51 | 52 | optional_shared_ptr<UINT16> m_68k_ram; |
| 52 | 53 | optional_shared_ptr<UINT8> m_apache3_z80_ram; |
| 53 | | UINT16 m_control_word; |
| 54 | | UINT16 m_apache3_rotate_ctrl[12]; |
| 55 | 54 | required_shared_ptr<UINT16> m_sprite_control_ram; |
| 56 | 55 | optional_shared_ptr<UINT16> m_cyclwarr_videoram0; |
| 57 | 56 | optional_shared_ptr<UINT16> m_cyclwarr_videoram1; |
| 58 | 57 | optional_shared_ptr<UINT16> m_roundup_r_ram; |
| 59 | 58 | optional_shared_ptr<UINT16> m_roundup_p_ram; |
| 60 | 59 | optional_shared_ptr<UINT16> m_roundup_l_ram; |
| 60 | required_shared_ptr<UINT16> m_spriteram; |
| 61 | |
| 62 | UINT16 m_bigfight_a20000[8]; |
| 63 | UINT16 m_bigfight_a60000[2]; |
| 64 | UINT16 m_bigfight_a40000[2]; |
| 65 | UINT8 *m_rom_sprite_lookup1; |
| 66 | UINT8 *m_rom_sprite_lookup2; |
| 67 | UINT8 *m_rom_clut0; |
| 68 | UINT8 *m_rom_clut1; |
| 69 | UINT16 m_control_word; |
| 70 | UINT16 m_apache3_rotate_ctrl[12]; |
| 61 | 71 | UINT16 m_last_control; |
| 62 | 72 | UINT8 m_apache3_adc; |
| 63 | 73 | int m_apache3_rot_idx; |
| r32577 | r32578 | |
| 75 | 85 | UINT8 m_roundupt_crt_selected_reg; |
| 76 | 86 | UINT8 m_roundupt_crt_reg[64]; |
| 77 | 87 | UINT8* m_shadow_pen_array; |
| 78 | | required_shared_ptr<UINT16> m_spriteram; |
| 79 | 88 | DECLARE_READ16_MEMBER(cyclwarr_sprite_r); |
| 80 | 89 | DECLARE_WRITE16_MEMBER(cyclwarr_sprite_w); |
| 81 | 90 | DECLARE_WRITE16_MEMBER(bigfight_a20000_w); |
| r32577 | r32578 | |
| 131 | 140 | DECLARE_READ8_MEMBER(tatsumi_hack_ym2151_r); |
| 132 | 141 | DECLARE_READ8_MEMBER(tatsumi_hack_oki_r); |
| 133 | 142 | DECLARE_WRITE_LINE_MEMBER(apache3_68000_reset); |
| 134 | | required_device<cpu_device> m_maincpu; |
| 135 | | required_device<cpu_device> m_audiocpu; |
| 136 | | required_device<m68000_base_device> m_subcpu; |
| 137 | | optional_device<cpu_device> m_subcpu2; |
| 138 | | required_device<okim6295_device> m_oki; |
| 139 | | required_device<gfxdecode_device> m_gfxdecode; |
| 140 | | required_device<palette_device> m_palette; |
| 143 | void tatsumi_reset(); |
| 141 | 144 | }; |
| 142 | | |
| 143 | | /*----------- defined in machine/tatsumi.c -----------*/ |
| 144 | | void tatsumi_reset(running_machine &machine); |
trunk/src/mame/video/gp9001.c
| r32577 | r32578 | |
| 669 | 669 | Sprite Handlers |
| 670 | 670 | ***************************************************************************/ |
| 671 | 671 | |
| 672 | | void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8* primap ) |
| 672 | void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8* primap ) |
| 673 | 673 | { |
| 674 | 674 | const UINT16 primask = (GP9001_PRIMASK << 8); |
| 675 | 675 | |
| r32577 | r32578 | |
| 859 | 859 | Draw the game screen in the given bitmap_ind16. |
| 860 | 860 | ***************************************************************************/ |
| 861 | 861 | |
| 862 | | void gp9001vdp_device::gp9001_draw_custom_tilemap(running_machine& machine, bitmap_ind16 &bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable ) |
| 862 | void gp9001vdp_device::gp9001_draw_custom_tilemap( bitmap_ind16 &bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable ) |
| 863 | 863 | { |
| 864 | | int width = machine.first_screen()->width(); |
| 865 | | int height = machine.first_screen()->height(); |
| 864 | int width = m_screen->width(); |
| 865 | int height = m_screen->height(); |
| 866 | 866 | int y,x; |
| 867 | 867 | bitmap_ind16 &tmb = tilemap->pixmap(); |
| 868 | 868 | UINT16* srcptr; |
| r32577 | r32578 | |
| 912 | 912 | |
| 913 | 913 | static const UINT8 batsugun_prienable0[16]={ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; |
| 914 | 914 | |
| 915 | | void gp9001vdp_device::gp9001_render_vdp(running_machine& machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 915 | void gp9001vdp_device::gp9001_render_vdp(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 916 | 916 | { |
| 917 | 917 | if (gp9001_gfxrom_is_banked && gp9001_gfxrom_bank_dirty) |
| 918 | 918 | { |
| r32577 | r32578 | |
| 921 | 921 | gp9001_gfxrom_bank_dirty = 0; |
| 922 | 922 | } |
| 923 | 923 | |
| 924 | | gp9001_draw_custom_tilemap( machine, bitmap, bg.tmap, gp9001_primap1, batsugun_prienable0); |
| 925 | | gp9001_draw_custom_tilemap( machine, bitmap, fg.tmap, gp9001_primap1, batsugun_prienable0); |
| 926 | | gp9001_draw_custom_tilemap( machine, bitmap, top.tmap, gp9001_primap1, batsugun_prienable0); |
| 927 | | draw_sprites( machine,bitmap,cliprect, gp9001_sprprimap1); |
| 924 | gp9001_draw_custom_tilemap(bitmap, bg.tmap, gp9001_primap1, batsugun_prienable0); |
| 925 | gp9001_draw_custom_tilemap(bitmap, fg.tmap, gp9001_primap1, batsugun_prienable0); |
| 926 | gp9001_draw_custom_tilemap(bitmap, top.tmap, gp9001_primap1, batsugun_prienable0); |
| 927 | draw_sprites(bitmap,cliprect, gp9001_sprprimap1); |
| 928 | 928 | } |
| 929 | 929 | |
| 930 | 930 | |
trunk/src/mame/video/snk.c
| r32577 | r32578 | |
| 658 | 658 | |
| 659 | 659 | /**************************************************************************************/ |
| 660 | 660 | |
| 661 | | static void marvins_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, |
| 662 | | const int scrollx, const int scrolly, const int from, const int to) |
| 661 | void snk_state::marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to) |
| 663 | 662 | { |
| 664 | | snk_state *state = machine.driver_data<snk_state>(); |
| 665 | | gfx_element *gfx = state->m_gfxdecode->gfx(3); |
| 663 | gfx_element *gfx = m_gfxdecode->gfx(3); |
| 666 | 664 | const UINT8 *source, *finish; |
| 667 | 665 | |
| 668 | | source = state->m_spriteram + from*4; |
| 669 | | finish = state->m_spriteram + to*4; |
| 666 | source = m_spriteram + from*4; |
| 667 | finish = m_spriteram + to*4; |
| 670 | 668 | |
| 671 | 669 | while( source<finish ) |
| 672 | 670 | { |
| r32577 | r32578 | |
| 678 | 676 | int flipy = (attributes&0x20); |
| 679 | 677 | int flipx = 0; |
| 680 | 678 | |
| 681 | | if (state->flip_screen()) |
| 679 | if (flip_screen()) |
| 682 | 680 | { |
| 683 | 681 | sx = 89 - 16 - sx; |
| 684 | 682 | sy = 262 - 16 - sy; |
| r32577 | r32578 | |
| 696 | 694 | color, |
| 697 | 695 | flipx, flipy, |
| 698 | 696 | sx, sy, |
| 699 | | state->m_drawmode_table); |
| 697 | m_drawmode_table); |
| 700 | 698 | |
| 701 | 699 | source+=4; |
| 702 | 700 | } |
| r32577 | r32578 | |
| 767 | 765 | } |
| 768 | 766 | |
| 769 | 767 | |
| 770 | | static void ikari_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, |
| 771 | | const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ) |
| 768 | void snk_state::ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ) |
| 772 | 769 | { |
| 773 | | snk_state *state = machine.driver_data<snk_state>(); |
| 774 | | gfx_element *gfx = state->m_gfxdecode->gfx(gfxnum); |
| 770 | gfx_element *gfx = m_gfxdecode->gfx(gfxnum); |
| 775 | 771 | const int size = gfx->width(); |
| 776 | 772 | int tile_number, attributes, color, sx, sy; |
| 777 | 773 | int which, finish; |
| r32577 | r32578 | |
| 809 | 805 | color, |
| 810 | 806 | 0,0, |
| 811 | 807 | sx,sy, |
| 812 | | state->m_drawmode_table); |
| 808 | m_drawmode_table); |
| 813 | 809 | } |
| 814 | 810 | } |
| 815 | 811 | |
| r32577 | r32578 | |
| 839 | 835 | -xx-x--- (bank number) |
| 840 | 836 | x------- (x offset bit8) |
| 841 | 837 | */ |
| 842 | | static void tdfever_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, |
| 843 | | const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to ) |
| 838 | void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, |
| 839 | const int hw_xflip, const int from, const int to) |
| 844 | 840 | { |
| 845 | | snk_state *state = machine.driver_data<snk_state>(); |
| 846 | | gfx_element *gfx = state->m_gfxdecode->gfx(gfxnum); |
| 841 | gfx_element *gfx = m_gfxdecode->gfx(gfxnum); |
| 847 | 842 | const int size = gfx->width(); |
| 848 | 843 | int tile_number, attributes, sx, sy, color; |
| 849 | 844 | int which; |
| r32577 | r32578 | |
| 879 | 874 | if (hw_xflip) |
| 880 | 875 | sx = 495 - size - sx; |
| 881 | 876 | |
| 882 | | if (state->flip_screen()) |
| 877 | if (flip_screen()) |
| 883 | 878 | { |
| 884 | 879 | sx = 495 - size - sx; |
| 885 | 880 | sy = 258 - size - sy; |
| r32577 | r32578 | |
| 897 | 892 | color, |
| 898 | 893 | flipx,flipy, |
| 899 | 894 | sx,sy, |
| 900 | | state->m_drawmode_table); |
| 895 | m_drawmode_table); |
| 901 | 896 | } |
| 902 | 897 | } |
| 903 | 898 | |
| r32577 | r32578 | |
| 911 | 906 | m_fg_tilemap->set_scrolly(0, m_fg_scrolly); |
| 912 | 907 | |
| 913 | 908 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 914 | | marvins_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, 0, m_sprite_split_point>>2); |
| 909 | marvins_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, 0, m_sprite_split_point>>2); |
| 915 | 910 | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 916 | | marvins_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_sprite_split_point>>2, 25); |
| 911 | marvins_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_sprite_split_point>>2, 25); |
| 917 | 912 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 918 | 913 | |
| 919 | 914 | return 0; |
| r32577 | r32578 | |
| 940 | 935 | |
| 941 | 936 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 942 | 937 | |
| 943 | | ikari_draw_sprites(machine(), bitmap, cliprect, 0, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 ); |
| 944 | | ikari_draw_sprites(machine(), bitmap, cliprect, 0, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3 ); |
| 945 | | ikari_draw_sprites(machine(), bitmap, cliprect, 25, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 ); |
| 938 | ikari_draw_sprites(bitmap, cliprect, 0, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 ); |
| 939 | ikari_draw_sprites(bitmap, cliprect, 0, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3 ); |
| 940 | ikari_draw_sprites(bitmap, cliprect, 25, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 ); |
| 946 | 941 | |
| 947 | 942 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 948 | 943 | return 0; |
| r32577 | r32578 | |
| 956 | 951 | |
| 957 | 952 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 958 | 953 | |
| 959 | | tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, 0, m_sprite_split_point ); |
| 960 | | tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3, 0, 0, 32 ); |
| 961 | | tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, m_sprite_split_point, 64 ); |
| 954 | tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, 0, m_sprite_split_point ); |
| 955 | tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3, 0, 0, 32 ); |
| 956 | tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, m_sprite_split_point, 64 ); |
| 962 | 957 | |
| 963 | 958 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 964 | 959 | |
| r32577 | r32578 | |
| 973 | 968 | |
| 974 | 969 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 975 | 970 | |
| 976 | | tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, 1, 0, 32 ); |
| 971 | tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, 1, 0, 32 ); |
| 977 | 972 | |
| 978 | 973 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 979 | 974 | |
trunk/src/mame/video/vsystem_spr2.c
| r32577 | r32578 | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | template<class _BitmapClass> |
| 140 | | void vsystem_spr2_device::turbofrc_draw_sprites_common( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) |
| 140 | void vsystem_spr2_device::turbofrc_draw_sprites_common( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) |
| 141 | 141 | { |
| 142 | 142 | int attr_start, first; |
| 143 | 143 | first = 4 * spriteram3[0x1fe]; |
| r32577 | r32578 | |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | | void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) |
| 248 | | { turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, machine, bitmap, cliprect, priority_bitmap, pri_param ); } |
| 247 | void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) |
| 248 | { turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, bitmap, cliprect, priority_bitmap, pri_param ); } |
| 249 | 249 | |
| 250 | | void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) |
| 251 | | { turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, machine, bitmap, cliprect, priority_bitmap, pri_param ); } |
| 250 | void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) |
| 251 | { turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, bitmap, cliprect, priority_bitmap, pri_param ); } |
trunk/src/mame/video/aerofgt.c
| r32577 | r32578 | |
| 296 | 296 | screen.priority().fill(0, cliprect); |
| 297 | 297 | |
| 298 | 298 | m_bg1_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 299 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); |
| 300 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); |
| 299 | m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); |
| 300 | m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); |
| 301 | 301 | return 0; |
| 302 | 302 | } |
| 303 | 303 | |
| r32577 | r32578 | |
| 315 | 315 | m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 316 | 316 | |
| 317 | 317 | /* we use the priority buffer so sprites are drawn front to back */ |
| 318 | | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); |
| 319 | | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); |
| 318 | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); |
| 319 | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); |
| 320 | 320 | |
| 321 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); |
| 322 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); |
| 321 | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); |
| 322 | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); |
| 323 | 323 | return 0; |
| 324 | 324 | } |
| 325 | 325 | |
| r32577 | r32578 | |
| 341 | 341 | m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 1); |
| 342 | 342 | |
| 343 | 343 | /* we use the priority buffer so sprites are drawn front to back */ |
| 344 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); |
| 345 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); |
| 344 | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); |
| 345 | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); |
| 346 | 346 | |
| 347 | | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); |
| 348 | | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); |
| 347 | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); |
| 348 | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); |
| 349 | 349 | return 0; |
| 350 | 350 | } |
| 351 | 351 | |
| r32577 | r32578 | |
| 368 | 368 | m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 1); |
| 369 | 369 | |
| 370 | 370 | /* we use the priority buffer so sprites are drawn front to back */ |
| 371 | | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); //enemy |
| 372 | | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); //enemy |
| 371 | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //enemy |
| 372 | m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //enemy |
| 373 | 373 | |
| 374 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); //ship |
| 375 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); //intro |
| 374 | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //ship |
| 375 | m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //intro |
| 376 | 376 | return 0; |
| 377 | 377 | } |
| 378 | 378 | |
| r32577 | r32578 | |
| 834 | 834 | m_bg1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); |
| 838 | | m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); |
| 837 | m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); |
| 838 | m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); |
| 839 | 839 | return 0; |
| 840 | 840 | } |
trunk/src/mame/video/cps1.c
| r32577 | r32578 | |
| 1684 | 1684 | } |
| 1685 | 1685 | |
| 1686 | 1686 | |
| 1687 | | INLINE UINT16 *cps1_base( running_machine &machine, int offset, int boundary ) |
| 1687 | inline UINT16 *cps_state::cps1_base( int offset, int boundary ) |
| 1688 | 1688 | { |
| 1689 | | cps_state *state = machine.driver_data<cps_state>(); |
| 1690 | | int base = state->m_cps_a_regs[offset] * 256; |
| 1689 | int base = m_cps_a_regs[offset] * 256; |
| 1691 | 1690 | |
| 1692 | 1691 | /* |
| 1693 | 1692 | The scroll RAM must start on a 0x4000 boundary. |
| r32577 | r32578 | |
| 1698 | 1697 | Mask out the irrelevant bits. |
| 1699 | 1698 | */ |
| 1700 | 1699 | base &= ~(boundary - 1); |
| 1701 | | return &state->m_gfxram[(base & 0x3ffff) / 2]; |
| 1700 | return &m_gfxram[(base & 0x3ffff) / 2]; |
| 1702 | 1701 | } |
| 1703 | 1702 | |
| 1704 | 1703 | |
| r32577 | r32578 | |
| 1716 | 1715 | fixes glitches in the ghouls intro, but it might happen at next vblank. |
| 1717 | 1716 | */ |
| 1718 | 1717 | if (offset == CPS1_PALETTE_BASE) |
| 1719 | | cps1_build_palette(cps1_base(machine(), CPS1_PALETTE_BASE, m_palette_align)); |
| 1718 | cps1_build_palette(cps1_base(CPS1_PALETTE_BASE, m_palette_align)); |
| 1720 | 1719 | |
| 1721 | 1720 | // pzloop2 write to register 24 on startup. This is probably just a bug. |
| 1722 | 1721 | if (offset == 0x24 / 2 && m_cps_version == 2) |
| r32577 | r32578 | |
| 1902 | 1901 | int layercontrol=0, videocontrol=0, scroll1xoff=0, scroll2xoff=0, scroll3xoff=0; |
| 1903 | 1902 | |
| 1904 | 1903 | /* Re-calculate the VIDEO RAM base */ |
| 1905 | | if (m_scroll1 != cps1_base(machine(), CPS1_SCROLL1_BASE, m_scroll_size)) |
| 1904 | if (m_scroll1 != cps1_base(CPS1_SCROLL1_BASE, m_scroll_size)) |
| 1906 | 1905 | { |
| 1907 | | m_scroll1 = cps1_base(machine(), CPS1_SCROLL1_BASE, m_scroll_size); |
| 1906 | m_scroll1 = cps1_base(CPS1_SCROLL1_BASE, m_scroll_size); |
| 1908 | 1907 | m_bg_tilemap[0]->mark_all_dirty(); |
| 1909 | 1908 | } |
| 1910 | | if (m_scroll2 != cps1_base(machine(), CPS1_SCROLL2_BASE, m_scroll_size)) |
| 1909 | if (m_scroll2 != cps1_base(CPS1_SCROLL2_BASE, m_scroll_size)) |
| 1911 | 1910 | { |
| 1912 | | m_scroll2 = cps1_base(machine(), CPS1_SCROLL2_BASE, m_scroll_size); |
| 1911 | m_scroll2 = cps1_base(CPS1_SCROLL2_BASE, m_scroll_size); |
| 1913 | 1912 | m_bg_tilemap[1]->mark_all_dirty(); |
| 1914 | 1913 | } |
| 1915 | | if (m_scroll3 != cps1_base(machine(), CPS1_SCROLL3_BASE, m_scroll_size)) |
| 1914 | if (m_scroll3 != cps1_base(CPS1_SCROLL3_BASE, m_scroll_size)) |
| 1916 | 1915 | { |
| 1917 | | m_scroll3 = cps1_base(machine(), CPS1_SCROLL3_BASE, m_scroll_size); |
| 1916 | m_scroll3 = cps1_base(CPS1_SCROLL3_BASE, m_scroll_size); |
| 1918 | 1917 | m_bg_tilemap[2]->mark_all_dirty(); |
| 1919 | 1918 | } |
| 1920 | 1919 | |
| r32577 | r32578 | |
| 1942 | 1941 | scroll3xoff = -0x0c; |
| 1943 | 1942 | } |
| 1944 | 1943 | |
| 1945 | | m_obj = cps1_base(machine(), CPS1_OBJ_BASE, m_obj_size); |
| 1946 | | m_other = cps1_base(machine(), CPS1_OTHER_BASE, m_other_size); |
| 1944 | m_obj = cps1_base(CPS1_OBJ_BASE, m_obj_size); |
| 1945 | m_other = cps1_base(CPS1_OTHER_BASE, m_other_size); |
| 1947 | 1946 | |
| 1948 | 1947 | /* Get scroll values */ |
| 1949 | 1948 | m_scroll1x = m_cps_a_regs[CPS1_SCROLL1_SCROLLX] + scroll1xoff; |
trunk/src/mame/video/sknsspr.c
| r32577 | r32578 | |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | sknsspr_device::sknsspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 23 | | : device_t(mconfig, SKNS_SPRITE, "SKNS Sprite", tag, owner, clock, "sknsspr", __FILE__) |
| 23 | : device_t(mconfig, SKNS_SPRITE, "SKNS Sprite", tag, owner, clock, "sknsspr", __FILE__), |
| 24 | device_video_interface(mconfig, *this) |
| 24 | 25 | { |
| 25 | 26 | } |
| 26 | 27 | |
| r32577 | r32578 | |
| 34 | 35 | //printf("sknsspr_device::device_reset()\n"); |
| 35 | 36 | } |
| 36 | 37 | |
| 37 | | int sknsspr_device::skns_rle_decode ( running_machine &machine, int romoffset, int size, UINT8*gfx_source, size_t gfx_length ) |
| 38 | int sknsspr_device::skns_rle_decode ( int romoffset, int size, UINT8*gfx_source, size_t gfx_length ) |
| 38 | 39 | { |
| 39 | 40 | UINT8 *src = gfx_source; |
| 40 | 41 | size_t srcsize = gfx_length; |
| r32577 | r32578 | |
| 229 | 230 | blit_fxy_z, |
| 230 | 231 | }; |
| 231 | 232 | |
| 232 | | void sknsspr_device::skns_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs) |
| 233 | void sknsspr_device::skns_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs) |
| 233 | 234 | { |
| 234 | 235 | /*- SPR RAM Format -** |
| 235 | 236 | |
| r32577 | r32578 | |
| 395 | 396 | if (sprite_flip&2) |
| 396 | 397 | { |
| 397 | 398 | xflip ^= 1; |
| 398 | | sx = machine.first_screen()->visible_area().max_x+1 - sx; |
| 399 | sx = m_screen->visible_area().max_x+1 - sx; |
| 399 | 400 | } |
| 400 | 401 | if (sprite_flip&1) |
| 401 | 402 | { |
| 402 | 403 | yflip ^= 1; |
| 403 | | sy = machine.first_screen()->visible_area().max_y+1 - sy; |
| 404 | sy = m_screen->visible_area().max_y+1 - sy; |
| 404 | 405 | } |
| 405 | 406 | |
| 406 | 407 | /* Palette linking */ |
| r32577 | r32578 | |
| 446 | 447 | |
| 447 | 448 | romoffset &= gfxlen-1; |
| 448 | 449 | |
| 449 | | endromoffs = skns_rle_decode ( machine, romoffset, size, gfx_source, gfx_length ); |
| 450 | endromoffs = skns_rle_decode ( romoffset, size, gfx_source, gfx_length ); |
| 450 | 451 | |
| 451 | 452 | // in Cyvern |
| 452 | 453 | |
trunk/src/mame/video/f1gp.c
| r32577 | r32578 | |
| 195 | 195 | /* quick kludge for "continue" screen priority */ |
| 196 | 196 | if (m_gfxctrl == 0x00) |
| 197 | 197 | { |
| 198 | | m_spr_old->turbofrc_draw_sprites(m_spr1vram, m_spr1vram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0x02); |
| 199 | | m_spr_old2->turbofrc_draw_sprites(m_spr2vram, m_spr2vram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0x02); |
| 198 | m_spr_old->turbofrc_draw_sprites(m_spr1vram, m_spr1vram.bytes(), 0, bitmap, cliprect, screen.priority(), 0x02); |
| 199 | m_spr_old2->turbofrc_draw_sprites(m_spr2vram, m_spr2vram.bytes(), 0, bitmap, cliprect, screen.priority(), 0x02); |
| 200 | 200 | } |
| 201 | 201 | else |
| 202 | 202 | { |
| 203 | | m_spr_old->turbofrc_draw_sprites(m_spr1vram, m_spr1vram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0x00); |
| 204 | | m_spr_old2->turbofrc_draw_sprites(m_spr2vram, m_spr2vram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0x02); |
| 203 | m_spr_old->turbofrc_draw_sprites(m_spr1vram, m_spr1vram.bytes(), 0, bitmap, cliprect, screen.priority(), 0x00); |
| 204 | m_spr_old2->turbofrc_draw_sprites(m_spr2vram, m_spr2vram.bytes(), 0, bitmap, cliprect, screen.priority(), 0x02); |
| 205 | 205 | } |
| 206 | 206 | return 0; |
| 207 | 207 | } |