Previous 199869 Revisions Next

r36084 Monday 23rd February, 2015 at 16:25:40 UTC by Osso
retofinv.c, thedeep.c: added save state support (nw)
[/branches/kale/src/mame/drivers]retofinv.c seicross.c thedeep.c
[/branches/kale/src/mame/includes]retofinv.h thedeep.h
[/branches/kale/src/mame/machine]retofinv.c
[/branches/kale/src/mame/video]retofinv.c thedeep.c

branches/kale/src/mame/drivers/retofinv.c
r244595r244596
3535#include "includes/retofinv.h"
3636
3737
38void retofinv_state::machine_start()
39{
40   save_item(NAME(m_main_irq_mask));
41   save_item(NAME(m_sub_irq_mask));
42   save_item(NAME(m_cpu2_m6000));
43   
44   if (m_68705 != NULL) // only for the parent (with MCU)
45   {
46      save_item(NAME(m_from_main));
47      save_item(NAME(m_from_mcu));
48      save_item(NAME(m_mcu_sent));
49      save_item(NAME(m_main_sent));
50      save_item(NAME(m_portA_in));
51      save_item(NAME(m_portA_out));
52      save_item(NAME(m_ddrA));
53      save_item(NAME(m_portB_in));
54      save_item(NAME(m_portB_out));
55      save_item(NAME(m_ddrB));
56      save_item(NAME(m_portC_in));
57      save_item(NAME(m_portC_out));
58      save_item(NAME(m_ddrC));
59   }
60}
3861
3962WRITE8_MEMBER(retofinv_state::cpu1_reset_w)
4063{
r244595r244596
99122   AM_RANGE(0x7fff, 0x7fff) AM_WRITE(coincounter_w)
100123   AM_RANGE(0x7b00, 0x7bff) AM_ROM /* space for diagnostic ROM? The code looks */
101124                           /* for a string here, and jumps if it's present */
102   AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(retofinv_fg_videoram_w) AM_SHARE("fg_videoram")
125   AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram")
103126   AM_RANGE(0x8800, 0x9fff) AM_RAM AM_SHARE("sharedram")
104   AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(retofinv_bg_videoram_w) AM_SHARE("bg_videoram")
105   AM_RANGE(0xb800, 0xb802) AM_WRITE(retofinv_gfx_ctrl_w)
127   AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram")
128   AM_RANGE(0xb800, 0xb802) AM_WRITE(gfx_ctrl_w)
106129   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("P1")
107130   AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P2")
108131   AM_RANGE(0xc002, 0xc002) AM_READNOP /* bit 7 must be 0, otherwise game resets */
109   AM_RANGE(0xc003, 0xc003) AM_READ(retofinv_mcu_status_r)
132   AM_RANGE(0xc003, 0xc003) AM_READ(mcu_status_r)
110133   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM")
111134   AM_RANGE(0xc005, 0xc005) AM_READ_PORT("DSW1")
112135   AM_RANGE(0xc006, 0xc006) AM_READ_PORT("DSW2")
r244595r244596
119142   AM_RANGE(0xc805, 0xc805) AM_WRITE(cpu1_reset_w)
120143   AM_RANGE(0xd000, 0xd000) AM_WRITE(watchdog_reset_w)
121144   AM_RANGE(0xd800, 0xd800) AM_WRITE(soundcommand_w)
122   AM_RANGE(0xe000, 0xe000) AM_READ(retofinv_mcu_r)
123   AM_RANGE(0xe800, 0xe800) AM_WRITE(retofinv_mcu_w)
145   AM_RANGE(0xe000, 0xe000) AM_READ(mcu_r)
146   AM_RANGE(0xe800, 0xe800) AM_WRITE(mcu_w)
124147   AM_RANGE(0xf800, 0xf800) AM_READ(cpu0_mf800_r)
125148ADDRESS_MAP_END
126149
127150static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, retofinv_state )
128151   AM_RANGE(0x0000, 0x1fff) AM_ROM
129   AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(retofinv_fg_videoram_w) AM_SHARE("fg_videoram")
152   AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram")
130153   AM_RANGE(0x8800, 0x9fff) AM_RAM AM_SHARE("sharedram")
131   AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(retofinv_bg_videoram_w) AM_SHARE("bg_videoram")
154   AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram")
132155   AM_RANGE(0xc804, 0xc804) AM_WRITE(irq1_ack_w)
133156ADDRESS_MAP_END
134157
r244595r244596
144167
145168static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, retofinv_state )
146169   ADDRESS_MAP_GLOBAL_MASK(0x7ff)
147   AM_RANGE(0x0000, 0x0000) AM_READWRITE(retofinv_68705_portA_r, retofinv_68705_portA_w)
148   AM_RANGE(0x0001, 0x0001) AM_READWRITE(retofinv_68705_portB_r, retofinv_68705_portB_w)
149   AM_RANGE(0x0002, 0x0002) AM_READWRITE(retofinv_68705_portC_r, retofinv_68705_portC_w)
150   AM_RANGE(0x0004, 0x0004) AM_WRITE(retofinv_68705_ddrA_w)
151   AM_RANGE(0x0005, 0x0005) AM_WRITE(retofinv_68705_ddrB_w)
152   AM_RANGE(0x0006, 0x0006) AM_WRITE(retofinv_68705_ddrC_w)
170   AM_RANGE(0x0000, 0x0000) AM_READWRITE(mcu_portA_r, mcu_portA_w)
171   AM_RANGE(0x0001, 0x0001) AM_READWRITE(mcu_portB_r, mcu_portB_w)
172   AM_RANGE(0x0002, 0x0002) AM_READWRITE(mcu_portC_r, mcu_portC_w)
173   AM_RANGE(0x0004, 0x0004) AM_WRITE(mcu_ddrA_w)
174   AM_RANGE(0x0005, 0x0005) AM_WRITE(mcu_ddrB_w)
175   AM_RANGE(0x0006, 0x0006) AM_WRITE(mcu_ddrC_w)
153176   AM_RANGE(0x0010, 0x007f) AM_RAM
154177   AM_RANGE(0x0080, 0x07ff) AM_ROM
155178ADDRESS_MAP_END
r244595r244596
367390   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
368391   MCFG_SCREEN_SIZE(36*8, 28*8)
369392   MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
370   MCFG_SCREEN_UPDATE_DRIVER(retofinv_state, screen_update_retofinv)
393   MCFG_SCREEN_UPDATE_DRIVER(retofinv_state, screen_update)
371394   MCFG_SCREEN_PALETTE("palette")
372395
373396   MCFG_GFXDECODE_ADD("gfxdecode", "palette", retofinv)
r244595r244596
501524
502525
503526
504GAME( 1985, retofinv, 0,        retofinv, retofinv, driver_device, 0, ROT90, "Taito Corporation", "Return of the Invaders", 0 )
505GAME( 1985, retofinv1,retofinv, retofinb, retofinv, driver_device, 0, ROT90, "bootleg", "Return of the Invaders (bootleg set 1)", 0 )
506GAME( 1985, retofinv2,retofinv, retofinb, retofin2, driver_device, 0, ROT90, "bootleg", "Return of the Invaders (bootleg set 2)", 0 )
527GAME( 1985, retofinv, 0,        retofinv, retofinv, driver_device, 0, ROT90, "Taito Corporation", "Return of the Invaders", GAME_SUPPORTS_SAVE )
528GAME( 1985, retofinv1,retofinv, retofinb, retofinv, driver_device, 0, ROT90, "bootleg", "Return of the Invaders (bootleg set 1)", GAME_SUPPORTS_SAVE )
529GAME( 1985, retofinv2,retofinv, retofinb, retofin2, driver_device, 0, ROT90, "bootleg", "Return of the Invaders (bootleg set 2)", GAME_SUPPORTS_SAVE )
branches/kale/src/mame/drivers/seicross.c
r244595r244596
8686   m_irq_mask = data & 1;
8787
8888   /* bit 1 flips screen */
89   flip_screen_set(data & 2);
8990
9091   /* bit 2 resets the microcontroller */
9192   if (((m_portb & 4) == 0) && (data & 4))
branches/kale/src/mame/drivers/thedeep.c
r244595r244596
3838***************************************************************************/
3939
4040
41WRITE8_MEMBER(thedeep_state::thedeep_nmi_w)
41WRITE8_MEMBER(thedeep_state::nmi_w)
4242{
4343   m_nmi_enable = data;
4444}
4545
46WRITE8_MEMBER(thedeep_state::thedeep_sound_w)
46WRITE8_MEMBER(thedeep_state::sound_w)
4747{
4848   soundlatch_byte_w(space, 0, data);
4949   m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
5050}
5151
52void thedeep_state::machine_start()
53{
54   save_item(NAME(m_nmi_enable));
55   save_item(NAME(m_protection_command));
56   save_item(NAME(m_protection_data));
57   save_item(NAME(m_protection_index));
58   save_item(NAME(m_protection_irq));
59   save_item(NAME(m_rombank));
60   save_item(NAME(m_mcu_p3_reg));
61}
5262
5363void thedeep_state::machine_reset()
5464{
r244595r244596
6373   m_rombank = -1;
6474}
6575
66WRITE8_MEMBER(thedeep_state::thedeep_protection_w)
76WRITE8_MEMBER(thedeep_state::protection_w)
6777{
6878   m_protection_command = data;
6979   switch (m_protection_command)
r244595r244596
126136   }
127137}
128138
129READ8_MEMBER(thedeep_state::thedeep_e004_r)
139READ8_MEMBER(thedeep_state::e004_r)
130140{
131141   return m_protection_irq ? 1 : 0;
132142}
133143
134READ8_MEMBER(thedeep_state::thedeep_protection_r)
144READ8_MEMBER(thedeep_state::protection_r)
135145{
136146   m_protection_irq = 0;
137147   return m_protection_data;
138148}
139149
140WRITE8_MEMBER(thedeep_state::thedeep_e100_w)
150WRITE8_MEMBER(thedeep_state::e100_w)
141151{
142152   if (data != 1)
143153      logerror("pc %04x: e100 = %02x\n", space.device().safe_pc(),data);
r244595r244596
148158   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")    // ROM (banked)
149159   AM_RANGE(0xc000, 0xcfff) AM_RAM
150160   AM_RANGE(0xd000, 0xdfff) AM_RAM                             // RAM (MCU data copied here)
151   AM_RANGE(0xe000, 0xe000) AM_READWRITE(thedeep_protection_r, thedeep_protection_w)   // To MCU
152   AM_RANGE(0xe004, 0xe004) AM_READWRITE(thedeep_e004_r, thedeep_nmi_w)    //
161   AM_RANGE(0xe000, 0xe000) AM_READWRITE(protection_r, protection_w)   // To MCU
162   AM_RANGE(0xe004, 0xe004) AM_READWRITE(e004_r, nmi_w)    //
153163   AM_RANGE(0xe008, 0xe008) AM_READ_PORT("e008")           // P1 (Inputs)
154164   AM_RANGE(0xe009, 0xe009) AM_READ_PORT("e009")           // P2
155165   AM_RANGE(0xe00a, 0xe00a) AM_READ_PORT("e00a")           // DSW1
156166   AM_RANGE(0xe00b, 0xe00b) AM_READ_PORT("e00b")           // DSW2
157   AM_RANGE(0xe00c, 0xe00c) AM_WRITE(thedeep_sound_w)  // To Sound CPU
158   AM_RANGE(0xe100, 0xe100) AM_WRITE(thedeep_e100_w)   // ?
167   AM_RANGE(0xe00c, 0xe00c) AM_WRITE(sound_w)  // To Sound CPU
168   AM_RANGE(0xe100, 0xe100) AM_WRITE(e100_w)   // ?
159169   AM_RANGE(0xe210, 0xe213) AM_WRITEONLY AM_SHARE("scroll")    // Scroll
160170   AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE("spriteram")   // Sprites
161   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(thedeep_vram_1_w) AM_SHARE("vram_1")  // Text Layer
162   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(thedeep_vram_0_w) AM_SHARE("vram_0")  // Background Layer
171   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1")  // Text Layer
172   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0")  // Background Layer
163173   AM_RANGE(0xf800, 0xf83f) AM_RAM AM_SHARE("scroll2") // Column Scroll
164174   AM_RANGE(0xf840, 0xffff) AM_RAM
165175ADDRESS_MAP_END
r244595r244596
185195
186196***************************************************************************/
187197
188void thedeep_state::thedeep_maincpu_bankswitch(UINT8 bank_trig)
198void thedeep_state::maincpu_bankswitch(UINT8 bank_trig)
189199{
190200   UINT8 *rom;
191201   int new_rombank = bank_trig & 3;
r244595r244596
198208
199209}
200210
201WRITE8_MEMBER(thedeep_state::thedeep_p1_w)
211WRITE8_MEMBER(thedeep_state::p1_w)
202212{
203213   flip_screen_set((data & 1) ^ 1);
204   thedeep_maincpu_bankswitch((data & 6) >> 1);
214   maincpu_bankswitch((data & 6) >> 1);
205215   logerror("P1 %02x\n",data);
206216}
207217
208READ8_MEMBER(thedeep_state::thedeep_from_main_r)
218READ8_MEMBER(thedeep_state::from_main_r)
209219{
210220   static UINT8 res;
211221
r244595r244596
215225   return 0x20;
216226}
217227
218WRITE8_MEMBER(thedeep_state::thedeep_to_main_w)
228WRITE8_MEMBER(thedeep_state::to_main_w)
219229{
220230   // ...
221231}
222232
223WRITE8_MEMBER(thedeep_state::thedeep_p3_w)
233WRITE8_MEMBER(thedeep_state::p3_w)
224234{
225235   /* bit 0 0->1 transition IRQ0 to main */
226236   if((!(m_mcu_p3_reg & 0x01)) && data & 0x01)
r244595r244596
238248   logerror("P3 %02x\n",data);
239249}
240250
241READ8_MEMBER(thedeep_state::thedeep_p0_r)
251READ8_MEMBER(thedeep_state::p0_r)
242252{
243253   UINT8 coin_mux;
244254
r244595r244596
249259
250260static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, thedeep_state )
251261   ADDRESS_MAP_UNMAP_HIGH
252   AM_RANGE(MCS51_PORT_P0,MCS51_PORT_P0) AM_READ(thedeep_p0_r)
253   AM_RANGE(MCS51_PORT_P1,MCS51_PORT_P1) AM_WRITE(thedeep_p1_w)
254   AM_RANGE(MCS51_PORT_P2,MCS51_PORT_P2) AM_READWRITE(thedeep_from_main_r,thedeep_to_main_w)
255   AM_RANGE(MCS51_PORT_P3,MCS51_PORT_P3) AM_WRITE(thedeep_p3_w)
262   AM_RANGE(MCS51_PORT_P0,MCS51_PORT_P0) AM_READ(p0_r)
263   AM_RANGE(MCS51_PORT_P1,MCS51_PORT_P1) AM_WRITE(p1_w)
264   AM_RANGE(MCS51_PORT_P2,MCS51_PORT_P2) AM_READWRITE(from_main_r,to_main_w)
265   AM_RANGE(MCS51_PORT_P3,MCS51_PORT_P3) AM_WRITE(p3_w)
256266ADDRESS_MAP_END
257267
258268
r244595r244596
382392
383393***************************************************************************/
384394
385WRITE_LINE_MEMBER(thedeep_state::irqhandler)
395TIMER_DEVICE_CALLBACK_MEMBER(thedeep_state::interrupt)
386396{
387   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
388}
389
390TIMER_DEVICE_CALLBACK_MEMBER(thedeep_state::thedeep_interrupt)
391{
392397   int scanline = param;
393398
394399   if (scanline == 124) // TODO: clean this
r244595r244596
417422   }
418423}
419424
420INTERRUPT_GEN_MEMBER(thedeep_state::thedeep_mcu_irq)
425INTERRUPT_GEN_MEMBER(thedeep_state::mcu_irq)
421426{
422427   m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE);
423428}
r244595r244596
427432   /* basic machine hardware */
428433   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2)      /* verified on pcb */
429434   MCFG_CPU_PROGRAM_MAP(main_map)
430   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedeep_state, thedeep_interrupt, "screen", 0, 1)
435   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedeep_state, interrupt, "screen", 0, 1)
431436
432437   MCFG_CPU_ADD("audiocpu", M65C02, XTAL_12MHz/8)      /* verified on pcb */
433438   MCFG_CPU_PROGRAM_MAP(audio_map)
r244595r244596
436441   /* MCU is a i8751 running at 8Mhz (8mhz xtal)*/
437442   MCFG_CPU_ADD("mcu", I8751, XTAL_8MHz)
438443   MCFG_CPU_IO_MAP(mcu_io_map)
439   MCFG_CPU_VBLANK_INT_DRIVER("screen", thedeep_state, thedeep_mcu_irq) // unknown source, but presumably vblank
444   MCFG_CPU_VBLANK_INT_DRIVER("screen", thedeep_state, mcu_irq) // unknown source, but presumably vblank
440445   MCFG_DEVICE_DISABLE()
441446
442447
r244595r244596
446451   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
447452   MCFG_SCREEN_SIZE(0x100, 0xf8)
448453   MCFG_SCREEN_VISIBLE_AREA(0, 0x100-1, 0, 0xf8-1)
449   MCFG_SCREEN_UPDATE_DRIVER(thedeep_state, screen_update_thedeep)
454   MCFG_SCREEN_UPDATE_DRIVER(thedeep_state, screen_update)
450455   MCFG_SCREEN_PALETTE("palette")
451456
452457   MCFG_GFXDECODE_ADD("gfxdecode", "palette", thedeep)
r244595r244596
458463   MCFG_SPEAKER_STANDARD_MONO("mono")
459464
460465   MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4)  /* verified on pcb */
461   MCFG_YM2203_IRQ_HANDLER(WRITELINE(thedeep_state, irqhandler))
466   MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
462467   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
463468MACHINE_CONFIG_END
464469
r244595r244596
474479
475480Here are the proms for The Deep!
476481NOTE: This game is Vertical.
477I couldn't test this board so I don't know the manufakturer, sorry.
482I couldn't test this board so I don't know the manufacturer, sorry.
4784831 Z80
4794841 R6502
4804851 YM 2203
r244595r244596
553558   ROM_LOAD( "fi-3", 0x400, 0x200, CRC(f61a9686) SHA1(24082f60b72268d240ceca6999bdf18872625cd2) )
554559ROM_END
555560
556GAME( 1987, thedeep, 0,      thedeep, thedeep, driver_device, 0, ROT270, "Wood Place Inc.", "The Deep (Japan)", 0 )
557GAME( 1988, rundeep, thedeep,thedeep, thedeep, driver_device, 0, ROT270, "bootleg (Cream)", "Run Deep", 0 )
561GAME( 1987, thedeep, 0,      thedeep, thedeep, driver_device, 0, ROT270, "Wood Place Inc.", "The Deep (Japan)", GAME_SUPPORTS_SAVE )
562GAME( 1988, rundeep, thedeep,thedeep, thedeep, driver_device, 0, ROT270, "bootleg (Cream)", "Run Deep", GAME_SUPPORTS_SAVE )
branches/kale/src/mame/includes/retofinv.h
r244595r244596
33public:
44   retofinv_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_fg_videoram(*this, "fg_videoram"),
7      m_sharedram(*this, "sharedram"),
8      m_bg_videoram(*this, "bg_videoram"),
96      m_maincpu(*this, "maincpu"),
107      m_audiocpu(*this, "audiocpu"),
118      m_subcpu(*this, "sub"),
129      m_68705(*this, "68705"),
1310      m_gfxdecode(*this, "gfxdecode"),
14      m_palette(*this, "palette") { }
11      m_palette(*this, "palette"),
12      m_fg_videoram(*this, "fg_videoram"),
13      m_sharedram(*this, "sharedram"),
14      m_bg_videoram(*this, "bg_videoram") { }
1515
16   UINT8 m_cpu2_m6000;
16   required_device<cpu_device> m_maincpu;
17   required_device<cpu_device> m_audiocpu;
18   required_device<cpu_device> m_subcpu;
19   optional_device<cpu_device> m_68705;
20   required_device<gfxdecode_device> m_gfxdecode;
21   required_device<palette_device> m_palette;
22   
1723   required_shared_ptr<UINT8> m_fg_videoram;
1824   required_shared_ptr<UINT8> m_sharedram;
1925   required_shared_ptr<UINT8> m_bg_videoram;
26   
27   UINT8 m_main_irq_mask;
28   UINT8 m_sub_irq_mask;
29   UINT8 m_cpu2_m6000;
2030   UINT8 m_from_main;
2131   UINT8 m_from_mcu;
2232   int m_mcu_sent;
r244595r244596
3545   tilemap_t *m_bg_tilemap;
3646   tilemap_t *m_fg_tilemap;
3747
38   UINT8 m_main_irq_mask;
39   UINT8 m_sub_irq_mask;
4048   DECLARE_WRITE8_MEMBER(cpu1_reset_w);
4149   DECLARE_WRITE8_MEMBER(cpu2_reset_w);
4250   DECLARE_WRITE8_MEMBER(mcu_reset_w);
r244595r244596
4755   DECLARE_WRITE8_MEMBER(irq1_ack_w);
4856   DECLARE_WRITE8_MEMBER(coincounter_w);
4957   DECLARE_WRITE8_MEMBER(coinlockout_w);
50   DECLARE_READ8_MEMBER(retofinv_68705_portA_r);
51   DECLARE_WRITE8_MEMBER(retofinv_68705_portA_w);
52   DECLARE_WRITE8_MEMBER(retofinv_68705_ddrA_w);
53   DECLARE_READ8_MEMBER(retofinv_68705_portB_r);
54   DECLARE_WRITE8_MEMBER(retofinv_68705_portB_w);
55   DECLARE_WRITE8_MEMBER(retofinv_68705_ddrB_w);
56   DECLARE_READ8_MEMBER(retofinv_68705_portC_r);
57   DECLARE_WRITE8_MEMBER(retofinv_68705_portC_w);
58   DECLARE_WRITE8_MEMBER(retofinv_68705_ddrC_w);
59   DECLARE_WRITE8_MEMBER(retofinv_mcu_w);
60   DECLARE_READ8_MEMBER(retofinv_mcu_r);
61   DECLARE_READ8_MEMBER(retofinv_mcu_status_r);
62   DECLARE_WRITE8_MEMBER(retofinv_bg_videoram_w);
63   DECLARE_WRITE8_MEMBER(retofinv_fg_videoram_w);
64   DECLARE_WRITE8_MEMBER(retofinv_gfx_ctrl_w);
58   DECLARE_READ8_MEMBER(mcu_portA_r);
59   DECLARE_WRITE8_MEMBER(mcu_portA_w);
60   DECLARE_WRITE8_MEMBER(mcu_ddrA_w);
61   DECLARE_READ8_MEMBER(mcu_portB_r);
62   DECLARE_WRITE8_MEMBER(mcu_portB_w);
63   DECLARE_WRITE8_MEMBER(mcu_ddrB_w);
64   DECLARE_READ8_MEMBER(mcu_portC_r);
65   DECLARE_WRITE8_MEMBER(mcu_portC_w);
66   DECLARE_WRITE8_MEMBER(mcu_ddrC_w);
67   DECLARE_WRITE8_MEMBER(mcu_w);
68   DECLARE_READ8_MEMBER(mcu_r);
69   DECLARE_READ8_MEMBER(mcu_status_r);
70   DECLARE_WRITE8_MEMBER(bg_videoram_w);
71   DECLARE_WRITE8_MEMBER(fg_videoram_w);
72   DECLARE_WRITE8_MEMBER(gfx_ctrl_w);
73
6574   TILEMAP_MAPPER_MEMBER(tilemap_scan);
6675   TILE_GET_INFO_MEMBER(bg_get_tile_info);
6776   TILE_GET_INFO_MEMBER(fg_get_tile_info);
77
78   virtual void machine_start();
6879   virtual void video_start();
6980   DECLARE_PALETTE_INIT(retofinv);
70   UINT32 screen_update_retofinv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
81   
82   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
83   void draw_sprites(bitmap_ind16 &bitmap);
84   
7185   INTERRUPT_GEN_MEMBER(main_vblank_irq);
7286   INTERRUPT_GEN_MEMBER(sub_vblank_irq);
73   void draw_sprites(bitmap_ind16 &bitmap);
74   required_device<cpu_device> m_maincpu;
75   required_device<cpu_device> m_audiocpu;
76   required_device<cpu_device> m_subcpu;
77   optional_device<cpu_device> m_68705;
78   required_device<gfxdecode_device> m_gfxdecode;
79   required_device<palette_device> m_palette;
8087};
branches/kale/src/mame/includes/thedeep.h
r244595r244596
33public:
44   thedeep_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_mcu(*this, "mcu"),
9      m_gfxdecode(*this, "gfxdecode"),
10      m_palette(*this, "palette"),
611      m_spriteram(*this, "spriteram"),
712      m_vram_0(*this, "vram_0"),
813      m_vram_1(*this, "vram_1"),
914      m_scroll(*this, "scroll"),
10      m_scroll2(*this, "scroll2"),
11      m_maincpu(*this,"maincpu"),
12      m_audiocpu(*this, "audiocpu"),
13      m_mcu(*this, "mcu"),
14      m_gfxdecode(*this, "gfxdecode"),
15      m_palette(*this, "palette")  { }
15      m_scroll2(*this, "scroll2")  { }
1616
17   required_device<cpu_device> m_maincpu;
18   required_device<cpu_device> m_audiocpu;
19   required_device<cpu_device> m_mcu;
20   required_device<gfxdecode_device> m_gfxdecode;
21   required_device<palette_device> m_palette;
22
1723   required_shared_ptr<UINT8> m_spriteram;
24   required_shared_ptr<UINT8> m_vram_0;
25   required_shared_ptr<UINT8> m_vram_1;
26   required_shared_ptr<UINT8> m_scroll;
27   required_shared_ptr<UINT8> m_scroll2;
28   
1829   int m_nmi_enable;
1930   UINT8 m_protection_command;
2031   UINT8 m_protection_data;
2132   int m_protection_index;
2233   int m_protection_irq;
2334   int m_rombank;
24   required_shared_ptr<UINT8> m_vram_0;
25   required_shared_ptr<UINT8> m_vram_1;
26   required_shared_ptr<UINT8> m_scroll;
27   required_shared_ptr<UINT8> m_scroll2;
2835   tilemap_t *m_tilemap_0;
2936   tilemap_t *m_tilemap_1;
3037   UINT8 m_mcu_p3_reg;
3138
32   required_device<cpu_device> m_maincpu;
33   required_device<cpu_device> m_audiocpu;
34   required_device<cpu_device> m_mcu;
35   required_device<gfxdecode_device> m_gfxdecode;
36   required_device<palette_device> m_palette;
37
38   DECLARE_WRITE8_MEMBER(thedeep_nmi_w);
39   DECLARE_WRITE8_MEMBER(thedeep_sound_w);
40   DECLARE_WRITE8_MEMBER(thedeep_protection_w);
41   DECLARE_READ8_MEMBER(thedeep_e004_r);
42   DECLARE_READ8_MEMBER(thedeep_protection_r);
43   DECLARE_WRITE8_MEMBER(thedeep_e100_w);
44   DECLARE_WRITE8_MEMBER(thedeep_p1_w);
45   DECLARE_READ8_MEMBER(thedeep_from_main_r);
46   DECLARE_WRITE8_MEMBER(thedeep_to_main_w);
47   DECLARE_WRITE8_MEMBER(thedeep_p3_w);
48   DECLARE_READ8_MEMBER(thedeep_p0_r);
49   DECLARE_WRITE8_MEMBER(thedeep_vram_0_w);
50   DECLARE_WRITE8_MEMBER(thedeep_vram_1_w);
39   DECLARE_WRITE8_MEMBER(nmi_w);
40   DECLARE_WRITE8_MEMBER(sound_w);
41   DECLARE_WRITE8_MEMBER(protection_w);
42   DECLARE_READ8_MEMBER(e004_r);
43   DECLARE_READ8_MEMBER(protection_r);
44   DECLARE_WRITE8_MEMBER(e100_w);
45   DECLARE_WRITE8_MEMBER(p1_w);
46   DECLARE_READ8_MEMBER(from_main_r);
47   DECLARE_WRITE8_MEMBER(to_main_w);
48   DECLARE_WRITE8_MEMBER(p3_w);
49   DECLARE_READ8_MEMBER(p0_r);
50   DECLARE_WRITE8_MEMBER(vram_0_w);
51   DECLARE_WRITE8_MEMBER(vram_1_w);
52   
5153   TILEMAP_MAPPER_MEMBER(tilemap_scan_rows_back);
5254   TILE_GET_INFO_MEMBER(get_tile_info_0);
5355   TILE_GET_INFO_MEMBER(get_tile_info_1);
56
57   virtual void machine_start();
5458   virtual void machine_reset();
5559   virtual void video_start();
5660   DECLARE_PALETTE_INIT(thedeep);
57   UINT32 screen_update_thedeep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
58   INTERRUPT_GEN_MEMBER(thedeep_mcu_irq);
59   TIMER_DEVICE_CALLBACK_MEMBER(thedeep_interrupt);
61
62   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6063   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
61   void thedeep_maincpu_bankswitch(UINT8 bank_trig);
62   DECLARE_WRITE_LINE_MEMBER(irqhandler);
64   
65   void maincpu_bankswitch(UINT8 bank_trig);
66   INTERRUPT_GEN_MEMBER(mcu_irq);
67   TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
6368};
branches/kale/src/mame/machine/retofinv.c
r244595r244596
1010***************************************************************************/
1111
1212
13READ8_MEMBER(retofinv_state::retofinv_68705_portA_r)
13READ8_MEMBER(retofinv_state::mcu_portA_r)
1414{
1515//logerror("%04x: 68705 port A read %02x\n",space.device().safe_pc(),m_portA_in);
1616   return (m_portA_out & m_ddrA) | (m_portA_in & ~m_ddrA);
1717}
1818
19WRITE8_MEMBER(retofinv_state::retofinv_68705_portA_w)
19WRITE8_MEMBER(retofinv_state::mcu_portA_w)
2020{
2121//logerror("%04x: 68705 port A write %02x\n",space.device().safe_pc(),data);
2222   m_portA_out = data;
2323}
2424
25WRITE8_MEMBER(retofinv_state::retofinv_68705_ddrA_w)
25WRITE8_MEMBER(retofinv_state::mcu_ddrA_w)
2626{
2727   m_ddrA = data;
2828}
r244595r244596
3939 */
4040
4141
42READ8_MEMBER(retofinv_state::retofinv_68705_portB_r)
42READ8_MEMBER(retofinv_state::mcu_portB_r)
4343{
4444   return (m_portB_out & m_ddrB) | (m_portB_in & ~m_ddrB);
4545}
4646
47WRITE8_MEMBER(retofinv_state::retofinv_68705_portB_w)
47WRITE8_MEMBER(retofinv_state::mcu_portB_w)
4848{
4949//logerror("%04x: 68705 port B write %02x\n",space.device().safe_pc(),data);
5050
r244595r244596
6565   m_portB_out = data;
6666}
6767
68WRITE8_MEMBER(retofinv_state::retofinv_68705_ddrB_w)
68WRITE8_MEMBER(retofinv_state::mcu_ddrB_w)
6969{
7070   m_ddrB = data;
7171}
r244595r244596
8181 */
8282
8383
84READ8_MEMBER(retofinv_state::retofinv_68705_portC_r)
84READ8_MEMBER(retofinv_state::mcu_portC_r)
8585{
8686   m_portC_in = 0;
8787   if (m_main_sent) m_portC_in |= 0x01;
r244595r244596
9090   return (m_portC_out & m_ddrC) | (m_portC_in & ~m_ddrC);
9191}
9292
93WRITE8_MEMBER(retofinv_state::retofinv_68705_portC_w)
93WRITE8_MEMBER(retofinv_state::mcu_portC_w)
9494{
9595logerror("%04x: 68705 port C write %02x\n",space.device().safe_pc(),data);
9696   m_portC_out = data;
9797}
9898
99WRITE8_MEMBER(retofinv_state::retofinv_68705_ddrC_w)
99WRITE8_MEMBER(retofinv_state::mcu_ddrC_w)
100100{
101101   m_ddrC = data;
102102}
103103
104104
105WRITE8_MEMBER(retofinv_state::retofinv_mcu_w)
105WRITE8_MEMBER(retofinv_state::mcu_w)
106106{
107107logerror("%04x: mcu_w %02x\n",space.device().safe_pc(),data);
108108   m_from_main = data;
r244595r244596
110110   m_68705->set_input_line(0, ASSERT_LINE);
111111}
112112
113READ8_MEMBER(retofinv_state::retofinv_mcu_r)
113READ8_MEMBER(retofinv_state::mcu_r)
114114{
115115logerror("%04x: mcu_r %02x\n",space.device().safe_pc(),m_from_mcu);
116116   m_mcu_sent = 0;
117117   return m_from_mcu;
118118}
119119
120READ8_MEMBER(retofinv_state::retofinv_mcu_status_r)
120READ8_MEMBER(retofinv_state::mcu_status_r)
121121{
122122   int res = 0;
123123
branches/kale/src/mame/video/retofinv.c
r244595r244596
103103   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(retofinv_state::fg_get_tile_info),this),tilemap_mapper_delegate(FUNC(retofinv_state::tilemap_scan),this),8,8,36,28);
104104
105105   m_fg_tilemap->configure_groups(*m_gfxdecode->gfx(0), 0);
106   
107   save_item(NAME(m_fg_bank));
108   save_item(NAME(m_bg_bank));
106109}
107110
108111
r244595r244596
113116
114117***************************************************************************/
115118
116WRITE8_MEMBER(retofinv_state::retofinv_bg_videoram_w)
119WRITE8_MEMBER(retofinv_state::bg_videoram_w)
117120{
118121   m_bg_videoram[offset] = data;
119122   m_bg_tilemap->mark_tile_dirty(offset & 0x3ff);
120123}
121124
122WRITE8_MEMBER(retofinv_state::retofinv_fg_videoram_w)
125WRITE8_MEMBER(retofinv_state::fg_videoram_w)
123126{
124127   m_fg_videoram[offset] = data;
125128   m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
126129}
127130
128WRITE8_MEMBER(retofinv_state::retofinv_gfx_ctrl_w)
131WRITE8_MEMBER(retofinv_state::gfx_ctrl_w)
129132{
130133   switch (offset)
131134   {
r244595r244596
214217
215218
216219
217UINT32 retofinv_state::screen_update_retofinv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
220UINT32 retofinv_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
218221{
219222   m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
220223   draw_sprites(bitmap);
branches/kale/src/mame/video/thedeep.c
r244595r244596
6363         0);
6464}
6565
66WRITE8_MEMBER(thedeep_state::thedeep_vram_0_w)
66WRITE8_MEMBER(thedeep_state::vram_0_w)
6767{
6868   m_vram_0[offset] = data;
6969   m_tilemap_0->mark_tile_dirty(offset / 2);
7070}
7171
72WRITE8_MEMBER(thedeep_state::thedeep_vram_1_w)
72WRITE8_MEMBER(thedeep_state::vram_1_w)
7373{
7474   m_vram_1[offset] = data;
7575   m_tilemap_1->mark_tile_dirty(offset / 2);
r244595r244596
202202
203203***************************************************************************/
204204
205UINT32 thedeep_state::screen_update_thedeep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
205UINT32 thedeep_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
206206{
207207   int scrollx = m_scroll[0] + (m_scroll[1]<<8);
208208   int scrolly = m_scroll[2] + (m_scroll[3]<<8);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team