Previous 199869 Revisions Next

r32293 Monday 22nd September, 2014 at 18:39:21 UTC by David Haywood
legionna re-org sound writes (nw)
[src/mame/drivers]legionna.c
[src/mame/includes]legionna.h
[src/mame/machine]seicop.c

trunk/src/mame/drivers/legionna.c
r32292r32293
7272
7373#include "emu.h"
7474#include "cpu/z80/z80.h"
75#include "audio/seibu.h"
7675#include "sound/3812intf.h"
7776#include "cpu/m68000/m68000.h"
7877#include "machine/seicop.h"
r32292r32293
8079
8180/*****************************************************************************/
8281
82READ16_MEMBER(legionna_state::sound_comms_r)
83{
84   return m_seibu_sound->main_word_r(space,(offset >> 1) & 7,0xffff);
85}
8386
87WRITE16_MEMBER(legionna_state::sound_comms_w)
88{
89   m_seibu_sound->main_word_w(space,(offset >> 1) & 7,data,0x00ff);
90}
91
8492static ADDRESS_MAP_START( legionna_cop_mem, AS_PROGRAM, 16, legionna_state )
8593//   AM_RANGE(0x10041c, 0x10041d) AM_WRITE(cop_angle_target_w) // angle target (for 0x6200 COP macro)
8694//   AM_RANGE(0x10041e, 0x10041f) AM_WRITE(cop_angle_step_w)   // angle step   (for 0x6200 COP macro)
r32292r32293
131139   AM_RANGE(0x000000, 0x07ffff) AM_ROM
132140   AM_RANGE(0x100000, 0x1003ff) AM_RAM
133141   AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
142   AM_RANGE(0x100700, 0x10071f) AM_READWRITE(sound_comms_r,sound_comms_w)
134143   AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, legionna_mcu_r, legionna_mcu_w) AM_SHARE("cop_mcu_ram")    /* COP mcu */
135144   AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
136145   AM_RANGE(0x101800, 0x101fff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
r32292r32293
148157   AM_RANGE(0x000000, 0x07ffff) AM_ROM
149158   AM_RANGE(0x100000, 0x1003ff) AM_RAM
150159   AM_RANGE(0x100640, 0x10068f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
160   AM_RANGE(0x1007c0, 0x1007df) AM_READWRITE(sound_comms_r,sound_comms_w)
151161   AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, heatbrl_mcu_r, heatbrl_mcu_w) AM_SHARE("cop_mcu_ram")  /* COP mcu */
152162   AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
153163   AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
r32292r32293
163173   AM_RANGE(0x000000, 0x07ffff) AM_ROM
164174   AM_RANGE(0x100000, 0x1003ff) AM_RAM
165175   AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
176   AM_RANGE(0x100700, 0x10071f) AM_READWRITE(sound_comms_r,sound_comms_w)
166177   AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, godzilla_mcu_r, godzilla_mcu_w) AM_SHARE("cop_mcu_ram")    /* COP mcu */
167178   AM_RANGE(0x100800, 0x100fff) AM_RAM
168179   AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
r32292r32293
192203   AM_RANGE(0x000000, 0x0fffff) AM_ROM
193204   AM_RANGE(0x100000, 0x1003ff) AM_RAM
194205   AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
206   AM_RANGE(0x100700, 0x10071f) AM_READWRITE(sound_comms_r,sound_comms_w)
195207   AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, denjinmk_mcu_r, denjinmk_mcu_w) AM_SHARE("cop_mcu_ram")    /* COP mcu */
196208   AM_RANGE(0x100800, 0x100fff) AM_RAM
197209   AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
r32292r32293
211223   AM_RANGE(0x000000, 0x0fffff) AM_ROM
212224   AM_RANGE(0x100000, 0x1003ff) AM_RAM
213225   AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
226   AM_RANGE(0x100700, 0x10071f) AM_READWRITE(sound_comms_r,sound_comms_w)
214227   AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, grainbow_mcu_r, grainbow_mcu_w) AM_SHARE("cop_mcu_ram")    /* COP mcu */
215228   AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
216229   AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
r32292r32293
229242   AM_RANGE(0x000000, 0x0fffff) AM_ROM
230243   AM_RANGE(0x100000, 0x1003ff) AM_RAM
231244   AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
245   AM_RANGE(0x100700, 0x10071f) AM_READWRITE(sound_comms_r,sound_comms_w)
232246   AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, cupsoc_mcu_r,cupsoc_mcu_w) AM_SHARE("cop_mcu_ram")
233247   AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
234248   AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
r32292r32293
251265   AM_RANGE(0x100000, 0x1003ff) AM_RAM
252266   AM_RANGE(0x100600, 0x10060f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)//?
253267   AM_RANGE(0x100640, 0x10067f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
268   AM_RANGE(0x100740, 0x10075f) AM_READWRITE(sound_comms_r,sound_comms_w)
254269   AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, cupsocs_mcu_r,cupsocs_mcu_w) AM_SHARE("cop_mcu_ram")
255270   AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data")
256271   AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data")
trunk/src/mame/machine/seicop.c
r32292r32293
15931593
15941594#include "emu.h"
15951595#include "includes/legionna.h"
1596#include "includes/raiden2.h"
15971596#include "machine/seicop.h"
15981597
15991598
r32292r32293
28852884
28862885READ16_MEMBER( seibu_cop_legacy_device::heatbrl_mcu_r )
28872886{
2888   if(offset >= 0x3c0/2 && offset <= 0x3df/2)
2889         return space.machine().device<seibu_sound_device>("seibu_sound")->main_word_r(space,(offset >> 1) & 7,0xffff);
2890
28912887   if(offset >= 0x340/2 && offset <= 0x34f/2)
28922888   {
28932889      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
r32292r32293
29142910
29152911
29162912
2917   if(offset >= 0x3c0/2 && offset <= 0x3df/2)
2918   {
2919      space.machine().device<seibu_sound_device>("seibu_sound")->main_word_w(space,(offset >> 1) & 7,m_cop_mcu_ram[offset],0x00ff);
2920      return;
2921   }
2922
29232913   generic_cop_w(space, offset, data, mem_mask);
29242914
29252915}
r32292r32293
29312921
29322922READ16_MEMBER( seibu_cop_legacy_device::cupsoc_mcu_r )
29332923{
2934   if(offset >= 0x300/2 && offset <= 0x31f/2)
2935      return space.machine().device<seibu_sound_device>("seibu_sound")->main_word_r(space,(offset >> 1) & 7,0xffff);
2936
29372924   if(offset >= 0x340/2 && offset <= 0x34f/2)
29382925   {
29392926      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
r32292r32293
29562943   if(offset == 0x280/2) //irq ack / sprite buffering?
29572944      return;
29582945
2959   if(offset >= 0x300/2 && offset <= 0x31f/2)
2960   {
2961      space.machine().device<seibu_sound_device>("seibu_sound")->main_word_w(space,(offset >> 1) & 7,m_cop_mcu_ram[offset],0x00ff);
2962      return;
2963   }
2964
29652946   generic_cop_w(space, offset, data, mem_mask);
29662947}
29672948
29682949READ16_MEMBER( seibu_cop_legacy_device::cupsocs_mcu_r )
29692950{
2970   if(offset >= 0x340/2 && offset <= 0x35f/2)
2971      return space.machine().device<seibu_sound_device>("seibu_sound")->main_word_r(space,(offset >> 1) & 7,0xffff);
29722951
29732952   if(offset >= 0x300/2 && offset <= 0x30f/2)
29742953   {
r32292r32293
29932972      return;
29942973
29952974
2996
2997   if(offset >= 0x340/2 && offset <= 0x35f/2)
2998   {
2999      space.machine().device<seibu_sound_device>("seibu_sound")->main_word_w(space,(offset >> 1) & 7,m_cop_mcu_ram[offset],0x00ff);
3000      return;
3001   }
3002
30032975   generic_cop_w(space, offset, data, mem_mask);
30042976}
30052977
r32292r32293
30092981
30102982READ16_MEMBER( seibu_cop_legacy_device::godzilla_mcu_r )
30112983{
3012   if(offset >= 0x300/2 && offset <= 0x31f/2)
3013      return space.machine().device<seibu_sound_device>("seibu_sound")->main_word_r(space,(offset >> 1) & 7,0xffff);
30142984
30152985   if(offset >= 0x340/2 && offset <= 0x34f/2)
30162986   {
r32292r32293
30363006      return;
30373007
30383008
3039   if(offset >= 0x300/2 && offset <= 0x31f/2)
3040   {
3041      space.machine().device<seibu_sound_device>("seibu_sound")->main_word_w(space,(offset >> 1) & 7,m_cop_mcu_ram[offset],0x00ff);
3042      return;
3043   }
3044
30453009   generic_cop_w(space, offset, data, mem_mask);
30463010}
30473011
r32292r32293
30513015
30523016READ16_MEMBER( seibu_cop_legacy_device::denjinmk_mcu_r )
30533017{
3054   if(offset >= 0x300/2 && offset <= 0x31f/2)
3055      return space.machine().device<seibu_sound_device>("seibu_sound")->main_word_r(space,(offset >> 1) & 7,0xffff);
30563018
30573019   if(offset >= 0x340/2 && offset <= 0x34f/2)
30583020   {
r32292r32293
30833045   }
30843046
30853047
3086   if(offset >= 0x300/2 && offset <= 0x31f/2)
3087   {
3088      space.machine().device<seibu_sound_device>("seibu_sound")->main_word_w(space,(offset >> 1) & 7,m_cop_mcu_ram[offset],0x00ff);
3089      return;
3090   }
3091
30923048   generic_cop_w(space, offset, data, mem_mask);
30933049}
30943050
r32292r32293
30983054
30993055READ16_MEMBER( seibu_cop_legacy_device::grainbow_mcu_r )
31003056{
3101   if(offset >= 0x300/2 && offset <= 0x31f/2)
3102      return space.machine().device<seibu_sound_device>("seibu_sound")->main_word_r(space,(offset >> 1) & 7,0xffff);
3103
31043057   if(offset >= 0x340/2 && offset <= 0x34f/2)
31053058   {
31063059      static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
r32292r32293
31253078      return;
31263079
31273080
3128   if(offset >= 0x300/2 && offset <= 0x31f/2)
3129   {
3130      space.machine().device<seibu_sound_device>("seibu_sound")->main_word_w(space,(offset >> 1) & 7,m_cop_mcu_ram[offset],0x00ff);
3131      return;
3132   }
3133
31343081   generic_cop_w(space, offset, data, mem_mask);
31353082}
31363083
r32292r32293
31413088
31423089READ16_MEMBER( seibu_cop_legacy_device::legionna_mcu_r )
31433090{
3144   if(offset >= 0x300/2 && offset <= 0x31f/2)
3145      return space.machine().device<seibu_sound_device>("seibu_sound")->main_word_r(space,(offset >> 1) & 7,0xffff);
31463091
31473092   if(offset >= 0x340/2 && offset <= 0x34f/2)
31483093   {
r32292r32293
31643109   if(offset == 0x280/2) //irq ack / sprite buffering?
31653110      return;
31663111
3167
3168   if(offset >= 0x300/2 && offset <= 0x31f/2)
3169   {
3170      space.machine().device<seibu_sound_device>("seibu_sound")->main_word_w(space,(offset >> 1) & 7,m_cop_mcu_ram[offset],0x00ff);
3171      return;
3172   }
3173
31743112   generic_cop_w(space, offset, data, mem_mask);
31753113}
trunk/src/mame/includes/legionna.h
r32292r32293
11#include "sound/okim6295.h"
2#include "audio/seibu.h"
23#include "machine/raiden2cop.h"
34#include "video/seibu_crtc.h"
45
r32292r32293
1415      m_textram(*this, "textram"),*/
1516      m_maincpu(*this, "maincpu"),
1617      m_audiocpu(*this, "audiocpu"),
18      m_seibu_sound(*this, "seibu_sound"),
1719      m_oki(*this, "oki"),
1820      m_gfxdecode(*this, "gfxdecode"),
1921      m_palette(*this, "palette"),
r32292r32293
5052   DECLARE_WRITE16_MEMBER(legionna_foreground_w);
5153   DECLARE_WRITE16_MEMBER(legionna_text_w);
5254   DECLARE_WRITE8_MEMBER(okim_rombank_w);
55   DECLARE_READ16_MEMBER(sound_comms_r);
56   DECLARE_WRITE16_MEMBER(sound_comms_w);
5357   DECLARE_DRIVER_INIT(legiongfx);
5458   DECLARE_DRIVER_INIT(cupsoc_debug);
5559   DECLARE_DRIVER_INIT(cupsoc);
r32292r32293
7579   void descramble_legionnaire_gfx(UINT8* src);
7680   required_device<cpu_device> m_maincpu;
7781   required_device<cpu_device> m_audiocpu;
82   optional_device<seibu_sound_device> m_seibu_sound;
7883   required_device<okim6295_device> m_oki;
7984   required_device<gfxdecode_device> m_gfxdecode;
8085   required_device<palette_device> m_palette;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team