trunk/src/mame/drivers/legionna.c
| r32292 | r32293 | |
| 72 | 72 | |
| 73 | 73 | #include "emu.h" |
| 74 | 74 | #include "cpu/z80/z80.h" |
| 75 | | #include "audio/seibu.h" |
| 76 | 75 | #include "sound/3812intf.h" |
| 77 | 76 | #include "cpu/m68000/m68000.h" |
| 78 | 77 | #include "machine/seicop.h" |
| r32292 | r32293 | |
| 80 | 79 | |
| 81 | 80 | /*****************************************************************************/ |
| 82 | 81 | |
| 82 | READ16_MEMBER(legionna_state::sound_comms_r) |
| 83 | { |
| 84 | return m_seibu_sound->main_word_r(space,(offset >> 1) & 7,0xffff); |
| 85 | } |
| 83 | 86 | |
| 87 | WRITE16_MEMBER(legionna_state::sound_comms_w) |
| 88 | { |
| 89 | m_seibu_sound->main_word_w(space,(offset >> 1) & 7,data,0x00ff); |
| 90 | } |
| 91 | |
| 84 | 92 | static ADDRESS_MAP_START( legionna_cop_mem, AS_PROGRAM, 16, legionna_state ) |
| 85 | 93 | // AM_RANGE(0x10041c, 0x10041d) AM_WRITE(cop_angle_target_w) // angle target (for 0x6200 COP macro) |
| 86 | 94 | // AM_RANGE(0x10041e, 0x10041f) AM_WRITE(cop_angle_step_w) // angle step (for 0x6200 COP macro) |
| r32292 | r32293 | |
| 131 | 139 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 132 | 140 | AM_RANGE(0x100000, 0x1003ff) AM_RAM |
| 133 | 141 | 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) |
| 134 | 143 | AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, legionna_mcu_r, legionna_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */ |
| 135 | 144 | AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data") |
| 136 | 145 | AM_RANGE(0x101800, 0x101fff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data") |
| r32292 | r32293 | |
| 148 | 157 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 149 | 158 | AM_RANGE(0x100000, 0x1003ff) AM_RAM |
| 150 | 159 | 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) |
| 151 | 161 | AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, heatbrl_mcu_r, heatbrl_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */ |
| 152 | 162 | AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data") |
| 153 | 163 | AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data") |
| r32292 | r32293 | |
| 163 | 173 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 164 | 174 | AM_RANGE(0x100000, 0x1003ff) AM_RAM |
| 165 | 175 | 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) |
| 166 | 177 | AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, godzilla_mcu_r, godzilla_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */ |
| 167 | 178 | AM_RANGE(0x100800, 0x100fff) AM_RAM |
| 168 | 179 | AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data") |
| r32292 | r32293 | |
| 192 | 203 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 193 | 204 | AM_RANGE(0x100000, 0x1003ff) AM_RAM |
| 194 | 205 | 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) |
| 195 | 207 | AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, denjinmk_mcu_r, denjinmk_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */ |
| 196 | 208 | AM_RANGE(0x100800, 0x100fff) AM_RAM |
| 197 | 209 | AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data") |
| r32292 | r32293 | |
| 211 | 223 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 212 | 224 | AM_RANGE(0x100000, 0x1003ff) AM_RAM |
| 213 | 225 | 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) |
| 214 | 227 | AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, grainbow_mcu_r, grainbow_mcu_w) AM_SHARE("cop_mcu_ram") /* COP mcu */ |
| 215 | 228 | AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data") |
| 216 | 229 | AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data") |
| r32292 | r32293 | |
| 229 | 242 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 230 | 243 | AM_RANGE(0x100000, 0x1003ff) AM_RAM |
| 231 | 244 | 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) |
| 232 | 246 | AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, cupsoc_mcu_r,cupsoc_mcu_w) AM_SHARE("cop_mcu_ram") |
| 233 | 247 | AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data") |
| 234 | 248 | AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data") |
| r32292 | r32293 | |
| 251 | 265 | AM_RANGE(0x100000, 0x1003ff) AM_RAM |
| 252 | 266 | AM_RANGE(0x100600, 0x10060f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)//? |
| 253 | 267 | 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) |
| 254 | 269 | AM_RANGE(0x100400, 0x1007ff) AM_DEVREADWRITE("seibucop", seibu_cop_legacy_device, cupsocs_mcu_r,cupsocs_mcu_w) AM_SHARE("cop_mcu_ram") |
| 255 | 270 | AM_RANGE(0x100800, 0x100fff) AM_RAM // _WRITE(legionna_background_w) AM_SHARE("back_data") |
| 256 | 271 | AM_RANGE(0x101000, 0x1017ff) AM_RAM // _WRITE(legionna_foreground_w) AM_SHARE("fore_data") |
trunk/src/mame/machine/seicop.c
| r32292 | r32293 | |
| 1593 | 1593 | |
| 1594 | 1594 | #include "emu.h" |
| 1595 | 1595 | #include "includes/legionna.h" |
| 1596 | | #include "includes/raiden2.h" |
| 1597 | 1596 | #include "machine/seicop.h" |
| 1598 | 1597 | |
| 1599 | 1598 | |
| r32292 | r32293 | |
| 2885 | 2884 | |
| 2886 | 2885 | READ16_MEMBER( seibu_cop_legacy_device::heatbrl_mcu_r ) |
| 2887 | 2886 | { |
| 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 | | |
| 2891 | 2887 | if(offset >= 0x340/2 && offset <= 0x34f/2) |
| 2892 | 2888 | { |
| 2893 | 2889 | static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" }; |
| r32292 | r32293 | |
| 2914 | 2910 | |
| 2915 | 2911 | |
| 2916 | 2912 | |
| 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 | | |
| 2923 | 2913 | generic_cop_w(space, offset, data, mem_mask); |
| 2924 | 2914 | |
| 2925 | 2915 | } |
| r32292 | r32293 | |
| 2931 | 2921 | |
| 2932 | 2922 | READ16_MEMBER( seibu_cop_legacy_device::cupsoc_mcu_r ) |
| 2933 | 2923 | { |
| 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 | | |
| 2937 | 2924 | if(offset >= 0x340/2 && offset <= 0x34f/2) |
| 2938 | 2925 | { |
| 2939 | 2926 | static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" }; |
| r32292 | r32293 | |
| 2956 | 2943 | if(offset == 0x280/2) //irq ack / sprite buffering? |
| 2957 | 2944 | return; |
| 2958 | 2945 | |
| 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 | | |
| 2965 | 2946 | generic_cop_w(space, offset, data, mem_mask); |
| 2966 | 2947 | } |
| 2967 | 2948 | |
| 2968 | 2949 | READ16_MEMBER( seibu_cop_legacy_device::cupsocs_mcu_r ) |
| 2969 | 2950 | { |
| 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); |
| 2972 | 2951 | |
| 2973 | 2952 | if(offset >= 0x300/2 && offset <= 0x30f/2) |
| 2974 | 2953 | { |
| r32292 | r32293 | |
| 2993 | 2972 | return; |
| 2994 | 2973 | |
| 2995 | 2974 | |
| 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 | | |
| 3003 | 2975 | generic_cop_w(space, offset, data, mem_mask); |
| 3004 | 2976 | } |
| 3005 | 2977 | |
| r32292 | r32293 | |
| 3009 | 2981 | |
| 3010 | 2982 | READ16_MEMBER( seibu_cop_legacy_device::godzilla_mcu_r ) |
| 3011 | 2983 | { |
| 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); |
| 3014 | 2984 | |
| 3015 | 2985 | if(offset >= 0x340/2 && offset <= 0x34f/2) |
| 3016 | 2986 | { |
| r32292 | r32293 | |
| 3036 | 3006 | return; |
| 3037 | 3007 | |
| 3038 | 3008 | |
| 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 | | |
| 3045 | 3009 | generic_cop_w(space, offset, data, mem_mask); |
| 3046 | 3010 | } |
| 3047 | 3011 | |
| r32292 | r32293 | |
| 3051 | 3015 | |
| 3052 | 3016 | READ16_MEMBER( seibu_cop_legacy_device::denjinmk_mcu_r ) |
| 3053 | 3017 | { |
| 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); |
| 3056 | 3018 | |
| 3057 | 3019 | if(offset >= 0x340/2 && offset <= 0x34f/2) |
| 3058 | 3020 | { |
| r32292 | r32293 | |
| 3083 | 3045 | } |
| 3084 | 3046 | |
| 3085 | 3047 | |
| 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 | | |
| 3092 | 3048 | generic_cop_w(space, offset, data, mem_mask); |
| 3093 | 3049 | } |
| 3094 | 3050 | |
| r32292 | r32293 | |
| 3098 | 3054 | |
| 3099 | 3055 | READ16_MEMBER( seibu_cop_legacy_device::grainbow_mcu_r ) |
| 3100 | 3056 | { |
| 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 | | |
| 3104 | 3057 | if(offset >= 0x340/2 && offset <= 0x34f/2) |
| 3105 | 3058 | { |
| 3106 | 3059 | static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" }; |
| r32292 | r32293 | |
| 3125 | 3078 | return; |
| 3126 | 3079 | |
| 3127 | 3080 | |
| 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 | | |
| 3134 | 3081 | generic_cop_w(space, offset, data, mem_mask); |
| 3135 | 3082 | } |
| 3136 | 3083 | |
| r32292 | r32293 | |
| 3141 | 3088 | |
| 3142 | 3089 | READ16_MEMBER( seibu_cop_legacy_device::legionna_mcu_r ) |
| 3143 | 3090 | { |
| 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); |
| 3146 | 3091 | |
| 3147 | 3092 | if(offset >= 0x340/2 && offset <= 0x34f/2) |
| 3148 | 3093 | { |
| r32292 | r32293 | |
| 3164 | 3109 | if(offset == 0x280/2) //irq ack / sprite buffering? |
| 3165 | 3110 | return; |
| 3166 | 3111 | |
| 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 | | |
| 3174 | 3112 | generic_cop_w(space, offset, data, mem_mask); |
| 3175 | 3113 | } |
trunk/src/mame/includes/legionna.h
| r32292 | r32293 | |
| 1 | 1 | #include "sound/okim6295.h" |
| 2 | #include "audio/seibu.h" |
| 2 | 3 | #include "machine/raiden2cop.h" |
| 3 | 4 | #include "video/seibu_crtc.h" |
| 4 | 5 | |
| r32292 | r32293 | |
| 14 | 15 | m_textram(*this, "textram"),*/ |
| 15 | 16 | m_maincpu(*this, "maincpu"), |
| 16 | 17 | m_audiocpu(*this, "audiocpu"), |
| 18 | m_seibu_sound(*this, "seibu_sound"), |
| 17 | 19 | m_oki(*this, "oki"), |
| 18 | 20 | m_gfxdecode(*this, "gfxdecode"), |
| 19 | 21 | m_palette(*this, "palette"), |
| r32292 | r32293 | |
| 50 | 52 | DECLARE_WRITE16_MEMBER(legionna_foreground_w); |
| 51 | 53 | DECLARE_WRITE16_MEMBER(legionna_text_w); |
| 52 | 54 | DECLARE_WRITE8_MEMBER(okim_rombank_w); |
| 55 | DECLARE_READ16_MEMBER(sound_comms_r); |
| 56 | DECLARE_WRITE16_MEMBER(sound_comms_w); |
| 53 | 57 | DECLARE_DRIVER_INIT(legiongfx); |
| 54 | 58 | DECLARE_DRIVER_INIT(cupsoc_debug); |
| 55 | 59 | DECLARE_DRIVER_INIT(cupsoc); |
| r32292 | r32293 | |
| 75 | 79 | void descramble_legionnaire_gfx(UINT8* src); |
| 76 | 80 | required_device<cpu_device> m_maincpu; |
| 77 | 81 | required_device<cpu_device> m_audiocpu; |
| 82 | optional_device<seibu_sound_device> m_seibu_sound; |
| 78 | 83 | required_device<okim6295_device> m_oki; |
| 79 | 84 | required_device<gfxdecode_device> m_gfxdecode; |
| 80 | 85 | required_device<palette_device> m_palette; |