Previous 199869 Revisions Next

r29506 Wednesday 9th April, 2014 at 23:31:21 UTC by Nathan Woods
Merge branch 'master' of ssh://mess.org/mame into new_menus
[/branches/new_menus/hlsl]bloom.fx
[/branches/new_menus/src/emu]addrmap.c addrmap.h device.h diexec.c digfx.h dimemory.c memory.c sound.c sound.h tilemap.h
[/branches/new_menus/src/emu/bus/isa]p1_hdc.c wdxt_gen.c
[/branches/new_menus/src/emu/bus/nes]ggenie.c nes_slot.h
[/branches/new_menus/src/emu/bus/pce]pce_slot.c pce_slot.h
[/branches/new_menus/src/emu/bus/sega8]rom.c sega8_slot.c sega8_slot.h
[/branches/new_menus/src/emu/bus/snes]sa1.c snes_slot.c snes_slot.h
[/branches/new_menus/src/emu/bus/x68k]x68k_scsiext.c
[/branches/new_menus/src/emu/cpu/tms57002]tms57002.c tms57002.h
[/branches/new_menus/src/emu/cpu/tms7000]tms7000.c tms7000.h tms70op.inc
[/branches/new_menus/src/emu/debug]debugcmd.c
[/branches/new_menus/src/emu/machine]aakart.c aakart.h hd63450.c hd63450.h i8279.c i8279.h mb89352.c mb89352.h ncr539x.c ncr539x.h roc10937.c roc10937.h wd2010.c wd2010.h
[/branches/new_menus/src/emu/video]crt9007.c
[/branches/new_menus/src/mame/audio]namco52.c namco54.c taitosnd.c taitosnd.h
[/branches/new_menus/src/mame/drivers]airbustr.c asuka.c backfire.c bfmsys85.c bishi.c boogwing.c cave.c cbuster.c cham24.c cninja.c crospang.c crshrace.c crystal.c darius.c darkseal.c dassault.c dblewing.c dbz.c deco156.c deco32.c dietgo.c djboy.c dreambal.c esd16.c exzisus.c f1gp.c famibox.c funkyjet.c galastrm.c galpanic.c globalfr.c gotcha.c groundfx.c gunbustr.c hvyunit.c icecold.c igspoker.c jpmimpct.c jpmsys5.c konamigx.c lemmings.c maygay1b.c maygay1bsw.c maygayv1.c metro.c mirage.c mlanding.c moo.c mpu3.c mpu4hw.c mpu4sw.c multigam.c namcona1.c namcos2.c ninjaw.c nmg5.c nmk16.c opwolf.c othunder.c pktgaldx.c playch10.c plygonet.c powerins.c proconn.c quizpani.c rainbow.c rastan.c rohga.c rungun.c sandscrp.c silvmil.c simpl156.c skylncr.c slapshot.c snowbros.c sshangha.c supbtime.c superchs.c suprslam.c taito_b.c taito_f2.c taito_h.c taito_l.c taito_o.c taito_x.c taito_z.c taitoair.c tceptor.c tmnt.c toaplan2.c topspeed.c tumbleb.c tumblep.c turbo.c undrfire.c vaportra.c volfied.c vsnes.c warriorb.c wgp.c xexex.c zn.c
[/branches/new_menus/src/mame/includes]boogwing.h cbuster.h cninja.h dassault.h deco32.h dietgo.h esd16.h jpmimpct.h jpmsys5.h maygay1b.h namcona1.h pktgaldx.h playch10.h rohga.h simpl156.h sshangha.h taito_z.h vaportra.h vsnes.h
[/branches/new_menus/src/mame/machine]archimds.c namco51.c namco51.h nmk112.c nmk112.h playch10.c vsnes.c
[/branches/new_menus/src/mame/video]c45.c c45.h deco16ic.h decospr.c decospr.h k053936.c k053936.h k054338.c k054338.h kan_pand.c kan_pand.h namcona1.c pc080sn.c pc080sn.h pc090oj.c pc090oj.h playch10.c ppu2c0x.c ppu2c0x.h rohga.c tc0080vco.c tc0080vco.h tc0100scn.c tc0100scn.h tc0150rod.c tc0150rod.h tc0180vcu.c tc0180vcu.h tc0280grd.c tc0280grd.h tc0480scp.c tc0480scp.h toaplan_scu.c toaplan_scu.h tumbleb.c vrender0.c vrender0.h vsnes.c
[/branches/new_menus/src/mess/drivers]a310.c cat.c digel804.c mac.c megadriv.c mmd1.c nes.c pdp1.c rainbow.c sdk85.c sdk86.c selz80.c sms.c tandy2k.c tx0.c vt100.c x68k.c z88.c
[/branches/new_menus/src/mess/includes]sms.h tandy2k.h x68k.h z88.h
[/branches/new_menus/src/mess/machine]megacd.c megacd.h sms.c upd65031.c upd65031.h
[/branches/new_menus/src/mess/video]crt.c crt.h vtvideo.c vtvideo.h z88.c
[/branches/new_menus/src/osd/windows]d3dhlsl.c d3dhlsl.h

branches/new_menus/hlsl/bloom.fx
r29505r29506
143143{
144144   float4 Position : POSITION;
145145   float4 Color : COLOR0;
146   float2 TexCoord : TEXCOORD0;
146   float4 TexCoord01 : TEXCOORD0;
147   float4 TexCoord23 : TEXCOORD1;
148   float4 TexCoord45 : TEXCOORD2;
149   float4 TexCoord67 : TEXCOORD3;
150   float4 TexCoord89 : TEXCOORD4;
151   float2 TexCoordA : TEXCOORD5;
147152};
148153
149154struct VS_INPUT
r29505r29506
157162struct PS_INPUT
158163{
159164   float4 Color : COLOR0;
160   float2 TexCoord : TEXCOORD0;
165   float4 TexCoord01 : TEXCOORD0;
166   float4 TexCoord23 : TEXCOORD1;
167   float4 TexCoord45 : TEXCOORD2;
168   float4 TexCoord67 : TEXCOORD3;
169   float4 TexCoord89 : TEXCOORD4;
170   float2 TexCoordA : TEXCOORD5;
161171};
162172
163173//-----------------------------------------------------------------------------
r29505r29506
165175//-----------------------------------------------------------------------------
166176
167177uniform float2 TargetSize;
178uniform float4 Level01Size;
179uniform float4 Level23Size;
180uniform float4 Level45Size;
181uniform float4 Level67Size;
182uniform float4 Level89Size;
183uniform float2 LevelASize;
168184
169185VS_OUTPUT vs_main(VS_INPUT Input)
170186{
r29505r29506
176192   Output.Position.xy -= float2(0.5f, 0.5f);
177193   Output.Position.xy *= float2(2.0f, 2.0f);
178194   Output.Color = Input.Color;
179   Output.TexCoord = (Input.Position.xy  + 0.5f) / TargetSize;
195   Output.TexCoord01 = Input.Position.xyxy / TargetSize.xyxy - 0.5f / Level01Size;
196   Output.TexCoord23 = Input.Position.xyxy / TargetSize.xyxy - 0.5f / Level23Size;
197   Output.TexCoord45 = Input.Position.xyxy / TargetSize.xyxy - 0.5f / Level45Size;
198   Output.TexCoord67 = Input.Position.xyxy / TargetSize.xyxy - 0.5f / Level67Size;
199   Output.TexCoord89 = Input.Position.xyxy / TargetSize.xyxy - 0.5f / Level89Size;
200   Output.TexCoordA = Input.Position.xy / TargetSize - 0.5f / LevelASize;
180201
181202   return Output;
182203}
r29505r29506
191212
192213float4 ps_main(PS_INPUT Input) : COLOR
193214{
194   float3 texel0 = tex2D(DiffuseSampler0, Input.TexCoord).rgb;
195   float3 texel1 = tex2D(DiffuseSampler1, Input.TexCoord).rgb;
196   float3 texel2 = tex2D(DiffuseSampler2, Input.TexCoord).rgb;
197   float3 texel3 = tex2D(DiffuseSampler3, Input.TexCoord).rgb;
198   float3 texel4 = tex2D(DiffuseSampler4, Input.TexCoord).rgb;
199   float3 texel5 = tex2D(DiffuseSampler5, Input.TexCoord).rgb;
200   float3 texel6 = tex2D(DiffuseSampler6, Input.TexCoord).rgb;
201   float3 texel7 = tex2D(DiffuseSampler7, Input.TexCoord).rgb;
202   float3 texel8 = tex2D(DiffuseSampler8, Input.TexCoord).rgb;
203   float3 texel9 = tex2D(DiffuseSampler9, Input.TexCoord).rgb;
204   float3 texelA = tex2D(DiffuseSamplerA, Input.TexCoord).rgb;
215   float3 texel0 = tex2D(DiffuseSampler0, Input.TexCoord01.xy).rgb;
216   float3 texel1 = tex2D(DiffuseSampler1, Input.TexCoord01.zw).rgb;
217   float3 texel2 = tex2D(DiffuseSampler2, Input.TexCoord23.xy).rgb;
218   float3 texel3 = tex2D(DiffuseSampler3, Input.TexCoord23.zw).rgb;
219   float3 texel4 = tex2D(DiffuseSampler4, Input.TexCoord45.xy).rgb;
220   float3 texel5 = tex2D(DiffuseSampler5, Input.TexCoord45.zw).rgb;
221   float3 texel6 = tex2D(DiffuseSampler6, Input.TexCoord67.xy).rgb;
222   float3 texel7 = tex2D(DiffuseSampler7, Input.TexCoord67.zw).rgb;
223   float3 texel8 = tex2D(DiffuseSampler8, Input.TexCoord89.xy).rgb;
224   float3 texel9 = tex2D(DiffuseSampler9, Input.TexCoord89.zw).rgb;
225   float3 texelA = tex2D(DiffuseSamplerA, Input.TexCoordA).rgb;
205226
206227   texel0 = texel0 * Level0123Weight.x;
207228   texel1 = texel1 * Level0123Weight.y;
branches/new_menus/src/mame/includes/esd16.h
r29505r29506
6969   virtual void machine_reset();
7070   virtual void video_start();
7171   UINT32 screen_update_hedpanic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
72   static UINT16 hedpanic_pri_callback(UINT16 x);
72   DECOSPR_PRIORITY_CB_MEMBER(hedpanic_pri_callback);
73
7374   required_device<cpu_device> m_maincpu;
7475   required_device<cpu_device> m_audiocpu;
7576   required_device<gfxdecode_device> m_gfxdecode;
branches/new_menus/src/mame/includes/maygay1b.h
r29505r29506
88#define M1_DUART_CLOCK  (XTAL_3_6864MHz)
99
1010#include "cpu/m6809/m6809.h"
11#include "machine/i8279.h"
12
1113#include "video/awpvid.h"       //Fruit Machines Only
1214#include "machine/6821pia.h"
1315#include "machine/mc68681.h"
r29505r29506
1921#include "sound/okim6376.h"
2022#include "machine/nvram.h"
2123
22struct i8279_state
23{
24   UINT8       command;
25   UINT8       mode;
26   UINT8       prescale;
27   UINT8       inhibit;
28   UINT8       clear;
29   UINT8       ram[16];
30   UINT8       read_sensor;
31   UINT8       write_display;
32   UINT8       sense_address;
33   UINT8       sense_auto_inc;
34   UINT8       disp_address;
35   UINT8       disp_auto_inc;
36};
37
38
3924class maygay1b_state : public driver_device
4025{
4126public:
r29505r29506
4328      : driver_device(mconfig, type, tag),
4429      m_maincpu(*this, "maincpu"),
4530      m_vfd(*this, "vfd"),
31      m_ay(*this, "aysnd"),
4632      m_msm6376(*this, "msm6376"),
47      m_duart68681(*this, "duart68681") {
48      m_NMIENABLE = 0;
49   }
33      m_duart68681(*this, "duart68681"),
34      m_sw1_port(*this, "SW1"),
35      m_sw2_port(*this, "SW2"),
36      m_s2_port(*this, "STROBE2"),
37      m_s3_port(*this, "STROBE3"),
38      m_s4_port(*this, "STROBE4"),
39      m_s5_port(*this, "STROBE5"),
40      m_s6_port(*this, "STROBE6"),
41      m_s7_port(*this, "STROBE7")
42   {}
5043
5144   required_device<cpu_device> m_maincpu;
52   optional_device<roc10937_t> m_vfd;
45   optional_device<s16lf01_t> m_vfd;
46   required_device<ay8910_device> m_ay;
5347   optional_device<okim6376_device> m_msm6376;
5448   required_device<mc68681_device> m_duart68681;
49   required_ioport m_sw1_port;
50   required_ioport m_sw2_port;
51   required_ioport m_s2_port;
52   required_ioport m_s3_port;
53   required_ioport m_s4_port;
54   required_ioport m_s5_port;
55   required_ioport m_s6_port;
56   required_ioport m_s7_port;
5557
5658   UINT8 m_lamppos;
59   int m_lamp_strobe;
60   int m_old_lamp_strobe;
61   int m_lamp_strobe2;
62   int m_old_lamp_strobe2;
5763   int m_alpha_clock;
5864   int m_RAMEN;
5965   int m_ALARMEN;
r29505r29506
6571   TIMER_DEVICE_CALLBACK_MEMBER( maygay1b_nmitimer_callback );
6672   UINT8 m_Lamps[256];
6773   int m_optic_pattern;
68   i8279_state m_i8279[2];
69   DECLARE_READ8_MEMBER(m1_8279_r);
70   DECLARE_WRITE8_MEMBER(m1_8279_w);
71   DECLARE_READ8_MEMBER(m1_8279_2_r);
72   DECLARE_WRITE8_MEMBER(m1_8279_2_w);
74   DECLARE_WRITE8_MEMBER(scanlines_w);
75   DECLARE_WRITE8_MEMBER(lamp_data_w);
76   DECLARE_WRITE8_MEMBER(lamp_data_2_w);
77   DECLARE_READ8_MEMBER(kbd_r);
7378   DECLARE_WRITE8_MEMBER(reel12_w);
7479   DECLARE_WRITE8_MEMBER(reel34_w);
7580   DECLARE_WRITE8_MEMBER(reel56_w);
r29505r29506
7883   DECLARE_READ8_MEMBER(latch_st_hi);
7984   DECLARE_READ8_MEMBER(latch_st_lo);
8085   DECLARE_WRITE8_MEMBER(m1ab_no_oki_w);
81   void m1_draw_lamps(int data,int strobe, int col);
8286   DECLARE_WRITE8_MEMBER(m1_pia_porta_w);
8387   DECLARE_WRITE8_MEMBER(m1_pia_portb_w);
88   DECLARE_WRITE8_MEMBER(m1_lockout_w);
8489   DECLARE_WRITE8_MEMBER(m1_meter_w);
8590   DECLARE_READ8_MEMBER(m1_meter_r);
91   DECLARE_READ8_MEMBER(m1_firq_clr_r);
8692   DECLARE_READ8_MEMBER(m1_firq_trg_r);
8793   DECLARE_WRITE_LINE_MEMBER(duart_irq_handler);
8894   DECLARE_READ8_MEMBER(m1_duart_r);
8995   DECLARE_DRIVER_INIT(m1);
9096   virtual void machine_start();
9197   virtual void machine_reset();
92   void update_outputs(i8279_state *chip, UINT16 which);
9398   void m1_stepper_reset();
9499};
branches/new_menus/src/mame/includes/simpl156.h
r29505r29506
3838   required_device<palette_device> m_palette;
3939   UINT16 *m_spriteram;
4040   size_t m_spriteram_size;
41   int bank_callback(int bank);
41   DECO16IC_BANK_CB_MEMBER(bank_callback);
42   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
4243
4344   DECLARE_READ32_MEMBER(simpl156_inputs_read);
4445   DECLARE_READ32_MEMBER(simpl156_palette_r);
branches/new_menus/src/mame/includes/cninja.h
r29505r29506
9292   TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
9393   void cninjabl_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
9494
95   int cninja_bank_callback(int bank);
96   int robocop2_bank_callback(int bank);
97   int mutantf_1_bank_callback(int bank);
98   int mutantf_2_bank_callback(int bank);
95   DECO16IC_BANK_CB_MEMBER(cninja_bank_callback);
96   DECO16IC_BANK_CB_MEMBER(robocop2_bank_callback);
97   DECO16IC_BANK_CB_MEMBER(mutantf_1_bank_callback);
98   DECO16IC_BANK_CB_MEMBER(mutantf_2_bank_callback);
9999
100   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
101
100102   DECLARE_READ16_MEMBER( sshangha_protection_region_6_146_r );
101103   DECLARE_WRITE16_MEMBER( sshangha_protection_region_6_146_w );
102104   DECLARE_READ16_MEMBER( sshangha_protection_region_8_146_r );
branches/new_menus/src/mame/includes/dietgo.h
r29505r29506
4141   DECLARE_DRIVER_INIT(dietgo);
4242   virtual void machine_start();
4343   UINT32 screen_update_dietgo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
44   int bank_callback(int bank);
44   DECO16IC_BANK_CB_MEMBER(bank_callback);
4545
4646   DECLARE_READ16_MEMBER( dietgo_protection_region_0_104_r );
4747   DECLARE_WRITE16_MEMBER( dietgo_protection_region_0_104_w );
branches/new_menus/src/mame/includes/jpmsys5.h
r29505r29506
3333   required_device<acia6850_device> m_acia6850_2;
3434   required_device<upd7759_device> m_upd7759;
3535   optional_device<tms34061_device> m_tms34061;
36   optional_device<roc10937_t> m_vfd;
36   optional_device<s16lf01_t> m_vfd;
3737   required_ioport m_direct_port;
3838   optional_device<palette_device> m_palette;
3939
branches/new_menus/src/mame/includes/namcona1.h
r29505r29506
2222   NAMCO_XDAY2
2323};
2424
25#define NAMCONA1_NUM_TILEMAPS 4
2625
27
2826class namcona1_state : public driver_device
2927{
3028public:
r29505r29506
3735      m_screen(*this, "screen"),
3836      m_palette(*this, "palette"),
3937      m_c140(*this, "c140"),
40      m_videoram(*this,"videoram"),
41      m_spriteram(*this,"spriteram"),
4238      m_workram(*this,"workram"),
4339      m_vreg(*this,"vreg"),
44      m_scroll(*this,"scroll")
40      m_paletteram(*this, "paletteram"),
41      m_cgram(*this, "cgram"),
42      m_videoram(*this,"videoram"),
43      m_scroll(*this,"scroll"),
44      m_spriteram(*this,"spriteram")
4545   { }
4646
4747   required_device<cpu_device> m_maincpu;
r29505r29506
5151   required_device<screen_device> m_screen;
5252   required_device<palette_device> m_palette;
5353   required_device<c140_device> m_c140;
54   required_shared_ptr<UINT16> m_videoram;
55   required_shared_ptr<UINT16> m_spriteram;
5654   required_shared_ptr<UINT16> m_workram;
5755   required_shared_ptr<UINT16> m_vreg;
56   required_shared_ptr<UINT16> m_paletteram;
57   required_shared_ptr<UINT16> m_cgram;
58   required_shared_ptr<UINT16> m_videoram;
5859   required_shared_ptr<UINT16> m_scroll;
60   required_shared_ptr<UINT16> m_spriteram;
5961
62   // this has to be UINT8 to be in the right byte order for the tilemap system
63   dynamic_array<UINT8> m_shaperam;
64
6065   UINT16 *m_mpBank0;
6166   UINT16 *m_mpBank1;
6267   int m_mEnableInterrupts;
r29505r29506
6873   UINT8 m_mcu_port5;
6974   UINT8 m_mcu_port6;
7075   UINT8 m_mcu_port8;
71   UINT16 *m_shaperam;
72   UINT16 *m_cgram;
73   tilemap_t *m_roz_tilemap;
74   int m_roz_palette;
75   tilemap_t *m_bg_tilemap[NAMCONA1_NUM_TILEMAPS];
76   int m_tilemap_palette_bank[NAMCONA1_NUM_TILEMAPS];
76   tilemap_t *m_bg_tilemap[4+1];
7777   int m_palette_is_dirty;
78   UINT8 m_mask_data[8];
79   UINT8 m_conv_data[9];
8078
8179
8280   DECLARE_READ16_MEMBER(custom_key_r);
8381   DECLARE_WRITE16_MEMBER(custom_key_w);
84   DECLARE_READ16_MEMBER(namcona1_vreg_r);
8582   DECLARE_WRITE16_MEMBER(namcona1_vreg_w);
8683   DECLARE_READ16_MEMBER(mcu_mailbox_r);
8784   DECLARE_WRITE16_MEMBER(mcu_mailbox_w_68k);
r29505r29506
106103   void init_namcona1(int gametype);
107104   void UpdatePalette(int offset);
108105   DECLARE_WRITE16_MEMBER(namcona1_videoram_w);
109   DECLARE_READ16_MEMBER(namcona1_videoram_r);
110   DECLARE_READ16_MEMBER(namcona1_paletteram_r);
111106   DECLARE_WRITE16_MEMBER(namcona1_paletteram_w);
112107   DECLARE_READ16_MEMBER(namcona1_gfxram_r);
113108   DECLARE_WRITE16_MEMBER(namcona1_gfxram_w);
r29505r29506
142137   TIMER_DEVICE_CALLBACK_MEMBER(mcu_interrupt);
143138
144139private:
145   void tilemap_get_info(tile_data &tileinfo, int tile_index, const UINT16 *tilemap_videoram, int tilemap_color, bool use_4bpp_gfx);
140   void tilemap_get_info(tile_data &tileinfo, int tile_index, const UINT16 *tilemap_videoram, bool use_4bpp_gfx);
146141};
branches/new_menus/src/mame/includes/rohga.h
r29505r29506
6969   DECLARE_DRIVER_INIT(nitrobal);
7070   DECLARE_DRIVER_INIT(schmeisr);
7171   DECLARE_DRIVER_INIT(rohga);
72   DECLARE_VIDEO_START(rohga);
7372   DECLARE_VIDEO_START(wizdfire);
74   DECLARE_VIDEO_START(schmeisr);
7573   UINT32 screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7674   UINT32 screen_update_wizdfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7775   UINT32 screen_update_nitrobal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7876   void mixwizdfirelayer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int gfxregion, UINT16 pri, UINT16 primask);
79   int bank_callback(int bank);
77   DECO16IC_BANK_CB_MEMBER(bank_callback);
78   DECOSPR_PRIORITY_CB_MEMBER(rohga_pri_callback);
79   DECOSPR_COLOUR_CB_MEMBER(rohga_col_callback);
80   DECOSPR_COLOUR_CB_MEMBER(schmeisr_col_callback);
8081
8182   READ16_MEMBER( nb_protection_region_0_146_r );
8283   WRITE16_MEMBER( nb_protection_region_0_146_w );
8384   READ16_MEMBER( wf_protection_region_0_104_r );
8485   WRITE16_MEMBER( wf_protection_region_0_104_w );
8586};
86/*----------- defined in video/rohga.c -----------*/
87UINT16 rohga_pri_callback(UINT16 x);
88UINT16 schmeisr_col_callback(UINT16 x);
89UINT16 rohga_col_callback(UINT16 x);
branches/new_menus/src/mame/includes/vaportra.h
r29505r29506
5050   virtual void machine_reset();
5151   UINT32 screen_update_vaportra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5252   void update_24bitcol( int offset );
53   int bank_callback(int bank);
53   DECO16IC_BANK_CB_MEMBER(bank_callback);
5454};
branches/new_menus/src/mame/includes/vsnes.h
r29505r29506
128128
129129   DECLARE_READ8_MEMBER( vsnes_bootleg_z80_latch_r );
130130};
131
132/*----------- defined in video/vsnes.c -----------*/
133extern const ppu2c0x_interface vsnes_ppu_interface_1;
134extern const ppu2c0x_interface vsnes_ppu_interface_2;
branches/new_menus/src/mame/includes/sshangha.h
r29505r29506
4545   optional_device<decospr_device> m_sprgen2;
4646
4747   int m_video_control;
48   int bank_callback(int bank);
48   DECO16IC_BANK_CB_MEMBER(bank_callback);
4949
5050   DECLARE_READ16_MEMBER( sshangha_protection_region_8_146_r );
5151   DECLARE_WRITE16_MEMBER( sshangha_protection_region_8_146_w );
branches/new_menus/src/mame/includes/jpmimpct.h
r29505r29506
7878   int m_slidesout;
7979   int m_hopper[3];
8080   int m_motor[3];
81   optional_device<roc10937_t> m_vfd;
81   optional_device<s16lf01_t> m_vfd;
8282   optional_shared_ptr<UINT16> m_vram;
8383   struct bt477_t m_bt477;
8484   DECLARE_READ16_MEMBER(duart_1_r);
branches/new_menus/src/mame/includes/deco32.h
r29505r29506
168168   UINT16 port_b_tattass(int unused);
169169   void tattass_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask );
170170
171   int fghthist_bank_callback( int bank );
172   int captaven_bank_callback( int bank );
173   int tattass_bank_callback( int bank );
171   DECO16IC_BANK_CB_MEMBER(fghthist_bank_callback);
172   DECO16IC_BANK_CB_MEMBER(captaven_bank_callback);
173   DECO16IC_BANK_CB_MEMBER(tattass_bank_callback);
174   DECOSPR_PRIORITY_CB_MEMBER(captaven_pri_callback);
174175};
175176
176177class dragngun_state : public deco32_state
r29505r29506
206207   void dragngun_draw_sprites( bitmap_rgb32 &bitmap, const rectangle &cliprect, const UINT32 *spritedata);
207208   READ32_MEMBER( dragngun_unk_video_r );
208209   
209   int bank_1_callback( int bank );
210   int bank_2_callback( int bank );
210   DECO16IC_BANK_CB_MEMBER(bank_1_callback);
211   DECO16IC_BANK_CB_MEMBER(bank_2_callback);
211212};
branches/new_menus/src/mame/includes/dassault.h
r29505r29506
7070   virtual void video_start();
7171   UINT32 screen_update_dassault(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7272   void mixdassaultlayer(bitmap_rgb32 &bitmap, bitmap_ind16* sprite_bitmap, const rectangle &cliprect, UINT16 pri, UINT16 primask, UINT16 penbase, UINT8 alpha);
73   int dassault_bank_callback( const int bank );
73   DECO16IC_BANK_CB_MEMBER(bank_callback);
7474};
branches/new_menus/src/mame/includes/cbuster.h
r29505r29506
5757   virtual void video_start();
5858   UINT32 screen_update_twocrude(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5959   void update_24bitcol( int offset );
60   int bank_callback(int bank);
60   DECO16IC_BANK_CB_MEMBER(bank_callback);
6161};
branches/new_menus/src/mame/includes/playch10.h
r29505r29506
142142   void ppu_irq(int *ppu_regs);
143143   void mapper9_latch(offs_t offset);
144144};
145
146/*----------- defined in video/playch10.c -----------*/
147extern const ppu2c0x_interface playch10_ppu_interface;
branches/new_menus/src/mame/includes/boogwing.h
r29505r29506
6464   DECLARE_READ16_MEMBER( boogwing_protection_region_0_104_r );
6565   DECLARE_WRITE16_MEMBER( boogwing_protection_region_0_104_w );
6666   
67   int bank_callback(int bank);
68   int bank_callback2(int bank);
67   DECO16IC_BANK_CB_MEMBER(bank_callback);
68   DECO16IC_BANK_CB_MEMBER(bank_callback2);
6969};
branches/new_menus/src/mame/includes/pktgaldx.h
r29505r29506
5959   READ16_MEMBER( pktgaldx_protection_region_f_104_r );
6060   WRITE16_MEMBER( pktgaldx_protection_region_f_104_w );
6161
62   int bank_callback(int bank);
62   DECO16IC_BANK_CB_MEMBER(bank_callback);
6363};
branches/new_menus/src/mame/includes/taito_z.h
r29505r29506
6565   optional_device<tc0110pcr_device> m_tc0110pcr;
6666   optional_device<tc0220ioc_device> m_tc0220ioc;
6767   optional_device<tc0510nio_device> m_tc0510nio;
68   required_device<tc0140syt_device> m_tc0140syt;
68   optional_device<tc0140syt_device> m_tc0140syt;   // bshark & spacegun miss the CPUs which shall use TC0140
6969   required_device<gfxdecode_device> m_gfxdecode;
7070   required_device<palette_device> m_palette;
7171
branches/new_menus/src/mame/video/kan_pand.c
r29505r29506
5555kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5656   : device_t(mconfig, KANEKO_PANDORA, "Kaneko Pandora - PX79C480FP-3", tag, owner, clock, "kaneko_pandora", __FILE__),
5757      device_video_interface(mconfig, *this),
58      m_gfx_region(0),
59      m_xoffset(0),
60      m_yoffset(0),
5861      m_gfxdecode(*this),
5962      m_palette(*this)
6063{
r29505r29506
8184}
8285
8386//-------------------------------------------------
84//  device_config_complete - perform any
85//  operations now that the configuration is
86//  complete
87//-------------------------------------------------
88
89void kaneko_pandora_device::device_config_complete()
90{
91   // inherit a copy of the static data
92   const kaneko_pandora_interface *intf = reinterpret_cast<const kaneko_pandora_interface *>(static_config());
93   if (intf != NULL)
94      *static_cast<kaneko_pandora_interface *>(this) = *intf;
95
96   // or initialize to defaults if none provided
97   else
98   {
99      m_gfx_region = 0;
100      m_xoffset = 0;
101      m_yoffset = 0;
102   }
103}
104
105//-------------------------------------------------
10687//  device_start - device-specific startup
10788//-------------------------------------------------
10889
branches/new_menus/src/mame/video/kan_pand.h
r29505r29506
1313    TYPE DEFINITIONS
1414***************************************************************************/
1515
16struct kaneko_pandora_interface
17{
18   UINT8      m_gfx_region;
19   int        m_xoffset;
20   int        m_yoffset;
21};
22
2316class kaneko_pandora_device : public device_t,
24                        public device_video_interface,
25                        public kaneko_pandora_interface
17                        public device_video_interface
2618{
2719public:
2820   kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r29505r29506
3123   // static configuration
3224   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
3325   static void static_set_palette_tag(device_t &device, const char *tag);
34
26   static void set_gfx_region(device_t &device, int gfxregion) { downcast<kaneko_pandora_device &>(device).m_gfx_region = gfxregion; }
27   static void set_offsets(device_t &device, int x_offset, int y_offset)
28   {
29      kaneko_pandora_device &dev = downcast<kaneko_pandora_device &>(device);
30      dev.m_xoffset = x_offset;
31      dev.m_yoffset = y_offset;
32   }
33   
3534   DECLARE_WRITE8_MEMBER ( spriteram_w );
3635   DECLARE_READ8_MEMBER( spriteram_r );
3736   DECLARE_WRITE16_MEMBER( spriteram_LSB_w );
r29505r29506
4342
4443protected:
4544   // device-level overrides
46   virtual void device_config_complete();
4745   virtual void device_start();
4846   virtual void device_reset();
4947
r29505r29506
5553   bitmap_ind16    *m_sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */
5654   int             m_clear_bitmap;
5755   int             m_bg_pen; // might work some other way..
56   UINT8           m_gfx_region;
57   int             m_xoffset;
58   int             m_yoffset;
5859   required_device<gfxdecode_device> m_gfxdecode;
5960   required_device<palette_device> m_palette;
6061};
r29505r29506
6667    DEVICE CONFIGURATION MACROS
6768***************************************************************************/
6869
69#define MCFG_KANEKO_PANDORA_ADD(_tag, _interface) \
70   MCFG_DEVICE_ADD(_tag, KANEKO_PANDORA, 0) \
71   MCFG_DEVICE_CONFIG(_interface)
70#define MCFG_KANEKO_PANDORA_GFX_REGION(_region) \
71   kaneko_pandora_device::set_gfx_region(*device, _region);
7272
73#define MCFG_KANEKO_PANDORA_OFFSETS(_xoffs, _yoffs) \
74   kaneko_pandora_device::set_offsets(*device, _xoffs, _yoffs);
75
7376#define MCFG_KANEKO_PANDORA_GFXDECODE(_gfxtag) \
7477   kaneko_pandora_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
7578
branches/new_menus/src/mame/video/pc090oj.c
r29505r29506
7171*****************************************************************************/
7272
7373
74
7574const device_type PC090OJ = &device_creator<pc090oj_device>;
7675
7776pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r29505r29506
8079   m_sprite_ctrl(0),
8180   m_ram(NULL),
8281   m_ram_buffered(0),
82   m_gfxnum(0),
83   m_x_offset(0),
84   m_y_offset(0),
85   m_use_buffer(0),
8386   m_gfxdecode(*this),
8487   m_palette(*this)
8588{
r29505r29506
106109}
107110
108111//-------------------------------------------------
109//  device_config_complete - perform any
110//  operations now that the configuration is
111//  complete
112//-------------------------------------------------
113
114void pc090oj_device::device_config_complete()
115{
116   // inherit a copy of the static data
117   const pc090oj_interface *intf = reinterpret_cast<const pc090oj_interface *>(static_config());
118   if (intf != NULL)
119   *static_cast<pc090oj_interface *>(this) = *intf;
120
121   // or initialize to defaults if none provided
122   else
123   {
124   }
125}
126
127//-------------------------------------------------
128112//  device_start - device-specific startup
129113//-------------------------------------------------
130114
branches/new_menus/src/mame/video/pc090oj.h
r29505r29506
1#ifndef _PC090OJ_H_
2#define _PC090OJ_H_
1#ifndef __PC090OJ_H__
2#define __PC090OJ_H__
33
4struct pc090oj_interface
4class pc090oj_device : public device_t
55{
6   int                m_gfxnum;
7
8   int                m_x_offset, m_y_offset;
9   int                m_use_buffer;
10};
11
12class pc090oj_device : public device_t,
13                  public pc090oj_interface
14{
156public:
167   pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
178   ~pc090oj_device() {}
r29505r29506
1910   // static configuration
2011   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2112   static void static_set_palette_tag(device_t &device, const char *tag);
22
13   static void set_gfx_region(device_t &device, int gfxregion) { downcast<pc090oj_device &>(device).m_gfxnum = gfxregion; }
14   static void set_usebuffer(device_t &device, int use_buf) { downcast<pc090oj_device &>(device).m_use_buffer = use_buf; }
15   static void set_offsets(device_t &device, int x_offset, int y_offset)
16   {
17      pc090oj_device &dev = downcast<pc090oj_device &>(device);
18      dev.m_x_offset = x_offset;
19      dev.m_y_offset = y_offset;
20   }
21   
2322   DECLARE_READ16_MEMBER( word_r );
2423   DECLARE_WRITE16_MEMBER( word_w );
2524
r29505r29506
2928
3029protected:
3130   // device-level overrides
32   virtual void device_config_complete();
3331   virtual void device_start();
3432   virtual void device_reset();
3533
r29505r29506
4947
5048   UINT16 *   m_ram;
5149   UINT16 *   m_ram_buffered;
50
51   int        m_gfxnum;
52   int        m_x_offset, m_y_offset;
53   int        m_use_buffer;
54
5255   required_device<gfxdecode_device> m_gfxdecode;
5356   required_device<palette_device> m_palette;
5457};
5558
5659extern const device_type PC090OJ;
5760
58#define MCFG_PC090OJ_ADD(_tag, _interface) \
59   MCFG_DEVICE_ADD(_tag, PC090OJ, 0) \
60   MCFG_DEVICE_CONFIG(_interface)
6161
62#define MCFG_PC090OJ_GFX_REGION(_region) \
63   pc090oj_device::set_gfx_region(*device, _region);
64
65#define MCFG_PC090OJ_OFFSETS(_xoffs, _yoffs) \
66   pc090oj_device::set_offsets(*device, _xoffs, _yoffs);
67
68#define MCFG_PC090OJ_USEBUFFER(_use_buf) \
69   pc090oj_device::set_usebuffer(*device, _use_buf);
70
6271#define MCFG_PC090OJ_GFXDECODE(_gfxtag) \
6372   pc090oj_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
6473
branches/new_menus/src/mame/video/tumbleb.c
r29505r29506
291291   else
292292      m_pf1_alt_tilemap->draw(screen, bitmap, cliprect, 0, 0);
293293
294   machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, m_spriteram, m_spriteram.bytes()/2);
294   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, m_spriteram.bytes()/2);
295295}
296296
297297UINT32 tumbleb_state::screen_update_tumblepb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
branches/new_menus/src/mame/video/tc0100scn.c
r29505r29506
141141   m_bg1_colbank(0),
142142   m_tx_colbank(0),
143143   m_dblwidth(0),
144   m_gfxnum(0),
145   m_txnum(0),
146   m_x_offset(0),
147   m_y_offset(0),
148   m_flip_xoffs(0),
149   m_flip_yoffs(0),
150   m_flip_text_xoffs(0),
151   m_flip_text_yoffs(0),
152   m_multiscrn_xoffs(0),
153   m_multiscrn_hack(0),
144154   m_gfxdecode(*this),
145155   m_palette(*this)
146156{
r29505r29506
167177}
168178
169179//-------------------------------------------------
170//  device_config_complete - perform any
171//  operations now that the configuration is
172//  complete
173//-------------------------------------------------
174
175void tc0100scn_device::device_config_complete()
176{
177   // inherit a copy of the static data
178   const tc0100scn_interface *intf = reinterpret_cast<const tc0100scn_interface *>(static_config());
179   if (intf != NULL)
180   *static_cast<tc0100scn_interface *>(this) = *intf;
181
182   // or initialize to defaults if none provided
183   else
184   {
185   }
186}
187
188//-------------------------------------------------
189180//  device_start - device-specific startup
190181//-------------------------------------------------
191182
r29505r29506
300291
301292void tc0100scn_device::device_reset()
302293{
303   int i;
304
305294   m_dblwidth = 0;
306295   m_colbank = 0;
307296   m_gfxbank = 0; /* Mjnquest uniquely banks tiles */
308297
309   for (i = 0; i < 8; i++)
298   for (int i = 0; i < 8; i++)
310299      m_ctrl[i] = 0;
311300}
312301
branches/new_menus/src/mame/video/tc0280grd.c
r29505r29506
4747
4848
4949//-------------------------------------------------
50//  device_config_complete - perform any
51//  operations now that the configuration is
52//  complete
53//-------------------------------------------------
54
55void tc0280grd_device::device_config_complete()
56{
57   // inherit a copy of the static data
58   const tc0280grd_interface *intf = reinterpret_cast<const tc0280grd_interface *>(static_config());
59   if (intf != NULL)
60   *static_cast<tc0280grd_interface *>(this) = *intf;
61
62   // or initialize to defaults if none provided
63   else
64   {
65   }
66}
67
68//-------------------------------------------------
6950//  device_start - device-specific startup
7051//-------------------------------------------------
7152
branches/new_menus/src/mame/video/tc0100scn.h
r29505r29506
1#ifndef _TC0100SCN_H_
2#define _TC0100SCN_H_
1#ifndef __TC0100SCN_H__
2#define __TC0100SCN_H__
33
4struct tc0100scn_interface
4class tc0100scn_device : public device_t
55{
6   int                m_gfxnum;
7   int                m_txnum;
8
9   int                m_x_offset, m_y_offset;
10   int                m_flip_xoffs, m_flip_yoffs;
11   int                m_flip_text_xoffs, m_flip_text_yoffs;
12
13   int                m_multiscrn_xoffs;
14   int                m_multiscrn_hack;
15};
16
17class tc0100scn_device : public device_t,
18                     public tc0100scn_interface
19{
206public:
217   tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
228   ~tc0100scn_device() {}
r29505r29506
2410   // static configuration
2511   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2612   static void static_set_palette_tag(device_t &device, const char *tag);
27
13   static void set_gfx_region(device_t &device, int gfxregion) { downcast<tc0100scn_device &>(device).m_gfxnum = gfxregion; }
14   static void set_tx_region(device_t &device, int txregion) { downcast<tc0100scn_device &>(device).m_txnum = txregion; }
15   static void set_multiscr_xoffs(device_t &device, int xoffs) { downcast<tc0100scn_device &>(device).m_multiscrn_xoffs = xoffs; }
16   static void set_multiscr_hack(device_t &device, int hack) { downcast<tc0100scn_device &>(device).m_multiscrn_hack = hack; }
17   static void set_offsets(device_t &device, int x_offset, int y_offset)
18   {
19      tc0100scn_device &dev = downcast<tc0100scn_device &>(device);
20      dev.m_x_offset = x_offset;
21      dev.m_y_offset = y_offset;
22   }
23   static void set_offsets_flip(device_t &device, int x_offset, int y_offset)
24   {
25      tc0100scn_device &dev = downcast<tc0100scn_device &>(device);
26      dev.m_flip_xoffs = x_offset;
27      dev.m_flip_yoffs = y_offset;
28   }
29   static void set_offsets_fliptx(device_t &device, int x_offset, int y_offset)
30   {
31      tc0100scn_device &dev = downcast<tc0100scn_device &>(device);
32      dev.m_flip_text_xoffs = x_offset;
33      dev.m_flip_text_yoffs = y_offset;
34   }
35   
2836   #define TC0100SCN_SINGLE_VDU    1024
2937
3038   /* Function to set separate color banks for the three tilemapped layers.
r29505r29506
6371
6472protected:
6573   // device-level overrides
66   virtual void device_config_complete();
6774   virtual void device_start();
6875   virtual void device_reset();
6976
r29505r29506
9097   INT32        m_bg0_colbank, m_bg1_colbank, m_tx_colbank;
9198   int          m_dblwidth;
9299
100   int          m_gfxnum;
101   int          m_txnum;
102   int          m_x_offset, m_y_offset;
103   int          m_flip_xoffs, m_flip_yoffs;
104   int          m_flip_text_xoffs, m_flip_text_yoffs;
105   int          m_multiscrn_xoffs;
106   int          m_multiscrn_hack;
107   
93108   required_device<gfxdecode_device> m_gfxdecode;
94109   required_device<palette_device> m_palette;
95110
r29505r29506
110125extern const device_type TC0100SCN;
111126
112127
113#define MCFG_TC0100SCN_ADD(_tag, _interface) \
114   MCFG_DEVICE_ADD(_tag, TC0100SCN, 0) \
115   MCFG_DEVICE_CONFIG(_interface)
128#define MCFG_TC0100SCN_GFX_REGION(_region) \
129   tc0100scn_device::set_gfx_region(*device, _region);
116130
131#define MCFG_TC0100SCN_TX_REGION(_region) \
132   tc0100scn_device::set_tx_region(*device, _region);
133
134#define MCFG_TC0100SCN_OFFSETS(_xoffs, _yoffs) \
135   tc0100scn_device::set_offsets(*device, _xoffs, _yoffs);
136
137#define MCFG_TC0100SCN_OFFSETS_FLIP(_xoffs, _yoffs) \
138   tc0100scn_device::set_offsets_flip(*device, _xoffs, _yoffs);
139
140#define MCFG_TC0100SCN_OFFSETS_FLIPTX(_xoffs, _yoffs) \
141   tc0100scn_device::set_offsets_fliptx(*device, _xoffs, _yoffs);
142
143#define MCFG_TC0100SCN_MULTISCR_XOFFS(_xoffs) \
144   tc0100scn_device::set_multiscr_xoffs(*device, _xoffs);
145
146#define MCFG_TC0100SCN_MULTISCR_HACK(_hack) \
147   tc0100scn_device::set_multiscr_hack(*device, _hack);
148
117149#define MCFG_TC0100SCN_GFXDECODE(_gfxtag) \
118150   tc0100scn_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
119151
branches/new_menus/src/mame/video/tc0280grd.h
r29505r29506
1#ifndef _TC0280GRD_H_
2#define _TC0280GRD_H_
1#ifndef __TC0280GRD_H__
2#define __TC0280GRD_H__
33
4struct tc0280grd_interface
4class tc0280grd_device : public device_t
55{
6   int                m_gfxnum;
7};
8
9class tc0280grd_device : public device_t,
10                     public tc0280grd_interface
11{
126public:
137   tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
148   ~tc0280grd_device() {}
159
1610   // static configuration
1711   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
12   static void set_gfx_region(device_t &device, int gfxregion) { downcast<tc0280grd_device &>(device).m_gfxnum = gfxregion; }
1813
1914   DECLARE_READ16_MEMBER( tc0280grd_word_r );
2015   DECLARE_WRITE16_MEMBER( tc0280grd_word_w );
r29505r29506
3025
3126protected:
3227   // device-level overrides
33   virtual void device_config_complete();
3428   virtual void device_start();
3529   virtual void device_reset();
3630
r29505r29506
4236
4337   UINT16         m_ctrl[8];
4438   int            m_base_color;
39   int            m_gfxnum;
4540   required_device<gfxdecode_device> m_gfxdecode;
4641
4742   TILE_GET_INFO_MEMBER(tc0280grd_get_tile_info);
r29505r29506
6055   MCFG_DEVICE_ADD(_tag, TC0430GRW, 0) \
6156   MCFG_DEVICE_CONFIG(_interface)
6257
58#define MCFG_TC0280GRD_GFX_REGION(_region) \
59   tc0280grd_device::set_gfx_region(*device, _region);
60
61#define MCFG_TC0430GRW_GFX_REGION(_region) \
62   tc0280grd_device::set_gfx_region(*device, _region);
63
6364#define MCFG_TC0280GRD_GFXDECODE(_gfxtag) \
6465   tc0280grd_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
6566
branches/new_menus/src/mame/video/ppu2c0x.c
r29505r29506
111111
112112void ppu2c0x_device::device_config_complete()
113113{
114   const ppu2c0x_interface *config = reinterpret_cast<const ppu2c0x_interface *>(static_config());
115   assert(config);
116
117114   /* reset the callbacks */
118115   m_latch = ppu2c0x_latch_delegate();
119116   m_scanline_callback_proc = ppu2c0x_scanline_delegate();
120117   m_hblank_callback_proc = ppu2c0x_hblank_delegate();
121118   m_vidaccess_callback_proc = ppu2c0x_vidaccess_delegate();
122
123   m_color_base = config->color_base;
124
125   m_cpu_tag = config->cpu_tag;
126119}
127120
128121ppu2c0x_device::ppu2c0x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
r29505r29506
130123               device_memory_interface(mconfig, *this),
131124               device_video_interface(mconfig, *this),
132125               m_space_config("videoram", ENDIANNESS_LITTLE, 8, 17, 0, NULL, *ADDRESS_MAP_NAME(ppu2c0x)),
126               m_cpu(*this),
133127               m_scanline(0),  // reset the scanline count
134128               m_refresh_data(0),
135129               m_refresh_latch(0),
r29505r29506
142136               m_tile_page(0),
143137               m_sprite_page(0),
144138               m_back_color(0),
139               m_color_base(0),
145140               m_scan_scale(1), // set the scan scale (this is for dual monitor vertical setups)
146141               m_tilecount(0),
147142               m_draw_phase(0)
r29505r29506
210205
211206void ppu2c0x_device::device_start()
212207{
213   m_cpu = machine().device<cpu_device>( m_cpu_tag );
214
215   assert(m_cpu);
216
217208   // bind our handler
218209   m_nmi_callback_proc.bind_relative_to(*owner());
219210
branches/new_menus/src/mame/video/ppu2c0x.h
r29505r29506
8383//  INTERFACE CONFIGURATION MACROS
8484///*************************************************************************
8585
86#define MCFG_PPU2C0X_ADD(_tag, _type, _intrf)   \
87   MCFG_DEVICE_ADD(_tag, _type, 0) \
88   MCFG_DEVICE_CONFIG(_intrf)
86#define MCFG_PPU2C0X_ADD(_tag, _type)   \
87   MCFG_DEVICE_ADD(_tag, _type, 0)
8988
90#define MCFG_PPU2C02_ADD(_tag, _intrf)   \
91   MCFG_PPU2C0X_ADD(_tag, PPU_2C02, _intrf)
92#define MCFG_PPU2C03B_ADD(_tag, _intrf)   \
93   MCFG_PPU2C0X_ADD(_tag, PPU_2C03B, _intrf)
94#define MCFG_PPU2C04_ADD(_tag, _intrf)   \
95   MCFG_PPU2C0X_ADD(_tag, PPU_2C04, _intrf)
96#define MCFG_PPU2C07_ADD(_tag, _intrf)   \
97   MCFG_PPU2C0X_ADD(_tag, PPU_2C07, _intrf)
98#define MCFG_PPU2C05_01_ADD(_tag, _intrf)   \
99   MCFG_PPU2C0X_ADD(_tag, PPU_2C05_01, _intrf)
100#define MCFG_PPU2C05_02_ADD(_tag, _intrf)   \
101   MCFG_PPU2C0X_ADD(_tag, PPU_2C05_02, _intrf)
102#define MCFG_PPU2C05_03_ADD(_tag, _intrf)   \
103   MCFG_PPU2C0X_ADD(_tag, PPU_2C05_03, _intrf)
104#define MCFG_PPU2C05_04_ADD(_tag, _intrf)   \
105   MCFG_PPU2C0X_ADD(_tag, PPU_2C05_04, _intrf)
89#define MCFG_PPU2C02_ADD(_tag)   \
90   MCFG_PPU2C0X_ADD(_tag, PPU_2C02)
91#define MCFG_PPU2C03B_ADD(_tag)   \
92   MCFG_PPU2C0X_ADD(_tag, PPU_2C03B)
93#define MCFG_PPU2C04_ADD(_tag)   \
94   MCFG_PPU2C0X_ADD(_tag, PPU_2C04)
95#define MCFG_PPU2C07_ADD(_tag)   \
96   MCFG_PPU2C0X_ADD(_tag, PPU_2C07)
97#define MCFG_PPU2C05_01_ADD(_tag)   \
98   MCFG_PPU2C0X_ADD(_tag, PPU_2C05_01)
99#define MCFG_PPU2C05_02_ADD(_tag)   \
100   MCFG_PPU2C0X_ADD(_tag, PPU_2C05_02)
101#define MCFG_PPU2C05_03_ADD(_tag)   \
102   MCFG_PPU2C0X_ADD(_tag, PPU_2C05_03)
103#define MCFG_PPU2C05_04_ADD(_tag)   \
104   MCFG_PPU2C0X_ADD(_tag, PPU_2C05_04)
106105
107106#define MCFG_PPU2C0X_SET_SCREEN MCFG_VIDEO_SET_SCREEN
108107
109#define MCFG_PPU2C0X_SET_NMI( _class, _method) \
108#define MCFG_PPU2C0X_CPU(_tag) \
109   ppu2c0x_device::set_cpu_tag(*device, "^"_tag);
110
111#define MCFG_PPU2C0X_COLORBASE(_color) \
112   ppu2c0x_device::set_color_base(*device, _color);
113
114#define MCFG_PPU2C0X_SET_NMI(_class, _method) \
110115   ppu2c0x_device::set_nmi_delegate(*device, ppu2c0x_nmi_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0));
111116
117
112118///*************************************************************************
113119//  TYPE DEFINITIONS
114120///*************************************************************************
r29505r29506
119125typedef device_delegate<void (offs_t offset)> ppu2c0x_latch_delegate;
120126
121127
122// ======================> ppu2c0x_interface
123
124struct ppu2c0x_interface
125{
126   const char        *cpu_tag;
127   int               gfx_layout_number;        /* gfx layout number used by each chip */
128   int               color_base;               /* color base to use per ppu */
129   int               mirroring;                /* mirroring options (PPU_MIRROR_* flag) */
130};
131
132
133128// ======================> ppu2c0x_device
134129
135130class ppu2c0x_device :  public device_t,
136131                  public device_memory_interface,
137                  public device_video_interface,
138                  public ppu2c0x_interface
132                  public device_video_interface
139133{
140134public:
141135   // construction/destruction
r29505r29506
154148   // address space configurations
155149   const address_space_config      m_space_config;
156150
151   static void set_cpu_tag(device_t &device, const char *tag) { downcast<ppu2c0x_device &>(device).m_cpu.set_tag(tag); }
152   static void set_color_base(device_t &device, int colorbase) { downcast<ppu2c0x_device &>(device).m_color_base = colorbase; }
153   static void set_nmi_delegate(device_t &device, ppu2c0x_nmi_delegate cb);
157154
158155   /* routines */
159156   void init_palette( palette_device &palette, int first_entry );
r29505r29506
173170   void set_scanline_callback( ppu2c0x_scanline_delegate cb ) { m_scanline_callback_proc = cb; m_scanline_callback_proc.bind_relative_to(*owner()); };
174171   void set_hblank_callback( ppu2c0x_hblank_delegate cb ) { m_hblank_callback_proc = cb; m_hblank_callback_proc.bind_relative_to(*owner()); };
175172   void set_vidaccess_callback( ppu2c0x_vidaccess_delegate cb ) { m_vidaccess_callback_proc = cb; m_vidaccess_callback_proc.bind_relative_to(*owner()); };
176   static void set_nmi_delegate(device_t &device,ppu2c0x_nmi_delegate cb);
177173   void set_scanlines_per_frame( int scanlines ) { m_scanlines_per_frame = scanlines; };
178174
179175   // MMC5 has to be able to check this
r29505r29506
186182
187183   //  void update_screen(bitmap_t &bitmap, const rectangle &cliprect);
188184
189   cpu_device                  *m_cpu;
185   required_device<cpu_device> m_cpu;
186
190187   bitmap_ind16                *m_bitmap;          /* target bitmap */
191188   UINT8                       *m_spriteram;           /* sprite ram */
192189   pen_t                       *m_colortable;          /* color table modified at run time */
r29505r29506
222219   emu_timer                   *m_nmi_timer;           /* NMI timer */
223220   emu_timer                   *m_scanline_timer;      /* scanline timer */
224221
225   const char        *m_cpu_tag;
226
227222private:
228223   static const device_timer_id TIMER_HBLANK = 0;
229224   static const device_timer_id TIMER_NMI = 1;
branches/new_menus/src/mame/video/rohga.c
r29505r29506
1515   m_spriteram->copy();
1616}
1717
18VIDEO_START_MEMBER(rohga_state,rohga)
19{
20   m_sprgen1->set_col_callback(rohga_col_callback);
21   m_sprgen1->set_pri_callback(rohga_pri_callback);
22}
23
24VIDEO_START_MEMBER(rohga_state,schmeisr)
25{
26   VIDEO_START_CALL_MEMBER( rohga );
27   // wire mods on pcb..
28   m_sprgen1->set_col_callback(schmeisr_col_callback);
29}
30
31
32UINT16 rohga_pri_callback(UINT16 x)
33{
34   switch (x & 0x6000)
35   {
36      case 0x0000: return 0;
37      case 0x4000: return 0xf0;
38      case 0x6000: return 0xf0 | 0xcc;
39      case 0x2000: return 0;//0xf0|0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */
40   }
41
42   return 0;
43}
44
45UINT16 schmeisr_col_callback(UINT16 x)
46{
47   UINT16 colour = ((x >> 9) & 0xf) << 2;
48   if (x & 0x8000)
49      colour++;
50
51   return colour;
52}
53
54UINT16 rohga_col_callback(UINT16 x)
55{
56   return (x >> 9) & 0xf;
57}
58
59
60
6118/******************************************************************************/
6219
6320UINT32 rohga_state::screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
r29505r29506
12582   bitmap_ind16* sprite_bitmap;
12683   int penbase;
12784
128   sprite_bitmap = &machine().device<decospr_device>("spritegen2")->get_sprite_temp_bitmap();
85   sprite_bitmap = &m_sprgen2->get_sprite_temp_bitmap();
12986   penbase = 0x600;
13087
13188   UINT16* srcline;
branches/new_menus/src/mame/video/k054338.c
r29505r29506
11
22#include "emu.h"
33#include "k054338.h"
4#include "k055555.h"
54
65
76#define VERBOSE 0
r29505r29506
237236
238237k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
239238   : device_t(mconfig, K054338, "Konami 054338", tag, owner, clock, "k054338", __FILE__),
240   device_video_interface(mconfig, *this)
239   device_video_interface(mconfig, *this),
240   m_alpha_inv(0),
241   m_k055555_tag("")
241242   //m_regs[32],
242243   //m_shd_rgb[9],
243244{
244245}
245246
246247//-------------------------------------------------
247//  device_config_complete - perform any
248//  operations now that the configuration is
249//  complete
250//-------------------------------------------------
251
252void k054338_device::device_config_complete()
253{
254   // inherit a copy of the static data
255   const k054338_interface *intf = reinterpret_cast<const k054338_interface *>(static_config());
256   if (intf != NULL)
257   *static_cast<k054338_interface *>(this) = *intf;
258
259   // or initialize to defaults if none provided
260   else
261   {
262   m_alpha_inv = 0;
263   m_k055555_tag = "";
264   };
265}
266
267//-------------------------------------------------
268248//  device_start - device-specific startup
269249//-------------------------------------------------
270250
branches/new_menus/src/mame/video/k054338.h
r29505r29506
1
21#pragma once
32#ifndef __K054338_H__
43#define __K054338_H__
54
65#include "k055555.h"
76
8#define MCFG_K054338_ADD(_tag, _interface) \
9   MCFG_DEVICE_ADD(_tag, K054338, 0) \
10   MCFG_DEVICE_CONFIG(_interface)
117
12
13
148/* K054338 mixer/alpha blender */
159void K054338_vh_start(running_machine &machine, k055555_device* k055555);
1610DECLARE_WRITE16_HANDLER( K054338_word_w ); // "CLCT" registers
r29505r29506
3832#define K338_CTL_CLIPSL     0x20
3933
4034
41struct k054338_interface
42{
43   int                m_alpha_inv;
44   const char         *m_k055555_tag;
45};
46
47
4835class k054338_device : public device_t,
49                              public device_video_interface,
50                              public k054338_interface
36                  public device_video_interface
5137{
5238public:
5339   k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5440   ~k054338_device() {}
5541
42   // static configuration
43   static void set_mixer_tag(device_t &device, const char  *tag) { downcast<k054338_device &>(device).m_k055555_tag = tag; }
44   static void set_yinvert(device_t &device, int alpha_inv) { downcast<k054338_device &>(device).m_alpha_inv = alpha_inv; }
45
5646   DECLARE_WRITE16_MEMBER( word_w ); // "CLCT" registers
5747   DECLARE_WRITE32_MEMBER( long_w );
5848
r29505r29506
6858
6959protected:
7060   // device-level overrides
71   virtual void device_config_complete();
7261   virtual void device_start();
7362   virtual void device_reset();
7463
7564private:
7665   // internal state
77   UINT16    m_regs[32];
78   int       m_shd_rgb[9];
66   UINT16      m_regs[32];
67   int         m_shd_rgb[9];
68   int         m_alpha_inv;
69   const char  *m_k055555_tag;
7970
8071   k055555_device *m_k055555;  /* used to fill BG color */
8172};
8273
8374extern const device_type K054338;
8475
76
77#define MCFG_K054338_MIXER(_tag) \
78   k054338_device::set_mixer_tag(*device, _tag);
79
80#define MCFG_K054338_ALPHAINV(_alphainv) \
81   k054338_device::set_alpha_invert(*device, _alphainv);
82
83
8584#endif
branches/new_menus/src/mame/video/namcona1.c
r29505r29506
1414   tile_data &tileinfo,
1515   int tile_index,
1616   const UINT16 *tilemap_videoram,
17   int tilemap_color,
1817   bool use_4bpp_gfx )
1918{
2019   UINT16 *source;
2120
2221   int data = tilemap_videoram[tile_index];
2322   int tile = data&0xfff;
24   int gfx;
23   int gfx = use_4bpp_gfx ? 1 : 0;
24   int color = use_4bpp_gfx ? (data & 0x7000)>>12 : 0;
2525
26   if( use_4bpp_gfx )
27   {
28      gfx = 1;
29      tilemap_color *= 0x10;
30      tilemap_color += (data & 0x7000)>>12;
31   }
32   else
33   {
34      gfx = 0;
35   }
36
3726   if( data & 0x8000 )
3827   {
39      SET_TILE_INFO_MEMBER(gfx,tile,tilemap_color,TILE_FORCE_LAYER0 );
28      SET_TILE_INFO_MEMBER(gfx,tile,color,TILE_FORCE_LAYER0 );
4029   }
4130   else
4231   {
43      SET_TILE_INFO_MEMBER(gfx,tile,tilemap_color,0 );
44      if (ENDIANNESS_NATIVE == ENDIANNESS_BIG)
45         tileinfo.mask_data = (UINT8 *)(m_shaperam+4*tile);
46      else
47      {
48         UINT8 *mask_data = m_mask_data;
49         source = m_shaperam+4*tile;
50         mask_data[0] = source[0]>>8;
51         mask_data[1] = source[0]&0xff;
52         mask_data[2] = source[1]>>8;
53         mask_data[3] = source[1]&0xff;
54         mask_data[4] = source[2]>>8;
55         mask_data[5] = source[2]&0xff;
56         mask_data[6] = source[3]>>8;
57         mask_data[7] = source[3]&0xff;
58         tileinfo.mask_data = mask_data;
59      }
32      SET_TILE_INFO_MEMBER(gfx,tile,color,0 );
33      tileinfo.mask_data = &m_shaperam[tile*8];
6034   }
6135} /* tilemap_get_info */
6236
6337TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info0)
6438{
6539   UINT16 *videoram = m_videoram;
66   tilemap_get_info(tileinfo,tile_index,0*0x1000+videoram,m_tilemap_palette_bank[0],m_vreg[0xbc/2]&1);
40   tilemap_get_info(tileinfo,tile_index,0*0x1000+videoram,m_vreg[0xbc/2]&1);
6741}
6842
6943TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info1)
7044{
7145   UINT16 *videoram = m_videoram;
72   tilemap_get_info(tileinfo,tile_index,1*0x1000+videoram,m_tilemap_palette_bank[1],m_vreg[0xbc/2]&2);
46   tilemap_get_info(tileinfo,tile_index,1*0x1000+videoram,m_vreg[0xbc/2]&2);
7347}
7448
7549TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info2)
7650{
7751   UINT16 *videoram = m_videoram;
78   tilemap_get_info(tileinfo,tile_index,2*0x1000+videoram,m_tilemap_palette_bank[2],m_vreg[0xbc/2]&4);
52   tilemap_get_info(tileinfo,tile_index,2*0x1000+videoram,m_vreg[0xbc/2]&4);
7953}
8054
8155TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info3)
8256{
8357   UINT16 *videoram = m_videoram;
84   tilemap_get_info(tileinfo,tile_index,3*0x1000+videoram,m_tilemap_palette_bank[3],m_vreg[0xbc/2]&8);
58   tilemap_get_info(tileinfo,tile_index,3*0x1000+videoram,m_vreg[0xbc/2]&8);
8559}
8660
8761TILE_GET_INFO_MEMBER(namcona1_state::roz_get_info)
8862{
89   UINT16 *videoram = m_videoram;
9063   /* each logical tile is constructed from 4*4 normal tiles */
91   int tilemap_color = m_roz_palette;
9264   int use_4bpp_gfx = m_vreg[0xbc/2]&16; /* ? */
9365   int c = tile_index%0x40;
9466   int r = tile_index/0x40;
95   int data = videoram[0x8000/2+(r/4)*0x40+c/4]&0xfbf; /* mask out bit 0x40 - patch for Emeraldia Japan */
67   int data = m_videoram[0x8000/2+(r/4)*0x40+c/4]&0xfbf; /* mask out bit 0x40 - patch for Emeraldia Japan */
9668   int tile = (data+(c%4)+(r%4)*0x40)&0xfff;
97   int gfx = use_4bpp_gfx;
98   if( use_4bpp_gfx )
99   {
100      tilemap_color *= 0x10;
101      tilemap_color += (data & 0x7000)>>12;
102   }
69   int gfx = use_4bpp_gfx ? 1 : 0;
70   int color = use_4bpp_gfx ? (data & 0x7000)>>12 : 0;
71
10372   if( data & 0x8000 )
10473   {
105      SET_TILE_INFO_MEMBER(gfx,tile,tilemap_color,TILE_FORCE_LAYER0 );
74      SET_TILE_INFO_MEMBER(gfx,tile,color,TILE_FORCE_LAYER0 );
10675   }
10776   else
10877   {
109      UINT8 *mask_data = (UINT8 *)(m_shaperam+4*tile);
110
111      if (ENDIANNESS_NATIVE == ENDIANNESS_LITTLE)
112      {
113         UINT16 *source = (UINT16 *)mask_data;
114         UINT8 *conv_data = m_conv_data;
115         conv_data[0] = source[0]>>8;
116         conv_data[1] = source[0]&0xff;
117         conv_data[2] = source[1]>>8;
118         conv_data[3] = source[1]&0xff;
119         conv_data[4] = source[2]>>8;
120         conv_data[5] = source[2]&0xff;
121         conv_data[6] = source[3]>>8;
122         conv_data[7] = source[3]&0xff;
123         mask_data = conv_data;
124      }
125      SET_TILE_INFO_MEMBER(gfx,tile,tilemap_color,0 );
126      tileinfo.mask_data = mask_data;
78      SET_TILE_INFO_MEMBER(gfx,tile,color,0 );
79      tileinfo.mask_data = &m_shaperam[tile*8];
12780   }
12881} /* roz_get_info */
12982
r29505r29506
13588   COMBINE_DATA( &videoram[offset] );
13689   if( offset<0x8000/2 )
13790   {
138      m_bg_tilemap[offset/0x1000]->mark_tile_dirty(offset&0xfff );
91      m_bg_tilemap[offset/0x1000]->mark_tile_dirty(offset&0xfff);
13992   }
14093   else if( offset<0xa000/2 )
14194   {
142      m_roz_tilemap ->mark_all_dirty();
95      m_bg_tilemap[4]->mark_all_dirty();
14396   }
14497} /* namcona1_videoram_w */
14598
146READ16_MEMBER(namcona1_state::namcona1_videoram_r)
147{
148   UINT16 *videoram = m_videoram;
149   return videoram[offset];
150} /* namcona1_videoram_r */
151
15299/*************************************************************************/
153100
154101void namcona1_state::UpdatePalette( int offset )
155102{
156   UINT16 data = m_generic_paletteram_16[offset]; /* -RRRRRGG GGGBBBBB */
103   UINT16 data = m_paletteram[offset]; /* -RRRRRGG GGGBBBBB */
157104   /**
158105    * sprites can be configured to use an alternate interpretation of palette ram
159106    * (used in-game in Emeraldia)
r29505r29506
168115   m_palette->set_pen_color(offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
169116} /* namcona1_paletteram_w */
170117
171READ16_MEMBER(namcona1_state::namcona1_paletteram_r)
172{
173   return m_generic_paletteram_16[offset];
174} /* namcona1_paletteram_r */
175
176118WRITE16_MEMBER(namcona1_state::namcona1_paletteram_w)
177119{
178   COMBINE_DATA( &m_generic_paletteram_16[offset] );
120   COMBINE_DATA( &m_paletteram[offset] );
179121   if( m_vreg[0x8e/2] )
180122   { /* graphics enabled; update palette immediately */
181123      UpdatePalette( offset );
r29505r29506
186128   }
187129}
188130
189/*************************************************************************/
190131
191static const gfx_layout shape_layout =
192{
193   8,8,
194   0x1000,
195   1,
196   { 0 },
197   { STEP8(0, 1) },
198   { STEP8(0, 8) },
199   8*8
200}; /* shape_layout */
201
202static const gfx_layout cg_layout_8bpp =
203{
204   8,8,
205   0x1000,
206   8, /* 8BPP */
207   { 0,1,2,3,4,5,6,7 },
208   { STEP8(0, 8) },
209   { STEP8(0, 8*8) },
210   8*8*8
211}; /* cg_layout_8bpp */
212
213static const gfx_layout cg_layout_4bpp =
214{
215   8,8,
216   0x1000,
217   4, /* 4BPP */
218   { 4,5,6,7 },
219   { STEP8(0, 8) },
220   { STEP8(0, 8*8) },
221   8*8*8
222}; /* cg_layout_4bpp */
223
224132READ16_MEMBER(namcona1_state::namcona1_gfxram_r)
225133{
226134   UINT16 type = m_vreg[0x0c/2];
r29505r29506
228136   {
229137      if( offset<0x4000 )
230138      {
231         return m_shaperam[offset];
139         offset *= 2;
140         return (m_shaperam[offset] << 8) | m_shaperam[offset+1];
232141      }
233142   }
234143   else if( type == 0x02 )
r29505r29506
247156   {
248157      if( offset<0x4000 )
249158      {
250         old_word = m_shaperam[offset];
251         COMBINE_DATA( &m_shaperam[offset] );
252         if( m_shaperam[offset]!=old_word )
253            m_gfxdecode->gfx(2)->mark_dirty(offset/4);
159         offset *= 2;
160         if (ACCESSING_BITS_8_15)
161            m_shaperam[offset] = data >> 8;
162         if (ACCESSING_BITS_0_7)
163            m_shaperam[offset+1] = data;
164         m_gfxdecode->gfx(2)->mark_dirty(offset/8);
254165      }
255166   }
256167   else if( type == 0x02 )
r29505r29506
265176   }
266177} /* namcona1_gfxram_w */
267178
268static void UpdateGfx(running_machine &machine)
269{
270} /* UpdateGfx */
271
272179void namcona1_state::video_start()
273180{
274   m_roz_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::roz_get_info),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
275   m_roz_palette = -1;
276
277   for( int i=0; i<NAMCONA1_NUM_TILEMAPS; i++ )
278   {
279      m_tilemap_palette_bank[i] = -1;
280   }
281
181   // normal tilemaps
282182   m_bg_tilemap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info0),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
283183   m_bg_tilemap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info1),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
284184   m_bg_tilemap[2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info2),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
285185   m_bg_tilemap[3] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::tilemap_get_info3),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
286186
287   m_shaperam           = auto_alloc_array_clear(machine(), UINT16, 0x2000*4/2 );
288   m_cgram              = auto_alloc_array_clear(machine(), UINT16, 0x1000*0x40/2 );
187   // roz tilemap
188   m_bg_tilemap[4] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namcona1_state::roz_get_info),this), TILEMAP_SCAN_ROWS, 8,8,64,64 );
289189
290   m_gfxdecode->set_gfx(0, global_alloc( gfx_element(m_palette, cg_layout_8bpp, (UINT8 *)m_cgram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), m_palette->entries()/256, 0 )));
291   m_gfxdecode->set_gfx(1, global_alloc( gfx_element(m_palette, cg_layout_4bpp, (UINT8 *)m_cgram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), m_palette->entries()/16, 0 )));
292   m_gfxdecode->set_gfx(2, global_alloc( gfx_element(m_palette, shape_layout, (UINT8 *)m_shaperam, NATIVE_ENDIAN_VALUE_LE_BE(8,0), m_palette->entries()/2, 0 )));
190   m_shaperam.resize(0x8000);
293191
192   m_gfxdecode->gfx(2)->set_source(m_shaperam);
294193} /* namcona1_vh_start */
295194
296195/*************************************************************************/
r29505r29506
537436
538437void namcona1_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int primask )
539438{
540   UINT16 *videoram = m_videoram;
541   /*          scrollx lineselect
542    *  tmap0   ffe000  ffe200
543    *  tmap1   ffe400  ffe600
544    *  tmap2   ffe800  ffea00
545    *  tmap3   ffec00  ffee00
546    */
547   int xadjust = 0x3a - which*2;
548   const UINT16 *scroll = m_scroll+0x200*which;
549   int line;
550   UINT16 xdata, ydata;
551   int scrollx, scrolly;
552   rectangle clip;
553   const pen_t *paldata;
554   gfx_element *pGfx;
555
556   pGfx = m_gfxdecode->gfx(0);
557   assert(which >= 0 && which < ARRAY_LENGTH(m_tilemap_palette_bank));
558   paldata = &m_palette->pen(pGfx->colorbase() + pGfx->granularity() * m_tilemap_palette_bank[which]);
559
560   /* draw one scanline at a time */
561   clip.min_x = cliprect.min_x;
562   clip.max_x = cliprect.max_x;
563   scrollx = 0;
564   scrolly = 0;
565   for( line=0; line<256; line++ )
439   if(which == 4)
566440   {
567      clip.min_y = line;
568      clip.max_y = line;
569      xdata = scroll[line];
570      if( xdata )
571      {
572         /* screenwise linescroll */
573         scrollx = xadjust+xdata;
574      }
575      ydata = scroll[line+0x100];
576      if( ydata&0x4000 )
577      {
578         /* line select: dword offset from 0xff000 or tilemap source line */
579         scrolly = (ydata - line)&0x1ff;
580      }
441      /* draw the roz tilemap all at once */
442      int incxx = ((INT16)m_vreg[0xc0/2])<<8;
443      int incxy = ((INT16)m_vreg[0xc2/2])<<8;
444      int incyx = ((INT16)m_vreg[0xc4/2])<<8;
445      int incyy = ((INT16)m_vreg[0xc6/2])<<8;
446      INT16 xoffset = m_vreg[0xc8/2];
447      INT16 yoffset = m_vreg[0xca/2];
448      int dx = 46; /* horizontal adjust */
449      int dy = -8; /* vertical adjust */
450      UINT32 startx = (xoffset<<12)+incxx*dx+incyx*dy;
451      UINT32 starty = (yoffset<<12)+incxy*dx+incyy*dy;
452      m_bg_tilemap[4]->draw_roz(screen, bitmap, cliprect,
453         startx, starty, incxx, incxy, incyx, incyy, 0, 0, primask, 0);
454   }
455   else
456   {
457      /* draw one scanline at a time */
458      /*          scrollx lineselect
459      *  tmap0   ffe000  ffe200
460      *  tmap1   ffe400  ffe600
461      *  tmap2   ffe800  ffea00
462      *  tmap3   ffec00  ffee00
463      */
464      const UINT16 *scroll = &m_scroll[which * 0x400/2];
465      const pen_t *paldata = &m_palette->pen(m_bg_tilemap[which]->palette_offset());
466      rectangle clip = cliprect;
467      int xadjust = 0x3a - which*2;
468      int scrollx = 0;
469      int scrolly = 0;
581470
582      if (line >= cliprect.min_y && line <= cliprect.max_y)
471      for( int line = 0; line < 256; line++ )
583472      {
584         if( xdata == 0xc001 )
473         clip.min_y = line;
474         clip.max_y = line;
475         int xdata = scroll[line];
476         int ydata = scroll[line + 0x200/2];
477
478         if( xdata )
585479         {
586            /* This is a simplification, but produces the correct behavior for the only game that uses this
587             * feature, Numan Athletics.
588             */
589            draw_pixel_line(
590               &bitmap.pix16(line),
591               &screen.priority().pix8(line),
592               videoram + ydata + 25,
593               paldata );
480            /* screenwise linescroll */
481            scrollx = xadjust+xdata;
594482         }
595         else
483
484         if( ydata&0x4000 )
596485         {
597            if(which == NAMCONA1_NUM_TILEMAPS )
486            /* line select: dword offset from 0xff000 or tilemap source line */
487            scrolly = (ydata - line)&0x1ff;
488         }
489
490         if (line >= cliprect.min_y && line <= cliprect.max_y)
491         {
492            if( xdata == 0xc001 )
598493            {
599               int incxx = ((INT16)m_vreg[0xc0/2])<<8;
600               int incxy = ((INT16)m_vreg[0xc2/2])<<8;
601               int incyx = ((INT16)m_vreg[0xc4/2])<<8;
602               int incyy = ((INT16)m_vreg[0xc6/2])<<8;
603               INT16 xoffset = m_vreg[0xc8/2];
604               INT16 yoffset = m_vreg[0xca/2];
605               int dx = 46; /* horizontal adjust */
606               int dy = -8; /* vertical adjust */
607               UINT32 startx = (xoffset<<12)+incxx*dx+incyx*dy;
608               UINT32 starty = (yoffset<<12)+incxy*dx+incyy*dy;
609               m_roz_tilemap->draw_roz(screen, bitmap, clip,
610                  startx, starty, incxx, incxy, incyx, incyy, 0, 0, primask, 0);
494               /* This is a simplification, but produces the correct behavior for the only game that uses this
495               * feature, Numan Athletics.
496               */
497               draw_pixel_line(&bitmap.pix16(line),
498                        &screen.priority().pix8(line),
499                        m_videoram + ydata + 25,
500                        paldata );
611501            }
612502            else
613503            {
r29505r29506
638528         }
639529         m_palette_is_dirty = 0;
640530      }
641      UpdateGfx(machine());
642      for( which=0; which<NAMCONA1_NUM_TILEMAPS; which++ )
643      {
644         int tilemap_color = m_vreg[0xb0/2+(which&3)]&0xf;
645         if( tilemap_color!=m_tilemap_palette_bank[which] )
646         {
647            m_bg_tilemap[which] ->mark_all_dirty();
648            m_tilemap_palette_bank[which] = tilemap_color;
649         }
650      } /* next tilemap */
651531
652      { /* ROZ tilemap */
653         int color = m_vreg[0xba/2]&0xf;
654         if( color != m_roz_palette )
655         {
656            m_roz_tilemap ->mark_all_dirty();
657            m_roz_palette = color;
658         }
659      }
532      for( which=0; which < 4; which++ )
533         m_bg_tilemap[which]->set_palette_offset((m_vreg[0xb0/2 + which] & 0xf) * 256);
660534
535      m_bg_tilemap[4]->set_palette_offset((m_vreg[0xba/2] & 0xf) * 256);
536
661537      screen.priority().fill(0, cliprect );
662538
663539      bitmap.fill(0xff, cliprect ); /* background color? */
branches/new_menus/src/mame/video/vsnes.c
r29505r29506
55
66PALETTE_INIT_MEMBER(vsnes_state,vsnes)
77{
8   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu1");
9   ppu->init_palette_rgb(palette, 0 );
8   m_ppu1->init_palette_rgb(palette, 0);
109}
1110
1211PALETTE_INIT_MEMBER(vsnes_state,vsdual)
1312{
14   ppu2c0x_device *ppu1 = machine().device<ppu2c0x_device>("ppu1");
15   ppu2c0x_device *ppu2 = machine().device<ppu2c0x_device>("ppu2");
16   ppu1->init_palette_rgb(palette, 0 );
17   ppu2->init_palette_rgb(palette, 8*4*16 );
13   m_ppu1->init_palette_rgb(palette, 0);
14   m_ppu2->init_palette_rgb(palette, 8 * 4 * 16);
1815}
1916
2017void vsnes_state::ppu_irq_1(int *ppu_regs)
2118{
22   m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
19   m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
2320}
2421
2522void vsnes_state::ppu_irq_2(int *ppu_regs)
2623{
27   m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
24   m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
2825}
2926
30/* our ppu interface                                            */
31const ppu2c0x_interface vsnes_ppu_interface_1 =
32{
33   "maincpu",
34   0,                  /* gfxlayout num */
35   0,                  /* color base */
36   PPU_MIRROR_NONE     /* mirroring */
37};
38
39/* our ppu interface for dual games                             */
40const ppu2c0x_interface vsnes_ppu_interface_2 =
41{
42   "sub",
43   1,                  /* gfxlayout num */
44   512,                /* color base */
45   PPU_MIRROR_NONE     /* mirroring */
46};
47
4827VIDEO_START_MEMBER(vsnes_state,vsnes )
4928{
5029}
r29505r29506
5837  Display refresh
5938
6039***************************************************************************/
40
6141UINT32 vsnes_state::screen_update_vsnes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6242{
6343   /* render the ppu */
64   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu1");
65   ppu->render(bitmap, 0, 0, 0, 0);
44   m_ppu1->render(bitmap, 0, 0, 0, 0);
6645   return 0;
6746}
6847
6948UINT32 vsnes_state::screen_update_vsnes_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7049{
71   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu2");
72   ppu->render(bitmap, 0, 0, 0, 0);
50   m_ppu2->render(bitmap, 0, 0, 0, 0);
7351   return 0;
7452}
branches/new_menus/src/mame/video/tc0480scp.c
r29505r29506
151151   //m_bgscrolly[4](NULL),
152152   m_pri_reg(0),
153153   m_dblwidth(0),
154   m_x_offs(0),
154   m_gfxnum(0),
155   m_txnum(0),
156   m_x_offset(0),
157   m_y_offset(0),
158   m_text_xoffs(0),
159   m_text_yoffs(0),
160   m_flip_xoffs(0),
161   m_flip_yoffs(0),
162   m_col_base(0),
155163   m_gfxdecode(*this),
156164   m_palette(*this)
157165{
r29505r29506
178186}
179187
180188//-------------------------------------------------
181//  device_config_complete - perform any
182//  operations now that the configuration is
183//  complete
184//-------------------------------------------------
185
186void tc0480scp_device::device_config_complete()
187{
188   // inherit a copy of the static data
189   const tc0480scp_interface *intf = reinterpret_cast<const tc0480scp_interface *>(static_config());
190   if (intf != NULL)
191   *static_cast<tc0480scp_interface *>(this) = *intf;
192
193   // or initialize to defaults if none provided
194   else
195   {
196   }
197}
198
199//-------------------------------------------------
200189//  device_start - device-specific startup
201190//-------------------------------------------------
202191
r29505r29506
205194   if(!m_gfxdecode->started())
206195      throw device_missing_dependencies();
207196
208   int i, xd, yd;
197   int xd, yd;
209198
210   m_x_offs = m_x_offset + m_pixels;
211
212
213199   static const gfx_layout tc0480scp_charlayout =
214200   {
215201      8,8,    /* 8*8 characters */
r29505r29506
236222   m_tilemap[3][1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
237223   m_tilemap[4][1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
238224
239   for (i = 0; i < 2; i++)
225   for (int i = 0; i < 2; i++)
240226   {
241227      m_tilemap[0][i]->set_transparent_pen(0);
242228      m_tilemap[1][i]->set_transparent_pen(0);
r29505r29506
245231      m_tilemap[4][i]->set_transparent_pen(0);
246232   }
247233
248   xd = -m_x_offs;
234   xd = -m_x_offset;
249235   yd =  m_y_offset;
250236
251237   /* Metalb and Deadconx have minor screenflip issues: blue planet
r29505r29506
280266   m_tilemap[4][1]->set_scrolldx(xd - 3, 317 - xd);   /* text layer */
281267   m_tilemap[4][1]->set_scrolldy(yd,     256 - yd);   /* text layer */
282268
283   for (i = 0; i < 2; i++)
269   for (int i = 0; i < 2; i++)
284270   {
285271      /* Both sets of bg tilemaps scrollable per pixel row */
286272      m_tilemap[0][i]->set_scroll_rows(512);
r29505r29506
308294
309295void tc0480scp_device::device_reset()
310296{
311   int i;
312
313297   m_dblwidth = 0;
314298
315   for (i = 0; i < 0x18; i++)
299   for (int i = 0; i < 0x18; i++)
316300      m_ctrl[i] = 0;
317301
318302}
r29505r29506
733717      if (!flip)
734718      {
735719         sx = ((m_bgscrollx[layer] + 15 + layer * 4) << 16) + ((255 - (m_ctrl[0x10 + layer] & 0xff)) << 8);
736         sx += (m_x_offs - 15 - layer * 4) * zoomx;
720         sx += (m_x_offset - 15 - layer * 4) * zoomx;
737721
738722         y_index = (m_bgscrolly[layer] << 16) + ((m_ctrl[0x14 + layer] & 0xff) << 8);
739723         y_index -= (m_y_offset - min_y) * zoomy;
r29505r29506
741725      else    /* TC0480SCP tiles flipscreen */
742726      {
743727         sx = ((-m_bgscrollx[layer] + 15 + layer * 4 + m_flip_xoffs ) << 16) + ((255-(m_ctrl[0x10 + layer] & 0xff)) << 8);
744         sx += (m_x_offs - 15 - layer * 4) * zoomx;
728         sx += (m_x_offset - 15 - layer * 4) * zoomx;
745729
746730         y_index = ((-m_bgscrolly[layer] + m_flip_yoffs) << 16) + ((m_ctrl[0x14 + layer] & 0xff) << 8);
747731         y_index -= (m_y_offset - min_y) * zoomy;
r29505r29506
875859   if (!flipscreen)
876860   {
877861      sx = ((m_bgscrollx[layer] + 15 + layer * 4) << 16) + ((255-(m_ctrl[0x10 + layer] & 0xff)) << 8);
878      sx += (m_x_offs - 15 - layer * 4) * zoomx;
862      sx += (m_x_offset - 15 - layer * 4) * zoomx;
879863
880864      y_index = (m_bgscrolly[layer] << 16) + ((m_ctrl[0x14 + layer] & 0xff) << 8);
881865      y_index -= (m_y_offset - min_y) * zoomy;
r29505r29506
883867   else    /* TC0480SCP tiles flipscreen */
884868   {
885869      sx = ((-m_bgscrollx[layer] + 15 + layer * 4 + m_flip_xoffs ) << 16) + ((255 - (m_ctrl[0x10 + layer] & 0xff)) << 8);
886      sx += (m_x_offs - 15 - layer * 4) * zoomx;
870      sx += (m_x_offset - 15 - layer * 4) * zoomx;
887871
888872      y_index = ((-m_bgscrolly[layer] + m_flip_yoffs) << 16) + ((m_ctrl[0x14 + layer] & 0xff) << 8);
889873      y_index -= (m_y_offset - min_y) * zoomy;
r29505r29506
915899      x_index = sx - ((m_bgscroll_ram[layer][row_index] << 16)) - ((m_bgscroll_ram[layer][row_index + 0x800] << 8) & 0xffff);
916900
917901      /* flawed calc ?? */
918      x_index -= (m_x_offs - 0x1f + layer * 4) * ((row_zoom & 0xff) << 8);
902      x_index -= (m_x_offset - 0x1f + layer * 4) * ((row_zoom & 0xff) << 8);
919903
920904/* We used to kludge 270 multiply factor, before adjusting x_index instead */
921905
branches/new_menus/src/mame/video/tc0480scp.h
r29505r29506
11#ifndef __TC0480SCP_H__
22#define __TC0480SCP_H__
33
4struct tc0480scp_interface
4class tc0480scp_device : public device_t
55{
6   int                m_gfxnum;
7   int                m_txnum;
8
9   int                m_pixels;
10
11   int                m_x_offset, m_y_offset;
12   int                m_text_xoffs, m_text_yoffs;
13   int                m_flip_xoffs, m_flip_yoffs;
14
15   int                m_col_base;
16};
17
18class tc0480scp_device : public device_t,
19                                 public tc0480scp_interface
20{
216public:
227   tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
238   ~tc0480scp_device() {}
r29505r29506
2510   // static configuration
2611   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2712   static void static_set_palette_tag(device_t &device, const char *tag);
28
13   static void set_gfx_region(device_t &device, int gfxregion) { downcast<tc0480scp_device &>(device).m_gfxnum = gfxregion; }
14   static void set_tx_region(device_t &device, int txregion) { downcast<tc0480scp_device &>(device).m_txnum = txregion; }
15   static void set_col_base(device_t &device, int col) { downcast<tc0480scp_device &>(device).m_col_base = col; }
16   static void set_offsets(device_t &device, int x_offset, int y_offset)
17   {
18      tc0480scp_device &dev = downcast<tc0480scp_device &>(device);
19      dev.m_x_offset = x_offset;
20      dev.m_y_offset = y_offset;
21   }
22   static void set_offsets_tx(device_t &device, int x_offset, int y_offset)
23   {
24      tc0480scp_device &dev = downcast<tc0480scp_device &>(device);
25      dev.m_text_xoffs = x_offset;
26      dev.m_text_yoffs = y_offset;
27   }
28   static void set_offsets_flip(device_t &device, int x_offset, int y_offset)
29   {
30      tc0480scp_device &dev = downcast<tc0480scp_device &>(device);
31      dev.m_flip_xoffs = x_offset;
32      dev.m_flip_yoffs = y_offset;
33   }
34   
2935   /* When writing a driver, pass zero for the text and flip offsets initially:
3036   then tweak them once you have the 4 bg layer positions correct. Col_base
3137   may be needed when tilemaps use a palette area from sprites. */
r29505r29506
5662
5763protected:
5864   // device-level overrides
59   virtual void device_config_complete();
6065   virtual void device_start();
6166   virtual void device_reset();
6267
r29505r29506
7681   int              m_pri_reg;
7782
7883   /* We keep two tilemaps for each of the 5 actual tilemaps: one at standard width, one double */
79   tilemap_t         *m_tilemap[5][2];
80   INT32           m_dblwidth;
81   int             m_x_offs;
84   tilemap_t        *m_tilemap[5][2];
85   INT32            m_dblwidth;
8286
87   int              m_gfxnum;
88   int              m_txnum;
89   int              m_x_offset, m_y_offset;
90   int              m_text_xoffs, m_text_yoffs;
91   int              m_flip_xoffs, m_flip_yoffs;
92   
93   int              m_col_base;
94   
8395   required_device<gfxdecode_device> m_gfxdecode;
8496   required_device<palette_device> m_palette;
8597
r29505r29506
100112
101113extern const device_type TC0480SCP;
102114
103#define MCFG_TC0480SCP_ADD(_tag, _interface) \
104   MCFG_DEVICE_ADD(_tag, TC0480SCP, 0) \
105   MCFG_DEVICE_CONFIG(_interface)
106115
116#define MCFG_TC0480SCP_GFX_REGION(_region) \
117   tc0480scp_device::set_gfx_region(*device, _region);
118
119#define MCFG_TC0480SCP_TX_REGION(_region) \
120   tc0480scp_device::set_tx_region(*device, _region);
121
122#define MCFG_TC0480SCP_OFFSETS(_xoffs, _yoffs) \
123   tc0480scp_device::set_offsets(*device, _xoffs, _yoffs);
124
125#define MCFG_TC0480SCP_OFFSETS_TX(_xoffs, _yoffs) \
126   tc0480scp_device::set_offsets_tx(*device, _xoffs, _yoffs);
127
128#define MCFG_TC0480SCP_OFFSETS_FLIP(_xoffs, _yoffs) \
129   tc0480scp_device::set_offsets_flip(*device, _xoffs, _yoffs);
130
131#define MCFG_TC0480SCP_COL_BASE(_col) \
132   tc0480scp_device::set_col_base(*device, _col);
133
107134#define MCFG_TC0480SCP_GFXDECODE(_gfxtag) \
108135   tc0480scp_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
109136
branches/new_menus/src/mame/video/tc0150rod.c
r29505r29506
1111
1212#define TC0150ROD_RAM_SIZE 0x2000
1313
14
15
1614const device_type TC0150ROD = &device_creator<tc0150rod_device>;
1715
1816tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r29505r29506
2220}
2321
2422//-------------------------------------------------
25//  device_config_complete - perform any
26//  operations now that the configuration is
27//  complete
28//-------------------------------------------------
29
30void tc0150rod_device::device_config_complete()
31{
32   // inherit a copy of the static data
33   const tc0150rod_interface *intf = reinterpret_cast<const tc0150rod_interface *>(static_config());
34   if (intf != NULL)
35   *static_cast<tc0150rod_interface *>(this) = *intf;
36
37   // or initialize to defaults if none provided
38   else
39   {
40   }
41}
42
43//-------------------------------------------------
4423//  device_start - device-specific startup
4524//-------------------------------------------------
4625
4726void tc0150rod_device::device_start()
4827{
4928   m_ram = auto_alloc_array_clear(machine(), UINT16, TC0150ROD_RAM_SIZE / 2);
50
5129   save_pointer(NAME(m_ram), TC0150ROD_RAM_SIZE / 2);
30
31   m_roadgfx = (UINT16 *)machine().root_device().memregion(m_gfx_region)->base();
32   assert(m_roadgfx);
5233}
5334
5435
r29505r29506
240221   UINT16 roada_line[512], roadb_line[512];
241222   UINT16 *dst16;
242223   UINT16 *roada, *roadb;
243   UINT16 *roadgfx = (UINT16 *)machine().root_device().memregion(m_gfx_region)->base();
244224
245225   UINT16 pixel, color, gfx_word;
246226   UINT16 roada_clipl, roada_clipr, roada_bodyctrl;
r29505r29506
434414         {
435415            if (road_gfx_tilenum)   /* fixes Nightstr round C */
436416            {
437               gfx_word = roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
417               gfx_word = m_roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
438418               pixel = ((gfx_word >> (7 - (x_index % 8) + 8)) & 0x1) * 2 + ((gfx_word >> (7 - (x_index % 8))) & 0x1);
439419
440420               if ((pixel) || !(road_trans))
r29505r29506
485465            {
486466               for (i = left_edge; i >= 0; i--)
487467               {
488                  gfx_word = roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
468                  gfx_word = m_roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
489469                  pixel = ((gfx_word >> (7 - (x_index % 8) + 8)) & 0x1) * 2 + ((gfx_word >> (7 - (x_index % 8))) & 0x1);
490470
491471                  pixpri = (pixel == 0) ? (0) : (pri);    /* off edge has low priority */
r29505r29506
528508         {
529509            for (i = right_edge; i < screen_width; i++)
530510            {
531               gfx_word = roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
511               gfx_word = m_roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
532512               pixel = ((gfx_word >> (7 - (x_index % 8) + 8)) & 0x1) * 2 + ((gfx_word >> (7 - (x_index % 8))) & 0x1);
533513
534514               pixpri = (pixel == 0) ? (0) : (pri);    /* off edge has low priority */
r29505r29506
642622         {
643623            for (i = begin; i < end; i++)
644624            {
645               gfx_word = roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
625               gfx_word = m_roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
646626               pixel = ((gfx_word >> (7 - (x_index % 8) + 8)) & 0x1) * 2 + ((gfx_word >> (7 - (x_index % 8))) & 0x1);
647627
648628               if ((pixel) || !(road_trans))
r29505r29506
692672            {
693673               for (i = left_edge; i >= 0; i--)
694674               {
695                  gfx_word = roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
675                  gfx_word = m_roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
696676                  pixel = ((gfx_word >> (7 - (x_index % 8) + 8)) & 0x1) * 2 + ((gfx_word >> (7 - (x_index % 8))) & 0x1);
697677
698678                  pixpri = (pixel == 0) ? (0) : (pri);    /* off edge has low priority */
r29505r29506
735715         {
736716            for (i = right_edge; i < screen_width; i++)
737717            {
738               gfx_word = roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
718               gfx_word = m_roadgfx[(road_gfx_tilenum << 8) + (x_index >> 3)];
739719               pixel = ((gfx_word >> (7 - (x_index % 8) + 8)) & 0x1) * 2 + ((gfx_word >> (7 - (x_index % 8))) & 0x1);
740720
741721               pixpri = (pixel == 0) ? (0) : (pri);    /* off edge has low priority */
branches/new_menus/src/mame/video/tc0150rod.h
r29505r29506
11#ifndef __TC0150ROD_H__
22#define __TC0150ROD_H__
33
4struct tc0150rod_interface
4class tc0150rod_device : public device_t
55{
6   const char      *m_gfx_region;    /* gfx region for the road */
7};
8
9class tc0150rod_device : public device_t,
10                                 public tc0150rod_interface
11{
126public:
137   tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
148   ~tc0150rod_device() {}
159
10   static void set_gfx_tag(device_t &device, const char *tag) { downcast<tc0150rod_device &>(device).m_gfx_region = tag; }
11
1612   DECLARE_READ16_MEMBER( word_r );
1713   DECLARE_WRITE16_MEMBER( word_w );
1814   void draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, bitmap_ind8 &priority_bitmap, UINT32 low_priority, UINT32 high_priority);
1915
2016protected:
2117   // device-level overrides
22   virtual void device_config_complete();
2318   virtual void device_start();
2419
2520private:
2621   // internal state
2722   UINT16 *        m_ram;
23   const char      *m_gfx_region;    /* gfx region for the road */
24   UINT16 *        m_roadgfx;
2825};
2926
3027extern const device_type TC0150ROD;
3128
32#define MCFG_TC0150ROD_ADD(_tag, _interface) \
33   MCFG_DEVICE_ADD(_tag, TC0150ROD, 0) \
34   MCFG_DEVICE_CONFIG(_interface)
3529
30#define MCFG_TC0150ROD_GFXTAG(_tag) \
31   tc0150rod_device::set_gfx_tag(*device, _tag);
32
3633#endif
branches/new_menus/src/mame/video/c45.c
r29505r29506
4646const device_type NAMCO_C45_ROAD = &device_creator<namco_c45_road_device>;
4747
4848
49const gfx_layout namco_c45_road_device::s_tile_layout =
49const gfx_layout namco_c45_road_device::tilelayout =
5050{
5151   ROAD_TILE_SIZE, ROAD_TILE_SIZE,
52   ROAD_TILE_COUNT_MAX,
52   RGN_FRAC(1,1),
5353   2,
5454   { 0, 8 },
55   {// x offset
56      0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
57      0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17
58   },
59   {// y offset
60      0x000,0x020,0x040,0x060,0x080,0x0a0,0x0c0,0x0e0,
61      0x100,0x120,0x140,0x160,0x180,0x1a0,0x1c0,0x1e0
62   },
55   { STEP8(0, 1), STEP8(16, 1) },
56   { STEP16(0, 32) },
6357   0x200 // offset to next tile
6458};
6559
60
61GFXDECODE_MEMBER( namco_c45_road_device::gfxinfo )
62   GFXDECODE_DEVICE_RAM( "tileram", 0, tilelayout, 0xf00, 64 )
63GFXDECODE_END
64
65
66DEVICE_ADDRESS_MAP_START(map, 16, namco_c45_road_device)
67   AM_RANGE(0x00000, 0x0ffff) AM_RAM_WRITE(tilemap_w) AM_SHARE("tmapram")
68   AM_RANGE(0x10000, 0x1f9ff) AM_RAM_WRITE(tileram_w) AM_SHARE("tileram")
69   AM_RANGE(0x1fa00, 0x1ffff) AM_RAM AM_SHARE("lineram")
70ADDRESS_MAP_END
71
72
6673//-------------------------------------------------
6774//  namco_c45_road_device -- constructor
6875//-------------------------------------------------
6976
7077namco_c45_road_device::namco_c45_road_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
7178   : device_t(mconfig, NAMCO_C45_ROAD, "Namco C45 Road", tag, owner, clock, "namco_c45_road", __FILE__),
72      m_transparent_color(~0),
73      m_tilemap(NULL),
74      m_gfxdecode(*this, "gfxdecode"),
75      m_palette(*this)
79      device_gfx_interface(mconfig, *this, gfxinfo),
80      device_memory_interface(mconfig, *this),
81      m_space_config("c45", ENDIANNESS_BIG, 16, 17, 0, address_map_delegate(FUNC(namco_c45_road_device::map), this)),
82      m_tmapram(*this, "tmapram"),
83      m_tileram(*this, "tileram"),
84      m_lineram(*this, "lineram"),
85      m_transparent_color(~0)
7686{
7787}
7888
89
90
91// We need these trampolines for now because uplift_submaps()
92// can't deal with address maps that contain RAM.
93// We need to explicitly use device_memory_interface::space()
94// because read/write handlers have a parameter called 'space'
95
7996//-------------------------------------------------
80//  read -- read from RAM
97//  read -- CPU read from our address space
8198//-------------------------------------------------
8299
83100READ16_MEMBER( namco_c45_road_device::read )
84101{
85   return m_ram[offset];
102   return device_memory_interface::space().read_word(offset*2);
86103}
87104
88105
89106//-------------------------------------------------
90//  write -- write to RAM
107//  write -- CPU write to our address space
91108//-------------------------------------------------
92109
93110WRITE16_MEMBER( namco_c45_road_device::write )
94111{
95   COMBINE_DATA(&m_ram[offset]);
112   device_memory_interface::space().write_word(offset*2, data, mem_mask);
113}
96114
97   // first half maps to the tilemap
98   if (offset < 0x10000/2)
99      m_tilemap->mark_tile_dirty(offset);
100115
101   // second half maps to the gfx elements
102   else
103   {
104      offset -= 0x10000/2;
105      m_gfxdecode->gfx(0)->mark_dirty(offset / WORDS_PER_ROAD_TILE);
106   }
116//-------------------------------------------------
117//  tilemap_w -- write to tilemap RAM
118//-------------------------------------------------
119
120WRITE16_MEMBER( namco_c45_road_device::tilemap_w )
121{
122   COMBINE_DATA(&m_tmapram[offset]);
123   m_tilemap->mark_tile_dirty(offset);
107124}
108125
109126
110127//-------------------------------------------------
128//  tileram_w -- write to tile RAM
129//-------------------------------------------------
130
131WRITE16_MEMBER( namco_c45_road_device::tileram_w )
132{
133   COMBINE_DATA(&m_tileram[offset]);
134   gfx(0)->mark_dirty(offset / WORDS_PER_ROAD_TILE);
135}
136
137
138//-------------------------------------------------
111139//  draw -- render to the target bitmap
112140//-------------------------------------------------
113141
114142void namco_c45_road_device::draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri)
115143{
116   const UINT8 *clut = (const UINT8 *)memregion("clut")->base();
117144   bitmap_ind16 &source_bitmap = m_tilemap->pixmap();
118   unsigned yscroll = m_ram[0x1fdfe/2];
145   unsigned yscroll = m_lineram[0x3fe/2];
119146
120147   // loop over scanlines
121148   for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
122149   {
123150      // skip if we are not the right priority
124      int screenx = m_ram[0x1fa00/2 + y + 15];
151      int screenx = m_lineram[y + 15];
125152      if (pri != ((screenx & 0xf000) >> 12))
126153         continue;
127154
128155      // skip if we don't have a valid zoom factor
129      unsigned zoomx = m_ram[0x1fe00/2 + y + 15] & 0x3ff;
156      unsigned zoomx = m_lineram[0x400/2 + y + 15] & 0x3ff;
130157      if (zoomx == 0)
131158         continue;
132159
133160      // skip if we don't have a valid source increment
134      unsigned sourcey = m_ram[0x1fc00/2 + y + 15] + yscroll;
161      unsigned sourcey = m_lineram[0x200/2 + y + 15] + yscroll;
135162      const UINT16 *source_gfx = &source_bitmap.pix(sourcey & (ROAD_TILEMAP_HEIGHT - 1));
136163      unsigned dsourcex = (ROAD_TILEMAP_WIDTH << 16) / zoomx;
137164      if (dsourcex == 0)
r29505r29506
171198         while (numpixels-- > 0)
172199         {
173200            int pen = source_gfx[sourcex >> 16];
174            if (m_palette->pen_indirect(pen) != m_transparent_color)
201            if (palette()->pen_indirect(pen) != m_transparent_color)
175202            {
176               if (clut != NULL)
177                  pen = (pen & ~0xff) | clut[pen & 0xff];
203               if (m_clut != NULL)
204                  pen = (pen & ~0xff) | m_clut[pen & 0xff];
178205               dest[screenx] = pen;
179206            }
180207            screenx++;
r29505r29506
186213         while (numpixels-- > 0)
187214         {
188215            int pen = source_gfx[sourcex >> 16];
189            if (clut != NULL)
190               pen = (pen & ~0xff) | clut[pen & 0xff];
216            if (m_clut != NULL)
217               pen = (pen & ~0xff) | m_clut[pen & 0xff];
191218            dest[screenx++] = pen;
192219            sourcex += dsourcex;
193220         }
r29505r29506
202229
203230void namco_c45_road_device::device_start()
204231{
205   if(!m_gfxdecode->started())
206      throw device_missing_dependencies();
232   m_clut = memregion("clut")->base();
207233
208   // create a gfx_element describing the road graphics
209   m_gfxdecode->set_gfx(0, global_alloc(gfx_element(m_palette, s_tile_layout, 0x10000 + (UINT8 *)&m_ram[0], NATIVE_ENDIAN_VALUE_LE_BE(8,0), 0x3f, 0xf00)));
210
211234   // create a tilemap for the road
212   m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(namco_c45_road_device::get_road_info), this),
235   m_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(namco_c45_road_device::get_road_info), this),
213236      TILEMAP_SCAN_ROWS, ROAD_TILE_SIZE, ROAD_TILE_SIZE, ROAD_COLS, ROAD_ROWS);
214237}
215238
216MACHINE_CONFIG_FRAGMENT( namco_c45_road )
217   MCFG_GFXDECODE_ADD("gfxdecode", "^palette", empty) // FIXME
218MACHINE_CONFIG_END
219//-------------------------------------------------
220//  device_mconfig_additions - return a pointer to
221//  the device's machine fragment
222//-------------------------------------------------
223239
224machine_config_constructor namco_c45_road_device::device_mconfig_additions() const
225{
226   return MACHINE_CONFIG_NAME( namco_c45_road );
227}
228
229240//-------------------------------------------------
230//  device_stop -- device shutdown
241//  memory_space_config - return a description of
242//  any address spaces owned by this device
231243//-------------------------------------------------
232244
233void namco_c45_road_device::device_stop()
245const address_space_config *namco_c45_road_device::memory_space_config(address_spacenum spacenum) const
234246{
247   return (spacenum == AS_0) ? &m_space_config : NULL;
235248}
236249
237250
r29505r29506
243256{
244257   // ------xx xxxxxxxx tile number
245258   // xxxxxx-- -------- palette select
246   UINT16 data = m_ram[tile_index];
259   UINT16 data = m_tmapram[tile_index];
247260   int tile = data & 0x3ff;
248261   int color = data >> 10;
249262   SET_TILE_INFO_MEMBER(0, tile, color, 0);
250263}
251
252//-------------------------------------------------
253//  static_set_palette_tag: Set the tag of the
254//  palette device
255//-------------------------------------------------
256
257void namco_c45_road_device::static_set_palette_tag(device_t &device, const char *tag)
258{
259   downcast<namco_c45_road_device &>(device).m_palette.set_tag(tag);
260}
branches/new_menus/src/mame/video/tc0180vcu.c
r29505r29506
1919   //m_tx_rambank(0),
2020   m_framebuffer_page(0),
2121   m_video_control(0),
22   m_bg_color_base(0),
23   m_fg_color_base(0),
24   m_tx_color_base(0),
2225   m_gfxdecode(*this)
2326{
2427}
r29505r29506
3336   downcast<tc0180vcu_device &>(device).m_gfxdecode.set_tag(tag);
3437}
3538
36
3739//-------------------------------------------------
38//  device_config_complete - perform any
39//  operations now that the configuration is
40//  complete
41//-------------------------------------------------
42
43void tc0180vcu_device::device_config_complete()
44{
45   // inherit a copy of the static data
46   const tc0180vcu_interface *intf = reinterpret_cast<const tc0180vcu_interface *>(static_config());
47   if (intf != NULL)
48   *static_cast<tc0180vcu_interface *>(this) = *intf;
49
50   // or initialize to defaults if none provided
51   else
52   {
53   }
54}
55
56//-------------------------------------------------
5740//  device_start - device-specific startup
5841//-------------------------------------------------
5942
branches/new_menus/src/mame/video/c45.h
r29505r29506
1111#define MCFG_NAMCO_C45_ROAD_ADD(_tag) \
1212   MCFG_DEVICE_ADD(_tag, NAMCO_C45_ROAD, 0)
1313
14#define MCFG_NAMCO_C45_ROAD_PALETTE(_palette_tag) \
15   namco_c45_road_device::static_set_palette_tag(*device, "^" _palette_tag);
1614
17
1815//**************************************************************************
1916//  TYPE DEFINITIONS
2017//**************************************************************************
r29505r29506
2219
2320// ======================> namco_c45_road_device
2421
25class namco_c45_road_device : public device_t
22class namco_c45_road_device : public device_t, public device_gfx_interface, public device_memory_interface
2623{
2724   // constants
2825   static const int ROAD_COLS = 64;
r29505r29506
3027   static const int ROAD_TILE_SIZE = 16;
3128   static const int ROAD_TILEMAP_WIDTH = ROAD_TILE_SIZE * ROAD_COLS;
3229   static const int ROAD_TILEMAP_HEIGHT = ROAD_TILE_SIZE * ROAD_ROWS;
33   static const int ROAD_TILE_COUNT_MAX = 0xfa00 / 0x40; // 0x3e8
3430   static const int WORDS_PER_ROAD_TILE = 0x40/2;
31   static const gfx_layout tilelayout;
3532
3633public:
3734   // construction/destruction
3835   namco_c45_road_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3936
40   static void static_set_palette_tag(device_t &device, const char *tag);
37   DECLARE_ADDRESS_MAP(map, 16);
4138
4239   // read/write handlers
4340   DECLARE_READ16_MEMBER( read );
4441   DECLARE_WRITE16_MEMBER( write );
4542
46   // optional information overrides
47   virtual machine_config_constructor device_mconfig_additions() const;
48
4943   // C45 Land (Road) Emulation
5044   void set_transparent_color(pen_t pen) { m_transparent_color = pen; }
5145   void draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
r29505r29506
5347protected:
5448   // device-level overrides
5549   virtual void device_start();
56   virtual void device_stop();
50   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
5751
52private:
5853   // internal helpers
54   DECLARE_GFXDECODE_MEMBER(gfxinfo);
55   DECLARE_WRITE16_MEMBER( tilemap_w );
56   DECLARE_WRITE16_MEMBER( tileram_w );
5957   TILE_GET_INFO_MEMBER( get_road_info );
6058
6159   // internal state
62   pen_t           m_transparent_color;
63   tilemap_t *     m_tilemap;
64   UINT16          m_ram[0x20000/2]; // at 0x880000 in Final Lap; at 0xa00000 in Lucky&Wild
65
66   static const gfx_layout s_tile_layout;
67   required_device<gfxdecode_device> m_gfxdecode;
68   required_device<palette_device> m_palette;
60   address_space_config        m_space_config;
61   required_shared_ptr<UINT16> m_tmapram;
62   required_shared_ptr<UINT16> m_tileram;
63   required_shared_ptr<UINT16> m_lineram;
64   UINT8 *                     m_clut;
65   tilemap_t *                 m_tilemap;
66   pen_t                       m_transparent_color;
6967};
7068
7169
branches/new_menus/src/mame/video/tc0180vcu.h
r29505r29506
1#ifndef _TC0180VCU_H_
2#define _TC0180VCU_H_
1#ifndef __TC0180VCU_H__
2#define __TC0180VCU_H__
33
4struct tc0180vcu_interface
4class tc0180vcu_device : public device_t
55{
6   int            m_bg_color_base;
7   int            m_fg_color_base;
8   int            m_tx_color_base;
9};
10
11class tc0180vcu_device : public device_t,
12                                 public tc0180vcu_interface
13{
146public:
157   tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
168   ~tc0180vcu_device() {}
179
1810   // static configuration
1911   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
12   static void set_bg_colorbase(device_t &device, int color) { downcast<tc0180vcu_device &>(device).m_bg_color_base = color; }
13   static void set_fg_colorbase(device_t &device, int color) { downcast<tc0180vcu_device &>(device).m_fg_color_base = color; }
14   static void set_tx_colorbase(device_t &device, int color) { downcast<tc0180vcu_device &>(device).m_tx_color_base = color; }
2015
2116   DECLARE_READ8_MEMBER( get_fb_page );
2217   DECLARE_WRITE8_MEMBER( set_fb_page );
r29505r29506
3126
3227protected:
3328   // device-level overrides
34   virtual void device_config_complete();
3529   virtual void device_start();
3630   virtual void device_reset();
3731
38   private:
32private:
3933   // internal state
4034   UINT16         m_ctrl[0x10];
4135
r29505r29506
4741   UINT16         m_bg_rambank[2], m_fg_rambank[2], m_tx_rambank;
4842   UINT8          m_framebuffer_page;
4943   UINT8          m_video_control;
44
45   int            m_bg_color_base;
46   int            m_fg_color_base;
47   int            m_tx_color_base;
48
5049   required_device<gfxdecode_device> m_gfxdecode;
5150
5251   TILE_GET_INFO_MEMBER(get_bg_tile_info);
r29505r29506
5857
5958extern const device_type TC0180VCU;
6059
61#define MCFG_TC0180VCU_ADD(_tag, _interface) \
62   MCFG_DEVICE_ADD(_tag, TC0180VCU, 0) \
63   MCFG_DEVICE_CONFIG(_interface)
60#define MCFG_TC0180VCU_BG_COLORBASE(_color) \
61   tc0180vcu_device::set_bg_colorbase(*device, _color);
6462
63#define MCFG_TC0180VCU_FG_COLORBASE(_color) \
64   tc0180vcu_device::set_fg_colorbase(*device, _color);
65
66#define MCFG_TC0180VCU_TX_COLORBASE(_color) \
67   tc0180vcu_device::set_tx_colorbase(*device, _color);
68
6569#define MCFG_TC0180VCU_GFXDECODE(_gfxtag) \
6670   tc0180vcu_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
71
6772#endif
branches/new_menus/src/mame/video/toaplan_scu.c
r29505r29506
1010
1111const device_type TOAPLAN_SCU = &device_creator<toaplan_scu_device>;
1212
13static const gfx_layout spritelayout =
13const gfx_layout toaplan_scu_device::spritelayout =
1414{
1515   16,16,          /* 16*16 sprites */
1616   RGN_FRAC(1,4),
r29505r29506
2121   16*16
2222};
2323
24static GFXDECODE_START( toaplan_scu )
24GFXDECODE_MEMBER( toaplan_scu_device::gfxinfo )
2525   GFXDECODE_DEVICE( DEVICE_SELF, 0, spritelayout, 0, 64 )
2626GFXDECODE_END
2727
2828
2929toaplan_scu_device::toaplan_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3030   : device_t(mconfig, TOAPLAN_SCU, "toaplan_scu_device", tag, owner, clock, "toaplan_scu", __FILE__),
31   device_gfx_interface(mconfig, *this, GFXDECODE_NAME( toaplan_scu ))
31   device_gfx_interface(mconfig, *this, gfxinfo )
3232{
3333}
3434
branches/new_menus/src/mame/video/toaplan_scu.h
r29505r29506
44
55class toaplan_scu_device : public device_t, public device_gfx_interface
66{
7   static const gfx_layout spritelayout;
8   DECLARE_GFXDECODE_MEMBER(gfxinfo);
9
710public:
811   toaplan_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
912
branches/new_menus/src/mame/video/pc080sn.c
r29505r29506
5252pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5353   : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock, "pc080sn", __FILE__),
5454   m_ram(NULL),
55   m_gfxnum(0),
56   m_x_offset(0),
57   m_y_offset(0),
58   m_y_invert(0),
59   m_dblwidth(0),
5560   m_gfxdecode(*this),
5661   m_palette(*this)
5762   //m_bg_ram[0](NULL),
r29505r29506
8287}
8388
8489//-------------------------------------------------
85//  device_config_complete - perform any
86//  operations now that the configuration is
87//  complete
88//-------------------------------------------------
89
90void pc080sn_device::device_config_complete()
91{
92   // inherit a copy of the static data
93   const pc080sn_interface *intf = reinterpret_cast<const pc080sn_interface *>(static_config());
94   if (intf != NULL)
95   *static_cast<pc080sn_interface *>(this) = *intf;
96
97   // or initialize to defaults if none provided
98   else
99   {
100   }
101}
102
103//-------------------------------------------------
10490//  device_start - device-specific startup
10591//-------------------------------------------------
10692
branches/new_menus/src/mame/video/pc080sn.h
r29505r29506
11#ifndef __PC080SN_H__
22#define __PC080SN_H__
33
4struct pc080sn_interface
4class pc080sn_device : public device_t
55{
6   int                m_gfxnum;
7
8   int                m_x_offset, m_y_offset;
9   int                m_y_invert;
10   int                m_dblwidth;
11};
12
13class pc080sn_device : public device_t,
14                              public pc080sn_interface
15{
166public:
177   pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
188   ~pc080sn_device() {}
r29505r29506
2010   // static configuration
2111   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2212   static void static_set_palette_tag(device_t &device, const char *tag);
23
13   static void set_gfx_region(device_t &device, int gfxregion) { downcast<pc080sn_device &>(device).m_gfxnum = gfxregion; }
14   static void set_yinvert(device_t &device, int y_inv) { downcast<pc080sn_device &>(device).m_y_invert = y_inv; }
15   static void set_dblwidth(device_t &device, int dblwidth) { downcast<pc080sn_device &>(device).m_dblwidth = dblwidth; }
16   static void set_offsets(device_t &device, int x_offset, int y_offset)
17   {
18      pc080sn_device &dev = downcast<pc080sn_device &>(device);
19      dev.m_x_offset = x_offset;
20      dev.m_y_offset = y_offset;
21   }
22   
2423   DECLARE_READ16_MEMBER( word_r );
2524   DECLARE_WRITE16_MEMBER( word_w );
2625   DECLARE_WRITE16_MEMBER( xscroll_word_w );
r29505r29506
4847
4948   protected:
5049   // device-level overrides
51   virtual void device_config_complete();
5250   virtual void device_start();
5351
5452   private:
r29505r29506
6260   int            m_bgscrollx[2], m_bgscrolly[2];
6361
6462   tilemap_t      *m_tilemap[2];
63
64   int            m_gfxnum;
65   int            m_x_offset, m_y_offset;
66   int            m_y_invert;
67   int            m_dblwidth;
68   
6569   required_device<gfxdecode_device> m_gfxdecode;
6670   required_device<palette_device> m_palette;
6771};
6872
6973extern const device_type PC080SN;
7074
71#define MCFG_PC080SN_ADD(_tag, _interface) \
72   MCFG_DEVICE_ADD(_tag, PC080SN, 0) \
73   MCFG_DEVICE_CONFIG(_interface)
7475
76#define MCFG_PC080SN_GFX_REGION(_region) \
77   pc080sn_device::set_gfx_region(*device, _region);
78
79#define MCFG_PC080SN_OFFSETS(_xoffs, _yoffs) \
80   pc080sn_device::set_offsets(*device, _xoffs, _yoffs);
81
82#define MCFG_PC080SN_YINVERT(_yinv) \
83   pc080sn_device::set_yinvert(*device, _yinv);
84
85#define MCFG_PC080SN_DBLWIDTH(_dbl) \
86   pc080sn_device::set_dblwidth(*device, _dbl);
87
7588#define MCFG_PC080SN_GFXDECODE(_gfxtag) \
7689   pc080sn_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
7790
branches/new_menus/src/mame/video/decospr.c
r29505r29506
131131#include "emu.h"
132132#include "decospr.h"
133133
134UINT16 decospr_default_colour_callback(UINT16 col)
134DECOSPR_COLOUR_CB_MEMBER(decospr_device::default_col_cb)
135135{
136136   return (col >> 9) & 0x1f;
137137}
r29505r29506
143143//  printf("decospr_device::set_gfx_region()\n");
144144}
145145
146void decospr_device::set_pri_callback(device_t &device, decospr_priority_callback_func callback)
147{
148   decospr_device &dev = downcast<decospr_device &>(device);
149   dev.m_pricallback = callback;
150}
151
152void decospr_device::set_col_callback(device_t &device, decospr_colour_callback_func callback)
153{
154   decospr_device &dev = downcast<decospr_device &>(device);
155   dev.m_colcallback = callback;
156}
157
158
159
160146const device_type DECO_SPRITE = &device_creator<decospr_device>;
161147
162148decospr_device::decospr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
163149   : device_t(mconfig, DECO_SPRITE, "decospr_device", tag, owner, clock, "decospr", __FILE__),
164150      device_video_interface(mconfig, *this),
165151      m_gfxregion(0),
166      m_pricallback(NULL),
167      m_colcallback(decospr_default_colour_callback),
168152      m_is_bootleg(false),
169153      m_x_offset(0),
170154      m_y_offset(0),
r29505r29506
173157      m_gfxdecode(*this),
174158      m_palette(*this)
175159{
160   // default color callback
161   m_col_cb =  decospr_col_cb_delegate(FUNC(decospr_device::default_col_cb), this);
176162}
177163
178164//-------------------------------------------------
r29505r29506
187173
188174void decospr_device::device_start()
189175{
190//  printf("decospr_device::device_start()\n");
176   m_pri_cb.bind_relative_to(*owner());
177   m_col_cb.bind_relative_to(*owner());
178   
191179   m_alt_format = 0;
192180   m_pixmask = 0xf;
193181   m_raw_shift = 4; // set to 8 on tattass / nslashers for the custom mixing (because they have 5bpp sprites, and shifting by 4 isn't good enough)
r29505r29506
203191   m_screen->register_screen_bitmap(m_sprite_bitmap);
204192}
205193
206void decospr_device::set_pri_callback(decospr_priority_callback_func callback)
207{
208   m_pricallback = callback;
209}
210
211void decospr_device::set_col_callback(decospr_priority_callback_func callback)
212{
213   m_colcallback = callback;
214}
215
216
217194template<class _BitmapClass>
218195void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip )
219196{
220197   //printf("cliprect %04x, %04x\n", cliprect.min_y, cliprect.max_y);
221198
222   if (m_sprite_bitmap.valid() && m_pricallback)
223      fatalerror("m_sprite_bitmap && m_pricallback is invalid\n");
199   if (m_sprite_bitmap.valid() && !m_pri_cb.isnull())
200      fatalerror("m_sprite_bitmap && m_pri_cb is invalid\n");
224201
225202   if (m_sprite_bitmap.valid())
226203      m_sprite_bitmap.fill(0, cliprect);
r29505r29506
234211      flipscreen = !flipscreen;
235212
236213
237   if (m_pricallback)
214   if (!m_pri_cb.isnull())
238215   {
239216      offs = sizewords-4;
240217      end = -4;
r29505r29506
265242
266243            if (!m_sprite_bitmap.valid())
267244            {
268               colour = m_colcallback(x);
245               colour = m_col_cb(x);
269246            }
270247            else
271248            {
r29505r29506
274251            }
275252
276253
277            if (m_pricallback)
278               pri = m_pricallback(x);
254            if (!m_pri_cb.isnull())
255               pri = m_pri_cb(x);
279256            else
280257               pri = 0;
281258
r29505r29506
355332                     {
356333                        if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y)-16))
357334                        {
358                           if (m_pricallback)
335                           if (!m_pri_cb.isnull())
359336                              m_gfxdecode->gfx(m_gfxregion)->prio_transpen(bitmap,cliprect,
360337                                 sprite - multi * inc,
361338                                 colour,
r29505r29506
374351                        // double wing uses this flag
375352                        if (w)
376353                        {
377                           if (m_pricallback)
354                           if (!m_pri_cb.isnull())
378355                              m_gfxdecode->gfx(m_gfxregion)->prio_transpen(bitmap,cliprect,
379356                                    (sprite - multi * inc)-mult2,
380357                                    colour,
r29505r29506
423400         sprite = spriteram[offs+3] & 0xffff;
424401
425402
426         if (m_pricallback)
427            pri = m_pricallback(spriteram[offs+2]&0x00ff);
403         if (!m_pri_cb.isnull())
404            pri = m_pri_cb(spriteram[offs+2]&0x00ff);
428405         else
429406            pri = 0;
430407
r29505r29506
474451               {
475452                  if(!m_sprite_bitmap.valid())
476453                  {
477                     if (m_pricallback)
454                     if (!m_pri_cb.isnull())
478455                     {
479456                        ypos = y + mult2 * (h-yy);
480457
branches/new_menus/src/mame/video/decospr.h
r29505r29506
11
2typedef UINT16 (*decospr_priority_callback_func)(UINT16 pri);
3typedef UINT16 (*decospr_colour_callback_func)(UINT16 col);
2typedef device_delegate<UINT16 (UINT16 pri)> decospr_pri_cb_delegate;
3typedef device_delegate<UINT16 (UINT16 col)> decospr_col_cb_delegate;
44
5
6// function definition for a callback
7#define DECOSPR_PRIORITY_CB_MEMBER(_name)   UINT16 _name(UINT16 pri)
8#define DECOSPR_COLOUR_CB_MEMBER(_name)     UINT16 _name(UINT16 col)
9
10
511class decospr_device : public device_t,
612                  public device_video_interface
713{
r29505r29506
1218   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
1319   static void static_set_palette_tag(device_t &device, const char *tag);
1420   static void set_gfx_region(device_t &device, int gfxregion);
15   static void set_pri_callback(device_t &device, decospr_priority_callback_func callback);
16   static void set_col_callback(device_t &device, decospr_colour_callback_func callback);
17
18   static void set_is_bootleg(device_t &device, bool is_bootleg)
19   {
20      decospr_device &dev = downcast<decospr_device &>(device);
21      dev.m_is_bootleg = is_bootleg;
22   }
23
21   static void set_pri_callback(device_t &device, decospr_pri_cb_delegate callback) { downcast<decospr_device &>(device).m_pri_cb = callback; }
22   static void set_col_callback(device_t &device, decospr_col_cb_delegate callback) { downcast<decospr_device &>(device).m_col_cb = callback; }
23   static void set_is_bootleg(device_t &device, bool is_bootleg) { downcast<decospr_device &>(device).m_is_bootleg = is_bootleg; }
24   static void set_flipallx(device_t &device, int flipallx) { downcast<decospr_device &>(device).m_flipallx = flipallx; }
25   static void set_transpen(device_t &device, int transpen) { downcast<decospr_device &>(device).m_transpen = transpen; }
2426   static void set_offsets(device_t &device, int x_offset, int y_offset)
2527   {
2628      decospr_device &dev = downcast<decospr_device &>(device);
r29505r29506
2830      dev.m_y_offset = y_offset;
2931   }
3032
31   static void set_flipallx(device_t &device, int flipallx)
32   {
33      decospr_device &dev = downcast<decospr_device &>(device);
34      dev.m_flipallx = flipallx;
35   }
36
37   static void set_transpen(device_t &device, int transpen)
38   {
39      decospr_device &dev = downcast<decospr_device &>(device);
40      dev.m_transpen = transpen;
41   }
42
43
4433   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
4534   void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
46   void set_pri_callback(decospr_priority_callback_func callback);
47   void set_col_callback(decospr_colour_callback_func callback);
48   void set_gfxregion(int region) { m_gfxregion = region; };
4935   void set_alt_format(bool alt) { m_alt_format = alt; };
5036   void set_pix_mix_mask(UINT16 mask) { m_pixmask = mask; };
5137   void set_pix_raw_shift(UINT16 shift) { m_raw_shift = shift; };
52   void set_is_bootleg(bool is_bootleg) { m_is_bootleg = is_bootleg; };
53   void set_offsets(int x_offset, int y_offset) { m_x_offset = x_offset; m_y_offset = y_offset; };
54   void set_flipallx(int flipallx) { m_flipallx = flipallx; };
55   void set_transpen(int transpen) { m_transpen = transpen; };
5638
5739   void alloc_sprite_bitmap();
5840   void inefficient_copy_sprite_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha = 0xff);
5941   bitmap_ind16& get_sprite_temp_bitmap() { assert(m_sprite_bitmap.valid()); return m_sprite_bitmap; };
6042
43   DECOSPR_PRIORITY_CB_MEMBER(default_col_cb);
44
6145protected:
6246   virtual void device_start();
6347   virtual void device_reset();
64   UINT8                       m_gfxregion;
65   decospr_priority_callback_func m_pricallback;
66   decospr_colour_callback_func m_colcallback;
48   UINT8 m_gfxregion;
49   decospr_pri_cb_delegate m_pri_cb;
50   decospr_col_cb_delegate m_col_cb;
6751   bitmap_ind16 m_sprite_bitmap;// optional sprite bitmap (should be INDEXED16)
6852   bool m_alt_format;
6953   UINT16 m_pixmask;
r29505r29506
8468
8569extern const device_type DECO_SPRITE;
8670
71#define MCFG_DECO_SPRITE_GFX_REGION(_region) \
72   decospr_device::set_gfx_region(*device, _region);
73
74#define MCFG_DECO_SPRITE_PRIORITY_CB(_class, _method) \
75   decospr_device::set_pri_callback(*device, decospr_pri_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
76
77#define MCFG_DECO_SPRITE_COLOUR_CB(_class, _method) \
78   decospr_device::set_col_callback(*device, decospr_col_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
79
80#define MCFG_DECO_SPRITE_ISBOOTLEG(_boot) \
81   decospr_device::set_is_bootleg(*device, _boot);
82
83#define MCFG_DECO_SPRITE_FLIPALLX(_flip) \
84   decospr_device::set_flipallx(*device, _flip);
85
86#define MCFG_DECO_SPRITE_TRANSPEN(_pen) \
87   decospr_device::set_transpen(*device, _pen);
88
89#define MCFG_DECO_SPRITE_OFFSETS(_xoffs, _yoffs) \
90   decospr_device::set_offsets(*device, _xoffs, _yoffs);
91
8792#define MCFG_DECO_SPRITE_GFXDECODE(_gfxtag) \
8893   decospr_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
8994
branches/new_menus/src/mame/video/deco16ic.h
r29505r29506
206206#define MCFG_DECO16IC_PALETTE(_palette_tag) \
207207   deco16ic_device::static_set_palette_tag(*device, "^" _palette_tag);
208208
209// function definition for a callback
210#define DECO16IC_BANK_CB_MEMBER(_name)     int _name(int bank)
211
209212#endif
branches/new_menus/src/mame/video/k053936.c
r29505r29506
220220
221221
222222
223
224
225
226223/***************************************************************************/
227224/*                                                                         */
228225/*                                 053936                                  */
r29505r29506
234231k053936_device::k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
235232   : device_t(mconfig, K053936, "Konami 053936", tag, owner, clock, "k053936", __FILE__),
236233   m_ctrl(NULL),
237   m_linectrl(NULL)
234   m_linectrl(NULL),
235   m_wrap(0),
236   m_xoff(0),
237   m_yoff(0)
238238{
239239}
240240
241241//-------------------------------------------------
242//  device_config_complete - perform any
243//  operations now that the configuration is
244//  complete
245//-------------------------------------------------
246
247void k053936_device::device_config_complete()
248{
249   // inherit a copy of the static data
250   const k053936_interface *intf = reinterpret_cast<const k053936_interface *>(static_config());
251   if (intf != NULL)
252   *static_cast<k053936_interface *>(this) = *intf;
253
254   // or initialize to defaults if none provided
255   else
256   {
257      m_wrap = 0;
258      m_xoff = 0;
259      m_yoff = 0;
260   }
261}
262
263//-------------------------------------------------
264242//  device_start - device-specific startup
265243//-------------------------------------------------
266244
branches/new_menus/src/mame/video/k053936.h
r29505r29506
33#define __K053936_H__
44
55
6/* */
7
8
9#define MCFG_K053936_ADD(_tag, _interface) \
10   MCFG_DEVICE_ADD(_tag, K053936, 0) \
11   MCFG_DEVICE_CONFIG(_interface)
12
13
14
156void K053936_0_zoom_draw(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack);
167void K053936_wraparound_enable(int chip, int status);
178void K053936_set_offset(int chip, int xoffs, int yoffs);
r29505r29506
2314void K053936GP_0_zoom_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output, UINT16* temp_m_k053936_0_ctrl_16, UINT16* temp_m_k053936_0_linectrl_16, UINT16* temp_m_k053936_0_ctrl, UINT16* temp_m_k053936_0_linectrl, palette_device *palette);
2415
2516
26
27
28struct k053936_interface
17class k053936_device : public device_t
2918{
30   int                m_wrap, m_xoff, m_yoff;
31};
32
33
34
35class k053936_device : public device_t,
36                              public k053936_interface
37{
3819public:
3920   k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4021   ~k053936_device() {}
4122
23   // static configuration
24   static void set_wrap(device_t &device, int wrap) { downcast<k053936_device &>(device).m_wrap = wrap; }
25   static void set_offsets(device_t &device, int x_offset, int y_offset)
26   {
27      k053936_device &dev = downcast<k053936_device &>(device);
28      dev.m_xoff = x_offset;
29      dev.m_yoff = y_offset;
30   }
31   
4232   DECLARE_WRITE16_MEMBER( ctrl_w );
4333   DECLARE_READ16_MEMBER( ctrl_r );
4434   DECLARE_WRITE16_MEMBER( linectrl_w );
r29505r29506
4939
5040protected:
5141   // device-level overrides
52   virtual void device_config_complete();
5342   virtual void device_start();
5443   virtual void device_reset();
5544
r29505r29506
5746   // internal state
5847   UINT16    *m_ctrl;
5948   UINT16    *m_linectrl;
49   int       m_wrap, m_xoff, m_yoff;
6050};
6151
6252extern const device_type K053936;
6353
54#define MCFG_K053936_WRAP(_wrap) \
55   k053936_device::set_wrap(*device, _wrap);
6456
57#define MCFG_K053936_OFFSETS(_xoffs, _yoffs) \
58   k053936_device::set_offsets(*device, _xoffs, _yoffs);
6559
66
6760#endif
branches/new_menus/src/mame/video/tc0080vco.c
r29505r29506
9595   m_bg1_scrollx(0),
9696   m_bg1_scrolly(0),
9797   m_flipscreen(0),
98   m_gfxnum(0),
99   m_txnum(0),
100   m_bg_xoffs(0),
101   m_bg_yoffs(0),
102   m_bg_flip_yoffs(0),
103   m_has_fg0(1),
98104   m_gfxdecode(*this),
99105   m_palette(*this)
100106{
r29505r29506
121127}
122128
123129//-------------------------------------------------
124//  device_config_complete - perform any
125//  operations now that the configuration is
126//  complete
127//-------------------------------------------------
128
129void tc0080vco_device::device_config_complete()
130{
131   // inherit a copy of the static data
132   const tc0080vco_interface *intf = reinterpret_cast<const tc0080vco_interface *>(static_config());
133   if (intf != NULL)
134   *static_cast<tc0080vco_interface *>(this) = *intf;
135
136   // or initialize to defaults if none provided
137   else
138   {
139   }
140}
141
142//-------------------------------------------------
143130//  device_start - device-specific startup
144131//-------------------------------------------------
145132
branches/new_menus/src/mame/video/tc0080vco.h
r29505r29506
11#ifndef __TC0080VCO_H__
22#define __TC0080VCO_H__
33
4struct tc0080vco_interface
4class tc0080vco_device : public device_t
55{
6   int                m_gfxnum;
7   int                m_txnum;
8
9   int                m_bg_xoffs, m_bg_yoffs;
10   int                m_bg_flip_yoffs;
11
12   int                m_has_fg0; /* for debug */
13};
14
15class tc0080vco_device : public device_t,
16                     public tc0080vco_interface
17{
186public:
197   tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
208   ~tc0080vco_device() {}
r29505r29506
2210   // static configuration
2311   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2412   static void static_set_palette_tag(device_t &device, const char *tag);
25
13   static void set_gfx_region(device_t &device, int gfxnum) { downcast<tc0080vco_device &>(device).m_gfxnum = gfxnum; }
14   static void set_tx_region(device_t &device, int txnum) { downcast<tc0080vco_device &>(device).m_txnum = txnum; }
15   static void set_offsets(device_t &device, int x_offset, int y_offset)
16   {
17      tc0080vco_device &dev = downcast<tc0080vco_device &>(device);
18      dev.m_bg_xoffs = x_offset;
19      dev.m_bg_yoffs = y_offset;
20   }
21   static void set_bgflip_yoffs(device_t &device, int offs) { downcast<tc0080vco_device &>(device).m_bg_flip_yoffs = offs; }
22   
2623   DECLARE_READ16_MEMBER( word_r );
2724   DECLARE_WRITE16_MEMBER( word_w );
2825
2926   void tilemap_update();
3027   void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
28   void set_fg0_debug(bool debug) { m_has_fg0 = debug ? 0 : 1; }
3129
3230   DECLARE_READ16_MEMBER( cram_0_r );
3331   DECLARE_READ16_MEMBER( cram_1_r );
r29505r29506
3735   READ_LINE_MEMBER( flipscreen_r );
3836   void postload();
3937
40   protected:
38protected:
4139   // device-level overrides
42   virtual void device_config_complete();
4340   virtual void device_start();
4441
45   private:
42private:
4643   // internal state
4744   UINT16 *       m_ram;
4845   UINT16 *       m_bg0_ram_0;
r29505r29506
5451   UINT16 *       m_char_ram;
5552   UINT16 *       m_bgscroll_ram;
5653
57/* FIXME: This sprite related stuff still needs to be accessed in
58   video/taito_h */
54/* FIXME: This sprite related stuff still needs to be accessed in video/taito_h */
5955   UINT16 *       m_chain_ram_0;
6056   UINT16 *       m_chain_ram_1;
6157   UINT16 *       m_spriteram;
r29505r29506
6662   UINT16         m_bg1_scrollx;
6763   UINT16         m_bg1_scrolly;
6864
69   tilemap_t        *m_tilemap[3];
65   tilemap_t      *m_tilemap[3];
7066
7167   INT32          m_flipscreen;
68   
69   int            m_gfxnum;
70   int            m_txnum;
71   int            m_bg_xoffs, m_bg_yoffs;
72   int            m_bg_flip_yoffs;
73   int            m_has_fg0; // for debug, it can be enabled with set_fg0_debug(true)
74
7275   required_device<gfxdecode_device> m_gfxdecode;
7376   required_device<palette_device> m_palette;
7477
r29505r29506
8184
8285extern const device_type TC0080VCO;
8386
84#define MCFG_TC0080VCO_ADD(_tag, _interface) \
85   MCFG_DEVICE_ADD(_tag, TC0080VCO, 0) \
86   MCFG_DEVICE_CONFIG(_interface)
87#define MCFG_TC0080VCO_GFX_REGION(_region) \
88   tc0080vco_device::set_gfx_region(*device, _region);
8789
90#define MCFG_TC0080VCO_TX_REGION(_region) \
91   tc0080vco_device::set_tx_region(*device, _region);
92
93#define MCFG_TC0080VCO_OFFSETS(_xoffs, _yoffs) \
94   tc0080vco_device::set_offsets(*device, _xoffs, _yoffs);
95
96#define MCFG_TC0080VCO_BGFLIP_OFFS(_offs) \
97   tc0080vco_device::set_bgflip_yoffs(*device, _offs);
98
8899#define MCFG_TC0080VCO_GFXDECODE(_gfxtag) \
89100   tc0080vco_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
90101
branches/new_menus/src/mame/video/vrender0.c
r29505r29506
2424const device_type VIDEO_VRENDER0 = &device_creator<vr0video_device>;
2525
2626vr0video_device::vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
27   : device_t(mconfig, VIDEO_VRENDER0, "VRender0 Video", tag, owner, clock, "vr0video", __FILE__)
27   : device_t(mconfig, VIDEO_VRENDER0, "VRender0 Video", tag, owner, clock, "vr0video", __FILE__),
28      m_cpu(*this)
2829{
2930}
3031
3132//-------------------------------------------------
32//  device_config_complete - perform any
33//  operations now that the configuration is
34//  complete
35//-------------------------------------------------
36
37void vr0video_device::device_config_complete()
38{
39   // inherit a copy of the static data
40   const vr0video_interface *intf = reinterpret_cast<const vr0video_interface *>(static_config());
41   if (intf != NULL)
42      *static_cast<vr0video_interface *>(this) = *intf;
43
44   // or initialize to defaults if none provided
45   else
46   {
47      m_cpu_tag = "";
48   }
49}
50
51//-------------------------------------------------
5233//  device_start - device-specific startup
5334//-------------------------------------------------
5435
5536void vr0video_device::device_start()
5637{
57   m_cpu = machine().device(m_cpu_tag);
58
5938   save_item(NAME(m_InternalPalette));
6039   save_item(NAME(m_LastPalUpdate));
6140
r29505r29506
418397//Returns TRUE if the operation was a flip (sync or async)
419398int vr0video_device::vrender0_ProcessPacket(UINT32 PacketPtr, UINT16 *Dest, UINT8 *TEXTURE)
420399{
421   address_space &space = m_cpu->memory().space(AS_PROGRAM);
400   address_space &space = m_cpu->space(AS_PROGRAM);
422401   UINT32 Dx = Packet(1) & 0x3ff;
423402   UINT32 Dy = Packet(2) & 0x1ff;
424403   UINT32 Endx = Packet(3) & 0x3ff;
branches/new_menus/src/mame/video/vrender0.h
r29505r29506
66 TYPE DEFINITIONS
77 ***************************************************************************/
88
9struct vr0video_interface
10{
11   const char *m_cpu_tag;
12};
13
149struct RenderStateInfo
1510{
1611   UINT32 Tx;
r29505r29506
3530   UINT32 Height;
3631};
3732
38
39class vr0video_device : public device_t,
40                              vr0video_interface
33class vr0video_device : public device_t
4134{
4235public:
4336   vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
r29505r29506
4538
4639   int vrender0_ProcessPacket(UINT32 PacketPtr, UINT16 *Dest, UINT8 *TEXTURE);
4740
41   static void set_cpu_tag(device_t &device, const char *tag) { downcast<vr0video_device &>(device).m_cpu.set_tag(tag); }
42
4843protected:
4944   // device-level overrides
50   virtual void device_config_complete();
5145   virtual void device_start();
5246   virtual void device_reset();
5347
5448private:
5549   // internal state
56   device_t *m_cpu;
50   required_device<cpu_device> m_cpu;
5751
5852   UINT16 m_InternalPalette[256];
5953   UINT32 m_LastPalUpdate;
r29505r29506
6660extern const device_type VIDEO_VRENDER0;
6761
6862
69#define MCFG_VIDEO_VRENDER0_ADD(_tag, _interface) \
70MCFG_DEVICE_ADD(_tag, VIDEO_VRENDER0, 0) \
71MCFG_DEVICE_CONFIG(_interface)
63#define MCFG_VIDEO_VRENDER0_CPU(_tag) \
64   vr0video_device::set_cpu_tag(*device, "^"_tag);
7265
7366#endif /* __VR0VIDEO_H__ */
branches/new_menus/src/mame/video/playch10.c
r29505r29506
1717PALETTE_INIT_MEMBER(playch10_state, playch10)
1818{
1919   const UINT8 *color_prom = memregion("proms")->base();
20   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
21   int i;
2220
23   for (i = 0; i < 256; i++)
21   for (int i = 0; i < 256; i++)
2422   {
2523      int bit0, bit1, bit2, bit3, r, g, b;
2624
r29505r29506
5553      color_prom++;
5654   }
5755
58   ppu->init_palette_rgb(palette, 256);
56   m_ppu->init_palette_rgb(palette, 256);
5957}
6058
6159void playch10_state::ppu_irq(int *ppu_regs)
r29505r29506
6462   m_pc10_int_detect = 1;
6563}
6664
67/* our ppu interface                                           */
68/* things like mirroring and whether to use vrom or vram       */
69/* can be set by calling 'ppu2c0x_override_hardware_options'   */
70
71const ppu2c0x_interface playch10_ppu_interface =
72{
73   "cart",
74   1,                  /* gfxlayout num */
75   256,                /* color base */
76   PPU_MIRROR_NONE     /* mirroring */
77};
78
7965TILE_GET_INFO_MEMBER(playch10_state::get_bg_tile_info)
8066{
8167   UINT8 *videoram = m_videoram;
r29505r29506
11298
11399UINT32 playch10_state::screen_update_playch10_single(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
114100{
115   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
116
117101   rectangle top_monitor = screen.visible_area();
118102
119   top_monitor.max_y = ( top_monitor.max_y - top_monitor.min_y ) / 2;
103   top_monitor.max_y = (top_monitor.max_y - top_monitor.min_y) / 2;
120104
121   if(m_pc10_dispmask_old != m_pc10_dispmask)
105   if (m_pc10_dispmask_old != m_pc10_dispmask)
122106   {
123107      m_pc10_dispmask_old = m_pc10_dispmask;
124108
125      if(m_pc10_dispmask)
109      if (m_pc10_dispmask)
126110         m_pc10_game_mode ^= 1;
127111   }
128112
129   if ( m_pc10_game_mode )
113   if (m_pc10_game_mode)
130114      /* render the ppu */
131      ppu->render(bitmap, 0, 0, 0, 0 );
115      m_ppu->render(bitmap, 0, 0, 0, 0);
132116   else
133117   {
134118      /* When the bios is accessing vram, the video circuitry can't access it */
135      if ( !m_pc10_sdcs )
119      if (!m_pc10_sdcs)
136120         m_bg_tilemap->draw(screen, bitmap, top_monitor, 0, 0);
137121   }
138122   return 0;
r29505r29506
140124
141125UINT32 playch10_state::screen_update_playch10_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
142126{
143   ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
144
145127   /* Single Monitor version */
146128   if (m_pc10_bios != 1)
147129      return screen_update_playch10_single(screen, bitmap, cliprect);
148130
149131   if (!m_pc10_dispmask)
150132      /* render the ppu */
151      ppu->render(bitmap, 0, 0, 0, 0);
133      m_ppu->render(bitmap, 0, 0, 0, 0);
152134   else
153135      bitmap.fill(0, cliprect);
154136
r29505r29506
162144      return screen_update_playch10_single(screen, bitmap, cliprect);
163145
164146   /* When the bios is accessing vram, the video circuitry can't access it */
165
166   if ( !m_pc10_sdcs )
147   if (!m_pc10_sdcs)
167148      m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
168149   else
169150      bitmap.fill(0, cliprect);
branches/new_menus/src/mame/drivers/konamigx.c
r29505r29506
10771077/**********************************************************************************/
10781078/* Sound handling */
10791079
1080INTERRUPT_GEN_MEMBER(konamigx_state::tms_sync)
1081{
1082   // DASP is synced to the LRCLK of one of the K054539s
1083   if (m_sound_ctrl & 0x20)
1084      m_dasp->sync_w(1);
1085}
1086
10871080READ16_MEMBER(konamigx_state::tms57002_data_word_r)
10881081{
10891082   return m_dasp->data_r(space, 0);
r29505r29506
16171610
16181611   MCFG_CPU_ADD("dasp", TMS57002, 24000000/2)
16191612   MCFG_CPU_DATA_MAP(gxtmsmap)
1620   MCFG_CPU_PERIODIC_INT_DRIVER(konamigx_state, tms_sync, 48000)
16211613
16221614   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
16231615
r29505r29506
16581650   /* sound hardware */
16591651   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
16601652
1653   MCFG_DEVICE_MODIFY("dasp")
1654   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
1655   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
1656
16611657   MCFG_K056800_ADD("k056800", XTAL_18_432MHz)
16621658   MCFG_K056800_INT_HANDLER(INPUTLINE("soundcpu", M68K_IRQ_1))
16631659
16641660   MCFG_K054539_ADD("k054539_1", XTAL_18_432MHz, k054539_config)
16651661   MCFG_K054539_TIMER_HANDLER(WRITELINE(konamigx_state, k054539_irq_gen))
1666
1662   MCFG_SOUND_ROUTE_EX(0, "dasp", 0.9, 0)
1663   MCFG_SOUND_ROUTE_EX(1, "dasp", 0.9, 1)
16671664   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
16681665   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
16691666
16701667   MCFG_K054539_ADD("k054539_2", XTAL_18_432MHz, k054539_config)
1668   MCFG_SOUND_ROUTE_EX(0, "dasp", 0.9, 2)
1669   MCFG_SOUND_ROUTE_EX(1, "dasp", 0.9, 3)
16711670   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
16721671   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
16731672MACHINE_CONFIG_END
branches/new_menus/src/mame/drivers/vsnes.c
r29505r29506
17281728   MCFG_PALETTE_INIT_OWNER(vsnes_state,vsnes)
17291729   MCFG_VIDEO_START_OVERRIDE(vsnes_state,vsnes)
17301730
1731   MCFG_PPU2C04_ADD("ppu1", vsnes_ppu_interface_1)
1731   MCFG_PPU2C04_ADD("ppu1")
17321732   MCFG_PPU2C0X_SET_SCREEN("screen1")
1733   MCFG_PPU2C0X_CPU("maincpu")
17331734   MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1)
17341735
17351736   /* sound hardware */
r29505r29506
17461747static MACHINE_CONFIG_DERIVED( jajamaru, vsnes )
17471748
17481749   MCFG_DEVICE_REMOVE( "ppu1" )
1749   MCFG_PPU2C05_01_ADD("ppu1", vsnes_ppu_interface_1)
1750   MCFG_PPU2C05_01_ADD("ppu1")
17501751   MCFG_PPU2C0X_SET_SCREEN("screen1")
1752   MCFG_PPU2C0X_CPU("maincpu")
17511753   MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1)
17521754MACHINE_CONFIG_END
17531755
17541756static MACHINE_CONFIG_DERIVED( mightybj, vsnes )
17551757
17561758   MCFG_DEVICE_REMOVE( "ppu1" )
1757   MCFG_PPU2C05_02_ADD("ppu1", vsnes_ppu_interface_1)
1759   MCFG_PPU2C05_02_ADD("ppu1")
17581760   MCFG_PPU2C0X_SET_SCREEN("screen1")
1761   MCFG_PPU2C0X_CPU("maincpu")
17591762   MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1)
17601763MACHINE_CONFIG_END
17611764
17621765static MACHINE_CONFIG_DERIVED( vsgshoe, vsnes )
17631766
17641767   MCFG_DEVICE_REMOVE( "ppu1" )
1765   MCFG_PPU2C05_03_ADD("ppu1", vsnes_ppu_interface_1)
1768   MCFG_PPU2C05_03_ADD("ppu1")
17661769   MCFG_PPU2C0X_SET_SCREEN("screen1")
1770   MCFG_PPU2C0X_CPU("maincpu")
17671771   MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1)
17681772MACHINE_CONFIG_END
17691773
17701774static MACHINE_CONFIG_DERIVED( topgun, vsnes )
17711775
17721776   MCFG_DEVICE_REMOVE( "ppu1" )
1773   MCFG_PPU2C05_04_ADD("ppu1", vsnes_ppu_interface_1)
1777   MCFG_PPU2C05_04_ADD("ppu1")
17741778   MCFG_PPU2C0X_SET_SCREEN("screen1")
1779   MCFG_PPU2C0X_CPU("maincpu")
17751780   MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1)
17761781MACHINE_CONFIG_END
17771782
r29505r29506
18091814
18101815   MCFG_VIDEO_START_OVERRIDE(vsnes_state,vsdual)
18111816
1812   MCFG_PPU2C04_ADD("ppu1", vsnes_ppu_interface_1)
1817   MCFG_PPU2C04_ADD("ppu1")
18131818   MCFG_PPU2C0X_SET_SCREEN("screen1")
1819   MCFG_PPU2C0X_CPU("maincpu")
18141820   MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1)
1815   MCFG_PPU2C04_ADD("ppu2", vsnes_ppu_interface_2)
1821
1822   MCFG_PPU2C04_ADD("ppu2")
18161823   MCFG_PPU2C0X_SET_SCREEN("screen2")
1824   MCFG_PPU2C0X_CPU("sub")
1825   MCFG_PPU2C0X_COLORBASE(512)
18171826   MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_2)
18181827
18191828   /* sound hardware */
r29505r29506
18481857   MCFG_CPU_PROGRAM_MAP(vsnes_bootleg_z80_map)
18491858   MCFG_CPU_VBLANK_INT_DRIVER("screen1", vsnes_state,  irq0_line_hold)
18501859
1851
1852
18531860   /* video hardware */
18541861   MCFG_SCREEN_ADD("screen1", RASTER)
18551862   MCFG_SCREEN_REFRESH_RATE(60)
r29505r29506
18631870   MCFG_PALETTE_INIT_OWNER(vsnes_state,vsnes)
18641871   MCFG_VIDEO_START_OVERRIDE(vsnes_state,vsnes)
18651872
1866   MCFG_PPU2C04_ADD("ppu1", vsnes_ppu_interface_1)
1873   MCFG_PPU2C04_ADD("ppu1")
1874   MCFG_PPU2C0X_CPU("maincpu")
18671875   MCFG_PPU2C0X_SET_SCREEN("screen1")
18681876   MCFG_PPU2C0X_SET_NMI(vsnes_state, ppu_irq_1)
18691877
branches/new_menus/src/mame/drivers/sandscrp.c
r29505r29506
480480};
481481
482482
483static const kaneko_pandora_interface sandscrp_pandora_config =
484{
485   0,  /* gfx_region */
486   0, 0    /* x_offs, y_offs */
487};
488
489483static MACHINE_CONFIG_START( sandscrp, sandscrp_state )
490484
491485   /* basic machine hardware */
r29505r29506
499493
500494   MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(3))  /* a guess, and certainly wrong */
501495
502
503496   /* video hardware */
504497   MCFG_SCREEN_ADD("screen", RASTER)
505498   MCFG_SCREEN_REFRESH_RATE(60)
r29505r29506
522515   MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0)
523516   kaneko_hit_device::set_type(*device, 0);
524517
525   MCFG_KANEKO_PANDORA_ADD("pandora", sandscrp_pandora_config)
518   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
526519   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
527520   MCFG_KANEKO_PANDORA_PALETTE("palette")
528521
branches/new_menus/src/mame/drivers/tceptor.c
r29505r29506
387387   MCFG_DEFAULT_LAYOUT(layout_horizont)
388388
389389   MCFG_NAMCO_C45_ROAD_ADD("c45_road")
390   MCFG_NAMCO_C45_ROAD_PALETTE("palette")
390   MCFG_GFX_PALETTE("palette")
391391
392392   MCFG_SCREEN_ADD("2dscreen", RASTER)
393393   MCFG_SCREEN_REFRESH_RATE(60.606060)
branches/new_menus/src/mame/drivers/pktgaldx.c
r29505r29506
303303GFXDECODE_END
304304
305305
306int pktgaldx_state::bank_callback( int bank )
306DECO16IC_BANK_CB_MEMBER(pktgaldx_state::bank_callback)
307307{
308308   return ((bank >> 4) & 0x7) * 0x1000;
309309}
r29505r29506
355355   MCFG_DECO16IC_PALETTE("palette")
356356
357357   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
358   decospr_device::set_gfx_region(*device, 2);
358   MCFG_DECO_SPRITE_GFX_REGION(2)
359359   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
360360   MCFG_DECO_SPRITE_PALETTE("palette")
361361
branches/new_menus/src/mame/drivers/moo.c
r29505r29506
541541   moo_sprite_callback
542542};
543543
544static const k054338_interface moo_k054338_intf =
545{
546   0,
547   "none"
548};
549
550544static k054539_interface k054539_config;
551545
552546static MACHINE_CONFIG_START( moo, moo_state )
r29505r29506
590584   MCFG_K056832_ADD("k056832", moo_k056832_intf)
591585   MCFG_K056832_GFXDECODE("gfxdecode")
592586   MCFG_K056832_PALETTE("palette")
587
593588   MCFG_K053251_ADD("k053251")
594   MCFG_K054338_ADD("k054338", moo_k054338_intf)
595589
590   MCFG_DEVICE_ADD("k054338", K054338, 0)
591
596592   /* sound hardware */
597593   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
598594
r29505r29506
640636   MCFG_K056832_ADD("k056832", moo_k056832_intf)
641637   MCFG_K056832_GFXDECODE("gfxdecode")
642638   MCFG_K056832_PALETTE("palette")
639
643640   MCFG_K053251_ADD("k053251")
644   MCFG_K054338_ADD("k054338", moo_k054338_intf)
645641
642   MCFG_DEVICE_ADD("k054338", K054338, 0)
643
646644   /* sound hardware */
647645   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
648646
branches/new_menus/src/mame/drivers/crshrace.c
r29505r29506
406406   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
407407}
408408
409static const k053936_interface crshrace_k053936_intf =
410{
411   1, -48, -21 /* wrap, xoff, yoff */
412};
413
414
415409void crshrace_state::machine_start()
416410{
417411   m_z80bank->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000, 0x8000);
r29505r29506
464458   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
465459   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram2")
466460
467   MCFG_K053936_ADD("k053936", crshrace_k053936_intf)
461   MCFG_DEVICE_ADD("k053936", K053936, 0)
462   MCFG_K053936_WRAP(1)
463   MCFG_K053936_OFFSETS(-48, -21)
468464
469
470465   /* sound hardware */
471466   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
472467
branches/new_menus/src/mame/drivers/airbustr.c
r29505r29506
589589
590590/* Machine Driver */
591591
592static const kaneko_pandora_interface airbustr_pandora_config =
593{
594   1,  /* gfx_region */
595   0, 0    /* x_offs, y_offs */
596};
597
598592static MACHINE_CONFIG_START( airbustr, airbustr_state )
599593
600594   /* basic machine hardware */
r29505r29506
631625   MCFG_PALETTE_ADD("palette", 768)
632626   MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
633627
634   MCFG_KANEKO_PANDORA_ADD("pandora", airbustr_pandora_config)
628   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
629   MCFG_KANEKO_PANDORA_GFX_REGION(1)
635630   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
636631   MCFG_KANEKO_PANDORA_PALETTE("palette")
637632
branches/new_menus/src/mame/drivers/deco32.c
r29505r29506
16451645   device.execute().set_input_line(ARM_IRQ_LINE, HOLD_LINE);
16461646}
16471647
1648UINT16 captaven_pri_callback(UINT16 x)
1648DECOSPR_PRIORITY_CB_MEMBER(deco32_state::captaven_pri_callback)
16491649{
1650   if ((x&0x60)==0x00)
1650   if ((pri & 0x60) == 0x00)
16511651   {
16521652      return 0; // above everything
16531653   }
1654   else if ((x&0x60)==0x20)
1654   else if ((pri & 0x60) == 0x20)
16551655   {
16561656      return 0xfff0; // above the 2nd playfield
16571657   }
1658   else if ((x&0x60)==0x40)
1658   else if ((pri & 0x60) == 0x40)
16591659   {
16601660      return 0xfffc; // above the 1st playfield
16611661   }
r29505r29506
16651665   }
16661666}
16671667
1668int deco32_state::captaven_bank_callback( int bank )
1668DECO16IC_BANK_CB_MEMBER(deco32_state::captaven_bank_callback)
16691669{
16701670   bank = bank >> 4;
16711671   bank = (bank & 2) >> 1;
r29505r29506
17291729   MCFG_DECO16IC_PALETTE("palette")
17301730
17311731   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1732   decospr_device::set_gfx_region(*device, 3);
1733   decospr_device::set_pri_callback(*device, captaven_pri_callback);
1732   MCFG_DECO_SPRITE_GFX_REGION(3)
1733   MCFG_DECO_SPRITE_PRIORITY_CB(deco32_state, captaven_pri_callback)
17341734   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
17351735   MCFG_DECO_SPRITE_PALETTE("palette")
17361736
r29505r29506
17731773   return machine().root_device().ioport(":IN1")->read();
17741774}
17751775
1776int deco32_state::fghthist_bank_callback( int bank )
1776DECO16IC_BANK_CB_MEMBER(deco32_state::fghthist_bank_callback)
17771777{
17781778   bank = bank >> 4;
17791779   bank = (bank & 1) | ((bank & 4) >> 1) | ((bank & 2) << 1);
r29505r29506
18351835   MCFG_DECO16IC_PALETTE("palette")
18361836
18371837   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1838   decospr_device::set_gfx_region(*device, 3);
1838   MCFG_DECO_SPRITE_GFX_REGION(3)
18391839   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
18401840   MCFG_DECO_SPRITE_PALETTE("palette")
18411841
r29505r29506
19211921   MCFG_DECO16IC_PALETTE("palette")
19221922
19231923   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1924   decospr_device::set_gfx_region(*device, 3);
1924   MCFG_DECO_SPRITE_GFX_REGION(3)
19251925   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
19261926   MCFG_DECO_SPRITE_PALETTE("palette")
19271927
r29505r29506
19531953MACHINE_CONFIG_END
19541954
19551955
1956int dragngun_state::bank_1_callback( int bank )
1956DECO16IC_BANK_CB_MEMBER(dragngun_state::bank_1_callback)
19571957{
19581958   bank = bank >> 4;
19591959   return bank * 0x1000;
19601960}
19611961
19621962
1963int dragngun_state::bank_2_callback( int bank )
1963DECO16IC_BANK_CB_MEMBER(dragngun_state::bank_2_callback)
19641964{
19651965   bank = bank >> 5;
19661966   return bank * 0x1000;
r29505r29506
21712171MACHINE_CONFIG_END
21722172
21732173
2174int deco32_state::tattass_bank_callback( int bank )
2174DECO16IC_BANK_CB_MEMBER(deco32_state::tattass_bank_callback)
21752175{
21762176   bank = bank >> 4;
21772177   return bank * 0x1000;
r29505r29506
22252225   MCFG_DECO16IC_PALETTE("palette")
22262226
22272227   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
2228   decospr_device::set_gfx_region(*device, 3);
2228   MCFG_DECO_SPRITE_GFX_REGION(3)
22292229   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
22302230   MCFG_DECO_SPRITE_PALETTE("palette")
22312231
22322232   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
2233   decospr_device::set_gfx_region(*device, 4);
2233   MCFG_DECO_SPRITE_GFX_REGION(4)
22342234   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
22352235   MCFG_DECO_SPRITE_PALETTE("palette")
22362236
r29505r29506
23022302   MCFG_DECO16IC_PALETTE("palette")
23032303
23042304   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
2305   decospr_device::set_gfx_region(*device, 3);
2305   MCFG_DECO_SPRITE_GFX_REGION(3)
23062306   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
23072307   MCFG_DECO_SPRITE_PALETTE("palette")
23082308
23092309   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
2310   decospr_device::set_gfx_region(*device, 4);
2310   MCFG_DECO_SPRITE_GFX_REGION(4)
23112311   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
23122312   MCFG_DECO_SPRITE_PALETTE("palette")
23132313
branches/new_menus/src/mame/drivers/crospang.c
r29505r29506
361361
362362
363363   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
364   decospr_device::set_gfx_region(*device, 0);
365   decospr_device::set_is_bootleg(*device, true);
366   decospr_device::set_offsets(*device, 5,7);
364   MCFG_DECO_SPRITE_GFX_REGION(0)
365   MCFG_DECO_SPRITE_ISBOOTLEG(true)
366   MCFG_DECO_SPRITE_OFFSETS(5, 7)
367367   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
368368   MCFG_DECO_SPRITE_PALETTE("palette")
369369
branches/new_menus/src/mame/drivers/deco156.c
r29505r29506
6565   INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
6666   void descramble_sound( const char *tag );
6767   DECLARE_WRITE_LINE_MEMBER(sound_irq_gen);
68   int bank_callback(int bank);
68   DECO16IC_BANK_CB_MEMBER(bank_callback);
69   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
6970};
7071
7172
r29505r29506
322323   device.execute().set_input_line(ARM_IRQ_LINE, HOLD_LINE);
323324}
324325
325int deco156_state::bank_callback(int bank)
326DECO16IC_BANK_CB_MEMBER(deco156_state::bank_callback)
326327{
327328   return ((bank >> 4) & 0x7) * 0x1000;
328329}
329330
330UINT16 deco156_pri_callback(UINT16 x)
331DECOSPR_PRIORITY_CB_MEMBER(deco156_state::pri_callback)
331332{
332   switch (x & 0xc000)
333   switch (pri & 0xc000)
333334   {
334335      case 0x0000: return 0;
335336      case 0x4000: return 0xf0;
r29505r29506
340341   return 0;
341342}
342343
343
344344static MACHINE_CONFIG_START( hvysmsh, deco156_state )
345345
346346   /* basic machine hardware */
r29505r29506
377377   MCFG_DECO16IC_PALETTE("palette")
378378
379379   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
380   decospr_device::set_gfx_region(*device, 2);
381   decospr_device::set_pri_callback(*device, deco156_pri_callback);
380   MCFG_DECO_SPRITE_GFX_REGION(2)
381   MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback)
382382   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
383383   MCFG_DECO_SPRITE_PALETTE("palette")
384384
r29505r29506
430430   MCFG_DECO16IC_PALETTE("palette")
431431
432432   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
433   decospr_device::set_gfx_region(*device, 2);
434   decospr_device::set_pri_callback(*device, deco156_pri_callback);
433   MCFG_DECO_SPRITE_GFX_REGION(2)
434   MCFG_DECO_SPRITE_PRIORITY_CB(deco156_state, pri_callback)
435435   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
436436   MCFG_DECO_SPRITE_PALETTE("palette")
437437
branches/new_menus/src/mame/drivers/taito_h.c
r29505r29506
243243   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_SHARE("m68000_mainram")
244244   AM_RANGE(0x200000, 0x200001) AM_READ8(syvalion_input_bypass_r, 0x00ff) AM_DEVWRITE8("tc0220ioc", tc0220ioc_device, portreg_w, 0x00ff)
245245   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, port_r, port_w, 0x00ff)
246   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
247   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
246   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
247   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
248248   AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE("tc0080vco", tc0080vco_device, word_r, word_w)
249249   AM_RANGE(0x500800, 0x500fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
250250ADDRESS_MAP_END
r29505r29506
254254   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_SHARE("m68000_mainram")
255255   AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, portreg_r, portreg_w, 0x00ff)
256256   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, port_r, port_w, 0x00ff)
257   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
258   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
257   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
258   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
259259   AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE("tc0080vco", tc0080vco_device, word_r, word_w)
260260   AM_RANGE(0x500800, 0x500fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
261261ADDRESS_MAP_END
r29505r29506
263263static ADDRESS_MAP_START( tetristh_map, AS_PROGRAM, 16, taitoh_state )
264264   AM_RANGE(0x000000, 0x03ffff) AM_ROM
265265   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_SHARE("m68000_mainram")
266   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
267   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
266   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
267   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
268268   AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, portreg_r, portreg_w, 0x00ff)
269269   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, port_r, port_w, 0x00ff)
270270   AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE("tc0080vco", tc0080vco_device, word_r, word_w)
r29505r29506
275275   AM_RANGE(0x000000, 0x05ffff) AM_ROM
276276   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_SHARE("m68000_mainram")
277277   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
278   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
279   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
278   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
279   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
280280   AM_RANGE(0x400000, 0x420fff) AM_DEVREADWRITE("tc0080vco", tc0080vco_device, word_r, word_w)
281281   AM_RANGE(0x500800, 0x500fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
282282   AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* ?? writes zero once per frame */
r29505r29506
288288   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
289289   AM_RANGE(0xc000, 0xdfff) AM_RAM
290290   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
291   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
292   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
291   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
292   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
293293   AM_RANGE(0xe400, 0xe403) AM_WRITENOP        /* pan control */
294294   AM_RANGE(0xea00, 0xea00) AM_READNOP
295295   AM_RANGE(0xee00, 0xee00) AM_WRITENOP        /* ? */
r29505r29506
646646}
647647
648648
649static const tc0080vco_interface syvalion_tc0080vco_intf =
650{
651   0, 1,   /* gfxnum, txnum */
652   1, 1, -2,
653   1
654};
655
656static const tc0080vco_interface recordbr_tc0080vco_intf =
657{
658   0, 1,   /* gfxnum, txnum */
659   1, 1, -2,
660   0
661};
662
663static const tc0140syt_interface taitoh_tc0140syt_intf =
664{
665   "maincpu", "audiocpu"
666};
667
668649static MACHINE_CONFIG_START( syvalion, taitoh_state )
669650
670651   /* basic machine hardware */
r29505r29506
698679   MCFG_PALETTE_ADD("palette", 33*16)
699680   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
700681
701   MCFG_TC0080VCO_ADD("tc0080vco", syvalion_tc0080vco_intf)
682   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
683   MCFG_TC0080VCO_GFX_REGION(0)
684   MCFG_TC0080VCO_TX_REGION(1)
685   MCFG_TC0080VCO_OFFSETS(1, 1)
686   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
702687   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
703688   MCFG_TC0080VCO_PALETTE("palette")
704689
r29505r29506
711696   MCFG_SOUND_ROUTE(1, "mono", 1.0)
712697   MCFG_SOUND_ROUTE(2, "mono", 1.0)
713698
714   MCFG_TC0140SYT_ADD("tc0140syt", taitoh_tc0140syt_intf)
699   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
700   MCFG_TC0140SYT_MASTER_CPU("maincpu")
701   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
715702MACHINE_CONFIG_END
716703
717704
r29505r29506
748735   MCFG_PALETTE_ADD("palette", 32*16)
749736   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
750737
751   MCFG_TC0080VCO_ADD("tc0080vco", recordbr_tc0080vco_intf)
738   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
739   MCFG_TC0080VCO_GFX_REGION(0)
740   MCFG_TC0080VCO_TX_REGION(1)
741   MCFG_TC0080VCO_OFFSETS(1, 1)
742   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
752743   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
753744   MCFG_TC0080VCO_PALETTE("palette")
754745
r29505r29506
761752   MCFG_SOUND_ROUTE(1, "mono", 1.0)
762753   MCFG_SOUND_ROUTE(2, "mono", 1.0)
763754
764   MCFG_TC0140SYT_ADD("tc0140syt", taitoh_tc0140syt_intf)
755   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
756   MCFG_TC0140SYT_MASTER_CPU("maincpu")
757   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
765758MACHINE_CONFIG_END
766759
767760
r29505r29506
806799   MCFG_PALETTE_ADD("palette", 33*16)
807800   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
808801
809   MCFG_TC0080VCO_ADD("tc0080vco", recordbr_tc0080vco_intf)
802   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
803   MCFG_TC0080VCO_GFX_REGION(0)
804   MCFG_TC0080VCO_TX_REGION(1)
805   MCFG_TC0080VCO_OFFSETS(1, 1)
806   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
810807   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
811808   MCFG_TC0080VCO_PALETTE("palette")
812809
r29505r29506
819816   MCFG_SOUND_ROUTE(1, "mono", 1.0)
820817   MCFG_SOUND_ROUTE(2, "mono", 1.0)
821818
822   MCFG_TC0140SYT_ADD("tc0140syt", taitoh_tc0140syt_intf)
819   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
820   MCFG_TC0140SYT_MASTER_CPU("maincpu")
821   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
823822MACHINE_CONFIG_END
824823
825824
branches/new_menus/src/mame/drivers/snowbros.c
r29505r29506
15091509      m_hyperpac_ram[0x2000/2 + i] = PROTDATA[i];
15101510}
15111511
1512static const kaneko_pandora_interface snowbros_pandora_config =
1513{
1514   0,  /* gfx_region */
1515   0, 0    /* x_offs, y_offs */
1516};
1517
15181512static MACHINE_CONFIG_START( snowbros, snowbros_state )
15191513
15201514   /* basic machine hardware */
r29505r29506
15401534   MCFG_PALETTE_ADD("palette", 256)
15411535   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
15421536
1543   MCFG_KANEKO_PANDORA_ADD("pandora", snowbros_pandora_config)
1537   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
15441538   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
15451539   MCFG_KANEKO_PANDORA_PALETTE("palette")
15461540
branches/new_menus/src/mame/drivers/dblewing.c
r29505r29506
113113   virtual void machine_reset();
114114   UINT32 screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
115115
116   int bank_callback(int bank);
116   DECO16IC_BANK_CB_MEMBER(bank_callback);
117   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
117118   void dblewing_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask );
118119
119120   READ16_MEMBER( wf_protection_region_0_104_r );
120121   WRITE16_MEMBER( wf_protection_region_0_104_w );
121122};
122123
123UINT16 dblwings_pri_callback(UINT16 x)
124{
125   return 0; // sprites always on top?
126}
127124
128
129
130125UINT32 dblewing_state::screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
131126{
132127   address_space &space = generic_space();
r29505r29506
332327   m_audiocpu->set_input_line(0, (m_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
333328}
334329
335int dblewing_state::bank_callback( int bank )
330DECO16IC_BANK_CB_MEMBER(dblewing_state::bank_callback)
336331{
337332   return ((bank >> 4) & 0x7) * 0x1000;
338333}
339334
335DECOSPR_PRIORITY_CB_MEMBER(dblewing_state::pri_callback)
336{
337   return 0; // sprites always on top?
338}
339
340
340341void dblewing_state::machine_start()
341342{
342343   save_item(NAME(m_sound_irq));
r29505r29506
398399   MCFG_DECO16IC_PALETTE("palette")
399400
400401   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
401   decospr_device::set_gfx_region(*device, 2);
402   decospr_device::set_pri_callback(*device, dblwings_pri_callback);
402   MCFG_DECO_SPRITE_GFX_REGION(2)
403   MCFG_DECO_SPRITE_PRIORITY_CB(dblewing_state, pri_callback)
403404   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
404405   MCFG_DECO_SPRITE_PALETTE("palette")
405406
branches/new_menus/src/mame/drivers/powerins.c
r29505r29506
328328   DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
329329};
330330
331static const nmk112_interface powerins_nmk112_intf =
332{
333   "oki1", "oki2", 0
334};
335
336
337331static MACHINE_CONFIG_START( powerins, powerins_state )
338332
339333   /* basic machine hardware */
r29505r29506
374368   MCFG_YM2203_AY8910_INTF(&ay8910_config)
375369   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
376370
377   MCFG_NMK112_ADD("nmk112", powerins_nmk112_intf)
371   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
372   MCFG_NMK112_ROM0("oki1")
373   MCFG_NMK112_ROM1("oki2")
378374MACHINE_CONFIG_END
379375
380376static MACHINE_CONFIG_DERIVED( powerina, powerins )
branches/new_menus/src/mame/drivers/tumbleb.c
r29505r29506
20602060   MCFG_SCREEN_PALETTE("palette")
20612061
20622062   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2063   decospr_device::set_gfx_region(*device, 3);
2064   decospr_device::set_is_bootleg(*device, true);
2063   MCFG_DECO_SPRITE_GFX_REGION(3)
2064   MCFG_DECO_SPRITE_ISBOOTLEG(true)
20652065   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
20662066   MCFG_DECO_SPRITE_PALETTE("palette")
20672067
r29505r29506
20992099   MCFG_SCREEN_PALETTE("palette")
21002100
21012101   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2102   decospr_device::set_gfx_region(*device, 3);
2103   decospr_device::set_is_bootleg(*device, true);
2102   MCFG_DECO_SPRITE_GFX_REGION(3)
2103   MCFG_DECO_SPRITE_ISBOOTLEG(true)
21042104   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
21052105   MCFG_DECO_SPRITE_PALETTE("palette")
21062106
r29505r29506
21412141   MCFG_SCREEN_PALETTE("palette")
21422142
21432143   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2144   decospr_device::set_gfx_region(*device, 3);
2145   decospr_device::set_is_bootleg(*device, true);
2144   MCFG_DECO_SPRITE_GFX_REGION(3)
2145   MCFG_DECO_SPRITE_ISBOOTLEG(true)
21462146   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
21472147   MCFG_DECO_SPRITE_PALETTE("palette")
21482148
r29505r29506
21792179   MCFG_SCREEN_PALETTE("palette")
21802180
21812181   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2182   decospr_device::set_gfx_region(*device, 3);
2183   decospr_device::set_is_bootleg(*device, true);
2184   decospr_device::set_transpen(*device, 15);
2182   MCFG_DECO_SPRITE_GFX_REGION(3)
2183   MCFG_DECO_SPRITE_ISBOOTLEG(true)
2184   MCFG_DECO_SPRITE_TRANSPEN(15)
21852185   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
21862186   MCFG_DECO_SPRITE_PALETTE("palette")
21872187
r29505r29506
22402240   MCFG_SCREEN_PALETTE("palette")
22412241
22422242   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2243   decospr_device::set_gfx_region(*device, 3);
2244   decospr_device::set_is_bootleg(*device, true);
2243   MCFG_DECO_SPRITE_GFX_REGION(3)
2244   MCFG_DECO_SPRITE_ISBOOTLEG(true)
22452245   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
22462246   MCFG_DECO_SPRITE_PALETTE("palette")
22472247
r29505r29506
23512351   MCFG_SCREEN_PALETTE("palette")
23522352
23532353   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2354   decospr_device::set_gfx_region(*device, 3);
2355   decospr_device::set_is_bootleg(*device, true);
2354   MCFG_DECO_SPRITE_GFX_REGION(3)
2355   MCFG_DECO_SPRITE_ISBOOTLEG(true)
23562356   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
23572357   MCFG_DECO_SPRITE_PALETTE("palette")
23582358
r29505r29506
23902390   MCFG_SCREEN_PALETTE("palette")
23912391
23922392   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
2393   decospr_device::set_gfx_region(*device, 3);
2394   decospr_device::set_is_bootleg(*device, true);
2393   MCFG_DECO_SPRITE_GFX_REGION(3)
2394   MCFG_DECO_SPRITE_ISBOOTLEG(true)
23952395   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
23962396   MCFG_DECO_SPRITE_PALETTE("palette")
23972397
branches/new_menus/src/mame/drivers/darius.c
r29505r29506
172172   switch (offset)
173173   {
174174      case 0x01:
175         return (m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff);    /* sound interface read */
175         return (m_tc0140syt->master_comm_r(space, 0) & 0xff);    /* sound interface read */
176176
177177      case 0x04:
178178         return ioport("P1")->read();
r29505r29506
201201   {
202202      case 0x00:  /* sound interface write */
203203
204         m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
204         m_tc0140syt->master_port_w(space, 0, data & 0xff);
205205         return;
206206
207207      case 0x01:  /* sound interface write */
208208
209         m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
209         m_tc0140syt->master_comm_w(space, 0, data & 0xff);
210210         return;
211211
212212      case 0x28:  /* unknown, written by both cpus - always 0? */
r29505r29506
464464   AM_RANGE(0x8000, 0x8fff) AM_RAM
465465   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym1", ym2203_device, read, write)
466466   AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
467   AM_RANGE(0xb000, 0xb000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
468   AM_RANGE(0xb001, 0xb001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
467   AM_RANGE(0xb000, 0xb000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
468   AM_RANGE(0xb001, 0xb001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
469469   AM_RANGE(0xc000, 0xc000) AM_WRITE(darius_fm0_pan)
470470   AM_RANGE(0xc400, 0xc400) AM_WRITE(darius_fm1_pan)
471471   AM_RANGE(0xc800, 0xc800) AM_WRITE(darius_psg0_pan)
r29505r29506
784784                       MACHINE DRIVERS
785785***********************************************************/
786786
787static const pc080sn_interface darius_pc080sn_intf =
788{
789   1,   /* gfxnum */
790   -16, 8, 0, 1    /* x_offset, y_offset, y_invert, dblwidth */
791};
792
793static const tc0140syt_interface darius_tc0140syt_intf =
794{
795   "maincpu", "audiocpu"
796};
797
798787void darius_state::darius_postload()
799788{
800789   parse_control();
r29505r29506
896885   MCFG_SCREEN_UPDATE_DRIVER(darius_state, screen_update_darius_right)
897886   MCFG_SCREEN_PALETTE("palette")
898887
899
900   MCFG_PC080SN_ADD("pc080sn", darius_pc080sn_intf)
888   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
889   MCFG_PC080SN_GFX_REGION(1)
890   MCFG_PC080SN_OFFSETS(-16, 8)
891   MCFG_PC080SN_YINVERT(0)
892   MCFG_PC080SN_DBLWIDTH(1)
901893   MCFG_PC080SN_GFXDECODE("gfxdecode")
902894   MCFG_PC080SN_PALETTE("palette")
903895
r29505r29506
972964   MCFG_FILTER_VOLUME_ADD("msm5205.r", 0)
973965   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
974966
975   MCFG_TC0140SYT_ADD("tc0140syt", darius_tc0140syt_intf)
967   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
968   MCFG_TC0140SYT_MASTER_CPU("maincpu")
969   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
976970MACHINE_CONFIG_END
977971
978972
branches/new_menus/src/mame/drivers/darkseal.c
r29505r29506
273273   MCFG_DECO16IC_PALETTE("palette")
274274
275275   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
276   decospr_device::set_gfx_region(*device, 4);
276   MCFG_DECO_SPRITE_GFX_REGION(4)
277277   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
278278   MCFG_DECO_SPRITE_PALETTE("palette")
279279
branches/new_menus/src/mame/drivers/dbz.c
r29505r29506
307307   dbz_sprite_callback
308308};
309309
310/* both k053936 use the same wrap/offs */
311static const k053936_interface dbz_k053936_intf =
312{
313   1, -46, -16
314};
315
316310WRITE_LINE_MEMBER(dbz_state::dbz_irq2_ack_w)
317311{
318312   m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE);
r29505r29506
370364   MCFG_K056832_ADD("k056832", dbz_k056832_intf)
371365   MCFG_K056832_GFXDECODE("gfxdecode")
372366   MCFG_K056832_PALETTE("palette")
367
373368   MCFG_K053246_ADD("k053246", dbz_k053246_intf)
374369   MCFG_K053246_GFXDECODE("gfxdecode")
375370   MCFG_K053246_PALETTE("palette")
371
376372   MCFG_K053251_ADD("k053251")
377   MCFG_K053936_ADD("k053936_1", dbz_k053936_intf)
378   MCFG_K053936_ADD("k053936_2", dbz_k053936_intf)
373
374   MCFG_DEVICE_ADD("k053936_1", K053936, 0)
375   MCFG_K053936_WRAP(1)
376   MCFG_K053936_OFFSETS(-46, -16)
377
378   MCFG_DEVICE_ADD("k053936_2", K053936, 0)
379   MCFG_K053936_WRAP(1)
380   MCFG_K053936_OFFSETS(-46, -16)
381
379382   MCFG_DEVICE_ADD("k053252", K053252, 16000000/2)
380383   MCFG_K053252_INT1_ACK_CB(WRITELINE(dbz_state, dbz_irq2_ack_w))
381384
branches/new_menus/src/mame/drivers/vaportra.c
r29505r29506
196196
197197/******************************************************************************/
198198
199int vaportra_state::bank_callback( int bank )
199DECO16IC_BANK_CB_MEMBER(vaportra_state::bank_callback)
200200{
201201   return ((bank >> 4) & 0x7) * 0x1000;
202202}
branches/new_menus/src/mame/drivers/icecold.c
r29505r29506
327327   }
328328}
329329
330static I8279_INTERFACE( icecold_i8279_intf )
331{
332   DEVCB_DEVICE_LINE_MEMBER("pia0", pia6821_device, cb1_w), // irq
333   DEVCB_DRIVER_MEMBER(icecold_state, scanlines_w),    // scan SL lines
334   DEVCB_DRIVER_MEMBER(icecold_state, digit_w),        // display A&B
335   DEVCB_NULL,                                         // BD
336   DEVCB_DRIVER_MEMBER(icecold_state, kbd_r),          // kbd RL lines
337   DEVCB_NULL,                                         // Shift key
338   DEVCB_NULL                                          // Ctrl-Strobe line
339};
340
341330static const ay8910_interface icecold_ay8910_0_intf =
342331{
343332   AY8910_LEGACY_OUTPUT,
r29505r29506
382371   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6809_device, irq_line))
383372   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6809_device, irq_line))
384373
385   MCFG_I8279_ADD("i8279", XTAL_6MHz/4, icecold_i8279_intf)
386
374   MCFG_DEVICE_ADD("i8279", I8279, XTAL_6MHz/4)
375   MCFG_I8279_OUT_IRQ_CB(DEVWRITELINE("pia0", pia6821_device, cb1_w)) // irq
376   MCFG_I8279_OUT_SL_CB(WRITE8(icecold_state, scanlines_w))       // scan SL lines
377   MCFG_I8279_OUT_DISP_CB(WRITE8(icecold_state, digit_w))         // display A&B
378   MCFG_I8279_IN_RL_CB(READ8(icecold_state, kbd_r))               // kbd RL lines
379   
387380   // 30Hz signal from CH-C of ay0
388381   MCFG_TIMER_DRIVER_ADD_PERIODIC("sint_timer", icecold_state, icecold_sint_timer, attotime::from_hz(30))
389382
branches/new_menus/src/mame/drivers/taito_l.c
r29505r29506
660660   AM_RANGE(0x0000, 0x7fff) AM_ROM
661661   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank6")
662662   AM_RANGE(0xc000, 0xc000) AM_WRITE(rombank2switch_w)
663   AM_RANGE(0xc800, 0xc800) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_port_w)
664   AM_RANGE(0xc801, 0xc801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w)
663   AM_RANGE(0xc800, 0xc800) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, master_port_w)
664   AM_RANGE(0xc801, 0xc801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w)
665665   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("DSWA") AM_WRITENOP   // Direct copy of input port 0
666666   AM_RANGE(0xd001, 0xd001) AM_READ_PORT("DSWB")
667667   AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN0")
r29505r29506
676676   AM_RANGE(0x0000, 0x3fff) AM_ROM
677677   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank7")
678678   AM_RANGE(0x8000, 0x9fff) AM_RAM
679   AM_RANGE(0xe000, 0xe000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
680   AM_RANGE(0xe001, 0xe001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
679   AM_RANGE(0xe000, 0xe000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
680   AM_RANGE(0xe001, 0xe001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
681681   AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
682682ADDRESS_MAP_END
683683
r29505r29506
687687   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("share1")
688688   AM_RANGE(0x8800, 0x8800) AM_READWRITE(mux_r, mux_w)
689689   AM_RANGE(0x8801, 0x8801) AM_WRITE(mux_ctrl_w) AM_READNOP    // Watchdog or interrupt ack (value ignored)
690   AM_RANGE(0x8c00, 0x8c00) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_port_w)
691   AM_RANGE(0x8c01, 0x8c01) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w)
690   AM_RANGE(0x8c00, 0x8c00) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, master_port_w)
691   AM_RANGE(0x8c01, 0x8c01) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w)
692692   AM_RANGE(0xa000, 0xbfff) AM_RAM
693693ADDRESS_MAP_END
694694
r29505r29506
712712   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank7")
713713   AM_RANGE(0xc000, 0xdfff) AM_RAM
714714   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
715   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
716   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
715   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
716   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
717717   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
718718   AM_RANGE(0xe600, 0xe600) AM_WRITENOP /* ? */
719719   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
739739   AM_RANGE(0xe004, 0xe004) AM_WRITE(control2_w)
740740   AM_RANGE(0xe007, 0xe007) AM_READ_PORT("IN2")
741741   AM_RANGE(0xe008, 0xe00f) AM_READNOP
742   AM_RANGE(0xe800, 0xe800) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_port_w)
743   AM_RANGE(0xe801, 0xe801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w)
742   AM_RANGE(0xe800, 0xe800) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, master_port_w)
743   AM_RANGE(0xe801, 0xe801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w)
744744   AM_RANGE(0xf000, 0xf000) AM_READWRITE(rombank2switch_r, rombank2switch_w)
745745ADDRESS_MAP_END
746746
r29505r29506
749749   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank7")
750750   AM_RANGE(0x8000, 0x8fff) AM_RAM
751751   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
752   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
753   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
752   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
753   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
754754   AM_RANGE(0xb000, 0xb000) AM_WRITE(champwr_msm5205_hi_w)
755755   AM_RANGE(0xc000, 0xc000) AM_WRITE(champwr_msm5205_lo_w)
756756   AM_RANGE(0xd000, 0xd000) AM_WRITE(champwr_msm5205_start_w)
r29505r29506
17821782};
17831783
17841784
1785static const tc0140syt_interface taitol_tc0140syt_intf =
1786{
1787   "slave", "audiocpu"
1788};
1789
1790
17911785static MACHINE_CONFIG_START( fhawk, taitol_state )
17921786
17931787   /* basic machine hardware */
r29505r29506
18331827   MCFG_SOUND_ROUTE(2, "mono", 0.20)
18341828   MCFG_SOUND_ROUTE(3, "mono", 0.80)
18351829
1836   MCFG_TC0140SYT_ADD("tc0140syt", taitol_tc0140syt_intf)
1830   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
1831   MCFG_TC0140SYT_MASTER_CPU("slave")
1832   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
18371833MACHINE_CONFIG_END
18381834
18391835
r29505r29506
19261922   MCFG_SOUND_ROUTE(1, "mono", 0.20)
19271923   MCFG_SOUND_ROUTE(2, "mono", 0.20)
19281924   MCFG_SOUND_ROUTE(3, "mono", 0.80)
1929
1930   MCFG_TC0140SYT_ADD("tc0140syt", taitol_tc0140syt_intf)
19311925MACHINE_CONFIG_END
19321926
19331927
r29505r29506
19741968   MCFG_SOUND_ROUTE(1, "mono", 0.20)
19751969   MCFG_SOUND_ROUTE(2, "mono", 0.20)
19761970   MCFG_SOUND_ROUTE(3, "mono", 0.80)
1977
1978   MCFG_TC0140SYT_ADD("tc0140syt", taitol_tc0140syt_intf)
19791971MACHINE_CONFIG_END
19801972
19811973
r29505r29506
20672059   MCFG_SOUND_ROUTE(1, "mono", 0.25)
20682060   MCFG_SOUND_ROUTE(2, "mono", 0.25)
20692061   MCFG_SOUND_ROUTE(3, "mono", 0.80)
2070
2071   MCFG_TC0140SYT_ADD("tc0140syt", taitol_tc0140syt_intf)
20722062MACHINE_CONFIG_END
20732063
20742064#ifdef UNUSED_CODE
branches/new_menus/src/mame/drivers/sshangha.c
r29505r29506
379379   DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
380380};
381381
382int sshangha_state::bank_callback( int bank )
382DECO16IC_BANK_CB_MEMBER(sshangha_state::bank_callback)
383383{
384384   return (bank >> 4) * 0x1000;
385385}
r29505r29506
424424   MCFG_DECO16IC_PALETTE("palette")
425425
426426   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
427   decospr_device::set_gfx_region(*device, 2);
427   MCFG_DECO_SPRITE_GFX_REGION(2)
428428   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
429429   MCFG_DECO_SPRITE_PALETTE("palette")
430430
431431   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
432   decospr_device::set_gfx_region(*device, 2);
432   MCFG_DECO_SPRITE_GFX_REGION(2)
433433   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
434434   MCFG_DECO_SPRITE_PALETTE("palette")
435435
branches/new_menus/src/mame/drivers/jpmimpct.c
r29505r29506
13501350   MCFG_CPU_PROGRAM_MAP(awp68k_program_map)
13511351
13521352   MCFG_QUANTUM_TIME(attotime::from_hz(30000))
1353   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
1353   MCFG_S16LF01_ADD("vfd",0)
13541354
13551355   MCFG_MACHINE_START_OVERRIDE(jpmimpct_state,impctawp)
13561356   MCFG_MACHINE_RESET_OVERRIDE(jpmimpct_state,impctawp)
branches/new_menus/src/mame/drivers/silvmil.c
r29505r29506
329329
330330
331331   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
332   decospr_device::set_gfx_region(*device, 0);
333   decospr_device::set_is_bootleg(*device, true);
334   decospr_device::set_offsets(*device, 5,7);
332   MCFG_DECO_SPRITE_GFX_REGION(0)
333   MCFG_DECO_SPRITE_ISBOOTLEG(true)
334   MCFG_DECO_SPRITE_OFFSETS(5, 7)
335335   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
336336   MCFG_DECO_SPRITE_PALETTE("palette")
337337
branches/new_menus/src/mame/drivers/maygay1bsw.c
r29505r29506
22
33/*
44 the MSM6376 is on the ROM board, so some games might not have it
5 the YM2149F is on the MAIN board
5 the YM2149F is on the MAIN board, but it seems very rarely used for sound.
6 
7 On various PCBs, I've seen the AY slot filled with AY8913's, 8910's,
8 YM2419s and even AY8930s.
69
710 some of the sound roms we have look more like uPD7749 ones? did some
811 ROM boards use that instead?
branches/new_menus/src/mame/drivers/toaplan2.c
r29505r29506
39333933   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
39343934MACHINE_CONFIG_END
39353935
3936
3937static const nmk112_interface bgaregga_nmk112_intf =
3938{
3939   "oki", NULL, 0
3940};
3941
3942static const nmk112_interface batrider_nmk112_intf =
3943{
3944   "oki1", "oki2", 0
3945};
3946
3947
39483936static MACHINE_CONFIG_START( bgaregga, toaplan2_state )
39493937
39503938   /* basic machine hardware */
r29505r29506
39903978   MCFG_OKIM6295_ADD("oki", XTAL_32MHz/16, OKIM6295_PIN7_HIGH)
39913979   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
39923980
3993   MCFG_NMK112_ADD("nmk112", bgaregga_nmk112_intf)
3981   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
3982   MCFG_NMK112_ROM0("oki")
39943983MACHINE_CONFIG_END
39953984
39963985
r29505r29506
40494038   MCFG_OKIM6295_ADD("oki2", XTAL_32MHz/10, OKIM6295_PIN7_LOW)
40504039   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
40514040
4052   MCFG_NMK112_ADD("nmk112", batrider_nmk112_intf)
4041   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
4042   MCFG_NMK112_ROM0("oki1")
4043   MCFG_NMK112_ROM1("oki2")
40534044MACHINE_CONFIG_END
40544045
40554046
branches/new_menus/src/mame/drivers/rainbow.c
r29505r29506
351351   AM_RANGE(0x3a0000, 0x3a0001) AM_WRITE(rbisland_spritectrl_w)
352352   AM_RANGE(0x3b0000, 0x3b0003) AM_READ_PORT("DSWB")
353353   AM_RANGE(0x3c0000, 0x3c0003) AM_WRITENOP        /* written very often, watchdog? */
354   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
355   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r,tc0140syt_comm_w, 0x00ff)
354   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
355   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
356356   AM_RANGE(0x800000, 0x8007ff) AM_READWRITE(rbisland_cchip_ram_r,rbisland_cchip_ram_w)
357357   AM_RANGE(0x800802, 0x800803) AM_READWRITE(rbisland_cchip_ctrl_r,rbisland_cchip_ctrl_w)
358358   AM_RANGE(0x800c00, 0x800c01) AM_WRITE(rbisland_cchip_bank_w)
r29505r29506
410410   AM_RANGE(0x8000, 0x8fff) AM_RAM
411411   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
412412   AM_RANGE(0x9002, 0x9100) AM_READNOP
413   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
414   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
413   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
414   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
415415ADDRESS_MAP_END
416416
417417static ADDRESS_MAP_START( jumping_sound_map, AS_PROGRAM, 8, rbisland_state )
r29505r29506
619619                      MACHINE DRIVERS
620620***********************************************************/
621621
622static const pc080sn_interface rbisland_pc080sn_intf =
623{
624   1,   /* gfxnum */
625   0, 0, 0, 0  /* x_offset, y_offset, y_invert, dblwidth */
626};
627
628static const pc080sn_interface jumping_pc080sn_intf =
629{
630   1,   /* gfxnum */
631   0, 0, 1, 0  /* x_offset, y_offset, y_invert, dblwidth */
632};
633
634static const pc090oj_interface rbisland_pc090oj_intf =
635{
636   0, 0, 0, 0
637};
638
639static const tc0140syt_interface rbisland_tc0140syt_intf =
640{
641   "maincpu", "audiocpu"
642};
643
644622void rbisland_state::machine_start()
645623{
646624}
r29505r29506
671649   MCFG_PALETTE_ADD("palette", 8192)
672650   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
673651
674   MCFG_PC080SN_ADD("pc080sn", rbisland_pc080sn_intf)
652   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
653   MCFG_PC080SN_GFX_REGION(1)
675654   MCFG_PC080SN_GFXDECODE("gfxdecode")
676655   MCFG_PC080SN_PALETTE("palette")
677   MCFG_PC090OJ_ADD("pc090oj", rbisland_pc090oj_intf)
656
657   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
678658   MCFG_PC090OJ_GFXDECODE("gfxdecode")
679659   MCFG_PC090OJ_PALETTE("palette")
680660
r29505r29506
687667   MCFG_SOUND_ROUTE(0, "mono", 0.50)
688668   MCFG_SOUND_ROUTE(1, "mono", 0.50)
689669
690   MCFG_TC0140SYT_ADD("tc0140syt", rbisland_tc0140syt_intf)
670   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
671   MCFG_TC0140SYT_MASTER_CPU("maincpu")
672   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
691673MACHINE_CONFIG_END
692674
693675
r29505r29506
720702
721703   MCFG_VIDEO_START_OVERRIDE(rbisland_state,jumping)
722704
723   MCFG_PC080SN_ADD("pc080sn", jumping_pc080sn_intf)
705   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
706   MCFG_PC080SN_GFX_REGION(1)
707   MCFG_PC080SN_YINVERT(1)
724708   MCFG_PC080SN_GFXDECODE("gfxdecode")
725709   MCFG_PC080SN_PALETTE("palette")
726710
branches/new_menus/src/mame/drivers/crystal.c
r29505r29506
900900   0x04800000
901901};
902902
903static const vr0video_interface vr0video_config =
904{
905   "maincpu"
906};
907
908903static MACHINE_CONFIG_START( crystal, crystal_state )
909904
910905   MCFG_CPU_ADD("maincpu", SE3208, 43000000)
911906   MCFG_CPU_PROGRAM_MAP(crystal_mem)
912907   MCFG_CPU_VBLANK_INT_DRIVER("screen", crystal_state,  crystal_interrupt)
913908
914
915909   MCFG_NVRAM_ADD_0FILL("nvram")
916910
917911   MCFG_SCREEN_ADD("screen", RASTER)
r29505r29506
923917   MCFG_SCREEN_VBLANK_DRIVER(crystal_state, screen_eof_crystal)
924918   MCFG_SCREEN_PALETTE("palette")
925919
926   MCFG_VIDEO_VRENDER0_ADD("vr0", vr0video_config)
920   MCFG_DEVICE_ADD("vr0", VIDEO_VRENDER0, 0)
921   MCFG_VIDEO_VRENDER0_CPU("maincpu")
927922
928923   MCFG_PALETTE_ADD_RRRRRGGGGGGBBBBB("palette")
929924
r29505r29506
11441139}
11451140
11461141
1147
1148
11491142GAME( 2001, crysbios,        0, crystal,  crystal, driver_device,         0, ROT0, "BrezzaSoft", "Crystal System BIOS", GAME_IS_BIOS_ROOT )
11501143GAME( 2001, crysking, crysbios, crystal,  crystal, crystal_state,  crysking, ROT0, "BrezzaSoft", "The Crystal of Kings", 0 )
11511144GAME( 2001, evosocc,  crysbios, crystal,  crystal, crystal_state,  evosocc,  ROT0, "Evoga", "Evolution Soccer", 0 )
branches/new_menus/src/mame/drivers/famibox.c
r29505r29506
526526   m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
527527}
528528
529/* our ppu interface                                            */
530static const ppu2c0x_interface ppu_interface =
531{
532   "maincpu",
533   0,                  /* gfxlayout num */
534   0,                  /* color base */
535   PPU_MIRROR_NONE     /* mirroring */
536};
537
538529void famibox_state::video_start()
539530{
540531}
r29505r29506
596587   MCFG_PALETTE_ADD("palette", 8*4*16)
597588   MCFG_PALETTE_INIT_OWNER(famibox_state, famibox)
598589
599
600   MCFG_PPU2C04_ADD("ppu", ppu_interface)
590   MCFG_PPU2C04_ADD("ppu")
591   MCFG_PPU2C0X_CPU("maincpu")
601592   MCFG_PPU2C0X_SET_NMI(famibox_state, ppu_irq)
602593
603594   /* sound hardware */
branches/new_menus/src/mame/drivers/cninja.c
r29505r29506
785785
786786/**********************************************************************************/
787787
788int cninja_state::cninja_bank_callback( int bank )
788DECO16IC_BANK_CB_MEMBER(cninja_state::cninja_bank_callback)
789789{
790790   if ((bank >> 4) & 0xf)
791791      return 0x0000; /* Only 2 banks */
792792   return 0x1000;
793793}
794794
795int cninja_state::robocop2_bank_callback( int bank )
795DECO16IC_BANK_CB_MEMBER(cninja_state::robocop2_bank_callback)
796796{
797797   return (bank & 0x30) << 8;
798798}
799799
800int cninja_state::mutantf_1_bank_callback( int bank )
800DECO16IC_BANK_CB_MEMBER(cninja_state::mutantf_1_bank_callback)
801801{
802802   return ((bank >> 4) & 0x3) << 12;
803803}
804804
805int cninja_state::mutantf_2_bank_callback( int bank )
805DECO16IC_BANK_CB_MEMBER(cninja_state::mutantf_2_bank_callback)
806806{
807807   return ((bank >> 5) & 0x1) << 14;
808808}
809809
810810
811void cninja_state::machine_start()
811DECOSPR_PRIORITY_CB_MEMBER(cninja_state::pri_callback)
812812{
813   save_item(NAME(m_scanline));
814   save_item(NAME(m_irq_mask));
815}
816
817void cninja_state::machine_reset()
818{
819   m_scanline = 0;
820   m_irq_mask = 0;
821}
822
823
824UINT16 cninja_pri_callback(UINT16 x)
825{
826813   /* Sprite/playfield priority */
827   switch (x & 0xc000)
814   switch (pri & 0xc000)
828815   {
829816      case 0x0000: return 0;
830817      case 0x4000: return 0xf0;
831818      case 0x8000: return 0xf0 | 0xcc;
832819      case 0xc000: return 0xf0 | 0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */
833820   }
834
821   
835822   return 0;
836823}
837824
838825
826void cninja_state::machine_start()
827{
828   save_item(NAME(m_scanline));
829   save_item(NAME(m_irq_mask));
830}
831
832void cninja_state::machine_reset()
833{
834   m_scanline = 0;
835   m_irq_mask = 0;
836}
837
839838static MACHINE_CONFIG_START( cninja, cninja_state )
840839
841840   /* basic machine hardware */
r29505r29506
896895   MCFG_DECO16IC_PALETTE("palette")
897896
898897   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
899   decospr_device::set_gfx_region(*device, 3);
900   decospr_device::set_pri_callback(*device, cninja_pri_callback);
898   MCFG_DECO_SPRITE_GFX_REGION(3)
899   MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
901900   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
902901   MCFG_DECO_SPRITE_PALETTE("palette")
903902
r29505r29506
986985   MCFG_DECO16IC_PALETTE("palette")
987986
988987   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
989   decospr_device::set_gfx_region(*device, 3);
990   decospr_device::set_pri_callback(*device, cninja_pri_callback);
988   MCFG_DECO_SPRITE_GFX_REGION(3)
989   MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
991990   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
992991   MCFG_DECO_SPRITE_PALETTE("palette")
993992
r29505r29506
11431142   MCFG_DECO16IC_PALETTE("palette")
11441143
11451144   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1146   decospr_device::set_gfx_region(*device, 3);
1147   decospr_device::set_pri_callback(*device, cninja_pri_callback);
1145   MCFG_DECO_SPRITE_GFX_REGION(3)
1146   MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
11481147   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
11491148   MCFG_DECO_SPRITE_PALETTE("palette")
11501149
r29505r29506
12311230   MCFG_DECO16IC_PALETTE("palette")
12321231
12331232   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1234   decospr_device::set_gfx_region(*device, 3);
1235   decospr_device::set_pri_callback(*device, cninja_pri_callback);
1233   MCFG_DECO_SPRITE_GFX_REGION(3)
1234   MCFG_DECO_SPRITE_PRIORITY_CB(cninja_state, pri_callback)
12361235   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
12371236   MCFG_DECO_SPRITE_PALETTE("palette")
12381237
r29505r29506
13251324   MCFG_DECO16IC_PALETTE("palette")
13261325
13271326   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
1328   decospr_device::set_gfx_region(*device, 3);
1327   MCFG_DECO_SPRITE_GFX_REGION(3)
13291328   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
13301329   MCFG_DECO_SPRITE_PALETTE("palette")
13311330
13321331   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
1333   decospr_device::set_gfx_region(*device, 4);
1332   MCFG_DECO_SPRITE_GFX_REGION(4)
13341333   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
13351334   MCFG_DECO_SPRITE_PALETTE("palette")
13361335
branches/new_menus/src/mame/drivers/taitoair.c
r29505r29506
403403   AM_RANGE(0xa00000, 0xa00007) AM_READ(stick_input_r)
404404   AM_RANGE(0xa00100, 0xa00107) AM_READ(stick2_input_r)
405405   AM_RANGE(0xa00200, 0xa0020f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff) /* other I/O */
406   AM_RANGE(0xa80000, 0xa80001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
407   AM_RANGE(0xa80002, 0xa80003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
406   AM_RANGE(0xa80000, 0xa80001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
407   AM_RANGE(0xa80002, 0xa80003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
408408   AM_RANGE(0xb00000, 0xb007ff) AM_RAM                     /* "power common ram" (mecha drive) */
409409ADDRESS_MAP_END
410410
r29505r29506
415415   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
416416   AM_RANGE(0xc000, 0xdfff) AM_RAM
417417   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
418   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
419   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
418   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
419   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
420420   AM_RANGE(0xe400, 0xe403) AM_WRITENOP        /* pan control */
421421   AM_RANGE(0xea00, 0xea00) AM_READNOP
422422   AM_RANGE(0xee00, 0xee00) AM_WRITENOP        /* ? */
r29505r29506
638638                MACHINE DRIVERS
639639************************************************************/
640640
641static const tc0080vco_interface airsys_tc0080vco_intf =
642{
643   0, 1,   /* gfxnum, txnum */
644   1, 1, -2,
645   0
646};
647
648static const tc0140syt_interface airsys_tc0140syt_intf =
649{
650   "maincpu", "audiocpu"
651};
652
653641void taitoair_state::machine_start()
654642{
655643   UINT8 *ROM = memregion("audiocpu")->base();
r29505r29506
721709
722710   MCFG_PALETTE_ADD_INIT_BLACK("palette", 512*16+512*16)
723711
724   MCFG_TC0080VCO_ADD("tc0080vco", airsys_tc0080vco_intf)
712   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
713   MCFG_TC0080VCO_GFX_REGION(0)
714   MCFG_TC0080VCO_TX_REGION(1)
715   MCFG_TC0080VCO_OFFSETS(1, 1)
716   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
725717   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
726718   MCFG_TC0080VCO_PALETTE("palette")
727719
r29505r29506
734726   MCFG_SOUND_ROUTE(1, "mono", 0.60)
735727   MCFG_SOUND_ROUTE(2, "mono", 0.60)
736728
737   MCFG_TC0140SYT_ADD("tc0140syt", airsys_tc0140syt_intf)
729   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
730   MCFG_TC0140SYT_MASTER_CPU("maincpu")
731   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
738732MACHINE_CONFIG_END
739733
740734
branches/new_menus/src/mame/drivers/maygayv1.c
r29505r29506
128128#include "cpu/m68000/m68000.h"
129129#include "video/awpvid.h"
130130#include "cpu/mcs51/mcs51.h"
131#include "machine/i8279.h"
131132#include "machine/6821pia.h"
132133#include "machine/mc68681.h"
133134#include "sound/2413intf.h"
r29505r29506
202203};
203204
204205
205struct i8279_t
206{
207   UINT8   command;
208   UINT8   mode;
209   UINT8   prescale;
210   UINT8   inhibit;
211   UINT8   clear;
212   UINT8   fifo[8];
213   UINT8   ram[16];
214};
215
216206class maygayv1_state : public driver_device
217207{
218208public:
r29505r29506
230220   required_device<mc68681_device> m_duart68681;
231221   required_device<palette_device> m_palette;
232222
223   int m_lamp_strobe;
224   int m_old_lamp_strobe;
233225   int m_vsync_latch_preset;
234226   UINT8 m_p1;
235227   UINT8 m_p3;
236228   int m_d68681_val;
237229   i82716_t m_i82716;
238   i8279_t m_i8279;
239230   DECLARE_WRITE16_MEMBER(i82716_w);
240231   DECLARE_READ16_MEMBER(i82716_r);
241232   DECLARE_WRITE16_MEMBER(write_odd);
242233   DECLARE_READ16_MEMBER(read_odd);
243   DECLARE_READ16_MEMBER(maygay_8279_r);
244   DECLARE_WRITE16_MEMBER(maygay_8279_w);
245234   DECLARE_WRITE16_MEMBER(vsync_int_ctrl);
246235   DECLARE_READ8_MEMBER(mcu_r);
247236   DECLARE_WRITE8_MEMBER(mcu_w);
248237   DECLARE_READ8_MEMBER(b_read);
249238   DECLARE_WRITE8_MEMBER(b_writ);
239   DECLARE_WRITE8_MEMBER(strobe_w);
240   DECLARE_WRITE8_MEMBER(lamp_data_w);
241   DECLARE_READ8_MEMBER(kbd_r);
250242   DECLARE_DRIVER_INIT(screenpl);
251243   virtual void machine_start();
252244   virtual void machine_reset();
r29505r29506
506498   return 0;
507499}
508500
501/*************************************
502 *
503 *  8279 display/keyboard driver
504 *
505 *************************************/
509506
510/* TODO */
511static void update_outputs(i8279_t &i8279, UINT16 which)
507WRITE8_MEMBER( maygayv1_state::strobe_w )
512508{
513   int i;
514
515   /* update the items in the bitmask */
516   for (i = 0; i < 16; i++)
517      if (which & (1 << i))
518      {
519/*
520            int val;
521
522            val = i8279.ram[i] & 0xff;
523
524            val = i8279.ram[i] & 0x0f;
525            if (i8279.inhibit & 0x01)
526                val = i8279.clear & 0x0f;
527
528                if(val) printf("%x\n", val);
529
530            val = i8279.ram[i] >> 4;
531            if (i8279.inhibit & 0x02)
532                val = i8279.clear >> 4;
533
534                if(val) printf("%x\n", val);
535*/
536      }
509   m_lamp_strobe = data;
537510}
538511
539READ16_MEMBER(maygayv1_state::maygay_8279_r)
512WRITE8_MEMBER( maygayv1_state::lamp_data_w )
540513{
541   i8279_t &i8279 = m_i8279;
542   static const char *const portnames[] = { "STROBE1","STROBE2","STROBE3","STROBE4","STROBE5","STROBE6","STROBE7","STROBE8" };
543   UINT8 result = 0xff;
544   UINT8 addr;
545
546   /* read data */
547   if ((offset & 1) == 0)
514   //The two A/B ports are merged back into one, to make one row of 8 lamps.
515   
516   if (m_old_lamp_strobe != m_lamp_strobe)
548517   {
549      switch (i8279.command & 0xe0)
550      {
551         /* read sensor RAM */
552         case 0x40:
553            addr = i8279.command & 0x07;
518      // Because of the nature of the lamping circuit, there is an element of persistance
519      // As a consequence, the lamp column data can change before the input strobe without
520      // causing the relevant lamps to black out.
554521
555            result = ioport(portnames[addr])->read();
556
557            /* handle autoincrement */
558            if (i8279.command & 0x10)
559               i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f);
560
561            break;
562
563         /* read display RAM */
564         case 0x60:
565
566            /* set the value of the corresponding outputs */
567            addr = i8279.command & 0x0f;
568            result = i8279.ram[addr];
569
570            /* handle autoincrement */
571            if (i8279.command & 0x10)
572               i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f);
573            break;
522      for (int i = 0; i < 8; i++)
523      {
524         output_set_lamp_value((8*m_lamp_strobe)+i, ((data  & (1 << i)) !=0));
574525      }
526      m_old_lamp_strobe = m_lamp_strobe;
575527   }
576   /* read status word */
577   else
578   {
579      printf("read 0xfc%02x\n", offset);
580      result = 0x10;
581   }
582   return result;
528   
583529}
584530
585
586WRITE16_MEMBER(maygayv1_state::maygay_8279_w)
531READ8_MEMBER( maygayv1_state::kbd_r )
587532{
588   i8279_t &i8279 = m_i8279;
589   UINT8 addr;
533   static const char *const portnames[] = { "STROBE1","STROBE2","STROBE3","STROBE4","STROBE5","STROBE6","STROBE7","STROBE8" };
590534
591   data >>= 8;
592
593   /* write data */
594   if ((offset & 1) == 0)
595   {
596      switch (i8279.command & 0xe0)
597      {
598         /* write display RAM */
599         case 0x80:
600
601            /* set the value of the corresponding outputs */
602            addr = i8279.command & 0x0f;
603            if (!(i8279.inhibit & 0x04))
604               i8279.ram[addr] = (i8279.ram[addr] & 0xf0) | (data & 0x0f);
605            if (!(i8279.inhibit & 0x08))
606               i8279.ram[addr] = (i8279.ram[addr] & 0x0f) | (data & 0xf0);
607            update_outputs(i8279, 1 << addr);
608
609            /* handle autoincrement */
610            if (i8279.command & 0x10)
611               i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f);
612            break;
613      }
614   }
615
616   /* write command */
617   else
618   {
619      i8279.command = data;
620
621      switch (data & 0xe0)
622      {
623         /* command 0: set mode */
624         /*
625             Display modes:
626
627             00 = 8 x 8-bit character display -- left entry
628             01 = 16 x 8-bit character display -- left entry
629             10 = 8 x 8-bit character display -- right entry
630             11 = 16 x 8-bit character display -- right entry
631
632             Keyboard modes:
633
634             000 = Encoded scan keyboard -- 2 key lockout
635             001 = Decoded scan keyboard -- 2 key lockout
636             010 = Encoded scan keyboard -- N-key rollover
637             011 = Decoded scan keyboard -- N-key rollover
638             100 = Encoded scan sensor matrix
639             101 = Decoded scan sensor matrix
640             110 = Strobed input, encoded display scan
641             111 = Strobed input, decoded display scan
642         */
643         case 0x00:
644            logerror("8279: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7);
645            i8279.mode = data & 0x1f;
646            break;
647
648         /* command 1: program clock */
649         case 0x20:
650            logerror("8279: clock prescaler set to %02X\n", data & 0x1f);
651            i8279.prescale = data & 0x1f;
652            break;
653
654         /* command 2: read FIFO/sensor RAM */
655         /* command 3: read display RAM */
656         /* command 4: write display RAM */
657         case 0x40:
658         case 0x60:
659         case 0x80:
660            break;
661
662         /* command 5: display write inhibit/blanking */
663         case 0xa0:
664            i8279.inhibit = data & 0x0f;
665            update_outputs(i8279, ~0);
666            logerror("8279: clock prescaler set to %02X\n", data & 0x1f);
667            break;
668
669         /* command 6: clear */
670         case 0xc0:
671            i8279.clear = (data & 0x08) ? ((data & 0x04) ? 0xff : 0x20) : 0x00;
672            if (data & 0x11)
673               memset(i8279.ram, i8279.clear, sizeof(i8279.ram));
674            break;
675
676         /* command 7: end interrupt/error mode set */
677         case 0xe0:
678            break;
679      }
680   }
535   return ioport(portnames[m_lamp_strobe&0x07])->read();
681536}
682537
538/*
539static I8279_INTERFACE( v1_i8279_intf )
540{
541   DEVCB_NULL,                                     // irq
542   DEVCB_DRIVER_MEMBER(maygayv1_state, strobe_w),  // scan SL lines
543   DEVCB_DRIVER_MEMBER(maygayv1_state, lamp_data_w),      // display A&B
544   DEVCB_NULL,                                     // BD
545   DEVCB_DRIVER_MEMBER(maygayv1_state,kbd_r),      // kbd RL lines
546   DEVCB_NULL,                                     // Shift key
547   DEVCB_NULL                                      // Ctrl-Strobe line
548};
549*/
683550
551
684552WRITE16_MEMBER(maygayv1_state::vsync_int_ctrl)
685553{
686554   m_vsync_latch_preset = data & 0x0100;
r29505r29506
694562   AM_RANGE(0x000000, 0x07ffff) AM_ROM
695563   AM_RANGE(0x080000, 0x083fff) AM_RAM AM_SHARE("nvram")
696564   AM_RANGE(0x100000, 0x17ffff) AM_ROM AM_REGION("maincpu", 0x80000)
697   AM_RANGE(0x820000, 0x820003) AM_READWRITE(maygay_8279_r, maygay_8279_w)
565   AM_RANGE(0x820000, 0x820001) AM_DEVREADWRITE8("i8279", i8279_device, data_r, data_w ,0xff)
566   AM_RANGE(0x820002, 0x820003) AM_DEVREADWRITE8("i8279", i8279_device, status_r, cmd_w,0xff)
698567   AM_RANGE(0x800000, 0x800003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0xff00)
699568   AM_RANGE(0x860000, 0x86000d) AM_READWRITE(read_odd, write_odd)
700569   AM_RANGE(0x86000e, 0x86000f) AM_WRITE(vsync_int_ctrl)
r29505r29506
1041910   MCFG_MC68681_IRQ_CALLBACK(WRITELINE(maygayv1_state, duart_irq_handler))
1042911   MCFG_MC68681_A_TX_CALLBACK(WRITELINE(maygayv1_state, duart_txa))
1043912
913   MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4)    // unknown clock
914//   MCFG_I8279_ADD("i8279", MASTER_CLOCK/4, v1_i8279_intf)    // unknown clock
915
1044916   MCFG_SPEAKER_STANDARD_MONO("mono")
1045917
1046918   MCFG_SOUND_ADD("ymsnd",YM2413, MASTER_CLOCK / 4)
branches/new_menus/src/mame/drivers/volfied.c
r29505r29506
7070   AM_RANGE(0x600000, 0x600001) AM_WRITE(volfied_video_mask_w)
7171   AM_RANGE(0x700000, 0x700001) AM_WRITE(volfied_sprite_ctrl_w)
7272   AM_RANGE(0xd00000, 0xd00001) AM_READWRITE(volfied_video_ctrl_r, volfied_video_ctrl_w)
73   AM_RANGE(0xe00000, 0xe00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
74   AM_RANGE(0xe00002, 0xe00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
73   AM_RANGE(0xe00000, 0xe00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
74   AM_RANGE(0xe00002, 0xe00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
7575   AM_RANGE(0xf00000, 0xf007ff) AM_READWRITE(volfied_cchip_ram_r, volfied_cchip_ram_w)
7676   AM_RANGE(0xf00802, 0xf00803) AM_READWRITE(volfied_cchip_ctrl_r, volfied_cchip_ctrl_w)
7777   AM_RANGE(0xf00c00, 0xf00c01) AM_WRITE(volfied_cchip_bank_w)
r29505r29506
8080static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8, volfied_state )
8181   AM_RANGE(0x0000, 0x7fff) AM_ROM
8282   AM_RANGE(0x8000, 0x87ff) AM_RAM
83   AM_RANGE(0x8800, 0x8800) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
84   AM_RANGE(0x8801, 0x8801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
83   AM_RANGE(0x8800, 0x8800) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
84   AM_RANGE(0x8801, 0x8801) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
8585   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
8686   AM_RANGE(0x9800, 0x9800) AM_WRITENOP    /* ? */
8787ADDRESS_MAP_END
r29505r29506
235235   volfied_cchip_reset();
236236}
237237
238static const pc090oj_interface volfied_pc090oj_intf =
239{
240   0, 0, 0, 0
241};
242
243static const tc0140syt_interface volfied_tc0140syt_intf =
244{
245   "maincpu", "audiocpu"
246};
247
248238static MACHINE_CONFIG_START( volfied, volfied_state )
249239
250240   /* basic machine hardware */
r29505r29506
271261   MCFG_PALETTE_ADD("palette", 8192)
272262   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
273263
274   MCFG_PC090OJ_ADD("pc090oj", volfied_pc090oj_intf)
264   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
275265   MCFG_PC090OJ_GFXDECODE("gfxdecode")
276266   MCFG_PC090OJ_PALETTE("palette")
277267
r29505r29506
286276   MCFG_SOUND_ROUTE(2, "mono", 0.15)
287277   MCFG_SOUND_ROUTE(3, "mono", 0.60)
288278
289   MCFG_TC0140SYT_ADD("tc0140syt", volfied_tc0140syt_intf)
279   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
280   MCFG_TC0140SYT_MASTER_CPU("maincpu")
281   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
290282MACHINE_CONFIG_END
291283
292284
branches/new_menus/src/mame/drivers/esd16.c
r29505r29506
592592   m_tilemap0_color = 0;
593593}
594594
595UINT16 esd16_state::hedpanic_pri_callback(UINT16 x)
595DECOSPR_PRIORITY_CB_MEMBER(esd16_state::hedpanic_pri_callback)
596596{
597   if (x & 0x8000)
597   if (pri & 0x8000)
598598      return 0xfffe; // under "tilemap 1"
599599   else
600600      return 0; // above everything
r29505r29506
623623   MCFG_SCREEN_PALETTE("palette")
624624
625625   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
626   decospr_device::set_gfx_region(*device, 0);
627   decospr_device::set_is_bootleg(*device, true);
628   decospr_device::set_pri_callback(*device, esd16_state::hedpanic_pri_callback);
629   decospr_device::set_flipallx(*device, 1);
626   MCFG_DECO_SPRITE_GFX_REGION(0)
627   MCFG_DECO_SPRITE_ISBOOTLEG(true)
628   MCFG_DECO_SPRITE_PRIORITY_CB(esd16_state, hedpanic_pri_callback)
629   MCFG_DECO_SPRITE_FLIPALLX(1)
630630   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
631631   MCFG_DECO_SPRITE_PALETTE("palette")
632632
r29505r29506
679679
680680static MACHINE_CONFIG_DERIVED( hedpanic, hedpanio )
681681   MCFG_DEVICE_MODIFY("spritegen")
682   decospr_device::set_offsets(*device, -0x18,-0x100);
682   MCFG_DECO_SPRITE_OFFSETS(-0x18, -0x100)
683683MACHINE_CONFIG_END
684684
685685/* ESD 08-26-1999 PCBs with different memory maps */
branches/new_menus/src/mame/drivers/superchs.c
r29505r29506
312312                 MACHINE DRIVERS
313313***********************************************************/
314314
315static const tc0480scp_interface superchs_tc0480scp_intf =
316{
317   1, 2,       /* gfxnum, txnum */
318   0,          /* pixels */
319   0x20, 0x08, /* x_offset, y_offset */
320   -1, 0,      /* text_xoff, text_yoff */
321   0, 0,       /* flip_xoff, flip_yoff */
322   0           /* col_base */
323};
324
325315static MACHINE_CONFIG_START( superchs, superchs_state )
326316
327317   /* basic machine hardware */
r29505r29506
349339   MCFG_GFXDECODE_ADD("gfxdecode", "palette", superchs)
350340   MCFG_PALETTE_ADD("palette", 8192)
351341
352
353   MCFG_TC0480SCP_ADD("tc0480scp", superchs_tc0480scp_intf)
342   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
343   MCFG_TC0480SCP_GFX_REGION(1)
344   MCFG_TC0480SCP_TX_REGION(2)
345   MCFG_TC0480SCP_OFFSETS(0x20, 0x08)
346   MCFG_TC0480SCP_OFFSETS_TX(-1, 0)
354347   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
355348   MCFG_TC0480SCP_PALETTE("palette")
356349
branches/new_menus/src/mame/drivers/xexex.c
r29505r29506
460460   ym_set_mixing
461461};
462462
463static const k054338_interface xexex_k054338_intf =
464{
465   0,
466   "none"
467};
468
469463static const k056832_interface xexex_k056832_intf =
470464{
471465   "gfx1", 0,
r29505r29506
570564   MCFG_K053246_PALETTE("palette")
571565   MCFG_K053250_ADD("k053250", "palette", "screen", -5, -16)
572566   MCFG_K053251_ADD("k053251")
567
573568   MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4)
574   MCFG_K054338_ADD("k054338", xexex_k054338_intf)
575569
570   MCFG_DEVICE_ADD("k054338", K054338, 0)
571
576572   /* sound hardware */
577573   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
578574
branches/new_menus/src/mame/drivers/skylncr.c
r29505r29506
11331133  1x HM6116LP-4
11341134  5x HM6116L-120
11351135
1136  One extra ROM (u48) is blank.
1137  Sure is the one that store the palette at offset $C000,
1138  among the missing graphics.
1136  Unfortunately, one extra ROM (u48) is blank.
1137  Seems to be the one that store the palette at offset $C000.
11391138
1140  Also graphics ROMs are half the standard size and
1141  they lack of at least 4 extra big girl pictures.
1142
11431139  BP 170 to see the palette registers...
11441140
11451141*/
r29505r29506
11481144   ROM_LOAD( "27256.u15",    0x0000, 0x8000, CRC(a5da4f92) SHA1(82ac70bd379649f130db017aa226d0247db0f3cd) )
11491145   ROM_LOAD( "unknown.u48",  0x8000, 0x8000, BAD_DUMP CRC(9f4c02e3) SHA1(05975184130ea7dd3bb5d32eff77b585bd53e6b5) )   // palette borrowed from other game
11501146
1151   ROM_REGION( 0x40000, "gfx1", 0 )    // All ROMs are 28-pins mask ROMs dumped as 27512. Should be dumped as Fujitsu MB831000 or TC531000 (mask ROM).
1152   ROM_LOAD16_BYTE( "bor_dun_4.u23", 0x00000, 0x10000, BAD_DUMP CRC(82c9db19) SHA1(3611fb59bb7c962c7fabe7a29fa72b632fa69bed) )
1153   ROM_LOAD16_BYTE( "bor_dun_2.u25", 0x00001, 0x10000, BAD_DUMP CRC(42ee9b7a) SHA1(b39f677f58072ea7dcd7f49208be1a7b70bdc5e5) )
1154   ROM_LOAD16_BYTE( "bor_dun_3.u24", 0x20000, 0x10000, BAD_DUMP CRC(6d70879b) SHA1(83cbe67cda95e5f3d95065015f6b1b2044b88989) )
1155   ROM_LOAD16_BYTE( "bor_dun_1.u26", 0x20001, 0x10000, BAD_DUMP CRC(1b8b84ac) SHA1(b914bad0b1fb58cf581d1227e8127c6afb906fb7) )
1147   ROM_REGION( 0x80000, "gfx1", 0 )    // All ROMs are 28-pins mask ROMs dumped as Fujitsu MB831000 or TC531000 (mask ROM).
1148   ROM_LOAD16_BYTE( "bor_dun_4.u23", 0x00000, 0x20000, CRC(d0d0ead1) SHA1(00bfe691cb9020c5d7e21d80a1e059ea2155aad8) )
1149   ROM_LOAD16_BYTE( "bor_dun_2.u25", 0x00001, 0x20000, CRC(2b0f07b5) SHA1(9bcde623e53697c4b68d2f083f6254596aee64eb) )
1150   ROM_LOAD16_BYTE( "bor_dun_3.u24", 0x40000, 0x20000, CRC(3c7da3f1) SHA1(8098b33a779fb697984b97f2d7edb9874e6e19d9) )
1151   ROM_LOAD16_BYTE( "bor_dun_1.u26", 0x40001, 0x20000, CRC(36efdca6) SHA1(e614fbba77e5c7a1e7a1d2970b4f945ee0468196) )
11561152
1157   ROM_REGION( 0x40000, "gfx2", 0 )    // All ROMs are 28-pins mask ROMs dumped as 27512. Should be dumped as Fujitsu MB831000 or TC531000 (mask ROM).
1158   ROM_LOAD16_BYTE( "bor_dun_8.u19", 0x00000, 0x10000, BAD_DUMP CRC(daf651a7) SHA1(d4e472aa90aa2b52c997b2f2272007b139e3cbc2) )
1159   ROM_LOAD16_BYTE( "bor_dun_6.u21", 0x00001, 0x10000, BAD_DUMP CRC(1d88bc70) SHA1(49246d96a4ce2b8e9b10e928d7dd13973feac883) )
1160   ROM_LOAD16_BYTE( "bor_dun_7.u20", 0x20000, 0x10000, BAD_DUMP CRC(7e28ba2f) SHA1(ac8d4e95efce87456f569a71650bd7afcb59095e) )
1161   ROM_LOAD16_BYTE( "bor_dun_5.u22", 0x20001, 0x10000, BAD_DUMP CRC(52f98575) SHA1(b786c441d5ef47ff4cb50835c6ac6889cb169c6e) )
1153   ROM_REGION( 0x80000, "gfx2", 0 )    // All ROMs are 28-pins mask ROMs dumped as Fujitsu MB831000 or TC531000 (mask ROM).
1154   ROM_LOAD16_BYTE( "bor_dun_8.u19", 0x00000, 0x20000, CRC(adf0b7ce) SHA1(41d9fb16eb20e1fd2960117b7e4ea23a97b88961) )
1155   ROM_LOAD16_BYTE( "bor_dun_6.u21", 0x00001, 0x20000, CRC(37be2cbe) SHA1(78acda58aab605cb992c3b9fbaf18d38f768ed1a) )
1156   ROM_LOAD16_BYTE( "bor_dun_7.u20", 0x40000, 0x20000, CRC(43908665) SHA1(41b9cee0723d9da6934ab7934012fb1625a8f080) )
1157   ROM_LOAD16_BYTE( "bor_dun_5.u22", 0x40001, 0x20000, CRC(ca17a632) SHA1(d491310ccdbe9b59a1e607f9254646f20700d79d) )
11621158ROM_END
11631159
11641160
branches/new_menus/src/mame/drivers/slapshot.c
r29505r29506
257257WRITE16_MEMBER(slapshot_state::slapshot_msb_sound_w)
258258{
259259   if (offset == 0)
260      m_tc0140syt->tc0140syt_port_w(space, 0, (data >> 8) & 0xff);
260      m_tc0140syt->master_port_w(space, 0, (data >> 8) & 0xff);
261261   else if (offset == 1)
262      m_tc0140syt->tc0140syt_comm_w(space, 0, (data >> 8) & 0xff);
262      m_tc0140syt->master_comm_w(space, 0, (data >> 8) & 0xff);
263263
264264#ifdef MAME_DEBUG
265265   if (data & 0xff)
r29505r29506
270270READ16_MEMBER(slapshot_state::slapshot_msb_sound_r)
271271{
272272   if (offset == 1)
273      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff) << 8);
273      return ((m_tc0140syt->master_comm_r(space, 0) & 0xff) << 8);
274274   else
275275      return 0;
276276}
r29505r29506
319319   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
320320   AM_RANGE(0xc000, 0xdfff) AM_RAM
321321   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
322   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
323   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
322   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
323   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
324324   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
325325   AM_RANGE(0xea00, 0xea00) AM_READNOP
326326   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
491491                 MACHINE DRIVERS
492492***********************************************************/
493493
494static const tc0480scp_interface slapshot_tc0480scp_intf =
495{
496   1, 2,       /* gfxnum, txnum */
497   3,      /* pixels */
498   30, 9,      /* x_offset, y_offset */
499   -1, 1,      /* text_xoff, text_yoff */
500   0, 2,       /* flip_xoff, flip_yoff */
501   256     /* col_base */
502};
503
504static const tc0140syt_interface slapshot_tc0140syt_intf =
505{
506   "maincpu", "audiocpu"
507};
508
509494void slapshot_state::machine_start()
510495{
511496   membank("bank10")->configure_entries(0, 4, memregion("audiocpu")->base() + 0xc000, 0x4000);
r29505r29506
547532   MCFG_GFXDECODE_ADD("gfxdecode", "palette", slapshot)
548533   MCFG_PALETTE_ADD("palette", 8192)
549534
550
551   MCFG_TC0480SCP_ADD("tc0480scp", slapshot_tc0480scp_intf)
535   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
536   MCFG_TC0480SCP_GFX_REGION(1)
537   MCFG_TC0480SCP_TX_REGION(2)
538   MCFG_TC0480SCP_OFFSETS(30 + 3, 9)
539   MCFG_TC0480SCP_OFFSETS_TX(-1, -1)
540   MCFG_TC0480SCP_OFFSETS_FLIP(0, 2)
541   MCFG_TC0480SCP_COL_BASE(256)
552542   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
553543   MCFG_TC0480SCP_PALETTE("palette")
544
554545   MCFG_TC0360PRI_ADD("tc0360pri")
555546
556547   /* sound hardware */
r29505r29506
565556
566557   MCFG_MK48T08_ADD( "mk48t08" )
567558
568   MCFG_TC0140SYT_ADD("tc0140syt", slapshot_tc0140syt_intf)
559   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
560   MCFG_TC0140SYT_MASTER_CPU("maincpu")
561   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
569562MACHINE_CONFIG_END
570563
571564static MACHINE_CONFIG_START( opwolf3, slapshot_state )
r29505r29506
599592   MCFG_GFXDECODE_ADD("gfxdecode", "palette", slapshot)
600593   MCFG_PALETTE_ADD("palette", 8192)
601594
602
603   MCFG_TC0480SCP_ADD("tc0480scp", slapshot_tc0480scp_intf)
595   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
596   MCFG_TC0480SCP_GFX_REGION(1)
597   MCFG_TC0480SCP_TX_REGION(2)
598   MCFG_TC0480SCP_OFFSETS(30 + 3, 9)
599   MCFG_TC0480SCP_OFFSETS_TX(-1, -1)
600   MCFG_TC0480SCP_OFFSETS_FLIP(0, 2)
601   MCFG_TC0480SCP_COL_BASE(256)
604602   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
605603   MCFG_TC0480SCP_PALETTE("palette")
604
606605   MCFG_TC0360PRI_ADD("tc0360pri")
607606
608607   /* sound hardware */
r29505r29506
617616
618617   MCFG_MK48T08_ADD( "mk48t08" )
619618
620   MCFG_TC0140SYT_ADD("tc0140syt", slapshot_tc0140syt_intf)
619   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
620   MCFG_TC0140SYT_MASTER_CPU("maincpu")
621   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
621622MACHINE_CONFIG_END
622623
623624/***************************************************************************
branches/new_menus/src/mame/drivers/gotcha.c
r29505r29506
281281
282282
283283   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
284   decospr_device::set_gfx_region(*device, 1);
285   decospr_device::set_is_bootleg(*device, true);
286   decospr_device::set_offsets(*device, 5,-1); // aligned to 2nd instruction screen in attract
284   MCFG_DECO_SPRITE_GFX_REGION(1)
285   MCFG_DECO_SPRITE_ISBOOTLEG(true)
286   MCFG_DECO_SPRITE_OFFSETS(5, -1) // aligned to 2nd instruction screen in attract
287287   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
288288   MCFG_DECO_SPRITE_PALETTE("palette")
289289
branches/new_menus/src/mame/drivers/dassault.c
r29505r29506
450450
451451/**********************************************************************************/
452452
453int dassault_state::dassault_bank_callback( const int bank )
453DECO16IC_BANK_CB_MEMBER(dassault_state::bank_callback)
454454{
455455   return ((bank >> 4) & 0xf) << 12;
456456}
r29505r29506
499499   MCFG_DECO16IC_PF2_COL_BANK(16)
500500   MCFG_DECO16IC_PF1_COL_MASK(0x0f)
501501   MCFG_DECO16IC_PF2_COL_MASK(0x0f)
502   MCFG_DECO16IC_BANK1_CB(dassault_state, dassault_bank_callback)
503   MCFG_DECO16IC_BANK2_CB(dassault_state, dassault_bank_callback)
502   MCFG_DECO16IC_BANK1_CB(dassault_state, bank_callback)
503   MCFG_DECO16IC_BANK2_CB(dassault_state, bank_callback)
504504   MCFG_DECO16IC_PF12_8X8_BANK(0)
505505   MCFG_DECO16IC_PF12_16X16_BANK(1)
506506
r29505r29506
516516   MCFG_DECO16IC_PF2_COL_BANK(16)
517517   MCFG_DECO16IC_PF1_COL_MASK(0x0f)
518518   MCFG_DECO16IC_PF2_COL_MASK(0x0f)
519   MCFG_DECO16IC_BANK1_CB(dassault_state, dassault_bank_callback)
520   MCFG_DECO16IC_BANK2_CB(dassault_state, dassault_bank_callback)
519   MCFG_DECO16IC_BANK1_CB(dassault_state, bank_callback)
520   MCFG_DECO16IC_BANK2_CB(dassault_state, bank_callback)
521521   MCFG_DECO16IC_PF12_8X8_BANK(0)
522522   MCFG_DECO16IC_PF12_16X16_BANK(2)
523523   
r29505r29506
525525   MCFG_DECO16IC_PALETTE("palette")
526526
527527   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
528   decospr_device::set_gfx_region(*device, 3);
528   MCFG_DECO_SPRITE_GFX_REGION(3)
529529   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
530530   MCFG_DECO_SPRITE_PALETTE("palette")
531531
532532   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
533   decospr_device::set_gfx_region(*device, 4);
533   MCFG_DECO_SPRITE_GFX_REGION(4)
534534   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
535535   MCFG_DECO_SPRITE_PALETTE("palette")
536536
branches/new_menus/src/mame/drivers/supbtime.c
r29505r29506
350350   MCFG_DECO16IC_PALETTE("palette")
351351
352352   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
353   decospr_device::set_gfx_region(*device, 2);
353   MCFG_DECO_SPRITE_GFX_REGION(2)
354354   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
355355   MCFG_DECO_SPRITE_PALETTE("palette")
356356
r29505r29506
406406   MCFG_DECO16IC_PALETTE("palette")
407407
408408   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
409   decospr_device::set_gfx_region(*device, 2);
409   MCFG_DECO_SPRITE_GFX_REGION(2)
410410   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
411411   MCFG_DECO_SPRITE_PALETTE("palette")
412412
branches/new_menus/src/mame/drivers/topspeed.c
r29505r29506
369369   AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_SHARE("sharedram")
370370   AM_RANGE(0x500000, 0x503fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
371371   AM_RANGE(0x600002, 0x600003) AM_WRITE(cpua_ctrl_w)
372   AM_RANGE(0x7e0000, 0x7e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
373   AM_RANGE(0x7e0002, 0x7e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
372   AM_RANGE(0x7e0000, 0x7e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
373   AM_RANGE(0x7e0002, 0x7e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
374374   AM_RANGE(0x800000, 0x8003ff) AM_RAM AM_SHARE("raster_ctrl")
375375   AM_RANGE(0x800400, 0x80ffff) AM_RAM
376376   AM_RANGE(0x880000, 0x880007) AM_WRITENOP // Lamps/outputs?
r29505r29506
402402   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("sndbank")
403403   AM_RANGE(0x8000, 0x8fff) AM_RAM
404404   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
405   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
406   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
405   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
406   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
407407   AM_RANGE(0xb000, 0xcfff) AM_WRITE(msm5205_command_w)
408408   AM_RANGE(0xd000, 0xdfff) AM_WRITE(volume_w)
409409ADDRESS_MAP_END
r29505r29506
525525                     DEVICES
526526***********************************************************/
527527
528static const pc080sn_interface pc080sn_intf =
529{
530   1,          // gfxnum
531   0, 8, 0, 0  // x_offset, y_offset, y_invert, dblwidth
532};
533
534static const tc0140syt_interface tc0140syt_intf =
535{
536   "maincpu", "audiocpu"
537};
538
539528static Z80CTC_INTERFACE( ctc_intf )
540529{
541530   DEVCB_NULL, // Interrupt handler
r29505r29506
595584   MCFG_CPU_IO_MAP(z80_io)
596585
597586   MCFG_Z80CTC_ADD("ctc", XTAL_16MHz / 4, ctc_intf)
598   MCFG_PC080SN_ADD("pc080sn_1", pc080sn_intf)
587
588   MCFG_DEVICE_ADD("pc080sn_1", PC080SN, 0)
589   MCFG_PC080SN_GFX_REGION(1)
590   MCFG_PC080SN_OFFSETS(0, 8)
599591   MCFG_PC080SN_GFXDECODE("gfxdecode")
600592   MCFG_PC080SN_PALETTE("palette")
601   MCFG_PC080SN_ADD("pc080sn_2", pc080sn_intf)
593
594   MCFG_DEVICE_ADD("pc080sn_2", PC080SN, 0)
595   MCFG_PC080SN_GFX_REGION(1)
596   MCFG_PC080SN_OFFSETS(0, 8)
602597   MCFG_PC080SN_GFXDECODE("gfxdecode")
603598   MCFG_PC080SN_PALETTE("palette")
604   MCFG_TC0140SYT_ADD("tc0140syt", tc0140syt_intf)
599
600   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
601   MCFG_TC0140SYT_MASTER_CPU("maincpu")
602   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
603
605604   MCFG_DEVICE_ADD("tc0220ioc", TC0220IOC, 0)
606605   MCFG_TC0220IOC_READ_0_CB(IOPORT("DSWA"))
607606   MCFG_TC0220IOC_READ_1_CB(IOPORT("DSWB"))
branches/new_menus/src/mame/drivers/turbo.c
r29505r29506
454454   output_set_digit_value(m_i8279_scanlines * 2 + 1, ls48_map[(data>>4) & 0x0f]);
455455}
456456
457
458static I8279_INTERFACE( turbo_i8279_intf )
459{
460   DEVCB_NULL,                                     // irq
461   DEVCB_DRIVER_MEMBER(turbo_state, scanlines_w),  // scan SL lines
462   DEVCB_DRIVER_MEMBER(turbo_state, digit_w),      // display A&B
463   DEVCB_NULL,                                     // BD
464   DEVCB_INPUT_PORT("DSW1"),                       // kbd RL lines
465   DEVCB_NULL,                                     // Shift key
466   DEVCB_NULL                                      // Ctrl-Strobe line
467};
468
469
470
471457/*************************************
472458 *
473459 *  Misc Turbo inputs/outputs
r29505r29506
936922   MCFG_I8255_ADD( "i8255_2", turbo_8255_intf_2 )
937923   MCFG_I8255_ADD( "i8255_3", turbo_8255_intf_3 )
938924
939   MCFG_I8279_ADD("i8279", MASTER_CLOCK/4, turbo_i8279_intf)    // unknown clock
940
925   MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4)    // unknown clock
926   MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w))     // scan SL lines
927   MCFG_I8279_OUT_DISP_CB(WRITE8(turbo_state, digit_w))      // display A&B
928   MCFG_I8279_IN_RL_CB(IOPORT("DSW1"))                       // kbd RL lines
929   
941930   /* video hardware */
942931   MCFG_GFXDECODE_ADD("gfxdecode", "palette", turbo)
943932   MCFG_PALETTE_ADD("palette", 256)
r29505r29506
966955   MCFG_I8255_ADD( "i8255_0", subroc3d_8255_intf_0 )
967956   MCFG_I8255_ADD( "i8255_1", subroc3d_8255_intf_1 )
968957
969   MCFG_I8279_ADD("i8279", MASTER_CLOCK/4, turbo_i8279_intf)    // unknown clock
958   MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4)    // unknown clock
959   MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w))     // scan SL lines
960   MCFG_I8279_OUT_DISP_CB(WRITE8(turbo_state, digit_w))      // display A&B
961   MCFG_I8279_IN_RL_CB(IOPORT("DSW1"))                       // kbd RL lines
970962
971963   /* video hardware */
972964   MCFG_GFXDECODE_ADD("gfxdecode", "palette", turbo)
r29505r29506
1003995   MCFG_I8255_ADD( "i8255_0", buckrog_8255_intf_0 )
1004996   MCFG_I8255_ADD( "i8255_1", buckrog_8255_intf_1 )
1005997
1006   MCFG_I8279_ADD("i8279", MASTER_CLOCK/4, turbo_i8279_intf)    // unknown clock
998   MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4)    // unknown clock
999   MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w))     // scan SL lines
1000   MCFG_I8279_OUT_DISP_CB(WRITE8(turbo_state, digit_w))      // display A&B
1001   MCFG_I8279_IN_RL_CB(IOPORT("DSW1"))                       // kbd RL lines
10071002
10081003   /* video hardware */
10091004   MCFG_GFXDECODE_ADD("gfxdecode", "palette", turbo)
branches/new_menus/src/mame/drivers/rohga.c
r29505r29506
759759
760760/**********************************************************************************/
761761
762int rohga_state::bank_callback( int bank )
762DECO16IC_BANK_CB_MEMBER(rohga_state::bank_callback)
763763{
764764   return ((bank >> 4) & 0x3) << 12;
765765}
766766
767DECOSPR_PRIORITY_CB_MEMBER(rohga_state::rohga_pri_callback)
768{
769   switch (pri & 0x6000)
770   {
771      case 0x0000: return 0;
772      case 0x4000: return 0xf0;
773      case 0x6000: return 0xf0 | 0xcc;
774      case 0x2000: return 0;//0xf0|0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */
775   }
776   
777   return 0;
778}
779
780DECOSPR_COLOUR_CB_MEMBER(rohga_state::rohga_col_callback)
781{
782   return (col >> 9) & 0xf;
783}
784
785DECOSPR_COLOUR_CB_MEMBER(rohga_state::schmeisr_col_callback)
786{
787   UINT16 colour = ((col >> 9) & 0xf) << 2;
788   if (col & 0x8000)
789      colour++;
790   
791   return colour;
792}
793
767794static MACHINE_CONFIG_START( rohga, rohga_state )
768795
769796   /* basic machine hardware */
r29505r29506
788815   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rohga)
789816   MCFG_PALETTE_ADD("palette", 2048)
790817
791   MCFG_VIDEO_START_OVERRIDE(rohga_state,rohga)
792
793818   MCFG_DECOCOMN_ADD("deco_common")
794819   MCFG_DECOCOMN_PALETTE("palette")
795820
r29505r29506
826851   MCFG_DECO16IC_PALETTE("palette")
827852
828853   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
829   decospr_device::set_gfx_region(*device, 3);
854   MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback)
855   MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, rohga_col_callback)
856   MCFG_DECO_SPRITE_GFX_REGION(3)
830857   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
831858   MCFG_DECO_SPRITE_PALETTE("palette")
832859
r29505r29506
910937   MCFG_DECO16IC_PALETTE("palette")
911938
912939   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
913   decospr_device::set_gfx_region(*device, 3);
940   MCFG_DECO_SPRITE_GFX_REGION(3)
914941   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
915942   MCFG_DECO_SPRITE_PALETTE("palette")
916943
917944   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
918   decospr_device::set_gfx_region(*device, 4);
945   MCFG_DECO_SPRITE_GFX_REGION(4)
919946   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
920947   MCFG_DECO_SPRITE_PALETTE("palette")
921948
922949   MCFG_DECO104_ADD("ioprot104")
923950   MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
924951
925   MCFG_VIDEO_START_OVERRIDE(rohga_state,wizdfire)
952   MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
926953
927954   /* sound hardware */
928955   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r29505r29506
10021029   MCFG_DECO16IC_PALETTE("palette")
10031030
10041031   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
1005   decospr_device::set_gfx_region(*device, 3);
1032   MCFG_DECO_SPRITE_GFX_REGION(3)
10061033   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
10071034   MCFG_DECO_SPRITE_PALETTE("palette")
10081035
10091036   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
1010   decospr_device::set_gfx_region(*device, 4);
1037   MCFG_DECO_SPRITE_GFX_REGION(4)
10111038   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
10121039   MCFG_DECO_SPRITE_PALETTE("palette")
10131040
1014   MCFG_VIDEO_START_OVERRIDE(rohga_state,wizdfire)
1041   MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
10151042
10161043   MCFG_DECO146_ADD("ioprot")
10171044   MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
r29505r29506
10601087   MCFG_GFXDECODE_ADD("gfxdecode", "palette", schmeisr)
10611088   MCFG_PALETTE_ADD("palette", 2048)
10621089
1063   MCFG_VIDEO_START_OVERRIDE(rohga_state,schmeisr)
1064
10651090   MCFG_DECOCOMN_ADD("deco_common")
10661091   MCFG_DECOCOMN_PALETTE("palette")
10671092
r29505r29506
10981123   MCFG_DECO16IC_PALETTE("palette")
10991124
11001125   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
1101   decospr_device::set_gfx_region(*device, 3);
1126   MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback)
1127   MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, schmeisr_col_callback)   // wire mods on pcb...
1128   MCFG_DECO_SPRITE_GFX_REGION(3)
11021129   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
11031130   MCFG_DECO_SPRITE_PALETTE("palette")
11041131
branches/new_menus/src/mame/drivers/cham24.c
r29505r29506
291291   m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
292292}
293293
294/* our ppu interface                                            */
295static const ppu2c0x_interface ppu_interface =
296{
297   "maincpu",
298   0,                  /* gfxlayout num */
299   0,                  /* color base */
300   PPU_MIRROR_NONE     /* mirroring */
301};
302
303294void cham24_state::video_start()
304295{
305296}
r29505r29506
362353   MCFG_PALETTE_ADD("palette", 8*4*16)
363354   MCFG_PALETTE_INIT_OWNER(cham24_state, cham24)
364355
365   MCFG_PPU2C04_ADD("ppu", ppu_interface)
356   MCFG_PPU2C04_ADD("ppu")
357   MCFG_PPU2C0X_CPU("maincpu")
366358   MCFG_PPU2C0X_SET_NMI(cham24_state, ppu_irq)
367359
368360   /* sound hardware */
branches/new_menus/src/mame/drivers/mpu3.c
r29505r29506
8484MOD4- Some modifications on the PCB that didnt work, so field engineers reverted them to MOD3.
8585MOD5- board revision with bigger RAM and reset sensitivity circuit added on the PCB.
8686
87MOD6- adaption of the PCB to use small daughter card with 6116 RAM
87MOD6- adaptation of the PCB to use small daughter card with 6116 RAM
8888
8989Collectors have gone further with zero power RAM and the like, but these are the ones out in the wild.
9090
r29505r29506
850850   MCFG_CPU_ADD("maincpu", M6808, MPU3_MASTER_CLOCK)///4)
851851   MCFG_CPU_PROGRAM_MAP(mpu3_basemap)
852852
853   MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT)
853   MCFG_MSC1937_ADD("vfd",0)
854854
855855   MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu3_state, gen_50hz, attotime::from_hz(100))
856856   MCFG_TIMER_DRIVER_ADD_PERIODIC("555_ic10", mpu3_state, ic10_callback, PERIOD_OF_555_ASTABLE(10000,1000,0.0000001))
branches/new_menus/src/mame/drivers/boogwing.c
r29505r29506
296296}
297297
298298
299int boogwing_state::bank_callback( int bank )
299DECO16IC_BANK_CB_MEMBER(boogwing_state::bank_callback)
300300{
301301   return ((bank >> 4) & 0x7) * 0x1000;
302302}
303303
304int boogwing_state::bank_callback2( int bank )
304DECO16IC_BANK_CB_MEMBER(boogwing_state::bank_callback2)
305305{
306306   int offset = ((bank >> 4) & 0x7) * 0x1000;
307307   if ((bank & 0xf) == 0xa)
r29505r29506
371371   MCFG_DECO16IC_PALETTE("palette")
372372
373373   MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
374   decospr_device::set_gfx_region(*device, 3);
374   MCFG_DECO_SPRITE_GFX_REGION(3)
375375   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
376376   MCFG_DECO_SPRITE_PALETTE("palette")
377377
378378   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
379   decospr_device::set_gfx_region(*device, 4);
379   MCFG_DECO_SPRITE_GFX_REGION(4)
380380   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
381381   MCFG_DECO_SPRITE_PALETTE("palette")
382382
branches/new_menus/src/mame/drivers/mpu4hw.c
r29505r29506
26332633MACHINE_CONFIG_FRAGMENT( mpu4_common )
26342634   MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu4_state, gen_50hz, attotime::from_hz(100))
26352635
2636   MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT)
2636   MCFG_MSC1937_ADD("vfd",0)
26372637   /* 6840 PTM */
26382638   MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf)
26392639
branches/new_menus/src/mame/drivers/rungun.c
r29505r29506
330330};
331331
332332
333static const k053936_interface rng_k053936_intf =
334{
335   0, 34, 9
336};
337
338333static const k053247_interface rng_k055673_intf =
339334{
340335   "gfx2", 1,
r29505r29506
398393   MCFG_PALETTE_ENABLE_SHADOWS()
399394   MCFG_PALETTE_ENABLE_HILIGHTS()
400395
401   MCFG_K053936_ADD("k053936", rng_k053936_intf)
396   MCFG_DEVICE_ADD("k053936", K053936, 0)
397   MCFG_K053936_OFFSETS(34, 9)
398
402399   MCFG_K055673_ADD("k055673", rng_k055673_intf)
403400   MCFG_K055673_GFXDECODE("gfxdecode")
404401   MCFG_K055673_PALETTE("palette")
branches/new_menus/src/mame/drivers/mpu4sw.c
r29505r29506
990990GAME_CUSTOM( 199?, m4eaw__bv, m4eaw,  "eun01r.p1",                0x0000, 0x010000, CRC(15b8eb9e) SHA1(e4babaf526e6dd45bb4b7f7441a08cfbec12c661), "Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 95)" )
991991GAME_CUSTOM( 199?, m4eaw__bw, m4eaw,  "eun01s.p1",                0x0000, 0x010000, CRC(d0b49fc6) SHA1(4062d9763010d42666660e383e52818d572b61b9), "Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 96)" )
992992GAME_CUSTOM( 199?, m4eaw__bx, m4eaw,  "eun01y.p1",                0x0000, 0x010000, CRC(88d3c370) SHA1(6c3839a9c89ae67f80ab932ec70ebaf1240de9bb), "Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 97)" )
993GAME_CUSTOM( 199?, m4eaw__bz, m4eaw,  "everyones a winner v2-5p", 0x0000, 0x008000, CRC(eb8f2fc5) SHA1(0d3614bd5ff561d17bef0d1e620f2f812b8fed5b), "Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 99)" )
994993
994ROM_START( m4eaw__bz ) \
995   ROM_REGION( 0x010000, "maincpu", 0 )
996   ROM_LOAD( "everyones a winner v2-5p", 0x8000, 0x008000, CRC(eb8f2fc5) SHA1(0d3614bd5ff561d17bef0d1e620f2f812b8fed5b))
997   M4EAW_EXTRA_ROMS
998ROM_END
995999
1000GAME(199?, m4eaw__bz, m4eaw ,mod4oki ,mpu4 , mpu4_state,m4_showstring ,ROT0,"Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 99)",GAME_FLAGS )
1001
9961002#define M4WTA_EXTRA_ROMS \
9971003   ROM_REGION( 0x48, "fakechr", 0 ) \
9981004   ROM_LOAD( "wn5s.chr", 0x0000, 0x000048, CRC(b90e5068) SHA1(14c57dcd7242104eb48a9be36192170b97bc5110) ) \
branches/new_menus/src/mame/drivers/taito_f2.c
r29505r29506
689689   AM_RANGE(0x100000, 0x10ffff) AM_RAM
690690   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, word_w)    /* palette */
691691   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
692   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
693   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
692   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
693   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
694694   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
695695   AM_RANGE(0x810000, 0x81ffff) AM_WRITENOP   /* error in game init code ? */
696696   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
r29505r29506
703703   AM_RANGE(0x100000, 0x10ffff) AM_RAM
704704   AM_RANGE(0x200000, 0x201fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
705705   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
706   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
707   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
706   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
707   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
708708   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
709709   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
710710   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
715715
716716static ADDRESS_MAP_START( megab_map, AS_PROGRAM, 16, taitof2_state )
717717   AM_RANGE(0x000000, 0x07ffff) AM_ROM
718   AM_RANGE(0x100000, 0x100001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
719   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
718   AM_RANGE(0x100000, 0x100001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
719   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
720720   AM_RANGE(0x120000, 0x12000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
721721   AM_RANGE(0x180000, 0x180fff) AM_READWRITE(cchip2_word_r, cchip2_word_w) AM_SHARE("cchip2_ram")
722722   AM_RANGE(0x200000, 0x20ffff) AM_RAM
r29505r29506
732732   AM_RANGE(0x000000, 0x07ffff) AM_ROM
733733   AM_RANGE(0x100000, 0x101fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
734734   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
735   AM_RANGE(0x220000, 0x220001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
736   AM_RANGE(0x220002, 0x220003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
735   AM_RANGE(0x220000, 0x220001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
736   AM_RANGE(0x220002, 0x220003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
737737   AM_RANGE(0x300000, 0x30ffff) AM_RAM
738738   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("tc0100scn_1", tc0100scn_device, word_r, word_w)  /* tilemaps */
739739   AM_RANGE(0x420000, 0x42000f) AM_DEVREADWRITE("tc0100scn_1", tc0100scn_device, ctrl_word_r, ctrl_word_w)
r29505r29506
749749   AM_RANGE(0x200000, 0x201fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
750750   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
751751   AM_RANGE(0x300018, 0x30001f) AM_READ(cameltry_paddle_r)
752   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
753   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
752   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
753   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
754754   AM_RANGE(0x800000, 0x813fff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
755755   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
756756   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
764764   AM_RANGE(0x100000, 0x10ffff) AM_RAM
765765   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, word_w)    /* palette */
766766   AM_RANGE(0x500000, 0x50000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
767   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
768   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
767   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
768   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
769769   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
770770   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
771771   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
777777   AM_RANGE(0x100000, 0x10ffff) AM_RAM
778778   AM_RANGE(0x200000, 0x201fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
779779   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
780   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
781   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
780   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
781   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
782782   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
783783   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
784784   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
797797   AM_RANGE(0x580000, 0x580001) AM_READ_PORT("DSWA")
798798   AM_RANGE(0x580002, 0x580003) AM_READ_PORT("IN1")
799799   AM_RANGE(0x580004, 0x580005) AM_READ_PORT("IN2")
800   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
801   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
800   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
801   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
802802   AM_RANGE(0x680000, 0x680001) AM_WRITENOP   /* ??? */
803803   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
804804   AM_RANGE(0x810000, 0x81ffff) AM_WRITENOP   /* error in init code ? */
r29505r29506
811811   AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w)
812812   AM_RANGE(0x200000, 0x20ffff) AM_RAM
813813   AM_RANGE(0x300000, 0x301fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
814   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
815   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
814   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
815   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
816816//  AM_RANGE(0x500000, 0x500001) AM_WRITENOP   /* ?? */
817817   AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps (not used) */
818818   AM_RANGE(0x620000, 0x62000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
r29505r29506
824824   AM_RANGE(0x100000, 0x10ffff) AM_RAM
825825   AM_RANGE(0x200000, 0x201fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
826826   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_wordswap_r, halfword_wordswap_w)
827   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
828   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
827   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
828   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
829829   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
830830   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
831831   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
844844   AM_RANGE(0x320002, 0x320003) AM_READ_PORT("IN1")
845845   AM_RANGE(0x320004, 0x320005) AM_READ_PORT("IN2")
846846   AM_RANGE(0x340000, 0x340001) AM_WRITE(watchdog_reset16_w)
847   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
848   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
847   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
848   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
849849   AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w)
850850   AM_RANGE(0x504000, 0x504001) AM_WRITENOP    /* unknown... various values */
851851   AM_RANGE(0x508000, 0x50800f) AM_READ_PORT("IN3")
r29505r29506
866866   AM_RANGE(0x320000, 0x320001) AM_WRITE(mjnquest_inputselect_w)
867867   AM_RANGE(0x330000, 0x330001) AM_WRITENOP   /* watchdog ? */
868868   AM_RANGE(0x350000, 0x350001) AM_WRITENOP   /* watchdog ? */
869   AM_RANGE(0x360000, 0x360001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
870   AM_RANGE(0x360002, 0x360003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
869   AM_RANGE(0x360000, 0x360001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
870   AM_RANGE(0x360002, 0x360003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
871871   AM_RANGE(0x380000, 0x380001) AM_DEVWRITE("tc0100scn", tc0100scn_device, gfxbank_w)   /* scr gfx bank select */
872872   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
873873   AM_RANGE(0x420000, 0x42000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
r29505r29506
892892   AM_RANGE(0x70000e, 0x70000f) AM_READ_PORT("IN3")
893893   AM_RANGE(0x700010, 0x700011) AM_READ_PORT("IN4")
894894   AM_RANGE(0x800000, 0x800001) AM_WRITE(watchdog_reset16_w)   /* ??? */
895   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
896   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
895   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
896   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
897897ADDRESS_MAP_END
898898
899899static ADDRESS_MAP_START( koshien_map, AS_PROGRAM, 16, taitof2_state )
r29505r29506
901901   AM_RANGE(0x100000, 0x10ffff) AM_RAM
902902   AM_RANGE(0x200000, 0x201fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
903903   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w)
904   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
905   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
904   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
905   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
906906   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
907907   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
908908   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
913913static ADDRESS_MAP_START( yuyugogo_map, AS_PROGRAM, 16, taitof2_state )
914914   AM_RANGE(0x000000, 0x03ffff) AM_ROM
915915   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w)
916   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
917   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
916   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
917   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
918918   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
919919   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
920920   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
931931   AM_RANGE(0x300000, 0x30000f) AM_READ(ninjak_input_r)
932932   AM_RANGE(0x30000e, 0x30000f) AM_WRITE(ninjak_coin_word_w)
933933   AM_RANGE(0x380000, 0x380001) AM_WRITE(watchdog_reset16_w)   /* ??? */
934   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
935   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
934   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
935   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
936936   AM_RANGE(0x600000, 0x60000f) AM_WRITE(taitof2_spritebank_w)
937937   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
938938   AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
r29505r29506
951951   AM_RANGE(0x320002, 0x320003) AM_READ_PORT("IN1")
952952   AM_RANGE(0x320004, 0x320005) AM_READ_PORT("IN2")
953953   AM_RANGE(0x340000, 0x340001) AM_WRITE(watchdog_reset16_w)   /* NOT VERIFIED */
954   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
955   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
954   AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
955   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
956956   AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w)
957957   AM_RANGE(0x504000, 0x504001) AM_WRITENOP    /* unknown... various values */
958958   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
r29505r29506
964964static ADDRESS_MAP_START( qzquest_map, AS_PROGRAM, 16, taitof2_state )
965965   AM_RANGE(0x000000, 0x17ffff) AM_ROM
966966   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w)
967   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
968   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
967   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
968   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
969969   AM_RANGE(0x400000, 0x401fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
970970   AM_RANGE(0x500000, 0x50ffff) AM_RAM
971971   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
975975
976976static ADDRESS_MAP_START( pulirula_map, AS_PROGRAM, 16, taitof2_state )
977977   AM_RANGE(0x000000, 0x0bffff) AM_ROM
978   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
979   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
978   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
979   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
980980   AM_RANGE(0x300000, 0x30ffff) AM_RAM
981981   AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE("tc0430grw", tc0280grd_device, tc0430grw_word_r, tc0430grw_word_w)    /* ROZ tilemap */
982982   AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE("tc0430grw", tc0280grd_device, tc0430grw_ctrl_word_w)
r29505r29506
10001000   AM_RANGE(0x600000, 0x60001f) AM_DEVWRITE8("tc0360pri", tc0360pri_device, write, 0x00ff)
10011001   AM_RANGE(0x700000, 0x703fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
10021002   AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_wordswap_r, halfword_wordswap_w)
1003   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1004   AM_RANGE(0x900002, 0x900003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1003   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
1004   AM_RANGE(0x900002, 0x900003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
10051005//  AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP   /* ??? */
10061006ADDRESS_MAP_END
10071007
10081008static ADDRESS_MAP_START( qzchikyu_map, AS_PROGRAM, 16, taitof2_state )
10091009   AM_RANGE(0x000000, 0x17ffff) AM_ROM
10101010   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w)
1011   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
1012   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
1011   AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
1012   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
10131013   AM_RANGE(0x400000, 0x401fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
10141014   AM_RANGE(0x500000, 0x50ffff) AM_RAM
10151015   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
10251025   AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
10261026   AM_RANGE(0x600000, 0x601fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
10271027//  AM_RANGE(0x700000, 0x70000b) AM_READ(yesnoj_unknown_r)   /* what's this? */
1028   AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1029   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1028   AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
1029   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
10301030   AM_RANGE(0x900002, 0x900003) AM_WRITENOP   /* lots of similar writes */
10311031   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("IN0")
10321032   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("IN1")
r29505r29506
10531053   AM_RANGE(0x70000a, 0x70000b) AM_READ_PORT("IN0")
10541054   AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("IN1")
10551055   AM_RANGE(0x800000, 0x800001) AM_WRITE(watchdog_reset16_w)   /* ??? */
1056   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1057   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1056   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
1057   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
10581058ADDRESS_MAP_END
10591059
10601060static ADDRESS_MAP_START( dinorex_map, AS_PROGRAM, 16, taitof2_state )
r29505r29506
10671067   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("spriteram")
10681068   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
10691069   AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
1070   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1071   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1070   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
1071   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
10721072   AM_RANGE(0xb00000, 0xb00001) AM_WRITENOP   /* watchdog? */
10731073ADDRESS_MAP_END
10741074
10751075static ADDRESS_MAP_START( qjinsei_map, AS_PROGRAM, 16, taitof2_state )
10761076   AM_RANGE(0x000000, 0x1fffff) AM_ROM
1077   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1078   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1077   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
1078   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
10791079   AM_RANGE(0x300000, 0x30ffff) AM_RAM
10801080   AM_RANGE(0x500000, 0x500001) AM_WRITENOP   /* watchdog ? */
10811081   AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext")
r29505r29506
10921092   AM_RANGE(0x100000, 0x10ffff) AM_RAM
10931093//  AM_RANGE(0x200000, 0x200001) AM_WRITENOP   /* unknown */
10941094   AM_RANGE(0x300000, 0x3fffff) AM_ROM AM_REGION("extra", 0)   /* extra data rom */
1095   AM_RANGE(0x500000, 0x500001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1096   AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1095   AM_RANGE(0x500000, 0x500001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
1096   AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
10971097   AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext")
10981098   AM_RANGE(0x700000, 0x701fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
10991099   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("spriteram")
r29505r29506
11131113   AM_RANGE(0x600000, 0x67ffff) AM_ROM AM_REGION("extra", 0)   /* extra data rom */
11141114   AM_RANGE(0x700000, 0x70000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w)
11151115   AM_RANGE(0x900000, 0x90001f) AM_DEVWRITE8("tc0360pri", tc0360pri_device, write, 0x00ff)  /* ?? */
1116   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1117   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1116   AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
1117   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
11181118   AM_RANGE(0xb00000, 0xb017ff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext")
11191119ADDRESS_MAP_END
11201120
11211121static ADDRESS_MAP_START( driftout_map, AS_PROGRAM, 16, taitof2_state )
11221122   AM_RANGE(0x000000, 0x0fffff) AM_ROM
1123   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
1124   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
1123   AM_RANGE(0x200000, 0x200001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
1124   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
11251125   AM_RANGE(0x300000, 0x30ffff) AM_RAM
11261126   AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE("tc0430grw", tc0280grd_device, tc0430grw_word_r, tc0430grw_word_w)    /* ROZ tilemap */
11271127   AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE("tc0430grw", tc0280grd_device, tc0430grw_ctrl_word_w)
r29505r29506
11601160   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2")
11611161   AM_RANGE(0xc000, 0xdfff) AM_RAM
11621162   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
1163   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
1164   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
1163   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
1164   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
11651165   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
11661166   AM_RANGE(0xea00, 0xea00) AM_READNOP
11671167   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
11761176   AM_RANGE(0x0000, 0x7fff) AM_ROM     // I can't see a bank control, but there ARE some bytes past 0x8000
11771177   AM_RANGE(0x8000, 0x8fff) AM_RAM
11781178   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
1179   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
1180   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
1179   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
1180   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
11811181//  AM_RANGE(0xb000, 0xb000) AM_WRITE(unknown_w)    // probably controlling sample player?
11821182   AM_RANGE(0xb000, 0xb001) AM_MIRROR(0x0001) AM_DEVREADWRITE("oki", okim6295_device, read, write)
11831183ADDRESS_MAP_END
r29505r29506
28332833                      MACHINE DRIVERS
28342834***********************************************************/
28352835
2836static const tc0100scn_interface taitof2_tc0100scn_intf =
2837{
2838   1, 2,       /* gfxnum, txnum */
2839   0, 0,       /* x_offset, y_offset */
2840   0, 0,       /* flip_xoff, flip_yoff */
2841   0, 0,       /* flip_text_xoff, flip_text_yoff */
2842   0, 0
2843};
2844
2845static const tc0100scn_interface liquidk_tc0100scn_intf =
2846{
2847   1, 2,       /* gfxnum, txnum */
2848   3, 0,       /* x_offset, y_offset */
2849   0, 0,       /* flip_xoff, flip_yoff */
2850   0, 0,       /* flip_text_xoff, flip_text_yoff */
2851   0, 0
2852};
2853
2854static const tc0100scn_interface dondokod_tc0100scn_intf =
2855{
2856   1, 3,       /* gfxnum, txnum */
2857   3, 0,       /* x_offset, y_offset */
2858   0, 0,       /* flip_xoff, flip_yoff */
2859   0, 0,       /* flip_text_xoff, flip_text_yoff */
2860   0, 0
2861};
2862
2863static const tc0100scn_interface finalb_tc0100scn_intf =
2864{
2865   1, 2,       /* gfxnum, txnum */
2866   1, 0,       /* x_offset, y_offset */
2867   0, 0,       /* flip_xoff, flip_yoff */
2868   0, 0,       /* flip_text_xoff, flip_text_yoff */
2869   0, 0
2870};
2871
2872#if 0
2873static const tc0100scn_interface ninjak_tc0100scn_intf =
2874{
2875   1, 2,       /* gfxnum, txnum */
2876   0, 0,       /* x_offset, y_offset */
2877   0, 0,       /* flip_xoff, flip_yoff */
2878   1, 2,       /* flip_text_xoff, flip_text_yoff */
2879   0, 0
2880};
2881#endif
2882
2883static const tc0100scn_interface qzchikyu_tc0100scn_intf =
2884{
2885   1, 2,       /* gfxnum, txnum */
2886   0, 0,       /* x_offset, y_offset */
2887   -4, 0,      /* flip_xoff, flip_yoff */
2888   -11, 0,     /* flip_text_xoff, flip_text_yoff */
2889   0, 0
2890};
2891
2892static const tc0100scn_interface solfigtr_tc0100scn_intf =
2893{
2894   1, 2,       /* gfxnum, txnum */
2895   3, 0,       /* x_offset, y_offset */
2896   6, 0,       /* flip_xoff, flip_yoff */
2897   6, 0,       /* flip_text_xoff, flip_text_yoff */
2898   0, 0
2899};
2900
2901static const tc0100scn_interface koshien_tc0100scn_intf =
2902{
2903   1, 2,       /* gfxnum, txnum */
2904   1, 0,       /* x_offset, y_offset */
2905   2, 0,       /* flip_xoff, flip_yoff */
2906   0, 0,       /* flip_text_xoff, flip_text_yoff */
2907   0, 0
2908};
2909
2910static const tc0100scn_interface thundfox_tc0100scn_intf_1 =
2911{
2912   1, 3,       /* gfxnum, txnum */
2913   3, 0,       /* x_offset, y_offset */
2914   5, 0,       /* flip_xoff, flip_yoff */
2915   4, 1,       /* flip_text_xoff, flip_text_yoff */
2916   0, 0
2917};
2918
2919static const tc0100scn_interface thundfox_tc0100scn_intf_2 =
2920{
2921   2, 4,       /* gfxnum, txnum */
2922   3, 0,       /* x_offset, y_offset */
2923   5, 0,       /* flip_xoff, flip_yoff */
2924   4, 1,       /* flip_text_xoff, flip_text_yoff */
2925   TC0100SCN_SINGLE_VDU, 1
2926};
2927
2928static const tc0480scp_interface footchmp_tc0480scp_intf =
2929{
2930   1, 2,       /* gfxnum, txnum */
2931   3,      /* pixels */
2932   0x1d, 0x08,     /* x_offset, y_offset */
2933   -1, 0,      /* text_xoff, text_yoff */
2934   -1, 0,      /* flip_xoff, flip_yoff */
2935   0       /* col_base */
2936};
2937
2938static const tc0480scp_interface hthero_tc0480scp_intf =
2939{
2940   1, 2,       /* gfxnum, txnum */
2941   3,      /* pixels */
2942   0x33, -0x04,        /* x_offset, y_offset */
2943   -1, 0,      /* text_xoff, text_yoff */
2944   -1, 0,      /* flip_xoff, flip_yoff */
2945   0       /* col_base */
2946};
2947
2948static const tc0480scp_interface deadconx_tc0480scp_intf =
2949{
2950   1, 2,       /* gfxnum, txnum */
2951   3,      /* pixels */
2952   0x1e, 0x08,     /* x_offset, y_offset */
2953   -1, 0,      /* text_xoff, text_yoff */
2954   -1, 0,      /* flip_xoff, flip_yoff */
2955   0       /* col_base */
2956};
2957
2958static const tc0480scp_interface deadconxj_tc0480scp_intf =
2959{
2960   1, 2,       /* gfxnum, txnum */
2961   3,      /* pixels */
2962   0x34, -0x05,        /* x_offset, y_offset */
2963   -1, 0,      /* text_xoff, text_yoff */
2964   -1, 0,      /* flip_xoff, flip_yoff */
2965   0       /* col_base */
2966};
2967
2968static const tc0480scp_interface metalb_tc0480scp_intf =
2969{
2970   1, 2,       /* gfxnum, txnum */
2971   3,      /* pixels */
2972   0x32, -0x04,        /* x_offset, y_offset */
2973   1, 0,       /* text_xoff, text_yoff */
2974   -1, 0,      /* flip_xoff, flip_yoff */
2975   256     /* col_base */
2976};
2977
2978
2979static const tc0280grd_interface taitof2_tc0280grd_intf = { 2 };
2980static const tc0280grd_interface taitof2_tc0430grw_intf = { 2 };
2981
2982static const tc0140syt_interface taitof2_tc0140syt_intf =
2983{
2984   "maincpu", "audiocpu"
2985};
2986
29872836MACHINE_START_MEMBER(taitof2_state,common)
29882837{
29892838}
r29505r29506
30312880   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
30322881   MCFG_SOUND_ROUTE(2, "rspeaker", 1.0)
30332882
3034   MCFG_TC0140SYT_ADD("tc0140syt", taitof2_tc0140syt_intf)
2883   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2884   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2885   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
30352886MACHINE_CONFIG_END
30362887
30372888static MACHINE_CONFIG_DERIVED( taito_f2_tc0220ioc, taito_f2 )
r29505r29506
30732924   MCFG_SCREEN_MODIFY("screen")
30742925   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed)
30752926
3076   MCFG_TC0100SCN_ADD("tc0100scn", finalb_tc0100scn_intf)
2927   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
2928   MCFG_TC0100SCN_GFX_REGION(1)
2929   MCFG_TC0100SCN_TX_REGION(2)
2930   MCFG_TC0100SCN_OFFSETS(1, 0)
30772931   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
30782932   MCFG_TC0100SCN_PALETTE("palette")
30792933
r29505r29506
30952949   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed)
30962950   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri_roz)
30972951
3098   MCFG_TC0100SCN_ADD("tc0100scn", dondokod_tc0100scn_intf)
2952   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
2953   MCFG_TC0100SCN_GFX_REGION(1)
2954   MCFG_TC0100SCN_TX_REGION(3)
2955   MCFG_TC0100SCN_OFFSETS(3, 0)
30992956   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
31002957   MCFG_TC0100SCN_PALETTE("palette")
31012958
3102   MCFG_TC0280GRD_ADD("tc0280grd", taitof2_tc0280grd_intf)
2959   MCFG_DEVICE_ADD("tc0280grd", TC0280GRD, 0)
2960   MCFG_TC0280GRD_GFX_REGION(2)
31032961   MCFG_TC0280GRD_GFXDECODE("gfxdecode");
2962
31042963   MCFG_TC0360PRI_ADD("tc0360pri")
31052964MACHINE_CONFIG_END
31062965
r29505r29506
31162975   MCFG_SCREEN_MODIFY("screen")
31172976   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
31182977
3119   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
2978   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
2979   MCFG_TC0100SCN_GFX_REGION(1)
2980   MCFG_TC0100SCN_TX_REGION(2)
2981   MCFG_TC0100SCN_OFFSETS(3, 0)
31202982   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
31212983   MCFG_TC0100SCN_PALETTE("palette")
31222984
r29505r29506
31372999   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_thundfox)
31383000   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed_thundfox)
31393001
3140   MCFG_TC0100SCN_ADD("tc0100scn_1", thundfox_tc0100scn_intf_1)
3002   MCFG_DEVICE_ADD("tc0100scn_1", TC0100SCN, 0)
3003   MCFG_TC0100SCN_GFX_REGION(1)
3004   MCFG_TC0100SCN_TX_REGION(3)
3005   MCFG_TC0100SCN_OFFSETS(3, 0)
3006   MCFG_TC0100SCN_OFFSETS_FLIP(5, 0)
3007   MCFG_TC0100SCN_OFFSETS_FLIPTX(4, 1)
31413008   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
31423009   MCFG_TC0100SCN_PALETTE("palette")
31433010
3144   MCFG_TC0100SCN_ADD("tc0100scn_2", thundfox_tc0100scn_intf_2)
3011   MCFG_DEVICE_ADD("tc0100scn_2", TC0100SCN, 0)
3012   MCFG_TC0100SCN_GFX_REGION(2)
3013   MCFG_TC0100SCN_TX_REGION(4)
3014   MCFG_TC0100SCN_OFFSETS(3, 0)
3015   MCFG_TC0100SCN_OFFSETS_FLIP(5, 0)
3016   MCFG_TC0100SCN_OFFSETS_FLIPTX(4, 1)
3017   MCFG_TC0100SCN_MULTISCR_XOFFS(TC0100SCN_SINGLE_VDU)
3018   MCFG_TC0100SCN_MULTISCR_HACK(1)
31453019   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
31463020   MCFG_TC0100SCN_PALETTE("palette")
31473021
r29505r29506
31613035   MCFG_SCREEN_MODIFY("screen")
31623036   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri_roz)
31633037
3164   MCFG_TC0100SCN_ADD("tc0100scn", dondokod_tc0100scn_intf)
3038   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3039   MCFG_TC0100SCN_GFX_REGION(1)
3040   MCFG_TC0100SCN_TX_REGION(3)
3041   MCFG_TC0100SCN_OFFSETS(3, 0)
31653042   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
31663043   MCFG_TC0100SCN_PALETTE("palette")
31673044
3168   MCFG_TC0280GRD_ADD("tc0280grd", taitof2_tc0280grd_intf)
3045   MCFG_DEVICE_ADD("tc0280grd", TC0280GRD, 0)
3046   MCFG_TC0280GRD_GFX_REGION(2)
31693047   MCFG_TC0280GRD_GFXDECODE("gfxdecode");
3048
31703049   MCFG_TC0360PRI_ADD("tc0360pri")
31713050MACHINE_CONFIG_END
31723051
r29505r29506
31823061   MCFG_SCREEN_MODIFY("screen")
31833062   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed)
31843063
3185   MCFG_TC0100SCN_ADD("tc0100scn", taitof2_tc0100scn_intf)
3064   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3065   MCFG_TC0100SCN_GFX_REGION(1)
3066   MCFG_TC0100SCN_TX_REGION(2)
31863067   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
31873068   MCFG_TC0100SCN_PALETTE("palette")
31883069
r29505r29506
32033084   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
32043085   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed)
32053086
3206   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3087   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3088   MCFG_TC0100SCN_GFX_REGION(1)
3089   MCFG_TC0100SCN_TX_REGION(2)
3090   MCFG_TC0100SCN_OFFSETS(3, 0)
32073091   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
32083092   MCFG_TC0100SCN_PALETTE("palette")
32093093
r29505r29506
32223106   MCFG_SCREEN_MODIFY("screen")
32233107   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed)
32243108
3225   MCFG_TC0100SCN_ADD("tc0100scn", taitof2_tc0100scn_intf)
3109   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3110   MCFG_TC0100SCN_GFX_REGION(1)
3111   MCFG_TC0100SCN_TX_REGION(2)
32263112   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
32273113   MCFG_TC0100SCN_PALETTE("palette")
32283114
r29505r29506
32463132   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_ssi)
32473133   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed_thundfox)
32483134
3249   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3135   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3136   MCFG_TC0100SCN_GFX_REGION(1)
3137   MCFG_TC0100SCN_TX_REGION(2)
3138   MCFG_TC0100SCN_OFFSETS(3, 0)
32503139   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
32513140   MCFG_TC0100SCN_PALETTE("palette")
32523141MACHINE_CONFIG_END
r29505r29506
32673156   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
32683157   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed)
32693158
3270   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3159   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3160   MCFG_TC0100SCN_GFX_REGION(1)
3161   MCFG_TC0100SCN_TX_REGION(2)
3162   MCFG_TC0100SCN_OFFSETS(3, 0)
32713163   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
32723164   MCFG_TC0100SCN_PALETTE("palette")
32733165
r29505r29506
32863178   MCFG_SCREEN_MODIFY("screen")
32873179   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
32883180
3289   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3181   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3182   MCFG_TC0100SCN_GFX_REGION(1)
3183   MCFG_TC0100SCN_TX_REGION(2)
3184   MCFG_TC0100SCN_OFFSETS(3, 0)
32903185   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
32913186   MCFG_TC0100SCN_PALETTE("palette")
32923187
r29505r29506
33033198   /* video hardware */
33043199   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_mjnquest)
33053200
3306   MCFG_TC0100SCN_ADD("tc0100scn", taitof2_tc0100scn_intf)
3201   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3202   MCFG_TC0100SCN_GFX_REGION(1)
3203   MCFG_TC0100SCN_TX_REGION(2)
33073204   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
33083205   MCFG_TC0100SCN_PALETTE("palette")
33093206
r29505r29506
33253222   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_deadconx)
33263223   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_full_buffer_delayed)
33273224
3328   MCFG_TC0480SCP_ADD("tc0480scp", footchmp_tc0480scp_intf)
3225   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
3226   MCFG_TC0480SCP_GFX_REGION(1)
3227   MCFG_TC0480SCP_TX_REGION(2)
3228   MCFG_TC0480SCP_OFFSETS(0x1d + 3, 0x08)
3229   MCFG_TC0480SCP_OFFSETS_TX(-1, 0)
3230   MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0)
33293231   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
33303232   MCFG_TC0480SCP_PALETTE("palette")
33313233
r29505r29506
33533255   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_full_buffer_delayed)
33543256
33553257   MCFG_TC0360PRI_ADD("tc0360pri")
3356   MCFG_TC0480SCP_ADD("tc0480scp", hthero_tc0480scp_intf)
3258
3259   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
3260   MCFG_TC0480SCP_GFX_REGION(1)
3261   MCFG_TC0480SCP_TX_REGION(2)
3262   MCFG_TC0480SCP_OFFSETS(0x33 + 3, -0x04)
3263   MCFG_TC0480SCP_OFFSETS_TX(-1, 0)
3264   MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0)
33573265   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
33583266   MCFG_TC0480SCP_PALETTE("palette")
33593267MACHINE_CONFIG_END
r29505r29506
33723280   MCFG_SCREEN_MODIFY("screen")
33733281   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
33743282
3375   MCFG_TC0100SCN_ADD("tc0100scn", koshien_tc0100scn_intf)
3283   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3284   MCFG_TC0100SCN_GFX_REGION(1)
3285   MCFG_TC0100SCN_TX_REGION(2)
3286   MCFG_TC0100SCN_OFFSETS(1, 0)
3287   MCFG_TC0100SCN_OFFSETS_FLIP(2, 0)
33763288   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
33773289   MCFG_TC0100SCN_PALETTE("palette")
33783290
r29505r29506
33953307   MCFG_SCREEN_MODIFY("screen")
33963308   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_yesnoj)
33973309
3398   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3310   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3311   MCFG_TC0100SCN_GFX_REGION(1)
3312   MCFG_TC0100SCN_TX_REGION(2)
3313   MCFG_TC0100SCN_OFFSETS(3, 0)
33993314   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
34003315   MCFG_TC0100SCN_PALETTE("palette")
34013316MACHINE_CONFIG_END
r29505r29506
34123327   MCFG_SCREEN_MODIFY("screen")
34133328   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
34143329
3415   MCFG_TC0100SCN_ADD("tc0100scn", finalb_tc0100scn_intf)
3330   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3331   MCFG_TC0100SCN_GFX_REGION(1)
3332   MCFG_TC0100SCN_TX_REGION(2)
3333   MCFG_TC0100SCN_OFFSETS(1, 0)
34163334   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
34173335   MCFG_TC0100SCN_PALETTE("palette")
34183336
r29505r29506
34313349   MCFG_SCREEN_MODIFY("screen")
34323350   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri)
34333351
3434   MCFG_TC0100SCN_ADD("tc0100scn", solfigtr_tc0100scn_intf)
3352   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3353   MCFG_TC0100SCN_GFX_REGION(1)
3354   MCFG_TC0100SCN_TX_REGION(2)
3355   MCFG_TC0100SCN_OFFSETS(3, 0)
3356   MCFG_TC0100SCN_OFFSETS_FLIP(6, 0)
3357   MCFG_TC0100SCN_OFFSETS_FLIPTX(6, 0)
34353358   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
34363359   MCFG_TC0100SCN_PALETTE("palette")
34373360
r29505r29506
34493372   MCFG_SCREEN_MODIFY("screen")
34503373   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed)
34513374
3452   MCFG_TC0100SCN_ADD("tc0100scn", taitof2_tc0100scn_intf)
3375   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3376   MCFG_TC0100SCN_GFX_REGION(1)
3377   MCFG_TC0100SCN_TX_REGION(2)
34533378   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
34543379   MCFG_TC0100SCN_PALETTE("palette")
34553380MACHINE_CONFIG_END
r29505r29506
34673392   MCFG_SCREEN_MODIFY("screen")
34683393   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri_roz)
34693394
3470   MCFG_TC0100SCN_ADD("tc0100scn", dondokod_tc0100scn_intf)
3395   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3396   MCFG_TC0100SCN_GFX_REGION(1)
3397   MCFG_TC0100SCN_TX_REGION(3)
3398   MCFG_TC0100SCN_OFFSETS(3, 0)
34713399   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
34723400   MCFG_TC0100SCN_PALETTE("palette")
34733401
3474   MCFG_TC0430GRW_ADD("tc0430grw", taitof2_tc0430grw_intf)
3402   MCFG_DEVICE_ADD("tc0430grw", TC0430GRW, 0)
3403   MCFG_TC0430GRW_GFX_REGION(2)
34753404   MCFG_TC0430GRW_GFXDECODE("gfxdecode")
3405
34763406   MCFG_TC0360PRI_ADD("tc0360pri")
34773407MACHINE_CONFIG_END
34783408
r29505r29506
34923422   MCFG_SCREEN_MODIFY("screen")
34933423   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_metalb)
34943424
3495   MCFG_TC0480SCP_ADD("tc0480scp", metalb_tc0480scp_intf)
3425   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
3426   MCFG_TC0480SCP_GFX_REGION(1)
3427   MCFG_TC0480SCP_TX_REGION(2)
3428   MCFG_TC0480SCP_OFFSETS(0x32 + 3, -0x04)
3429   MCFG_TC0480SCP_OFFSETS_TX(1, 0)
3430   MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0)
3431   MCFG_TC0480SCP_COL_BASE(256)
34963432   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
34973433   MCFG_TC0480SCP_PALETTE("palette")
34983434
r29505r29506
35113447   MCFG_SCREEN_MODIFY("screen")
35123448   MCFG_SCREEN_VBLANK_DRIVER(taitof2_state, screen_eof_taitof2_partial_buffer_delayed_qzchikyu)
35133449
3514   MCFG_TC0100SCN_ADD("tc0100scn", qzchikyu_tc0100scn_intf)
3450   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3451   MCFG_TC0100SCN_GFX_REGION(1)
3452   MCFG_TC0100SCN_TX_REGION(2)
3453   MCFG_TC0100SCN_OFFSETS(0, 0)
3454   MCFG_TC0100SCN_OFFSETS_FLIP(-4, 0)
3455   MCFG_TC0100SCN_OFFSETS_FLIPTX(-11, 0)
35153456   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
35163457   MCFG_TC0100SCN_PALETTE("palette")
35173458MACHINE_CONFIG_END
r29505r29506
35293470   MCFG_SCREEN_MODIFY("screen")
35303471   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_yesnoj)
35313472
3532   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3473   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3474   MCFG_TC0100SCN_GFX_REGION(1)
3475   MCFG_TC0100SCN_TX_REGION(2)
3476   MCFG_TC0100SCN_OFFSETS(3, 0)
35333477   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
35343478   MCFG_TC0100SCN_PALETTE("palette")
35353479MACHINE_CONFIG_END
r29505r29506
35473491   MCFG_SCREEN_MODIFY("screen")
35483492   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_deadconx)
35493493
3550   MCFG_TC0480SCP_ADD("tc0480scp", deadconx_tc0480scp_intf)
3494   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
3495   MCFG_TC0480SCP_GFX_REGION(1)
3496   MCFG_TC0480SCP_TX_REGION(2)
3497   MCFG_TC0480SCP_OFFSETS(0x1e + 3, 0x08)
3498   MCFG_TC0480SCP_OFFSETS_TX(-1, 0)
3499   MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0)
35513500   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
35523501   MCFG_TC0480SCP_PALETTE("palette")
35533502
r29505r29506
35673516   MCFG_SCREEN_MODIFY("screen")
35683517   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_deadconx)
35693518
3570   MCFG_TC0480SCP_ADD("tc0480scp", deadconxj_tc0480scp_intf)
3519   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
3520   MCFG_TC0480SCP_GFX_REGION(1)
3521   MCFG_TC0480SCP_TX_REGION(2)
3522   MCFG_TC0480SCP_OFFSETS(0x34 + 3, -0x05)
3523   MCFG_TC0480SCP_OFFSETS_TX(-1, 0)
3524   MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0)
35713525   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
35723526   MCFG_TC0480SCP_PALETTE("palette")
35733527
r29505r29506
35893543   MCFG_PALETTE_MODIFY("palette")
35903544   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
35913545
3592   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3546   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3547   MCFG_TC0100SCN_GFX_REGION(1)
3548   MCFG_TC0100SCN_TX_REGION(2)
3549   MCFG_TC0100SCN_OFFSETS(3, 0)
35933550   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
35943551   MCFG_TC0100SCN_PALETTE("palette")
35953552
r29505r29506
36113568   MCFG_PALETTE_MODIFY("palette")
36123569   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
36133570
3614   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3571   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3572   MCFG_TC0100SCN_GFX_REGION(1)
3573   MCFG_TC0100SCN_TX_REGION(2)
3574   MCFG_TC0100SCN_OFFSETS(3, 0)
36153575   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
36163576   MCFG_TC0100SCN_PALETTE("palette")
36173577
r29505r29506
36333593   MCFG_PALETTE_MODIFY("palette")
36343594   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
36353595
3636   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3596   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3597   MCFG_TC0100SCN_GFX_REGION(1)
3598   MCFG_TC0100SCN_TX_REGION(2)
3599   MCFG_TC0100SCN_OFFSETS(3, 0)
36373600   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
36383601   MCFG_TC0100SCN_PALETTE("palette")
36393602
r29505r29506
36553618   MCFG_PALETTE_MODIFY("palette")
36563619   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
36573620
3658   MCFG_TC0100SCN_ADD("tc0100scn", liquidk_tc0100scn_intf)
3621   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3622   MCFG_TC0100SCN_GFX_REGION(1)
3623   MCFG_TC0100SCN_TX_REGION(2)
3624   MCFG_TC0100SCN_OFFSETS(3, 0)
36593625   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
36603626   MCFG_TC0100SCN_PALETTE("palette")
36613627
r29505r29506
36753641   MCFG_SCREEN_MODIFY("screen")
36763642   MCFG_SCREEN_UPDATE_DRIVER(taitof2_state, screen_update_taitof2_pri_roz)
36773643
3678   MCFG_TC0100SCN_ADD("tc0100scn", dondokod_tc0100scn_intf)
3644   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3645   MCFG_TC0100SCN_GFX_REGION(1)
3646   MCFG_TC0100SCN_TX_REGION(3)
3647   MCFG_TC0100SCN_OFFSETS(3, 0)
36793648   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
36803649   MCFG_TC0100SCN_PALETTE("palette")
36813650
3682   MCFG_TC0430GRW_ADD("tc0430grw", taitof2_tc0430grw_intf)
3651   MCFG_DEVICE_ADD("tc0430grw", TC0430GRW, 0)
3652   MCFG_TC0430GRW_GFX_REGION(2)
36833653   MCFG_TC0430GRW_GFXDECODE("gfxdecode")
3654
36843655   MCFG_TC0360PRI_ADD("tc0360pri")
36853656MACHINE_CONFIG_END
36863657
r29505r29506
37203691
37213692   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_dondokod)
37223693
3723   MCFG_TC0100SCN_ADD("tc0100scn", dondokod_tc0100scn_intf)
3694   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3695   MCFG_TC0100SCN_GFX_REGION(1)
3696   MCFG_TC0100SCN_TX_REGION(3)
3697   MCFG_TC0100SCN_OFFSETS(3, 0)
37243698   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
37253699   MCFG_TC0100SCN_PALETTE("palette")
37263700
3727   MCFG_TC0280GRD_ADD("tc0280grd", taitof2_tc0280grd_intf)
3701   MCFG_DEVICE_ADD("tc0280grd", TC0280GRD, 0)
3702   MCFG_TC0280GRD_GFX_REGION(2)
37283703   MCFG_TC0280GRD_GFXDECODE("gfxdecode");
3704
37293705   MCFG_TC0360PRI_ADD("tc0360pri")
37303706
37313707   /* sound hardware */
r29505r29506
37423718   MCFG_OKIM6295_ADD("oki", XTAL_4_224MHz/4, OKIM6295_PIN7_HIGH) /* verified on pcb */
37433719   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
37443720
3745   MCFG_TC0140SYT_ADD("tc0140syt", taitof2_tc0140syt_intf)
3721   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3722   MCFG_TC0140SYT_MASTER_CPU("maincpu")
3723   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
37463724MACHINE_CONFIG_END
37473725
37483726
r29505r29506
37813759
37823760   MCFG_VIDEO_START_OVERRIDE(taitof2_state,taitof2_driftout)
37833761
3784   MCFG_TC0100SCN_ADD("tc0100scn", dondokod_tc0100scn_intf)
3762   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3763   MCFG_TC0100SCN_GFX_REGION(1)
3764   MCFG_TC0100SCN_TX_REGION(3)
3765   MCFG_TC0100SCN_OFFSETS(3, 0)
37853766   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
37863767   MCFG_TC0100SCN_PALETTE("palette")
37873768
3788   MCFG_TC0430GRW_ADD("tc0430grw", taitof2_tc0430grw_intf)
3769   MCFG_DEVICE_ADD("tc0430grw", TC0430GRW, 0)
3770   MCFG_TC0430GRW_GFX_REGION(2)
37893771   MCFG_TC0430GRW_GFXDECODE("gfxdecode")
3772
37903773   MCFG_TC0360PRI_ADD("tc0360pri")
37913774
37923775   /* sound hardware */
r29505r29506
37963779   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
37973780   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
37983781
3799   MCFG_TC0140SYT_ADD("tc0140syt", taitof2_tc0140syt_intf)
3782   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3783   MCFG_TC0140SYT_MASTER_CPU("maincpu")
3784   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
38003785MACHINE_CONFIG_END
38013786
38023787
branches/new_menus/src/mame/drivers/djboy.c
r29505r29506
501501      m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
502502}
503503
504static const kaneko_pandora_interface djboy_pandora_config =
505{
506   0,  /* gfx_region */
507   0, 0    /* x_offs, y_offs */
508};
509
510
511504void djboy_state::machine_start()
512505{
513506   UINT8 *MAIN = memregion("maincpu")->base();
r29505r29506
584577   MCFG_GFXDECODE_ADD("gfxdecode", "palette", djboy)
585578   MCFG_PALETTE_ADD("palette", 0x200)
586579
587   MCFG_KANEKO_PANDORA_ADD("pandora", djboy_pandora_config)
580   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
588581   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
589582   MCFG_KANEKO_PANDORA_PALETTE("palette")
590583
branches/new_menus/src/mame/drivers/groundfx.c
r29505r29506
324324                 MACHINE DRIVERS
325325***********************************************************/
326326
327static const tc0100scn_interface groundfx_tc0100scn_intf =
328{
329   2, 3,       /* gfxnum, txnum */
330   50, 8,      /* x_offset, y_offset */
331   0, 0,       /* flip_xoff, flip_yoff */
332   0, 0,       /* flip_text_xoff, flip_text_yoff */
333   0, 0
334};
335
336static const tc0480scp_interface groundfx_tc0480scp_intf =
337{
338   1, 4,       /* gfxnum, txnum */
339   0,      /* pixels */
340   0x24, 0,        /* x_offset, y_offset */
341   -1, 0,      /* text_xoff, text_yoff */
342   0, 0,       /* flip_xoff, flip_yoff */
343   0       /* col_base */
344};
345
346327INTERRUPT_GEN_MEMBER(groundfx_state::groundfx_interrupt)
347328{
348329   m_frame_counter^=1;
r29505r29506
370351   MCFG_GFXDECODE_ADD("gfxdecode", "palette", groundfx)
371352   MCFG_PALETTE_ADD("palette", 16384)
372353
373
374   MCFG_TC0100SCN_ADD("tc0100scn", groundfx_tc0100scn_intf)
354   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
355   MCFG_TC0100SCN_GFX_REGION(2)
356   MCFG_TC0100SCN_TX_REGION(3)
357   MCFG_TC0100SCN_OFFSETS(50, 8)
375358   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
376359   MCFG_TC0100SCN_PALETTE("palette")
377   MCFG_TC0480SCP_ADD("tc0480scp", groundfx_tc0480scp_intf)
360
361   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
362   MCFG_TC0480SCP_GFX_REGION(1)
363   MCFG_TC0480SCP_TX_REGION(4)
364   MCFG_TC0480SCP_OFFSETS(0x24, 0)
365   MCFG_TC0480SCP_OFFSETS_TX(-1, 0)
378366   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
379367   MCFG_TC0480SCP_PALETTE("palette")
380368
branches/new_menus/src/mame/drivers/multigam.c
r29505r29506
11551155   m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
11561156}
11571157
1158/* our ppu interface                                            */
1159static const ppu2c0x_interface ppu_interface =
1160{
1161   "maincpu",
1162   0,                  /* gfxlayout num */
1163   0,                  /* color base */
1164   PPU_MIRROR_NONE     /* mirroring */
1165};
1166
11671158void multigam_state::video_start()
11681159{
11691160}
r29505r29506
12631254   MCFG_PALETTE_ADD("palette", 8*4*16)
12641255   MCFG_PALETTE_INIT_OWNER(multigam_state, multigam)
12651256
1266   MCFG_PPU2C04_ADD("ppu", ppu_interface)
1257   MCFG_PPU2C04_ADD("ppu")
1258   MCFG_PPU2C0X_CPU("maincpu")
12671259   MCFG_PPU2C0X_SET_NMI(multigam_state, ppu_irq)
12681260
12691261   /* sound hardware */
branches/new_menus/src/mame/drivers/cbuster.c
r29505r29506
258258
259259/******************************************************************************/
260260
261int cbuster_state::bank_callback( int bank )
261DECO16IC_BANK_CB_MEMBER(cbuster_state::bank_callback)
262262{
263263   return ((bank >> 4) & 0x7) * 0x1000;
264264}
r29505r29506
330330   MCFG_DECO16IC_PALETTE("palette")
331331
332332   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
333   decospr_device::set_gfx_region(*device, 3);
333   MCFG_DECO_SPRITE_GFX_REGION(3)
334334   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
335335   MCFG_DECO_SPRITE_PALETTE("palette")
336336
branches/new_menus/src/mame/drivers/tmnt.c
r29505r29506
20852085   thndrx2_sprite_callback
20862086};
20872087
2088
2089/* 053936 interfaces */
2090static const k053936_interface glfgreat_k053936_interface =
2091{
2092   1, 85, 0        /* wrap, xoff, yoff */
2093};
2094
2095static const k053936_interface prmrsocr_k053936_interface =
2096{
2097   0, 85, 1        /* wrap, xoff, yoff */
2098};
2099
2100
21012088MACHINE_START_MEMBER(tmnt_state,common)
21022089{
21032090   save_item(NAME(m_toggle));
r29505r29506
24962483   MCFG_K053245_ADD("k053245", glfgreat_k05324x_intf)
24972484   MCFG_K053245_GFXDECODE("gfxdecode")
24982485   MCFG_K053245_PALETTE("palette")
2499   MCFG_K053936_ADD("k053936", glfgreat_k053936_interface)
2486
2487   MCFG_DEVICE_ADD("k053936", K053936, 0)
2488   MCFG_K053936_WRAP(1)
2489   MCFG_K053936_OFFSETS(85, 0)
2490
25002491   MCFG_K053251_ADD("k053251")
25012492
25022493   /* sound hardware */
r29505r29506
25622553   MCFG_K053245_ADD("k053245", prmrsocr_k05324x_intf)
25632554   MCFG_K053245_GFXDECODE("gfxdecode")
25642555   MCFG_K053245_PALETTE("palette")
2565   MCFG_K053936_ADD("k053936", prmrsocr_k053936_interface)
2556
2557   MCFG_DEVICE_ADD("k053936", K053936, 0)
2558   MCFG_K053936_OFFSETS(85, 1)
2559
25662560   MCFG_K053251_ADD("k053251")
25672561
25682562   /* sound hardware */
branches/new_menus/src/mame/drivers/backfire.c
r29505r29506
9696   UINT32 screen_update_backfire_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9797   INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
9898   void descramble_sound();
99   int bank_callback(int bank);
100
99   DECO16IC_BANK_CB_MEMBER(bank_callback);
100   DECOSPR_PRIORITY_CB_MEMBER(pri_callback);
101                     
101102   required_ioport m_io_in0;
102103   required_ioport m_io_in1;
103104   required_ioport m_io_in2;
r29505r29506
447448}
448449
449450
450
451int backfire_state::bank_callback( int bank )
451DECO16IC_BANK_CB_MEMBER(backfire_state::bank_callback)
452452{
453453   //  mame_printf_debug("bank callback %04x\n",bank); // bit 1 gets set too?
454454   bank = bank >> 4;
r29505r29506
457457   return bank * 0x1000;
458458}
459459
460void backfire_state::machine_start()
460DECOSPR_PRIORITY_CB_MEMBER(backfire_state::pri_callback)
461461{
462}
463
464UINT16 backfire_pri_callback(UINT16 x)
465{
466   switch (x & 0xc000)
462   switch (pri & 0xc000)
467463   {
468464      case 0x0000: return 0;    // numbers, people, cars when in the air, status display..
469465      case 0x4000: return 0xf0; // cars most of the time
r29505r29506
473469   return 0;
474470}
475471
472void backfire_state::machine_start()
473{
474}
475
476476static MACHINE_CONFIG_START( backfire, backfire_state )
477477
478478   /* basic machine hardware */
r29505r29506
540540
541541   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
542542   MCFG_VIDEO_SET_SCREEN("lscreen")
543   decospr_device::set_gfx_region(*device, 4);
544   decospr_device::set_pri_callback(*device, backfire_pri_callback);
543   MCFG_DECO_SPRITE_GFX_REGION(4)
544   MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback)
545545   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
546546   MCFG_DECO_SPRITE_PALETTE("palette")
547547
548548   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
549549   MCFG_VIDEO_SET_SCREEN("rscreen")
550   decospr_device::set_gfx_region(*device, 5);
551   decospr_device::set_pri_callback(*device, backfire_pri_callback);
550   MCFG_DECO_SPRITE_GFX_REGION(5)
551   MCFG_DECO_SPRITE_PRIORITY_CB(backfire_state, pri_callback)
552552   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
553553   MCFG_DECO_SPRITE_PALETTE("palette")
554554
branches/new_menus/src/mame/drivers/proconn.c
r29505r29506
3030#include "sound/ay8910.h"
3131#include "video/awpvid.h"
3232#include "machine/roc10937.h"
33#include "machine/meters.h"
3334
3435#include "proconn.lh"
3536
r29505r29506
5051         m_ay(*this, "aysnd")
5152   { }
5253
53   optional_device<roc10937_t> m_vfd;
54   optional_device<s16lf01_t> m_vfd;
5455
5556   DECLARE_WRITE8_MEMBER( ay_w0 ) { m_ay->address_data_w(space, 0, data); }
5657   DECLARE_WRITE8_MEMBER( ay_w1 ) { m_ay->address_data_w(space, 1, data); }
r29505r29506
186187   required_device<z80sio_device> m_z80sio;
187188   required_device<ay8910_device> m_ay;
188189public:
190   int m_meter;
189191   DECLARE_DRIVER_INIT(proconn);
190192   virtual void machine_reset();
193   DECLARE_WRITE8_MEMBER(meter_w);
191194   DECLARE_WRITE16_MEMBER(serial_transmit);
192195   DECLARE_READ16_MEMBER(serial_receive);
193196};
r29505r29506
343346
344347READ16_MEMBER(proconn_state::serial_receive)
345348{
349   logerror("proconn serial receive read %x",offset);
346350   return -1;
347351}
348352
r29505r29506
357361   DEVCB_DRIVER_MEMBER16(proconn_state,serial_receive)     /* receive handler */
358362};
359363
364WRITE8_MEMBER(proconn_state::meter_w)
365{
366   int i;
367   for (i=0; i<8; i++)
368   {
369      if ( data & (1 << i) )
370      {
371         MechMtr_update(i, data & (1 << i) );
372         m_meter = data;
373      }
374   }
375}
376
360377static const ay8910_interface ay8910_config =
361378{
362379   AY8910_LEGACY_OUTPUT,
363380   AY8910_DEFAULT_LOADS,
364381   DEVCB_NULL,
365   DEVCB_NULL
382   DEVCB_NULL,
383   DEVCB_DRIVER_MEMBER(proconn_state,meter_w),
366384};
367385
368386
r29505r29506
383401   MCFG_CPU_CONFIG(z80_daisy_chain)
384402   MCFG_CPU_PROGRAM_MAP(proconn_map)
385403   MCFG_CPU_IO_MAP(proconn_portmap)
386   MCFG_ROC10937_ADD("vfd",0,LEFT_TO_RIGHT)
404   MCFG_S16LF01_ADD("vfd",0)
387405
388406   MCFG_Z80PIO_ADD( "z80pio_1", 4000000, pio_interface_1 ) /* ?? Mhz */
389407   MCFG_Z80PIO_ADD( "z80pio_2", 4000000, pio_interface_2 ) /* ?? Mhz */
branches/new_menus/src/mame/drivers/taito_x.c
r29505r29506
414414   AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* written each frame at $3aa2, mostly 0x10 */
415415   AM_RANGE(0x500000, 0x500007) AM_READ(superman_dsw_input_r)
416416   AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* written each frame at $3ab0, mostly 0x10 */
417   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
418   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
417   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
418   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
419419   AM_RANGE(0x900000, 0x9007ff) AM_READWRITE(cchip1_ram_r, cchip1_ram_w)
420420   AM_RANGE(0x900802, 0x900803) AM_READWRITE(cchip1_ctrl_r, cchip1_ctrl_w)
421421   AM_RANGE(0x900c00, 0x900c01) AM_WRITE(cchip1_bank_w)
r29505r29506
431431//  AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* written each frame at $2ac, values change */
432432   AM_RANGE(0x500000, 0x50000f) AM_READ(superman_dsw_input_r)
433433//  AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* written each frame at $2a2, values change */
434   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
435   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
434   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
435   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
436436   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
437437   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
438438   AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spriteylow_r16, spriteylow_w16) // Sprites Y
r29505r29506
446446   AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* 0x1 written each frame at $d42, watchdog? */
447447   AM_RANGE(0x500000, 0x500007) AM_READ(superman_dsw_input_r)
448448   AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* 0x1 written each frame at $d3c, watchdog? */
449   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
450   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
449   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
450   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
451451   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
452452   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
453453   AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spriteylow_r16, spriteylow_w16) // Sprites Y
r29505r29506
461461   AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* 0x1 written each frame at $c56, watchdog? */
462462   AM_RANGE(0x500000, 0x50000f) AM_READ(superman_dsw_input_r)
463463   AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* 0x1 written each frame at $c4e, watchdog? */
464   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
465   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
464   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
465   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
466466   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
467467   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
468468   AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spriteylow_r16, spriteylow_w16) // Sprites Y
r29505r29506
479479   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2")
480480   AM_RANGE(0xc000, 0xdfff) AM_RAM
481481   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
482   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
483   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
482   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
483   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
484484   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
485485   AM_RANGE(0xea00, 0xea00) AM_READNOP
486486   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
493493   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank2")
494494   AM_RANGE(0xc000, 0xdfff) AM_RAM
495495   AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
496   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
497   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
496   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
497   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
498498   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
499499   AM_RANGE(0xea00, 0xea00) AM_READNOP
500500   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
796796   save_item(NAME(m_cc_port));
797797}
798798
799static const tc0140syt_interface taitox_tc0140syt_intf =
800{
801   "maincpu", "audiocpu"
802};
803
804
805799/**************************************************************************/
806800
807801static MACHINE_CONFIG_START( superman, taitox_state )
r29505r29506
847841   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
848842   MCFG_SOUND_ROUTE(2, "rspeaker", 1.0)
849843
850   MCFG_TC0140SYT_ADD("tc0140syt", taitox_tc0140syt_intf)
844   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
845   MCFG_TC0140SYT_MASTER_CPU("maincpu")
846   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
851847MACHINE_CONFIG_END
852848
853849static MACHINE_CONFIG_START( daisenpu, taitox_state )
r29505r29506
891887   MCFG_SOUND_ROUTE(0, "lspeaker", 0.45)
892888   MCFG_SOUND_ROUTE(1, "rspeaker", 0.45)
893889
894   MCFG_TC0140SYT_ADD("tc0140syt", taitox_tc0140syt_intf)
890   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
891   MCFG_TC0140SYT_MASTER_CPU("maincpu")
892   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
895893MACHINE_CONFIG_END
896894
897895static MACHINE_CONFIG_START( gigandes, taitox_state )
r29505r29506
937935   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
938936   MCFG_SOUND_ROUTE(2, "rspeaker", 1.0)
939937
940   MCFG_TC0140SYT_ADD("tc0140syt", taitox_tc0140syt_intf)
938   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
939   MCFG_TC0140SYT_MASTER_CPU("maincpu")
940   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
941941MACHINE_CONFIG_END
942942
943943static MACHINE_CONFIG_START( ballbros, taitox_state )
r29505r29506
983983   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
984984   MCFG_SOUND_ROUTE(2, "rspeaker", 1.0)
985985
986   MCFG_TC0140SYT_ADD("tc0140syt", taitox_tc0140syt_intf)
986   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
987   MCFG_TC0140SYT_MASTER_CPU("maincpu")
988   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
987989MACHINE_CONFIG_END
988990
989991
branches/new_menus/src/mame/drivers/tumblep.c
r29505r29506
314314   MCFG_DECO16IC_PALETTE("palette")
315315
316316   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
317   decospr_device::set_gfx_region(*device, 2);
317   MCFG_DECO_SPRITE_GFX_REGION(2)
318318   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
319319   MCFG_DECO_SPRITE_PALETTE("palette")
320320
branches/new_menus/src/mame/drivers/maygay1b.c
r29505r29506
6868            3x trimmer
6969
7070
71        TODO: Convert to stock i8279 implementation, as currently inputs aren't read.
72              Fix meter reading (possibly related to above)
71        TODO: I/O is generally a nightmare, probably needs a rebuild at the address level.
72           Inputs need a sort out.
73           Some games require dongles for security, need to figure this out.
7374******************************************************************************************/
7475#include "emu.h"
7576#include "includes/maygay1b.h"
7677
7778#include "maygay1b.lh"
7879
79
80void maygay1b_state::m1_draw_lamps(int data,int strobe, int col)
81{
82   int i;
83
84   for ( i = 0; i < 8; i++ )
85   {
86      m_lamppos = (strobe*8) + col + i;
87
88      if ((data>>i)&1)
89         m_Lamps[m_lamppos] = 1;
90      else
91         m_Lamps[m_lamppos] = 0;
92
93      output_set_lamp_value(m_lamppos, m_Lamps[m_lamppos]);
94   }
95}
96
97
98/*************************************
99 *
100 *  8279 display/keyboard driver
101 *
102 *************************************/
103
104void maygay1b_state::update_outputs(i8279_state *chip, UINT16 which)
105{
106   static const UINT8 ls48_map[16] =
107      { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 };
108   int i;
109
110   /* update the items in the bitmask */
111   for (i = 0; i < 16; i++)
112      if (which & (1 << i))
113      {
114         int val;
115
116         val = chip->ram[i] & 0x0f;
117         if (chip->inhibit & 0x01)
118            val = chip->clear & 0x0f;
119         output_set_digit_value(i * 2 + 0, ls48_map[val]);
120
121         val = chip->ram[i] >> 4;
122         if (chip->inhibit & 0x02)
123            val = chip->clear >> 4;
124         output_set_digit_value(i * 2 + 1, ls48_map[val]);
125      }
126}
127
128READ8_MEMBER(maygay1b_state::m1_8279_r)
129{
130   i8279_state *chip = m_i8279 + 0;
131   static const char *const portnames[] = { "SW1","STROBE5","STROBE7","STROBE3","SW2","STROBE4","STROBE6","STROBE2" };
132   UINT8 result = 0xff;
133   UINT8 addr;
134
135   /* read data */
136   if ((offset & 1) == 0)
137   {
138      switch (chip->command & 0xe0)
139      {
140         /* read sensor RAM */
141         case 0x40:
142            addr = chip->command & 0x07;
143            result = ioport("SW1")->read();
144            /* handle autoincrement */
145            if (chip->command & 0x10)
146               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
147
148            break;
149
150
151         /* read display RAM */
152         case 0x60:
153
154            /* set the value of the corresponding outputs */
155            addr = chip->command & 0x0f;
156            result = chip->ram[addr];
157
158            /* handle autoincrement */
159            if (chip->command & 0x10)
160               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
161            break;
162      }
163   }
164
165   /* read status word */
166   else
167   {
168      if ( chip->read_sensor )
169      {
170      result = ioport(portnames[chip->sense_address])->read();
171//          break
172      }
173      if ( chip->sense_auto_inc )
174      {
175         chip->sense_address = (chip->sense_address + 1 ) & 7;
176      }
177      else
178      {
179         result = chip->ram[chip->disp_address];
180         if ( chip->disp_auto_inc )
181         chip->disp_address++;
182      }
183   }
184   return result;
185}
186
187WRITE8_MEMBER(maygay1b_state::m1_8279_w)
188{
189   i8279_state *chip = m_i8279 + 0;
190   UINT8 addr;
191
192   /* write data */
193   if ((offset & 1) == 0)
194   {
195      switch (chip->command & 0xe0)
196      {
197         /* write display RAM */
198         case 0x80:
199
200            /* set the value of the corresponding outputs */
201            addr = chip->command & 0x0f;
202            if (!(chip->inhibit & 0x04))
203               chip->ram[addr] = (chip->ram[addr] & 0xf0) | (data & 0x0f);
204            if (!(chip->inhibit & 0x08))
205               chip->ram[addr] = (chip->ram[addr] & 0x0f) | (data & 0xf0);
206            update_outputs(chip, 1 << addr);
207
208            /* handle autoincrement */
209            if (chip->command & 0x10)
210               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
211            break;
212      }
213   }
214
215   /* write command */
216   else
217   {
218      chip->command = data;
219
220      switch (data & 0xe0)
221      {
222         /* command 0: set mode */
223         /*
224             Display modes:
225
226             00 = 8 x 8-bit character display -- left entry
227             01 = 16 x 8-bit character display -- left entry
228             10 = 8 x 8-bit character display -- right entry
229             11 = 16 x 8-bit character display -- right entry
230
231             Keyboard modes:
232
233             000 = Encoded scan keyboard -- 2 key lockout
234             001 = Decoded scan keyboard -- 2 key lockout
235             010 = Encoded scan keyboard -- N-key rollover
236             011 = Decoded scan keyboard -- N-key rollover
237             100 = Encoded scan sensor matrix
238             101 = Decoded scan sensor matrix
239             110 = Strobed input, encoded display scan
240             111 = Strobed input, decoded display scan
241         */
242         case 0x00:
243            logerror("8279A: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7);
244            chip->mode = data & 0x1f;
245            break;
246
247         /* command 1: program clock */
248         case 0x20:
249            logerror("8279A: clock prescaler set to %02X\n", data & 0x1f);
250            chip->prescale = data & 0x1f;
251            break;
252
253         /* command 2: read FIFO/sensor RAM */
254         case 0x40:
255            chip->sense_address = data & 0x07;
256            chip->sense_auto_inc = data & 0x10;
257            chip->read_sensor = 1;
258            break;
259         /* command 3: read display RAM */
260         case 0x60:
261            chip->disp_address = data & 0x0f;
262            chip->disp_auto_inc = data & 0x10;
263            chip->read_sensor = 0;
264            break;
265         /* command 4: write display RAM */
266         case 0x80:
267            chip->disp_address = data & 0x0f;
268            chip->disp_auto_inc = data & 0x10;
269            chip->write_display = 1;
270            break;
271
272         /* command 5: display write inhibit/blanking */
273         case 0xa0:
274            chip->inhibit = data & 0x0f;
275            update_outputs(chip, 0);
276            logerror("8279: clock prescaler set to %02X\n", data & 0x1f);
277            break;
278
279            break;
280
281         /* command 6: clear */
282         case 0xc0:
283            chip->clear = (data & 0x08) ? ((data & 0x04) ? 0xff : 0x20) : 0x00;
284            if (data & 0x11)
285               memset(chip->ram, chip->clear, sizeof(chip->ram));
286            break;
287
288         /* command 7: end interrupt/error mode set */
289         case 0xe0:
290            break;
291      }
292   }
293   if ( chip->write_display )
294   {  // Data
295      assert(chip->disp_address < ARRAY_LENGTH(chip->ram));
296      if ( chip->ram[chip->disp_address] != data )
297      {
298         m1_draw_lamps(chip->ram[chip->disp_address],chip->disp_address, 0);
299      }
300      chip->ram[chip->disp_address] = data;
301
302      if ( chip->disp_auto_inc )
303         chip->disp_address ++;
304   }
305}
306
307READ8_MEMBER(maygay1b_state::m1_8279_2_r)
308{
309   i8279_state *chip = m_i8279 + 1;
310   UINT8 result = 0xff;
311   UINT8 addr;
312
313   /* read data */
314   if ((offset & 1) == 0)
315   {
316      switch (chip->command & 0xe0)
317      {
318         /* read sensor RAM */
319         case 0x40:
320            //result = ~ioport("DSW1")->read();  /* DSW 1 - inverted! */
321            break;
322
323         /* read display RAM */
324         case 0x60:
325
326            /* set the value of the corresponding outputs */
327            addr = chip->command & 0x0f;
328            result = chip->ram[addr];
329
330            /* handle autoincrement */
331            if (chip->command & 0x10)
332               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
333            break;
334      }
335   }
336
337   /* read status word */
338   else
339   {
340      logerror("read 0xfc%02x\n", offset);
341      result = 0x10;
342   }
343   return result;
344}
345
346
347WRITE8_MEMBER(maygay1b_state::m1_8279_2_w)
348{
349   i8279_state *chip = m_i8279 + 1;
350   UINT8 addr;
351
352   /* write data */
353   if ((offset & 1) == 0)
354   {
355      switch (chip->command & 0xe0)
356      {
357         /* write display RAM */
358         case 0x80:
359
360            /* set the value of the corresponding outputs */
361            addr = chip->command & 0x0f;
362            if (!(chip->inhibit & 0x04))
363               chip->ram[addr] = (chip->ram[addr] & 0xf0) | (data & 0x0f);
364            if (!(chip->inhibit & 0x08))
365               chip->ram[addr] = (chip->ram[addr] & 0x0f) | (data & 0xf0);
366            update_outputs(chip, 1 << addr);
367
368            /* handle autoincrement */
369            if (chip->command & 0x10)
370               chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
371            break;
372      }
373   }
374
375   /* write command */
376   else
377   {
378      chip->command = data;
379
380      switch (data & 0xe0)
381      {
382         /* command 0: set mode */
383         /*
384             Display modes:
385
386             00 = 8 x 8-bit character display -- left entry
387             01 = 16 x 8-bit character display -- left entry
388             10 = 8 x 8-bit character display -- right entry
389             11 = 16 x 8-bit character display -- right entry
390
391             Keyboard modes:
392
393             000 = Encoded scan keyboard -- 2 key lockout
394             001 = Decoded scan keyboard -- 2 key lockout
395             010 = Encoded scan keyboard -- N-key rollover
396             011 = Decoded scan keyboard -- N-key rollover
397             100 = Encoded scan sensor matrix
398             101 = Decoded scan sensor matrix
399             110 = Strobed input, encoded display scan
400             111 = Strobed input, decoded display scan
401         */
402         case 0x00:
403            logerror("8279A: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7);
404            chip->mode = data & 0x1f;
405            break;
406
407         /* command 1: program clock */
408         case 0x20:
409            logerror("8279A: clock prescaler set to %02X\n", data & 0x1f);
410            chip->prescale = data & 0x1f;
411            break;
412
413         /* command 2: read FIFO/sensor RAM */
414         case 0x40:
415            chip->sense_address = data & 0x07;
416            chip->sense_auto_inc = data & 0x10;
417            chip->read_sensor = 1;
418            break;
419         /* command 3: read display RAM */
420         case 0x60:
421            chip->disp_address = data & 0x0f;
422            chip->disp_auto_inc = data & 0x10;
423            chip->read_sensor = 0;
424            break;
425         /* command 4: write display RAM */
426         case 0x80:
427            chip->disp_address = data & 0x0f;
428            chip->disp_auto_inc = data & 0x10;
429            chip->write_display = 1;
430            break;
431
432         /* command 5: display write inhibit/blanking */
433         case 0xa0:
434            break;
435
436         /* command 6: clear */
437         case 0xc0:
438            break;
439
440         /* command 7: end interrupt/error mode set */
441         case 0xe0:
442            break;
443      }
444   }
445   if ( chip->write_display )
446   {  // Data
447      if ( chip->ram[chip->disp_address] != data )
448      {
449         m1_draw_lamps(chip->ram[chip->disp_address],chip->disp_address, 128);
450      }
451      chip->ram[chip->disp_address] = data;
452      if ( chip->disp_auto_inc )
453         chip->disp_address ++;
454   }
455
456}
457
45880///////////////////////////////////////////////////////////////////////////
45981// called if board is reset ///////////////////////////////////////////////
46082///////////////////////////////////////////////////////////////////////////
r29505r29506
495117   return i;
496118}
497119
120READ8_MEMBER( maygay1b_state::m1_firq_clr_r )
121{
122   static int i = 0xff;
123   i ^= 0xff;
124   m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
125   LOG(("6809 firq clr\n"));
126   return i;
127}
128
498129// NMI is periodic? or triggered by a write?
499130TIMER_DEVICE_CALLBACK_MEMBER( maygay1b_state::maygay1b_nmitimer_callback )
500131{
r29505r29506
784415
785416READ8_MEMBER(maygay1b_state::m1_meter_r)
786417{
787   //ay8910_device *ay8910 = machine().device<ay8910_device>("aysnd");
788   //return ay8910->data_r(space, offset);
789
790   //TODO: Game should read the meter state through Port A of the AY chip, but our timings aren't good enough (?)
418   //TODO: Can we just return the AY port A data?
791419   return m_meter;
792420}
421WRITE8_MEMBER(maygay1b_state::m1_lockout_w)
422{
423   int i;
424   for (i=0; i<6; i++)
425   {
426      coin_lockout_w(machine(), i, data & (1 << i) );
427   }
428}
793429
794430static ADDRESS_MAP_START( m1_memmap, AS_PROGRAM, 8, maygay1b_state )
795431   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram")
r29505r29506
798434   AM_RANGE(0x2010, 0x2010) AM_WRITE(reel34_w)
799435   AM_RANGE(0x2020, 0x2020) AM_WRITE(reel56_w)
800436
801   // there is actually an 8279 and an 8051..
802   AM_RANGE(0x2030, 0x2031) AM_READWRITE(m1_8279_r,m1_8279_w)
803   AM_RANGE(0x2040, 0x2041) AM_READWRITE(m1_8279_2_r,m1_8279_2_w)
437   // there is actually an 8279 and an 8051 (which I guess is the MCU?).
438   AM_RANGE(0x2030, 0x2030) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w )
439   AM_RANGE(0x2031, 0x2031) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w)
440
441   //8051
442   AM_RANGE(0x2040, 0x2040) AM_DEVREADWRITE("i8279_2", i8279_device, data_r, data_w )
443   AM_RANGE(0x2041, 0x2041) AM_DEVREADWRITE("i8279_2", i8279_device, status_r, cmd_w)
804444//  AM_RANGE(0x2050, 0x2050)// SCAN on M1B
805445
806446   AM_RANGE(0x2070, 0x207f) AM_DEVREADWRITE("duart68681", mc68681_device, read, write )
r29505r29506
817457   AM_RANGE(0x2404, 0x2405) AM_READ(latch_st_lo)
818458   AM_RANGE(0x2406, 0x2407) AM_READ(latch_st_hi)
819459
460   AM_RANGE(0x2410, 0x2410) AM_READ(m1_firq_clr_r)
461
820462   AM_RANGE(0x2412, 0x2412) AM_READ(m1_firq_trg_r) // firq, sample playback?
821463
822464   AM_RANGE(0x2420, 0x2421) AM_WRITE(latch_ch2_w ) // oki
r29505r29506
831473   DEVCB_NULL,
832474   DEVCB_NULL,
833475   DEVCB_DRIVER_MEMBER(maygay1b_state,m1_meter_w),
834   DEVCB_NULL,
476   DEVCB_DRIVER_MEMBER(maygay1b_state,m1_lockout_w),
835477};
836478
479/*************************************
480 *
481 *  8279 display/keyboard driver
482 *
483 *************************************/
484
485WRITE8_MEMBER( maygay1b_state::scanlines_w )
486{
487   m_lamp_strobe = data;
488}
489
490WRITE8_MEMBER( maygay1b_state::lamp_data_w )
491{
492   //The two A/B ports are merged back into one, to make one row of 8 lamps.
493   
494   if (m_old_lamp_strobe != m_lamp_strobe)
495   {
496      // Because of the nature of the lamping circuit, there is an element of persistance
497      // As a consequence, the lamp column data can change before the input strobe without
498      // causing the relevant lamps to black out.
499
500      for (int i = 0; i < 8; i++)
501      {
502         output_set_lamp_value((8*m_lamp_strobe)+i, ((data  & (1 << i)) !=0));
503      }
504      m_old_lamp_strobe = m_lamp_strobe;
505   }
506   
507}
508
509READ8_MEMBER( maygay1b_state::kbd_r )
510{
511   ioport_port * portnames[] = { m_sw1_port, m_s2_port, m_s3_port, m_s4_port, m_s5_port, m_s6_port, m_s7_port, m_sw2_port};
512   return (portnames[m_lamp_strobe&0x07])->read();
513}
514
515/*
516static I8279_INTERFACE( m1_i8279_intf )
517{
518   DEVCB_NULL,                                     // irq
519   DEVCB_DRIVER_MEMBER(maygay1b_state, scanlines_w),  // scan SL lines
520   DEVCB_DRIVER_MEMBER(maygay1b_state, lamp_data_w),      // display A&B
521   DEVCB_NULL,                                     // BD
522   DEVCB_DRIVER_MEMBER(maygay1b_state,kbd_r),      // kbd RL lines
523   DEVCB_NULL,                                     // Shift key
524   DEVCB_NULL                                      // Ctrl-Strobe line
525};
526*/
527
528
529
530WRITE8_MEMBER( maygay1b_state::lamp_data_2_w )
531{
532   //The two A/B ports are merged back into one, to make one row of 8 lamps.
533   
534   if (m_old_lamp_strobe2 != m_lamp_strobe2)
535   {
536      // Because of the nature of the lamping circuit, there is an element of persistance
537      // As a consequence, the lamp column data can change before the input strobe without
538      // causing the relevant lamps to black out.
539
540      for (int i = 0; i < 8; i++)
541      {
542         output_set_lamp_value((8*m_lamp_strobe)+i+128, ((data  & (1 << i)) !=0));
543      }
544      m_old_lamp_strobe2 = m_lamp_strobe2;
545   }
546   
547}
548
549/*
550static I8279_INTERFACE( m1_i8279_2_intf )
551{
552   DEVCB_NULL,                                     // irq
553   DEVCB_NULL,  // scan SL lines
554   DEVCB_DRIVER_MEMBER(maygay1b_state, lamp_data_2_w),      // display A&B
555   DEVCB_NULL,                                     // BD
556   DEVCB_NULL,                                   // kbd RL lines
557   DEVCB_NULL,                                     // Shift key
558   DEVCB_NULL                                      // Ctrl-Strobe line
559};
560*/
561
837562// machine driver for maygay m1 board /////////////////////////////////
838563
839564
r29505r29506
851576   MCFG_PIA_WRITEPA_HANDLER(WRITE8(maygay1b_state, m1_pia_porta_w))
852577   MCFG_PIA_WRITEPB_HANDLER(WRITE8(maygay1b_state, m1_pia_portb_w))
853578
854   MCFG_MSC1937_ADD("vfd",0,RIGHT_TO_LEFT)
579   MCFG_S16LF01_ADD("vfd",0)
855580   MCFG_SPEAKER_STANDARD_MONO("mono")
856581   MCFG_SOUND_ADD("aysnd",YM2149, M1_MASTER_CLOCK)
857582   MCFG_SOUND_CONFIG(ay8910_config)
r29505r29506
863588   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
864589
865590   MCFG_TIMER_DRIVER_ADD_PERIODIC("nmitimer", maygay1b_state, maygay1b_nmitimer_callback, attotime::from_hz(75)) // freq?
591   MCFG_DEVICE_ADD("i8279", I8279, M1_MASTER_CLOCK/4)    // unknown clock
592   MCFG_DEVICE_ADD("i8279_2", I8279, M1_MASTER_CLOCK/4)    // unknown clock
866593
594//   MCFG_I8279_ADD("i8279", M1_MASTER_CLOCK/4, m1_i8279_intf)    // unknown clock
595//   MCFG_I8279_ADD("i8279_2", M1_MASTER_CLOCK/4, m1_i8279_2_intf)    // unknown clock
596
867597   MCFG_NVRAM_ADD_0FILL("nvram")
868598
869599   MCFG_DEFAULT_LAYOUT(layout_maygay1b)
branches/new_menus/src/mame/drivers/simpl156.c
r29505r29506
387387}
388388
389389
390int simpl156_state::bank_callback(int bank)
390DECO16IC_BANK_CB_MEMBER(simpl156_state::bank_callback)
391391{
392392   return ((bank >> 4) & 0x7) * 0x1000;
393393}
394394
395UINT16 simpl156_pri_callback(UINT16 x)
395DECOSPR_PRIORITY_CB_MEMBER(simpl156_state::pri_callback)
396396{
397   switch (x & 0xc000)
397   switch (pri & 0xc000)
398398   {
399399      case 0x0000: return 0;
400400      case 0x4000: return 0xf0;
r29505r29506
444444   MCFG_DECO16IC_PALETTE("palette")
445445
446446   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
447   decospr_device::set_gfx_region(*device, 2);
448   decospr_device::set_pri_callback(*device, simpl156_pri_callback);
447   MCFG_DECO_SPRITE_GFX_REGION(2)
448   MCFG_DECO_SPRITE_PRIORITY_CB(simpl156_state, pri_callback)
449449   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
450450   MCFG_DECO_SPRITE_PALETTE("palette")
451451
branches/new_menus/src/mame/drivers/namcos2.c
r29505r29506
18621862   MCFG_VIDEO_START_OVERRIDE(namcos2_state, finallap)
18631863
18641864   MCFG_NAMCO_C45_ROAD_ADD("c45_road")
1865   MCFG_NAMCO_C45_ROAD_PALETTE("palette")
1865   MCFG_GFX_PALETTE("palette")
18661866
18671867   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
18681868
r29505r29506
20202020   MCFG_VIDEO_START_OVERRIDE(namcos2_state, luckywld)
20212021
20222022   MCFG_NAMCO_C45_ROAD_ADD("c45_road")
2023   MCFG_NAMCO_C45_ROAD_PALETTE("palette")
2023   MCFG_GFX_PALETTE("palette")
20242024
20252025   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
20262026
branches/new_menus/src/mame/drivers/exzisus.c
r29505r29506
151151   AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_0_r, exzisus_objectram_0_w) AM_SHARE("objectram0")
152152   AM_RANGE(0xc600, 0xdfff) AM_READWRITE(exzisus_videoram_0_r, exzisus_videoram_0_w) AM_SHARE("videoram0")
153153   AM_RANGE(0xe000, 0xefff) AM_RAM
154   AM_RANGE(0xf000, 0xf000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_port_w)
155   AM_RANGE(0xf001, 0xf001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w)
154   AM_RANGE(0xf000, 0xf000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, master_port_w)
155   AM_RANGE(0xf001, 0xf001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w)
156156   AM_RANGE(0xf400, 0xf400) AM_READ_PORT("P1")
157157   AM_RANGE(0xf400, 0xf400) AM_WRITE(exzisus_cpub_bankswitch_w)
158158   AM_RANGE(0xf401, 0xf401) AM_READ_PORT("P2")
r29505r29506
176176   AM_RANGE(0x0000, 0x7fff) AM_ROM
177177   AM_RANGE(0x8000, 0x8fff) AM_RAM
178178   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
179   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
180   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
179   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
180   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
181181ADDRESS_MAP_END
182182
183183
r29505r29506
252252
253253
254254
255static const tc0140syt_interface exzisus_tc0140syt_intf =
256{
257   "cpub", "audiocpu"
258};
259
260255/* All clocks are unconfirmed */
261256static MACHINE_CONFIG_START( exzisus, exzisus_state )
262257
r29505r29506
298293   MCFG_SOUND_ROUTE(0, "mono", 0.50)
299294   MCFG_SOUND_ROUTE(1, "mono", 0.50)
300295
301   MCFG_TC0140SYT_ADD("tc0140syt", exzisus_tc0140syt_intf)
296   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
297   MCFG_TC0140SYT_MASTER_CPU("cpub")
298   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
302299MACHINE_CONFIG_END
303300
304301
branches/new_menus/src/mame/drivers/undrfire.c
r29505r29506
696696   device.execute().set_input_line(4, HOLD_LINE);
697697}
698698
699static const tc0100scn_interface undrfire_tc0100scn_intf =
700{
701   2, 3,       /* gfxnum, txnum */
702   50, 8,      /* x_offset, y_offset */
703   0, 0,       /* flip_xoff, flip_yoff */
704   0, 0,       /* flip_text_xoff, flip_text_yoff */
705   0, 0
706};
707
708static const tc0480scp_interface undrfire_tc0480scp_intf =
709{
710   1, 4,       /* gfxnum, txnum */
711   0,      /* pixels */
712   0x24, 0,        /* x_offset, y_offset */
713   -1, 0,      /* text_xoff, text_yoff */
714   0, 0,       /* flip_xoff, flip_yoff */
715   0       /* col_base */
716};
717
718699static MACHINE_CONFIG_START( undrfire, undrfire_state )
719700
720701   /* basic machine hardware */
r29505r29506
736717   MCFG_GFXDECODE_ADD("gfxdecode", "palette", undrfire)
737718   MCFG_PALETTE_ADD("palette", 16384)
738719
739
740   MCFG_TC0100SCN_ADD("tc0100scn", undrfire_tc0100scn_intf)
720   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
721   MCFG_TC0100SCN_GFX_REGION(2)
722   MCFG_TC0100SCN_TX_REGION(3)
723   MCFG_TC0100SCN_OFFSETS(50, 8)
741724   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
742725   MCFG_TC0100SCN_PALETTE("palette")
743   MCFG_TC0480SCP_ADD("tc0480scp", undrfire_tc0480scp_intf)
726
727   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
728   MCFG_TC0480SCP_GFX_REGION(1)
729   MCFG_TC0480SCP_TX_REGION(4)
730   MCFG_TC0480SCP_OFFSETS(0x24, 0)
731   MCFG_TC0480SCP_OFFSETS_TX(-1, 0)
744732   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
745733   MCFG_TC0480SCP_PALETTE("palette")
746734
r29505r29506
776764   MCFG_GFXDECODE_ADD("gfxdecode", "palette", cbombers)
777765   MCFG_PALETTE_ADD("palette", 16384)
778766
779
780   MCFG_TC0100SCN_ADD("tc0100scn", undrfire_tc0100scn_intf)
767   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
768   MCFG_TC0100SCN_GFX_REGION(2)
769   MCFG_TC0100SCN_TX_REGION(3)
770   MCFG_TC0100SCN_OFFSETS(50, 8)
781771   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
782772   MCFG_TC0100SCN_PALETTE("palette")
783773
784   MCFG_TC0480SCP_ADD("tc0480scp", undrfire_tc0480scp_intf)
774   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
775   MCFG_TC0480SCP_GFX_REGION(1)
776   MCFG_TC0480SCP_TX_REGION(4)
777   MCFG_TC0480SCP_OFFSETS(0x24, 0)
778   MCFG_TC0480SCP_OFFSETS_TX(-1, 0)
785779   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
786780   MCFG_TC0480SCP_PALETTE("palette")
787781
branches/new_menus/src/mame/drivers/taito_z.c
r29505r29506
14041404WRITE16_MEMBER(taitoz_state::taitoz_sound_w)
14051405{
14061406   if (offset == 0)
1407      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
1407      m_tc0140syt->master_port_w(space, 0, data & 0xff);
14081408   else if (offset == 1)
1409      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
1409      m_tc0140syt->master_comm_w(space, 0, data & 0xff);
14101410
14111411#ifdef MAME_DEBUG
14121412//  if (data & 0xff00)
r29505r29506
14221422READ16_MEMBER(taitoz_state::taitoz_sound_r)
14231423{
14241424   if (offset == 1)
1425      return (m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff);
1425      return (m_tc0140syt->master_comm_r(space, 0) & 0xff);
14261426   else
14271427      return 0;
14281428}
r29505r29506
14311431WRITE16_MEMBER(taitoz_state::taitoz_msb_sound_w)
14321432{
14331433   if (offset == 0)
1434      m_tc0140syt->tc0140syt_port_w(0, (data >> 8) & 0xff);
1434      m_tc0140syt->master_port_w(0, (data >> 8) & 0xff);
14351435   else if (offset == 1)
1436      m_tc0140syt->tc0140syt_comm_w(0, (data >> 8) & 0xff);
1436      m_tc0140syt->master_comm_w(0, (data >> 8) & 0xff);
14371437
14381438#ifdef MAME_DEBUG
14391439   if (data & 0xff)
r29505r29506
14491449READ16_MEMBER(taitoz_state::taitoz_msb_sound_r)
14501450{
14511451   if (offset == 1)
1452      return ((m_tc0140syt->tc0140syt_comm_r(0) & 0xff) << 8);
1452      return ((m_tc0140syt->master_comm_r(0) & 0xff) << 8);
14531453   else
14541454      return 0;
14551455}
r29505r29506
17331733   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
17341734   AM_RANGE(0xc000, 0xdfff) AM_RAM
17351735   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
1736   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
1737   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
1736   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
1737   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
17381738   AM_RANGE(0xe400, 0xe403) AM_WRITE(taitoz_pancontrol) /* pan */
17391739   AM_RANGE(0xea00, 0xea00) AM_READNOP
17401740   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
29552955
29562956***********************************************************/
29572957
2958
2959static const tc0100scn_interface taitoz_tc0100scn_intf =
2960{
2961   1, 2,       /* gfxnum, txnum */
2962   0, 0,       /* x_offset, y_offset */
2963   0, 0,       /* flip_xoff, flip_yoff */
2964   0, 0,       /* flip_text_xoff, flip_text_yoff */
2965   0, 0
2966};
2967
2968static const tc0100scn_interface chasehq_tc0100scn_intf =
2969{
2970   1, 3,       /* gfxnum, txnum */
2971   0, 0,       /* x_offset, y_offset */
2972   0, 0,       /* flip_xoff, flip_yoff */
2973   0, 0,       /* flip_text_xoff, flip_text_yoff */
2974   0, 0
2975};
2976
2977static const tc0100scn_interface spacegun_tc0100scn_intf =
2978{
2979   1, 2,       /* gfxnum, txnum */
2980   4, 0,       /* x_offset, y_offset */
2981   0, 0,       /* flip_xoff, flip_yoff */
2982   0, 0,       /* flip_text_xoff, flip_text_yoff */
2983   0, 0
2984};
2985
2986static const tc0480scp_interface taitoz_tc0480scp_intf =
2987{
2988   1, 2,       /* gfxnum, txnum */
2989   0,          /* pixels */
2990   0x1f, 0x08, /* x_offset, y_offset */
2991   0, 0,       /* text_xoff, text_yoff */
2992   0, 0,       /* flip_xoff, flip_yoff */
2993   0           /* col_base */
2994};
2995
2996
2997static const tc0150rod_interface taitoz_tc0150rod_intf = { "gfx3" };
2998
2999
3000static const tc0140syt_interface taitoz_tc0140syt_intf =
3001{
3002   "sub", "audiocpu"
3003};
3004
3005
30062958/***********************************************************
30072959                   SAVE STATES
30082960***********************************************************/
r29505r29506
30843036
30853037   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
30863038
3087   MCFG_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf)
3039   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3040   MCFG_TC0100SCN_GFX_REGION(1)
3041   MCFG_TC0100SCN_TX_REGION(2)
30883042   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
30893043   MCFG_TC0100SCN_PALETTE("palette")
30903044
3091   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3045   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3046   MCFG_TC0150ROD_GFXTAG("gfx3")
3047
30923048   MCFG_TC0110PCR_ADD("tc0110pcr")
30933049   MCFG_TC0110PCR_PALETTE("palette")
30943050
r29505r29506
31143070   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
31153071   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
31163072
3117   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
3073   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3074   MCFG_TC0140SYT_MASTER_CPU("sub")
3075   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
31183076MACHINE_CONFIG_END
31193077
31203078
r29505r29506
31573115
31583116   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
31593117
3160   MCFG_TC0100SCN_ADD("tc0100scn", chasehq_tc0100scn_intf)
3118   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3119   MCFG_TC0100SCN_GFX_REGION(1)
3120   MCFG_TC0100SCN_TX_REGION(3)
31613121   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
31623122   MCFG_TC0100SCN_PALETTE("palette")
31633123
3164   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3124   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3125   MCFG_TC0150ROD_GFXTAG("gfx3")
3126
31653127   MCFG_TC0110PCR_ADD("tc0110pcr")
31663128   MCFG_TC0110PCR_PALETTE("palette")
31673129
r29505r29506
31873149   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
31883150   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
31893151
3190   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
3152   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3153   MCFG_TC0140SYT_MASTER_CPU("sub")
3154   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
31913155MACHINE_CONFIG_END
31923156
31933157
r29505r29506
32323196
32333197   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
32343198
3235   MCFG_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf)
3199   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3200   MCFG_TC0100SCN_GFX_REGION(1)
3201   MCFG_TC0100SCN_TX_REGION(2)
32363202   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
32373203   MCFG_TC0100SCN_PALETTE("palette")
32383204
3239   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3205   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3206   MCFG_TC0150ROD_GFXTAG("gfx3")
3207
32403208   MCFG_TC0110PCR_ADD("tc0110pcr")
32413209   MCFG_TC0110PCR_PALETTE("palette")
32423210
r29505r29506
32613229   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
32623230   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
32633231
3264   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
3232   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3233   MCFG_TC0140SYT_MASTER_CPU("sub")
3234   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
32653235MACHINE_CONFIG_END
32663236
32673237
r29505r29506
33033273
33043274   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
33053275
3306   MCFG_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf)
3276   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3277   MCFG_TC0100SCN_GFX_REGION(1)
3278   MCFG_TC0100SCN_TX_REGION(2)
33073279   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
33083280   MCFG_TC0100SCN_PALETTE("palette")
33093281
3310   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3282   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3283   MCFG_TC0150ROD_GFXTAG("gfx3")
33113284
33123285   /* sound hardware */
33133286   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r29505r29506
33293302   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
33303303   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
33313304   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
3332
3333   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
33343305MACHINE_CONFIG_END
33353306
33363307static MACHINE_CONFIG_DERIVED( bsharkjjs, bshark )
r29505r29506
33843355
33853356   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
33863357
3387   MCFG_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf)
3358   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3359   MCFG_TC0100SCN_GFX_REGION(1)
3360   MCFG_TC0100SCN_TX_REGION(2)
33883361   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
33893362   MCFG_TC0100SCN_PALETTE("palette")
33903363
3391   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3364   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3365   MCFG_TC0150ROD_GFXTAG("gfx3")
33923366
33933367   /* sound hardware */
33943368   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r29505r29506
34113385   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
34123386   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
34133387
3414   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
3388   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3389   MCFG_TC0140SYT_MASTER_CPU("sub")
3390   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
34153391MACHINE_CONFIG_END
34163392
34173393
r29505r29506
34563432
34573433   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
34583434
3459   MCFG_TC0100SCN_ADD("tc0100scn", chasehq_tc0100scn_intf)
3435   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3436   MCFG_TC0100SCN_GFX_REGION(1)
3437   MCFG_TC0100SCN_TX_REGION(3)
34603438   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
34613439   MCFG_TC0100SCN_PALETTE("palette")
34623440
3463   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3441   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3442   MCFG_TC0150ROD_GFXTAG("gfx3")
3443
34643444   MCFG_TC0110PCR_ADD("tc0110pcr")
34653445   MCFG_TC0110PCR_PALETTE("palette")
34663446
r29505r29506
34863466   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
34873467   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "front", 1.0)
34883468
3489   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
3469   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3470   MCFG_TC0140SYT_MASTER_CPU("sub")
3471   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
34903472MACHINE_CONFIG_END
34913473
34923474
r29505r29506
35313513
35323514   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
35333515
3534   MCFG_TC0100SCN_ADD("tc0100scn", taitoz_tc0100scn_intf)
3516   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3517   MCFG_TC0100SCN_GFX_REGION(1)
3518   MCFG_TC0100SCN_TX_REGION(2)
35353519   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
35363520   MCFG_TC0100SCN_PALETTE("palette")
35373521
3538   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3522   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3523   MCFG_TC0150ROD_GFXTAG("gfx3")
3524
35393525   MCFG_TC0110PCR_ADD("tc0110pcr")
35403526   MCFG_TC0110PCR_PALETTE("palette")
35413527
r29505r29506
35603546   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
35613547   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
35623548
3563   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
3549   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3550   MCFG_TC0140SYT_MASTER_CPU("sub")
3551   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
35643552MACHINE_CONFIG_END
35653553
35663554
r29505r29506
36013589   MCFG_PALETTE_ADD("palette", 4096)
36023590   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
36033591
3604   MCFG_TC0100SCN_ADD("tc0100scn", spacegun_tc0100scn_intf)
3592   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
3593   MCFG_TC0100SCN_GFX_REGION(1)
3594   MCFG_TC0100SCN_TX_REGION(2)
3595   MCFG_TC0100SCN_OFFSETS(4, 0)
36053596   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
36063597   MCFG_TC0100SCN_PALETTE("palette")
36073598
r29505r29506
36283619   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
36293620   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
36303621   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
3631
3632   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
36333622MACHINE_CONFIG_END
36343623
36353624
r29505r29506
36743663
36753664   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
36763665
3677   MCFG_TC0480SCP_ADD("tc0480scp", taitoz_tc0480scp_intf)
3666   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
3667   MCFG_TC0480SCP_GFX_REGION(1)
3668   MCFG_TC0480SCP_TX_REGION(2)
3669   MCFG_TC0480SCP_OFFSETS(0x1f, 0x08)
36783670   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
36793671   MCFG_TC0480SCP_PALETTE("palette")
36803672
3681   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3673   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3674   MCFG_TC0150ROD_GFXTAG("gfx3")
36823675
36833676   /* sound hardware */
36843677   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r29505r29506
37013694   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
37023695   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
37033696
3704   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
3697   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3698   MCFG_TC0140SYT_MASTER_CPU("sub")
3699   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
37053700MACHINE_CONFIG_END
37063701
37073702
r29505r29506
37453740   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
37463741   MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz)
37473742
3748   MCFG_TC0480SCP_ADD("tc0480scp", taitoz_tc0480scp_intf)
3743   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
3744   MCFG_TC0480SCP_GFX_REGION(1)
3745   MCFG_TC0480SCP_TX_REGION(2)
3746   MCFG_TC0480SCP_OFFSETS(0x1f, 0x08)
37493747   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
37503748   MCFG_TC0480SCP_PALETTE("palette")
37513749
3752   MCFG_TC0150ROD_ADD("tc0150rod", taitoz_tc0150rod_intf)
3750   MCFG_DEVICE_ADD("tc0150rod", TC0150ROD, 0)
3751   MCFG_TC0150ROD_GFXTAG("gfx3")
37533752
37543753   /* sound hardware */
37553754   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r29505r29506
37723771   MCFG_FILTER_VOLUME_ADD("2610.2.l", 0)
37733772   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
37743773
3775   MCFG_TC0140SYT_ADD("tc0140syt", taitoz_tc0140syt_intf)
3774   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
3775   MCFG_TC0140SYT_MASTER_CPU("sub")
3776   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
37763777MACHINE_CONFIG_END
37773778
37783779
branches/new_menus/src/mame/drivers/galpanic.c
r29505r29506
545545GFXDECODE_END
546546
547547
548static const kaneko_pandora_interface galpanic_pandora_config =
549{
550   0,  /* gfx_region */
551   0, -16  /* x_offs, y_offs */
552};
553
554
555548static MACHINE_CONFIG_START( galpanic, galpanic_state )
556549
557550   /* basic machine hardware */
r29505r29506
573566   MCFG_PALETTE_ADD("palette", 1024 + 32768)
574567   MCFG_PALETTE_INIT_OWNER(galpanic_state,galpanic)
575568
576   MCFG_KANEKO_PANDORA_ADD("pandora", galpanic_pandora_config)
569   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
570   MCFG_KANEKO_PANDORA_OFFSETS(0, -16)
577571   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
578572   MCFG_KANEKO_PANDORA_PALETTE("palette")
579573
580574   MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0)
581575   kaneko_hit_device::set_type(*device, 0);
582576
583
584
585
586577   MCFG_VIDEO_START_OVERRIDE(galpanic_state,galpanic)
587578
588579   /* sound hardware */
branches/new_menus/src/mame/drivers/igspoker.c
r29505r29506
17321732static const gfx_layout charlayout2 =
17331733{
17341734   8, 32,   /* 8*32 characters */
1735   RGN_FRAC(1, 3),
1735   RGN_FRAC(1, 3*4),
17361736   6,      /* 6 bits per pixel */
17371737   { RGN_FRAC(0,3)+8,RGN_FRAC(0,3)+0,
17381738      RGN_FRAC(1,3)+8,RGN_FRAC(1,3)+0,
branches/new_menus/src/mame/drivers/namcona1.c
r29505r29506
293293
294294/***************************************************************/
295295
296READ16_MEMBER(namcona1_state::namcona1_vreg_r)
297{
298   return m_vreg[offset];
299} /* namcona1_vreg_r */
300
301296int namcona1_state::transfer_dword( UINT32 dest, UINT32 source )
302297{
303298   UINT16 data;
r29505r29506
549544   AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION("maincpu", 0x080000)  /* code */
550545   AM_RANGE(0xe00000, 0xe00fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
551546   AM_RANGE(0xe40000, 0xe4000f) AM_READWRITE(custom_key_r, custom_key_w)
552   AM_RANGE(0xefff00, 0xefffff) AM_READWRITE(namcona1_vreg_r, namcona1_vreg_w) AM_SHARE("vreg")
553   AM_RANGE(0xf00000, 0xf01fff) AM_READWRITE(namcona1_paletteram_r, namcona1_paletteram_w) AM_SHARE("paletteram")
554   AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w)
555   AM_RANGE(0xff0000, 0xffbfff) AM_READWRITE(namcona1_videoram_r, namcona1_videoram_w) AM_SHARE("videoram")
547   AM_RANGE(0xefff00, 0xefffff) AM_RAM_WRITE(namcona1_vreg_w) AM_SHARE("vreg")
548   AM_RANGE(0xf00000, 0xf01fff) AM_RAM_WRITE(namcona1_paletteram_w) AM_SHARE("paletteram")
549   AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w) AM_SHARE("cgram")
550   AM_RANGE(0xff0000, 0xffbfff) AM_RAM_WRITE(namcona1_videoram_w) AM_SHARE("videoram")
556551   AM_RANGE(0xffd000, 0xffdfff) AM_RAM /* unknown */
557552   AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_SHARE("scroll")      /* scroll registers */
558553   AM_RANGE(0xfff000, 0xffffff) AM_RAM AM_SHARE("spriteram")           /* spriteram */
r29505r29506
571566   AM_RANGE(0xe00000, 0xe00fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
572567   /* xday: additional battery-backed ram at 00E024FA? */
573568   AM_RANGE(0xe40000, 0xe4000f) AM_READWRITE(custom_key_r, custom_key_w)
574   AM_RANGE(0xefff00, 0xefffff) AM_READWRITE(namcona1_vreg_r, namcona1_vreg_w) AM_SHARE("vreg")
575   AM_RANGE(0xf00000, 0xf01fff) AM_READWRITE(namcona1_paletteram_r, namcona1_paletteram_w) AM_SHARE("paletteram")
576   AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w)
577   AM_RANGE(0xff0000, 0xffbfff) AM_READWRITE(namcona1_videoram_r, namcona1_videoram_w) AM_SHARE("videoram")
569   AM_RANGE(0xefff00, 0xefffff) AM_RAM_WRITE(namcona1_vreg_w) AM_SHARE("vreg")
570   AM_RANGE(0xf00000, 0xf01fff) AM_RAM_WRITE(namcona1_paletteram_w) AM_SHARE("paletteram")
571   AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w) AM_SHARE("cgram")
572   AM_RANGE(0xff0000, 0xffbfff) AM_RAM_WRITE(namcona1_videoram_w) AM_SHARE("videoram")
578573   AM_RANGE(0xffd000, 0xffdfff) AM_RAM /* unknown */
579574   AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_SHARE("scroll")      /* scroll registers */
580575   AM_RANGE(0xfff000, 0xffffff) AM_RAM AM_SHARE("spriteram")           /* spriteram */
r29505r29506
875870
876871/***************************************************************************/
877872
873static const gfx_layout cg_layout_8bpp =
874{
875   8,8,
876   RGN_FRAC(1,1),
877   8, /* 8BPP */
878   { 0,1,2,3,4,5,6,7 },
879   { STEP8(0, 8) },
880   { STEP8(0, 8*8) },
881   8*8*8
882};
883
884static const gfx_layout cg_layout_4bpp =
885{
886   8,8,
887   RGN_FRAC(1,1),
888   4, /* 4BPP */
889   { 4,5,6,7 },
890   { STEP8(0, 8) },
891   { STEP8(0, 8*8) },
892   8*8*8
893};
894
895static const gfx_layout shape_layout =
896{
897   8,8,
898   0x1000,
899   1,
900   { 0 },
901   { STEP8(0, 1) },
902   { STEP8(0, 8) },
903   8*8
904};
905
906static GFXDECODE_START( namcona1 )
907   GFXDECODE_RAM( "cgram", 0, cg_layout_8bpp, 0, 0x2000/256 )
908   GFXDECODE_RAM( "cgram", 0, cg_layout_4bpp, 0, 0x2000/16  )
909   GFXDECODE_RAM(  NULL,   0, shape_layout,   0, 0x2000/2   )
910GFXDECODE_END
911
912/***************************************************************************/
913
878914TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::namcona1_interrupt)
879915{
880916   int scanline = param;
r29505r29506
948984
949985   MCFG_PALETTE_ADD("palette", 0x2000)
950986   MCFG_PALETTE_ENABLE_SHADOWS()
951   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
987   MCFG_GFXDECODE_ADD("gfxdecode", "palette", namcona1)
952988
953989   /* sound hardware */
954990   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
branches/new_menus/src/mame/drivers/asuka.c
r29505r29506
320320   AM_RANGE(0x3b0000, 0x3b0001) AM_READ_PORT("DSWB")
321321   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(watchdog_reset16_w)
322322   AM_RANGE(0x3d0000, 0x3d0001) AM_READNOP
323   AM_RANGE(0x3e0000, 0x3e0001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
324   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
323   AM_RANGE(0x3e0000, 0x3e0001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
324   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
325325   AM_RANGE(0x800000, 0x8007ff) AM_READWRITE(bonzeadv_cchip_ram_r, bonzeadv_cchip_ram_w)
326326   AM_RANGE(0x800802, 0x800803) AM_READWRITE(bonzeadv_cchip_ctrl_r, bonzeadv_cchip_ctrl_w)
327327   AM_RANGE(0x800c00, 0x800c01) AM_WRITE(bonzeadv_cchip_bank_w)
r29505r29506
336336   AM_RANGE(0x1076f0, 0x1076f1) AM_READNOP /* Mofflott init does dummy reads here */
337337   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_word_w)
338338   AM_RANGE(0x3a0000, 0x3a0003) AM_WRITE(asuka_spritectrl_w)
339   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
340   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
339   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
340   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
341341   AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
342342   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
343343   AM_RANGE(0xc10000, 0xc103ff) AM_WRITENOP    /* error in Asuka init code */
r29505r29506
348348static ADDRESS_MAP_START( cadash_map, AS_PROGRAM, 16, asuka_state )
349349   AM_RANGE(0x000000, 0x07ffff) AM_ROM
350350   AM_RANGE(0x080000, 0x080003) AM_WRITE(asuka_spritectrl_w)
351   AM_RANGE(0x0c0000, 0x0c0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
352   AM_RANGE(0x0c0002, 0x0c0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
351   AM_RANGE(0x0c0000, 0x0c0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
352   AM_RANGE(0x0c0002, 0x0c0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
353353   AM_RANGE(0x100000, 0x107fff) AM_RAM
354354   AM_RANGE(0x800000, 0x800fff) AM_READWRITE(cadash_share_r,cadash_share_w)    /* network ram */
355355   AM_RANGE(0x900000, 0x90000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
r29505r29506
366366   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
367367   AM_RANGE(0x400000, 0x40000f) AM_DEVREAD8("tc0220ioc", tc0220ioc_device, read, 0x00ff)   /* service mode mirror */
368368   AM_RANGE(0x4a0000, 0x4a0003) AM_WRITE(asuka_spritectrl_w)
369   AM_RANGE(0x4e0000, 0x4e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
370   AM_RANGE(0x4e0002, 0x4e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
369   AM_RANGE(0x4e0000, 0x4e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
370   AM_RANGE(0x4e0002, 0x4e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
371371   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("pc090oj", pc090oj_device, word_r, word_w)  /* sprite ram */
372372   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVWRITE("tc0100scn", tc0100scn_device, word_w)
373373   AM_RANGE(0xd00000, 0xd0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
r29505r29506
382382   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
383383   AM_RANGE(0xc000, 0xdfff) AM_RAM
384384   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
385   AM_RANGE(0xe200, 0xe200) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
386   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
385   AM_RANGE(0xe200, 0xe200) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
386   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
387387   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
388388   AM_RANGE(0xe600, 0xe600) AM_WRITENOP
389389   AM_RANGE(0xee00, 0xee00) AM_WRITENOP
r29505r29506
397397   AM_RANGE(0x8000, 0x8fff) AM_RAM
398398   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
399399//  AM_RANGE(0x9002, 0x9100) AM_READNOP
400   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
401   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
400   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
401   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
402402   AM_RANGE(0xb000, 0xb000) AM_WRITE(asuka_msm5205_address_w)
403403   AM_RANGE(0xc000, 0xc000) AM_WRITE(asuka_msm5205_start_w)
404404   AM_RANGE(0xd000, 0xd000) AM_WRITE(asuka_msm5205_stop_w)
r29505r29506
410410   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
411411   AM_RANGE(0x8000, 0x8fff) AM_RAM
412412   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
413   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
414   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
413   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
414   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
415415ADDRESS_MAP_END
416416
417417/*
r29505r29506
778778                 MACHINE DRIVERS
779779***********************************************************/
780780
781static const tc0100scn_interface asuka_tc0100scn_intf =
782{
783   1, 2,       /* gfxnum, txnum */
784   0, 0,       /* x_offset, y_offset */
785   0, 0,       /* flip_xoff, flip_yoff */
786   0, 0,       /* flip_text_xoff, flip_text_yoff */
787   0, 0
788};
789
790static const tc0100scn_interface cadash_tc0100scn_intf =
791{
792   1, 2,       /* gfxnum, txnum */
793   1, 0,       /* x_offset, y_offset */
794   0, 0,       /* flip_xoff, flip_yoff */
795   0, 0,       /* flip_text_xoff, flip_text_yoff */
796   0, 0
797};
798
799static const pc090oj_interface asuka_pc090oj_intf =
800{
801   0, 0, 8, 1
802};
803
804static const pc090oj_interface bonzeadv_pc090oj_intf =
805{
806   0, 0, 8, 0
807};
808
809
810
811781void asuka_state::machine_start()
812782{
813783   /* configure the banks */
r29505r29506
849819   }
850820}
851821
852static const tc0140syt_interface asuka_tc0140syt_intf =
853{
854   "maincpu", "audiocpu"
855};
856
857822static MACHINE_CONFIG_START( bonzeadv, asuka_state )
858823
859824   /* basic machine hardware */
r29505r29506
880845   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
881846   MCFG_PALETTE_ADD("palette", 4096)
882847
883   MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf)
848   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
849   MCFG_PC090OJ_OFFSETS(0, 8)
884850   MCFG_PC090OJ_GFXDECODE("gfxdecode")
885851   MCFG_PC090OJ_PALETTE("palette")
886   MCFG_TC0100SCN_ADD("tc0100scn", asuka_tc0100scn_intf)
852
853   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
854   MCFG_TC0100SCN_GFX_REGION(1)
855   MCFG_TC0100SCN_TX_REGION(2)
887856   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
888857   MCFG_TC0100SCN_PALETTE("palette")
858
889859   MCFG_TC0110PCR_ADD("tc0110pcr")
890860   MCFG_TC0110PCR_PALETTE("palette")
891861
r29505r29506
898868   MCFG_SOUND_ROUTE(1, "mono", 1.0)
899869   MCFG_SOUND_ROUTE(2, "mono", 1.0)
900870
901   MCFG_TC0140SYT_ADD("tc0140syt", asuka_tc0140syt_intf)
871   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
872   MCFG_TC0140SYT_MASTER_CPU("maincpu")
873   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
902874MACHINE_CONFIG_END
903875
904876static MACHINE_CONFIG_START( asuka, asuka_state )
r29505r29506
934906   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
935907   MCFG_PALETTE_ADD("palette", 4096)
936908
937   MCFG_PC090OJ_ADD("pc090oj", asuka_pc090oj_intf)
909   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
910   MCFG_PC090OJ_OFFSETS(0, 8)
911   MCFG_PC090OJ_USEBUFFER(1)
938912   MCFG_PC090OJ_GFXDECODE("gfxdecode")
939913   MCFG_PC090OJ_PALETTE("palette")
940   MCFG_TC0100SCN_ADD("tc0100scn", asuka_tc0100scn_intf)
914
915   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
916   MCFG_TC0100SCN_GFX_REGION(1)
917   MCFG_TC0100SCN_TX_REGION(2)
941918   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
942919   MCFG_TC0100SCN_PALETTE("palette")
920
943921   MCFG_TC0110PCR_ADD("tc0110pcr")
944922   MCFG_TC0110PCR_PALETTE("palette")
945923
r29505r29506
957935   MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B)      /* 8 kHz */
958936   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
959937
960   MCFG_TC0140SYT_ADD("tc0140syt", asuka_tc0140syt_intf)
938   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
939   MCFG_TC0140SYT_MASTER_CPU("maincpu")
940   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
961941MACHINE_CONFIG_END
962942
963943static MACHINE_CONFIG_START( cadash, asuka_state )
r29505r29506
997977   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
998978   MCFG_PALETTE_ADD("palette", 4096)
999979
1000   MCFG_PC090OJ_ADD("pc090oj", asuka_pc090oj_intf)
980   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
981   MCFG_PC090OJ_OFFSETS(0, 8)
982   MCFG_PC090OJ_USEBUFFER(1)
1001983   MCFG_PC090OJ_GFXDECODE("gfxdecode")
1002984   MCFG_PC090OJ_PALETTE("palette")
1003   MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf)
985
986   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
987   MCFG_TC0100SCN_GFX_REGION(1)
988   MCFG_TC0100SCN_TX_REGION(2)
989   MCFG_TC0100SCN_OFFSETS(1, 0)
1004990   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
1005991   MCFG_TC0100SCN_PALETTE("palette")
992
1006993   MCFG_TC0110PCR_ADD("tc0110pcr")
1007994   MCFG_TC0110PCR_PALETTE("palette")
1008995
r29505r29506
10151002   MCFG_SOUND_ROUTE(0, "mono", 0.50)
10161003   MCFG_SOUND_ROUTE(1, "mono", 0.50)
10171004
1018   MCFG_TC0140SYT_ADD("tc0140syt", asuka_tc0140syt_intf)
1005   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
1006   MCFG_TC0140SYT_MASTER_CPU("maincpu")
1007   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
10191008MACHINE_CONFIG_END
10201009
10211010static MACHINE_CONFIG_START( mofflott, asuka_state )
r29505r29506
10511040   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
10521041   MCFG_PALETTE_ADD("palette", 4096)   /* only Mofflott uses full palette space */
10531042
1054   MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf)
1043   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
1044   MCFG_PC090OJ_OFFSETS(0, 8)
10551045   MCFG_PC090OJ_GFXDECODE("gfxdecode")
10561046   MCFG_PC090OJ_PALETTE("palette")
1057   MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf)
1047
1048   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
1049   MCFG_TC0100SCN_GFX_REGION(1)
1050   MCFG_TC0100SCN_TX_REGION(2)
1051   MCFG_TC0100SCN_OFFSETS(1, 0)
10581052   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
10591053   MCFG_TC0100SCN_PALETTE("palette")
1054
10601055   MCFG_TC0110PCR_ADD("tc0110pcr")
10611056   MCFG_TC0110PCR_PALETTE("palette")
10621057
r29505r29506
10741069   MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B)      /* 8 kHz */
10751070   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10761071
1077   MCFG_TC0140SYT_ADD("tc0140syt", asuka_tc0140syt_intf)
1072   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
1073   MCFG_TC0140SYT_MASTER_CPU("maincpu")
1074   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
10781075MACHINE_CONFIG_END
10791076
10801077static MACHINE_CONFIG_START( galmedes, asuka_state )
r29505r29506
11101107   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
11111108   MCFG_PALETTE_ADD("palette", 4096)   /* only Mofflott uses full palette space */
11121109
1113   MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf)
1110   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
1111   MCFG_PC090OJ_OFFSETS(0, 8)
11141112   MCFG_PC090OJ_GFXDECODE("gfxdecode")
11151113   MCFG_PC090OJ_PALETTE("palette")
1116   MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf)
1114
1115   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
1116   MCFG_TC0100SCN_GFX_REGION(1)
1117   MCFG_TC0100SCN_TX_REGION(2)
1118   MCFG_TC0100SCN_OFFSETS(1, 0)
11171119   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
11181120   MCFG_TC0100SCN_PALETTE("palette")
1121
11191122   MCFG_TC0110PCR_ADD("tc0110pcr")
11201123   MCFG_TC0110PCR_PALETTE("palette")
11211124
r29505r29506
11281131   MCFG_SOUND_ROUTE(0, "mono", 0.50)
11291132   MCFG_SOUND_ROUTE(1, "mono", 0.50)
11301133
1131   MCFG_TC0140SYT_ADD("tc0140syt", asuka_tc0140syt_intf)
1134   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
1135   MCFG_TC0140SYT_MASTER_CPU("maincpu")
1136   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
11321137MACHINE_CONFIG_END
11331138
11341139static MACHINE_CONFIG_START( eto, asuka_state )
r29505r29506
11641169   MCFG_GFXDECODE_ADD("gfxdecode", "palette", asuka)
11651170   MCFG_PALETTE_ADD("palette", 4096)
11661171
1167   MCFG_PC090OJ_ADD("pc090oj", bonzeadv_pc090oj_intf)
1172   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
1173   MCFG_PC090OJ_OFFSETS(0, 8)
11681174   MCFG_PC090OJ_GFXDECODE("gfxdecode")
11691175   MCFG_PC090OJ_PALETTE("palette")
1170   MCFG_TC0100SCN_ADD("tc0100scn", cadash_tc0100scn_intf)
1176
1177   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
1178   MCFG_TC0100SCN_GFX_REGION(1)
1179   MCFG_TC0100SCN_TX_REGION(2)
1180   MCFG_TC0100SCN_OFFSETS(1, 0)
11711181   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
11721182   MCFG_TC0100SCN_PALETTE("palette")
1183
11731184   MCFG_TC0110PCR_ADD("tc0110pcr")
11741185   MCFG_TC0110PCR_PALETTE("palette")
11751186
r29505r29506
11821193   MCFG_SOUND_ROUTE(0, "mono", 0.50)
11831194   MCFG_SOUND_ROUTE(1, "mono", 0.50)
11841195
1185   MCFG_TC0140SYT_ADD("tc0140syt", asuka_tc0140syt_intf)
1196   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
1197   MCFG_TC0140SYT_MASTER_CPU("maincpu")
1198   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
11861199MACHINE_CONFIG_END
11871200
11881201
branches/new_menus/src/mame/drivers/nmk16.c
r29505r29506
36263626      m_maincpu->set_input_line(2, HOLD_LINE);
36273627}
36283628
3629
3630static const nmk112_interface nmk16_nmk112_intf =
3631{
3632   "oki1", "oki2", 0
3633};
3634
36353629static MACHINE_CONFIG_START( tharrier, nmk16_state )
36363630
36373631   /* basic machine hardware */
r29505r29506
43454339   MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW)
43464340   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
43474341
4348   MCFG_NMK112_ADD("nmk112", nmk16_nmk112_intf)
4342   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
4343   MCFG_NMK112_ROM0("oki1")
4344   MCFG_NMK112_ROM1("oki2")
43494345MACHINE_CONFIG_END
43504346
43514347static MACHINE_CONFIG_START( tdragon2, nmk16_state )
r29505r29506
43904386   MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW)
43914387   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
43924388
4393   MCFG_NMK112_ADD("nmk112", nmk16_nmk112_intf)
4389   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
4390   MCFG_NMK112_ROM0("oki1")
4391   MCFG_NMK112_ROM1("oki2")
43944392MACHINE_CONFIG_END
43954393
43964394static MACHINE_CONFIG_START( raphero, nmk16_state )
r29505r29506
44374435   MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW)
44384436   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
44394437
4440   MCFG_NMK112_ADD("nmk112", nmk16_nmk112_intf)
4438   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
4439   MCFG_NMK112_ROM0("oki1")
4440   MCFG_NMK112_ROM1("oki2")
44414441MACHINE_CONFIG_END
44424442
44434443static MACHINE_CONFIG_START( bjtwin, nmk16_state )
r29505r29506
44734473   MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) /* verified on pcb */
44744474   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
44754475
4476   MCFG_NMK112_ADD("nmk112", nmk16_nmk112_intf)
4476   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
4477   MCFG_NMK112_ROM0("oki1")
4478   MCFG_NMK112_ROM1("oki2")
44774479MACHINE_CONFIG_END
44784480
44794481
branches/new_menus/src/mame/drivers/f1gp.c
r29505r29506
367367   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
368368}
369369
370static const k053936_interface f1gp_k053936_intf =
371{
372   1, -58, -2  /* wrap, xoff, yoff */
373};
374
375static const k053936_interface f1gp2_k053936_intf =
376{
377   1, -48, -21 /* wrap, xoff, yoff */
378};
379
380
381370MACHINE_START_MEMBER(f1gp_state,f1gpb)
382371{
383372   save_item(NAME(m_pending_command));
r29505r29506
452441
453442   MCFG_VIDEO_START_OVERRIDE(f1gp_state,f1gp)
454443
455   MCFG_K053936_ADD("k053936", f1gp_k053936_intf)
444   MCFG_DEVICE_ADD("k053936", K053936, 0)
445   MCFG_K053936_WRAP(1)
446   MCFG_K053936_OFFSETS(-58, -2)
456447
457448   /* sound hardware */
458449   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r29505r29506
525516   MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")
526517   MCFG_VSYSTEM_SPR_PALETTE("palette")
527518
528   MCFG_DEVICE_REMOVE("k053936")
529   MCFG_K053936_ADD("k053936", f1gp2_k053936_intf)
519   MCFG_DEVICE_MODIFY("k053936")
520   MCFG_K053936_OFFSETS(-48, -21)
530521
531522   MCFG_VIDEO_START_OVERRIDE(f1gp_state,f1gp2)
532523MACHINE_CONFIG_END
branches/new_menus/src/mame/drivers/suprslam.c
r29505r29506
283283
284284/*** MACHINE DRIVER **********************************************************/
285285
286static const k053936_interface suprslam_k053936_intf =
287{
288   1, -45, -21 /* wrap, xoff, yoff */
289};
290
291286void suprslam_state::machine_start()
292287{
293288   save_item(NAME(m_screen_bank));
r29505r29506
333328   MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")
334329   MCFG_VSYSTEM_SPR_PALETTE("palette")
335330
336   MCFG_K053936_ADD("k053936", suprslam_k053936_intf)
331   MCFG_DEVICE_ADD("k053936", K053936, 0)
332   MCFG_K053936_WRAP(1)
333   MCFG_K053936_OFFSETS(-45, -21)
337334
338335   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
339336
branches/new_menus/src/mame/drivers/opwolf.c
r29505r29506
366366   AM_RANGE(0x380000, 0x380003) AM_WRITE(opwolf_spritectrl_w)  // usually 0x4, changes when you fire
367367   AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r)     /* lightgun, read at $11e0/6 */
368368   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITENOP                    /* watchdog ?? */
369   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
370   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
369   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
370   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
371371   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("pc080sn", pc080sn_device, word_r, word_w)
372372   AM_RANGE(0xc10000, 0xc1ffff) AM_WRITEONLY                   /* error in init code (?) */
373373   AM_RANGE(0xc20000, 0xc20003) AM_DEVWRITE("pc080sn", pc080sn_device, yscroll_word_w)
r29505r29506
387387   AM_RANGE(0x380000, 0x380003) AM_WRITE(opwolf_spritectrl_w)  // usually 0x4, changes when you fire
388388   AM_RANGE(0x3a0000, 0x3a0003) AM_READ(opwolf_lightgun_r)     /* lightgun, read at $11e0/6 */
389389   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITENOP                    /* watchdog ?? */
390   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
391   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
390   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
391   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
392392   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("pc080sn", pc080sn_device, word_r, word_w)
393393   AM_RANGE(0xc10000, 0xc1ffff) AM_WRITEONLY                   /* error in init code (?) */
394394   AM_RANGE(0xc20000, 0xc20003) AM_DEVWRITE("pc080sn", pc080sn_device, yscroll_word_w)
r29505r29506
536536   AM_RANGE(0x8000, 0x8fff) AM_RAM
537537   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
538538   AM_RANGE(0x9002, 0x9100) AM_READNOP
539   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
540   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
539   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
540   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
541541   AM_RANGE(0xb000, 0xb006) AM_WRITE(opwolf_adpcm_b_w)
542542   AM_RANGE(0xc000, 0xc006) AM_WRITE(opwolf_adpcm_c_w)
543543   AM_RANGE(0xd000, 0xd000) AM_WRITE(opwolf_adpcm_d_w)
r29505r29506
680680                 MACHINE DRIVERS
681681***********************************************************/
682682
683static const pc080sn_interface opwolf_pc080sn_intf =
684{
685   1,   /* gfxnum */
686   0, 0, 0, 0  /* x_offset, y_offset, y_invert, dblwidth */
687};
688
689static const pc090oj_interface opwolf_pc090oj_intf =
690{
691   0, 0, 0, 0
692};
693
694static const tc0140syt_interface opwolf_tc0140syt_intf =
695{
696   "maincpu", "audiocpu"
697};
698
699683static MACHINE_CONFIG_START( opwolf, opwolf_state )
700684
701685   /* basic machine hardware */
r29505r29506
723707   MCFG_PALETTE_ADD("palette", 8192)
724708   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
725709
726   MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf)
710   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
711   MCFG_PC080SN_GFX_REGION(1)
727712   MCFG_PC080SN_GFXDECODE("gfxdecode")
728713   MCFG_PC080SN_PALETTE("palette")
729   MCFG_PC090OJ_ADD("pc090oj", opwolf_pc090oj_intf)
714
715   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
730716   MCFG_PC090OJ_GFXDECODE("gfxdecode")
731717   MCFG_PC090OJ_PALETTE("palette")
732718
r29505r29506
751737   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
752738   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
753739
754   MCFG_TC0140SYT_ADD("tc0140syt", opwolf_tc0140syt_intf)
740   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
741   MCFG_TC0140SYT_MASTER_CPU("maincpu")
742   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
755743MACHINE_CONFIG_END
756744
757745
r29505r29506
785773   MCFG_PALETTE_ADD("palette", 8192)
786774   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
787775
788   MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf)
776   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
777   MCFG_PC080SN_GFX_REGION(1)
789778   MCFG_PC080SN_GFXDECODE("gfxdecode")
790779   MCFG_PC080SN_PALETTE("palette")
791   MCFG_PC090OJ_ADD("pc090oj", opwolf_pc090oj_intf)
780
781   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
792782   MCFG_PC090OJ_GFXDECODE("gfxdecode")
793783   MCFG_PC090OJ_PALETTE("palette")
794784
r29505r29506
813803   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.60)
814804   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.60)
815805
816   MCFG_TC0140SYT_ADD("tc0140syt", opwolf_tc0140syt_intf)
806   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
807   MCFG_TC0140SYT_MASTER_CPU("maincpu")
808   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
817809MACHINE_CONFIG_END
818810
819811
branches/new_menus/src/mame/drivers/jpmsys5.c
r29505r29506
646646
647647   MCFG_NVRAM_ADD_0FILL("nvram")
648648
649   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)//for debug ports
649   MCFG_S16LF01_ADD("vfd",0)//for debug ports
650650
651651   MCFG_MACHINE_START_OVERRIDE(jpmsys5_state,jpmsys5v)
652652   MCFG_MACHINE_RESET_OVERRIDE(jpmsys5_state,jpmsys5v)
r29505r29506
864864   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(jpmsys5_state, write_acia_clock))
865865
866866   MCFG_NVRAM_ADD_0FILL("nvram")
867   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
867   MCFG_S16LF01_ADD("vfd",0)
868868
869869   MCFG_MACHINE_START_OVERRIDE(jpmsys5_state,jpmsys5)
870870   MCFG_MACHINE_RESET_OVERRIDE(jpmsys5_state,jpmsys5)
r29505r29506
911911   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(jpmsys5_state, write_acia_clock))
912912
913913   MCFG_NVRAM_ADD_0FILL("nvram")
914   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
914   MCFG_S16LF01_ADD("vfd",0)
915915
916916   MCFG_MACHINE_START_OVERRIDE(jpmsys5_state,jpmsys5)
917917   MCFG_MACHINE_RESET_OVERRIDE(jpmsys5_state,jpmsys5)
branches/new_menus/src/mame/drivers/lemmings.c
r29505r29506
256256
257257
258258   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
259   decospr_device::set_gfx_region(*device, 1);
259   MCFG_DECO_SPRITE_GFX_REGION(1)
260260   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
261261   MCFG_DECO_SPRITE_PALETTE("palette")
262262
263263   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
264   decospr_device::set_gfx_region(*device, 0);
264   MCFG_DECO_SPRITE_GFX_REGION(0)
265265   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
266266   MCFG_DECO_SPRITE_PALETTE("palette")
267267
branches/new_menus/src/mame/drivers/nmg5.c
r29505r29506
10251025   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
10261026
10271027   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
1028   decospr_device::set_gfx_region(*device, 1);
1029   decospr_device::set_is_bootleg(*device, true);
1030   decospr_device::set_flipallx(*device, 1);
1031   decospr_device::set_offsets(*device, 0,8);
1028   MCFG_DECO_SPRITE_GFX_REGION(1)
1029   MCFG_DECO_SPRITE_ISBOOTLEG(true)
1030   MCFG_DECO_SPRITE_FLIPALLX(1)
1031   MCFG_DECO_SPRITE_OFFSETS(0, 8)
10321032   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
10331033   MCFG_DECO_SPRITE_PALETTE("palette")
10341034
branches/new_menus/src/mame/drivers/globalfr.c
r29505r29506
77  Motherboard contains very few major components
88
99  Missing sound roms? (or is sound data in the program roms?)
10  NOTE: VFD is guessed as 16 segment, need to know more
10  NOTE: VFD is guessed as Samsung 16 segment, need to know more
1111*******************************************************************************/
1212
1313
r29505r29506
2828      { }
2929
3030   required_device<cpu_device> m_maincpu;
31   optional_device<roc10937_t> m_vfd;
31   optional_device<s16lf01_t> m_vfd;
3232
3333// serial vfd
3434   int m_alpha_clock;
r29505r29506
7777   /* basic machine hardware */
7878   MCFG_CPU_ADD("maincpu", M37710, 4000000)
7979   MCFG_CPU_PROGRAM_MAP(globalfr_map)
80   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
80   MCFG_S16LF01_ADD("vfd",0)
8181   MCFG_DEFAULT_LAYOUT(layout_globalfr)
8282MACHINE_CONFIG_END
8383
branches/new_menus/src/mame/drivers/funkyjet.c
r29505r29506
347347   MCFG_DECO16IC_PALETTE("palette")
348348
349349   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
350   decospr_device::set_gfx_region(*device, 2);
350   MCFG_DECO_SPRITE_GFX_REGION(2)
351351   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
352352   MCFG_DECO_SPRITE_PALETTE("palette")
353353
branches/new_menus/src/mame/drivers/hvyunit.c
r29505r29506
625625      m_mastercpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
626626}
627627
628static const kaneko_pandora_interface hvyunit_pandora_config =
629{
630   0,          /* gfx_region */
631   0, 0        /* x_offs, y_offs */
632};
633
634
635628/*************************************
636629 *
637630 *  Machine driver
r29505r29506
660653
661654   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
662655
663
664656   MCFG_SCREEN_ADD("screen", RASTER)
665657   MCFG_SCREEN_REFRESH_RATE(58)
666658   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
r29505r29506
674666   MCFG_PALETTE_ADD("palette", 0x800)
675667   MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB)
676668
677   MCFG_KANEKO_PANDORA_ADD("pandora", hvyunit_pandora_config)
669   MCFG_DEVICE_ADD("pandora", KANEKO_PANDORA, 0)
678670   MCFG_KANEKO_PANDORA_GFXDECODE("gfxdecode")
679671   MCFG_KANEKO_PANDORA_PALETTE("palette")
680672
branches/new_menus/src/mame/drivers/mlanding.c
r29505r29506
742742   AM_RANGE(0x2b0006, 0x2b0007) AM_READ(analog2_lsb_r)
743743   AM_RANGE(0x2c0000, 0x2c0001) AM_READ(analog3_msb_r)
744744   AM_RANGE(0x2c0002, 0x2c0003) AM_READ(analog3_lsb_r)
745   AM_RANGE(0x2d0000, 0x2d0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
746   AM_RANGE(0x2d0002, 0x2d0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
745   AM_RANGE(0x2d0000, 0x2d0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
746   AM_RANGE(0x2d0002, 0x2d0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
747747ADDRESS_MAP_END
748748
749749
r29505r29506
797797   AM_RANGE(0x0000, 0x7fff) AM_ROM
798798   AM_RANGE(0x8000, 0x8fff) AM_RAM
799799   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
800   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
801   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
800   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
801   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
802802   AM_RANGE(0xb000, 0xb000) AM_WRITE(msm5205_2_start_w)
803803   AM_RANGE(0xc000, 0xc000) AM_WRITE(msm5205_2_stop_w)
804804   AM_RANGE(0xd000, 0xd000) AM_WRITE(msm5205_1_start_w)
r29505r29506
925925 *
926926 *************************************/
927927
928static const tc0140syt_interface mlanding_tc0140syt_intf =
929{
930   "maincpu", "audiocpu"
931};
932
933
934928static Z80CTC_INTERFACE( ctc_intf )
935929{
936930   DEVCB_NULL, // Interrupt handler
r29505r29506
970964   MCFG_CPU_IO_MAP(dsp_map_io)
971965
972966   MCFG_Z80CTC_ADD("ctc", 4000000, ctc_intf)
973   MCFG_TC0140SYT_ADD("tc0140syt", mlanding_tc0140syt_intf)
974967
968   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
969   MCFG_TC0140SYT_MASTER_CPU("maincpu")
970   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
971
975972   MCFG_QUANTUM_TIME(attotime::from_hz(600))
976973
977974   /* video hardware */
branches/new_menus/src/mame/drivers/dreambal.c
r29505r29506
5050   virtual void machine_start();
5151   virtual void machine_reset();
5252   UINT32 screen_update_dreambal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
53   int bank_callback(int bank);
53   DECO16IC_BANK_CB_MEMBER(bank_callback);
5454
5555   DECLARE_READ16_MEMBER( dreambal_protection_region_0_104_r );
5656   DECLARE_WRITE16_MEMBER( dreambal_protection_region_0_104_w );
r29505r29506
286286   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
287287INPUT_PORTS_END
288288
289int dreambal_state::bank_callback( int bank )
289DECO16IC_BANK_CB_MEMBER(dreambal_state::bank_callback)
290290{
291291   return ((bank >> 4) & 0x7) * 0x1000;
292292}
branches/new_menus/src/mame/drivers/galastrm.c
r29505r29506
277277
278278/***************************************************************************/
279279
280static const tc0100scn_interface galastrm_tc0100scn_intf =
281{
282   0, 2,       /* gfxnum, txnum */
283   -48, -56,       /* x_offset, y_offset */
284   0, 0,       /* flip_xoff, flip_yoff */
285   0, 0,       /* flip_text_xoff, flip_text_yoff */
286   0, 0
287};
288
289static const tc0480scp_interface galastrm_tc0480scp_intf =
290{
291   1, 3,       /* gfxnum, txnum */
292   0,      /* pixels */
293   -40, -3,        /* x_offset, y_offset */
294   0, 0,       /* text_xoff, text_yoff */
295   0, 0,       /* flip_xoff, flip_yoff */
296   0       /* col_base */
297};
298
299280static MACHINE_CONFIG_START( galastrm, galastrm_state )
300281   /* basic machine hardware */
301282   MCFG_CPU_ADD("maincpu", M68EC020, 16000000) /* 16 MHz */
r29505r29506
316297   MCFG_GFXDECODE_ADD("gfxdecode", "palette", galastrm)
317298   MCFG_PALETTE_ADD("palette", 4096)
318299
319
320   MCFG_TC0100SCN_ADD("tc0100scn", galastrm_tc0100scn_intf)
300   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
301   MCFG_TC0100SCN_GFX_REGION(0)
302   MCFG_TC0100SCN_TX_REGION(2)
303   MCFG_TC0100SCN_OFFSETS(-48, -56)
321304   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
322305   MCFG_TC0100SCN_PALETTE("palette")
323   MCFG_TC0480SCP_ADD("tc0480scp", galastrm_tc0480scp_intf)
306
307   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
308   MCFG_TC0480SCP_GFX_REGION(1)
309   MCFG_TC0480SCP_TX_REGION(3)
310   MCFG_TC0480SCP_OFFSETS(-40, -3)
324311   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
325312   MCFG_TC0480SCP_PALETTE("palette")
326313
branches/new_menus/src/mame/drivers/mirage.c
r29505r29506
8080   virtual void machine_reset();
8181   virtual void video_start();
8282   UINT32 screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
83   int bank_callback(int bank);
83   DECO16IC_BANK_CB_MEMBER(bank_callback);
8484};
8585
8686void miragemi_state::video_start()
r29505r29506
287287GFXDECODE_END
288288
289289
290int miragemi_state::bank_callback( int bank )
290DECO16IC_BANK_CB_MEMBER(miragemi_state::bank_callback)
291291{
292292   return ((bank >> 4) & 0x7) * 0x1000;
293293}
r29505r29506
343343   MCFG_DECO16IC_PALETTE("palette")
344344
345345   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
346   decospr_device::set_gfx_region(*device, 2);
346   MCFG_DECO_SPRITE_GFX_REGION(2)
347347   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
348348   MCFG_DECO_SPRITE_PALETTE("palette")
349349
branches/new_menus/src/mame/drivers/dietgo.c
r29505r29506
189189   GFXDECODE_ENTRY( "gfx2", 0, spritelayout,      512, 16 )    /* Sprites (16x16) */
190190GFXDECODE_END
191191
192int dietgo_state::bank_callback(int bank)
192DECO16IC_BANK_CB_MEMBER(dietgo_state::bank_callback)
193193{
194194   return ((bank >> 4) & 0x7) * 0x1000;
195195}
r29505r29506
241241   MCFG_DECO16IC_PALETTE("palette")
242242
243243   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
244   decospr_device::set_gfx_region(*device, 2);
244   MCFG_DECO_SPRITE_GFX_REGION(2)
245245   MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
246246   MCFG_DECO_SPRITE_PALETTE("palette")
247247
branches/new_menus/src/mame/drivers/wgp.c
r29505r29506
610610WRITE16_MEMBER(wgp_state::wgp_sound_w)
611611{
612612   if (offset == 0)
613      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
613      m_tc0140syt->master_port_w(space, 0, data & 0xff);
614614   else if (offset == 1)
615      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
615      m_tc0140syt->master_comm_w(space, 0, data & 0xff);
616616}
617617
618618READ16_MEMBER(wgp_state::wgp_sound_r)
619619{
620620   if (offset == 1)
621      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff));
621      return ((m_tc0140syt->master_comm_r(space, 0) & 0xff));
622622   else
623623      return 0;
624624}
r29505r29506
667667   AM_RANGE(0x0000, 0x7fff) AM_ROM
668668   AM_RANGE(0xc000, 0xdfff) AM_RAM
669669   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
670   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
671   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
670   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
671   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
672672   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
673673   AM_RANGE(0xea00, 0xea00) AM_READNOP
674674   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
933933   machine().save().register_postload(save_prepost_delegate(FUNC(wgp_state::wgp_postload), this));
934934}
935935
936static const tc0100scn_interface wgp_tc0100scn_intf =
937{
938   1, 3,       /* gfxnum, txnum */
939   0, 0,       /* x_offset, y_offset */
940   0, 0,       /* flip_xoff, flip_yoff */
941   0, 0,       /* flip_text_xoff, flip_text_yoff */
942   0, 0
943};
944
945static const tc0100scn_interface wgp2_tc0100scn_intf =
946{
947   1, 3,       /* gfxnum, txnum */
948   4, 2,       /* x_offset, y_offset */
949   0, 0,       /* flip_xoff, flip_yoff */
950   0, 0,       /* flip_text_xoff, flip_text_yoff */
951   0, 0
952};
953
954static const tc0140syt_interface wgp_tc0140syt_intf =
955{
956   "sub", "audiocpu"
957};
958
959936static MACHINE_CONFIG_START( wgp, wgp_state )
960937
961938   /* basic machine hardware */
r29505r29506
993970   MCFG_PALETTE_ADD("palette", 4096)
994971   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
995972
996   MCFG_TC0100SCN_ADD("tc0100scn", wgp_tc0100scn_intf)
973   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
974   MCFG_TC0100SCN_GFX_REGION(1)
975   MCFG_TC0100SCN_TX_REGION(3)
997976   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
998977   MCFG_TC0100SCN_PALETTE("palette")
999978
r29505r29506
1007986   MCFG_SOUND_ROUTE(1, "lspeaker",  1.0)
1008987   MCFG_SOUND_ROUTE(2, "rspeaker", 1.0)
1009988
1010   MCFG_TC0140SYT_ADD("tc0140syt", wgp_tc0140syt_intf)
989   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
990   MCFG_TC0140SYT_MASTER_CPU("sub")
991   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
1011992MACHINE_CONFIG_END
1012993
1013994
r29505r29506
1017998   /* video hardware */
1018999   MCFG_VIDEO_START_OVERRIDE(wgp_state,wgp2)
10191000
1020   MCFG_DEVICE_REMOVE("tc0100scn")
1021   MCFG_TC0100SCN_ADD("tc0100scn", wgp2_tc0100scn_intf)
1001   MCFG_DEVICE_MODIFY("tc0100scn")
1002   MCFG_TC0100SCN_OFFSETS(4, 2)
10221003   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
10231004   MCFG_TC0100SCN_PALETTE("palette")
10241005MACHINE_CONFIG_END
branches/new_menus/src/mame/drivers/taito_o.c
r29505r29506
230230   DEVCB_NULL, DEVCB_NULL,
231231};
232232
233static const tc0080vco_interface parentj_intf =
234{
235   0, 1,   /* gfxnum, txnum */
236   1, 1, -2,
237   0
238};
239
240233void taitoo_state::machine_start()
241234{
242235}
r29505r29506
260253   MCFG_PALETTE_ADD("palette", 33*16)
261254   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
262255
263   MCFG_TC0080VCO_ADD("tc0080vco", parentj_intf)
256   MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0)
257   MCFG_TC0080VCO_GFX_REGION(0)
258   MCFG_TC0080VCO_TX_REGION(1)
259   MCFG_TC0080VCO_OFFSETS(1, 1)
260   MCFG_TC0080VCO_BGFLIP_OFFS(-2)
264261   MCFG_TC0080VCO_GFXDECODE("gfxdecode")
265262   MCFG_TC0080VCO_PALETTE("palette")
266263
branches/new_menus/src/mame/drivers/plygonet.c
r29505r29506
643643   m_sound_intck = state;
644644}
645645
646
647static const k053936_interface polygonet_k053936_intf =
648{
649   0, 0, 0 /* wrap, xoff, yoff */
650};
651
652646static MACHINE_CONFIG_START( plygonet, polygonet_state )
653647
654648   MCFG_CPU_ADD("maincpu", M68EC020, XTAL_32MHz/2)
r29505r29506
679673
680674   MCFG_PALETTE_ADD("palette", 32768)
681675
682   MCFG_K053936_ADD("k053936", polygonet_k053936_intf)
676   MCFG_DEVICE_ADD("k053936", K053936, 0)
683677
684678   /* sound hardware */
685679   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
branches/new_menus/src/mame/drivers/warriorb.c
r29505r29506
173173WRITE16_MEMBER(warriorb_state::warriorb_sound_w)
174174{
175175   if (offset == 0)
176      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
176      m_tc0140syt->master_port_w(space, 0, data & 0xff);
177177   else if (offset == 1)
178      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
178      m_tc0140syt->master_comm_w(space, 0, data & 0xff);
179179}
180180
181181READ16_MEMBER(warriorb_state::warriorb_sound_r)
182182{
183183   if (offset == 1)
184      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff));
184      return ((m_tc0140syt->master_comm_r(space, 0) & 0xff));
185185   else
186186      return 0;
187187}
r29505r29506
254254   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
255255   AM_RANGE(0xc000, 0xdfff) AM_RAM
256256   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
257   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
258   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
257   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
258   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
259259   AM_RANGE(0xe400, 0xe403) AM_WRITE(warriorb_pancontrol) /* pan */
260260   AM_RANGE(0xea00, 0xea00) AM_READNOP
261261   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
423423                       MACHINE DRIVERS
424424***********************************************************/
425425
426static const tc0100scn_interface darius2d_tc0100scn_intf_l =
427{
428   1, 3,       /* gfxnum, txnum */
429   4, 0,       /* x_offset, y_offset */
430   0, 0,       /* flip_xoff, flip_yoff */
431   0, 0,       /* flip_text_xoff, flip_text_yoff */
432   0, 0
433};
434
435static const tc0100scn_interface darius2d_tc0100scn_intf_r =
436{
437   2, 3,       /* gfxnum, txnum */
438   4, 0,       /* x_offset, y_offset */
439   0, 0,       /* flip_xoff, flip_yoff */
440   0, 0,       /* flip_text_xoff, flip_text_yoff */
441   0, 1
442};
443
444static const tc0100scn_interface warriorb_tc0100scn_intf_l =
445{
446   1, 3,       /* gfxnum, txnum */
447   4, 0,       /* x_offset, y_offset */
448   0, 0,       /* flip_xoff, flip_yoff */
449   0, 0,       /* flip_text_xoff, flip_text_yoff */
450   0, 0
451};
452
453static const tc0100scn_interface warriorb_tc0100scn_intf_r =
454{
455   2, 3,       /* gfxnum, txnum */
456   4, 0,       /* x_offset, y_offset */
457   0, 0,       /* flip_xoff, flip_yoff */
458   0, 0,       /* flip_text_xoff, flip_text_yoff */
459   1, 1
460};
461
462
463static const tc0140syt_interface warriorb_tc0140syt_intf =
464{
465   "maincpu", "audiocpu"
466};
467
468
469426void warriorb_state::machine_start()
470427{
471428   membank("bank10")->configure_entries(0, 8, memregion("audiocpu")->base() + 0xc000, 0x4000);
r29505r29506
515472   MCFG_SCREEN_UPDATE_DRIVER(warriorb_state, screen_update_warriorb_left)
516473   MCFG_SCREEN_PALETTE("palette")
517474
475   MCFG_DEVICE_ADD("tc0100scn_1", TC0100SCN, 0)
476   MCFG_TC0100SCN_GFX_REGION(1)
477   MCFG_TC0100SCN_TX_REGION(3)
478   MCFG_TC0100SCN_OFFSETS(4, 0)
479   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
480   MCFG_TC0100SCN_PALETTE("palette")
481
482   MCFG_TC0110PCR_ADD("tc0110pcr_1")
483   MCFG_TC0110PCR_PALETTE("palette")
484
518485   MCFG_SCREEN_ADD("rscreen", RASTER)
519486   MCFG_SCREEN_REFRESH_RATE(60)
520487   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
r29505r29506
523490   MCFG_SCREEN_UPDATE_DRIVER(warriorb_state, screen_update_warriorb_right)
524491   MCFG_SCREEN_PALETTE("palette2")
525492
526   MCFG_TC0100SCN_ADD("tc0100scn_1", darius2d_tc0100scn_intf_l)
493   MCFG_DEVICE_ADD("tc0100scn_2", TC0100SCN, 0)
494   MCFG_TC0100SCN_GFX_REGION(2)
495   MCFG_TC0100SCN_TX_REGION(3)
496   MCFG_TC0100SCN_OFFSETS(4, 0)
497   MCFG_TC0100SCN_MULTISCR_HACK(1)
527498   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
528   MCFG_TC0100SCN_PALETTE("palette")
529
530   MCFG_TC0100SCN_ADD("tc0100scn_2", darius2d_tc0100scn_intf_r)
531   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
532499   MCFG_TC0100SCN_PALETTE("palette2")
533500
534   MCFG_TC0110PCR_ADD("tc0110pcr_1")
535   MCFG_TC0110PCR_PALETTE("palette")
536501   MCFG_TC0110PCR_ADD("tc0110pcr_2")
537502   MCFG_TC0110PCR_PALETTE("palette2")
538503
r29505r29506
557522   MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
558523   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
559524
560   MCFG_TC0140SYT_ADD("tc0140syt", warriorb_tc0140syt_intf)
525   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
526   MCFG_TC0140SYT_MASTER_CPU("maincpu")
527   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
561528MACHINE_CONFIG_END
562529
563530
r29505r29506
593560   MCFG_SCREEN_UPDATE_DRIVER(warriorb_state, screen_update_warriorb_left)
594561   MCFG_SCREEN_PALETTE("palette")
595562
563   MCFG_DEVICE_ADD("tc0100scn_1", TC0100SCN, 0)
564   MCFG_TC0100SCN_GFX_REGION(1)
565   MCFG_TC0100SCN_TX_REGION(3)
566   MCFG_TC0100SCN_OFFSETS(4, 0)
567   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
568   MCFG_TC0100SCN_PALETTE("palette")
569
570   MCFG_TC0110PCR_ADD("tc0110pcr_1")
571   MCFG_TC0110PCR_PALETTE("palette")
572
596573   MCFG_SCREEN_ADD("rscreen", RASTER)
597574   MCFG_SCREEN_REFRESH_RATE(60)
598575   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
r29505r29506
601578   MCFG_SCREEN_UPDATE_DRIVER(warriorb_state, screen_update_warriorb_right)
602579   MCFG_SCREEN_PALETTE("palette2")
603580
604   MCFG_TC0100SCN_ADD("tc0100scn_1", warriorb_tc0100scn_intf_l)
581   MCFG_DEVICE_ADD("tc0100scn_2", TC0100SCN, 0)
582   MCFG_TC0100SCN_GFX_REGION(2)
583   MCFG_TC0100SCN_TX_REGION(3)
584   MCFG_TC0100SCN_OFFSETS(4, 0)
585   MCFG_TC0100SCN_MULTISCR_XOFFS(1)
586   MCFG_TC0100SCN_MULTISCR_HACK(1)
605587   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
606   MCFG_TC0100SCN_PALETTE("palette")
607
608   MCFG_TC0100SCN_ADD("tc0100scn_2", warriorb_tc0100scn_intf_r)
609   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
610588   MCFG_TC0100SCN_PALETTE("palette2")
611589
612   MCFG_TC0110PCR_ADD("tc0110pcr_1")
613   MCFG_TC0110PCR_PALETTE("palette")
614590   MCFG_TC0110PCR_ADD("tc0110pcr_2")
615591   MCFG_TC0110PCR_PALETTE("palette2")
616592
r29505r29506
635611   MCFG_FILTER_VOLUME_ADD("2610.2.r", 0)
636612   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
637613
638   MCFG_TC0140SYT_ADD("tc0140syt", warriorb_tc0140syt_intf)
614   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
615   MCFG_TC0140SYT_MASTER_CPU("maincpu")
616   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
639617MACHINE_CONFIG_END
640618
641619
branches/new_menus/src/mame/drivers/zn.c
r29505r29506
11131113static ADDRESS_MAP_START(coh1000ta_map, AS_PROGRAM, 32, zn_state)
11141114   AM_RANGE(0x1f000000, 0x1f7fffff) AM_ROMBANK("bankedroms")
11151115   AM_RANGE(0x1fb40000, 0x1fb40003) AM_WRITE8(bank_coh1000t_w, 0x000000ff)
1116   AM_RANGE(0x1fb80000, 0x1fb80003) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x000000ff)
1117   AM_RANGE(0x1fb80000, 0x1fb80003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff0000)
1116   AM_RANGE(0x1fb80000, 0x1fb80003) AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x000000ff)
1117   AM_RANGE(0x1fb80000, 0x1fb80003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff0000)
11181118
11191119   AM_IMPORT_FROM(zn_map)
11201120ADDRESS_MAP_END
r29505r29506
11291129   AM_RANGE(0x0000, 0x7fff) AM_ROM
11301130   AM_RANGE(0xc000, 0xdfff) AM_RAM
11311131   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
1132   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
1133   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
1132   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
1133   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
11341134   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
11351135   AM_RANGE(0xee00, 0xee00) AM_NOP /* ? */
11361136   AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ? */
r29505r29506
11431143   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
11441144}
11451145
1146static const tc0140syt_interface coh1000ta_tc0140syt_intf =
1147{
1148   "maincpu", "audiocpu"
1149};
1150
11511146static MACHINE_CONFIG_DERIVED( coh1000ta, zn1_1mb_vram )
11521147   MCFG_CPU_MODIFY("maincpu")
11531148   MCFG_CPU_PROGRAM_MAP(coh1000ta_map)
r29505r29506
11651160
11661161   MCFG_MB3773_ADD("mb3773")
11671162
1168   MCFG_TC0140SYT_ADD("tc0140syt", coh1000ta_tc0140syt_intf)
1163   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
1164   MCFG_TC0140SYT_MASTER_CPU("maincpu")
1165   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
11691166MACHINE_CONFIG_END
11701167
11711168WRITE8_MEMBER(zn_state::fx1b_fram_w)
branches/new_menus/src/mame/drivers/cave.c
r29505r29506
20672067                                    Donpachi
20682068***************************************************************************/
20692069
2070static const nmk112_interface donpachi_nmk112_intf =
2071{
2072   "oki1", "oki2", 1 << 0  // chip #0 (music) is not paged
2073};
2074
20752070static MACHINE_CONFIG_START( donpachi, cave_state )
20762071
20772072   /* basic machine hardware */
r29505r29506
21102105   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
21112106   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
21122107
2113   MCFG_NMK112_ADD("nmk112", donpachi_nmk112_intf)
2108   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
2109   MCFG_NMK112_ROM0("oki1")
2110   MCFG_NMK112_ROM1("oki2")
2111   MCFG_NMK112_DISABLE_PAGEMASK(1 << 0)   // chip #0 (music) is not paged
21142112MACHINE_CONFIG_END
21152113
21162114
r29505r29506
25782576
25792577/*  X1 = 12 MHz, X2 = 28 MHz, X3 = 16 MHz. OKI: / 165 mode A ; / 132 mode B */
25802578
2581static const nmk112_interface pwrinst2_nmk112_intf =
2582{
2583   "oki1", "oki2", 0
2584};
2585
25862579static MACHINE_CONFIG_START( pwrinst2, cave_state )
25872580
25882581   /* basic machine hardware */
r29505r29506
26372630   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
26382631   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
26392632
2640   MCFG_NMK112_ADD("nmk112", pwrinst2_nmk112_intf)
2633   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
2634   MCFG_NMK112_ROM0("oki1")
2635   MCFG_NMK112_ROM1("oki2")
26412636MACHINE_CONFIG_END
26422637
26432638
branches/new_menus/src/mame/drivers/rastan.c
r29505r29506
212212   AM_RANGE(0x390008, 0x390009) AM_READ_PORT("DSWA")
213213   AM_RANGE(0x39000a, 0x39000b) AM_READ_PORT("DSWB")
214214   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(watchdog_reset16_w)
215   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
216   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
215   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0x00ff)
216   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0x00ff)
217217   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("pc080sn", pc080sn_device, word_r, word_w)
218218   AM_RANGE(0xc20000, 0xc20003) AM_DEVWRITE("pc080sn", pc080sn_device, yscroll_word_w)
219219   AM_RANGE(0xc40000, 0xc40003) AM_DEVWRITE("pc080sn", pc080sn_device, xscroll_word_w)
r29505r29506
227227   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
228228   AM_RANGE(0x8000, 0x8fff) AM_RAM
229229   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
230   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
231   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
230   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
231   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
232232   AM_RANGE(0xb000, 0xb000) AM_WRITE(rastan_msm5205_address_w)
233233   AM_RANGE(0xc000, 0xc000) AM_WRITE(rastan_msm5205_start_w)
234234   AM_RANGE(0xd000, 0xd000) AM_WRITE(rastan_msm5205_stop_w)
r29505r29506
356356}
357357
358358
359static const pc080sn_interface rastan_pc080sn_intf =
360{
361   0,   /* gfxnum */
362   0, 0, 0, 0  /* x_offset, y_offset, y_invert, dblwidth */
363};
364
365static const pc090oj_interface rastan_pc090oj_intf =
366{
367   1, 0, 0, 0
368};
369
370static const tc0140syt_interface rastan_tc0140syt_intf =
371{
372   "maincpu", "audiocpu"
373};
374
375359static MACHINE_CONFIG_START( rastan, rastan_state )
376360
377361   /* basic machine hardware */
r29505r29506
398382   MCFG_PALETTE_ADD("palette", 8192)
399383   MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
400384
401   MCFG_PC080SN_ADD("pc080sn", rastan_pc080sn_intf)
385   MCFG_DEVICE_ADD("pc080sn", PC080SN, 0)
402386   MCFG_PC080SN_GFXDECODE("gfxdecode")
403387   MCFG_PC080SN_PALETTE("palette")
404   MCFG_PC090OJ_ADD("pc090oj", rastan_pc090oj_intf)
388
389   MCFG_DEVICE_ADD("pc090oj", PC090OJ, 0)
390   MCFG_PC090OJ_GFX_REGION(1)
405391   MCFG_PC090OJ_GFXDECODE("gfxdecode")
406392   MCFG_PC090OJ_PALETTE("palette")
407393
r29505r29506
419405   MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B)      /* 8 kHz */
420406   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
421407
422   MCFG_TC0140SYT_ADD("tc0140syt", rastan_tc0140syt_intf)
408   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
409   MCFG_TC0140SYT_MASTER_CPU("maincpu")
410   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
423411MACHINE_CONFIG_END
424412
425413
branches/new_menus/src/mame/drivers/othunder.c
r29505r29506
391391WRITE16_MEMBER(othunder_state::othunder_sound_w)
392392{
393393   if (offset == 0)
394      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
394      m_tc0140syt->master_port_w(space, 0, data & 0xff);
395395   else if (offset == 1)
396      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
396      m_tc0140syt->master_comm_w(space, 0, data & 0xff);
397397}
398398
399399READ16_MEMBER(othunder_state::othunder_sound_r)
400400{
401401   if (offset == 1)
402      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff));
402      return ((m_tc0140syt->master_comm_r(space, 0) & 0xff));
403403   else
404404      return 0;
405405}
r29505r29506
460460   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
461461   AM_RANGE(0xc000, 0xdfff) AM_RAM
462462   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
463   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
464   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
463   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
464   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
465465   AM_RANGE(0xe400, 0xe403) AM_WRITE(othunder_TC0310FAM_w) /* pan */
466466   AM_RANGE(0xe600, 0xe600) AM_WRITENOP /* ? */
467467   AM_RANGE(0xea00, 0xea00) AM_READ_PORT(ROTARY_PORT_TAG)  /* rotary input */
r29505r29506
623623                 MACHINE DRIVERS
624624***********************************************************/
625625
626static const tc0100scn_interface othunder_tc0100scn_intf =
627{
628   1, 2,       /* gfxnum, txnum */
629   4, 0,       /* x_offset, y_offset */
630   0, 0,       /* flip_xoff, flip_yoff */
631   0, 0,       /* flip_text_xoff, flip_text_yoff */
632   0, 0
633};
634
635static const tc0140syt_interface othunder_tc0140syt_intf =
636{
637   "maincpu", "audiocpu"
638};
639
640626void othunder_state::machine_start()
641627{
642628   membank("bank10")->configure_entries(0, 4, memregion("audiocpu")->base() + 0xc000, 0x4000);
r29505r29506
688674   MCFG_GFXDECODE_ADD("gfxdecode", "palette", othunder)
689675   MCFG_PALETTE_ADD("palette", 4096)
690676
691
692   MCFG_TC0100SCN_ADD("tc0100scn", othunder_tc0100scn_intf)
677   MCFG_DEVICE_ADD("tc0100scn", TC0100SCN, 0)
678   MCFG_TC0100SCN_GFX_REGION(1)
679   MCFG_TC0100SCN_TX_REGION(2)
680   MCFG_TC0100SCN_OFFSETS(4, 0)
693681   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
694682   MCFG_TC0100SCN_PALETTE("palette")
695683
r29505r29506
721709   MCFG_FILTER_VOLUME_ADD("2610.2r", 0)
722710   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
723711
724   MCFG_TC0140SYT_ADD("tc0140syt", othunder_tc0140syt_intf)
712   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
713   MCFG_TC0140SYT_MASTER_CPU("maincpu")
714   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
725715MACHINE_CONFIG_END
726716
727717
branches/new_menus/src/mame/drivers/bfmsys85.c
r29505r29506
415415   MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4)          // 6809 CPU at 1 Mhz
416416   MCFG_CPU_PROGRAM_MAP(memmap)                        // setup read and write memorymap
417417   MCFG_CPU_PERIODIC_INT_DRIVER(bfmsys85_state, timer_irq,  1000)              // generate 1000 IRQ's per second
418   MCFG_MSC1937_ADD("vfd",0,RIGHT_TO_LEFT)
418   MCFG_MSC1937_ADD("vfd",0)
419419
420420   MCFG_DEVICE_ADD("acia6850_0", ACIA6850, 0)
421421   MCFG_ACIA6850_TXD_HANDLER(WRITELINE(bfmsys85_state,sys85_data_w))
branches/new_menus/src/mame/drivers/taito_b.c
r29505r29506
474474   AM_RANGE(0x200000, 0x201fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
475475   AM_RANGE(0x600000, 0x607fff) AM_RAM /* Main RAM */ /*ashura up to 603fff only*/
476476   TC0180VCU_MEMRW( 0x400000 )
477   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
478   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
477   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
478   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
479479   AM_RANGE(0xa00000, 0xa0000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0xff00)
480480ADDRESS_MAP_END
481481
r29505r29506
484484   AM_RANGE(0x000000, 0x07ffff) AM_ROM
485485   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0xff00)
486486   TC0180VCU_MEMRW( 0x400000 )
487   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
488   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
487   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
488   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
489489   AM_RANGE(0x800000, 0x801fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
490490   AM_RANGE(0xa00000, 0xa0ffff) AM_RAM /* Main RAM */
491491ADDRESS_MAP_END
r29505r29506
493493
494494static ADDRESS_MAP_START( tetrist_map, AS_PROGRAM, 16, taitob_state )
495495   AM_RANGE(0x000000, 0x07ffff) AM_ROM
496   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
497   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
496   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
497   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
498498   TC0180VCU_MEMRW( 0x400000 )
499499   AM_RANGE(0x600000, 0x60000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0xff00)
500500   AM_RANGE(0x800000, 0x807fff) AM_RAM /* Main RAM */
r29505r29506
508508   AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, portreg_r, portreg_w, 0xff00)
509509   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, port_r, port_w, 0xff00)
510510   AM_RANGE(0x800000, 0x803fff) AM_RAM /* Main RAM */
511   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
512   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
511   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
512   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
513513ADDRESS_MAP_END
514514
515515
r29505r29506
518518   TC0180VCU_MEMRW( 0x400000 )
519519   AM_RANGE(0x600000, 0x60000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0xff00)
520520   AM_RANGE(0x610000, 0x610001) AM_READ_PORT("P3_P4")
521   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
522   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
521   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
522   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
523523   AM_RANGE(0x800000, 0x803fff) AM_RAM /* Main RAM */
524524   AM_RANGE(0xa00000, 0xa01fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
525525   AM_RANGE(0xb00000, 0xb7ffff) AM_RAM_WRITE(hitice_pixelram_w) AM_SHARE("pixelram")
r29505r29506
531531
532532static ADDRESS_MAP_START( rambo3_map, AS_PROGRAM, 16, taitob_state )
533533   AM_RANGE(0x000000, 0x07ffff) AM_ROM
534   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
535   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
534   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
535   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
536536   TC0180VCU_MEMRW( 0x400000 )
537537   AM_RANGE(0x600000, 0x60000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0xff00)
538538   AM_RANGE(0x600010, 0x600011) AM_READ(tracky1_lo_r) /*player 1*/
r29505r29506
557557   AM_RANGE(0x500028, 0x500029) AM_WRITE(player_34_coin_ctrl_w)    /* simply locks coins 3&4 out */
558558   AM_RANGE(0x50002e, 0x50002f) AM_READ_PORT("P3_P4_B")        /* shown in service mode, game omits to read it */
559559   AM_RANGE(0x600000, 0x600003) AM_WRITE(gain_control_w)
560   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
561   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
560   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
561   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
562562   AM_RANGE(0x800000, 0x801fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
563563   AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */
564564ADDRESS_MAP_END
r29505r29506
573573   AM_RANGE(0x500028, 0x500029) AM_WRITE(player_34_coin_ctrl_w)    /* simply locks coins 3&4 out */
574574   AM_RANGE(0x50002e, 0x50002f) AM_READ_PORT("P3_P4_B")
575575   AM_RANGE(0x600000, 0x600003) AM_WRITE(gain_control_w)
576   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
577   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
576   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
577   AM_RANGE(0x700002, 0x700003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
578578   AM_RANGE(0x800000, 0x801fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
579579   AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */
580580ADDRESS_MAP_END
581581
582582static ADDRESS_MAP_START( spacedxo_map, AS_PROGRAM, 16, taitob_state )
583583   AM_RANGE(0x000000, 0x07ffff) AM_ROM
584   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
585   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
584   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
585   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
586586   AM_RANGE(0x200000, 0x20000f) AM_DEVREAD8("tc0220ioc", tc0220ioc_device, read, 0x00ff) AM_WRITE(spacedxo_tc0220ioc_w)
587587   AM_RANGE(0x210000, 0x210001) AM_READ_PORT("IN3")
588588   AM_RANGE(0x220000, 0x220001) AM_READ_PORT("IN4")
r29505r29506
602602   AM_RANGE(0x200028, 0x200029) AM_READWRITE(player_34_coin_ctrl_r, player_34_coin_ctrl_w)
603603   AM_RANGE(0x20002e, 0x20002f) AM_READ_PORT("P3_P4_B")    /* player 3,4 buttons */
604604   TC0180VCU_MEMRW( 0x400000 )
605   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
606   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
605   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
606   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
607607   AM_RANGE(0x700000, 0x700003) AM_WRITE(gain_control_w)
608608   AM_RANGE(0x800000, 0x801fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
609609   AM_RANGE(0x900000, 0x90ffff) AM_RAM /* Main RAM */
r29505r29506
612612
613613static ADDRESS_MAP_START( viofight_map, AS_PROGRAM, 16, taitob_state )
614614   AM_RANGE(0x000000, 0x07ffff) AM_ROM
615   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
616   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
615   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
616   AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
617617   TC0180VCU_MEMRW( 0x400000 )
618618   AM_RANGE(0x600000, 0x601fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
619619   AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0xff00)
r29505r29506
628628   AM_RANGE(0x600000, 0x601fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
629629   AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, portreg_r, portreg_w, 0xff00)
630630   AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, port_r, port_w, 0xff00)
631   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
632   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
631   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
632   AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
633633ADDRESS_MAP_END
634634
635635
636636static ADDRESS_MAP_START( silentd_map, AS_PROGRAM, 16, taitob_state )
637637   AM_RANGE(0x000000, 0x07ffff) AM_ROM
638   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
639   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
638   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
639   AM_RANGE(0x100002, 0x100003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
640640//  AM_RANGE(0x10001a, 0x10001b) AM_READNOP // ??? read at $1e344
641641//  AM_RANGE(0x10001c, 0x10001d) AM_READNOP // ??? read at $1e356
642642   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
r29505r29506
658658   AM_RANGE(0x300000, 0x301fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
659659   AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0xff00)
660660   AM_RANGE(0x410000, 0x41000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0xff00) /* mirror address - seems to be only used for coin control */
661   AM_RANGE(0x500000, 0x500001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
662   AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
661   AM_RANGE(0x500000, 0x500001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
662   AM_RANGE(0x500002, 0x500003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
663663ADDRESS_MAP_END
664664
665665
r29505r29506
668668   AM_RANGE(0x100000, 0x10ffff) AM_RAM /* Main RAM */
669669   AM_RANGE(0x200000, 0x201fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
670670   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_wordswap_r, halfword_wordswap_w)
671   AM_RANGE(0x320000, 0x320001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
672   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
671   AM_RANGE(0x320000, 0x320001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
672   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w, 0xff00)
673673   TC0180VCU_MEMRW( 0x900000 )
674674ADDRESS_MAP_END
675675
r29505r29506
680680   AM_RANGE(0x130000, 0x13ffff) AM_RAM // Check me
681681   AM_RANGE(0x180000, 0x18000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_wordswap_r, halfword_wordswap_w)
682682   AM_RANGE(0x184000, 0x184001) AM_WRITE(realpunc_video_ctrl_w)
683   AM_RANGE(0x188000, 0x188001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
684   AM_RANGE(0x188002, 0x188003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_w, 0xff00)
683   AM_RANGE(0x188000, 0x188001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_port_w, 0xff00)
684   AM_RANGE(0x188002, 0x188003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_comm_w, 0xff00)
685685   AM_RANGE(0x18c000, 0x18c001) AM_WRITE(realpunc_output_w)
686686   TC0180VCU_MEMRW( 0x200000 )
687687   AM_RANGE(0x280000, 0x281fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
688688   AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE("hd63484", hd63484_device, status_r, address_w)
689689   AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
690690//  AM_RANGE(0x320000, 0x320001) AM_NOP // ?
691   AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_w, 0xff00)
691   AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_comm_w, 0xff00)
692692ADDRESS_MAP_END
693693
694694static ADDRESS_MAP_START( masterw_sound_map, AS_PROGRAM, 8, taitob_state )
r29505r29506
696696   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
697697   AM_RANGE(0x8000, 0x8fff) AM_RAM
698698   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
699   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
700   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
699   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
700   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
701701ADDRESS_MAP_END
702702
703703static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, taitob_state )
r29505r29506
705705   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
706706   AM_RANGE(0xc000, 0xdfff) AM_RAM
707707   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
708   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
709   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
708   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
709   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
710710   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
711711   AM_RANGE(0xe600, 0xe600) AM_WRITENOP /* ? */
712712   AM_RANGE(0xea00, 0xea00) AM_READNOP
r29505r29506
721721   AM_RANGE(0x8000, 0x8fff) AM_RAM
722722   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
723723   AM_RANGE(0xb000, 0xb001) AM_DEVREADWRITE("oki", okim6295_device, read, write)       /* yes, both addresses for the same chip */
724   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
725   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r, tc0140syt_slave_comm_w)
724   AM_RANGE(0xa000, 0xa000) AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
725   AM_RANGE(0xa001, 0xa001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r, slave_comm_w)
726726ADDRESS_MAP_END
727727
728728
r29505r29506
19061906   }
19071907}
19081908
1909/* this is the basic layout used in: Nastar, Ashura Blaster, Hit the Ice, Rambo3, Tetris */
1910static const tc0180vcu_interface color0_tc0180vcu_intf =
1911{
1912   0xc0,       /* background */
1913   0x80,       /* foreground */
1914   0x00        /* text       */
1915};
19161909
1917/* this is the reversed layout used in: Crime City, Puzzle Bobble */
1918static const tc0180vcu_interface color1_tc0180vcu_intf =
1919{
1920   0x00,       /* background */
1921   0x40,       /* foreground */
1922   0xc0        /* text       */
1923};
1924
1925/* this is used in: rambo3a, masterw, silentd, selfeena, ryujin */
1926static const tc0180vcu_interface color2_tc0180vcu_intf =
1927{
1928   0x30,       /* background */
1929   0x20,       /* foreground */
1930   0x00        /* text       */
1931};
1932
1933
1934static const tc0140syt_interface taitob_tc0140syt_intf =
1935{
1936   "maincpu", "audiocpu"
1937};
1938
19391910void taitob_state::machine_start()
19401911{
19411912   m_ym = machine().device("ymsnd");
r29505r29506
19861957
19871958   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
19881959
1989   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
1960   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
1961   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
1962   MCFG_TC0180VCU_FG_COLORBASE(0x80)
1963   MCFG_TC0180VCU_TX_COLORBASE(0x00)
19901964   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
19911965
19921966   /* sound hardware */
r29505r29506
19981972   MCFG_SOUND_ROUTE(1, "mono", 1.0)
19991973   MCFG_SOUND_ROUTE(2, "mono", 1.0)
20001974
2001   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
1975   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
1976   MCFG_TC0140SYT_MASTER_CPU("maincpu")
1977   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
20021978MACHINE_CONFIG_END
20031979
20041980
r29505r29506
20372013
20382014   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
20392015
2040   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2016   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2017   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2018   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2019   MCFG_TC0180VCU_TX_COLORBASE(0x00)
20412020   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
20422021
20432022   /* sound hardware */
r29505r29506
20512030   MCFG_SOUND_ROUTE(2, "mono", 0.25)
20522031   MCFG_SOUND_ROUTE(3, "mono", 0.80)
20532032
2054   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2033   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2034   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2035   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
20552036MACHINE_CONFIG_END
20562037
20572038
r29505r29506
21072088
21082089   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
21092090
2110   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2091   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2092   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2093   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2094   MCFG_TC0180VCU_TX_COLORBASE(0x00)
21112095   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
21122096
21132097   /* sound hardware */
r29505r29506
21192103   MCFG_SOUND_ROUTE(1, "mono", 1.0)
21202104   MCFG_SOUND_ROUTE(2, "mono", 1.0)
21212105
2122   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2106   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2107   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2108   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
21232109MACHINE_CONFIG_END
21242110
21252111
r29505r29506
21582144
21592145   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1)
21602146
2161   MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf)
2147   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2148   MCFG_TC0180VCU_BG_COLORBASE(0x00)
2149   MCFG_TC0180VCU_FG_COLORBASE(0x40)
2150   MCFG_TC0180VCU_TX_COLORBASE(0xc0)
21622151   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
21632152
21642153   /* sound hardware */
r29505r29506
21702159   MCFG_SOUND_ROUTE(1, "mono", 1.0)
21712160   MCFG_SOUND_ROUTE(2, "mono", 1.0)
21722161
2173   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2162   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2163   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2164   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
21742165MACHINE_CONFIG_END
21752166
21762167
r29505r29506
22102201   MCFG_VIDEO_START_OVERRIDE(taitob_state,hitice)
22112202   MCFG_VIDEO_RESET_OVERRIDE(taitob_state,hitice)
22122203
2213   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2204   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2205   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2206   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2207   MCFG_TC0180VCU_TX_COLORBASE(0x00)
22142208   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
22152209
22162210   /* sound hardware */
r29505r29506
22272221   MCFG_OKIM6295_ADD("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
22282222   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
22292223
2230   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2224   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2225   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2226   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
22312227MACHINE_CONFIG_END
22322228
22332229
r29505r29506
22662262
22672263   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
22682264
2269   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2265   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2266   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2267   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2268   MCFG_TC0180VCU_TX_COLORBASE(0x00)
22702269   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
22712270
22722271   /* sound hardware */
r29505r29506
22782277   MCFG_SOUND_ROUTE(1, "mono", 1.0)
22792278   MCFG_SOUND_ROUTE(2, "mono", 1.0)
22802279
2281   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2280   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2281   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2282   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
22822283MACHINE_CONFIG_END
22832284
22842285
r29505r29506
23172318
23182319   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
23192320
2320   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2321   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2322   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2323   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2324   MCFG_TC0180VCU_TX_COLORBASE(0x00)
23212325   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
23222326
23232327   /* sound hardware */
r29505r29506
23292333   MCFG_SOUND_ROUTE(1, "mono", 1.0)
23302334   MCFG_SOUND_ROUTE(2, "mono", 1.0)
23312335
2332   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2336   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2337   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2338   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
23332339MACHINE_CONFIG_END
23342340
23352341
r29505r29506
23742380
23752381   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1)
23762382
2377   MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf)
2383   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2384   MCFG_TC0180VCU_BG_COLORBASE(0x00)
2385   MCFG_TC0180VCU_FG_COLORBASE(0x40)
2386   MCFG_TC0180VCU_TX_COLORBASE(0xc0)
23782387   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
23792388
23802389   /* sound hardware */
r29505r29506
23862395   MCFG_SOUND_ROUTE(1, "mono", 1.0)
23872396   MCFG_SOUND_ROUTE(2, "mono", 1.0)
23882397
2389   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2398   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2399   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2400   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
23902401MACHINE_CONFIG_END
23912402
23922403
r29505r29506
24312442
24322443   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1)
24332444
2434   MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf)
2445   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2446   MCFG_TC0180VCU_BG_COLORBASE(0x00)
2447   MCFG_TC0180VCU_FG_COLORBASE(0x40)
2448   MCFG_TC0180VCU_TX_COLORBASE(0xc0)
24352449   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
24362450
24372451   /* sound hardware */
r29505r29506
24432457   MCFG_SOUND_ROUTE(1, "mono", 1.0)
24442458   MCFG_SOUND_ROUTE(2, "mono", 1.0)
24452459
2446   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2460   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2461   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2462   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
24472463MACHINE_CONFIG_END
24482464
24492465
r29505r29506
24822498
24832499   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
24842500
2485   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2501   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2502   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2503   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2504   MCFG_TC0180VCU_TX_COLORBASE(0x00)
24862505   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
24872506
24882507   /* sound hardware */
r29505r29506
24942513   MCFG_SOUND_ROUTE(1, "mono", 1.0)
24952514   MCFG_SOUND_ROUTE(2, "mono", 1.0)
24962515
2497   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2516   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2517   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2518   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
24982519MACHINE_CONFIG_END
24992520
25002521
r29505r29506
25392560
25402561   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order1)
25412562
2542   MCFG_TC0180VCU_ADD("tc0180vcu", color1_tc0180vcu_intf)
2563   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2564   MCFG_TC0180VCU_BG_COLORBASE(0x00)
2565   MCFG_TC0180VCU_FG_COLORBASE(0x40)
2566   MCFG_TC0180VCU_TX_COLORBASE(0xc0)
25432567   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
25442568
25452569   /* sound hardware */
r29505r29506
25512575   MCFG_SOUND_ROUTE(1, "mono", 1.0)
25522576   MCFG_SOUND_ROUTE(2, "mono", 1.0)
25532577
2554   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2578   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2579   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2580   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
25552581MACHINE_CONFIG_END
25562582
25572583
r29505r29506
25902616
25912617   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
25922618
2593   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2619   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2620   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2621   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2622   MCFG_TC0180VCU_TX_COLORBASE(0x00)
25942623   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
25952624
25962625   /* sound hardware */
r29505r29506
26072636   MCFG_OKIM6295_ADD("oki", XTAL_4_224MHz/4, OKIM6295_PIN7_HIGH) // 1.056MHz clock frequency, but pin 7 not verified
26082637   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
26092638
2610   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2639   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2640   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2641   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
26112642MACHINE_CONFIG_END
26122643
26132644
r29505r29506
26462677
26472678   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
26482679
2649   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2680   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2681   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2682   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2683   MCFG_TC0180VCU_TX_COLORBASE(0x00)
26502684   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
26512685
26522686   /* sound hardware */
r29505r29506
26582692   MCFG_SOUND_ROUTE(1, "mono", 1.0)
26592693   MCFG_SOUND_ROUTE(2, "mono", 1.0)
26602694
2661   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2695   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2696   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2697   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
26622698MACHINE_CONFIG_END
26632699
26642700
r29505r29506
26972733
26982734   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
26992735
2700   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2736   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2737   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2738   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2739   MCFG_TC0180VCU_TX_COLORBASE(0x00)
27012740   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
27022741
27032742   /* sound hardware */
r29505r29506
27092748   MCFG_SOUND_ROUTE(1, "mono", 1.0)
27102749   MCFG_SOUND_ROUTE(2, "mono", 1.0)
27112750
2712   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2751   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2752   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2753   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
27132754MACHINE_CONFIG_END
27142755
27152756#if 0
r29505r29506
27572798
27582799   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order2)
27592800
2760   MCFG_TC0180VCU_ADD("tc0180vcu", color2_tc0180vcu_intf)
2801   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2802   MCFG_TC0180VCU_BG_COLORBASE(0x30)
2803   MCFG_TC0180VCU_FG_COLORBASE(0x20)
2804   MCFG_TC0180VCU_TX_COLORBASE(0x00)
27612805   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
27622806
27632807   /* sound hardware */
r29505r29506
27692813   MCFG_SOUND_ROUTE(1, "mono", 1.0)
27702814   MCFG_SOUND_ROUTE(2, "mono", 1.0)
27712815
2772   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2816   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2817   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2818   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
27732819MACHINE_CONFIG_END
27742820
27752821#if 0
r29505r29506
28152861
28162862   MCFG_VIDEO_START_OVERRIDE(taitob_state,taitob_color_order0)
28172863
2818   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2864   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2865   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2866   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2867   MCFG_TC0180VCU_TX_COLORBASE(0x00)
28192868   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
28202869
28212870   /* sound hardware */
r29505r29506
28272876   MCFG_SOUND_ROUTE(1, "mono", 1.0)
28282877   MCFG_SOUND_ROUTE(2, "mono", 1.0)
28292878
2830   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2879   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2880   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2881   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
28312882MACHINE_CONFIG_END
28322883
28332884/* TODO: Properly hook up the HD63484 */
r29505r29506
28722923
28732924   MCFG_HD63484_ADD("hd63484", realpunc_hd63484_intf)
28742925
2875   MCFG_TC0180VCU_ADD("tc0180vcu", color0_tc0180vcu_intf)
2926   MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
2927   MCFG_TC0180VCU_BG_COLORBASE(0xc0)
2928   MCFG_TC0180VCU_FG_COLORBASE(0x80)
2929   MCFG_TC0180VCU_TX_COLORBASE(0x00)
28762930   MCFG_TC0180VCU_GFXDECODE("gfxdecode")
28772931
28782932   /* sound hardware */
r29505r29506
28842938   MCFG_SOUND_ROUTE(1, "mono", 1.0)
28852939   MCFG_SOUND_ROUTE(2, "mono", 1.0)
28862940
2887   MCFG_TC0140SYT_ADD("tc0140syt", taitob_tc0140syt_intf)
2941   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
2942   MCFG_TC0140SYT_MASTER_CPU("maincpu")
2943   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
28882944MACHINE_CONFIG_END
28892945
28902946/***************************************************************************
branches/new_menus/src/mame/drivers/metro.c
r29505r29506
45014501MACHINE_CONFIG_END
45024502
45034503
4504static const k053936_interface blzntrnd_k053936_intf =
4505{
4506   0, -69, -21
4507};
4508
45094504static MACHINE_CONFIG_START( blzntrnd, metro_state )
45104505
45114506   /* basic machine hardware */
r29505r29506
45354530   MCFG_PALETTE_ADD("palette", 0x1000)
45364531   MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx)
45374532
4538   MCFG_K053936_ADD("k053936", blzntrnd_k053936_intf)
4533   MCFG_DEVICE_ADD("k053936", K053936, 0)
4534   MCFG_K053936_OFFSETS(-69, -21)
45394535
45404536   /* sound hardware */
45414537   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r29505r29506
45504546
45514547/* like blzntrnd but new vidstart / gfxdecode for the different bg tilemap */
45524548
4553static const k053936_interface gstrik2_k053936_intf =
4554{
4555   0, -69, -19
4556};
4557
45584549static MACHINE_CONFIG_START( gstrik2, metro_state )
45594550
45604551   /* basic machine hardware */
r29505r29506
45844575   MCFG_PALETTE_ADD("palette", 0x1000)
45854576   MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx)
45864577
4587   MCFG_K053936_ADD("k053936", gstrik2_k053936_intf)
4578   MCFG_DEVICE_ADD("k053936", K053936, 0)
4579   MCFG_K053936_OFFSETS(-69, -19)
45884580
45894581   /* sound hardware */
45904582   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
branches/new_menus/src/mame/drivers/ninjaw.c
r29505r29506
362362WRITE16_MEMBER(ninjaw_state::ninjaw_sound_w)
363363{
364364   if (offset == 0)
365      m_tc0140syt->tc0140syt_port_w(space, 0, data & 0xff);
365      m_tc0140syt->master_port_w(space, 0, data & 0xff);
366366   else if (offset == 1)
367      m_tc0140syt->tc0140syt_comm_w(space, 0, data & 0xff);
367      m_tc0140syt->master_comm_w(space, 0, data & 0xff);
368368
369369#ifdef MAME_DEBUG
370370   if (data & 0xff00)
r29505r29506
375375READ16_MEMBER(ninjaw_state::ninjaw_sound_r)
376376{
377377   if (offset == 1)
378      return ((m_tc0140syt->tc0140syt_comm_r(space, 0) & 0xff));
378      return ((m_tc0140syt->master_comm_r(space, 0) & 0xff));
379379   else
380380      return 0;
381381}
r29505r29506
487487   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
488488   AM_RANGE(0xc000, 0xdfff) AM_RAM
489489   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
490   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_port_w)
491   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, tc0140syt_slave_comm_r,tc0140syt_slave_comm_w)
490   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, slave_port_w)
491   AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, slave_comm_r,slave_comm_w)
492492   AM_RANGE(0xe400, 0xe403) AM_WRITE(ninjaw_pancontrol) /* pan */
493493   AM_RANGE(0xea00, 0xea00) AM_READNOP
494494   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r29505r29506
724724Darius2: arbitrary interleaving of 10 to keep cpus synced.
725725*************************************************************/
726726
727static const tc0100scn_interface darius2_tc0100scn_intf_l =
728{
729   1, 3,       /* gfxnum, txnum */
730   22, 0,      /* x_offset, y_offset */
731   0, 0,       /* flip_xoff, flip_yoff */
732   0, 0,       /* flip_text_xoff, flip_text_yoff */
733   0, 0
734};
735
736static const tc0100scn_interface darius2_tc0100scn_intf_m =
737{
738   2, 3,       /* gfxnum, txnum */
739   22, 0,      /* x_offset, y_offset */
740   0, 0,       /* flip_xoff, flip_yoff */
741   0, 0,       /* flip_text_xoff, flip_text_yoff */
742   2, 1
743};
744
745static const tc0100scn_interface darius2_tc0100scn_intf_r =
746{
747   2, 3,       /* gfxnum, txnum */
748   22, 0,      /* x_offset, y_offset */
749   0, 0,       /* flip_xoff, flip_yoff */
750   0, 0,       /* flip_text_xoff, flip_text_yoff */
751   4, 1
752};
753
754static const tc0140syt_interface ninjaw_tc0140syt_intf =
755{
756   "maincpu", "audiocpu"
757};
758
759
760727void ninjaw_state::ninjaw_postload()
761728{
762729   parse_control();
r29505r29506
838805   MCFG_SCREEN_UPDATE_DRIVER(ninjaw_state, screen_update_ninjaw_right)
839806   MCFG_SCREEN_PALETTE("palette3")
840807
841   MCFG_TC0100SCN_ADD("tc0100scn_1", darius2_tc0100scn_intf_l)
808   MCFG_DEVICE_ADD("tc0100scn_1", TC0100SCN, 0)
809   MCFG_TC0100SCN_GFX_REGION(1)
810   MCFG_TC0100SCN_TX_REGION(3)
811   MCFG_TC0100SCN_OFFSETS(22, 0)
812   MCFG_TC0100SCN_MULTISCR_XOFFS(0)
813   MCFG_TC0100SCN_MULTISCR_HACK(0)
842814   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
843815   MCFG_TC0100SCN_PALETTE("palette")
844   MCFG_TC0100SCN_ADD("tc0100scn_2", darius2_tc0100scn_intf_m)
816
817   MCFG_TC0110PCR_ADD("tc0110pcr_1")
818   MCFG_TC0110PCR_PALETTE("palette")
819
820   MCFG_DEVICE_ADD("tc0100scn_2", TC0100SCN, 0)
821   MCFG_TC0100SCN_GFX_REGION(2)
822   MCFG_TC0100SCN_TX_REGION(3)
823   MCFG_TC0100SCN_OFFSETS(22, 0)
824   MCFG_TC0100SCN_MULTISCR_XOFFS(2)
825   MCFG_TC0100SCN_MULTISCR_HACK(1)
845826   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
846827   MCFG_TC0100SCN_PALETTE("palette2")
847   MCFG_TC0100SCN_ADD("tc0100scn_3", darius2_tc0100scn_intf_r)
828
829   MCFG_TC0110PCR_ADD("tc0110pcr_2")
830   MCFG_TC0110PCR_PALETTE("palette2")
831
832   MCFG_DEVICE_ADD("tc0100scn_3", TC0100SCN, 0)
833   MCFG_TC0100SCN_GFX_REGION(2)
834   MCFG_TC0100SCN_TX_REGION(3)
835   MCFG_TC0100SCN_OFFSETS(22, 0)
836   MCFG_TC0100SCN_MULTISCR_XOFFS(4)
837   MCFG_TC0100SCN_MULTISCR_HACK(1)
848838   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
849839   MCFG_TC0100SCN_PALETTE("palette3")
850840
851   MCFG_TC0110PCR_ADD("tc0110pcr_1")
852   MCFG_TC0110PCR_PALETTE("palette")
853   MCFG_TC0110PCR_ADD("tc0110pcr_2")
854   MCFG_TC0110PCR_PALETTE("palette2")
855841   MCFG_TC0110PCR_ADD("tc0110pcr_3")
856842   MCFG_TC0110PCR_PALETTE("palette3")
857843
r29505r29506
878864
879865//  MCFG_SOUND_ADD("subwoofer", SUBWOOFER, 0)
880866
881   MCFG_TC0140SYT_ADD("tc0140syt", ninjaw_tc0140syt_intf)
867   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
868   MCFG_TC0140SYT_MASTER_CPU("maincpu")
869   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
882870MACHINE_CONFIG_END
883871
884872
r29505r29506
937925   MCFG_SCREEN_UPDATE_DRIVER(ninjaw_state, screen_update_ninjaw_right)
938926   MCFG_SCREEN_PALETTE("palette3")
939927
940   MCFG_TC0100SCN_ADD("tc0100scn_1", darius2_tc0100scn_intf_l)
928   MCFG_DEVICE_ADD("tc0100scn_1", TC0100SCN, 0)
929   MCFG_TC0100SCN_GFX_REGION(1)
930   MCFG_TC0100SCN_TX_REGION(3)
931   MCFG_TC0100SCN_OFFSETS(22, 0)
932   MCFG_TC0100SCN_MULTISCR_XOFFS(0)
933   MCFG_TC0100SCN_MULTISCR_HACK(0)
941934   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
942935   MCFG_TC0100SCN_PALETTE("palette")
943   MCFG_TC0100SCN_ADD("tc0100scn_2", darius2_tc0100scn_intf_m)
936
937   MCFG_TC0110PCR_ADD("tc0110pcr_1")
938   MCFG_TC0110PCR_PALETTE("palette")
939
940   MCFG_DEVICE_ADD("tc0100scn_2", TC0100SCN, 0)
941   MCFG_TC0100SCN_GFX_REGION(2)
942   MCFG_TC0100SCN_TX_REGION(3)
943   MCFG_TC0100SCN_OFFSETS(22, 0)
944   MCFG_TC0100SCN_MULTISCR_XOFFS(2)
945   MCFG_TC0100SCN_MULTISCR_HACK(1)
944946   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
945947   MCFG_TC0100SCN_PALETTE("palette2")
946   MCFG_TC0100SCN_ADD("tc0100scn_3", darius2_tc0100scn_intf_r)
948
949   MCFG_TC0110PCR_ADD("tc0110pcr_2")
950   MCFG_TC0110PCR_PALETTE("palette2")
951
952   MCFG_DEVICE_ADD("tc0100scn_3", TC0100SCN, 0)
953   MCFG_TC0100SCN_GFX_REGION(2)
954   MCFG_TC0100SCN_TX_REGION(3)
955   MCFG_TC0100SCN_OFFSETS(22, 0)
956   MCFG_TC0100SCN_MULTISCR_XOFFS(4)
957   MCFG_TC0100SCN_MULTISCR_HACK(1)
947958   MCFG_TC0100SCN_GFXDECODE("gfxdecode")
948959   MCFG_TC0100SCN_PALETTE("palette3")
949960
950   MCFG_TC0110PCR_ADD("tc0110pcr_1")
951   MCFG_TC0110PCR_PALETTE("palette")
952   MCFG_TC0110PCR_ADD("tc0110pcr_2")
953   MCFG_TC0110PCR_PALETTE("palette2")
954961   MCFG_TC0110PCR_ADD("tc0110pcr_3")
955962   MCFG_TC0110PCR_PALETTE("palette3")
956963
r29505r29506
977984
978985//  MCFG_SOUND_ADD("subwoofer", SUBWOOFER, 0)
979986
980   MCFG_TC0140SYT_ADD("tc0140syt", ninjaw_tc0140syt_intf)
987   MCFG_DEVICE_ADD("tc0140syt", TC0140SYT, 0)
988   MCFG_TC0140SYT_MASTER_CPU("maincpu")
989   MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
981990MACHINE_CONFIG_END
982991
983992
branches/new_menus/src/mame/drivers/gunbustr.c
r29505r29506
284284                 MACHINE DRIVERS
285285***********************************************************/
286286
287static const tc0480scp_interface gunbustr_tc0480scp_intf =
288{
289   1, 2,           /* gfxnum, txnum */
290   0,              /* pixels */
291   0x20, 0x07,     /* x_offset, y_offset */
292   -1, -1,         /* text_xoff, text_yoff */
293   -1, 0,          /* flip_xoff, flip_yoff */
294   0               /* col_base */
295};
296
297287static MACHINE_CONFIG_START( gunbustr, gunbustr_state )
298288
299289   /* basic machine hardware */
r29505r29506
315305   MCFG_GFXDECODE_ADD("gfxdecode", "palette", gunbustr)
316306   MCFG_PALETTE_ADD("palette", 8192)
317307
318
319   MCFG_TC0480SCP_ADD("tc0480scp", gunbustr_tc0480scp_intf)
308   MCFG_DEVICE_ADD("tc0480scp", TC0480SCP, 0)
309   MCFG_TC0480SCP_GFX_REGION(1)
310   MCFG_TC0480SCP_TX_REGION(2)
311   MCFG_TC0480SCP_OFFSETS(0x20, 0x07)
312   MCFG_TC0480SCP_OFFSETS_TX(-1, -1)
313   MCFG_TC0480SCP_OFFSETS_FLIP(-1, 0)
320314   MCFG_TC0480SCP_GFXDECODE("gfxdecode")
321315   MCFG_TC0480SCP_PALETTE("palette")
322316
branches/new_menus/src/mame/drivers/playch10.c
r29505r29506
665665   "cart"
666666};
667667
668
669668static MACHINE_CONFIG_START( playch10, playch10_state )
670669   // basic machine hardware
671670   MCFG_CPU_ADD("maincpu", Z80, 8000000/2) // 4 MHz
r29505r29506
697696   MCFG_SCREEN_UPDATE_DRIVER(playch10_state, screen_update_playch10_bottom)
698697   MCFG_SCREEN_PALETTE("palette")
699698
700
701   MCFG_PPU2C03B_ADD("ppu", playch10_ppu_interface)
699   MCFG_PPU2C03B_ADD("ppu")
702700   MCFG_PPU2C0X_SET_SCREEN("bottom")
701   MCFG_PPU2C0X_CPU("cart")
702   MCFG_PPU2C0X_COLORBASE(256)
703703   MCFG_PPU2C0X_SET_NMI(playch10_state, ppu_irq)
704704
705705   // sound hardware
branches/new_menus/src/mame/drivers/bishi.c
r29505r29506
372372   bishi_tile_callback, "none"
373373};
374374
375static const k054338_interface bishi_k054338_intf =
376{
377   0,
378   "none"
379};
380
381375void bishi_state::machine_start()
382376{
383377   save_item(NAME(m_cur_control));
r29505r29506
416410   MCFG_K056832_ADD("k056832", bishi_k056832_intf)
417411   MCFG_K056832_GFXDECODE("gfxdecode")
418412   MCFG_K056832_PALETTE("palette")
419   MCFG_K054338_ADD("k054338", bishi_k054338_intf)
413
414   MCFG_DEVICE_ADD("k054338", K054338, 0)
415   // FP 201404: any reason why this is not connected to the k055555 below?
416
420417   MCFG_K055555_ADD("k055555")
421418
422419   /* sound hardware */
branches/new_menus/src/mame/drivers/quizpani.c
r29505r29506
187187GFXDECODE_END
188188
189189
190static const nmk112_interface quizpani_nmk112_intf =
191{
192   "oki", "oki", 0
193};
194
195
196190static MACHINE_CONFIG_START( quizpani, quizpani_state )
197191   MCFG_CPU_ADD("maincpu", M68000, 10000000)
198192   MCFG_CPU_PROGRAM_MAP(quizpani_map)
r29505r29506
217211   MCFG_OKIM6295_ADD("oki", 16000000/4, OKIM6295_PIN7_LOW)
218212   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
219213
220   MCFG_NMK112_ADD("nmk112", quizpani_nmk112_intf)
214   MCFG_DEVICE_ADD("nmk112", NMK112, 0)
215   MCFG_NMK112_ROM0("oki")
216   MCFG_NMK112_ROM1("oki")
221217MACHINE_CONFIG_END
222218
223219ROM_START( quizpani )
branches/new_menus/src/mame/audio/namco52.c
r29505r29506
166166   m_basenode(0),
167167   m_extclock(0),
168168   m_romread(*this),
169   m_si(*this)
169   m_si(*this),
170   m_latched_cmd(0),
171   m_address(0)
170172{
171173}
172174
branches/new_menus/src/mame/audio/taitosnd.c
r29505r29506
4444      m_submode(0),
4545      m_status(0),
4646      m_nmi_enabled(0),
47      m_mastercpu(NULL),
48      m_slavecpu(NULL)
47      m_mastercpu(*this),
48      m_slavecpu(*this)
4949{
5050   memset(m_slavedata, 0, sizeof(UINT8)*4);
5151   memset(m_masterdata, 0, sizeof(UINT8)*4);
r29505r29506
5858
5959void tc0140syt_device::device_start()
6060{
61   const tc0140syt_interface *intf = reinterpret_cast<const tc0140syt_interface*>(static_config());
62
63   m_mastercpu = machine().device(intf->master);
64   m_slavecpu = machine().device(intf->slave);
65
6661   save_item(NAME(m_mainmode));
6762   save_item(NAME(m_submode));
6863   save_item(NAME(m_status));
r29505r29506
10095   UINT32 nmi_pending = m_status & (TC0140SYT_PORT23_FULL | TC0140SYT_PORT01_FULL);
10196   UINT32 state = (nmi_pending && m_nmi_enabled) ? ASSERT_LINE : CLEAR_LINE;
10297
103   m_slavecpu->execute().set_input_line(INPUT_LINE_NMI, state);
98   m_slavecpu->set_input_line(INPUT_LINE_NMI, state);
10499}
105100
106101
r29505r29506
108103//  MASTER SIDE
109104//-------------------------------------------------
110105
111WRITE8_MEMBER( tc0140syt_device::tc0140syt_port_w )
106WRITE8_MEMBER( tc0140syt_device::master_port_w )
112107{
113108   data &= 0x0f;
114109   m_mainmode = data;
r29505r29506
119114   }
120115}
121116
122WRITE8_MEMBER( tc0140syt_device::tc0140syt_comm_w )
117WRITE8_MEMBER( tc0140syt_device::master_comm_w )
123118{
124119   machine().scheduler().synchronize(); // let slavecpu catch up before changing anything
125120   data &= 0x0f; /* this is important, otherwise ballbros won't work */
r29505r29506
148143
149144      case 0x04: // port status
150145         /* this does a hi-lo transition to reset the sound cpu */
151         m_slavecpu->execute().set_input_line(INPUT_LINE_RESET, data ? ASSERT_LINE : CLEAR_LINE);
146         m_slavecpu->set_input_line(INPUT_LINE_RESET, data ? ASSERT_LINE : CLEAR_LINE);
152147         break;
153148
154149      default:
r29505r29506
156151   }
157152}
158153
159READ8_MEMBER( tc0140syt_device::tc0140syt_comm_r )
154READ8_MEMBER( tc0140syt_device::master_comm_r )
160155{
161156   machine().scheduler().synchronize(); // let slavecpu catch up before changing anything
162157   UINT8 res = 0;
r29505r29506
197192//  SLAVE SIDE
198193//-------------------------------------------------
199194
200WRITE8_MEMBER( tc0140syt_device::tc0140syt_slave_port_w )
195WRITE8_MEMBER( tc0140syt_device::slave_port_w )
201196{
202197   data &= 0x0f;
203198   m_submode = data;
r29505r29506
208203   }
209204}
210205
211WRITE8_MEMBER( tc0140syt_device::tc0140syt_slave_comm_w )
206WRITE8_MEMBER( tc0140syt_device::slave_comm_w )
212207{
213208   data &= 0x0f;
214209
r29505r29506
251246   }
252247}
253248
254READ8_MEMBER( tc0140syt_device::tc0140syt_slave_comm_r )
249READ8_MEMBER( tc0140syt_device::slave_comm_r )
255250{
256251   UINT8 res = 0;
257252
branches/new_menus/src/mame/audio/taitosnd.h
r29505r29506
66//  INTERFACE CONFIGURATION MACROS
77//**************************************************************************
88
9#define MCFG_TC0140SYT_ADD(_tag, _interface) \
10   MCFG_DEVICE_ADD(_tag, TC0140SYT, 0) \
11   MCFG_DEVICE_CONFIG(_interface)
9#define MCFG_TC0140SYT_MASTER_CPU(_tag) \
10   tc0140syt_device::set_master_tag(*device, "^"_tag);
1211
12#define MCFG_TC0140SYT_SLAVE_CPU(_tag) \
13   tc0140syt_device::set_slave_tag(*device, "^"_tag);
1314
15
1416//**************************************************************************
1517//  TYPE DEFINITIONS
1618//**************************************************************************
r29505r29506
3032   tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3133   ~tc0140syt_device() { }
3234
35   static void set_master_tag(device_t &device, const char *tag) { downcast<tc0140syt_device &>(device).m_mastercpu.set_tag(tag); }
36   static void set_slave_tag(device_t &device, const char *tag)  { downcast<tc0140syt_device &>(device).m_slavecpu.set_tag(tag); }
37
38   // MASTER (4-bit bus) control functions
39   DECLARE_WRITE8_MEMBER( master_port_w );
40   DECLARE_WRITE8_MEMBER( master_comm_w );
41   DECLARE_READ8_MEMBER( master_comm_r );
42
43   // SLAVE (4-bit bus) control functions ONLY
44   DECLARE_WRITE8_MEMBER( slave_port_w );
45   DECLARE_READ8_MEMBER( slave_comm_r );
46   DECLARE_WRITE8_MEMBER( slave_comm_w );
47   
3348protected:
3449   // device-level overrides
3550   virtual void device_start();
3651   virtual void device_reset();
37
38public:
39   // MASTER (4-bit bus) control functions
40   DECLARE_WRITE8_MEMBER( tc0140syt_port_w );
41   DECLARE_WRITE8_MEMBER( tc0140syt_comm_w );
42   DECLARE_READ8_MEMBER( tc0140syt_comm_r );
43
44   // SLAVE (4-bit bus) control functions ONLY
45   DECLARE_WRITE8_MEMBER( tc0140syt_slave_port_w );
46   DECLARE_READ8_MEMBER( tc0140syt_slave_comm_r );
47   DECLARE_WRITE8_MEMBER( tc0140syt_slave_comm_w );
48
52   
4953private:
5054   void update_nmi();
5155
52private:
5356   UINT8     m_slavedata[4];  /* Data on master->slave port (4 nibbles) */
5457   UINT8     m_masterdata[4]; /* Data on slave->master port (4 nibbles) */
5558   UINT8     m_mainmode;      /* Access mode on master cpu side */
r29505r29506
5760   UINT8     m_status;        /* Status data */
5861   UINT8     m_nmi_enabled;   /* 1 if slave cpu has nmi's enabled */
5962
60   device_t *m_mastercpu;     /* this is the maincpu */
61   device_t *m_slavecpu;      /* this is the audiocpu */
63   required_device<cpu_device> m_mastercpu;     /* this is the maincpu */
64   required_device<cpu_device> m_slavecpu;      /* this is the audiocpu */
6265};
6366
6467extern const device_type TC0140SYT;
branches/new_menus/src/mame/audio/namco54.c
r29505r29506
134134   : device_t(mconfig, NAMCO_54XX, "Namco 54xx", tag, owner, clock, "namco54", __FILE__),
135135   m_cpu(*this, "mcu"),
136136   m_discrete(*this),
137   m_basenode(0)
137   m_basenode(0),
138   m_latched_cmd(0)
138139{
139140}
140141//-------------------------------------------------
branches/new_menus/src/mame/machine/playch10.c
r29505r29506
237237   /* do the gun thing */
238238   if (m_pc10_gun_controller)
239239   {
240      ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
241240      int trigger = ioport("P1")->read();
242241      int x = ioport("GUNX")->read();
243242      int y = ioport("GUNY")->read();
r29505r29506
247246      ret |= 0x08;
248247
249248      /* get the pixel at the gun position */
250      pix = ppu->get_pixel(x, y);
249      pix = m_ppu->get_pixel(x, y);
251250
252251      /* get the color base from the ppu */
253      color_base = ppu->get_colorbase();
252      color_base = m_ppu->get_colorbase();
254253
255254      /* look at the screen and see if the cursor is over a bright pixel */
256255      if ((pix == color_base + 0x20) || (pix == color_base + 0x30) ||
branches/new_menus/src/mame/machine/vsnes.c
r29505r29506
343343
344344WRITE8_MEMBER(vsnes_state::gun_in0_w)
345345{
346   ppu2c0x_device *ppu1 = machine().device<ppu2c0x_device>("ppu1");
347
348346   if (m_do_vrom_bank)
349347   {
350348      /* switch vrom */
r29505r29506
363361      UINT32 pix, color_base;
364362
365363      /* get the pixel at the gun position */
366      pix = ppu1->get_pixel(x, y);
364      pix = m_ppu1->get_pixel(x, y);
367365
368366      /* get the color base from the ppu */
369      color_base = ppu1->get_colorbase();
367      color_base = m_ppu1->get_colorbase();
370368
371369      /* look at the screen and see if the cursor is over a bright pixel */
372370      if ((pix == color_base + 0x20 ) || (pix == color_base + 0x30) ||
r29505r29506
669667
670668WRITE8_MEMBER(vsnes_state::mapper4_w)
671669{
672   ppu2c0x_device *ppu1 = machine().device<ppu2c0x_device>("ppu1");
673670   UINT8 MMC3_helper, cmd;
674671
675672   switch (offset & 0x6001)
r29505r29506
718715
719716      case 0x2001: /* $a001 - extra RAM enable/disable */
720717         /* ignored - we always enable it */
721
722718         break;
719
723720      case 0x4000: /* $c000 - IRQ scanline counter */
724721         m_IRQ_count = data;
725
726722         break;
727723
728724      case 0x4001: /* $c001 - IRQ scanline latch */
729725         m_IRQ_count_latch = data;
730
731726         break;
732727
733728      case 0x6000: /* $e000 - Disable IRQs */
734729         m_IRQ_enable = 0;
735730         m_IRQ_count = m_IRQ_count_latch;
736
737         ppu1->set_scanline_callback(ppu2c0x_scanline_delegate());
738
731         m_ppu1->set_scanline_callback(ppu2c0x_scanline_delegate());
739732         break;
740733
741734      case 0x6001: /* $e001 - Enable IRQs */
742735         m_IRQ_enable = 1;
743         ppu1->set_scanline_callback(ppu2c0x_scanline_delegate(FUNC(vsnes_state::mapper4_irq),this));
744
736         m_ppu1->set_scanline_callback(ppu2c0x_scanline_delegate(FUNC(vsnes_state::mapper4_irq), this));
745737         break;
746738
747739      default:
branches/new_menus/src/mame/machine/nmk112.c
r29505r29506
1818const device_type NMK112 = &device_creator<nmk112_device>;
1919
2020nmk112_device::nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
21   : device_t(mconfig, NMK112, "NMK 112", tag, owner, clock, "nmk112", __FILE__)
21   : device_t(mconfig, NMK112, "NMK 112", tag, owner, clock, "nmk112", __FILE__),
22      m_page_mask(0xff),
23      m_rom0(NULL),
24      m_rom1(NULL),
25      m_size0(0),
26      m_size1(0)
2227{
2328}
2429
2530//-------------------------------------------------
26//  device_config_complete - perform any
27//  operations now that the configuration is
28//  complete
29//-------------------------------------------------
30
31void nmk112_device::device_config_complete()
32{
33}
34
35//-------------------------------------------------
3631//  device_start - device-specific startup
3732//-------------------------------------------------
3833
3934void nmk112_device::device_start()
4035{
41   const nmk112_interface *intf = (const nmk112_interface *)static_config();
36   save_item(NAME(m_current_bank));
37   machine().save().register_postload(save_prepost_delegate(FUNC(nmk112_device::postload_bankswitch), this));
4238
43   if (intf->rgn0 == NULL)
39   if (m_tag0)
4440   {
45      m_rom0 = NULL;
46      m_size0 = 0;
41      m_rom0 = machine().root_device().memregion(m_tag0)->base();
42      m_size0 = machine().root_device().memregion(m_tag0)->bytes() - 0x40000;
4743   }
48   else
44   if (m_tag1)
4945   {
50      m_rom0 = machine().root_device().memregion(intf->rgn0)->base();
51      m_size0 = machine().root_device().memregion(intf->rgn0)->bytes() - 0x40000;
46      m_rom1 = machine().root_device().memregion(m_tag1)->base();
47      m_size1 = machine().root_device().memregion(m_tag1)->bytes() - 0x40000;
5248   }
53
54   if (intf->rgn1 == NULL)
55   {
56      m_rom1 = NULL;
57      m_size1 = 0;
58   }
59   else
60   {
61      m_rom1 = machine().root_device().memregion(intf->rgn1)->base();
62      m_size1 = machine().root_device().memregion(intf->rgn1)->bytes() - 0x40000;
63   }
64
65   m_page_mask = ~intf->disable_page_mask;
66
67   save_item(NAME(m_current_bank));
68   machine().save().register_postload(save_prepost_delegate(FUNC(nmk112_device::postload_bankswitch), this));
6949}
7050
7151//-------------------------------------------------
r29505r29506
8161   }
8262}
8363
84
8564void nmk112_device::do_bankswitch( int offset, int data )
8665{
8766   int chip = (offset & 4) >> 2;
branches/new_menus/src/mame/machine/nmk112.h
r29505r29506
1111    TYPE DEFINITIONS
1212***************************************************************************/
1313
14struct nmk112_interface
14class nmk112_device : public device_t
1515{
16   const char *rgn0, *rgn1;
17   UINT8 disable_page_mask;
18};
19
20class nmk112_device : public device_t,
21                           public nmk112_interface
22{
2316public:
2417   nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2518   ~nmk112_device() {}
2619
20   // static configuration
21   static void set_rom0_tag(device_t &device, const char *tag) { downcast<nmk112_device &>(device).m_tag0 = tag; }
22   static void set_rom1_tag(device_t &device, const char *tag) { downcast<nmk112_device &>(device).m_tag1 = tag; }
23   static void set_page_mask(device_t &device, UINT8 mask) { downcast<nmk112_device &>(device).m_page_mask = ~mask; }
24   
2725   DECLARE_WRITE8_MEMBER( okibank_w );
2826   DECLARE_WRITE16_MEMBER( okibank_lsb_w );
2927
3028protected:
3129   // device-level overrides
32   virtual void device_config_complete();
3330   virtual void device_start();
3431   virtual void device_reset();
3532
r29505r29506
4441
4542   UINT8 m_current_bank[8];
4643
44   const char *m_tag0, *m_tag1;
4745   UINT8 *m_rom0, *m_rom1;
4846   int   m_size0, m_size1;
4947};
r29505r29506
5553    DEVICE CONFIGURATION MACROS
5654***************************************************************************/
5755
58#define MCFG_NMK112_ADD(_tag, _interface) \
59   MCFG_DEVICE_ADD(_tag, NMK112, 0) \
60   MCFG_DEVICE_CONFIG(_interface)
56#define MCFG_NMK112_ROM0(_tag) \
57   nmk112_device::set_rom0_tag(*device, _tag);
6158
59#define MCFG_NMK112_ROM1(_tag) \
60   nmk112_device::set_rom1_tag(*device, _tag);
61
62#define MCFG_NMK112_DISABLE_PAGEMASK(_mask) \
63   nmk112_device::set_page_mask(*device, _mask);
64
65
6266#endif /* __NMK112_H__ */
branches/new_menus/src/mame/machine/archimds.c
r29505r29506
7575void archimedes_state::archimedes_clear_irq_a(int mask)
7676{
7777   m_ioc_regs[IRQ_STATUS_A] &= ~mask;
78   archimedes_request_irq_a(0);
7879}
7980
8081void archimedes_state::archimedes_clear_irq_b(int mask)
r29505r29506
111112
112113/* video DMA */
113114/* TODO: what type of DMA this is, burst or cycle steal? Docs doesn't explain it (4 usec is the DRAM refresh). */
115/* TODO: change m_region_vram into proper alloc array */
116/* TODO: Erotictac and Poizone sets up vidinit register AFTER vidend, for double buffering? (fixes Poizone "Eterna" logo display on attract) */
114117void archimedes_state::vidc_video_tick()
115118{
116119   address_space &space = m_maincpu->space(AS_PROGRAM);
117120   static UINT8 *vram = m_region_vram->base();
118121   UINT32 size;
119122   UINT32 m_vidc_ccur;
123   UINT32 offset_ptr;
120124
121125   size = m_vidc_vidend-m_vidc_vidstart+0x10;
122126
127   offset_ptr = m_vidc_vidstart+m_vidc_vidinit;
128   if(offset_ptr >= m_vidc_vidend+0x10) // TODO: correct?
129      offset_ptr = m_vidc_vidstart;
130
131   //popmessage("%08x %08x %08x",m_vidc_vidstart,m_vidc_vidinit,m_vidc_vidend);
132
123133   for(m_vidc_vidcur = 0;m_vidc_vidcur < size;m_vidc_vidcur++)
124      vram[m_vidc_vidcur] = (space.read_byte(m_vidc_vidstart+m_vidc_vidcur));
134   {
135      vram[m_vidc_vidcur] = (space.read_byte(offset_ptr));
136      offset_ptr++;
137      if(offset_ptr >= m_vidc_vidend+0x10) // TODO: correct?
138         offset_ptr = m_vidc_vidstart;
139   }
125140
126141   size = m_vidc_vidend-m_vidc_vidstart+0x10;
127142
r29505r29506
129144      m_cursor_vram[m_vidc_ccur] = (space.read_byte(m_vidc_cinit+m_vidc_ccur));
130145
131146   if(m_video_dma_on)
147   {
132148      m_vid_timer->adjust(m_screen->time_until_pos(m_vidc_regs[0xb4]));
149   }
133150   else
134151      m_vid_timer->adjust(attotime::never);
135152}
r29505r29506
174191      372,   356,   340,   324,   308,   292,   276,   260,
175192      244,   228,   212,   196,   180,   164,   148,   132,
176193      120,   112,   104,    96,    88,    80,    72,    64,
177         56,    48,    40,    32,    24,    16,     8,     0
194      56,    48,    40,    32,    24,    16,     8,     0
178195   };
179196
180197   for(ch=0;ch<8;ch++)
r29505r29506
214231   {
215232      case 0:
216233      case 1:
217         m_timer[tmr]->adjust(attotime::from_usec(m_ioc_timercnt[tmr]/8), tmr); // TODO: ARM timings are quite off there, it should be latch and not latch/8
234         m_timer[tmr]->adjust(attotime::from_usec(m_ioc_timercnt[tmr]/2), tmr); // TODO: ARM timings are quite off there, it should be latch and not latch/2
218235         break;
219236      case 2:
220237         freq = 1000000.0 / (double)(m_ioc_timercnt[tmr]+1);
r29505r29506
416433static const char *const ioc_regnames[] =
417434{
418435   "(rw) Control",                 // 0
419   "(read) Keyboard receive (write) keyboard send",    // 1
436   "(read) Keyboard receive (write) keyboard send",    // 4
420437   "?",
421438   "?",
422   "(read) IRQ status A",              // 4
423   "(read) IRQ request A (write) IRQ clear",   // 5
424   "(rw) IRQ mask A",              // 6
439   "(read) IRQ status A",              // 10
440   "(read) IRQ request A (write) IRQ clear",   // 14
441   "(rw) IRQ mask A",              // 18
425442   "?",
426   "(read) IRQ status B",      // 8
427   "(read) IRQ request B",     // 9
428   "(rw) IRQ mask B",      // 10
443   "(read) IRQ status B",      // 20
444   "(read) IRQ request B",     // 24
445   "(rw) IRQ mask B",      // 28
429446   "?",
430   "(read) FIQ status",        // 12
431   "(read) FIQ request",       // 13
432   "(rw) FIQ mask",        // 14
447   "(read) FIQ status",        // 30
448   "(read) FIQ request",       // 34
449   "(rw) FIQ mask",        // 38
433450   "?",
434   "(read) Timer 0 count low (write) Timer 0 latch low",       // 16
435   "(read) Timer 0 count high (write) Timer 0 latch high",     // 17
436   "(write) Timer 0 go command",                   // 18
437   "(write) Timer 0 latch command",                // 19
438   "(read) Timer 1 count low (write) Timer 1 latch low",       // 20
439   "(read) Timer 1 count high (write) Timer 1 latch high",     // 21
440   "(write) Timer 1 go command",                   // 22
441   "(write) Timer 1 latch command",                // 23
442   "(read) Timer 2 count low (write) Timer 2 latch low",       // 24
443   "(read) Timer 2 count high (write) Timer 2 latch high",     // 25
444   "(write) Timer 2 go command",                   // 26
445   "(write) Timer 2 latch command",                // 27
446   "(read) Timer 3 count low (write) Timer 3 latch low",       // 28
447   "(read) Timer 3 count high (write) Timer 3 latch high",     // 29
448   "(write) Timer 3 go command",                   // 30
449   "(write) Timer 3 latch command"                 // 31
451   "(read) Timer 0 count low (write) Timer 0 latch low",       // 40
452   "(read) Timer 0 count high (write) Timer 0 latch high",     // 44
453   "(write) Timer 0 go command",                   // 48
454   "(write) Timer 0 latch command",                // 4c
455   "(read) Timer 1 count low (write) Timer 1 latch low",       // 50
456   "(read) Timer 1 count high (write) Timer 1 latch high",     // 54
457   "(write) Timer 1 go command",                   // 58
458   "(write) Timer 1 latch command",                // 5c
459   "(read) Timer 2 count low (write) Timer 2 latch low",       // 60
460   "(read) Timer 2 count high (write) Timer 2 latch high",     // 64
461   "(write) Timer 2 go command",                   // 68
462   "(write) Timer 2 latch command",                // 6c
463   "(read) Timer 3 count low (write) Timer 3 latch low",       // 70
464   "(read) Timer 3 count high (write) Timer 3 latch high",     // 74
465   "(write) Timer 3 go command",                   // 78
466   "(write) Timer 3 latch command"                 // 7c
450467};
451468
452469void archimedes_state::latch_timer_cnt(int tmr)
r29505r29506
798815         visarea.max_x = m_vidc_regs[VIDC_HBER] - m_vidc_regs[VIDC_HBSR] - 1;
799816         visarea.max_y = (m_vidc_regs[VIDC_VBER] - m_vidc_regs[VIDC_VBSR]) * (m_vidc_interlace+1);
800817
801         logerror("Configuring: htotal %d vtotal %d border %d x %d display %d x %d\n",
802            m_vidc_regs[VIDC_HCR], m_vidc_regs[VIDC_VCR],
803            visarea.max_x, visarea.max_y,
804            m_vidc_regs[VIDC_HDER]-m_vidc_regs[VIDC_HDSR],m_vidc_regs[VIDC_VDER]-m_vidc_regs[VIDC_VDSR]+1);
818         //logerror("Configuring: htotal %d vtotal %d border %d x %d display %d x %d\n",
819         //   m_vidc_regs[VIDC_HCR], m_vidc_regs[VIDC_VCR],
820         //   visarea.max_x, visarea.max_y,
821         //   m_vidc_regs[VIDC_HDER]-m_vidc_regs[VIDC_HDSR],m_vidc_regs[VIDC_VDER]-m_vidc_regs[VIDC_VDSR]+1);
805822
806823         /* FIXME: pixel clock */
807824         refresh = HZ_TO_ATTOSECONDS(pixel_rate[m_vidc_pixel_clk]*2) * m_vidc_regs[VIDC_HCR] * m_vidc_regs[VIDC_VCR];
branches/new_menus/src/mame/machine/namco51.c
r29505r29506
350350   m_in_2(*this),
351351   m_in_3(*this),
352352   m_out_0(*this),
353   m_out_1(*this)
353   m_out_1(*this),
354   m_lastcoins(0),
355   m_lastbuttons(0),
356   m_mode(0),
357   m_coincred_mode(0),
358   m_remap_joy(0)
354359{
355360}
356361
branches/new_menus/src/mame/machine/namco51.h
r29505r29506
5858   devcb2_read8 m_in_3;
5959   devcb2_write8 m_out_0;
6060   devcb2_write8 m_out_1;
61
6162   INT32 m_lastcoins;
6263   INT32 m_lastbuttons;
6364   INT32 m_credits;
branches/new_menus/src/osd/windows/d3dhlsl.c
r29505r29506
16641664   float bloom_height = rt->target_height;
16651665   vec2f screendims = d3d->get_dims();
16661666   curr_effect->set_vector("ScreenSize", 2, &screendims.c.x);
1667   float bloom_dims[11][2];
16671668   for(; bloom_size >= 2.0f && bloom_index < 11; bloom_size *= 0.5f)
16681669   {
1669      target_size[0] = bloom_width;
1670      target_size[1] = bloom_height;
1671      curr_effect->set_vector("TargetSize", 2, target_size);
1670      bloom_dims[bloom_index][0] = bloom_width;
1671      bloom_dims[bloom_index][1] = bloom_height;
1672      curr_effect->set_vector("TargetSize", 2, bloom_dims[bloom_index]);
16721673
16731674      curr_effect->begin(&num_passes, 0);
16741675
r29505r29506
16981699
16991700   curr_effect = bloom_effect;
17001701
1702   float target_size[2] = { d3d->get_width(), d3d->get_height() };
1703   curr_effect->set_vector("TargetSize", 2, target_size);
17011704   float weight0123[4] = { options->bloom_level0_weight, options->bloom_level1_weight, options->bloom_level2_weight, options->bloom_level3_weight };
17021705   float weight4567[4] = { options->bloom_level4_weight, options->bloom_level5_weight, options->bloom_level6_weight, options->bloom_level7_weight };
17031706   float weight89A[3]  = { options->bloom_level8_weight, options->bloom_level9_weight, options->bloom_level10_weight };
17041707   curr_effect->set_vector("Level0123Weight", 4, weight0123);
17051708   curr_effect->set_vector("Level4567Weight", 4, weight4567);
17061709   curr_effect->set_vector("Level89AWeight", 3, weight89A);
1707   curr_effect->set_vector("TargetSize", 2, &screendims.c.x);
1710   curr_effect->set_vector("Level01Size", 4, bloom_dims[0]);
1711   curr_effect->set_vector("Level23Size", 4, bloom_dims[2]);
1712   curr_effect->set_vector("Level45Size", 4, bloom_dims[4]);
1713   curr_effect->set_vector("Level67Size", 4, bloom_dims[6]);
1714   curr_effect->set_vector("Level89Size", 4, bloom_dims[8]);
1715   curr_effect->set_vector("LevelASize", 2, bloom_dims[10]);
17081716
17091717   curr_effect->set_texture("DiffuseA", rt->render_texture[2]);
17101718
r29505r29506
18461854      float bloom_height = rt->target_height;
18471855      float screen_size[2] = { d3d->get_width(), d3d->get_height() };
18481856      curr_effect->set_vector("ScreenSize", 2, screen_size);
1857      float bloom_dims[11][2];
18491858      for(; bloom_size >= 2.0f && bloom_index < 11; bloom_size *= 0.5f)
18501859      {
1851         target_size[0] = bloom_width;
1852         target_size[1] = bloom_height;
1853         curr_effect->set_vector("TargetSize", 2, target_size);
1860         bloom_dims[bloom_index][0] = bloom_width;
1861         bloom_dims[bloom_index][1] = bloom_height;
1862         curr_effect->set_vector("TargetSize", 2, bloom_dims[bloom_index]);
18541863
18551864         curr_effect->begin(&num_passes, 0);
18561865
r29505r29506
18911900      curr_effect->set_vector("Level0123Weight", 4, weight0123);
18921901      curr_effect->set_vector("Level4567Weight", 4, weight4567);
18931902      curr_effect->set_vector("Level89AWeight", 3, weight89A);
1903      curr_effect->set_vector("Level01Size", 4, bloom_dims[0]);
1904      curr_effect->set_vector("Level23Size", 4, bloom_dims[2]);
1905      curr_effect->set_vector("Level45Size", 4, bloom_dims[4]);
1906      curr_effect->set_vector("Level67Size", 4, bloom_dims[6]);
1907      curr_effect->set_vector("Level89Size", 4, bloom_dims[8]);
1908      curr_effect->set_vector("LevelASize", 2, bloom_dims[10]);
18941909
18951910      curr_effect->set_texture("DiffuseA", rt->render_texture[0]);
18961911
r29505r29506
31403155         m_shader->set_vector("Floor", 3, options->floor);
31413156         break;
31423157
3143      case CU_BLOOM_TARGET_SIZE:
3144         m_shader->set_vector("TargetSize", 2, shadersys->target_size);
3145         break;
31463158      case CU_BLOOM_RESCALE:
31473159         m_shader->set_float("BloomRescale", options->raster_bloom_scale);
31483160         break;
branches/new_menus/src/osd/windows/d3dhlsl.h
r29505r29506
8888      CU_POST_POWER,
8989      CU_POST_FLOOR,
9090
91      CU_BLOOM_TARGET_SIZE,
9291      CU_BLOOM_RESCALE,
9392      CU_BLOOM_LVL0123_WEIGHTS,
9493      CU_BLOOM_LVL4567_WEIGHTS,
r29505r29506
402401
403402   texture_info *          curr_texture;
404403   bool                    phosphor_passthrough;
405   float                   target_size[2];
406404
407405public:
408406   render_target *         targethead;
branches/new_menus/src/emu/sound.c
r29505r29506
9494      m_device.machine().save().save_item("stream", state_tag, outputnum, NAME(m_output[outputnum].m_gain));
9595   }
9696
97   // Mark synchronous streams as such
98   m_synchronous = m_sample_rate == STREAM_SYNC;
99   if (m_synchronous)
100   {
101      m_sample_rate = 0;
102      m_sync_timer = m_device.machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sound_stream::sync_update), this));
103   }
104   else
105      m_sync_timer = NULL;
106
97107   // force an update to the sample rates; this will cause everything to be recomputed
98108   // and will generate the initial resample buffers for our inputs
99109   recompute_sample_rate_data();
r29505r29506
284294}
285295
286296
297void sound_stream::sync_update(void *, INT32)
298{
299   update();
300   attotime time = m_device.machine().time();
301   attoseconds_t next_edge = m_attoseconds_per_sample - (time.attoseconds % m_attoseconds_per_sample);
302   m_sync_timer->adjust(attotime(0, next_edge));
303}
304
305
287306//-------------------------------------------------
288307//  output_since_last_update - return a pointer to
289308//  the output buffer and the number of samples
r29505r29506
447466
448467void sound_stream::recompute_sample_rate_data()
449468{
469   if (m_synchronous)
470   {
471      m_sample_rate = 0;
472      // When synchronous, pick the sample rate for the inputs, if any
473      for (int inputnum = 0; inputnum < m_input.count(); inputnum++)
474      {
475         stream_input &input = m_input[inputnum];
476         if (input.m_source != NULL)
477         {
478            if (!m_sample_rate)
479               m_sample_rate = input.m_source->m_stream->m_sample_rate;
480            else if (m_sample_rate != input.m_source->m_stream->m_sample_rate)
481               throw emu_fatalerror("Incompatible sample rates as input of a synchronous stream: %d and %d\n", m_sample_rate, input.m_source->m_stream->m_sample_rate);
482         }
483      }
484      if (!m_sample_rate)
485         m_sample_rate = 1000;
486   }
487
488
450489   // recompute the timing parameters
451490   attoseconds_t update_attoseconds = m_device.machine().sound().update_attoseconds();
452491   m_attoseconds_per_sample = ATTOSECONDS_PER_SECOND / m_sample_rate;
r29505r29506
483522         assert(input.m_latency_attoseconds < update_attoseconds);
484523      }
485524   }
525
526   // If synchronous, prime the timer
527   if (m_synchronous)
528   {
529      attotime time = m_device.machine().time();
530      attoseconds_t next_edge = m_attoseconds_per_sample - (time.attoseconds % m_attoseconds_per_sample);
531      m_sync_timer->adjust(attotime(0, next_edge));
532   }
486533}
487534
488535
branches/new_menus/src/emu/sound.h
r29505r29506
1919
2020
2121//**************************************************************************
22//  CONSTANTS
23//**************************************************************************
24
25const int STREAM_SYNC       = -1;       // special rate value indicating a one-sample-at-a-time stream
26                                        // with actual rate defined by its input
27
28//**************************************************************************
2229//  MACROS
2330//**************************************************************************
2431
r29505r29506
133140   void postload();
134141   void generate_samples(int samples);
135142   stream_sample_t *generate_resampled_data(stream_input &input, UINT32 numsamples);
143   void sync_update(void *, INT32);
136144
137145   // linking information
138   device_t &          m_device;               // owning device
139   sound_stream *      m_next;                 // next stream in the chain
146   device_t &          m_device;                     // owning device
147   sound_stream *      m_next;                       // next stream in the chain
140148
141149   // general information
142   UINT32              m_sample_rate;          // sample rate of this stream
143   UINT32              m_new_sample_rate;      // newly-set sample rate for the stream
150   UINT32              m_sample_rate;                // sample rate of this stream
151   UINT32              m_new_sample_rate;            // newly-set sample rate for the stream
152   bool                m_synchronous;                // synchronous stream that runs at the rate of its input
144153
145154   // timing information
146   attoseconds_t       m_attoseconds_per_sample;// number of attoseconds per sample
147   INT32               m_max_samples_per_update;// maximum samples per update
155   attoseconds_t       m_attoseconds_per_sample;     // number of attoseconds per sample
156   INT32               m_max_samples_per_update;     // maximum samples per update
157   emu_timer *         m_sync_timer;                 // update timer for synchronous streams
148158
149159   // input information
150   dynamic_array<stream_input> m_input;        // list of streams we directly depend upon
151   dynamic_array<stream_sample_t *> m_input_array; // array of inputs for passing to the callback
160   dynamic_array<stream_input> m_input;              // list of streams we directly depend upon
161   dynamic_array<stream_sample_t *> m_input_array;   // array of inputs for passing to the callback
152162
153163   // resample buffer information
154   UINT32              m_resample_bufalloc;    // allocated size of each resample buffer
164   UINT32              m_resample_bufalloc;          // allocated size of each resample buffer
155165
156166   // output information
157   dynamic_array<stream_output> m_output;      // list of streams which directly depend upon us
158   dynamic_array<stream_sample_t *> m_output_array; // array of outputs for passing to the callback
167   dynamic_array<stream_output> m_output;            // list of streams which directly depend upon us
168   dynamic_array<stream_sample_t *> m_output_array;  // array of outputs for passing to the callback
159169
160170   // output buffer information
161   UINT32              m_output_bufalloc;      // allocated size of each output buffer
162   INT32               m_output_sampindex;     // current position within each output buffer
163   INT32               m_output_update_sampindex;// position at time of last global update
164   INT32               m_output_base_sampindex;// sample at base of buffer, relative to the current emulated second
171   UINT32              m_output_bufalloc;            // allocated size of each output buffer
172   INT32               m_output_sampindex;           // current position within each output buffer
173   INT32               m_output_update_sampindex;    // position at time of last global update
174   INT32               m_output_base_sampindex;      // sample at base of buffer, relative to the current emulated second
165175
166176   // callback information
167   stream_update_func  m_callback;             // callback function
168   void *              m_param;                // callback function parameter
177   stream_update_func  m_callback;                   // callback function
178   void *              m_param;                      // callback function parameter
169179};
170180
171181
branches/new_menus/src/emu/cpu/tms7000/tms7000.h
r29505r29506
9292   static const opcode_func s_opfn_exl[0x100];
9393   const opcode_func *m_opcode;
9494
95   static UINT16 bcd_add( UINT16 a, UINT16 b );
96   static UINT16 bcd_tencomp( UINT16 a );
97   static UINT16 bcd_sub( UINT16 a, UINT16 b);
95   inline UINT8 bcd_add( UINT8 a, UINT8 b, UINT8 c );
96   inline UINT8 bcd_sub( UINT8 a, UINT8 b, UINT8 c );
9897
99   PAIR        m_pc;         /* Program counter */
100   UINT8       m_sp;     /* Stack Pointer */
101   UINT8       m_sr;     /* Status Register */
102   UINT8       m_irq_state[3];   /* State of the three IRQs */
103   UINT8       m_rf[0x80];   /* Register file (SJE) */
104   UINT8       m_pf[0x100];  /* Perpherial file */
105   address_space *m_program;
106   direct_read_data *m_direct;
107   address_space *m_io;
98   PAIR        m_pc;               /* Program counter */
99   UINT8       m_sp;               /* Stack Pointer */
100   UINT8       m_sr;               /* Status Register */
101   UINT8       m_irq_state[3];     /* State of the three IRQs */
102   UINT8       m_rf[0x80];         /* Register file (SJE) */
103   UINT8       m_pf[0x100];        /* Perpherial file */
104
108105   int         m_icount;
109106   int         m_div_by_16_trigger;
110107   int         m_cycles_per_INT2;
111108   UINT8       m_t1_capture_latch; /* Timer 1 capture latch */
112   INT8        m_t1_prescaler;   /* Timer 1 prescaler (5 bits) */
113   INT16       m_t1_decrementer; /* Timer 1 decrementer (8 bits) */
114   UINT8       m_idle_state; /* Set after the execution of an idle instruction */
109   INT8        m_t1_prescaler;     /* Timer 1 prescaler (5 bits) */
110   INT16       m_t1_decrementer;   /* Timer 1 decrementer (8 bits) */
111   UINT8       m_idle_state;       /* Set after the execution of an idle instruction */
115112
113   address_space *m_program;
114   direct_read_data *m_direct;
115   address_space *m_io;
116
116117   inline UINT16 RM16( UINT32 mAddr );
117118   inline UINT16 RRF16( UINT32 mAddr );
118119   inline void WRF16( UINT32 mAddr, PAIR p );
120
119121   void tms7000_check_IRQ_lines();
120122   void tms7000_do_interrupt( UINT16 address, UINT8 line );
121123   void illegal();
r29505r29506
348350   void xorp_b2p();
349351   void xorp_i2p();
350352   void tms7000_service_timer1();
351
352353};
353354
354355
branches/new_menus/src/emu/cpu/tms7000/tms70op.inc
r29505r29506
12921292
12931293void tms7000_device::dac_b2a()
12941294{
1295   UINT16  t;
1295   WRA(bcd_add(RDA, RDB, pSR & SR_C));
12961296
1297   t = bcd_add( RDA, RDB );
1298
1299   if (pSR & SR_C)
1300      t = bcd_add( t, 1 );
1301
1302   WRA(t);
1303
1304   CLR_NZC;
1305   SET_C8(t);
1306   SET_N8(t);
1307   SET_Z8(t);
1308
13091297   m_icount -= 7;
13101298}
13111299
13121300void tms7000_device::dac_r2a()
13131301{
1314   UINT8   r;
1315   UINT16  t;
1316
1302   UINT8 r;
13171303   IMMBYTE(r);
13181304
1319   t = bcd_add( RDA, RM(r) );
1305   WRA(bcd_add(RDA, RM(r), pSR & SR_C));
13201306
1321   if (pSR & SR_C)
1322      t = bcd_add( t, 1 );
1323
1324   WRA(t);
1325
1326   CLR_NZC;
1327   SET_C8(t);
1328   SET_N8(t);
1329   SET_Z8(t);
1330
13311307   m_icount -= 10;
13321308}
13331309
13341310void tms7000_device::dac_r2b()
13351311{
1336   UINT8   r;
1337   UINT16  t;
1338
1312   UINT8 r;
13391313   IMMBYTE(r);
13401314
1341   t = bcd_add( RDB, RM(r) );
1315   WRB(bcd_add(RDB, RM(r), pSR & SR_C));
13421316
1343   if (pSR & SR_C)
1344      t = bcd_add( t, 1 );
1345
1346   WRB(t);
1347
1348   CLR_NZC;
1349   SET_C8(t);
1350   SET_N8(t);
1351   SET_Z8(t);
1352
13531317   m_icount -= 10;
13541318}
13551319
13561320void tms7000_device::dac_r2r()
13571321{
1358   UINT8   r,s;
1359   UINT16  t;
1360
1322   UINT8 s, r;
13611323   IMMBYTE(s);
13621324   IMMBYTE(r);
13631325
1364   t = bcd_add( RM(s), RM(r) );
1326   WM(r, bcd_add(RM(s), RM(r), pSR & SR_C));
13651327
1366   if (pSR & SR_C)
1367      t = bcd_add( t, 1 );
1368
1369   WM(r,t);
1370
1371   CLR_NZC;
1372   SET_C8(t);
1373   SET_N8(t);
1374   SET_Z8(t);
1375
13761328   m_icount -= 12;
13771329}
13781330
13791331void tms7000_device::dac_i2a()
13801332{
1381   UINT8   i;
1382   UINT16  t;
1383
1333   UINT8 i;
13841334   IMMBYTE(i);
13851335
1386   t = bcd_add( i, RDA );
1336   WRA(bcd_add(i, RDA, pSR & SR_C));
13871337
1388   if (pSR & SR_C)
1389      t = bcd_add( t, 1 );
1390
1391   WRA(t);
1392
1393   CLR_NZC;
1394   SET_C8(t);
1395   SET_N8(t);
1396   SET_Z8(t);
1397
13981338   m_icount -= 9;
13991339}
14001340
14011341void tms7000_device::dac_i2b()
14021342{
1403   UINT8   i;
1404   UINT16  t;
1405
1343   UINT8 i;
14061344   IMMBYTE(i);
14071345
1408   t = bcd_add( i, RDB );
1346   WRB(bcd_add(i, RDB, pSR & SR_C));
14091347
1410   if (pSR & SR_C)
1411      t = bcd_add( t, 1 );
1412
1413   WRB(t);
1414
1415   CLR_NZC;
1416   SET_C8(t);
1417   SET_N8(t);
1418   SET_Z8(t);
1419
14201348   m_icount -= 9;
14211349}
14221350
14231351void tms7000_device::dac_i2r()
14241352{
1425   UINT8   i,r;
1426   UINT16  t;
1427
1353   UINT8 i, r;
14281354   IMMBYTE(i);
14291355   IMMBYTE(r);
14301356
1431   t = bcd_add( i, RM(r) );
1357   WM(r, bcd_add(i, RM(r), pSR & SR_C));
14321358
1433   if (pSR & SR_C)
1434      t = bcd_add( t, 1 );
1435
1436   WM(r,t);
1437
1438   CLR_NZC;
1439   SET_C8(t);
1440   SET_N8(t);
1441   SET_Z8(t);
1442
14431359   m_icount -= 11;
14441360}
14451361
r29505r29506
16421558
16431559void tms7000_device::dsb_b2a()
16441560{
1645   UINT16  t;
1561   WRA(bcd_sub(RDA, RDB, pSR & SR_C));
16461562
1647   t = bcd_sub( RDA, RDB );
1648
1649   if( !(pSR & SR_C) )
1650      t = bcd_sub( t, 1 );
1651
1652   WRA(t);
1653
1654   CLR_NZC;
1655   SET_C8(~t);
1656   SET_N8(t);
1657   SET_Z8(t);
1658
16591563   m_icount -= 7;
16601564}
16611565
16621566void tms7000_device::dsb_r2a()
16631567{
1664   UINT8   r;
1665   UINT16  t;
1666
1568   UINT8 r;
16671569   IMMBYTE(r);
16681570
1669   t = bcd_sub( RDA, RM(r) );
1571   WRA(bcd_sub(RDA, RM(r), pSR & SR_C));
16701572
1671   if( !(pSR & SR_C) )
1672      t = bcd_sub( t, 1 );
1673
1674   WRA(t);
1675
1676   CLR_NZC;
1677   SET_C8(~t);
1678   SET_N8(t);
1679   SET_Z8(t);
1680
16811573   m_icount -= 10;
16821574}
16831575
16841576void tms7000_device::dsb_r2b()
16851577{
1686   UINT8   r;
1687   UINT16  t;
1688
1578   UINT8 r;
16891579   IMMBYTE(r);
16901580
1691   t = bcd_sub( RDB, RM(r) );
1581   WRB(bcd_sub(RDB, RM(r), pSR & SR_C));
16921582
1693   if( !(pSR & SR_C) )
1694      t = bcd_sub( t, 1 );
1695
1696   WRB(t);
1697
1698   CLR_NZC;
1699   SET_C8(~t);
1700   SET_N8(t);
1701   SET_Z8(t);
1702
17031583   m_icount -= 10;
17041584}
17051585
17061586void tms7000_device::dsb_r2r()
17071587{
1708   UINT8   r,s;
1709   UINT16  t;
1710
1588   UINT8 s, r;
17111589   IMMBYTE(s);
17121590   IMMBYTE(r);
17131591
1714   t = bcd_sub( RM(s), RM(r) );
1592   WM(r, bcd_sub(RM(s), RM(r), pSR & SR_C));
17151593
1716   if( !(pSR & SR_C) )
1717      t = bcd_sub( t, 1 );
1718
1719   WM(r,t);
1720
1721   CLR_NZC;
1722   SET_C8(~t);
1723   SET_N8(t);
1724   SET_Z8(t);
1725
17261594   m_icount -= 12;
17271595}
17281596
17291597void tms7000_device::dsb_i2a()
17301598{
1731   UINT8   i;
1732   UINT16  t;
1733
1599   UINT8 i;
17341600   IMMBYTE(i);
17351601
1736   t = bcd_sub( RDA, i );
1602   WRA(bcd_sub(RDA, i, pSR & SR_C));
17371603
1738   if( !(pSR & SR_C) )
1739      t = bcd_sub( t, 1 );
1740
1741   WRA(t);
1742
1743   CLR_NZC;
1744   SET_C8(~t);
1745   SET_N8(t);
1746   SET_Z8(t);
1747
17481604   m_icount -= 9;
17491605}
17501606
17511607void tms7000_device::dsb_i2b()
17521608{
1753   UINT8   i;
1754   UINT16  t;
1755
1609   UINT8 i;
17561610   IMMBYTE(i);
17571611
1758   t = bcd_sub( RDB, i );
1612   WRB(bcd_sub(RDB, i, pSR & SR_C));
17591613
1760   if( !(pSR & SR_C) )
1761      t = bcd_sub( t, 1 );
1762
1763   WRB(t);
1764
1765   CLR_NZC;
1766   SET_C8(~t);
1767   SET_N8(t);
1768   SET_Z8(t);
1769
17701614   m_icount -= 9;
17711615}
17721616
17731617void tms7000_device::dsb_i2r()
17741618{
1775   UINT8   r,i;
1776   UINT16  t;
1777
1619   UINT8 i, r;
17781620   IMMBYTE(i);
17791621   IMMBYTE(r);
17801622
1781   t = bcd_sub( RM(r), i );
1623   WM(r, bcd_sub(RM(r), i, pSR & SR_C));
17821624
1783   if( !(pSR & SR_C) )
1784      t = bcd_sub( t, 1 );
1785
1786   WM(r,t);
1787
1788   CLR_NZC;
1789   SET_C8(~t);
1790   SET_N8(t);
1791   SET_Z8(t);
1792
17931625   m_icount -= 11;
17941626}
17951627
branches/new_menus/src/emu/cpu/tms7000/tms7000.c
r29505r29506
5757
5858
5959static ADDRESS_MAP_START(tms7000_mem, AS_PROGRAM, 8, tms7000_device )
60   AM_RANGE(0x0000, 0x007f)    AM_READWRITE(tms7000_internal_r, tms7000_internal_w) /* tms7000 internal RAM */
61   AM_RANGE(0x0080, 0x00ff)    AM_NOP                      /* reserved */
62   AM_RANGE(0x0100, 0x01ff)    AM_READWRITE(tms70x0_pf_r, tms70x0_pf_w)             /* tms7000 internal I/O ports */
60   AM_RANGE(0x0000, 0x007f) AM_READWRITE(tms7000_internal_r, tms7000_internal_w) /* tms7000 internal RAM */
61   AM_RANGE(0x0080, 0x00ff) AM_NOP                                               /* reserved */
62   AM_RANGE(0x0100, 0x01ff) AM_READWRITE(tms70x0_pf_r, tms70x0_pf_w)             /* tms7000 internal I/O ports */
6363ADDRESS_MAP_END
6464
6565
r29505r29506
133133   return result | RM((mAddr+1)&0xffff);
134134}
135135
136UINT16 tms7000_device::RRF16( UINT32 mAddr )    /*Read register file (16 bit) */
136UINT16 tms7000_device::RRF16( UINT32 mAddr ) /* Read register file (16 bit) */
137137{
138138   PAIR result;
139139   result.b.h = RM((mAddr-1)&0xffff);
r29505r29506
141141   return result.w.l;
142142}
143143
144void tms7000_device::WRF16( UINT32 mAddr, PAIR p ) /*Write register file (16 bit) */
144void tms7000_device::WRF16( UINT32 mAddr, PAIR p ) /* Write register file (16 bit) */
145145{
146146   WM( (mAddr-1)&0xffff, p.b.h );
147147   WM( mAddr, p.b.l );
r29505r29506
527527}
528528
529529// BCD arthrimetic handling
530UINT16 tms7000_device::bcd_add( UINT16 a, UINT16 b )
530static const UINT8 lut_bcd_out[6] = { 0x00, 0x06, 0x00, 0x66, 0x60, 0x66 };
531
532inline UINT8 tms7000_device::bcd_add( UINT8 a, UINT8 b, UINT8 c )
531533{
532   UINT16  t1,t2,t3,t4,t5,t6;
534   c = (c != 0) ? 1 : 0;
533535
534   /* Sure it is a lot of code, but it works! */
535   t1 = a + 0x0666;
536   t2 = t1 + b;
537   t3 = t1 ^ b;
538   t4 = t2 ^ t3;
539   t5 = ~t4 & 0x1110;
540   t6 = (t5 >> 2) | (t5 >> 3);
541   return t2-t6;
536   UINT8 h1 = a >> 4 & 0xf;
537   UINT8 l1 = a >> 0 & 0xf;
538   UINT8 h2 = b >> 4 & 0xf;
539   UINT8 l2 = b >> 0 & 0xf;
540   
541   // compute bcd constant
542   UINT8 d = ((l1 + l2 + c) < 10) ? 0 : 1;
543   if ((h1 + h2) == 9)
544      d |= 2;
545   else if ((h1 + h2) > 9)
546      d |= 4;
547   
548   UINT8 ret = a + b + c + lut_bcd_out[d];
549   
550   CLR_NZC;
551   SET_N8(ret);
552   SET_Z8(ret);
553   
554   if (d > 2)
555      pSR |= SR_C;
556   
557   return ret;
542558}
543559
544UINT16 tms7000_device::bcd_tencomp( UINT16 a )
560inline UINT8 tms7000_device::bcd_sub( UINT8 a, UINT8 b, UINT8 c )
545561{
546   UINT16  t1,t2,t3,t4,t5,t6;
562   c = (c != 0) ? 0 : 1;
547563
548   t1 = 0xffff - a;
549   t2 = -a;
550   t3 = t1 ^ 0x0001;
551   t4 = t2 ^ t3;
552   t5 = ~t4 & 0x1110;
553   t6 = (t5 >> 2)|(t5>>3);
554   return t2-t6;
555}
564   UINT8 h1 = a >> 4 & 0xf;
565   UINT8 l1 = a >> 0 & 0xf;
566   UINT8 h2 = b >> 4 & 0xf;
567   UINT8 l2 = b >> 0 & 0xf;
556568
557/*
558    Compute difference a-b???
559*/
560UINT16 tms7000_device::bcd_sub( UINT16 a, UINT16 b)
561{
562   //return bcd_tencomp(b) - bcd_tencomp(a);
563   return bcd_add(a, bcd_tencomp(b) & 0xff);
569   // compute bcd constant
570   UINT8 d = ((l1 - c) >= l2) ? 0 : 1;
571   if (h1 == h2)
572      d |= 2;
573   else if (h1 < h2)
574      d |= 4;
575
576   UINT8 ret = a - b - c - lut_bcd_out[d];
577   
578   CLR_NZC;
579   SET_N8(ret);
580   SET_Z8(ret);
581   
582   if (d > 2)
583      pSR |= SR_C;
584   
585   return ret;
564586}
565587
566588WRITE8_MEMBER( tms7000_device::tms7000_internal_w )
branches/new_menus/src/emu/cpu/tms57002/tms57002.c
r29505r29506
2222
2323tms57002_device::tms57002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2424   : cpu_device(mconfig, TMS57002, "TMS57002", tag, owner, clock, "tms57002", __FILE__),
25      program_config("program", ENDIANNESS_LITTLE, 32, 8, -2, ADDRESS_MAP_NAME(internal_pgm)),
26      data_config("data", ENDIANNESS_LITTLE, 8, 20)
25     device_sound_interface(mconfig, *this),
26     program_config("program", ENDIANNESS_LITTLE, 32, 8, -2, ADDRESS_MAP_NAME(internal_pgm)),
27     data_config("data", ENDIANNESS_LITTLE, 8, 20)
2728{
2829}
2930
r29505r29506
211212   if(st0 & ST0_WORD) {
212213      if(st0 & ST0_SEL) {
213214         int off = 16 - ((adr & 3) << 3);
214         xrd = (xrd & ~(0xff << off)) | (v << off);
215         txrd = (txrd & ~(0xff << off)) | (v << off);
215216         done = off == 0;
216217      } else {
217218         int off = 20 - ((adr & 7) << 2);
218         xrd = (xrd & ~(0xf << off)) | ((v & 0xf) << off);
219         txrd = (txrd & ~(0xf << off)) | ((v & 0xf) << off);
219220         done = off == 0;
220221      }
221222   } else {
222223      if(st0 & ST0_SEL) {
223224         int off = 16 - ((adr & 1) << 3);
224         xrd = (xrd & ~(0xff << off)) | (v << off);
225         txrd = (txrd & ~(0xff << off)) | (v << off);
225226         done = off == 8;
226227         if(done)
227            xrd &= 0xffff00;
228            txrd &= 0xffff00;
228229      } else {
229230         int off = 20 - ((adr & 3) << 2);
230         xrd = (xrd & ~(0xf << off)) | ((v & 0xf) << off);
231         txrd = (txrd & ~(0xf << off)) | ((v & 0xf) << off);
231232         done = off == 8;
232233         if(done)
233            xrd &= 0xffff00;
234            txrd &= 0xffff00;
234235      }
235236   }
236237   if(done) {
238      xrd = txrd;
237239      sti &= ~S_READ;
238240      xm_adr = 0;
239241   } else
r29505r29506
782784      icount = 0;
783785}
784786
787void tms57002_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
788{
789   assert(samples == 1);
790
791   if(st0 & ST0_SIM) {
792      si[0] = (inputs[0][0] << 8) & 0xffffff;
793      si[1] = (inputs[1][0] << 8) & 0xffffff;
794      si[2] = (inputs[2][0] << 8) & 0xffffff;
795      si[3] = (inputs[3][0] << 8) & 0xffffff;
796   } else {
797      si[0] = inputs[0][0] & 0xffffff;
798      si[1] = inputs[1][0] & 0xffffff;
799      si[2] = inputs[2][0] & 0xffffff;
800      si[3] = inputs[3][0] & 0xffffff;
801   }
802   outputs[0][0] = INT16(so[0] >> 8);
803   outputs[1][0] = INT16(so[1] >> 8);
804   outputs[2][0] = INT16(so[2] >> 8);
805   outputs[3][0] = INT16(so[3] >> 8);
806
807   sync_w(1);
808}
809
785810void tms57002_device::device_start()
786811{
787812   sti = S_IDLE;
r29505r29506
812837
813838   m_icountptr = &icount;
814839
840   stream_alloc(4, 4, STREAM_SYNC);
841
815842   save_item(NAME(macc));
816843
817844   save_item(NAME(cmem));
r29505r29506
829856   save_item(NAME(xba));
830857   save_item(NAME(xwr));
831858   save_item(NAME(xrd));
859   save_item(NAME(txrd));
832860   save_item(NAME(creg));
833861
834862   save_item(NAME(pc));
branches/new_menus/src/emu/cpu/tms57002/tms57002.h
r29505r29506
1212#ifndef __TMS57002_H__
1313#define __TMS57002_H__
1414
15class tms57002_device : public cpu_device {
15class tms57002_device : public cpu_device, public device_sound_interface {
1616public:
1717   tms57002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1818
r29505r29506
2929protected:
3030   virtual void device_start();
3131   virtual void device_reset();
32   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
3233   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
3334   virtual UINT32 execute_min_cycles() const;
3435   virtual UINT32 execute_max_cycles() const;
r29505r29506
126127   UINT32 si[4], so[4];
127128
128129   UINT32 st0, st1, sti;
129   UINT32 aacc, xoa, xba, xwr, xrd, creg;
130   UINT32 aacc, xoa, xba, xwr, xrd, txrd, creg;
130131
131132   UINT8 pc, hpc, ca, id, ba0, ba1, rptc, rptc_next, sa;
132133
branches/new_menus/src/emu/dimemory.c
r29505r29506
293293            }
294294
295295            // if this entry references a memory region, validate it
296            if (entry->m_region != NULL && entry->m_share == 0)
296            if (entry->m_region != NULL && entry->m_sharetag == 0)
297297            {
298298               // make sure we can resolve the full path to the region
299299               bool found = false;
r29505r29506
346346               valid.validate_tag(entry->m_read.m_tag);
347347            if (entry->m_write.m_type == AMH_BANK)
348348               valid.validate_tag(entry->m_write.m_tag);
349            if (entry->m_share != NULL)
350               valid.validate_tag(entry->m_share);
349            if (entry->m_sharetag != NULL)
350               valid.validate_tag(entry->m_sharetag);
351351         }
352352
353353         // release the address map
branches/new_menus/src/emu/addrmap.c
r29505r29506
2626      m_addrend((map.m_globalmask == 0) ? end : end & map.m_globalmask),
2727      m_addrmirror(0),
2828      m_addrmask(0),
29      m_share(NULL),
29      m_sharebase(NULL),
30      m_sharetag(NULL),
3031      m_region(NULL),
3132      m_rgnoffs(0),
3233      m_rspace8(NULL),
branches/new_menus/src/emu/addrmap.h
r29505r29506
8383   void set_read_type(map_handler_type _type) { m_read.m_type = _type; }
8484   void set_write_type(map_handler_type _type) { m_write.m_type = _type; }
8585   void set_region(const char *tag, offs_t offset) { m_region = tag; m_rgnoffs = offset; }
86   void set_share(const char *tag) { assert(m_share == NULL); m_share = tag; }
86   void set_share(device_t &device, const char *tag) { assert(m_sharetag == NULL); m_sharebase = &device; m_sharetag = tag; }
8787
8888   // mask setting
8989   void set_mask(offs_t _mask);
r29505r29506
117117   map_handler_data        m_read;                 // data for read handler
118118   map_handler_data        m_write;                // data for write handler
119119   map_handler_data        m_setoffsethd;          // data for setoffset handler
120   const char *            m_share;                // tag of a shared memory block
120   device_t *              m_sharebase;            // pointer to the base device for the share tag
121   const char *            m_sharetag;             // tag of a shared memory block
121122   const char *            m_region;               // tag of region containing the memory backing this entry
122123   offs_t                  m_rgnoffs;              // offset within the region
123124
r29505r29506
566567#define AM_REGION(_tag, _offs) \
567568   curentry->set_region(_tag, _offs);
568569#define AM_SHARE(_tag) \
569   curentry->set_share(_tag);
570   curentry->set_share(device, _tag);
570571
571572// common shortcuts
572573#define AM_ROMBANK(_bank)                   AM_READ_BANK(_bank)
branches/new_menus/src/emu/device.h
r29505r29506
322322   template<class _InterfaceClass> bool next(_InterfaceClass *&intf) const { return m_device.next(intf); }
323323
324324   // optional operation overrides
325   //
326   // WARNING: interface_pre_start must be callable multiple times in
327   // case another interface throws a missing dependency.  In
328   // particular, state saving registrations should be done in post.
325329   virtual void interface_config_complete();
326330   virtual void interface_validity_check(validity_checker &valid) const;
327331   virtual void interface_pre_start();
branches/new_menus/src/emu/bus/pce/pce_slot.h
r29505r29506
3030   virtual DECLARE_READ8_MEMBER(read_cart) { return 0xff; }
3131   virtual DECLARE_WRITE8_MEMBER(write_cart) {};
3232
33   void rom_alloc(running_machine &machine, UINT32 size);
34   void ram_alloc(running_machine &machine, UINT32 size);
33   void rom_alloc(UINT32 size);
34   void ram_alloc(UINT32 size);
3535   UINT8* get_rom_base() { return m_rom; }
3636   UINT8* get_ram_base() { return m_ram; }
37   UINT32 get_rom_size() { return m_rom_size; }
38   UINT32 get_ram_size() { return m_ram_size; }
37   UINT32 get_rom_size() { return m_rom.count(); }
38   UINT32 get_ram_size() { return m_ram.count(); }
3939
4040   // internal state
41   UINT8 *m_rom;
42   UINT8 *m_ram;
43   UINT32 m_rom_size;
44   UINT32 m_ram_size;
41   dynamic_buffer m_rom;
42   dynamic_buffer m_ram;
4543
4644   void rom_map_setup(UINT32 size);
4745
branches/new_menus/src/emu/bus/pce/pce_slot.c
r29505r29506
2525//-------------------------------------------------
2626
2727device_pce_cart_interface::device_pce_cart_interface(const machine_config &mconfig, device_t &device)
28   : device_slot_card_interface(mconfig, device),
29      m_rom(NULL),
30      m_ram(NULL),
31      m_rom_size(0),
32      m_ram_size(0)
28   : device_slot_card_interface(mconfig, device)
3329{
3430}
3531
r29505r29506
4642//  rom_alloc - alloc the space for the cart
4743//-------------------------------------------------
4844
49void device_pce_cart_interface::rom_alloc(running_machine &machine, UINT32 size)
45void device_pce_cart_interface::rom_alloc(UINT32 size)
5046{
5147   if (m_rom == NULL)
52   {
53      m_rom = auto_alloc_array_clear(machine, UINT8, size);
54      m_rom_size = size;
55   }
48      m_rom.resize(size);
5649}
5750
5851
r29505r29506
6053//  ram_alloc - alloc the space for the ram
6154//-------------------------------------------------
6255
63void device_pce_cart_interface::ram_alloc(running_machine &machine, UINT32 size)
56void device_pce_cart_interface::ram_alloc(UINT32 size)
6457{
6558   if (m_ram == NULL)
6659   {
67      m_ram = auto_alloc_array_clear(machine, UINT8, size);
68      m_ram_size = size;
69      state_save_register_item_pointer(machine, "PCE_CART", this->device().tag(), 0, m_ram, m_ram_size);
60      m_ram.resize(size);
61      device().save_item(NAME(m_ram));
7062   }
7163}
7264
r29505r29506
228220         fseek(offset, SEEK_SET);
229221      }
230222
231      m_cart->rom_alloc(machine(), len);
223      m_cart->rom_alloc(len);
232224      ROM = m_cart->get_rom_base();
233225
234226      if (software_entry() == NULL)
r29505r29506
263255      //printf("Type: %s\n", pce_get_slot(m_type));
264256
265257      if (m_type == PCE_POPULOUS)
266         m_cart->ram_alloc(machine(), 0x8000);
258         m_cart->ram_alloc(0x8000);
267259      if (m_type == PCE_CDSYS3J || m_type == PCE_CDSYS3U)
268         m_cart->ram_alloc(machine(), 0x30000);
260         m_cart->ram_alloc(0x30000);
269261
270262      return IMAGE_INIT_PASS;
271263   }
branches/new_menus/src/emu/bus/sega8/rom.c
r29505r29506
329329   int bank = offset / 0x4000;
330330
331331   if (bank == 2 && m_ram && m_ram_enabled)
332      return m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram_size];
332      return m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram.count()];
333333
334334   if (offset < 0x400) // first 1k is hardcoded
335335      return m_rom[offset];
r29505r29506
342342   int bank = offset / 0x4000;
343343
344344   if (bank == 2 && m_ram && m_ram_enabled)
345      m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram_size] = data;
345      m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram.count()] = data;
346346}
347347
348348WRITE8_MEMBER(sega8_rom_device::write_mapper)
r29505r29506
422422   if (offset >= 0x8000 && offset < 0xa000)
423423      return m_ram[offset & 0x7ff];
424424
425   return m_rom[offset % m_rom_size];
425   return m_rom[offset % m_rom.count()];
426426}
427427
428428WRITE8_MEMBER(sega8_othello_device::write_cart)
r29505r29506
446446   if (offset >= 0x8000 && offset < 0xa000)
447447      return m_ram[offset & 0x1fff];
448448
449   return m_rom[offset % m_rom_size];
449   return m_rom[offset % m_rom.count()];
450450}
451451
452452WRITE8_MEMBER(sega8_castle_device::write_cart)
r29505r29506
470470   if (offset >= 0x8000)
471471      return m_ram[offset & 0x3fff];
472472
473   return m_rom[offset % m_rom_size];
473   return m_rom[offset % m_rom.count()];
474474}
475475
476476WRITE8_MEMBER(sega8_basic_l3_device::write_cart)
r29505r29506
504504   if (offset >= 0x8000 && offset < 0xa000)
505505      return m_ram[offset & 0x1fff];
506506
507   return m_rom[offset % m_rom_size];
507   return m_rom[offset % m_rom.count()];
508508}
509509
510510WRITE8_MEMBER(sega8_music_editor_device::write_cart)
r29505r29506
623623   if (offset >= 0x2000 && offset < 0x4000)
624624      return m_ram[offset & 0x1fff];
625625
626   return m_rom[offset % m_rom_size];
626   return m_rom[offset % m_rom.count()];
627627}
628628
629629WRITE8_MEMBER(sega8_dahjee_typea_device::write_cart)
r29505r29506
651651// TYPE B
652652READ8_MEMBER(sega8_dahjee_typeb_device::read_cart)
653653{
654   return m_rom[offset % m_rom_size];
654   return m_rom[offset % m_rom.count()];
655655}
656656
657657READ8_MEMBER(sega8_dahjee_typeb_device::read_ram)
r29505r29506
750750   int bank = offset / 0x2000;
751751
752752   if (bank == 5 && m_ram && m_ram_enabled)
753      return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size];
753      return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram.count()];
754754
755755   return m_rom[m_rom_bank_base[bank/2] * 0x4000 + (offset & 0x3fff)];
756756}
r29505r29506
782782   }
783783
784784   if (bank == 5 && m_ram && m_ram_enabled)
785      m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size] = data;
785      m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram.count()] = data;
786786}
787787
788788/*-------------------------------------------------
r29505r29506
824824   int bank = offset / 0x2000;
825825
826826   if (bank >= 4 && m_ram && m_ram_enabled)
827      return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size];
827      return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram.count()];
828828
829829   return m_rom[m_rom_bank_base[bank] * 0x2000 + (offset & 0x1fff)];
830830}
r29505r29506
834834   int bank = offset / 0x2000;
835835
836836   if (bank >= 4 && m_ram && m_ram_enabled)
837      m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size] = data;
837      m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram.count()] = data;
838838
839839   if (offset < 4)
840840   {
branches/new_menus/src/emu/bus/sega8/sega8_slot.h
r29505r29506
4949   virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
5050   virtual DECLARE_WRITE8_MEMBER(write_ram) {}
5151
52   void rom_alloc(running_machine &machine, UINT32 size);
53   void ram_alloc(running_machine &machine, UINT32 size);
52   void rom_alloc(UINT32 size);
53   void ram_alloc(UINT32 size);
5454
5555   virtual void late_bank_setup() {}
5656
r29505r29506
6666//protected:
6767   UINT8* get_rom_base() { return m_rom; }
6868   UINT8* get_ram_base() { return m_ram; }
69   UINT32 get_rom_size() { return m_rom_size; }
70   UINT32 get_ram_size() { return m_ram_size; }
69   UINT32 get_rom_size() { return m_rom.count(); }
70   UINT32 get_ram_size() { return m_ram.count(); }
7171
7272   void rom_map_setup(UINT32 size);
7373   void ram_map_setup(UINT8 banks);
7474
7575//private:
7676   // internal state
77   UINT8  *m_rom;
78   UINT8  *m_ram;
79   UINT32 m_rom_size;
80   UINT32 m_ram_size;
77   dynamic_buffer m_rom;
78   dynamic_buffer m_ram;
8179   int m_rom_page_count;
8280
8381   bool has_battery;
branches/new_menus/src/emu/bus/sega8/sega8_slot.c
r29505r29506
4949
5050device_sega8_cart_interface::device_sega8_cart_interface(const machine_config &mconfig, device_t &device)
5151   : device_slot_card_interface(mconfig, device),
52      m_rom(NULL),
53      m_ram(NULL),
54      m_rom_size(0),
55      m_ram_size(0),
5652      m_rom_page_count(0),
5753      has_battery(FALSE),
5854      m_late_battery_enable(FALSE),
r29505r29506
7470//  rom_alloc - alloc the space for the cart
7571//-------------------------------------------------
7672
77void device_sega8_cart_interface::rom_alloc(running_machine &machine, UINT32 size)
73void device_sega8_cart_interface::rom_alloc(UINT32 size)
7874{
7975   if (m_rom == NULL)
8076   {
81      m_rom = auto_alloc_array_clear(machine, UINT8, size);
82      m_rom_size = size;
77      m_rom.resize(size);
8378      m_rom_page_count = size / 0x4000;
8479      if (!m_rom_page_count)
8580         m_rom_page_count = 1;   // we compute rom pages through (XXX % m_rom_page_count)!
r29505r29506
9287//  ram_alloc - alloc the space for the ram
9388//-------------------------------------------------
9489
95void device_sega8_cart_interface::ram_alloc(running_machine &machine, UINT32 size)
90void device_sega8_cart_interface::ram_alloc(UINT32 size)
9691{
9792   if (m_ram == NULL)
9893   {
99      m_ram = auto_alloc_array_clear(machine, UINT8, size);
100      m_ram_size = size;
101      state_save_register_item_pointer(machine, "SEGA8_CART", this->device().tag(), 0, m_ram, m_ram_size);
94      m_ram.resize(size);
95      device().save_item(NAME(m_ram));
10296   }
10397}
10498
r29505r29506
284278   {
285279      if (m_type == SEGA8_CASTLE)
286280      {
287         m_cart->ram_alloc(machine(), 0x2000);
281         m_cart->ram_alloc(0x2000);
288282         m_cart->set_has_battery(FALSE);
289283      }
290284      else if (m_type == SEGA8_OTHELLO)
291285      {
292         m_cart->ram_alloc(machine(), 0x800);
286         m_cart->ram_alloc(0x800);
293287         m_cart->set_has_battery(FALSE);
294288      }
295289      else if (m_type == SEGA8_BASIC_L3)
296290      {
297         m_cart->ram_alloc(machine(), 0x8000);
291         m_cart->ram_alloc(0x8000);
298292         m_cart->set_has_battery(FALSE);
299293      }
300294      else if (m_type == SEGA8_MUSIC_EDITOR)
301295      {
302         m_cart->ram_alloc(machine(), 0x2800);
296         m_cart->ram_alloc(0x2800);
303297         m_cart->set_has_battery(FALSE);
304298      }
305299      else if (m_type == SEGA8_DAHJEE_TYPEA)
306300      {
307         m_cart->ram_alloc(machine(), 0x2400);
301         m_cart->ram_alloc(0x2400);
308302         m_cart->set_has_battery(FALSE);
309303      }
310304      else if (m_type == SEGA8_DAHJEE_TYPEB)
311305      {
312         m_cart->ram_alloc(machine(), 0x2000);
306         m_cart->ram_alloc(0x2000);
313307         m_cart->set_has_battery(FALSE);
314308      }
315309      else if (m_type == SEGA8_CODEMASTERS)
316310      {
317311         // Codemasters cart can have 64KB of RAM (Ernie Els Golf? or 8KB?) and no battery
318         m_cart->ram_alloc(machine(), 0x10000);
312         m_cart->ram_alloc(0x10000);
319313         m_cart->set_has_battery(FALSE);
320314      }
321315      else
r29505r29506
324318         // how much RAM was in the cart and if there was a battery so we always alloc 32KB and
325319         // we save its content only if the game enable the RAM
326320         m_cart->set_late_battery(TRUE);
327         m_cart->ram_alloc(machine(), 0x08000);
321         m_cart->ram_alloc(0x08000);
328322      }
329323   }
330324   else
r29505r29506
334328      m_cart->set_late_battery(FALSE);
335329
336330      if (get_software_region_length("ram"))
337         m_cart->ram_alloc(machine(), get_software_region_length("ram"));
331         m_cart->ram_alloc(get_software_region_length("ram"));
338332
339333      if (battery && !strcmp(battery, "yes"))
340334         m_cart->set_has_battery(TRUE);
r29505r29506
366360      if (len & 0x3fff)
367361         len = ((len >> 14) + 1) << 14;
368362
369      m_cart->rom_alloc(machine(), len);
363      m_cart->rom_alloc(len);
370364      ROM = m_cart->get_rom_base();
371365
372366      if (software_entry() == NULL)
branches/new_menus/src/emu/bus/snes/snes_slot.c
r29505r29506
6767//-------------------------------------------------
6868
6969device_sns_cart_interface::device_sns_cart_interface(const machine_config &mconfig, device_t &device)
70   : device_slot_card_interface(mconfig, device),
71      m_rom(NULL),
72      m_nvram(NULL),
73      m_bios(NULL),
74      m_rtc_ram(NULL),
75      m_rom_size(0),
76      m_nvram_size(0),
77      m_bios_size(0),
78      m_rtc_ram_size(0)
70   : device_slot_card_interface(mconfig, device)
7971{
8072}
8173
r29505r29506
9284//  rom_alloc - alloc the space for the cart
9385//-------------------------------------------------
9486
95void device_sns_cart_interface::rom_alloc(running_machine &machine, UINT32 size)
87void device_sns_cart_interface::rom_alloc(UINT32 size)
9688{
9789   if (m_rom == NULL)
98   {
99      m_rom = auto_alloc_array_clear(machine, UINT8, size);
100      m_rom_size = size;
101   }
90      m_rom.resize(size);
10291}
10392
10493
r29505r29506
10695//  nvram_alloc - alloc the space for the nvram
10796//-------------------------------------------------
10897
109void device_sns_cart_interface::nvram_alloc(running_machine &machine, UINT32 size)
98void device_sns_cart_interface::nvram_alloc(UINT32 size)
11099{
111100   if (m_nvram == NULL)
112101   {
113      m_nvram = auto_alloc_array_clear(machine, UINT8, size);
114      m_nvram_size = size;
115      state_save_register_item_pointer(machine, "SNES_CART", this->device().tag(), 0, m_nvram, m_nvram_size);
102      m_nvram.resize(size);
103      device().save_item(NAME(m_nvram));
116104   }
117105}
118106
r29505r29506
124112//  saved by the device itself)
125113//-------------------------------------------------
126114
127void device_sns_cart_interface::rtc_ram_alloc(running_machine &machine, UINT32 size)
115void device_sns_cart_interface::rtc_ram_alloc(UINT32 size)
128116{
129117   if (m_rtc_ram == NULL)
130118   {
131      m_rtc_ram = auto_alloc_array_clear(machine, UINT8, size);
132      m_rtc_ram_size = size;
133      state_save_register_item_pointer(machine, "SNES_CART", this->device().tag(), 0, m_rtc_ram, m_rtc_ram_size);
119      m_rtc_ram.resize(size);
120      device().save_item(NAME(m_rtc_ram));
134121   }
135122}
136123
r29505r29506
140127//  (optional) add-on CPU bios
141128//-------------------------------------------------
142129
143void device_sns_cart_interface::addon_bios_alloc(running_machine &machine, UINT32 size)
130void device_sns_cart_interface::addon_bios_alloc(UINT32 size)
144131{
145132   if (m_bios == NULL)
146   {
147      m_bios = auto_alloc_array_clear(machine, UINT8, size);
148      m_bios_size = size;
149   }
133      m_bios.resize(size);
150134}
151135
152136
r29505r29506
638622
639623      len = (software_entry() == NULL) ? (length() - offset) : get_software_region_length("rom");
640624
641      m_cart->rom_alloc(machine(), len);
625      m_cart->rom_alloc(len);
642626      ROM = m_cart->get_rom_base();
643627      if (software_entry() == NULL)
644628         fread(ROM, len);
r29505r29506
652636      {
653637         if (get_software_region("addon"))
654638         {
655            m_cart->addon_bios_alloc(machine(), get_software_region_length("addon"));
639            m_cart->addon_bios_alloc(get_software_region_length("addon"));
656640            memcpy(m_cart->get_addon_bios_base(), get_software_region("addon"), get_software_region_length("addon"));
657641         }
658642      }
r29505r29506
746730         if ((m_cart->get_rom_size() & 0x7fff) == 0x2800)
747731         {
748732            logerror("Found NEC DSP dump at the bottom of the ROM.\n");
749            m_cart->addon_bios_alloc(machine(), 0x2800);
733            m_cart->addon_bios_alloc(0x2800);
750734            memcpy(m_cart->get_addon_bios_base(), m_cart->get_rom_base() + (m_cart->get_rom_size() - 0x2800), 0x2800);
751735            m_cart->rom_map_setup(m_cart->get_rom_size() - 0x2800);
752736         }
r29505r29506
754738         if ((m_cart->get_rom_size() & 0x7fff) == 0x2000)
755739         {
756740            logerror("Found NEC DSP dump (byuu's version) at the bottom of the ROM.\n");
757            m_cart->addon_bios_alloc(machine(), 0x2800);
741            m_cart->addon_bios_alloc(0x2800);
758742            for (int i = 0; i < 0x800; i++)
759743            {
760744               memcpy(m_cart->get_addon_bios_base() + i * 4 + 2, m_cart->get_rom_base() + (m_cart->get_rom_size() - 0x2000) + i * 3 + 0, 1);
r29505r29506
772756         if ((m_cart->get_rom_size() & 0x3ffff) == 0x11000)
773757         {
774758            logerror("Found Seta DSP dump at the bottom of the ROM.\n");
775            m_cart->addon_bios_alloc(machine(), 0x11000);
759            m_cart->addon_bios_alloc(0x11000);
776760            memcpy(m_cart->get_addon_bios_base(), m_cart->get_rom_base() + (m_cart->get_rom_size() - 0x11000), 0x11000);
777761            m_cart->rom_map_setup(m_cart->get_rom_size() - 0x11000);
778762         }
r29505r29506
780764         if ((m_cart->get_rom_size() & 0xffff) == 0xd000)
781765         {
782766            logerror("Found Seta DSP dump (byuu's version) at the bottom of the ROM.\n");
783            m_cart->addon_bios_alloc(machine(), 0x11000);
767            m_cart->addon_bios_alloc(0x11000);
784768            for (int i = 0; i < 0x4000; i++)
785769            {
786770               memcpy(m_cart->get_addon_bios_base() + i * 4 + 2, m_cart->get_rom_base() + (m_cart->get_rom_size() - 0xd000) + i * 3 + 0, 1);
r29505r29506
796780         if ((m_cart->get_rom_size() & 0x7fff) == 0x0c00)
797781         {
798782            logerror("Found CX4 dump at the bottom of the ROM.\n");
799            m_cart->addon_bios_alloc(machine(), 0x0c00);
783            m_cart->addon_bios_alloc(0x0c00);
800784            memcpy(m_cart->get_addon_bios_base(), m_cart->get_rom_base() + (m_cart->get_rom_size() - 0x0c00), 0x0c00);
801785            m_cart->rom_map_setup(m_cart->get_rom_size() - 0x0c00);
802786         }
r29505r29506
805789         if ((m_cart->get_rom_size() & 0x3ffff) == 0x28000)
806790         {
807791            logerror("Found ST018 dump at the bottom of the ROM.\n");
808            m_cart->addon_bios_alloc(machine(), 0x28000);
792            m_cart->addon_bios_alloc(0x28000);
809793            memcpy(m_cart->get_addon_bios_base(), m_cart->get_rom_base() + (m_cart->get_rom_size() - 0x28000), 0x28000);
810794            m_cart->rom_map_setup(m_cart->get_rom_size() - 0x28000);
811795         }
r29505r29506
822806      {
823807         case ADDON_DSP1:
824808            ROM = machine().root_device().memregion(region)->base();
825            m_cart->addon_bios_alloc(machine(), 0x2800);
809            m_cart->addon_bios_alloc(0x2800);
826810            memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
827811            break;
828812         case ADDON_DSP1B:
829813            ROM = machine().root_device().memregion(region)->base();
830            m_cart->addon_bios_alloc(machine(), 0x2800);
814            m_cart->addon_bios_alloc(0x2800);
831815            memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
832816            break;
833817         case ADDON_DSP2:
834818            ROM = machine().root_device().memregion(region)->base();
835            m_cart->addon_bios_alloc(machine(), 0x2800);
819            m_cart->addon_bios_alloc(0x2800);
836820            memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
837821            break;
838822         case ADDON_DSP3:
839823            ROM = machine().root_device().memregion(region)->base();
840            m_cart->addon_bios_alloc(machine(), 0x2800);
824            m_cart->addon_bios_alloc(0x2800);
841825            memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
842826            break;
843827         case ADDON_DSP4:
844828            ROM = machine().root_device().memregion(region)->base();
845            m_cart->addon_bios_alloc(machine(), 0x2800);
829            m_cart->addon_bios_alloc(0x2800);
846830            memcpy(m_cart->get_addon_bios_base(), ROM, 0x2800);
847831            break;
848832         case ADDON_ST010:
849833            ROM = machine().root_device().memregion(region)->base();
850            m_cart->addon_bios_alloc(machine(), 0x11000);
834            m_cart->addon_bios_alloc(0x11000);
851835            memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000);
852836            break;
853837         case ADDON_ST011:
854838            ROM = machine().root_device().memregion(region)->base();
855            m_cart->addon_bios_alloc(machine(), 0x11000);
839            m_cart->addon_bios_alloc(0x11000);
856840            memcpy(m_cart->get_addon_bios_base(), ROM, 0x11000);
857841            break;
858842      }
r29505r29506
883867   }
884868
885869   if (size)
886      m_cart->nvram_alloc(machine(), size);
870      m_cart->nvram_alloc(size);
887871
888872   if (m_type == SNES_STROM)
889      m_cart->nvram_alloc(machine(), 0x20000);
873      m_cart->nvram_alloc(0x20000);
890874   if (m_type == SNES_BSX)
891      m_cart->nvram_alloc(machine(), 0x8000);
875      m_cart->nvram_alloc(0x8000);
892876
893877   // setup also RTC SRAM, when needed (to be removed when RTCs are converted to devices)
894878   if (m_type == SNES_SRTC)
895      m_cart->rtc_ram_alloc(machine(), 13);
879      m_cart->rtc_ram_alloc(13);
896880   if (m_type == SNES_SPC7110_RTC)
897      m_cart->rtc_ram_alloc(machine(), 16);
881      m_cart->rtc_ram_alloc(16);
898882}
899883
900884
branches/new_menus/src/emu/bus/snes/snes_slot.h
r29505r29506
9191   ADDON_Z80GB
9292};
9393
94// ======================> sns_cart_interface
95
96struct sns_cart_interface
97{
98};
99
100
10194// ======================> device_sns_cart_interface
10295
10396class device_sns_cart_interface : public device_slot_card_interface
r29505r29506
110103   // reading and writing
111104   virtual DECLARE_READ8_MEMBER(read_l) { return 0xff; }   // ROM access in range [00-7f]
112105   virtual DECLARE_READ8_MEMBER(read_h) { return 0xff; }   // ROM access in range [80-ff]
113   virtual DECLARE_READ8_MEMBER(read_ram) { if (m_nvram) { UINT32 mask = m_nvram_size - 1; return m_nvram[offset & mask]; } else return 0xff; }   // NVRAM access
106   virtual DECLARE_READ8_MEMBER(read_ram) { if (m_nvram) { UINT32 mask = m_nvram.count() - 1; return m_nvram[offset & mask]; } else return 0xff; }   // NVRAM access
114107   virtual DECLARE_WRITE8_MEMBER(write_l) {}   // used by carts with subslots
115108   virtual DECLARE_WRITE8_MEMBER(write_h) {}   // used by carts with subslots
116   virtual DECLARE_WRITE8_MEMBER(write_ram) { if (m_nvram) { UINT32 mask = m_nvram_size - 1; m_nvram[offset & mask] = data; return; } } // NVRAM access
109   virtual DECLARE_WRITE8_MEMBER(write_ram) { if (m_nvram) { UINT32 mask = m_nvram.count() - 1; m_nvram[offset & mask] = data; return; } } // NVRAM access
117110   virtual DECLARE_READ8_MEMBER(chip_read) { return 0xff; }
118111   virtual DECLARE_WRITE8_MEMBER(chip_write) {}
119112   virtual void speedup_addon_bios_access() {};
120113
121   void rom_alloc(running_machine &machine, UINT32 size);
122   void nvram_alloc(running_machine &machine, UINT32 size);
123   void rtc_ram_alloc(running_machine &machine, UINT32 size);
124   void addon_bios_alloc(running_machine &machine, UINT32 size);
114   void rom_alloc(UINT32 size);
115   void nvram_alloc(UINT32 size);
116   void rtc_ram_alloc(UINT32 size);
117   void addon_bios_alloc(UINT32 size);
125118   UINT8* get_rom_base() { return m_rom; };
126119   UINT8* get_nvram_base() { return m_nvram; };
127120   UINT8* get_addon_bios_base() { return m_bios; };
128121   UINT8* get_rtc_ram_base() { return m_rtc_ram; };
129   UINT32 get_rom_size() { return m_rom_size; };
130   UINT32 get_nvram_size() { return m_nvram_size; };
131   UINT32 get_addon_bios_size() { return m_bios_size; };
132   UINT32 get_rtc_ram_size() { return m_rtc_ram_size; };
122   UINT32 get_rom_size() { return m_rom.count(); };
123   UINT32 get_nvram_size() { return m_nvram.count(); };
124   UINT32 get_addon_bios_size() { return m_bios.count(); };
125   UINT32 get_rtc_ram_size() { return m_rtc_ram.count(); };
133126
134127   void rom_map_setup(UINT32 size);
135128
136129   // internal state
137   UINT8  *m_rom;
138   UINT8  *m_nvram;
139   UINT8  *m_bios;
140   UINT8  *m_rtc_ram;  // temp pointer to save RTC ram to nvram (will disappear when RTCs become devices)
141   UINT32 m_rom_size;
142   UINT32 m_nvram_size;
143   UINT32 m_bios_size;
144   UINT32 m_rtc_ram_size;  // temp
130   dynamic_buffer m_rom;
131   dynamic_buffer m_nvram;
132   dynamic_buffer m_bios;
133   dynamic_buffer m_rtc_ram;  // temp pointer to save RTC ram to nvram (will disappear when RTCs become devices)
145134
146135   UINT8 rom_bank_map[256];    // 32K chunks of rom
147136};
r29505r29506
150139// ======================> base_sns_cart_slot_device
151140
152141class base_sns_cart_slot_device : public device_t,
153                        public sns_cart_interface,
154142                        public device_image_interface,
155143                        public device_slot_interface
156144{
branches/new_menus/src/emu/bus/snes/sa1.c
r29505r29506
823823      return 0xff;    // this should probably never happen, or are there SA-1 games with no BWRAM?
824824
825825   if (offset < 0x100000)
826      return m_nvram[offset & (m_nvram_size - 1)];
826      return m_nvram[offset & (m_nvram.count() - 1)];
827827
828828   // Bitmap BWRAM
829829   offset -= 0x100000;
r29505r29506
844844   }
845845
846846   // only return the correct bits
847   return (m_nvram[offset & (m_nvram_size - 1)] >> shift) & mask;
847   return (m_nvram[offset & (m_nvram.count() - 1)] >> shift) & mask;
848848}
849849
850850void sns_sa1_device::write_bwram(UINT32 offset, UINT8 data)
r29505r29506
856856
857857   if (offset < 0x100000)
858858   {
859      m_nvram[offset & (m_nvram_size - 1)] = data;
859      m_nvram[offset & (m_nvram.count() - 1)] = data;
860860      return;
861861   }
862862
r29505r29506
879879   }
880880
881881   // only change the correct bits, keeping the rest untouched
882   m_nvram[offset & (m_nvram_size - 1)] = (m_nvram[offset & (m_nvram_size - 1)] & ~mask) | data;
882   m_nvram[offset & (m_nvram.count() - 1)] = (m_nvram[offset & (m_nvram.count() - 1)] & ~mask) | data;
883883}
884884
885885
branches/new_menus/src/emu/bus/isa/p1_hdc.c
r29505r29506
3737
3838const device_type P1_HDC = &device_creator<p1_hdc_device>;
3939
40static WD2010_INTERFACE( hdc_intf )
41{
42   DEVCB_NULL,
43   DEVCB_NULL,
44   DEVCB_NULL,
45   DEVCB_NULL,
46   DEVCB_NULL,
47   DEVCB_NULL,
48   DEVCB_NULL,
49   DEVCB_NULL,
50   DEVCB_LINE_VCC,
51   DEVCB_LINE_VCC,
52   DEVCB_LINE_VCC,
53   DEVCB_LINE_VCC,
54   DEVCB_LINE_VCC
55};
56
5740static MACHINE_CONFIG_FRAGMENT( hdc_b942 )
58   MCFG_WD2010_ADD(KM1809VG7_TAG, 5000000, hdc_intf) // XXX clock?
59
41   MCFG_DEVICE_ADD(KM1809VG7_TAG, WD2010, 5000000) // XXX clock?
42   MCFG_WD2010_IN_DRDY_CB(VCC)
43   MCFG_WD2010_IN_INDEX_CB(VCC)
44   MCFG_WD2010_IN_WF_CB(VCC)
45   MCFG_WD2010_IN_TK000_CB(VCC)
46   MCFG_WD2010_IN_SC_CB(VCC)
47   
6048   MCFG_HARDDISK_ADD("hard0")
6149   MCFG_HARDDISK_ADD("hard1")
6250MACHINE_CONFIG_END
branches/new_menus/src/emu/bus/isa/wdxt_gen.c
r29505r29506
157157
158158
159159//-------------------------------------------------
160//  WD2010_INTERFACE( hdc_intf )
161//-------------------------------------------------
162
163static WD2010_INTERFACE( hdc_intf )
164{
165   DEVCB_NULL,
166   DEVCB_NULL,
167   DEVCB_DEVICE_LINE_MEMBER(WD11C00_17_TAG, wd11c00_17_device, clct_w),
168   DEVCB_DEVICE_MEMBER(WD11C00_17_TAG, wd11c00_17_device, read),
169   DEVCB_DEVICE_MEMBER(WD11C00_17_TAG, wd11c00_17_device, write),
170   DEVCB_NULL,
171   DEVCB_NULL,
172   DEVCB_NULL,
173   DEVCB_LINE_VCC,
174   DEVCB_LINE_VCC,
175   DEVCB_LINE_VCC,
176   DEVCB_LINE_VCC,
177   DEVCB_LINE_VCC
178};
179
180
181//-------------------------------------------------
182160//  MACHINE_DRIVER( wdxt_gen )
183161//-------------------------------------------------
184162
r29505r29506
187165   MCFG_CPU_IO_MAP(wd1015_io)
188166
189167   MCFG_WD11C00_17_ADD(WD11C00_17_TAG, 5000000, host_intf)
190   MCFG_WD2010_ADD(WD2010A_TAG, 5000000, hdc_intf)
168   MCFG_DEVICE_ADD(WD2010A_TAG, WD2010, 5000000)
169   MCFG_WD2010_OUT_BCR_CB(DEVWRITELINE(WD11C00_17_TAG, wd11c00_17_device, clct_w))
170   MCFG_WD2010_IN_BCS_CB(DEVREAD8(WD11C00_17_TAG, wd11c00_17_device, read))
171   MCFG_WD2010_OUT_BCS_CB(DEVWRITE8(WD11C00_17_TAG, wd11c00_17_device, write))
172   MCFG_WD2010_IN_DRDY_CB(VCC)
173   MCFG_WD2010_IN_INDEX_CB(VCC)
174   MCFG_WD2010_IN_WF_CB(VCC)
175   MCFG_WD2010_IN_TK000_CB(VCC)
176   MCFG_WD2010_IN_SC_CB(VCC)
191177
192178   MCFG_HARDDISK_ADD("hard0")
193179   MCFG_HARDDISK_ADD("hard1")
branches/new_menus/src/emu/bus/nes/ggenie.c
r29505r29506
254254//  MACHINE_CONFIG_FRAGMENT( sub_slot )
255255//-------------------------------------------------
256256
257static const nes_cart_interface gg_crt_interface =
258{
259};
260
261257static MACHINE_CONFIG_FRAGMENT( sub_slot )
262   MCFG_NES_CARTRIDGE_ADD("gg_slot", gg_crt_interface, nes_cart, NULL)
258   MCFG_NES_CARTRIDGE_ADD("gg_slot", nes_cart, NULL)
263259   MCFG_NES_CARTRIDGE_NOT_MANDATORY
264260MACHINE_CONFIG_END
265261
branches/new_menus/src/emu/bus/nes/nes_slot.h
r29505r29506
128128};
129129
130130
131// ======================> nes_cart_interface
132
133struct nes_cart_interface
134{
135};
136
137131#define CHRROM 0
138132#define CHRRAM 1
139133
r29505r29506
323317// ======================> nes_cart_slot_device
324318
325319class nes_cart_slot_device : public device_t,
326                        public nes_cart_interface,
327320                        public device_image_interface,
328321                        public device_slot_interface
329322{
r29505r29506
400393 DEVICE CONFIGURATION MACROS
401394 ***************************************************************************/
402395
403#define MCFG_NES_CARTRIDGE_ADD(_tag,_config,_slot_intf,_def_slot) \
396#define MCFG_NES_CARTRIDGE_ADD(_tag, _slot_intf, _def_slot) \
404397   MCFG_DEVICE_ADD(_tag, NES_CART_SLOT, 0) \
405   MCFG_DEVICE_CONFIG(_config) \
406398   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
407399
408400#define MCFG_NES_CARTRIDGE_NOT_MANDATORY                                     \
branches/new_menus/src/emu/bus/x68k/x68k_scsiext.c
r29505r29506
1818
1919const device_type X68K_SCSIEXT = &device_creator<x68k_scsiext_device>;
2020
21static const mb89352_interface mb89352_intf =
22{
23   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER,x68k_scsiext_device,irq_w),
24   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER,x68k_scsiext_device,drq_w)
25};
26
2721//-------------------------------------------------
2822//  rom_region - device-specific ROM region
2923//-------------------------------------------------
r29505r29506
4842   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
4943   MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
5044   MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
51   MCFG_MB89352A_ADD("scsi:mb89352",mb89352_intf)
45   MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
46   MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_scsiext_device, irq_w))
47   MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_scsiext_device, drq_w))
5248MACHINE_CONFIG_END
5349
5450machine_config_constructor x68k_scsiext_device::device_mconfig_additions() const
branches/new_menus/src/emu/memory.c
r29505r29506
18861886      adjust_addresses(entry->m_bytestart, entry->m_byteend, entry->m_bytemask, entry->m_bytemirror);
18871887
18881888      // if we have a share entry, add it to our map
1889      if (entry->m_share != NULL)
1889      if (entry->m_sharetag != NULL)
18901890      {
18911891         // if we can't find it, add it to our map
18921892         astring fulltag;
1893         if (manager().m_sharelist.find(device().siblingtag(fulltag, entry->m_share).cstr()) == NULL)
1893         if (manager().m_sharelist.find(entry->m_sharebase->subtag(fulltag, entry->m_sharetag).cstr()) == NULL)
18941894         {
18951895            VPRINTF(("Creating share '%s' of length 0x%X\n", fulltag.cstr(), entry->m_byteend + 1 - entry->m_bytestart));
18961896            memory_share *share = global_alloc(memory_share(m_map->m_databits, entry->m_byteend + 1 - entry->m_bytestart, endianness()));
r29505r29506
19101910      }
19111911
19121912      // validate adjusted addresses against implicit regions
1913      if (entry->m_region != NULL && entry->m_share == NULL)
1913      if (entry->m_region != NULL && entry->m_sharetag == NULL)
19141914      {
19151915         // determine full tag
19161916         astring fulltag;
r29505r29506
22242224   for (address_map_entry *entry = m_map->m_entrylist.first(); entry != NULL; entry = entry->next())
22252225   {
22262226      // if we haven't assigned this block yet, see if we have a mapped shared pointer for it
2227      if (entry->m_memory == NULL && entry->m_share != NULL)
2227      if (entry->m_memory == NULL && entry->m_sharetag != NULL)
22282228      {
22292229         astring fulltag;
2230         memory_share *share = manager().m_sharelist.find(device().siblingtag(fulltag, entry->m_share).cstr());
2230         memory_share *share = manager().m_sharelist.find(entry->m_sharebase->subtag(fulltag, entry->m_sharetag).cstr());
22312231         if (share != NULL && share->ptr() != NULL)
22322232         {
22332233            entry->m_memory = share->ptr();
2234            VPRINTF(("memory range %08X-%08X -> shared_ptr '%s' [%p]\n", entry->m_addrstart, entry->m_addrend, entry->m_share, entry->m_memory));
2234            VPRINTF(("memory range %08X-%08X -> shared_ptr '%s' [%p]\n", entry->m_addrstart, entry->m_addrend, entry->m_sharetag, entry->m_memory));
22352235         }
22362236         else
22372237         {
2238            VPRINTF(("memory range %08X-%08X -> shared_ptr '%s' but not found\n", entry->m_addrstart, entry->m_addrend, entry->m_share));
2238            VPRINTF(("memory range %08X-%08X -> shared_ptr '%s' but not found\n", entry->m_addrstart, entry->m_addrend, entry->m_sharetag));
22392239         }
22402240      }
22412241
r29505r29506
22472247      }
22482248
22492249      // if we're the first match on a shared pointer, assign it now
2250      if (entry->m_memory != NULL && entry->m_share != NULL)
2250      if (entry->m_memory != NULL && entry->m_sharetag != NULL)
22512251      {
22522252         astring fulltag;
2253         memory_share *share = manager().m_sharelist.find(device().siblingtag(fulltag, entry->m_share).cstr());
2253         memory_share *share = manager().m_sharelist.find(entry->m_sharebase->subtag(fulltag, entry->m_sharetag).cstr());
22542254         if (share != NULL && share->ptr() == NULL)
22552255         {
22562256            share->set_ptr(entry->m_memory);
2257            VPRINTF(("setting shared_ptr '%s' = %p\n", entry->m_share, entry->m_memory));
2257            VPRINTF(("setting shared_ptr '%s' = %p\n", entry->m_sharetag, entry->m_memory));
22582258         }
22592259      }
22602260
r29505r29506
28012801bool address_space::needs_backing_store(const address_map_entry *entry)
28022802{
28032803   // if we are sharing, and we don't have a pointer yet, create one
2804   if (entry->m_share != NULL)
2804   if (entry->m_sharetag != NULL)
28052805   {
28062806      astring fulltag;
2807      memory_share *share = manager().m_sharelist.find(device().siblingtag(fulltag, entry->m_share).cstr());
2807      memory_share *share = manager().m_sharelist.find(entry->m_sharebase->subtag(fulltag, entry->m_sharetag).cstr());
28082808      if (share != NULL && share->ptr() == NULL)
28092809         return true;
28102810   }
branches/new_menus/src/emu/diexec.c
r29505r29506
492492   m_profiler = profile_type(index + PROFILER_DEVICE_FIRST);
493493   m_inttrigger = index + TRIGGER_INT;
494494
495   // fill in the input states and IRQ callback information
496   for (int line = 0; line < ARRAY_LENGTH(m_input); line++)
497      m_input[line].start(this, line);
498
499495   // allocate timers if we need them
500496   if (m_timed_interrupt_period != attotime::zero)
501497      m_timedint_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
502
503   // register for save states
504   device().save_item(NAME(m_suspend));
505   device().save_item(NAME(m_nextsuspend));
506   device().save_item(NAME(m_eatcycles));
507   device().save_item(NAME(m_nexteatcycles));
508   device().save_item(NAME(m_trigger));
509   device().save_item(NAME(m_totalcycles));
510   device().save_item(NAME(m_localtime));
511498}
512499
513500
r29505r29506
520507{
521508   // make sure somebody set us up the icount
522509   assert_always(m_icountptr != NULL, "m_icountptr never initialized!");
510
511   // register for save states
512   device().save_item(NAME(m_suspend));
513   device().save_item(NAME(m_nextsuspend));
514   device().save_item(NAME(m_eatcycles));
515   device().save_item(NAME(m_nexteatcycles));
516   device().save_item(NAME(m_trigger));
517   device().save_item(NAME(m_totalcycles));
518   device().save_item(NAME(m_localtime));
519
520   // fill in the input states and IRQ callback information
521   for (int line = 0; line < ARRAY_LENGTH(m_input); line++)
522      m_input[line].start(this, line);
523523}
524524
525525
branches/new_menus/src/emu/debug/debugcmd.c
r29505r29506
19931993      {
19941994         cheat_region[region_count].offset = space->address_to_byte(entry->m_addrstart) & space->bytemask();
19951995         cheat_region[region_count].endoffset = space->address_to_byte(entry->m_addrend) & space->bytemask();
1996         cheat_region[region_count].share = entry->m_share;
1996         cheat_region[region_count].share = entry->m_sharetag;
19971997         cheat_region[region_count].disabled = (entry->m_write.m_type == AMH_RAM) ? FALSE : TRUE;
19981998
19991999         /* disable double share regions */
2000         if (entry->m_share != NULL)
2000         if (entry->m_sharetag != NULL)
20012001            for (i = 0; i < region_count; i++)
20022002               if (cheat_region[i].share != NULL)
2003                  if (strcmp(cheat_region[i].share, entry->m_share) == 0)
2003                  if (strcmp(cheat_region[i].share, entry->m_sharetag) == 0)
20042004                     cheat_region[region_count].disabled = TRUE;
20052005
20062006         region_count++;
branches/new_menus/src/emu/video/crt9007.c
r29505r29506
398398
399399inline void crt9007_t::recompute_parameters()
400400{
401#ifdef UNUSED_FOR_NOW
402401   // check that necessary registers have been loaded
403402   if (!HAS_VALID_PARAMETERS) return;
404403
405404   // screen dimensions
406   int horiz_pix_total = CHARACTERS_PER_HORIZONTAL_PERIOD * m_hpixels_per_column;
407   int vert_pix_total = SCAN_LINES_PER_FRAME;
405   //int horiz_pix_total = CHARACTERS_PER_HORIZONTAL_PERIOD * m_hpixels_per_column;
406   //int vert_pix_total = SCAN_LINES_PER_FRAME;
408407
409408   // refresh rate
410   attoseconds_t refresh = HZ_TO_ATTOSECONDS(clock()) * horiz_pix_total * vert_pix_total;
409   //attoseconds_t refresh = HZ_TO_ATTOSECONDS(clock()) * horiz_pix_total * vert_pix_total;
411410
412411   // horizontal sync
413412   m_hsync_start = 0;
r29505r29506
426425   m_vsync_end = VERTICAL_SYNC_WIDTH;
427426
428427   // visible area
429   rectangle visarea;
428   //rectangle visarea;
430429
431   visarea.set(m_hsync_end, horiz_pix_total - 1, m_vsync_end, vert_pix_total - 1);
430   //visarea.set(m_hsync_end, horiz_pix_total - 1, m_vsync_end, vert_pix_total - 1);
432431
433   if (LOG)
434   {
435      logerror("CRT9007 '%s' Screen: %u x %u @ %f Hz\n", tag(), horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
436      logerror("CRT9007 '%s' Visible Area: (%u, %u) - (%u, %u)\n", tag(), visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
437   }
432   //if (LOG)
433   //{
434   //   logerror("CRT9007 '%s' Screen: %u x %u @ %f Hz\n", tag(), horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
435   //   logerror("CRT9007 '%s' Visible Area: (%u, %u) - (%u, %u)\n", tag(), visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
436   //}
438437
439   m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
438   //m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
440439
441440   m_hsync_timer->adjust(m_screen->time_until_pos(0, 0));
442441   m_vsync_timer->adjust(m_screen->time_until_pos(0, 0));
443442   m_vlt_timer->adjust(m_screen->time_until_pos(0, m_vlt_start), 1);
444443   m_drb_timer->adjust(m_screen->time_until_pos(0, 0));
445#endif
446444}
447445
448446
branches/new_menus/src/emu/tilemap.h
r29505r29506
499499   UINT32 width() const { return m_width; }
500500   UINT32 height() const { return m_height; }
501501   bool enabled() const { return m_enable; }
502   int palette_offset() const { return m_palette_offset; }
502503   int scrolldx() const { return (m_attributes & TILEMAP_FLIPX) ? m_dx_flipped : m_dx; }
503504   int scrolldy() const { return (m_attributes & TILEMAP_FLIPY) ? m_dy_flipped : m_dy; }
504505   int scrollx(int which = 0) const { return (which < m_scrollrows) ? m_rowscroll[which] : 0; }
branches/new_menus/src/emu/machine/hd63450.h
r29505r29506
8585
8686   DECLARE_READ16_MEMBER( read );
8787   DECLARE_WRITE16_MEMBER( write );
88   DECLARE_WRITE_LINE_MEMBER(drq0_w);
89   DECLARE_WRITE_LINE_MEMBER(drq1_w);
90   DECLARE_WRITE_LINE_MEMBER(drq2_w);
91   DECLARE_WRITE_LINE_MEMBER(drq3_w);
8892
8993   void single_transfer(int x);
9094   void set_timer(int channel, attotime tm);
r29505r29506
9599   // device-level overrides
96100   virtual void device_config_complete();
97101   virtual void device_start();
102   virtual void device_reset();
98103
99104private:
100105   devcb2_write8 m_dma_end;
r29505r29506
115120   int m_transfer_size[4];
116121   int m_halted[4];  // non-zero if a channel has been halted, and can be continued later.
117122   cpu_device *m_cpu;
123   bool m_drq_state[4];
118124
119125   TIMER_CALLBACK_MEMBER(dma_transfer_timer);
120126   void dma_transfer_abort(int channel);
121127   void dma_transfer_halt(int channel);
122128   void dma_transfer_continue(int channel);
123   void dma_transfer_start(int channel, int dir);
129   void dma_transfer_start(int channel);
124130};
125131
126132extern const device_type HD63450;
branches/new_menus/src/emu/machine/aakart.c
r29505r29506
6464   m_rxtimer = timer_alloc(RX_TIMER);
6565   m_rxtimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
6666   m_txtimer = timer_alloc(TX_TIMER);
67   m_txtimer->adjust(attotime::from_hz(clock()*3), 0, attotime::from_hz(clock()*3));
67   m_txtimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
6868   m_mousetimer = timer_alloc(MOUSE_TIMER);
6969   m_mousetimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
7070   m_keybtimer = timer_alloc(KEYB_TIMER);
r29505r29506
9898
9999void aakart_device::device_reset()
100100{
101   m_status = STATUS_NORMAL;
101   m_status = STATUS_HRST;
102102   m_new_command = 0;
103103   m_rx = -1;
104104   m_mouse_enable = 0;
r29505r29506
108108//  device_timer - handler timer events
109109//-------------------------------------------------
110110
111#if 0
112
113111void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
114112{
115   #if 0
116   if(id == KEYB_TIMER && m_keyb_enable && m_status == STATUS_NORMAL)
117   {
118      m_new_command |= 2;
119      m_rx_latch = 0xd0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 row)
120      m_status = STATUS_KEYUP;
121      //m_ff ^= 1;
122      return;
123   }
124   #endif
113    if(id == TX_TIMER && m_new_command & 1)
114    {
115        switch(m_tx_latch)
116        {
117            case 0x00:
118            case 0x02:
119            case 0x03:
120            case 0x07:
121                // ---- -x-- scroll lock
122                // ---- --x- num lock
123                // ---- ---x caps lock
124                break;
125            case 0x20:
126                m_rx = 0x81;
127                m_out_tx_func(ASSERT_LINE);
128                break;
129            case 0x30:
130            case 0x31:
131            case 0x32:
132            case 0x33:
133                m_keyb_enable = m_tx_latch & 1;
134                m_mouse_enable = (m_tx_latch & 2) >> 1;
135                if(m_keyb_enable & 1 && m_keyb_state & 1)
136                {
137                    //printf("Got row\n");
138                    m_rx = m_keyb_row;
139                    m_out_tx_func(ASSERT_LINE);
140                }
141                break;
142            case 0x3f:
143                if(m_keyb_enable & 1 && m_keyb_state & 1)
144                {
145                    //printf("Got col\n");
146                    m_rx = m_keyb_col;
147                    m_out_tx_func(ASSERT_LINE);
148                    m_keyb_state = 0;
149                }
150                break;
151            case 0xfd:
152                m_rx = 0xfd;
153                m_out_tx_func(ASSERT_LINE);
154                break;
155            case 0xfe:
156                m_rx = 0xfe;
157                m_out_tx_func(ASSERT_LINE);
158                break;
159            case 0xff:
160                m_rx = 0xff;
161                m_out_tx_func(ASSERT_LINE);
162                break;
163            default:
164                printf("%02x %02x %02x\n",m_tx_latch,m_rx_latch,m_keyb_enable);
165                break;
166        }
125167
126   if(id == MOUSE_TIMER && m_mouse_enable && m_status == STATUS_NORMAL)
127   {
128      m_new_command |= 2;
129      m_rx_latch = 0; // mouse X position
130      m_status = STATUS_MOUSE;
131      //m_ff ^= 1;
132      return;
133   }
168        //m_new_command &= ~1;
169        m_out_rx_func(ASSERT_LINE);
170    }
134171
135   if(m_new_command == 0)
136      return;
137
138   if(id == RX_TIMER && m_new_command & 2)
139   {
140      m_out_rx_func(ASSERT_LINE);
141      m_new_command &= ~2;
142      m_rx = m_rx_latch;
143      return;
144   }
145
146   if(id == TX_TIMER && m_new_command & 1)
147   {
148      switch(m_status)
149      {
150         case STATUS_NORMAL:
151         {
152            switch(m_tx_latch)
153            {
154               case 0x00: // set leds
155                  break;
156               case RQID:
157                  m_rx_latch = 0x81; //keyboard ID
158                  break;
159               case SMAK:
160               case MACK:
161               case SACK:
162               case NACK:
163                  if(m_tx_latch & 2) { m_mouse_enable = 1; }
164                  if(m_tx_latch & 1) { m_keyb_enable = 1; }
165                  break;
166               case HRST:
167                  m_rx_latch = HRST;
168                  m_status = STATUS_HRST;
169                  break;
170               default:
171                  //printf("%02x\n",m_tx_latch);
172                  break;
173            }
174            break;
175         }
176         case STATUS_KEYDOWN:
177         {
178            switch(m_tx_latch)
179            {
180               case BACK:
181                  m_rx_latch = 0xc0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 col)
182                  m_status = STATUS_NORMAL;
183                  break;
184               case HRST:
185                  m_rx_latch = HRST;
186                  m_status = STATUS_HRST;
187                  break;
188            }
189            break;
190         }
191         case STATUS_KEYUP:
192         {
193            switch(m_tx_latch)
194            {
195               case BACK:
196                  m_rx_latch = 0xd0 | 0; // keyb scancode (0xd0=up 0xc0=down, bits 3-0 col)
197                  m_status = STATUS_NORMAL;
198                  break;
199               case HRST:
200                  m_rx_latch = HRST;
201                  m_status = STATUS_HRST;
202                  break;
203            }
204            break;
205         }
206         case STATUS_MOUSE:
207         {
208            switch(m_tx_latch)
209            {
210               case BACK:
211                  m_rx_latch = 0; // mouse Y
212                  m_status = STATUS_NORMAL;
213                  break;
214               default:
215               case HRST:
216                  m_rx_latch = HRST;
217                  m_status = STATUS_HRST;
218                  break;
219            }
220            break;
221         }
222         case STATUS_HRST:
223         {
224            switch(m_tx_latch)
225            {
226               case HRST:  { m_rx_latch = HRST; m_keyb_enable = m_mouse_enable = 0; break; }
227               case RAK1:  { m_rx_latch = RAK1; m_keyb_enable = m_mouse_enable = 0; break; }
228               case RAK2:  { m_rx_latch = RAK2; m_status = STATUS_NORMAL; break; }
229            }
230            break;
231         }
232      }
233      m_out_tx_func(ASSERT_LINE);
234      m_new_command &= ~1;
235      m_new_command |= 2;
236   }
237172}
238#else
239173
240void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
241{
242   if(id == RX_TIMER && m_new_command & 2)
243   {
244      m_out_rx_func(ASSERT_LINE);
245      m_out_tx_func(CLEAR_LINE);
246      m_rx = m_rx_latch;
247      return;
248   }
249
250   if(id == TX_TIMER && m_new_command & 1)
251   {
252      m_out_tx_func(ASSERT_LINE);
253      m_new_command &= ~1;
254      m_new_command |= 2;
255      return;
256   }
257}
258#endif
259
260174//**************************************************************************
261175//  READ/WRITE HANDLERS
262176//**************************************************************************
263177
178#include "debugger.h"
179
264180READ8_MEMBER( aakart_device::read )
265181{
266   m_out_rx_func(CLEAR_LINE);
182    m_out_tx_func(CLEAR_LINE);
183    //debugger_break(machine());
267184   return m_rx;
268185}
269186
r29505r29506
272189   // if(m_new_command) printf("skip cmd %02x\n",data);
273190
274191   m_tx_latch = data;
275   switch(m_status)
276   {
277      case STATUS_NORMAL:
278      {
279         switch(m_tx_latch)
280         {
281            case 0x00: //set leds
282               break;
283            case RQID:
284               m_rx_latch = 0x81; //keyboard ID
285               break;
286            case HRST:
287               m_rx_latch = HRST;
288               m_status = STATUS_HRST;
289               break;
290            case SMAK:
291            case MACK:
292            case SACK:
293            case NACK:
294               if(m_tx_latch & 2) { m_mouse_enable = 1; }
295               if(m_tx_latch & 1) { m_keyb_enable = 1; }
296               m_rx_latch = 0;
297               break;
298            case BACK:
299               m_rx_latch = machine().rand(); // ???
300               break;
301            default:
302               //printf("%02x\n",data);
303               break;
304         }
305         break;
306      }
307      case STATUS_KEYDOWN:
308      {
309         m_rx_latch = machine().rand();
192    m_out_rx_func(CLEAR_LINE);
193    m_new_command |= 1;
194}
310195
311         switch(m_tx_latch)
312         {
313            case HRST:
314            m_rx_latch = HRST;
315            m_status = STATUS_HRST;
316            break;
317            default:
318            //m_rx_latch = 0xc0 | 0x04;
319            printf("%02x\n",data);
320            break;
321         }
322         break;
323      }
324      case STATUS_HRST:
325      {
326         switch(m_tx_latch)
327         {
328            case HRST:  { m_rx_latch = HRST; m_keyb_enable = m_mouse_enable = 0; break; }
329            case RAK1:  { m_rx_latch = RAK1; m_keyb_enable = m_mouse_enable = 0; break; }
330            case RAK2:  { m_rx_latch = RAK2; m_status = STATUS_NORMAL; break; }
331         }
332         break;
333      }
334   }
335   m_new_command |= 1;
336
337   //m_tx_latch = data;
338   //m_new_command |= 1;
196void aakart_device::send_keycode_down(UINT8 row, UINT8 col)
197{
198    //printf("keycode down\n");
199    m_keyb_row = row | 0xc0;
200    m_keyb_col = col | 0xc0;
201    m_keyb_state = 1;
339202}
340203
341#if 0
342void aakart_device::write_kbd_buf()
204void aakart_device::send_keycode_up(UINT8 row, UINT8 col)
343205{
344   //printf("%08x\n",data);
345   m_out_tx_func(ASSERT_LINE);
346   //debugger_break(machine());
347   m_status = STATUS_KEYDOWN;
206    //printf("keycode up\n");
207    m_keyb_row = row | 0xd0;
208    m_keyb_col = col | 0xd0;
209    m_keyb_state = 1;
348210}
349#endif
branches/new_menus/src/emu/machine/aakart.h
r29505r29506
5252   // I/O operations
5353   DECLARE_WRITE8_MEMBER( write );
5454   DECLARE_READ8_MEMBER( read );
55
55    void send_keycode_down(UINT8 row, UINT8 col);
56    void send_keycode_up(UINT8 row, UINT8 col);
5657protected:
5758   // device-level overrides
5859   virtual void device_validity_check(validity_checker &valid) const;
r29505r29506
7374
7475   devcb_resolved_write_line   m_out_tx_func;
7576   devcb_resolved_write_line   m_out_rx_func;
76   int m_tx_latch, m_rx_latch;
77   int m_rx;
78   int m_new_command;
79   int m_status;
80   int m_mouse_enable;
81   int m_keyb_enable;
77   UINT8 m_tx_latch, m_rx_latch;
78   UINT8 m_rx;
79   UINT8 m_new_command;
80   UINT8 m_status;
81   UINT8 m_mouse_enable;
82   UINT8 m_keyb_enable;
83    UINT8 m_keyb_row;
84    UINT8 m_keyb_col;
85    UINT8 m_keyb_state;
86
8287};
8388
8489
branches/new_menus/src/emu/machine/roc10937.c
r29505r29506
3232*/
3333
3434static const UINT16 roc10937charset[]=
35{            // FEDC BA98 7654 3210
35{           // FEDC BA98 7654 3210
3636   0x507F, // 0101 0000 0111 1111 @.
3737   0x44CF, // 0100 0100 1100 1111 A.
3838   0x153F, // 0001 0101 0011 1111 B.
r29505r29506
9595         //                     -.
9696   0x2001, // 0010 0000 0000 0001 -
9797         //                     /.
98   0x2430, // 0010 0100 0011 0000 <.
98   0x2430, // 0010 0010 0011 0000 <.
9999   0x4430, // 0100 0100 0011 0000 =.
100100   0x8830, // 1000 1000 0011 0000 >.
101101   0x1407, // 0001 0100 0000 0111 ?.
102102};
103103
104
104105///////////////////////////////////////////////////////////////////////////
105106static const int roc10937poslut[]=
106107{
r29505r29506
128129   device_t(mconfig, type, name, tag, owner, clock, shortname, source)
129130{
130131   m_port_val=0;
131   m_reversed=0;
132132}
133133
134134
r29505r29506
138138   roc.m_port_val = val;
139139}
140140
141void rocvfd_t::static_set_zero(device_t &device, bool reversed)
142{
143   rocvfd_t &roc = downcast<rocvfd_t &>(device);
144   roc.m_reversed = reversed;
145}
146
147141void rocvfd_t::device_start()
148142{
149143   save_item(NAME(m_port_val));
150   save_item(NAME(m_reversed));
151144   save_item(NAME(m_cursor_pos));
152145   save_item(NAME(m_window_size));
153146   save_item(NAME(m_shift_count));
r29505r29506
196189   }
197190}
198191
192//Display on Rockwell chips is naturally backwards, due to the way it is wired. We emulate this by flipping the display at update time
199193void rocvfd_t::update_display()
200194{
201195   for (int i =0; i<16; i++)
202196   {
203      if (m_reversed)
204      {
205         m_outputs[i] = set_display(m_chars[15-i]);
206      }
207      else
208      {
209         m_outputs[i] = set_display(m_chars[i]);
210      }
197      m_outputs[i] = set_display(m_chars[15-i]);
211198      output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
212199   }
213200}
r29505r29506
232219   : rocvfd_t(mconfig, ROC10937, "Rockwell 10937 VFD controller and compatible", tag, owner, clock, "roc10937", __FILE__)
233220{
234221   m_port_val=0;
235   m_reversed=0;
236222}
237223
238224const device_type MSC1937 = &device_creator<msc1937_t>;
r29505r29506
241227   : rocvfd_t(mconfig, MSC1937, "OKI MSC1937 VFD controller", tag, owner, clock, "msc1937", __FILE__)
242228{
243229   m_port_val=0;
244   m_reversed=0;
245230}
246231
247232void rocvfd_t::write_char(int data)
r29505r29506
301286   : rocvfd_t(mconfig, ROC10957, "Rockwell 10957 VFD controller and compatible", tag, owner, clock, "roc10957", __FILE__)
302287{
303288   m_port_val=0;
304   m_reversed=0;
305289}
306290
307291void roc10957_t::write_char(int data)
r29505r29506
363347      }
364348   }
365349}
350
351const device_type S16LF01 = &device_creator<s16lf01_t>;
352
353s16lf01_t::s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
354   : rocvfd_t(mconfig, S16LF01, "Samsung 16LF01 Series VFD controller and compatible", tag, owner, clock, "s16lf01", __FILE__)
355{
356   m_port_val=0;
357}
358
359//Samsung chips fix the issue with the reversal of the drive.
360void s16lf01_t::update_display()
361{
362   for (int i =0; i<16; i++)
363   {
364      m_outputs[i] = set_display(m_chars[i]);
365      output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
366   }
367}
branches/new_menus/src/emu/machine/roc10937.h
r29505r29506
11/**********************************************************************
22
3    Rockwell 10937/10957 interface and emulation by J.Wallace
4    OKI MSC1937 is a clone of this chip
3    Rockwell 10937/10957 interface and simlar chips
4   Emulation by J.Wallace
5    OKI MSC1937 is a clone of this chip, with many others.
56
67**********************************************************************/
78#pragma once
r29505r29506
910#ifndef ROC10937_H
1011#define ROC10937_H
1112
12#define LEFT_TO_RIGHT 1
13#define RIGHT_TO_LEFT 0
13#define MCFG_ROC10937_ADD(_tag,_val) \
14      MCFG_DEVICE_ADD(_tag, ROC10937,60)\
15      MCFG_ROC10937_PORT(_val)
1416
15#define MCFG_ROC10937_ADD(_tag,_val,_reversed) \
16      MCFG_DEVICE_ADD(_tag, ROC10937,60)\
17      MCFG_ROC10937_PORT(_val) \
18      MCFG_ROC10937_REVERSE(_reversed)
1917#define MCFG_ROC10937_PORT(_val) \
2018   roc10937_t::static_set_value(*device, _val);
21#define MCFG_ROC10937_REVERSE(_reversed) \
22   roc10937_t::static_set_zero(*device, _reversed);
2319#define MCFG_ROC10937_REMOVE(_tag) \
2420   MCFG_DEVICE_REMOVE(_tag)
2521
26#define MCFG_ROC10957_ADD(_tag,_val,_reversed) \
22#define MCFG_ROC10957_ADD(_tag,_val) \
2723      MCFG_DEVICE_ADD(_tag, ROC10957,60)\
28      MCFG_ROC10957_PORT(_val) \
29      MCFG_ROC10957_REVERSE(_reversed)
24      MCFG_ROC10957_PORT(_val)
25     
3026#define MCFG_ROC10957_PORT(_val) \
3127   roc10957_t::static_set_value(*device, _val);
32#define MCFG_ROC10957_REVERSE(_reversed) \
33   roc10957_t::static_set_zero(*device, _reversed);
3428#define MCFG_ROC10957_REMOVE(_tag) \
3529   MCFG_DEVICE_REMOVE(_tag)
3630
37#define MCFG_MSC1937_ADD(_tag,_val,_reversed) \
31#define MCFG_MSC1937_ADD(_tag,_val) \
3832      MCFG_DEVICE_ADD(_tag, ROC10937,60)\
39      MCFG_MSC1937_PORT(_val) \
40      MCFG_MSC1937_REVERSE(_reversed)
33      MCFG_MSC1937_PORT(_val)
34     
4135#define MCFG_MSC1937_PORT(_val) \
4236   MCFG_ROC10937_PORT(_val)
4337
44#define MCFG_MSC1937_REVERSE(_reversed) \
45   roc10937_t::static_set_zero(*device, _reversed);
4638#define MCFG_MSC1937_REMOVE(_tag) \
4739   MCFG_DEVICE_REMOVE(_tag)
4840
41#define MCFG_S16LF01_ADD(_tag,_val) \
42      MCFG_DEVICE_ADD(_tag, S16LF01,60)\
43      MCFG_S16LF01_PORT(_val)
4944
45#define MCFG_S16LF01_PORT(_val) \
46   MCFG_ROC10937_PORT(_val)
47
5048class rocvfd_t : public device_t {
5149public:
5250   rocvfd_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
5351
5452   // inline configuration helpers
5553   static void static_set_value(device_t &device, int val);
56   static void static_set_zero(device_t &device, bool reversed);
5754   virtual void update_display();
5855   UINT8   m_port_val;
59   bool m_reversed;
6056   void blank(int data);
6157   void shift_data(int data);
6258   void write_char(int data);
r29505r29506
110106
111107};
112108
109class s16lf01_t : public rocvfd_t {
110public:
111   s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
112
113   virtual void update_display();
114protected:
115
116};
117
113118extern const device_type ROC10937;
114119extern const device_type MSC1937;
115120extern const device_type ROC10957;
121extern const device_type S16LF01;
116122
117123#endif
branches/new_menus/src/emu/machine/i8279.c
r29505r29506
8888//-------------------------------------------------
8989
9090i8279_device::i8279_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
91   : device_t(mconfig, I8279, "8279 KDC", tag, owner, clock, "i8279", __FILE__)
91   : device_t(mconfig, I8279, "8279 KDC", tag, owner, clock, "i8279", __FILE__),
92   m_out_irq_cb(*this),
93   m_out_sl_cb(*this),
94   m_out_disp_cb(*this),
95   m_out_bd_cb(*this),
96   m_in_rl_cb(*this),
97   m_in_shift_cb(*this),
98   m_in_ctrl_cb(*this)
9299{
93100}
94101
95102//-------------------------------------------------
96//  device_config_complete - perform any
97//  operations now that the configuration is
98//  complete
99//-------------------------------------------------
100
101void i8279_device::device_config_complete()
102{
103   // inherit a copy of the static data
104   const i8279_interface *intf = reinterpret_cast<const i8279_interface *>(static_config());
105   if (intf != NULL)
106   {
107      *static_cast<i8279_interface *>(this) = *intf;
108   }
109
110   // or initialize to defaults if none provided
111   else
112   {
113      memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
114      memset(&m_out_sl_cb, 0, sizeof(m_out_sl_cb));
115      memset(&m_out_disp_cb, 0, sizeof(m_out_disp_cb));
116      memset(&m_out_bd_cb, 0, sizeof(m_out_bd_cb));
117      memset(&m_in_rl_cb, 0, sizeof(m_in_rl_cb));
118      memset(&m_in_shift_cb, 0, sizeof(m_in_shift_cb));
119      memset(&m_in_ctrl_cb, 0, sizeof(m_in_ctrl_cb));
120   }
121}
122
123
124//-------------------------------------------------
125103//  device_start - device-specific startup
126104//-------------------------------------------------
127105
128106void i8279_device::device_start()
129107{
130108   /* resolve callbacks */
131   m_out_irq_func.resolve(m_out_irq_cb, *this);
132   m_out_sl_func.resolve(m_out_sl_cb, *this);
133   m_out_disp_func.resolve(m_out_disp_cb, *this);
134   m_out_bd_func.resolve(m_out_bd_cb, *this);
135   m_in_rl_func.resolve(m_in_rl_cb, *this);
136   m_in_shift_func.resolve(m_in_shift_cb, *this);
137   m_in_ctrl_func.resolve(m_in_ctrl_cb, *this);
109   m_out_irq_cb.resolve();
110   m_out_sl_cb.resolve();
111   m_out_disp_cb.resolve();
112   m_out_bd_cb.resolve();
113   m_in_rl_cb.resolve();
114   m_in_shift_cb.resolve();
115   m_in_ctrl_cb.resolve();
138116   m_clock = clock();
139   m_timer = machine().scheduler().timer_alloc(FUNC(timerproc_callback), (void *)this);
117   m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(i8279_device::timerproc_callback), this));
140118}
141119
142120
r29505r29506
218196
219197void i8279_device::set_irq(bool state)
220198{
221   if ( !m_out_irq_func.isnull() )
222      m_out_irq_func( state );
199   if ( !m_out_irq_cb.isnull() )
200      m_out_irq_cb( state );
223201}
224202
225203
r29505r29506
267245}
268246
269247
270TIMER_CALLBACK( i8279_device::timerproc_callback )
248TIMER_CALLBACK_MEMBER( i8279_device::timerproc_callback )
271249{
272   reinterpret_cast<i8279_device*>(ptr)->timer_mainloop();
250   timer_mainloop();
273251}
274252
275253
r29505r29506
295273   // type 3 = strobed
296274
297275   // Get shift keys
298   if ( !m_in_shift_func.isnull() )
299      shift_key = m_in_shift_func();
276   if ( !m_in_shift_cb.isnull() )
277      shift_key = m_in_shift_cb();
300278
301   if ( !m_in_ctrl_func.isnull() )
302      ctrl_key = m_in_ctrl_func();
279   if ( !m_in_ctrl_cb.isnull() )
280      ctrl_key = m_in_ctrl_cb();
303281
304282   if (ctrl_key && !m_ctrl_key)
305283      strobe_pulse = 1; // low-to-high is a strobe
r29505r29506
308286
309287   // Read a row of keys
310288
311   if ( !m_in_rl_func.isnull() )
289   if ( !m_in_rl_cb.isnull() )
312290   {
313      UINT8 rl = m_in_rl_func(0);
291      UINT8 rl = m_in_rl_cb(0);
314292
315293      // see if key still down from last time
316294      UINT16 key_down = (m_scanner << 8) | rl;
r29505r29506
367345
368346   m_scanner &= scanner_mask; // 4-bit port
369347
370   if ( !m_out_sl_func.isnull() )
371      m_out_sl_func(0, m_scanner);
348   if ( !m_out_sl_cb.isnull() )
349      m_out_sl_cb((offs_t)0, m_scanner);
372350
373351   // output a digit
374352
375   if ( !m_out_disp_func.isnull() )
376      m_out_disp_func(0, m_d_ram[m_scanner] );
353   if ( !m_out_disp_cb.isnull() )
354      m_out_disp_cb((offs_t)0, m_d_ram[m_scanner] );
377355}
378356
379357
branches/new_menus/src/emu/machine/i8279.h
r29505r29506
4444    DEVICE CONFIGURATION MACROS
4545***************************************************************************/
4646
47#define MCFG_I8279_ADD(_tag, _clock, _config) \
48   MCFG_DEVICE_ADD(_tag, I8279, _clock) \
49   MCFG_DEVICE_CONFIG(_config)
47#define MCFG_I8279_OUT_IRQ_CB(_devcb) \
48   devcb = &i8279_device::set_out_irq_callback(*device, DEVCB2_##_devcb);
5049
51#define I8279_INTERFACE(_name) \
52   const i8279_interface (_name) =
50#define MCFG_I8279_OUT_SL_CB(_devcb) \
51   devcb = &i8279_device::set_out_sl_callback(*device, DEVCB2_##_devcb);
5352
53#define MCFG_I8279_OUT_DISP_CB(_devcb) \
54   devcb = &i8279_device::set_out_disp_callback(*device, DEVCB2_##_devcb);
5455
55/***************************************************************************
56    TYPE DEFINITIONS
57***************************************************************************/
56#define MCFG_I8279_OUT_BD_CB(_devcb) \
57   devcb = &i8279_device::set_out_bd_callback(*device, DEVCB2_##_devcb);
5858
59#define MCFG_I8279_IN_RL_CB(_devcb) \
60   devcb = &i8279_device::set_in_rl_callback(*device, DEVCB2_##_devcb);
5961
60// ======================> i8279_interface
62#define MCFG_I8279_IN_SHIFT_CB(_devcb) \
63   devcb = &i8279_device::set_in_shift_callback(*device, DEVCB2_##_devcb);
6164
62struct i8279_interface
63{
64   devcb_write_line    m_out_irq_cb;       // IRQ
65   devcb_write8        m_out_sl_cb;        // Scanlines SL0-3
66   devcb_write8        m_out_disp_cb;      // B0-3,A0-3
67   devcb_write_line    m_out_bd_cb;        // BD
68   devcb_read8     m_in_rl_cb;     // kbd readlines RL0-7
69   devcb_read_line     m_in_shift_cb;      // Shift key
70   devcb_read_line     m_in_ctrl_cb;       // Ctrl-Strobe line
71};
65#define MCFG_I8279_IN_CTRL_CB(_devcb) \
66   devcb = &i8279_device::set_in_ctrl_callback(*device, DEVCB2_##_devcb);
7267
68/***************************************************************************
69    TYPE DEFINITIONS
70***************************************************************************/
7371
74
7572// ======================> i8279_device
7673
77class i8279_device :  public device_t, public i8279_interface
74class i8279_device :  public device_t
7875{
7976public:
8077   // construction/destruction
8178   i8279_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8279
80   template<class _Object> static devcb2_base &set_out_irq_callback(device_t &device, _Object object) { return downcast<i8279_device &>(device).m_out_irq_cb.set_callback(object); }
81   template<class _Object> static devcb2_base &set_out_sl_callback(device_t &device, _Object object) { return downcast<i8279_device &>(device).m_out_sl_cb.set_callback(object); }
82   template<class _Object> static devcb2_base &set_out_disp_callback(device_t &device, _Object object) { return downcast<i8279_device &>(device).m_out_disp_cb.set_callback(object); }
83   template<class _Object> static devcb2_base &set_out_bd_callback(device_t &device, _Object object) { return downcast<i8279_device &>(device).m_out_bd_cb.set_callback(object); }
84   template<class _Object> static devcb2_base &set_in_rl_callback(device_t &device, _Object object) { return downcast<i8279_device &>(device).m_in_rl_cb.set_callback(object); }
85   template<class _Object> static devcb2_base &set_in_shift_callback(device_t &device, _Object object) { return downcast<i8279_device &>(device).m_in_shift_cb.set_callback(object); }
86   template<class _Object> static devcb2_base &set_in_ctrl_callback(device_t &device, _Object object) { return downcast<i8279_device &>(device).m_in_ctrl_cb.set_callback(object); }
87   
8388   // read & write handlers
8489   DECLARE_READ8_MEMBER(status_r);
8590   DECLARE_READ8_MEMBER(data_r);
r29505r29506
8994
9095protected:
9196   // device-level overrides
92   virtual void device_config_complete();
9397   virtual void device_start();
9498   virtual void device_reset();
9599   virtual void device_post_load() { }
96100   virtual void device_clock_changed() { }
97101
98   static TIMER_CALLBACK( timerproc_callback );
102   TIMER_CALLBACK_MEMBER( timerproc_callback );
99103
100104private:
101105
r29505r29506
107111   void set_irq(bool state);
108112   void set_display_mode(UINT8 data);
109113
110   devcb_resolved_write_line   m_out_irq_func;
111   devcb_resolved_write8       m_out_sl_func;
112   devcb_resolved_write8       m_out_disp_func;
113   devcb_resolved_write_line   m_out_bd_func;
114   devcb_resolved_read8        m_in_rl_func;
115   devcb_resolved_read_line    m_in_shift_func;
116   devcb_resolved_read_line    m_in_ctrl_func;
114   devcb2_write_line    m_out_irq_cb;       // IRQ
115   devcb2_write8        m_out_sl_cb;        // Scanlines SL0-3
116   devcb2_write8        m_out_disp_cb;      // B0-3,A0-3
117   devcb2_write_line    m_out_bd_cb;        // BD
118   devcb2_read8        m_in_rl_cb;        // kbd readlines RL0-7
119   devcb2_read_line     m_in_shift_cb;      // Shift key
120   devcb2_read_line     m_in_ctrl_cb;       // Ctrl-Strobe line
117121
118122   emu_timer *m_timer;
119123
branches/new_menus/src/emu/machine/mb89352.c
r29505r29506
109109const device_type MB89352A = &device_creator<mb89352_device>;
110110
111111
112void mb89352_device::device_config_complete()
113{
114   // copy static configuration if present
115   const mb89352_interface *intf = reinterpret_cast<const mb89352_interface *>(static_config());
116   if (intf != NULL)
117      *static_cast<mb89352_interface *>(this) = *intf;
118
119   // otherwise, initialize it to defaults
120   else
121   {
122      memset(&irq_callback,0,sizeof(irq_callback));
123      memset(&drq_callback,0,sizeof(drq_callback));
124   }
125}
126
127112/*
128113 * Device
129114 */
130115
131116mb89352_device::mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
132   : device_t(mconfig, MB89352A, "MB89352A", tag, owner, clock, "mb89352", __FILE__)
117   : device_t(mconfig, MB89352A, "MB89352A", tag, owner, clock, "mb89352", __FILE__),
118      m_irq_cb(*this),
119      m_drq_cb(*this)
133120{
134121}
135122
r29505r29506
146133      m_spc_status |= SSTS_TC_ZERO;
147134   m_ints = 0x00;
148135
149   m_irq_func.resolve(irq_callback,*this);
150   m_drq_func.resolve(drq_callback,*this);
136   m_irq_cb.resolve_safe();
137   m_drq_cb.resolve_safe();
151138
152139   memset(m_SCSIdevices,0,sizeof(m_SCSIdevices));
153140
r29505r29506
204191   case TIMER_TRANSFER:
205192      // TODO: check interrupts are actually enabled
206193      {
207         m_drq_func(1);
194         m_drq_cb(1);
208195      }
209196      break;
210197   }
r29505r29506
325312            m_spc_status |= SSTS_DREG_EMPTY;
326313            m_ints |= INTS_COMMAND_COMPLETE;
327314            if(m_int_enable != 0)
328               m_irq_func(1);
315               m_irq_cb(1);
329316            if(m_phase == SCSI_PHASE_MESSAGE_IN)
330317               set_phase(SCSI_PHASE_BUS_FREE);
331318            else if(m_phase == SCSI_PHASE_DATAIN)
r29505r29506
427414         if(m_busfree_int_enable)
428415         {
429416            if(m_int_enable != 0)
430               m_irq_func(1);
417               m_irq_cb(1);
431418         }
432419         logerror("mb89352: SCMD: Bus free\n");
433420         break;
r29505r29506
458445         m_spc_status |= SSTS_SPC_BSY;
459446         m_ints |= INTS_COMMAND_COMPLETE;
460447         if(m_int_enable != 0)
461            m_irq_func(1);
448            m_irq_cb(1);
462449         logerror("mb89352: SCMD: Selection (SCSI ID%i)\n",m_target);
463450         break;
464451      case 0x02:  // Reset ATN
r29505r29506
558545      break;
559546   case 0x04:  // INTS - Interrupt Sense
560547      m_ints &= ~data;  // resets relevant status bits to zero
561      m_irq_func(0);  // clear IRQ
548      m_irq_cb(0);  // clear IRQ
562549      logerror("mb89352: Reset INTS status bits %02x\n",data);
563550      break;
564551   case 0x08:  // PCTL - Phase control
r29505r29506
613600            m_spc_status |= SSTS_DREG_EMPTY;
614601            m_ints |= INTS_COMMAND_COMPLETE;
615602            if(m_int_enable != 0)
616               m_irq_func(1);
603               m_irq_cb(1);
617604            set_phase(SCSI_PHASE_STATUS);
618605         }
619606      }
branches/new_menus/src/emu/machine/mb89352.h
r29505r29506
4848#define SERR_SCSI_PAR   0x80
4949
5050
51struct mb89352_interface
52{
53   devcb_write_line irq_callback;  /* irq callback */
54   devcb_write_line drq_callback;  /* drq callback */
55};
51#define MCFG_MB89352A_IRQ_CB(_devcb) \
52   devcb = &mb89352_device::set_irq_callback(*device, DEVCB2_##_devcb);
53   
54#define MCFG_MB89352A_DRQ_CB(_devcb) \
55   devcb = &mb89352_device::set_drq_callback(*device, DEVCB2_##_devcb);
5656
57#define MCFG_MB89352A_ADD(_tag, _intrf) \
58   MCFG_DEVICE_ADD(_tag, MB89352A, 0) \
59   MCFG_DEVICE_CONFIG(_intrf)
60
61class mb89352_device : public device_t,
62                  public mb89352_interface
57class mb89352_device : public device_t
6358{
6459public:
6560   // construction/destruction
6661   mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6762
63   template<class _Object> static devcb2_base &set_irq_callback(device_t &device, _Object object) { return downcast<mb89352_device &>(device).m_irq_cb.set_callback(object); }
64   template<class _Object> static devcb2_base &set_drq_callback(device_t &device, _Object object) { return downcast<mb89352_device &>(device).m_drq_cb.set_callback(object); }
65   
6866   // any publically accessible interfaces needed for runtime
6967   DECLARE_READ8_MEMBER( mb89352_r );
7068   DECLARE_WRITE8_MEMBER( mb89352_w );
r29505r29506
7775   virtual void device_start();
7876   virtual void device_reset();
7977   virtual void device_stop();
80   virtual void device_config_complete();
8178   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
8279
8380private:
r29505r29506
8784   int get_scsi_cmd_len(UINT8 cbyte);
8885   //void set_ints(UINT8 flag);
8986
90   devcb_resolved_write_line m_irq_func;
91   devcb_resolved_write_line m_drq_func;
87   devcb2_write_line m_irq_cb;  /* irq callback */
88   devcb2_write_line m_drq_cb;  /* drq callback */
9289
9390   scsihle_device* m_SCSIdevices[8];
9491
branches/new_menus/src/emu/machine/ncr539x.c
r29505r29506
104104   return 6;
105105}
106106
107//-------------------------------------------------
108//  device_config_complete - perform any
109//  operations now that the configuration is
110//  complete
111//-------------------------------------------------
112
113void ncr539x_device::device_config_complete()
114{
115   // inherit a copy of the static data
116   const NCR539Xinterface *intf = reinterpret_cast<const NCR539Xinterface *>(static_config());
117   if (intf != NULL)
118   {
119      *static_cast<NCR539Xinterface *>(this) = *intf;
120   }
121
122   // or initialize to defaults if none provided
123   else
124   {
125      memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
126      memset(&m_out_drq_cb, 0, sizeof(m_out_drq_cb));
127   }
128}
129
130107//**************************************************************************
131108//  LIVE DEVICE
132109//**************************************************************************
r29505r29506
138115//-------------------------------------------------
139116
140117ncr539x_device::ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
141   : device_t(mconfig, NCR539X, "539x SCSI", tag, owner, clock, "ncr539x", __FILE__)
118   : device_t(mconfig, NCR539X, "539x SCSI", tag, owner, clock, "ncr539x", __FILE__),
119   m_out_irq_cb(*this),
120   m_out_drq_cb(*this)
142121{
143122}
144123
r29505r29506
151130   memset(m_scsi_devices, 0, sizeof(m_scsi_devices));
152131
153132   // resolve line callbacks
154   m_out_irq_func.resolve(m_out_irq_cb, *this);
155   m_out_drq_func.resolve(m_out_drq_cb, *this);
133   m_out_irq_cb.resolve_safe();
134   m_out_drq_cb.resolve_safe();
156135
157136   // try to open the devices
158137   for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
r29505r29506
189168   m_chipid_available = false;
190169   m_chipid_lock = false;
191170
192   m_out_irq_func(CLEAR_LINE);
193   m_out_drq_func(CLEAR_LINE);
171   m_out_irq_cb(CLEAR_LINE);
172   m_out_drq_cb(CLEAR_LINE);
194173}
195174
196175void ncr539x_device::dma_read_data(int bytes, UINT8 *pData)
r29505r29506
233212         // if this is a DMA command, raise DRQ now
234213         if (m_command & 0x80)
235214         {
236            m_out_drq_func(ASSERT_LINE);
215            m_out_drq_cb(ASSERT_LINE);
237216         }
238217
239218         switch (m_command & 0x7f)
r29505r29506
267246                  m_status |= MAIN_STATUS_INTERRUPT;
268247                  m_irq_status |= IRQ_STATUS_DISCONNECTED;
269248               }
270               m_out_irq_func(ASSERT_LINE);
249               m_out_irq_cb(ASSERT_LINE);
271250               break;
272251
273252            case 0x42:  // Select with ATN steps
r29505r29506
298277                  m_status |= MAIN_STATUS_INTERRUPT;
299278                  m_irq_status |= IRQ_STATUS_DISCONNECTED;
300279               }
301               m_out_irq_func(ASSERT_LINE);
280               m_out_irq_cb(ASSERT_LINE);
302281               break;
303282
304283            case 0x11:  // initiator command complete
r29505r29506
308287               m_irq_status = IRQ_STATUS_SERVICE_REQUEST;
309288               m_status &= ~7; // clear phase bits
310289               m_status |= MAIN_STATUS_INTERRUPT | SCSI_PHASE_DATAIN;  // go to data in phase (?)
311               m_out_irq_func(ASSERT_LINE);
290               m_out_irq_cb(ASSERT_LINE);
312291
313292               // this puts status and message bytes into the FIFO (todo: what are these?)
314293               m_fifo_ptr = 0;
r29505r29506
326305               #endif
327306               m_irq_status = IRQ_STATUS_SERVICE_REQUEST;
328307               m_status |= MAIN_STATUS_INTERRUPT;
329               m_out_irq_func(ASSERT_LINE);
308               m_out_irq_cb(ASSERT_LINE);
330309               break;
331310
332311            default:
r29505r29506
407386                     m_irq_status = IRQ_STATUS_SERVICE_REQUEST;
408387                     m_status &= 0x7;    // clear everything but the phase bits
409388                     m_status |= MAIN_STATUS_INTERRUPT | MAIN_STATUS_COUNT_TO_ZERO;
410                     m_out_irq_func(ASSERT_LINE);
389                     m_out_irq_cb(ASSERT_LINE);
411390
412391                     // if no data at all, drop the phase
413392                     if ((m_buffer_remaining + m_total_data) == 0)
r29505r29506
436415         rv = m_irq_status;
437416         // clear the interrupt state
438417         m_status &= ~MAIN_STATUS_INTERRUPT;
439         m_out_irq_func(CLEAR_LINE);
418         m_out_irq_cb(CLEAR_LINE);
440419         break;
441420
442421      case 6:
r29505r29506
515494            case 0x00:  // NOP
516495               m_irq_status = IRQ_STATUS_SUCCESS;
517496               m_status |= MAIN_STATUS_INTERRUPT;
518               m_out_irq_func(ASSERT_LINE);
497               m_out_irq_cb(ASSERT_LINE);
519498
520499               // DMA NOP?  allow chip ID
521500               if ((m_command == 0x80) && (!m_chipid_lock))
r29505r29506
529508               update_fifo_internal_state(0);
530509               m_irq_status = IRQ_STATUS_SUCCESS;
531510               m_status |= MAIN_STATUS_INTERRUPT;
532               m_out_irq_func(ASSERT_LINE);
511               m_out_irq_cb(ASSERT_LINE);
533512               break;
534513
535514            case 0x02:  // Reset device
r29505r29506
537516
538517               m_irq_status = IRQ_STATUS_SUCCESS;
539518               m_status |= MAIN_STATUS_INTERRUPT;
540               m_out_irq_func(ASSERT_LINE);
519               m_out_irq_cb(ASSERT_LINE);
541520               break;
542521
543522            case 0x03:  // Reset SCSI bus
544523               m_status = 0;
545524               m_irq_status = IRQ_STATUS_SUCCESS;
546525               m_status |= MAIN_STATUS_INTERRUPT;
547               m_out_irq_func(ASSERT_LINE);
526               m_out_irq_cb(ASSERT_LINE);
548527               break;
549528
550529            case 0x10:  // information transfer (must happen immediately)
r29505r29506
611590                     m_xfer_count = m_dma_size;
612591                     m_fifo_ptr = 0;
613592                     update_fifo_internal_state(fifo_fill_size);
614                     m_out_drq_func(ASSERT_LINE);
593                     m_out_drq_cb(ASSERT_LINE);
615594                  }
616595
617596                  m_status |= MAIN_STATUS_COUNT_TO_ZERO;
r29505r29506
635614                  m_buffer_offset = 0;
636615                  m_buffer_remaining = 0;
637616               }
638               m_out_irq_func(ASSERT_LINE);
617               m_out_irq_cb(ASSERT_LINE);
639618               break;
640619
641620            case 0x24:  // Terminate steps
r29505r29506
644623               #endif
645624               m_irq_status = IRQ_STATUS_SUCCESS | IRQ_STATUS_DISCONNECTED;
646625               m_status |= MAIN_STATUS_INTERRUPT;
647               m_out_irq_func(ASSERT_LINE);
626               m_out_irq_cb(ASSERT_LINE);
648627               m_fifo_ptr = 0;
649628               update_fifo_internal_state(0);
650629               break;
r29505r29506
655634               #endif
656635               m_irq_status = IRQ_STATUS_SUCCESS;
657636               m_status |= MAIN_STATUS_INTERRUPT;
658               m_out_irq_func(ASSERT_LINE);
637               m_out_irq_cb(ASSERT_LINE);
659638               break;
660639
661640            case 0x44:  // Enable selection/reselection
r29505r29506
664643               #endif
665644               m_irq_status = IRQ_STATUS_SUCCESS;
666645               m_status |= MAIN_STATUS_INTERRUPT;
667               m_out_irq_func(ASSERT_LINE);
646               m_out_irq_cb(ASSERT_LINE);
668647               break;
669648
670649            case 0x47:  // Reselect with ATN3 steps
r29505r29506
695674                  m_status |= MAIN_STATUS_INTERRUPT;
696675                  m_irq_status |= IRQ_STATUS_DISCONNECTED;
697676               }
698               m_out_irq_func(ASSERT_LINE);
677               m_out_irq_cb(ASSERT_LINE);
699678               break;
700679
701680            default:    // other commands are not instantaneous
r29505r29506
846825         m_irq_status = IRQ_STATUS_SERVICE_REQUEST;
847826         m_status &= 7;
848827         m_status |= MAIN_STATUS_INTERRUPT;
849         m_out_irq_func(ASSERT_LINE);
828         m_out_irq_cb(ASSERT_LINE);
850829      }
851830
852831      if ((m_xfer_count == 0) && (m_total_data == 0))
r29505r29506
858837         m_buffer_offset = 0;
859838         m_irq_status = IRQ_STATUS_SERVICE_REQUEST;
860839         m_status = MAIN_STATUS_INTERRUPT | SCSI_PHASE_STATUS;
861         m_out_irq_func(ASSERT_LINE);
840         m_out_irq_cb(ASSERT_LINE);
862841      }
863842   }
864843}
branches/new_menus/src/emu/machine/ncr539x.h
r29505r29506
88
99#include "machine/scsihle.h"
1010
11struct NCR539Xinterface
12{
13   devcb_write_line m_out_irq_cb;          /* IRQ line */
14   devcb_write_line m_out_drq_cb;          /* DRQ line */
15};
16
1711//// 539x registers
1812//enum
1913//{
2014//};
2115
2216// device stuff
23#define MCFG_NCR539X_ADD(_tag, _clock, _intrf) \
24   MCFG_DEVICE_ADD(_tag, NCR539X, _clock) \
25   MCFG_DEVICE_CONFIG(_intrf)
2617
27class ncr539x_device : public device_t,
28                  public NCR539Xinterface
18#define MCFG_NCR539X_OUT_IRQ_CB(_devcb) \
19   devcb = &ncr539x_device::set_out_irq_callback(*device, DEVCB2_##_devcb);
20   
21#define MCFG_NCR539X_OUT_DRQ_CB(_devcb) \
22   devcb = &ncr539x_device::set_out_drq_callback(*device, DEVCB2_##_devcb);
23   
24
25class ncr539x_device : public device_t
2926{
3027public:
3128   // construction/destruction
3229   ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30   
31   template<class _Object> static devcb2_base &set_out_irq_callback(device_t &device, _Object object) { return downcast<ncr539x_device &>(device).m_out_irq_cb.set_callback(object); }
32   template<class _Object> static devcb2_base &set_out_drq_callback(device_t &device, _Object object) { return downcast<ncr539x_device &>(device).m_out_drq_cb.set_callback(object); }
3333
3434   // our API
3535   DECLARE_READ8_MEMBER(read);
r29505r29506
4242   // device-level overrides
4343   virtual void device_start();
4444   virtual void device_reset();
45   virtual void device_config_complete();
4645   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4746
4847private:
r29505r29506
8382
8483   emu_timer *m_operation_timer;
8584
86   devcb_resolved_write_line   m_out_irq_func;
87   devcb_resolved_write_line   m_out_drq_func;
85   devcb2_write_line m_out_irq_cb;          /* IRQ line */
86   devcb2_write_line m_out_drq_cb;          /* DRQ line */
8887};
8988
9089// device type definition
branches/new_menus/src/emu/machine/wd2010.c
r29505r29506
9999const device_type WD2010 = &device_creator<wd2010_device>;
100100
101101
102//-------------------------------------------------
103//  device_config_complete - perform any
104//  operations now that the configuration is
105//  complete
106//-------------------------------------------------
107
108void wd2010_device::device_config_complete()
109{
110   // inherit a copy of the static data
111   const wd2010_interface *intf = reinterpret_cast<const wd2010_interface *>(static_config());
112   if (intf != NULL)
113      *static_cast<wd2010_interface *>(this) = *intf;
114
115   // or initialize to defaults if none provided
116   else
117   {
118      memset(&m_out_intrq_cb, 0, sizeof(m_out_intrq_cb));
119      memset(&m_out_bdrq_cb, 0, sizeof(m_out_bdrq_cb));
120      memset(&m_out_bcr_cb, 0, sizeof(m_out_bcr_cb));
121      memset(&m_in_bcs_cb, 0, sizeof(m_in_bcs_cb));
122      memset(&m_out_bcs_cb, 0, sizeof(m_out_bcs_cb));
123      memset(&m_out_dirin_cb, 0, sizeof(m_out_dirin_cb));
124      memset(&m_out_step_cb, 0, sizeof(m_out_step_cb));
125      memset(&m_out_rwc_cb, 0, sizeof(m_out_rwc_cb));
126      memset(&m_in_drdy_cb, 0, sizeof(m_in_drdy_cb));
127      memset(&m_in_index_cb, 0, sizeof(m_in_index_cb));
128      memset(&m_in_wf_cb, 0, sizeof(m_in_wf_cb));
129      memset(&m_in_tk000_cb, 0, sizeof(m_in_tk000_cb));
130      memset(&m_in_sc_cb, 0, sizeof(m_in_sc_cb));
131   }
132}
133
134
135
136102//**************************************************************************
137103//  LIVE DEVICE
138104//**************************************************************************
r29505r29506
143109
144110wd2010_device::wd2010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
145111   : device_t(mconfig, WD2010, "Western Digital WD2010", tag, owner, clock, "wd2010", __FILE__),
112   m_out_intrq_cb(*this),
113   m_out_bdrq_cb(*this),
114   m_out_bcr_cb(*this),
115   m_in_bcs_cb(*this),
116   m_out_bcs_cb(*this),
117   m_out_dirin_cb(*this),
118   m_out_step_cb(*this),
119   m_out_rwc_cb(*this),
120   m_in_drdy_cb(*this),
121   m_in_index_cb(*this),
122   m_in_wf_cb(*this),
123   m_in_tk000_cb(*this),
124   m_in_sc_cb(*this),
146125   m_status(0),
147126   m_error(0)
148127{
r29505r29506
156135void wd2010_device::device_start()
157136{
158137   // resolve callbacks
159   m_out_intrq_func.resolve(m_out_intrq_cb, *this);
160   m_out_bdrq_func.resolve(m_out_bdrq_cb, *this);
161   m_out_bcr_func.resolve(m_out_bcr_cb, *this);
162   m_in_bcs_func.resolve(m_in_bcs_cb, *this);
163   m_out_bcs_func.resolve(m_out_bcs_cb, *this);
164   m_out_dirin_func.resolve(m_out_dirin_cb, *this);
165   m_out_step_func.resolve(m_out_step_cb, *this);
166   m_out_rwc_func.resolve(m_out_rwc_cb, *this);
167   m_in_drdy_func.resolve(m_in_drdy_cb, *this);
168   m_in_index_func.resolve(m_in_index_cb, *this);
169   m_in_wf_func.resolve(m_in_wf_cb, *this);
170   m_in_tk000_func.resolve(m_in_tk000_cb, *this);
171   m_in_sc_func.resolve(m_in_sc_cb, *this);
138   m_out_intrq_cb.resolve_safe();
139   m_out_bdrq_cb.resolve_safe();
140   m_out_bcr_cb.resolve_safe();
141   m_in_bcs_cb.resolve_safe(0);
142   m_out_bcs_cb.resolve_safe();
143   m_out_dirin_cb.resolve_safe();
144   m_out_step_cb.resolve_safe();
145   m_out_rwc_cb.resolve_safe();
146   m_in_drdy_cb.resolve_safe(0);
147   m_in_index_cb.resolve_safe(0);
148   m_in_wf_cb.resolve_safe(0);
149   m_in_tk000_cb.resolve_safe(0);
150   m_in_sc_cb.resolve_safe(0);
172151}
173152
174153
r29505r29506
196175      break;
197176
198177   case TASK_FILE_STATUS:
199      m_out_intrq_func(CLEAR_LINE);
178      m_out_intrq_cb(CLEAR_LINE);
200179      data = m_status | STATUS_RDY | STATUS_SC;
201180      break;
202181
r29505r29506
324303void wd2010_device::restore(UINT8 data)
325304{
326305   // reset INTRQ, errors, set BUSY, CIP
327   m_out_intrq_func(CLEAR_LINE);
306   m_out_intrq_cb(CLEAR_LINE);
328307   m_error = 0;
329308   m_status = STATUS_BSY | STATUS_CIP;
330309
331310   // reset RWC, set direction=OUT, store step rate
332   m_out_rwc_func(0);
333   m_out_dirin_func(0);
311   m_out_rwc_cb(0);
312   m_out_dirin_cb(0);
334313
335314   int step_pulses = 0;
336315
337316   while (step_pulses < 2048)
338317   {
339      while (!m_in_sc_func())
318      while (!m_in_sc_cb())
340319      {
341320         // drive not ready or write fault?
342         if (!m_in_drdy_func() || m_in_wf_func())
321         if (!m_in_drdy_cb() || m_in_wf_cb())
343322         {
344323            // pulse BCR, set AC, INTRQ, reset BSY, CIP
345            m_out_bcr_func(0);
346            m_out_bcr_func(1);
324            m_out_bcr_cb(0);
325            m_out_bcr_cb(1);
347326            m_error = ERROR_AC;
348            m_status = (m_in_drdy_func() << 6) | (m_in_wf_func() << 5) | STATUS_ERR;
349            m_out_intrq_func(ASSERT_LINE);
327            m_status = (m_in_drdy_cb() << 6) | (m_in_wf_cb() << 5) | STATUS_ERR;
328            m_out_intrq_cb(ASSERT_LINE);
350329            return;
351330         }
352331      }
353332
354      if (m_in_tk000_func())
333      if (m_in_tk000_cb())
355334      {
356335         // pulse BCR, set INTRQ, reset BSY, CIP
357         m_out_bcr_func(0);
358         m_out_bcr_func(1);
336         m_out_bcr_cb(0);
337         m_out_bcr_cb(1);
359338         m_status &= ~(STATUS_BSY | STATUS_CIP);
360         m_out_intrq_func(ASSERT_LINE);
339         m_out_intrq_cb(ASSERT_LINE);
361340         return;
362341      }
363342
r29505r29506
368347         m_status |= STATUS_ERR;
369348
370349         // pulse BCR, set INTRQ, reset BSY, CIP
371         m_out_bcr_func(0);
372         m_out_bcr_func(1);
350         m_out_bcr_cb(0);
351         m_out_bcr_cb(1);
373352         m_status &= ~(STATUS_BSY | STATUS_CIP);
374         m_out_intrq_func(ASSERT_LINE);
353         m_out_intrq_cb(ASSERT_LINE);
375354         return;
376355      }
377356
378357      // issue a step pulse
379      m_out_step_func(1);
380      m_out_step_func(0);
358      m_out_step_cb(1);
359      m_out_step_cb(0);
381360      step_pulses++;
382361   }
383362}
branches/new_menus/src/emu/machine/wd2010.h
r29505r29506
2323//  INTERFACE CONFIGURATION MACROS
2424//**************************************************************************
2525
26#define MCFG_WD2010_ADD(_tag, _clock, _config) \
27   MCFG_DEVICE_ADD(_tag, WD2010, _clock) \
28   MCFG_DEVICE_CONFIG(_config)
26#define MCFG_WD2010_OUT_INTRQ_CB(_devcb) \
27   devcb = &wd2010_device::set_out_intrq_callback(*device, DEVCB2_##_devcb);
2928
29#define MCFG_WD2010_OUT_BDRQ_CB(_devcb) \
30   devcb = &wd2010_device::set_out_bdrq_callback(*device, DEVCB2_##_devcb);
3031
31#define WD2010_INTERFACE(_name) \
32   const wd2010_interface (_name) =
32#define MCFG_WD2010_OUT_BCR_CB(_devcb) \
33   devcb = &wd2010_device::set_out_bcr_callback(*device, DEVCB2_##_devcb);
3334
35#define MCFG_WD2010_IN_BCS_CB(_devcb) \
36   devcb = &wd2010_device::set_in_bcs_callback(*device, DEVCB2_##_devcb);
3437
38#define MCFG_WD2010_OUT_BCS_CB(_devcb) \
39   devcb = &wd2010_device::set_out_bcs_callback(*device, DEVCB2_##_devcb);
3540
41#define MCFG_WD2010_OUT_DIRIN_CB(_devcb) \
42   devcb = &wd2010_device::set_out_dirin_callback(*device, DEVCB2_##_devcb);
43
44#define MCFG_WD2010_OUT_STEP_CB(_devcb) \
45   devcb = &wd2010_device::set_out_step_callback(*device, DEVCB2_##_devcb);
46
47#define MCFG_WD2010_OUT_RWC_CB(_devcb) \
48   devcb = &wd2010_device::set_out_rwc_callback(*device, DEVCB2_##_devcb);
49
50#define MCFG_WD2010_IN_DRDY_CB(_devcb) \
51   devcb = &wd2010_device::set_in_drdy_callback(*device, DEVCB2_##_devcb);
52
53#define MCFG_WD2010_IN_INDEX_CB(_devcb) \
54   devcb = &wd2010_device::set_in_index_callback(*device, DEVCB2_##_devcb);
55
56#define MCFG_WD2010_IN_WF_CB(_devcb) \
57   devcb = &wd2010_device::set_in_wf_callback(*device, DEVCB2_##_devcb);
58
59#define MCFG_WD2010_IN_TK000_CB(_devcb) \
60   devcb = &wd2010_device::set_in_tk000_callback(*device, DEVCB2_##_devcb);
61
62#define MCFG_WD2010_IN_SC_CB(_devcb) \
63   devcb = &wd2010_device::set_in_sc_callback(*device, DEVCB2_##_devcb);
64
3665//**************************************************************************
3766//  TYPE DEFINITIONS
3867//**************************************************************************
3968
40// ======================> wd2010_interface
41
42struct wd2010_interface
43{
44   devcb_write_line    m_out_intrq_cb;
45   devcb_write_line    m_out_bdrq_cb;
46   devcb_write_line    m_out_bcr_cb;
47   devcb_read8         m_in_bcs_cb;
48   devcb_write8        m_out_bcs_cb;
49   devcb_write_line    m_out_dirin_cb;
50   devcb_write_line    m_out_step_cb;
51   devcb_write_line    m_out_rwc_cb;
52   devcb_read_line     m_in_drdy_cb;
53   devcb_read_line     m_in_index_cb;
54   devcb_read_line     m_in_wf_cb;
55   devcb_read_line     m_in_tk000_cb;
56   devcb_read_line     m_in_sc_cb;
57};
58
59
6069// ======================> wd2010_device
6170
62class wd2010_device :   public device_t,
63                  public wd2010_interface
71class wd2010_device :   public device_t
6472{
6573public:
6674   // construction/destruction
6775   wd2010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6876
77   template<class _Object> static devcb2_base &set_out_intrq_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_out_intrq_cb.set_callback(object); }
78   template<class _Object> static devcb2_base &set_out_bdrq_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_out_bdrq_cb.set_callback(object); }
79   template<class _Object> static devcb2_base &set_out_bcr_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_out_bcr_cb.set_callback(object); }
80   template<class _Object> static devcb2_base &set_in_bcs_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_in_bcs_cb.set_callback(object); }
81   template<class _Object> static devcb2_base &set_out_bcs_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_out_bcs_cb.set_callback(object); }
82   template<class _Object> static devcb2_base &set_out_dirin_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_out_dirin_cb.set_callback(object); }
83   template<class _Object> static devcb2_base &set_out_step_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_out_step_cb.set_callback(object); }
84   template<class _Object> static devcb2_base &set_out_rwc_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_out_rwc_cb.set_callback(object); }
85   template<class _Object> static devcb2_base &set_in_drdy_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_in_drdy_cb.set_callback(object); }
86   template<class _Object> static devcb2_base &set_in_index_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_in_index_cb.set_callback(object); }
87   template<class _Object> static devcb2_base &set_in_wf_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_in_wf_cb.set_callback(object); }
88   template<class _Object> static devcb2_base &set_in_tk000_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_in_tk000_cb.set_callback(object); }
89   template<class _Object> static devcb2_base &set_in_sc_callback(device_t &device, _Object object) { return downcast<wd2010_device &>(device).m_in_sc_cb.set_callback(object); }
90   
6991   DECLARE_READ8_MEMBER( read );
7092   DECLARE_WRITE8_MEMBER( write );
7193
r29505r29506
7395   // device-level overrides
7496   virtual void device_start();
7597   virtual void device_reset();
76   virtual void device_config_complete();
7798
7899private:
79100   void compute_correction(UINT8 data);
r29505r29506
85106   void scan_id(UINT8 data);
86107   void format(UINT8 data);
87108
88   devcb_resolved_write_line   m_out_intrq_func;
89   devcb_resolved_write_line   m_out_bdrq_func;
90   devcb_resolved_write_line   m_out_bcr_func;
91   devcb_resolved_read8        m_in_bcs_func;
92   devcb_resolved_write8       m_out_bcs_func;
93   devcb_resolved_write_line   m_out_dirin_func;
94   devcb_resolved_write_line   m_out_step_func;
95   devcb_resolved_write_line   m_out_rwc_func;
96   devcb_resolved_read_line    m_in_drdy_func;
97   devcb_resolved_read_line    m_in_index_func;
98   devcb_resolved_read_line    m_in_wf_func;
99   devcb_resolved_read_line    m_in_tk000_func;
100   devcb_resolved_read_line    m_in_sc_func;
109   devcb2_write_line    m_out_intrq_cb;
110   devcb2_write_line    m_out_bdrq_cb;
111   devcb2_write_line    m_out_bcr_cb;
112   devcb2_read8         m_in_bcs_cb;
113   devcb2_write8        m_out_bcs_cb;
114   devcb2_write_line    m_out_dirin_cb;
115   devcb2_write_line    m_out_step_cb;
116   devcb2_write_line    m_out_rwc_cb;
117   devcb2_read_line     m_in_drdy_cb;
118   devcb2_read_line     m_in_index_cb;
119   devcb2_read_line     m_in_wf_cb;
120   devcb2_read_line     m_in_tk000_cb;
121   devcb2_read_line     m_in_sc_cb;
101122
102123   UINT8 m_status;
103124   UINT8 m_error;
branches/new_menus/src/emu/machine/hd63450.c
r29505r29506
8383   }
8484}
8585
86void hd63450_device::device_reset()
87{
88   m_drq_state[0] = m_drq_state[1] = m_drq_state[2] = m_drq_state[3] = 0;
89}
90
8691READ16_MEMBER(hd63450_device::read)
8792{
8893   int channel,reg;
r29505r29506
143148   case 0x00:  // CSR / CER
144149      if(ACCESSING_BITS_8_15)
145150      {
146//          m_reg[channel].csr = (data & 0xff00) >> 8;
151         m_reg[channel].csr &= ~((data & 0xff00) >> 8);
147152//          logerror("DMA#%i: Channel status write : %02x\n",channel,dmac.reg[channel].csr);
148153      }
149154      // CER is read-only, so no action needed there.
r29505r29506
170175      {
171176         m_reg[channel].ccr = data & 0x00ff;
172177         if((data & 0x0080))// && !m_dma_read[channel] && !m_dma_write[channel])
173            dma_transfer_start(channel,0);
178            dma_transfer_start(channel);
174179         if(data & 0x0010)  // software abort
175180            dma_transfer_abort(channel);
176181         if(data & 0x0020)  // halt operation
r29505r29506
243248   }
244249}
245250
246void hd63450_device::dma_transfer_start(int channel, int dir)
251void hd63450_device::dma_transfer_start(int channel)
247252{
248253   address_space &space = m_cpu->space(AS_PROGRAM);
249254   m_in_progress[channel] = 1;
r29505r29506
293298
294299void hd63450_device::dma_transfer_abort(int channel)
295300{
301   if(!m_in_progress[channel])
302      return;
303
296304   logerror("DMA#%i: Transfer aborted\n",channel);
297   m_timer[channel]->adjust(attotime::zero);
305   m_timer[channel]->adjust(attotime::never);
298306   m_in_progress[channel] = 0;
299   m_reg[channel].mtc = m_transfer_size[channel];
300   m_reg[channel].csr |= 0xe0;  // channel operation complete, block transfer complete
307   m_reg[channel].csr |= 0x90;  // channel error
301308   m_reg[channel].csr &= ~0x08;  // channel no longer active
309   m_reg[channel].cer = 0x11;
310   m_reg[channel].ccr &= ~0xc0;
311   m_dma_error((offs_t)3, 1);
302312}
303313
304314void hd63450_device::dma_transfer_halt(int channel)
305315{
306316   m_halted[channel] = 1;
307   m_timer[channel]->adjust(attotime::zero);
317   m_timer[channel]->adjust(attotime::never);
308318}
309319
310320void hd63450_device::dma_transfer_continue(int channel)
r29505r29506
478488            m_in_progress[x] = 0;
479489            m_reg[x].csr |= 0xe0;  // channel operation complete, block transfer complete
480490            m_reg[x].csr &= ~0x08;  // channel no longer active
491            m_reg[x].ccr &= ~0xc0;
481492
482493            // Burst transfer
483494            if((m_reg[x].dcr & 0xc0) == 0x00)
r29505r29506
491502      }
492503}
493504
505WRITE_LINE_MEMBER(hd63450_device::drq0_w)
506{
507   bool ostate = m_drq_state[0];
508   m_drq_state[0] = state;
509   
510   if((m_reg[0].ocr & 2) && (state && !ostate))
511      single_transfer(0);
512}
513
514WRITE_LINE_MEMBER(hd63450_device::drq1_w)
515{
516   bool ostate = m_drq_state[1];
517   m_drq_state[1] = state;
518
519   if((m_reg[1].ocr & 2) && (state && !ostate))
520      single_transfer(1);
521}
522
523WRITE_LINE_MEMBER(hd63450_device::drq2_w)
524{
525   bool ostate = m_drq_state[2];
526   m_drq_state[2] = state;
527   
528   if((m_reg[2].ocr & 2) && (state && !ostate))
529      single_transfer(2);
530}
531
532WRITE_LINE_MEMBER(hd63450_device::drq3_w)
533{
534   bool ostate = m_drq_state[3];
535   m_drq_state[3] = state;
536   
537   if((m_reg[3].ocr & 2) && (state && !ostate))
538      single_transfer(3);
539}
540
494541int hd63450_device::get_vector(int channel)
495542{
496543   return m_reg[channel].niv;
branches/new_menus/src/emu/digfx.h
r29505r29506
105105#define GFXDECODE_START( name ) const gfx_decode_entry GFXDECODE_NAME(name)[] = {
106106#define GFXDECODE_END { 0 } };
107107
108// use these to declare a gfx_decode_entry array as a member of a device class
109#define DECLARE_GFXDECODE_MEMBER( name ) static const gfx_decode_entry name[]
110#define GFXDECODE_MEMBER( name ) const gfx_decode_entry name[] = {
111
112
108113// common gfx_decode_entry macros
109114#define GFXDECODE_ENTRYX(region,offset,layout,start,colors,flags) { region, offset, &layout, start, colors, flags },
110115#define GFXDECODE_ENTRY(region,offset,layout,start,colors) { region, offset, &layout, start, colors, 0 },
branches/new_menus/src/mess/drivers/sms.c
r29505r29506
1111
1212 - SIO interface for Game Gear (needs netplay, I guess)
1313 - Gear to Gear Port SMS Controller Adaptor
14 - SMS Store Display Unit (kiosk console)
1514 - Sega Demo Unit II (kiosk expansion device)
1615 - SMS Disk System (floppy disk drive expansion device) - unreleased
1716 - Sega Graphic Board (black version) - unreleased
r29505r29506
2032028000      - System Control Register (R/W)
204203            Reading:
205204            bit7      - ready (0 = ready, 1 = not ready)
206            bit6-bit5 - unknown
207            bit4-bit3 - timer selection bit switches
208            bit2-bit0 - unknown
205            bit6      - active timer bit switch (0 = selection 2, 1 = selection 1)
206            bit5      - unknown
207            bit4-bit3 - timer selection 2 bit switches (10s-25s)
208            bit2-bit0 - timer selection 1 bit switches (30s-135s)
209209            Writing:
210            bit7-bit4 - unknown, maybe led of selected game to set?
210            bit7-bit4 - led of selected game to set
211211            bit3      - unknown, 1 seems to be written all the time
212212            bit2      - unknown, 1 seems to be written all the time
213213            bit1      - reset signal for sms cpu, 0 = reset low, 1 = reset high
r29505r29506
259259   AM_RANGE(0x0000, 0x3fff) AM_ROM                     /* BIOS */
260260   AM_RANGE(0x4000, 0x47ff) AM_RAM                     /* RAM */
261261   AM_RANGE(0x6000, 0x7fff) AM_READ(store_cart_peek)
262   AM_RANGE(0x8000, 0x8000) AM_READWRITE(sms_store_control_r, sms_store_control_w) /* Control */
262   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW") AM_WRITE(sms_store_control_w) /* Control */
263263   AM_RANGE(0xc000, 0xc000) AM_READWRITE(sms_store_cart_select_r, sms_store_cart_select_w) /* cartridge/card slot selector */
264   AM_RANGE(0xd800, 0xd800) AM_READ(sms_store_select1)         /* Game selector port #1 */
265   AM_RANGE(0xdc00, 0xdc00) AM_READ(sms_store_select2)         /* Game selector port #2 */
264   AM_RANGE(0xd800, 0xd800) AM_READ_PORT("GAMESEL1")         /* Game selector port #1 */
265   AM_RANGE(0xdc00, 0xdc00) AM_READ_PORT("GAMESEL2")         /* Game selector port #2 */
266266ADDRESS_MAP_END
267267
268268// I/O ports $3E and $3F do not exist on Mark III
r29505r29506
381381   //PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Rapid Button") /* Not implemented */
382382INPUT_PORTS_END
383383
384static INPUT_PORTS_START( smssdisp )
385   PORT_INCLUDE( sms )
386
387   PORT_START("DSW")
388   PORT_DIPNAME( 0x07, 0x07, "Timer 1 length" )
389   PORT_DIPSETTING( 0x00, "135s" )
390   PORT_DIPSETTING( 0x01, "120s" )
391   PORT_DIPSETTING( 0x02, "105s" )
392   PORT_DIPSETTING( 0x03, "90s" )
393   PORT_DIPSETTING( 0x04, "75s" )
394   PORT_DIPSETTING( 0x05, "60s" )
395   PORT_DIPSETTING( 0x06, "45s" )
396   PORT_DIPSETTING( 0x07, "30s" )
397   PORT_DIPNAME( 0x18, 0x18, "Timer 2 length" )
398   PORT_DIPSETTING( 0x00, "25s" )
399   PORT_DIPSETTING( 0x08, "20s" )
400   PORT_DIPSETTING( 0x10, "15s" )
401   PORT_DIPSETTING( 0x18, "10s" )
402   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
403   PORT_DIPSETTING( 0x00, DEF_STR( On ) )
404   PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
405   PORT_DIPNAME( 0x40, 0x40, "Select Timer" )
406   PORT_DIPSETTING( 0x00, "Timer 2" )
407   PORT_DIPSETTING( 0x40, "Timer 1" )
408   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )   // READY, must be high
409
410   PORT_START("GAMESEL1")
411   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 03") PORT_CODE(KEYCODE_B)
412   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 02") PORT_CODE(KEYCODE_G)
413   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 01") PORT_CODE(KEYCODE_T)
414   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 00") PORT_CODE(KEYCODE_5)
415   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 07") PORT_CODE(KEYCODE_N)
416   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 06") PORT_CODE(KEYCODE_H)
417   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 05") PORT_CODE(KEYCODE_Y)
418   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 04") PORT_CODE(KEYCODE_6)
419
420   PORT_START("GAMESEL2")
421   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 11") PORT_CODE(KEYCODE_M)
422   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 10") PORT_CODE(KEYCODE_J)
423   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 09") PORT_CODE(KEYCODE_U)
424   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 08") PORT_CODE(KEYCODE_7)
425   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 15") PORT_CODE(KEYCODE_COMMA)
426   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 14") PORT_CODE(KEYCODE_K)
427   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 13") PORT_CODE(KEYCODE_I)
428   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 12") PORT_CODE(KEYCODE_8)
429INPUT_PORTS_END
430
384431static INPUT_PORTS_START( gg )
385432   PORT_START("GG_PORT_DC")
386433   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY
r29505r29506
9881035CONS( 1985, sg1000m3,   sms,        0,      sg1000m3,    sg1000m3, sms_state,      sg1000m3, "Sega",     "SG-1000 Mark III",                 GAME_SUPPORTS_SAVE )
9891036CONS( 1986, sms1,       sms,        0,      sms1_ntsc,   sms1,     sms_state,      sms1,     "Sega",     "Master System I",                  GAME_SUPPORTS_SAVE )
9901037CONS( 1986, sms1pal,    sms,        0,      sms1_pal,    sms1,     sms_state,      sms1,     "Sega",     "Master System I (PAL)" ,           GAME_SUPPORTS_SAVE )
991CONS( 1986, smssdisp,   sms,        0,      sms_sdisp,   sms,      smssdisp_state, smssdisp, "Sega",     "Master System Store Display Unit", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1038CONS( 1986, smssdisp,   sms,        0,      sms_sdisp,   smssdisp, smssdisp_state, smssdisp, "Sega",     "Master System Store Display Unit", GAME_SUPPORTS_SAVE )
9921039CONS( 1987, smsj,       sms,        0,      smsj,        smsj,     sms_state,      smsj,     "Sega",     "Master System (Japan)",            GAME_SUPPORTS_SAVE )
9931040CONS( 1990, sms,        0,          0,      sms2_ntsc,   sms,      sms_state,      sms1,     "Sega",     "Master System II",                 GAME_SUPPORTS_SAVE )
9941041CONS( 1990, smspal,     sms,        0,      sms2_pal,    sms,      sms_state,      sms1,     "Sega",     "Master System II (PAL)",           GAME_SUPPORTS_SAVE )
branches/new_menus/src/mess/drivers/vt100.c
r29505r29506
374374   m_vertical_int = 0;
375375}
376376
377static const vt_video_interface vt100_video_interface =
378{
379   "chargen",
380};
381
382377INTERRUPT_GEN_MEMBER(vt100_state::vt100_vertical_interrupt)
383378{
384379   m_vertical_int = 1;
r29505r29506
425420
426421   MCFG_DEFAULT_LAYOUT( layout_vt100 )
427422
428   MCFG_VT100_VIDEO_ADD("vt100_video", "screen", vt100_video_interface)
423   MCFG_DEVICE_ADD("vt100_video", VT100_VIDEO, 0)
424   MCFG_VT_SET_SCREEN("screen")
425   MCFG_VT_CHARGEN("chargen")
429426   MCFG_VT_VIDEO_RAM_CALLBACK(READ8(vt100_state, vt100_read_video_ram_r))
430427   MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(vt100_state, vt100_clear_video_interrupt))
431428
branches/new_menus/src/mess/drivers/mac.c
r29505r29506
841841   sony_read_status
842842};
843843
844static const struct NCR539Xinterface mac_539x_intf =
845{
846   DEVCB_DRIVER_LINE_MEMBER(mac_state, irq_539x_1_w),
847   DEVCB_DRIVER_LINE_MEMBER(mac_state, drq_539x_1_w)
848};
849
850844static const struct nbbus_interface nubus_intf =
851845{
852846   // interrupt lines
r29505r29506
18681862   MCFG_SCSIBUS_ADD("scsi")
18691863   MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
18701864   MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
1871   MCFG_NCR539X_ADD(MAC_539X_1_TAG, C7M, mac_539x_intf)
1872
1865   MCFG_DEVICE_ADD(MAC_539X_1_TAG, NCR539X, C7M)
1866   MCFG_NCR539X_OUT_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, irq_539x_1_w))
1867   MCFG_NCR539X_OUT_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, drq_539x_1_w))
1868   
18731869   /* internal ram */
18741870   MCFG_RAM_ADD(RAM_TAG)
18751871   MCFG_RAM_DEFAULT_SIZE("4M")
branches/new_menus/src/mess/drivers/z88.c
r29505r29506
5656WRITE8_MEMBER(z88_state::bank3_cart_w) { m_carts[m_bank[3].slot]->write(space, (m_bank[3].page<<14) + offset, data); }
5757
5858
59void z88_state::bankswitch_update(int bank, UINT16 page, int rams)
59UPD65031_MEMORY_UPDATE(z88_state::bankswitch_update)
6060{
6161   char bank_tag[6];
6262   sprintf(bank_tag, "bank%d", bank + 2);
r29505r29506
605605   return data;
606606}
607607
608static UPD65031_MEMORY_UPDATE(z88_bankswitch_update)
609{
610   z88_state *state = device.machine().driver_data<z88_state>();
611   state->bankswitch_update(bank, page, rams);
612}
613
614static UPD65031_SCREEN_UPDATE(z88_screen_update)
615{
616   z88_state *state = device.machine().driver_data<z88_state>();
617   state->lcd_update(bitmap, sbf, hires0, hires1, lores0, lores1, flash);
618}
619
620static UPD65031_INTERFACE( z88_blink_intf )
621{
622   z88_screen_update,                                      // callback for update the LCD
623   z88_bankswitch_update,                                  // callback for update the bankswitch
624};
625
626608static const z88cart_interface z88_cart_interface =
627609{
628610   DEVCB_DEVICE_LINE_MEMBER("blink", upd65031_device, flp_w)
r29505r29506
659641
660642   MCFG_DEFAULT_LAYOUT(layout_lcd)
661643
662   MCFG_UPD65031_ADD("blink", XTAL_9_8304MHz, z88_blink_intf)
644   MCFG_DEVICE_ADD("blink", UPD65031, XTAL_9_8304MHz)
663645   MCFG_UPD65031_KB_CALLBACK(READ8(z88_state, kb_r))
664646   MCFG_UPD65031_INT_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
665647   MCFG_UPD65031_NMI_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI))
666648   MCFG_UPD65031_SPKR_CALLBACK(DEVWRITELINE("speaker", speaker_sound_device, level_w))
649   MCFG_UPD65031_SCR_UPDATE_CB(z88_state, lcd_update)
650   MCFG_UPD65031_MEM_UPDATE_CB(z88_state, bankswitch_update)
667651
668652   /* sound hardware */
669653   MCFG_SPEAKER_STANDARD_MONO("mono")
branches/new_menus/src/mess/drivers/rainbow.c
r29505r29506
11431143   m_irq_high = (state == ASSERT_LINE) ? 0x80 : 0;
11441144}
11451145
1146static const vt_video_interface video_interface =
1147{
1148   "chargen",
1149};
1150
11511146/* F4 Character Displayer */
11521147static const gfx_layout rainbow_charlayout =
11531148{
r29505r29506
12111206   MCFG_SCREEN_PALETTE("vt100_video:palette")
12121207   MCFG_GFXDECODE_ADD("gfxdecode", "vt100_video:palette", rainbow)
12131208
1214   MCFG_RAINBOW_VIDEO_ADD("vt100_video", "screen", video_interface)
1209   MCFG_DEVICE_ADD("vt100_video", RAINBOW_VIDEO, 0)
1210   MCFG_VT_SET_SCREEN("screen")
1211   MCFG_VT_CHARGEN("chargen")
12151212   MCFG_VT_VIDEO_RAM_CALLBACK(READ8(rainbow_state, read_video_ram_r))
12161213   MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(rainbow_state, clear_video_interrupt))
12171214
branches/new_menus/src/mess/drivers/a310.c
r29505r29506
8686   DECLARE_DRIVER_INIT(a310);
8787   virtual void machine_start();
8888   virtual void machine_reset();
89    DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
8990
91
9092protected:
9193   required_device<ram_device> m_ram;
9294};
r29505r29506
151153ADDRESS_MAP_END
152154
153155
156INPUT_CHANGED_MEMBER(a310_state::key_stroke)
157{
158    UINT8 row_val = (UINT8)(FPTR)(param) >> 4;
159    UINT8 col_val = (UINT8)(FPTR)(param) & 0xf;
160
161   if(newval && !oldval)
162      m_kart->send_keycode_down(row_val,col_val);
163   
164   if(oldval && !newval)
165      m_kart->send_keycode_up(row_val,col_val);
166}
167
168// TODO:
169// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0c) PORT_IMPULSE(1) <- led enabled & 4
170// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1d) PORT_IMPULSE(1) <- English Pound symbol
171// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x21) PORT_IMPULSE(1) <- unknown but used (changes cursor to full)
172// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x22) PORT_IMPULSE(1) <- led enabled & 1
173// 0x37 - 0x39 another 7 - 9 (keypad?)
174// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3a) PORT_IMPULSE(1) <- another minus (keypad?)
175// 0x48 - 0x4a another 4 - 6 (keypad?)
176// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x4b) PORT_IMPULSE(1) <- +
177// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x4c) PORT_IMPULSE(1) <- another English Pound
178// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x57) PORT_IMPULSE(1) <- another /
179// PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x5d) PORT_IMPULSE(1) <- led enabled & 2
180
154181static INPUT_PORTS_START( a310 )
155182   PORT_START("dip") /* DIP switches */
156183   PORT_BIT(0xfd, 0xfd, IPT_UNUSED)
157184
158185   PORT_START("key0") /* KEY ROW 0 */
159   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC)
160   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("1  !") PORT_CODE(KEYCODE_1)
161   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("2  \"") PORT_CODE(KEYCODE_2)
162   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("3  #") PORT_CODE(KEYCODE_3)
163   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("4  $") PORT_CODE(KEYCODE_4)
164   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("5  %") PORT_CODE(KEYCODE_5)
165   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("6  &") PORT_CODE(KEYCODE_6)
166   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("7  '") PORT_CODE(KEYCODE_7)
186   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x00) PORT_IMPULSE(1)
187   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("1  !") PORT_CODE(KEYCODE_1) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x11) PORT_IMPULSE(1)
188   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("2  \"") PORT_CODE(KEYCODE_2) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x12) PORT_IMPULSE(1)
189   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("3  #") PORT_CODE(KEYCODE_3) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x13) PORT_IMPULSE(1)
190   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("4  $") PORT_CODE(KEYCODE_4) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x14) PORT_IMPULSE(1)
191   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("5  %") PORT_CODE(KEYCODE_5) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x15) PORT_IMPULSE(1)
192   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("6  &") PORT_CODE(KEYCODE_6) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x16) PORT_IMPULSE(1)
193   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("7  '") PORT_CODE(KEYCODE_7) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x17) PORT_IMPULSE(1)
167194
168195   PORT_START("key1") /* KEY ROW 1 */
169   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("8  *") PORT_CODE(KEYCODE_8)
170   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("9  (") PORT_CODE(KEYCODE_9)
171   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("0  )") PORT_CODE(KEYCODE_0)
172   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("-  _") PORT_CODE(KEYCODE_MINUS)
173   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("=  +") PORT_CODE(KEYCODE_EQUALS)
174   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("`  ~") PORT_CODE(KEYCODE_TILDE)
175   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("BACK SPACE") PORT_CODE(KEYCODE_BACKSPACE)
196   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("8  *") PORT_CODE(KEYCODE_8) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x18) PORT_IMPULSE(1)
197   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("9  (") PORT_CODE(KEYCODE_9) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x19) PORT_IMPULSE(1)
198   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("0  )") PORT_CODE(KEYCODE_0) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1a) PORT_IMPULSE(1)
199   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("-  _") PORT_CODE(KEYCODE_MINUS) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1b) PORT_IMPULSE(1)
200   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("=  +") PORT_CODE(KEYCODE_EQUALS) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1c) PORT_IMPULSE(1)
201   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("`  ~") PORT_CODE(KEYCODE_TILDE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x10) PORT_IMPULSE(1)
202   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("BACK SPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x1e) PORT_IMPULSE(1)
176203   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB)
177204
178205   PORT_START("key2") /* KEY ROW 2 */
179   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("q  Q") PORT_CODE(KEYCODE_Q)
180   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("w  W") PORT_CODE(KEYCODE_W)
181   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("e  E") PORT_CODE(KEYCODE_E)
182   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("r  R") PORT_CODE(KEYCODE_R)
183   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("t  T") PORT_CODE(KEYCODE_T)
184   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("y  Y") PORT_CODE(KEYCODE_Y)
185   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("u  U") PORT_CODE(KEYCODE_U)
186   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("i  I") PORT_CODE(KEYCODE_I)
206    PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("q  Q") PORT_CODE(KEYCODE_Q) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x27) PORT_IMPULSE(1)
207   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("w  W") PORT_CODE(KEYCODE_W) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x28) PORT_IMPULSE(1)
208   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("e  E") PORT_CODE(KEYCODE_E) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x29) PORT_IMPULSE(1)
209   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("r  R") PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2a) PORT_IMPULSE(1)
210   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("t  T") PORT_CODE(KEYCODE_T) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2b) PORT_IMPULSE(1)
211   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("y  Y") PORT_CODE(KEYCODE_Y) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2c) PORT_IMPULSE(1)
212   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("u  U") PORT_CODE(KEYCODE_U) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2d) PORT_IMPULSE(1)
213   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("i  I") PORT_CODE(KEYCODE_I) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2e) PORT_IMPULSE(1)
187214
188215   PORT_START("key3") /* KEY ROW 3 */
189   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("o  O") PORT_CODE(KEYCODE_O)
190   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("p  P") PORT_CODE(KEYCODE_P)
191   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("[  {") PORT_CODE(KEYCODE_OPENBRACE)
192   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("]  }") PORT_CODE(KEYCODE_CLOSEBRACE)
193   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER)
216   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("o  O") PORT_CODE(KEYCODE_O) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2f) PORT_IMPULSE(1)
217   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("p  P") PORT_CODE(KEYCODE_P) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x30) PORT_IMPULSE(1)
218   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("[  {") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x31) PORT_IMPULSE(1)
219   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("]  }") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x32) PORT_IMPULSE(1)
220   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x47) PORT_IMPULSE(1)
194221   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL)
195222   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL)
196223   PORT_BIT(0x80, 0x80, IPT_KEYBOARD) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
197224
198225   PORT_START("key4") /* KEY ROW 4 */
199   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("a  A") PORT_CODE(KEYCODE_A)
200   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("s  S") PORT_CODE(KEYCODE_S)
201   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("d  D") PORT_CODE(KEYCODE_D)
202   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("f  F") PORT_CODE(KEYCODE_F)
203   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("g  G") PORT_CODE(KEYCODE_G)
204   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("h  H") PORT_CODE(KEYCODE_H)
205   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("j  J") PORT_CODE(KEYCODE_J)
206   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("k  K") PORT_CODE(KEYCODE_K)
226   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("a  A") PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3c) PORT_IMPULSE(1)
227   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("s  S") PORT_CODE(KEYCODE_S) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3d) PORT_IMPULSE(1)
228   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("d  D") PORT_CODE(KEYCODE_D) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3e) PORT_IMPULSE(1)
229   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("f  F") PORT_CODE(KEYCODE_F) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x3f) PORT_IMPULSE(1)
230   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("g  G") PORT_CODE(KEYCODE_G) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x40) PORT_IMPULSE(1)
231   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("h  H") PORT_CODE(KEYCODE_H) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x41) PORT_IMPULSE(1)
232   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("j  J") PORT_CODE(KEYCODE_J) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x42) PORT_IMPULSE(1)
233   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("k  K") PORT_CODE(KEYCODE_K) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x43) PORT_IMPULSE(1)
207234
208235   PORT_START("key5") /* KEY ROW 5 */
209   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("l  L") PORT_CODE(KEYCODE_L)
210   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME(";  :") PORT_CODE(KEYCODE_COLON)
211   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("'  \"") PORT_CODE(KEYCODE_QUOTE)
212   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("\\  |") PORT_CODE(KEYCODE_ASTERISK)
236   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("l  L") PORT_CODE(KEYCODE_L) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x44) PORT_IMPULSE(1)
237   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME(";  :") PORT_CODE(KEYCODE_COLON) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x45) PORT_IMPULSE(1)
238   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("'  \"") PORT_CODE(KEYCODE_QUOTE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x46) PORT_IMPULSE(1)
239   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("\\  |") PORT_CODE(KEYCODE_ASTERISK) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x33) PORT_IMPULSE(1)
213240   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("SHIFT (L)") PORT_CODE(KEYCODE_LSHIFT)
214   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("z  Z") PORT_CODE(KEYCODE_Z)
215   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("x  X") PORT_CODE(KEYCODE_X)
216   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("c  C") PORT_CODE(KEYCODE_C)
241   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("z  Z") PORT_CODE(KEYCODE_Z) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x4e) PORT_IMPULSE(1)
242   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("x  X") PORT_CODE(KEYCODE_X) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x4f) PORT_IMPULSE(1)
243   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("c  C") PORT_CODE(KEYCODE_C) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x50) PORT_IMPULSE(1)
217244
218245   PORT_START("key6") /* KEY ROW 6 */
219   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("v  V") PORT_CODE(KEYCODE_V)
220   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("b  B") PORT_CODE(KEYCODE_B)
221   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("n  N") PORT_CODE(KEYCODE_N)
222   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("m  M") PORT_CODE(KEYCODE_M)
223   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME(",  <") PORT_CODE(KEYCODE_COMMA)
224   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME(".  >") PORT_CODE(KEYCODE_STOP)
225   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("/  ?") PORT_CODE(KEYCODE_SLASH)
246   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("v  V") PORT_CODE(KEYCODE_V) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x51) PORT_IMPULSE(1)
247   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("b  B") PORT_CODE(KEYCODE_B) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x52) PORT_IMPULSE(1)
248   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("n  N") PORT_CODE(KEYCODE_N) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x53) PORT_IMPULSE(1)
249   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("m  M") PORT_CODE(KEYCODE_M) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x54) PORT_IMPULSE(1)
250   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME(",  <") PORT_CODE(KEYCODE_COMMA) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x55) PORT_IMPULSE(1)
251   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME(".  >") PORT_CODE(KEYCODE_STOP) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x56) PORT_IMPULSE(1)
252   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("/  ?") PORT_CODE(KEYCODE_SLASH) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x23) PORT_IMPULSE(1)
226253   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("SHIFT (R)") PORT_CODE(KEYCODE_RSHIFT)
227254
228255   PORT_START("key7") /* KEY ROW 7 */
229256   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("LINE FEED")
230   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE)
231   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_MINUS_PAD)
232   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME(", (KP)") PORT_CODE(KEYCODE_PLUS_PAD)
257   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x26) PORT_IMPULSE(1)
258    PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_MINUS_PAD)
259    PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME(", (KP)") PORT_CODE(KEYCODE_PLUS_PAD)
233260   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("ENTER (KP)") PORT_CODE(KEYCODE_ENTER_PAD)
234261   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME(". (KP)") PORT_CODE(KEYCODE_DEL_PAD)
235262   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("0 (KP)") PORT_CODE(KEYCODE_0_PAD)
236263   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("1 (KP)") PORT_CODE(KEYCODE_1_PAD)
237264
238265   PORT_START("key8") /* KEY ROW 8 */
239   PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("2 (KP)") PORT_CODE(KEYCODE_2_PAD)
240   PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("3 (KP)") PORT_CODE(KEYCODE_3_PAD)
241   PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("4 (KP)") PORT_CODE(KEYCODE_4_PAD)
242   PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("5 (KP)") PORT_CODE(KEYCODE_5_PAD)
243   PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("6 (KP)") PORT_CODE(KEYCODE_6_PAD)
244   PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("7 (KP)") PORT_CODE(KEYCODE_7_PAD)
245   PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("8 (KP)") PORT_CODE(KEYCODE_8_PAD)
246   PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("9 (KP)") PORT_CODE(KEYCODE_9_PAD)
266    PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("2 (KP)") PORT_CODE(KEYCODE_2_PAD)
267    PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("3 (KP)") PORT_CODE(KEYCODE_3_PAD)
268    PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("4 (KP)") PORT_CODE(KEYCODE_4_PAD)
269    PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("5 (KP)") PORT_CODE(KEYCODE_5_PAD)
270    PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("6 (KP)") PORT_CODE(KEYCODE_6_PAD)
271    PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("7 (KP)") PORT_CODE(KEYCODE_7_PAD)
272    PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("8 (KP)") PORT_CODE(KEYCODE_8_PAD)
273    PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("9 (KP)") PORT_CODE(KEYCODE_9_PAD)
247274
275    PORT_START("key9")
276    PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x20) PORT_IMPULSE(1)
277    PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("*") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x24) PORT_IMPULSE(1) // (KP?)
278    PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("#") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x25) PORT_IMPULSE(1) // (KP?)
279
280
248281   PORT_START("via1a") /* VIA #1 PORT A */
249282   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(1)
250283   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(2)
251   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1                   )
252   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2                   )
284   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1)
285   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2)
253286   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_4WAY
254287   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_4WAY
255288   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_4WAY
r29505r29506
297330   MCFG_CPU_ADD("maincpu", ARM, 8000000)        /* 8 MHz */
298331   MCFG_CPU_PROGRAM_MAP(a310_mem)
299332
300   MCFG_AAKART_ADD("kart", 8000000/128, kart_interface) // TODO: frequency
333   MCFG_AAKART_ADD("kart", 8000000/256, kart_interface) // TODO: frequency
334
301335   MCFG_I2CMEM_ADD("i2cmem")
302336   MCFG_I2CMEM_DATA_SIZE(0x100)
303337
branches/new_menus/src/mess/drivers/megadriv.c
r29505r29506
696696   MCFG_SCREEN_VBLANK_DRIVER(md_cons_state, screen_eof_console)
697697
698698   MCFG_DEVICE_ADD("segacd", SEGA_SEGACD_US, 0)
699   MCFG_GFX_PALETTE("gen_vdp:palette")
699700
700701   MCFG_CDROM_ADD( "cdrom",scd_cdrom )
701702
r29505r29506
712713   MCFG_SCREEN_VBLANK_DRIVER(md_cons_state, screen_eof_console)
713714
714715   MCFG_DEVICE_ADD("segacd", SEGA_SEGACD_EUROPE, 0)
716   MCFG_GFX_PALETTE("gen_vdp:palette")
715717
716718   MCFG_CDROM_ADD( "cdrom",scd_cdrom )
717719
r29505r29506
728730   MCFG_SCREEN_VBLANK_DRIVER(md_cons_state, screen_eof_console)
729731
730732   MCFG_DEVICE_ADD("segacd", SEGA_SEGACD_JAPAN, 0)
733   MCFG_GFX_PALETTE("gen_vdp:palette")
731734
732735   MCFG_CDROM_ADD( "cdrom",scd_cdrom )
733736
r29505r29506
738741static MACHINE_CONFIG_DERIVED( genesis_32x_scd, genesis_32x )
739742
740743   MCFG_DEVICE_ADD("segacd", SEGA_SEGACD_US, 0)
744   MCFG_GFX_PALETTE("gen_vdp:palette")
745
741746   MCFG_CDROM_ADD( "cdrom",scd_cdrom )
742747
743748   MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd)
branches/new_menus/src/mess/drivers/mmd1.c
r29505r29506
410410   return data;
411411}
412412
413
414static I8279_INTERFACE( mmd2_intf )
415{
416   DEVCB_NULL,                     // irq
417   DEVCB_DRIVER_MEMBER(mmd1_state, mmd2_scanlines_w),  // scan SL lines
418   DEVCB_DRIVER_MEMBER(mmd1_state, mmd2_digit_w),      // display A&B
419   DEVCB_NULL,                     // BD
420   DEVCB_DRIVER_MEMBER(mmd1_state, mmd2_kbd_r),        // kbd RL lines
421   DEVCB_LINE_VCC,                     // Shift key
422   DEVCB_LINE_VCC
423};
424
425413WRITE8_MEMBER( mmd1_state::mmd2_status_callback )
426414{
427415   // operate the HALT LED
r29505r29506
513501   MCFG_DEFAULT_LAYOUT(layout_mmd2)
514502
515503   /* Devices */
516   MCFG_I8279_ADD("i8279", 400000, mmd2_intf) // based on divider
504   MCFG_DEVICE_ADD("i8279", I8279, 400000) // based on divider
505   MCFG_I8279_OUT_SL_CB(WRITE8(mmd1_state, mmd2_scanlines_w))         // scan SL lines
506   MCFG_I8279_OUT_DISP_CB(WRITE8(mmd1_state, mmd2_digit_w))         // display A&B
507   MCFG_I8279_IN_RL_CB(READ8(mmd1_state, mmd2_kbd_r))               // kbd RL lines
508   MCFG_I8279_IN_SHIFT_CB(VCC)                              // Shift key
509   MCFG_I8279_IN_CTRL_CB(VCC)
510
517511MACHINE_CONFIG_END
518512
519513/* ROM definition */
branches/new_menus/src/mess/drivers/sdk85.c
r29505r29506
114114   return data;
115115}
116116
117static I8279_INTERFACE( sdk85_intf )
118{
119   DEVCB_CPU_INPUT_LINE("maincpu", I8085_RST55_LINE),  // irq
120   DEVCB_DRIVER_MEMBER(sdk85_state, scanlines_w),  // scan SL lines
121   DEVCB_DRIVER_MEMBER(sdk85_state, digit_w),      // display A&B
122   DEVCB_NULL,                     // BD
123   DEVCB_DRIVER_MEMBER(sdk85_state, kbd_r),        // kbd RL lines
124   DEVCB_LINE_VCC,                     // Shift key
125   DEVCB_LINE_VCC
126};
127
128117static MACHINE_CONFIG_START( sdk85, sdk85_state )
129118   /* basic machine hardware */
130119   MCFG_CPU_ADD("maincpu", I8085A, XTAL_2MHz)
r29505r29506
135124   MCFG_DEFAULT_LAYOUT(layout_sdk85)
136125
137126   /* Devices */
138   MCFG_I8279_ADD("i8279", 3100000, sdk85_intf) // based on divider
127   MCFG_DEVICE_ADD("i8279", I8279, 3100000) // based on divider
128   MCFG_I8279_OUT_IRQ_CB(INPUTLINE("maincpu", I8085_RST55_LINE))   // irq
129   MCFG_I8279_OUT_SL_CB(WRITE8(sdk85_state, scanlines_w))         // scan SL lines
130   MCFG_I8279_OUT_DISP_CB(WRITE8(sdk85_state, digit_w))         // display A&B
131   MCFG_I8279_IN_RL_CB(READ8(sdk85_state, kbd_r))               // kbd RL lines
132   MCFG_I8279_IN_SHIFT_CB(VCC)                              // Shift key
133   MCFG_I8279_IN_CTRL_CB(VCC)
139134MACHINE_CONFIG_END
140135
141136/* ROM definition */
branches/new_menus/src/mess/drivers/tandy2k.c
r29505r29506
1313    - floppy
1414        - HDL is also connected to WP/TS input where TS is used to detect motor status
1515        - 3 second motor off delay timer
16    - DMA
1716    - video (video RAM is at memory top - 0x1400, i.e. 0x1ec00)
1817    - keyboard ROM
1918    - hires graphics board
r29505r29506
2524
2625#include "includes/tandy2k.h"
2726
27#define LOG 1
28
2829// Read/Write Handlers
2930
3031void tandy2k_state::update_drq()
r29505r29506
5051void tandy2k_state::dma_request(int line, int state)
5152{
5253   m_busdmarq[line] = state;
54
5355   update_drq();
5456}
5557
r29505r29506
119121
120122       0       KBEN        keyboard enable
121123       1       EXTCLK      external baud rate clock
122       2       SPKRGATE    enable periodic m_speaker output
123       3       SPKRDATA    direct output to m_speaker
124       2       SPKRGATE    enable periodic speaker output
125       3       SPKRDATA    direct output to speaker
124126       4       RFRQGATE    enable refresh and baud rate clocks
125127       5       FDCRESET*   reset 8272
126128       6       TMRIN0      enable 80186 timer 0
r29505r29506
128130
129131   */
130132
133   if (LOG) logerror("ENABLE %02x\n", data);
134
131135   // keyboard enable
132136   m_kb->power_w(BIT(data, 0));
133137
134138   // external baud rate clock
135139   m_extclk = BIT(data, 1);
136140
137   // m_speaker gate
141   // speaker gate
138142   m_pit->write_gate0(BIT(data, 2));
139143
140   // m_speaker data
144   // speaker data
141145   m_spkrdata = BIT(data, 3);
142146   speaker_update();
143147
r29505r29506
146150   m_pit->write_gate2(BIT(data, 4));
147151
148152   // FDC reset
149   if(!BIT(data, 5))
153   if (!BIT(data, 5))
154   {
150155      m_fdc->reset();
156   }
151157
152158   // timer 0 enable
153159   m_maincpu->tmrin0_w(BIT(data, 6));
r29505r29506
173179
174180   */
175181
182   if (LOG) logerror("DMA MUX %02x\n", data);
183
176184   m_dma_mux = data;
177185
178186   // check for DMA error
r29505r29506
228236
229237READ8_MEMBER( tandy2k_state::fldtc_r )
230238{
239   if (LOG) logerror("FLDTC\n");
240
231241   fldtc_w(space, 0, 0);
232242
233243   return 0;
r29505r29506
256266
257267   */
258268
269   if (LOG) logerror("Address Control %02x\n", data);
270
259271   // video access
260272   m_vram_base = data & 0x1f;
261273
r29505r29506
281293
282294   // video source select
283295   m_vidouts = BIT(data, 7);
284
285   logerror("Address Control %02x\n", data);
286296}
287297
288298// Memory Maps
r29505r29506
297307
298308static ADDRESS_MAP_START( tandy2k_io, AS_IO, 16, tandy2k_state )
299309   ADDRESS_MAP_UNMAP_HIGH
300   AM_RANGE(0x00000, 0x00001) AM_READWRITE8(enable_r, enable_w, 0x00ff)
301   AM_RANGE(0x00002, 0x00003) AM_WRITE8(dma_mux_w, 0x00ff)
302   AM_RANGE(0x00004, 0x00005) AM_READWRITE8(fldtc_r, fldtc_w, 0x00ff)
303   AM_RANGE(0x00010, 0x00013) AM_DEVREADWRITE8(I8251A_TAG, i8251_device, data_r, data_w, 0x00ff)
304   AM_RANGE(0x00030, 0x00033) AM_DEVICE8(I8272A_TAG, i8272a_device, map, 0x00ff)
305   AM_RANGE(0x00040, 0x00047) AM_DEVREADWRITE8(I8253_TAG, pit8253_device, read, write, 0x00ff)
306   AM_RANGE(0x00052, 0x00053) AM_READ8(kbint_clr_r, 0x00ff)
307   AM_RANGE(0x00050, 0x00057) AM_DEVREADWRITE8(I8255A_TAG, i8255_device, read, write, 0x00ff)
308   AM_RANGE(0x00060, 0x00063) AM_DEVREADWRITE8(I8259A_0_TAG, pic8259_device, read, write, 0x00ff)
309   AM_RANGE(0x00070, 0x00073) AM_DEVREADWRITE8(I8259A_1_TAG, pic8259_device, read, write, 0x00ff)
310   AM_RANGE(0x00080, 0x00081) AM_DEVREADWRITE8(I8272A_TAG, i8272a_device, mdma_r, mdma_w, 0x00ff)
310   AM_RANGE(0x00000, 0x00001) AM_MIRROR(0x8) AM_READWRITE8(enable_r, enable_w, 0x00ff)
311   AM_RANGE(0x00002, 0x00003) AM_MIRROR(0x8) AM_WRITE8(dma_mux_w, 0x00ff)
312   AM_RANGE(0x00004, 0x00005) AM_MIRROR(0x8) AM_READWRITE8(fldtc_r, fldtc_w, 0x00ff)
313   AM_RANGE(0x00010, 0x00013) AM_MIRROR(0xc) AM_DEVREADWRITE8(I8251A_TAG, i8251_device, data_r, data_w, 0x00ff)
314   AM_RANGE(0x00030, 0x00033) AM_MIRROR(0xc) AM_DEVICE8(I8272A_TAG, i8272a_device, map, 0x00ff)
315   AM_RANGE(0x00040, 0x00047) AM_MIRROR(0x8) AM_DEVREADWRITE8(I8253_TAG, pit8253_device, read, write, 0x00ff)
316   AM_RANGE(0x00052, 0x00053) AM_MIRROR(0x8) AM_READ8(kbint_clr_r, 0x00ff)
317   AM_RANGE(0x00050, 0x00057) AM_MIRROR(0x8) AM_DEVREADWRITE8(I8255A_TAG, i8255_device, read, write, 0x00ff)
318   AM_RANGE(0x00060, 0x00063) AM_MIRROR(0xc) AM_DEVREADWRITE8(I8259A_0_TAG, pic8259_device, read, write, 0x00ff)
319   AM_RANGE(0x00070, 0x00073) AM_MIRROR(0xc) AM_DEVREADWRITE8(I8259A_1_TAG, pic8259_device, read, write, 0x00ff)
320   AM_RANGE(0x00080, 0x00081) AM_MIRROR(0xe) AM_DEVREADWRITE8(I8272A_TAG, i8272a_device, mdma_r, mdma_w, 0x00ff)
311321//  AM_RANGE(0x00100, 0x0017f) AM_DEVREADWRITE8(CRT9007_TAG, crt9007_t, read, write, 0x00ff) AM_WRITE8(addr_ctrl_w, 0xff00)
312322   AM_RANGE(0x00100, 0x0017f) AM_READWRITE(vpac_r, vpac_w)
313323//  AM_RANGE(0x00180, 0x00180) AM_READ8(hires_status_r, 0x00ff)
r29505r29506
516526
517527WRITE_LINE_MEMBER( tandy2k_state::rfrqpulse_w )
518528{
529   // memory refresh counter up
519530}
520531
521532// Intel 8255A Interface
r29505r29506
786797   MCFG_DEVICE_ADD(CRT9021B_TAG, CRT9021, XTAL_16MHz*28/20)
787798   MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
788799
789   MCFG_TIMER_DRIVER_ADD_PERIODIC("vidldsh", tandy2k_state, vidldsh_tick, attotime::from_hz(XTAL_16MHz*28/20/8))
800   MCFG_TIMER_DRIVER_ADD("vidldsh", tandy2k_state, vidldsh_tick)
790801
791802   // sound hardware
792803   MCFG_SPEAKER_STANDARD_MONO("mono")
r29505r29506
806817   MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL)
807818   MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rxd))
808819   MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_dsr))
820   // TODO pin 15 external transmit clock
821   // TODO pin 17 external receiver clock
809822
810823   MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0)
811824   MCFG_PIT8253_CLK0(XTAL_16MHz/16)
812825   MCFG_PIT8253_OUT0_HANDLER(WRITELINE(tandy2k_state, outspkr_w))
813826   MCFG_PIT8253_CLK1(XTAL_16MHz/8)
814827   MCFG_PIT8253_OUT1_HANDLER(WRITELINE(tandy2k_state, intbrclk_w))
815   MCFG_PIT8253_CLK2(XTAL_16MHz/8)
816   MCFG_PIT8253_OUT2_HANDLER(WRITELINE(tandy2k_state, rfrqpulse_w))
828   //MCFG_PIT8253_CLK2(XTAL_16MHz/8)
829   //MCFG_PIT8253_OUT2_HANDLER(WRITELINE(tandy2k_state, rfrqpulse_w))
817830
818831   MCFG_PIC8259_ADD(I8259A_0_TAG, DEVWRITELINE(I80186_TAG, i80186_cpu_device, int0_w), VCC, NULL)
819832
branches/new_menus/src/mess/drivers/sdk86.c
r29505r29506
137137   m_usart->write_rxc(state);
138138}
139139
140static I8279_INTERFACE( sdk86_intf )
141{
142   DEVCB_NULL, // irq
143   DEVCB_DRIVER_MEMBER(sdk86_state, scanlines_w),  // scan SL lines
144   DEVCB_DRIVER_MEMBER(sdk86_state, digit_w),      // display A&B
145   DEVCB_NULL,                     // BD
146   DEVCB_DRIVER_MEMBER(sdk86_state, kbd_r),        // kbd RL lines
147   DEVCB_LINE_GND,                     // Shift key
148   DEVCB_LINE_GND
149};
150
151140static DEVICE_INPUT_DEFAULTS_START( terminal )
152141   DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x05 ) // 4800
153142   DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x05 ) // 4800
r29505r29506
180169   MCFG_DEVICE_ADD("usart_clock", CLOCK, 307200)
181170   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(sdk86_state, write_usart_clock))
182171
183   MCFG_I8279_ADD("i8279", 2500000, sdk86_intf) // based on divider
172   MCFG_DEVICE_ADD("i8279", I8279, 2500000) // based on divider
173   MCFG_I8279_OUT_SL_CB(WRITE8(sdk86_state, scanlines_w))         // scan SL lines
174   MCFG_I8279_OUT_DISP_CB(WRITE8(sdk86_state, digit_w))         // display A&B
175   MCFG_I8279_IN_RL_CB(READ8(sdk86_state, kbd_r))               // kbd RL lines
176   MCFG_I8279_IN_SHIFT_CB(GND)                              // Shift key
177   MCFG_I8279_IN_CTRL_CB(GND)
184178
185179MACHINE_CONFIG_END
186180
branches/new_menus/src/mess/drivers/nes.c
r29505r29506
652652}
653653
654654
655static const ppu2c0x_interface nes_ppu_interface =
656{
657   "maincpu",
658   0,
659   0,
660   PPU_MIRROR_NONE
661};
662
663655static const floppy_interface nes_floppy_interface =
664656{
665657   DEVCB_NULL,
r29505r29506
674666};
675667
676668
677static const nes_cart_interface nes_crt_interface =
678{
679};
680
681
682669static const cassette_interface fc_cassette_interface =
683670{
684671   cassette_default_formats,
r29505r29506
710697   MCFG_PALETTE_ADD("palette", 4*16*8)
711698   MCFG_PALETTE_INIT_OWNER(nes_state, nes)
712699
713   MCFG_PPU2C02_ADD("ppu", nes_ppu_interface)
700   MCFG_PPU2C02_ADD("ppu")
701   MCFG_PPU2C0X_CPU("maincpu")
714702   MCFG_PPU2C0X_SET_NMI(nes_state, ppu_nmi)
715703
716704   /* sound hardware */
r29505r29506
719707   MCFG_SOUND_CONFIG(nes_apu_interface)
720708   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
721709
722   MCFG_NES_CARTRIDGE_ADD("nes_slot", nes_crt_interface, nes_cart, NULL)
710   MCFG_NES_CARTRIDGE_ADD("nes_slot", nes_cart, NULL)
723711   MCFG_SOFTWARE_LIST_ADD("cart_list", "nes")
724712   MCFG_SOFTWARE_LIST_ADD("ade_list", "nes_ade")         // Camerica/Codemasters Aladdin Deck Enhancer mini-carts
725713   MCFG_SOFTWARE_LIST_ADD("ntb_list", "nes_ntbrom")      // Sunsoft Nantettate! Baseball mini-carts
r29505r29506
734722   MCFG_CPU_CLOCK(PAL_CLOCK)
735723
736724   MCFG_DEVICE_REMOVE("ppu")
737   MCFG_PPU2C07_ADD("ppu", nes_ppu_interface)
725   MCFG_PPU2C07_ADD("ppu")
726   MCFG_PPU2C0X_CPU("maincpu")
738727   MCFG_PPU2C0X_SET_NMI(nes_state, ppu_nmi)
739728
740729   /* video hardware */
r29505r29506
757746   MCFG_CPU_CLOCK( 26601712/15 ) /* 26.601712MHz / 15 == 1.77344746666... MHz */
758747
759748   MCFG_DEVICE_REMOVE("ppu")
760   MCFG_PPU2C07_ADD("ppu", nes_ppu_interface)
749   MCFG_PPU2C07_ADD("ppu")
750   MCFG_PPU2C0X_CPU("maincpu")
761751   MCFG_PPU2C0X_SET_NMI(nes_state, ppu_nmi)
762752
763753   /* video hardware */
r29505r29506
773763
774764static MACHINE_CONFIG_DERIVED( famicom, nes )
775765   MCFG_DEVICE_REMOVE("nes_slot")
776   MCFG_NES_CARTRIDGE_ADD("nes_slot", nes_crt_interface, nes_cart, NULL)
766   MCFG_NES_CARTRIDGE_ADD("nes_slot", nes_cart, NULL)
777767   MCFG_NES_CARTRIDGE_NOT_MANDATORY
778768
779769   MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, nes_floppy_interface)
branches/new_menus/src/mess/drivers/x68k.c
r29505r29506
115115*/
116116
117117#include "emu.h"
118#include "cpu/m68000/m68000.h"
119#include "machine/i8255.h"
120118#include "machine/mc68901.h"
121119#include "machine/upd765.h"
122#include "sound/2151intf.h"
123120#include "sound/okim6258.h"
124#include "machine/8530scc.h"
125121#include "machine/rp5c15.h"
126122#include "machine/mb89352.h"
127123#include "formats/xdf_dsk.h"
r29505r29506
181177      m_fdc.fdc->tc_w(ASSERT_LINE);
182178      m_fdc.fdc->tc_w(CLEAR_LINE);
183179      break;
180   case TIMER_X68K_ADPCM:
181      m_hd63450->drq3_w(1);
182      m_hd63450->drq3_w(0);
183      break;
184184   default:
185185      assert_always(FALSE, "Unknown id in x68k_state::device_timer");
186186   }
r29505r29506
213213// typically read from the SCC data port on receive buffer full interrupt per byte
214214int x68k_state::x68k_read_mouse()
215215{
216   scc8530_t *scc = machine().device<scc8530_t>("scc");
217216   char val = 0;
218217   char ipt = 0;
219218
220   if(!(scc->get_reg_b(5) & 0x02))
219   if(!(m_scc->get_reg_b(5) & 0x02))
221220      return 0xff;
222221
223222   switch(m_mouse.inputtype)
224223   {
225224   case 0:
226      ipt = ioport("mouse1")->read();
225      ipt = m_mouse1->read();
227226      break;
228227   case 1:
229      val = ioport("mouse2")->read();
228      val = m_mouse2->read();
230229      ipt = val - m_mouse.last_mouse_x;
231230      m_mouse.last_mouse_x = val;
232231      break;
233232   case 2:
234      val = ioport("mouse3")->read();
233      val = m_mouse3->read();
235234      ipt = val - m_mouse.last_mouse_y;
236235      m_mouse.last_mouse_y = val;
237236      break;
r29505r29506
239238   m_mouse.inputtype++;
240239   if(m_mouse.inputtype > 2)
241240   {
242      int i_val = scc->get_reg_b(0);
241      int i_val = m_scc->get_reg_b(0);
243242      m_mouse.inputtype = 0;
244243      m_mouse.bufferempty = 1;
245244      i_val &= ~0x01;
246      scc->set_reg_b(0, i_val);
245      m_scc->set_reg_b(0, i_val);
247246      logerror("SCC: mouse buffer empty\n");
248247   }
249248
r29505r29506
258257*/
259258READ16_MEMBER(x68k_state::x68k_scc_r )
260259{
261   scc8530_t *scc = machine().device<scc8530_t>("scc");
262260   offset %= 4;
263261   switch(offset)
264262   {
265263   case 0:
266      return scc->reg_r(space, 0);
264      return m_scc->reg_r(space, 0);
267265   case 1:
268266      return x68k_read_mouse();
269267   case 2:
270      return scc->reg_r(space, 1);
268      return m_scc->reg_r(space, 1);
271269   case 3:
272      return scc->reg_r(space, 3);
270      return m_scc->reg_r(space, 3);
273271   default:
274272      return 0xff;
275273   }
r29505r29506
277275
278276WRITE16_MEMBER(x68k_state::x68k_scc_w )
279277{
280   scc8530_t *scc = machine().device<scc8530_t>("scc");
281278   offset %= 4;
282279
283280   switch(offset)
284281   {
285282   case 0:
286      scc->reg_w(space, 0,(UINT8)data);
287      if((scc->get_reg_b(5) & 0x02) != m_scc_prev)
283      m_scc->reg_w(space, 0,(UINT8)data);
284      if((m_scc->get_reg_b(5) & 0x02) != m_scc_prev)
288285      {
289         if(scc->get_reg_b(5) & 0x02)  // Request to Send
286         if(m_scc->get_reg_b(5) & 0x02)  // Request to Send
290287         {
291            int val = scc->get_reg_b(0);
288            int val = m_scc->get_reg_b(0);
292289            m_mouse.bufferempty = 0;
293290            val |= 0x01;
294            scc->set_reg_b(0,val);
291            m_scc->set_reg_b(0,val);
295292         }
296293      }
297294      break;
298295   case 1:
299      scc->reg_w(space, 2,(UINT8)data);
296      m_scc->reg_w(space, 2,(UINT8)data);
300297      break;
301298   case 2:
302      scc->reg_w(space, 1,(UINT8)data);
299      m_scc->reg_w(space, 1,(UINT8)data);
303300      break;
304301   case 3:
305      scc->reg_w(space, 3,(UINT8)data);
302      m_scc->reg_w(space, 3,(UINT8)data);
306303      break;
307304   }
308   m_scc_prev = scc->get_reg_b(5) & 0x02;
305   m_scc_prev = m_scc->get_reg_b(5) & 0x02;
309306}
310307
311308TIMER_CALLBACK_MEMBER(x68k_state::x68k_scc_ack)
312309{
313   scc8530_t *scc = machine().device<scc8530_t>("scc");
314310   if(m_mouse.bufferempty != 0)  // nothing to do if the mouse data buffer is empty
315311      return;
316312
r29505r29506
318314//      return;
319315
320316   // hard-code the IRQ vector for now, until the SCC code is more complete
321   if((scc->get_reg_a(9) & 0x08) || (scc->get_reg_b(9) & 0x08))  // SCC reg WR9 is the same for both channels
317   if((m_scc->get_reg_a(9) & 0x08) || (m_scc->get_reg_b(9) & 0x08))  // SCC reg WR9 is the same for both channels
322318   {
323      if((scc->get_reg_b(1) & 0x18) != 0)  // if bits 3 and 4 of WR1 are 0, then Rx IRQs are disabled on this channel
319      if((m_scc->get_reg_b(1) & 0x18) != 0)  // if bits 3 and 4 of WR1 are 0, then Rx IRQs are disabled on this channel
324320      {
325         if(scc->get_reg_b(5) & 0x02)  // RTS signal
321         if(m_scc->get_reg_b(5) & 0x02)  // RTS signal
326322         {
327323            m_mouse.irqactive = 1;
328324            m_current_vector[5] = 0x54;
r29505r29506
354350   }
355351   if(m_adpcm.clock != 0)
356352      rate = rate/2;
357   m_hd63450->set_timer(3,attotime::from_hz(rate));
353   m_adpcm_timer->adjust(attotime::from_hz(rate), 0, attotime::from_hz(rate));
358354}
359355
360356// Megadrive 3 button gamepad
r29505r29506
367363{
368364   if(port == 1)
369365   {
370      UINT8 porta = ioport("md3b")->read() & 0xff;
371      UINT8 portb = (ioport("md3b")->read() >> 8) & 0xff;
366      UINT8 porta = m_md3b->read() & 0xff;
367      UINT8 portb = (m_md3b->read() >> 8) & 0xff;
372368      if(m_mdctrl.mux1 & 0x10)
373369      {
374370         return porta | 0x90;
r29505r29506
380376   }
381377   if(port == 2)
382378   {
383      UINT8 porta = (ioport("md3b")->read() >> 16) & 0xff;
384      UINT8 portb = (ioport("md3b")->read() >> 24) & 0xff;
379      UINT8 porta = (m_md3b->read() >> 16) & 0xff;
380      UINT8 portb = (m_md3b->read() >> 24) & 0xff;
385381      if(m_mdctrl.mux2 & 0x20)
386382      {
387383         return porta | 0x90;
r29505r29506
415411{
416412   if(port == 1)
417413   {
418      UINT8 porta = ioport("md6b")->read() & 0xff;
419      UINT8 portb = (ioport("md6b")->read() >> 8) & 0xff;
420      UINT8 extra = ioport("md6b_extra")->read() & 0x0f;
414      UINT8 porta = m_md6b->read() & 0xff;
415      UINT8 portb = (m_md6b->read() >> 8) & 0xff;
416      UINT8 extra = m_md6b_extra->read() & 0x0f;
421417
422418      switch(m_mdctrl.seq1)
423419      {
r29505r29506
453449   }
454450   if(port == 2)
455451   {
456      UINT8 porta = (ioport("md6b")->read() >> 16) & 0xff;
457      UINT8 portb = (ioport("md6b")->read() >> 24) & 0xff;
458      UINT8 extra = (ioport("md6b_extra")->read() >> 4) & 0x0f;
452      UINT8 porta = (m_md6b->read() >> 16) & 0xff;
453      UINT8 portb = (m_md6b->read() >> 24) & 0xff;
454      UINT8 extra = (m_md6b_extra->read() >> 4) & 0x0f;
459455
460456      switch(m_mdctrl.seq2)
461457      {
r29505r29506
503499{
504500   if(port == 1)
505501   {
506      UINT8 porta = ioport("xpd1lr")->read() & 0xff;
507      UINT8 portb = (ioport("xpd1lr")->read() >> 8) & 0xff;
502      UINT8 porta = m_xpd1lr->read() & 0xff;
503      UINT8 portb = (m_xpd1lr->read() >> 8) & 0xff;
508504      if(m_mdctrl.mux1 & 0x10)
509505      {
510506         return porta;
r29505r29506
516512   }
517513   if(port == 2)
518514   {
519      UINT8 porta = (ioport("xpd1lr")->read() >> 16) & 0xff;
520      UINT8 portb = (ioport("xpd1lr")->read() >> 24) & 0xff;
515      UINT8 porta = (m_xpd1lr->read() >> 16) & 0xff;
516      UINT8 portb = (m_xpd1lr->read() >> 24) & 0xff;
521517      if(m_mdctrl.mux2 & 0x20)
522518      {
523519         return porta;
r29505r29506
533529// Judging from the XM6 source code, PPI ports A and B are joystick inputs
534530READ8_MEMBER(x68k_state::ppi_port_a_r)
535531{
536   int ctrl = ioport("ctrltype")->read() & 0x0f;
532   int ctrl = m_ctrltype->read() & 0x0f;
537533
538534   switch(ctrl)
539535   {
540536      case 0x00:  // standard MSX/FM-Towns joystick
541537         if(m_joy.joy1_enable == 0)
542            return ioport("joy1")->read();
538            return m_joy1->read();
543539         else
544540            return 0xff;
545541      case 0x01:  // 3-button Megadrive gamepad
r29505r29506
555551
556552READ8_MEMBER(x68k_state::ppi_port_b_r)
557553{
558   int ctrl = ioport("ctrltype")->read() & 0xf0;
554   int ctrl = m_ctrltype->read() & 0xf0;
559555
560556   switch(ctrl)
561557   {
562558      case 0x00:  // standard MSX/FM-Towns joystick
563559         if(m_joy.joy2_enable == 0)
564            return ioport("joy2")->read();
560            return m_joy2->read();
565561         else
566562            return 0xff;
567563      case 0x10:  // 3-button Megadrive gamepad
r29505r29506
736732   return m_fdc.fdc->dma_w(data);
737733}
738734
739WRITE_LINE_MEMBER( x68k_state::fdc_drq )
740{
741   bool ostate = m_fdc.drq_state;
742   m_fdc.drq_state = state;
743   if(state && !ostate)
744   {
745      m_hd63450->single_transfer(0);
746   }
747}
748
749735WRITE16_MEMBER(x68k_state::x68k_fm_w)
750736{
751737   switch(offset)
752738   {
753739   case 0x00:
754740   case 0x01:
755      machine().device<ym2151_device>("ym2151")->write(space, offset, data);
741      m_ym2151->write(space, offset, data);
756742      break;
757743   }
758744}
r29505r29506
760746READ16_MEMBER(x68k_state::x68k_fm_r)
761747{
762748   if(offset == 0x01)
763      return machine().device<ym2151_device>("ym2151")->read(space, 1);
749      return m_ym2151->read(space, 1);
764750
765751   return 0xffff;
766752}
r29505r29506
901887
902888WRITE16_MEMBER(x68k_state::x68k_ppi_w)
903889{
904   i8255_device *ppi = machine().device<i8255_device>("ppi8255");
905   ppi->write(space,offset & 0x03,data);
890   m_ppi->write(space,offset & 0x03,data);
906891}
907892
908893READ16_MEMBER(x68k_state::x68k_ppi_r)
909894{
910   i8255_device *ppi = machine().device<i8255_device>("ppi8255");
911   return ppi->read(space,offset & 0x03);
895   return m_ppi->read(space,offset & 0x03);
912896}
913897
914898
r29505r29506
10661050      then access causes a bus error */
10671051   m_current_vector[2] = 0x02;  // bus error
10681052   m_current_irq_line = 2;
1069   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1053   if((m_options->read() & 0x02) && !space.debugger_access())
10701054      set_bus_error((offset << 1) + 0xbffffc, 0, mem_mask);
10711055   return 0xff;
10721056}
r29505r29506
10771061      then access causes a bus error */
10781062   m_current_vector[2] = 0x02;  // bus error
10791063   m_current_irq_line = 2;
1080   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1064   if((m_options->read() & 0x02) && !space.debugger_access())
10811065      set_bus_error((offset << 1) + 0xbffffc, 1, mem_mask);
10821066}
10831067
r29505r29506
10871071      Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */
10881072   m_current_vector[2] = 0x02;  // bus error
10891073   m_current_irq_line = 2;
1090   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1074   if((m_options->read() & 0x02) && !space.debugger_access())
10911075      set_bus_error((offset << 1), 0, mem_mask);
10921076   return 0xff;
10931077}
r29505r29506
10981082      Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */
10991083   m_current_vector[2] = 0x02;  // bus error
11001084   m_current_irq_line = 2;
1101   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1085   if((m_options->read() & 0x02) && !space.debugger_access())
11021086      set_bus_error((offset << 1), 1, mem_mask);
11031087}
11041088
r29505r29506
11071091   /* These are expansion devices, if not present, they cause a bus error */
11081092   m_current_vector[2] = 0x02;  // bus error
11091093   m_current_irq_line = 2;
1110   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1094   if((m_options->read() & 0x02) && !space.debugger_access())
11111095      set_bus_error((offset << 1) + 0xeafa00, 0, mem_mask);
11121096   return 0xff;
11131097}
r29505r29506
11171101   /* These are expansion devices, if not present, they cause a bus error */
11181102   m_current_vector[2] = 0x02;  // bus error
11191103   m_current_irq_line = 2;
1120   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1104   if((m_options->read() & 0x02) && !space.debugger_access())
11211105      set_bus_error((offset << 1) + 0xeafa00, 1, mem_mask);
11221106}
11231107
r29505r29506
11471131   {
11481132      m_current_vector[3] = m_hd63450->get_error_vector(offset);
11491133      m_current_irq_line = 3;
1134      logerror("DMA#%i: DMA Error (vector 0x%02x)\n",offset,m_current_vector[3]);
11501135      m_maincpu->set_input_line_and_vector(3,ASSERT_LINE,m_current_vector[3]);
11511136   }
11521137}
r29505r29506
16031588
16041589}
16051590
1606static const mb89352_interface x68k_scsi_intf =
1607{
1608   DEVCB_DRIVER_LINE_MEMBER(x68k_state,x68k_scsi_irq),
1609   DEVCB_DRIVER_LINE_MEMBER(x68k_state,x68k_scsi_drq)
1610};
1611
16121591static X68K_EXPANSION_INTERFACE(x68k_exp_intf)
16131592{
16141593   DEVCB_DRIVER_LINE_MEMBER(x68k_state,x68k_irq2_line),
r29505r29506
17991778   m_led_timer = timer_alloc(TIMER_X68K_LED);
18001779   m_net_timer = timer_alloc(TIMER_X68K_NET_IRQ);
18011780   m_fdc_tc = timer_alloc(TIMER_X68K_FDC_TC);
1781   m_adpcm_timer = timer_alloc(TIMER_X68K_ADPCM);
18021782
18031783   // Initialise timers for 6-button MD controllers
18041784   md_6button_init();
r29505r29506
18971877
18981878   MCFG_UPD72065_ADD("upd72065", true, true)
18991879   MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(x68k_state, fdc_irq))
1900   MCFG_UPD765_DRQ_CALLBACK(WRITELINE(x68k_state, fdc_drq))
1880   MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("hd63450", hd63450_device, drq0_w))
19011881   MCFG_FLOPPY_DRIVE_ADD("upd72065:0", x68k_floppies, "525hd", x68k_state::floppy_formats)
19021882   MCFG_FLOPPY_DRIVE_ADD("upd72065:1", x68k_floppies, "525hd", x68k_state::floppy_formats)
19031883   MCFG_FLOPPY_DRIVE_ADD("upd72065:2", x68k_floppies, "525hd", x68k_state::floppy_formats)
r29505r29506
19381918   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
19391919   MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
19401920   MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
1941   MCFG_MB89352A_ADD("scsi:mb89352",x68k_scsi_intf)
1921   MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
1922   MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
1923   MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
19421924MACHINE_CONFIG_END
19431925
19441926static MACHINE_CONFIG_START( x68kxvi, x68k_state )
r29505r29506
19591941   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
19601942   MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
19611943   MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
1962   MCFG_MB89352A_ADD("scsi:mb89352",x68k_scsi_intf)
1944   MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
1945   MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
1946   MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
19631947MACHINE_CONFIG_END
19641948
19651949static MACHINE_CONFIG_START( x68030, x68k_state )
r29505r29506
19811965   MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
19821966   MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
19831967   MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
1984   MCFG_MB89352A_ADD("scsi:mb89352",x68k_scsi_intf)
1968   MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
1969   MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
1970   MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
19851971MACHINE_CONFIG_END
19861972
19871973ROM_START( x68000 )
branches/new_menus/src/mess/drivers/pdp1.c
r29505r29506
351351}
352352
353353
354static const crt_interface pdp1_crt_interface =
355{
356   pen_crt_num_levels,
357   crt_window_offset_x, crt_window_offset_y,
358   crt_window_width, crt_window_height
359};
360
361
362354/*
363355    pdp1 machine code
364356
r29505r29506
19451937   MCFG_CPU_PROGRAM_MAP(pdp1_map)
19461938   MCFG_CPU_VBLANK_INT_DRIVER("screen", pdp1_state,  pdp1_interrupt)   /* dummy interrupt: handles input */
19471939
1948
19491940   /* video hardware (includes the control panel and typewriter output) */
19501941   MCFG_SCREEN_ADD("screen", RASTER)
19511942   MCFG_SCREEN_REFRESH_RATE(refresh_rate)
r29505r29506
19561947   MCFG_SCREEN_VBLANK_DRIVER(pdp1_state, screen_eof_pdp1)
19571948   MCFG_SCREEN_PALETTE("palette")
19581949
1959   MCFG_CRT_ADD( "crt", pdp1_crt_interface )
1950   MCFG_DEVICE_ADD("crt", CRT, 0)
1951   MCFG_CRT_NUM_LEVELS(pen_crt_num_levels)
1952   MCFG_CRT_OFFSETS(crt_window_offset_x, crt_window_offset_y)
1953   MCFG_CRT_SIZE(crt_window_width, crt_window_height)
1954
19601955   MCFG_DEVICE_ADD("readt", PDP1_READTAPE, 0)
19611956   MCFG_DEVICE_ADD("punch", PDP1_PUNCHTAPE, 0)
19621957   MCFG_DEVICE_ADD("typewriter", PDP1_PRINTER, 0)
branches/new_menus/src/mess/drivers/selz80.c
r29505r29506
153153   return data;
154154}
155155
156static I8279_INTERFACE( selz80_intf )
157{
158   DEVCB_NULL, // irq
159   DEVCB_DRIVER_MEMBER(selz80_state, scanlines_w), // scan SL lines
160   DEVCB_DRIVER_MEMBER(selz80_state, digit_w),     // display A&B
161   DEVCB_NULL,                     // BD
162   DEVCB_DRIVER_MEMBER(selz80_state, kbd_r),       // kbd RL lines
163   DEVCB_LINE_VCC,                     // Shift key
164   DEVCB_LINE_VCC
165};
166
167156static MACHINE_CONFIG_START( selz80, selz80_state )
168157   /* basic machine hardware */
169158   MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz)
r29505r29506
174163   MCFG_DEFAULT_LAYOUT(layout_selz80)
175164
176165   /* Devices */
177   MCFG_I8279_ADD("i8279", 2500000, selz80_intf) // based on divider
166   MCFG_DEVICE_ADD("i8279", I8279, 2500000) // based on divider
167   MCFG_I8279_OUT_SL_CB(WRITE8(selz80_state, scanlines_w))         // scan SL lines
168   MCFG_I8279_OUT_DISP_CB(WRITE8(selz80_state, digit_w))         // display A&B
169   MCFG_I8279_IN_RL_CB(READ8(selz80_state, kbd_r))               // kbd RL lines
170   MCFG_I8279_IN_SHIFT_CB(VCC)                              // Shift key
171   MCFG_I8279_IN_CTRL_CB(VCC)
178172MACHINE_CONFIG_END
179173
180174static MACHINE_CONFIG_DERIVED( dagz80, selz80 )
branches/new_menus/src/mess/drivers/digel804.c
r29505r29506
585585   MCFG_CPU_IO_MAP(z80_io_1_4)
586586   MCFG_QUANTUM_TIME(attotime::from_hz(60))
587587
588   MCFG_ROC10937_ADD("vfd",0,RIGHT_TO_LEFT)
588   MCFG_ROC10937_ADD("vfd",0) // RIGHT_TO_LEFT
589589
590590   /* video hardware */
591591   MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, digel804_terminal_intf)
branches/new_menus/src/mess/drivers/cat.c
r29505r29506
282282    data, though track 0 is just a disk "unique" identifier for the cat
283283    meaning 404480 usable bytes
284284  * (Once the floppy is working I'd declare the system working)
285- WIP: Centronics port (not sure what is wrong right now, ip4 is never reading
286    as high meaning nothing works; does our centronics implementation correctly
287    assert BUSY at all?)
285- Centronics port finishing touches: verify where the paper out, slct/err, and IPP pins map in memory
288286- RS232C port and Modem "port" connected to the DUART's two ports
287  These are currently optionally debug-logged but don't connect anywhere
289288- DTMF generator chip (connected to DUART 'user output' pins OP4,5,6,7)
290289- WIP: Watchdog timer/powerfail at 0x85xxxx (watchdog NMI needs to actually
291290  fire if wdt goes above a certain number, possibly 3, 7 or F?)
r29505r29506
308307  happens inside an asic) for the SVROMS (or the svram or the code roms, for
309308  that matter!)
310309- Hook Battery Low input to a dipswitch.
311- Hook pfail to a dipswitch?
310- Hook pfail to a dipswitch.
312311- Hook the floppy control register readback up properly, things seem to get
313312  confused.
314313
r29505r29506
341340#undef DEBUG_FLOPPY_DATA_R
342341#undef DEBUG_FLOPPY_STATUS_R
343342
344#define DEBUG_PRINTER_DATA_W 1
343#undef DEBUG_PRINTER_DATA_W
345344#undef DEBUG_PRINTER_CONTROL_W
346345
347346#undef DEBUG_MODEM_R
r29505r29506
353352// data sent to modem chip
354353#undef DEBUG_DUART_TXB
355354#undef DEBUG_DUART_IRQ_HANDLER
356#define DEBUG_PRN_FF 1
355#undef DEBUG_PRN_FF
357356
358357#undef DEBUG_TEST_W
359358
r29505r29506
820819    * \--------- (unused?)
821820    */
822821#ifdef DEBUG_GA2OPR_W
823   fprintf(stderr, "GA2 OPR (video ena/inv, watchdog, and phone relay) reg write: offset %06X, data %04X\n", 0x840000+(offset<<1), data);
822   if (data != 0x001C)
823      fprintf(stderr, "GA2 OPR (video ena/inv, watchdog, and phone relay) reg write: offset %06X, data %04X\n", 0x840000+(offset<<1), data);
824824#endif
825825   if (data&0x08) m_wdt_counter = 0;
826826   m_video_enable = BIT( data, 2 );
r29505r29506
834834    * before each write to SVRAM, the forth code does NOT actually do that!
835835    *
836836    * 76543210
837    * ??????\\-- Watchdog count? (counts upward? if this reaches <some unknown number greater than 2> the watchdog fires? writing bit 3 set to opr above resets this)
837    * ??????\\-- Watchdog count? (counts upward? if this reaches <some unknown number greater than 3> the watchdog fires? writing bit 3 set to opr above resets this)
838838    *
839839    * FEDCBA98
840840    * |||||||\-- PFAIL state (MB3771 comparator: 1: vcc = 5v; 0: vcc != 5v, hence do not write to svram!)
r29505r29506
16731673   ROMX_LOAD( "boulth1.ic5", 0x20000, 0x10000, CRC(bed1f761) SHA1(d177e1d3a39b005dd94a6bda186221d597129af4), ROM_SKIP(1) | ROM_BIOS(1))
16741674   /* This 2.40 code was compiled by Dwight Elvey based on the v2.40 source
16751675    * code disks recovered around 2004. It does NOT exactly match the above
1676    * set exactly but has a few small differences.
1676    * set exactly but has a few small differences. One of the printer drivers
1677    * may have been replaced by Dwight with an HP PCL4 driver.
16771678    * It is as of yet unknown whether it is earlier or later code than the
16781679    * set above.
16791680    */
branches/new_menus/src/mess/drivers/tx0.c
r29505r29506
300300}
301301
302302
303static const crt_interface tx0_crt_interface =
304{
305   pen_crt_num_levels,
306   crt_window_offset_x, crt_window_offset_y,
307   crt_window_width, crt_window_height
308};
309303
310
311304/*
312305    TX-0
313306*
r29505r29506
316309
317310
318311
319
320
321
322
323
324
325
326
327
328
329
330312/* crt display timer */
331313
332314
r29505r29506
15791561   /* dummy interrupt: handles input */
15801562   MCFG_CPU_VBLANK_INT_DRIVER("screen", tx0_state,  tx0_interrupt)
15811563
1582
15831564   /* video hardware (includes the control panel and typewriter output) */
15841565   MCFG_SCREEN_ADD("screen", RASTER)
15851566   MCFG_SCREEN_REFRESH_RATE(refresh_rate)
r29505r29506
15901571   MCFG_SCREEN_VBLANK_DRIVER(tx0_state, screen_eof_tx0)
15911572   MCFG_SCREEN_PALETTE("palette")
15921573
1593   MCFG_CRT_ADD( "crt", tx0_crt_interface )
1574   MCFG_DEVICE_ADD("crt", CRT, 0)
1575   MCFG_CRT_NUM_LEVELS(pen_crt_num_levels)
1576   MCFG_CRT_OFFSETS(crt_window_offset_x, crt_window_offset_y)
1577   MCFG_CRT_SIZE(crt_window_width, crt_window_height)
1578
15941579   MCFG_DEVICE_ADD("readt", TX0_READTAPE, 0)
15951580   MCFG_DEVICE_ADD("punch", TX0_PUNCHTAPE, 0)
15961581   MCFG_DEVICE_ADD("typewriter", TX0_PRINTER, 0)
branches/new_menus/src/mess/machine/sms.c
r29505r29506
804804      save_item(NAME(m_ctrl2_th_latch));
805805      save_item(NAME(m_ctrl1_th_state));
806806      save_item(NAME(m_ctrl2_th_state));
807      save_item(NAME(m_lphaser_x_offs));
807808   }
808809
809810   if (m_is_gamegear)
r29505r29506
871872
872873READ8_MEMBER(smssdisp_state::sms_store_cart_select_r)
873874{
874   return 0xff;
875   return m_store_cart_selection_data;
875876}
876877
877878
r29505r29506
897898   UINT8 slot = data >> 4;
898899   UINT8 slottype = data & 0x08;
899900
900   // The SMS Store Display only uses the logical cartridge slot to map
901   // the active cartridge or card slot, of its multiple ones.
901   // The SMS Store Display Unit only uses the logical cartridge slot to
902   // map the active cartridge or card slot, of its multiple ones.
902903   if (slottype == 0)
903904      m_cartslot = m_slots[slot];
904905   else
r29505r29506
907908   logerror("switching in part of %s slot #%d\n", slottype ? "card" : "cartridge", slot);
908909}
909910
910
911READ8_MEMBER(smssdisp_state::sms_store_select1)
912{
913   return 0xff;
914}
915
916
917READ8_MEMBER(smssdisp_state::sms_store_select2)
918{
919   return 0xff;
920}
921
922
923READ8_MEMBER(smssdisp_state::sms_store_control_r)
924{
925   return m_store_control;
926}
927
928
929911WRITE8_MEMBER(smssdisp_state::sms_store_control_w)
930912{
913   int led_number = data >> 4;
914   int led_column = led_number / 4;
915   int led_line = 3 - (led_number % 4);
916   int game_number = (4 * led_column) + led_line;
917
931918   logerror("0x%04X: sms_store_control write 0x%02X\n", space.device().safe_pc(), data);
919   logerror("sms_store_control: LED #%d activated for game #%d\n", led_number, game_number);
920
932921   if (data & 0x02)
933922   {
934923      m_maincpu->resume(SUSPEND_REASON_HALT);
branches/new_menus/src/mess/machine/megacd.c
r29505r29506
22#include "machine/megacd.h"
33#include "machine/nvram.h"
44#include "megacd.lh"
5#include "sound/rf5c68.h"
65
76
7const device_type SEGA_SEGACD_US = &device_creator<sega_segacd_us_device>;
8const device_type SEGA_SEGACD_JAPAN = &device_creator<sega_segacd_japan_device>;
9const device_type SEGA_SEGACD_EUROPE = &device_creator<sega_segacd_europe_device>;
10
11
812/* Callback when the genesis enters interrupt code */
913IRQ_CALLBACK_MEMBER(sega_segacd_device::segacd_sub_int_callback)
1014{
r29505r29506
1923}
2024
2125
22const device_type SEGA_SEGACD_US = &device_creator<sega_segacd_us_device>;
23const device_type SEGA_SEGACD_JAPAN = &device_creator<sega_segacd_japan_device>;
24const device_type SEGA_SEGACD_EUROPE = &device_creator<sega_segacd_europe_device>;
25
26sega_segacd_device::sega_segacd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
27   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
28      m_scdcpu(*this, "segacd_68k"),
29      m_gfxdecode(*this, "gfxdecode")
26TIMER_DEVICE_CALLBACK_MEMBER( sega_segacd_device::irq3_timer_callback )
3027{
31}
32
33sega_segacd_us_device::sega_segacd_us_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
34   : sega_segacd_device(mconfig, SEGA_SEGACD_US, "sega_segacd_us", tag, owner, clock, "sega_segacd_us", __FILE__)
35{
36}
37
38sega_segacd_japan_device::sega_segacd_japan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
39   : sega_segacd_device(mconfig, SEGA_SEGACD_JAPAN, "sega_segacd_japan", tag, owner, clock, "sega_segacd_japan", __FILE__)
40{
41}
42
43sega_segacd_europe_device::sega_segacd_europe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
44   : sega_segacd_device(mconfig, SEGA_SEGACD_EUROPE, "sega_segacd_europe", tag, owner, clock, "sega_segacd_europe", __FILE__)
45{
46}
47
48
49TIMER_DEVICE_CALLBACK_MEMBER( sega_segacd_device::segacd_irq3_timer_callback )
50{
5128   CHECK_SCD_LV3_INTERRUPT
52   segacd_irq3_timer->adjust(SEGACD_IRQ3_TIMER_SPEED);
29   m_irq3_timer->adjust(SEGACD_IRQ3_TIMER_SPEED);
5330}
5431
5532
56TIMER_DEVICE_CALLBACK_MEMBER( sega_segacd_device::segacd_gfx_conversion_timer_callback )
33TIMER_DEVICE_CALLBACK_MEMBER( sega_segacd_device::stamp_timer_callback )
5734{
58   //printf("segacd_gfx_conversion_timer_callback\n");
35   //printf("stamp_timer_callback\n");
5936
6037   CHECK_SCD_LV1_INTERRUPT
6138
r29505r29506
6643}
6744
6845
69
70
71ADDRESS_MAP_START( segacd_map, AS_PROGRAM, 16, sega_segacd_device )
72   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_SHARE("segacd_program")
73
46static ADDRESS_MAP_START( segacd_map, AS_PROGRAM, 16, sega_segacd_device )
47   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_SHARE("prgram")
7448   AM_RANGE(0x080000, 0x0bffff) AM_READWRITE(segacd_sub_dataram_part1_r, segacd_sub_dataram_part1_w) AM_SHARE("dataram")
7549   AM_RANGE(0x0c0000, 0x0dffff) AM_READWRITE(segacd_sub_dataram_part2_r, segacd_sub_dataram_part2_w) //AM_SHARE("dataram2")
7650
77   AM_RANGE(0xfe0000, 0xfe3fff) AM_READWRITE(segacd_backupram_r,segacd_backupram_w) AM_SHARE("backupram") // backup RAM, odd bytes only!
51   AM_RANGE(0xfe0000, 0xfe3fff) AM_READWRITE8(backupram_r, backupram_w, 0x00ff) // backup RAM, odd bytes only!
7852
7953   AM_RANGE(0xff0000, 0xff001f) AM_DEVWRITE8("rfsnd", rf5c68_device, rf5c68_w, 0x00ff)  // PCM, RF5C164
8054   AM_RANGE(0xff0020, 0xff003f) AM_DEVREAD8("rfsnd", rf5c68_device, rf5c68_r, 0x00ff)
8155   AM_RANGE(0xff2000, 0xff3fff) AM_DEVREADWRITE8("rfsnd", rf5c68_device, rf5c68_mem_r, rf5c68_mem_w,0x00ff)  // PCM, RF5C164
8256
83
8457   AM_RANGE(0xff8000 ,0xff8001) AM_READWRITE(segacd_sub_led_ready_r, segacd_sub_led_ready_w)
8558   AM_RANGE(0xff8002 ,0xff8003) AM_READWRITE(segacd_sub_memory_mode_r, segacd_sub_memory_mode_w)
8659
r29505r29506
9871   AM_RANGE(0xff8036, 0xff8037) AM_DEVREADWRITE("tempcdc",lc89510_temp_device,segacd_cdd_ctrl_r,segacd_cdd_ctrl_w)
9972   AM_RANGE(0xff8038, 0xff8041) AM_DEVREAD8("tempcdc",lc89510_temp_device,segacd_cdd_rx_r,0xffff)
10073   AM_RANGE(0xff8042, 0xff804b) AM_DEVWRITE8("tempcdc",lc89510_temp_device,segacd_cdd_tx_w,0xffff)
101   AM_RANGE(0xff804c, 0xff804d) AM_READWRITE(segacd_font_color_r, segacd_font_color_w)
102   AM_RANGE(0xff804e, 0xff804f) AM_RAM AM_SHARE("segacd_font")
103   AM_RANGE(0xff8050, 0xff8057) AM_READ(segacd_font_converted_r)
74   AM_RANGE(0xff804c, 0xff804d) AM_READWRITE8(font_color_r, font_color_w, 0x00ff)
75   AM_RANGE(0xff804e, 0xff804f) AM_RAM AM_SHARE("font_bits")
76   AM_RANGE(0xff8050, 0xff8057) AM_READ(font_converted_r)
10477   AM_RANGE(0xff8058, 0xff8059) AM_READWRITE(segacd_stampsize_r, segacd_stampsize_w) // Stamp size
10578   AM_RANGE(0xff805a, 0xff805b) AM_READWRITE(segacd_stampmap_base_address_r, segacd_stampmap_base_address_w) // Stamp map base address
10679   AM_RANGE(0xff805c, 0xff805d) AM_READWRITE(segacd_imagebuffer_vcell_size_r, segacd_imagebuffer_vcell_size_w)// Image buffer V cell size
r29505r29506
12699#define SEGACD_NUM_TILES16 (0x40000/SEGACD_BYTES_PER_TILE16)
127100#define SEGACD_NUM_TILES32 (0x40000/SEGACD_BYTES_PER_TILE32)
128101
129#define _16x16_SEQUENCE_1  { 8,12,0,4,24,28,16,20, 512+8, 512+12, 512+0, 512+4, 512+24, 512+28, 512+16, 512+20 },
130#define _16x16_SEQUENCE_1_FLIP  { 512+20,512+16,512+28,512+24,512+4,512+0, 512+12,512+8, 20,16,28,24,4,0,12,8 },
102#define _16x16_SEQUENCE_1  { STEP8(0, 4), STEP8(512, 4) },
103#define _16x16_SEQUENCE_1_FLIP  { STEP8(512+28, -4), STEP8(28, -4) },
131104
132#define _16x16_SEQUENCE_2  { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32,10*32,11*32,12*32,13*32,14*32,15*32 },
133#define _16x16_SEQUENCE_2_FLIP  { 15*32, 14*32, 13*32, 12*32, 11*32, 10*32, 9*32, 8*32, 7*32, 6*32, 5*32, 4*32, 3*32, 2*32, 1*32, 0*32 },
105#define _16x16_SEQUENCE_2  { STEP16(0, 32) },
106#define _16x16_SEQUENCE_2_FLIP  { STEP16(15*32, -32) },
134107
135108
136109#define _16x16_START \
r29505r29506
153126   8*512 \
154127};
155128
129#define _32x32_SEQUENCE_1 { STEP8(0, 4), STEP8(1024, 4), STEP8(2048, 4), STEP8(3072, 4) },
130#define _32x32_SEQUENCE_1_FLIP { STEP8(3072+28, -4), STEP8(2048+28, -4), STEP8(1024+28, -4), STEP8(28, -4) },
156131
157#define _32x32_SEQUENCE_1 \
158   { 8,12,0,4,24,28,16,20, \
159   1024+8, 1024+12, 1024+0, 1024+4, 1024+24, 1024+28, 1024+16, 1024+20, \
160   2048+8, 2048+12, 2048+0, 2048+4, 2048+24, 2048+28, 2048+16, 2048+20, \
161   3072+8, 3072+12, 3072+0, 3072+4, 3072+24, 3072+28, 3072+16, 3072+20  \
162   },
163#define _32x32_SEQUENCE_1_FLIP \
164{ 3072+20, 3072+16, 3072+28, 3072+24, 3072+4, 3072+0, 3072+12, 3072+8, \
165   2048+20, 2048+16, 2048+28, 2048+24, 2048+4, 2048+0, 2048+12, 2048+8, \
166   1024+20, 1024+16, 1024+28, 1024+24, 1024+4, 1024+0, 1024+12, 1024+8, \
167   20, 16, 28, 24, 4, 0, 12, 8},
132#define _32x32_SEQUENCE_2 { STEP32(0, 32) },
133#define _32x32_SEQUENCE_2_FLIP { STEP32(31*32, -32) },
168134
169#define _32x32_SEQUENCE_2 \
170      { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, \
171      8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32, \
172      16*32,17*32,18*32,19*32,20*32,21*32,22*32,23*32, \
173      24*32,25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32},
174#define _32x32_SEQUENCE_2_FLIP \
175{ 31*32, 30*32, 29*32, 28*32, 27*32, 26*32, 25*32, 24*32, \
176   23*32, 22*32, 21*32, 20*32, 19*32, 18*32, 17*32, 16*32, \
177   15*32, 14*32, 13*32, 12*32, 11*32, 10*32, 9*32 , 8*32 , \
178   7*32 , 6*32 , 5*32 , 4*32 , 3*32 , 2*32 , 1*32 , 0*32},
179135
180136/* 16x16 decodes */
181137static const gfx_layout sega_16x16_r00_f0_layout =
r29505r29506
275231   _32x32_SEQUENCE_1_FLIP
276232_32x32_END
277233
278GFXDECODE_START( segacd )
279   GFXDECODE_ENTRY( NULL, 0, sega_16x16_r00_f0_layout, 0, 0 )
280   GFXDECODE_ENTRY( NULL, 0, sega_16x16_r01_f0_layout, 0, 0 )
281   GFXDECODE_ENTRY( NULL, 0, sega_16x16_r10_f0_layout, 0, 0 )
282   GFXDECODE_ENTRY( NULL, 0, sega_16x16_r11_f0_layout, 0, 0 )
283   GFXDECODE_ENTRY( NULL, 0, sega_16x16_r00_f1_layout, 0, 0 )
284   GFXDECODE_ENTRY( NULL, 0, sega_16x16_r11_f1_layout, 0, 0 )
285   GFXDECODE_ENTRY( NULL, 0, sega_16x16_r10_f1_layout, 0, 0 )
286   GFXDECODE_ENTRY( NULL, 0, sega_16x16_r01_f1_layout, 0, 0 )
287   GFXDECODE_ENTRY( NULL, 0, sega_32x32_r00_f0_layout, 0, 0 )
288   GFXDECODE_ENTRY( NULL, 0, sega_32x32_r01_f0_layout, 0, 0 )
289   GFXDECODE_ENTRY( NULL, 0, sega_32x32_r10_f0_layout, 0, 0 )
290   GFXDECODE_ENTRY( NULL, 0, sega_32x32_r11_f0_layout, 0, 0 )
291   GFXDECODE_ENTRY( NULL, 0, sega_32x32_r00_f1_layout, 0, 0 )
292   GFXDECODE_ENTRY( NULL, 0, sega_32x32_r11_f1_layout, 0, 0 )
293   GFXDECODE_ENTRY( NULL, 0, sega_32x32_r10_f1_layout, 0, 0 )
294   GFXDECODE_ENTRY( NULL, 0, sega_32x32_r01_f1_layout, 0, 0 )
234static GFXDECODE_START( segacd )
235   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_16x16_r00_f0_layout, 0, 0 )
236   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_16x16_r01_f0_layout, 0, 0 )
237   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_16x16_r10_f0_layout, 0, 0 )
238   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_16x16_r11_f0_layout, 0, 0 )
239   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_16x16_r00_f1_layout, 0, 0 )
240   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_16x16_r11_f1_layout, 0, 0 )
241   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_16x16_r10_f1_layout, 0, 0 )
242   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_16x16_r01_f1_layout, 0, 0 )
243   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_32x32_r00_f0_layout, 0, 0 )
244   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_32x32_r01_f0_layout, 0, 0 )
245   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_32x32_r10_f0_layout, 0, 0 )
246   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_32x32_r11_f0_layout, 0, 0 )
247   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_32x32_r00_f1_layout, 0, 0 )
248   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_32x32_r11_f1_layout, 0, 0 )
249   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_32x32_r10_f1_layout, 0, 0 )
250   GFXDECODE_DEVICE_RAM( "dataram", 0, sega_32x32_r01_f1_layout, 0, 0 )
295251GFXDECODE_END
296252
297253
298
299254static MACHINE_CONFIG_FRAGMENT( segacd_fragment )
300255
301256   MCFG_CPU_ADD("segacd_68k", M68000, SEGACD_CLOCK ) /* 12.5 MHz */
r29505r29506
308263   MCFG_SEGACD_HACK_SET_CDC_DO_DMA( sega_segacd_device, SegaCD_CDC_Do_DMA ) // hack
309264
310265   MCFG_TIMER_ADD_NONE("sw_timer") //stopwatch timer
311   MCFG_TIMER_DRIVER_ADD("irq3_timer", sega_segacd_device, segacd_irq3_timer_callback)
312   MCFG_TIMER_DRIVER_ADD("stamp_timer", sega_segacd_device, segacd_gfx_conversion_timer_callback)
313   MCFG_TIMER_DRIVER_ADD("scd_dma_timer", sega_segacd_device, scd_dma_timer_callback)
266   MCFG_TIMER_DRIVER_ADD("stamp_timer", sega_segacd_device, stamp_timer_callback)
267   MCFG_TIMER_DRIVER_ADD("irq3_timer", sega_segacd_device, irq3_timer_callback)
268   MCFG_TIMER_DRIVER_ADD("dma_timer", sega_segacd_device, dma_timer_callback)
314269
315   MCFG_GFXDECODE_ADD("gfxdecode", "^gen_vdp:palette", segacd) // FIXME
316
317270   MCFG_DEFAULT_LAYOUT( layout_megacd )
318271
319272   MCFG_RF5C68_ADD("rfsnd", SEGACD_CLOCK) // RF5C164!
r29505r29506
333286}
334287
335288
289sega_segacd_device::sega_segacd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
290   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
291      device_gfx_interface(mconfig, *this, GFXDECODE_NAME( segacd )),
292      m_scdcpu(*this, "segacd_68k"),
293      m_rfsnd(*this, "rfsnd"),
294      m_lc89510_temp(*this, "tempcdc"),
295      m_stopwatch_timer(*this, "sw_timer"),
296      m_stamp_timer(*this, "stamp_timer"),
297      m_irq3_timer(*this, "irq3_timer"),
298      m_dma_timer(*this, "dma_timer"),
299      m_prgram(*this, "prgram"),
300      m_dataram(*this, "dataram"),
301      m_font_bits(*this, "font_bits")
302{
303}
336304
305sega_segacd_us_device::sega_segacd_us_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
306   : sega_segacd_device(mconfig, SEGA_SEGACD_US, "sega_segacd_us", tag, owner, clock, "sega_segacd_us", __FILE__)
307{
308}
337309
310sega_segacd_japan_device::sega_segacd_japan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
311   : sega_segacd_device(mconfig, SEGA_SEGACD_JAPAN, "sega_segacd_japan", tag, owner, clock, "sega_segacd_japan", __FILE__)
312{
313}
338314
315sega_segacd_europe_device::sega_segacd_europe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
316   : sega_segacd_device(mconfig, SEGA_SEGACD_EUROPE, "sega_segacd_europe", tag, owner, clock, "sega_segacd_europe", __FILE__)
317{
318}
339319
340inline void sega_segacd_device::write_pixel(running_machine& machine, UINT8 pix, int pixeloffset )
320
321inline void sega_segacd_device::write_pixel(UINT8 pix, int pixeloffset)
341322{
342323   int shift = 12-(4*(pixeloffset&0x3));
343324   UINT16 datamask = (0x000f) << shift;
r29505r29506
350331   switch (segacd_memory_priority_mode)
351332   {
352333      case 0x00: // normal write, just write the data
353         segacd_dataram[offset] = segacd_dataram[offset] &~ datamask;
354         segacd_dataram[offset] |= pix << shift;
334         m_dataram[offset] = m_dataram[offset] &~ datamask;
335         m_dataram[offset] |= pix << shift;
355336         break;
356337
357338      case 0x01: // underwrite, only write if the existing data is 0
358         if ((segacd_dataram[offset]&datamask) == 0x0000)
339         if ((m_dataram[offset]&datamask) == 0x0000)
359340         {
360            segacd_dataram[offset] = segacd_dataram[offset] &~ datamask;
361            segacd_dataram[offset] |= pix << shift;
341            m_dataram[offset] = m_dataram[offset] &~ datamask;
342            m_dataram[offset] |= pix << shift;
362343         }
363344         break;
364345
365346      case 0x02: // overwrite, only write non-zero data
366347         if (pix)
367348         {
368            segacd_dataram[offset] = segacd_dataram[offset] &~ datamask;
369            segacd_dataram[offset] |= pix << shift;
349            m_dataram[offset] = m_dataram[offset] &~ datamask;
350            m_dataram[offset] |= pix << shift;
370351         }
371352         break;
372353
373354      default:
374355      case 0x03:
375         pix = machine.rand() & 0x000f;
376         segacd_dataram[offset] = segacd_dataram[offset] &~ datamask;
377         segacd_dataram[offset] |= pix << shift;
356         pix = machine().rand() & 0x000f;
357         m_dataram[offset] = m_dataram[offset] &~ datamask;
358         m_dataram[offset] |= pix << shift;
378359         break;
379360
380361   }
r29505r29506
393374
394375   offset &=0x1ffff;
395376
396   return segacd_dataram[offset];
377   return m_dataram[offset];
397378}
398379
399380
r29505r29506
413394      switch (segacd_memory_priority_mode)
414395      {
415396         case 0x00: // normal write, just write the data
416            COMBINE_DATA(&segacd_dataram[offset]);
397            COMBINE_DATA(&m_dataram[offset]);
417398            break;
418399
419400         case 0x01: // underwrite, only write if the existing data is 0
420401            if (ACCESSING_BITS_8_15)
421402            {
422               if ((segacd_dataram[offset]&0xf000) == 0x0000) segacd_dataram[offset] |= (data)&0xf000;
423               if ((segacd_dataram[offset]&0x0f00) == 0x0000) segacd_dataram[offset] |= (data)&0x0f00;
403               if ((m_dataram[offset]&0xf000) == 0x0000) m_dataram[offset] |= (data)&0xf000;
404               if ((m_dataram[offset]&0x0f00) == 0x0000) m_dataram[offset] |= (data)&0x0f00;
424405            }
425406            if (ACCESSING_BITS_0_7)
426407            {
427               if ((segacd_dataram[offset]&0x00f0) == 0x0000) segacd_dataram[offset] |= (data)&0x00f0;
428               if ((segacd_dataram[offset]&0x000f) == 0x0000) segacd_dataram[offset] |= (data)&0x000f;
408               if ((m_dataram[offset]&0x00f0) == 0x0000) m_dataram[offset] |= (data)&0x00f0;
409               if ((m_dataram[offset]&0x000f) == 0x0000) m_dataram[offset] |= (data)&0x000f;
429410            }
430411            break;
431412
432413         case 0x02: // overwrite, only write non-zero data
433414            if (ACCESSING_BITS_8_15)
434415            {
435               if ((data)&0xf000) segacd_dataram[offset] = (segacd_dataram[offset] & 0x0fff) | ((data)&0xf000);
436               if ((data)&0x0f00) segacd_dataram[offset] = (segacd_dataram[offset] & 0xf0ff) | ((data)&0x0f00);
416               if ((data)&0xf000) m_dataram[offset] = (m_dataram[offset] & 0x0fff) | ((data)&0xf000);
417               if ((data)&0x0f00) m_dataram[offset] = (m_dataram[offset] & 0xf0ff) | ((data)&0x0f00);
437418            }
438419            if (ACCESSING_BITS_0_7)
439420            {
440               if ((data)&0x00f0) segacd_dataram[offset] = (segacd_dataram[offset] & 0xff0f) | ((data)&0x00f0);
441               if ((data)&0x000f) segacd_dataram[offset] = (segacd_dataram[offset] & 0xfff0) | ((data)&0x000f);
421               if ((data)&0x00f0) m_dataram[offset] = (m_dataram[offset] & 0xff0f) | ((data)&0x00f0);
422               if ((data)&0x000f) m_dataram[offset] = (m_dataram[offset] & 0xfff0) | ((data)&0x000f);
442423            }
443424            break;
444425
445426         default:
446427         case 0x03: // invalid?
447            COMBINE_DATA(&segacd_dataram[offset]);
428            COMBINE_DATA(&m_dataram[offset]);
448429            break;
449430
450431      }
451432   }
452433   else
453434   {
454      COMBINE_DATA(&segacd_dataram[offset]);
435      COMBINE_DATA(&m_dataram[offset]);
455436   }
456437}
457438
r29505r29506
731712READ16_MEMBER( sega_segacd_device::scd_4m_prgbank_ram_r )
732713{
733714   UINT16 realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset;
734   return segacd_4meg_prgram[realoffset];
715   return m_prgram[realoffset];
735716
736717}
737718
r29505r29506
742723   // todo:
743724   // check for write protection? (or does that only apply to writes on the SubCPU side?
744725
745   COMBINE_DATA(&segacd_4meg_prgram[realoffset]);
726   COMBINE_DATA(&m_prgram[realoffset]);
746727
747728}
748729
r29505r29506
797778      // is this correct?
798779      if (!(scd_rammode&1))
799780      {
800         //printf("segacd_main_dataram_part1_r in mode 0 %08x %04x\n", offset*2, segacd_dataram[offset]);
781         //printf("segacd_main_dataram_part1_r in mode 0 %08x %04x\n", offset*2, m_dataram[offset]);
801782
802         return segacd_dataram[offset];
783         return m_dataram[offset];
803784
804785      }
805786      else
r29505r29506
864845      // is this correct?
865846      if (!(scd_rammode&1))
866847      {
867         COMBINE_DATA(&segacd_dataram[offset]);
868         segacd_mark_tiles_dirty(space.machine(), offset);
848         COMBINE_DATA(&m_dataram[offset]);
849         segacd_mark_tiles_dirty(offset);
869850      }
870851      else
871852      {
r29505r29506
925906}
926907
927908
928
929
930
931
932void sega_segacd_device::segacd_mark_tiles_dirty(running_machine& machine, int offset)
909void sega_segacd_device::segacd_mark_tiles_dirty(int offset)
933910{
934   m_gfxdecode->gfx(0)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
935   m_gfxdecode->gfx(1)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
936   m_gfxdecode->gfx(2)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
937   m_gfxdecode->gfx(3)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
938   m_gfxdecode->gfx(4)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
939   m_gfxdecode->gfx(5)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
940   m_gfxdecode->gfx(6)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
941   m_gfxdecode->gfx(7)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
911   gfx(0)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
912   gfx(1)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
913   gfx(2)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
914   gfx(3)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
915   gfx(4)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
916   gfx(5)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
917   gfx(6)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
918   gfx(7)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
942919
943   m_gfxdecode->gfx(8)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
944   m_gfxdecode->gfx(9)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
945   m_gfxdecode->gfx(10)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
946   m_gfxdecode->gfx(11)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
947   m_gfxdecode->gfx(12)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
948   m_gfxdecode->gfx(13)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
949   m_gfxdecode->gfx(14)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
950   m_gfxdecode->gfx(15)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
920   gfx(8)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
921   gfx(9)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
922   gfx(10)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
923   gfx(11)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
924   gfx(12)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
925   gfx(13)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
926   gfx(14)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
927   gfx(15)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
951928}
952929
953930
r29505r29506
964941   tile_region = 0; // 16x16 tiles
965942   int tile_base = (segacd_stampmap_base_address & 0xff80) * 4;
966943
967   int tiledat = segacd_dataram[((tile_base>>1)+tile_index) & 0x1ffff];
944   int tiledat = m_dataram[((tile_base>>1)+tile_index) & 0x1ffff];
968945   tileno = tiledat & 0x07ff;
969946   int xflip =  tiledat & 0x8000;
970947   int roll  =  (tiledat & 0x6000)>>13;
r29505r29506
978955   tile_region = 8; // 32x32 tiles
979956   int tile_base = (segacd_stampmap_base_address & 0xffe0) * 4;
980957
981   int tiledat = segacd_dataram[((tile_base>>1)+tile_index) & 0x1ffff];
958   int tiledat = m_dataram[((tile_base>>1)+tile_index) & 0x1ffff];
982959   tileno = (tiledat & 0x07fc)>>2;
983960   int xflip =  tiledat & 0x8000;
984961   int roll  =  (tiledat & 0x6000)>>13;
r29505r29506
993970   tile_region = 0; // 16x16 tiles
994971   int tile_base = (0x8000) * 4; // fixed address in this mode
995972
996   int tiledat = segacd_dataram[((tile_base>>1)+tile_index) & 0x1ffff];
973   int tiledat = m_dataram[((tile_base>>1)+tile_index) & 0x1ffff];
997974   tileno = tiledat & 0x07ff;
998975   int xflip =  tiledat & 0x8000;
999976   int roll  =  (tiledat & 0x6000)>>13;
r29505r29506
1008985   tile_region = 8; // 32x32 tiles
1009986   int tile_base = (segacd_stampmap_base_address & 0xe000) * 4;
1010987
1011   int tiledat = segacd_dataram[((tile_base>>1)+tile_index) & 0x1ffff];
988   int tiledat = m_dataram[((tile_base>>1)+tile_index) & 0x1ffff];
1012989   tileno = (tiledat & 0x07fc)>>2;
1013990   int xflip =  tiledat & 0x8000;
1014991   int roll  =  (tiledat & 0x6000)>>13;
r29505r29506
10521029
10531030// non-tilemap functions to get a pixel from a 'tilemap' based on the above, but looking up each pixel, as to avoid the heavy cache bitmap
10541031
1055inline UINT8 sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(running_machine& machine, int xpos, int ypos)
1032inline UINT8 sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos)
10561033{
10571034   const int tilesize = 4; // 0xf pixels
10581035   const int tilemapsize = 0x0f;
r29505r29506
10821059   int tile_region, tileno;
10831060   SCD_GET_TILE_INFO_16x16_1x1(tile_region,tileno,(int)tile_index);
10841061
1085   gfx_element *gfx = m_gfxdecode->gfx(tile_region);
1086   tileno %= gfx->elements();
1062   tileno %= gfx(tile_region)->elements();
10871063
10881064   if (tileno==0) return 0x00;
10891065
1090   const UINT8* srcdata = gfx->get_data(tileno);
1066   const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
10911067   return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
10921068}
10931069
1094inline UINT8 sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(running_machine& machine, int xpos, int ypos)
1070inline UINT8 sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos)
10951071{
10961072   const int tilesize = 5; // 0x1f pixels
10971073   const int tilemapsize = 0x07;
r29505r29506
11211097   int tile_region, tileno;
11221098   SCD_GET_TILE_INFO_32x32_1x1(tile_region,tileno,(int)tile_index);
11231099
1124   gfx_element *gfx = m_gfxdecode->gfx(tile_region);
1125   tileno %= gfx->elements();
1100   tileno %= gfx(tile_region)->elements();
11261101
11271102   if (tileno==0) return 0x00; // does this apply in this mode?
11281103
1129   const UINT8* srcdata = gfx->get_data(tileno);
1104   const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
11301105   return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
11311106}
11321107
1133inline UINT8 sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(running_machine& machine, int xpos, int ypos)
1108inline UINT8 sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos)
11341109{
11351110   const int tilesize = 4; // 0xf pixels
11361111   const int tilemapsize = 0xff;
r29505r29506
11601135   int tile_region, tileno;
11611136   SCD_GET_TILE_INFO_16x16_16x16(tile_region,tileno,(int)tile_index);
11621137
1163   gfx_element *gfx = m_gfxdecode->gfx(tile_region);
1164   tileno %= gfx->elements();
1138   tileno %= gfx(tile_region)->elements();
11651139
11661140   if (tileno==0) return 0x00; // does this apply in this mode
11671141
1168   const UINT8* srcdata = gfx->get_data(tileno);
1142   const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
11691143   return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
11701144}
11711145
1172inline UINT8 sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(running_machine& machine, int xpos, int ypos)
1146inline UINT8 sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos)
11731147{
11741148   const int tilesize = 5; // 0x1f pixels
11751149   const int tilemapsize = 0x7f;
r29505r29506
11991173   int tile_region, tileno;
12001174   SCD_GET_TILE_INFO_32x32_16x16(tile_region,tileno,(int)tile_index);
12011175
1202   gfx_element *gfx = m_gfxdecode->gfx(tile_region);
1203   tileno %= gfx->elements();
1176   tileno %= gfx(tile_region)->elements();
12041177
12051178   if (tileno==0) return 0x00;
12061179
1207   const UINT8* srcdata = gfx->get_data(tileno);
1180   const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
12081181   return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
12091182}
12101183
r29505r29506
12131186WRITE16_MEMBER( sega_segacd_device::segacd_stopwatch_timer_w )
12141187{
12151188   if(data == 0)
1216      stopwatch_timer->reset();
1189      m_stopwatch_timer->reset();
12171190   else
12181191      printf("Stopwatch timer %04x\n",data);
12191192}
12201193
12211194READ16_MEMBER( sega_segacd_device::segacd_stopwatch_timer_r )
12221195{
1223   INT32 result = (stopwatch_timer->time_elapsed() * ATTOSECONDS_TO_HZ(ATTOSECONDS_IN_USEC(30.72))).as_double();
1196   INT32 result = (m_stopwatch_timer->time_elapsed() * ATTOSECONDS_TO_HZ(ATTOSECONDS_IN_USEC(30.72))).as_double();
12241197
12251198   return result & 0xfff;
12261199}
r29505r29506
12791252   {
12801253      // is this correct?
12811254      if (scd_rammode&1)
1282         return segacd_dataram[offset];
1255         return m_dataram[offset];
12831256      else
12841257      {
12851258         //printf("Illegal: segacd_sub_dataram_part1_r in mode 0 without permission\n");
r29505r29506
13221295      // is this correct?
13231296      if (scd_rammode&1)
13241297      {
1325         COMBINE_DATA(&segacd_dataram[offset]);
1326         segacd_mark_tiles_dirty(space.machine(), offset);
1298         COMBINE_DATA(&m_dataram[offset]);
1299         segacd_mark_tiles_dirty(offset);
13271300      }
13281301      else
13291302      {
r29505r29506
14521425// the lower 3 bits of segacd_imagebuffer_hdot_size are set
14531426
14541427// this really needs to be doing it's own lookups rather than depending on the inefficient MAME cache..
1455inline UINT8 sega_segacd_device::read_pixel_from_stampmap( running_machine& machine, bitmap_ind16* srcbitmap, int x, int y)
1428inline UINT8 sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y)
14561429{
14571430/*
14581431    if (!srcbitmap)
r29505r29506
14701443
14711444   switch (segacd_get_active_stampmap_tilemap()&3)
14721445   {
1473      case 0x00: return get_stampmap_16x16_1x1_tile_info_pixel( machine, x, y );
1474      case 0x01: return get_stampmap_32x32_1x1_tile_info_pixel( machine, x, y );
1475      case 0x02: return get_stampmap_16x16_16x16_tile_info_pixel( machine, x, y );
1476      case 0x03: return get_stampmap_32x32_16x16_tile_info_pixel( machine, x, y );
1446      case 0x00: return get_stampmap_16x16_1x1_tile_info_pixel( x, y );
1447      case 0x01: return get_stampmap_32x32_1x1_tile_info_pixel( x, y );
1448      case 0x02: return get_stampmap_16x16_16x16_tile_info_pixel( x, y );
1449      case 0x03: return get_stampmap_32x32_16x16_tile_info_pixel( x, y );
14771450   }
14781451
14791452   return 0;
r29505r29506
15041477      segacd_conversion_active = 1;
15051478
15061479      // todo: proper time calculation
1507      segacd_gfx_conversion_timer->adjust(attotime::from_nsec(30000));
1480      m_stamp_timer->adjust(attotime::from_nsec(30000));
15081481
15091482
15101483
r29505r29506
15211494         INT16 tilemapxoffs,tilemapyoffs;
15221495         INT16 deltax,deltay;
15231496
1524         tilemapxoffs = segacd_dataram[(currbase+0x0)>>1];
1525         tilemapyoffs = segacd_dataram[(currbase+0x2)>>1];
1526         deltax = segacd_dataram[(currbase+0x4)>>1]; // x-zoom
1527         deltay = segacd_dataram[(currbase+0x6)>>1]; // rotation
1497         tilemapxoffs = m_dataram[(currbase+0x0)>>1];
1498         tilemapyoffs = m_dataram[(currbase+0x2)>>1];
1499         deltax = m_dataram[(currbase+0x4)>>1]; // x-zoom
1500         deltay = m_dataram[(currbase+0x6)>>1]; // rotation
15281501
15291502         //printf("%06x:  %04x (%d) %04x (%d) %04x %04x\n", currbase, tilemapxoffs, tilemapxoffs>>3, tilemapyoffs, tilemapyoffs>>3, deltax, deltay);
15301503
r29505r29506
15371510            //int i;
15381511            UINT8 pix = 0x0;
15391512
1540            pix = read_pixel_from_stampmap(space.machine(), srcbitmap, xbase>>(3+8), ybase>>(3+8));
1513            pix = read_pixel_from_stampmap(srcbitmap, xbase>>(3+8), ybase>>(3+8));
15411514
15421515            xbase += deltax;
15431516            ybase += deltay;
r29505r29506
15571530
15581531            offset+=countx & 0x7;
15591532
1560            write_pixel( space.machine(), pix, offset );
1533            write_pixel( pix, offset );
15611534
1562            segacd_mark_tiles_dirty(space.machine(), (offset>>3));
1563            segacd_mark_tiles_dirty(space.machine(), (offset>>3)+1);
1535            segacd_mark_tiles_dirty(offset>>3);
1536            segacd_mark_tiles_dirty((offset>>3)+1);
15641537
15651538         }
15661539
r29505r29506
16481621
16491622READ16_MEMBER( sega_segacd_device::segacd_irq3timer_r )
16501623{
1651   return segacd_irq3_timer_reg; // always returns value written, not current counter!
1624   return m_irq3_timer_reg; // always returns value written, not current counter!
16521625}
16531626
16541627
r29505r29506
16561629{
16571630   if (ACCESSING_BITS_0_7)
16581631   {
1659      segacd_irq3_timer_reg = data & 0xff;
1632      m_irq3_timer_reg = data & 0xff;
16601633
16611634      // time = reg * 30.72 us
16621635
1663      if (segacd_irq3_timer_reg)
1664         segacd_irq3_timer->adjust(SEGACD_IRQ3_TIMER_SPEED);
1636      if (m_irq3_timer_reg)
1637         m_irq3_timer->adjust(SEGACD_IRQ3_TIMER_SPEED);
16651638      else
1666         segacd_irq3_timer->adjust(attotime::never);
1639         m_irq3_timer->adjust(attotime::never);
16671640
1668      //printf("segacd_irq3timer_w %02x\n", segacd_irq3_timer_reg);
1641      //printf("segacd_irq3timer_w %02x\n", segacd_m_irq3_timer_reg);
16691642   }
16701643}
16711644
16721645
1673
1674
1675
1676
1677
1678READ16_MEMBER( sega_segacd_device::segacd_backupram_r )
1646READ8_MEMBER( sega_segacd_device::backupram_r )
16791647{
1680   if(ACCESSING_BITS_8_15 && !(space.debugger_access()))
1681      printf("Warning: read to backupram even bytes! [%04x]\n",offset);
1682
1683   return segacd_backupram[offset] & 0xff;
1648   return m_backupram[offset];
16841649}
16851650
1686WRITE16_MEMBER( sega_segacd_device::segacd_backupram_w )
1651WRITE8_MEMBER( sega_segacd_device::backupram_w )
16871652{
1688   if(ACCESSING_BITS_0_7)
1689      segacd_backupram[offset] = data;
1690
1691   if(ACCESSING_BITS_8_15 && !(space.debugger_access()))
1692      printf("Warning: write to backupram even bytes! [%04x] %02x\n",offset,data);
1653   m_backupram[offset] = data;
16931654}
16941655
1695READ16_MEMBER( sega_segacd_device::segacd_font_color_r )
1656READ8_MEMBER( sega_segacd_device::font_color_r )
16961657{
1697   return segacd_font_color;
1658   return m_font_color;
16981659}
16991660
1700WRITE16_MEMBER( sega_segacd_device::segacd_font_color_w )
1661WRITE8_MEMBER( sega_segacd_device::font_color_w )
17011662{
1702   if (ACCESSING_BITS_0_7)
1703   {
1704      segacd_font_color = data & 0xff;
1705   }
1663   m_font_color = data;
17061664}
17071665
1708READ16_MEMBER( sega_segacd_device::segacd_font_converted_r )
1666READ16_MEMBER( sega_segacd_device::font_converted_r )
17091667{
1710   int scbg = (segacd_font_color & 0x0f);
1711   int scfg = (segacd_font_color & 0xf0)>>4;
1668   int scbg = (m_font_color & 0x0f);
1669   int scfg = (m_font_color & 0xf0)>>4;
17121670   UINT16 retdata = 0;
17131671   int bit;
17141672
17151673   for (bit=0;bit<4;bit++)
17161674   {
1717      if (*segacd_font_bits&((0x1000>>offset*4)<<bit))
1675      if (*m_font_bits&((0x1000>>offset*4)<<bit))
17181676         retdata |= scfg << (bit*4);
17191677      else
17201678         retdata |= scbg << (bit*4);
r29505r29506
17291687
17301688void sega_segacd_device::device_start()
17311689{
1732   if (!m_gfxdecode->started())
1733      throw device_missing_dependencies();
1734
1735   segacd_gfx_conversion_timer = machine().device<timer_device>(":segacd:stamp_timer");
1736   segacd_irq3_timer = machine().device<timer_device>(":segacd:irq3_timer");
1737   scd_dma_timer = machine().device<timer_device>(":segacd:scd_dma_timer");
1738
17391690   address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
17401691
1741   segacd_font_bits = reinterpret_cast<UINT16 *>(memshare(":segacd:segacd_font")->ptr());
1742   segacd_backupram = reinterpret_cast<UINT16 *>(memshare(":segacd:backupram")->ptr());
1743   segacd_dataram = reinterpret_cast<UINT16 *>(memshare(":segacd:dataram")->ptr());
1744//  segacd_dataram2 = reinterpret_cast<UINT16 *>(memshare(":segacd:dataram2")->ptr());
1745   segacd_4meg_prgram = reinterpret_cast<UINT16 *>(memshare(":segacd:segacd_program")->ptr());
1692   m_backupram.resize(0x2000);
1693   subdevice<nvram_device>("backupram")->set_base(m_backupram, 0x2000);
17461694
17471695   segacd_4meg_prgbank = 0;
17481696
1749
17501697   space.unmap_readwrite        (0x020000,0x3fffff);
17511698
1752
17531699   space.install_read_handler (0x0020000, 0x003ffff, read16_delegate(FUNC(sega_segacd_device::scd_4m_prgbank_ram_r),this) );
17541700   space.install_write_handler (0x0020000, 0x003ffff, write16_delegate(FUNC(sega_segacd_device::scd_4m_prgbank_ram_w),this) );
17551701
r29505r29506
17751721
17761722   space.install_read_handler (0x0000070, 0x0000073, read16_delegate(FUNC(sega_segacd_device::scd_hint_vector_r),this) );
17771723
1778   /* create the char set (gfx will then be updated dynamically from RAM) */
1779   for (int i = 0; i < 16; i++)
1780      m_gfxdecode->gfx(i)->set_source((UINT8 *)segacd_dataram);
1724   segacd_stampmap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(sega_segacd_device::get_stampmap_16x16_1x1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
1725   segacd_stampmap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(sega_segacd_device::get_stampmap_32x32_1x1_tile_info),this), TILEMAP_SCAN_ROWS, 32, 32, 8, 8);
1726   segacd_stampmap[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(sega_segacd_device::get_stampmap_16x16_16x16_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 256, 256); // 128kb!
1727   segacd_stampmap[3] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(sega_segacd_device::get_stampmap_32x32_16x16_tile_info),this), TILEMAP_SCAN_ROWS, 32, 32, 128, 128); // 32kb!
17811728
1782   segacd_stampmap[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sega_segacd_device::get_stampmap_16x16_1x1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 16, 16);
1783   segacd_stampmap[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sega_segacd_device::get_stampmap_32x32_1x1_tile_info),this), TILEMAP_SCAN_ROWS, 32, 32, 8, 8);
1784   segacd_stampmap[2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sega_segacd_device::get_stampmap_16x16_16x16_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 256, 256); // 128kb!
1785   segacd_stampmap[3] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sega_segacd_device::get_stampmap_32x32_16x16_tile_info),this), TILEMAP_SCAN_ROWS, 32, 32, 128, 128); // 32kb!
1786
17871729   // todo register save state stuff
17881730}
17891731
r29505r29506
18091751   scd_rammode = 0;
18101752   scd_mode_dmna_ret_flags = 0x5421;
18111753
1812   lc89510_temp = machine().device<lc89510_temp_device>(":segacd:tempcdc");
1813   lc89510_temp->reset_cd();
1754   m_lc89510_temp->reset_cd();
18141755   m_dmaaddr = 0;
1815   scd_dma_timer->adjust(attotime::zero);
1756   m_dma_timer->adjust(attotime::zero);
18161757
1817   stopwatch_timer = machine().device<timer_device>(":segacd:sw_timer");
1818
18191758   m_total_scanlines = 262;
18201759
18211760   // HACK!!!! timegal, anettfut, roadaven end up with the SubCPU waiting in a loop for *something*
r29505r29506
18481787   segacd_redled = 0;
18491788   segacd_greenled = 0;
18501789   segacd_ready = 1; // actually set 100ms after startup?
1851   segacd_irq3_timer_reg = 0;
1790   m_irq3_timer_reg = 0;
18521791
1853   segacd_gfx_conversion_timer->adjust(attotime::never);
1854   segacd_irq3_timer->adjust(attotime::never);
1792   m_stamp_timer->adjust(attotime::never);
1793   m_irq3_timer->adjust(attotime::never);
18551794
18561795}
18571796
18581797
18591798// todo: tidy up
1860TIMER_DEVICE_CALLBACK_MEMBER( sega_segacd_device::scd_dma_timer_callback )
1799TIMER_DEVICE_CALLBACK_MEMBER( sega_segacd_device::dma_timer_callback )
18611800{
18621801   // todo: accurate timing of this!
18631802
18641803   #define RATE 256
1865   lc89510_temp->CDC_Do_DMA(machine(), RATE);
1804   m_lc89510_temp->CDC_Do_DMA(machine(), RATE);
18661805
18671806   // timed reset of flags
18681807   scd_mode_dmna_ret_flags |= 0x0021;
18691808
1870   scd_dma_timer->adjust(attotime::from_hz(m_framerate) / m_total_scanlines);
1809   m_dma_timer->adjust(attotime::from_hz(m_framerate) / m_total_scanlines);
18711810
18721811}
18731812
r29505r29506
18751814void sega_segacd_device::SegaCD_CDC_Do_DMA(int &dmacount, UINT8 *CDC_BUFFER, UINT16 &dma_addrc, UINT16 &destination )
18761815{
18771816   int length = dmacount;
1878   UINT8 *dest;
1817   UINT16 *dest;
18791818   int srcoffset = 0;
18801819   int dstoffset = 0;
18811820   address_space& space = m_scdcpu->space(AS_PROGRAM);
r29505r29506
18991838
19001839      if (destination==DMA_PRG)
19011840      {
1902         dest = (UINT8 *) segacd_4meg_prgram;
1841         dest = m_prgram;
19031842      }
19041843      else if (destination==DMA_WRAM)
19051844      {
1906         dest = (UINT8*)segacd_dataram;
1845         dest = m_dataram;
19071846      }
19081847      else if (destination==DMA_PCM)
19091848      {
r29505r29506
19161855
19171856      if (PCM_DMA)
19181857      {
1919         space.write_byte(0xff2000+(((dstoffset*2)+1)&0x1fff),data >> 8);
1920         space.write_byte(0xff2000+(((dstoffset*2)+3)&0x1fff),data & 0xff);
1858         m_rfsnd->rf5c68_mem_w(space, dstoffset & 0xfff, data >> 8);
1859         m_rfsnd->rf5c68_mem_w(space, (dstoffset+1) & 0xfff, data);
19211860      //  printf("PCM_DMA writing %04x %04x\n",0xff2000+(dstoffset*2), data);
19221861      }
19231862      else
r29505r29506
19301869               {
19311870                  dstoffset &= 0x3ffff;
19321871
1933                  dest[dstoffset+1] = data >>8;
1934                  dest[dstoffset+0] = data&0xff;
1872                  dest[dstoffset/2] = data;
19351873
1936                  segacd_mark_tiles_dirty(space.machine(), dstoffset/2);
1874                  segacd_mark_tiles_dirty(dstoffset/2);
19371875               }
19381876               else
19391877               {
r29505r29506
19531891            else
19541892            {
19551893               // main ram
1956               dest[dstoffset+1] = data >>8;
1957               dest[dstoffset+0] = data&0xff;
1894               dest[dstoffset/2] = data;
19581895            }
19591896
19601897         }
branches/new_menus/src/mess/machine/megacd.h
r29505r29506
33#include "cpu/m68000/m68000.h"
44#include "machine/lc89510.h"
55#include "machine/megacdcd.h"
6#include "sound/rf5c68.h"
67
78#define SEGACD_CLOCK      12500000
89
r29505r29506
1516
1617// irq3 timer
1718#define CHECK_SCD_LV3_INTERRUPT \
18   if (lc89510_temp->get_segacd_irq_mask() & 0x08) \
19   if (m_lc89510_temp->get_segacd_irq_mask() & 0x08) \
1920   { \
2021      m_scdcpu->set_input_line(3, HOLD_LINE); \
2122   }
2223// from master
2324#define CHECK_SCD_LV2_INTERRUPT \
24   if (lc89510_temp->get_segacd_irq_mask() & 0x04) \
25   if (m_lc89510_temp->get_segacd_irq_mask() & 0x04) \
2526   { \
2627      m_scdcpu->set_input_line(2, HOLD_LINE); \
2728   }
2829
2930// gfx convert
3031#define CHECK_SCD_LV1_INTERRUPT \
31   if (lc89510_temp->get_segacd_irq_mask() & 0x02) \
32   if (m_lc89510_temp->get_segacd_irq_mask() & 0x02) \
3233   { \
3334      m_scdcpu->set_input_line(1, HOLD_LINE); \
3435   }
3536
36#define SEGACD_IRQ3_TIMER_SPEED (attotime::from_nsec(segacd_irq3_timer_reg*30720))
37#define SEGACD_IRQ3_TIMER_SPEED (attotime::from_nsec(m_irq3_timer_reg*30720))
3738
3839
39class sega_segacd_device : public device_t
40class sega_segacd_device : public device_t, public device_gfx_interface
4041{
4142public:
4243   sega_segacd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
4344
4445   required_device<cpu_device> m_scdcpu;
45   lc89510_temp_device *lc89510_temp;
46   required_device<rf5c68_device> m_rfsnd;
47   required_device<lc89510_temp_device> m_lc89510_temp;
48   required_device<timer_device> m_stopwatch_timer;
49   required_device<timer_device> m_stamp_timer;
50   required_device<timer_device> m_irq3_timer;
51   required_device<timer_device> m_dma_timer;
52   //required_device<timer_device> m_hock_timer;
4653
47   UINT16 *segacd_backupram;
48   timer_device *stopwatch_timer;
49   UINT8 segacd_font_color;
50   UINT16* segacd_font_bits;
54   required_shared_ptr<UINT16> m_prgram;
55   required_shared_ptr<UINT16> m_dataram;
56   required_shared_ptr<UINT16> m_font_bits;
57
58   // can't use a memshare because it's 8-bit RAM in a 16-bit address space
59   dynamic_array<UINT8> m_backupram;
60
61   UINT8 m_font_color;
62
5163   UINT16 scd_rammode;
5264   UINT32 scd_mode_dmna_ret_flags ;
5365
54   timer_device *segacd_gfx_conversion_timer;
55   timer_device *segacd_irq3_timer;
56   //timer_device *segacd_hock_timer;
57
58   UINT16* segacd_4meg_prgram;  // pointer to SubCPU PrgRAM
59   UINT16* segacd_dataram;
60   UINT16* segacd_dataram2;
6166   tilemap_t    *segacd_stampmap[4];
6267
6368
r29505r29506
8489   int segacd_redled;// = 0;
8590   int segacd_greenled;// = 0;
8691   int segacd_ready;// = 1; // actually set 100ms after startup?
87   UINT16 segacd_irq3_timer_reg;
92   UINT8 m_irq3_timer_reg;
8893
8994
90   TIMER_DEVICE_CALLBACK_MEMBER( segacd_irq3_timer_callback );
91   TIMER_DEVICE_CALLBACK_MEMBER( segacd_gfx_conversion_timer_callback );
95   TIMER_DEVICE_CALLBACK_MEMBER( irq3_timer_callback );
96   TIMER_DEVICE_CALLBACK_MEMBER( stamp_timer_callback );
9297
9398   UINT16 handle_segacd_sub_int_callback(int irqline);
9499
95   inline void write_pixel(running_machine& machine, UINT8 pix, int pixeloffset );
100   inline void write_pixel(UINT8 pix, int pixeloffset);
96101   UINT16 segacd_1meg_mode_word_read(int offset, UINT16 mem_mask);
97102   void segacd_1meg_mode_word_write(int offset, UINT16 data, UINT16 mem_mask, int use_pm);
98103
r29505r29506
106111   int m_base_total_scanlines;
107112   int m_total_scanlines;
108113
109   void segacd_mark_tiles_dirty(running_machine& machine, int offset);
114   void segacd_mark_tiles_dirty(int offset);
110115   int segacd_get_active_stampmap_tilemap(void);
111116
112117   // set some variables at start, depending on region (shall be moved to a device interface?)
r29505r29506
124129   TILE_GET_INFO_MEMBER( get_stampmap_16x16_16x16_tile_info );
125130   TILE_GET_INFO_MEMBER( get_stampmap_32x32_16x16_tile_info );
126131
127   UINT8 get_stampmap_16x16_1x1_tile_info_pixel(running_machine& machine, int xpos, int ypos);
128   UINT8 get_stampmap_32x32_1x1_tile_info_pixel(running_machine& machine, int xpos, int ypos);
129   UINT8 get_stampmap_16x16_16x16_tile_info_pixel(running_machine& machine, int xpos, int ypos);
130   UINT8 get_stampmap_32x32_16x16_tile_info_pixel(running_machine& machine, int xpos, int ypos);
132   UINT8 get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos);
133   UINT8 get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos);
134   UINT8 get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos);
135   UINT8 get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos);
131136
132137   WRITE16_MEMBER( scd_a12000_halt_reset_w );
133138   READ16_MEMBER( scd_a12000_halt_reset_r );
r29505r29506
177182   READ16_MEMBER( segacd_stampsize_r );
178183   WRITE16_MEMBER( segacd_stampsize_w );
179184
180   UINT8 read_pixel_from_stampmap( running_machine& machine, bitmap_ind16* srcbitmap, int x, int y);
185   UINT8 read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y);
181186
182187   WRITE16_MEMBER( segacd_trace_vector_base_address_w );
183188   READ16_MEMBER( segacd_imagebuffer_vdot_size_r );
r29505r29506
194199   WRITE16_MEMBER( segacd_imagebuffer_hdot_size_w );
195200   READ16_MEMBER( segacd_irq3timer_r );
196201   WRITE16_MEMBER( segacd_irq3timer_w );
197   READ16_MEMBER( segacd_backupram_r );
198   WRITE16_MEMBER( segacd_backupram_w );
199   READ16_MEMBER( segacd_font_color_r );
200   WRITE16_MEMBER( segacd_font_color_w );
201   READ16_MEMBER( segacd_font_converted_r );
202   TIMER_DEVICE_CALLBACK_MEMBER( scd_dma_timer_callback );
202   READ8_MEMBER( backupram_r );
203   WRITE8_MEMBER( backupram_w );
204   READ8_MEMBER( font_color_r );
205   WRITE8_MEMBER( font_color_w );
206   READ16_MEMBER( font_converted_r );
207   TIMER_DEVICE_CALLBACK_MEMBER( dma_timer_callback );
203208   IRQ_CALLBACK_MEMBER(segacd_sub_int_callback);
204209
205210   void SegaCD_CDC_Do_DMA( int &dmacount, UINT8 *CDC_BUFFER, UINT16 &dma_addrc, UINT16 &destination );
206   timer_device* scd_dma_timer;
207   required_device<gfxdecode_device> m_gfxdecode;
208211
209212protected:
210213   virtual void device_start();
branches/new_menus/src/mess/machine/upd65031.c
r29505r29506
204204
205205
206206//-------------------------------------------------
207//  device_config_complete - perform any
208//  operations now that the configuration is
209//  complete
210//-------------------------------------------------
211
212void upd65031_device::device_config_complete()
213{
214   // inherit a copy of the static data
215   const upd65031_interface *intf = reinterpret_cast<const upd65031_interface *>(static_config());
216   if (intf != NULL)
217   {
218      *static_cast<upd65031_interface *>(this) = *intf;
219   }
220   // or initialize to defaults if none provided
221   else
222   {
223      m_screen_update_cb = NULL;
224      m_out_mem_cb = NULL;
225   }
226}
227
228
229//-------------------------------------------------
230207//  device_start - device-specific startup
231208//-------------------------------------------------
232209
r29505r29506
238215   m_write_nmi.resolve_safe();
239216   m_write_spkr.resolve_safe();
240217
218   // bind delegates
219   m_screen_update_cb.bind_relative_to(*owner());
220   m_out_mem_cb.bind_relative_to(*owner());
221
241222   // allocate timers
242223   m_rtc_timer = timer_alloc(TIMER_RTC);
243224   m_flash_timer = timer_alloc(TIMER_FLASH);
r29505r29506
282263   m_mode = 0;
283264   set_mode(STATE_AWAKE);
284265
285   if (m_out_mem_cb)
266   if (!m_out_mem_cb.isnull())
286267   {
287268      // reset bankswitch
288      (m_out_mem_cb)(*this, 0, 0, 0);
289      (m_out_mem_cb)(*this, 1, 0, 0);
290      (m_out_mem_cb)(*this, 2, 0, 0);
291      (m_out_mem_cb)(*this, 3, 0, 0);
269      m_out_mem_cb(0, 0, 0);
270      m_out_mem_cb(1, 0, 0);
271      m_out_mem_cb(2, 0, 0);
272      m_out_mem_cb(3, 0, 0);
292273   }
293274}
294275
r29505r29506
405386
406387UINT32 upd65031_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
407388{
408   if (m_screen_update_cb && (m_com & COM_LCDON))
409      (m_screen_update_cb)(*this, bitmap, m_lcd_regs[4], m_lcd_regs[2], m_lcd_regs[3], m_lcd_regs[0], m_lcd_regs[1], m_flash);
389   if (!m_screen_update_cb.isnull() && (m_com & COM_LCDON))
390      m_screen_update_cb(bitmap, m_lcd_regs[4], m_lcd_regs[2], m_lcd_regs[3], m_lcd_regs[0], m_lcd_regs[1], m_flash);
410391   else
411392      bitmap.fill(0, cliprect);
412393
r29505r29506
528509         }
529510
530511         // bit 2 controls the lower 8kb of memory
531         if (BIT(m_com^data, 2) && m_out_mem_cb)
532            (m_out_mem_cb)(*this, 0, m_sr[0], BIT(data, 2));
512         if (BIT(m_com^data, 2) && !m_out_mem_cb.isnull())
513            m_out_mem_cb(0, m_sr[0], BIT(data, 2));
533514
534515         m_com = data;
535516         break;
r29505r29506
582563      case REG_SR1:
583564      case REG_SR2:
584565      case REG_SR3:
585         if (m_out_mem_cb && m_sr[port & 3] != data)
586            (m_out_mem_cb)(*this, port & 3, data, BIT(m_com, 2));
566         if (!m_out_mem_cb.isnull() && m_sr[port & 3] != data)
567            m_out_mem_cb(port & 3, data, BIT(m_com, 2));
587568
588569         m_sr[port & 3] = data;
589570         break;
branches/new_menus/src/mess/machine/upd65031.h
r29505r29506
1717//  INTERFACE CONFIGURATION MACROS
1818//**************************************************************************
1919
20#define MCFG_UPD65031_ADD(_tag, _clock, _config) \
21   MCFG_DEVICE_ADD((_tag), UPD65031, _clock)   \
22   MCFG_DEVICE_CONFIG(_config)
23
24#define UPD65031_INTERFACE(name) \
25   const upd65031_interface (name) =
26
2720#define MCFG_UPD65031_KB_CALLBACK(_read) \
2821   devcb = &upd65031_device::set_kb_rd_callback(*device, DEVCB2_##_read);
2922
r29505r29506
3629#define MCFG_UPD65031_SPKR_CALLBACK(_write) \
3730   devcb = &upd65031_device::set_spkr_wr_callback(*device, DEVCB2_##_write);
3831
32#define MCFG_UPD65031_SCR_UPDATE_CB(_class, _method) \
33   upd65031_device::set_screen_update_callback(*device, upd65031_screen_update_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
3934
35#define MCFG_UPD65031_MEM_UPDATE_CB(_class, _method) \
36   upd65031_device::set_memory_update_callback(*device, upd65031_memory_update_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
37
38
4039//**************************************************************************
4140//  TYPE DEFINITIONS
4241//**************************************************************************
4342
44typedef void (*upd65031_screen_update_func)(device_t &device, bitmap_ind16 &bitmap, UINT16 sbf, UINT16 hires0, UINT16 hires1, UINT16 lores0, UINT16 lores1, int flash);
45#define UPD65031_SCREEN_UPDATE(name) void name(device_t &device, bitmap_ind16 &bitmap, UINT16 sbf, UINT16 hires0, UINT16 hires1, UINT16 lores0, UINT16 lores1, int flash)
43typedef device_delegate<void (bitmap_ind16 &bitmap, UINT16 sbf, UINT16 hires0, UINT16 hires1, UINT16 lores0, UINT16 lores1, int flash)> upd65031_screen_update_delegate;
44typedef device_delegate<void (int bank, UINT16 page, int rams)> upd65031_memory_update_delegate;
4645
47typedef void (*upd65031_memory_update_func)(device_t &device, int bank, UINT16 page, int rams);
48#define UPD65031_MEMORY_UPDATE(name) void name(device_t &device, int bank, UINT16 page, int rams)
46#define UPD65031_SCREEN_UPDATE(_name) void _name(bitmap_ind16 &bitmap, UINT16 sbf, UINT16 hires0, UINT16 hires1, UINT16 lores0, UINT16 lores1, int flash)
47#define UPD65031_MEMORY_UPDATE(_name) void _name(int bank, UINT16 page, int rams)
4948
5049
51// ======================> upd65031_interface
52
53struct upd65031_interface
54{
55   upd65031_screen_update_func m_screen_update_cb;  // callback for update the LCD
56   upd65031_memory_update_func m_out_mem_cb;        // callback for update bankswitch
57};
58
59
6050// ======================> upd65031_device
6151
62class upd65031_device : public device_t,
63                  public upd65031_interface
52class upd65031_device : public device_t
6453{
6554public:
6655   // construction/destruction
r29505r29506
7160   template<class _Object> static devcb2_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast<upd65031_device &>(device).m_write_nmi.set_callback(object); }
7261   template<class _Object> static devcb2_base &set_spkr_wr_callback(device_t &device, _Object object) { return downcast<upd65031_device &>(device).m_write_spkr.set_callback(object); }
7362
63   static void set_screen_update_callback(device_t &device, upd65031_screen_update_delegate callback) { downcast<upd65031_device &>(device).m_screen_update_cb = callback; }
64   static void set_memory_update_callback(device_t &device, upd65031_memory_update_delegate callback) { downcast<upd65031_device &>(device).m_out_mem_cb = callback; }
65
7466   DECLARE_READ8_MEMBER( read );
7567   DECLARE_WRITE8_MEMBER( write );
7668   DECLARE_WRITE_LINE_MEMBER( flp_w );
r29505r29506
7971
8072protected:
8173   // device-level overrides
82   virtual void device_config_complete();
8374   virtual void device_start();
8475   virtual void device_reset();
8576   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
r29505r29506
9788   devcb2_write_line   m_write_nmi;
9889   devcb2_write_line   m_write_spkr;
9990
91   upd65031_screen_update_delegate m_screen_update_cb;  // callback for update the LCD
92   upd65031_memory_update_delegate m_out_mem_cb;        // callback for update bankswitch
93
10094   int     m_mode;
10195   UINT16  m_lcd_regs[5];      // LCD registers
10296   UINT8   m_tim[5];           // RTC registers
branches/new_menus/src/mess/includes/z88.h
r29505r29506
5858
5959   virtual void machine_start();
6060   virtual void machine_reset();
61   void bankswitch_update(int bank, UINT16 page, int rams);
6261   DECLARE_READ8_MEMBER(kb_r);
62   UPD65031_MEMORY_UPDATE(bankswitch_update);
63   UPD65031_SCREEN_UPDATE(lcd_update);
6364
6465   // cartridges read/write
6566   DECLARE_READ8_MEMBER(bank0_cart_r);
r29505r29506
7778   void vh_render_8x8(bitmap_ind16 &bitmap, int x, int y, UINT16 pen0, UINT16 pen1, UINT8 *gfx);
7879   void vh_render_6x8(bitmap_ind16 &bitmap, int x, int y, UINT16 pen0, UINT16 pen1, UINT8 *gfx);
7980   void vh_render_line(bitmap_ind16 &bitmap, int x, int y, UINT16 pen);
80   void lcd_update(bitmap_ind16 &bitmap, UINT16 sbf, UINT16 hires0, UINT16 hires1, UINT16 lores0, UINT16 lores1, int flash);
8181
8282   struct
8383   {
branches/new_menus/src/mess/includes/tandy2k.h
r29505r29506
7676      m_pb_sel(0),
7777      m_vram_base(0),
7878      m_vidouts(0),
79      m_clkspd(0),
80      m_clkcnt(0),
79      m_clkspd(-1),
80      m_clkcnt(-1),
8181      m_blc(0),
8282      m_bkc(0),
8383      m_cblank(0),
branches/new_menus/src/mess/includes/x68k.h
r29505r29506
1515#include "machine/upd765.h"
1616#include "sound/okim6258.h"
1717#include "machine/ram.h"
18#include "machine/8530scc.h"
19#include "sound/2151intf.h"
20#include "machine/i8255.h"
1821
1922#define MC68901_TAG     "mc68901"
2023#define RP5C15_TAG      "rp5c15"
r29505r29506
4043      TIMER_X68K_CRTC_RASTER_IRQ,
4144      TIMER_X68K_CRTC_VBLANK_IRQ,
4245      TIMER_X68K_FDC_TC,
46      TIMER_X68K_ADPCM
4347   };
4448
4549   x68k_state(const machine_config &mconfig, device_type type, const char *tag)
r29505r29506
5256         m_palette(*this, "palette"),
5357         m_mfpdev(*this, MC68901_TAG),
5458         m_rtc(*this, RP5C15_TAG),
59         m_scc(*this, "scc"),
60         m_ym2151(*this, "ym2151"),
61         m_ppi(*this, "ppi8255"),
5562         m_nvram16(*this, "nvram16"),
5663         m_nvram32(*this, "nvram32"),
5764         m_gvram16(*this, "gvram16"),
5865         m_tvram16(*this, "tvram16"),
5966         m_gvram32(*this, "gvram32"),
60         m_tvram32(*this, "tvram32") { }
67         m_tvram32(*this, "tvram32"),
68         m_options(*this, "options"),
69         m_mouse1(*this, "mouse1"),
70         m_mouse2(*this, "mouse2"),
71         m_mouse3(*this, "mouse3"),
72         m_xpd1lr(*this, "xpd1lr"),
73         m_ctrltype(*this, "ctrltype"),
74         m_joy1(*this, "joy1"),
75         m_joy2(*this, "joy2"),
76         m_md3b(*this, "md3b"),
77         m_md6b(*this, "md6b"),
78         m_md6b_extra(*this, "md6b_extra")
79   { }
6180
6281   required_device<m68000_base_device> m_maincpu;
6382   required_device<okim6258_device> m_okim6258;
r29505r29506
6786   required_device<palette_device> m_palette;
6887   required_device<mc68901_device> m_mfpdev;
6988   required_device<rp5c15_device> m_rtc;
89   required_device<scc8530_t> m_scc;
90   required_device<ym2151_device> m_ym2151;
91   required_device<i8255_device> m_ppi;
7092
7193   optional_shared_ptr<UINT16> m_nvram16;
7294   optional_shared_ptr<UINT32> m_nvram32;
r29505r29506
7597   optional_shared_ptr<UINT16> m_tvram16;
7698   optional_shared_ptr<UINT32> m_gvram32;
7799   optional_shared_ptr<UINT32> m_tvram32;
100   
101   required_ioport m_options;
102   required_ioport m_mouse1;
103   required_ioport m_mouse2;
104   required_ioport m_mouse3;
105   required_ioport m_xpd1lr;
106   required_ioport m_ctrltype;
107   required_ioport m_joy1;
108   required_ioport m_joy2;
109   required_ioport m_md3b;
110   required_ioport m_md6b;
111   required_ioport m_md6b_extra;
78112
79113   DECLARE_WRITE_LINE_MEMBER( mfp_tbo_w );
80114
r29505r29506
100134      int eject[4];
101135      int motor[4];
102136      int selected_drive;
103      int drq_state;
104137   } m_fdc;
105138   struct
106139   {
r29505r29506
203236   emu_timer* m_raster_irq;
204237   emu_timer* m_vblank_irq;
205238   emu_timer* m_fdc_tc;
239   emu_timer* m_adpcm_timer;
206240   UINT16* m_spriteram;
207241   UINT16* m_spritereg;
208242   tilemap_t* m_bg0_8;
r29505r29506
241275   DECLARE_READ8_MEMBER(ppi_port_c_r);
242276   DECLARE_WRITE8_MEMBER(ppi_port_c_w);
243277   DECLARE_WRITE_LINE_MEMBER(fdc_irq);
244   DECLARE_WRITE_LINE_MEMBER(fdc_drq);
245278   DECLARE_WRITE8_MEMBER(x68k_ct_w);
246279   DECLARE_WRITE_LINE_MEMBER(x68k_rtc_alarm_irq);
247280   DECLARE_WRITE8_MEMBER(x68030_adpcm_w);
branches/new_menus/src/mess/includes/sms.h
r29505r29506
200200
201201   DECLARE_READ8_MEMBER(sms_store_cart_select_r);
202202   DECLARE_WRITE8_MEMBER(sms_store_cart_select_w);
203   DECLARE_READ8_MEMBER(sms_store_select1);
204   DECLARE_READ8_MEMBER(sms_store_select2);
205   DECLARE_READ8_MEMBER(sms_store_control_r);
206203   DECLARE_WRITE8_MEMBER(sms_store_control_w);
207204   DECLARE_DRIVER_INIT(smssdisp);
208205
branches/new_menus/src/mess/video/crt.c
r29505r29506
2525    Based on earlier work by Chris Salomon
2626*/
2727
28#include <math.h>
2928#include "emu.h"
3029#include "video/crt.h"
3130
r29505r29506
6867
6968void crt_device::device_start()
7069{
71   const crt_interface *intf = (const crt_interface *)static_config();
72   int width = intf->width;
73   int height = intf->height;
74   int i;
75
76   m_num_intensity_levels = intf->num_levels;
77   m_window_offset_x = intf->offset_x;
78   m_window_offset_y = intf->offset_y;
79   m_window_width = width;
80   m_window_height = height;
81
8270   /* alloc the arrays */
83   m_list = auto_alloc_array(machine(), crt_point, width * height);
71   m_list = auto_alloc_array(machine(), crt_point, m_window_width * m_window_height);
72   m_list_head = auto_alloc_array(machine(), int, m_window_height);
8473
85   m_list_head = auto_alloc_array(machine(), int, height);
86
8774   /* fill with black and set up list as empty */
88   for (i=0; i<(width * height); i++)
89   {
75   for (int i = 0; i < (m_window_width * m_window_height); i++)
9076      m_list[i].intensity = intensity_pixel_not_in_list;
91   }
9277
93   for (i=0; i<height; i++)
78   for (int i = 0; i < m_window_height; i++)
9479      m_list_head[i] = -1;
9580
9681   m_decay_counter = 0;
branches/new_menus/src/mess/video/crt.h
r29505r29506
66
77*************************************************************************/
88
9#ifndef CRT_H_
10#define CRT_H_
9#ifndef __CRT_H__
10#define __CRT_H__
1111
1212
1313//**************************************************************************
1414//  INTERFACE CONFIGURATION MACROS
1515//**************************************************************************
1616
17#define MCFG_CRT_ADD(_tag, _interface) \
18   MCFG_DEVICE_ADD(_tag, CRT, 0) \
19   MCFG_DEVICE_CONFIG(_interface)
17#define MCFG_CRT_NUM_LEVELS(_lev) \
18   crt_device::set_num_levels(*device, _lev);
2019
20#define MCFG_CRT_OFFSETS(_xoffs, _yoffs) \
21   crt_device::set_offsets(*device, _xoffs, _yoffs);
2122
23#define MCFG_CRT_SIZE(_width, _height) \
24   crt_device::set_size(*device, _width, _height);
25
26
2227//**************************************************************************
2328//  TYPE DEFINITIONS
2429//**************************************************************************
2530
26struct crt_interface
27{
28   int num_levels;
29   int offset_x, offset_y;
30   int width, height;
31};
32
33
3431struct crt_point
3532{
3633   crt_point() :
r29505r29506
5047   crt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5148   ~crt_device() { }
5249
50   static void set_num_levels(device_t &device, int levels) { downcast<crt_device &>(device).m_num_intensity_levels = levels; }
51   static void set_offsets(device_t &device, int x_offset, int y_offset)
52   {
53      crt_device &dev = downcast<crt_device &>(device);
54      dev.m_window_offset_x = x_offset;
55      dev.m_window_offset_y = y_offset;
56   }
57   static void set_size(device_t &device, int width, int height)
58   {
59      crt_device &dev = downcast<crt_device &>(device);
60      dev.m_window_width = width;
61      dev.m_window_height = height;
62   }
63   
64   void plot(int x, int y);
65   void eof();
66   void update(bitmap_ind16 &bitmap);
67   
5368protected:
5469   // device-level overrides
5570   virtual void device_start();
5671
57public:
58   void plot(int x, int y);
59   void eof();
60   void update(bitmap_ind16 &bitmap);
61
6272private:
6373   crt_point *m_list; /* array of (crt_window_width*crt_window_height) point */
6474   int *m_list_head;  /* head of the list of lit pixels (index in the array) */
branches/new_menus/src/mess/video/vtvideo.c
r29505r29506
4949                  device_video_interface(mconfig, *this),
5050                  m_read_ram(*this),
5151                  m_write_clear_video_interrupt(*this),
52                  m_char_rom_tag(""),
5253                  m_palette(*this, "palette")
5354{
5455}
r29505r29506
5960                  device_video_interface(mconfig, *this),
6061                  m_read_ram(*this),
6162                  m_write_clear_video_interrupt(*this),
63                  m_char_rom_tag(""),
6264                  m_palette(*this, "palette")
6365{
6466}
r29505r29506
7173
7274
7375//-------------------------------------------------
74//  device_config_complete - perform any
75//  operations now that the configuration is
76//  complete
77//-------------------------------------------------
78
79void vt100_video_device::device_config_complete()
80{
81   // inherit a copy of the static data
82   const vt_video_interface *intf = reinterpret_cast<const vt_video_interface *>(static_config());
83   if (intf != NULL)
84      *static_cast<vt_video_interface *>(this) = *intf;
85
86   // or initialize to defaults if none provided
87   else
88   {
89      m_char_rom_tag = "";
90   }
91}
92
93//-------------------------------------------------
9476//  device_start - device-specific startup
9577//-------------------------------------------------
9678
branches/new_menus/src/mess/video/vtvideo.h
r29505r29506
1515
1616#include "emu.h"
1717
18#define MCFG_VT_VIDEO_RAM_CALLBACK(_read) \
19   devcb = &vt100_video_device::set_ram_rd_callback(*device, DEVCB2_##_read);
20
21#define MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(_write) \
22   devcb = &vt100_video_device::set_clear_video_irq_wr_callback(*device, DEVCB2_##_write);
23
24struct vt_video_interface
25{
26   const char *m_char_rom_tag; /* character rom region */
27};
28
29
3018class vt100_video_device : public device_t,
31                     public device_video_interface,
32                     public vt_video_interface
19                     public device_video_interface
3320{
3421public:
3522   vt100_video_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
r29505r29506
3926   template<class _Object> static devcb2_base &set_ram_rd_callback(device_t &device, _Object object) { return downcast<vt100_video_device &>(device).m_read_ram.set_callback(object); }
4027   template<class _Object> static devcb2_base &set_clear_video_irq_wr_callback(device_t &device, _Object object) { return downcast<vt100_video_device &>(device).m_write_clear_video_interrupt.set_callback(object); }
4128
29   static void set_chargen_tag(device_t &device, const char *tag) { downcast<vt100_video_device &>(device).m_char_rom_tag = tag; }
30
4231   DECLARE_READ8_MEMBER(lba7_r);
4332   DECLARE_WRITE8_MEMBER(dc012_w);
4433   DECLARE_WRITE8_MEMBER(dc011_w);
r29505r29506
4736   virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
4837protected:
4938   // device-level overrides
50   virtual void device_config_complete();
5139   virtual void device_start();
5240   virtual void device_reset();
5341   virtual machine_config_constructor device_mconfig_additions() const;
r29505r29506
6755   bool MHFU_FLAG;
6856   int MHFU_counter;
6957
70
7158   // dc012 attributes
7259   UINT8 m_scroll_latch;
7360   UINT8 m_scroll_latch_valid;
r29505r29506
8269   UINT8 m_frequency;
8370   UINT8 m_interlaced;
8471
72   const char *m_char_rom_tag; /* character rom region */
8573   required_device<palette_device> m_palette;
8674};
8775
r29505r29506
10694extern const device_type RAINBOW_VIDEO;
10795
10896
109#define MCFG_VT100_VIDEO_ADD(_tag, _screen_tag, _intrf) \
110   MCFG_DEVICE_ADD(_tag, VT100_VIDEO, 0) \
111   MCFG_DEVICE_CONFIG(_intrf) \
112   MCFG_VIDEO_SET_SCREEN(_screen_tag)
97#define MCFG_VT_SET_SCREEN MCFG_VIDEO_SET_SCREEN
11398
114#define MCFG_RAINBOW_VIDEO_ADD(_tag, _screen_tag, _intrf) \
115   MCFG_DEVICE_ADD(_tag, RAINBOW_VIDEO, 0) \
116   MCFG_DEVICE_CONFIG(_intrf) \
117   MCFG_VIDEO_SET_SCREEN(_screen_tag)
99#define MCFG_VT_CHARGEN(_tag) \
100   vt100_video_device::set_chargen_tag(*device, _tag);
118101
102#define MCFG_VT_VIDEO_RAM_CALLBACK(_read) \
103   devcb = &vt100_video_device::set_ram_rd_callback(*device, DEVCB2_##_read);
119104
105#define MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(_write) \
106   devcb = &vt100_video_device::set_clear_video_irq_wr_callback(*device, DEVCB2_##_write);
120107
121108#endif
branches/new_menus/src/mess/video/z88.c
r29505r29506
7272      plot_pixel(bitmap, x + i, y + 7, pen);
7373}
7474
75void z88_state::lcd_update(bitmap_ind16 &bitmap, UINT16 sbf, UINT16 hires0, UINT16 hires1, UINT16 lores0, UINT16 lores1, int flash)
75UPD65031_SCREEN_UPDATE(z88_state::lcd_update)
7676{
7777   if (sbf == 0)
7878   {
Property changes on: branches/new_menus
Modified: svn:mergeinfo
   Merged /trunk:r29425-29482

Previous 199869 Revisions Next


© 1997-2024 The MAME Team