Previous 199869 Revisions Next

r36106 Wednesday 25th February, 2015 at 17:56:44 UTC by Osso
mosaic.c, tagteam.c, taotaido.c: added / enabled save state support (nw)
[/branches/kale/src/mame/drivers]mosaic.c tagteam.c taotaido.c
[/branches/kale/src/mame/includes]mosaic.h tagteam.h taotaido.h
[/branches/kale/src/mame/video]mosaic.c tagteam.c taotaido.c

branches/kale/src/mame/drivers/mosaic.c
r244617r244618
8888static ADDRESS_MAP_START( mosaic_map, AS_PROGRAM, 8, mosaic_state )
8989   AM_RANGE(0x00000, 0x0ffff) AM_ROM
9090   AM_RANGE(0x20000, 0x21fff) AM_RAM
91   AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(mosaic_bgvideoram_w) AM_SHARE("bgvideoram")
92   AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(mosaic_fgvideoram_w) AM_SHARE("fgvideoram")
91   AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram")
92   AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram")
9393   AM_RANGE(0x24000, 0x241ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
9494ADDRESS_MAP_END
9595
9696static ADDRESS_MAP_START( gfire2_map, AS_PROGRAM, 8, mosaic_state )
9797   AM_RANGE(0x00000, 0x0ffff) AM_ROM
9898   AM_RANGE(0x10000, 0x17fff) AM_RAM
99   AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(mosaic_bgvideoram_w) AM_SHARE("bgvideoram")
100   AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(mosaic_fgvideoram_w) AM_SHARE("fgvideoram")
99   AM_RANGE(0x22000, 0x22fff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram")
100   AM_RANGE(0x23000, 0x23fff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram")
101101   AM_RANGE(0x24000, 0x241ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
102102ADDRESS_MAP_END
103103
r244617r244618
255255   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
256256   MCFG_SCREEN_SIZE(64*8, 32*8)
257257   MCFG_SCREEN_VISIBLE_AREA(8*8, 48*8-1, 2*8, 30*8-1)
258   MCFG_SCREEN_UPDATE_DRIVER(mosaic_state, screen_update_mosaic)
258   MCFG_SCREEN_UPDATE_DRIVER(mosaic_state, screen_update)
259259   MCFG_SCREEN_PALETTE("palette")
260260
261261   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mosaic)
r244617r244618
338338
339339
340340
341GAME( 1990, mosaic,  0,      mosaic, mosaic, driver_device, 0, ROT0, "Space", "Mosaic", 0 )
342GAME( 1990, mosaica, mosaic, mosaic, mosaic, driver_device, 0, ROT0, "Space (Fuuki license)", "Mosaic (Fuuki)", 0 )
343GAME( 1992, gfire2,  0,      gfire2, gfire2, driver_device, 0, ROT0, "Topis Corp", "Golden Fire II", 0 )
341GAME( 1990, mosaic,  0,      mosaic, mosaic, driver_device, 0, ROT0, "Space", "Mosaic", GAME_SUPPORTS_SAVE )
342GAME( 1990, mosaica, mosaic, mosaic, mosaic, driver_device, 0, ROT0, "Space (Fuuki license)", "Mosaic (Fuuki)", GAME_SUPPORTS_SAVE )
343GAME( 1992, gfire2,  0,      gfire2, gfire2, driver_device, 0, ROT0, "Topis Corp", "Golden Fire II", GAME_SUPPORTS_SAVE )
branches/kale/src/mame/drivers/tagteam.c
r244617r244618
3030#include "sound/dac.h"
3131#include "includes/tagteam.h"
3232
33
34void tagteam_state::machine_start()
35{
36   save_item(NAME(m_sound_nmi_mask));
37}
38
3339WRITE8_MEMBER(tagteam_state::sound_command_w)
3440{
3541   soundlatch_byte_w(space, offset, data);
r244617r244618
4349
4450static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tagteam_state )
4551   AM_RANGE(0x0000, 0x07ff) AM_RAM
46   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("P2") AM_WRITE(tagteam_flipscreen_w)
47   AM_RANGE(0x2001, 0x2001) AM_READ_PORT("P1") AM_WRITE(tagteam_control_w)
52   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("P2") AM_WRITE(flipscreen_w)
53   AM_RANGE(0x2001, 0x2001) AM_READ_PORT("P1") AM_WRITE(control_w)
4854   AM_RANGE(0x2002, 0x2002) AM_READ_PORT("DSW1") AM_WRITE(sound_command_w)
4955   AM_RANGE(0x2003, 0x2003) AM_READ_PORT("DSW2") AM_WRITE(irq_clear_w)
50   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(tagteam_mirrorvideoram_r, tagteam_mirrorvideoram_w)
51   AM_RANGE(0x4400, 0x47ff) AM_READWRITE(tagteam_mirrorcolorram_r, tagteam_mirrorcolorram_w)
56   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(mirrorvideoram_r, mirrorvideoram_w)
57   AM_RANGE(0x4400, 0x47ff) AM_READWRITE(mirrorcolorram_r, mirrorcolorram_w)
5258   AM_RANGE(0x4800, 0x4fff) AM_READONLY
53   AM_RANGE(0x4800, 0x4bff) AM_WRITE(tagteam_videoram_w) AM_SHARE("videoram")
54   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(tagteam_colorram_w) AM_SHARE("colorram")
59   AM_RANGE(0x4800, 0x4bff) AM_WRITE(videoram_w) AM_SHARE("videoram")
60   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(colorram_w) AM_SHARE("colorram")
5561   AM_RANGE(0x8000, 0xffff) AM_ROM
5662ADDRESS_MAP_END
5763
r244617r244618
218224   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3072))
219225   MCFG_SCREEN_SIZE(32*8, 32*8)
220226   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
221   MCFG_SCREEN_UPDATE_DRIVER(tagteam_state, screen_update_tagteam)
227   MCFG_SCREEN_UPDATE_DRIVER(tagteam_state, screen_update)
222228   MCFG_SCREEN_PALETTE("palette")
223229
224230   MCFG_GFXDECODE_ADD("gfxdecode", "palette", tagteam)
r244617r244618
304310
305311
306312
307GAME( 1983, bigprowr, 0,        tagteam, bigprowr, driver_device, 0, ROT270, "Technos Japan", "The Big Pro Wrestling!", 0 )
308GAME( 1983, tagteam,  bigprowr, tagteam, tagteam, driver_device,  0, ROT270, "Technos Japan (Data East license)", "Tag Team Wrestling", 0 )
313GAME( 1983, bigprowr, 0,        tagteam, bigprowr, driver_device, 0, ROT270, "Technos Japan", "The Big Pro Wrestling!", GAME_SUPPORTS_SAVE )
314GAME( 1983, tagteam,  bigprowr, tagteam, tagteam, driver_device,  0, ROT270, "Technos Japan (Data East license)", "Tag Team Wrestling", GAME_SUPPORTS_SAVE )
branches/kale/src/mame/drivers/taotaido.c
r244617r244618
7373#define TAOTAIDO_SHOW_ALL_INPUTS    0
7474
7575
76void taotaido_state::machine_start()
77{
78   save_item(NAME(m_pending_command));
79}
80
81
7682READ16_MEMBER(taotaido_state::pending_command_r)
7783{
7884   /* Only bit 0 is tested */
r244617r244618
9096}
9197static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, taotaido_state )
9298   AM_RANGE(0x000000, 0x0fffff) AM_ROM
93   AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(taotaido_bgvideoram_w) AM_SHARE("bgram")  // bg ram?
99   AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgram")  // bg ram?
94100   AM_RANGE(0xa00000, 0xa01fff) AM_RAM AM_SHARE("spriteram")       // sprite ram
95101   AM_RANGE(0xc00000, 0xc0ffff) AM_RAM AM_SHARE("spriteram2")      // sprite tile lookup ram
96102   AM_RANGE(0xfe0000, 0xfeffff) AM_RAM                                     // main ram
r244617r244618
106112   AM_RANGE(0xffff8e, 0xffff8f) AM_READ_PORT("JP")
107113   AM_RANGE(0xffffa0, 0xffffa1) AM_READ_PORT("P3")                     // used only by taotaida
108114   AM_RANGE(0xffffa2, 0xffffa3) AM_READ_PORT("P4")                     // used only by taotaida
109   AM_RANGE(0xffff00, 0xffff0f) AM_WRITE(taotaido_tileregs_w)
115   AM_RANGE(0xffff00, 0xffff0f) AM_WRITE(tileregs_w)
110116   AM_RANGE(0xffff10, 0xffff11) AM_WRITENOP                        // unknown
111117   AM_RANGE(0xffff20, 0xffff21) AM_WRITENOP                        // unknown - flip screen related
112   AM_RANGE(0xffff40, 0xffff47) AM_WRITE(taotaido_sprite_character_bank_select_w)
118   AM_RANGE(0xffff40, 0xffff47) AM_WRITE(sprite_character_bank_select_w)
113119   AM_RANGE(0xffffc0, 0xffffc1) AM_WRITE(sound_command_w)              // seems right
114120   AM_RANGE(0xffffe0, 0xffffe1) AM_READ(pending_command_r) // guess - seems to be needed for all the sounds to work
115121ADDRESS_MAP_END
r244617r244618
122128   m_pending_command = 0;
123129}
124130
125WRITE8_MEMBER(taotaido_state::taotaido_sh_bankswitch_w)
131WRITE8_MEMBER(taotaido_state::sh_bankswitch_w)
126132{
127133   UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
128134
r244617r244618
138144static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, taotaido_state )
139145   ADDRESS_MAP_GLOBAL_MASK(0xff)
140146   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
141   AM_RANGE(0x04, 0x04) AM_WRITE(taotaido_sh_bankswitch_w)
147   AM_RANGE(0x04, 0x04) AM_WRITE(sh_bankswitch_w)
142148   AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w)
143149   AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r)
144150ADDRESS_MAP_END
r244617r244618
331337INPUT_PORTS_END
332338
333339
334static const gfx_layout taotaido_layout =
340static const gfx_layout layout =
335341{
336342   16,16,
337343   RGN_FRAC(1,1),
r244617r244618
345351};
346352
347353static GFXDECODE_START( taotaido )
348   GFXDECODE_ENTRY( "gfx1", 0, taotaido_layout,  0x000, 256  ) /* sprites */
349   GFXDECODE_ENTRY( "gfx2", 0, taotaido_layout,  0x300, 256  ) /* bg tiles */
354   GFXDECODE_ENTRY( "gfx1", 0, layout,  0x000, 256  ) /* sprites */
355   GFXDECODE_ENTRY( "gfx2", 0, layout,  0x300, 256  ) /* bg tiles */
350356GFXDECODE_END
351357
352WRITE_LINE_MEMBER(taotaido_state::irqhandler)
353{
354   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
355}
356358
357359
358
359360static MACHINE_CONFIG_START( taotaido, taotaido_state )
360361   MCFG_CPU_ADD("maincpu", M68000, 32000000/2)
361362   MCFG_CPU_PROGRAM_MAP(main_map)
r244617r244618
373374   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
374375   MCFG_SCREEN_SIZE(40*8, 32*8)
375376   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
376   MCFG_SCREEN_UPDATE_DRIVER(taotaido_state, screen_update_taotaido)
377   MCFG_SCREEN_VBLANK_DRIVER(taotaido_state, screen_eof_taotaido)
377   MCFG_SCREEN_UPDATE_DRIVER(taotaido_state, screen_update)
378   MCFG_SCREEN_VBLANK_DRIVER(taotaido_state, screen_eof)
378379   MCFG_SCREEN_PALETTE("palette")
379380
380381   MCFG_PALETTE_ADD("palette", 0x800)
381382   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
382383
383384   MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
384   MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( taotaido_state, taotaido_tile_callback )
385   MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( taotaido_state, tile_callback )
385386   MCFG_VSYSTEM_SPR_SET_GFXREGION(0)
386387   MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")
387388   MCFG_VSYSTEM_SPR_PALETTE("palette")
r244617r244618
390391   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
391392
392393   MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
393   MCFG_YM2610_IRQ_HANDLER(WRITELINE(taotaido_state, irqhandler))
394   MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
394395   MCFG_SOUND_ROUTE(0, "lspeaker",  0.25)
395396   MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
396397   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
r244617r244618
470471   ROM_LOAD( "u15.bin", 0x000000, 0x200000, CRC(e95823e9) SHA1(362583944ad4fdde4f9e29928cf34376c7ad931f) )
471472ROM_END
472473
473GAME( 1993, taotaido, 0,        taotaido, taotaido, driver_device, 0, ROT0, "Video System Co.", "Tao Taido (2 button version)", GAME_NO_COCKTAIL )
474GAME( 1993, taotaidoa,taotaido, taotaido, taotaido6,driver_device, 0, ROT0, "Video System Co.", "Tao Taido (6 button version)", GAME_NO_COCKTAIL ) // maybe a prototype? has various debug features
475GAME( 1993, taotaido3,taotaido, taotaido, taotaido3,driver_device, 0, ROT0, "Video System Co.", "Tao Taido (2/3 button version)", GAME_NO_COCKTAIL )
474GAME( 1993, taotaido, 0,        taotaido, taotaido, driver_device, 0, ROT0, "Video System Co.", "Tao Taido (2 button version)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
475GAME( 1993, taotaidoa,taotaido, taotaido, taotaido6,driver_device, 0, ROT0, "Video System Co.", "Tao Taido (6 button version)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE  ) // maybe a prototype? has various debug features
476GAME( 1993, taotaido3,taotaido, taotaido, taotaido3,driver_device, 0, ROT0, "Video System Co.", "Tao Taido (2/3 button version)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE  )
branches/kale/src/mame/includes/mosaic.h
r244617r244618
99public:
1010   mosaic_state(const machine_config &mconfig, device_type type, const char *tag)
1111      : driver_device(mconfig, type, tag),
12      m_maincpu(*this, "maincpu"),
13      m_gfxdecode(*this, "gfxdecode"),
1214      m_fgvideoram(*this, "fgvideoram"),
13      m_bgvideoram(*this, "bgvideoram"),
14      m_maincpu(*this, "maincpu"),
15      m_gfxdecode(*this, "gfxdecode") { }
15      m_bgvideoram(*this, "bgvideoram") { }
1616
17   /* devices */
18   required_device<cpu_device> m_maincpu;
19   required_device<gfxdecode_device> m_gfxdecode;
20   
1721   /* memory pointers */
1822   required_shared_ptr<UINT8> m_fgvideoram;
1923   required_shared_ptr<UINT8> m_bgvideoram;
20//      UINT8 *        m_paletteram;    // currently this uses generic palette handling
2124
2225   /* video-related */
2326   tilemap_t      *m_bg_tilemap;
r244617r244618
2528
2629   /* misc */
2730   int            m_prot_val;
31   
2832   DECLARE_WRITE8_MEMBER(protection_w);
2933   DECLARE_READ8_MEMBER(protection_r);
3034   DECLARE_WRITE8_MEMBER(gfire2_protection_w);
3135   DECLARE_READ8_MEMBER(gfire2_protection_r);
32   DECLARE_WRITE8_MEMBER(mosaic_fgvideoram_w);
33   DECLARE_WRITE8_MEMBER(mosaic_bgvideoram_w);
36   DECLARE_WRITE8_MEMBER(fgvideoram_w);
37   DECLARE_WRITE8_MEMBER(bgvideoram_w);
38   
3439   TILE_GET_INFO_MEMBER(get_fg_tile_info);
3540   TILE_GET_INFO_MEMBER(get_bg_tile_info);
41   
3642   virtual void machine_start();
3743   virtual void machine_reset();
3844   virtual void video_start();
39   UINT32 screen_update_mosaic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
40   required_device<cpu_device> m_maincpu;
41   required_device<gfxdecode_device> m_gfxdecode;
45   
46   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4247};
branches/kale/src/mame/includes/tagteam.h
r244617r244618
33public:
44   tagteam_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_videoram(*this, "videoram"),
7      m_colorram(*this, "colorram"),
86      m_maincpu(*this, "maincpu"),
97      m_audiocpu(*this, "audiocpu"),
108      m_gfxdecode(*this, "gfxdecode"),
11      m_palette(*this, "palette") { }
9      m_palette(*this, "palette"),
10      m_videoram(*this, "videoram"),
11      m_colorram(*this, "colorram") { }
1212
13   required_device<cpu_device> m_maincpu;
14   required_device<cpu_device> m_audiocpu;
15   required_device<gfxdecode_device> m_gfxdecode;
16   required_device<palette_device> m_palette;
17
1318   required_shared_ptr<UINT8> m_videoram;
1419   required_shared_ptr<UINT8> m_colorram;
20
1521   int m_palettebank;
1622   tilemap_t *m_bg_tilemap;
23   UINT8 m_sound_nmi_mask;
1724
18   UINT8 m_sound_nmi_mask;
1925   DECLARE_WRITE8_MEMBER(sound_command_w);
2026   DECLARE_WRITE8_MEMBER(irq_clear_w);
2127   DECLARE_WRITE8_MEMBER(sound_nmi_mask_w);
22   DECLARE_WRITE8_MEMBER(tagteam_videoram_w);
23   DECLARE_WRITE8_MEMBER(tagteam_colorram_w);
24   DECLARE_READ8_MEMBER(tagteam_mirrorvideoram_r);
25   DECLARE_READ8_MEMBER(tagteam_mirrorcolorram_r);
26   DECLARE_WRITE8_MEMBER(tagteam_mirrorvideoram_w);
27   DECLARE_WRITE8_MEMBER(tagteam_mirrorcolorram_w);
28   DECLARE_WRITE8_MEMBER(tagteam_control_w);
29   DECLARE_WRITE8_MEMBER(tagteam_flipscreen_w);
28   DECLARE_WRITE8_MEMBER(videoram_w);
29   DECLARE_WRITE8_MEMBER(colorram_w);
30   DECLARE_READ8_MEMBER(mirrorvideoram_r);
31   DECLARE_READ8_MEMBER(mirrorcolorram_r);
32   DECLARE_WRITE8_MEMBER(mirrorvideoram_w);
33   DECLARE_WRITE8_MEMBER(mirrorcolorram_w);
34   DECLARE_WRITE8_MEMBER(control_w);
35   DECLARE_WRITE8_MEMBER(flipscreen_w);
36
3037   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
38   INTERRUPT_GEN_MEMBER(sound_timer_irq);
39
3140   TILE_GET_INFO_MEMBER(get_bg_tile_info);
41
42   virtual void machine_start();
3243   virtual void video_start();
3344   DECLARE_PALETTE_INIT(tagteam);
34   UINT32 screen_update_tagteam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35   INTERRUPT_GEN_MEMBER(sound_timer_irq);
45
46   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3647   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
37   required_device<cpu_device> m_maincpu;
38   required_device<cpu_device> m_audiocpu;
39   required_device<gfxdecode_device> m_gfxdecode;
40   required_device<palette_device> m_palette;
4148};
branches/kale/src/mame/includes/taotaido.h
r244617r244618
33public:
44   taotaido_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_maincpu(*this, "maincpu"),
7      m_audiocpu(*this, "audiocpu"),
8      m_gfxdecode(*this, "gfxdecode"),
9      m_spr(*this, "vsystem_spr"),
610      m_spriteram(*this, "spriteram"),
711      m_spriteram2(*this, "spriteram2"),
812      m_scrollram(*this, "scrollram"),
9      m_bgram(*this, "bgram"),
10      m_spr(*this, "vsystem_spr"),
11      m_maincpu(*this, "maincpu"),
12      m_audiocpu(*this, "audiocpu"),
13      m_gfxdecode(*this, "gfxdecode") { }
13      m_bgram(*this, "bgram") { }
1414
15   int m_pending_command;
15   required_device<cpu_device> m_maincpu;
16   required_device<cpu_device> m_audiocpu;
17   required_device<gfxdecode_device> m_gfxdecode;
18   required_device<vsystem_spr_device> m_spr;
19
1620   required_shared_ptr<UINT16> m_spriteram;
1721   required_shared_ptr<UINT16> m_spriteram2;
1822   required_shared_ptr<UINT16> m_scrollram;
1923   required_shared_ptr<UINT16> m_bgram;
20   required_device<vsystem_spr_device> m_spr;
21
22   UINT32 taotaido_tile_callback( UINT32 code );
24   
25   int m_pending_command;
2326   UINT16 m_sprite_character_bank_select[8];
2427   UINT16 m_video_bank_select[8];
2528   tilemap_t *m_bg_tilemap;
r244617r244618
2730   UINT16 *m_spriteram_older;
2831   UINT16 *m_spriteram2_old;
2932   UINT16 *m_spriteram2_older;
33   
3034   DECLARE_READ16_MEMBER(pending_command_r);
3135   DECLARE_WRITE16_MEMBER(sound_command_w);
3236   DECLARE_WRITE8_MEMBER(pending_command_clear_w);
33   DECLARE_WRITE8_MEMBER(taotaido_sh_bankswitch_w);
34   DECLARE_WRITE16_MEMBER(taotaido_sprite_character_bank_select_w);
35   DECLARE_WRITE16_MEMBER(taotaido_tileregs_w);
36   DECLARE_WRITE16_MEMBER(taotaido_bgvideoram_w);
37   TILE_GET_INFO_MEMBER(taotaido_bg_tile_info);
38   TILEMAP_MAPPER_MEMBER(taotaido_tilemap_scan_rows);
37   DECLARE_WRITE8_MEMBER(sh_bankswitch_w);
38   DECLARE_WRITE16_MEMBER(sprite_character_bank_select_w);
39   DECLARE_WRITE16_MEMBER(tileregs_w);
40   DECLARE_WRITE16_MEMBER(bgvideoram_w);
41   
42   TILE_GET_INFO_MEMBER(bg_tile_info);
43   TILEMAP_MAPPER_MEMBER(tilemap_scan_rows);
44   
45   virtual void machine_start();
3946   virtual void video_start();
40   UINT32 screen_update_taotaido(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
41   void screen_eof_taotaido(screen_device &screen, bool state);
42   DECLARE_WRITE_LINE_MEMBER(irqhandler);
43   required_device<cpu_device> m_maincpu;
44   required_device<cpu_device> m_audiocpu;
45   required_device<gfxdecode_device> m_gfxdecode;
47   
48   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
49   void screen_eof(screen_device &screen, bool state);
50   UINT32 tile_callback( UINT32 code );
4651};
branches/kale/src/mame/video/mosaic.c
r244617r244618
11/***************************************************************************
22
3  video.c
3  mosaic.c
44
55  Functions to emulate the video hardware of the machine.
66
r244617r244618
5656
5757***************************************************************************/
5858
59WRITE8_MEMBER(mosaic_state::mosaic_fgvideoram_w)
59WRITE8_MEMBER(mosaic_state::fgvideoram_w)
6060{
6161   m_fgvideoram[offset] = data;
6262   m_fg_tilemap->mark_tile_dirty(offset / 2);
6363}
6464
65WRITE8_MEMBER(mosaic_state::mosaic_bgvideoram_w)
65WRITE8_MEMBER(mosaic_state::bgvideoram_w)
6666{
6767   m_bgvideoram[offset] = data;
6868   m_bg_tilemap->mark_tile_dirty(offset / 2);
r244617r244618
7070
7171
7272
73UINT32 mosaic_state::screen_update_mosaic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
73UINT32 mosaic_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7474{
7575   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
7676   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
branches/kale/src/mame/video/tagteam.c
r244617r244618
11/***************************************************************************
22
3    video.c
3    tagteam.c
44
55    Functions to emulate the video hardware of the machine.
66
r244617r244618
4242}
4343
4444
45WRITE8_MEMBER(tagteam_state::tagteam_videoram_w)
45WRITE8_MEMBER(tagteam_state::videoram_w)
4646{
4747   m_videoram[offset] = data;
4848   m_bg_tilemap->mark_tile_dirty(offset);
4949}
5050
51WRITE8_MEMBER(tagteam_state::tagteam_colorram_w)
51WRITE8_MEMBER(tagteam_state::colorram_w)
5252{
5353   m_colorram[offset] = data;
5454   m_bg_tilemap->mark_tile_dirty(offset);
5555}
5656
57READ8_MEMBER(tagteam_state::tagteam_mirrorvideoram_r)
57READ8_MEMBER(tagteam_state::mirrorvideoram_r)
5858{
5959   int x,y;
6060
r244617r244618
6666   return m_videoram[offset];
6767}
6868
69READ8_MEMBER(tagteam_state::tagteam_mirrorcolorram_r)
69READ8_MEMBER(tagteam_state::mirrorcolorram_r)
7070{
7171   int x,y;
7272
r244617r244618
7878   return m_colorram[offset];
7979}
8080
81WRITE8_MEMBER(tagteam_state::tagteam_mirrorvideoram_w)
81WRITE8_MEMBER(tagteam_state::mirrorvideoram_w)
8282{
8383   int x,y;
8484
r244617r244618
8787   y = offset % 32;
8888   offset = 32 * y + x;
8989
90   tagteam_videoram_w(space,offset,data);
90   videoram_w(space,offset,data);
9191}
9292
93WRITE8_MEMBER(tagteam_state::tagteam_mirrorcolorram_w)
93WRITE8_MEMBER(tagteam_state::mirrorcolorram_w)
9494{
9595   int x,y;
9696
r244617r244618
9999   y = offset % 32;
100100   offset = 32 * y + x;
101101
102   tagteam_colorram_w(space,offset,data);
102   colorram_w(space,offset,data);
103103}
104104
105WRITE8_MEMBER(tagteam_state::tagteam_control_w)
105WRITE8_MEMBER(tagteam_state::control_w)
106106{
107107   // d0-3: color for blank screen, applies to h/v borders too
108108   // (not implemented yet, and tagteam doesn't have a global screen on/off bit)
r244617r244618
111111   m_palettebank = (data & 0x80) >> 7;
112112}
113113
114WRITE8_MEMBER(tagteam_state::tagteam_flipscreen_w)
114WRITE8_MEMBER(tagteam_state::flipscreen_w)
115115{
116116   // d0: flip screen
117117   if (flip_screen() != (data &0x01))
r244617r244618
137137{
138138   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tagteam_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS_FLIP_X,
139139         8, 8, 32, 32);
140
141   save_item(NAME(m_palettebank));
140142}
141143
142144void tagteam_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
r244617r244618
183185   }
184186}
185187
186UINT32 tagteam_state::screen_update_tagteam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
188UINT32 tagteam_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
187189{
188190   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
189191   draw_sprites(bitmap, cliprect);
branches/kale/src/mame/video/taotaido.c
r244617r244618
1313#include "includes/taotaido.h"
1414
1515/* sprite tile codes 0x4000 - 0x7fff get remapped according to the content of these registers */
16WRITE16_MEMBER(taotaido_state::taotaido_sprite_character_bank_select_w)
16WRITE16_MEMBER(taotaido_state::sprite_character_bank_select_w)
1717{
1818   if(ACCESSING_BITS_8_15)
1919      m_sprite_character_bank_select[offset*2] = data >> 8;
r244617r244618
2727
2828/* the tilemap */
2929
30WRITE16_MEMBER(taotaido_state::taotaido_tileregs_w)
30WRITE16_MEMBER(taotaido_state::tileregs_w)
3131{
3232   switch (offset)
3333   {
r244617r244618
5252   }
5353}
5454
55WRITE16_MEMBER(taotaido_state::taotaido_bgvideoram_w)
55WRITE16_MEMBER(taotaido_state::bgvideoram_w)
5656{
5757   COMBINE_DATA(&m_bgram[offset]);
5858   m_bg_tilemap->mark_tile_dirty(offset);
5959}
6060
61TILE_GET_INFO_MEMBER(taotaido_state::taotaido_bg_tile_info)
61TILE_GET_INFO_MEMBER(taotaido_state::bg_tile_info)
6262{
6363   int code = m_bgram[tile_index]&0x01ff;
6464   int bank = (m_bgram[tile_index]&0x0e00)>>9;
r244617r244618
7272         0);
7373}
7474
75TILEMAP_MAPPER_MEMBER(taotaido_state::taotaido_tilemap_scan_rows)
75TILEMAP_MAPPER_MEMBER(taotaido_state::tilemap_scan_rows)
7676{
7777   /* logical (col,row) -> memory offset */
7878   return row*0x40 + (col&0x3f) + ((col&0x40)<<6);
7979}
8080
8181
82UINT32 taotaido_state::taotaido_tile_callback( UINT32 code )
82UINT32 taotaido_state::tile_callback( UINT32 code )
8383{
8484   code = m_spriteram2_older[code&0x7fff];
8585
r244617r244618
9696
9797void taotaido_state::video_start()
9898{
99   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(taotaido_state::taotaido_bg_tile_info),this),tilemap_mapper_delegate(FUNC(taotaido_state::taotaido_tilemap_scan_rows),this),16,16,128,64);
99   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(taotaido_state::bg_tile_info),this),tilemap_mapper_delegate(FUNC(taotaido_state::tilemap_scan_rows),this),16,16,128,64);
100100
101101   m_spriteram_old = auto_alloc_array(machine(), UINT16, 0x2000/2);
102102   m_spriteram_older = auto_alloc_array(machine(), UINT16, 0x2000/2);
r244617r244618
104104   m_spriteram2_old = auto_alloc_array(machine(), UINT16, 0x10000/2);
105105   m_spriteram2_older = auto_alloc_array(machine(), UINT16, 0x10000/2);
106106
107   save_item(NAME(m_sprite_character_bank_select));
108   save_item(NAME(m_video_bank_select));
107109}
108110
109111
110UINT32 taotaido_state::screen_update_taotaido(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
112UINT32 taotaido_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
111113{
112114//  m_bg_tilemap->set_scrollx(0,(m_scrollram[0x380/2]>>4)); // the values put here end up being wrong every other frame
113115//  m_bg_tilemap->set_scrolly(0,(m_scrollram[0x382/2]>>4)); // the values put here end up being wrong every other frame
r244617r244618
133135   return 0;
134136}
135137
136void taotaido_state::screen_eof_taotaido(screen_device &screen, bool state)
138void taotaido_state::screen_eof(screen_device &screen, bool state)
137139{
138140   // rising edge
139141   if (state)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team