Previous 199869 Revisions Next

r34909 Saturday 7th February, 2015 at 12:48:34 UTC by Robbbert
(MESS) mbee: sped up bank switching; removed unneeded format files (nw)
[src/emu/cpu/m6502]m6502.h
[src/emu/cpu/ucom4]ucom4.c ucom4d.c
[src/lib]lib.mak
[src/lib/formats]flex_dsk.c flex_dsk.h mbee_dsk.c mbee_dsk.h
[src/mame/audio]t5182.c t5182.h
[src/mame/drivers]buggychl.c darkmist.c mustache.c panicr.c
[src/mame/includes]darkmist.h mustache.h
[src/mame/video]buggychl.c darkmist.c mustache.c
[src/mess]mess.lst mess.mak
[src/mess/drivers]mbee.c tmtennis.c
[src/mess/includes]mbee.h
[src/mess/layout]tmtennis.lay
[src/mess/machine]mbee.c

trunk/src/emu/cpu/m6502/m6502.h
r243420r243421
220220
221221   // inline helpers
222222   static inline bool page_changing(UINT16 base, int delta) { return ((base + delta) ^ base) & 0xff00; }
223   static inline UINT16 set_l(UINT16 base, UINT8 val) { return (base & 0xff00) | val; }
224   static inline UINT16 set_h(UINT16 base, UINT8 val) { return (base & 0x00ff) | (val << 8); }
223   static inline UINT16 set_l(UINT16 base, UINT16 val) { return (base & 0xff00) | val; }
224   static inline UINT16 set_h(UINT16 base, UINT16 val) { return (base & 0x00ff) | (val << 8); }
225225
226226   inline void dec_SP() { SP = set_l(SP, SP-1); }
227227   inline void inc_SP() { SP = set_l(SP, SP+1); }
trunk/src/emu/cpu/ucom4/ucom4.c
r243420r243421
142142   state_add(UCOM4_ACC, "ACC", m_acc).formatstr("%01X");
143143
144144   state_add(STATE_GENPC, "curpc", m_pc).formatstr("%04X").noshow();
145   state_add(STATE_GENFLAGS, "GENFLAGS", m_carry_f).formatstr("%4s").noshow(); // dummy
145//   state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).formatstr("%4s").noshow();
146146
147147   m_icountptr = &m_icount;
148148}
trunk/src/emu/cpu/ucom4/ucom4d.c
r243420r243421
1313
1414CPU_DISASSEMBLE(ucom4)
1515{
16   int pos = 1;//0;
16   int pos = 0;
1717//   UINT8 op = oprom[pos++];
1818//   UINT8 instr = ucom4_mnemonic[op];
1919
trunk/src/lib/formats/flex_dsk.c
r243420r243421
77#include "emu.h"
88#include "flex_dsk.h"
99
10flex_format::flex_format()
10flex_format::flex_format() : wd177x_format(formats)
1111{
1212}
1313
r243420r243421
2626   return "dsk";
2727}
2828
29bool flex_format::supports_save() const
30{
31   return true;
32}
33
3429int flex_format::identify(io_generic *io, UINT32 form_factor)
3530{
3631   io_generic_read(io, &info, 256 * 2, sizeof(struct sysinfo_sector));
r243420r243421
10297   return true;
10398}
10499
100// Empty since geometry is determined from the disk image itself
101const flex_format::format flex_format::formats[] = { {} };
102
105103const floppy_format_type FLOPPY_FLEX_FORMAT = &floppy_image_format_creator<flex_format>;
trunk/src/lib/formats/flex_dsk.h
r243420r243421
77#ifndef FLEX_DSK_H_
88#define FLEX_DSK_H_
99
10#include "flopimg.h"
10#include "wd177x_dsk.h"
1111
12class flex_format : public floppy_image_format_t {
12class flex_format : public wd177x_format {
1313public:
1414   flex_format();
1515
r243420r243421
1818   virtual const char *extensions() const;
1919   virtual int identify(io_generic *io, UINT32 form_factor);
2020   virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
21   virtual bool supports_save() const;
22
2321private:
2422   struct sysinfo_sector
2523   {
r243420r243421
3937      UINT8 last_sec;
4038      UINT8 unused2[216];
4139   } info;
40   static const format formats[];
4241};
4342
4443extern const floppy_format_type FLOPPY_FLEX_FORMAT;
trunk/src/lib/formats/mbee_dsk.c
r243420r243421
1// license:BSD-3-Clause
2// copyright-holders:Olivier Galibert
3/*********************************************************************
4
5    formats/mbee_dsk.c
6
7    Microbee disk image format
8
9*********************************************************************/
10
11#include "emu.h"
12#include "formats/mbee_dsk.h"
13
14mbee_format::mbee_format() : wd177x_format(formats)
15{
16}
17
18const char *mbee_format::name() const
19{
20   return "mbee";
21}
22
23const char *mbee_format::description() const
24{
25   return "Microbee disk image";
26}
27
28const char *mbee_format::extensions() const
29{
30   return "ss80,ds40,ds80,ds82,ds84";
31}
32
33// Unverified gap sizes
34const mbee_format::format mbee_format::formats[] = {
35   {   /*  ss80 3 1/2 inch double density */
36      floppy_image::FF_35,  floppy_image::SSDD, floppy_image::MFM,
37      2000,  10, 80, 1, 512, {}, 1, {}, 32, 22, 31
38   },
39   {   /*  ds40 5.25 inch double density */
40      floppy_image::FF_525,  floppy_image::DSDD, floppy_image::MFM,
41      2000,  10, 40, 2, 512, {}, 1, {}, 32, 22, 31
42   },
43   {   /*  ds80 3 1/2 inch double density */
44      floppy_image::FF_35,  floppy_image::DSDD, floppy_image::MFM,
45      2000,  10, 80, 2, 512, {}, 21, {}, 32, 22, 31
46   },
47   {   /*  ds82,ds84 3 1/2 inch double density */
48      floppy_image::FF_35,  floppy_image::DSDD, floppy_image::MFM,
49      2000,  10, 80, 2, 512, {}, 1, {}, 32, 22, 31
50   },
51   {}
52};
53
54const floppy_format_type FLOPPY_MBEE_FORMAT = &floppy_image_format_creator<mbee_format>;
trunk/src/lib/formats/mbee_dsk.h
r243420r243421
1/*********************************************************************
2
3    formats/mbee_dsk.h
4
5    Microbee disk image format
6
7*********************************************************************/
8
9#ifndef MBEE_DSK_H_
10#define MBEE_DSK_H_
11
12#include "wd177x_dsk.h"
13
14class mbee_format : public wd177x_format {
15public:
16   mbee_format();
17
18   virtual const char *name() const;
19   virtual const char *description() const;
20   virtual const char *extensions() const;
21
22private:
23   static const format formats[];
24};
25
26extern const floppy_format_type FLOPPY_MBEE_FORMAT;
27
28#endif
trunk/src/lib/lib.mak
r243420r243421
183183   $(LIBOBJ)/formats/m20_dsk.o     \
184184   $(LIBOBJ)/formats/m5_dsk.o      \
185185   $(LIBOBJ)/formats/mbee_cas.o    \
186   $(LIBOBJ)/formats/mbee_dsk.o    \
187186   $(LIBOBJ)/formats/mm_dsk.o      \
188187   $(LIBOBJ)/formats/msx_dsk.o     \
189188   $(LIBOBJ)/formats/mfi_dsk.o     \
trunk/src/mame/audio/t5182.c
r243420r243421
22
33Toshiba T5182 die map, by Jonathan Gevaryahu AKA Lord Nightmare,
44with assistance from Kevin Horton.
5T5182 supplied by Tomasz 'Dox' Slanina which came from a Dark Mist PCB bought by Guru
5T5182 supplied by Tomasz 'Dox' Slanina
66
77Die Diagram:
88|------------------------|
r243420r243421
152152const device_type T5182 = &device_creator<t5182_device>;
153153
154154t5182_device::t5182_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
155   : device_t(mconfig, T5182, "T5182 MCU", tag, owner, clock, "t5182", __FILE__),
156   m_ourcpu(*this, "t5182_z80"),
157   m_sharedram(*this, "sharedram"),
155   : device_t(mconfig, T5182, "T5182 MCU", tag, owner, clock, "toshiba_t5182", __FILE__),
156   m_t5182_sharedram(NULL),
158157   m_irqstate(0),
159158   m_semaphore_main(0),
160159   m_semaphore_snd(0)
161160{
162161}
163162
163//-------------------------------------------------
164//  device_config_complete - perform any
165//  operations now that the configuration is
166//  complete
167//-------------------------------------------------
164168
169void t5182_device::device_config_complete()
170{
171}
172
165173//-------------------------------------------------
166174//  device_start - device-specific startup
167175//-------------------------------------------------
168176
169177void t5182_device::device_start()
170178{
171   m_setirq_cb = timer_alloc(SETIRQ_CB);
172   
179   m_t5182_sharedram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("t5182_sharedram")->ptr());
180
181   save_pointer(NAME(m_t5182_sharedram), sizeof(UINT8));
173182   save_item(NAME(m_irqstate));
174183   save_item(NAME(m_semaphore_main));
175184   save_item(NAME(m_semaphore_snd));
185
186   m_ourcpu = machine().device<cpu_device>("t5182_z80");
176187}
177188
178189READ8_MEMBER(t5182_device::sharedram_r)
179190{
180   return m_sharedram[offset];
191   return m_t5182_sharedram[offset];
181192}
182193
183194WRITE8_MEMBER(t5182_device::sharedram_w)
184195{
185   m_sharedram[offset] = data;
196   m_t5182_sharedram[offset] = data;
186197}
187198
188199TIMER_CALLBACK_MEMBER( t5182_device::setirq_callback )
r243420r243421
219230      m_ourcpu->set_input_line(0,ASSERT_LINE);
220231}
221232
222void t5182_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
223{
224   switch (id)
225   {
226      case SETIRQ_CB:
227         setirq_callback(ptr, param);
228         break;
229      default:
230         assert_always(FALSE, "Unknown id in t5182_device::device_timer");
231   }
232}
233233
234
234235WRITE8_MEMBER( t5182_device::sound_irq_w )
235236{
236   synchronize(SETIRQ_CB, CPU_ASSERT);
237   space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(t5182_device::setirq_callback), this), CPU_ASSERT);
237238}
238239
239240WRITE8_MEMBER( t5182_device::ym2151_irq_ack_w )
240241{
241   synchronize(SETIRQ_CB, YM2151_ACK);
242   space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(t5182_device::setirq_callback), this), YM2151_ACK);
242243}
243244
244245WRITE8_MEMBER( t5182_device::cpu_irq_ack_w )
245246{
246   synchronize(SETIRQ_CB, CPU_CLEAR);
247   space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(t5182_device::setirq_callback), this), CPU_CLEAR);
247248}
248249
249250WRITE_LINE_MEMBER(t5182_device::ym2151_irq_handler)
250251{
251252   if (state)
252      synchronize(SETIRQ_CB, YM2151_ASSERT);
253      machine().scheduler().synchronize(timer_expired_delegate(FUNC(t5182_device::setirq_callback), this), YM2151_ASSERT);
253254   else
254      synchronize(SETIRQ_CB, YM2151_CLEAR);
255      machine().scheduler().synchronize(timer_expired_delegate(FUNC(t5182_device::setirq_callback), this), YM2151_CLEAR);
255256}
256257
257258READ8_MEMBER(t5182_device::sharedram_semaphore_snd_r)
r243420r243421
284285   return m_semaphore_main | (m_irqstate & 2);
285286}
286287
287// ROM definition for the Toshiba T5182 Custom CPU internal program ROM
288ROM_START( t5182 )
289   ROM_REGION( 0x2000, "cpu", 0 )
290   ROM_LOAD( "t5182.rom",   0x0000, 0x2000, CRC(d354c8fc) SHA1(a1c9e1ac293f107f69cc5788cf6abc3db1646e33) )
291ROM_END
292
293288//-------------------------------------------------
294//  rom_region - return a pointer to the device's
295//  internal ROM region
289//  MACHINE_CONFIG_FRAGMENT( t5182 )
296290//-------------------------------------------------
297const rom_entry *t5182_device::device_rom_region() const
298{
299   return ROM_NAME( t5182 );
300}
301291
302INPUT_PORTS_START(t5182)
303   PORT_START("T5182_COIN")
304   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2)
305   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
306INPUT_PORTS_END
292MACHINE_CONFIG_FRAGMENT( t5182 )
293   MCFG_CPU_ADD("t5182_z80", Z80, T5182_CLOCK)
294   MCFG_CPU_PROGRAM_MAP(t5182_map)
295   MCFG_CPU_IO_MAP(t5182_io)
307296
308//-------------------------------------------------
309//  input_ports - return a pointer to the implicit
310//  input ports description for this device
311//-------------------------------------------------
297MACHINE_CONFIG_END
312298
313ioport_constructor t5182_device::device_input_ports() const
314{
315   return INPUT_PORTS_NAME(t5182);
316}
317   
318299
319300   // 4000-407F    RAM shared with main CPU
320301   // 4000 output queue length
r243420r243421
334315   //  A0XX
335316   // rest unused
336317ADDRESS_MAP_START( t5182_map, AS_PROGRAM, 8, t5182_device )
337   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("cpu", 0) // internal ROM
318   AM_RANGE(0x0000, 0x1fff) AM_ROM // internal ROM
338319   AM_RANGE(0x2000, 0x27ff) AM_RAM AM_MIRROR(0x1800) // internal RAM
339   AM_RANGE(0x4000, 0x40ff) AM_RAM AM_MIRROR(0x3F00) AM_SHARE("sharedram") // 2016 with four 74ls245s, one each for main and t5182 address and data. pins 23, 22, 20, 19, 18 are all tied low so only 256 bytes are usable
340   AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION(":t5182_z80", 0) // external ROM
320   AM_RANGE(0x4000, 0x40ff) AM_RAM AM_MIRROR(0x3F00) AM_SHARE("t5182_sharedram") // 2016 with four 74ls245s, one each for main and t5182 address and data. pins 23, 22, 20, 19, 18 are all tied low so only 256 bytes are usable
321   AM_RANGE(0x8000, 0xffff) AM_ROM // external ROM
341322ADDRESS_MAP_END
342323
343324
r243420r243421
353334   // 50  W test mode status flags (bit 0 = ROM test fail, bit 1 = RAM test fail, bit 2 = YM2151 IRQ not received)
354335ADDRESS_MAP_START( t5182_io, AS_IO, 8, t5182_device )
355336   ADDRESS_MAP_GLOBAL_MASK(0xff)
356   AM_RANGE(0x00, 0x01) AM_DEVREADWRITE(":ymsnd", ym2151_device, read, write)
357   AM_RANGE(0x10, 0x10) AM_WRITE(sharedram_semaphore_snd_acquire_w)
358   AM_RANGE(0x11, 0x11) AM_WRITE(sharedram_semaphore_snd_release_w)
359   AM_RANGE(0x12, 0x12) AM_WRITE(ym2151_irq_ack_w)
360   AM_RANGE(0x13, 0x13) AM_WRITE(cpu_irq_ack_w)
361   AM_RANGE(0x20, 0x20) AM_READ(sharedram_semaphore_main_r)
362   AM_RANGE(0x30, 0x30) AM_READ_PORT("T5182_COIN")
337   AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
338   AM_RANGE(0x10, 0x10) AM_DEVWRITE("t5182", t5182_device, sharedram_semaphore_snd_acquire_w)
339   AM_RANGE(0x11, 0x11) AM_DEVWRITE("t5182", t5182_device, sharedram_semaphore_snd_release_w)
340   AM_RANGE(0x12, 0x12) AM_DEVWRITE("t5182", t5182_device, ym2151_irq_ack_w)
341   AM_RANGE(0x13, 0x13) AM_DEVWRITE("t5182", t5182_device, cpu_irq_ack_w)
342   AM_RANGE(0x20, 0x20) AM_DEVREAD("t5182", t5182_device, sharedram_semaphore_main_r)
343   AM_RANGE(0x30, 0x30) AM_READ_PORT(T5182COINPORT)
363344ADDRESS_MAP_END
364
365
366//-------------------------------------------------
367//  MACHINE_CONFIG_FRAGMENT( t5182 )
368//-------------------------------------------------
369
370MACHINE_CONFIG_FRAGMENT( t5182 )
371   MCFG_CPU_ADD("t5182_z80", Z80, T5182_CLOCK)
372   MCFG_CPU_PROGRAM_MAP(t5182_map)
373   MCFG_CPU_IO_MAP(t5182_io)
374
375MACHINE_CONFIG_END
376
377//-------------------------------------------------
378//  machine_config_additions - device-specific
379//  machine configurations
380//-------------------------------------------------
381
382machine_config_constructor t5182_device::device_mconfig_additions() const
383{
384   return MACHINE_CONFIG_NAME( t5182 );
385}
trunk/src/mame/audio/t5182.h
r243420r243421
11#include "sound/2151intf.h"
22#include "cpu/z80/z80.h"
33
4#define T5182COINPORT "T5182_COIN"
5
46class t5182_device : public device_t
57
68{
r243420r243421
1820      CPU_CLEAR
1921   };
2022
21   enum
22   {
23      SETIRQ_CB
24   };
25   
2623   DECLARE_WRITE8_MEMBER(sound_irq_w );
2724   DECLARE_READ8_MEMBER(sharedram_semaphore_snd_r);
2825   DECLARE_WRITE8_MEMBER(sharedram_semaphore_main_acquire_w);
r243420r243421
3835
3936protected:
4037   // device-level overrides
38   virtual void device_config_complete();
4139   virtual void device_start();
42   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
43   virtual const rom_entry *device_rom_region() const;
44   virtual ioport_constructor device_input_ports() const;
45   virtual machine_config_constructor device_mconfig_additions() const;
4640
4741private:
4842   // internal state
49   required_device<cpu_device> m_ourcpu;
50   required_shared_ptr<UINT8> m_sharedram;
43   cpu_device *m_ourcpu;
44   UINT8 *m_t5182_sharedram;
5145   int m_irqstate;
5246   int m_semaphore_main;
5347   int m_semaphore_snd;
54   emu_timer *m_setirq_cb;
48
5549   TIMER_CALLBACK_MEMBER( setirq_callback );
5650};
5751
5852extern const device_type T5182;
53
54ADDRESS_MAP_EXTERN( t5182_map, 8 );
55ADDRESS_MAP_EXTERN( t5182_io, 8 );
56
57MACHINE_CONFIG_EXTERN( t5182 );
58
59#define MCFG_T5182_ADD(_tag) \
60   MCFG_DEVICE_ADD(_tag, T5182, 0)
trunk/src/mame/drivers/buggychl.c
r243420r243421
482482ROM_END
483483
484484
485GAMEL( 1984, buggychl, 0,        buggychl, buggychl, driver_device, 0, ROT270, "Taito Corporation", "Buggy Challenge", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE, layout_buggychl )
486GAMEL( 1984, buggychlt,buggychl, buggychl, buggychl, driver_device, 0, ROT270, "Taito Corporation (Tecfri license)", "Buggy Challenge (Tecfri)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS| GAME_SUPPORTS_SAVE, layout_buggychl )
485GAMEL( 1984, buggychl, 0,        buggychl, buggychl, driver_device, 0, ROT270, "Taito Corporation", "Buggy Challenge", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS, layout_buggychl )
486GAMEL( 1984, buggychlt,buggychl, buggychl, buggychl, driver_device, 0, ROT270, "Taito Corporation (Tecfri license)", "Buggy Challenge (Tecfri)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS, layout_buggychl )
trunk/src/mame/drivers/darkmist.c
r243420r243421
2828#include "includes/darkmist.h"
2929
3030
31WRITE8_MEMBER(darkmist_state::hw_w)
31WRITE8_MEMBER(darkmist_state::darkmist_hw_w)
3232{
3333   m_hw=data;
3434   membank("bank1")->set_base(&memregion("maincpu")->base()[0x010000+((data&0x80)?0x4000:0)]);
r243420r243421
4040   AM_RANGE(0xc801, 0xc801) AM_READ_PORT("P1")
4141   AM_RANGE(0xc802, 0xc802) AM_READ_PORT("P2")
4242   AM_RANGE(0xc803, 0xc803) AM_READ_PORT("START")
43   AM_RANGE(0xc804, 0xc804) AM_WRITE(hw_w)
43   AM_RANGE(0xc804, 0xc804) AM_WRITE(darkmist_hw_w)
4444   AM_RANGE(0xc805, 0xc805) AM_WRITEONLY AM_SHARE("spritebank")
4545   AM_RANGE(0xc806, 0xc806) AM_READ_PORT("DSW1")
4646   AM_RANGE(0xc807, 0xc807) AM_READ_PORT("DSW2")
r243420r243421
173173   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
174174   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
175175
176   PORT_START(T5182COINPORT)
177   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2)
178   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
179
176180INPUT_PORTS_END
177181
178182static const gfx_layout charlayout =
r243420r243421
209213   GFXDECODE_ENTRY( "gfx3", 0, tilelayout,  0, 16*4 )
210214GFXDECODE_END
211215
212TIMER_DEVICE_CALLBACK_MEMBER(darkmist_state::scanline)
216TIMER_DEVICE_CALLBACK_MEMBER(darkmist_state::darkmist_scanline)
213217{
214218   int scanline = param;
215219
r243420r243421
226230   /* basic machine hardware */
227231   MCFG_CPU_ADD("maincpu", Z80,4000000)         /* ? MHz */
228232   MCFG_CPU_PROGRAM_MAP(memmap)
229   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkmist_state, scanline, "screen", 0, 1)
233   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkmist_state, darkmist_scanline, "screen", 0, 1)
230234
231   MCFG_DEVICE_ADD("t5182", T5182, 0)
232   
235   MCFG_T5182_ADD("t5182")
236   MCFG_FRAGMENT_ADD(t5182)
233237
234238   /* video hardware */
235239   MCFG_SCREEN_ADD("screen", RASTER)
r243420r243421
237241   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
238242   MCFG_SCREEN_SIZE(256, 256)
239243   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
240   MCFG_SCREEN_UPDATE_DRIVER(darkmist_state, screen_update)
244   MCFG_SCREEN_UPDATE_DRIVER(darkmist_state, screen_update_darkmist)
241245   MCFG_SCREEN_PALETTE("palette")
242246
243247   MCFG_GFXDECODE_ADD("gfxdecode", "palette", darkmist)
r243420r243421
262266
263267   ROM_LOAD( "dm_16.rom", 0x10000, 0x08000, CRC(094579d9) SHA1(2449bc9ba38396912ee9b72dd870ea9fcff95776) )
264268
265   ROM_REGION( 0x8000, "t5182_z80", 0 ) /* Toshiba T5182 external ROM */
266   ROM_LOAD( "dm_17.rom", 0x0000, 0x8000, CRC(7723dcae) SHA1(a0c69e7a7b6fd74f7ed6b9c6419aed94aabcd4b0) )
269   ROM_REGION( 0x10000, "t5182_z80", 0 ) /* Toshiba T5182 module */
270   ROM_LOAD( "t5182.rom", 0x0000, 0x2000, CRC(d354c8fc) SHA1(a1c9e1ac293f107f69cc5788cf6abc3db1646e33) )
271   ROM_LOAD( "dm_17.rom", 0x8000, 0x8000, CRC(7723dcae) SHA1(a0c69e7a7b6fd74f7ed6b9c6419aed94aabcd4b0) )
267272
268273   ROM_REGION( 0x4000, "gfx1", 0 )
269274   ROM_LOAD( "dm_13.rom", 0x00000, 0x02000, CRC(38bb38d9) SHA1(d751990166dd3d503c5de7667679b96210061cd1) )
r243420r243421
390395   int i;
391396   UINT8 *ROM = memregion("t5182_z80")->base();
392397
393   for(i=0x0000;i<0x2000;i++)
398   for(i=0x8000;i<0x10000;i++)
394399      ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);
395400}
396401
r243420r243421
468473   }
469474}
470475
471GAME( 1986, darkmist, 0, darkmist, darkmist, darkmist_state, darkmist, ROT270, "Taito Corporation", "The Lost Castle In Darkmist", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
476GAME( 1986, darkmist, 0, darkmist, darkmist, darkmist_state, darkmist, ROT270, "Taito Corporation", "The Lost Castle In Darkmist", GAME_IMPERFECT_GRAPHICS|GAME_NO_COCKTAIL )
trunk/src/mame/drivers/mustache.c
r243420r243421
4343static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, mustache_state )
4444   AM_RANGE(0x0000, 0x7fff) AM_ROM
4545   AM_RANGE(0x8000, 0xbfff) AM_ROM
46   AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
46   AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(mustache_videoram_w) AM_SHARE("videoram")
4747   AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("t5182", t5182_device, sound_irq_w)
4848   AM_RANGE(0xd001, 0xd001) AM_DEVREAD("t5182", t5182_device, sharedram_semaphore_snd_r)
4949   AM_RANGE(0xd002, 0xd002) AM_DEVWRITE("t5182", t5182_device, sharedram_semaphore_main_acquire_w)
r243420r243421
5454   AM_RANGE(0xd802, 0xd802) AM_READ_PORT("START")
5555   AM_RANGE(0xd803, 0xd803) AM_READ_PORT("DSWA")
5656   AM_RANGE(0xd804, 0xd804) AM_READ_PORT("DSWB")
57   AM_RANGE(0xd806, 0xd806) AM_WRITE(scroll_w)
58   AM_RANGE(0xd807, 0xd807) AM_WRITE(video_control_w)
57   AM_RANGE(0xd806, 0xd806) AM_WRITE(mustache_scroll_w)
58   AM_RANGE(0xd807, 0xd807) AM_WRITE(mustache_video_control_w)
5959   AM_RANGE(0xe800, 0xefff) AM_WRITEONLY AM_SHARE("spriteram")
6060   AM_RANGE(0xf000, 0xffff) AM_RAM
6161ADDRESS_MAP_END
r243420r243421
123123   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
124124// There is an 8th dipswitch here, which controls screen flip, but the operator sheet implies it does it via hardware, i.e. not readable by cpu. May need further investigation.
125125
126   PORT_START(T5182COINPORT)
127   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2)
128   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
126129INPUT_PORTS_END
127130
128131
r243420r243421
152155   GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x80, 8 )
153156GFXDECODE_END
154157
155TIMER_DEVICE_CALLBACK_MEMBER(mustache_state::scanline)
158TIMER_DEVICE_CALLBACK_MEMBER(mustache_state::mustache_scanline)
156159{
157160   int scanline = param;
158161
r243420r243421
170173   /* basic machine hardware */
171174   MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK)
172175   MCFG_CPU_PROGRAM_MAP(memmap)
173   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mustache_state, scanline, "screen", 0, 1)
176   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mustache_state, mustache_scanline, "screen", 0, 1)
174177
175   MCFG_DEVICE_ADD("t5182", T5182, 0)
178   MCFG_T5182_ADD("t5182")
179   MCFG_FRAGMENT_ADD(t5182)
176180
177
178181   /* video hardware */
179182   MCFG_SCREEN_ADD("screen", RASTER)
180183   MCFG_SCREEN_REFRESH_RATE(56.747)
181184   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
182185   MCFG_SCREEN_SIZE(32*8, 32*8)
183186   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0, 31*8-1)
184   MCFG_SCREEN_UPDATE_DRIVER(mustache_state, screen_update)
187   MCFG_SCREEN_UPDATE_DRIVER(mustache_state, screen_update_mustache)
185188   MCFG_SCREEN_PALETTE("palette")
186189
187190   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mustache)
r243420r243421
204207   ROM_LOAD( "mustache.h18", 0x0000, 0x8000, CRC(123bd9b8) SHA1(33a7cba5c3a54b0b1a15dd1e24d298b6f7274321) )
205208   ROM_LOAD( "mustache.h16", 0x8000, 0x4000, CRC(62552beb) SHA1(ee10991d7de0596608fa1db48805781cbfbbdb9f) )
206209
207   ROM_REGION( 0x8000, "t5182_z80", 0 ) /* Toshiba T5182 external ROM */
208   ROM_LOAD( "mustache.e5", 0x0000, 0x8000, CRC(efbb1943) SHA1(3320e9eaeb776d09ed63f7dedc79e720674e6718) )
210   ROM_REGION( 0x10000, "t5182_z80", 0 ) /* Toshiba T5182 module */
211   ROM_LOAD( "t5182.rom",   0x0000, 0x2000, CRC(d354c8fc) SHA1(a1c9e1ac293f107f69cc5788cf6abc3db1646e33) )
212   ROM_LOAD( "mustache.e5", 0x8000, 0x8000, CRC(efbb1943) SHA1(3320e9eaeb776d09ed63f7dedc79e720674e6718) )
209213
210214   ROM_REGION( 0x0c000, "gfx1",0)  /* BG tiles  */
211215   ROM_LOAD( "mustache.a13", 0x0000,  0x4000, CRC(9baee4a7) SHA1(31bcec838789462e67e54ebe7256db9fc4e51b69) )
r243420r243421
274278}
275279
276280
277GAME( 1987, mustache, 0, mustache, mustache, mustache_state, mustache, ROT90, "Seibu Kaihatsu (March license)", "Mustache Boy", GAME_SUPPORTS_SAVE )
281GAME( 1987, mustache, 0, mustache, mustache, mustache_state, mustache, ROT90, "Seibu Kaihatsu (March license)", "Mustache Boy", 0 )
trunk/src/mame/drivers/panicr.c
r243420r243421
6969public:
7070   panicr_state(const machine_config &mconfig, device_type type, const char *tag)
7171      : driver_device(mconfig, type, tag),
72      m_mainram(*this, "mainram"),
73      m_spriteram(*this, "spriteram"),
74      m_textram(*this, "textram"),
75      m_spritebank(*this, "spritebank"),
7276      m_maincpu(*this, "maincpu"),
7377      m_t5182(*this, "t5182"),
7478      m_gfxdecode(*this, "gfxdecode"),
7579      m_screen(*this, "screen"),
76      m_palette(*this, "palette"),
77      m_mainram(*this, "mainram"),
78      m_spriteram(*this, "spriteram"),
79      m_textram(*this, "textram"),
80      m_spritebank(*this, "spritebank") { }
80      m_palette(*this, "palette") { }
8181
82   required_shared_ptr<UINT8> m_mainram;
83   required_shared_ptr<UINT8> m_spriteram;
84   required_shared_ptr<UINT8> m_textram;
85   required_shared_ptr<UINT8> m_spritebank;
86
8287   required_device<cpu_device> m_maincpu;
8388   required_device<t5182_device> m_t5182;
8489   required_device<gfxdecode_device> m_gfxdecode;
8590   required_device<screen_device> m_screen;
8691   required_device<palette_device> m_palette;
87   
88   required_shared_ptr<UINT8> m_mainram;
89   required_shared_ptr<UINT8> m_spriteram;
90   required_shared_ptr<UINT8> m_textram;
91   required_shared_ptr<UINT8> m_spritebank;
9292
9393   tilemap_t *m_bgtilemap;
9494   tilemap_t *m_infotilemap_2;
95
9596   tilemap_t *m_txttilemap;
96
9797   int m_scrollx;
98   bitmap_ind16 *m_temprender;
99   bitmap_ind16 *m_tempbitmap_1;
100   rectangle m_tempbitmap_clip;
10198
102   DECLARE_READ8_MEMBER(collision_r);
103   DECLARE_WRITE8_MEMBER(scrollx_lo_w);
104   DECLARE_WRITE8_MEMBER(scrollx_hi_w);
105   DECLARE_WRITE8_MEMBER(output_w);
99   DECLARE_READ8_MEMBER(panicr_collision_r);
100   DECLARE_WRITE8_MEMBER(panicr_scrollx_lo_w);
101   DECLARE_WRITE8_MEMBER(panicr_scrollx_hi_w);
102   DECLARE_WRITE8_MEMBER(panicr_output_w);
106103   DECLARE_READ8_MEMBER(t5182shared_r);
107104   DECLARE_WRITE8_MEMBER(t5182shared_w);
108105
106   DECLARE_DRIVER_INIT(panicr);
109107   TILE_GET_INFO_MEMBER(get_bgtile_info);
110108   TILE_GET_INFO_MEMBER(get_infotile_info);
111109   TILE_GET_INFO_MEMBER(get_infotile_info_2);
112110   TILE_GET_INFO_MEMBER(get_infotile_info_3);
113111   TILE_GET_INFO_MEMBER(get_infotile_info_4);
112
114113   TILE_GET_INFO_MEMBER(get_txttile_info);
115   
116   DECLARE_DRIVER_INIT(panicr);
117114   virtual void video_start();
118115   DECLARE_PALETTE_INIT(panicr);
119   
120   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
116   UINT32 screen_update_panicr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
117   TIMER_DEVICE_CALLBACK_MEMBER(panicr_scanline);
121118   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect );
122   
123   TIMER_DEVICE_CALLBACK_MEMBER(scanline);
119
120   bitmap_ind16 *m_temprender;
121
122   bitmap_ind16 *m_tempbitmap_1;
123   rectangle m_tempbitmap_clip;
124124};
125125
126126
r243420r243421
243243
244244   m_txttilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(panicr_state::get_txttile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32 );
245245   m_txttilemap->configure_groups(*m_gfxdecode->gfx(0), 0);
246   
247   save_item(NAME(m_scrollx));
248246}
249247
250248void panicr_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect )
251249{
250   UINT8 *spriteram = m_spriteram;
252251   int offs,flipx,flipy,x,y,color,sprite;
253252
254253
r243420r243421
257256   for (offs = m_spriteram.bytes() - 16; offs>=0; offs-=16)
258257   {
259258      flipx = 0;
260      flipy = m_spriteram[offs+1] & 0x80;
261      y = m_spriteram[offs+2];
262      x = m_spriteram[offs+3];
263      if (m_spriteram[offs+1] & 0x40) x -= 0x100;
259      flipy = spriteram[offs+1] & 0x80;
260      y = spriteram[offs+2];
261      x = spriteram[offs+3];
262      if (spriteram[offs+1] & 0x40) x -= 0x100;
264263
265      if (m_spriteram[offs+1] & 0x20)
264      if (spriteram[offs+1] & 0x20)
266265      {
267266         // often set
268267      }
269268
270      if (m_spriteram[offs+1] & 0x10)
269      if (spriteram[offs+1] & 0x10)
271270      {
272         popmessage("(spriteram[offs+1] & 0x10) %02x\n", (m_spriteram[offs+1] & 0x10));
271         popmessage("(spriteram[offs+1] & 0x10) %02x\n", (spriteram[offs+1] & 0x10));
273272      }
274273
275274
276      color = m_spriteram[offs+1] & 0x0f;
277      sprite = m_spriteram[offs+0] | (*m_spritebank << 8);
275      color = spriteram[offs+1] & 0x0f;
276      sprite = spriteram[offs+0] | (*m_spritebank << 8);
278277
279278      m_gfxdecode->gfx(2)->transmask(bitmap,cliprect,
280279            sprite,
r243420r243421
283282   }
284283}
285284
286UINT32 panicr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
285UINT32 panicr_state::screen_update_panicr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
287286{
288287   m_bgtilemap->set_scrollx(0, m_scrollx);
289288   m_bgtilemap->draw(screen, *m_temprender, m_tempbitmap_clip, 0,0);
r243420r243421
342341
343342***************************************************************************/
344343
345READ8_MEMBER(panicr_state::collision_r)
344READ8_MEMBER(panicr_state::panicr_collision_r)
346345{
347346   // re-render the collision data here
348347   // collisions are based on 2 bits from the tile data, relative to a page of tiles
r243420r243421
385384}
386385
387386
388WRITE8_MEMBER(panicr_state::scrollx_lo_w)
387WRITE8_MEMBER(panicr_state::panicr_scrollx_lo_w)
389388{
390   logerror("scrollx_lo_w %02x\n", data);
389   logerror("panicr_scrollx_lo_w %02x\n", data);
391390   m_scrollx = (m_scrollx & 0xff00) | (data << 1 & 0xfe) | (data >> 7 & 0x01);
392391}
393392
394WRITE8_MEMBER(panicr_state::scrollx_hi_w)
393WRITE8_MEMBER(panicr_state::panicr_scrollx_hi_w)
395394{
396   logerror("scrollx_hi_w %02x\n", data);
395   logerror("panicr_scrollx_hi_w %02x\n", data);
397396   m_scrollx = (m_scrollx & 0xff) | ((data &0xf0) << 4) | ((data & 0x0f) << 12);
398397}
399398
400WRITE8_MEMBER(panicr_state::output_w)
399WRITE8_MEMBER(panicr_state::panicr_output_w)
401400{
402401   // d6, d7: play counter? (it only triggers on 1st coin)
403402   coin_counter_w(machine(), 0, (data & 0x40) ? 1 : 0);
404403   coin_counter_w(machine(), 1, (data & 0x80) ? 1 : 0);
405404
406   logerror("output_w %02x\n", data);
405   logerror("panicr_output_w %02x\n", data);
407406
408407   // other bits: ?
409408}
r243420r243421
427426   AM_RANGE(0x00000, 0x01fff) AM_RAM AM_SHARE("mainram")
428427   AM_RANGE(0x02000, 0x03cff) AM_RAM AM_SHARE("spriteram") // how big is sprite ram, some places definitely have sprites at 3000+
429428   AM_RANGE(0x03d00, 0x03fff) AM_RAM
430   AM_RANGE(0x08000, 0x0bfff) AM_READ(collision_r)
429   AM_RANGE(0x08000, 0x0bfff) AM_READ(panicr_collision_r)
431430   AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_SHARE("textram")
432431   AM_RANGE(0x0d000, 0x0d000) AM_DEVWRITE("t5182", t5182_device, sound_irq_w)
433432   AM_RANGE(0x0d002, 0x0d002) AM_DEVWRITE("t5182", t5182_device, sharedram_semaphore_main_acquire_w)
r243420r243421
439438   AM_RANGE(0x0d404, 0x0d404) AM_READ_PORT("START")
440439   AM_RANGE(0x0d406, 0x0d406) AM_READ_PORT("DSW1")
441440   AM_RANGE(0x0d407, 0x0d407) AM_READ_PORT("DSW2")
442   AM_RANGE(0x0d802, 0x0d802) AM_WRITE(scrollx_hi_w)
443   AM_RANGE(0x0d804, 0x0d804) AM_WRITE(scrollx_lo_w)
444   AM_RANGE(0x0d80a, 0x0d80a) AM_WRITE(output_w)
441   AM_RANGE(0x0d802, 0x0d802) AM_WRITE(panicr_scrollx_hi_w)
442   AM_RANGE(0x0d804, 0x0d804) AM_WRITE(panicr_scrollx_lo_w)
443   AM_RANGE(0x0d80a, 0x0d80a) AM_WRITE(panicr_output_w)
445444   AM_RANGE(0x0d80c, 0x0d80c) AM_WRITEONLY AM_SHARE("spritebank")
446445   AM_RANGE(0x0d818, 0x0d818) AM_WRITENOP // watchdog?
447446   AM_RANGE(0xf0000, 0xfffff) AM_ROM
r243420r243421
520519   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
521520   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
522521
522   PORT_START(T5182COINPORT)
523   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2)
524   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
523525INPUT_PORTS_END
524526
525527
r243420r243421
592594GFXDECODE_END
593595
594596
595TIMER_DEVICE_CALLBACK_MEMBER(panicr_state::scanline)
597TIMER_DEVICE_CALLBACK_MEMBER(panicr_state::panicr_scanline)
596598{
597599   int scanline = param;
598600
r243420r243421
606608static MACHINE_CONFIG_START( panicr, panicr_state )
607609   MCFG_CPU_ADD("maincpu", V20,MASTER_CLOCK/2) /* Sony 8623h9 CXQ70116D-8 (V20 compatible) */
608610   MCFG_CPU_PROGRAM_MAP(panicr_map)
609   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", panicr_state, scanline, "screen", 0, 1)
611   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", panicr_state, panicr_scanline, "screen", 0, 1)
610612
611   MCFG_DEVICE_ADD("t5182", T5182, 0)
612   
613   MCFG_T5182_ADD("t5182")
614   MCFG_FRAGMENT_ADD(t5182)
613615
614616   MCFG_SCREEN_ADD("screen", RASTER)
615617   MCFG_SCREEN_REFRESH_RATE(60)
r243420r243421
617619   MCFG_SCREEN_SIZE(32*8, 32*8)
618620//  MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
619621   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
620   MCFG_SCREEN_UPDATE_DRIVER(panicr_state, screen_update)
622   MCFG_SCREEN_UPDATE_DRIVER(panicr_state, screen_update_panicr)
621623   MCFG_SCREEN_PALETTE("palette")
622624
623625   MCFG_GFXDECODE_ADD("gfxdecode", "palette", panicr)
r243420r243421
641643   ROM_LOAD16_BYTE("2.19m",   0x0f0000, 0x08000, CRC(3d48b0b5) SHA1(a6e8b38971a8964af463c16f32bb7dbd301dd314) )
642644   ROM_LOAD16_BYTE("1.19n",   0x0f0001, 0x08000, CRC(674131b9) SHA1(63499cd5ad39e79e70f3ba7060680f0aa133f095) )
643645
644   ROM_REGION( 0x8000, "t5182_z80", 0 ) /* Toshiba T5182 external ROM */
645   ROM_LOAD( "22d.bin",   0x0000, 0x8000, CRC(eb1a46e1) SHA1(278859ae4bca9f421247e646d789fa1206dcd8fc) )
646   ROM_REGION( 0x10000, "t5182_z80", 0 ) /* Toshiba T5182 module */
647   ROM_LOAD( "t5182.rom", 0x0000, 0x2000, CRC(d354c8fc) SHA1(a1c9e1ac293f107f69cc5788cf6abc3db1646e33) )
648   ROM_LOAD( "22d.bin",   0x8000, 0x8000, CRC(eb1a46e1) SHA1(278859ae4bca9f421247e646d789fa1206dcd8fc) )
646649
647650   ROM_REGION( 0x04000, "gfx1", 0 )
648651   ROM_LOAD( "13f.bin", 0x000000, 0x2000, CRC(4e6b3c04) SHA1(f388969d5d822df0eaa4d8300cbf9cee47468360) )
r243420r243421
679682   ROM_LOAD16_BYTE("2g.19m",   0x0f0000, 0x08000, CRC(cf759403) SHA1(1a0911c943ecc752e46873c9a5da981745f7562d) )
680683   ROM_LOAD16_BYTE("1g.19n",   0x0f0001, 0x08000, CRC(06877f9b) SHA1(8b92209d6422ff2b1f3cb66bd39a3ff84e399eec) )
681684
682   ROM_REGION( 0x10000, "t5182_z80", 0 ) /* Toshiba T5182 external ROM */
683   ROM_LOAD( "22d.bin",   0x0000, 0x8000, CRC(eb1a46e1) SHA1(278859ae4bca9f421247e646d789fa1206dcd8fc) )
685   ROM_REGION( 0x10000, "t5182_z80", 0 ) /* Toshiba T5182 module */
686   ROM_LOAD( "t5182.rom", 0x0000, 0x2000, CRC(d354c8fc) SHA1(a1c9e1ac293f107f69cc5788cf6abc3db1646e33) )
687   ROM_LOAD( "22d.bin",   0x8000, 0x8000, CRC(eb1a46e1) SHA1(278859ae4bca9f421247e646d789fa1206dcd8fc) )
684688
685689   ROM_REGION( 0x04000, "gfx1", 0 )
686690   ROM_LOAD( "13f.bin", 0x000000, 0x2000, CRC(4e6b3c04) SHA1(f388969d5d822df0eaa4d8300cbf9cee47468360) )
r243420r243421
828832}
829833
830834
831GAME( 1986, panicr,  0,      panicr,  panicr, panicr_state,  panicr, ROT270, "Seibu Kaihatsu (Taito license)", "Panic Road (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
832GAME( 1986, panicrg, panicr, panicr,  panicr, panicr_state,  panicr, ROT270, "Seibu Kaihatsu (Tuning license)", "Panic Road (Germany)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
835GAME( 1986, panicr,  0,      panicr,  panicr, panicr_state,  panicr, ROT270, "Seibu Kaihatsu (Taito license)", "Panic Road (Japan)", GAME_IMPERFECT_GRAPHICS )
836GAME( 1986, panicrg, panicr, panicr,  panicr, panicr_state,  panicr, ROT270, "Seibu Kaihatsu (Tuning license)", "Panic Road (Germany)", GAME_IMPERFECT_GRAPHICS )
trunk/src/mame/includes/darkmist.h
r243420r243421
55public:
66   darkmist_state(const machine_config &mconfig, device_type type, const char *tag)
77      : driver_device(mconfig, type, tag),
8      m_maincpu(*this, "maincpu"),
9      m_t5182(*this, "t5182"),
10      m_gfxdecode(*this, "gfxdecode"),
11      m_palette(*this, "palette"),
128      m_spritebank(*this, "spritebank"),
139      m_scroll(*this, "scroll"),
1410      m_videoram(*this, "videoram"),
1511      m_workram(*this, "workram"),
16      m_spriteram(*this, "spriteram") { }
12      m_spriteram(*this, "spriteram"),
13      m_maincpu(*this, "maincpu"),
14      m_t5182(*this, "t5182"),
15      m_gfxdecode(*this, "gfxdecode"),
16      m_palette(*this, "palette") { }
1717
18   required_device<cpu_device> m_maincpu;
19   required_device<t5182_device> m_t5182;
20   required_device<gfxdecode_device> m_gfxdecode;
21   required_device<palette_device> m_palette;
22
2318   required_shared_ptr<UINT8> m_spritebank;
2419   required_shared_ptr<UINT8> m_scroll;
2520   required_shared_ptr<UINT8> m_videoram;
2621   required_shared_ptr<UINT8> m_workram;
2722   required_shared_ptr<UINT8> m_spriteram;
2823
24   required_device<cpu_device> m_maincpu;
25   required_device<t5182_device> m_t5182;
26   required_device<gfxdecode_device> m_gfxdecode;
27   required_device<palette_device> m_palette;
28
2929   int m_hw;
3030   tilemap_t *m_bgtilemap;
3131   tilemap_t *m_fgtilemap;
3232   tilemap_t *m_txtilemap;
3333
34   DECLARE_WRITE8_MEMBER(hw_w);
35
34   DECLARE_WRITE8_MEMBER(darkmist_hw_w);
35   DECLARE_DRIVER_INIT(darkmist);
3636   TILE_GET_INFO_MEMBER(get_bgtile_info);
3737   TILE_GET_INFO_MEMBER(get_fgtile_info);
3838   TILE_GET_INFO_MEMBER(get_txttile_info);
39
40   DECLARE_DRIVER_INIT(darkmist);
4139   virtual void video_start();
4240   DECLARE_PALETTE_INIT(darkmist);
43
44   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
41   UINT32 screen_update_darkmist(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
42   TIMER_DEVICE_CALLBACK_MEMBER(darkmist_scanline);
4543   void decrypt_gfx();
4644   void decrypt_snd();
47   
48   TIMER_DEVICE_CALLBACK_MEMBER(scanline);
4945};
trunk/src/mame/includes/mustache.h
r243420r243421
55public:
66   mustache_state(const machine_config &mconfig, device_type type, const char *tag)
77      : driver_device(mconfig, type, tag),
8      m_videoram(*this, "videoram"),
9      m_spriteram(*this, "spriteram"),
810      m_maincpu(*this, "maincpu"),
911      m_cpu_decrypt(*this, "seibu_sound"),
1012      m_gfxdecode(*this, "gfxdecode"),
1113      m_screen(*this, "screen"),
12      m_palette(*this, "palette"),
13      m_videoram(*this, "videoram"),
14      m_spriteram(*this, "spriteram") { }
14      m_palette(*this, "palette") { }
1515
16   required_shared_ptr<UINT8> m_videoram;
17   required_shared_ptr<UINT8> m_spriteram;
18
1619   required_device<cpu_device> m_maincpu;
1720   required_device<seibu_sound_device> m_cpu_decrypt;
1821   required_device<gfxdecode_device> m_gfxdecode;
1922   required_device<screen_device> m_screen;
2023   required_device<palette_device> m_palette;
2124
22   required_shared_ptr<UINT8> m_videoram;
23   required_shared_ptr<UINT8> m_spriteram;
24
2525   tilemap_t *m_bg_tilemap;
2626   int m_control_byte;
27   
28   DECLARE_WRITE8_MEMBER(videoram_w);
29   DECLARE_WRITE8_MEMBER(video_control_w);
30   DECLARE_WRITE8_MEMBER(scroll_w);
31   
32   TILE_GET_INFO_MEMBER(get_bg_tile_info);
33   
27   DECLARE_WRITE8_MEMBER(mustache_videoram_w);
28   DECLARE_WRITE8_MEMBER(mustache_video_control_w);
29   DECLARE_WRITE8_MEMBER(mustache_scroll_w);
3430   DECLARE_DRIVER_INIT(mustache);
31   TILE_GET_INFO_MEMBER(get_bg_tile_info);
3532   virtual void video_start();
3633   DECLARE_PALETTE_INIT(mustache);
37   
38   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
34   UINT32 screen_update_mustache(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35   TIMER_DEVICE_CALLBACK_MEMBER(mustache_scanline);
3936   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
40   
41   TIMER_DEVICE_CALLBACK_MEMBER(scanline);
4237};
trunk/src/mame/video/buggychl.c
r243420r243421
44
55PALETTE_INIT_MEMBER(buggychl_state, buggychl)
66{
7   int i;
8
79   /* arbitrary blue shading for the sky, estimation */
8   for (int i = 0; i < 128; i++)
10   for (i = 0; i < 128; i++)
911      palette.set_pen_color(i + 128, rgb_t(0, 240-i, 255));
1012}
1113
r243420r243421
7375
7476void buggychl_state::draw_sky( bitmap_ind16 &bitmap, const rectangle &cliprect )
7577{
76   for (int y = 0; y < 256; y++)
77      for (int x = 0; x < 256; x++)
78   int x, y;
79
80   for (y = 0; y < 256; y++)
81      for (x = 0; x < 256; x++)
7882         bitmap.pix16(y, x) = 128 + x / 2;
7983}
8084
r243420r243421
152156
153157void buggychl_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
154158{
159   UINT8 *spriteram = m_spriteram;
155160   int offs;
156161   const UINT8 *gfx;
157162
r243420r243421
164169      const UINT8 *lookup;
165170      const UINT8 *zoomx_rom, *zoomy_rom;
166171
167      sx = m_spriteram[offs + 3] - ((m_spriteram[offs + 2] & 0x80) << 1);
168      sy = 256 - 64 - m_spriteram[offs] + ((m_spriteram[offs + 1] & 0x80) << 1);
169      flipy = m_spriteram[offs + 1] & 0x40;
170      zoom = m_spriteram[offs + 1] & 0x3f;
172      sx = spriteram[offs + 3] - ((spriteram[offs + 2] & 0x80) << 1);
173      sy = 256 - 64 - spriteram[offs] + ((spriteram[offs + 1] & 0x80) << 1);
174      flipy = spriteram[offs + 1] & 0x40;
175      zoom = spriteram[offs + 1] & 0x3f;
171176      zoomy_rom = gfx + (zoom << 6);
172177      zoomx_rom = gfx + 0x2000 + (zoom << 3);
173178
174      lookup = m_sprite_lookup + ((m_spriteram[offs + 2] & 0x7f) << 6);
179      lookup = m_sprite_lookup + ((spriteram[offs + 2] & 0x7f) << 6);
175180
176181      for (y = 0; y < 64; y++)
177182      {
trunk/src/mame/video/darkmist.c
r243420r243421
4848
4949TILE_GET_INFO_MEMBER(darkmist_state::get_txttile_info)
5050{
51   UINT8 *videoram = m_videoram;
5152   int code,attr,pal;
5253
53   code=m_videoram[tile_index];
54   attr=m_videoram[tile_index+0x400];
54   code=videoram[tile_index];
55   attr=videoram[tile_index+0x400];
5556   pal=(attr>>1);
5657
5758   code+=(attr&1)<<8;
r243420r243421
101102   m_txtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(darkmist_state::get_txttile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32 );
102103   m_fgtilemap->set_transparent_pen(0);
103104   m_txtilemap->set_transparent_pen(0);
104   
105   save_item(NAME(m_hw));
106105}
107106
108UINT32 darkmist_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
107UINT32 darkmist_state::screen_update_darkmist(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
109108{
110   
109   UINT8 *spriteram = m_spriteram;
110
111111#define DM_GETSCROLL(n) (((m_scroll[(n)]<<1)&0xff) + ((m_scroll[(n)]&0x80)?1:0) +( ((m_scroll[(n)-1]<<4) | (m_scroll[(n)-1]<<12) )&0xff00))
112112
113113   m_bgtilemap->set_scrollx(0, DM_GETSCROLL(0x2));
r243420r243421
139139      int i,fx,fy,tile,palette;
140140      for(i=0;i<m_spriteram.bytes();i+=32)
141141      {
142         fy=m_spriteram[i+1]&0x40;
143         fx=m_spriteram[i+1]&0x80;
142         fy=spriteram[i+1]&0x40;
143         fx=spriteram[i+1]&0x80;
144144
145         tile=m_spriteram[i+0];
145         tile=spriteram[i+0];
146146
147         if(m_spriteram[i+1]&0x20)
147         if(spriteram[i+1]&0x20)
148148            tile += (*m_spritebank << 8);
149149
150         palette=((m_spriteram[i+1])>>1)&0xf;
150         palette=((spriteram[i+1])>>1)&0xf;
151151
152         if(m_spriteram[i+1]&0x1)
152         if(spriteram[i+1]&0x1)
153153            palette=machine().rand()&15;
154154
155155         palette+=32;
r243420r243421
160160            tile,
161161            palette,
162162            fx,fy,
163            m_spriteram[i+3],m_spriteram[i+2],0 );
163            spriteram[i+3],spriteram[i+2],0 );
164164      }
165165   }
166166
trunk/src/mame/video/mustache.c
r243420r243421
4444   }
4545}
4646
47WRITE8_MEMBER(mustache_state::videoram_w)
47WRITE8_MEMBER(mustache_state::mustache_videoram_w)
4848{
49   m_videoram[offset] = data;
49   UINT8 *videoram = m_videoram;
50   videoram[offset] = data;
5051   m_bg_tilemap->mark_tile_dirty(offset / 2);
5152}
5253
53WRITE8_MEMBER(mustache_state::video_control_w)
54WRITE8_MEMBER(mustache_state::mustache_video_control_w)
5455{
5556   if (flip_screen() != (data & 0x01))
5657   {
r243420r243421
6768   }
6869}
6970
70WRITE8_MEMBER(mustache_state::scroll_w)
71WRITE8_MEMBER(mustache_state::mustache_scroll_w)
7172{
7273   m_bg_tilemap->set_scrollx(0, 0x100 - data);
7374   m_bg_tilemap->set_scrollx(1, 0x100 - data);
r243420r243421
7778
7879TILE_GET_INFO_MEMBER(mustache_state::get_bg_tile_info)
7980{
80   int attr = m_videoram[2 * tile_index + 1];
81   int code = m_videoram[2 * tile_index] + ((attr & 0x60) << 3) + ((m_control_byte & 0x08) << 7);
81   UINT8 *videoram = m_videoram;
82   int attr = videoram[2 * tile_index + 1];
83   int code = videoram[2 * tile_index] + ((attr & 0x60) << 3) + ((m_control_byte & 0x08) << 7);
8284   int color = attr & 0x0f;
8385
8486   SET_TILE_INFO_MEMBER(0, code, color, ((attr & 0x10) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0)   );
r243420r243421
9294         8, 8, 64, 32);
9395
9496   m_bg_tilemap->set_scroll_rows(4);
95   
96   save_item(NAME(m_control_byte));
9797}
9898
9999void mustache_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
r243420r243421
101101   rectangle clip = cliprect;
102102   gfx_element *gfx = m_gfxdecode->gfx(1);
103103   const rectangle &visarea = m_screen->visible_area();
104   UINT8 *spriteram = m_spriteram;
104105   int offs;
105106
106107   for (offs = 0;offs < m_spriteram.bytes();offs += 4)
107108   {
108      int sy = 240-m_spriteram[offs];
109      int sx = 240-m_spriteram[offs+3];
110      int code = m_spriteram[offs+2];
111      int attr = m_spriteram[offs+1];
109      int sy = 240-spriteram[offs];
110      int sx = 240-spriteram[offs+3];
111      int code = spriteram[offs+2];
112      int attr = spriteram[offs+1];
112113      int color = (attr & 0xe0)>>5;
113114
114115      if (sy == 240) continue;
r243420r243421
137138   }
138139}
139140
140UINT32 mustache_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
141UINT32 mustache_state::screen_update_mustache(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
141142{
142143   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
143144   draw_sprites(bitmap, cliprect);
trunk/src/mess/drivers/mbee.c
r243420r243421
9090      work.
9191
9292    - various fdc issues:
93        - B drive doesn't work.
9394        - some disks cause MESS to freeze.
9495        - ENMF pin missing from wd_fdc.
9596        - incorrect timing for track register causes 256tc failure to boot a disk.
trunk/src/mess/drivers/tmtennis.c
r243420r243421
1// license:BSD-3-Clause
2// copyright-holders:hap
3/***************************************************************************
4
5  Tomy Tennis (manufactured in Japan)
6  * board labeled TOMY TN-04 TENNIS
7  * NEC uCOM-44 MCU, labeled D552C 048
8  * VFD display NEC FIP11AM15T (FIP=fluorescent indicator panel)
9
10
11***************************************************************************/
12
13#include "emu.h"
14#include "cpu/ucom4/ucom4.h"
15#include "sound/speaker.h"
16
17#include "tmtennis.lh"
18
19// master clock is from an LC circuit oscillating by default at 360kHz,
20// the difficulty switch puts a capacitor across it to slow it down to 260kHz
21#define MASTER_CLOCK_PRO1 (260000)
22#define MASTER_CLOCK_PRO2 (360000)
23
24
25class tmtennis_state : public driver_device
26{
27public:
28   tmtennis_state(const machine_config &mconfig, device_type type, const char *tag)
29      : driver_device(mconfig, type, tag),
30      m_maincpu(*this, "maincpu"),
31      m_speaker(*this, "speaker")
32   { }
33
34   required_device<cpu_device> m_maincpu;
35   required_device<speaker_sound_device> m_speaker;
36
37   virtual void machine_start();
38};
39
40
41
42/***************************************************************************
43
44  I/O
45
46***************************************************************************/
47
48
49
50/***************************************************************************
51
52  Inputs
53
54***************************************************************************/
55
56static INPUT_PORTS_START( tmtennis )
57INPUT_PORTS_END
58
59
60
61/***************************************************************************
62
63  Machine Config
64
65***************************************************************************/
66
67void tmtennis_state::machine_start()
68{
69}
70
71
72static MACHINE_CONFIG_START( tmtennis, tmtennis_state )
73
74   /* basic machine hardware */
75   MCFG_CPU_ADD("maincpu", NEC_D552, MASTER_CLOCK_PRO2)
76
77   MCFG_DEFAULT_LAYOUT(layout_tmtennis)
78
79   /* no video! */
80
81   /* sound hardware */
82   MCFG_SPEAKER_STANDARD_MONO("mono")
83   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
84   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
85MACHINE_CONFIG_END
86
87
88
89/***************************************************************************
90
91  Game driver(s)
92
93***************************************************************************/
94
95ROM_START( tmtennis )
96   ROM_REGION( 0x0400, "maincpu", 0 )
97   ROM_LOAD( "d552c-048", 0x0000, 0x0400, CRC(78702003) SHA1(4d427d4dbeed901770c682338867f58c7b54eee3) )
98ROM_END
99
100
101CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tomytronic Tennis", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
trunk/src/mess/includes/mbee.h
r243420r243421
151151   DECLARE_QUICKLOAD_LOAD_MEMBER( mbee_z80bin );
152152   WRITE_LINE_MEMBER(fdc_intrq_w);
153153   WRITE_LINE_MEMBER(fdc_drq_w);
154   DECLARE_FLOPPY_FORMATS(floppy_formats);
155154   UINT8 *m_p_videoram;
156155   UINT8 *m_p_gfxram;
157156   UINT8 *m_p_colorram;
r243420r243421
183182   UINT8 m_sy6545_reg[32];
184183   UINT8 m_sy6545_ind;
185184   UINT8 m_fdc_rq;
186   void mbee256_setup_banks(UINT8 data);
185   UINT8 m_bank_array[33];
186   void mbee256_setup_banks(UINT8 data, bool first_time);
187187   void sy6545_cursor_configure();
188188   void keyboard_matrix_r(int offs);
189189   void machine_reset_common_disk();
trunk/src/mess/layout/tmtennis.lay
r243420r243421
1<?xml version="1.0"?>
2<mamelayout version="2">
3
4<!-- define elements -->
5
6   <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
7
8
9<!-- build screen -->
10
11   <view name="Internal Layout">
12      <bounds left="0" right="100" top="0" bottom="100" />
13      <bezel element="static_black">
14         <bounds left="0" right="100" top="0" bottom="100" />
15      </bezel>
16
17
18   </view>
19</mamelayout>
trunk/src/mess/machine/mbee.c
r243420r243421
274274
275275************************************************************/
276276
277void mbee_state::mbee256_setup_banks(UINT8 data)
277void mbee_state::mbee256_setup_banks(UINT8 data, bool first_time)
278278{
279279   // (bits 0-5 are referred to as S0-S5)
280280   address_space &mem = m_maincpu->space(AS_PROGRAM);
281281   UINT8 *prom = memregion("proms")->base();
282282   UINT8 b_data = BITSWAP8(data, 7,5,3,2,4,6,1,0) & 0x3b; // arrange data bits to S0,S1,-,S4,S2,S3
283   UINT8 b_bank, b_byte, b_byte_t, b_addr;
283   UINT8 b_bank, b_byte, b_byte_t, b_addr, p_bank = 1;
284284   UINT16 b_vid;
285285   char banktag[10];
286286
287   for (b_bank = 0; b_bank < 16; b_bank++)
287   if (first_time || (b_data != m_bank_array[0]))
288288   {
289      b_vid = b_bank << 12;
290      mem.unmap_readwrite (b_vid, b_vid + 0xfff);
291      b_addr = BITSWAP8(b_bank, 7,4,5,3,1,2,6,0) & 0x1f; // arrange address bits to A12,-,A14,A13,A15
289      m_bank_array[0] = b_data;
292290
293      // Calculate read-bank
294      b_byte_t = prom[b_addr | (b_data << 8) | 0x82]; // read-bank (RDS and MREQ are low, RFSH is high)
295      b_byte = BITSWAP8(b_byte_t, 7,5,0,3,6,2,1,4); // rearrange so that bits 0-2 are rambank, bit 3 = rom select, bit 4 = video select, others not used
296      if (!BIT(data, 5))
297         b_byte &= 0xfb;  // U42/1 - S17 only valid if S5 is on
298      if (!BIT(b_byte, 4))
291      for (b_bank = 0; b_bank < 16; b_bank++)
299292      {
300         // select video
301         mem.install_read_handler (b_vid, b_vid + 0x7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this));
302         mem.install_read_handler (b_vid + 0x800, b_vid + 0xfff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this));
303      }
304      else
305      {
306         sprintf(banktag, "bankr%d", b_bank);
307         mem.install_read_bank( b_vid, b_vid+0xfff, banktag );
293         b_vid = b_bank << 12;
294         b_addr = BITSWAP8(b_bank, 7,4,5,3,1,2,6,0) & 0x1f; // arrange address bits to A12,-,A14,A13,A15
308295
309         if (!BIT(b_byte, 3))
310            membank(banktag)->set_entry(64 + (b_bank & 3)); // read from rom
311         else
312            membank(banktag)->set_entry((b_bank & 7) | ((b_byte & 7) << 3)); // ram
313      }
296         // Calculate read-bank
297         b_byte_t = prom[b_addr | (b_data << 8) | 0x82]; // read-bank (RDS and MREQ are low, RFSH is high)
298         b_byte = BITSWAP8(b_byte_t, 7,5,0,3,6,2,1,4); // rearrange so that bits 0-2 are rambank, bit 3 = rom select, bit 4 = video select, others not used
314299
315      // Calculate write-bank
316      b_byte_t = prom[b_addr | (b_data << 8) | 0xc0]; // write-bank (XWR and MREQ are low, RFSH is high)
317      b_byte = BITSWAP8(b_byte_t, 7,5,0,3,6,2,1,4); // rearrange so that bits 0-2 are rambank, bit 3 = rom select, bit 4 = video select, others not used
318      if (!BIT(data, 5))
319         b_byte &= 0xfb;  // U42/1 - S17 only valid if S5 is on
320      if (!BIT(b_byte, 4))
321      {
322         // select video
323         mem.install_write_handler (b_vid, b_vid + 0x7ff, write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this));
324         mem.install_write_handler (b_vid + 0x800, b_vid + 0xfff, write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this));
325      }
326      else
327      {
328         sprintf(banktag, "bankw%d", b_bank);
329         mem.install_write_bank( b_vid, b_vid+0xfff, banktag );
300         if (first_time || (b_byte != m_bank_array[p_bank]))
301         {
302            m_bank_array[p_bank] = b_byte;
330303
331         if (!BIT(b_byte, 3))
332            membank(banktag)->set_entry(64); // write to rom dummy area
333         else
334            membank(banktag)->set_entry((b_bank & 7) | ((b_byte & 7) << 3)); // ram
304            if (!BIT(data, 5))
305               b_byte &= 0xfb;  // U42/1 - S17 only valid if S5 is on
306
307            mem.unmap_read (b_vid, b_vid + 0xfff);
308
309            if (!BIT(b_byte, 4))
310            {
311               // select video
312               mem.install_read_handler (b_vid, b_vid + 0x7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this));
313               mem.install_read_handler (b_vid + 0x800, b_vid + 0xfff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this));
314            }
315            else
316            {
317               sprintf(banktag, "bankr%d", b_bank);
318               mem.install_read_bank( b_vid, b_vid+0xfff, banktag );
319
320               if (!BIT(b_byte, 3))
321                  membank(banktag)->set_entry(64 + (b_bank & 3)); // read from rom
322               else
323                  membank(banktag)->set_entry((b_bank & 7) | ((b_byte & 7) << 3)); // ram
324            }
325         }
326         p_bank++;
327
328         // Calculate write-bank
329         b_byte_t = prom[b_addr | (b_data << 8) | 0xc0]; // write-bank (XWR and MREQ are low, RFSH is high)
330         b_byte = BITSWAP8(b_byte_t, 7,5,0,3,6,2,1,4); // rearrange so that bits 0-2 are rambank, bit 3 = rom select, bit 4 = video select, others not used
331
332         if (first_time || (b_byte != m_bank_array[p_bank]))
333         {
334            m_bank_array[p_bank] = b_byte;
335
336            if (!BIT(data, 5))
337               b_byte &= 0xfb;  // U42/1 - S17 only valid if S5 is on
338
339            mem.unmap_write (b_vid, b_vid + 0xfff);
340
341            if (!BIT(b_byte, 4))
342            {
343               // select video
344               mem.install_write_handler (b_vid, b_vid + 0x7ff, write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this));
345               mem.install_write_handler (b_vid + 0x800, b_vid + 0xfff, write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this));
346            }
347            else
348            {
349               sprintf(banktag, "bankw%d", b_bank);
350               mem.install_write_bank( b_vid, b_vid+0xfff, banktag );
351
352               if (!BIT(b_byte, 3))
353                  membank(banktag)->set_entry(64); // write to rom dummy area
354               else
355                  membank(banktag)->set_entry((b_bank & 7) | ((b_byte & 7) << 3)); // ram
356            }
357         }
358         p_bank++;
335359      }
336360   }
337361}
338362
339363WRITE8_MEMBER( mbee_state::mbee256_50_w )
340364{
341   mbee256_setup_banks(data & 0x3f);
365   mbee256_setup_banks(data & 0x3f, 0);
342366}
343367
344368/***********************************************************
r243420r243421
356380
357381WRITE8_MEMBER( mbee_state::mbee128_50_w )
358382{
359   mbee256_setup_banks(data & 0x1f); // S5 not used
383   mbee256_setup_banks(data & 0x1f, 0); // S5 not used
360384}
361385
362386
r243420r243421
476500MACHINE_RESET_MEMBER( mbee_state, mbee128 )
477501{
478502   machine_reset_common_disk();
479   mbee256_setup_banks(0); // set banks to default
503   mbee256_setup_banks(0, 1); // set banks to default
480504   m_maincpu->set_pc(0x8000);
481505}
482506
r243420r243421
486510   for (i = 0; i < 15; i++) m_mbee256_was_pressed[i] = 0;
487511   m_mbee256_q_pos = 0;
488512   machine_reset_common_disk();
489   mbee256_setup_banks(0); // set banks to default
513   mbee256_setup_banks(0, 1); // set banks to default
490514   m_maincpu->set_pc(0x8000);
491515}
492516
trunk/src/mess/mess.lst
r243420r243421
26092609unk3403
26102610elecdet
26112611wildfire
2612tmtennis
trunk/src/mess/mess.mak
r243420r243421
17881788   $(MESS_DRIVERS)/tiki100.o   \
17891789
17901790$(MESSOBJ)/tomy.a:              \
1791   $(MESS_DRIVERS)/tmtennis.o  \
17921791   $(MESS_DRIVERS)/tutor.o     \
17931792
17941793$(MESSOBJ)/toshiba.a:           \
r243420r243421
22092208$(MESS_DRIVERS)/tk80.o:     $(MESS_LAYOUT)/tk80.lh
22102209$(MESS_DRIVERS)/tm990189.o: $(MESS_LAYOUT)/tm990189.lh \
22112210                     $(MESS_LAYOUT)/tm990189v.lh
2212$(MESS_DRIVERS)/tmtennis.o: $(MESS_LAYOUT)/tmtennis.lh
22132211$(MESS_DRIVERS)/unixpc.o:   $(MESS_LAYOUT)/unixpc.lh
22142212$(MESS_DRIVERS)/ut88.o:     $(MESS_LAYOUT)/ut88mini.lh
22152213$(MESS_DRIVERS)/vboy.o:     $(MESS_LAYOUT)/vboy.lh


Previous 199869 Revisions Next


© 1997-2024 The MAME Team