Previous 199869 Revisions Next

r35172 Saturday 21st February, 2015 at 08:46:10 UTC by Miodrag Milanović
Merge pull request #140 from cuavas/master

Version info for OSX binaries
[src/mame/drivers]tecmosys.c tehkanwc.c
[src/mame/includes]tecmosys.h tehkanwc.h
[src/mame/machine]tecmosys.c
[src/mame/video]tecmosys.c tehkanwc.c

trunk/src/mame/drivers/tecmosys.c
r243683r243684
309309   AM_RANGE(0xa00000, 0xa00001) AM_WRITE(eeprom_w  )
310310   AM_RANGE(0xa80000, 0xa80005) AM_WRITEONLY AM_SHARE("a80000regs")    // a80000-3 scroll? a80004 inverted ? 3 : 0
311311   AM_RANGE(0xb00000, 0xb00005) AM_WRITEONLY AM_SHARE("b00000regs")    // b00000-3 scrool?, b00004 inverted ? 3 : 0
312   AM_RANGE(0xb80000, 0xb80001) AM_READWRITE(tecmosys_prot_status_r, tecmosys_prot_status_w)
312   AM_RANGE(0xb80000, 0xb80001) AM_READWRITE(prot_status_r, prot_status_w)
313313   AM_RANGE(0xc00000, 0xc00005) AM_WRITEONLY AM_SHARE("c00000regs")    // c00000-3 scroll? c00004 inverted ? 13 : 10
314314   AM_RANGE(0xc80000, 0xc80005) AM_WRITEONLY AM_SHARE("c80000regs")    // c80000-3 scrool? c80004 inverted ? 3 : 0
315315   AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("P1")
316316   AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("P2")
317317   AM_RANGE(0xd80000, 0xd80001) AM_READ(eeprom_r)
318318   AM_RANGE(0xe00000, 0xe00001) AM_WRITE(sound_w )
319   AM_RANGE(0xe80000, 0xe80001) AM_WRITE(tecmosys_prot_data_w)
319   AM_RANGE(0xe80000, 0xe80001) AM_WRITE(prot_data_w)
320320   AM_RANGE(0xf00000, 0xf00001) AM_READ(sound_r)
321   AM_RANGE(0xf80000, 0xf80001) AM_READ(tecmosys_prot_data_r)
321   AM_RANGE(0xf80000, 0xf80001) AM_READ(prot_data_r)
322322ADDRESS_MAP_END
323323
324324
325WRITE8_MEMBER(tecmosys_state::tecmosys_z80_bank_w)
325WRITE8_MEMBER(tecmosys_state::z80_bank_w)
326326{
327327   membank("bank1")->set_entry(data);
328328}
329329
330WRITE8_MEMBER(tecmosys_state::tecmosys_oki_bank_w)
330WRITE8_MEMBER(tecmosys_state::oki_bank_w)
331331{
332332   UINT8 upperbank = (data & 0x30) >> 4;
333333   UINT8 lowerbank = (data & 0x03) >> 0;
r243683r243684
347347   ADDRESS_MAP_GLOBAL_MASK(0xff)
348348   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymf", ymf262_device, read, write)
349349   AM_RANGE(0x10, 0x10) AM_DEVREADWRITE("oki", okim6295_device, read, write)
350   AM_RANGE(0x20, 0x20) AM_WRITE(tecmosys_oki_bank_w)
351   AM_RANGE(0x30, 0x30) AM_WRITE(tecmosys_z80_bank_w)
350   AM_RANGE(0x20, 0x20) AM_WRITE(oki_bank_w)
351   AM_RANGE(0x30, 0x30) AM_WRITE(z80_bank_w)
352352   AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r)
353353   AM_RANGE(0x50, 0x50) AM_WRITE(soundlatch2_byte_w)
354354   AM_RANGE(0x60, 0x61) AM_DEVREADWRITE("ymz", ymz280b_device, read, write)
r243683r243684
441441void tecmosys_state::machine_start()
442442{
443443   membank("bank1")->configure_entries(0, 16, memregion("audiocpu")->base(), 0x4000);
444   
445   save_item(NAME(m_device_read_ptr));
446   save_item(NAME(m_device_status));
447   save_item(NAME(m_device_value));
444448}
445449
446450static MACHINE_CONFIG_START( deroon, tecmosys_state )
r243683r243684
465469   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3000))
466470   MCFG_SCREEN_SIZE(64*8, 64*8)
467471   MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
468   MCFG_SCREEN_UPDATE_DRIVER(tecmosys_state, screen_update_tecmosys)
472   MCFG_SCREEN_UPDATE_DRIVER(tecmosys_state, screen_update)
469473
470474   MCFG_PALETTE_ADD("palette", 0x4000+0x800)
471475   MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
r243683r243684
620624   ROM_LOAD( "ae500w07.ad1", 0x080000, 0x080000, CRC(3734f92c) SHA1(048555b5aa89eaf983305c439ba08d32b4a1bb80) )
621625ROM_END
622626
623void tecmosys_state::tecmosys_descramble()
627void tecmosys_state::descramble()
624628{
625629   UINT8 *gfxsrc  = memregion( "gfx1" )->base();
626630   size_t srcsize = memregion( "gfx1" )->bytes();
r243683r243684
644648
645649DRIVER_INIT_MEMBER(tecmosys_state,deroon)
646650{
647   tecmosys_descramble();
648   tecmosys_prot_init(0); // machine/tecmosys.c
651   descramble();
652   prot_init(0); // machine/tecmosys.c
649653}
650654
651655DRIVER_INIT_MEMBER(tecmosys_state,tkdensho)
652656{
653   tecmosys_descramble();
654   tecmosys_prot_init(1);
657   descramble();
658   prot_init(1);
655659}
656660
657661DRIVER_INIT_MEMBER(tecmosys_state,tkdensha)
658662{
659   tecmosys_descramble();
660   tecmosys_prot_init(2);
663   descramble();
664   prot_init(2);
661665}
662666
663GAME( 1995, deroon,           0, deroon, deroon, tecmosys_state, deroon,     ROT0, "Tecmo", "Deroon DeroDero", 0 )
664GAME( 1996, tkdensho,         0, deroon, deroon, tecmosys_state, tkdensho,   ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960614)", 0 )
665GAME( 1996, tkdenshoa, tkdensho, deroon, deroon, tecmosys_state, tkdensha,   ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960427)", 0 )
667GAME( 1995, deroon,           0, deroon, deroon, tecmosys_state, deroon,     ROT0, "Tecmo", "Deroon DeroDero", GAME_SUPPORTS_SAVE )
668GAME( 1996, tkdensho,         0, deroon, deroon, tecmosys_state, tkdensho,   ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960614)", GAME_SUPPORTS_SAVE )
669GAME( 1996, tkdenshoa, tkdensho, deroon, deroon, tecmosys_state, tkdensha,   ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960427)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/tehkanwc.c
r243683r243684
9191#include "emu.h"
9292#include "cpu/z80/z80.h"
9393#include "sound/ay8910.h"
94#include "sound/msm5205.h"
9594#include "gridiron.lh"
9695#include "includes/tehkanwc.h"
9796
97
98void tehkanwc_state::machine_start()
99{
100   save_item(NAME(m_track0));
101   save_item(NAME(m_track1));
102   save_item(NAME(m_msm_data_offs));
103   save_item(NAME(m_toggle));
104}
105
98106WRITE8_MEMBER(tehkanwc_state::sub_cpu_halt_w)
99107{
100108   if (data)
r243683r243684
104112}
105113
106114
107READ8_MEMBER(tehkanwc_state::tehkanwc_track_0_r)
115READ8_MEMBER(tehkanwc_state::track_0_r)
108116{
109117   int joy;
110118
r243683r243684
114122   return ioport(offset ? "P1Y" : "P1X")->read() - m_track0[offset];
115123}
116124
117READ8_MEMBER(tehkanwc_state::tehkanwc_track_1_r)
125READ8_MEMBER(tehkanwc_state::track_1_r)
118126{
119127   int joy;
120128
r243683r243684
124132   return ioport(offset ? "P2Y" : "P2X")->read() - m_track1[offset];
125133}
126134
127WRITE8_MEMBER(tehkanwc_state::tehkanwc_track_0_reset_w)
135WRITE8_MEMBER(tehkanwc_state::track_0_reset_w)
128136{
129137   /* reset the trackball counters */
130138   m_track0[offset] = ioport(offset ? "P1Y" : "P1X")->read() + data;
131139}
132140
133WRITE8_MEMBER(tehkanwc_state::tehkanwc_track_1_reset_w)
141WRITE8_MEMBER(tehkanwc_state::track_1_reset_w)
134142{
135143   /* reset the trackball counters */
136144   m_track1[offset] = ioport(offset ? "P2Y" : "P2X")->read() + data;
r243683r243684
169177/* Emulate MSM sound samples with counters */
170178
171179
172READ8_MEMBER(tehkanwc_state::tehkanwc_portA_r)
180READ8_MEMBER(tehkanwc_state::portA_r)
173181{
174182   return m_msm_data_offs & 0xff;
175183}
176184
177READ8_MEMBER(tehkanwc_state::tehkanwc_portB_r)
185READ8_MEMBER(tehkanwc_state::portB_r)
178186{
179187   return (m_msm_data_offs >> 8) & 0xff;
180188}
181189
182WRITE8_MEMBER(tehkanwc_state::tehkanwc_portA_w)
190WRITE8_MEMBER(tehkanwc_state::portA_w)
183191{
184192   m_msm_data_offs = (m_msm_data_offs & 0xff00) | data;
185193}
186194
187WRITE8_MEMBER(tehkanwc_state::tehkanwc_portB_w)
195WRITE8_MEMBER(tehkanwc_state::portB_w)
188196{
189197   m_msm_data_offs = (m_msm_data_offs & 0x00ff) | (data << 8);
190198}
r243683r243684
194202   m_msm->reset_w(data ? 0 : 1);
195203}
196204
197WRITE_LINE_MEMBER(tehkanwc_state::tehkanwc_adpcm_int)
205WRITE_LINE_MEMBER(tehkanwc_state::adpcm_int)
198206{
199207   UINT8 *SAMPLES = memregion("adpcm")->base();
200208   int msm_data = SAMPLES[m_msm_data_offs & 0x7fff];
r243683r243684
218226   AM_RANGE(0x0000, 0xbfff) AM_ROM
219227   AM_RANGE(0xc000, 0xc7ff) AM_RAM
220228   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1")
221   AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(tehkanwc_videoram_w) AM_SHARE("videoram")
222   AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(tehkanwc_colorram_w) AM_SHARE("colorram")
229   AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
230   AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
223231   AM_RANGE(0xd800, 0xddff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
224232   AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("share5") /* unused part of the palette RAM, I think? Gridiron uses it */
225   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(tehkanwc_videoram2_w) AM_SHARE("videoram2")
233   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
226234   AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("spriteram") /* sprites */
227   AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(tehkanwc_scroll_x_w)
228   AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(tehkanwc_scroll_y_w)
229   AM_RANGE(0xf800, 0xf801) AM_READWRITE(tehkanwc_track_0_r, tehkanwc_track_0_reset_w) /* track 0 x/y */
235   AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(scroll_x_w)
236   AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(scroll_y_w)
237   AM_RANGE(0xf800, 0xf801) AM_READWRITE(track_0_r, track_0_reset_w) /* track 0 x/y */
230238   AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM") AM_WRITE(gridiron_led0_w)
231239   AM_RANGE(0xf803, 0xf803) AM_READ_PORT("P1BUT")
232240   AM_RANGE(0xf806, 0xf806) AM_READ_PORT("SYSTEM")
233   AM_RANGE(0xf810, 0xf811) AM_READWRITE(tehkanwc_track_1_r, tehkanwc_track_1_reset_w) /* track 1 x/y */
241   AM_RANGE(0xf810, 0xf811) AM_READWRITE(track_1_r, track_1_reset_w) /* track 1 x/y */
234242   AM_RANGE(0xf812, 0xf812) AM_WRITE(gridiron_led1_w)
235243   AM_RANGE(0xf813, 0xf813) AM_READ_PORT("P2BUT")
236244   AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_byte_r) AM_WRITE(sound_command_w)  /* answer from the sound CPU */
237245   AM_RANGE(0xf840, 0xf840) AM_READ_PORT("DSW1") AM_WRITE(sub_cpu_halt_w)
238246   AM_RANGE(0xf850, 0xf850) AM_READ_PORT("DSW2") AM_WRITENOP           /* ?? writes 0x00 or 0xff */
239   AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r) AM_WRITE(tehkanwc_flipscreen_x_w)
240   AM_RANGE(0xf870, 0xf870) AM_READ_PORT("DSW3") AM_WRITE(tehkanwc_flipscreen_y_w)
247   AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r) AM_WRITE(flipscreen_x_w)
248   AM_RANGE(0xf870, 0xf870) AM_READ_PORT("DSW3") AM_WRITE(flipscreen_y_w)
241249ADDRESS_MAP_END
242250
243251static ADDRESS_MAP_START( sub_mem, AS_PROGRAM, 8, tehkanwc_state )
244252   AM_RANGE(0x0000, 0x7fff) AM_ROM
245253   AM_RANGE(0x8000, 0xc7ff) AM_RAM
246254   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1")
247   AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(tehkanwc_videoram_w) AM_SHARE("videoram")
248   AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(tehkanwc_colorram_w) AM_SHARE("colorram")
255   AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
256   AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
249257   AM_RANGE(0xd800, 0xddff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
250258   AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("share5") /* unused part of the palette RAM, I think? Gridiron uses it */
251   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(tehkanwc_videoram2_w) AM_SHARE("videoram2")
259   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
252260   AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("spriteram") /* sprites */
253   AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(tehkanwc_scroll_x_w)
254   AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(tehkanwc_scroll_y_w)
261   AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(scroll_x_w)
262   AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(scroll_y_w)
255263   AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r)
256264ADDRESS_MAP_END
257265
r243683r243684
638646   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
639647   MCFG_SCREEN_SIZE(32*8, 32*8)
640648   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
641   MCFG_SCREEN_UPDATE_DRIVER(tehkanwc_state, screen_update_tehkanwc)
649   MCFG_SCREEN_UPDATE_DRIVER(tehkanwc_state, screen_update)
642650   MCFG_SCREEN_PALETTE("palette")
643651
644652   MCFG_GFXDECODE_ADD("gfxdecode", "palette", tehkanwc)
r243683r243684
650658   MCFG_SPEAKER_STANDARD_MONO("mono")
651659
652660   MCFG_SOUND_ADD("ay1", AY8910, 1536000)
653   MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(tehkanwc_state, tehkanwc_portA_w))
654   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(tehkanwc_state, tehkanwc_portB_w))
661   MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(tehkanwc_state, portA_w))
662   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(tehkanwc_state, portB_w))
655663   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
656664
657665   MCFG_SOUND_ADD("ay2", AY8910, 1536000)
658   MCFG_AY8910_PORT_A_READ_CB(READ8(tehkanwc_state, tehkanwc_portA_r))
659   MCFG_AY8910_PORT_B_READ_CB(READ8(tehkanwc_state, tehkanwc_portB_r))
666   MCFG_AY8910_PORT_A_READ_CB(READ8(tehkanwc_state, portA_r))
667   MCFG_AY8910_PORT_B_READ_CB(READ8(tehkanwc_state, portB_r))
660668   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
661669
662670   MCFG_SOUND_ADD("msm", MSM5205, 384000)
663   MCFG_MSM5205_VCLK_CB(WRITELINE(tehkanwc_state, tehkanwc_adpcm_int)) /* interrupt function */
671   MCFG_MSM5205_VCLK_CB(WRITELINE(tehkanwc_state, adpcm_int)) /* interrupt function */
664672   MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B)      /* 8KHz               */
665673   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
666674MACHINE_CONFIG_END
r243683r243684
882890
883891
884892
885GAME( 1985, tehkanwc,  0,        tehkanwc, tehkanwc, driver_device, 0,        ROT0,  "Tehkan", "Tehkan World Cup (set 1)", 0 )
886GAME( 1985, tehkanwcb, tehkanwc, tehkanwc, tehkanwc, driver_device, 0,        ROT0,  "Tehkan", "Tehkan World Cup (set 2, bootleg?)", 0 )
887GAME( 1985, tehkanwcc, tehkanwc, tehkanwc, tehkanwc, driver_device, 0,        ROT0,  "bootleg", "Tehkan World Cup (set 3, bootleg)", GAME_NOT_WORKING ) // aka 'World Cup 85', different inputs?
888GAMEL(1985, gridiron,  0,        tehkanwc, gridiron, driver_device, 0,        ROT0,  "Tehkan", "Gridiron Fight", 0, layout_gridiron )
889GAME( 1986, teedoff,   0,        tehkanwc, teedoff, tehkanwc_state,  teedoff,  ROT90, "Tecmo", "Tee'd Off (Japan)", 0 )
893GAME( 1985, tehkanwc,  0,        tehkanwc, tehkanwc, driver_device, 0,        ROT0,  "Tehkan", "Tehkan World Cup (set 1)", GAME_SUPPORTS_SAVE )
894GAME( 1985, tehkanwcb, tehkanwc, tehkanwc, tehkanwc, driver_device, 0,        ROT0,  "Tehkan", "Tehkan World Cup (set 2, bootleg?)", GAME_SUPPORTS_SAVE )
895GAME( 1985, tehkanwcc, tehkanwc, tehkanwc, tehkanwc, driver_device, 0,        ROT0,  "bootleg", "Tehkan World Cup (set 3, bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // aka 'World Cup 85', different inputs?
896GAMEL(1985, gridiron,  0,        tehkanwc, gridiron, driver_device, 0,        ROT0,  "Tehkan", "Gridiron Fight", GAME_SUPPORTS_SAVE, layout_gridiron )
897GAME( 1986, teedoff,   0,        tehkanwc, teedoff, tehkanwc_state,  teedoff,  ROT90, "Tecmo", "Tee'd Off (Japan)", GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/tecmosys.h
r243683r243684
1010public:
1111   tecmosys_state(const machine_config &mconfig, device_type type, const char *tag)
1212      : driver_device(mconfig, type, tag),
13      m_maincpu(*this, "maincpu"),
14      m_audiocpu(*this, "audiocpu"),
15      m_eeprom(*this, "eeprom"),
16      m_gfxdecode(*this, "gfxdecode"),
17      m_screen(*this, "screen"),
18      m_palette(*this, "palette"),
1319      m_spriteram(*this, "spriteram"),
1420      m_tilemap_paletteram16(*this, "tmap_palette"),
1521      m_bg2tilemap_ram(*this, "bg2tilemap_ram"),
r243683r243684
2329      m_b00000regs(*this, "b00000regs"),
2430      m_c00000regs(*this, "c00000regs"),
2531      m_c80000regs(*this, "c80000regs"),
26      m_880000regs(*this, "880000regs"),
27      m_maincpu(*this, "maincpu"),
28      m_audiocpu(*this, "audiocpu"),
29      m_eeprom(*this, "eeprom"),
30      m_gfxdecode(*this, "gfxdecode"),
31      m_screen(*this, "screen"),
32      m_palette(*this, "palette") { }
32      m_880000regs(*this, "880000regs") { }
3333
34   required_device<cpu_device> m_maincpu;
35   required_device<cpu_device> m_audiocpu;
36   required_device<eeprom_serial_93cxx_device> m_eeprom;
37   required_device<gfxdecode_device> m_gfxdecode;
38   required_device<screen_device> m_screen;
39   required_device<palette_device> m_palette;
40
3441   required_shared_ptr<UINT16> m_spriteram;
3542   required_shared_ptr<UINT16> m_tilemap_paletteram16;
3643   required_shared_ptr<UINT16> m_bg2tilemap_ram;
r243683r243684
4552   required_shared_ptr<UINT16> m_c00000regs;
4653   required_shared_ptr<UINT16> m_c80000regs;
4754   required_shared_ptr<UINT16> m_880000regs;
55   
4856   int m_spritelist;
4957   bitmap_ind16 m_sprite_bitmap;
5058   bitmap_ind16 m_tmp_tilemap_composebitmap;
r243683r243684
5765   UINT8 m_device_status;
5866   const struct prot_data* m_device_data;
5967   UINT8 m_device_value;
68   
6069   DECLARE_READ16_MEMBER(sound_r);
6170   DECLARE_WRITE16_MEMBER(sound_w);
6271   DECLARE_WRITE16_MEMBER(unk880000_w);
6372   DECLARE_READ16_MEMBER(unk880000_r);
64   DECLARE_WRITE8_MEMBER(tecmosys_z80_bank_w);
65   DECLARE_WRITE8_MEMBER(tecmosys_oki_bank_w);
66   DECLARE_READ16_MEMBER(tecmosys_prot_status_r);
67   DECLARE_WRITE16_MEMBER(tecmosys_prot_status_w);
68   DECLARE_READ16_MEMBER(tecmosys_prot_data_r);
69   DECLARE_WRITE16_MEMBER(tecmosys_prot_data_w);
73   DECLARE_WRITE8_MEMBER(z80_bank_w);
74   DECLARE_WRITE8_MEMBER(oki_bank_w);
75   DECLARE_READ16_MEMBER(prot_status_r);
76   DECLARE_WRITE16_MEMBER(prot_status_w);
77   DECLARE_READ16_MEMBER(prot_data_r);
78   DECLARE_WRITE16_MEMBER(prot_data_w);
7079   DECLARE_WRITE16_MEMBER(bg0_tilemap_w);
7180   DECLARE_WRITE16_MEMBER(bg1_tilemap_w);
7281   DECLARE_WRITE16_MEMBER(bg2_tilemap_w);
r243683r243684
7786   DECLARE_WRITE16_MEMBER(bg2_tilemap_lineram_w);
7887   DECLARE_READ16_MEMBER(eeprom_r);
7988   DECLARE_WRITE16_MEMBER(eeprom_w);
89   DECLARE_WRITE_LINE_MEMBER(sound_irq);
90   
8091   DECLARE_DRIVER_INIT(tkdensha);
8192   DECLARE_DRIVER_INIT(deroon);
8293   DECLARE_DRIVER_INIT(tkdensho);
94   virtual void machine_start();
95   virtual void video_start();
96   
8397   TILE_GET_INFO_MEMBER(get_bg0tile_info);
8498   TILE_GET_INFO_MEMBER(get_bg1tile_info);
8599   TILE_GET_INFO_MEMBER(get_bg2tile_info);
86100   TILE_GET_INFO_MEMBER(get_fg_tile_info);
87   virtual void machine_start();
88   virtual void video_start();
89   UINT32 screen_update_tecmosys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
90   void tecmosys_prot_init(int which);
91   void tecmosys_prot_reset();
92   inline void set_color_555_tecmo(pen_t color, int rshift, int gshift, int bshift, UINT16 data);
93   void tecmosys_render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray );
94   void tecmosys_tilemap_copy_to_compose(UINT16 pri);
95   void tecmosys_do_final_mix(bitmap_rgb32 &bitmap);
96   void tecmosys_descramble();
97   DECLARE_WRITE_LINE_MEMBER(sound_irq);
98   required_device<cpu_device> m_maincpu;
99   required_device<cpu_device> m_audiocpu;
100   required_device<eeprom_serial_93cxx_device> m_eeprom;
101   required_device<gfxdecode_device> m_gfxdecode;
102   required_device<screen_device> m_screen;
103   required_device<palette_device> m_palette;
101
102   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
103   void prot_init(int which);
104   void prot_reset();
105   inline void set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT16 data);
106   void render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray );
107   void tilemap_copy_to_compose(UINT16 pri);
108   void do_final_mix(bitmap_rgb32 &bitmap);
109   void descramble();
104110};
trunk/src/mame/includes/tehkanwc.h
r243683r243684
1010
1111   tehkanwc_state(const machine_config &mconfig, device_type type, const char *tag)
1212      : driver_device(mconfig, type, tag),
13      m_videoram(*this, "videoram"),
14      m_colorram(*this, "colorram"),
15      m_videoram2(*this, "videoram2"),
16      m_spriteram(*this, "spriteram"),
1713      m_maincpu(*this, "maincpu"),
1814      m_audiocpu(*this, "audiocpu"),
1915      m_subcpu(*this, "sub"),
2016      m_msm(*this, "msm"),
2117      m_gfxdecode(*this, "gfxdecode"),
22      m_palette(*this, "palette") { }
18      m_palette(*this, "palette"),
19      m_videoram(*this, "videoram"),
20      m_colorram(*this, "colorram"),
21      m_videoram2(*this, "videoram2"),
22      m_spriteram(*this, "spriteram") { }
2323
24   required_device<cpu_device> m_maincpu;
25   required_device<cpu_device> m_audiocpu;
26   required_device<cpu_device> m_subcpu;
27   required_device<msm5205_device> m_msm;
28   required_device<gfxdecode_device> m_gfxdecode;
29   required_device<palette_device> m_palette;
30
31   required_shared_ptr<UINT8> m_videoram;
32   required_shared_ptr<UINT8> m_colorram;
33   required_shared_ptr<UINT8> m_videoram2;
34   required_shared_ptr<UINT8> m_spriteram;
35   
2436   int m_track0[2];
2537   int m_track1[2];
2638   int m_msm_data_offs;
2739   int m_toggle;
28   required_shared_ptr<UINT8> m_videoram;
29   required_shared_ptr<UINT8> m_colorram;
30   required_shared_ptr<UINT8> m_videoram2;
3140   UINT8 m_scroll_x[2];
3241   UINT8 m_led0;
3342   UINT8 m_led1;
3443   tilemap_t *m_bg_tilemap;
3544   tilemap_t *m_fg_tilemap;
36   required_shared_ptr<UINT8> m_spriteram;
45   
3746   DECLARE_WRITE8_MEMBER(sub_cpu_halt_w);
38   DECLARE_READ8_MEMBER(tehkanwc_track_0_r);
39   DECLARE_READ8_MEMBER(tehkanwc_track_1_r);
40   DECLARE_WRITE8_MEMBER(tehkanwc_track_0_reset_w);
41   DECLARE_WRITE8_MEMBER(tehkanwc_track_1_reset_w);
47   DECLARE_READ8_MEMBER(track_0_r);
48   DECLARE_READ8_MEMBER(track_1_r);
49   DECLARE_WRITE8_MEMBER(track_0_reset_w);
50   DECLARE_WRITE8_MEMBER(track_1_reset_w);
4251   DECLARE_WRITE8_MEMBER(sound_command_w);
4352   DECLARE_WRITE8_MEMBER(sound_answer_w);
44   DECLARE_WRITE8_MEMBER(tehkanwc_videoram_w);
45   DECLARE_WRITE8_MEMBER(tehkanwc_colorram_w);
46   DECLARE_WRITE8_MEMBER(tehkanwc_videoram2_w);
47   DECLARE_WRITE8_MEMBER(tehkanwc_scroll_x_w);
48   DECLARE_WRITE8_MEMBER(tehkanwc_scroll_y_w);
49   DECLARE_WRITE8_MEMBER(tehkanwc_flipscreen_x_w);
50   DECLARE_WRITE8_MEMBER(tehkanwc_flipscreen_y_w);
53   DECLARE_WRITE8_MEMBER(videoram_w);
54   DECLARE_WRITE8_MEMBER(colorram_w);
55   DECLARE_WRITE8_MEMBER(videoram2_w);
56   DECLARE_WRITE8_MEMBER(scroll_x_w);
57   DECLARE_WRITE8_MEMBER(scroll_y_w);
58   DECLARE_WRITE8_MEMBER(flipscreen_x_w);
59   DECLARE_WRITE8_MEMBER(flipscreen_y_w);
5160   DECLARE_WRITE8_MEMBER(gridiron_led0_w);
5261   DECLARE_WRITE8_MEMBER(gridiron_led1_w);
53   DECLARE_READ8_MEMBER(tehkanwc_portA_r);
54   DECLARE_READ8_MEMBER(tehkanwc_portB_r);
55   DECLARE_WRITE8_MEMBER(tehkanwc_portA_w);
56   DECLARE_WRITE8_MEMBER(tehkanwc_portB_w);
62   DECLARE_READ8_MEMBER(portA_r);
63   DECLARE_READ8_MEMBER(portB_r);
64   DECLARE_WRITE8_MEMBER(portA_w);
65   DECLARE_WRITE8_MEMBER(portB_w);
5766   DECLARE_WRITE8_MEMBER(msm_reset_w);
58   DECLARE_DRIVER_INIT(teedoff);
67   DECLARE_WRITE_LINE_MEMBER(adpcm_int);
68
5969   TILE_GET_INFO_MEMBER(get_bg_tile_info);
6070   TILE_GET_INFO_MEMBER(get_fg_tile_info);
71
72   DECLARE_DRIVER_INIT(teedoff);
73   virtual void machine_start();
6174   virtual void video_start();
62   UINT32 screen_update_tehkanwc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
63   void gridiron_draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player);
75   
76   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
77   void draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player);
6478   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
65   DECLARE_WRITE_LINE_MEMBER(tehkanwc_adpcm_int);
66   required_device<cpu_device> m_maincpu;
67   required_device<cpu_device> m_audiocpu;
68   required_device<cpu_device> m_subcpu;
69   required_device<msm5205_device> m_msm;
70   required_device<gfxdecode_device> m_gfxdecode;
71   required_device<palette_device> m_palette;
79
7280protected:
7381   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7482};
trunk/src/mame/machine/tecmosys.c
r243683r243684
103103};
104104
105105
106void tecmosys_state::tecmosys_prot_reset()
106void tecmosys_state::prot_reset()
107107{
108108   m_device_read_ptr = 0;
109109   m_device_status = DS_IDLE;
110110   m_device_value = 0xff;
111111}
112112
113void tecmosys_state::tecmosys_prot_init(int which)
113void tecmosys_state::prot_init(int which)
114114{
115115   switch (which)
116116   {
r243683r243684
119119   case 2: m_device_data = &tkdensha_data; break;
120120   }
121121
122   machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(tecmosys_state::tecmosys_prot_reset),this));
122   machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(tecmosys_state::prot_reset),this));
123123}
124124
125READ16_MEMBER(tecmosys_state::tecmosys_prot_status_r)
125READ16_MEMBER(tecmosys_state::prot_status_r)
126126{
127127   if (ACCESSING_BITS_8_15)
128128   {
r243683r243684
134134   return 0xc0; // simulation is always ready
135135}
136136
137WRITE16_MEMBER(tecmosys_state::tecmosys_prot_status_w)
137WRITE16_MEMBER(tecmosys_state::prot_status_w)
138138{
139139   // deroon clears the status in one place.
140140}
141141
142142
143READ16_MEMBER(tecmosys_state::tecmosys_prot_data_r)
143READ16_MEMBER(tecmosys_state::prot_data_r)
144144{
145145   // prot appears to be read-ready for two consecutive reads
146146   // but returns 0xff for subsequent reads.
r243683r243684
151151}
152152
153153
154WRITE16_MEMBER(tecmosys_state::tecmosys_prot_data_w)
154WRITE16_MEMBER(tecmosys_state::prot_data_w)
155155{
156156   // Only LSB
157157   data >>= 8;
trunk/src/mame/video/tecmosys.c
r243683r243684
6666}
6767
6868
69inline void tecmosys_state::set_color_555_tecmo(pen_t color, int rshift, int gshift, int bshift, UINT16 data)
69inline void tecmosys_state::set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT16 data)
7070{
7171   m_palette->set_pen_color(color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift));
7272}
r243683r243684
7474WRITE16_MEMBER(tecmosys_state::tilemap_paletteram16_xGGGGGRRRRRBBBBB_word_w)
7575{
7676   COMBINE_DATA(&m_tilemap_paletteram16[offset]);
77   set_color_555_tecmo(offset+0x4000, 5, 10, 0, m_tilemap_paletteram16[offset]);
77   set_color_555(offset+0x4000, 5, 10, 0, m_tilemap_paletteram16[offset]);
7878}
7979
8080WRITE16_MEMBER(tecmosys_state::bg0_tilemap_lineram_w)
r243683r243684
9797
9898
9999
100void tecmosys_state::tecmosys_render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray )
100void tecmosys_state::render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray )
101101{
102102   UINT8 *gfxsrc    = memregion       ( "gfx1" )->base();
103103   int i;
r243683r243684
188188   }
189189}
190190
191void tecmosys_state::tecmosys_tilemap_copy_to_compose(UINT16 pri)
191void tecmosys_state::tilemap_copy_to_compose(UINT16 pri)
192192{
193193   int y,x;
194194   UINT16 *srcptr;
r243683r243684
205205   }
206206}
207207
208void tecmosys_state::tecmosys_do_final_mix(bitmap_rgb32 &bitmap)
208void tecmosys_state::do_final_mix(bitmap_rgb32 &bitmap)
209209{
210210   const pen_t *paldata = m_palette->pens();
211211   int y,x;
r243683r243684
275275}
276276
277277
278UINT32 tecmosys_state::screen_update_tecmosys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
278UINT32 tecmosys_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
279279{
280280   bitmap.fill(m_palette->pen(0x4000), cliprect);
281281
r243683r243684
293293
294294   m_tmp_tilemap_renderbitmap.fill(0, cliprect);
295295   m_bg0tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0);
296   tecmosys_tilemap_copy_to_compose(0x0000);
296   tilemap_copy_to_compose(0x0000);
297297
298298   m_tmp_tilemap_renderbitmap.fill(0, cliprect);
299299   m_bg1tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0);
300   tecmosys_tilemap_copy_to_compose(0x4000);
300   tilemap_copy_to_compose(0x4000);
301301
302302   m_tmp_tilemap_renderbitmap.fill(0, cliprect);
303303   m_bg2tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0);
304   tecmosys_tilemap_copy_to_compose(0x8000);
304   tilemap_copy_to_compose(0x8000);
305305
306306   m_tmp_tilemap_renderbitmap.fill(0, cliprect);
307307   m_txt_tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0);
308   tecmosys_tilemap_copy_to_compose(0xc000);
308   tilemap_copy_to_compose(0xc000);
309309
310310
311   tecmosys_do_final_mix(bitmap);
311   do_final_mix(bitmap);
312312
313313   // prepare sprites for NEXT frame - causes 1 frame palette errors, but prevents sprite lag in tkdensho, which is correct?
314   tecmosys_render_sprites_to_bitmap(bitmap, m_880000regs[0x0], m_880000regs[0x1]);
314   render_sprites_to_bitmap(bitmap, m_880000regs[0x0], m_880000regs[0x1]);
315315
316316   return 0;
317317}
r243683r243684
339339
340340   m_bg2tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg2tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
341341   m_bg2tilemap->set_transparent_pen(0);
342   
343   save_item(NAME(m_spritelist));
342344}
trunk/src/mame/video/tehkanwc.c
r243683r243684
1515#include "includes/tehkanwc.h"
1616
1717
18WRITE8_MEMBER(tehkanwc_state::tehkanwc_videoram_w)
18WRITE8_MEMBER(tehkanwc_state::videoram_w)
1919{
2020   m_videoram[offset] = data;
2121   m_fg_tilemap->mark_tile_dirty(offset);
2222}
2323
24WRITE8_MEMBER(tehkanwc_state::tehkanwc_colorram_w)
24WRITE8_MEMBER(tehkanwc_state::colorram_w)
2525{
2626   m_colorram[offset] = data;
2727   m_fg_tilemap->mark_tile_dirty(offset);
2828}
2929
30WRITE8_MEMBER(tehkanwc_state::tehkanwc_videoram2_w)
30WRITE8_MEMBER(tehkanwc_state::videoram2_w)
3131{
3232   m_videoram2[offset] = data;
3333   m_bg_tilemap->mark_tile_dirty(offset / 2);
3434}
3535
36WRITE8_MEMBER(tehkanwc_state::tehkanwc_scroll_x_w)
36WRITE8_MEMBER(tehkanwc_state::scroll_x_w)
3737{
3838   m_scroll_x[offset] = data;
3939}
4040
41WRITE8_MEMBER(tehkanwc_state::tehkanwc_scroll_y_w)
41WRITE8_MEMBER(tehkanwc_state::scroll_y_w)
4242{
4343   m_bg_tilemap->set_scrolly(0, data);
4444}
4545
46WRITE8_MEMBER(tehkanwc_state::tehkanwc_flipscreen_x_w)
46WRITE8_MEMBER(tehkanwc_state::flipscreen_x_w)
4747{
4848   flip_screen_x_set(data & 0x40);
4949}
5050
51WRITE8_MEMBER(tehkanwc_state::tehkanwc_flipscreen_y_w)
51WRITE8_MEMBER(tehkanwc_state::flipscreen_y_w)
5252{
5353   flip_screen_y_set(data & 0x40);
5454}
r243683r243684
9494         8, 8, 32, 32);
9595
9696   m_fg_tilemap->set_transparent_pen(0);
97   
98   save_item(NAME(m_scroll_x));
99   save_item(NAME(m_led0));
100   save_item(NAME(m_led1));
97101}
98102
99103/*
r243683r243684
113117   bit 7 = enable (0 = display off)
114118 */
115119
116void tehkanwc_state::gridiron_draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player)
120void tehkanwc_state::draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player)
117121{
118122   if (led&0x80)
119123      output_set_digit_value(player, led&0x7f);
r243683r243684
123127
124128void tehkanwc_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
125129{
126   UINT8 *spriteram = m_spriteram;
127   int offs;
128
129   for (offs = 0;offs < m_spriteram.bytes();offs += 4)
130   for (int offs = 0;offs < m_spriteram.bytes();offs += 4)
130131   {
131      int attr = spriteram[offs + 1];
132      int code = spriteram[offs] + ((attr & 0x08) << 5);
132      int attr = m_spriteram[offs + 1];
133      int code = m_spriteram[offs] + ((attr & 0x08) << 5);
133134      int color = attr & 0x07;
134135      int flipx = attr & 0x40;
135136      int flipy = attr & 0x80;
136      int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128;
137      int sy = spriteram[offs + 3];
137      int sx = m_spriteram[offs + 2] + ((attr & 0x20) << 3) - 128;
138      int sy = m_spriteram[offs + 3];
138139
139140      if (flip_screen_x())
140141      {
r243683r243684
153154   }
154155}
155156
156UINT32 tehkanwc_state::screen_update_tehkanwc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
157UINT32 tehkanwc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
157158{
158159   m_bg_tilemap->set_scrollx(0, m_scroll_x[0] + 256 * m_scroll_x[1]);
159160   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
160161   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
161162   draw_sprites(bitmap, cliprect);
162163   m_fg_tilemap->draw(screen, bitmap, cliprect, 1, 0);
163   gridiron_draw_led(bitmap, cliprect, m_led0, 0);
164   gridiron_draw_led(bitmap, cliprect, m_led1, 1);
164   draw_led(bitmap, cliprect, m_led0, 0);
165   draw_led(bitmap, cliprect, m_led1, 1);
165166   return 0;
166167}


Previous 199869 Revisions Next


© 1997-2024 The MAME Team