trunk/src/mame/includes/taito_f3.h
| r32403 | r32404 | |
| 52 | 52 | |
| 53 | 53 | taito_f3_state(const machine_config &mconfig, device_type type, const char *tag) |
| 54 | 54 | : driver_device(mconfig, type, tag), |
| 55 | | m_f3_ram(*this,"f3_ram") , |
| 56 | 55 | m_maincpu(*this, "maincpu"), |
| 57 | 56 | m_audiocpu(*this, "audiocpu"), |
| 58 | 57 | m_oki(*this, "oki"), |
| 59 | 58 | m_gfxdecode(*this, "gfxdecode"), |
| 60 | 59 | m_screen(*this, "screen"), |
| 61 | 60 | m_palette(*this, "palette"), |
| 61 | m_f3_ram(*this,"f3_ram"), |
| 62 | 62 | m_paletteram32(*this, "paletteram") { } |
| 63 | 63 | |
| 64 | required_device<cpu_device> m_maincpu; |
| 65 | optional_device<cpu_device> m_audiocpu; |
| 66 | optional_device<okim6295_device> m_oki; |
| 67 | required_device<gfxdecode_device> m_gfxdecode; |
| 68 | required_device<screen_device> m_screen; |
| 69 | required_device<palette_device> m_palette; |
| 70 | |
| 71 | optional_shared_ptr<UINT32> m_f3_ram; |
| 72 | optional_shared_ptr<UINT32> m_paletteram32; |
| 73 | |
| 64 | 74 | UINT16 *m_videoram; |
| 65 | 75 | UINT16 *m_spriteram; |
| 66 | | optional_shared_ptr<UINT32> m_f3_ram; |
| 67 | 76 | UINT16 *m_f3_vram; |
| 68 | 77 | UINT16 *m_f3_line_ram; |
| 69 | 78 | UINT16 *m_f3_pf_data; |
| r32403 | r32404 | |
| 288 | 297 | UINT32 screen_update_f3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 289 | 298 | void screen_eof_f3(screen_device &screen, bool state); |
| 290 | 299 | INTERRUPT_GEN_MEMBER(f3_interrupt2); |
| 291 | | required_device<cpu_device> m_maincpu; |
| 292 | | optional_device<cpu_device> m_audiocpu; |
| 293 | | optional_device<okim6295_device> m_oki; |
| 294 | | required_device<gfxdecode_device> m_gfxdecode; |
| 295 | | required_device<screen_device> m_screen; |
| 296 | | required_device<palette_device> m_palette; |
| 297 | | optional_shared_ptr<UINT32> m_paletteram32; |
| 298 | 300 | |
| 299 | 301 | protected: |
| 300 | 302 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| r32403 | r32404 | |
| 304 | 306 | inline void f3_drawgfx(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,int code,int color,int flipx,int flipy,int sx,int sy,UINT8 pri_dst); |
| 305 | 307 | inline void f3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,int code,int color,int flipx,int flipy,int sx,int sy,int scalex,int scaley,UINT8 pri_dst); |
| 306 | 308 | void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 309 | void get_sprite_info(const UINT16 *spriteram16_ptr); |
| 307 | 310 | }; |
trunk/src/mame/video/taito_f3.c
| r32403 | r32404 | |
| 271 | 271 | int pri; |
| 272 | 272 | }; |
| 273 | 273 | |
| 274 | | static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_ptr); |
| 275 | | |
| 276 | 274 | struct f3_playfield_line_inf |
| 277 | 275 | { |
| 278 | 276 | int alpha_mode[256]; |
| r32403 | r32404 | |
| 511 | 509 | { |
| 512 | 510 | if (machine().video().skip_this_frame() == 0) |
| 513 | 511 | { |
| 514 | | get_sprite_info(machine(), m_spriteram16_buffered); |
| 512 | get_sprite_info(m_spriteram16_buffered); |
| 515 | 513 | } |
| 516 | 514 | memcpy(m_spriteram16_buffered,m_spriteram,0x10000); |
| 517 | 515 | } |
| r32403 | r32404 | |
| 519 | 517 | { |
| 520 | 518 | if (machine().video().skip_this_frame() == 0) |
| 521 | 519 | { |
| 522 | | get_sprite_info(machine(), m_spriteram); |
| 520 | get_sprite_info(m_spriteram); |
| 523 | 521 | } |
| 524 | 522 | } |
| 525 | 523 | } |
| r32403 | r32404 | |
| 2832 | 2830 | /*zoom##p = p##_addition << 12;*/ \ |
| 2833 | 2831 | } |
| 2834 | 2832 | |
| 2835 | | static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_ptr) |
| 2833 | void taito_f3_state::get_sprite_info(const UINT16 *spriteram16_ptr) |
| 2836 | 2834 | { |
| 2837 | | taito_f3_state *state = machine.driver_data<taito_f3_state>(); |
| 2838 | | const rectangle &visarea = machine.first_screen()->visible_area(); |
| 2835 | const rectangle &visarea = m_screen->visible_area(); |
| 2839 | 2836 | const int min_x=visarea.min_x,max_x=visarea.max_x; |
| 2840 | 2837 | const int min_y=visarea.min_y,max_y=visarea.max_y; |
| 2841 | 2838 | int offs,spritecont,flipx,flipy,/*old_x,*/color,x,y; |
| r32403 | r32404 | |
| 2849 | 2846 | |
| 2850 | 2847 | int x_addition_left = 8, y_addition_left = 8; |
| 2851 | 2848 | |
| 2852 | | struct tempsprite *sprite_ptr = state->m_spritelist; |
| 2849 | struct tempsprite *sprite_ptr = m_spritelist; |
| 2853 | 2850 | |
| 2854 | 2851 | int total_sprites=0; |
| 2855 | 2852 | |
| r32403 | r32404 | |
| 2876 | 2873 | /* Check if special command bit is set */ |
| 2877 | 2874 | if (spriteram16_ptr[current_offs+2+1] & 0x8000) { |
| 2878 | 2875 | UINT32 cntrl=(spriteram16_ptr[current_offs+4+1])&0xffff; |
| 2879 | | state->m_flipscreen=cntrl&0x2000; |
| 2876 | m_flipscreen=cntrl&0x2000; |
| 2880 | 2877 | |
| 2881 | 2878 | /* cntrl&0x1000 = disabled? (From F2 driver, doesn't seem used anywhere) |
| 2882 | 2879 | cntrl&0x0010 = ??? |
| 2883 | 2880 | cntrl&0x0020 = ??? |
| 2884 | 2881 | */ |
| 2885 | 2882 | |
| 2886 | | state->m_sprite_extra_planes = (cntrl & 0x0300) >> 8; // 0 = 4bpp, 1 = 5bpp, 2 = unused?, 3 = 6bpp |
| 2887 | | state->m_sprite_pen_mask = (state->m_sprite_extra_planes << 4) | 0x0f; |
| 2883 | m_sprite_extra_planes = (cntrl & 0x0300) >> 8; // 0 = 4bpp, 1 = 5bpp, 2 = unused?, 3 = 6bpp |
| 2884 | m_sprite_pen_mask = (m_sprite_extra_planes << 4) | 0x0f; |
| 2888 | 2885 | |
| 2889 | 2886 | /* Sprite bank select */ |
| 2890 | 2887 | if (cntrl&1) { |
| r32403 | r32404 | |
| 2925 | 2922 | /* These games either don't set the XY control bits properly (68020 bug?), or |
| 2926 | 2923 | have some different mode from the others */ |
| 2927 | 2924 | #ifdef DARIUSG_KLUDGE |
| 2928 | | if (state->m_f3_game==DARIUSG || state->m_f3_game==GEKIRIDO || state->m_f3_game==CLEOPATR || state->m_f3_game==RECALH) |
| 2925 | if (m_f3_game==DARIUSG || m_f3_game==GEKIRIDO || m_f3_game==CLEOPATR || m_f3_game==RECALH) |
| 2929 | 2926 | multi=spritecont&0xf0; |
| 2930 | 2927 | #endif |
| 2931 | 2928 | |
| r32403 | r32404 | |
| 2936 | 2933 | else color=(spriteram16_ptr[current_offs+4+0])&0xff; |
| 2937 | 2934 | |
| 2938 | 2935 | #ifdef DARIUSG_KLUDGE |
| 2939 | | if (state->m_f3_game==DARIUSG || state->m_f3_game==GEKIRIDO || state->m_f3_game==CLEOPATR || state->m_f3_game==RECALH) { |
| 2936 | if (m_f3_game==DARIUSG || m_f3_game==GEKIRIDO || m_f3_game==CLEOPATR || m_f3_game==RECALH) { |
| 2940 | 2937 | /* Adjust X Position */ |
| 2941 | 2938 | if ((spritecont & 0x40) == 0) { |
| 2942 | 2939 | if (spritecont & 0x4) { |
| r32403 | r32404 | |
| 3064 | 3061 | if (!sprite) continue; |
| 3065 | 3062 | if (!x_addition || !y_addition) continue; |
| 3066 | 3063 | |
| 3067 | | if (state->m_flipscreen) |
| 3064 | if (m_flipscreen) |
| 3068 | 3065 | { |
| 3069 | 3066 | int tx,ty; |
| 3070 | 3067 | |
| r32403 | r32404 | |
| 3095 | 3092 | sprite_ptr++; |
| 3096 | 3093 | total_sprites++; |
| 3097 | 3094 | } |
| 3098 | | state->m_sprite_end = sprite_ptr; |
| 3095 | m_sprite_end = sprite_ptr; |
| 3099 | 3096 | } |
| 3100 | 3097 | #undef CALC_ZOOM |
| 3101 | 3098 | |
| r32403 | r32404 | |
| 3183 | 3180 | |
| 3184 | 3181 | /* sprites */ |
| 3185 | 3182 | if (m_sprite_lag==0) |
| 3186 | | get_sprite_info(machine(), m_spriteram); |
| 3183 | get_sprite_info(m_spriteram); |
| 3187 | 3184 | |
| 3188 | 3185 | /* Update sprite buffer */ |
| 3189 | 3186 | draw_sprites(bitmap,cliprect); |