Previous 199869 Revisions Next

r32629 Friday 10th October, 2014 at 17:14:00 UTC by David Haywood
begin st0016 reorganization (nw)
[src/emu/sound]st0016.c
[src/mame]mame.mak
[src/mame/drivers]jclub2.c macs.c speglsht.c srmp5.c st0016.c
[src/mame/machine]st0016.c* st0016.h*

trunk/src/mame/drivers/speglsht.c
r32628r32629
104104*/
105105
106106#include "emu.h"
107#include "cpu/z80/z80.h"
107#include "machine/st0016.h"
108108#include "cpu/mips/r3000.h"
109#include "sound/st0016.h"
110109#include "includes/st0016.h"
111110
112111
r32628r32629
144143   AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w)
145144   AM_RANGE(0xe000, 0xe7ff) AM_RAM
146145   AM_RANGE(0xe800, 0xe87f) AM_RAM
147   AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w)
146   //AM_RANGE(0xe900, 0xe9ff) // sound - internal
148147   AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w)
149148   AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w)
150149   AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("shared")
r32628r32629
321320static GFXDECODE_START( speglsht )
322321GFXDECODE_END
323322
324static const st0016_interface st0016_config =
325{
326   &st0016_charram
327};
328323
329324MACHINE_RESET_MEMBER(speglsht_state,speglsht)
330325{
r32628r32629
380375
381376static MACHINE_CONFIG_START( speglsht, speglsht_state )
382377   /* basic machine hardware */
383   MCFG_CPU_ADD("maincpu",Z80, 8000000) /* 8 MHz ? */
378   MCFG_CPU_ADD("maincpu",ST0016_CPU, 8000000) /* 8 MHz ? */
384379   MCFG_CPU_PROGRAM_MAP(st0016_mem)
385380   MCFG_CPU_IO_MAP(st0016_io)
386381
r32628r32629
407402
408403   MCFG_VIDEO_START_OVERRIDE(speglsht_state,speglsht)
409404
410   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
411
412   MCFG_ST0016_ADD("stsnd", 0)
413   MCFG_SOUND_CONFIG(st0016_config)
414   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
415   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
416405MACHINE_CONFIG_END
417406
418407ROM_START( speglsht )
trunk/src/mame/drivers/srmp5.c
r32628r32629
3535
3636
3737#include "emu.h"
38#include "cpu/z80/z80.h"
38#include "machine/st0016.h"
3939#include "cpu/mips/r3000.h"
40#include "sound/st0016.h"
4140#include "includes/st0016.h"
4241
4342#define DEBUG_CHAR
r32628r32629
370369static ADDRESS_MAP_START( st0016_mem, AS_PROGRAM, 8, srmp5_state )
371370   AM_RANGE(0x0000, 0x7fff) AM_ROM
372371   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
373   AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w)
372   //AM_RANGE(0xe900, 0xe9ff) // sound - internal
374373   AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w)
375374   AM_RANGE(0xf000, 0xffff) AM_RAM
376375ADDRESS_MAP_END
r32628r32629
497496
498497INPUT_PORTS_END
499498
500static const st0016_interface st0016_config =
501{
502   &st0016_charram
503};
504499
505500static const gfx_layout tile_16x8x8_layout =
506501{
r32628r32629
534529static MACHINE_CONFIG_START( srmp5, srmp5_state )
535530
536531   /* basic machine hardware */
537   MCFG_CPU_ADD("maincpu",Z80,8000000)
532   MCFG_CPU_ADD("maincpu",ST0016_CPU,8000000)
538533   MCFG_CPU_PROGRAM_MAP(st0016_mem)
539534   MCFG_CPU_IO_MAP(st0016_io)
540535   MCFG_CPU_VBLANK_INT_DRIVER("screen", srmp5_state,  irq0_line_hold)
r32628r32629
559554#endif
560555   MCFG_VIDEO_START_OVERRIDE(st0016_state,st0016)
561556
562   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
563
564   MCFG_ST0016_ADD("stsnd", 0)
565   MCFG_SOUND_CONFIG(st0016_config)
566   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
567   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
568557MACHINE_CONFIG_END
569558
570559ROM_START( srmp5 )
trunk/src/mame/drivers/macs.c
r32628r32629
5656*/
5757
5858#include "emu.h"
59#include "cpu/z80/z80.h"
60#include "sound/st0016.h"
59#include "machine/st0016.h"
6160#include "includes/st0016.h"
6261
6362
r32628r32629
9493   AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w)
9594   AM_RANGE(0xe000, 0xe7ff) AM_RAM /* work ram ? */
9695   AM_RANGE(0xe800, 0xe87f) AM_RAM AM_SHARE("ram2")
97   AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w)
96   //AM_RANGE(0xe900, 0xe9ff) // sound - internal
9897   AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w)
9998   AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w)
10099   AM_RANGE(0xf000, 0xf7ff) AM_RAMBANK("bank3") /* common /backup ram ?*/
r32628r32629
470469INPUT_PORTS_END
471470
472471
473static const st0016_interface st0016_config =
474{
475   &st0016_charram
476};
477472
473
478474static MACHINE_CONFIG_START( macs, macs_state )
479475   /* basic machine hardware */
480   MCFG_CPU_ADD("maincpu",Z80,8000000) /* 8 MHz ? */
476   MCFG_CPU_ADD("maincpu",ST0016_CPU,8000000) /* 8 MHz ? */
481477   MCFG_CPU_PROGRAM_MAP(macs_mem)
482478   MCFG_CPU_IO_MAP(macs_io)
483479
r32628r32629
498494   MCFG_PALETTE_ADD("palette", 16*16*4+1)
499495
500496   MCFG_VIDEO_START_OVERRIDE(st0016_state,st0016)
501
502   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
503
504   MCFG_ST0016_ADD("stsnd", 0)
505   MCFG_SOUND_CONFIG(st0016_config)
506   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
507   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
508497MACHINE_CONFIG_END
509498
510499
trunk/src/mame/drivers/st0016.c
r32628r32629
1414#include "cpu/z80/z80.h"
1515#include "sound/st0016.h"
1616#include "includes/st0016.h"
17#include "machine/st0016.h"
1718
1819
19
2020UINT32 st0016_rom_bank;
2121
2222/*************************************
r32628r32629
3232   AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w)
3333   AM_RANGE(0xe000, 0xe7ff) AM_RAM
3434   AM_RANGE(0xe800, 0xe87f) AM_RAM /* common ram */
35   AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) /* sound regs 8 x $20 bytes, see notes */
35   //AM_RANGE(0xe900, 0xe9ff) // sound - internal
3636   AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w)
3737   AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w)
3838   AM_RANGE(0xf000, 0xffff) AM_RAM /* work ram */
r32628r32629
395395         m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
396396}
397397
398static const st0016_interface st0016_config =
399{
400   &st0016_charram
401};
402398
403399
400
404401/*************************************
405402 *
406403 *  Machine driver(s)
r32628r32629
409406
410407static MACHINE_CONFIG_START( st0016, st0016_state )
411408   /* basic machine hardware */
412   MCFG_CPU_ADD("maincpu",Z80,8000000) /* 8 MHz ? */
409   MCFG_CPU_ADD("maincpu",ST0016_CPU,8000000) /* 8 MHz ? */
413410   MCFG_CPU_PROGRAM_MAP(st0016_mem)
414411   MCFG_CPU_IO_MAP(st0016_io)
415412   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", st0016_state, st0016_int, "screen", 0, 1)
r32628r32629
428425
429426   MCFG_VIDEO_START_OVERRIDE(st0016_state,st0016)
430427
431   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
432
433   MCFG_ST0016_ADD("stsnd", 0)
434   MCFG_SOUND_CONFIG(st0016_config)
435   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
436   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
437428MACHINE_CONFIG_END
438429
439430static MACHINE_CONFIG_DERIVED( mayjinsn, st0016 )
trunk/src/mame/drivers/jclub2.c
r32628r32629
9696#include "cpu/m68000/m68000.h"
9797#include "machine/eepromser.h"
9898#include "sound/okim6295.h"
99#include "sound/st0016.h"
10099#include "includes/st0016.h"
101#include "cpu/z80/z80.h"
100#include "machine/st0016.h"
102101#include "video/st0020.h"
103102#include "machine/nvram.h"
104103
r32628r32629
10381037static ADDRESS_MAP_START( st0016_mem, AS_PROGRAM, 8, darkhors_state )
10391038   AM_RANGE(0x0000, 0x7fff) AM_ROM
10401039   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
1041   AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w)
1040   //AM_RANGE(0xe900, 0xe9ff) // sound - internal
10421041   AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w)
10431042   AM_RANGE(0xe82f, 0xe830) AM_READNOP
10441043   AM_RANGE(0xf000, 0xffff) AM_RAM
r32628r32629
10551054   //AM_RANGE(0xf0, 0xf0) AM_READ(st0016_dma_r)
10561055ADDRESS_MAP_END
10571056
1058static const st0016_interface st0016_config =
1059{
1060   &st0016_charram
1061};
10621057
10631058VIDEO_START_MEMBER(darkhors_state,jclub2o)
10641059{
r32628r32629
10751070   MCFG_CPU_PROGRAM_MAP(jclub2o_map)
10761071   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkhors_state, darkhors_irq, "screen", 0, 1)
10771072
1078   MCFG_CPU_ADD("st0016",Z80,8000000)
1073   MCFG_CPU_ADD("st0016",ST0016_CPU,8000000)
10791074   MCFG_CPU_PROGRAM_MAP(st0016_mem)
10801075   MCFG_CPU_IO_MAP(st0016_io)
10811076   MCFG_CPU_VBLANK_INT_DRIVER("screen", darkhors_state,  irq0_line_hold)
r32628r32629
11041099
11051100   MCFG_VIDEO_START_OVERRIDE(darkhors_state,jclub2o)
11061101
1107   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1108
1109   MCFG_ST0016_ADD("stsnd", 0)
1110   MCFG_SOUND_CONFIG(st0016_config)
1111   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
1112   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
11131102MACHINE_CONFIG_END
11141103
11151104
trunk/src/mame/machine/st0016.c
r0r32629
1/* ST0016 - CPU (z80) + Sound + Video */
2
3#include "st0016.h"
4
5const device_type ST0016_CPU = &device_creator<st0016_cpu_device>;
6
7
8static ADDRESS_MAP_START(st0016_cpu_internal_map, AS_PROGRAM, 8, st0016_cpu_device)
9   AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) /* sound regs 8 x $20 bytes, see notes */
10ADDRESS_MAP_END
11
12
13static ADDRESS_MAP_START(st0016_cpu_internal_io_map, AS_IO, 8, st0016_cpu_device)
14ADDRESS_MAP_END
15
16
17st0016_cpu_device::st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
18   : z80_device(mconfig, ST0016_CPU, "ST0016", tag, owner, clock, "st0016_cpu", __FILE__),
19       m_io_space_config("io", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_io_map)),
20     m_space_config("regs", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_map))
21{
22}
23
24
25
26//-------------------------------------------------
27//  device_start - device-specific startup
28//-------------------------------------------------
29
30void st0016_cpu_device::device_start()
31{
32   z80_device::device_start();
33}
34
35
36//-------------------------------------------------
37//  device_reset - device-specific reset
38//-------------------------------------------------
39
40void st0016_cpu_device::device_reset()
41{
42   z80_device::device_reset();
43}
44
45static const st0016_interface st0016_config =
46{
47   &st0016_charram
48};
49
50/* CPU interface */
51static MACHINE_CONFIG_FRAGMENT( st0016_cpu )
52   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
53
54   MCFG_ST0016_ADD("stsnd", 0)
55   MCFG_SOUND_CONFIG(st0016_config)
56   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
57   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
58
59MACHINE_CONFIG_END
60
61machine_config_constructor st0016_cpu_device::device_mconfig_additions() const
62{
63   return MACHINE_CONFIG_NAME( st0016_cpu );
64}
65
66
Property changes on: trunk/src/mame/machine/st0016.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mame/machine/st0016.h
r0r32629
1/* ST0016 - CPU (z80) + Sound + Video */
2
3#pragma once
4
5#ifndef __ST0016_CPU__
6#define __ST0016_CPU__
7
8#include "emu.h"
9#include "cpu/z80/z80.h"
10#include "sound/st0016.h"
11
12extern UINT8 *st0016_charram;
13
14
15class st0016_cpu_device : public z80_device
16{
17public:
18   st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32);
19
20protected:
21   // device-level overrides
22   virtual machine_config_constructor device_mconfig_additions() const;
23   virtual void device_start();
24   virtual void device_reset();
25
26   const address_space_config m_io_space_config;
27   const address_space_config m_space_config;
28
29
30   const address_space_config *memory_space_config(address_spacenum spacenum) const
31   {
32      switch (spacenum)
33      {
34         case AS_IO: return &m_io_space_config;
35         case AS_PROGRAM: return &m_space_config;
36         default: return z80_device::memory_space_config(spacenum);
37      }
38   }
39
40
41private:
42
43};
44
45
46// device type definition
47extern const device_type ST0016_CPU;
48
49
50#endif /// __ST0016_CPU__
Property changes on: trunk/src/mame/machine/st0016.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mame/mame.mak
r32628r32629
17911791   $(DRIVERS)/srmp6.o \
17921792   $(DRIVERS)/ssv.o $(VIDEO)/ssv.o \
17931793   $(VIDEO)/st0020.o \
1794   $(DRIVERS)/st0016.o $(VIDEO)/st0016.o \
1794   $(MACHINE)/st0016.o $(DRIVERS)/st0016.o $(VIDEO)/st0016.o \
17951795   $(VIDEO)/seta001.o \
17961796
17971797$(MAMEOBJ)/sigma.a: \
trunk/src/emu/sound/st0016.c
r32628r32629
2323//-------------------------------------------------
2424
2525st0016_device::st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
26   : device_t(mconfig, ST0016, "ST0016", tag, owner, clock, "st0016", __FILE__),
26   : device_t(mconfig, ST0016, "ST0016 (Audio)", tag, owner, clock, "st0016_audio", __FILE__),
2727      device_sound_interface(mconfig, *this),
2828      m_stream(NULL),
2929      m_sound_ram(NULL)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team