Previous 199869 Revisions Next

r29304 Saturday 5th April, 2014 at 11:04:32 UTC by Nathan Woods
Merge branch 'master' of ssh://mess.org/mame into new_menus
[/shelves/new_menus/src/emu/bus]bus.mak
[/shelves/new_menus/src/emu/bus/adamnet]spi.c
[/shelves/new_menus/src/emu/bus/bml3]bml3mp1802.c bml3mp1805.c
[/shelves/new_menus/src/emu/bus/c64]exp.h
[/shelves/new_menus/src/emu/bus/coco]coco_fdc.c
[/shelves/new_menus/src/emu/bus/ieee488]c8050.c c8050.h
[/shelves/new_menus/src/emu/bus/iq151]iq151.c
[/shelves/new_menus/src/emu/bus/isa]3c505.c 3c505.h
[/shelves/new_menus/src/emu/bus/megadrive]rom.c
[/shelves/new_menus/src/emu/bus/plus4]exp.h
[/shelves/new_menus/src/emu/bus/rs232]teleprinter.c teleprinter.h
[/shelves/new_menus/src/emu/bus/ti99_peb]bwg.c bwg.h hfdc.c hfdc.h peribox.c ti_fdc.c ti_fdc.h
[/shelves/new_menus/src/emu/bus/vic10]exp.h
[/shelves/new_menus/src/emu/bus/vic20]exp.h
[/shelves/new_menus/src/emu/bus/vip]exp.c exp.h vp575.c vp575.h
[/shelves/new_menus/src/emu/cpu/powerpc]ppc.h ppccom.c ppccom.h
[/shelves/new_menus/src/emu/imagedev]flopdrv.c flopdrv.h
[/shelves/new_menus/src/emu/machine]aakart.c i8271.c i8271.h mc2661.c mc2661.h mc6843.c mc6843.h s3c2400.h s3c2410.h smc92x4.c smc92x4.h wd17xx.c wd17xx.h
[/shelves/new_menus/src/emu/video]h63484.c h63484.h huc6270.c huc6270.h
[/shelves/new_menus/src/mame]mame.lst mame.mak
[/shelves/new_menus/src/mame/drivers]4enlinea.c adp.c aristmk4.c cobra.c ggconnie.c konamim2.c model3.c namcos23.c paranoia.c slapfght.c taitopjc.c taitotz.c tourvis.c uapce.c viper.c
[/shelves/new_menus/src/mame/includes]archimds.h slapfght.h
[/shelves/new_menus/src/mame/layout]gunnrose.lay*
[/shelves/new_menus/src/mame/machine]archimds.c slapfght.c
[/shelves/new_menus/src/mame/video]archimds.c slapfght.c
[/shelves/new_menus/src/mess]mess.mak
[/shelves/new_menus/src/mess/drivers]abc1600.c alphasma.c apf.c apollo.c c128.c c64.c compis.c comx35.c dm7000.c fm7.c iq151.c mbc200.c megadriv.c mod8.c ms0515.c myb3k.c mz2000.c mz2500.c pce.c pcfx.c pet.c plus4.c rainbow.c smc777.c thomson.c unixpc.c vic10.c vic20.c vip.c vtech1.c wangpc.c wicat.c x1.c z100.c
[/shelves/new_menus/src/mess/includes]apollo.h dm7000.h thomson.h
[/shelves/new_menus/src/mess/machine]appldriv.c atarifdc.c atarifdc.h beta.c concept_exp.c hec2hrp.c megacd.c micropolis.c micropolis.h nes.c osborne1.c partner.c pk8020.c rmnimbus.c rx01.c rx01.h sonydriv.c svi318.c swtpc09.c teleprinter.c* teleprinter.h* thomflop.c trs80.c
[/shelves/new_menus/src/mess/machine/ti99]990_dk.c 990_dk.h
[/shelves/new_menus/src/mess/video]abc1600.c apollo.c gb_lcd.c

shelves/new_menus/src/mame/mame.lst
r29303r29304
1130211302clkwise         // (c) 1986 Ainsworth Nominees P.L.
1130311303gldnpkr         // (c) 1986 Ainsworth Nominees P.L.
1130411304cgold           // (c) 1986 Ainsworth Nominees P.L.
11305gunnrose        // (c) 1993
11305113063bagflvt        // (c) 1994
11306113073bagflnz        // (c) 1994
1130711308eforest         // (c) 1994
shelves/new_menus/src/mame/machine/slapfght.c
r29303r29304
160160   }
161161   if ((m_ddrB & 0x08) && (~data & 0x08) && (m_portB_out & 0x08))
162162   {
163      *m_slapfight_scrollx_lo = m_portA_out;
163      m_scrollx_lo = m_portA_out;
164164   }
165165   if ((m_ddrB & 0x10) && (~data & 0x10) && (m_portB_out & 0x10))
166166   {
167      *m_slapfight_scrollx_hi = m_portA_out;
167      m_scrollx_hi = m_portA_out;
168168   }
169169
170170   m_portB_out = data;
shelves/new_menus/src/mame/machine/archimds.c
r29303r29304
116116   address_space &space = m_maincpu->space(AS_PROGRAM);
117117   static UINT8 *vram = m_region_vram->base();
118118   UINT32 size;
119   UINT32 m_vidc_ccur;
119120
120121   size = m_vidc_vidend-m_vidc_vidstart+0x10;
121122
122123   for(m_vidc_vidcur = 0;m_vidc_vidcur < size;m_vidc_vidcur++)
123124      vram[m_vidc_vidcur] = (space.read_byte(m_vidc_vidstart+m_vidc_vidcur));
124125
126   size = m_vidc_vidend-m_vidc_vidstart+0x10;
127
128   for(m_vidc_ccur = 0;m_vidc_ccur < 0x200;m_vidc_ccur++)
129      m_cursor_vram[m_vidc_ccur] = (space.read_byte(m_vidc_cinit+m_vidc_ccur));
130
125131   if(m_video_dma_on)
126132      m_vid_timer->adjust(m_screen->time_until_pos(m_vidc_regs[0xb4]));
127133   else
r29303r29304
930936      {
931937         case 0: /* video init */
932938            m_vidc_vidinit = ((data>>2)&0x7fff)*16;
933            //logerror("MEMC: VIDINIT %08x\n",vidc_vidinit);
939            //printf("MEMC: VIDINIT %08x\n",m_vidc_vidinit);
934940            break;
935941
936942         case 1: /* video start */
937943            m_vidc_vidstart = 0x2000000 | (((data>>2)&0x7fff)*16);
938            //logerror("MEMC: VIDSTART %08x\n",vidc_vidstart);
944            //printf("MEMC: VIDSTART %08x\n",m_vidc_vidstart);
939945            break;
940946
941947         case 2: /* video end */
942948            m_vidc_vidend = 0x2000000 | (((data>>2)&0x7fff)*16);
943            //logerror("MEMC: VIDEND %08x\n",vidc_vidend);
949            //printf("MEMC: VIDEND %08x\n",m_vidc_vidend);
944950            break;
945951
952         case 3: /* cursor init */
953            m_vidc_cinit = 0x2000000 | (((data>>2)&0x7fff)*16);
954            //printf("MEMC: CURSOR %08x\n",((data>>2)&0x7fff)*16);
955            break;
956
946957         case 4: /* sound start */
947958            //logerror("MEMC: SNDSTART %08x\n",data);
948959            archimedes_clear_irq_b(ARCHIMEDES_IRQB_SOUND_EMPTY);
shelves/new_menus/src/mame/includes/slapfght.h
r29303r29304
2020      m_screen(*this, "screen"),
2121      m_palette(*this, "palette"),
2222      m_spriteram(*this, "spriteram"),
23      m_slapfight_videoram(*this, "videoram"),
24      m_slapfight_colorram(*this, "colorram"),
25      m_slapfight_fixvideoram(*this, "fixvideoram"),
26      m_slapfight_fixcolorram(*this, "fixcolorram"),
27      m_slapfight_scrollx_lo(*this, "scrollx_lo"),
28      m_slapfight_scrollx_hi(*this, "scrollx_hi"),
29      m_slapfight_scrolly(*this, "scrolly")
23      m_videoram(*this, "videoram"),
24      m_colorram(*this, "colorram"),
25      m_fixvideoram(*this, "fixvideoram"),
26      m_fixcolorram(*this, "fixcolorram")
3027   { }
3128   
3229   // devices, memory pointers
r29303r29304
3835   required_device<palette_device> m_palette;
3936   required_device<buffered_spriteram8_device> m_spriteram;
4037
41   required_shared_ptr<UINT8> m_slapfight_videoram;
42   required_shared_ptr<UINT8> m_slapfight_colorram;
43   optional_shared_ptr<UINT8> m_slapfight_fixvideoram;
44   optional_shared_ptr<UINT8> m_slapfight_fixcolorram;
45   optional_shared_ptr<UINT8> m_slapfight_scrollx_lo;
46   optional_shared_ptr<UINT8> m_slapfight_scrollx_hi;
47   optional_shared_ptr<UINT8> m_slapfight_scrolly;
38   required_shared_ptr<UINT8> m_videoram;
39   required_shared_ptr<UINT8> m_colorram;
40   optional_shared_ptr<UINT8> m_fixvideoram;
41   optional_shared_ptr<UINT8> m_fixcolorram;
4842
4943   /* This it the best way to allow game specific kludges until the system is fully understood */
5044   enum getstar_id
r29303r29304
5953   tilemap_t *m_pf1_tilemap;
6054   tilemap_t *m_fix_tilemap;
6155   UINT8 m_palette_bank;
62   UINT8 m_flipscreen;
56   UINT8 m_scrollx_lo;
57   UINT8 m_scrollx_hi;
58   UINT8 m_scrolly;
6359   bool m_main_irq_enabled;
6460   bool m_sound_nmi_enabled;
6561
r29303r29304
9187   DECLARE_WRITE8_MEMBER(prg_bank_w);
9288   DECLARE_READ8_MEMBER(vblank_r);
9389   DECLARE_WRITE8_MEMBER(sound_nmi_enable_w);
94   DECLARE_WRITE8_MEMBER(slapfight_videoram_w);
95   DECLARE_WRITE8_MEMBER(slapfight_colorram_w);
96   DECLARE_WRITE8_MEMBER(slapfight_fixram_w);
97   DECLARE_WRITE8_MEMBER(slapfight_fixcol_w);
90   DECLARE_WRITE8_MEMBER(videoram_w);
91   DECLARE_WRITE8_MEMBER(colorram_w);
92   DECLARE_WRITE8_MEMBER(fixram_w);
93   DECLARE_WRITE8_MEMBER(fixcol_w);
94   DECLARE_WRITE8_MEMBER(scrollx_lo_w);
95   DECLARE_WRITE8_MEMBER(scrollx_hi_w);
96   DECLARE_WRITE8_MEMBER(scrolly_w);
9897   DECLARE_WRITE8_MEMBER(flipscreen_w);
9998   DECLARE_WRITE8_MEMBER(palette_bank_w);
10099
r29303r29304
145144   DECLARE_VIDEO_START(perfrman);
146145   DECLARE_VIDEO_START(slapfight);
147146
148   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_display);
147   void draw_perfrman_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer);
148   void draw_slapfight_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
149149   UINT32 screen_update_perfrman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
150150   UINT32 screen_update_slapfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
151151
shelves/new_menus/src/mame/includes/archimds.h
r29303r29304
8181   UINT8 m_i2c_clk;
8282   INT16 m_memc_pages[0x2000]; // the logical RAM area is 32 megs, and the smallest page size is 4k
8383   UINT32 m_vidc_regs[256];
84   UINT8 m_cursor_vram[0x200];
8485   UINT8 m_ioc_regs[0x80/4];
8586   UINT8 m_vidc_bpp_mode;
8687   UINT8 m_vidc_interlace;
r29303r29304
120121   UINT32 m_memc_pagesize;
121122   int m_memc_latchrom;
122123   UINT32 m_ioc_timercnt[4], m_ioc_timerout[4];
123   UINT32 m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur;
124   UINT32 m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur,m_vidc_cinit;
124125   UINT32 m_vidc_sndstart, m_vidc_sndend, m_vidc_sndcur;
125126   UINT8 m_video_dma_on,m_audio_dma_on;
126127   UINT8 m_vidc_pixel_clk;
shelves/new_menus/src/mame/mame.mak
r29303r29304
23222322         $(LAYOUT)/kgbird.lh \
23232323         $(LAYOUT)/topgear.lh \
23242324         $(LAYOUT)/wildone.lh \
2325         $(LAYOUT)/gunnrose.lh \
23252326         $(LAYOUT)/gldnpkr.lh \
23262327
23272328$(DRIVERS)/asteroid.o:  $(LAYOUT)/astdelux.lh
shelves/new_menus/src/mame/video/archimds.c
r29303r29304
7777            }
7878         }
7979         break;
80         case 2: //4 bpp
81         {
82            for(y=0;y<ysize;y++)
83            {
84               for(x=0;x<xsize;x+=2)
85               {
86                  pen = vram[count];
87
88                  for(xi=0;xi<2;xi++)
89                  {
90                     res_x = x+xi+xstart;
91                     res_y = (y+ystart)*(m_vidc_interlace+1);
92
93                     if(m_vidc_interlace)
94                     {
95                        if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
96                           bitmap.pix32(res_y, res_x) = m_palette->pen((pen>>(xi*4))&0xf);
97                        if (cliprect.contains(res_x, res_y+1) && (res_x) <= xend && (res_y+1) <= yend)
98                           bitmap.pix32(res_y+1, res_x) = m_palette->pen((pen>>(xi*4))&0xf);
99                     }
100                     else
101                     {
102                        if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
103                           bitmap.pix32(res_y, res_x) = m_palette->pen((pen>>(xi*4))&0xf);
104                     }
105                  }
106
107                  count++;
108               }
109            }
110         }
111         break;
80112         case 3: //8 bpp
81113         {
82114            for(y=0;y<ysize;y++)
r29303r29304
106138            }
107139         }
108140         break;
141         default:
142            popmessage("Unemulated bpp mode %02x, contact MAME/MESSdev",m_vidc_bpp_mode);
143            break;
109144      }
145
146
147      if(0)
148      {
149         count = 0;
150         for(y=0;y<16;y++)
151         {
152            for(x=0;x<32;x+=4)
153            {
154               for(xi=0;xi<4;xi++)
155               {
156                  UINT8 cursor_dot;
157                  pen = m_cursor_vram[count];
158
159                  res_x = x+xi+xstart;
160                  res_y = (y+ystart)*(m_vidc_interlace+1);
161
162                  cursor_dot = ((pen>>(xi*2))&0x3);
163
164                  if(cursor_dot)
165                  {
166                     if(m_vidc_interlace)
167                     {
168                        if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
169                           bitmap.pix32(res_y, res_x) = m_palette->pen(cursor_dot+0x10);
170                        if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y+1) <= yend)
171                           bitmap.pix32(res_y+1, res_x) = m_palette->pen(cursor_dot+0x10);
172                     }
173                     else
174                     {
175                        if (cliprect.contains(res_x, res_y) && (res_x) <= xend && (res_y) <= yend)
176                           bitmap.pix32(res_y, res_x) = m_palette->pen(cursor_dot+0x10);
177                     }
178                  }
179               }
180
181               count++;
182            }
183         }
184      }
110185   }
111186
187
188
112189   return 0;
113190}
shelves/new_menus/src/mame/video/slapfght.c
r29303r29304
1919TILE_GET_INFO_MEMBER(slapfght_state::get_pf_tile_info)
2020{
2121   /* For Performan only */
22   int tile = m_slapfight_videoram[tile_index] | ((m_slapfight_colorram[tile_index] & 0x03) << 8);
23   int color = (m_slapfight_colorram[tile_index] >> 3) & 0x0f;
22   int tile = m_videoram[tile_index] | ((m_colorram[tile_index] & 0x03) << 8);
23   int color = (m_colorram[tile_index] >> 3) & 0x0f;
2424
2525   SET_TILE_INFO_MEMBER(0, tile, color, 0);
2626}
2727
2828TILE_GET_INFO_MEMBER(slapfght_state::get_pf1_tile_info)
2929{
30   int tile = m_slapfight_videoram[tile_index] | ((m_slapfight_colorram[tile_index] & 0x0f) << 8);
31   int color = (m_slapfight_colorram[tile_index] & 0xf0) >> 4;
30   int tile = m_videoram[tile_index] | ((m_colorram[tile_index] & 0x0f) << 8);
31   int color = (m_colorram[tile_index] & 0xf0) >> 4;
3232
3333   SET_TILE_INFO_MEMBER(1, tile, color, 0);
3434}
3535
3636TILE_GET_INFO_MEMBER(slapfght_state::get_fix_tile_info)
3737{
38   int tile = m_slapfight_fixvideoram[tile_index] | ((m_slapfight_fixcolorram[tile_index] & 0x03) << 8);
39   int color = (m_slapfight_fixcolorram[tile_index] & 0xfc) >> 2;
38   int tile = m_fixvideoram[tile_index] | ((m_fixcolorram[tile_index] & 0x03) << 8);
39   int color = (m_fixcolorram[tile_index] & 0xfc) >> 2;
4040
4141   SET_TILE_INFO_MEMBER(0, tile, color, 0);
4242}
r29303r29304
6060{
6161   m_pf1_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(slapfght_state::get_pf1_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
6262   m_fix_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(slapfght_state::get_fix_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
63   
64   m_fix_tilemap->set_scrolldy(0, 15);
65   m_pf1_tilemap->set_scrolldy(0, 14);
6366
6467   m_fix_tilemap->set_transparent_pen(0);
6568}
r29303r29304
7275
7376***************************************************************************/
7477
75WRITE8_MEMBER(slapfght_state::slapfight_videoram_w)
78WRITE8_MEMBER(slapfght_state::videoram_w)
7679{
77   m_slapfight_videoram[offset] = data;
80   m_videoram[offset] = data;
7881   m_pf1_tilemap->mark_tile_dirty(offset);
7982}
8083
81WRITE8_MEMBER(slapfght_state::slapfight_colorram_w)
84WRITE8_MEMBER(slapfght_state::colorram_w)
8285{
83   m_slapfight_colorram[offset] = data;
86   m_colorram[offset] = data;
8487   m_pf1_tilemap->mark_tile_dirty(offset);
8588}
8689
87WRITE8_MEMBER(slapfght_state::slapfight_fixram_w)
90WRITE8_MEMBER(slapfght_state::fixram_w)
8891{
89   m_slapfight_fixvideoram[offset] = data;
92   m_fixvideoram[offset] = data;
9093   m_fix_tilemap->mark_tile_dirty(offset);
9194}
9295
93WRITE8_MEMBER(slapfght_state::slapfight_fixcol_w)
96WRITE8_MEMBER(slapfght_state::fixcol_w)
9497{
95   m_slapfight_fixcolorram[offset] = data;
98   m_fixcolorram[offset] = data;
9699   m_fix_tilemap->mark_tile_dirty(offset);
97100}
98101
102WRITE8_MEMBER(slapfght_state::scrollx_lo_w)
103{
104   m_scrollx_lo = data;
105}
106
107WRITE8_MEMBER(slapfght_state::scrollx_hi_w)
108{
109   m_scrollx_hi = data;
110}
111
112WRITE8_MEMBER(slapfght_state::scrolly_w)
113{
114   m_scrolly = data;
115}
116
99117WRITE8_MEMBER(slapfght_state::flipscreen_w)
100118{
101   m_flipscreen = offset ? 0 : 1;
119   flip_screen_set(offset ? 0 : 1);
102120}
103121
104122WRITE8_MEMBER(slapfght_state::palette_bank_w)
r29303r29304
114132
115133***************************************************************************/
116134
117void slapfght_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_display)
135void slapfght_state::draw_perfrman_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer)
118136{
119137   UINT8 *src = m_spriteram->buffer();
120
138   
121139   for (int offs = 0; offs < m_spriteram->bytes(); offs += 4)
122140   {
123      int sx, sy;
124
125      if ((src[offs + 2] & 0x80) == priority_to_display)
141      /*
142         0: xxxxxxxx - code
143         1: xxxxxxxx - x
144         2: x....... - priority over backdrop
145            .x...... - sprite-sprite priority (see point-pop sprites)
146            ..x..... - ?
147            ...xx... - no function?
148            .....xxx - color
149         3: xxxxxxxx - y
150      */
151     
152      int code = src[offs + 0];
153      int sy = src[offs + 3] - 1;
154      int sx = src[offs + 1] - 13;
155      int pri = src[offs + 2] >> 6 & 3;
156      int color = (src[offs + 2] >> 1 & 3) | (src[offs + 2] << 2 & 4) | (m_palette_bank << 3);
157      int fx = 0, fy = 0;
158     
159      if (flip_screen())
126160      {
127         if (m_flipscreen)
128         {
129            sx = 265 - src[offs + 1];
130            sy = 239 - src[offs + 3];
131            sy &= 0xff;
132         }
133         else
134         {
135            sx = src[offs + 1] + 3;
136            sy = src[offs + 3] - 1;
137         }
138         
139         m_gfxdecode->gfx(1)->transpen(bitmap, cliprect,
140            src[offs],
141            ((src[offs + 2] >> 1) & 3) | ((src[offs + 2] << 2) & 4) | (m_palette_bank << 3),
142            m_flipscreen, m_flipscreen,
143            sx, sy, 0
144         );
161         sy = 256 - sy;
162         sx = 240 - sx;
163         fx = fy = 1;
145164      }
165     
166      if (layer == pri)
167         m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, fx, fy, sx, sy, 0);
146168   }
147169}
148170
149
150171UINT32 slapfght_state::screen_update_perfrman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
151172{
152   m_pf1_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
153   m_pf1_tilemap->set_scrolly(0, 0);
154   if (m_flipscreen)
155      m_pf1_tilemap->set_scrollx(0, 264);
156   else
157      m_pf1_tilemap->set_scrollx(0, -16);
173   m_pf1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE);
174   draw_perfrman_sprites(bitmap, cliprect, 0);
175   draw_perfrman_sprites(bitmap, cliprect, 1);
158176
159   m_pf1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
160   draw_sprites(bitmap,cliprect, 0);
161   m_pf1_tilemap->draw(screen, bitmap, cliprect, 0, 0);
162   draw_sprites(bitmap,cliprect, 0x80);
177   m_pf1_tilemap->draw(screen, bitmap, cliprect, 0);
178   draw_perfrman_sprites(bitmap, cliprect, 2);
179   draw_perfrman_sprites(bitmap, cliprect, 3);
163180
164181   return 0;
165182}
166183
167184
168UINT32 slapfght_state::screen_update_slapfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
185void slapfght_state::draw_slapfight_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
169186{
170187   UINT8 *src = m_spriteram->buffer();
171188
172   machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
173   if (m_flipscreen)
189   for (int offs = 0; offs < m_spriteram->bytes(); offs += 4)
174190   {
175      m_fix_tilemap->set_scrollx(0, 296);
176      m_pf1_tilemap->set_scrollx(0, (*m_slapfight_scrollx_lo + 256 * *m_slapfight_scrollx_hi) + 296);
177      m_pf1_tilemap->set_scrolly(0, (*m_slapfight_scrolly) + 15);
178      m_fix_tilemap->set_scrolly(0, -1); /* Glitch in Tiger Heli otherwise */
191      /*
192         0: xxxxxxxx - code low
193         1: xxxxxxxx - x low
194         2: xx...... - code high
195            ..x..... - no function?
196            ...xxxx. - color
197            .......x - x high
198         3: xxxxxxxx - y
199      */
200     
201      int code = src[offs + 0] | ((src[offs + 2] & 0xc0) << 2);
202      int sy = src[offs + 3];
203      int sx = (src[offs + 1] | (src[offs + 2] << 8 & 0x100)) - 13;
204      int color = src[offs + 2] >> 1 & 0xf;
205      int fx = 0, fy = 0;
206
207      if (flip_screen())
208      {
209         sy = (238 - sy) & 0xff;
210         sx = 284 - sx;
211         fx = fy = 1;
212      }
213     
214      m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, fx, fy, sx, sy, 0);
179215   }
180   else
181   {
182      m_fix_tilemap->set_scrollx(0, 0);
183      m_pf1_tilemap->set_scrollx(0, (*m_slapfight_scrollx_lo + 256 * *m_slapfight_scrollx_hi));
184      m_pf1_tilemap->set_scrolly(0, (*m_slapfight_scrolly) - 1);
185      m_fix_tilemap->set_scrolly(0, -1); /* Glitch in Tiger Heli otherwise */
186   }
216}
187217
218UINT32 slapfght_state::screen_update_slapfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
219{
220   m_pf1_tilemap->set_scrollx(m_scrollx_hi << 8 | m_scrollx_lo);
221   m_pf1_tilemap->set_scrolly(m_scrolly);
222
188223   m_pf1_tilemap->draw(screen, bitmap, cliprect, 0, 0);
189
190   /* Draw the sprites */
191   for (int offs = 0; offs < m_spriteram->bytes(); offs += 4)
192   {
193      if (m_flipscreen)
194         m_gfxdecode->gfx(2)->transpen(bitmap, cliprect,
195            src[offs] + ((src[offs + 2] & 0xc0) << 2),
196            (src[offs + 2] & 0x1e) >> 1,
197            1, 1,
198            288 - (src[offs + 1] + ((src[offs + 2] & 0x01) << 8)) + 18, 240 - src[offs + 3], 0
199         );
200      else
201         m_gfxdecode->gfx(2)->transpen(bitmap, cliprect,
202            src[offs] + ((src[offs + 2] & 0xc0) << 2),
203            (src[offs + 2] & 0x1e) >> 1,
204            0, 0,
205            (src[offs + 1] + ((src[offs + 2] & 0x01) << 8)) - 13, src[offs + 3], 0
206         );
207   }
208
224   draw_slapfight_sprites(bitmap, cliprect);
209225   m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0);
210226
211227   return 0;
shelves/new_menus/src/mame/layout/gunnrose.lay
r0r29304
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="collect">
4      <rect state="1">
5         <color red="1.0" green="1.0" blue="0.0" />
6      </rect>
7      <rect state="0">
8         <color red="0.5" green="0.5" blue="0.0" />
9      </rect>
10      <text string="COLLECT">
11         <color red="0.0" green="0.0" blue="0.0" />
12         <bounds x="0" y="0.1" width="1" height="0.8" />
13      </text>
14   </element>
15
16   <element name="red">
17      <rect state="1">
18         <color red="1.0" green="1.0" blue="1.0" />
19      </rect>
20      <rect state="0">
21         <color red="0.5" green="0.5" blue="0.5" />
22      </rect>
23      <text string="RED">
24         <color red="0.0" green="0.0" blue="0.0" />
25         <bounds x="0" y="0.1" width="1" height="0.8" />
26      </text>
27   </element>
28
29   <element name="draw">
30      <rect state="1">
31         <color red="1.0" green="1.0" blue="1.0" />
32      </rect>
33      <rect state="0">
34         <color red="0.5" green="0.5" blue="0.5" />
35      </rect>
36      <text string="DRAW">
37         <color red="0.0" green="0.0" blue="0.0" />
38         <bounds x="0" y="0.1" width="1" height="0.8" />
39      </text>
40   </element>
41
42   <element name="black">
43      <rect state="1">
44         <color red="1.0" green="1.0" blue="1.0" />
45      </rect>
46      <rect state="0">
47         <color red="0.5" green="0.5" blue="0.5" />
48      </rect>
49      <text string="BLACK">
50         <color red="0.0" green="0.0" blue="0.0" />
51         <bounds x="0" y="0.1" width="1" height="0.8" />
52      </text>
53   </element>
54
55   <element name="double up">
56      <rect state="1">
57         <color red="0.5" green="0.0" blue="0.7" />
58      </rect>
59      <rect state="0">
60      <color red="0.25" green="0.0" blue="0.35" />
61
62      </rect>
63      <text string="DOUBLE UP">
64         <color red="0.0" green="0.0" blue="0.0" />
65         <bounds x="0" y="0.1" width="1" height="0.8" />
66      </text>
67   </element>
68
69   <element name="service">
70      <rect state="1">
71         <color red="0.0" green="1.0" blue="0.0" />
72      </rect>
73      <rect state="0">
74         <color red="0.0" green="0.5" blue="0.0" />
75      </rect>
76      <text string="SERVICE">
77         <color red="0.0" green="0.0" blue="0.0" />
78         <bounds x="0" y="0.1" width="1" height="0.8" />
79      </text>
80   </element>
81
82   <element name="hold1">
83      <rect state="1">
84         <color red="1.0" green="1.0" blue="1.0" />
85      </rect>
86      <rect state="0">
87         <color red="0.5" green="0.5" blue="0.5" />
88      </rect>
89      <text string="BET 1/HOLD 1">
90         <color red="0.0" green="0.0" blue="0.0" />
91         <bounds x="0" y="0.1" width="1" height="0.8" />
92      </text>
93   </element>
94
95   <element name="hold2">
96      <rect state="1">
97         <color red="1.0" green="1.0" blue="1.0" />
98      </rect>
99      <rect state="0">
100         <color red="0.5" green="0.5" blue="0.5" />
101      </rect>
102      <text string="BET 2/HOLD 2">
103         <color red="0.0" green="0.0" blue="0.0" />
104         <bounds x="0" y="0.1" width="1" height="0.8" />
105      </text>
106   </element>
107
108   <element name="hold3">
109      <rect state="1">
110         <color red="1.0" green="1.0" blue="1.0" />
111      </rect>
112      <rect state="0">
113         <color red="0.5" green="0.5" blue="0.5" />
114      </rect>
115      <text string="BET 3/HOLD 3">
116         <color red="0.0" green="0.0" blue="0.0" />
117         <bounds x="0" y="0.1" width="1" height="0.8" />
118      </text>
119   </element>
120
121   <element name="hold4">
122      <rect state="1">
123         <color red="1.0" green="1.0" blue="1.0" />
124      </rect>
125      <rect state="0">
126         <color red="0.5" green="0.5" blue="0.5" />
127      </rect>
128      <text string="BIG 5/HOLD 4">
129         <color red="0.0" green="0.0" blue="0.0" />
130         <bounds x="0" y="0.1" width="1" height="0.8" />
131      </text>
132   </element>
133
134   <element name="hold5">
135      <rect state="1">
136         <color red="1.0" green="1.0" blue="1.0" />
137      </rect>
138      <rect state="0">
139         <color red="0.5" green="0.5" blue="0.5" />
140      </rect>
141      <text string="HIGH 5/HOLD 5">
142         <color red="0.0" green="0.0" blue="0.0" />
143         <bounds x="0" y="0.1" width="1" height="0.8" />
144      </text>
145   </element>
146
147   <element name="take win">
148      <rect state="1">
149         <color red="1.0" green="0.7" blue="0.0" />
150      </rect>
151      <rect state="0">
152         <color red="0.5" green="0.35" blue="0.0" />
153      </rect>
154      <text string="TAKE WIN">
155         <color red="0.0" green="0.0" blue="0.0" />
156         <bounds x="0" y="0.1" width="1" height="0.8" />
157      </text>
158   </element>
159
160   <element name="light tower1">
161      <disk state="1">
162         <color red="1.0" green="0.0" blue="0.0" />
163      </disk>
164      <disk state="0">
165         <color red="0.5" green="0.0" blue="0.0" />
166      </disk>
167      <text string="">
168         <color red="0.0" green="0.0" blue="0.0" />
169         <bounds x="0" y="0.1" width="1" height="0.8" />
170      </text>
171   </element>
172
173   <element name="light tower2">
174      <disk state="1">
175         <color red="1.0" green="0.0" blue="0.0" />
176      </disk>
177      <disk state="0">
178         <color red="0.5" green="0.0" blue="0.0" />
179      </disk>
180      <text string="">
181         <color red="0.0" green="0.0" blue="0.0" />
182         <bounds x="0" y="0.1" width="1" height="0.8" />
183      </text>
184   </element>
185
186   <element name="light tower3">
187      <disk state="1">
188         <color red="1.0" green="0.0" blue="0.0" />
189      </disk>
190      <disk state="0">
191         <color red="0.5" green="0.0" blue="0.0" />
192      </disk>
193      <text string="">
194         <color red="0.0" green="0.0" blue="0.0" />
195         <bounds x="0" y="0.1" width="1" height="0.8" />
196      </text>
197   </element>
198
199   <element name="light tower4">
200      <disk state="1">
201         <color red="1.0" green="0.0" blue="0.0" />
202      </disk>
203      <disk state="0">
204         <color red="0.5" green="0.0" blue="0.0" />
205      </disk>
206      <text string="">
207         <color red="0.0" green="0.0" blue="0.0" />
208         <bounds x="0" y="0.1" width="1" height="0.8" />
209      </text>
210   </element>
211
212   <element name="auditkey">
213      <rect state="1">
214         <color red="0.5" green="0.35" blue="0.0" />
215      </rect>
216      <rect state="0">
217         <color red="1.0" green="0.7" blue="0.0" />
218      </rect>
219      <text string="Audit Key">
220         <color red="0.0" green="0.0" blue="0.0" />
221         <bounds x="0" y="0.1" width="1" height="0.8" />
222      </text>
223   </element>
224
225   <element name="jackpotkey">
226      <rect state="1">
227         <color red="0.2" green="0.2" blue="0.2" />
228      </rect>
229      <rect state="0">
230         <color red="0.4" green="0.4" blue="0.4" />
231      </rect>
232      <text string="Jackpot Key">
233         <color red="0.0" green="0.0" blue="0.0" />
234         <bounds x="0" y="0.1" width="1" height="0.8" />
235      </text>
236   </element>
237
238   <view name="Button Lamps">
239      <screen index="0">
240         <bounds left="0" top="0" right="4" bottom="3" />
241      </screen>
242
243      <bezel name="lamp6" element="collect">
244         <bounds x="0.67" y="3.02" width="0.31" height="0.24" />
245      </bezel>
246
247      <bezel name="lamp5" element="red">
248         <bounds x="1.08" y="3.02" width="0.31" height="0.24" />
249      </bezel>
250
251      <bezel name="lamp2" element="draw">
252         <bounds x="1.91" y="3.02" width="0.31" height="0.24" />
253      </bezel>
254
255      <bezel name="lamp1" element="black">
256         <bounds x="2.72" y="3.02" width="0.31" height="0.24" />
257      </bezel>
258
259      <bezel name="lamp7" element="double up">
260         <bounds x="3.13" y="3.02" width="0.31" height="0.24" />
261      </bezel>
262
263      <bezel name="lamp12" element="service">
264         <bounds x="0.67" y="3.28" width="0.31" height="0.24" />
265      </bezel>
266
267      <bezel name="lamp4" element="hold1">
268         <bounds x="1.08" y="3.28" width="0.31" height="0.24" />
269      </bezel>
270
271      <bezel name="lamp11" element="hold2">
272         <bounds x="1.49" y="3.28" width="0.31" height="0.24" />
273      </bezel>
274
275      <bezel name="lamp10" element="hold3">
276         <bounds x="1.91" y="3.28" width="0.31" height="0.24" />
277      </bezel>
278
279      <bezel name="lamp9" element="hold4">
280         <bounds x="2.31" y="3.28" width="0.31" height="0.24" />
281      </bezel>
282
283      <bezel name="lamp8" element="hold5">
284         <bounds x="2.72" y="3.28" width="0.31" height="0.24" />
285      </bezel>
286
287      <bezel name="lamp3" element="take win">
288         <bounds x="3.13" y="3.28" width="0.31" height="0.24" />
289      </bezel>
290
291      <bezel name="lamp14" element="light tower1">
292         <bounds x="3.70" y="3.28" width="0.10" height="0.10" />
293      </bezel>
294
295      <bezel name="lamp15" element="light tower2">
296         <bounds x="3.80" y="3.28" width="0.10" height="0.10" />
297      </bezel>
298
299      <bezel name="lamp16" element="light tower3">
300         <bounds x="3.70" y="3.38" width="0.10" height="0.10" />
301      </bezel>
302
303      <bezel name="lamp17" element="light tower4">
304         <bounds x="3.80" y="3.38" width="0.10" height="0.10" />
305      </bezel>
306
307      <bezel name="lamp19" element="auditkey">
308         <bounds x="0.26" y="3.09" width="0.31" height="0.12" />
309      </bezel>
310
311      <bezel name="lamp20" element="jackpotkey">
312         <bounds x="0.26" y="3.34" width="0.31" height="0.12" />
313      </bezel>
314
315   </view>
316</mamelayout>
No newline at end of file
Property changes on: shelves/new_menus/src/mame/layout/gunnrose.lay
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
shelves/new_menus/src/mame/drivers/taitopjc.c
r29303r29304
407407
408408static const powerpc_config ppc603e_config =
409409{
410   XTAL_66_6667MHz,        /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
411   NULL,
412   NULL
410   XTAL_66_6667MHz        /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
413411};
414412
415413
shelves/new_menus/src/mame/drivers/cobra.c
r29303r29304
31213121
31223122static powerpc_config main_ppc_cfg =
31233123{
3124   XTAL_66_6667MHz,        /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
3125   NULL,
3126   NULL
3124   XTAL_66_6667MHz        /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
31273125};
31283126
31293127static powerpc_config gfx_ppc_cfg =
31303128{
3131   XTAL_66_6667MHz,        /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
3132   NULL,
3133   NULL
3129   XTAL_66_6667MHz        /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
31343130};
31353131
31363132
shelves/new_menus/src/mame/drivers/adp.c
r29303r29304
196196   DECLARE_PALETTE_INIT(adp);
197197   DECLARE_WRITE_LINE_MEMBER(duart_irq_handler);
198198   UINT32 screen_update_adp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
199   H63484_DISPLAY_PIXELS_MEMBER( acrtc_display_pixels );
199200   //INTERRUPT_GEN_MEMBER(adp_int);
200201};
201202
202203
203static H63484_DISPLAY_PIXELS( acrtc_display_pixels )
204H63484_DISPLAY_PIXELS_MEMBER( adp_state::acrtc_display_pixels )
204205{
205   bitmap.pix16(y, x) = data & 0xf;
206   if (cliprect.contains(x, y))
207      bitmap.pix16(y, x) = data;
206208}
207209
208210UINT32 adp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
r29303r29304
645647   AM_RANGE(0x80000, 0xfffff) AM_RAM
646648ADDRESS_MAP_END
647649
648static H63484_INTERFACE( adp_h63484_intf )
649{
650   acrtc_display_pixels
651};
652
653650static MACHINE_CONFIG_START( quickjac, adp_state )
654651
655652   MCFG_CPU_ADD("maincpu", M68000, 8000000)
r29303r29304
678675
679676   MCFG_PALETTE_INIT_OWNER(adp_state,adp)
680677
681   MCFG_H63484_ADD("h63484", 0, adp_h63484_intf, adp_h63484_map)
678   MCFG_H63484_ADD("h63484", 0, adp_h63484_map)
679   MCFG_H63484_DISPLAY_CALLBACK_OWNER(adp_state, acrtc_display_pixels)
682680
683681   MCFG_SPEAKER_STANDARD_MONO("mono")
684682   MCFG_SOUND_ADD("aysnd", AY8910, 3686400/2)
r29303r29304
702700MACHINE_CONFIG_END
703701
704702static MACHINE_CONFIG_DERIVED( fashiong, skattv )
705   MCFG_DEVICE_REMOVE("h63484")
706   MCFG_H63484_ADD("h63484", 0, adp_h63484_intf, fashiong_h63484_map)
703   MCFG_DEVICE_MODIFY("h63484")
704   MCFG_H63484_ADDRESS_MAP(fashiong_h63484_map)
707705MACHINE_CONFIG_END
708706
709707static MACHINE_CONFIG_DERIVED( funland, quickjac )
r29303r29304
713711   MCFG_DEVICE_REMOVE("palette")
714712   MCFG_PALETTE_ADD_INIT_BLACK("palette", 0x100)
715713
716   MCFG_DEVICE_REMOVE("h63484")
717   MCFG_H63484_ADD("h63484", 0, adp_h63484_intf, fstation_h63484_map)
714   MCFG_DEVICE_MODIFY("h63484")
715   MCFG_H63484_ADDRESS_MAP(fstation_h63484_map)
718716MACHINE_CONFIG_END
719717
720718static MACHINE_CONFIG_DERIVED( fstation, funland )
shelves/new_menus/src/mame/drivers/konamim2.c
r29303r29304
11501150
11511151static const powerpc_config ppc602_config =
11521152{
1153   33000000,           /* Multiplier 2, Bus = 33MHz, Core = 66MHz */
1154   NULL,
1155   NULL
1153   33000000           /* Multiplier 2, Bus = 33MHz, Core = 66MHz */
11561154};
11571155
11581156INTERRUPT_GEN_MEMBER(konamim2_state::m2)
shelves/new_menus/src/mame/drivers/4enlinea.c
r29303r29304
1313  1x AY-3-8910 A
1414  1x UMC UM487F (HCGA Controller)
1515
16  2x NEC D41464C (64K x 4-bit Dynamic NMOS RAM).
16  2x NEC D41464C (64K x 4-bit Dynamic NMOS RAM) for VRAM.
1717  1x UMC UM6264A (8K x 8-bit CMOS SRAM).
1818
1919  2x 27512 EPROMS.
r29303r29304
2929  1x 8.000 MHz crystal.   ; Divided by 2 for audio CPU Z84C00AB6.
3030  1x 14.31818 MHz crystal ; For HCGA controller.
3131
32  CN1: 1 x 8 connector.
33  CN2: 1 x 8 connector.
34  CN3: 2 x 5 connector.
35  CN4: 2 x 5 connector.
36  CN5: 2 x 5 connector.
37  CN6: 2 x 28 Jamma connector.
38  CN7: 1 x 20 connector.
39  CN8: 1 x 4 connector.
40  CN9: 1 x 4 connector.
41  CN10: DB9 video out connector.
42  CN11 1 x 2 bridge connector.
43
3244**************************************************************************
3345
3446  UM487F HCGA Controller notes...
r29303r29304
321333                     1: Vertical sync period.
322334
323335*/
324   //logerror("CRTC status read\n");
325   return (m_screen->vpos() >= 200) ? 0x80 : 0x00;
326
327//   return (machine().rand() & 0x80);   /* bit 7 ??? (it's suppossed to be unused in CGA mode) */
336   return (m_screen->vpos() >= 200) ? 0x80 : 0x00;    // bit 7 is suppossed to be unused in CGA mode
328337}
329338
330339READ8_MEMBER(_4enlinea_state::unk_e000_r)
r29303r29304
390399***********************************/
391400
392401static INPUT_PORTS_START( 4enlinea )
393   PORT_START("DSW1")
394   PORT_DIPNAME( 0x01, 0x00, "0-0")
395   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
396   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
397   PORT_DIPNAME( 0x02, 0x00, "0-1")
398   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
399   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
400   PORT_DIPNAME( 0x04, 0x00, "0-2")
401   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
402   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
403   PORT_DIPNAME( 0x08, 0x00, "0-3")
404   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
405   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
406   PORT_DIPNAME( 0x10, 0x00, "0-4")
407   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
408   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
409   PORT_DIPNAME( 0x20, 0x00, "0-5")
410   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
411   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
412   PORT_DIPNAME( 0x40, 0x00, "0-6")
413   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
414   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
415   PORT_DIPNAME( 0x80, 0x00, "0-7")
416   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
417   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
418402
419   PORT_START("DSW2")
420   PORT_DIPNAME( 0x01, 0x00, "0-0")
421   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
422   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
423   PORT_DIPNAME( 0x02, 0x00, "0-1")
424   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
425   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
426   PORT_DIPNAME( 0x04, 0x00, "0-2")
427   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
428   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
429   PORT_DIPNAME( 0x08, 0x00, "0-3")
430   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
431   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
432   PORT_DIPNAME( 0x10, 0x00, "0-4")
433   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
434   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
435   PORT_DIPNAME( 0x20, 0x00, "0-5")
436   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
437   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
438   PORT_DIPNAME( 0x40, 0x00, "0-6")
439   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
440   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
441   PORT_DIPNAME( 0x80, 0x00, "0-7")
442   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
443   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
403/*  Player 1 & 2 ports are tied to both AY-3-8910 ports.
404    Coin 1 & 2 are tied to the big ES2 9046 CPLD/FPGA,
405    so... It's a mystery to figure out.
406*/
407   PORT_START("IN-P1")
408   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
409   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY  PORT_PLAYER(1)
410   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY  PORT_PLAYER(1)
411   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY  PORT_PLAYER(1)
412   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY  PORT_PLAYER(1)
413   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )                   PORT_PLAYER(1)
414   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )                   PORT_PLAYER(1)
415   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
416
417   PORT_START("IN-P2")
418   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
419   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY  PORT_PLAYER(2)
420   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY  PORT_PLAYER(2)
421   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY  PORT_PLAYER(2)
422   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY  PORT_PLAYER(2)
423   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )                   PORT_PLAYER(2)
424   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )                   PORT_PLAYER(2)
425   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
444426INPUT_PORTS_END
445427
446428
r29303r29304
516498{
517499   AY8910_LEGACY_OUTPUT,
518500   AY8910_DEFAULT_LOADS,
501   DEVCB_INPUT_PORT("IN-P2"),
502   DEVCB_INPUT_PORT("IN-P1"),
519503   DEVCB_NULL,
520   DEVCB_NULL,
521   DEVCB_NULL,
522504   DEVCB_NULL
523505};
524506
shelves/new_menus/src/mame/drivers/taitotz.c
r29303r29304
26602660
26612661static const powerpc_config ppc603e_config =
26622662{
2663   XTAL_66_6667MHz,        /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
2664   NULL,
2665   NULL
2663   XTAL_66_6667MHz        /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
26662664};
26672665
26682666
shelves/new_menus/src/mame/drivers/uapce.c
r29303r29304
311311}
312312
313313
314static const huc6270_interface pce_huc6270_config =
315{
316   0x10000,
317   DEVCB_DRIVER_LINE_MEMBER(uapce_state,pce_irq_changed)
318};
319
320
321314static const huc6260_interface pce_huc6260_config =
322315{
323316   DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, next_pixel ),
r29303r29304
343336   MCFG_SCREEN_PALETTE("huc6260:palette")
344337
345338   MCFG_HUC6260_ADD( "huc6260", PCE_MAIN_CLOCK, pce_huc6260_config )
346   MCFG_HUC6270_ADD( "huc6270", pce_huc6270_config )
339   MCFG_DEVICE_ADD( "huc6270", HUC6270, 0 )
340   MCFG_HUC6270_VRAM_SIZE(0x10000)
341   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(uapce_state, pce_irq_changed))
347342
348343   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
349344   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
shelves/new_menus/src/mame/drivers/model3.c
r29303r29304
54035403static const powerpc_config model3_10 =
54045404{
54055405   /* 603e, Stretch, 1.3 */
5406   66000000,       /* Multiplier 1, Bus = 66MHz, Core = 66MHz */
5407   NULL,
5408   NULL
5406   66000000       /* Multiplier 1, Bus = 66MHz, Core = 66MHz */
54095407};
54105408
54115409static const powerpc_config model3_15 =
54125410{
54135411   /* 603e, Stretch, 1.3 */
5414   66000000,       /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
5415   NULL,
5416   NULL
5412   66000000       /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
54175413};
54185414
54195415static const powerpc_config model3_2x =
54205416{
54215417   /* 603e-PID7t, Goldeneye, 2.1 */
5422   66000000,       /* Multiplier 2.5, Bus = 66MHz, Core = 166MHz */
5423   NULL,
5424   NULL
5418   66000000       /* Multiplier 2.5, Bus = 66MHz, Core = 166MHz */
54255419};
54265420
54275421static MACHINE_CONFIG_START( model3_10, model3_state )
shelves/new_menus/src/mame/drivers/namcos23.c
r29303r29304
14271427   UINT32 m_tile_mask;
14281428   UINT32 m_ptrom_limit;
14291429
1430   int m_vblank_count;
1431
14301432// It may only be 128
14311433// At 0x1e bytes per slot, rounded up to 0x20, that's 0x1000 to 0x2000 bytes.
14321434// That fits pretty much anywhere, including inside a IC
r29303r29304
16031605   return m_matrices[id];
16041606}
16051607
1606void namcos23_state::c435_matrix_matrix_mul() // 000.
1608void namcos23_state::c435_matrix_matrix_mul() // 0.0
16071609{
1608   if(m_c435_buffer[0] != 0x0004)
1610   if((m_c435_buffer[0] & 0xf) != 4)
16091611   {
16101612      logerror("WARNING: c435_matrix_matrix_mul with size %d\n", m_c435_buffer[0] & 0xf);
16111613      return;
r29303r29304
16141616      logerror("WARNING: c435_matrix_matrix_mul with +2=%04x\n", m_c435_buffer[3]);
16151617
16161618   INT16 *t        = c435_getm(m_c435_buffer[1]);
1617   const INT16 *m1 = c435_getm(m_c435_buffer[2]);
1618   const INT16 *m2 = c435_getm(m_c435_buffer[4]);
1619   const INT16 *m2 = c435_getm(m_c435_buffer[2]);
1620   const INT16 *m1 = c435_getm(m_c435_buffer[4]);
16191621
1620   t[0] = INT16((m1[0]*m2[0] + m1[1]*m2[3] + m1[2]*m2[6]) >> 14);
1621   t[1] = INT16((m1[0]*m2[1] + m1[1]*m2[4] + m1[2]*m2[7]) >> 14);
1622   t[2] = INT16((m1[0]*m2[2] + m1[1]*m2[5] + m1[2]*m2[8]) >> 14);
1623   t[3] = INT16((m1[3]*m2[0] + m1[4]*m2[3] + m1[5]*m2[6]) >> 14);
1624   t[4] = INT16((m1[3]*m2[1] + m1[4]*m2[4] + m1[5]*m2[7]) >> 14);
1625   t[5] = INT16((m1[3]*m2[2] + m1[4]*m2[5] + m1[5]*m2[8]) >> 14);
1626   t[6] = INT16((m1[6]*m2[0] + m1[7]*m2[3] + m1[8]*m2[6]) >> 14);
1627   t[7] = INT16((m1[6]*m2[1] + m1[7]*m2[4] + m1[8]*m2[7]) >> 14);
1628   t[8] = INT16((m1[6]*m2[2] + m1[7]*m2[5] + m1[8]*m2[8]) >> 14);
1622   t[0] = INT16((m1[0]*m2[0] + m1[1]*m2[1] + m1[2]*m2[2]) >> 14);
1623   t[1] = INT16((m1[0]*m2[3] + m1[1]*m2[4] + m1[2]*m2[5]) >> 14);
1624   t[2] = INT16((m1[0]*m2[6] + m1[1]*m2[7] + m1[2]*m2[8]) >> 14);
1625   t[3] = INT16((m1[3]*m2[0] + m1[4]*m2[1] + m1[5]*m2[2]) >> 14);
1626   t[4] = INT16((m1[3]*m2[3] + m1[4]*m2[4] + m1[5]*m2[5]) >> 14);
1627   t[5] = INT16((m1[3]*m2[6] + m1[4]*m2[7] + m1[5]*m2[8]) >> 14);
1628   t[6] = INT16((m1[6]*m2[0] + m1[7]*m2[1] + m1[8]*m2[2]) >> 14);
1629   t[7] = INT16((m1[6]*m2[3] + m1[7]*m2[4] + m1[8]*m2[5]) >> 14);
1630   t[8] = INT16((m1[6]*m2[6] + m1[7]*m2[7] + m1[8]*m2[8]) >> 14);
16291631}
16301632
1631void namcos23_state::c435_matrix_set() // 004.
1633void namcos23_state::c435_matrix_vector_mul() // 0.1
16321634{
1633   if(m_c435_buffer[0] != 0x004a)
1635   if((m_c435_buffer[0] & 0xf) != 4)
16341636   {
1635      logerror("WARNING: c435_matrix_set with size %d\n", m_c435_buffer[0] & 0xf);
1636      return;
1637   }
1638   INT16 *t = c435_getm(m_c435_buffer[1]);
1639   for(int i=0; i<9; i++)
1640      t[i] = m_c435_buffer[i+2];
1641}
1642
1643void namcos23_state::c435_vector_set() // 005.
1644{
1645   if(m_c435_buffer[0] != 0x0057)
1646   {
1647      logerror("WARNING: c435_vector_set with size %d\n", m_c435_buffer[0] & 0xf);
1648      return;
1649   }
1650   INT32 *t = c435_getv(m_c435_buffer[1]);
1651   for(int i=0; i<3; i++)
1652      t[i] = u32_to_s24((m_c435_buffer[2*i+2] << 16) | m_c435_buffer[2*i+3]);
1653}
1654
1655void namcos23_state::c435_matrix_vector_mul() // 081.
1656{
1657   if(m_c435_buffer[0] != 0x0814)
1658   {
16591637      logerror("WARNING: c435_matrix_vector_mul with size %d\n", m_c435_buffer[0] & 0xf);
16601638      return;
16611639   }
r29303r29304
16671645   const INT32 *v = c435_getv(m_c435_buffer[4]);
16681646
16691647   t[0] = INT32((m[0]*INT64(v[0]) + m[1]*INT64(v[1]) + m[2]*INT64(v[2])) >> 14);
1670   t[1] = INT32((m[3]*INT64(v[0]) + m[4]*INT64(v[1]) + m[7]*INT64(v[2])) >> 14);
1648   t[1] = INT32((m[3]*INT64(v[0]) + m[4]*INT64(v[1]) + m[5]*INT64(v[2])) >> 14);
16711649   t[2] = INT32((m[6]*INT64(v[0]) + m[7]*INT64(v[1]) + m[8]*INT64(v[2])) >> 14);
16721650}
16731651
1674void namcos23_state::c435_vector_matrix_mul() // 101.
1652void namcos23_state::c435_matrix_set() // 0.4
16751653{
1676   if(m_c435_buffer[0] != 0x1014)
1654   if((m_c435_buffer[0] & 0xf) != 10)
16771655   {
1678      logerror("WARNING: c435_vector_matrix_mul with size %d\n", m_c435_buffer[0] & 0xf);
1656      logerror("WARNING: c435_matrix_set with size %d\n", m_c435_buffer[0] & 0xf);
16791657      return;
16801658   }
1681   if(m_c435_buffer[3] != 0xffff)
1682      logerror("WARNING: c435_vector_matrix_mul with [3]=%04x\n", m_c435_buffer[3]);
1659   INT16 *t = c435_getm(m_c435_buffer[1]);
1660   for(int i=0; i<9; i++)
1661      t[i] = m_c435_buffer[i+2];
1662}
16831663
1684   INT32 *t       = c435_getv(m_c435_buffer[1]);
1685   const INT16 *m = c435_getm(m_c435_buffer[2]);
1686   const INT32 *v = c435_getv(m_c435_buffer[4]);
1687
1688   t[0] = INT32((m[0]*INT64(v[0]) + m[3]*INT64(v[1]) + m[6]*INT64(v[2])) >> 14);
1689   t[1] = INT32((m[1]*INT64(v[0]) + m[4]*INT64(v[1]) + m[7]*INT64(v[2])) >> 14);
1690   t[2] = INT32((m[2]*INT64(v[0]) + m[5]*INT64(v[1]) + m[8]*INT64(v[2])) >> 14);
1664void namcos23_state::c435_vector_set() // 0.5
1665{
1666   if((m_c435_buffer[0] & 0xf) != 7)
1667   {
1668      logerror("WARNING: c435_vector_set with size %d\n", m_c435_buffer[0] & 0xf);
1669      return;
1670   }
1671   INT32 *t = c435_getv(m_c435_buffer[1]);
1672   for(int i=0; i<3; i++)
1673      t[i] = u32_to_s24((m_c435_buffer[2*i+2] << 16) | m_c435_buffer[2*i+3]);
16911674}
16921675
1693void namcos23_state::c435_scaling_set() // 44..
1676void namcos23_state::c435_scaling_set() // 4.4
16941677{
1695   if(m_c435_buffer[0] != 0x4401)
1678   if((m_c435_buffer[0] & 0xff) != 1)
16961679   {
16971680      logerror("WARNING: c435_scaling_set with size %d\n", m_c435_buffer[0] & 0xff);
16981681      return;
r29303r29304
17001683   m_scaling = m_c435_buffer[1];
17011684}
17021685
1703void namcos23_state::c435_state_set_interrupt() // 4f.. 0001
1686void namcos23_state::c435_state_set_interrupt() // 4.f.0001
17041687{
17051688   if(m_c435_buffer[0] != 0x4f02)
17061689   {
r29303r29304
17131696      update_main_interrupts(m_main_irqcause & ~MAIN_C435_IRQ);
17141697}
17151698
1716void namcos23_state::c435_state_set() // 4f..
1699void namcos23_state::c435_state_set() // 4.f
17171700{
1718   if(m_c435_buffer[0] == 0x4f00)
1701   if((m_c435_buffer[0] & 0xff) == 0)
17191702   {
17201703      logerror("WARNING: c435_state_set with size %d\n", m_c435_buffer[0] & 0xff);
17211704      return;
r29303r29304
17281711   }
17291712}
17301713
1731void namcos23_state::c435_render() // 800. 808.
1714void namcos23_state::c435_render() // 8
17321715{
1733   if(m_c435_buffer[0] != 0x8003 && m_c435_buffer[0] != 0x8083)
1716   if((m_c435_buffer[0] & 0xf) != 3)
17341717   {
1735      logerror("WARNING: c435_render with header %04x\n", m_c435_buffer[0]);
1718      logerror("WARNING: c435_render with size %d, header %04x", m_c435_buffer[0] & 0xf, m_c435_buffer[0]);
17361719      return;
17371720   }
17381721
r29303r29304
17681751   render.count[render.cur]++;
17691752}
17701753
1771void namcos23_state::c435_flush() // c00.
1754void namcos23_state::c435_flush() // c
17721755{
1773   if(m_c435_buffer[0] != 0xc000)
1756   if((m_c435_buffer[0] & 0xf) != 0)
17741757   {
17751758      logerror("WARNING: c435_flush with size %d\n", m_c435_buffer[0] & 0xf);
17761759      return;
r29303r29304
17871770{
17881771   m_c435_buffer[m_c435_buffer_pos++] = data;
17891772   UINT16 h = m_c435_buffer[0];
1790   UINT16 h1;
17911773   int psize;
1792   if(h & 0x4000)
1793   {
1794      h1 = h & 0xff00;
1774   if((h & 0x4000) == 0x4000)
17951775      psize = h & 0xff;
1796   }
17971776   else
1798   {
1799      h1 = h & 0xfff0;
18001777      psize = h & 0xf;
1801   }
18021778   if(m_c435_buffer_pos < psize+1)
18031779      return;
18041780
1805   switch(h1)
1806   {
1807   case 0x0000: c435_matrix_matrix_mul(); break;
1808   case 0x0040: c435_matrix_set(); break;
1809   case 0x0050: c435_vector_set(); break;
1810   case 0x0810: c435_matrix_vector_mul(); break;
1811   case 0x1010: c435_vector_matrix_mul(); break;
1812   case 0x4400: c435_scaling_set(); break;
1813   case 0x4f00: c435_state_set(); break;
1814   case 0x8000: c435_render(); break;
1815   case 0x8080: c435_render(); break;
1816   case 0xc000: c435_flush(); break;
1817   default:
1818      if(1)
1819      {
1820         logerror("c435 - [%04x]", h1);
1821         for(int i=0; i<m_c435_buffer_pos; i++)
1822            logerror(" %04x", m_c435_buffer[i]);
1823         logerror("\n");
1781   bool known = true;
1782   switch(h & 0xc000) {
1783   case 0x0000:
1784      switch(h & 0xf0) {
1785      case 0x00: c435_matrix_matrix_mul(); break;
1786      case 0x10: c435_matrix_vector_mul(); break;
1787      case 0x40: c435_matrix_set(); break;
1788      case 0x50: c435_vector_set(); break;
1789      default: known = false; break;
18241790      }
18251791      break;
1792
1793   case 0x4000:
1794      switch(h & 0xf00) {
1795      case 0x400: c435_scaling_set(); break;
1796      case 0xf00: c435_state_set(); break;
1797      default: known = false; break;
1798      }
1799      break;
1800
1801   case 0x8000: c435_render(); break;
1802   case 0xc000: c435_flush(); break;
18261803   }
1804
1805   if(!known) {
1806      logerror("c435 -");
1807      for(int i=0; i<m_c435_buffer_pos; i++)
1808         logerror(" %04x", m_c435_buffer[i]);
1809      logerror("\n");
1810   }
1811
18271812   m_c435_buffer_pos = 0;
18281813}
18291814
r29303r29304
19021887
19031888void namcos23_state::render_apply_transform(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, poly_vertex &pv)
19041889{
1905   pv.x =    (INT32((re->model.m[0]*INT64(xi) + re->model.m[3]*INT64(yi) + re->model.m[6]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[0])/16384.0;
1906   pv.y =    (INT32((re->model.m[1]*INT64(xi) + re->model.m[4]*INT64(yi) + re->model.m[7]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[1])/16384.0;
1907   pv.p[0] = (INT32((re->model.m[2]*INT64(xi) + re->model.m[5]*INT64(yi) + re->model.m[8]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[2])/16384.0;
1890   pv.x =    (INT32((re->model.m[0]*INT64(xi) + re->model.m[1]*INT64(yi) + re->model.m[2]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[0])/16384.0;
1891   pv.y =    (INT32((re->model.m[3]*INT64(xi) + re->model.m[4]*INT64(yi) + re->model.m[5]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[1])/16384.0;
1892   pv.p[0] = (INT32((re->model.m[6]*INT64(xi) + re->model.m[7]*INT64(yi) + re->model.m[8]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[2])/16384.0;
19081893}
19091894
19101895void namcos23_state::render_apply_matrot(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, INT32 &x, INT32 &y, INT32 &z)
r29303r29304
19631948      UINT32 type = m_ptrom[adr++];
19641949      UINT32 h    = m_ptrom[adr++];
19651950
1966
19671951      float tbase = (type >> 24) << 12;
19681952      UINT8 color = (h >> 24) & 0x7f;
19691953      int lmode = (type >> 19) & 3;
r29303r29304
20041988
20051989         switch(lmode)
20061990         {
2007         case 0: case 1:
1991         case 0:
20081992            pv[i].p[3] = ((light >> (8*(3-i))) & 0xff) / 64.0;
20091993            break;
1994         case 1:
1995            pv[i].p[3] = ((light >> (8*(3-i))) & 0xff) / 64.0;
1996            break;
20101997         case 2:
20111998            pv[i].p[3] = 1.0;
20121999            break;
r29303r29304
20182005            INT32 nz = u32_to_s10(norm);
20192006            INT32 nrx, nry, nrz;
20202007            render_apply_matrot(nx, ny, nz, re, nrx, nry, nrz);
2021
20222008            float lsi = float(nrx*m_light_vector[0] + nry*m_light_vector[1] + nrz*m_light_vector[2])/4194304.0;
20232009            if(lsi < 0)
20242010               lsi = 0;
20252011
20262012            // Mapping taken out of a hat
2027            pv[i].p[3] = 0.5+lsi;
2013            pv[i].p[3] = 0.25+1.5*lsi;
20282014            break;
20292015         }
20302016         }
r29303r29304
22012187   if (m_c404.layer & 4)
22022188      m_bgtilemap->draw(screen, bitmap, cliprect, 0, 0);
22032189
2190   m_vblank_count++;
2191
22042192   return 0;
22052193}
22062194
r29303r29304
23232311         m_c417.pointrom_adr = 0;
23242312         break;
23252313      case 4:
2326         //logerror("c417_w %04x = %04x (%08x, %08x)\n", c417.adr, data, space.device().safe_pc(), (unsigned int)space.device().state().state_int(MIPS3_R31));
2314         //logerror("c417_w %04x = %04x (%08x, %08x)\n", m_c417.adr, data, space.device().safe_pc(), (unsigned int)space.device().state().state_int(MIPS3_R31));
23272315         COMBINE_DATA(m_c417.ram + m_c417.adr);
23282316         break;
23292317      case 7:
r29303r29304
31643152   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
31653153
31663154   PORT_START("SERVICE")
3167   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
3155   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE )
31683156
31693157   PORT_START("DSW")
31703158   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
r29303r29304
32223210
32233211void namcos23_state::machine_reset()
32243212{
3213   m_vblank_count = 0;
32253214   m_c435_buffer_pos = 0;
32263215   m_subcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
32273216}
shelves/new_menus/src/mame/drivers/tourvis.c
r29303r29304
369369}
370370
371371
372static const huc6270_interface pce_huc6270_config =
373{
374   0x10000,
375   DEVCB_DRIVER_LINE_MEMBER(tourvision_state,pce_irq_changed)
376};
377
378
379372static const huc6260_interface pce_huc6260_config =
380373{
381374   DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, next_pixel ),
r29303r29304
401394   MCFG_SCREEN_PALETTE("huc6260:palette")
402395
403396   MCFG_HUC6260_ADD( "huc6260", PCE_MAIN_CLOCK, pce_huc6260_config )
404   MCFG_HUC6270_ADD( "huc6270", pce_huc6270_config )
397   MCFG_DEVICE_ADD( "huc6270", HUC6270, 0 )
398   MCFG_HUC6270_VRAM_SIZE(0x10000)
399   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(tourvision_state, pce_irq_changed))
405400
406401
407402   MCFG_I8155_ADD("i8155", 1000000 /*?*/, i8155_intf)
shelves/new_menus/src/mame/drivers/ggconnie.c
r29303r29304
180180   "maincpu"
181181};
182182
183static const huc6270_interface sgx_huc6270_0_config =
184{
185   0x10000,
186   DEVCB_DRIVER_LINE_MEMBER(pce_common_state,pce_irq_changed)
187};
188
189
190static const huc6270_interface sgx_huc6270_1_config =
191{
192   0x10000,
193   DEVCB_DRIVER_LINE_MEMBER(pce_common_state,pce_irq_changed)
194};
195
196
197183static const huc6202_interface sgx_huc6202_config =
198184{
199185   DEVCB_DEVICE_MEMBER16( "huc6270_0", huc6270_device, next_pixel ),
r29303r29304
232218   MCFG_SCREEN_PALETTE("huc6260:palette")
233219
234220   MCFG_HUC6260_ADD( "huc6260", PCE_MAIN_CLOCK/3, sgx_huc6260_config )
235   MCFG_HUC6270_ADD( "huc6270_0", sgx_huc6270_0_config )
236   MCFG_HUC6270_ADD( "huc6270_1", sgx_huc6270_1_config )
221   MCFG_DEVICE_ADD( "huc6270_0", HUC6270, 0 )
222   MCFG_HUC6270_VRAM_SIZE(0x10000)
223   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pce_common_state, pce_irq_changed))
224   MCFG_DEVICE_ADD( "huc6270_1", HUC6270, 0 )
225   MCFG_HUC6270_VRAM_SIZE(0x10000)
226   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pce_common_state, pce_irq_changed))
237227   MCFG_HUC6202_ADD( "huc6202", sgx_huc6202_config )
238228
239229   MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz)
shelves/new_menus/src/mame/drivers/aristmk4.c
r29303r29304
1212    ***************** INITIALISATION *********************************************************************
1313
1414    Method 1 :
15    * Key in with the Jackpot Key followed by the Audit Key
15    * Key in with the Jackpot Key followed by the Audit Key (K+L Keys)
16    * Hit UP (W key) twice (for gunnrose only)
1617    * Press PB4, PB5 and PB6 keys simultaneously (Z+X+C keys by default)
1718    * A value (displayed below) will appear next to RF/AMT on the right of the screen
1819    * Key out both the Jackpot and Audit Keys
20   
1921
2022    This method works with the following games:
2123    3bagflnz 200
r29303r29304
3638    swtht2nz 200
3739    wildone  200
3840    wtigernz 200
41    gunnrose
3942
4043    Method 2 :
4144    * Key in with the Jackpot Key followed by the Audit Key
r29303r29304
6568    eforest
6669    fhunter
6770    fhuntera
68
71   
6972    Technical Notes:
7073
7174    68B09EP Motorola Processor
r29303r29304
173176    Promoted Fortune Hunter and clone to working status, as they were in fact working for quite a while.
174177    Fixed ROM names for kgbird/kgbirda; 5c and 10c variants were mixed up.
175178
176    11/12/13 - Lord-Data
179    11/12/2014 - Lord-Data
177180    Added hopper and meter outputs.
178181
182    27/03/2014
183    Added new game: Gun's and Roses Poker - gunnrose
184
179185    ****************************************************************************
180186
181187    When the games first power on (or when reset), they will display a TILT message on the screen. This doesn't affect gameplay, and if there are no pending errors the game should coin up and/or play immediately.
r29303r29304
272278#include "kgbird.lh"   // NZ 25cr with double up
273279#include "topgear.lh"  // NZ 5 line without gamble
274280#include "wildone.lh"  // Video poker
281#include "gunnrose.lh" // Video poker
275282#include "gldnpkr.lh"  // Video poker
276283
277284UINT8 crtc_cursor_index = 0;
r29303r29304
23712378   //  ROM_LOAD( "prom.x", 0x00, 0x20, NO_DUMP )
23722379ROM_END
23732380
2381ROM_START( gunnrose ) // MK2.5
2382   ROM_REGION(0x10000, "maincpu", 0 )
2383      /* VIDEO AND SOUND EPROM */
2384   ROM_LOAD("gnr.u7", 0x06000, 0x2000, CRC(fe7d0ea4) SHA1(3F3F4809534065C33ECA2CFFF0D1D2A3E3992406))   // 1VL/SH136 RED AND BLACK
2385
2386      /* GAME EPROMS */
2387   ROM_LOAD("gnr.u9", 0x08000, 0x8000, CRC(4fb5f757) SHA1(A4129BCA7E573FAAC0D11DE41A9BF8EA144091EE))   // E/C606191SMP
2388
2389      /* SHAPE EPROMS */
2390   ROM_REGION(0xc000, "tile_gfx", 0 )
2391   ROM_LOAD("gnr.u8",  0x00000, 0x2000, CRC(dec9e695) SHA1(A596C4243D6D39E0611FF714E19E14188C90B6F1))   // 1VL/SH136 RED AND BLACK
2392   ROM_LOAD("gnr.u10", 0x02000, 0x2000, CRC(e83b8e79) SHA1(595F41A5F59F938581A57B445370AA716C6B1409))   // 1VL/SH136 RED AND BLACK
2393   ROM_LOAD("gnr.u12", 0x04000, 0x2000, CRC(9134d029) SHA1(D698FB91D8F5FA78FFD056149421008D3F12C456))   // 1VL/SH136 RED AND BLACK
2394   ROM_LOAD("gnr.u9t", 0x06000, 0x2000, CRC(73a0c2cd) SHA1(662056D570EAA069483D378B77EFCFB42EFF6D0D))   // E/C606191SMP
2395   ROM_LOAD("gnr.u11", 0x08000, 0x2000, CRC(c50adffe) SHA1(A7C4A3CDD4D5D31A1420E47859408CAA75CE2636))   // 1VL/SH136 RED AND BLACK
2396   ROM_LOAD("gnr.u13", 0x0a000, 0x2000, CRC(e0a6bfc5) SHA1(07E4C8191503F0EA2DE4F7CE18FE6290D20EF80E))   // 1VL/SH136 RED AND BLACK
2397
2398      /* COLOR PROM */
2399   ROM_REGION(0x200, "proms", 0 ) /* are either of these correct?  They are taken from different games */
2400   //ROM_LOAD("2cm07.u71", 0x0000, 0x0200, CRC(1e3f402a) SHA1(f38da1ad6607df38add10c69febf7f5f8cd21744)) // Using 2CM07 until a correct PROM is confirmed
2401   ROM_LOAD("1cm48.u71", 0x0000, 0x0200, BAD_DUMP CRC(81daeeb0) SHA1(7dfe198c6def5c4ae4ecac488d65c2911fb3a890))
2402   
2403ROM_END
2404
23742405GAMEL( 1985, 86lions,  0,        86lions,  aristmk4, aristmk4_state, aristmk4, ROT0, "Aristocrat", "86 Lions", GAME_NOT_WORKING, layout_topgear )
23752406GAMEL( 1996, eforest,  0,        aristmk4, eforest,  aristmk4_state, aristmk4, ROT0, "Aristocrat", "Enchanted Forest (12XF528902, US)",         0, layout_eforest  )
23762407GAMEL( 1995, eforesta, eforest,  aristmk4, aristmk4, aristmk4_state, aristmk4, ROT0, "Aristocrat", "Enchanted Forest (4VXFC818, NSW)",          0, layout_aristmk4 ) // 10c, $1 = 10 credits
r29303r29304
23972428GAMEL( 1996, arcwins,  0,        aristmk4, arcwins,  aristmk4_state, aristmk4, ROT0, "Aristocrat", "Arctic Wins (4XF5227H03, USA)",             0, layout_arcwins  )
23982429GAMEL( 1997, wildone,  0,  aristmk4_poker, wildone,  aristmk4_state, aristmk4, ROT0, "Aristocrat", "Wild One (4VXEC5357, New Zealand)",         0, layout_wildone  ) // 20c, $2 = 10 credits, video poker
23992430GAMEL( 1986, gldnpkr,  0,  aristmk4_poker, gldnpkr,  aristmk4_state, aristmk4, ROT0, "Ainsworth Nominees P.L.", "Golden Poker (8VXEC037, New Zealand)", 0, layout_gldnpkr ) // possibly 20c, 1 coin = 1 credit, video poker
2431GAMEL( 1993, gunnrose, 0,  aristmk4_poker, wildone,  aristmk4_state, aristmk4, ROT0, "Aristocrat", "Guns and Roses (C606191SMP, Australia)",    GAME_WRONG_COLORS, layout_gunnrose  )
shelves/new_menus/src/mame/drivers/viper.c
r29303r29304
19881988
19891989static const powerpc_config viper_ppc_cfg =
19901990{
1991   100000000,
1992   NULL,
1993   NULL
1991   100000000
19941992};
19951993
19961994INTERRUPT_GEN_MEMBER(viper_state::viper_vblank)
shelves/new_menus/src/mame/drivers/slapfght.c
r29303r29304
1212 
1313  TODO:
1414  - proper MCU emulation (mame/machine/slapfght.c)
15  - alcon cocktail/flipscreen, it doesn't write to the flipscreen reg
1516
1617
1718****************************************************************************
r29303r29304
271272   AM_RANGE(0x0000, 0x7fff) AM_ROM
272273   AM_RANGE(0x8000, 0x87ff) AM_RAM
273274   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_SHARE("share1")
274   AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(slapfight_videoram_w) AM_SHARE("videoram")
275   AM_RANGE(0x9800, 0x9fff) AM_RAM_WRITE(slapfight_colorram_w) AM_SHARE("colorram")
275   AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
276   AM_RANGE(0x9800, 0x9fff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
276277   AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE("spriteram")
277278ADDRESS_MAP_END
278279
r29303r29304
281282   AM_RANGE(0x0000, 0xbfff) AM_ROM
282283   AM_RANGE(0xc000, 0xc7ff) AM_RAM
283284   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1")
284   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(slapfight_videoram_w) AM_SHARE("videoram")
285   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(slapfight_colorram_w) AM_SHARE("colorram")
285   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
286   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
286287   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("spriteram")
287   AM_RANGE(0xe800, 0xe800) AM_WRITEONLY AM_SHARE("scrollx_lo")
288   AM_RANGE(0xe801, 0xe801) AM_WRITEONLY AM_SHARE("scrollx_hi")
289   AM_RANGE(0xe802, 0xe802) AM_WRITEONLY AM_SHARE("scrolly")
288   AM_RANGE(0xe800, 0xe800) AM_WRITE(scrollx_lo_w)
289   AM_RANGE(0xe801, 0xe801) AM_WRITE(scrollx_hi_w)
290   AM_RANGE(0xe802, 0xe802) AM_WRITE(scrolly_w)
290291   AM_RANGE(0xe803, 0xe803) AM_READWRITE(tigerh_mcu_r, tigerh_mcu_w)
291   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(slapfight_fixram_w) AM_SHARE("fixvideoram")
292   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(slapfight_fixcol_w) AM_SHARE("fixcolorram")
292   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(fixram_w) AM_SHARE("fixvideoram")
293   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(fixcol_w) AM_SHARE("fixcolorram")
293294ADDRESS_MAP_END
294295
295296static ADDRESS_MAP_START( tigerhb1_map, AS_PROGRAM, 8, slapfght_state )
r29303r29304
308309   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
309310   AM_RANGE(0xc000, 0xc7ff) AM_RAM
310311   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1")
311   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(slapfight_videoram_w) AM_SHARE("videoram")
312   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(slapfight_colorram_w) AM_SHARE("colorram")
312   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
313   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
313314   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("spriteram")
314   AM_RANGE(0xe800, 0xe800) AM_WRITEONLY AM_SHARE("scrollx_lo")
315   AM_RANGE(0xe801, 0xe801) AM_WRITEONLY AM_SHARE("scrollx_hi")
316   AM_RANGE(0xe802, 0xe802) AM_WRITEONLY AM_SHARE("scrolly")
315   AM_RANGE(0xe800, 0xe800) AM_WRITE(scrollx_lo_w)
316   AM_RANGE(0xe801, 0xe801) AM_WRITE(scrollx_hi_w)
317   AM_RANGE(0xe802, 0xe802) AM_WRITE(scrolly_w)
317318   AM_RANGE(0xe803, 0xe803) AM_READWRITE(tigerh_mcu_r, tigerh_mcu_w)
318   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(slapfight_fixram_w) AM_SHARE("fixvideoram")
319   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(slapfight_fixcol_w) AM_SHARE("fixcolorram")
319   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(fixram_w) AM_SHARE("fixvideoram")
320   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(fixcol_w) AM_SHARE("fixcolorram")
320321ADDRESS_MAP_END
321322
322323static ADDRESS_MAP_START( slapfighb1_map, AS_PROGRAM, 8, slapfght_state )
r29303r29304
334335   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
335336   AM_RANGE(0xc000, 0xc7ff) AM_RAM
336337   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1")
337   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(slapfight_videoram_w) AM_SHARE("videoram")
338   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(slapfight_colorram_w) AM_SHARE("colorram")
338   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
339   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
339340   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("spriteram")
340   AM_RANGE(0xe800, 0xe800) AM_WRITEONLY AM_SHARE("scrollx_hi")
341   AM_RANGE(0xe802, 0xe802) AM_WRITEONLY AM_SHARE("scrolly")
342   AM_RANGE(0xe803, 0xe803) AM_WRITEONLY AM_SHARE("scrollx_lo")
341   AM_RANGE(0xe800, 0xe800) AM_WRITE(scrollx_hi_w)
342   AM_RANGE(0xe802, 0xe802) AM_WRITE(scrolly_w)
343   AM_RANGE(0xe803, 0xe803) AM_WRITE(scrollx_lo_w)
343344   AM_RANGE(0xec00, 0xefff) AM_ROM // it reads a copy of the logo from here!
344   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(slapfight_fixram_w) AM_SHARE("fixvideoram")
345   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(slapfight_fixcol_w) AM_SHARE("fixcolorram")
345   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(fixram_w) AM_SHARE("fixvideoram")
346   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(fixcol_w) AM_SHARE("fixcolorram")
346347ADDRESS_MAP_END
347348
348349
r29303r29304
757758{
758759   // zerofill
759760   m_palette_bank = 0;
760   m_flipscreen = 0;
761   m_scrollx_lo = 0;
762   m_scrollx_hi = 0;
763   m_scrolly = 0;
761764   m_main_irq_enabled = false;
762765   m_sound_nmi_enabled = false;
763766
r29303r29304
786789
787790   // savestates
788791   save_item(NAME(m_palette_bank));
789   save_item(NAME(m_flipscreen));
792   save_item(NAME(m_scrollx_lo));
793   save_item(NAME(m_scrollx_hi));
794   save_item(NAME(m_scrolly));
790795   save_item(NAME(m_main_irq_enabled));
791796   save_item(NAME(m_sound_nmi_enabled));
792797
r29303r29304
10091014   MCFG_SCREEN_REFRESH_RATE(60)
10101015   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
10111016   MCFG_SCREEN_SIZE(64*8, 32*8)
1012   MCFG_SCREEN_VISIBLE_AREA(1*8, 34*8-1, 2*8, 32*8-1)
1017   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 32*8-1)
10131018   MCFG_SCREEN_UPDATE_DRIVER(slapfght_state, screen_update_perfrman)
10141019   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
10151020   MCFG_SCREEN_PALETTE("palette")
r29303r29304
10551060   MCFG_SCREEN_REFRESH_RATE(60)
10561061   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
10571062   MCFG_SCREEN_SIZE(64*8, 32*8)
1058   MCFG_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8, 32*8-1)
1063   MCFG_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8-1, 32*8-1-1)
10591064   MCFG_SCREEN_UPDATE_DRIVER(slapfght_state, screen_update_slapfight)
10601065   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
10611066   MCFG_SCREEN_PALETTE("palette")
r29303r29304
11181123   MCFG_SCREEN_REFRESH_RATE(60)
11191124   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
11201125   MCFG_SCREEN_SIZE(64*8, 32*8)
1121   MCFG_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8, 32*8-1)
1126   MCFG_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8-1, 32*8-1-1)
11221127   MCFG_SCREEN_UPDATE_DRIVER(slapfght_state, screen_update_slapfight)
11231128   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
11241129   MCFG_SCREEN_PALETTE("palette")
r29303r29304
19811986GAME( 1985, perfrman,   0,        perfrman,   perfrman,  driver_device,  0,         ROT270, "Toaplan / Data East Corporation", "Performan (Japan)", GAME_SUPPORTS_SAVE )
19821987GAME( 1985, perfrmanu,  perfrman, perfrman,   perfrman,  driver_device,  0,         ROT270, "Toaplan / Data East USA", "Performan (US)", GAME_SUPPORTS_SAVE )
19831988
1984GAME( 1985, tigerh,     0,        tigerh,     tigerh,    driver_device,  0,         ROT270, "Toaplan / Taito America Corp.", "Tiger Heli (US)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
1985GAME( 1985, tigerhj,    tigerh,   tigerh,     tigerh,    driver_device,  0,         ROT270, "Toaplan / Taito", "Tiger Heli (Japan)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
1986GAME( 1985, tigerhb1,   tigerh,   tigerhb1,   tigerh,    driver_device,  0,         ROT270, "bootleg", "Tiger Heli (bootleg set 1)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
1987GAME( 1985, tigerhb2,   tigerh,   tigerhb2,   tigerh,    driver_device,  0,         ROT270, "bootleg", "Tiger Heli (bootleg set 2)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
1988GAME( 1985, tigerhb3,   tigerh,   tigerhb2,   tigerh,    driver_device,  0,         ROT270, "bootleg", "Tiger Heli (bootleg set 3)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
1989GAME( 1985, tigerh,     0,        tigerh,     tigerh,    driver_device,  0,         ROT270, "Toaplan / Taito America Corp.", "Tiger Heli (US)", GAME_SUPPORTS_SAVE )
1990GAME( 1985, tigerhj,    tigerh,   tigerh,     tigerh,    driver_device,  0,         ROT270, "Toaplan / Taito", "Tiger Heli (Japan)", GAME_SUPPORTS_SAVE )
1991GAME( 1985, tigerhb1,   tigerh,   tigerhb1,   tigerh,    driver_device,  0,         ROT270, "bootleg", "Tiger Heli (bootleg set 1)", GAME_SUPPORTS_SAVE )
1992GAME( 1985, tigerhb2,   tigerh,   tigerhb2,   tigerh,    driver_device,  0,         ROT270, "bootleg", "Tiger Heli (bootleg set 2)", GAME_SUPPORTS_SAVE )
1993GAME( 1985, tigerhb3,   tigerh,   tigerhb2,   tigerh,    driver_device,  0,         ROT270, "bootleg", "Tiger Heli (bootleg set 3)", GAME_SUPPORTS_SAVE )
19891994
19901995GAME( 1986, alcon,      0,        slapfigh,   slapfigh,  slapfght_state, slapfigh,  ROT270, "Toaplan / Taito America Corp.", "Alcon (US)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
19911996GAME( 1986, slapfigh,   alcon,    slapfigh,   slapfigh,  slapfght_state, slapfigh,  ROT270, "Toaplan / Taito", "Slap Fight (Japan set 1)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
r29303r29304
19941999GAME( 1986, slapfighb2, alcon,    slapfighb2, slapfigh,  slapfght_state, slapfigh,  ROT270, "bootleg", "Slap Fight (bootleg set 2)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL ) // England?
19952000GAME( 1986, slapfighb3, alcon,    slapfighb2, slapfigh,  slapfght_state, slapfigh,  ROT270, "bootleg", "Slap Fight (bootleg set 3)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL ) // PCB labeled 'slap fighter'
19962001
1997GAME( 1986, grdian,     0,        getstar,    getstar,   slapfght_state, getstar,   ROT0,   "Toaplan / Taito America Corporation (Kitkorp license)", "Guardian (US)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
1998GAME( 1986, getstarj,   grdian,   getstar,    getstarj,  slapfght_state, getstarj,  ROT0,   "Toaplan / Taito", "Get Star (Japan)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
2002GAME( 1986, grdian,     0,        getstar,    getstar,   slapfght_state, getstar,   ROT0,   "Toaplan / Taito America Corporation (Kitkorp license)", "Guardian (US)", GAME_SUPPORTS_SAVE )
2003GAME( 1986, getstarj,   grdian,   getstar,    getstarj,  slapfght_state, getstarj,  ROT0,   "Toaplan / Taito", "Get Star (Japan)", GAME_SUPPORTS_SAVE )
19992004GAME( 1986, getstarb1,  grdian,   getstarb1,  getstarj,  slapfght_state, getstarb1, ROT0,   "bootleg", "Get Star (bootleg set 1)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
2000GAME( 1986, getstarb2,  grdian,   getstarb2,  getstarb2, slapfght_state, getstarb2, ROT0,   "bootleg", "Get Star (bootleg set 2)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
2005GAME( 1986, getstarb2,  grdian,   getstarb2,  getstarb2, slapfght_state, getstarb2, ROT0,   "bootleg", "Get Star (bootleg set 2)", GAME_SUPPORTS_SAVE )
shelves/new_menus/src/mame/drivers/paranoia.c
r29303r29304
174174   "maincpu"
175175};
176176
177
178static const huc6270_interface pce_huc6270_config =
179{
180   0x10000,
181   DEVCB_DRIVER_LINE_MEMBER(pce_common_state,pce_irq_changed)
182};
183
184
185177static const huc6260_interface pce_huc6260_config =
186178{
187179   DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, next_pixel ),
r29303r29304
214206   MCFG_SCREEN_PALETTE("huc6260:palette")
215207
216208   MCFG_HUC6260_ADD( "huc6260", PCE_MAIN_CLOCK, pce_huc6260_config )
217   MCFG_HUC6270_ADD( "huc6270", pce_huc6270_config )
209   MCFG_DEVICE_ADD( "huc6270", HUC6270, 0 )
210   MCFG_HUC6270_VRAM_SIZE(0x10000)
211   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pce_common_state, pce_irq_changed))
218212
219213   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
220214   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
shelves/new_menus/src/emu/bus/plus4/exp.h
r29303r29304
5858//  INTERFACE CONFIGURATION MACROS
5959//**************************************************************************
6060
61#define MCFG_PLUS4_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot, _irq) \
61#define MCFG_PLUS4_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot) \
6262   MCFG_DEVICE_ADD(_tag, PLUS4_EXPANSION_SLOT, _clock) \
63   downcast<plus4_expansion_slot_device *>(device)->set_irq_callback(DEVCB2_##_irq); \
6463   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
6564
6665#define MCFG_PLUS4_PASSTHRU_EXPANSION_SLOT_ADD() \
67   MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, 0, plus4_expansion_cards, NULL, DEVWRITELINE(DEVICE_SELF_OWNER, plus4_expansion_slot_device, irq_w)) \
68   MCFG_PLUS4_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, plus4_expansion_slot_device, dma_cd_r), DEVWRITE8(DEVICE_SELF_OWNER, plus4_expansion_slot_device, dma_cd_w), DEVWRITELINE(DEVICE_SELF_OWNER, plus4_expansion_slot_device, aec_w))
66   MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, 0, plus4_expansion_cards, NULL) \
67   MCFG_PLUS4_EXPANSION_SLOT_IRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, plus4_expansion_slot_device, irq_w)) \
68   MCFG_PLUS4_EXPANSION_SLOT_CD_INPUT_CALLBACK(DEVREAD8(DEVICE_SELF_OWNER, plus4_expansion_slot_device, dma_cd_r)) \
69   MCFG_PLUS4_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(DEVWRITE8(DEVICE_SELF_OWNER, plus4_expansion_slot_device, dma_cd_w)) \
70   MCFG_PLUS4_EXPANSION_SLOT_AEC_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, plus4_expansion_slot_device, aec_w))
6971
7072
71#define MCFG_PLUS4_EXPANSION_SLOT_DMA_CALLBACKS(_read, _write, _aec) \
72   downcast<plus4_expansion_slot_device *>(device)->set_dma_callbacks(DEVCB2_##_read, DEVCB2_##_write, DEVCB2_##_aec);
73#define MCFG_PLUS4_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
74   devcb = &plus4_expansion_slot_device::set_irq_wr_callback(*device, DEVCB2_##_write);
7375
76#define MCFG_PLUS4_EXPANSION_SLOT_CD_INPUT_CALLBACK(_read) \
77   devcb = &plus4_expansion_slot_device::set_cd_rd_callback(*device, DEVCB2_##_read);
7478
79#define MCFG_PLUS4_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(_write) \
80   devcb = &plus4_expansion_slot_device::set_cd_wr_callback(*device, DEVCB2_##_write);
7581
82#define MCFG_PLUS4_EXPANSION_SLOT_AEC_CALLBACK(_write) \
83   devcb = &plus4_expansion_slot_device::set_aec_wr_callback(*device, DEVCB2_##_write);
84
85
86
7687//**************************************************************************
7788//  TYPE DEFINITIONS
7889//**************************************************************************
r29303r29304
89100   // construction/destruction
90101   plus4_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
91102
92   template<class _irq> void set_irq_callback(_irq irq) { m_write_irq.set_callback(irq); }
103   template<class _Object> static devcb2_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<plus4_expansion_slot_device &>(device).m_write_irq.set_callback(object); }
104   template<class _Object> static devcb2_base &set_cd_rd_callback(device_t &device, _Object object) { return downcast<plus4_expansion_slot_device &>(device).m_read_dma_cd.set_callback(object); }
105   template<class _Object> static devcb2_base &set_cd_wr_callback(device_t &device, _Object object) { return downcast<plus4_expansion_slot_device &>(device).m_write_dma_cd.set_callback(object); }
106   template<class _Object> static devcb2_base &set_aec_wr_callback(device_t &device, _Object object) { return downcast<plus4_expansion_slot_device &>(device).m_write_aec.set_callback(object); }
93107
94   template<class _read, class _write, class _aec> void set_dma_callbacks(_read read, _write write, _aec aec) {
95      m_read_dma_cd.set_callback(read);
96      m_write_dma_cd.set_callback(write);
97      m_write_aec.set_callback(aec);
98   }
99
100108   // computer interface
101109   UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
102110   void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
shelves/new_menus/src/emu/bus/adamnet/spi.c
r29303r29304
7272
7373
7474//-------------------------------------------------
75//  MC2661_INTERFACE( uart_intf )
76//-------------------------------------------------
77
78static MC2661_INTERFACE( uart_intf )
79{
80   0,
81   0,
82   DEVCB_NULL,
83   DEVCB_NULL,
84   DEVCB_NULL,
85   DEVCB_NULL,
86   DEVCB_NULL,
87   DEVCB_NULL,
88   DEVCB_NULL,
89   DEVCB_NULL
90};
91
92
93//-------------------------------------------------
9475//  MACHINE_DRIVER( adam_spi )
9576//-------------------------------------------------
9677
r29303r29304
10081   MCFG_CPU_IO_MAP(adam_spi_io)
10182   MCFG_DEVICE_DISABLE()
10283
103   MCFG_MC2661_ADD(MC2661_TAG, XTAL_4_9152MHz, uart_intf)
84   MCFG_DEVICE_ADD(MC2661_TAG, MC2661, XTAL_4_9152MHz)
85
10486   MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL)
10587
10688   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image")
shelves/new_menus/src/emu/bus/isa/3c505.c
r29303r29304
473473   m_size = RX_FIFO_SIZE; // size;
474474   for (i = 0; i < m_size; i++)
475475   {
476      m_db[i] = new data_buffer();
476      m_db[i] = global_alloc(data_buffer());
477477      m_db[i]->start(device, db_size);
478478   }
479479}
r29303r29304
485485   m_count = 0;
486486}
487487
488threecom3c505_device::data_buffer_fifo::~data_buffer_fifo()
489{
490   for (int i = 0; i < m_size; i++)
491   {
492      global_free(m_db[i]);
493   }
494}
495
488496int threecom3c505_device::data_buffer_fifo::put(const UINT8 data[], const int length)
489497{
490498   UINT16 next_index = (m_put_index + 1) % m_size;
shelves/new_menus/src/emu/bus/isa/3c505.h
r29303r29304
175175   {
176176   public:
177177      data_buffer_fifo();
178      ~data_buffer_fifo();
178179      void start(threecom3c505_device *device, INT32 size, INT32 db_size);
179180      void reset();
180181      int put(const UINT8 data[], const int length);
shelves/new_menus/src/emu/bus/vic10/exp.h
r29303r29304
6161   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
6262
6363
64#define MCFG_VIC10_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
65   devcb = &vic10_expansion_slot_device::set_irq_wr_callback(*device, DEVCB2_##_write);
66
67#define MCFG_VIC10_EXPANSION_SLOT_RES_CALLBACK(_write) \
68   devcb = &vic10_expansion_slot_device::set_res_wr_callback(*device, DEVCB2_##_write);
69
70#define MCFG_VIC10_EXPANSION_SLOT_CNT_CALLBACK(_write) \
71   devcb = &vic10_expansion_slot_device::set_cnt_wr_callback(*device, DEVCB2_##_write);
72
73#define MCFG_VIC10_EXPANSION_SLOT_SP_CALLBACK(_write) \
74   devcb = &vic10_expansion_slot_device::set_sp_wr_callback(*device, DEVCB2_##_write);
75
76
6477#define MCFG_VIC10_EXPANSION_SLOT_IRQ_CALLBACKS(_irq, _res) \
6578   downcast<vic10_expansion_slot_device *>(device)->set_irq_callbacks(DEVCB2_##_irq, DEVCB2_##_res);
6679
r29303r29304
8598   // construction/destruction
8699   vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
87100
88   template<class _irq, class _res> void set_irq_callbacks(_irq irq, _res res) {
89      m_write_irq.set_callback(irq);
90      m_write_res.set_callback(res);
91   }
101   template<class _Object> static devcb2_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<vic10_expansion_slot_device &>(device).m_write_irq.set_callback(object); }
102   template<class _Object> static devcb2_base &set_res_wr_callback(device_t &device, _Object object) { return downcast<vic10_expansion_slot_device &>(device).m_write_res.set_callback(object); }
103   template<class _Object> static devcb2_base &set_cnt_wr_callback(device_t &device, _Object object) { return downcast<vic10_expansion_slot_device &>(device).m_write_cnt.set_callback(object); }
104   template<class _Object> static devcb2_base &set_sp_wr_callback(device_t &device, _Object object) { return downcast<vic10_expansion_slot_device &>(device).m_write_sp.set_callback(object); }
92105
93   template<class _cnt, class _sp> void set_serial_callbacks(_cnt cnt, _sp sp) {
94      m_write_cnt.set_callback(cnt);
95      m_write_sp.set_callback(sp);
96   }
97
98106   // computer interface
99107   UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram);
100108   void cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram);
shelves/new_menus/src/emu/bus/ti99_peb/ti_fdc.c
r29303r29304
648648    the default implementation sets the drive geometry to the geometry
649649    of the medium.
650650*/
651void ti_fdc_legacy_device::set_geometry(device_t *drive, floppy_type_t type)
651void ti_fdc_legacy_device::set_geometry(legacy_floppy_image_device *drive, floppy_type_t type)
652652{
653653   // This assertion may fail when the names of the floppy devices change.
654654   // Unfortunately, the wd17xx device assumes the floppy drives at root
655655   // level, so we use an explicitly qualified tag. See peribox.h.
656656   assert (drive!=NULL);
657   floppy_drive_set_geometry(drive, type);
657   drive->floppy_drive_set_geometry(type);
658658}
659659
660660void ti_fdc_legacy_device::set_all_geometries(floppy_type_t type)
661661{
662   set_geometry(machine().device(PFLOPPY_0), type);
663   set_geometry(machine().device(PFLOPPY_1), type);
664   set_geometry(machine().device(PFLOPPY_2), type);
662   set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_0), type);
663   set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_1), type);
664   set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_2), type);
665665}
666666
667667/*
shelves/new_menus/src/emu/bus/ti99_peb/ti_fdc.h
r29303r29304
146146private:
147147   void set_ready_line();
148148   void set_all_geometries(floppy_type_t type);
149   void set_geometry(device_t *drive, floppy_type_t type);
149   void set_geometry(legacy_floppy_image_device *drive, floppy_type_t type);
150150
151151   // Recent address
152152   int             m_address;
shelves/new_menus/src/emu/bus/ti99_peb/hfdc.c
r29303r29304
304304      if (index==-1) return 0;
305305
306306      /* Get floppy status. */
307      if (floppy_drive_get_flag_state(m_floppy_unit[index], FLOPPY_DRIVE_INDEX) == FLOPPY_DRIVE_INDEX)
307      if (m_floppy_unit[index]->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX) == FLOPPY_DRIVE_INDEX)
308308         reply |= DS_INDEX;
309      if (floppy_tk00_r(m_floppy_unit[index]) == CLEAR_LINE)
309      if (m_floppy_unit[index]->floppy_tk00_r() == CLEAR_LINE)
310310         reply |= DS_TRK00;
311      if (floppy_wpt_r(m_floppy_unit[index]) == CLEAR_LINE)
311      if (m_floppy_unit[index]->floppy_wpt_r() == CLEAR_LINE)
312312         reply |= DS_WRPROT;
313313
314314      /* if (image_exists(disk_img)) */
r29303r29304
321321   {
322322      UINT8 state;
323323      index = slog2((m_output1_latch>>4) & 0x0f)-1;
324      mfm_harddisk_device *hd = static_cast<mfm_harddisk_device *>(m_harddisk_unit[index]);
324      mfm_harddisk_device *hd = m_harddisk_unit[index];
325325      state = hd->get_status();
326326
327327      if (state & MFMHD_TRACK00)      reply |= DS_TRK00;
r29303r29304
338338WRITE8_MEMBER( myarc_hfdc_device::auxbus_out )
339339{
340340   int index;
341   device_t* selected_drive = NULL;
342
343341   switch (offset)
344342   {
345343   case INPUT_STATUS:
r29303r29304
363361      {
364362         // Floppy selected
365363         index = slog2(data & 0x0f);
366         if (index>=0) selected_drive = m_floppy_unit[index];
364         if (index>=0) m_hdc9234->connect_floppy_drive(m_floppy_unit[index]);
367365      }
368366      else
369367      {
370368         // HD selected
371369         index = slog2((data>>4) & 0x0f);
372         if (index>=0) selected_drive = m_harddisk_unit[index-1];
370         if (index>=0) m_hdc9234->connect_hard_drive(m_harddisk_unit[index-1]);
373371      }
374372
375      m_hdc9234->connect_drive(selected_drive);
376373      m_output1_latch = data;
377374      break;
378375
r29303r29304
536533   m_selected = false;
537534
538535   // Find the floppies and hard disks
539   m_floppy_unit[0] = m_slot->get_drive(FLOPPY_0);
540   m_floppy_unit[1] = m_slot->get_drive(FLOPPY_1);
541   m_floppy_unit[2] = m_slot->get_drive(FLOPPY_2);
542   m_floppy_unit[3] = m_slot->get_drive(FLOPPY_3);
536   m_floppy_unit[0] = static_cast<legacy_floppy_image_device *>(m_slot->get_drive(FLOPPY_0));
537   m_floppy_unit[1] = static_cast<legacy_floppy_image_device *>(m_slot->get_drive(FLOPPY_1));
538   m_floppy_unit[2] = static_cast<legacy_floppy_image_device *>(m_slot->get_drive(FLOPPY_2));
539   m_floppy_unit[3] = static_cast<legacy_floppy_image_device *>(m_slot->get_drive(FLOPPY_3));
543540
544   m_harddisk_unit[0] = m_slot->get_drive(MFMHD_0);
545   m_harddisk_unit[1] = m_slot->get_drive(MFMHD_1);
546   m_harddisk_unit[2] = m_slot->get_drive(MFMHD_2);
541   m_harddisk_unit[0] = static_cast<mfm_harddisk_device *>(m_slot->get_drive(MFMHD_0));
542   m_harddisk_unit[1] = static_cast<mfm_harddisk_device *>(m_slot->get_drive(MFMHD_1));
543   m_harddisk_unit[2] = static_cast<mfm_harddisk_device *>(m_slot->get_drive(MFMHD_2));
547544
548545   if (ioport("HFDCDIP")->read()&0x55)
549546      ti99_set_80_track_drives(TRUE);
r29303r29304
560557      {
561558         //  floppy_drive_set_controller(card->floppy_unit[i], device);
562559         //  floppy_drive_set_index_pulse_callback(floppy_unit[i], smc92x4_index_pulse_callback);
563         floppy_drive_set_geometry(m_floppy_unit[i], floptype);
560         m_floppy_unit[i]->floppy_drive_set_geometry(floptype);
564561      }
565562   }
566563
shelves/new_menus/src/emu/bus/ti99_peb/peribox.c
r29303r29304
394394{
395395   if (TRACE_EMU) logerror("Peribox started\n");
396396
397   floppy_drive_set_rpm(subdevice(FLOPPY_0), 300.);
398   floppy_drive_set_rpm(subdevice(FLOPPY_1), 300.);
399   floppy_drive_set_rpm(subdevice(FLOPPY_2), 300.);
400   floppy_drive_set_rpm(subdevice(FLOPPY_3), 300.);
397   subdevice<legacy_floppy_image_device>(FLOPPY_0)->floppy_drive_set_rpm(300.);
398   subdevice<legacy_floppy_image_device>(FLOPPY_1)->floppy_drive_set_rpm(300.);
399   subdevice<legacy_floppy_image_device>(FLOPPY_2)->floppy_drive_set_rpm(300.);
400   subdevice<legacy_floppy_image_device>(FLOPPY_3)->floppy_drive_set_rpm(300.);
401401
402402   // Resolve the callback lines to the console
403403   m_console_inta.resolve();
shelves/new_menus/src/emu/bus/ti99_peb/hfdc.h
r29303r29304
9393   UINT8           m_output2_latch;
9494
9595   /* Connected floppy drives. */
96   device_t*       m_floppy_unit[HFDC_MAX_FLOPPY];
96   legacy_floppy_image_device*       m_floppy_unit[HFDC_MAX_FLOPPY];
9797
9898   /* Connected harddisk drives. */
99   device_t*       m_harddisk_unit[HFDC_MAX_HARD];
99   mfm_harddisk_device*       m_harddisk_unit[HFDC_MAX_HARD];
100100
101101   /* DMA address latch */
102102   UINT32          m_dma_address;
shelves/new_menus/src/emu/bus/ti99_peb/bwg.c
r29303r29304
839839    the default implementation sets the drive geometry to the geometry
840840    of the medium.
841841*/
842void snug_bwg_legacy_device::set_geometry(device_t *drive, floppy_type_t type)
842void snug_bwg_legacy_device::set_geometry(legacy_floppy_image_device *drive, floppy_type_t type)
843843{
844844   // This assertion may fail when the names of the floppy devices change.
845845   // Unfortunately, the wd17xx device assumes the floppy drives at root
846846   // level, so we use an explicitly qualified tag. See peribox.h.
847847   assert(drive != NULL);
848   floppy_drive_set_geometry(drive, type);
848   drive->floppy_drive_set_geometry(type);
849849}
850850
851851void snug_bwg_legacy_device::set_all_geometries(floppy_type_t type)
852852{
853   set_geometry(machine().device(PFLOPPY_0), type);
854   set_geometry(machine().device(PFLOPPY_1), type);
855   set_geometry(machine().device(PFLOPPY_2), type);
853   set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_0), type);
854   set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_1), type);
855   set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_2), type);
856856}
857857
858858/*
shelves/new_menus/src/emu/bus/ti99_peb/bwg.h
r29303r29304
173173private:
174174   void set_ready_line();
175175   void set_all_geometries(floppy_type_t type);
176   void set_geometry(device_t *drive, floppy_type_t type);
176   void set_geometry(legacy_floppy_image_device *drive, floppy_type_t type);
177177   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
178178
179179   // Holds the status of the DRQ and IRQ lines.
shelves/new_menus/src/emu/bus/vip/vp575.c
r29303r29304
4242   m_slot->dma_in_w(dma_in);
4343}
4444
45WRITE_LINE_MEMBER( vp575_device::exp1_int_w ) { m_int[0] = state; update_interrupts(); }
46WRITE_LINE_MEMBER( vp575_device::exp2_int_w ) { m_int[1] = state; update_interrupts(); }
47WRITE_LINE_MEMBER( vp575_device::exp3_int_w ) { m_int[2] = state; update_interrupts(); }
48WRITE_LINE_MEMBER( vp575_device::exp4_int_w ) { m_int[3] = state; update_interrupts(); }
49WRITE_LINE_MEMBER( vp575_device::exp5_int_w ) { m_int[4] = state; update_interrupts(); }
5045
51WRITE_LINE_MEMBER( vp575_device::exp1_dma_out_w ) { m_dma_out[0] = state; update_interrupts(); }
52WRITE_LINE_MEMBER( vp575_device::exp2_dma_out_w ) { m_dma_out[1] = state; update_interrupts(); }
53WRITE_LINE_MEMBER( vp575_device::exp3_dma_out_w ) { m_dma_out[2] = state; update_interrupts(); }
54WRITE_LINE_MEMBER( vp575_device::exp4_dma_out_w ) { m_dma_out[3] = state; update_interrupts(); }
55WRITE_LINE_MEMBER( vp575_device::exp5_dma_out_w ) { m_dma_out[4] = state; update_interrupts(); }
56
57WRITE_LINE_MEMBER( vp575_device::exp1_dma_in_w ) { m_dma_in[0] = state; update_interrupts(); }
58WRITE_LINE_MEMBER( vp575_device::exp2_dma_in_w ) { m_dma_in[1] = state; update_interrupts(); }
59WRITE_LINE_MEMBER( vp575_device::exp3_dma_in_w ) { m_dma_in[2] = state; update_interrupts(); }
60WRITE_LINE_MEMBER( vp575_device::exp4_dma_in_w ) { m_dma_in[3] = state; update_interrupts(); }
61WRITE_LINE_MEMBER( vp575_device::exp5_dma_in_w ) { m_dma_in[4] = state; update_interrupts(); }
62
63
6446//-------------------------------------------------
6547//  MACHINE_CONFIG_FRAGMENT( vp575 )
6648//-------------------------------------------------
6749
6850static MACHINE_CONFIG_FRAGMENT( vp575 )
6951   MCFG_VIP_EXPANSION_SLOT_ADD("exp1", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
70   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_in_w))
52   MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(vp575_device, exp1_int_w))
53   MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(vp575_device, exp1_dma_out_w))
54   MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(vp575_device, exp1_dma_in_w))
55
7156   MCFG_VIP_EXPANSION_SLOT_ADD("exp2", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
72   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_in_w))
57   MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(vp575_device, exp2_int_w))
58   MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(vp575_device, exp2_dma_out_w))
59   MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(vp575_device, exp2_dma_in_w))
60
7361   MCFG_VIP_EXPANSION_SLOT_ADD("exp3", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
74   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_in_w))
62   MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(vp575_device, exp3_int_w))
63   MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(vp575_device, exp3_dma_out_w))
64   MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(vp575_device, exp3_dma_in_w))
65
7566   MCFG_VIP_EXPANSION_SLOT_ADD("exp4", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
76   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_in_w))
67   MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(vp575_device, exp4_int_w))
68   MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(vp575_device, exp4_dma_out_w))
69   MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(vp575_device, exp4_dma_in_w))
70
7771   MCFG_VIP_EXPANSION_SLOT_ADD("exp5", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
78   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_in_w))
72   MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(vp575_device, exp5_int_w))
73   MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(vp575_device, exp5_dma_out_w))
74   MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(vp575_device, exp5_dma_in_w))
7975MACHINE_CONFIG_END
8076
8177
shelves/new_menus/src/emu/bus/vip/vp575.h
r29303r29304
4444   virtual machine_config_constructor device_mconfig_additions() const;
4545
4646   // not really public
47   DECLARE_WRITE_LINE_MEMBER( exp1_int_w );
48   DECLARE_WRITE_LINE_MEMBER( exp2_int_w );
49   DECLARE_WRITE_LINE_MEMBER( exp3_int_w );
50   DECLARE_WRITE_LINE_MEMBER( exp4_int_w );
51   DECLARE_WRITE_LINE_MEMBER( exp5_int_w );
52   DECLARE_WRITE_LINE_MEMBER( exp1_dma_out_w );
53   DECLARE_WRITE_LINE_MEMBER( exp2_dma_out_w );
54   DECLARE_WRITE_LINE_MEMBER( exp3_dma_out_w );
55   DECLARE_WRITE_LINE_MEMBER( exp4_dma_out_w );
56   DECLARE_WRITE_LINE_MEMBER( exp5_dma_out_w );
57   DECLARE_WRITE_LINE_MEMBER( exp1_dma_in_w );
58   DECLARE_WRITE_LINE_MEMBER( exp2_dma_in_w );
59   DECLARE_WRITE_LINE_MEMBER( exp3_dma_in_w );
60   DECLARE_WRITE_LINE_MEMBER( exp4_dma_in_w );
61   DECLARE_WRITE_LINE_MEMBER( exp5_dma_in_w );
47   DECLARE_WRITE_LINE_MEMBER( exp1_int_w ) { m_int[0] = state; update_interrupts(); }
48   DECLARE_WRITE_LINE_MEMBER( exp2_int_w ) { m_int[1] = state; update_interrupts(); }
49   DECLARE_WRITE_LINE_MEMBER( exp3_int_w ) { m_int[2] = state; update_interrupts(); }
50   DECLARE_WRITE_LINE_MEMBER( exp4_int_w ) { m_int[3] = state; update_interrupts(); }
51   DECLARE_WRITE_LINE_MEMBER( exp5_int_w ) { m_int[4] = state; update_interrupts(); }
6252
53   DECLARE_WRITE_LINE_MEMBER( exp1_dma_out_w ) { m_dma_out[0] = state; update_interrupts(); }
54   DECLARE_WRITE_LINE_MEMBER( exp2_dma_out_w ) { m_dma_out[1] = state; update_interrupts(); }
55   DECLARE_WRITE_LINE_MEMBER( exp3_dma_out_w ) { m_dma_out[2] = state; update_interrupts(); }
56   DECLARE_WRITE_LINE_MEMBER( exp4_dma_out_w ) { m_dma_out[3] = state; update_interrupts(); }
57   DECLARE_WRITE_LINE_MEMBER( exp5_dma_out_w ) { m_dma_out[4] = state; update_interrupts(); }
58
59   DECLARE_WRITE_LINE_MEMBER( exp1_dma_in_w ) { m_dma_in[0] = state; update_interrupts(); }
60   DECLARE_WRITE_LINE_MEMBER( exp2_dma_in_w ) { m_dma_in[1] = state; update_interrupts(); }
61   DECLARE_WRITE_LINE_MEMBER( exp3_dma_in_w ) { m_dma_in[2] = state; update_interrupts(); }
62   DECLARE_WRITE_LINE_MEMBER( exp4_dma_in_w ) { m_dma_in[3] = state; update_interrupts(); }
63   DECLARE_WRITE_LINE_MEMBER( exp5_dma_in_w ) { m_dma_in[4] = state; update_interrupts(); }
64
6365   void update_interrupts();
6466
6567protected:
shelves/new_menus/src/emu/bus/vip/exp.c
r29303r29304
5656vip_expansion_slot_device::vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
5757   device_t(mconfig, VIP_EXPANSION_SLOT, "VIP expansion port", tag, owner, clock, "vip_expansion_slot", __FILE__),
5858   device_slot_interface(mconfig, *this),
59   m_write_irq(*this),
59   m_write_int(*this),
6060   m_write_dma_out(*this),
6161   m_write_dma_in(*this)
6262{
r29303r29304
7272   m_card = dynamic_cast<device_vip_expansion_card_interface *>(get_card_device());
7373
7474   // resolve callbacks
75   m_write_irq.resolve_safe();
75   m_write_int.resolve_safe();
7676   m_write_dma_out.resolve_safe();
7777   m_write_dma_in.resolve_safe();
7878}
shelves/new_menus/src/emu/bus/vip/exp.h
r29303r29304
5959   MCFG_DEVICE_ADD(_tag, VIP_EXPANSION_SLOT, _clock) \
6060   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
6161
62#define MCFG_VIP_EXPANSION_SLOT_CALLBACKS(_irq, _dma_out, _dma_in) \
63   downcast<vip_expansion_slot_device *>(device)->set_irq_callback(DEVCB2_##_irq); \
64   downcast<vip_expansion_slot_device *>(device)->set_dma_out_callback(DEVCB2_##_dma_out); \
65   downcast<vip_expansion_slot_device *>(device)->set_dma_in_callback(DEVCB2_##_dma_in);
6662
63#define MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(_write) \
64   devcb = &vip_expansion_slot_device::set_int_wr_callback(*device, DEVCB2_##_write);
6765
66#define MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(_write) \
67   devcb = &vip_expansion_slot_device::set_dma_out_wr_callback(*device, DEVCB2_##_write);
6868
69#define MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(_write) \
70   devcb = &vip_expansion_slot_device::set_dma_in_wr_callback(*device, DEVCB2_##_write);
71
72
73
6974//**************************************************************************
7075//  TYPE DEFINITIONS
7176//**************************************************************************
r29303r29304
8186   // construction/destruction
8287   vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8388
84   template<class _irq> void set_irq_callback(_irq irq) { m_write_irq.set_callback(irq); }
85   template<class _dma_out> void set_dma_out_callback(_dma_out dma_out) { m_write_dma_out.set_callback(dma_out); }
86   template<class _dma_in> void set_dma_in_callback(_dma_in dma_in) { m_write_dma_in.set_callback(dma_in); }
89   template<class _Object> static devcb2_base &set_int_wr_callback(device_t &device, _Object object) { return downcast<vip_expansion_slot_device &>(device).m_write_int.set_callback(object); }
90   template<class _Object> static devcb2_base &set_dma_out_wr_callback(device_t &device, _Object object) { return downcast<vip_expansion_slot_device &>(device).m_write_dma_out.set_callback(object); }
91   template<class _Object> static devcb2_base &set_dma_in_wr_callback(device_t &device, _Object object) { return downcast<vip_expansion_slot_device &>(device).m_write_dma_in.set_callback(object); }
8792
8893   // computer interface
8994   UINT8 program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh);
r29303r29304
101106   DECLARE_WRITE_LINE_MEMBER( run_w );
102107
103108   // cartridge interface
104   DECLARE_WRITE_LINE_MEMBER( interrupt_w ) { m_write_irq(state); }
109   DECLARE_WRITE_LINE_MEMBER( interrupt_w ) { m_write_int(state); }
105110   DECLARE_WRITE_LINE_MEMBER( dma_out_w ) { m_write_dma_out(state); }
106111   DECLARE_WRITE_LINE_MEMBER( dma_in_w ) { m_write_dma_in(state); }
107112
r29303r29304
109114   // device-level overrides
110115   virtual void device_start();
111116
112   devcb2_write_line m_write_irq;
117   devcb2_write_line m_write_int;
113118   devcb2_write_line m_write_dma_out;
114119   devcb2_write_line m_write_dma_in;
115120
shelves/new_menus/src/emu/bus/iq151/iq151.c
r29303r29304
218218
219219void iq151cart_slot_device::get_default_card_software(astring &result)
220220{
221   software_get_default_slot(result, NULL);
221   software_get_default_slot(result, "basic6");
222222}
shelves/new_menus/src/emu/bus/bus.mak
r29303r29304
706706BUSOBJS += $(BUSOBJ)/rs232/null_modem.o
707707BUSOBJS += $(BUSOBJ)/rs232/rs232.o
708708BUSOBJS += $(BUSOBJ)/rs232/ser_mouse.o
709BUSOBJS += $(BUSOBJ)/rs232/teleprinter.o
710709BUSOBJS += $(BUSOBJ)/rs232/terminal.o
711710endif
712711
shelves/new_menus/src/emu/bus/megadrive/rom.c
r29303r29304
549549READ16_MEMBER(md_rom_mcpirate_device::read)
550550{
551551   if (offset < 0x400000/2)
552      return m_rom[(((m_bank * 0x10000) + (offset << 1)) & (m_rom.count() - 1))/2];
552      return m_rom[(((m_bank * 0x10000) + (offset << 1)) & (m_rom.bytes() - 1))/2];
553553   else
554554      return read(space, offset - 0x400000/2, 0xffff);
555555}
r29303r29304
795795 LION KING 3
796796 -------------------------------------------------*/
797797
798#define MD_LION3_ADDR(a)  (((offset << 1) | (m_bank << 15)) & (m_rom.count() - 1))/2
798#define MD_LION3_ADDR(a)  (((offset << 1) | (m_bank << 15)) & (m_rom.bytes() - 1))/2
799799
800800READ16_MEMBER(md_rom_lion3_device::read)
801801{
r29303r29304
926926 POKEMON STADIUM / KAIJU
927927 -------------------------------------------------*/
928928
929#define MD_POKESTAD_ADDR(a)  (((offset << 1) | (m_bank << 15)) & (m_rom.count() - 1))/2
929#define MD_POKESTAD_ADDR(a)  (((offset << 1) | (m_bank << 15)) & (m_rom.bytes() - 1))/2
930930
931931READ16_MEMBER(md_rom_pokestad_device::read)
932932{
r29303r29304
13081308
13091309READ16_MEMBER(md_rom_radica_device::read)
13101310{
1311   return m_rom[(((m_bank * 0x10000) + (offset << 1)) & (m_rom.count() - 1))/2];
1311   return m_rom[(((m_bank * 0x10000) + (offset << 1)) & (m_rom.bytes() - 1))/2];
13121312}
13131313
13141314READ16_MEMBER(md_rom_radica_device::read_a13)
shelves/new_menus/src/emu/bus/ieee488/c8050.c
r29303r29304
618618   UINT8 data = 0;
619619
620620   // write protect sense
621   data |= floppy_wpt_r(m_unit[m_drive].m_image) << 3;
621   data |= m_unit[m_drive].m_image->floppy_wpt_r() << 3;
622622
623623   // drive type
624624   data |= 0x10;
r29303r29304
10171017   m_bit_count = 0;
10181018
10191019   // read track data
1020   floppy_drive_read_track_data_info_buffer(m_unit[unit].m_image, m_side, m_unit[unit].m_track_buffer, &m_unit[unit].m_track_len);
1020   m_unit[unit].m_image->floppy_drive_read_track_data_info_buffer(m_side, m_unit[unit].m_track_buffer, &m_unit[unit].m_track_len);
10211021
10221022   // extract track length
1023   m_unit[unit].m_track_len = floppy_drive_get_current_track_size(m_unit[unit].m_image, m_side);
1023   m_unit[unit].m_track_len = m_unit[unit].m_image->floppy_drive_get_current_track_size(m_side);
10241024}
10251025
10261026
r29303r29304
10381038         read_current_track(unit);
10391039      }
10401040
1041      floppy_mon_w(m_unit[unit].m_image, mtr);
1041      m_unit[unit].m_image->floppy_mon_w(mtr);
10421042
10431043      m_unit[unit].m_mtr = mtr;
10441044   }
r29303r29304
10661066      if (tracks != 0)
10671067      {
10681068         // step read/write head
1069         floppy_drive_seek(m_unit[unit].m_image, tracks);
1069         m_unit[unit].m_image->floppy_drive_seek(tracks);
10701070
10711071         // read new track data
10721072         read_current_track(unit);
r29303r29304
11991199   // install image callbacks
12001200   m_unit[0].m_image = m_image0;
12011201
1202   floppy_install_load_proc(m_image0, c8050_device::on_disk0_change);
1202   m_image0->floppy_install_load_proc(c8050_device::on_disk0_change);
12031203
12041204   if (m_image1)
12051205   {
12061206      m_unit[1].m_image = m_image1;
12071207
1208      floppy_install_load_proc(m_image1, c8050_device::on_disk1_change);
1208      m_image1->floppy_install_load_proc(c8050_device::on_disk1_change);
12091209   }
12101210
12111211   // register for state saving
shelves/new_menus/src/emu/bus/ieee488/c8050.h
r29303r29304
125125      int m_bit_pos;                          // bit position within track buffer byte
126126
127127      // devices
128      device_t *m_image;
128      legacy_floppy_image_device *m_image;
129129   } m_unit[2];
130130
131131   int m_drive;                        // selected drive
shelves/new_menus/src/emu/bus/rs232/teleprinter.c
r29303r29304
1#include "teleprinter.h"
2
3#define KEYBOARD_TAG "keyboard"
4
5static const UINT8 teleprinter_font[128*8] =
6{
7   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8   0x07,0x07,0x07,0x07,0x00,0x00,0x00,0x00,
9   0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00,
10   0x3f,0x3f,0x3f,0x3f,0x00,0x00,0x00,0x00,
11   0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,
12   0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
13   0x38,0x38,0x38,0x38,0x07,0x07,0x07,0x07,
14   0x3f,0x3f,0x3f,0x3f,0x07,0x07,0x07,0x07,
15   0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x38,
16   0x07,0x07,0x07,0x07,0x38,0x38,0x38,0x38,
17   0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
18   0x3f,0x3f,0x3f,0x3f,0x38,0x38,0x38,0x38,
19   0x00,0x00,0x00,0x00,0x3f,0x3f,0x3f,0x3f,
20   0x07,0x07,0x07,0x07,0x3f,0x3f,0x3f,0x3f,
21   0x38,0x38,0x38,0x38,0x3f,0x3f,0x3f,0x3f,
22   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
23   0x00,0x00,0x00,0x00,0x2a,0x15,0x2a,0x15,
24   0x2a,0x15,0x2a,0x15,0x00,0x00,0x00,0x00,
25   0x3f,0x3f,0x3f,0x3f,0x2a,0x15,0x2a,0x15,
26   0x2a,0x15,0x2a,0x15,0x3f,0x3f,0x3f,0x3f,
27   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
28   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
29   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
30   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
31   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
32   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
33   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
34   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
35   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
36   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
37   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
38   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
39   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
40   0x08,0x08,0x08,0x08,0x08,0x00,0x08,0x00,
41   0x14,0x14,0x14,0x00,0x00,0x00,0x00,0x00,
42   0x14,0x14,0x3e,0x14,0x3e,0x14,0x14,0x00,
43   0x08,0x3c,0x0a,0x1c,0x28,0x1e,0x08,0x00,
44   0x06,0x26,0x10,0x08,0x04,0x32,0x30,0x00,
45   0x08,0x14,0x14,0x0c,0x2a,0x12,0x2c,0x00,
46   0x08,0x08,0x04,0x00,0x00,0x00,0x00,0x00,
47   0x10,0x08,0x04,0x04,0x04,0x08,0x10,0x00,
48   0x04,0x08,0x10,0x10,0x10,0x08,0x04,0x00,
49   0x00,0x08,0x2a,0x1c,0x2a,0x08,0x00,0x00,
50   0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,
51   0x00,0x00,0x00,0x00,0x08,0x08,0x04,0x00,
52   0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,
53   0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,
54   0x00,0x20,0x10,0x08,0x04,0x02,0x00,0x00,
55   0x1c,0x22,0x32,0x2a,0x26,0x22,0x1c,0x00,
56   0x08,0x0c,0x08,0x08,0x08,0x08,0x1c,0x00,
57   0x1c,0x22,0x20,0x18,0x04,0x02,0x3e,0x00,
58   0x3e,0x20,0x10,0x18,0x20,0x22,0x1c,0x00,
59   0x10,0x18,0x14,0x12,0x3e,0x10,0x10,0x00,
60   0x3e,0x02,0x1e,0x20,0x20,0x22,0x1c,0x00,
61   0x10,0x08,0x04,0x1c,0x22,0x22,0x1c,0x00,
62   0x3e,0x20,0x10,0x08,0x04,0x04,0x04,0x00,
63   0x1c,0x22,0x22,0x1c,0x22,0x22,0x1c,0x00,
64   0x1c,0x22,0x22,0x1c,0x10,0x08,0x04,0x00,
65   0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x00,
66   0x00,0x00,0x08,0x00,0x08,0x08,0x04,0x00,
67   0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x00,
68   0x00,0x00,0x3e,0x00,0x3e,0x00,0x00,0x00,
69   0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x00,
70   0x1c,0x22,0x20,0x10,0x08,0x00,0x08,0x00,
71   0x1c,0x22,0x32,0x2a,0x3a,0x02,0x3c,0x00,
72   0x08,0x14,0x22,0x22,0x3e,0x22,0x22,0x00,
73   0x1e,0x22,0x22,0x1e,0x22,0x22,0x1e,0x00,
74   0x1c,0x22,0x02,0x02,0x02,0x22,0x1c,0x00,
75   0x1e,0x24,0x24,0x24,0x24,0x24,0x1e,0x00,
76   0x3e,0x02,0x02,0x1e,0x02,0x02,0x3e,0x00,
77   0x3e,0x02,0x02,0x1e,0x02,0x02,0x02,0x00,
78   0x1c,0x22,0x02,0x02,0x32,0x22,0x3c,0x00,
79   0x22,0x22,0x22,0x3e,0x22,0x22,0x22,0x00,
80   0x1c,0x08,0x08,0x08,0x08,0x08,0x1c,0x00,
81   0x38,0x10,0x10,0x10,0x10,0x12,0x0c,0x00,
82   0x22,0x12,0x0a,0x06,0x0a,0x12,0x22,0x00,
83   0x02,0x02,0x02,0x02,0x02,0x02,0x3e,0x00,
84   0x22,0x36,0x2a,0x2a,0x22,0x22,0x22,0x00,
85   0x22,0x22,0x26,0x2a,0x32,0x22,0x22,0x00,
86   0x1c,0x22,0x22,0x22,0x22,0x22,0x1c,0x00,
87   0x1e,0x22,0x22,0x1e,0x02,0x02,0x02,0x00,
88   0x1c,0x22,0x22,0x22,0x2a,0x12,0x2c,0x00,
89   0x1e,0x22,0x22,0x1e,0x0a,0x12,0x22,0x00,
90   0x1c,0x22,0x02,0x1c,0x20,0x22,0x1c,0x00,
91   0x3e,0x08,0x08,0x08,0x08,0x08,0x08,0x00,
92   0x22,0x22,0x22,0x22,0x22,0x22,0x1c,0x00,
93   0x22,0x22,0x22,0x14,0x14,0x08,0x08,0x00,
94   0x22,0x22,0x22,0x2a,0x2a,0x2a,0x14,0x00,
95   0x22,0x22,0x14,0x08,0x14,0x22,0x22,0x00,
96   0x22,0x22,0x22,0x14,0x08,0x08,0x08,0x00,
97   0x3e,0x20,0x10,0x08,0x04,0x02,0x3e,0x00,
98   0x0e,0x02,0x02,0x02,0x02,0x02,0x0e,0x00,
99   0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x00,
100   0x38,0x20,0x20,0x20,0x20,0x20,0x38,0x00,
101   0x08,0x1c,0x2a,0x08,0x08,0x08,0x08,0x00,
102   0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,
103   0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
104   0x00,0x00,0x1c,0x20,0x3c,0x22,0x3c,0x00,
105   0x02,0x02,0x1e,0x22,0x22,0x22,0x1e,0x00,
106   0x00,0x00,0x3c,0x02,0x02,0x02,0x3c,0x00,
107   0x20,0x20,0x3c,0x22,0x22,0x22,0x3c,0x00,
108   0x00,0x00,0x1c,0x22,0x3e,0x02,0x1c,0x00,
109   0x18,0x04,0x0e,0x04,0x04,0x04,0x04,0x00,
110   0x00,0x00,0x3c,0x22,0x22,0x3c,0x20,0x18,
111   0x02,0x02,0x1e,0x22,0x22,0x22,0x22,0x00,
112   0x08,0x00,0x0c,0x08,0x08,0x08,0x1c,0x00,
113   0x10,0x00,0x18,0x10,0x10,0x10,0x12,0x0c,
114   0x02,0x02,0x22,0x12,0x0e,0x16,0x22,0x00,
115   0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x00,
116   0x00,0x00,0x16,0x2a,0x2a,0x2a,0x2a,0x00,
117   0x00,0x00,0x1a,0x26,0x22,0x22,0x22,0x00,
118   0x00,0x00,0x1c,0x22,0x22,0x22,0x1c,0x00,
119   0x00,0x00,0x1e,0x22,0x22,0x1e,0x02,0x02,
120   0x00,0x00,0x3c,0x22,0x22,0x3c,0x20,0x20,
121   0x00,0x00,0x34,0x0c,0x04,0x04,0x04,0x00,
122   0x00,0x00,0x3c,0x02,0x1c,0x20,0x1e,0x00,
123   0x08,0x08,0x1c,0x08,0x08,0x08,0x10,0x00,
124   0x00,0x00,0x22,0x22,0x22,0x32,0x2c,0x00,
125   0x00,0x00,0x22,0x22,0x22,0x14,0x08,0x00,
126   0x00,0x00,0x22,0x22,0x2a,0x2a,0x14,0x00,
127   0x00,0x00,0x22,0x14,0x08,0x14,0x22,0x00,
128   0x00,0x00,0x22,0x22,0x14,0x08,0x04,0x02,
129   0x00,0x00,0x3e,0x10,0x08,0x04,0x3e,0x00,
130   0x10,0x08,0x08,0x04,0x08,0x08,0x10,0x00,
131   0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,
132   0x04,0x08,0x08,0x10,0x08,0x08,0x04,0x00,
133   0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
134   0x2a,0x15,0x2a,0x15,0x2a,0x15,0x2a,0x15
135};
136
137teleprinter_device::teleprinter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
138   : generic_terminal_device(mconfig, TELEPRINTER, "Teleprinter", tag, owner, clock, "teleprinter", __FILE__)
139{
140}
141
142void teleprinter_device::scroll_line()
143{
144   memmove(m_buffer,m_buffer+TELEPRINTER_WIDTH,(TELEPRINTER_HEIGHT-1)*TELEPRINTER_WIDTH);
145   memset(m_buffer + TELEPRINTER_WIDTH*(TELEPRINTER_HEIGHT-1),0x20,TELEPRINTER_WIDTH);
146}
147
148void teleprinter_device::write_char(UINT8 data) {
149   m_buffer[(TELEPRINTER_HEIGHT-1)*TELEPRINTER_WIDTH+m_x_pos] = data;
150   m_x_pos++;
151   if (m_x_pos >= TELEPRINTER_WIDTH)
152   {
153      m_x_pos = 0;
154      scroll_line();
155   }
156}
157
158void teleprinter_device::clear() {
159   memset(m_buffer,0,TELEPRINTER_WIDTH*TELEPRINTER_HEIGHT);
160   m_x_pos = 0;
161}
162
163void teleprinter_device::term_write(UINT8 data)
164{
165   switch(data) {
166      case 10: m_x_pos = 0;
167            scroll_line();
168            break;
169      case 13: m_x_pos = 0; break;
170      case  9: m_x_pos = (m_x_pos & 0xf8) + 8;
171            if (m_x_pos >= TELEPRINTER_WIDTH)
172               m_x_pos = TELEPRINTER_WIDTH-1;
173
174            break;
175      case 16: break;
176      default: write_char(data); break;
177   }
178}
179
180/***************************************************************************
181    VIDEO HARDWARE
182***************************************************************************/
183UINT32 teleprinter_device::tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect)
184{
185   UINT8 code;
186   int y, c, x, b;
187
188   for (y = 0; y < TELEPRINTER_HEIGHT; y++)
189   {
190      for (c = 0; c < 8; c++)
191      {
192         int horpos = 0;
193         for (x = 0; x < TELEPRINTER_WIDTH; x++)
194         {
195            code = teleprinter_font[(m_buffer[y*TELEPRINTER_WIDTH + x]  & 0x7f) *8 + c];
196            for (b = 0; b < 8; b++)
197            {
198               bitmap.pix32(y*8 + c, horpos++) =  (code >> b) & 0x01 ? 0 : 0x00ffffff;
199            }
200         }
201      }
202   }
203   return 0;
204}
205
206static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
207{
208   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, generic_terminal_device, kbd_put)
209};
210
211/***************************************************************************
212    VIDEO HARDWARE
213***************************************************************************/
214MACHINE_CONFIG_FRAGMENT( generic_teleprinter )
215   MCFG_SCREEN_ADD(TELEPRINTER_SCREEN_TAG, RASTER)
216   MCFG_SCREEN_REFRESH_RATE(50)
217   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
218   MCFG_SCREEN_SIZE(TELEPRINTER_WIDTH*8, TELEPRINTER_HEIGHT*8)
219   MCFG_SCREEN_VISIBLE_AREA(0, TELEPRINTER_WIDTH*8-1, 0, TELEPRINTER_HEIGHT*8-1)
220   MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, teleprinter_device, tp_update)
221   MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
222MACHINE_CONFIG_END
223
224machine_config_constructor teleprinter_device::device_mconfig_additions() const
225{
226   return MACHINE_CONFIG_NAME(generic_teleprinter);
227}
228
229/*-------------------------------------------------
230    device_reset - device-specific reset
231-------------------------------------------------*/
232
233void teleprinter_device::device_reset()
234{
235   clear();
236   generic_terminal_device::device_reset();
237}
238
239const device_type TELEPRINTER = &device_creator<teleprinter_device>;
shelves/new_menus/src/emu/bus/rs232/teleprinter.h
r29303r29304
1#ifndef __TELEPRINTER_H__
2#define __TELEPRINTER_H__
3
4#include "machine/terminal.h"
5
6#define TELEPRINTER_WIDTH 80
7#define TELEPRINTER_HEIGHT 50
8
9#define GENERIC_TELEPRINTER_INTERFACE GENERIC_TERMINAL_INTERFACE
10
11/***************************************************************************
12    DEVICE CONFIGURATION MACROS
13***************************************************************************/
14#define TELEPRINTER_TAG "teleprinter"
15#define TELEPRINTER_SCREEN_TAG "tty_screen"
16
17#define MCFG_GENERIC_TELEPRINTER_ADD(_tag, _intrf) \
18   MCFG_DEVICE_ADD(_tag, TELEPRINTER, 0) \
19   MCFG_DEVICE_CONFIG(_intrf)
20
21#define MCFG_GENERIC_TELEPRINTER_REMOVE(_tag)       \
22   MCFG_DEVICE_REMOVE(_tag)
23
24/***************************************************************************
25    FUNCTION PROTOTYPES
26***************************************************************************/
27
28class teleprinter_device : public generic_terminal_device
29{
30public:
31   teleprinter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   UINT32 tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect);
33protected:
34   virtual void term_write(UINT8 data);
35   virtual void device_reset();
36   virtual machine_config_constructor device_mconfig_additions() const;
37private:
38   void scroll_line();
39   void write_char(UINT8 data);
40   void clear();
41};
42
43extern const device_type TELEPRINTER;
44
45#endif /* __TELEPRINTER_H__ */
shelves/new_menus/src/emu/bus/coco/coco_fdc.c
r29303r29304
299299   else if (data & 0x40)
300300      drive = 3;
301301
302   device_t *floppy[4];
302   legacy_floppy_image_device *floppy[4];
303303
304   floppy[0] = subdevice(FLOPPY_0);
305   floppy[1] = subdevice(FLOPPY_1);
306   floppy[2] = subdevice(FLOPPY_2);
307   floppy[3] = subdevice(FLOPPY_3);
304   floppy[0] = subdevice<legacy_floppy_image_device>(FLOPPY_0);
305   floppy[1] = subdevice<legacy_floppy_image_device>(FLOPPY_1);
306   floppy[2] = subdevice<legacy_floppy_image_device>(FLOPPY_2);
307   floppy[3] = subdevice<legacy_floppy_image_device>(FLOPPY_3);
308308
309309   for (int i = 0; i < 4; i++)
310310   {
311      floppy_mon_w(floppy[i], i == drive ? CLEAR_LINE : ASSERT_LINE);
311      floppy[i]->floppy_mon_w(i == drive ? CLEAR_LINE : ASSERT_LINE);
312312   }
313313
314314   head = ((data & 0x40) && (drive != 3)) ? 1 : 0;
shelves/new_menus/src/emu/bus/vic20/exp.h
r29303r29304
6161
6262#define MCFG_VIC20_PASSTHRU_EXPANSION_SLOT_ADD(_tag) \
6363   MCFG_VIC20_EXPANSION_SLOT_ADD(_tag, 0, vic20_expansion_cards, NULL) \
64   MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, irq_w), DEVWRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, nmi_w), DEVWRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, res_w))
64   MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, irq_w)) \
65   MCFG_VIC20_EXPANSION_SLOT_NMI_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, nmi_w)) \
66   MCFG_VIC20_EXPANSION_SLOT_RES_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, vic20_expansion_slot_device, res_w))
6567
6668
67#define MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACKS(_irq, _nmi, _res) \
68   downcast<vic20_expansion_slot_device *>(device)->set_irq_callbacks(DEVCB2_##_irq, DEVCB2_##_nmi, DEVCB2_##_res);
69#define MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
70   devcb = &vic20_expansion_slot_device::set_irq_wr_callback(*device, DEVCB2_##_write);
6971
72#define MCFG_VIC20_EXPANSION_SLOT_NMI_CALLBACK(_write) \
73   devcb = &vic20_expansion_slot_device::set_nmi_wr_callback(*device, DEVCB2_##_write);
7074
75#define MCFG_VIC20_EXPANSION_SLOT_RES_CALLBACK(_write) \
76   devcb = &vic20_expansion_slot_device::set_res_wr_callback(*device, DEVCB2_##_write);
7177
78
79
7280//**************************************************************************
7381//  TYPE DEFINITIONS
7482//**************************************************************************
r29303r29304
8593   // construction/destruction
8694   vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8795
88   template<class _irq, class _nmi, class _res> void set_irq_callbacks(_irq irq, _nmi nmi, _res res) {
89      m_write_irq.set_callback(irq);
90      m_write_nmi.set_callback(nmi);
91      m_write_res.set_callback(res);
92   }
96   template<class _Object> static devcb2_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<vic20_expansion_slot_device &>(device).m_write_irq.set_callback(object); }
97   template<class _Object> static devcb2_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast<vic20_expansion_slot_device &>(device).m_write_nmi.set_callback(object); }
98   template<class _Object> static devcb2_base &set_res_wr_callback(device_t &device, _Object object) { return downcast<vic20_expansion_slot_device &>(device).m_write_res.set_callback(object); }
9399
94100   // computer interface
95101   UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3);
shelves/new_menus/src/emu/bus/c64/exp.h
r29303r29304
6262
6363#define MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD() \
6464   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, c64_expansion_cards, NULL) \
65   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, irq_w), DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, nmi_w), DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)) \
66   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(DEVREAD8(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_cd_r), DEVWRITE8(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_cd_w), DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_w))
65   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, irq_w)) \
66   MCFG_C64_EXPANSION_SLOT_NMI_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, nmi_w)) \
67   MCFG_C64_EXPANSION_SLOT_RESET_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w)) \
68   MCFG_C64_EXPANSION_SLOT_CD_INPUT_CALLBACK(DEVREAD8(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_cd_r)) \
69   MCFG_C64_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(DEVWRITE8(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_cd_w)) \
70   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, c64_expansion_slot_device, dma_w))
6771
6872
69#define MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(_irq, _nmi, _reset) \
70   downcast<c64_expansion_slot_device *>(device)->set_irq_callbacks(DEVCB2_##_irq, DEVCB2_##_nmi, DEVCB2_##_reset);
73#define MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACK(_write) \
74   devcb = &c64_expansion_slot_device::set_irq_wr_callback(*device, DEVCB2_##_write);
7175
72#define MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(_read, _write, _dma) \
73   downcast<c64_expansion_slot_device *>(device)->set_dma_callbacks(DEVCB2_##_read, DEVCB2_##_write, DEVCB2_##_dma);
76#define MCFG_C64_EXPANSION_SLOT_NMI_CALLBACK(_write) \
77   devcb = &c64_expansion_slot_device::set_nmi_wr_callback(*device, DEVCB2_##_write);
7478
79#define MCFG_C64_EXPANSION_SLOT_RESET_CALLBACK(_write) \
80   devcb = &c64_expansion_slot_device::set_reset_wr_callback(*device, DEVCB2_##_write);
7581
82#define MCFG_C64_EXPANSION_SLOT_CD_INPUT_CALLBACK(_read) \
83   devcb = &c64_expansion_slot_device::set_cd_rd_callback(*device, DEVCB2_##_read);
7684
85#define MCFG_C64_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(_write) \
86   devcb = &c64_expansion_slot_device::set_cd_wr_callback(*device, DEVCB2_##_write);
87
88#define MCFG_C64_EXPANSION_SLOT_DMA_CALLBACK(_write) \
89   devcb = &c64_expansion_slot_device::set_dma_wr_callback(*device, DEVCB2_##_write);
90
91
92
7793//**************************************************************************
7894//  TYPE DEFINITIONS
7995//**************************************************************************
r29303r29304
90106   // construction/destruction
91107   c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
92108
93   template<class _irq, class _nmi, class _reset> void set_irq_callbacks(_irq irq, _nmi nmi, _reset reset) {
94      m_write_irq.set_callback(irq);
95      m_write_nmi.set_callback(nmi);
96      m_write_reset.set_callback(reset);
97   }
109   template<class _Object> static devcb2_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<c64_expansion_slot_device &>(device).m_write_irq.set_callback(object); }
110   template<class _Object> static devcb2_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast<c64_expansion_slot_device &>(device).m_write_nmi.set_callback(object); }
111   template<class _Object> static devcb2_base &set_reset_wr_callback(device_t &device, _Object object) { return downcast<c64_expansion_slot_device &>(device).m_write_reset.set_callback(object); }
112   template<class _Object> static devcb2_base &set_cd_rd_callback(device_t &device, _Object object) { return downcast<c64_expansion_slot_device &>(device).m_read_dma_cd.set_callback(object); }
113   template<class _Object> static devcb2_base &set_cd_wr_callback(device_t &device, _Object object) { return downcast<c64_expansion_slot_device &>(device).m_write_dma_cd.set_callback(object); }
114   template<class _Object> static devcb2_base &set_dma_wr_callback(device_t &device, _Object object) { return downcast<c64_expansion_slot_device &>(device).m_write_dma.set_callback(object); }
98115
99   template<class _read, class _write, class _dma> void set_dma_callbacks(_read read, _write write, _dma dma) {
100      m_read_dma_cd.set_callback(read);
101      m_write_dma_cd.set_callback(write);
102      m_write_dma.set_callback(dma);
103   }
104
105116   // computer interface
106117   UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
107118   void cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
shelves/new_menus/src/emu/bus/bml3/bml3mp1805.c
r29303r29304
128128      floppy_name = FLOPPY_3;
129129      break;
130130   }
131   device_t *floppy = subdevice(floppy_name);
131   legacy_floppy_image_device *floppy = subdevice<legacy_floppy_image_device>(floppy_name);
132132   m_mc6843->set_drive(drive);
133   floppy_mon_w(floppy, motor);
134   floppy_drive_set_ready_state(floppy, ASSERT_LINE, 0);
133   floppy->floppy_mon_w(motor);
134   floppy->floppy_drive_set_ready_state(ASSERT_LINE, 0);
135135   m_mc6843->set_side(side);
136136}
137137
shelves/new_menus/src/emu/bus/bml3/bml3mp1802.c
r29303r29304
110110      floppy_name = FLOPPY_3;
111111      break;
112112   }
113   device_t *floppy = subdevice(floppy_name);
113   legacy_floppy_image_device *floppy = subdevice<legacy_floppy_image_device>(floppy_name);
114114   m_wd17xx->set_drive(drive);
115   floppy_mon_w(floppy, !motor);
116   floppy_drive_set_ready_state(floppy, ASSERT_LINE, 0);
115   floppy->floppy_mon_w(!motor);
116   floppy->floppy_drive_set_ready_state(ASSERT_LINE, 0);
117117   m_wd17xx->set_side(side);
118118}
119119
shelves/new_menus/src/emu/video/h63484.c
r29303r29304
382382}
383383
384384
385//-------------------------------------------------
386//  device_config_complete - perform any
387//  operations now that the configuration is
388//  complete
389//-------------------------------------------------
390
391void h63484_device::device_config_complete()
392{
393   // inherit a copy of the static data
394   const h63484_interface *intf = reinterpret_cast<const h63484_interface *>(static_config());
395   if (intf != NULL)
396      *static_cast<h63484_interface *>(this) = *intf;
397
398   // or initialize to defaults if none provided
399   else
400   {
401      // ...
402   }
403}
404
405385inline void h63484_device::fifo_w_clear()
406386{
407387   int i;
r29303r29304
19741954
19751955void h63484_device::device_start()
19761956{
1977   //h63484->space = device->memory().space(AS_0);
1957   m_display_cb.bind_relative_to(*owner());
19781958}
19791959
19801960//-------------------------------------------------
r29303r29304
20622042         for (int b=0; b<ppw; b++)
20632043         {
20642044            int x = sx + g * ppw + b;
2065            if (cliprect.contains(x, y))
2066            {
2067               if (m_display_cb)
2068                  m_display_cb(this, bitmap, y, x, data & mask);
2069               else
2070                  bitmap.pix16(y, x) = data & mask;
2071            }
2045            if (!m_display_cb.isnull())
2046               m_display_cb(bitmap, cliprect, y, x, data & mask);
2047            else if (cliprect.contains(x, y))
2048               bitmap.pix16(y, x) = data & mask;
20722049
20732050            data >>= bpp;
20742051         }
shelves/new_menus/src/emu/video/h63484.h
r29303r29304
1414#include "emu.h"
1515
1616
17typedef device_delegate<void (bitmap_ind16 &bitmap, const rectangle &cliprect, int y, int x, UINT16 data)> h63484_display_delegate;
18
19
1720/***************************************************************************
1821    DEVICE CONFIGURATION MACROS
1922***************************************************************************/
2023
21#define MCFG_H63484_ADD(_tag, _clock, _config, _map) \
24#define MCFG_H63484_ADD(_tag, _clock, _map) \
2225   MCFG_DEVICE_ADD(_tag, H63484, _clock) \
23   MCFG_DEVICE_CONFIG(_config) \
2426   MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)
2527
26#define H63484_INTERFACE(name) \
27   const h63484_interface (name) =
28#define MCFG_H63484_ADDRESS_MAP(_map) \
29   MCFG_DEVICE_ADDRESS_MAP(AS_0, _map)
2830
29typedef void (*h63484_display_pixels_func)(device_t *device, bitmap_ind16 &bitmap, int y, int x, UINT16 data);
30#define H63484_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_ind16 &bitmap, int y, int x, UINT16 data)
31#define MCFG_H63484_DISPLAY_CALLBACK_OWNER(_class, _method) \
32   h63484_device::static_set_display_callback(*device, h63484_display_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
3133
32// ======================> h63484_interface
34#define H63484_DISPLAY_PIXELS_MEMBER(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, int x, UINT16 data)
3335
34struct h63484_interface
35{
36   h63484_display_pixels_func  m_display_cb;
37};
3836
3937// ======================> h63484_device
4038
4139class h63484_device :   public device_t,
4240                  public device_memory_interface,
43                  public device_video_interface,
44                  public h63484_interface
41                  public device_video_interface
4542{
4643public:
4744   // construction/destruction
4845   h63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4946
47   static void static_set_display_callback(device_t &device, h63484_display_delegate callback) { downcast<h63484_device &>(device).m_display_cb = callback; }
48
5049   DECLARE_WRITE16_MEMBER( address_w );
5150   DECLARE_WRITE16_MEMBER( data_w );
5251
r29303r29304
6261   virtual void device_start();
6362   virtual void device_reset();
6463   //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
65   virtual void device_config_complete();
6664
6765   inline UINT16 readword(offs_t address);
6866   inline void writeword(offs_t address, UINT16 data);
r29303r29304
105103   int translate_command(UINT16 data);
106104   void draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int vs, int y, int layer_n, bool active, bool ins_window);
107105
106   h63484_display_delegate  m_display_cb;
108107
109108   UINT8 m_ar;
110109   UINT8 m_vreg[0x100];
shelves/new_menus/src/emu/video/huc6270.c
r29303r29304
9494
9595const UINT8 huc6270_device::vram_increments[4] = { 1, 32, 64, 128 };
9696
97
98void huc6270_device::device_config_complete()
99{
100   const huc6270_interface *intf = reinterpret_cast<const huc6270_interface *>(static_config());
101
102   if ( intf != NULL )
103   {
104      *static_cast<huc6270_interface *>(this) = *intf;
105   }
106   else
107   {
108      memset(&m_irq_changed, 0, sizeof(m_irq_changed));
109   }
110}
111
112
11397huc6270_device::huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
114   : device_t(mconfig, HUC6270, "HuC6270 VDC", tag, owner, clock, "huc6270", __FILE__)
98   : device_t(mconfig, HUC6270, "HuC6270 VDC", tag, owner, clock, "huc6270", __FILE__),
99   m_vram_size(0),
100   m_irq_changed_cb(*this)
115101{
116102}
117103
r29303r29304
293279      if ( m_cr & 0x02 )
294280      {
295281         m_status |= HUC6270_OR;
296         m_irq_changed( ASSERT_LINE );
282         m_irq_changed_cb( ASSERT_LINE );
297283      }
298284   }
299285}
r29303r29304
306292      if ( m_cr & 0x08 )
307293      {
308294         m_status |= HUC6270_VD;
309         m_irq_changed( ASSERT_LINE );
295         m_irq_changed_cb( ASSERT_LINE );
310296      }
311297
312298      /* Should we initiate a VRAM->SATB DMA transfer.
r29303r29304
331317         {
332318            m_satb_countdown = 4;
333319//                  m_status |= HUC6270_DS;
334//                  m_irq_changed( ASSERT_LINE );
320//                  m_irq_changed_cb( ASSERT_LINE );
335321         }
336322      }
337323
r29303r29304
471457         if ( collission && ( m_cr & 0x01 ) )
472458         {
473459            m_status |= HUC6270_CR;
474            m_irq_changed( ASSERT_LINE );
460            m_irq_changed_cb( ASSERT_LINE );
475461         }
476462      }
477463   }
r29303r29304
533519            if ( m_dcr & 0x0002 )
534520            {
535521               m_status |= HUC6270_DV;
536               m_irq_changed( ASSERT_LINE );
522               m_irq_changed_cb( ASSERT_LINE );
537523            }
538524            m_dma_enabled = 0;
539525         }
r29303r29304
559545         if ( m_satb_countdown == 0 )
560546         {
561547            m_status |= HUC6270_DS;
562            m_irq_changed( ASSERT_LINE );
548            m_irq_changed_cb( ASSERT_LINE );
563549         }
564550      }
565551
r29303r29304
581567      if ( m_raster_count == m_rcr && ( m_cr & 0x04 ) )
582568      {
583569         m_status |= HUC6270_RR;
584         m_irq_changed( ASSERT_LINE );
570         m_irq_changed_cb( ASSERT_LINE );
585571      }
586572   }
587573
r29303r29304
598584      case 0x00:  /* status */
599585         data = m_status;
600586         m_status &= ~( HUC6270_VD | HUC6270_DV | HUC6270_RR | HUC6270_CR | HUC6270_OR | HUC6270_DS );
601         m_irq_changed( CLEAR_LINE );
587         m_irq_changed_cb( CLEAR_LINE );
602588         break;
603589
604590      case 0x02:
r29303r29304
654640//                  if ( m_raster_count == m_rcr && m_cr & 0x04 )
655641//                  {
656642//                      m_status |= HUC6270_RR;
657//                      m_irq_changed( ASSERT_LINE );
643//                      m_irq_changed_cb( ASSERT_LINE );
658644//                  }
659645//if (LOG) printf("%04x: RCR (%03x) written at %d,%d\n", activecpu_get_pc(), huc6270->m_rcr, video_screen_get_vpos(device->machine->first_screen()), video_screen_get_hpos(device->machine->first_screen()) );
660646               break;
r29303r29304
745731//                  if ( m_raster_count == m_rcr && m_cr & 0x04 )
746732//                  {
747733//                      m_status |= HUC6270_RR;
748//                      m_irq_changed( ASSERT_LINE );
734//                      m_irq_changed_cb( ASSERT_LINE );
749735//                  }
750736               break;
751737
r29303r29304
814800void huc6270_device::device_start()
815801{
816802   /* Resolve callbacks */
817   m_irq_changed.resolve( irq_changed, *this );
803   m_irq_changed_cb.resolve_safe();
818804
819   assert( ! m_irq_changed.isnull() );
805   m_vram = auto_alloc_array_clear(machine(), UINT16, m_vram_size/sizeof(UINT16));
806   m_vram_mask = (m_vram_size >> 1) - 1;
820807
821   m_vram = auto_alloc_array_clear(machine(), UINT16, vram_size/sizeof(UINT16));
822   m_vram_mask = (vram_size >> 1) - 1;
808   save_pointer(NAME(m_vram), m_vram_size/sizeof(UINT16));
823809
824   save_pointer(NAME(m_vram), vram_size/sizeof(UINT16));
825
826810   save_item(NAME(m_register_index));
827811   save_item(NAME(m_mawr));
828812   save_item(NAME(m_marr));
shelves/new_menus/src/emu/video/huc6270.h
r29303r29304
99
1010#include "emu.h"
1111
12#define MCFG_HUC6270_VRAM_SIZE(_size) \
13   huc6270_device::set_vram_size(*device, _size);
1214
15#define MCFG_HUC6270_IRQ_CHANGED_CB(_devcb) \
16   devcb = &huc6270_device::set_irq_changed_callback(*device, DEVCB2_##_devcb);
1317
14#define MCFG_HUC6270_ADD( _tag, _intrf )    \
15   MCFG_DEVICE_ADD( _tag, HUC6270, 0 )     \
16   MCFG_DEVICE_CONFIG( _intrf )
17
18
19struct huc6270_interface
18class huc6270_device :  public device_t
2019{
21   /* Size of Video ram (mandatory) */
22   UINT32              vram_size;
23   /* Callback for when the irq line may have changed (mandatory) */
24   devcb_write_line    irq_changed;
25};
26
27
28class huc6270_device :  public device_t,
29                  public huc6270_interface
30{
3120public:
3221   // construction/destruction
3322   huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23   
24   static void set_vram_size(device_t &device, UINT32 vram_size) { downcast<huc6270_device &>(device).m_vram_size = vram_size; }
25   template<class _Object> static devcb2_base &set_irq_changed_callback(device_t &device, _Object object) { return downcast<huc6270_device &>(device).m_irq_changed_cb.set_callback(object); }
3426
3527   DECLARE_READ8_MEMBER( read );
3628   DECLARE_WRITE8_MEMBER( write );
r29303r29304
4840
4941protected:
5042   // device-level overrides
51   virtual void device_config_complete();
5243   virtual void device_start();
5344   virtual void device_reset();
5445
r29303r29304
7566      HUC6270_HSW
7667   };
7768
78   /* Callbacks */
79   devcb_resolved_write_line   m_irq_changed;
69   
70   /* Size of Video ram (mandatory) */
71   UINT32 m_vram_size;
72   
73   /* Callback for when the irq line may have changed (mandatory) */
74   devcb2_write_line    m_irq_changed_cb;
8075
8176   UINT8   m_register_index;
8277
shelves/new_menus/src/emu/machine/i8271.h
r29303r29304
77#ifndef I8271_H_
88#define I8271_H_
99
10#include "imagedev/flopdrv.h"
11
1012#define MCFG_I8271_IRQ_CALLBACK(_write) \
1113   devcb = &i8271_device::set_irq_wr_callback(*device, DEVCB2_##_write);
1214
r29303r29304
126128   emu_timer *m_data_timer;
127129   emu_timer *m_command_complete_timer;
128130   
129   device_t *current_image();
131   legacy_floppy_image_device *current_image();
130132   void seek_to_track(int track);
131133   void load_bad_tracks(int surface);
132134   void write_bad_track(int surface, int track, int data);
shelves/new_menus/src/emu/machine/s3c2400.h
r29303r29304
379379   // static configuration
380380   static void static_set_palette_tag(device_t &device, const char *tag);
381381
382   // access to legacy token
383   struct s3c24xx_t *token() const { assert(m_token != NULL); return m_token; }
384
385382   // device-level overrides
386383   virtual void device_config_complete();
387384   virtual void device_start();
388385   virtual void device_reset();
389386private:
390387   // internal state
391   struct s3c24xx_t *m_token;
392388   required_device<palette_device> m_palette;
393389public:
394390   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
shelves/new_menus/src/emu/machine/aakart.c
r29303r29304
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()), 0, attotime::from_hz(clock()));
67   m_txtimer->adjust(attotime::from_hz(clock()*3), 0, attotime::from_hz(clock()*3));
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);
r29303r29304
108108//  device_timer - handler timer events
109109//-------------------------------------------------
110110
111#if 0
112
111113void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
112114{
113115   #if 0
r29303r29304
233235      m_new_command |= 2;
234236   }
235237}
238#else
236239
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
237260//**************************************************************************
238261//  READ/WRITE HANDLERS
239262//**************************************************************************
240263
241264READ8_MEMBER( aakart_device::read )
242265{
243   m_out_tx_func(CLEAR_LINE);
266   m_out_rx_func(CLEAR_LINE);
244267   return m_rx;
245268}
246269
r29303r29304
249272   // if(m_new_command) printf("skip cmd %02x\n",data);
250273
251274   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();
310
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   }
252335   m_new_command |= 1;
253   m_out_rx_func(CLEAR_LINE);
336
337   //m_tx_latch = data;
338   //m_new_command |= 1;
254339}
340
341#if 0
342void aakart_device::write_kbd_buf()
343{
344   //printf("%08x\n",data);
345   m_out_tx_func(ASSERT_LINE);
346   //debugger_break(machine());
347   m_status = STATUS_KEYDOWN;
348}
349#endif
shelves/new_menus/src/emu/machine/mc6843.c
r29303r29304
139139   /* setup/reset floppy drive */
140140   for ( i = 0; i < 4; i++ )
141141   {
142      device_t * img = floppy_image( i );
143      floppy_mon_w(img, CLEAR_LINE);
144      floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
145      floppy_drive_set_rpm( img, 300. );
142      legacy_floppy_image_device * img = floppy_image( i );
143      img->floppy_mon_w(CLEAR_LINE);
144      img->floppy_drive_set_ready_state(FLOPPY_DRIVE_READY, 0 );
145      img->floppy_drive_set_rpm( 300. );
146146   }
147147   
148148   /* reset registers */
r29303r29304
162162
163163
164164
165device_t* mc6843_device::floppy_image( UINT8 drive )
165legacy_floppy_image_device* mc6843_device::floppy_image( UINT8 drive )
166166{
167   device_t *img = floppy_get_device( machine(), drive );
167   legacy_floppy_image_device *img = floppy_get_device( machine(), drive );
168168   if (!img && owner()) {
169169      // For slot devices, drives are typically attached to the slot rather than the machine
170170      const char *floppy_name = NULL;
r29303r29304
182182         floppy_name = FLOPPY_3;
183183         break;
184184      }
185      img = owner()->subdevice(floppy_name);
185      img = owner()->subdevice<legacy_floppy_image_device>(floppy_name);
186186   }
187187   return img;
188188}
189189
190190
191device_t* mc6843_device::floppy_image( )
191legacy_floppy_image_device* mc6843_device::floppy_image( )
192192{
193193   return floppy_image( m_drive );
194194}
r29303r29304
262262/* Seek Track Zero bottom half */
263263void mc6843_device::finish_STZ( )
264264{
265   device_t* img = floppy_image( );
265   legacy_floppy_image_device* img = floppy_image( );
266266   int i;
267267
268268   /* seek to track zero */
269269   for ( i=0; i<83; i++ )
270270   {
271      if (floppy_tk00_r(img) == CLEAR_LINE)
271      if (img->floppy_tk00_r() == CLEAR_LINE)
272272         break;
273      floppy_drive_seek( img, -1 );
273      img->floppy_drive_seek( -1 );
274274   }
275275
276   LOG(( "%f mc6843_finish_STZ: actual=%i\n", machine().time().as_double(), floppy_drive_get_current_track( img ) ));
276   LOG(( "%f mc6843_finish_STZ: actual=%i\n", machine().time().as_double(), img->floppy_drive_get_current_track() ));
277277
278278   /* update state */
279279   m_CTAR = 0;
280280   m_GCR = 0;
281281   m_SAR = 0;
282   m_STRB |= floppy_tk00_r(img) << 4;
282   m_STRB |= img->floppy_tk00_r() << 4;
283283
284284   cmd_end( );
285285}
r29303r29304
289289/* Seek bottom half */
290290void mc6843_device::finish_SEK( )
291291{
292   device_t* img = floppy_image( );
292   legacy_floppy_image_device* img = floppy_image( );
293293
294294   /* seek to track */
295295   // TODO: not sure how CTAR bit 7 is handled here, but this is the safest approach for now
296   floppy_drive_seek( img, m_GCR - (m_CTAR & 0x7F) );
296   img->floppy_drive_seek( m_GCR - (m_CTAR & 0x7F) );
297297
298   LOG(( "%f mc6843_finish_SEK: from %i to %i (actual=%i)\n", machine().time().as_double(), (m_CTAR & 0x7F), m_GCR, floppy_drive_get_current_track( img ) ));
298   LOG(( "%f mc6843_finish_SEK: from %i to %i (actual=%i)\n", machine().time().as_double(), (m_CTAR & 0x7F), m_GCR, img->floppy_drive_get_current_track() ));
299299
300300   /* update state */
301301   m_CTAR = m_GCR;
r29303r29304
308308/* preamble to all sector read / write commands, returns 1 if found */
309309int mc6843_device::address_search( chrn_id* id )
310310{
311   device_t* img = floppy_image( );
311   legacy_floppy_image_device* img = floppy_image( );
312312   int r = 0;
313313
314314   while ( 1 )
315315   {
316      if ( ( ! floppy_drive_get_next_id( img, m_side, id ) ) || ( id->flags & ID_FLAG_CRC_ERROR_IN_ID_FIELD ) || ( id->N != 0 ) )
316      if ( ( ! img->floppy_drive_get_next_id( m_side, id ) ) || ( id->flags & ID_FLAG_CRC_ERROR_IN_ID_FIELD ) || ( id->N != 0 ) )
317317      {
318318         /* read address error */
319319         LOG(( "%f mc6843_address_search: get_next_id failed\n", machine().time().as_double() ));
r29303r29304
343343         return 1;
344344      }
345345
346      if ( floppy_drive_get_flag_state( img, FLOPPY_DRIVE_INDEX ) )
346      if ( img->floppy_drive_get_flag_state( FLOPPY_DRIVE_INDEX ) )
347347      {
348348         r++;
349349         if ( r >= 4 )
r29303r29304
403403void mc6843_device::cont_SR( )
404404{
405405   chrn_id id;
406   device_t* img = floppy_image( );
406   legacy_floppy_image_device* img = floppy_image( );
407407
408408   /* sector seek */
409409   if ( ! address_search_read( &id ) )
410410      return;
411411
412412   /* sector read */
413   floppy_drive_read_sector_data( img, m_side, id.data_id, m_data, 128 );
413   img->floppy_drive_read_sector_data( m_side, id.data_id, m_data, 128 );
414414   m_data_idx = 0;
415415   m_data_size = 128;
416416   m_STRA |= 0x01;     /* set Data Transfer Request */
r29303r29304
551551      data = m_CTAR;
552552      LOG(( "%f %s mc6843_r: read CTAR %i (actual=%i)\n",
553553            machine().time().as_double(), machine().describe_context(), data,
554            floppy_drive_get_current_track( floppy_image( ) ) ));
554            floppy_image()->floppy_drive_get_current_track()));
555555      break;
556556
557557   case 2: /* Interrupt Status Register (ISR) */
r29303r29304
569569   case 3: /* Status Register A (STRA) */
570570   {
571571      /* update */
572      device_t* img = floppy_image( );
573      int flag = floppy_drive_get_flag_state( img, FLOPPY_DRIVE_READY);
572      legacy_floppy_image_device* img = floppy_image( );
573      int flag = img->floppy_drive_get_flag_state( FLOPPY_DRIVE_READY);
574574      m_STRA &= 0xa3;
575575      if ( flag & FLOPPY_DRIVE_READY )
576576         m_STRA |= 0x04;
577577
578      m_STRA |= !floppy_tk00_r(img) << 3;
579      m_STRA |= !floppy_wpt_r(img) << 4;
578      m_STRA |= !img->floppy_tk00_r() << 3;
579      m_STRA |= !img->floppy_wpt_r() << 4;
580580
581581      if ( m_index_pulse )
582582         m_STRA |= 0x40;
r29303r29304
605605      data = m_LTAR;
606606      LOG(( "%f %s mc6843_r: read LTAR %i (actual=%i)\n",
607607            machine().time().as_double(), machine().describe_context(), data,
608            floppy_drive_get_current_track( floppy_image( ) ) ));
608            floppy_image()->floppy_drive_get_current_track()));
609609      break;
610610
611611   default:
r29303r29304
639639         if ( m_data_idx >= m_data_size )
640640         {
641641            /* end of sector write */
642            device_t* img = floppy_image( );
642            legacy_floppy_image_device* img = floppy_image( );
643643
644644            LOG(( "%f %s mc6843_w: write sector %i\n", machine().time().as_double(), machine().describe_context(), m_data_id ));
645645
646            floppy_drive_write_sector_data(
647               img, m_side, m_data_id,
646            img->floppy_drive_write_sector_data(
647               m_side, m_data_id,
648648               m_data, m_data_size,
649649               (cmd == CMD_SWD) ? ID_FLAG_DELETED_DATA : 0 );
650650
r29303r29304
701701            if ( (m_data[2] == 0) && (m_data[4] == 0) )
702702            {
703703               /* valid address id field */
704               device_t* img = floppy_image( );
704               legacy_floppy_image_device* img = floppy_image( );
705705               UINT8 track  = m_data[1];
706706               UINT8 sector = m_data[3];
707707               UINT8 filler = 0xe5; /* standard Thomson filler */
708708               LOG(( "%f %s mc6843_w: address id detected track=%i sector=%i\n", machine().time().as_double(), machine().describe_context(), track, sector));
709               floppy_drive_format_sector( img, m_side, sector, track, 0, sector, 0, filler );
709               img->floppy_drive_format_sector( m_side, sector, track, 0, sector, 0, filler );
710710            }
711711            else
712712            {
r29303r29304
736736      m_CTAR = data;
737737      LOG(( "%f %s mc6843_w: set CTAR to %i %02X (actual=%i) \n",
738738            machine().time().as_double(), machine().describe_context(), m_CTAR, data,
739            floppy_drive_get_current_track( floppy_image( ) ) ));
739            floppy_image()->floppy_drive_get_current_track()));
740740      break;
741741
742742   case 2: /* Command Register (CMR) */
r29303r29304
816816      m_LTAR = data & 0x7f;
817817      LOG(( "%f %s mc6843_w: set LTAR to %i %02X (actual=%i)\n",
818818            machine().time().as_double(), machine().describe_context(), m_LTAR, data,
819            floppy_drive_get_current_track( floppy_image( ) ) ));
819            floppy_image()->floppy_drive_get_current_track()));
820820      break;
821821
822822   default:
shelves/new_menus/src/emu/machine/mc6843.h
r29303r29304
6767   /* trigger delayed actions (bottom halves) */
6868   emu_timer* m_timer_cont;
6969   
70   device_t* floppy_image(UINT8 drive);
71   device_t* floppy_image();
70   legacy_floppy_image_device* floppy_image(UINT8 drive);
71   legacy_floppy_image_device* floppy_image();
7272   void status_update();
7373   void cmd_end();
7474   void finish_STZ();
shelves/new_menus/src/emu/machine/s3c2410.h
r29303r29304
464464   // static configuration
465465   static void static_set_palette_tag(device_t &device, const char *tag);
466466
467   // access to legacy token
468   struct s3c24xx_t *token() const { assert(m_token != NULL); return m_token; }
469
470467   DECLARE_WRITE_LINE_MEMBER( frnb_w );
471468   
472469   // device-level overrides
r29303r29304
475472   virtual void device_reset();
476473private:
477474   // internal state
478   struct s3c24xx_t *m_token;
479475   required_device<palette_device> m_palette;
480476public:
481477   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
shelves/new_menus/src/emu/machine/smc92x4.c
r29303r29304
200200
201201int smc92x4_device::image_is_single_density()
202202{
203   floppy_image_legacy *image = flopimg_get_image(m_drive);
203   floppy_image_legacy *image = m_drive->flopimg_get_image();
204204   return (floppy_get_track_size(image, 0, 0)<4000);
205205}
206206
r29303r29304
436436   int redcur;
437437   int precomp;
438438   int write_long;
439   mfm_harddisk_device *harddisk;
440439
441440   switch (id)
442441   {
r29303r29304
481480         else
482481         {
483482            if (VERBOSE>5) LOG("smc92x4 step %s direction %d\n", m_drive->tag(), m_step_direction);
484            floppy_drive_seek(m_drive, m_step_direction);
483            m_drive->floppy_drive_seek(m_step_direction);
485484         }
486485      }
487486      else
488487      {
489488         if (VERBOSE>6) LOG("smc92x4 step harddisk direction %d\n", m_step_direction);
490         harddisk = static_cast<mfm_harddisk_device *>(m_drive);
491         harddisk->seek(m_step_direction);
489         m_harddisk->seek(m_step_direction);
492490      }
493491      sync_status_in();
494492      break;
r29303r29304
566564{
567565   int des_cylinder, cur_cylinder;
568566   bool found = false;
569   mfm_harddisk_device *harddisk;
570567
571568   sync_latches_out();
572569   sync_status_in();
r29303r29304
579576   if (m_selected_drive_type & TYPE_FLOPPY)
580577   {
581578      chrn_id idflop;
582      if (flopimg_get_image(m_drive) == NULL)
579      if (m_drive->flopimg_get_image() == NULL)
583580      {
584581         if (VERBOSE>2) LOG("smc92x4 warn: No disk in drive\n");
585582         m_register_r[CHIP_STATUS] |= CS_SYNCERR;
r29303r29304
590587      if ((image_is_single_density() && in_single_density_mode())
591588         || (!image_is_single_density() && !in_single_density_mode()))
592589      {
593         found = floppy_drive_get_next_id(m_drive, m_register_w[DESIRED_HEAD]&0x0f, &idflop);
590         found = m_drive->floppy_drive_get_next_id(m_register_w[DESIRED_HEAD]&0x0f, &idflop);
594591         copyid(idflop, id); /* Need to use bigger values for HD, but we don't use separate variables here */
595592      }
596593      else
r29303r29304
608605   }
609606   else
610607   {
611      harddisk = static_cast<mfm_harddisk_device *>(m_drive);
612
613      harddisk->get_next_id(m_register_w[DESIRED_HEAD]&0x0f, id);
608      m_harddisk->get_next_id(m_register_w[DESIRED_HEAD]&0x0f, id);
614609      sync_status_in();
615610      if (!(m_register_r[DRIVE_STATUS]& DS_READY))
616611      {
r29303r29304
670665   int found = false;
671666   int foundsect = false;
672667   int des_cylinder = 0;
673   mfm_harddisk_device *harddisk;
674668
675669   // Set command termination code. The error code is set first, and
676670   // on success, it is cleared.
r29303r29304
683677      if (m_selected_drive_type & TYPE_FLOPPY)
684678      {
685679         chrn_id idflop;
686         found = floppy_drive_get_next_id(m_drive, m_register_w[DESIRED_HEAD]&0x0f, &idflop);
680         found = m_drive->floppy_drive_get_next_id(m_register_w[DESIRED_HEAD]&0x0f, &idflop);
687681         copyid(idflop, id);
688682         if (/* pass==1 && */!found)
689683         {
r29303r29304
694688      }
695689      else
696690      {
697         harddisk = static_cast<mfm_harddisk_device *>(m_drive);
698         harddisk->get_next_id(m_register_w[DESIRED_HEAD]&0x0f, id);
691         m_harddisk->get_next_id(m_register_w[DESIRED_HEAD]&0x0f, id);
699692         sync_status_in();
700693         if (!(m_register_r[DRIVE_STATUS]& DS_READY))
701694         {
r29303r29304
742735void smc92x4_device::data_transfer_read(chrn_id_hd id, int transfer_enable)
743736{
744737   int i, retry, sector_len;
745   mfm_harddisk_device *harddisk;
746738
747739   int sector_data_id;
748740   dynamic_buffer buf;
r29303r29304
780772
781773   if (m_selected_drive_type & TYPE_FLOPPY)
782774   {
783      floppy_drive_read_sector_data(m_drive, id.H, sector_data_id, buf, sector_len);
775      m_drive->floppy_drive_read_sector_data(id.H, sector_data_id, buf, sector_len);
784776   }
785777   else
786778   {
787779      // TODO: Should we get the sector length from the harddisk?
788      harddisk = static_cast<mfm_harddisk_device *>(m_drive);
789      harddisk->read_sector(id.C, id.H, id.R, buf);
780      m_harddisk->read_sector(id.C, id.H, id.R, buf);
790781   }
791782   sync_status_in();
792783
r29303r29304
837828   int retry, i, sector_len;
838829   dynamic_buffer buf;
839830   int sector_data_id;
840   mfm_harddisk_device *harddisk;
841831   sync_latches_out();
842832   sync_status_in();
843833
r29303r29304
876866   if (m_selected_drive_type & TYPE_FLOPPY)
877867   {
878868      if (VERBOSE>4) LOG("smc92x4 info: write sector CHS=(%d,%d,%d)\n", id.C, id.H, id.R);
879      floppy_drive_write_sector_data(m_drive, id.H, sector_data_id, buf, sector_len, false);
869      m_drive->floppy_drive_write_sector_data(id.H, sector_data_id, buf, sector_len, false);
880870   }
881871   else
882872   {
883      harddisk = static_cast<mfm_harddisk_device *>(m_drive);
884      harddisk->write_sector(id.C, id.H, id.R, buf);
873      m_harddisk->write_sector(id.C, id.H, id.R, buf);
885874   }
886875   sync_status_in();
887876
r29303r29304
13441333
13451334   sync_status_in();
13461335
1347   floppy = flopimg_get_image(m_drive);
1336   floppy = m_drive->flopimg_get_image();
13481337
13491338   if (floppy != NULL)
13501339      data_count = floppy_get_track_size(floppy, 0, 0);
r29303r29304
14861475   memset(&buffer[index], gap_byte, gap4);
14871476   index += gap4;
14881477
1489   floppy_drive_write_track_data_info_buffer(m_drive, m_register_w[DESIRED_HEAD]&0x0f, buffer, &data_count);
1478   m_drive->floppy_drive_write_track_data_info_buffer(m_register_w[DESIRED_HEAD]&0x0f, buffer, &data_count);
14901479   sync_status_in();
14911480}
14921481
r29303r29304
15061495   int normal_data_mark = flags & 0x10;
15071496   int data_count=0;
15081497
1509   mfm_harddisk_device *harddisk = static_cast<mfm_harddisk_device *>(m_drive);
1510
15111498   dynamic_buffer buffer;
15121499
15131500   sync_status_in();
r29303r29304
15851572   for (i=0; i < gap4; i++) buffer[index++] = gap_byte;
15861573
15871574   // Now write the whole track
1588   harddisk->write_track(m_register_w[DESIRED_HEAD]&0x0f, buffer, data_count);
1575   m_harddisk->write_track(m_register_w[DESIRED_HEAD]&0x0f, buffer, data_count);
15891576
15901577   sync_status_in();
15911578}
r29303r29304
16181605
16191606   sync_latches_out();
16201607
1621   floppy = flopimg_get_image(m_drive);
1608   floppy = m_drive->flopimg_get_image();
16221609
16231610   /* Determine the track size. We cannot allow different sizes in this design. */
16241611   if (floppy != NULL)
r29303r29304
16341621
16351622   buffer = global_alloc_array(UINT8, data_count);
16361623
1637   floppy_drive_read_track_data_info_buffer(m_drive, m_register_w[DESIRED_HEAD]&0x0f, (char *)buffer, &data_count);
1624   m_drive->floppy_drive_read_track_data_info_buffer(m_register_w[DESIRED_HEAD]&0x0f, (char *)buffer, &data_count);
16381625   sync_status_in();
16391626
16401627   // Transfer the buffer to the external memory. We assume the memory
r29303r29304
16621649   int i;
16631650   UINT8 *buffer;
16641651   int data_count=0;
1665   mfm_harddisk_device *harddisk = static_cast<mfm_harddisk_device *>(m_drive);
1666
16671652   sync_latches_out();
16681653
1669   data_count = harddisk->get_track_length();
1654   data_count = m_harddisk->get_track_length();
16701655   buffer = global_alloc_array(UINT8, data_count);
16711656
16721657   /* buffer and data_count are allocated and set by the function. */
1673   harddisk->read_track(m_register_w[DESIRED_HEAD]&0x0f, buffer);
1658   m_harddisk->read_track(m_register_w[DESIRED_HEAD]&0x0f, buffer);
16741659   sync_status_in();
16751660
16761661   if (!(m_register_r[DRIVE_STATUS] & DS_READY))
r29303r29304
20041989   if (VERBOSE>0) LOG("smc92x4: use realistic timing: %02x\n", realistic);
20051990}
20061991
2007void smc92x4_device::connect_drive(device_t *drive)
1992void smc92x4_device::connect_floppy_drive(legacy_floppy_image_device *drive)
20081993{
20091994   m_drive = drive;
20101995   if (VERBOSE>3)
r29303r29304
20131998      else LOG("smc92x4: Connect drive %s\n", drive->tag());
20141999   }
20152000}
2001void smc92x4_device::connect_hard_drive(mfm_harddisk_device *drive)
2002{
2003   m_harddisk = drive;
2004   if (VERBOSE>3)
2005   {
2006      if (drive==NULL) LOG("smc92x4: Unselect all drives\n");
2007      else LOG("smc92x4: Connect drive %s\n", drive->tag());
2008   }
2009}
20162010
20172011void smc92x4_device::reset()
20182012{
shelves/new_menus/src/emu/machine/smc92x4.h
r29303r29304
9898
9999   // Used to reconfigure the drive connections. Drive selection is done
100100   // using the select lines and maybe also the user-programmable outputs.
101   void connect_drive(device_t *drive);
101   void connect_floppy_drive(legacy_floppy_image_device *drive);
102   void connect_hard_drive(mfm_harddisk_device *drive);
102103
103104   void reset();
104105
r29303r29304
221222   // Hard disks must be instances of mfmhd_device; floppy disks are the common drives.
222223   // We expect the embedding board to replace the drive according to the
223224   // select lines.
224   device_t    *m_drive;
225   legacy_floppy_image_device    *m_drive;
226   mfm_harddisk_device           *m_harddisk;
225227};
226228
227229#define MCFG_SMC92X4_ADD(_tag, _intrf) \
shelves/new_menus/src/emu/machine/mc2661.c
r29303r29304
9797//  mc2661_device - constructor
9898//-------------------------------------------------
9999
100mc2661_device::mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
101   : device_t(mconfig, MC2661, "MC2661", tag, owner, clock, "mc2661", __FILE__),
102      device_serial_interface(mconfig, *this)
100mc2661_device::mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
101   device_t(mconfig, MC2661, "MC2661", tag, owner, clock, "mc2661", __FILE__),
102   device_serial_interface(mconfig, *this),
103   m_write_txd(*this),
104   m_write_rxrdy(*this),
105   m_write_txrdy(*this),
106   m_write_rts(*this),
107   m_write_dtr(*this),
108   m_write_txemt_dschg(*this),
109   m_write_bkdet(*this),
110   m_write_xsync(*this),
111   m_rxc(0),
112   m_txc(0)
103113{
104114}
105115
106116
107117//-------------------------------------------------
108//  device_config_complete - perform any
109//  operations now that the configuration is
110//  complete
111//-------------------------------------------------
112
113void mc2661_device::device_config_complete()
114{
115   // inherit a copy of the static data
116   const mc2661_interface *intf = reinterpret_cast<const mc2661_interface *>(static_config());
117   if (intf != NULL)
118      *static_cast<mc2661_interface *>(this) = *intf;
119
120   // or initialize to defaults if none provided
121   else
122   {
123      memset(&m_out_txd_cb, 0, sizeof(m_out_txd_cb));
124      memset(&m_out_rxrdy_cb, 0, sizeof(m_out_rxrdy_cb));
125      memset(&m_out_txrdy_cb, 0, sizeof(m_out_txrdy_cb));
126      memset(&m_out_rts_cb, 0, sizeof(m_out_rts_cb));
127      memset(&m_out_dtr_cb, 0, sizeof(m_out_dtr_cb));
128      memset(&m_out_txemt_dschg_cb, 0, sizeof(m_out_txemt_dschg_cb));
129      memset(&m_out_bkdet_cb, 0, sizeof(m_out_bkdet_cb));
130      memset(&m_out_xsync_cb, 0, sizeof(m_out_xsync_cb));
131   }
132}
133
134
135//-------------------------------------------------
136118//  device_start - device-specific startup
137119//-------------------------------------------------
138120
139121void mc2661_device::device_start()
140122{
141123   // resolve callbacks
142   m_out_txd_func.resolve(m_out_txd_cb, *this);
143   m_out_rxrdy_func.resolve(m_out_rxrdy_cb, *this);
144   m_out_txrdy_func.resolve(m_out_txrdy_cb, *this);
145   m_out_rts_func.resolve(m_out_rts_cb, *this);
146   m_out_dtr_func.resolve(m_out_dtr_cb, *this);
147   m_out_txemt_dschg_func.resolve(m_out_txemt_dschg_cb, *this);
148   m_out_bkdet_func.resolve(m_out_bkdet_cb, *this);
149   m_out_xsync_func.resolve(m_out_xsync_cb, *this);
124   m_write_txd.resolve_safe();
125   m_write_rxrdy.resolve_safe();
126   m_write_txrdy.resolve_safe();
127   m_write_rts.resolve_safe();
128   m_write_dtr.resolve_safe();
129   m_write_txemt_dschg.resolve_safe();
130   m_write_bkdet.resolve_safe();
131   m_write_xsync.resolve_safe();
150132
151133   // create the timers
152134   if (m_rxc > 0)
r29303r29304
188170   m_mode_index = 0;
189171   m_sync_index = 0;
190172
191   m_out_txd_func(1);
192   m_out_rxrdy_func(CLEAR_LINE);
193   m_out_txrdy_func(CLEAR_LINE);
194   m_out_rts_func(1);
195   m_out_dtr_func(1);
196   m_out_txemt_dschg_func(CLEAR_LINE);
197   m_out_bkdet_func(0);
198   m_out_xsync_func(0);
173   m_write_txd(1);
174   m_write_rxrdy(CLEAR_LINE);
175   m_write_txrdy(CLEAR_LINE);
176   m_write_rts(1);
177   m_write_dtr(1);
178   m_write_txemt_dschg(CLEAR_LINE);
179   m_write_bkdet(0);
180   m_write_xsync(0);
199181}
200182
201183
r29303r29304
205187
206188void mc2661_device::tra_callback()
207189{
208   m_out_txd_func(transmit_register_get_data_bit());
190   m_write_txd(transmit_register_get_data_bit());
209191}
210192
211193
r29303r29304
217199{
218200   // TODO
219201   m_sr |= STATUS_TXRDY;
220   m_out_txrdy_func(ASSERT_LINE);
202   m_write_txrdy(ASSERT_LINE);
221203}
222204
223205
r29303r29304
231213   receive_register_extract();
232214   m_rhr = get_received_char();
233215   m_sr |= STATUS_RXRDY;
234   m_out_rxrdy_func(ASSERT_LINE);
216   m_write_rxrdy(ASSERT_LINE);
235217}
236218
237219
r29303r29304
248230   case REGISTER_HOLDING:
249231      data = m_rhr;
250232      m_sr &= ~STATUS_RXRDY;
251      m_out_rxrdy_func(CLEAR_LINE);
233      m_write_rxrdy(CLEAR_LINE);
252234      break;
253235
254236   case REGISTER_STATUS:
r29303r29304
292274         if(COMMAND_MODE != 0x02)
293275            transmit_register_setup(m_thr);
294276         m_sr &= ~STATUS_TXRDY;
295         m_out_txrdy_func(CLEAR_LINE);
277         m_write_txrdy(CLEAR_LINE);
296278      }
297279      if(COMMAND_MODE == 0x02)  // loopback - the Wicat will set this after enabling the transmitter
298280         m_rhr = data;
r29303r29304
403385
404386      m_cr = data & 0xef;
405387
406      m_out_dtr_func(!COMMAND_DTR);
407      m_out_rts_func(!COMMAND_RTS);
388      m_write_dtr(!COMMAND_DTR);
389      m_write_rts(!COMMAND_RTS);
408390
409391      if (COMMAND_MODE == 0x02)  // local loopback
410392      {
r29303r29304
413395            // probably much more to it that this, but this is enough for the Wicat to be happy
414396            m_rhr = m_thr;
415397            m_sr |= STATUS_RXRDY;
416            m_out_rxrdy_func(ASSERT_LINE);
398            m_write_rxrdy(ASSERT_LINE);
417399            return;
418400         }
419401      }
r29303r29304
421403      if (COMMAND_TXEN)
422404      {
423405         m_sr |= STATUS_TXRDY;
424         m_out_txrdy_func(ASSERT_LINE);
406         m_write_txrdy(ASSERT_LINE);
425407      }
426408      else
427409      {
428410         m_sr &= ~STATUS_TXRDY;
429         m_out_txrdy_func(CLEAR_LINE);
411         m_write_txrdy(CLEAR_LINE);
430412      }
431413      if (!COMMAND_RXEN)
432414      {
433415         m_sr &= ~STATUS_RXRDY;
434         m_out_rxrdy_func(CLEAR_LINE);
416         m_write_rxrdy(CLEAR_LINE);
435417      }
436418      if (COMMAND_RESET)
437419      {
shelves/new_menus/src/emu/machine/mc2661.h
r29303r29304
3939    DEVICE CONFIGURATION MACROS
4040***************************************************************************/
4141
42#define MCFG_MC2661_ADD(_tag, _clock, _config) \
43   MCFG_DEVICE_ADD(_tag, MC2661, _clock) \
44   MCFG_DEVICE_CONFIG(_config)
42#define MCFG_MC2661_RXC(_clock) \
43   mc2661_device::static_set_rxc(*device, _clock);
4544
45#define MCFG_MC2661_TXC(_clock) \
46   mc2661_device::static_set_txc(*device, _clock);
4647
47#define MC2661_INTERFACE(_name) \
48   const mc2661_interface (_name) =
48#define MCFG_MC2661_TXD_HANDLER(_write) \
49   devcb = &mc2661_device::set_txd_callback(*device, DEVCB2_##_write);
4950
51#define MCFG_MC2661_RXRDY_HANDLER(_write) \
52   devcb = &mc2661_device::set_rxrdy_callback(*device, DEVCB2_##_write);
5053
54#define MCFG_MC2661_TXRDY_HANDLER(_write) \
55   devcb = &mc2661_device::set_txrdy_callback(*device, DEVCB2_##_write);
5156
52/***************************************************************************
53    TYPE DEFINITIONS
54***************************************************************************/
57#define MCFG_MC2661_RTS_HANDLER(_write) \
58   devcb = &mc2661_device::set_rts_callback(*device, DEVCB2_##_write);
5559
56// ======================> mc2661_interface
60#define MCFG_MC2661_DTR_HANDLER(_write) \
61   devcb = &mc2661_device::set_dtr_callback(*device, DEVCB2_##_write);
5762
58struct mc2661_interface
59{
60   int m_rxc;
61   int m_txc;
63#define MCFG_MC2661_TXEMT_DSCHG_HANDLER(_write) \
64   devcb = &mc2661_device::set_txemt_dschg_callback(*device, DEVCB2_##_write);
6265
63   devcb_write_line    m_out_txd_cb;
66#define MCFG_MC2661_BKDET_HANDLER(_write) \
67   devcb = &mc2661_device::set_bkdet_callback(*device, DEVCB2_##_write);
6468
65   devcb_write_line    m_out_rxrdy_cb;
66   devcb_write_line    m_out_txrdy_cb;
67   devcb_write_line    m_out_rts_cb;
68   devcb_write_line    m_out_dtr_cb;
69   devcb_write_line    m_out_txemt_dschg_cb;
70   devcb_write_line    m_out_bkdet_cb;
71   devcb_write_line    m_out_xsync_cb;
72};
69#define MCFG_MC2661_XSYNC_HANDLER(_write) \
70   devcb = &mc2661_device::set_xsync_callback(*device, DEVCB2_##_write);
7371
7472
73
74/***************************************************************************
75    TYPE DEFINITIONS
76***************************************************************************/
77
7578// ======================> mc2661_device
7679
7780class mc2661_device :  public device_t,
78                  public device_serial_interface,
79                  public mc2661_interface
81                  public device_serial_interface
8082{
8183public:
8284   // construction/destruction
8385   mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8486
87   static void static_set_rxc(device_t &device, int clock) { downcast<mc2661_device &>(device).m_rxc = clock; }
88   static void static_set_txc(device_t &device, int clock) { downcast<mc2661_device &>(device).m_txc = clock; }
89
90   template<class _Object> static devcb2_base &set_txd_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_txd.set_callback(object); }
91   template<class _Object> static devcb2_base &set_rxrdy_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_rxrdy.set_callback(object); }
92   template<class _Object> static devcb2_base &set_txrdy_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_txrdy.set_callback(object); }
93   template<class _Object> static devcb2_base &set_rts_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_rts.set_callback(object); }
94   template<class _Object> static devcb2_base &set_dtr_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_dtr.set_callback(object); }
95   template<class _Object> static devcb2_base &set_txemt_dschg_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_txemt_dschg.set_callback(object); }
96   template<class _Object> static devcb2_base &set_bkdet_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_bkdet.set_callback(object); }
97   template<class _Object> static devcb2_base &set_xsync_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_xsync.set_callback(object); }
98
8599   DECLARE_READ8_MEMBER( read );
86100   DECLARE_WRITE8_MEMBER( write );
87101
r29303r29304
96110
97111protected:
98112   // device-level overrides
99   virtual void device_config_complete();
100113   virtual void device_start();
101114   virtual void device_reset();
102115   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
r29303r29304
107120   virtual void rcv_complete();
108121
109122private:
110   devcb_resolved_read_line    m_in_rxd_func;
111   devcb_resolved_write_line   m_out_txd_func;
123   devcb2_write_line   m_write_txd;
124   devcb2_write_line   m_write_rxrdy;
125   devcb2_write_line   m_write_txrdy;
126   devcb2_write_line   m_write_rts;
127   devcb2_write_line   m_write_dtr;
128   devcb2_write_line   m_write_txemt_dschg;
129   devcb2_write_line   m_write_bkdet;
130   devcb2_write_line   m_write_xsync;
112131
113   devcb_resolved_write_line   m_out_rxrdy_func;
114   devcb_resolved_write_line   m_out_txrdy_func;
115   devcb_resolved_write_line   m_out_rts_func;
116   devcb_resolved_write_line   m_out_dtr_func;
117   devcb_resolved_write_line   m_out_txemt_dschg_func;
118   devcb_resolved_write_line   m_out_bkdet_func;
119   devcb_resolved_write_line   m_out_xsync_func;
132   int m_rxc;
133   int m_txc;
120134
121135   UINT8 m_rhr;
122136   UINT8 m_thr;
shelves/new_menus/src/emu/machine/wd17xx.c
r29303r29304
154154#include "emu.h"
155155#include "formats/imageutl.h"
156156#include "machine/wd17xx.h"
157#include "imagedev/flopdrv.h"
158157
159158/***************************************************************************
160159    CONSTANTS
r29303r29304
494493   if (1) // image_slotexists(m_drive) : FIXME
495494   {
496495      /* keep stepping until track 0 is received or 255 steps have been done */
497      while (floppy_tk00_r(m_drive) && (step_counter != 0))
496      while (m_drive->floppy_tk00_r() && (step_counter != 0))
498497      {
499498         /* update time to simulate seek time busy signal */
500499         m_busy_count++;
501         floppy_drive_seek(m_drive, m_direction);
500         m_drive->floppy_drive_seek(m_direction);
502501         step_counter--;
503502      }
504503   }
r29303r29304
539538         //int len     = m_buffer[i+4];
540539         int filler  = 0xe5; /* IBM and Thomson */
541540         int density = m_density;
542         floppy_drive_format_sector(m_drive,side,sector,track,
541         m_drive->floppy_drive_format_sector(side,sector,track,
543542                  m_hd,sector,density?1:0,filler);
544543         i += 128; /* at least... */
545544      }
r29303r29304
556555   selected format.
557556   */
558557   m_data_count = 0;
559   floppy = flopimg_get_image(m_drive);
558   floppy = m_drive->flopimg_get_image();
560559   if (floppy != NULL)
561560      m_data_count = floppy_get_track_size(floppy, m_hd, m_track);
562561
r29303r29304
568567            m_data_count = wd17xx_dden() ? TRKSIZE_SD : TRKSIZE_DD;
569568      }
570569
571   floppy_drive_write_track_data_info_buffer( m_drive, m_hd, (char *)m_buffer, &(m_data_count) );
570   m_drive->floppy_drive_write_track_data_info_buffer( m_hd, (char *)m_buffer, &(m_data_count) );
572571
573572   m_data_offset = 0;
574573
r29303r29304
707706   /* Determine the track size. We cannot allow different sizes in this
708707   design (see above, write_track). */
709708   m_data_count = 0;
710   floppy = flopimg_get_image(m_drive);
709   floppy = m_drive->flopimg_get_image();
711710   if (floppy != NULL)
712711      m_data_count = floppy_get_track_size(floppy, m_hd, m_track);
713712
r29303r29304
719718            m_data_count = wd17xx_dden() ? TRKSIZE_SD : TRKSIZE_DD;
720719      }
721720
722   floppy_drive_read_track_data_info_buffer( m_drive, m_hd, (char *)m_buffer, &(m_data_count) );
721   m_drive->floppy_drive_read_track_data_info_buffer( m_hd, (char *)m_buffer, &(m_data_count) );
723722
724723   m_data_offset = 0;
725724
r29303r29304
736735   m_status &= ~(STA_2_CRC_ERR | STA_2_REC_N_FND);
737736
738737   /* get next id from disc */
739   if (floppy_drive_get_next_id(m_drive, m_hd, &id))
738   if (m_drive->floppy_drive_get_next_id(m_hd, &id))
740739   {
741740      UINT16 crc = 0xffff;
742741
r29303r29304
809808
810809   while (revolution_count!=4)
811810   {
812      if (floppy_drive_get_next_id(m_drive, m_hd, &id))
811      if (m_drive->floppy_drive_get_next_id(m_hd, &id))
813812      {
814813         /* compare track */
815814         if (id.C == m_track)
r29303r29304
834833      }
835834
836835         /* index set? */
837      if (floppy_drive_get_flag_state(m_drive, FLOPPY_DRIVE_INDEX))
836      if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX))
838837      {
839838         /* update revolution count */
840839         revolution_count++;
r29303r29304
886885      m_data_count = m_sector_length;
887886
888887      /* read data */
889      floppy_drive_read_sector_data(m_drive, m_hd, m_sector_data_id, (char *)m_buffer, m_sector_length);
888      m_drive->floppy_drive_read_sector_data(m_hd, m_sector_data_id, (char *)m_buffer, m_sector_length);
890889
891890      wd17xx_timed_data_request();
892891
r29303r29304
936935      m_data_count = m_sector_length;
937936
938937      /* write data */
939      floppy_drive_write_sector_data(m_drive, m_hd, m_sector_data_id, (char *)m_buffer, m_sector_length, m_write_cmd & 0x01);
938      m_drive->floppy_drive_write_sector_data(m_hd, m_sector_data_id, (char *)m_buffer, m_sector_length, m_write_cmd & 0x01);
940939   }
941940}
942941
r29303r29304
957956   /* must be found within 5 revolutions otherwise error */
958957   while (revolution_count!=5)
959958   {
960      if (floppy_drive_get_next_id(m_drive, m_hd, &id))
959      if (m_drive->floppy_drive_get_next_id( m_hd, &id))
961960      {
962961         /* compare track */
963962         if (id.C == m_track)
r29303r29304
969968      }
970969
971970         /* index set? */
972      if (floppy_drive_get_flag_state(m_drive, FLOPPY_DRIVE_INDEX))
971      if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX))
973972      {
974973         /* update revolution count */
975974         revolution_count++;
r29303r29304
992991   if (VERBOSE)
993992      logerror("wd179x: Read Sector callback.\n");
994993
995   if (!floppy_drive_get_flag_state(m_drive, FLOPPY_DRIVE_READY))
994   if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
996995      wd17xx_complete_command(DELAY_NOTREADY);
997996   else
998997      wd17xx_read_sector();
r29303r29304
10081007   if (VERBOSE)
10091008      logerror("wd179x: Write Sector callback.\n");
10101009
1011   if (!floppy_drive_get_flag_state(m_drive, FLOPPY_DRIVE_READY))
1010   if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
10121011      wd17xx_complete_command(DELAY_NOTREADY);
10131012   else
10141013   {
10151014      /* drive write protected? */
1016      if (floppy_wpt_r(m_drive) == CLEAR_LINE)
1015      if (m_drive->floppy_wpt_r() == CLEAR_LINE)
10171016      {
10181017         m_status |= STA_2_WRITE_PRO;
10191018
r29303r29304
10801079
10811080   if (m_intf->floppy_drive_tags[drive] != NULL)
10821081   {
1083      m_drive = siblingdevice(m_intf->floppy_drive_tags[drive]);
1082      m_drive = siblingdevice<legacy_floppy_image_device>(m_intf->floppy_drive_tags[drive]);
10841083   }
10851084}
10861085
r29303r29304
12011200   else
12021201   {
12031202      m_status &= ~STA_1_NOT_READY;
1204      if (!floppy_drive_get_flag_state(m_drive, FLOPPY_DRIVE_READY))
1203      if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
12051204         m_status |= STA_1_NOT_READY;
12061205   }
12071206
r29303r29304
12161215      result |= m_idx << 1;
12171216
12181217      /* bit 2, track 0 state, inverted */
1219      result |= !floppy_tk00_r(m_drive) << 2;
1218      result |= !m_drive->floppy_tk00_r() << 2;
12201219
12211220      if (m_command_type==TYPE_I)
12221221      {
r29303r29304
12271226      }
12281227
12291228      /* bit 6, write protect, inverted */
1230      result |= !floppy_wpt_r(m_drive) << 6;
1229      result |= !m_drive->floppy_wpt_r() << 6;
12311230   }
12321231
12331232   /* eventually set data request bit */
r29303r29304
12831282   if (type() == WD1770 || type() == WD1772)
12841283   {
12851284      m_mo = ASSERT_LINE;
1286      floppy_mon_w(m_drive, CLEAR_LINE);
1285      m_drive->floppy_mon_w(CLEAR_LINE);
12871286   }
12881287
1289   floppy_drive_set_ready_state(m_drive, 1,0);
1288   m_drive->floppy_drive_set_ready_state(1,0);
12901289
12911290   if (!BIT(m_interrupt, 3))
12921291   {
r29303r29304
14091408         m_status &= ~STA_2_LOST_DAT;
14101409         wd17xx_clear_drq();
14111410
1412         if (!floppy_drive_get_flag_state(m_drive, FLOPPY_DRIVE_READY))
1411         if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
14131412         {
14141413            wd17xx_complete_command(DELAY_NOTREADY);
14151414         }
14161415         else
14171416         {
14181417            /* drive write protected? */
1419            if (floppy_wpt_r(m_drive) == CLEAR_LINE)
1418            if (m_drive->floppy_wpt_r() == CLEAR_LINE)
14201419            {
14211420            /* yes */
14221421               m_status |= STA_2_WRITE_PRO;
r29303r29304
14521451
14531452         wd17xx_clear_drq();
14541453
1455         if (floppy_drive_get_flag_state(m_drive, FLOPPY_DRIVE_READY))
1454         if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
14561455            wd17xx_read_id();
14571456         else
14581457            wd17xx_complete_command(DELAY_NOTREADY);
r29303r29304
15191518         /* update track reg */
15201519         m_track += m_direction;
15211520
1522         floppy_drive_seek(m_drive, m_direction);
1521         m_drive->floppy_drive_seek(m_direction);
15231522      }
15241523
15251524      /* simulate seek time busy signal */
r29303r29304
15411540      /* simulate seek time busy signal */
15421541      m_busy_count = 0;  //((data & FDC_STEP_RATE) + 1);
15431542
1544      floppy_drive_seek(m_drive, m_direction);
1543      m_drive->floppy_drive_seek(m_direction);
15451544
15461545      if (data & FDC_STEP_UPDATE)
15471546         m_track += m_direction;
r29303r29304
15641563      /* simulate seek time busy signal */
15651564      m_busy_count = 0;  //((data & FDC_STEP_RATE) + 1);
15661565
1567      floppy_drive_seek(m_drive, m_direction);
1566      m_drive->floppy_drive_seek(m_direction);
15681567
15691568      if (data & FDC_STEP_UPDATE)
15701569         m_track += m_direction;
r29303r29304
15861585      m_busy_count = 0;  //((data & FDC_STEP_RATE) + 1);
15871586
15881587      /* for now only allows a single drive to be selected */
1589      floppy_drive_seek(m_drive, m_direction);
1588      m_drive->floppy_drive_seek(m_direction);
15901589
15911590      if (data & FDC_STEP_UPDATE)
15921591         m_track += m_direction;
r29303r29304
20452044   for (i = 0; i < 4; i++)
20462045   {
20472046      if(m_intf->floppy_drive_tags[i]!=NULL) {
2048         device_t *img = NULL;
2047         legacy_floppy_image_device *img = NULL;
20492048
2050         img = siblingdevice(m_intf->floppy_drive_tags[i]);
2049         img = siblingdevice<legacy_floppy_image_device>(m_intf->floppy_drive_tags[i]);
20512050
20522051         if (img!=NULL) {
2053            floppy_drive_set_controller(img,this);
2054            floppy_drive_set_index_pulse_callback(img, wd17xx_index_pulse_callback);
2055            floppy_drive_set_rpm( img, 300.);
2052            img->floppy_drive_set_controller(this);
2053            img->floppy_drive_set_index_pulse_callback(wd17xx_index_pulse_callback);
2054            img->floppy_drive_set_rpm( 300.);
20562055         }
20572056      }
20582057   }
shelves/new_menus/src/emu/machine/wd17xx.h
r29303r29304
1010#ifndef __WD17XX_H__
1111#define __WD17XX_H__
1212
13#include "imagedev/flopdrv.h"
1314
15
1416/***************************************************************************
1517    TYPE DEFINITIONS
1618***************************************************************************/
r29303r29304
165167   emu_timer *m_timer_cmd, *m_timer_data, *m_timer_rs, *m_timer_ws;
166168
167169   /* this is the drive currently selected */
168   device_t *m_drive;
170   legacy_floppy_image_device *m_drive;
169171
170172   /* this is the head currently selected */
171173   UINT8 m_hd;
shelves/new_menus/src/emu/machine/i8271.c
r29303r29304
1414
1515#include "emu.h"
1616#include "i8271.h"
17#include "imagedev/flopdrv.h"
1817
1918/* data request */
2019#define I8271_FLAGS_DATA_REQUEST 0x01
r29303r29304
238237   set_dma_drq();
239238}
240239
241device_t *i8271_device::current_image()
240legacy_floppy_image_device *i8271_device::current_image()
242241{
243242   if (m_floppy_drive_tags[m_drive]!=NULL) {
244      return machine().device(m_floppy_drive_tags[m_drive]);
243      return machine().device<legacy_floppy_image_device>(m_floppy_drive_tags[m_drive]);
245244   } else {
246245      return NULL;
247246   }
r29303r29304
250249
251250void i8271_device::seek_to_track(int track)
252251{
253   device_t *img = current_image();
252   legacy_floppy_image_device *img = current_image();
254253   if (track==0)
255254   {
256255      /* seek to track 0 */
r29303r29304
259258      /*logerror("step\n"); */
260259
261260      /* track 0 not set, not seeked more than 255 tracks */
262      while (floppy_tk00_r(img) && (StepCount != 0))
261      while (img->floppy_tk00_r() && (StepCount != 0))
263262      {
264263/*            logerror("step\n"); */
265264         StepCount--;
266         floppy_drive_seek(img, -1);
265         img->floppy_drive_seek(-1);
267266      }
268267
269268      m_CurrentTrack[m_drive] = 0;
r29303r29304
297296
298297
299298      /* seek to track 0 */
300      floppy_drive_seek(img, SignedTracks);
299      img->floppy_drive_seek(SignedTracks);
301300
302301      m_CurrentTrack[m_drive] = track;
303302   }
r29303r29304
610609      case I8271_COMMAND_WRITE_DATA_SINGLE_RECORD:
611610      {
612611         /* put the buffer to the sector */
613         floppy_drive_write_sector_data(current_image(), m_side, m_data_id, m_pExecutionPhaseData, 1<<(m_ID_N+7),0);
612         current_image()->floppy_drive_write_sector_data(m_side, m_data_id, m_pExecutionPhaseData, 1<<(m_ID_N+7),0);
614613
615614         /* completed all sectors? */
616615         m_Counter--;
r29303r29304
653652   if (find_sector())
654653   {
655654      /* get the sector into the buffer */
656      floppy_drive_read_sector_data(current_image(), m_side, m_data_id, m_pExecutionPhaseData, 1<<(m_ID_N+7));
655      current_image()->floppy_drive_read_sector_data(m_side, m_data_id, m_pExecutionPhaseData, 1<<(m_ID_N+7));
657656
658657      /* initialise for reading */
659658      initialise_execution_phase_read(1<<(m_ID_N+7));
r29303r29304
672671   chrn_id id;
673672   
674673   /* get next id from disc */
675   floppy_drive_get_next_id(current_image(), m_side,&id);
674   current_image()->floppy_drive_get_next_id(m_side,&id);
676675
677676   m_pExecutionPhaseData[0] = id.C;
678677   m_pExecutionPhaseData[1] = id.H;
r29303r29304
704703
705704int i8271_device::find_sector()
706705{
707   device_t *img = current_image();
706   legacy_floppy_image_device *img = current_image();
708707//  int track_count_attempt;
709708
710709//  track_count_attempt
r29303r29304
719718      chrn_id id;
720719
721720      /* get next id from disc */
722      if (floppy_drive_get_next_id(img, m_side,&id))
721      if (img->floppy_drive_get_next_id(m_side,&id))
723722      {
724723         /* tested on Amstrad CPC - All bytes must match, otherwise
725724         a NO DATA error is reported */
r29303r29304
742741      }
743742
744743         /* index set? */
745      if (floppy_drive_get_flag_state(img, FLOPPY_DRIVE_INDEX))
744      if (img->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX))
746745      {
747746         index_count++;
748747      }
r29303r29304
759758
760759void i8271_device::command_execute()
761760{
762   device_t *img = current_image();
761   legacy_floppy_image_device *img = current_image();
763762
764763   /* clear it = good completion status */
765764   /* this will be changed if anything bad happens! */
r29303r29304
885884               m_drive_control_input = (1<<6) | (1<<2);
886885
887886               /* bit 3 = 0 if write protected */
888               m_drive_control_input |= floppy_wpt_r(img) << 3;
887               m_drive_control_input |= img->floppy_wpt_r() << 3;
889888
890889               /* bit 1 = 0 if head at track 0 */
891               m_drive_control_input |= floppy_tk00_r(img) << 1;
890               m_drive_control_input |= img->floppy_tk00_r() << 1;
892891
893892               /* need to setup this register based on drive selected */
894893               data = m_drive_control_input;
r29303r29304
10211020
10221021               /* load head - on mini-sized drives this turns on the disc motor,
10231022               on standard-sized drives this loads the head and turns the motor on */
1024               floppy_mon_w(img, !BIT(m_CommandParameters[1], 3));
1025               floppy_drive_set_ready_state(img, 1, 1);
1023               img->floppy_mon_w(!BIT(m_CommandParameters[1], 3));
1024               img->floppy_drive_set_ready_state(1, 1);
10261025
10271026               /* step pin changed? if so perform a step in the direction indicated */
10281027               if (((m_drive_control_output^m_CommandParameters[1]) & (1<<1))!=0)
r29303r29304
10421041                        signed_tracks = -1;
10431042                     }
10441043
1045                     floppy_drive_seek(img, signed_tracks);
1044                     img->floppy_drive_seek(signed_tracks);
10461045                  }
10471046               }
10481047
r29303r29304
10811080         /* these two do not appear to be set at all! ?? */
10821081
10831082         if (m_floppy_drive_tags[0]!=NULL) {
1084            if (floppy_drive_get_flag_state(machine().device(m_floppy_drive_tags[0]), FLOPPY_DRIVE_READY))
1083            if (machine().device<legacy_floppy_image_device>(m_floppy_drive_tags[0])->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
10851084            {
10861085               status |= (1<<2);
10871086            }
10881087         }
10891088
10901089         if (m_floppy_drive_tags[1]!=NULL) {
1091            if (floppy_drive_get_flag_state(machine().device(m_floppy_drive_tags[1]), FLOPPY_DRIVE_READY))
1090            if (machine().device<legacy_floppy_image_device>(m_floppy_drive_tags[1])->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
10921091            {
10931092               status |= (1<<6);
10941093            }
10951094         }
10961095
10971096         /* bit 3 = 1 if write protected */
1098         status |= !floppy_wpt_r(img) << 3;
1097         status |= !img->floppy_wpt_r() << 3;
10991098
11001099         /* bit 1 = 1 if head at track 0 */
1101         status |= !floppy_tk00_r(img) << 1;
1100         status |= !img->floppy_tk00_r() << 1;
11021101
11031102         m_ResultRegister = status;
11041103         command_complete(1,0);
r29303r29304
11401139
11411140         get_drive();
11421141
1143         if (!floppy_drive_get_flag_state(img, FLOPPY_DRIVE_READY))
1142         if (!img->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
11441143         {
11451144            /* Completion type: operation intervention probably required for recovery */
11461145            /* Completion code: Drive not ready */
r29303r29304
11731172
11741173         get_drive();
11751174
1176         if (!floppy_drive_get_flag_state(img, FLOPPY_DRIVE_READY))
1175         if (!img->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
11771176         {
11781177            /* Completion type: operation intervention probably required for recovery */
11791178            /* Completion code: Drive not ready */
r29303r29304
12121211
12131212         m_drive_control_output &=~1;
12141213
1215         if (!floppy_drive_get_flag_state(img, FLOPPY_DRIVE_READY))
1214         if (!img->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
12161215         {
12171216            /* Completion type: operation intervention probably required for recovery */
12181217            /* Completion code: Drive not ready */
r29303r29304
12211220         }
12221221         else
12231222         {
1224            if (floppy_wpt_r(img) == CLEAR_LINE)
1223            if (img->floppy_wpt_r() == CLEAR_LINE)
12251224            {
12261225               /* Completion type: operation intervention probably required for recovery */
12271226               /* Completion code: Drive write protected */
r29303r29304
12571256
12581257         m_drive_control_output &=~1;
12591258
1260         if (!floppy_drive_get_flag_state(img, FLOPPY_DRIVE_READY))
1259         if (!img->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
12611260         {
12621261            /* Completion type: operation intervention probably required for recovery */
12631262            /* Completion code: Drive not ready */
r29303r29304
12661265         }
12671266         else
12681267         {
1269            if (floppy_wpt_r(img) == CLEAR_LINE)
1268            if (img->floppy_wpt_r() == CLEAR_LINE)
12701269            {
12711270               /* Completion type: operation intervention probably required for recovery */
12721271               /* Completion code: Drive write protected */
r29303r29304
12961295
12971296         get_drive();
12981297
1299         if (!floppy_drive_get_flag_state(img, FLOPPY_DRIVE_READY))
1298         if (!img->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
13001299         {
13011300            /* Completion type: operation intervention probably required for recovery */
13021301            /* Completion code: Drive not ready */
shelves/new_menus/src/emu/imagedev/flopdrv.c
r29303r29304
2929    TYPE DEFINITIONS
3030***************************************************************************/
3131
32struct floppy_drive
33{
34   /* callbacks */
35   devcb_resolved_write_line out_idx_func;
36   devcb_resolved_read_line in_mon_func;
37   devcb_resolved_write_line out_tk00_func;
38   devcb_resolved_write_line out_wpt_func;
39   devcb_resolved_write_line out_rdy_func;
40   devcb_resolved_write_line out_dskchg_func;
41
42   /* state of input lines */
43   int drtn; /* direction */
44   int stp;  /* step */
45   int wtg;  /* write gate */
46   int mon;  /* motor on */
47
48   /* state of output lines */
49   int idx;  /* index pulse */
50   int tk00; /* track 00 */
51   int wpt;  /* write protect */
52   int rdy;  /* ready */
53   int dskchg;     /* disk changed */
54
55   /* drive select logic */
56   int drive_id;
57   int active;
58
59   const floppy_interface  *config;
60
61   /* flags */
62   int flags;
63   /* maximum track allowed */
64   int max_track;
65   /* num sides */
66   int num_sides;
67   /* current track - this may or may not relate to the present cylinder number
68   stored by the fdc */
69   int current_track;
70
71   /* index pulse timer */
72   emu_timer   *index_timer;
73   /* index pulse callback */
74   void    (*index_pulse_callback)(device_t *controller,device_t *image, int state);
75   /* rotation per minute => gives index pulse frequency */
76   float rpm;
77
78   void    (*ready_state_change_callback)(device_t *controller,device_t *img, int state);
79
80   int id_index;
81
82   device_t *controller;
83
84   floppy_image_legacy *floppy;
85   int track;
86   void (*load_proc)(device_image_interface &image);
87   void (*unload_proc)(device_image_interface &image);
88   int floppy_drive_type;
89};
90
91
9232struct floppy_error_map
9333{
9434   floperr_t ferr;
r29303r29304
11555    IMPLEMENTATION
11656***************************************************************************/
11757
118INLINE floppy_drive *get_safe_token(device_t *device)
119{
120   assert( device != NULL );
121   return (floppy_drive *) downcast<legacy_floppy_image_device *>(device)->token();
122}
12358
124floppy_image_legacy *flopimg_get_image(device_t *image)
59floppy_image_legacy *legacy_floppy_image_device::flopimg_get_image()
12560{
126   return get_safe_token(image)->floppy;
61   return m_floppy;
12762}
12863
129static int flopimg_get_sectors_per_track(device_t *image, int side)
64int legacy_floppy_image_device::flopimg_get_sectors_per_track(int side)
13065{
13166   floperr_t err;
13267   int sector_count;
133   floppy_drive *flopimg = get_safe_token( image );
13468
135   if (!flopimg || !flopimg->floppy)
69   if (!m_floppy)
13670      return 0;
13771
138   err = floppy_get_sector_count(flopimg->floppy, side, flopimg->track, &sector_count);
72   err = floppy_get_sector_count(m_floppy, side, m_track, &sector_count);
13973   if (err)
14074      return 0;
14175   return sector_count;
14276}
14377
144static void flopimg_get_id_callback(device_t *image, chrn_id *id, int id_index, int side)
78void legacy_floppy_image_device::flopimg_get_id_callback(chrn_id *id, int id_index, int side)
14579{
146   floppy_drive *flopimg;
14780   int cylinder, sector, N;
14881   unsigned long flags;
14982   UINT32 sector_length;
15083
151   flopimg = get_safe_token( image );
152   if (!flopimg || !flopimg->floppy)
84   if (!m_floppy)
15385      return;
15486
155   floppy_get_indexed_sector_info(flopimg->floppy, side, flopimg->track, id_index, &cylinder, &side, &sector, &sector_length, &flags);
87   floppy_get_indexed_sector_info(m_floppy, side, m_track, id_index, &cylinder, &side, &sector, &sector_length, &flags);
15688
15789   N = compute_log2(sector_length);
15890
r29303r29304
16496   id->N = ((N >= 7) && (N <= 10)) ? N - 7 : 0;
16597}
16698
167static void log_readwrite(const char *name, int head, int track, int sector, const char *buf, int length)
99void legacy_floppy_image_device::log_readwrite(const char *name, int head, int track, int sector, const char *buf, int length)
168100{
169101   char membuf[1024];
170102   int i;
r29303r29304
173105   logerror("%s:  head=%i track=%i sector=%i buffer='%s'\n", name, head, track, sector, membuf);
174106}
175107
176static void floppy_drive_set_geometry_absolute(device_t *img, int tracks, int sides)
108void legacy_floppy_image_device::floppy_drive_set_geometry_absolute(int tracks, int sides)
177109{
178   floppy_drive *pDrive = get_safe_token( img );
179   pDrive->max_track = tracks;
180   pDrive->num_sides = sides;
110   m_max_track = tracks;
111   m_num_sides = sides;
181112}
182113
183void floppy_drive_set_geometry(device_t *img, floppy_type_t type)
114void legacy_floppy_image_device::floppy_drive_set_geometry(floppy_type_t type)
184115{
185   floppy_drive_set_geometry_absolute(img, type.max_track_number, type.head_number);
116   floppy_drive_set_geometry_absolute(type.max_track_number, type.head_number);
186117}
187118
188static TIMER_CALLBACK(floppy_drive_index_callback);
189
190119/* this is called on device init */
191static void floppy_drive_init(device_t *img)
120void legacy_floppy_image_device::floppy_drive_init()
192121{
193   floppy_drive *pDrive = get_safe_token( img );
194
195122   /* initialise flags */
196   pDrive->flags = 0;
197   pDrive->index_pulse_callback = NULL;
198   pDrive->ready_state_change_callback = NULL;
199   pDrive->index_timer = img->machine().scheduler().timer_alloc(FUNC(floppy_drive_index_callback), (void *) img);
200   pDrive->idx = 0;
123   m_flags = 0;
124   m_index_pulse_callback = NULL;
125   m_ready_state_change_callback = NULL;
126   m_index_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(legacy_floppy_image_device::floppy_drive_index_callback),this));
127   m_idx = 0;
201128
202   floppy_drive_set_geometry(img, ((floppy_interface*)img->static_config())->floppy_type);
129   floppy_drive_set_geometry(((floppy_interface*)static_config())->floppy_type);
203130
204131   /* initialise id index - not so important */
205   pDrive->id_index = 0;
132   m_id_index = 0;
206133   /* initialise track */
207   pDrive->current_track = 0;
134   m_current_track = 0;
208135
209136   /* default RPM */
210   pDrive->rpm = 300;
137   m_rpm = 300;
211138
212   pDrive->controller = NULL;
139   m_controller = NULL;
213140
214   pDrive->floppy_drive_type = FLOPPY_TYPE_REGULAR;
141   m_floppy_drive_type = FLOPPY_TYPE_REGULAR;
215142}
216143
217144/* index pulses at rpm/60 Hz, and stays high 1/20th of time */
218static void floppy_drive_index_func(device_t *img)
145void legacy_floppy_image_device::floppy_drive_index_func()
219146{
220   floppy_drive *drive = get_safe_token( img );
147   double ms = 1000.0 / (m_rpm / 60.0);
221148
222   double ms = 1000.0 / (drive->rpm / 60.0);
223
224   if (drive->idx)
149   if (m_idx)
225150   {
226      drive->idx = 0;
227      drive->index_timer->adjust(attotime::from_double(ms*19/20/1000.0));
151      m_idx = 0;
152      m_index_timer->adjust(attotime::from_double(ms*19/20/1000.0));
228153   }
229154   else
230155   {
231      drive->idx = 1;
232      drive->index_timer->adjust(attotime::from_double(ms/20/1000.0));
156      m_idx = 1;
157      m_index_timer->adjust(attotime::from_double(ms/20/1000.0));
233158   }
234159
235   drive->out_idx_func(drive->idx);
160   m_out_idx_func(m_idx);
236161
237   if (drive->index_pulse_callback)
238      drive->index_pulse_callback(drive->controller, img, drive->idx);
162   if (m_index_pulse_callback)
163      m_index_pulse_callback(m_controller, this, m_idx);
239164}
240165
241static TIMER_CALLBACK(floppy_drive_index_callback)
166TIMER_CALLBACK_MEMBER(legacy_floppy_image_device::floppy_drive_index_callback)
242167{
243   device_t *image = (device_t *) ptr;
244   floppy_drive_index_func(image);
168   floppy_drive_index_func();
245169}
246170
247171/*************************************************************************/
248172/* IO_FLOPPY device functions */
249173
250174/* set flag state */
251void floppy_drive_set_flag_state(device_t *img, int flag, int state)
175void legacy_floppy_image_device::floppy_drive_set_flag_state(int flag, int state)
252176{
253   floppy_drive *drv = get_safe_token( img );
254177   int prev_state;
255178   int new_state;
256179
257180   /* get old state */
258   prev_state = drv->flags & flag;
181   prev_state = m_flags & flag;
259182
260183   /* set new state */
261   drv->flags &= ~flag;
184   m_flags &= ~flag;
262185   if (state)
263      drv->flags |= flag;
186      m_flags |= flag;
264187
265188   /* get new state */
266   new_state = drv->flags & flag;
189   new_state = m_flags & flag;
267190
268191   /* changed state? */
269192   if (prev_state ^ new_state)
r29303r29304
271194      if (flag & FLOPPY_DRIVE_READY)
272195      {
273196         /* trigger state change callback */
274         drv->out_rdy_func(new_state ? ASSERT_LINE : CLEAR_LINE);
197         m_out_rdy_func(new_state ? ASSERT_LINE : CLEAR_LINE);
275198
276         if (drv->ready_state_change_callback)
277            drv->ready_state_change_callback(drv->controller, img, new_state);
199         if (m_ready_state_change_callback)
200            m_ready_state_change_callback(m_controller, this, new_state);
278201      }
279202   }
280203}
r29303r29304
282205/* for pc, drive is always ready, for amstrad,pcw,spectrum it is only ready under
283206a fixed set of circumstances */
284207/* use this to set ready state of drive */
285void floppy_drive_set_ready_state(device_t *img, int state, int flag)
286{
287   floppy_drive *drive = get_safe_token(img);
288   device_image_interface *image = dynamic_cast<device_image_interface *>(img);
208void legacy_floppy_image_device::floppy_drive_set_ready_state(int state, int flag)
209{   
289210   if (flag)
290211   {
291212      /* set ready only if drive is present, disk is in the drive,
r29303r29304
293214
294215      /* drive present? */
295216      /* disk inserted? */
296      if (image->exists())
217      if (exists())
297218      {
298         if (drive->mon == CLEAR_LINE)
219         if (m_mon == CLEAR_LINE)
299220         {
300221            /* set state */
301            floppy_drive_set_flag_state(img, FLOPPY_DRIVE_READY, state);
222            floppy_drive_set_flag_state(FLOPPY_DRIVE_READY, state);
302223            return;
303224         }
304225      }
305      floppy_drive_set_flag_state(img, FLOPPY_DRIVE_READY, 0);
226      floppy_drive_set_flag_state(FLOPPY_DRIVE_READY, 0);
306227   }
307228   else
308229   {
309230      /* force ready state - for PC driver */
310      floppy_drive_set_flag_state(img, FLOPPY_DRIVE_READY, state);
231      floppy_drive_set_flag_state(FLOPPY_DRIVE_READY, state);
311232   }
312233}
313234
314235/* get flag state */
315int floppy_drive_get_flag_state(device_t *img, int flag)
236int legacy_floppy_image_device::floppy_drive_get_flag_state(int flag)
316237{
317   floppy_drive *drv = get_safe_token( img );
318238   int drive_flags;
319239   int flags;
320240
321241   flags = 0;
322242
323   drive_flags = drv->flags;
243   drive_flags = m_flags;
324244
325245   /* these flags are independent of a real drive/disk image */
326246   flags |= drive_flags & (FLOPPY_DRIVE_READY | FLOPPY_DRIVE_INDEX);
r29303r29304
331251}
332252
333253
334void floppy_drive_seek(device_t *img, signed int signed_tracks)
335{
336   device_image_interface *image = dynamic_cast<device_image_interface *>(img);
337   floppy_drive *pDrive;
254void legacy_floppy_image_device::floppy_drive_seek(signed int signed_tracks)
255{   
256   LOG(("seek from: %d delta: %d\n",m_current_track, signed_tracks));
338257
339   pDrive = get_safe_token( img );
340
341   LOG(("seek from: %d delta: %d\n",pDrive->current_track, signed_tracks));
342
343258   /* update position */
344   pDrive->current_track+=signed_tracks;
259   m_current_track+=signed_tracks;
345260
346   if (pDrive->current_track<0)
261   if (m_current_track<0)
347262   {
348      pDrive->current_track = 0;
263      m_current_track = 0;
349264   }
350265   else
351   if (pDrive->current_track>=pDrive->max_track)
266   if (m_current_track>=m_max_track)
352267   {
353      pDrive->current_track = pDrive->max_track-1;
268      m_current_track = m_max_track-1;
354269   }
355270
356271   /* set track 0 flag */
357   pDrive->tk00 = (pDrive->current_track == 0) ? CLEAR_LINE : ASSERT_LINE;
358   pDrive->out_tk00_func(pDrive->tk00);
272   m_tk00 = (m_current_track == 0) ? CLEAR_LINE : ASSERT_LINE;
273   m_out_tk00_func(m_tk00);
359274
360275   /* clear disk changed flag */
361   pDrive->dskchg = ASSERT_LINE;
362   //flopimg->out_dskchg_func(flopimg->dskchg);
276   m_dskchg = ASSERT_LINE;
277   //m_out_dskchg_func(m_dskchg);
363278
364279   /* inform disk image of step operation so it can cache information */
365   if (image->exists())
366      pDrive->track = pDrive->current_track;
280   if (exists())
281      m_track = m_current_track;
367282
368   pDrive->id_index = 0;
283   m_id_index = 0;
369284}
370285
371286
372287/* this is not accurate. But it will do for now */
373int floppy_drive_get_next_id(device_t *img, int side, chrn_id *id)
288int legacy_floppy_image_device::floppy_drive_get_next_id(int side, chrn_id *id)
374289{
375   floppy_drive *pDrive;
376290   int spt;
377291
378   pDrive = get_safe_token( img );
379
380292   /* get sectors per track */
381   spt = flopimg_get_sectors_per_track(img, side);
293   spt = flopimg_get_sectors_per_track(side);
382294
383295   /* set index */
384   if ((pDrive->id_index==(spt-1)) || (spt==0))
296   if ((m_id_index==(spt-1)) || (spt==0))
385297   {
386      floppy_drive_set_flag_state(img, FLOPPY_DRIVE_INDEX, 1);
298      floppy_drive_set_flag_state(FLOPPY_DRIVE_INDEX, 1);
387299   }
388300   else
389301   {
390      floppy_drive_set_flag_state(img, FLOPPY_DRIVE_INDEX, 0);
302      floppy_drive_set_flag_state(FLOPPY_DRIVE_INDEX, 0);
391303   }
392304
393305   /* get id */
394306   if (spt!=0)
395307   {
396      flopimg_get_id_callback(img, id, pDrive->id_index, side);
308      flopimg_get_id_callback(id, m_id_index, side);
397309   }
398310
399   pDrive->id_index++;
311   m_id_index++;
400312   if (spt!=0)
401      pDrive->id_index %= spt;
313      m_id_index %= spt;
402314   else
403      pDrive->id_index = 0;
315      m_id_index = 0;
404316
405317   return (spt == 0) ? 0 : 1;
406318}
407319
408void floppy_drive_read_track_data_info_buffer(device_t *img, int side, void *ptr, int *length )
320void legacy_floppy_image_device::floppy_drive_read_track_data_info_buffer(int side, void *ptr, int *length )
409321{
410   floppy_drive *flopimg;
411   device_image_interface *image = dynamic_cast<device_image_interface *>(img);
412
413   if (image->exists())
322   if (exists())
414323   {
415      flopimg = get_safe_token( img );
416      if (!flopimg || !flopimg->floppy)
324      if (!m_floppy)
417325         return;
418326
419      floppy_read_track_data(flopimg->floppy, side, flopimg->track, ptr, *length);
327      floppy_read_track_data(m_floppy, side, m_track, ptr, *length);
420328   }
421329}
422330
423void floppy_drive_write_track_data_info_buffer(device_t *img, int side, const void *ptr, int *length )
331void legacy_floppy_image_device::floppy_drive_write_track_data_info_buffer(int side, const void *ptr, int *length )
424332{
425   floppy_drive *flopimg;
426   device_image_interface *image = dynamic_cast<device_image_interface *>(img);
427
428   if (image->exists())
333   if (exists())
429334   {
430      flopimg = get_safe_token( img );
431      if (!flopimg || !flopimg->floppy)
335      if (!m_floppy)
432336         return;
433337
434      floppy_write_track_data(flopimg->floppy, side, flopimg->track, ptr, *length);
338      floppy_write_track_data(m_floppy, side, m_track, ptr, *length);
435339   }
436340}
437341
438void floppy_drive_format_sector(device_t *img, int side, int sector_index,int c,int h, int r, int n, int filler)
342void legacy_floppy_image_device::floppy_drive_format_sector(int side, int sector_index,int c,int h, int r, int n, int filler)
439343{
440   device_image_interface *image = dynamic_cast<device_image_interface *>(img);
441
442   if (image->exists())
344   if (exists())
443345   {
444/*      if (drv->interface_.format_sector)
445            drv->interface_.format_sector(img, side, sector_index,c, h, r, n, filler);*/
346/*      if (m_interface_.format_sector)
347            m_interface_.format_sector(img, side, sector_index,c, h, r, n, filler);*/
446348   }
447349}
448350
449void floppy_drive_read_sector_data(device_t *img, int side, int index1, void *ptr, int length)
351void legacy_floppy_image_device::floppy_drive_read_sector_data(int side, int index1, void *ptr, int length)
450352{
451   floppy_drive *flopimg;
452   device_image_interface *image = dynamic_cast<device_image_interface *>(img);
453
454   if (image->exists())
353   if (exists())
455354   {
456      flopimg = get_safe_token( img );
457      if (!flopimg || !flopimg->floppy)
355      if (!m_floppy)
458356         return;
459357
460      floppy_read_indexed_sector(flopimg->floppy, side, flopimg->track, index1, 0, ptr, length);
358      floppy_read_indexed_sector(m_floppy, side, m_track, index1, 0, ptr, length);
461359
462360      if (LOG_FLOPPY)
463         log_readwrite("sector_read", side, flopimg->track, index1, (const char *)ptr, length);
361         log_readwrite("sector_read", side, m_track, index1, (const char *)ptr, length);
464362
465363   }
466364}
467365
468void floppy_drive_write_sector_data(device_t *img, int side, int index1, const void *ptr,int length, int ddam)
366void legacy_floppy_image_device::floppy_drive_write_sector_data(int side, int index1, const void *ptr,int length, int ddam)
469367{
470   floppy_drive *flopimg;
471   device_image_interface *image = dynamic_cast<device_image_interface *>(img);
472
473   if (image->exists())
368   if (exists())
474369   {
475      flopimg = get_safe_token( img );
476      if (!flopimg || !flopimg->floppy)
370      if (!m_floppy)
477371         return;
478372
479373      if (LOG_FLOPPY)
480         log_readwrite("sector_write", side, flopimg->track, index1, (const char *)ptr, length);
374         log_readwrite("sector_write", side, m_track, index1, (const char *)ptr, length);
481375
482      floppy_write_indexed_sector(flopimg->floppy, side, flopimg->track, index1, 0, ptr, length, ddam);
376      floppy_write_indexed_sector(m_floppy, side, m_track, index1, 0, ptr, length, ddam);
483377   }
484378}
485379
486void floppy_install_load_proc(device_t *image, void (*proc)(device_image_interface &image))
380void legacy_floppy_image_device::floppy_install_load_proc(void (*proc)(device_image_interface &image))
487381{
488   floppy_drive *flopimg = get_safe_token( image );
489   flopimg->load_proc = proc;
382   m_load_proc = proc;
490383}
491384
492void floppy_install_unload_proc(device_t *image, void (*proc)(device_image_interface &image))
385void legacy_floppy_image_device::floppy_install_unload_proc(void (*proc)(device_image_interface &image))
493386{
494   floppy_drive *flopimg = get_safe_token( image );
495   flopimg->unload_proc = proc;
387   m_unload_proc = proc;
496388}
497389
498390/* set the callback for the index pulse */
499void floppy_drive_set_index_pulse_callback(device_t *img, void (*callback)(device_t *controller,device_t *image, int state))
391void legacy_floppy_image_device::floppy_drive_set_index_pulse_callback(void (*callback)(device_t *controller, device_t *img, int state))
500392{
501   floppy_drive *pDrive = get_safe_token( img );
502   pDrive->index_pulse_callback = callback;
393   m_index_pulse_callback = callback;
503394}
504395
505
506void floppy_drive_set_ready_state_change_callback(device_t *img, void (*callback)(device_t *controller,device_t *img, int state))
396void legacy_floppy_image_device::floppy_drive_set_ready_state_change_callback(void (*callback)(device_t *controller,device_t *img, int state))
507397{
508   floppy_drive *pDrive = get_safe_token( img );
509   pDrive->ready_state_change_callback = callback;
398   m_ready_state_change_callback = callback;
510399}
511400
512int floppy_drive_get_current_track(device_t *img)
401int legacy_floppy_image_device::floppy_drive_get_current_track()
513402{
514   floppy_drive *drv = get_safe_token( img );
515   return drv->current_track;
403   return m_current_track;
516404}
517405
518UINT64 floppy_drive_get_current_track_size(device_t *img, int head)
406UINT64 legacy_floppy_image_device::floppy_drive_get_current_track_size(int head)
519407{
520   floppy_drive *drv = get_safe_token( img );
521408   int size = 0;
522   device_image_interface *image = dynamic_cast<device_image_interface *>(img);
523
524   if (image->exists())
409   if (exists())
525410   {
526      size = floppy_get_track_size(drv->floppy, head, drv->current_track);
411      size = floppy_get_track_size(m_floppy, head, m_current_track);
527412   }
528413
529414   return size;
530415}
531416
532void floppy_drive_set_rpm(device_t *img, float rpm)
417void legacy_floppy_image_device::floppy_drive_set_rpm(float rpm)
533418{
534   floppy_drive *drv = get_safe_token( img );
535   drv->rpm = rpm;
419   m_rpm = rpm;
536420}
537421
538void floppy_drive_set_controller(device_t *img, device_t *controller)
422void legacy_floppy_image_device::floppy_drive_set_controller(device_t *controller)
539423{
540   floppy_drive *drv = get_safe_token( img );
541   drv->controller = controller;
424   m_controller = controller;
542425}
543426
544static int internal_floppy_device_load(device_image_interface *image, int create_format, option_resolution *create_args)
427int legacy_floppy_image_device::internal_floppy_device_load(int create_format, option_resolution *create_args)
545428{
546429   floperr_t err;
547   floppy_drive *flopimg;
548430   const struct FloppyFormat *floppy_options;
549431   int floppy_flags, i;
550432   const char *extension;
551433
552   /* look up instance data */
553   flopimg = get_safe_token( &image->device() );
434   device_image_interface *image = NULL;
435   interface(image);   /* figure out the floppy options */
436   floppy_options = ((floppy_interface*)static_config())->formats;
554437
555   /* figure out the floppy options */
556   floppy_options = ((floppy_interface*)image->device().static_config())->formats;
557
558   if (image->has_been_created())
438   if (has_been_created())
559439   {
560440      /* creating an image */
561441      assert(create_format >= 0);
562      err = floppy_create((void *) image, &image_ioprocs, &floppy_options[create_format], create_args, &flopimg->floppy);
442      err = floppy_create((void *) image, &image_ioprocs, &floppy_options[create_format], create_args, &m_floppy);
563443      if (err)
564444         goto error;
565445   }
566446   else
567447   {
568448      /* opening an image */
569      floppy_flags = !image->is_readonly() ? FLOPPY_FLAGS_READWRITE : FLOPPY_FLAGS_READONLY;
570      extension = image->filetype();
571      err = floppy_open_choices((void *) image, &image_ioprocs, extension, floppy_options, floppy_flags, &flopimg->floppy);
449      floppy_flags = !is_readonly() ? FLOPPY_FLAGS_READWRITE : FLOPPY_FLAGS_READONLY;
450      extension = filetype();
451      err = floppy_open_choices((void *) image, &image_ioprocs, extension, floppy_options, floppy_flags, &m_floppy);
572452      if (err)
573453         goto error;
574454   }
575   if (floppy_callbacks(flopimg->floppy)->get_heads_per_disk && floppy_callbacks(flopimg->floppy)->get_tracks_per_disk)
455   if (floppy_callbacks(m_floppy)->get_heads_per_disk && floppy_callbacks(m_floppy)->get_tracks_per_disk)
576456   {
577      floppy_drive_set_geometry_absolute(&image->device(),
578         floppy_get_tracks_per_disk(flopimg->floppy),
579         floppy_get_heads_per_disk(flopimg->floppy));
457      floppy_drive_set_geometry_absolute(floppy_get_tracks_per_disk(m_floppy),floppy_get_heads_per_disk(m_floppy));
580458   }
581459   /* disk changed */
582   flopimg->dskchg = CLEAR_LINE;
460   m_dskchg = CLEAR_LINE;
583461
584462   return IMAGE_INIT_PASS;
585463
r29303r29304
587465   for (i = 0; i < ARRAY_LENGTH(errmap); i++)
588466   {
589467      if (err == errmap[i].ferr)
590         image->seterror(errmap[i].ierr, errmap[i].message);
468         seterror(errmap[i].ierr, errmap[i].message);
591469   }
592470   return IMAGE_INIT_FAIL;
593471}
594472
595static TIMER_CALLBACK( set_wpt )
473TIMER_CALLBACK_MEMBER( legacy_floppy_image_device::set_wpt )
596474{
597   floppy_drive *flopimg = (floppy_drive *)ptr;
598
599   flopimg->wpt = param;
600   flopimg->out_wpt_func(param);
475   m_wpt = param;
476   m_out_wpt_func(param);
601477}
602478
603device_t *floppy_get_device(running_machine &machine,int drive)
479legacy_floppy_image_device *floppy_get_device(running_machine &machine,int drive)
604480{
605481   switch(drive) {
606      case 0 : return machine.device(FLOPPY_0);
607      case 1 : return machine.device(FLOPPY_1);
608      case 2 : return machine.device(FLOPPY_2);
609      case 3 : return machine.device(FLOPPY_3);
482      case 0 : return machine.device<legacy_floppy_image_device>(FLOPPY_0);
483      case 1 : return machine.device<legacy_floppy_image_device>(FLOPPY_1);
484      case 2 : return machine.device<legacy_floppy_image_device>(FLOPPY_2);
485      case 3 : return machine.device<legacy_floppy_image_device>(FLOPPY_3);
610486   }
611487   return NULL;
612488}
613489
614int floppy_get_drive_type(device_t *image)
490int legacy_floppy_image_device::floppy_get_drive_type()
615491{
616   floppy_drive *flopimg = get_safe_token( image );
617   return flopimg->floppy_drive_type;
492   return m_floppy_drive_type;
618493}
619494
620void floppy_set_type(device_t *image,int ftype)
495void legacy_floppy_image_device::floppy_set_type(int ftype)
621496{
622   floppy_drive *flopimg = get_safe_token( image );
623   flopimg->floppy_drive_type = ftype;
497   m_floppy_drive_type = ftype;
624498}
625499
626device_t *floppy_get_device_by_type(running_machine &machine,int ftype,int drive)
500legacy_floppy_image_device *floppy_get_device_by_type(running_machine &machine,int ftype,int drive)
627501{
628502   int i;
629503   int cnt = 0;
630504   for (i=0;i<4;i++) {
631      device_t *disk = floppy_get_device(machine,i);
632      if (floppy_get_drive_type(disk)==ftype) {
505      legacy_floppy_image_device *disk = floppy_get_device(machine,i);
506      if (disk->floppy_get_drive_type()==ftype) {
633507         if (cnt==drive) {
634508            return disk;
635509         }
r29303r29304
649523   return drive;
650524}
651525
652int floppy_get_drive_by_type(device_t *image,int ftype)
526int floppy_get_drive_by_type(legacy_floppy_image_device *image,int ftype)
653527{
654528   int i,drive =0;
655529   for (i=0;i<4;i++) {
656      device_t *disk = floppy_get_device(image->machine(),i);
657      if (floppy_get_drive_type(disk)==ftype) {
530      legacy_floppy_image_device *disk = floppy_get_device(image->machine(),i);
531      if (disk->floppy_get_drive_type()==ftype) {
658532         if (image==disk) {
659533            return drive;
660534         }
r29303r29304
667541int floppy_get_count(running_machine &machine)
668542{
669543   int cnt = 0;
670   if (machine.device(FLOPPY_0)) cnt++;
671   if (machine.device(FLOPPY_1)) cnt++;
672   if (machine.device(FLOPPY_2)) cnt++;
673   if (machine.device(FLOPPY_3)) cnt++;
544   if (machine.device<legacy_floppy_image_device>(FLOPPY_0)) cnt++;
545   if (machine.device<legacy_floppy_image_device>(FLOPPY_1)) cnt++;
546   if (machine.device<legacy_floppy_image_device>(FLOPPY_2)) cnt++;
547   if (machine.device<legacy_floppy_image_device>(FLOPPY_3)) cnt++;
674548   return cnt;
675549}
676550
677551
678552/* drive select 0 */
679WRITE_LINE_DEVICE_HANDLER( floppy_ds0_w )
553WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_ds0_w )
680554{
681   floppy_drive *drive = get_safe_token(device);
682
683555   if (state == CLEAR_LINE)
684      drive->active = (drive->drive_id == 0);
556      m_active = (m_drive_id == 0);
685557}
686558
687559/* drive select 1 */
688WRITE_LINE_DEVICE_HANDLER( floppy_ds1_w )
560WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_ds1_w )
689561{
690   floppy_drive *drive = get_safe_token(device);
691
692562   if (state == CLEAR_LINE)
693      drive->active = (drive->drive_id == 1);
563      m_active = (m_drive_id == 1);
694564}
695565
696566/* drive select 2 */
697WRITE_LINE_DEVICE_HANDLER( floppy_ds2_w )
567WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_ds2_w )
698568{
699   floppy_drive *drive = get_safe_token(device);
700
701569   if (state == CLEAR_LINE)
702      drive->active = (drive->drive_id == 2);
570      m_active = (m_drive_id == 2);
703571}
704572
705573/* drive select 3 */
706WRITE_LINE_DEVICE_HANDLER( floppy_ds3_w )
574WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_ds3_w )
707575{
708   floppy_drive *drive = get_safe_token(device);
709
710576   if (state == CLEAR_LINE)
711      drive->active = (drive->drive_id == 3);
577      m_active = (m_drive_id == 3);
712578}
713579
714580/* shortcut to write all four ds lines */
715WRITE8_DEVICE_HANDLER( floppy_ds_w )
581WRITE8_MEMBER( legacy_floppy_image_device::floppy_ds_w )
716582{
717   floppy_ds0_w(device, BIT(data, 0));
718   floppy_ds1_w(device, BIT(data, 1));
719   floppy_ds2_w(device, BIT(data, 2));
720   floppy_ds3_w(device, BIT(data, 3));
583   floppy_ds0_w(BIT(data, 0));
584   floppy_ds1_w(BIT(data, 1));
585   floppy_ds2_w(BIT(data, 2));
586   floppy_ds3_w(BIT(data, 3));
721587}
722588
723589/* motor on, active low */
724WRITE_LINE_DEVICE_HANDLER( floppy_mon_w )
590WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_mon_w )
725591{
726   floppy_drive *drive = get_safe_token(device);
727   device_image_interface *image = dynamic_cast<device_image_interface *>(device);
728592   /* force off if there is no attached image */
729   if (!image->exists())
593   if (!exists())
730594      state = ASSERT_LINE;
731595
732596   /* off -> on */
733   if (drive->mon && state == CLEAR_LINE)
597   if (m_mon && state == CLEAR_LINE)
734598   {
735      drive->idx = 0;
736      floppy_drive_index_func(device);
599      m_idx = 0;
600      floppy_drive_index_func();
737601   }
738602
739603   /* on -> off */
740   else if (drive->mon == CLEAR_LINE && state)
741      drive->index_timer->adjust(attotime::zero);
604   else if (m_mon == CLEAR_LINE && state)
605      m_index_timer->adjust(attotime::zero);
742606
743   drive->mon = state;
607   m_mon = state;
744608}
745609
746610/* direction */
747WRITE_LINE_DEVICE_HANDLER( floppy_drtn_w )
611WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_drtn_w )
748612{
749   floppy_drive *drive = get_safe_token(device);
750   drive->drtn = state;
613   m_drtn = state;
751614}
752615
753616/* write data */
754WRITE_LINE_DEVICE_HANDLER( floppy_wtd_w )
617WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_wtd_w )
755618{
756619}
757620
758621/* step */
759WRITE_LINE_DEVICE_HANDLER( floppy_stp_w )
622WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_stp_w )
760623{
761   floppy_drive *drive = get_safe_token(device);
762624
763625   /* move head one track when going from high to low and write gate is high */
764   if (drive->active && drive->stp && state == CLEAR_LINE && drive->wtg)
626   if (m_active && m_stp && state == CLEAR_LINE && m_wtg)
765627   {
766628      /* move head according to the direction line */
767      if (drive->drtn)
629      if (m_drtn)
768630      {
769631         /* move head outward */
770         if (drive->current_track > 0)
771            drive->current_track--;
632         if (m_current_track > 0)
633            m_current_track--;
772634
773635         /* are we at track 0 now? */
774         drive->tk00 = (drive->current_track == 0) ? CLEAR_LINE : ASSERT_LINE;
636         m_tk00 = (m_current_track == 0) ? CLEAR_LINE : ASSERT_LINE;
775637      }
776638      else
777639      {
778640         /* move head inward */
779         if (drive->current_track < drive->max_track)
780            drive->current_track++;
641         if (m_current_track < m_max_track)
642            m_current_track++;
781643
782644         /* we can't be at track 0 here, so reset the line */
783         drive->tk00 = ASSERT_LINE;
645         m_tk00 = ASSERT_LINE;
784646      }
785647
786648      /* update track 0 line with new status */
787      drive->out_tk00_func(drive->tk00);
649      m_out_tk00_func(m_tk00);
788650   }
789651
790   drive->stp = state;
652   m_stp = state;
791653}
792654
793655/* write gate */
794WRITE_LINE_DEVICE_HANDLER( floppy_wtg_w )
656WRITE_LINE_MEMBER( legacy_floppy_image_device::floppy_wtg_w )
795657{
796   floppy_drive *drive = get_safe_token(device);
797   drive->wtg = state;
658   m_wtg = state;
798659}
799660
800661/* write protect signal, active low */
801READ_LINE_DEVICE_HANDLER( floppy_wpt_r )
662READ_LINE_MEMBER( legacy_floppy_image_device::floppy_wpt_r )
802663{
803   floppy_drive *drive = get_safe_token(device);
804   return drive->wpt;
664   return m_wpt;
805665}
806666
807667/* track 0 detect */
808READ_LINE_DEVICE_HANDLER( floppy_tk00_r )
668READ_LINE_MEMBER( legacy_floppy_image_device::floppy_tk00_r )
809669{
810   floppy_drive *drive = get_safe_token(device);
811   return drive->tk00;
670   return m_tk00;
812671}
813672
814673/* disk changed */
815READ_LINE_DEVICE_HANDLER( floppy_dskchg_r )
674READ_LINE_MEMBER( legacy_floppy_image_device::floppy_dskchg_r )
816675{
817   floppy_drive *drive = get_safe_token(device);
818   return drive->dskchg;
676   return m_dskchg;
819677}
820678
821679/* 2-sided disk */
822READ_LINE_DEVICE_HANDLER( floppy_twosid_r )
680READ_LINE_MEMBER( legacy_floppy_image_device::floppy_twosid_r )
823681{
824   floppy_drive *drive = get_safe_token(device);
825
826   if (drive->floppy == NULL)
682   if (m_floppy == NULL)
827683      return ASSERT_LINE;
828684   else
829      return !floppy_get_heads_per_disk(drive->floppy);
685      return !floppy_get_heads_per_disk(m_floppy);
830686}
831687
832READ_LINE_DEVICE_HANDLER( floppy_index_r )
688READ_LINE_MEMBER( legacy_floppy_image_device::floppy_index_r )
833689{
834   floppy_drive *drive = get_safe_token(device);
835   return drive->idx;
690   return m_idx;
836691}
837692
838READ_LINE_DEVICE_HANDLER( floppy_ready_r )
693READ_LINE_MEMBER( legacy_floppy_image_device::floppy_ready_r )
839694{
840   return !(floppy_drive_get_flag_state(device, FLOPPY_DRIVE_READY) == FLOPPY_DRIVE_READY);
695   return !(floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) == FLOPPY_DRIVE_READY);
841696}
842697
843698// device type definition
r29303r29304
849704
850705legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
851706   : device_t(mconfig, LEGACY_FLOPPY, "Floppy Disk", tag, owner, clock, "legacy_floppy_image", __FILE__),
852      device_image_interface(mconfig, *this),
853      m_token(NULL)
707      device_image_interface(mconfig, *this)
854708{
855   m_token = global_alloc_clear(floppy_drive);
856709}
857710
858711legacy_floppy_image_device::legacy_floppy_image_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)
859712   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
860      device_image_interface(mconfig, *this),
861      m_token(NULL)
713      device_image_interface(mconfig, *this)
862714{
863   m_token = global_alloc_clear(floppy_drive);
864715}
865716
866717//-------------------------------------------------
r29303r29304
869720
870721legacy_floppy_image_device::~legacy_floppy_image_device()
871722{
872   global_free(m_token);
873723}
874724
875725//-------------------------------------------------
r29303r29304
878728
879729void legacy_floppy_image_device::device_start()
880730{
881   floppy_drive *floppy = get_safe_token( this );
882   floppy->config = (const floppy_interface*)static_config();
883   floppy_drive_init(this);
731   m_config = (const floppy_interface*)static_config();
732   floppy_drive_init();
884733
885   floppy->drive_id = floppy_get_drive(this);
886   floppy->active = FALSE;
734   m_drive_id = floppy_get_drive(this);
735   m_active = FALSE;
887736
888737   /* resolve callbacks */
889   floppy->out_idx_func.resolve(floppy->config->out_idx_func, *this);
890   floppy->in_mon_func.resolve(floppy->config->in_mon_func, *this);
891   floppy->out_tk00_func.resolve(floppy->config->out_tk00_func, *this);
892   floppy->out_wpt_func.resolve(floppy->config->out_wpt_func, *this);
893   floppy->out_rdy_func.resolve(floppy->config->out_rdy_func, *this);
894//  floppy->out_dskchg_func.resolve(floppy->config->out_dskchg_func, *this);
738   m_out_idx_func.resolve(m_config->out_idx_func, *this);
739   m_in_mon_func.resolve(m_config->in_mon_func, *this);
740   m_out_tk00_func.resolve(m_config->out_tk00_func, *this);
741   m_out_wpt_func.resolve(m_config->out_wpt_func, *this);
742   m_out_rdy_func.resolve(m_config->out_rdy_func, *this);
743//  m_out_dskchg_func.resolve(m_config->out_dskchg_func, *this);
895744
896745   /* by default we are not write-protected */
897   floppy->wpt = ASSERT_LINE;
898   floppy->out_wpt_func(floppy->wpt);
746   m_wpt = ASSERT_LINE;
747   m_out_wpt_func(m_wpt);
899748
900749   /* not at track 0 */
901   floppy->tk00 = ASSERT_LINE;
902   floppy->out_tk00_func(floppy->tk00);
750   m_tk00 = ASSERT_LINE;
751   m_out_tk00_func(m_tk00);
903752
904753   /* motor off */
905   floppy->mon = ASSERT_LINE;
754   m_mon = ASSERT_LINE;
906755
907756   /* disk changed */
908   floppy->dskchg = CLEAR_LINE;
909//  floppy->out_dskchg_func(floppy->dskchg);
757   m_dskchg = CLEAR_LINE;
758//  m_out_dskchg_func(m_dskchg);
910759}
911760
912761
r29303r29304
936785
937786bool legacy_floppy_image_device::call_create(int format_type, option_resolution *format_options)
938787{
939   return internal_floppy_device_load(this, format_type, format_options);
788   return internal_floppy_device_load(format_type, format_options);
940789}
941790
942791bool legacy_floppy_image_device::call_load()
943792{
944   floppy_drive *flopimg;
945   int retVal = internal_floppy_device_load(this, -1, NULL);
946   flopimg = get_safe_token( this);
793   int retVal = internal_floppy_device_load(-1, NULL);
947794   if (retVal==IMAGE_INIT_PASS) {
948795      /* if we have one of our hacky unload procs, call it */
949      if (flopimg->load_proc)
950         flopimg->load_proc(*this);
796      if (m_load_proc)
797         m_load_proc(*this);
951798   }
952799
953800   /* push disk halfway into drive */
954   flopimg->wpt = CLEAR_LINE;
955   flopimg->out_wpt_func(flopimg->wpt);
801   m_wpt = CLEAR_LINE;
802   m_out_wpt_func(m_wpt);
956803
957804   /* set timer for disk load */
958805   int next_wpt;
r29303r29304
962809   else
963810      next_wpt = CLEAR_LINE;
964811
965   machine().scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), next_wpt, flopimg);
812   machine().scheduler().timer_set(attotime::from_msec(250), timer_expired_delegate(FUNC(legacy_floppy_image_device::set_wpt),this), next_wpt);
966813
967814   return retVal;
968815}
969816
970817void legacy_floppy_image_device::call_unload()
971818{
972   floppy_drive *flopimg = get_safe_token( this);
973   if (flopimg->unload_proc)
974      flopimg->unload_proc(*this);
819   if (m_unload_proc)
820      m_unload_proc(*this);
975821
976   floppy_close(flopimg->floppy);
977   flopimg->floppy = NULL;
822   floppy_close(m_floppy);
823   m_floppy = NULL;
978824
979825   /* disk changed */
980   flopimg->dskchg = CLEAR_LINE;
981   //flopimg->out_dskchg_func(flopimg->dskchg);
826   m_dskchg = CLEAR_LINE;
827   //m_out_dskchg_func(m_dskchg);
982828
983829   /* pull disk halfway out of drive */
984   flopimg->wpt = CLEAR_LINE;
985   flopimg->out_wpt_func(flopimg->wpt);
830   m_wpt = CLEAR_LINE;
831   m_out_wpt_func(m_wpt);
986832
987833   /* set timer for disk eject */
988   machine().scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), ASSERT_LINE, flopimg);
834   machine().scheduler().timer_set(attotime::from_msec(250), timer_expired_delegate(FUNC(legacy_floppy_image_device::set_wpt),this), ASSERT_LINE);
989835}
990836
991837void legacy_floppy_image_device::call_display_info()
shelves/new_menus/src/emu/imagedev/flopdrv.h
r29303r29304
9090/* set if index has just occurred */
9191#define FLOPPY_DRIVE_INDEX                      0x0020
9292
93/* a callback which will be executed if the ready state of the drive changes e.g. not ready->ready, ready->not ready */
94void floppy_drive_set_ready_state_change_callback(device_t *img, void (*callback)(device_t *controller,device_t *img, int state));
9593
96void floppy_drive_set_index_pulse_callback(device_t *img, void (*callback)(device_t *controller,device_t *image, int state));
97
98/* set flag state */
99int floppy_drive_get_flag_state(device_t *img, int flag);
100/* get flag state */
101void floppy_drive_set_flag_state(device_t *img, int flag, int state);
102/* get current physical track drive is on */
103int floppy_drive_get_current_track(device_t *img);
104/* get current physical track size */
105UINT64 floppy_drive_get_current_track_size(device_t *img, int head);
106
107/* get next id from track, 1 if got a id, 0 if no id was got */
108int floppy_drive_get_next_id(device_t *img, int side, chrn_id *);
109/* set ready state of drive. If flag == 1, set ready state only if drive present,
110disk is in drive, and motor is on. Otherwise set ready state to the state passed */
111void floppy_drive_set_ready_state(device_t *img, int state, int flag);
112
113/* seek up or down */
114void floppy_drive_seek(device_t *img, signed int signed_tracks);
115
116void floppy_drive_read_track_data_info_buffer(device_t *img, int side, void *ptr, int *length );
117void floppy_drive_write_track_data_info_buffer(device_t *img, int side, const void *ptr, int *length );
118void floppy_drive_format_sector(device_t *img, int side, int sector_index, int c, int h, int r, int n, int filler);
119void floppy_drive_read_sector_data(device_t *img, int side, int index1, void *pBuffer, int length);
120void floppy_drive_write_sector_data(device_t *img, int side, int index1, const void *pBuffer, int length, int ddam);
121
122/* set motor speed to get correct index pulses
123   standard RPM are 300 RPM (common) and 360 RPM
124   Note: this actually only works for soft sectored disks: one index pulse per
125   track.
126*/
127void floppy_drive_set_rpm(device_t *image, float rpm);
128
129void floppy_drive_set_controller(device_t *img, device_t *controller);
130
131floppy_image_legacy *flopimg_get_image(device_t *image);
132
133/* hack for apple II; replace this when we think of something better */
134void floppy_install_unload_proc(device_t *image, void (*proc)(device_image_interface &image));
135
136void floppy_install_load_proc(device_t *image, void (*proc)(device_image_interface &image));
137
138device_t *floppy_get_device(running_machine &machine,int drive);
139device_t *floppy_get_device_by_type(running_machine &machine,int ftype,int drive);
140int floppy_get_drive_type(device_t *image);
141void floppy_set_type(device_t *image,int ftype);
142int floppy_get_count(running_machine &machine);
143
144int floppy_get_drive(device_t *image);
145int floppy_get_drive_by_type(device_t *image,int ftype);
146
147void floppy_drive_set_geometry(device_t *img, floppy_type_t type);
148
149/* drive select lines */
150WRITE_LINE_DEVICE_HANDLER( floppy_ds0_w );
151WRITE_LINE_DEVICE_HANDLER( floppy_ds1_w );
152WRITE_LINE_DEVICE_HANDLER( floppy_ds2_w );
153WRITE_LINE_DEVICE_HANDLER( floppy_ds3_w );
154DECLARE_WRITE8_DEVICE_HANDLER( floppy_ds_w );
155
156WRITE_LINE_DEVICE_HANDLER( floppy_mon_w );
157WRITE_LINE_DEVICE_HANDLER( floppy_drtn_w );
158WRITE_LINE_DEVICE_HANDLER( floppy_stp_w );
159WRITE_LINE_DEVICE_HANDLER( floppy_wtd_w );
160WRITE_LINE_DEVICE_HANDLER( floppy_wtg_w );
161
162/* write-protect */
163READ_LINE_DEVICE_HANDLER( floppy_wpt_r );
164
165/* track 0 detect */
166READ_LINE_DEVICE_HANDLER( floppy_tk00_r );
167
168/* disk changed */
169READ_LINE_DEVICE_HANDLER( floppy_dskchg_r );
170
171/* 2-sided disk */
172READ_LINE_DEVICE_HANDLER( floppy_twosid_r );
173
174// index pulse
175READ_LINE_DEVICE_HANDLER( floppy_index_r );
176
177// drive ready
178READ_LINE_DEVICE_HANDLER( floppy_ready_r );
179
18094class legacy_floppy_image_device :  public device_t,
18195                           public device_image_interface
18296{
r29303r29304
203117   virtual const char *file_extensions() const { return m_extension_list; }
204118   virtual const option_guide *create_option_guide() const { return floppy_option_guide; }
205119
206   // access to legacy token
207   struct floppy_drive *token() const { assert(m_token != NULL); return m_token; }
120   floppy_image_legacy *flopimg_get_image();
121   void floppy_drive_set_geometry(floppy_type_t type);
122   void floppy_drive_set_flag_state(int flag, int state);
123   void floppy_drive_set_ready_state(int state, int flag);
124   int floppy_drive_get_flag_state(int flag);
125   void floppy_drive_seek(signed int signed_tracks);
126   int floppy_drive_get_next_id(int side, chrn_id *id);
127   void floppy_drive_read_track_data_info_buffer(int side, void *ptr, int *length );
128   void floppy_drive_write_track_data_info_buffer(int side, const void *ptr, int *length );
129   void floppy_drive_format_sector(int side, int sector_index,int c,int h, int r, int n, int filler);
130   void floppy_drive_read_sector_data(int side, int index1, void *ptr, int length);
131   void floppy_drive_write_sector_data(int side, int index1, const void *ptr,int length, int ddam);
132   void floppy_install_load_proc(void (*proc)(device_image_interface &image));
133   void floppy_install_unload_proc(void (*proc)(device_image_interface &image));
134   void floppy_drive_set_index_pulse_callback(void (*callback)(device_t *controller,device_t *image, int state));
135   void floppy_drive_set_ready_state_change_callback(void (*callback)(device_t *controller,device_t *img, int state));
136   int floppy_drive_get_current_track();
137   UINT64 floppy_drive_get_current_track_size(int head);
138   void floppy_drive_set_rpm(float rpm);
139   void floppy_drive_set_controller(device_t *controller);
140   int floppy_get_drive_type();
141   void floppy_set_type(int ftype);
142   WRITE_LINE_MEMBER( floppy_ds0_w );
143   WRITE_LINE_MEMBER( floppy_ds1_w );
144   WRITE_LINE_MEMBER( floppy_ds2_w );
145   WRITE_LINE_MEMBER( floppy_ds3_w );
146   WRITE8_MEMBER( floppy_ds_w );
147   WRITE_LINE_MEMBER( floppy_mon_w );
148   WRITE_LINE_MEMBER( floppy_drtn_w );
149   WRITE_LINE_MEMBER( floppy_wtd_w );
150   WRITE_LINE_MEMBER( floppy_stp_w );
151   WRITE_LINE_MEMBER( floppy_wtg_w );
152   READ_LINE_MEMBER( floppy_wpt_r );
153   READ_LINE_MEMBER( floppy_tk00_r );
154   READ_LINE_MEMBER( floppy_dskchg_r );
155   READ_LINE_MEMBER( floppy_twosid_r );
156   READ_LINE_MEMBER( floppy_index_r );
157   READ_LINE_MEMBER( floppy_ready_r );
158
159
160private:
161   int flopimg_get_sectors_per_track(int side);
162   void flopimg_get_id_callback(chrn_id *id, int id_index, int side);
163   void log_readwrite(const char *name, int head, int track, int sector, const char *buf, int length);
164   void floppy_drive_set_geometry_absolute(int tracks, int sides);
165   TIMER_CALLBACK_MEMBER(floppy_drive_index_callback);
166   void floppy_drive_init();
167   void floppy_drive_index_func();
168   TIMER_CALLBACK(floppy_drive_index_callback);
169   int internal_floppy_device_load(int create_format, option_resolution *create_args);
170   TIMER_CALLBACK_MEMBER( set_wpt );
171
208172protected:
209173   // device overrides
210174   virtual void device_config_complete();
211175   virtual void device_start();
212176
213   struct floppy_drive *m_token;
177   /* callbacks */
178   devcb_resolved_write_line m_out_idx_func;
179   devcb_resolved_read_line m_in_mon_func;
180   devcb_resolved_write_line m_out_tk00_func;
181   devcb_resolved_write_line m_out_wpt_func;
182   devcb_resolved_write_line m_out_rdy_func;
183   devcb_resolved_write_line m_out_dskchg_func;
184
185   /* state of input lines */
186   int m_drtn; /* direction */
187   int m_stp;  /* step */
188   int m_wtg;  /* write gate */
189   int m_mon;  /* motor on */
190
191   /* state of output lines */
192   int m_idx;  /* index pulse */
193   int m_tk00; /* track 00 */
194   int m_wpt;  /* write protect */
195   int m_rdy;  /* ready */
196   int m_dskchg;     /* disk changed */
197
198   /* drive select logic */
199   int m_drive_id;
200   int m_active;
201
202   const floppy_interface  *m_config;
203
204   /* flags */
205   int m_flags;
206   /* maximum track allowed */
207   int m_max_track;
208   /* num sides */
209   int m_num_sides;
210   /* current track - this may or may not relate to the present cylinder number
211   stored by the fdc */
212   int m_current_track;
213
214   /* index pulse timer */
215   emu_timer   *m_index_timer;
216   /* index pulse callback */
217   void    (*m_index_pulse_callback)(device_t *controller,device_t *image, int state);
218   /* rotation per minute => gives index pulse frequency */
219   float m_rpm;
220
221   void    (*m_ready_state_change_callback)(device_t *controller,device_t *img, int state);
222
223   int m_id_index;
224
225   device_t *m_controller;
226
227   floppy_image_legacy *m_floppy;
228   int m_track;
229   void (*m_load_proc)(device_image_interface &image);
230   void (*m_unload_proc)(device_image_interface &image);
231   int m_floppy_drive_type;
232
214233   char            m_extension_list[256];
215234};
216235
217236// device type definition
218237extern const device_type LEGACY_FLOPPY;
219238
239
240
241legacy_floppy_image_device *floppy_get_device(running_machine &machine,int drive);
242legacy_floppy_image_device *floppy_get_device_by_type(running_machine &machine,int ftype,int drive);
243int floppy_get_drive(device_t *image);
244int floppy_get_drive_by_type(legacy_floppy_image_device *image,int ftype);
245int floppy_get_count(running_machine &machine);
246
247
220248/***************************************************************************
221249    DEVICE CONFIGURATION MACROS
222250***************************************************************************/
shelves/new_menus/src/emu/cpu/powerpc/ppccom.c
r29303r29304
326326   ppc->program = &device->space(AS_PROGRAM);
327327   ppc->direct = &ppc->program->direct();
328328   ppc->system_clock = (config != NULL) ? config->bus_frequency : device->clock();
329   ppc->dcr_read_func = (config != NULL) ? config->dcr_read_func : NULL;
330   ppc->dcr_write_func = (config != NULL) ? config->dcr_write_func : NULL;
329   ppc->dcr_read_func = read32_delegate();
330   ppc->dcr_write_func = write32_delegate();
331331
332332   ppc->tb_divisor = (ppc->tb_divisor * device->clock() + ppc->system_clock / 2 - 1) / ppc->system_clock;
333333   ppc->codexor = 0;
r29303r29304
11201120   }
11211121
11221122   /* default handling */
1123   if (!ppc->dcr_read_func) {
1123   if (ppc->dcr_read_func.isnull()) {
11241124      mame_printf_debug("DCR %03X read\n", ppc->param0);
11251125      if (ppc->param0 < ARRAY_LENGTH(ppc->dcr))
11261126         ppc->param1 = ppc->dcr[ppc->param0];
11271127      else
11281128         ppc->param1 = 0;
11291129   } else {
1130      ppc->param1 = ppc->dcr_read_func(ppc->device,*ppc->program,ppc->param0,0xffffffff);
1130      ppc->param1 = ppc->dcr_read_func(*ppc->program,ppc->param0,0xffffffff);
11311131   }
11321132}
11331133
r29303r29304
12121212   }
12131213
12141214   /* default handling */
1215   if (!ppc->dcr_write_func) {
1215   if (ppc->dcr_write_func.isnull()) {
12161216      mame_printf_debug("DCR %03X write = %08X\n", ppc->param0, ppc->param1);
12171217      if (ppc->param0 < ARRAY_LENGTH(ppc->dcr))
12181218         ppc->dcr[ppc->param0] = ppc->param1;
12191219   } else {
1220      ppc->dcr_write_func(ppc->device,*ppc->program,ppc->param0,ppc->param1,0xffffffff);
1220      ppc->dcr_write_func(*ppc->program,ppc->param0,ppc->param1,0xffffffff);
12211221   }
12221222}
12231223
r29303r29304
24882488   ppc->buffered_dma_rate[channel] = rate;
24892489}
24902490
2491/*-------------------------------------------------
2492    ppc4xx_set_dcr_read_handler
2493-------------------------------------------------*/
24912494
2495void ppc4xx_set_dcr_read_handler(device_t *device, read32_delegate dcr_read_func)
2496{
2497   powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(device)->token();
2498   ppc->dcr_read_func = dcr_read_func;
2499
2500}
2501
24922502/*-------------------------------------------------
2503    ppc4xx_set_dcr_write_handler
2504-------------------------------------------------*/
2505
2506void ppc4xx_set_dcr_write_handler(device_t *device, write32_delegate dcr_write_func)
2507{
2508   powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(device)->token();
2509   ppc->dcr_write_func = dcr_write_func;
2510}
2511
2512/*-------------------------------------------------
24932513    ppc4xx_set_info - PowerPC 4XX-specific
24942514    information setter
24952515-------------------------------------------------*/
shelves/new_menus/src/emu/cpu/powerpc/ppccom.h
r29303r29304
566566   /* for use by specific implementations */
567567   ppcimp_state *  impstate;
568568
569   read32_device_func  dcr_read_func;
570   write32_device_func dcr_write_func;
569   read32_delegate  dcr_read_func;
570   write32_delegate dcr_write_func;
571571
572572   ppc_dcstore_handler dcstore_handler;
573573
shelves/new_menus/src/emu/cpu/powerpc/ppc.h
r29303r29304
165165struct powerpc_config
166166{
167167   UINT32      bus_frequency;
168   read32_device_func  dcr_read_func;
169   write32_device_func dcr_write_func;
170168};
171169
172170typedef void (*ppc_dcstore_handler)(device_t *device, UINT32 address);
r29303r29304
188186void ppc_set_dcstore_callback(device_t *device, ppc_dcstore_handler handler);
189187void ppc4xx_set_dma_read_handler(device_t *device, int channel, ppc4xx_dma_read_handler handler, int rate);
190188void ppc4xx_set_dma_write_handler(device_t *device, int channel, ppc4xx_dma_write_handler handler, int rate);
189void ppc4xx_set_dcr_read_handler(device_t *device, read32_delegate dcr_read_func);
190void ppc4xx_set_dcr_write_handler(device_t *device, write32_delegate dcr_write_func);
191191
192
193192DECLARE_LEGACY_CPU_DEVICE(PPC403GA, ppc403ga);
194193DECLARE_LEGACY_CPU_DEVICE(PPC403GCX, ppc403gcx);
195194
shelves/new_menus/src/mess/drivers/apollo.c
r29303r29304
688688      AM_RANGE(0x016400, 0x0164ff) AM_READWRITE16(selective_clear_locations_r, selective_clear_locations_w, 0xffffffff )
689689      AM_RANGE(0x017000, 0x017fff) AM_READWRITE16(apollo_address_translation_map_r, apollo_address_translation_map_w, 0xffffffff )
690690
691      AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE8_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
692      AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
691      AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE8(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
692      AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
693693
694      AM_RANGE(0x05e800, 0x05ec07) AM_DEVREADWRITE8_LEGACY(APOLLO_SCREEN_TAG, apollo_ccr_r, apollo_ccr_w, 0xffffffff)
695      AM_RANGE(0x0a0000, 0x0bffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_cgm_r, apollo_cgm_w, 0xffffffff)
694      AM_RANGE(0x05e800, 0x05ec07) AM_DEVREADWRITE8(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_ccr_r, apollo_ccr_w, 0xffffffff)
695      AM_RANGE(0x0a0000, 0x0bffff) AM_DEVREADWRITE16(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_cgm_r, apollo_cgm_w, 0xffffffff)
696696
697697      AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
698698
r29303r29304
762762      AM_RANGE(0x009500, 0x0095ff) AM_DEVREADWRITE8(APOLLO_PIC2_TAG, pic8259_device, read, write, 0xffffffff)
763763      AM_RANGE(0x009600, 0x0096ff) AM_READWRITE16(apollo_node_id_r, apollo_node_id_w, 0xffffffff)
764764
765      AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE8_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
766      AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
765      AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE8(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
766      AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
767767
768      AM_RANGE(0x05e800, 0x05ec07) AM_DEVREADWRITE8_LEGACY(APOLLO_SCREEN_TAG, apollo_ccr_r, apollo_ccr_w, 0xffffffff)
769      AM_RANGE(0x0a0000, 0x0bffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_cgm_r, apollo_cgm_w, 0xffffffff)
768      AM_RANGE(0x05e800, 0x05ec07) AM_DEVREADWRITE8(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_ccr_r, apollo_ccr_w, 0xffffffff)
769      AM_RANGE(0x0a0000, 0x0bffff) AM_DEVREADWRITE16(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_cgm_r, apollo_cgm_w, 0xffffffff)
770770
771771      AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
772772
r29303r29304
836836      AM_RANGE(0x016400, 0x0164ff) AM_READWRITE16(selective_clear_locations_r, selective_clear_locations_w, 0xffffffff )
837837      AM_RANGE(0x017000, 0x017fff) AM_READWRITE16(apollo_address_translation_map_r, apollo_address_translation_map_w, 0xffffffff )
838838
839      AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE8_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
840      AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
839      AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE8(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
840      AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
841841
842      AM_RANGE(0x05e800, 0x05ec07) AM_DEVREADWRITE8_LEGACY(APOLLO_SCREEN_TAG, apollo_ccr_r, apollo_ccr_w, 0xffffffff)
843      AM_RANGE(0x0a0000, 0x0bffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_cgm_r, apollo_cgm_w, 0xffffffff)
842      AM_RANGE(0x05e800, 0x05ec07) AM_DEVREADWRITE8(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_ccr_r, apollo_ccr_w, 0xffffffff)
843      AM_RANGE(0x0a0000, 0x0bffff) AM_DEVREADWRITE16(APOLLO_SCREEN_TAG, apollo_graphics_15i, apollo_cgm_r, apollo_cgm_w, 0xffffffff)
844844
845845      AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
846846
shelves/new_menus/src/mess/drivers/fm7.c
r29303r29304
492492         else
493493         {
494494            m_fdc->set_drive(data & 0x03);
495            floppy_mon_w(floppy_get_device(machine(), data & 0x03), !BIT(data, 7));
496            floppy_drive_set_ready_state(floppy_get_device(machine(), data & 0x03), data & 0x80,0);
495            floppy_get_device(machine(), data & 0x03)->floppy_mon_w(!BIT(data, 7));
496            floppy_get_device(machine(), data & 0x03)->floppy_drive_set_ready_state(data & 0x80,0);
497497            logerror("FDC: wrote %02x to 0x%04x (drive)\n",data,offset+0xfd18);
498498         }
499499         break;
shelves/new_menus/src/mess/drivers/dm7000.c
r29303r29304
256256   dcr[DCRSTB045_DISP_MODE] = 0x00880000;
257257   dcr[DCRSTB045_FRAME_BUFR_BASE] = 0x0f000000;
258258   m_scc0_lsr = UART_LSR_THRE | UART_LSR_TEMT;
259   
260   ppc4xx_set_dcr_read_handler(m_maincpu, read32_delegate(FUNC(dm7000_state::dcr_r),this));
261   ppc4xx_set_dcr_write_handler(m_maincpu, write32_delegate(FUNC(dm7000_state::dcr_w),this));
259262}
260263
261264void dm7000_state::video_start()
r29303r29304
267270   return 0;
268271}
269272
270static READ32_DEVICE_HANDLER( dcr_r )
273READ32_MEMBER( dm7000_state::dcr_r )
271274{
272   dm7000_state *state = space.machine().driver_data<dm7000_state>();
273275   mame_printf_debug("DCR %03X read\n", offset);
274276   if(offset>=1024) {printf("get %04X\n", offset); return 0;} else
275277   switch(offset) {
276278      case DCRSTB045_CMD_STAT:
277279         return 0; // assume that video dev is always ready
278280      default:
279         return state->dcr[offset];
281         return dcr[offset];
280282   }
281283
282284}
283285
284static WRITE32_DEVICE_HANDLER( dcr_w )
286WRITE32_MEMBER( dm7000_state::dcr_w )
285287{
286288   mame_printf_debug("DCR %03X write = %08X\n", offset, data);
287   dm7000_state *state = space.machine().driver_data<dm7000_state>();
288289   if(offset>=1024) {printf("get %04X\n", offset); } else
289   state->dcr[offset] = data;
290   dcr[offset] = data;
290291}
291292
292293WRITE8_MEMBER( dm7000_state::kbd_put )
r29303r29304
303304
304305static const powerpc_config ppc405_config =
305306{
306   252000000,
307   dcr_r,
308   dcr_w
307   252000000
309308};
310309
311310static MACHINE_CONFIG_START( dm7000, dm7000_state )
shelves/new_menus/src/mess/drivers/alphasma.c
r29303r29304
383383   MCFG_CPU_ADD("maincpu", MC68HC11, XTAL_8MHz/2)  // MC68HC11D0, XTAL is 8 Mhz, unknown divider
384384   MCFG_CPU_PROGRAM_MAP(alphasmart_mem)
385385   MCFG_CPU_IO_MAP(alphasmart_io)
386   MCFG_MC68HC11_CONFIG(0, 0, 0x00) // FIXME: internal ram should be 192, but the 68hc11 core doesn't handle internal RAM correctly
386   MCFG_MC68HC11_CONFIG(0, 192, 0x00)
387387
388388   MCFG_KS0066_F05_ADD("ks0066_0")
389389   MCFG_HD44780_LCD_SIZE(2, 40)
shelves/new_menus/src/mess/drivers/ms0515.c
r29303r29304
126126   m_video_ram = ram + 0000000 + 0340000;
127127   m_blink = 0;
128128
129   floppy_mon_w(machine().device(FLOPPY_0), 0); // turn it on
129   machine().device<legacy_floppy_image_device>(FLOPPY_0)->floppy_mon_w(0); // turn it on
130130}
131131
132132/* Input ports */
shelves/new_menus/src/mess/drivers/mbc200.c
r29303r29304
127127
128128void mbc200_state::machine_start()
129129{
130   floppy_mon_w(m_floppy0, CLEAR_LINE);
131   floppy_mon_w(m_floppy1, CLEAR_LINE);
132   floppy_drive_set_ready_state(m_floppy0, 1, 1);
133   floppy_drive_set_ready_state(m_floppy1, 1, 1);
130   m_floppy0->floppy_mon_w(CLEAR_LINE);
131   m_floppy1->floppy_mon_w(CLEAR_LINE);
132   m_floppy0->floppy_drive_set_ready_state(1, 1);
133   m_floppy1->floppy_drive_set_ready_state(1, 1);
134134}
135135
136136MC6845_UPDATE_ROW( mbc200_update_row )
shelves/new_menus/src/mess/drivers/iq151.c
r29303r29304
331331
332332IRQ_CALLBACK_MEMBER(iq151_state::iq151_irq_callback)
333333{
334   return m_pic->inta_r();
334   return m_pic->acknowledge();
335335}
336336
337337TIMER_DEVICE_CALLBACK_MEMBER(iq151_state::cassette_timer)
shelves/new_menus/src/mess/drivers/vic10.c
r29303r29304
644644   MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS6566_TAG, mos6566_device, lp_w))
645645   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
646646   MCFG_VIC10_EXPANSION_SLOT_ADD(VIC10_EXPANSION_SLOT_TAG, XTAL_8MHz/8, vic10_expansion_cards, NULL)
647   MCFG_VIC10_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(vic10_state, exp_irq_w), WRITELINE(vic10_state, exp_reset_w))
648   MCFG_VIC10_EXPANSION_SLOT_SERIAL_CALLBACKS(DEVWRITELINE(MOS6526_TAG, mos6526_device, cnt_w), DEVWRITELINE(MOS6526_TAG, mos6526_device, sp_w))
647   MCFG_VIC10_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(vic10_state, exp_irq_w))
648   MCFG_VIC10_EXPANSION_SLOT_RES_CALLBACK(WRITELINE(vic10_state, exp_reset_w))
649   MCFG_VIC10_EXPANSION_SLOT_CNT_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, cnt_w))
650   MCFG_VIC10_EXPANSION_SLOT_SP_CALLBACK(DEVWRITELINE(MOS6526_TAG, mos6526_device, sp_w))
649651
650652   // software list
651653   MCFG_SOFTWARE_LIST_ADD("cart_list", "vic10")
shelves/new_menus/src/mess/drivers/unixpc.c
r29303r29304
117117{
118118   logerror("disk_control_w: %04x\n", data);
119119
120   floppy_mon_w(m_floppy, !BIT(data, 5));
120   m_floppy->floppy_mon_w(!BIT(data, 5));
121121
122122   // bit 6 = floppy selected / not selected
123123   m_wd2797->set_drive(0);
shelves/new_menus/src/mess/drivers/thomson.c
r29303r29304
566566
567567WRITE_LINE_MEMBER( thomson_state::fdc_index_0_w )
568568{
569  thomson_index_callback(machine().device(FLOPPY_0), state);
569  thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_0), state);
570570}
571571
572572WRITE_LINE_MEMBER( thomson_state::fdc_index_1_w )
573573{
574  thomson_index_callback(machine().device(FLOPPY_1), state);
574  thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_1), state);
575575}
576576
577577WRITE_LINE_MEMBER( thomson_state::fdc_index_2_w )
578578{
579  thomson_index_callback(machine().device(FLOPPY_2), state);
579  thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_2), state);
580580}
581581
582582WRITE_LINE_MEMBER( thomson_state::fdc_index_3_w )
583583{
584  thomson_index_callback(machine().device(FLOPPY_3), state);
584  thomson_index_callback(machine().device<legacy_floppy_image_device>(FLOPPY_3), state);
585585}
586586
587587static const floppy_interface thomson_floppy_interface_0 =
shelves/new_menus/src/mess/drivers/c64.c
r29303r29304
11401140   MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS6567_TAG, mos6567_device, lp_w))
11411141   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
11421142   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/14, c64_expansion_cards, NULL)
1143   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
1144   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
1143   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(c64_state, exp_irq_w))
1144   MCFG_C64_EXPANSION_SLOT_NMI_CALLBACK(WRITELINE(c64_state, exp_nmi_w))
1145   MCFG_C64_EXPANSION_SLOT_RESET_CALLBACK(WRITELINE(c64_state, exp_reset_w))
1146   MCFG_C64_EXPANSION_SLOT_CD_INPUT_CALLBACK(READ8(c64_state, read))
1147   MCFG_C64_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(WRITE8(c64_state, write))
1148   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACK(WRITELINE(c64_state, exp_dma_w))
11451149
11461150   MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL)
11471151   MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
r29303r29304
12911295   MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
12921296   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
12931297   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, XTAL_17_734472MHz/18, c64_expansion_cards, NULL)
1294   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
1295   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
1298   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(c64_state, exp_irq_w))
1299   MCFG_C64_EXPANSION_SLOT_NMI_CALLBACK(WRITELINE(c64_state, exp_nmi_w))
1300   MCFG_C64_EXPANSION_SLOT_RESET_CALLBACK(WRITELINE(c64_state, exp_reset_w))
1301   MCFG_C64_EXPANSION_SLOT_CD_INPUT_CALLBACK(READ8(c64_state, read))
1302   MCFG_C64_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(WRITE8(c64_state, write))
1303   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACK(WRITELINE(c64_state, exp_dma_w))
12961304
12971305   MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL)
12981306   MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
r29303r29304
14191427   MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS6569_TAG, mos6569_device, lp_w))
14201428   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
14211429   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, XTAL_17_734472MHz/18, c64_expansion_cards, NULL)
1422   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c64_state, exp_irq_w), WRITELINE(c64_state, exp_nmi_w), WRITELINE(c64_state, exp_reset_w))
1423   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c64_state, read), WRITE8(c64_state, write), WRITELINE(c64_state, exp_dma_w))
1430   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(c64_state, exp_irq_w))
1431   MCFG_C64_EXPANSION_SLOT_NMI_CALLBACK(WRITELINE(c64_state, exp_nmi_w))
1432   MCFG_C64_EXPANSION_SLOT_RESET_CALLBACK(WRITELINE(c64_state, exp_reset_w))
1433   MCFG_C64_EXPANSION_SLOT_CD_INPUT_CALLBACK(READ8(c64_state, read))
1434   MCFG_C64_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(WRITE8(c64_state, write))
1435   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACK(WRITELINE(c64_state, exp_dma_w))
14241436
14251437   MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL)
14261438   MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c64_state, exp_reset_w))
shelves/new_menus/src/mess/drivers/wicat.c
r29303r29304
748748   }
749749}
750750
751// internal terminal
752static mc2661_interface wicat_uart0_intf =
753{
754   0,  // RXC
755   0,  // TXC
756   DEVCB_DEVICE_LINE_MEMBER("videouart0",mc2661_device, rx_w),  // TXD out
757   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // RXRDY out
758   DEVCB_NULL,  // TXRDY out
759   DEVCB_DEVICE_LINE_MEMBER("videouart0", mc2661_device, cts_w),  // RTS out
760   DEVCB_DEVICE_LINE_MEMBER("videouart0", mc2661_device, dsr_w),  // DTR out
761   DEVCB_NULL,  // TXEMT out
762   DEVCB_NULL,  // BKDET out
763   DEVCB_NULL   // XSYNC out
764};
765
766// RS232C ports (x5)
767static mc2661_interface wicat_uart1_intf =
768{
769   0,
770   0,
771   DEVCB_DEVICE_LINE_MEMBER("serial1", rs232_port_device, write_txd),
772   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // RXRDY out
773   DEVCB_NULL,
774   DEVCB_DEVICE_LINE_MEMBER("serial1", rs232_port_device, write_rts),
775   DEVCB_DEVICE_LINE_MEMBER("serial1", rs232_port_device, write_dtr),
776   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // TXEMT out
777   DEVCB_NULL,
778   DEVCB_NULL
779};
780
781static mc2661_interface wicat_uart2_intf =
782{
783   0,
784   0,
785   DEVCB_DEVICE_LINE_MEMBER("serial2", rs232_port_device, write_txd),
786   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // RXRDY out
787   DEVCB_NULL,
788   DEVCB_DEVICE_LINE_MEMBER("serial2", rs232_port_device, write_rts),
789   DEVCB_DEVICE_LINE_MEMBER("serial2", rs232_port_device, write_dtr),
790   DEVCB_NULL,  // TXEMT out
791   DEVCB_NULL,
792   DEVCB_NULL
793};
794
795static mc2661_interface wicat_uart3_intf =
796{
797   0,
798   0,
799   DEVCB_DEVICE_LINE_MEMBER("serial3", rs232_port_device, write_txd),
800   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // RXRDY out
801   DEVCB_NULL,
802   DEVCB_DEVICE_LINE_MEMBER("serial3", rs232_port_device, write_rts),
803   DEVCB_DEVICE_LINE_MEMBER("serial3", rs232_port_device, write_dtr),
804   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // TXEMT out
805   DEVCB_NULL,
806   DEVCB_NULL
807};
808
809static mc2661_interface wicat_uart4_intf =
810{
811   0,
812   0,
813   DEVCB_DEVICE_LINE_MEMBER("serial4", rs232_port_device, write_txd),
814   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // RXRDY out
815   DEVCB_NULL,
816   DEVCB_DEVICE_LINE_MEMBER("serial4", rs232_port_device, write_rts),
817   DEVCB_DEVICE_LINE_MEMBER("serial4", rs232_port_device, write_dtr),
818   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // TXEMT out
819   DEVCB_NULL,
820   DEVCB_NULL
821};
822
823static mc2661_interface wicat_uart5_intf =
824{
825   0,
826   0,
827   DEVCB_DEVICE_LINE_MEMBER("serial5", rs232_port_device, write_txd),
828   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // RXRDY out
829   DEVCB_NULL,
830   DEVCB_DEVICE_LINE_MEMBER("serial5", rs232_port_device, write_rts),
831   DEVCB_DEVICE_LINE_MEMBER("serial5", rs232_port_device, write_dtr),
832   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // TXEMT out
833   DEVCB_NULL,
834   DEVCB_NULL
835};
836
837// modem
838static mc2661_interface wicat_uart6_intf =
839{
840   0,  // RXC
841   0,  // TXC
842   DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_txd),  // RXD out
843   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // RXRDY out
844   DEVCB_NULL,  // TXRDY out
845   DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_rts),  // RTS out
846   DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_dtr),  // DTR out
847   DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2),  // TXEMT out
848   DEVCB_NULL,  // BKDET out
849   DEVCB_NULL   // XSYNC out
850};
851
852// terminal (2x INS2651, 1x IM6042 - one of these is for the keyboard, another communicates with the main board, the third is unknown)
853static mc2661_interface wicat_video_uart0_intf =
854{
855   0,  // RXC
856   0,  // TXC
857   DEVCB_DEVICE_LINE_MEMBER("uart0",mc2661_device, rx_w),  // RXD out
858   DEVCB_CPU_INPUT_LINE("videocpu",INPUT_LINE_IRQ0),  // RXRDY out
859   DEVCB_NULL,  // TXRDY out
860   DEVCB_DEVICE_LINE_MEMBER("uart0",mc2661_device, cts_w),  // RTS out
861   DEVCB_DEVICE_LINE_MEMBER("uart0",mc2661_device, dsr_w),  // DTR out
862   DEVCB_NULL,  // TXEMT out
863   DEVCB_NULL,  // BKDET out
864   DEVCB_NULL   // XSYNC out
865};
866
867static mc2661_interface wicat_video_uart1_intf =
868{
869   19200,  // RXC
870   19200,  // TXC
871   DEVCB_NULL,  // RXD out
872   DEVCB_CPU_INPUT_LINE("videocpu",INPUT_LINE_IRQ0),  // RXRDY out
873   DEVCB_NULL,  // TXRDY out
874   DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_rts),  // RTS out
875   DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_dtr),  // DTR out
876   DEVCB_NULL,  // TXEMT out
877   DEVCB_NULL,  // BKDET out
878   DEVCB_NULL   // XSYNC out
879};
880
881751static mm58274c_interface wicat_rtc_intf =
882752{
883753   0,  // 12 hour
r29303r29304
909779
910780   MCFG_MM58274C_ADD("rtc",wicat_rtc_intf)  // actually an MM58174AN, but should be compatible
911781
912   MCFG_MC2661_ADD("uart0", XTAL_5_0688MHz, wicat_uart0_intf)  // connected to terminal board
913   MCFG_MC2661_ADD("uart1", XTAL_5_0688MHz, wicat_uart1_intf)
914   MCFG_MC2661_ADD("uart2", XTAL_5_0688MHz, wicat_uart2_intf)
915   MCFG_MC2661_ADD("uart3", XTAL_5_0688MHz, wicat_uart3_intf)
916   MCFG_MC2661_ADD("uart4", XTAL_5_0688MHz, wicat_uart4_intf)
917   MCFG_MC2661_ADD("uart5", XTAL_5_0688MHz, wicat_uart5_intf)
918   MCFG_MC2661_ADD("uart6", XTAL_5_0688MHz, wicat_uart6_intf)  // connected to modem port
782   // internal terminal
783   MCFG_DEVICE_ADD("uart0", MC2661, XTAL_5_0688MHz)  // connected to terminal board
784   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("videouart0", mc2661_device, rx_w))
785   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
786   MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("videouart0", mc2661_device, cts_w))
787   MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("videouart0", mc2661_device, dsr_w))
919788
789   // RS232C ports (x5)
790   MCFG_DEVICE_ADD("uart1", MC2661, XTAL_5_0688MHz)
791   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial1", rs232_port_device, write_txd))
792   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
793   MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial1", rs232_port_device, write_rts))
794   MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial1", rs232_port_device, write_dtr))
795   MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
796
797   MCFG_DEVICE_ADD("uart2", MC2661, XTAL_5_0688MHz)
798   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial2", rs232_port_device, write_txd))
799   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
800   MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial2", rs232_port_device, write_rts))
801   MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial2", rs232_port_device, write_dtr))
802
803   MCFG_DEVICE_ADD("uart3", MC2661, XTAL_5_0688MHz)
804   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial3", rs232_port_device, write_txd))
805   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
806   MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial3", rs232_port_device, write_rts))
807   MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial3", rs232_port_device, write_dtr))
808   MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
809
810   MCFG_DEVICE_ADD("uart4", MC2661, XTAL_5_0688MHz)
811   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial4", rs232_port_device, write_txd))
812   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
813   MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial4", rs232_port_device, write_rts))
814   MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial4", rs232_port_device, write_dtr))
815   MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
816
817   MCFG_DEVICE_ADD("uart5", MC2661, XTAL_5_0688MHz)
818   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial5", rs232_port_device, write_txd))
819   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
820   MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial5", rs232_port_device, write_rts))
821   MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial5", rs232_port_device, write_dtr))
822   MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
823
824   // modem
825   MCFG_DEVICE_ADD("uart6", MC2661, XTAL_5_0688MHz)  // connected to modem port
826   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
827   MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
828
920829   MCFG_RS232_PORT_ADD("serial1",default_rs232_devices,NULL)
921830   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart1",mc2661_device,rx_w))
922831   MCFG_RS232_DCD_HANDLER(DEVWRITELINE("uart1",mc2661_device,dcd_w))
r29303r29304
955864   MCFG_AM9517A_ADD("videodma", XTAL_8MHz, wicat_videodma_intf)  // clock is a bit of guess
956865   MCFG_IM6402_ADD("videouart", 0, 0)
957866   MCFG_IM6402_DR_CALLBACK(WRITELINE(wicat_state, kb_data_ready))
958   MCFG_MC2661_ADD("videouart0", XTAL_5_0688MHz, wicat_video_uart0_intf)  // the INS2651 looks similar enough to the MC2661...
959   MCFG_MC2661_ADD("videouart1", XTAL_5_0688MHz, wicat_video_uart1_intf)
867
868   // terminal (2x INS2651, 1x IM6042 - one of these is for the keyboard, another communicates with the main board, the third is unknown)
869   MCFG_DEVICE_ADD("videouart0", MC2661, XTAL_5_0688MHz)  // the INS2651 looks similar enough to the MC2661...
870   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("uart0", mc2661_device, rx_w))
871   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("videocpu", INPUT_LINE_IRQ0))
872   MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("uart0", mc2661_device, cts_w))
873   MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("uart0", mc2661_device, dsr_w))
874
875   MCFG_DEVICE_ADD("videouart1", MC2661, XTAL_5_0688MHz)
876   MCFG_MC2661_RXC(19200)
877   MCFG_MC2661_TXC(19200)
878   MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("videocpu", INPUT_LINE_IRQ0))
879
960880   MCFG_X2210_ADD("vsram")  // XD2210
961881
962882   MCFG_SCREEN_ADD("screen",RASTER)
shelves/new_menus/src/mess/drivers/pce.c
r29303r29304
302302}
303303
304304
305static const huc6270_interface pce_huc6270_config =
306{
307   0x10000,
308   DEVCB_DRIVER_LINE_MEMBER(pce_state,pce_irq_changed)
309};
310
311
312305static const huc6260_interface pce_huc6260_config =
313306{
314307   DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, next_pixel ),
r29303r29304
318311};
319312
320313
321static const huc6270_interface sgx_huc6270_0_config =
322{
323   0x10000,
324   DEVCB_DRIVER_LINE_MEMBER(pce_state,pce_irq_changed)
325};
326
327
328static const huc6270_interface sgx_huc6270_1_config =
329{
330   0x10000,
331   DEVCB_DRIVER_LINE_MEMBER(pce_state,pce_irq_changed)
332};
333
334
335314static const huc6202_interface sgx_huc6202_config =
336315{
337316   DEVCB_DEVICE_MEMBER16( "huc6270_0", huc6270_device, next_pixel ),
r29303r29304
383362   MCFG_SCREEN_PALETTE("huc6260:palette")
384363
385364   MCFG_HUC6260_ADD( "huc6260", MAIN_CLOCK, pce_huc6260_config )
386   MCFG_HUC6270_ADD( "huc6270", pce_huc6270_config )
365   MCFG_DEVICE_ADD( "huc6270", HUC6270, 0 )
366   MCFG_HUC6270_VRAM_SIZE(0x10000)
367   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pce_state, pce_irq_changed))
387368
388369   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
389370   MCFG_SOUND_ADD(C6280_TAG, C6280, MAIN_CLOCK/6)
r29303r29304
426407   MCFG_SCREEN_PALETTE("huc6260:palette")
427408
428409   MCFG_HUC6260_ADD( "huc6260", MAIN_CLOCK, sgx_huc6260_config )
429   MCFG_HUC6270_ADD( "huc6270_0", sgx_huc6270_0_config )
430   MCFG_HUC6270_ADD( "huc6270_1", sgx_huc6270_1_config )
410   MCFG_DEVICE_ADD( "huc6270_0", HUC6270, 0 )
411   MCFG_HUC6270_VRAM_SIZE(0x10000)
412   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pce_state, pce_irq_changed))
413   MCFG_DEVICE_ADD( "huc6270_1", HUC6270, 0 )
414   MCFG_HUC6270_VRAM_SIZE(0x10000)
415   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pce_state, pce_irq_changed))
431416   MCFG_HUC6202_ADD( "huc6202", sgx_huc6202_config )
432417
433418   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
shelves/new_menus/src/mess/drivers/smc777.c
r29303r29304
389389   /* FIXME: floppy drive 1 doesn't work? */
390390   for(f_num=0;f_num<2;f_num++)
391391   {
392      floppy = flopimg_get_image(floppy_get_device(machine(), f_num));
393      floppy_mon_w(floppy_get_device(machine(), f_num), (floppy != NULL) ? 0 : 1);
394      floppy_drive_set_ready_state(floppy_get_device(machine(), f_num), (floppy != NULL) ? 1 : 0,0);
392      floppy = floppy_get_device(machine(), f_num)->flopimg_get_image();
393      floppy_get_device(machine(), f_num)->floppy_mon_w((floppy != NULL) ? 0 : 1);
394      floppy_get_device(machine(), f_num)->floppy_drive_set_ready_state((floppy != NULL) ? 1 : 0,0);
395395   }
396396}
397397
shelves/new_menus/src/mess/drivers/z100.c
r29303r29304
380380         m_z207_cur_drive = data & 3;
381381         break;
382382      case 5: // aux control
383         floppy_mon_w(floppy_get_device(machine(), m_z207_cur_drive), !BIT(data, 1));
384         floppy_drive_set_ready_state(floppy_get_device(machine(), m_z207_cur_drive), data & 2,0);
383         floppy_get_device(machine(), m_z207_cur_drive)->floppy_mon_w(!BIT(data, 1));
384         floppy_get_device(machine(), m_z207_cur_drive)->floppy_drive_set_ready_state(data & 2,0);
385385         break;
386386
387387   }
shelves/new_menus/src/mess/drivers/vip.c
r29303r29304
754754
755755   MCFG_VIP_BYTEIO_PORT_ADD(VIP_BYTEIO_PORT_TAG, vip_byteio_cards, NULL, WRITELINE(vip_state, byteio_inst_w))
756756   MCFG_VIP_EXPANSION_SLOT_ADD(VIP_EXPANSION_SLOT_TAG, XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
757   MCFG_VIP_EXPANSION_SLOT_CALLBACKS(WRITELINE(vip_state, exp_int_w), WRITELINE(vip_state, exp_dma_out_w), WRITELINE(vip_state, exp_dma_in_w))
757    MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(vip_state, exp_int_w))
758    MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(vip_state, exp_dma_out_w))
759    MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(vip_state, exp_dma_in_w))
758760
759761   // devices
760762   MCFG_QUICKLOAD_ADD("quickload", vip_state, vip, "bin,c8,c8x", 0)
shelves/new_menus/src/mess/drivers/vic20.c
r29303r29304
730730
731731   // devices
732732   MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, MOS6560_CLOCK, vic20_expansion_cards, NULL)
733   MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACKS(INPUTLINE(M6502_TAG, M6502_IRQ_LINE), INPUTLINE(M6502_TAG, M6502_NMI_LINE), WRITELINE(vic20_state, exp_reset_w))
733   MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACK(INPUTLINE(M6502_TAG, M6502_IRQ_LINE))
734   MCFG_VIC20_EXPANSION_SLOT_NMI_CALLBACK(INPUTLINE(M6502_TAG, M6502_NMI_LINE))
735   MCFG_VIC20_EXPANSION_SLOT_RES_CALLBACK(WRITELINE(vic20_state, exp_reset_w))
734736
735737   // software lists
736738   MCFG_SOFTWARE_LIST_FILTER("cart_list", "NTSC")
r29303r29304
757759
758760   // devices
759761   MCFG_VIC20_EXPANSION_SLOT_ADD(VIC20_EXPANSION_SLOT_TAG, MOS6561_CLOCK, vic20_expansion_cards, NULL)
760   MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACKS(INPUTLINE(M6502_TAG, M6502_IRQ_LINE), INPUTLINE(M6502_TAG, M6502_NMI_LINE), WRITELINE(vic20_state, exp_reset_w))
762   MCFG_VIC20_EXPANSION_SLOT_IRQ_CALLBACK(INPUTLINE(M6502_TAG, M6502_IRQ_LINE))
763   MCFG_VIC20_EXPANSION_SLOT_NMI_CALLBACK(INPUTLINE(M6502_TAG, M6502_NMI_LINE))
764   MCFG_VIC20_EXPANSION_SLOT_RES_CALLBACK(WRITELINE(vic20_state, exp_reset_w))
761765
762766   // software lists
763767   MCFG_SOFTWARE_LIST_FILTER("cart_list", "PAL")
shelves/new_menus/src/mess/drivers/plus4.c
r29303r29304
799799
800800   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL)
801801   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
802   MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/16, plus4_expansion_cards, "c1551", WRITELINE(plus4_state, exp_irq_w))
803   MCFG_PLUS4_EXPANSION_SLOT_DMA_CALLBACKS(READ8(plus4_state, read), WRITE8(plus4_state, write), INPUTLINE(MOS7501_TAG, INPUT_LINE_HALT))
802   MCFG_PLUS4_EXPANSION_SLOT_ADD(PLUS4_EXPANSION_SLOT_TAG, XTAL_14_31818MHz/16, plus4_expansion_cards, "c1551")
803   MCFG_PLUS4_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(plus4_state, exp_irq_w))
804   MCFG_PLUS4_EXPANSION_SLOT_CD_INPUT_CALLBACK(READ8(plus4_state, read))
805   MCFG_PLUS4_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(WRITE8(plus4_state, write))
806   MCFG_PLUS4_EXPANSION_SLOT_AEC_CALLBACK(INPUTLINE(MOS7501_TAG, INPUT_LINE_HALT))
804807
805808   MCFG_QUICKLOAD_ADD("quickload", plus4_state, cbm_c16, "p00,prg", CBM_QUICKLOAD_DELAY_SECONDS)
806809
shelves/new_menus/src/mess/drivers/mz2500.c
r29303r29304
11901190   {
11911191      case 0xdc:
11921192         fdc->set_drive(data & 3);
1193         floppy_mon_w(floppy_get_device(machine(), data & 3), (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
1194         floppy_drive_set_ready_state(floppy_get_device(machine(), data & 3), 1,0);
1193         floppy_get_device(machine(), data & 3)->floppy_mon_w((data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
1194         floppy_get_device(machine(), data & 3)->floppy_drive_set_ready_state(1,0);
11951195         break;
11961196      case 0xdd:
11971197         fdc->set_side((data & 1));
shelves/new_menus/src/mess/drivers/c128.c
r29303r29304
15111511   MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS8564_TAG, mos8564_device, lp_w))
15121512   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
15131513   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, XTAL_14_31818MHz*2/3.5/8, c64_expansion_cards, NULL)
1514   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w))
1515   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c128_state, exp_dma_cd_r), WRITE8(c128_state, exp_dma_cd_w), WRITELINE(c128_state, exp_dma_w))
1514   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(c128_state, exp_irq_w))
1515   MCFG_C64_EXPANSION_SLOT_NMI_CALLBACK(WRITELINE(c128_state, exp_nmi_w))
1516   MCFG_C64_EXPANSION_SLOT_RESET_CALLBACK(WRITELINE(c128_state, exp_reset_w))
1517   MCFG_C64_EXPANSION_SLOT_CD_INPUT_CALLBACK(READ8(c128_state, exp_dma_cd_r))
1518   MCFG_C64_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(WRITE8(c128_state, exp_dma_cd_w))
1519   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACK(WRITELINE(c128_state, exp_dma_w))
15161520
15171521   MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL)
15181522   MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w))
r29303r29304
16711675   MCFG_VCS_CONTROL_PORT_TRIGGER_CALLBACK(DEVWRITELINE(MOS8566_TAG, mos8566_device, lp_w))
16721676   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, "joy")
16731677   MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, XTAL_17_734472MHz*2/4.5/8, c64_expansion_cards, NULL)
1674   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACKS(WRITELINE(c128_state, exp_irq_w), WRITELINE(c128_state, exp_nmi_w), WRITELINE(c128_state, exp_reset_w))
1675   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACKS(READ8(c128_state, exp_dma_cd_r), WRITE8(c128_state, exp_dma_cd_w), WRITELINE(c128_state, exp_dma_w))
1678   MCFG_C64_EXPANSION_SLOT_IRQ_CALLBACK(WRITELINE(c128_state, exp_irq_w))
1679   MCFG_C64_EXPANSION_SLOT_NMI_CALLBACK(WRITELINE(c128_state, exp_nmi_w))
1680   MCFG_C64_EXPANSION_SLOT_RESET_CALLBACK(WRITELINE(c128_state, exp_reset_w))
1681   MCFG_C64_EXPANSION_SLOT_CD_INPUT_CALLBACK(READ8(c128_state, exp_dma_cd_r))
1682   MCFG_C64_EXPANSION_SLOT_CD_OUTPUT_CALLBACK(WRITE8(c128_state, exp_dma_cd_w))
1683   MCFG_C64_EXPANSION_SLOT_DMA_CALLBACK(WRITELINE(c128_state, exp_dma_w))
16761684
16771685   MCFG_PET_USER_PORT_ADD(PET_USER_PORT_TAG, c64_user_port_cards, NULL)
16781686   MCFG_PET_USER_PORT_3_HANDLER(WRITELINE(c128_state, exp_reset_w))
shelves/new_menus/src/mess/drivers/vtech1.c
r29303r29304
669669
670670   for(id=0;id<2;id++)
671671   {
672      floppy_install_load_proc(floppy_get_device(machine(), id), vtech1_load_proc);
672      floppy_get_device(machine(), id)->floppy_install_load_proc(vtech1_load_proc);
673673   }
674674}
675675
shelves/new_menus/src/mess/drivers/comx35.c
r29303r29304
44
55    TODO:
66
7    - unreliable DOS commands?
87    - tape input/output
98    - PL-80 plotter
109    - serial printer
shelves/new_menus/src/mess/drivers/pet.c
r29303r29304
135135    TODO:
136136
137137    - accurate video timing for non-CRTC models
138    - PET 4000-12 (40 column CRTC models)
139138    - High Speed Graphics board
140139    - keyboard layouts
141140        - Swedish
r29303r29304
10691068//  MC6845_INTERFACE( crtc_intf )
10701069//-------------------------------------------------
10711070
1071static MC6845_BEGIN_UPDATE( pet_begin_update )
1072{
1073   bitmap.fill(rgb_t::black);
1074
1075   return 0;
1076}
1077
10721078static MC6845_UPDATE_ROW( pet80_update_row )
10731079{
10741080   pet80_state *state = device->machine().driver_data<pet80_state>();
r29303r29304
11181124   true,
11191125   0,0,0,0,
11201126   2*8,
1121   NULL,
1127   pet_begin_update,
11221128   pet80_update_row,
11231129   NULL,
11241130   DEVCB_NULL,
r29303r29304
11321138//-------------------------------------------------
11331139//  MC6845_INTERFACE( pet40_crtc_intf )
11341140//-------------------------------------------------
1135static MC6845_BEGIN_UPDATE( pet_begin_update )
1136{
1137   bitmap.fill(rgb_t::black);
1138   return 0;
1139}
11401141
11411142static MC6845_UPDATE_ROW( pet40_update_row )
11421143{
shelves/new_menus/src/mess/drivers/compis.c
r29303r29304
766766   MCFG_RS232_CTS_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, ctsb_w))
767767
768768   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image")
769   MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(compis_state, write_centronics_busy))
770   MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(compis_state, write_centronics_select))
769771   MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG)
770772
771773   MCFG_ISBX_SLOT_ADD(ISBX_0_TAG, 0, isbx_cards, "fdc")
shelves/new_menus/src/mess/drivers/mod8.c
r29303r29304
5454
5555#include "emu.h"
5656#include "cpu/i8008/i8008.h"
57#include "bus/rs232/teleprinter.h"
57#include "machine/teleprinter.h"
5858
5959class mod8_state : public driver_device
6060{
shelves/new_menus/src/mess/drivers/rainbow.c
r29303r29304
326326   virtual void machine_reset();
327327
328328   int m_unit;
329   device_t *m_image[4];
329   legacy_floppy_image_device *m_image[4];
330330
331331   int m_irq_high;
332332   UINT32 m_irq_mask;
r29303r29304
335335
336336void rainbow_state::machine_start()
337337{
338   m_image[0] = subdevice(FLOPPY_0);
339   m_image[1] = subdevice(FLOPPY_1);
340   m_image[2] = subdevice(FLOPPY_2);
341   m_image[3] = subdevice(FLOPPY_3);
338   m_image[0] = subdevice<legacy_floppy_image_device>(FLOPPY_0);
339   m_image[1] = subdevice<legacy_floppy_image_device>(FLOPPY_1);
340   m_image[2] = subdevice<legacy_floppy_image_device>(FLOPPY_2);
341   m_image[3] = subdevice<legacy_floppy_image_device>(FLOPPY_3);
342342
343343   COLD_BOOT = 1;
344344
r29303r29304
863863NOTES: ALL LOW ACTIVE - EXCEPT TR00
864864*/
865865   // * TRACK 00 *  signal for current drive
866   int tk00 = ( floppy_tk00_r( m_image[m_unit] ) == CLEAR_LINE ) ? 0x20 : 0x00;
866   int tk00 = ( m_image[m_unit]->floppy_tk00_r() == CLEAR_LINE ) ? 0x20 : 0x00;
867867
868   int fdc_ready = floppy_drive_get_flag_state( m_image[m_unit] , FLOPPY_DRIVE_READY);
868   int fdc_ready = m_image[m_unit]->floppy_drive_get_flag_state( FLOPPY_DRIVE_READY);
869869
870870   int data=(   0x80                    |   // (STEP L)
871871//           (  (fdc_write_gate) )       |
r29303r29304
958958
959959   int selected_drive = 255;
960960
961   if (flopimg_get_image( floppy_get_device( machine(), drive ) ) != NULL)
961   if (floppy_get_device( machine(), drive )->flopimg_get_image() != NULL)
962962   {   selected_drive = drive;
963963      m_fdc->set_drive(selected_drive);
964964   }
r29303r29304
987987         {
988988            // Although 1773 does not feature 'motor on' this statement is required:
989989            // CLEAR_LINE = turn motor on -
990            floppy_mon_w(m_image[f_num], (f_num == selected_drive) ? CLEAR_LINE : ASSERT_LINE);
990            m_image[f_num]->floppy_mon_w((f_num == selected_drive) ? CLEAR_LINE : ASSERT_LINE);
991991
992992            // Parameters: DRIVE, STATE, FLAG
993            floppy_drive_set_ready_state( m_image[f_num],
993            m_image[f_num]->floppy_drive_set_ready_state(
994994                                    (f_num == selected_drive) ? 1 : 0,
995995                                    (f_num == selected_drive) ? force_ready : 0
996996                                 );
shelves/new_menus/src/mess/drivers/apf.c
r29303r29304
260260
261261   m_fdc->set_drive(drive);
262262   floppy_image_legacy *floppy;
263   floppy = flopimg_get_image(floppy_get_device(machine(), drive));
264   floppy_mon_w(floppy_get_device(machine(), drive), (floppy != NULL) ? 0 : 1);
265   floppy_drive_set_ready_state(floppy_get_device(machine(), drive), (floppy != NULL) ? 1 : 0,0);
263   floppy = floppy_get_device(machine(), drive)->flopimg_get_image();
264   floppy_get_device(machine(), drive)->floppy_mon_w((floppy != NULL) ? 0 : 1);
265   floppy_get_device(machine(), drive)->floppy_drive_set_ready_state((floppy != NULL) ? 1 : 0,0);
266266
267267
268268   logerror("disc w %04x %04x\n",offset,data);
shelves/new_menus/src/mess/drivers/pcfx.c
r29303r29304
464464};
465465
466466
467static const huc6270_interface pcfx_huc6270_a_config =
468{
469   0x20000,
470   DEVCB_DRIVER_LINE_MEMBER(pcfx_state, irq12_w)
471};
472
473
474static const huc6270_interface pcfx_huc6270_b_config =
475{
476   0x20000,
477   DEVCB_DRIVER_LINE_MEMBER(pcfx_state, irq14_w)
478};
479
480
481467void pcfx_state::machine_reset()
482468{
483469   membank( "bank1" )->set_base( memregion("user1")->base() );
r29303r29304
503489   MCFG_SCREEN_UPDATE_DRIVER(pcfx_state, screen_update)
504490   MCFG_SCREEN_RAW_PARAMS(XTAL_21_4772MHz, HUC6261_WPF, 64, 64 + 1024 + 64, HUC6261_LPF, 18, 18 + 242)
505491
506   MCFG_HUC6270_ADD( "huc6270_a", pcfx_huc6270_a_config )
507   MCFG_HUC6270_ADD( "huc6270_b", pcfx_huc6270_b_config )
492   MCFG_DEVICE_ADD( "huc6270_a", HUC6270, 0 )
493   MCFG_HUC6270_VRAM_SIZE(0x20000)
494   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pcfx_state, irq12_w))
495   MCFG_DEVICE_ADD( "huc6270_b", HUC6270, 0 )
496   MCFG_HUC6270_VRAM_SIZE(0x20000)
497   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pcfx_state, irq14_w))
508498   MCFG_HUC6261_ADD( "huc6261", XTAL_21_4772MHz, pcfx_huc6261_config )
509499   MCFG_HUC6272_ADD( "huc6272", XTAL_21_4772MHz )
510500
shelves/new_menus/src/mess/drivers/mz2000.c
r29303r29304
360360   {
361361      case 0xdc:
362362         m_mb8877a->set_drive(data & 3);
363         floppy_mon_w(floppy_get_device(machine(), data & 3), (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
364         floppy_drive_set_ready_state(floppy_get_device(machine(), data & 3), 1,0);
363         floppy_get_device(machine(), data & 3)->floppy_mon_w((data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
364         floppy_get_device(machine(), data & 3)->floppy_drive_set_ready_state(1,0);
365365         break;
366366      case 0xdd:
367367         m_mb8877a->set_side((data & 1));
shelves/new_menus/src/mess/drivers/megadriv.c
r29303r29304
738738static MACHINE_CONFIG_DERIVED( genesis_32x_scd, genesis_32x )
739739
740740   MCFG_DEVICE_ADD("segacd", SEGA_SEGACD_US, 0)
741   MCFG_CDROM_ADD( "cdrom",scd_cdrom )
741742
742743   MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd)
743744
745   MCFG_DEVICE_MODIFY("cart")
746   MCFG_CARTSLOT_NOT_MANDATORY
747
744748   //MCFG_QUANTUM_PERFECT_CPU("32x_master_sh2")
745749MACHINE_CONFIG_END
746750
shelves/new_menus/src/mess/drivers/myb3k.c
r29303r29304
127127{
128128   /* TODO: complete guesswork! (it just does a 0x24 -> 0x20 in there) */
129129   m_fdc->set_drive(data & 3);
130   floppy_mon_w(floppy_get_device(machine(), data & 3), !(data & 4) ? 1: 0);
131   floppy_drive_set_ready_state(floppy_get_device(machine(), data & 3), data & 0x4,0);
130   floppy_get_device(machine(), data & 3)->floppy_mon_w(!(data & 4) ? 1: 0);
131   floppy_get_device(machine(), data & 3)->floppy_drive_set_ready_state(data & 0x4,0);
132132   //m_fdc->set_side((data & 0x10)>>4);
133133}
134134
shelves/new_menus/src/mess/drivers/wangpc.c
r29303r29304
926926   check_level1_interrupts();
927927}
928928
929static MC2661_INTERFACE( epci_intf )
930{
931   0,
932   0,
933   DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_txd),
934   DEVCB_DRIVER_LINE_MEMBER(wangpc_state, epci_irq_w),
935   DEVCB_NULL,
936   DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_rts),
937   DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_dtr),
938   DEVCB_DRIVER_LINE_MEMBER(wangpc_state, epci_irq_w),
939   DEVCB_NULL,
940   DEVCB_NULL
941};
942929
943
944930//-------------------------------------------------
945931//  upd765_interface fdc_intf
946932//-------------------------------------------------
r29303r29304
11471133   MCFG_IM6402_TRO_CALLBACK(DEVWRITELINE(WANGPC_KEYBOARD_TAG, wangpc_keyboard_device, write_rxd))
11481134   MCFG_IM6402_DR_CALLBACK(WRITELINE(wangpc_state, uart_dr_w))
11491135   MCFG_IM6402_TBRE_CALLBACK(WRITELINE(wangpc_state, uart_tbre_w))
1150   MCFG_MC2661_ADD(SCN2661_TAG, 0, epci_intf)
1136   
1137   MCFG_DEVICE_ADD(SCN2661_TAG, MC2661, 0)
1138   MCFG_MC2661_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
1139   MCFG_MC2661_RXRDY_HANDLER(WRITELINE(wangpc_state, epci_irq_w))
1140   MCFG_MC2661_RTS_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts))
1141   MCFG_MC2661_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr))
1142   MCFG_MC2661_TXEMT_DSCHG_HANDLER(WRITELINE(wangpc_state, epci_irq_w))
1143
11511144   MCFG_UPD765A_ADD(UPD765_TAG, false, false)
11521145   MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(wangpc_state, fdc_irq))
11531146   MCFG_UPD765_DRQ_CALLBACK(WRITELINE(wangpc_state, fdc_drq))
r29303r29304
12181211//  GAME DRIVERS
12191212//**************************************************************************
12201213
1221COMP( 1985, wangpc, 0, 0, wangpc, wangpc, driver_device, 0, "Wang Laboratories", "Wang Professional Computer", GAME_SUPPORTS_SAVE )
1214COMP( 1985, wangpc, 0, 0, wangpc, wangpc, driver_device, 0, "Wang Laboratories", "Wang Professional Computer", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
shelves/new_menus/src/mess/drivers/x1.c
r29303r29304
10371037         break;
10381038      case 0x0ffc:
10391039         m_fdc->set_drive(data & 3);
1040         floppy_mon_w(floppy_get_device(machine(), data & 3), !BIT(data, 7));
1041         floppy_drive_set_ready_state(floppy_get_device(machine(), data & 3), data & 0x80,0);
1040         floppy_get_device(machine(), data & 3)->floppy_mon_w(!BIT(data, 7));
1041         floppy_get_device(machine(), data & 3)->floppy_drive_set_ready_state(data & 0x80,0);
10421042         m_fdc->set_side(BIT(data, 4));
10431043         break;
10441044      case 0x0ffd:
shelves/new_menus/src/mess/drivers/abc1600.c
r29303r29304
469469
470470static ADDRESS_MAP_START( mac_mem, AS_PROGRAM, 8, abc1600_state )
471471   AM_RANGE(0x000000, 0x0fffff) AM_RAM
472   AM_RANGE(0x100000, 0x17ffff) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, vram_map)//AM_READWRITE(video_ram_r, video_ram_w)
472   AM_RANGE(0x100000, 0x17ffff) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, vram_map)
473473   AM_RANGE(0x1fe000, 0x1fefff) AM_READWRITE(bus_r, bus_w)
474474   AM_RANGE(0x1ff000, 0x1ff000) AM_MIRROR(0xf9) AM_DEVREADWRITE(SAB1797_02P_TAG, fd1797_t, status_r, cmd_w)
475475   AM_RANGE(0x1ff002, 0x1ff002) AM_MIRROR(0xf9) AM_DEVREADWRITE(SAB1797_02P_TAG, fd1797_t, track_r, track_w)
shelves/new_menus/src/mess/mess.mak
r29303r29304
850850   $(MESS_MACHINE)/microdrv.o  \
851851   $(MESS_MACHINE)/smartmed.o  \
852852   $(MESS_MACHINE)/sonydriv.o  \
853   $(MESS_MACHINE)/teleprinter.o  \
853854   $(MESS_MACHINE)/z80bin.o    \
854855
855856#-------------------------------------------------
shelves/new_menus/src/mess/machine/trs80.c
r29303r29304
527527   m_fdc->dden_w(!BIT(data, 7));
528528
529529   /* CLEAR_LINE means to turn motors on */
530   floppy_mon_w(floppy_get_device(machine(), 0), (data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
531   floppy_mon_w(floppy_get_device(machine(), 1), (data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
532   floppy_mon_w(floppy_get_device(machine(), 2), (data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
533   floppy_mon_w(floppy_get_device(machine(), 3), (data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
530   floppy_get_device(machine(), 0)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
531   floppy_get_device(machine(), 1)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
532   floppy_get_device(machine(), 2)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
533   floppy_get_device(machine(), 3)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
534534}
535535
536536WRITE8_MEMBER( trs80_state::sys80_f8_w )
r29303r29304
781781
782782   if (drive > 3)
783783   {   /* Turn motors off */
784      floppy_mon_w(floppy_get_device(machine(), 0), ASSERT_LINE);
785      floppy_mon_w(floppy_get_device(machine(), 1), ASSERT_LINE);
786      floppy_mon_w(floppy_get_device(machine(), 2), ASSERT_LINE);
787      floppy_mon_w(floppy_get_device(machine(), 3), ASSERT_LINE);
784      floppy_get_device(machine(), 0)->floppy_mon_w(ASSERT_LINE);
785      floppy_get_device(machine(), 1)->floppy_mon_w(ASSERT_LINE);
786      floppy_get_device(machine(), 2)->floppy_mon_w(ASSERT_LINE);
787      floppy_get_device(machine(), 3)->floppy_mon_w(ASSERT_LINE);
788788      return;
789789   }
790790
r29303r29304
792792   m_fdc->set_side(m_head);
793793
794794   /* Turn motors on */
795   floppy_mon_w(floppy_get_device(machine(), 0), CLEAR_LINE);
796   floppy_mon_w(floppy_get_device(machine(), 1), CLEAR_LINE);
797   floppy_mon_w(floppy_get_device(machine(), 2), CLEAR_LINE);
798   floppy_mon_w(floppy_get_device(machine(), 3), CLEAR_LINE);
795   floppy_get_device(machine(), 0)->floppy_mon_w(CLEAR_LINE);
796   floppy_get_device(machine(), 1)->floppy_mon_w(CLEAR_LINE);
797   floppy_get_device(machine(), 2)->floppy_mon_w(CLEAR_LINE);
798   floppy_get_device(machine(), 3)->floppy_mon_w(CLEAR_LINE);
799799}
800800
801801/*************************************
shelves/new_menus/src/mess/machine/osborne1.c
r29303r29304
429429   memset( m_ram->pointer() + 0x10000, 0xFF, 0x1000 );
430430
431431   for(drive=0;drive<2;drive++)
432      floppy_install_load_proc(floppy_get_device(machine(), drive), osborne1_load_proc);
432      floppy_get_device(machine(), drive)->floppy_install_load_proc(osborne1_load_proc);
433433
434434   space.set_direct_update_handler(direct_update_delegate(FUNC(osborne1_state::osborne1_opbase), this));
435435}
shelves/new_menus/src/mess/machine/rmnimbus.c
r29303r29304
22742274   wd2793_device *fdc = machine().device<wd2793_device>(FDC_TAG);
22752275
22762276   int pc=space.device().safe_pc();
2277   device_t *drive = machine().device(nimbus_wd17xx_interface.floppy_drive_tags[FDC_DRIVE()]);
2277   legacy_floppy_image_device *drive = machine().device<legacy_floppy_image_device>(nimbus_wd17xx_interface.floppy_drive_tags[FDC_DRIVE()]);
22782278
22792279   switch(offset*2)
22802280   {
r29303r29304
22942294      case 0x10 :
22952295         m_nimbus_drives.reg410_in &= ~FDC_BITS_410;
22962296         m_nimbus_drives.reg410_in |= (FDC_MOTOR() ? FDC_MOTOR_MASKI : 0x00);
2297         m_nimbus_drives.reg410_in |= (floppy_drive_get_flag_state(drive, FLOPPY_DRIVE_INDEX) ? 0x00 : FDC_INDEX_MASK);
2298         m_nimbus_drives.reg410_in |= (floppy_drive_get_flag_state(drive, FLOPPY_DRIVE_READY) ? FDC_READY_MASK : 0x00);
2297         m_nimbus_drives.reg410_in |= (drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX) ? 0x00 : FDC_INDEX_MASK);
2298         m_nimbus_drives.reg410_in |= (drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) ? FDC_READY_MASK : 0x00);
22992299
23002300         // Flip inverted bits
23012301         result=m_nimbus_drives.reg410_in ^ INV_BITS_410;
shelves/new_menus/src/mess/machine/concept_exp.c
r29303r29304
243243         // floppy_drive_set_motor_state(floppy_get_device(machine(),  current_drive), (data & LC_MOTOROF_mask) == 0 ? 1 : 0);
244244         /*flp_8in = (data & LC_FLP8IN_mask) != 0;*/
245245         m_wd179x->dden_w(BIT(data, 7));
246         floppy_drive_set_ready_state(floppy_get_device(machine(), current_drive), 1, 0);
246         floppy_get_device(machine(), current_drive)->floppy_drive_set_ready_state(1, 0);
247247         break;
248248
249249      case  8:    // FDC COMMAMD REG
shelves/new_menus/src/mess/machine/beta.c
r29303r29304
158158      }
159159      // bit 3 connected to pin 23 "HRDY" of FDC
160160      // TEMP HACK, FDD motor and RDY FDC pin controlled by HLD pin of FDC
161      device_t *flop = subdevice(beta_wd17xx_interface.floppy_drive_tags[data & 3]);
162      floppy_mon_w(flop, CLEAR_LINE);
163      floppy_drive_set_ready_state(flop, 1, 0);
161      legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(beta_wd17xx_interface.floppy_drive_tags[data & 3]);
162      flop->floppy_mon_w(CLEAR_LINE);
163      flop->floppy_drive_set_ready_state(1, 0);
164164   }
165165}
166166
shelves/new_menus/src/mess/machine/ti99/990_dk.c
r29303r29304
1616#include "emu.h"
1717
1818#include "formats/basicdsk.h"
19#include "imagedev/flopdrv.h"
2019#include "990_dk.h"
2120
2221/* status bits */
r29303r29304
110109
111110   /*while (revolution_count < 2)*/
112111   /*{*/
113      if (floppy_drive_get_next_id(&m_drv[unit].img->device(), head, &id))
112      if (m_drv[unit].img->floppy_drive_get_next_id(head, &id))
114113      {
115114         if (cylinder_id)
116115            *cylinder_id = id.C;
r29303r29304
142141
143142   while (revolution_count < 2)
144143   {
145      if (floppy_drive_get_next_id(&m_drv[unit].img->device(), head, &id))
144      if (m_drv[unit].img->floppy_drive_get_next_id(head, &id))
146145      {
147146         /* compare id */
148147         if ((id.R == sector) && (id.N == 0))
r29303r29304
199198   }
200199   for (retries=0; retries<10; retries++)
201200   {   /* seek to requested track */
202      floppy_drive_seek(&m_drv[unit].img->device(), cylinder-m_drv[unit].log_cylinder[head]);
201      m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].log_cylinder[head]);
203202      /* update physical track position */
204203      if (m_drv[unit].phys_cylinder != -1)
205204         m_drv[unit].phys_cylinder += cylinder-m_drv[unit].log_cylinder[head];
r29303r29304
241240   }
242241
243242   /* limit iterations to 76 to prevent an endless loop if the disc is locked */
244   while (!(seek_complete = !floppy_tk00_r(&m_drv[unit].img->device())) && (seek_count < 76))
243   while (!(seek_complete = !m_drv[unit].img->floppy_tk00_r()) && (seek_count < 76))
245244   {
246      floppy_drive_seek(&m_drv[unit].img->device(), -1);
245      m_drv[unit].img->floppy_drive_seek(-1);
247246      seek_count++;
248247   }
249248   if (! seek_complete)
r29303r29304
279278      return;
280279   }
281280
282   floppy_drive_read_sector_data(&m_drv[m_unit].img->device(), m_head, data_id, m_buf, 128);
281   m_drv[m_unit].img->floppy_drive_read_sector_data(m_head, data_id, m_buf, 128);
283282   m_buf_pos = 0;
284283   m_buf_mode = bm_read;
285284   m_recv_buf = (m_buf[m_buf_pos<<1] << 8) | m_buf[(m_buf_pos<<1)+1];
r29303r29304
305304      return;
306305   }
307306
308   floppy_drive_write_sector_data(&m_drv[m_unit].img->device(), m_head, data_id, m_buf, 128, m_ddam);
307   m_drv[m_unit].img->floppy_drive_write_sector_data(m_head, data_id, m_buf, 128, m_ddam);
309308   m_buf_pos = 0;
310309   m_buf_mode = bm_write;
311310
r29303r29304
587586      }
588587      else if ((m_drv[unit].phys_cylinder != -1) || (!do_restore(unit)))
589588      {
590         floppy_drive_seek(&m_drv[unit].img->device(), cylinder-m_drv[unit].phys_cylinder);
589         m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].phys_cylinder);
591590         m_stat_reg |= status_OP_complete;
592591      }
593592
r29303r29304
871870
872871   for (int i=0; i<MAX_FLOPPIES; i++)
873872   {
874      m_drv[i].img = dynamic_cast<device_image_interface *>(floppy_get_device(machine(), i));
873      m_drv[i].img = floppy_get_device(machine(), i);
875874      m_drv[i].phys_cylinder = -1;
876875      m_drv[i].log_cylinder[0] = m_drv[i].log_cylinder[1] = -1;
877876      m_drv[i].seclen = 64;
shelves/new_menus/src/mess/machine/ti99/990_dk.h
r29303r29304
55#ifndef __990_DK__
66#define __990_DK__
77
8#include "imagedev/flopdrv.h"
9
810extern const device_type FD800;
911
1012#define MAX_FLOPPIES 4
r29303r29304
5759
5860   struct
5961   {
60      device_image_interface *img;
62      legacy_floppy_image_device *img;
6163      int phys_cylinder;
6264      int log_cylinder[2];
6365      int seclen;
shelves/new_menus/src/mess/machine/atarifdc.c
r29303r29304
1616#include "atarifdc.h"
1717#include "sound/pokey.h"
1818#include "machine/6821pia.h"
19#include "imagedev/flopdrv.h"
2019#include "formats/atari_dsk.h"
2120
2221#define VERBOSE_SERIAL  0
r29303r29304
746745   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(atari_floppy_interface)
747746MACHINE_CONFIG_END
748747
749device_t *atari_fdc_device::atari_floppy_get_device_child(int drive)
748legacy_floppy_image_device *atari_fdc_device::atari_floppy_get_device_child(int drive)
750749{
751750   switch(drive) {
752      case 0 : return subdevice(FLOPPY_0);
753      case 1 : return subdevice(FLOPPY_1);
754      case 2 : return subdevice(FLOPPY_2);
755      case 3 : return subdevice(FLOPPY_3);
751      case 0 : return subdevice<legacy_floppy_image_device>(FLOPPY_0);
752      case 1 : return subdevice<legacy_floppy_image_device>(FLOPPY_1);
753      case 2 : return subdevice<legacy_floppy_image_device>(FLOPPY_2);
754      case 3 : return subdevice<legacy_floppy_image_device>(FLOPPY_3);
756755   }
757756   return NULL;
758757}
r29303r29304
786785
787786   for(id=0;id<4;id++)
788787   {
789      floppy_install_load_proc(atari_floppy_get_device_child(id), _atari_load_proc);
788      atari_floppy_get_device_child(id)->floppy_install_load_proc(_atari_load_proc);
790789   }
791790}
792791
shelves/new_menus/src/mess/machine/atarifdc.h
r29303r29304
66#ifndef _ATARIFDC_H
77#define _ATARIFDC_H
88
9#include "imagedev/flopdrv.h"
10
911class atari_fdc_device : public device_t
1012{
1113public:
r29303r29304
2830   void add_serin(UINT8 data, int with_checksum);
2931   void a800_serial_command();
3032   void a800_serial_write();
31   device_t *atari_floppy_get_device_child(int drive);
33   legacy_floppy_image_device *atari_floppy_get_device_child(int drive);
3234
3335   struct atari_drive
3436   {
shelves/new_menus/src/mess/machine/megacd.c
r29303r29304
11#include "emu.h"
2#include "mcfglgcy.h"
32#include "machine/megacd.h"
43#include "machine/nvram.h"
54#include "megacd.lh"
r29303r29304
317316
318317   MCFG_DEFAULT_LAYOUT( layout_megacd )
319318
320
321319   MCFG_RF5C68_ADD("rfsnd", SEGACD_CLOCK) // RF5C164!
322320   MCFG_SOUND_ROUTE( 0, ":lspeaker", 0.50 )
323321   MCFG_SOUND_ROUTE( 1, ":rspeaker", 0.50 )
324322
325
326   MCFG_NVRAM_HANDLER_CLEAR()
327323   MCFG_NVRAM_ADD_0FILL("backupram")
328324
329325   MCFG_QUANTUM_PERFECT_CPU("segacd_68k") // perfect sync to the fastest cpu
shelves/new_menus/src/mess/machine/svi318.c
r29303r29304
564564
565565   for(drive=0;drive<2;drive++)
566566   {
567      floppy_install_load_proc(floppy_get_device(machine(), drive), svi318_load_proc);
567      floppy_get_device(machine(), drive)->floppy_install_load_proc(svi318_load_proc);
568568   }
569569}
570570
shelves/new_menus/src/mess/machine/partner.c
r29303r29304
100100         default   : m_fdc->data_w(space, 0,data);break;
101101      }
102102   } else {
103      floppy_mon_w(floppy_get_device(machine(), 0), 1);
104      floppy_mon_w(floppy_get_device(machine(), 1), 1);
103      floppy_get_device(machine(), 0)->floppy_mon_w(1);
104      floppy_get_device(machine(), 1)->floppy_mon_w(1);
105105      if (((data >> 6) & 1)==1) {
106106         m_fdc->set_drive(0);
107         floppy_mon_w(floppy_get_device(machine(), 0), 0);
108         floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1, 1);
107         floppy_get_device(machine(), 0)->floppy_mon_w(0);
108         floppy_get_device(machine(), 0)->floppy_drive_set_ready_state(1, 1);
109109      }
110110      if (((data >> 3) & 1)==1) {
111111         m_fdc->set_drive(1);
112         floppy_mon_w(floppy_get_device(machine(), 1), 0);
113         floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1, 1);
112         floppy_get_device(machine(), 1)->floppy_mon_w(0);
113         floppy_get_device(machine(), 1)->floppy_drive_set_ready_state(1, 1);
114114      }
115115      m_fdc->set_side(data >> 7);
116116   }
shelves/new_menus/src/mess/machine/appldriv.c
r29303r29304
2727
2828static int apple525_enable_mask = 1;
2929
30device_t *apple525_get_subdevice(device_t *device, int drive)
30legacy_floppy_image_device *apple525_get_subdevice(device_t *device, int drive)
3131{
3232   switch(drive) {
33      case 0 : return device->subdevice(PARENT_FLOPPY_0);
34      case 1 : return device->subdevice(PARENT_FLOPPY_1);
35      case 2 : return device->subdevice(PARENT_FLOPPY_2);
36      case 3 : return device->subdevice(PARENT_FLOPPY_3);
33      case 0 : return device->subdevice<legacy_floppy_image_device>(PARENT_FLOPPY_0);
34      case 1 : return device->subdevice<legacy_floppy_image_device>(PARENT_FLOPPY_1);
35      case 2 : return device->subdevice<legacy_floppy_image_device>(PARENT_FLOPPY_2);
36      case 3 : return device->subdevice<legacy_floppy_image_device>(PARENT_FLOPPY_3);
3737   }
3838   return NULL;
3939}
r29303r29304
4343   int i;
4444   int cnt = 0;
4545   for (i=0;i<4;i++) {
46      device_t *disk = apple525_get_subdevice(device, i);
47      if (floppy_get_drive_type(disk)==ftype) {
46      legacy_floppy_image_device *disk = apple525_get_subdevice(device, i);
47      if (disk->floppy_get_drive_type()==ftype) {
4848         if (cnt==drive) {
4949            return disk;
5050         }
r29303r29304
6969   disk = get_device(image);
7070   len = sizeof(disk->track_data);
7171
72   floppy_drive_read_track_data_info_buffer(image, 0, disk->track_data, &len);
72   disk->floppy_drive_read_track_data_info_buffer(0, disk->track_data, &len);
7373   disk->track_loaded = 1;
7474   disk->track_dirty = 0;
7575}
r29303r29304
8484   if (disk->track_dirty)
8585   {
8686      len = sizeof(disk->track_data);
87      floppy_drive_write_track_data_info_buffer(image, 0, disk->track_data, &len);
87      disk->floppy_drive_write_track_data_info_buffer(0, disk->track_data, &len);
8888      disk->track_dirty = 0;
8989   }
9090   if (unload)
9191      disk->track_loaded = 0;
9292}
9393
94static void apple525_seek_disk(device_t *img, signed int step)
94static void apple525_seek_disk(apple525_floppy_image_device *img, signed int step)
9595{
9696   int track;
9797   int pseudo_track;
r29303r29304
101101
102102   apple525_save_current_track(img, FALSE);
103103
104   track = floppy_drive_get_current_track(img);
104   track = img->floppy_drive_get_current_track();
105105   pseudo_track = (track * 2) + disk->tween_tracks;
106106
107107   pseudo_track += step;
r29303r29304
112112
113113   if (pseudo_track/2 != track)
114114   {
115      floppy_drive_seek(img, pseudo_track/2 - floppy_drive_get_current_track(img));
115      img->floppy_drive_seek(pseudo_track/2 - img->floppy_drive_get_current_track());
116116      disk->track_loaded = 0;
117117   }
118118
r29303r29304
144144         case 8: phase = 3; break;
145145      }
146146
147      phase -= floppy_drive_get_current_track(image) * 2;
147      phase -= cur_disk->floppy_drive_get_current_track() * 2;
148148      if (cur_disk->tween_tracks)
149149         phase--;
150150      phase %= 4;
r29303r29304
152152      switch(phase)
153153      {
154154         case 1:
155            apple525_seek_disk(image, +1);
155            apple525_seek_disk(cur_disk, +1);
156156            break;
157157         case 3:
158            apple525_seek_disk(image, -1);
158            apple525_seek_disk(cur_disk, -1);
159159            break;
160160      }
161161   }
r29303r29304
164164int apple525_get_count(device_t *device)
165165{
166166   int cnt = 0;
167   if ((device->subdevice("^"FLOPPY_0)!=NULL) && (floppy_get_drive_type(device->subdevice("^"FLOPPY_0)) == FLOPPY_TYPE_APPLE) && (get_device(device->subdevice(PARENT_FLOPPY_0))!=NULL)) cnt++;
168   if ((device->subdevice("^"FLOPPY_1)!=NULL) && (floppy_get_drive_type(device->subdevice("^"FLOPPY_1)) == FLOPPY_TYPE_APPLE) && (get_device(device->subdevice(PARENT_FLOPPY_1))!=NULL)) cnt++;
169   if ((device->subdevice("^"FLOPPY_2)!=NULL) && (floppy_get_drive_type(device->subdevice("^"FLOPPY_2)) == FLOPPY_TYPE_APPLE) && (get_device(device->subdevice(PARENT_FLOPPY_2))!=NULL)) cnt++;
170   if ((device->subdevice("^"FLOPPY_3)!=NULL) && (floppy_get_drive_type(device->subdevice("^"FLOPPY_3)) == FLOPPY_TYPE_APPLE) && (get_device(device->subdevice(PARENT_FLOPPY_3))!=NULL)) cnt++;
167   if ((device->subdevice("^"FLOPPY_0)!=NULL) && (device->subdevice<legacy_floppy_image_device>("^"FLOPPY_0)->floppy_get_drive_type() == FLOPPY_TYPE_APPLE) && (get_device(device->subdevice(PARENT_FLOPPY_0))!=NULL)) cnt++;
168   if ((device->subdevice("^"FLOPPY_1)!=NULL) && (device->subdevice<legacy_floppy_image_device>("^"FLOPPY_1)->floppy_get_drive_type() == FLOPPY_TYPE_APPLE) && (get_device(device->subdevice(PARENT_FLOPPY_1))!=NULL)) cnt++;
169   if ((device->subdevice("^"FLOPPY_2)!=NULL) && (device->subdevice<legacy_floppy_image_device>("^"FLOPPY_2)->floppy_get_drive_type() == FLOPPY_TYPE_APPLE) && (get_device(device->subdevice(PARENT_FLOPPY_2))!=NULL)) cnt++;
170   if ((device->subdevice("^"FLOPPY_3)!=NULL) && (device->subdevice<legacy_floppy_image_device>("^"FLOPPY_3)->floppy_get_drive_type() == FLOPPY_TYPE_APPLE) && (get_device(device->subdevice(PARENT_FLOPPY_3))!=NULL)) cnt++;
171171
172172   return cnt;
173173}
r29303r29304
307307void apple525_floppy_image_device::device_start()
308308{
309309   legacy_floppy_image_device::device_start();
310   floppy_set_type(this,FLOPPY_TYPE_APPLE);
310   floppy_set_type(FLOPPY_TYPE_APPLE);
311311
312312   state = 0;
313313   tween_tracks = 0;
r29303r29304
321321bool apple525_floppy_image_device::call_load()
322322{
323323   int result = legacy_floppy_image_device::call_load();
324   floppy_drive_seek(*this, -999);
325   floppy_drive_seek(*this, +35/2);
324   floppy_drive_seek(-999);
325   floppy_drive_seek(+35/2);
326326   return result;
327327}
328328
shelves/new_menus/src/mess/machine/pk8020.c
r29303r29304
840840WRITE8_MEMBER(pk8020_state::pk8020_portb_w)
841841{
842842   // Turn all motors off
843   floppy_mon_w(floppy_get_device(machine(), 0), 1);
844   floppy_mon_w(floppy_get_device(machine(), 1), 1);
845   floppy_mon_w(floppy_get_device(machine(), 2), 1);
846   floppy_mon_w(floppy_get_device(machine(), 3), 1);
843   floppy_get_device(machine(), 0)->floppy_mon_w(1);
844   floppy_get_device(machine(), 1)->floppy_mon_w(1);
845   floppy_get_device(machine(), 2)->floppy_mon_w(1);
846   floppy_get_device(machine(), 3)->floppy_mon_w(1);
847847   m_wd1793->set_side(BIT(data,4));
848848   if (BIT(data,0)) {
849849      m_wd1793->set_drive(0);
850      floppy_mon_w(floppy_get_device(machine(), 0), 0);
851      floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1, 1);
850      floppy_get_device(machine(), 0)->floppy_mon_w(0);
851      floppy_get_device(machine(), 0)->floppy_drive_set_ready_state(1, 1);
852852   } else if (BIT(data,1)) {
853853      m_wd1793->set_drive(1);
854      floppy_mon_w(floppy_get_device(machine(), 1), 0);
855      floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1, 1);
854      floppy_get_device(machine(), 1)->floppy_mon_w(0);
855      floppy_get_device(machine(), 1)->floppy_drive_set_ready_state(1, 1);
856856   } else if (BIT(data,2)) {
857857      m_wd1793->set_drive(2);
858      floppy_mon_w(floppy_get_device(machine(), 2), 0);
859      floppy_drive_set_ready_state(floppy_get_device(machine(), 2), 1, 1);
858      floppy_get_device(machine(), 2)->floppy_mon_w(0);
859      floppy_get_device(machine(), 2)->floppy_drive_set_ready_state(1, 1);
860860   } else if (BIT(data,3)) {
861861      m_wd1793->set_drive(3);
862      floppy_mon_w(floppy_get_device(machine(), 3), 0);
863      floppy_drive_set_ready_state(floppy_get_device(machine(), 3), 1, 1);
862      floppy_get_device(machine(), 3)->floppy_mon_w(0);
863      floppy_get_device(machine(), 3)->floppy_drive_set_ready_state(1, 1);
864864   }
865865}
866866
shelves/new_menus/src/mess/machine/hec2hrp.c
r29303r29304
107107   fdc->dden_w(1);// density select => always 1 (0 ?a plante !)
108108
109109   /* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */
110   floppy_mon_w(floppy_get_device(machine(), 0), 0); // Moteur floppy A:
111   //floppy_mon_w(floppy_get_device(space.machine(), 1), BIT(data, 7));   // Moteur floppy B:, not implanted on the real machine
110   floppy_get_device(machine(), 0)->floppy_mon_w( 0); // Moteur floppy A:
111   //floppy_get_device(machine(), 1)->floppy_mon_w(BIT(data, 7));   // Moteur floppy B:, not implanted on the real machine
112112
113113   //Set the drive ready !
114   floppy_drive_set_ready_state(floppy_get_device(machine(), 0), FLOPPY_DRIVE_READY, 0);// Disc 0 ready !
114   floppy_get_device(machine(), 0)->floppy_drive_set_ready_state(FLOPPY_DRIVE_READY, 0);// Disc 0 ready !
115115
116116}
117117
shelves/new_menus/src/mess/machine/teleprinter.c
r0r29304
1#include "teleprinter.h"
2
3#define KEYBOARD_TAG "keyboard"
4
5static const UINT8 teleprinter_font[128*8] =
6{
7   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8   0x07,0x07,0x07,0x07,0x00,0x00,0x00,0x00,
9   0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00,
10   0x3f,0x3f,0x3f,0x3f,0x00,0x00,0x00,0x00,
11   0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,
12   0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
13   0x38,0x38,0x38,0x38,0x07,0x07,0x07,0x07,
14   0x3f,0x3f,0x3f,0x3f,0x07,0x07,0x07,0x07,
15   0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x38,
16   0x07,0x07,0x07,0x07,0x38,0x38,0x38,0x38,
17   0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
18   0x3f,0x3f,0x3f,0x3f,0x38,0x38,0x38,0x38,
19   0x00,0x00,0x00,0x00,0x3f,0x3f,0x3f,0x3f,
20   0x07,0x07,0x07,0x07,0x3f,0x3f,0x3f,0x3f,
21   0x38,0x38,0x38,0x38,0x3f,0x3f,0x3f,0x3f,
22   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
23   0x00,0x00,0x00,0x00,0x2a,0x15,0x2a,0x15,
24   0x2a,0x15,0x2a,0x15,0x00,0x00,0x00,0x00,
25   0x3f,0x3f,0x3f,0x3f,0x2a,0x15,0x2a,0x15,
26   0x2a,0x15,0x2a,0x15,0x3f,0x3f,0x3f,0x3f,
27   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
28   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
29   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
30   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
31   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
32   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
33   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
34   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
35   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
36   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
37   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
38   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
39   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
40   0x08,0x08,0x08,0x08,0x08,0x00,0x08,0x00,
41   0x14,0x14,0x14,0x00,0x00,0x00,0x00,0x00,
42   0x14,0x14,0x3e,0x14,0x3e,0x14,0x14,0x00,
43   0x08,0x3c,0x0a,0x1c,0x28,0x1e,0x08,0x00,
44   0x06,0x26,0x10,0x08,0x04,0x32,0x30,0x00,
45   0x08,0x14,0x14,0x0c,0x2a,0x12,0x2c,0x00,
46   0x08,0x08,0x04,0x00,0x00,0x00,0x00,0x00,
47   0x10,0x08,0x04,0x04,0x04,0x08,0x10,0x00,
48   0x04,0x08,0x10,0x10,0x10,0x08,0x04,0x00,
49   0x00,0x08,0x2a,0x1c,0x2a,0x08,0x00,0x00,
50   0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,
51   0x00,0x00,0x00,0x00,0x08,0x08,0x04,0x00,
52   0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,
53   0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,
54   0x00,0x20,0x10,0x08,0x04,0x02,0x00,0x00,
55   0x1c,0x22,0x32,0x2a,0x26,0x22,0x1c,0x00,
56   0x08,0x0c,0x08,0x08,0x08,0x08,0x1c,0x00,
57   0x1c,0x22,0x20,0x18,0x04,0x02,0x3e,0x00,
58   0x3e,0x20,0x10,0x18,0x20,0x22,0x1c,0x00,
59   0x10,0x18,0x14,0x12,0x3e,0x10,0x10,0x00,
60   0x3e,0x02,0x1e,0x20,0x20,0x22,0x1c,0x00,
61   0x10,0x08,0x04,0x1c,0x22,0x22,0x1c,0x00,
62   0x3e,0x20,0x10,0x08,0x04,0x04,0x04,0x00,
63   0x1c,0x22,0x22,0x1c,0x22,0x22,0x1c,0x00,
64   0x1c,0x22,0x22,0x1c,0x10,0x08,0x04,0x00,
65   0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x00,
66   0x00,0x00,0x08,0x00,0x08,0x08,0x04,0x00,
67   0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x00,
68   0x00,0x00,0x3e,0x00,0x3e,0x00,0x00,0x00,
69   0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x00,
70   0x1c,0x22,0x20,0x10,0x08,0x00,0x08,0x00,
71   0x1c,0x22,0x32,0x2a,0x3a,0x02,0x3c,0x00,
72   0x08,0x14,0x22,0x22,0x3e,0x22,0x22,0x00,
73   0x1e,0x22,0x22,0x1e,0x22,0x22,0x1e,0x00,
74   0x1c,0x22,0x02,0x02,0x02,0x22,0x1c,0x00,
75   0x1e,0x24,0x24,0x24,0x24,0x24,0x1e,0x00,
76   0x3e,0x02,0x02,0x1e,0x02,0x02,0x3e,0x00,
77   0x3e,0x02,0x02,0x1e,0x02,0x02,0x02,0x00,
78   0x1c,0x22,0x02,0x02,0x32,0x22,0x3c,0x00,
79   0x22,0x22,0x22,0x3e,0x22,0x22,0x22,0x00,
80   0x1c,0x08,0x08,0x08,0x08,0x08,0x1c,0x00,
81   0x38,0x10,0x10,0x10,0x10,0x12,0x0c,0x00,
82   0x22,0x12,0x0a,0x06,0x0a,0x12,0x22,0x00,
83   0x02,0x02,0x02,0x02,0x02,0x02,0x3e,0x00,
84   0x22,0x36,0x2a,0x2a,0x22,0x22,0x22,0x00,
85   0x22,0x22,0x26,0x2a,0x32,0x22,0x22,0x00,
86   0x1c,0x22,0x22,0x22,0x22,0x22,0x1c,0x00,
87   0x1e,0x22,0x22,0x1e,0x02,0x02,0x02,0x00,
88   0x1c,0x22,0x22,0x22,0x2a,0x12,0x2c,0x00,
89   0x1e,0x22,0x22,0x1e,0x0a,0x12,0x22,0x00,
90   0x1c,0x22,0x02,0x1c,0x20,0x22,0x1c,0x00,
91   0x3e,0x08,0x08,0x08,0x08,0x08,0x08,0x00,
92   0x22,0x22,0x22,0x22,0x22,0x22,0x1c,0x00,
93   0x22,0x22,0x22,0x14,0x14,0x08,0x08,0x00,
94   0x22,0x22,0x22,0x2a,0x2a,0x2a,0x14,0x00,
95   0x22,0x22,0x14,0x08,0x14,0x22,0x22,0x00,
96   0x22,0x22,0x22,0x14,0x08,0x08,0x08,0x00,
97   0x3e,0x20,0x10,0x08,0x04,0x02,0x3e,0x00,
98   0x0e,0x02,0x02,0x02,0x02,0x02,0x0e,0x00,
99   0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x00,
100   0x38,0x20,0x20,0x20,0x20,0x20,0x38,0x00,
101   0x08,0x1c,0x2a,0x08,0x08,0x08,0x08,0x00,
102   0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,
103   0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
104   0x00,0x00,0x1c,0x20,0x3c,0x22,0x3c,0x00,
105   0x02,0x02,0x1e,0x22,0x22,0x22,0x1e,0x00,
106   0x00,0x00,0x3c,0x02,0x02,0x02,0x3c,0x00,
107   0x20,0x20,0x3c,0x22,0x22,0x22,0x3c,0x00,
108   0x00,0x00,0x1c,0x22,0x3e,0x02,0x1c,0x00,
109   0x18,0x04,0x0e,0x04,0x04,0x04,0x04,0x00,
110   0x00,0x00,0x3c,0x22,0x22,0x3c,0x20,0x18,
111   0x02,0x02,0x1e,0x22,0x22,0x22,0x22,0x00,
112   0x08,0x00,0x0c,0x08,0x08,0x08,0x1c,0x00,
113   0x10,0x00,0x18,0x10,0x10,0x10,0x12,0x0c,
114   0x02,0x02,0x22,0x12,0x0e,0x16,0x22,0x00,
115   0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x00,
116   0x00,0x00,0x16,0x2a,0x2a,0x2a,0x2a,0x00,
117   0x00,0x00,0x1a,0x26,0x22,0x22,0x22,0x00,
118   0x00,0x00,0x1c,0x22,0x22,0x22,0x1c,0x00,
119   0x00,0x00,0x1e,0x22,0x22,0x1e,0x02,0x02,
120   0x00,0x00,0x3c,0x22,0x22,0x3c,0x20,0x20,
121   0x00,0x00,0x34,0x0c,0x04,0x04,0x04,0x00,
122   0x00,0x00,0x3c,0x02,0x1c,0x20,0x1e,0x00,
123   0x08,0x08,0x1c,0x08,0x08,0x08,0x10,0x00,
124   0x00,0x00,0x22,0x22,0x22,0x32,0x2c,0x00,
125   0x00,0x00,0x22,0x22,0x22,0x14,0x08,0x00,
126   0x00,0x00,0x22,0x22,0x2a,0x2a,0x14,0x00,
127   0x00,0x00,0x22,0x14,0x08,0x14,0x22,0x00,
128   0x00,0x00,0x22,0x22,0x14,0x08,0x04,0x02,
129   0x00,0x00,0x3e,0x10,0x08,0x04,0x3e,0x00,
130   0x10,0x08,0x08,0x04,0x08,0x08,0x10,0x00,
131   0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,
132   0x04,0x08,0x08,0x10,0x08,0x08,0x04,0x00,
133   0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
134   0x2a,0x15,0x2a,0x15,0x2a,0x15,0x2a,0x15
135};
136
137teleprinter_device::teleprinter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
138   : generic_terminal_device(mconfig, TELEPRINTER, "Teleprinter", tag, owner, clock, "teleprinter", __FILE__)
139{
140}
141
142void teleprinter_device::scroll_line()
143{
144   memmove(m_buffer,m_buffer+TELEPRINTER_WIDTH,(TELEPRINTER_HEIGHT-1)*TELEPRINTER_WIDTH);
145   memset(m_buffer + TELEPRINTER_WIDTH*(TELEPRINTER_HEIGHT-1),0x20,TELEPRINTER_WIDTH);
146}
147
148void teleprinter_device::write_char(UINT8 data) {
149   m_buffer[(TELEPRINTER_HEIGHT-1)*TELEPRINTER_WIDTH+m_x_pos] = data;
150   m_x_pos++;
151   if (m_x_pos >= TELEPRINTER_WIDTH)
152   {
153      m_x_pos = 0;
154      scroll_line();
155   }
156}
157
158void teleprinter_device::clear() {
159   memset(m_buffer,0,TELEPRINTER_WIDTH*TELEPRINTER_HEIGHT);
160   m_x_pos = 0;
161}
162
163void teleprinter_device::term_write(UINT8 data)
164{
165   switch(data) {
166      case 10: m_x_pos = 0;
167            scroll_line();
168            break;
169      case 13: m_x_pos = 0; break;
170      case  9: m_x_pos = (m_x_pos & 0xf8) + 8;
171            if (m_x_pos >= TELEPRINTER_WIDTH)
172               m_x_pos = TELEPRINTER_WIDTH-1;
173
174            break;
175      case 16: break;
176      default: write_char(data); break;
177   }
178}
179
180/***************************************************************************
181    VIDEO HARDWARE
182***************************************************************************/
183UINT32 teleprinter_device::tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect)
184{
185   UINT8 code;
186   int y, c, x, b;
187
188   for (y = 0; y < TELEPRINTER_HEIGHT; y++)
189   {
190      for (c = 0; c < 8; c++)
191      {
192         int horpos = 0;
193         for (x = 0; x < TELEPRINTER_WIDTH; x++)
194         {
195            code = teleprinter_font[(m_buffer[y*TELEPRINTER_WIDTH + x]  & 0x7f) *8 + c];
196            for (b = 0; b < 8; b++)
197            {
198               bitmap.pix32(y*8 + c, horpos++) =  (code >> b) & 0x01 ? 0 : 0x00ffffff;
199            }
200         }
201      }
202   }
203   return 0;
204}
205
206static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
207{
208   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, generic_terminal_device, kbd_put)
209};
210
211/***************************************************************************
212    VIDEO HARDWARE
213***************************************************************************/
214MACHINE_CONFIG_FRAGMENT( generic_teleprinter )
215   MCFG_SCREEN_ADD(TELEPRINTER_SCREEN_TAG, RASTER)
216   MCFG_SCREEN_REFRESH_RATE(50)
217   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
218   MCFG_SCREEN_SIZE(TELEPRINTER_WIDTH*8, TELEPRINTER_HEIGHT*8)
219   MCFG_SCREEN_VISIBLE_AREA(0, TELEPRINTER_WIDTH*8-1, 0, TELEPRINTER_HEIGHT*8-1)
220   MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, teleprinter_device, tp_update)
221   MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
222MACHINE_CONFIG_END
223
224machine_config_constructor teleprinter_device::device_mconfig_additions() const
225{
226   return MACHINE_CONFIG_NAME(generic_teleprinter);
227}
228
229/*-------------------------------------------------
230    device_reset - device-specific reset
231-------------------------------------------------*/
232
233void teleprinter_device::device_reset()
234{
235   clear();
236   generic_terminal_device::device_reset();
237}
238
239const device_type TELEPRINTER = &device_creator<teleprinter_device>;
Property changes on: shelves/new_menus/src/mess/machine/teleprinter.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
shelves/new_menus/src/mess/machine/teleprinter.h
r0r29304
1#ifndef __TELEPRINTER_H__
2#define __TELEPRINTER_H__
3
4#include "machine/terminal.h"
5
6#define TELEPRINTER_WIDTH 80
7#define TELEPRINTER_HEIGHT 50
8
9#define GENERIC_TELEPRINTER_INTERFACE GENERIC_TERMINAL_INTERFACE
10
11/***************************************************************************
12    DEVICE CONFIGURATION MACROS
13***************************************************************************/
14#define TELEPRINTER_TAG "teleprinter"
15#define TELEPRINTER_SCREEN_TAG "tty_screen"
16
17#define MCFG_GENERIC_TELEPRINTER_ADD(_tag, _intrf) \
18   MCFG_DEVICE_ADD(_tag, TELEPRINTER, 0) \
19   MCFG_DEVICE_CONFIG(_intrf)
20
21#define MCFG_GENERIC_TELEPRINTER_REMOVE(_tag)       \
22   MCFG_DEVICE_REMOVE(_tag)
23
24/***************************************************************************
25    FUNCTION PROTOTYPES
26***************************************************************************/
27
28class teleprinter_device : public generic_terminal_device
29{
30public:
31   teleprinter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   UINT32 tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect);
33protected:
34   virtual void term_write(UINT8 data);
35   virtual void device_reset();
36   virtual machine_config_constructor device_mconfig_additions() const;
37private:
38   void scroll_line();
39   void write_char(UINT8 data);
40   void clear();
41};
42
43extern const device_type TELEPRINTER;
44
45#endif /* __TELEPRINTER_H__ */
Property changes on: shelves/new_menus/src/mess/machine/teleprinter.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
shelves/new_menus/src/mess/machine/nes.c
r29303r29304
962962   m_fds_ram = auto_alloc_array_clear(machine(), UINT8, 0x8000);
963963   save_pointer(NAME(m_fds_ram), 0x8000);
964964
965   floppy_install_load_proc(floppy_get_device(machine(), 0), nes_load_proc);
966   floppy_install_unload_proc(floppy_get_device(machine(), 0), nes_unload_proc);
965   floppy_get_device(machine(), 0)->floppy_install_load_proc(nes_load_proc);
966   floppy_get_device(machine(), 0)->floppy_install_unload_proc(nes_unload_proc);
967967
968968   // setup alt input handlers for additional FC input devices
969969   address_space &space = machine().device<cpu_device>("maincpu")->space(AS_PROGRAM);
shelves/new_menus/src/mess/machine/swtpc09.c
r29303r29304
154154       case 0x0e:
155155          m_fdc->set_drive(0);
156156           // need to set drive ready as sw checks before doing anything
157          floppy_drive_set_ready_state(machine().device("floppy0"), 1,0);
157          machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
158158         break;
159159       case 0x0d:
160160          m_fdc->set_drive(1);
161          floppy_drive_set_ready_state(machine().device("floppy1"), 1,0);
161          machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
162162         break;
163163
164164       case 0x0b:
165165          m_fdc->set_drive(2);
166          floppy_drive_set_ready_state(machine().device("floppy2"), 1,0);
166          machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
167167           break;
168168
169169       case 0x07:
170170          m_fdc->set_drive(3);
171          floppy_drive_set_ready_state(machine().device("floppy3"), 1,0);
171          machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
172172           break;
173173
174174      default:
r29303r29304
422422       case 0x01:
423423          m_fdc->set_drive(0);
424424           // need to set drive ready as sw checks before doing anything
425          floppy_drive_set_ready_state(machine().device("floppy0"), 1,0);
425          machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
426426         break;
427427       case 0x02:
428428          m_fdc->set_drive(1);
429          floppy_drive_set_ready_state(machine().device("floppy1"), 1,0);
429          machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
430430         break;
431431
432432       case 0x04:
433433          m_fdc->set_drive(2);
434          floppy_drive_set_ready_state(machine().device("floppy2"), 1,0);
434          machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
435435           break;
436436
437437       case 0x08:
438438          m_fdc->set_drive(3);
439          floppy_drive_set_ready_state(machine().device("floppy3"), 1,0);
439          machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
440440           break;
441441
442442      default:
r29303r29304
476476       case 0x00:
477477          m_fdc->set_drive(0);
478478           // need to set drive ready as sw checks before doing anything
479          floppy_drive_set_ready_state(machine().device("floppy0"), 1,0);
479          machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
480480         break;
481481       case 0x01:
482482          m_fdc->set_drive(1);
483          floppy_drive_set_ready_state(machine().device("floppy1"), 1,0);
483          machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
484484         break;
485485
486486       case 0x02:
487487          m_fdc->set_drive(2);
488          floppy_drive_set_ready_state(machine().device("floppy2"), 1,0);
488          machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
489489           break;
490490
491491       case 0x03:
492492          m_fdc->set_drive(3);
493          floppy_drive_set_ready_state(machine().device("floppy3"), 1,0);
493          machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
494494           break;
495495
496496      default:
shelves/new_menus/src/mess/machine/micropolis.c
r29303r29304
2828
2929
3030#include "emu.h"
31#include "imagedev/flopdrv.h"
3231#include "machine/micropolis.h"
3332
3433
r29303r29304
162161   {
163162      if(m_floppy_drive_tags[i])
164163      {
165         device_t *img = NULL;
164         legacy_floppy_image_device *img = NULL;
166165
167         img = siblingdevice(m_floppy_drive_tags[i]);
166         img = siblingdevice<legacy_floppy_image_device>(m_floppy_drive_tags[i]);
168167
169168         if (img)
170169         {
171            floppy_drive_set_controller(img, this);
172            //floppy_drive_set_index_pulse_callback(img, wd17xx_index_pulse_callback);
173            floppy_drive_set_rpm( img, 300.);
170            img->floppy_drive_set_controller(this);
171            //img->floppy_drive_set_index_pulse_callback( wd17xx_index_pulse_callback);
172            img->floppy_drive_set_rpm( 300.);
174173         }
175174      }
176175   }
r29303r29304
197196   m_data_count = m_sector_length;
198197
199198   /* read data */
200   floppy_drive_read_sector_data(m_drive, 0, m_sector, (char *)m_buffer, m_sector_length);
199   m_drive->floppy_drive_read_sector_data(0, m_sector, (char *)m_buffer, m_sector_length);
201200}
202201
203202
r29303r29304
213212   m_data_count = m_sector_length;
214213
215214   /* write data */
216   floppy_drive_write_sector_data(m_drive, 0, m_sector, (char *)m_buffer, m_sector_length, m_write_cmd & 0x01);
215   m_drive->floppy_drive_write_sector_data(0, m_sector, (char *)m_buffer, m_sector_length, m_write_cmd & 0x01);
217216#endif
218217}
219218
r29303r29304
231230      logerror("micropolis_set_drive: $%02x\n", drive);
232231
233232   if (m_floppy_drive_tags[drive])
234      m_drive = siblingdevice(m_floppy_drive_tags[drive]);
233      m_drive = siblingdevice<legacy_floppy_image_device>(m_floppy_drive_tags[drive]);
235234}
236235
237236
r29303r29304
287286   {
288287   case 1:
289288      m_drive_num = data & 3;
290      floppy_mon_w(m_drive, 1); // turn off the old drive
289      m_drive->floppy_mon_w(1); // turn off the old drive
291290      set_drive(m_drive_num); // select new drive
292      floppy_mon_w(m_drive, 0); // turn it on
291      m_drive->floppy_mon_w(0); // turn it on
293292      break;
294293   case 2:  // not emulated, not used in sorcerer
295294      break;
r29303r29304
323322   if (BIT(data, 5))
324323      m_status |= STAT_READY;
325324
326   floppy_drive_set_ready_state(m_drive, 1,0);
325   m_drive->floppy_drive_set_ready_state(1,0);
327326
328327
329328   if (!m_track)
330329      m_status |= STAT_TRACK0;
331330
332   floppy_drive_seek(m_drive, direction);
331   m_drive->floppy_drive_seek(direction);
333332}
334333
335334
shelves/new_menus/src/mess/machine/micropolis.h
r29303r29304
1111#define __MICROPOLIS_H__
1212
1313#include "devcb.h"
14#include "imagedev/flopdrv.h"
1415
1516
1617/***************************************************************************
r29303r29304
8889   UINT32  m_sector_length;          /* sector length (byte) */
8990
9091   /* this is the drive currently selected */
91   device_t *m_drive;
92   legacy_floppy_image_device *m_drive;
9293
9394   void read_sector();
9495   void write_sector();
shelves/new_menus/src/mess/machine/thomflop.c
r29303r29304
115115
116116
117117/* build a sector, with header & space */
118int thomson_state::thom_floppy_make_sector( device_t* img, chrn_id id, UINT8* dst, int sector_size )
118int thomson_state::thom_floppy_make_sector( legacy_floppy_image_device* img, chrn_id id, UINT8* dst, int sector_size )
119119{
120120   if ( sector_size == 128 )
121121   {
122122      /* single density */
123123      memset( dst, 0x00, 6 ); /* synchro bytes */
124124      dst[ 6 ] = 0xfb; /* data field mark */
125      floppy_drive_read_sector_data
126         ( img, id.H, id.data_id, dst + 7, sector_size );
125      img->floppy_drive_read_sector_data
126         (  id.H, id.data_id, dst + 7, sector_size );
127127      dst[ sector_size + 7 ] = 0; /* TODO: CRC */
128128      dst[ sector_size + 8 ] = 0; /* TODO: CRC */
129129      memset( dst + sector_size + 9, 0xff, 22 ); /* end mark */
r29303r29304
134134      /* double density */
135135      memset( dst, 0xa1, 3 ); /* synchro bytes */
136136      dst[ 3 ] = 0xfb; /* data field mark */
137      floppy_drive_read_sector_data
138         ( img, id.H, id.data_id, dst + 4, sector_size );
137      img->floppy_drive_read_sector_data
138         (  id.H, id.data_id, dst + 4, sector_size );
139139      dst[ sector_size + 4 ] = 0; /* TODO: CRC */
140140      dst[ sector_size + 5 ] = 0; /* TODO: CRC */
141141      memset( dst + sector_size + 6, 0xF7, 74 ); /* end mark */
r29303r29304
146146
147147
148148/* build a whole track */
149int thomson_state::thom_floppy_make_track( device_t* img, UINT8* dst, int sector_size, int side )
149int thomson_state::thom_floppy_make_track( legacy_floppy_image_device* img, UINT8* dst, int sector_size, int side )
150150{
151151   UINT8 space = ( sector_size == 128 ) ? 0xff : 0;
152152   UINT8* org = dst;
r29303r29304
154154   int nb;
155155
156156   /* go to start of track */
157   while ( ! floppy_drive_get_flag_state( img, FLOPPY_DRIVE_INDEX ) )
157   while ( ! img->floppy_drive_get_flag_state( FLOPPY_DRIVE_INDEX ) )
158158   {
159      if ( ! floppy_drive_get_next_id( img, side, &id ) )
159      if ( ! img->floppy_drive_get_next_id( side, &id ) )
160160         return 0;
161161   }
162162
163163   /* for each sector... */
164164   for ( nb = 0; nb < 16; nb++ )
165165   {
166      if ( ! floppy_drive_get_next_id( img, side, &id ) )
166      if ( ! img->floppy_drive_get_next_id( side, &id ) )
167167         break;
168168
169169      memset( dst, space, THOM_SIZE_SYNCHRO ); dst += THOM_SIZE_SYNCHRO;
r29303r29304
171171      memset( dst, space, THOM_SIZE_SYNCHRO ); dst += THOM_SIZE_SYNCHRO;
172172      dst += thom_floppy_make_sector( img, id, dst, sector_size );
173173
174      if ( floppy_drive_get_flag_state( img, FLOPPY_DRIVE_INDEX ) )
174      if ( img->floppy_drive_get_flag_state( FLOPPY_DRIVE_INDEX ) )
175175         break;
176176   }
177177   return dst - org;
r29303r29304
222222
223223
224224/* build a sector, with header */
225int thomson_state::thom_qdd_make_sector( device_t* img, int sector, UINT8* dst )
225int thomson_state::thom_qdd_make_sector( legacy_floppy_image_device* img, int sector, UINT8* dst )
226226{
227227   int i;
228228   dst[ 0 ] = 0x5a;
229   floppy_drive_read_sector_data ( img, 0, sector, dst + 1, 128 );
229   img->floppy_drive_read_sector_data (  0, sector, dst + 1, 128 );
230230   dst[ 129 ] = 0;
231231   for ( i = 0; i < 129; i++ )
232232      dst[ 129 ] += dst[ i ];
r29303r29304
236236
237237
238238/* build a whole disk */
239int thomson_state::thom_qdd_make_disk ( device_t* img, UINT8* dst )
239int thomson_state::thom_qdd_make_disk ( legacy_floppy_image_device* img, UINT8* dst )
240240{
241241   UINT8* org = dst;
242242   int i;
r29303r29304
418418            machine().time().as_double(), m_maincpu->pc(), offset, data );
419419}
420420
421void thomson_state::to7_5p14_index_pulse_callback( device_t *controller,device_t *image, int state )
421void thomson_state::to7_5p14_index_pulse_callback( device_t *controller,legacy_floppy_image_device *image, int state )
422422{
423423   m_mc6843->set_index_pulse( state );
424424}
r29303r29304
429429   LOG(( "to7_5p14sd_reset: CD 90-015 controller\n" ));
430430   for ( i = 0; i < floppy_get_count( machine() ); i++ )
431431   {
432      device_t * img = floppy_get_device( machine(), i );
432      legacy_floppy_image_device * img = floppy_get_device( machine(), i );
433433      if (img) {
434         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
435         floppy_drive_set_rpm( img, 300. );
436         floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
434         img->floppy_drive_set_ready_state( FLOPPY_DRIVE_READY, 0 );
435         img->floppy_drive_set_rpm( 300. );
436         img->floppy_drive_seek( - img->floppy_drive_get_current_track() );
437437      }
438438   }
439439}
r29303r29304
515515
516516
517517
518void thomson_state::to7_qdd_index_pulse_cb( device_t *controller,device_t *image, int state )
518void thomson_state::to7_qdd_index_pulse_cb( device_t *controller,legacy_floppy_image_device *image, int state )
519519{
520520   to7qdd->index_pulse = state;
521521
r29303r29304
532532
533533
534534
535device_t * thomson_state::to7_qdd_image()
535legacy_floppy_image_device * thomson_state::to7_qdd_image()
536536{
537537   return floppy_get_device( machine(), 0 );
538538}
r29303r29304
548548      to7qdd->status |= QDD_S_PE;
549549
550550   /* write-protect */
551   if (floppy_wpt_r(to7_qdd_image()) == CLEAR_LINE)
551   if (to7_qdd_image()->floppy_wpt_r() == CLEAR_LINE)
552552      to7qdd->status |= QDD_S_NCTS;
553553
554554   /* sticky reset conditions */
r29303r29304
644644         LOG(( "%f $%04x to7_qdd_write_byte: got id field for sector=%i\n",
645645               machine().time().as_double(), m_maincpu->pc(), sector ));
646646
647         floppy_drive_format_sector( to7_qdd_image(),
647         to7_qdd_image()->floppy_drive_format_sector(
648648                     0, sector, 0, 0, sector, 128, filler );
649649                  thom_floppy_active( 1 );
650650         to7qdd->start_idx = to7qdd->data_idx;
r29303r29304
673673            LOG(( "%f $%04x to7_qdd_write_byte: goto data field for sector=%i\n",
674674                  machine().time().as_double(), m_maincpu->pc(), sector ));
675675
676            floppy_drive_write_sector_data( to7_qdd_image(), 0, sector, to7qdd->data + to7qdd->start_idx + 1, 128, 0 );
676            to7_qdd_image()->floppy_drive_write_sector_data( 0, sector, to7qdd->data + to7qdd->start_idx + 1, 128, 0 );
677677                        thom_floppy_active( 1 );
678678         }
679679
r29303r29304
825825
826826   for ( i = 0; i < floppy_get_count( machine() ); i++ )
827827   {
828      device_t * img = floppy_get_device( machine(), i );
828      legacy_floppy_image_device * img = floppy_get_device( machine(), i );
829829      if (img) {
830         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
830         img->floppy_drive_set_ready_state(  FLOPPY_DRIVE_READY, 0 );
831831
832832         motor_on = CLEAR_LINE;
833         floppy_mon_w(img, motor_on);
833         img->floppy_mon_w( motor_on);
834834
835835         /* pulse each time the whole-disk spiraling track ends */
836836         /* at 90us per byte read, the disk can be read in 6s */
837         floppy_drive_set_rpm( img, 60. / 6. );
837         img->floppy_drive_set_rpm( 60. / 6. );
838838      }
839839   }
840840
r29303r29304
927927
928928
929929
930device_t * thomson_state::thmfc_floppy_image()
930legacy_floppy_image_device * thomson_state::thmfc_floppy_image()
931931{
932932   return floppy_get_device( machine(), thmfc1->drive );
933933}
934934
935935
936936
937int thomson_state::thmfc_floppy_is_qdd ( device_image_interface *image )
937int thomson_state::thmfc_floppy_is_qdd ( legacy_floppy_image_device *image )
938938{
939939   if (image==NULL) return 0;
940940   if (!image->exists()) return 0;
r29303r29304
943943
944944
945945
946void thomson_state::thmfc_floppy_index_pulse_cb ( device_t *controller,device_t *image, int state )
946void thomson_state::thmfc_floppy_index_pulse_cb ( device_t *controller,legacy_floppy_image_device *image, int state )
947947{
948948   if ( image != thmfc_floppy_image())
949949      return;
950950
951   if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(image)))
951   if ( thmfc_floppy_is_qdd(image))
952952   {
953953      /* pulse each time the whole-disk spiraling track ends */
954      floppy_drive_set_rpm( image, 16.92f /* 423/25 */ );
954      image->floppy_drive_set_rpm( 16.92f /* 423/25 */ );
955955      thmfc1->ipl = state;
956956      if ( state )
957957      {
r29303r29304
962962   }
963963   else
964964   {
965      floppy_drive_set_rpm( image, 300. );
965      image->floppy_drive_set_rpm( 300. );
966966      thmfc1->ipl = state;
967967      if ( state  )
968968         thmfc1->data_raw_idx = 0;
r29303r29304
975975
976976int thomson_state::thmfc_floppy_find_sector( chrn_id* dst )
977977{
978   device_t* img = thmfc_floppy_image();
978   legacy_floppy_image_device* img = thmfc_floppy_image();
979979   chrn_id id;
980980   int r = 0;
981981
982982   /* scan track, try 4 revolutions */
983983   while ( r < 4 )
984984   {
985      if ( floppy_drive_get_next_id( img, thmfc1->side, &id ) )
985      if ( img->floppy_drive_get_next_id( thmfc1->side, &id ) )
986986      {
987987         if ( id.C == thmfc1->track &&
988988               id.R == thmfc1->sector &&
r29303r29304
997997         }
998998      }
999999
1000      if ( floppy_drive_get_flag_state( img, FLOPPY_DRIVE_INDEX ) )
1000      if ( img->floppy_drive_get_flag_state( FLOPPY_DRIVE_INDEX ) )
10011001         r++;
10021002   }
10031003
10041004   thmfc1->stat0 = THMFC1_STAT0_CRC_ERROR | THMFC1_STAT0_FINISHED;
1005   LOG (( "thmfc_floppy_find_sector: sector not found drive=%i track=%i sector=%i\n", floppy_get_drive( img ), thmfc1->track, thmfc1->sector ));
1005   LOG (( "thmfc_floppy_find_sector: sector not found drive=%i track=%i sector=%i\n", floppy_get_drive(img), thmfc1->track, thmfc1->sector ));
10061006   return 0;
10071007}
10081008
r29303r29304
10171017
10181018   if ( thmfc1->op == THMFC1_OP_WRITE_SECT )
10191019   {
1020      device_t * img = thmfc_floppy_image();
1021      floppy_drive_write_sector_data( img, thmfc1->side, thmfc1->sector_id, thmfc1->data + 3, thmfc1->data_size - 3, 0 );
1020      legacy_floppy_image_device * img = thmfc_floppy_image();
1021      img->floppy_drive_write_sector_data( thmfc1->side, thmfc1->sector_id, thmfc1->data + 3, thmfc1->data_size - 3, 0 );
10221022            thom_floppy_active( 1 );
10231023   }
10241024   thmfc1->op = THMFC1_OP_RESET;
r29303r29304
10681068   /* rebuild track if needed */
10691069   if ( ! thmfc1->data_raw_size )
10701070   {
1071      if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image())))
1071      if ( thmfc_floppy_is_qdd(thmfc_floppy_image()))
10721072         /* QDD: track = whole disk */
10731073         thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(), thmfc1->data );
10741074      else
r29303r29304
11361136
11371137         LOG(( "%f $%04x thmfc_floppy_qdd_write_byte: id field, sector=%i\n", machine().time().as_double(), m_maincpu->pc(), sector ));
11381138
1139         floppy_drive_format_sector( thmfc_floppy_image(), 0, sector, 0, 0, sector, 128, filler );
1139         thmfc_floppy_image()->floppy_drive_format_sector( 0, sector, 0, 0, sector, 128, filler );
11401140         thom_floppy_active( 1 );
11411141         thmfc1->data_idx = 0;
11421142      }
r29303r29304
11581158         if ( i >= 0 )
11591159         {
11601160            /* got an id & a data field => write */
1161            device_t * img = thmfc_floppy_image();
1161            legacy_floppy_image_device * img = thmfc_floppy_image();
11621162            int sector = (int) thmfc1->data[ i + 1 ] * 256 +
11631163               (int) thmfc1->data[ i + 2 ];
11641164
11651165            LOG(( "%f $%04x thmfc_floppy_qdd_write_byte: data field, sector=%i\n",
11661166                  machine().time().as_double(), m_maincpu->pc(), sector ));
11671167
1168            floppy_drive_write_sector_data( img, 0, sector, thmfc1->data + thmfc1->data_idx, 128, 0 );
1168            img->floppy_drive_write_sector_data( 0, sector, thmfc1->data + thmfc1->data_idx, 128, 0 );
11691169            thom_floppy_active( 1 );
11701170         }
11711171
r29303r29304
12181218         if ( !memcmp ( thmfc1->data, header, sizeof( header ) ) )
12191219         {
12201220            /* got id field => format */
1221            device_t * img = thmfc_floppy_image();
1221            legacy_floppy_image_device * img = thmfc_floppy_image();
12221222            UINT8 track  = thmfc1->data[4];
12231223            UINT8 side   = thmfc1->data[5];
12241224            UINT8 sector = thmfc1->data[6];
r29303r29304
12271227                        chrn_id id;
12281228                        if ( thmfc_floppy_find_sector( &id ) )
12291229                        {
1230                              floppy_drive_format_sector( img, side, thmfc1->sector_id, track, thmfc1->side, sector, length, filler );
1230                              img->floppy_drive_format_sector( side, thmfc1->sector_id, track, thmfc1->side, sector, length, filler );
12311231                              thom_floppy_active( 1 );
12321232                        }
12331233         }
r29303r29304
12521252   case 1: /* STAT1 */
12531253   {
12541254      UINT8 data = 0;
1255      device_image_interface * img = dynamic_cast<device_image_interface *>(thmfc_floppy_image());
1256      int flags = floppy_drive_get_flag_state( &img->device(), -1 );
1255      legacy_floppy_image_device * img = thmfc_floppy_image();
1256      int flags = img->floppy_drive_get_flag_state(-1 );
12571257      if ( thmfc_floppy_is_qdd(img) )
12581258      {
12591259         if ( ! img->exists() )
r29303r29304
12691269         if ( img->exists() )
12701270            data |= 0x20; /* disk change (?) */
12711271
1272         data |= !floppy_tk00_r(&img->device()) << 3;
1272         data |= !img->floppy_tk00_r() << 3;
12731273
12741274         if ( flags & FLOPPY_DRIVE_READY )
12751275            data |= 0x02;
12761276      }
12771277      if (!motor_on)
12781278         data |= 0x10;
1279      if (!floppy_wpt_r(&img->device()))
1279      if (!img->floppy_wpt_r())
12801280         data |= 0x04;
12811281      VLOG(( "%f $%04x thmfc_floppy_r: STAT1=$%02X\n", machine().time().as_double(), m_maincpu->pc(), data ));
12821282      return data;
r29303r29304
13141314   case 0: /* CMD0 */
13151315   {
13161316      int wsync = (data >> 4) & 1;
1317      int qdd = thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image()));
1317      int qdd = thmfc_floppy_is_qdd(thmfc_floppy_image());
13181318      chrn_id id;
13191319      thmfc1->formatting = (data >> 2) & 1;
13201320      LOG (( "%f $%04x thmfc_floppy_w: CMD0=$%02X dens=%s wsync=%i dsync=%i fmt=%i op=%i\n",
r29303r29304
14151415
14161416   case 2: /* CMD2 */
14171417   {
1418      device_t * img;
1418      legacy_floppy_image_device * img;
14191419      int seek = 0, motor;
14201420      thmfc1->drive = data & 2;
14211421
1422      img = thmfc_floppy_image();
1423      if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(img)))
1422      img  = thmfc_floppy_image();
1423      if ( thmfc_floppy_is_qdd(img))
14241424      {
14251425         motor = !(data & 0x40);
14261426         /* no side select & no seek for QDD */
r29303r29304
14431443      if ( seek )
14441444      {
14451445         thmfc1->data_raw_size = 0;
1446         floppy_drive_seek( img, seek );
1446         img->floppy_drive_seek( seek );
14471447      }
14481448
14491449      /* in real life, to keep the motor running, it is sufficient to
r29303r29304
14511451         instead of counting, we assume the motor is always running...
14521452      */
14531453      motor_on = CLEAR_LINE /* motor */;
1454      floppy_mon_w(img, motor_on);
1454      img->floppy_mon_w(motor_on);
14551455   }
14561456   break;
14571457
14581458
14591459   case 3: /* WDATA */
14601460      thmfc1->wsync = data;
1461      if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image())))
1461      if ( thmfc_floppy_is_qdd(thmfc_floppy_image()))
14621462         thmfc_floppy_qdd_write_byte( data );
14631463      else if ( thmfc1->op==THMFC1_OP_WRITE_SECT )
14641464         thmfc_floppy_write_byte( data );
r29303r29304
14901490      thmfc1->track = data;
14911491      LOG (( "%f $%04x thmfc_floppy_w: WTRCK=%i (real=%i)\n",
14921492            machine().time().as_double(), m_maincpu->pc(), data,
1493            floppy_drive_get_current_track( thmfc_floppy_image() ) ));
1493            thmfc_floppy_image()->floppy_drive_get_current_track()));
14941494      break;
14951495
14961496   case 7: /* WCELL */
r29303r29304
15141514
15151515   for ( i = 0; i < floppy_get_count( machine() ); i++ )
15161516   {
1517      device_t * img = floppy_get_device( machine(), i );
1517      legacy_floppy_image_device * img = floppy_get_device( machine(), i );
15181518      if (img) {
1519         floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
1520         floppy_drive_seek( img, - floppy_drive_get_current_track( img ) );
1519         img->floppy_drive_set_ready_state( FLOPPY_DRIVE_READY, 0 );
1520         img->floppy_drive_seek(  - img->floppy_drive_get_current_track() );
15211521      }
15221522   }
15231523
r29303r29304
19121912      to7_5p14_w( space, offset, data, mem_mask );
19131913}
19141914
1915void thomson_state::thomson_index_callback(device_t *device, int state)
1915void thomson_state::thomson_index_callback(legacy_floppy_image_device *device, int state)
19161916{
19171917   switch ( to7_controller_type )
19181918   {
shelves/new_menus/src/mess/machine/sonydriv.c
r29303r29304
103103static void load_track_data(device_t *device,int floppy_select)
104104{
105105   int track_size;
106   device_image_interface *cur_image;
106   legacy_floppy_image_device *cur_image;
107107   UINT8 *new_data;
108108   floppy_t *f;
109109
110110   f = &sony.floppy[floppy_select];
111   cur_image = dynamic_cast<device_image_interface *>(floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, floppy_select));
111   cur_image = floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, floppy_select);
112112
113   floppy_image_legacy *fimg = flopimg_get_image(&cur_image->device());
113   floppy_image_legacy *fimg = cur_image->flopimg_get_image();
114114
115115   if (!fimg)
116116   {
117117      return;
118118   }
119119
120   track_size = floppy_get_track_size(fimg, f->head, floppy_drive_get_current_track(&cur_image->device()));
120   track_size = floppy_get_track_size(fimg, f->head, cur_image->floppy_drive_get_current_track());
121121   if (f->loadedtrack_data) auto_free(device->machine(),f->loadedtrack_data);
122122   new_data = auto_alloc_array(device->machine(),UINT8,track_size);
123123   if (!new_data)
r29303r29304
125125      return;
126126   }
127127
128   floppy_drive_read_track_data_info_buffer(&cur_image->device(), f->head, new_data, &track_size);
128   cur_image->floppy_drive_read_track_data_info_buffer(f->head, new_data, &track_size);
129129   f->loadedtrack_valid = 1;
130130   f->loadedtrack_dirty = 0;
131131   f->loadedtrack_size = track_size;
r29303r29304
137137
138138static void save_track_data(device_t *device, int floppy_select)
139139{
140   device_image_interface *cur_image;
140   legacy_floppy_image_device *cur_image;
141141   floppy_t *f;
142142   int len;
143143
144144   f = &sony.floppy[floppy_select];
145   cur_image = dynamic_cast<device_image_interface *>(floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, floppy_select));
145   cur_image = floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, floppy_select);
146146
147147   if (f->loadedtrack_dirty)
148148   {
149149      len = f->loadedtrack_size;
150      floppy_drive_write_track_data_info_buffer(&cur_image->device(), f->head, f->loadedtrack_data, &len);
150      cur_image->floppy_drive_write_track_data_info_buffer(f->head, f->loadedtrack_data, &len);
151151      f->loadedtrack_dirty = 0;
152152   }
153153}
r29303r29304
157157UINT8 sony_read_data(device_t *device)
158158{
159159   UINT8 result = 0;
160   device_image_interface *cur_image;
160   legacy_floppy_image_device *cur_image;
161161   floppy_t *f;
162162
163163   if (sony_enable2() || (! sony.floppy_enable))
164164      return 0xFF;            /* right ??? */
165165
166166   f = &sony.floppy[sony.floppy_select];
167   cur_image = dynamic_cast<device_image_interface *>(floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, sony.floppy_select));
167   cur_image = floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, sony.floppy_select);
168168   if (!cur_image->exists())
169169      return 0xFF;
170170
r29303r29304
206206
207207
208208
209static int sony_rpm(floppy_t *f, device_t *cur_image)
209static int sony_rpm(floppy_t *f, legacy_floppy_image_device *cur_image)
210210{
211211   int result = 0;
212   device_image_interface *image =dynamic_cast<device_image_interface *>(cur_image);
213212   /*
214213    * The Mac floppy controller was interesting in that its speed was adjusted
215214    * while the thing was running.  On the tracks closer to the rim, it was
r29303r29304
253252         439     /* 64-79:   timing value ???? (acceptable range {021E-0222} */
254253      };
255254#endif
256      if (cur_image && image->exists())
257         result = speeds[floppy_drive_get_current_track(cur_image) / 16];
255      if (cur_image && cur_image->exists())
256         result = speeds[cur_image->floppy_drive_get_current_track() / 16];
258257   }
259258   return result;
260259}
r29303r29304
264263   int result = 1;
265264   int action;
266265   floppy_t *f;
267   device_image_interface *cur_image;
266   legacy_floppy_image_device *cur_image;
268267
269268   action = ((sony.lines & (SONY_CA1 | SONY_CA0)) << 2) | (sony.sel_line << 1) | ((sony.lines & SONY_CA2) >> 2);
270269
r29303r29304
277276   if ((! sony_enable2()) && sony.floppy_enable)
278277   {
279278      f = &sony.floppy[sony.floppy_select];
280      cur_image = dynamic_cast<device_image_interface *>(floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, sony.floppy_select));
279      cur_image = floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, sony.floppy_select);
281280      if (!cur_image->exists())
282281         cur_image = NULL;
283282
r29303r29304
314313         break;
315314      case 0x06:  /* Disk is locked 0=locked 1=unlocked */
316315         if (cur_image)
317            result = floppy_wpt_r(&cur_image->device());
316            result = cur_image->floppy_wpt_r();
318317         else
319318            result = 0;
320319         break;
r29303r29304
324323      case 0x09:  /* Number of sides: 0=single sided, 1=double sided */
325324         if (cur_image)
326325         {
327            floppy_image_legacy *fimg = flopimg_get_image(&cur_image->device());
326            floppy_image_legacy *fimg = cur_image->flopimg_get_image();
328327            if (fimg)
329328            {
330329               result = floppy_get_heads_per_disk(fimg) - 1;
r29303r29304
335334      case 0x0a:  /* At track 0: 0=track zero 1=not track zero */
336335         logerror("%s sony.status(): reading Track 0\n", device->machine().describe_context());
337336         if (cur_image)
338            result = floppy_tk00_r(&cur_image->device());
337            result = cur_image->floppy_tk00_r();
339338         else
340339            result = 0;
341340         break;
r29303r29304
346345         {
347346            if (cur_image)
348347            {
349               if (!floppy_dskchg_r(&cur_image->device()))
348               if (!cur_image->floppy_dskchg_r())
350349               {
351350                  f->disk_switched = 1;
352351               }
r29303r29304
372371         /* (time in seconds) / (60 sec/minute) * (rounds/minute) * (60 pulses) * (2 pulse phases) */
373372         if (cur_image)
374373         {
375            result = ((int) (device->machine().time().as_double() / 60.0 * sony_rpm(f, &cur_image->device()) * 60.0 * 2.0)) & 1;
374            result = ((int) (device->machine().time().as_double() / 60.0 * sony_rpm(f, cur_image) * 60.0 * 2.0)) & 1;
376375         }
377376         break;
378377      case 0x0f:  /* 400k/800k: Drive installed: 0=drive connected, 1=drive not connected */
r29303r29304
400399{
401400   int action;
402401   floppy_t *f;
403   device_image_interface *cur_image;
402   legacy_floppy_image_device *cur_image;
404403
405404   action = ((sony.lines & (SONY_CA1 | SONY_CA0)) << 2) | ((sony.lines & SONY_CA2) >> 2) | (sony.sel_line << 1);
406405
r29303r29304
413412   if (sony.floppy_enable)
414413   {
415414      f = &sony.floppy[sony.floppy_select];
416      cur_image = dynamic_cast<device_image_interface *>(floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, sony.floppy_select));
415      cur_image = floppy_get_device_by_type(device->machine(), FLOPPY_TYPE_SONY, sony.floppy_select);
417416      if (!cur_image->exists())
418417         cur_image = NULL;
419418
r29303r29304
433432         {
434433            save_track_data(device,sony.floppy_select);
435434            if (f->step)
436               floppy_drive_seek(&cur_image->device(), -1);
435               cur_image->floppy_drive_seek(-1);
437436            else
438               floppy_drive_seek(&cur_image->device(), +1);
437               cur_image->floppy_drive_seek(+1);
439438            f->loadedtrack_valid = 0;
440439         }
441440         break;
442441      case 0x08:  /* Turn motor on */
443442         f->motor_on = CLEAR_LINE;
444443         if (cur_image)
445            floppy_mon_w(&cur_image->device(), f->motor_on);
444            cur_image->floppy_mon_w(f->motor_on);
446445         break;
447446      case 0x09:  /* Turn motor off */
448447         f->motor_on = ASSERT_LINE;
449448         if (cur_image)
450            floppy_mon_w(&cur_image->device(), f->motor_on);
449            cur_image->floppy_mon_w(f->motor_on);
451450         break;
452451      case 0x0d:  /* Eject disk */
453452         if (cur_image)
r29303r29304
542541void sonydriv_floppy_image_device::device_start()
543542{
544543   legacy_floppy_image_device::device_start();
545   floppy_set_type(this, FLOPPY_TYPE_SONY);
544   floppy_set_type(FLOPPY_TYPE_SONY);
546545
547546   sony.floppy[0].is_fdhd = 0;
548547   sony.floppy[1].is_fdhd = 0;
shelves/new_menus/src/mess/machine/rx01.c
r29303r29304
1212
1313#include "emu.h"
1414#include "machine/rx01.h"
15#include "imagedev/flopdrv.h"
1615#include "formats/basicdsk.h"
1716
1817static LEGACY_FLOPPY_OPTIONS_START( rx01 )
r29303r29304
7473
7574void rx01_device::device_start()
7675{
77   m_image[0] = subdevice(FLOPPY_0);
78   m_image[1] = subdevice(FLOPPY_1);
76   m_image[0] = subdevice<legacy_floppy_image_device>(FLOPPY_0);
77   m_image[1] = subdevice<legacy_floppy_image_device>(FLOPPY_1);
7978}
8079
8180
r29303r29304
8786{
8887   for(int i=0;i<2;i++)
8988   {
90      floppy_mon_w(m_image[i], 0); // turn it on
91      floppy_drive_set_controller(m_image[i], this);
92      floppy_drive_set_rpm(m_image[i], 360.);
89      m_image[i]->floppy_mon_w(0); // turn it on
90      m_image[i]->floppy_drive_set_controller(this);
91      m_image[i]->floppy_drive_set_rpm(360.);
9392   }
9493   m_rxes = 0;
9594   m_rxcs = 0;
r29303r29304
128127   m_unit = BIT(data,4);
129128   m_interrupt = BIT(data,6);
130129
131   floppy_drive_set_ready_state(m_image[m_unit], 1,0);
130   m_image[m_unit]->floppy_drive_set_ready_state(1,0);
132131
133132
134133   if (BIT(data,14)) // Initialize
r29303r29304
164163         case 7: // Read Error Register
165164               m_state = RX01_COMPLETE;
166165               // set ready signal according to current drive status
167               m_rxes |= floppy_drive_get_flag_state(m_image[m_unit], FLOPPY_DRIVE_READY) << 7;
166               m_rxes |= m_image[m_unit]->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) << 7;
168167               break;
169168      }
170169   }
r29303r29304
195194void rx01_device::service_command()
196195{
197196   printf("service_command %d\n",m_state);
198   m_rxes |= floppy_drive_get_flag_state(m_image[m_unit], FLOPPY_DRIVE_READY) << 7;
197   m_rxes |= m_image[m_unit]->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) << 7;
199198   switch(m_state) {
200199      case RX01_FILL :
201200                  m_buffer[m_buf_pos] = m_rxdb & 0xff;
r29303r29304
241240
242241void rx01_device::position_head()
243242{
244   int cur_track = floppy_drive_get_current_track(m_image[m_unit]);
243   int cur_track = m_image[m_unit]->floppy_drive_get_current_track();
245244   int dir = (cur_track < m_rxta) ? +1 : -1;
246245
247246   while (m_rxta != cur_track)
248247   {
249248      cur_track += dir;
250249
251      floppy_drive_seek(m_image[m_unit], dir);
250      m_image[m_unit]->floppy_drive_seek(dir);
252251   }
253252}
254253
255254void rx01_device::read_sector()
256255{
257256   /* read data */
258   floppy_drive_read_sector_data(m_image[m_unit], 0, m_rxsa, (char *)m_buffer, 128);
257   m_image[m_unit]->floppy_drive_read_sector_data(0, m_rxsa, (char *)m_buffer, 128);
259258}
260259
261260void rx01_device::write_sector(int ddam)
262261{
263262   /* write data */
264   floppy_drive_write_sector_data(m_image[m_unit], 0, m_rxsa, (char *)m_buffer, 128, ddam);
263   m_image[m_unit]->floppy_drive_write_sector_data(0, m_rxsa, (char *)m_buffer, 128, ddam);
265264}
shelves/new_menus/src/mess/machine/rx01.h
r29303r29304
99#ifndef __RX01__
1010#define __RX01__
1111
12#include "imagedev/flopdrv.h"
13
1214//**************************************************************************
1315//  INTERFACE CONFIGURATION MACROS
1416//**************************************************************************
r29303r29304
6163      RX01_INIT
6264   };
6365
64   device_t *m_image[2];
66   legacy_floppy_image_device *m_image[2];
6567   UINT8 m_buffer[128];
6668   int m_buf_pos;
6769
shelves/new_menus/src/mess/includes/apollo.h
r29303r29304
301301   apollo_graphics_15i(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, device_type type, const char *name, const char *shortname, const char *source);
302302   ~apollo_graphics_15i();
303303
304   // access to legacy token
305   class apollo_graphics *token() const { assert(m_token != NULL); return m_token; }
304   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);   
305
306   // monochrome control
307   DECLARE_READ8_MEMBER( apollo_mcr_r );
308   DECLARE_WRITE8_MEMBER( apollo_mcr_w );
309
310   // monochrome and color memory
311   DECLARE_READ16_MEMBER( apollo_mem_r );
312   DECLARE_WRITE16_MEMBER( apollo_mem_w );
313
314   // color control
315   DECLARE_READ8_MEMBER( apollo_ccr_r );
316   DECLARE_WRITE8_MEMBER( apollo_ccr_w );
306317   
307   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);   
318   DECLARE_READ16_MEMBER( apollo_mgm_r );
319   DECLARE_WRITE16_MEMBER( apollo_mgm_w );
320
321   DECLARE_READ16_MEMBER( apollo_cgm_r );
322   DECLARE_WRITE16_MEMBER( apollo_cgm_w );
323     
324   void vblank_state_changed(screen_device &screen, bool vblank_state);
325
326   int is_mono() { return m_n_planes == 1; }
327
308328protected:
309329   // device-level overrides
310330   virtual void device_config_complete();
311331   virtual void device_start();
312332   virtual void device_reset();
333protected:
334   class lut_fifo;
335   class bt458;
336
337   const char *cr_text(offs_t offset, UINT8 data, UINT8 rw);
338
339   void increment_h_clock();
340   void increment_v_clock();
341   void increment_p_clock();
342
343   void log_cr1(const char * text);
344   void set_cr1(UINT8 data);
345   void set_cr3a(UINT8 data);
346   void set_cr3b(UINT8 data);
347   void set_lut_cr(UINT8 data);
348
349   void register_vblank_callback();
350   
351   UINT32 set_msb0(UINT32 value, UINT8 data)
352   {
353      return (value & 0xffffff00) | data;
354   }
355   UINT32 set_lsb0(UINT32 value, UINT8 data)
356   {
357      return (value & 0xffff00ff) | (data << 8);
358   }
359   UINT32 set_msb1(UINT32 value, UINT8 data)
360   {
361      return (value & 0xff00ffff) | (data << 16);
362   }
363   UINT32 set_lsb1(UINT32 value, UINT8 data)
364   {
365      return (value & 0x00ffffff) | (data << 24);
366   }
367   UINT8 get_msb1(UINT32 value)
368   {
369      return (value >> 16) & 0xff;
370   }
371   UINT8 get_lsb1(UINT32 value)
372   {
373      return (value >> 24) & 0xff;
374   }
375
376   void set_status_rmw();
377   UINT16 rop(UINT16 dest_data, UINT16 src_data, UINT8 plane);
378   void set_source_data(UINT32 offset);
379   UINT32 get_source_data(UINT8 plane);
380   void blt(UINT32 dest_addr, UINT16 mem_mask);
381
382   UINT8 get_pixel(UINT32 offset, UINT16 mask);
383   UINT8 c4p_read_adc(UINT8 data);
384   UINT8 c8p_read_adc(UINT8 data);
385
386   void screen_update1(bitmap_rgb32 &bitmap, const rectangle &cliprect);
387protected:
388   UINT16 m_n_planes;
389   UINT16 m_width;
390   UINT16 m_height;
391   UINT16 m_buffer_width;
392   UINT16 m_buffer_height;
393
394   UINT8 m_sr;
395   UINT8 m_device_id;
396   UINT16 m_write_enable_register;
397   UINT32 m_rop_register;
398   UINT16 m_diag_mem_request;
399   UINT8 m_cr0;
400   UINT8 m_cr1;
401   UINT8 m_cr2;
402   UINT8 m_cr2b;
403   UINT8 m_cr2_s_data;
404   UINT8 m_cr2_s_plane;
405   UINT8 m_cr2_d_plane;
406   UINT8 m_cr3a;
407   UINT8 m_cr3b;
408   UINT8 m_ad_result;
409   UINT8 m_ad_pending;
410
411   UINT8 m_lut_control;
412   UINT8 m_lut_data;
413
414   UINT8 m_update_flag;
415   UINT8 m_update_pending;
416
417   UINT8 m_blt_cycle_count;
418   UINT32 m_image_offset;
419   UINT32 m_guard_latch[8];
420
421   int m_h_clock;
422   int m_v_clock;
423   int m_p_clock;
424   int m_data_clock;
425
426   UINT16 *m_image_memory;
427   int m_image_plane_size;
428   int m_image_memory_size;
429
430   UINT32 m_color_lookup_table[16];
431
432   lut_fifo *m_lut_fifo;
433   bt458 *m_bt458;
434};
435
436
437#define LUT_FIFO_SIZE   1024
438
439
440//**************************************************************************
441// class LUT Fifo
442//**************************************************************************
443
444class apollo_graphics_15i::lut_fifo
445{
446public:
447   lut_fifo()
448   {
449      reset();
450   }
451
452   void reset()
453   {
454      m_size = LUT_FIFO_SIZE;
455      m_get_index = 0;
456      m_put_index = 0;
457   }
458
459   void put(const UINT8 data)
460   {
461      if (!is_full())
462      {
463         m_data[m_put_index] = data;
464         m_put_index = (m_put_index + 1) % m_size;
465      }
466   }
467
468   UINT8 get()
469   {
470      UINT8 data = is_empty() ? 0xff : m_data[m_get_index];
471      m_get_index = (m_get_index + 1) % m_size;
472      return data;
473   }
474
475   int is_empty()
476   {
477      return m_get_index == m_put_index;
478   }
479
480   int is_full()
481   {
482      return ((m_put_index + 1) % m_size) == m_get_index;
483   }
484
313485private:
314   // internal state
315   class apollo_graphics *m_token;
486   UINT16 m_size;
487   UINT16 m_get_index;
488   UINT16 m_put_index;
489   UINT8 m_data[LUT_FIFO_SIZE];
316490};
317491
492//**************************************************************************
493//  class Brooktree Bt458
494//**************************************************************************
495
496class apollo_graphics_15i::bt458
497{
498public:
499   bt458(running_machine &running_machine);
500   void start();
501   void reset();
502   UINT8 read(UINT8 c10);
503   void write(UINT8 data, UINT8 c10);
504   UINT32 get_rgb(UINT8 index);
505
506private:
507   running_machine &machine() const
508   {
509      assert(m_machine != NULL);
510      return *m_machine;
511   }
512
513   UINT8 m_color_counter;
514   UINT8 m_red;
515   UINT8 m_green;
516
517   UINT8 m_address_register;
518   UINT32 m_color_palette_RAM[256];
519   UINT32 m_overlay_color[4];
520   UINT8 m_read_mask_register;
521   UINT8 m_blink_mask_register;
522   UINT8 m_command_register;
523   UINT8 m_control_test_register;
524
525   running_machine *m_machine;
526};
527
528
529
318530extern const device_type APOLLO_GRAPHICS;
319531
320532#define MCFG_APOLLO_GRAPHICS_ADD( _tag) \
r29303r29304
344556
345557MACHINE_CONFIG_EXTERN( apollo_mono19i );
346558
347DECLARE_READ8_DEVICE_HANDLER( apollo_mcr_r ) ;
348DECLARE_WRITE8_DEVICE_HANDLER(apollo_mcr_w );
349559
350DECLARE_READ16_DEVICE_HANDLER( apollo_mgm_r );
351DECLARE_WRITE16_DEVICE_HANDLER( apollo_mgm_w );
352
353DECLARE_READ8_DEVICE_HANDLER( apollo_ccr_r ) ;
354DECLARE_WRITE8_DEVICE_HANDLER(apollo_ccr_w );
355
356DECLARE_READ16_DEVICE_HANDLER( apollo_cgm_r );
357DECLARE_WRITE16_DEVICE_HANDLER( apollo_cgm_w );
358
359560#endif /* APOLLO_H_ */
shelves/new_menus/src/mess/includes/dm7000.h
r29303r29304
4141
4242   DECLARE_WRITE16_MEMBER ( dm7000_enet_w );
4343   DECLARE_READ16_MEMBER ( dm7000_enet_r );
44   
45   DECLARE_READ32_MEMBER( dcr_r );
46   DECLARE_WRITE32_MEMBER( dcr_w );
47   
48   
4449   UINT16          m_enet_regs[32];
4550
4651   UINT32          dcr[1024];
shelves/new_menus/src/mess/includes/thomson.h
r29303r29304
304304   WRITE_LINE_MEMBER( fdc_index_1_w );
305305   WRITE_LINE_MEMBER( fdc_index_2_w );
306306   WRITE_LINE_MEMBER( fdc_index_3_w );
307   void thomson_index_callback(device_t *device, int state);
307   void thomson_index_callback(legacy_floppy_image_device *device, int state);
308308   DECLARE_PALETTE_INIT(thom);
309309   
310310   optional_device<mc6854_device> m_mc6854;
r29303r29304
519519   unsigned to7_lightpen_gpl( int decx, int decy );
520520
521521   int thom_floppy_make_addr( chrn_id id, UINT8* dst, int sector_size );
522   int thom_floppy_make_sector( device_t* img, chrn_id id, UINT8* dst, int sector_size );
523   int thom_floppy_make_track( device_t* img, UINT8* dst, int sector_size, int side );
522   int thom_floppy_make_sector( legacy_floppy_image_device* img, chrn_id id, UINT8* dst, int sector_size );
523   int thom_floppy_make_track( legacy_floppy_image_device* img, UINT8* dst, int sector_size, int side );
524524   int thom_qdd_make_addr( int sector, UINT8* dst );
525   int thom_qdd_make_sector( device_t* img, int sector, UINT8* dst );
526   int thom_qdd_make_disk ( device_t* img, UINT8* dst );
525   int thom_qdd_make_sector( legacy_floppy_image_device* img, int sector, UINT8* dst );
526   int thom_qdd_make_disk ( legacy_floppy_image_device* img, UINT8* dst );
527527   void to7_5p14_reset();
528528   void to7_5p14_init();
529   void to7_5p14_index_pulse_callback( device_t *controller,device_t *image, int state );
529   void to7_5p14_index_pulse_callback( device_t *controller,legacy_floppy_image_device *image, int state );
530530   void to7_5p14sd_reset();
531531   void to7_5p14sd_init();
532   void to7_qdd_index_pulse_cb( device_t *controller,device_t *image, int state );
533   device_t * to7_qdd_image();
532   void to7_qdd_index_pulse_cb( device_t *controller,legacy_floppy_image_device *image, int state );
533   legacy_floppy_image_device * to7_qdd_image();
534534   void to7_qdd_stat_update();
535535   UINT8 to7_qdd_read_byte();
536536   void to7_qdd_write_byte( UINT8 data );
537537   void to7_qdd_reset();
538538   void to7_qdd_init();
539   device_t * thmfc_floppy_image();
540   int thmfc_floppy_is_qdd( device_image_interface *image );
541   void thmfc_floppy_index_pulse_cb( device_t *controller,device_t *image, int state );
539   legacy_floppy_image_device * thmfc_floppy_image();
540   int thmfc_floppy_is_qdd( legacy_floppy_image_device *image );
541   void thmfc_floppy_index_pulse_cb( device_t *controller,legacy_floppy_image_device *image, int state );
542542   int thmfc_floppy_find_sector( chrn_id* dst );
543543   void thmfc_floppy_cmd_complete();
544544   UINT8 thmfc_floppy_read_byte();
shelves/new_menus/src/mess/video/gb_lcd.c
r29303r29304
10581058            data = tiles[tile_index] | (tiles[tile_index + 1] << 8);
10591059            data <<= m_layer[l].xshift;
10601060
1061            /* Figure out which palette we're using */
1062            assert(((m_end_x - i) >> 3) >= 0 && ((m_end_x - i) >> 3) < ARRAY_LENGTH(m_sgb_pal_map));
1063            sgb_palette = m_sgb_pal_map[(m_end_x - i) >> 3][m_current_line >> 3] << 2;
1064
10651061            while (i > 0)
10661062            {
1063               /* Figure out which palette we're using */
1064               assert(((m_end_x - i) >> 3) >= 0 && ((m_end_x - i) >> 3) < ARRAY_LENGTH(m_sgb_pal_map));
1065               sgb_palette = m_sgb_pal_map[(m_end_x - i) >> 3][m_current_line >> 3] << 2;
1066
10671067               while ((m_layer[l].xshift < 8) && i)
10681068               {
10691069                  register int colour = ((data & 0x8000) ? 2 : 0) | ((data & 0x0080) ? 1 : 0);
r29303r29304
10881088                  m_layer[l].xshift = 0;
10891089                  tile_index = (map[m_layer[l].xindex] ^ m_gb_tile_no_mod) * 16;
10901090                  data = tiles[tile_index] | (tiles[tile_index + 1] << 8);
1091                  assert(((m_end_x - i) >> 3) >= 0 && ((m_end_x - i) >> 3) < ARRAY_LENGTH(m_sgb_pal_map));
1092                  sgb_palette = m_sgb_pal_map[(m_end_x - i) >> 3][m_current_line >> 3] << 2;
10931091               }
10941092            }
10951093            l++;
shelves/new_menus/src/mess/video/apollo.c
r29303r29304
9696#define LUT_C0          0x01
9797#define LUT_C1_C0(a)    ((a)& (LUT_C1|LUT_C0))
9898
99#define LUT_FIFO_SIZE   1024
10099
101//**************************************************************************
102//  class apollo_graphics
103//**************************************************************************
104
105class apollo_graphics /*: public device_t*/
100apollo_graphics_15i::bt458::bt458(running_machine &running_machine)
106101{
107public:
108   apollo_graphics()
109   {
110   }
111
112   void device_start(running_machine &m_machine);
113   void device_reset();
114   void device_reset_mono19i();
115
116   // monochrome control
117   READ8_DEVICE_HANDLER( apollo_mcr_r );
118   WRITE8_DEVICE_HANDLER( apollo_mcr_w );
119
120   // monochrome and color memory
121   READ16_DEVICE_HANDLER( apollo_mem_r );
122   WRITE16_DEVICE_HANDLER( apollo_mem_w );
123
124   // color control
125   READ8_DEVICE_HANDLER( apollo_ccr_r );
126   WRITE8_DEVICE_HANDLER( apollo_ccr_w );
127
128   UINT32 screen_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
129   void vblank_state_changed(device_t *device, screen_device &screen, bool vblank_state);
130
131   int is_mono() { return m_n_planes == 1; }
132
133private:
134   class lut_fifo;
135   class bt458;
136
137   running_machine &machine() const
138   {
139      assert(m_machine != NULL);
140      return *m_machine;
141   }
142
143   const char *cr_text(offs_t offset, UINT8 data, UINT8 rw);
144
145   void increment_h_clock();
146   void increment_v_clock();
147   void increment_p_clock();
148
149   void log_cr1(const char * text, device_t *device);
150   void set_cr1(device_t *device, UINT8 data);
151   void set_cr3a(device_t *device, UINT8 data);
152   void set_cr3b(device_t *device, UINT8 data);
153   void set_lut_cr(device_t *device, UINT8 data);
154
155   UINT32 set_msb0(UINT32 value, UINT8 data)
156   {
157      return (value & 0xffffff00) | data;
158   }
159   UINT32 set_lsb0(UINT32 value, UINT8 data)
160   {
161      return (value & 0xffff00ff) | (data << 8);
162   }
163   UINT32 set_msb1(UINT32 value, UINT8 data)
164   {
165      return (value & 0xff00ffff) | (data << 16);
166   }
167   UINT32 set_lsb1(UINT32 value, UINT8 data)
168   {
169      return (value & 0x00ffffff) | (data << 24);
170   }
171   UINT8 get_msb1(UINT32 value)
172   {
173      return (value >> 16) & 0xff;
174   }
175   UINT8 get_lsb1(UINT32 value)
176   {
177      return (value >> 24) & 0xff;
178   }
179
180   void set_status_rmw();
181   UINT16 rop(UINT16 dest_data, UINT16 src_data, UINT8 plane);
182   void set_source_data(UINT32 offset);
183   UINT32 get_source_data(UINT8 plane);
184   void blt(UINT32 dest_addr, UINT16 mem_mask);
185
186   UINT8 get_pixel(UINT32 offset, UINT16 mask);
187   UINT8 c4p_read_adc(UINT8 data);
188   UINT8 c8p_read_adc(UINT8 data);
189
190   void screen_update1(bitmap_rgb32 &bitmap, const rectangle &cliprect);
191
192   UINT16 m_n_planes;
193   UINT16 m_width;
194   UINT16 m_height;
195   UINT16 m_buffer_width;
196   UINT16 m_buffer_height;
197
198   UINT8 m_sr;
199   UINT8 m_device_id;
200   UINT16 m_write_enable_register;
201   UINT32 m_rop_register;
202   UINT16 m_diag_mem_request;
203   UINT8 m_cr0;
204   UINT8 m_cr1;
205   UINT8 m_cr2;
206   UINT8 m_cr2b;
207   UINT8 m_cr2_s_data;
208   UINT8 m_cr2_s_plane;
209   UINT8 m_cr2_d_plane;
210   UINT8 m_cr3a;
211   UINT8 m_cr3b;
212   UINT8 m_ad_result;
213   UINT8 m_ad_pending;
214
215   UINT8 m_lut_control;
216   UINT8 m_lut_data;
217
218   UINT8 m_update_flag;
219   UINT8 m_update_pending;
220
221   UINT8 m_blt_cycle_count;
222   UINT32 m_image_offset;
223   UINT32 m_guard_latch[8];
224
225   int m_h_clock;
226   int m_v_clock;
227   int m_p_clock;
228   int m_data_clock;
229
230   UINT16 *m_image_memory;
231   int m_image_plane_size;
232   int m_image_memory_size;
233
234   UINT32 m_color_lookup_table[16];
235
236   lut_fifo *m_lut_fifo;
237   bt458 *m_bt458;
238
239   running_machine *m_machine;
240};
241
242   //**************************************************************************
243   // class LUT Fifo
244   //**************************************************************************
245
246class apollo_graphics::lut_fifo
247{
248public:
249   lut_fifo()
250   {
251      reset();
252   }
253
254   void reset()
255   {
256      m_size = LUT_FIFO_SIZE;
257      m_get_index = 0;
258      m_put_index = 0;
259   }
260
261   void put(const UINT8 data)
262   {
263      if (!is_full())
264      {
265         m_data[m_put_index] = data;
266         m_put_index = (m_put_index + 1) % m_size;
267      }
268   }
269
270   UINT8 get()
271   {
272      UINT8 data = is_empty() ? 0xff : m_data[m_get_index];
273      m_get_index = (m_get_index + 1) % m_size;
274      return data;
275   }
276
277   int is_empty()
278   {
279      return m_get_index == m_put_index;
280   }
281
282   int is_full()
283   {
284      return ((m_put_index + 1) % m_size) == m_get_index;
285   }
286
287private:
288   UINT16 m_size;
289   UINT16 m_get_index;
290   UINT16 m_put_index;
291   UINT8 m_data[LUT_FIFO_SIZE];
292};
293
294//**************************************************************************
295//  class Brooktree Bt458
296//**************************************************************************
297
298class apollo_graphics::bt458
299{
300public:
301   bt458(running_machine &running_machine);
302   void start();
303   void reset();
304   UINT8 read(UINT8 c10);
305   void write(UINT8 data, UINT8 c10);
306   UINT32 get_rgb(UINT8 index);
307
308private:
309   running_machine &machine() const
310   {
311      assert(m_machine != NULL);
312      return *m_machine;
313   }
314
315   UINT8 m_color_counter;
316   UINT8 m_red;
317   UINT8 m_green;
318
319   UINT8 m_address_register;
320   UINT32 m_color_palette_RAM[256];
321   UINT32 m_overlay_color[4];
322   UINT8 m_read_mask_register;
323   UINT8 m_blink_mask_register;
324   UINT8 m_command_register;
325   UINT8 m_control_test_register;
326
327   running_machine *m_machine;
328};
329
330apollo_graphics::bt458::bt458(running_machine &running_machine)
331{
332102   m_machine = &running_machine;
333103}
334104
335void apollo_graphics::bt458::start()
105void apollo_graphics_15i::bt458::start()
336106{
337   MLOG1(("start apollo_graphics::bt458"));
107   MLOG1(("start apollo_graphics_15i::bt458"));
338108}
339109
340void apollo_graphics::bt458::reset()
110void apollo_graphics_15i::bt458::reset()
341111{
342   MLOG1(("reset apollo_graphics::bt458"));
112   MLOG1(("reset apollo_graphics_15i::bt458"));
343113
344114   m_color_counter = 0;
345115   m_red = 0;
r29303r29304
354124   m_control_test_register = 0;
355125}
356126
357void apollo_graphics::bt458::write(UINT8 data, UINT8 c10)
127void apollo_graphics_15i::bt458::write(UINT8 data, UINT8 c10)
358128{
359129   MLOG1(("writing Bt458 data=%02x C1,C0=%d", data, c10));
360130   switch (c10)
r29303r29304
427197   }
428198}
429199
430UINT8 apollo_graphics::bt458::read(UINT8 c10)
200UINT8 apollo_graphics_15i::bt458::read(UINT8 c10)
431201{
432202   UINT8 data = 0xff;
433203
r29303r29304
498268   return data;
499269}
500270
501UINT32 apollo_graphics::bt458::get_rgb(UINT8 index)
271UINT32 apollo_graphics_15i::bt458::get_rgb(UINT8 index)
502272{
503273   return m_color_palette_RAM[index];
504274}
505275
506/*****************************************************************************
507 INLINE FUNCTIONS
508 *****************************************************************************/
509
510INLINE apollo_graphics *get_safe_token(device_t *device)
511{
512   assert(device != NULL);
513   assert(device->type() == APOLLO_GRAPHICS || device->type() == APOLLO_MONO19I );
514   return (apollo_graphics *) downcast<apollo_graphics_15i *> (device)->token();
515}
516
517void apollo_graphics::device_start(running_machine &running_machine)
518{
519   m_n_planes = 0;
520   m_width = 0;
521   m_height = 0;
522   m_buffer_width = 0;
523   m_buffer_height = 0;
524
525   m_sr = 0;
526   m_device_id = 0;
527   m_write_enable_register = 0;
528   m_rop_register = 0;
529   m_diag_mem_request = 0;
530   m_cr0 = 0;
531   m_cr1 = 0;
532   m_cr2 = 0;
533   m_cr2b = 0;
534   m_cr2_s_data = 0;
535   m_cr2_s_plane = 0x00;
536   m_cr2_d_plane = 0x0e;
537   m_cr3a = 0;
538   m_cr3b = 0;
539   m_ad_result = 0;
540   m_ad_pending = 0;
541
542   m_lut_control = 0;
543   m_lut_data = 0;
544
545   m_update_flag = 0;
546   m_update_pending = 0;
547
548   m_blt_cycle_count = 0;
549   m_image_offset = 0;
550   memset(m_guard_latch, 0, sizeof(m_guard_latch));
551
552   m_h_clock = 0;
553   m_v_clock = 0;
554   m_p_clock = 0;
555   m_data_clock = 0;
556
557   m_image_memory = 0;
558   m_image_plane_size = 0;
559   m_image_memory_size = 0;
560
561   memset(m_color_lookup_table, 0, sizeof(m_color_lookup_table));
562
563   m_lut_fifo = NULL;
564   m_bt458 = NULL;
565
566   m_machine = &running_machine;
567}
568
569void apollo_graphics::device_reset()
570{
571   if (m_n_planes == 0)
572   {
573      if (apollo_config(APOLLO_CONF_MONO_19I))
574      {
575         // monochrome 1280x1024
576         m_n_planes = 1;
577         m_device_id = SCREEN_DEVICE_ID_19I;
578         m_width = 1280;
579         m_height = 1024;
580         m_buffer_width = 2048;
581         m_buffer_height = 1024;
582      }
583      else if (apollo_config(APOLLO_CONF_MONO_15I))
584      {
585         // monochrome 1024x800
586         m_n_planes = 1;
587         m_device_id = SCREEN_DEVICE_ID_15I;
588         m_width = 1024;
589         m_height = 800;
590         m_buffer_width = 1024;
591         m_buffer_height = 1024;
592      }
593      else if (apollo_config(APOLLO_CONF_4_PLANES))
594      {
595         // 4-planes color 1024x800
596         m_n_planes = 4;
597         m_device_id = SCREEN_DEVICE_ID_C4P;
598         m_width = 1024;
599         m_height = 800;
600         m_buffer_width = 1024;
601         m_buffer_height = 1024;
602      }
603      else
604      {
605         // 8-planes color 1024x800
606         m_n_planes = 8;
607         m_device_id = SCREEN_DEVICE_ID_C8P;
608         m_width = 1024;
609         m_height = 800;
610         m_buffer_width = 1024;
611         m_buffer_height = 1024;
612
613         m_lut_fifo = new lut_fifo();
614
615         m_bt458 = new bt458(*m_machine);
616         m_bt458->start();
617         m_bt458->reset();
618      }
619   }
620
621   if (m_image_memory == NULL)
622   {
623      /* allocate the memory image */
624      m_image_plane_size = m_buffer_height * m_buffer_width / 16;
625      m_image_memory_size = m_image_plane_size * m_n_planes;
626      m_image_memory
627            = auto_alloc_array(machine(), UINT16, m_image_memory_size);
628      assert(m_image_memory != NULL);
629
630      MLOG1(("device reset apollo graphics: buffer=%p size=%0x", m_image_memory, m_image_memory_size));
631   }
632
633   memset(m_color_lookup_table, 0, sizeof(m_color_lookup_table));
634   memset(m_image_memory, 0, m_image_memory_size * 2);
635
636   //  register_vblank_callback(this);
637}
638
639void apollo_graphics::device_reset_mono19i()
640{
641   if (m_n_planes == 0)
642   {
643      // monochrome 1280x1024
644      m_n_planes = 1;
645      m_device_id = SCREEN_DEVICE_ID_19I;
646      m_width = 1280;
647      m_height = 1024;
648      m_buffer_width = 2048;
649      m_buffer_height = 1024;
650   }
651
652   device_reset();
653}
654
655276/***************************************************************************
656277 Monochrome Controller Registers at 0x5d800 - 0x5dc07
657278 ***************************************************************************/
658279
659const char *apollo_graphics::cr_text(offs_t offset, UINT8 data, UINT8 rw)
280const char *apollo_graphics_15i::cr_text(offs_t offset, UINT8 data, UINT8 rw)
660281{
661282   static const char *cr0[8] =
662283   { "cr0 mode=0 CPU dest BLT", "cr0 mode=1 Alternating BLT",
r29303r29304
708329   }
709330}
710331
711void apollo_graphics::log_cr1(const char * text, device_t *device)
332void apollo_graphics_15i::log_cr1(const char * text)
712333{
713   DLOG2(("%s: cr0=%02x cr1=%02x sr=%02x pixel_clock=%3d/%3d bl=%d vb=%d vs=%d hs=%d hc=%d vck=%d hck=%d pck=%d vd=%d",
334   MLOG2(("%s: cr0=%02x cr1=%02x sr=%02x pixel_clock=%3d/%3d bl=%d vb=%d vs=%d hs=%d hc=%d vck=%d hck=%d pck=%d vd=%d",
714335               text,
715336               m_cr0,
716337               m_cr1,
r29303r29304
728349               m_sr & SR_V_DATA ? 1 : 0));
729350}
730351
731void apollo_graphics::increment_h_clock()
352void apollo_graphics_15i::increment_h_clock()
732353{
733354   MLOG1(("increment_h_clock: sr=%02x m_h_clock=%d", m_sr, m_h_clock));
734355
r29303r29304
809430   m_h_clock++;
810431}
811432
812void apollo_graphics::increment_v_clock()
433void apollo_graphics_15i::increment_v_clock()
813434{
814435   MLOG1(("increment_v_clock: sr=%02x m_v_clock=%d", m_sr, m_v_clock));
815436
r29303r29304
896517   m_data_clock = 0;
897518}
898519
899void apollo_graphics::increment_p_clock()
520void apollo_graphics_15i::increment_p_clock()
900521{
901522   if (m_n_planes == 1)
902523   {
r29303r29304
954575   }
955576}
956577
957void apollo_graphics::set_cr1(device_t *device, UINT8 data)
578void apollo_graphics_15i::set_cr1(UINT8 data)
958579{
959580   UINT8 diffs = m_cr1 ^ data;
960581   m_cr1 = data;
r29303r29304
992613            m_sr = SR_H_CK | SR_V_BLANK | SR_SYNC | SR_DONE;
993614         }
994615      }
995      log_cr1("CR1_RESET", device);
616      log_cr1("CR1_RESET");
996617   }
997618   else
998619   {
999620      if ((diffs & CR1_RESET) && (m_cr1 & CR1_RESET) != 0)
1000621      {
1001         log_cr1("CR1_RESET", device);
622         log_cr1("CR1_RESET");
1002623      }
1003624
1004625      if (dh_clock)
1005626      {
1006627         increment_h_clock();
1007         log_cr1("CR1_DH_CK", device);
628         log_cr1("CR1_DH_CK");
1008629      }
1009630
1010631      if (dv_clock)
1011632      {
1012633         increment_v_clock();
1013         log_cr1("CR1_DV_CK", device);
634         log_cr1("CR1_DV_CK");
1014635      }
1015636
1016637      if (dp_clock)
1017638      {
1018639         increment_p_clock();
1019         log_cr1("CR1_DP_CK", device);
640         log_cr1("CR1_DP_CK");
1020641      }
1021642
1022643      if ((m_sr & SR_V_BLANK) == 0)
r29303r29304
1032653   }
1033654}
1034655
1035void apollo_graphics::set_cr3a(device_t *device, UINT8 data)
656void apollo_graphics_15i::set_cr3a(UINT8 data)
1036657{
1037658   m_cr3a = data;
1038659   if ((data & 0x80) == 0)
r29303r29304
1041662      UINT8 bit_mask = 1 << shift;
1042663      if (data & 0x01)
1043664      {
1044         set_cr1(device, m_cr1 | bit_mask);
665         set_cr1(m_cr1 | bit_mask);
1045666      }
1046667      else
1047668      {
1048         set_cr1(device, m_cr1 & ~bit_mask);
669         set_cr1(m_cr1 & ~bit_mask);
1049670      }
1050671   }
1051672}
1052673
1053void apollo_graphics::set_cr3b(device_t *device, UINT8 data)
674void apollo_graphics_15i::set_cr3b(UINT8 data)
1054675{
1055676   m_cr3b = data;
1056677   if ((data & 0x80) == 0)
r29303r29304
1059680      UINT8 bit_mask = 1 << shift;
1060681      if (data & 0x01)
1061682      {
1062         set_lut_cr(device, m_lut_control | bit_mask);
683         set_lut_cr(m_lut_control | bit_mask);
1063684      }
1064685      else
1065686      {
1066         set_lut_cr(device, m_lut_control & ~bit_mask);
687         set_lut_cr(m_lut_control & ~bit_mask);
1067688      }
1068689   }
1069690}
1070691
1071void apollo_graphics::set_lut_cr(device_t *device, UINT8 data)
692void apollo_graphics_15i::set_lut_cr(UINT8 data)
1072693{
1073694   UINT8 diffs = m_lut_control ^ data;
1074695   m_lut_control = data;
1075696
1076697   if ((diffs & LUT_CPAL_CS) && (data & LUT_CPAL_CS) != 0)
1077698   {
1078      DLOG1(("writing Color Graphics Controller: LUT_CPAL_CS Disabled"));
699      MLOG1(("writing Color Graphics Controller: LUT_CPAL_CS Disabled"));
1079700      while (!m_lut_fifo->is_empty())
1080701      {
1081702         m_bt458->write(m_lut_fifo->get(), LUT_C1_C0(m_lut_control));
r29303r29304
1084705
1085706   if ((diffs & LUT_FIFO_RST) && (data & LUT_FIFO_RST) == 0)
1086707   {
1087      DLOG1(("writing Color Graphics Controller: LUT_FIFO_RST Active"));
708      MLOG1(("writing Color Graphics Controller: LUT_FIFO_RST Active"));
1088709      m_lut_fifo->reset();
1089710      m_sr |= SR_LUT_OK;
1090711   }
1091712
1092713   if ((diffs & LUT_FIFO_CS) && (data & LUT_FIFO_CS) == 0)
1093714   {
1094      DLOG1(("writing Color Graphics Controller: LUT_FIFO_CS Enabled"));
715      MLOG1(("writing Color Graphics Controller: LUT_FIFO_CS Enabled"));
1095716   }
1096717
1097718   if ((diffs & LUT_ST_LUK) && (data & LUT_ST_LUK) == 0)
1098719   {
1099      DLOG1(("writing Color Graphics Controller: LUT_ST_LUK Active"));
720      MLOG1(("writing Color Graphics Controller: LUT_ST_LUK Active"));
1100721      m_sr &= ~SR_LUT_OK;
1101722   }
1102723}
1103724
1104READ8_DEVICE_HANDLER( apollo_graphics::apollo_mcr_r )
725READ8_MEMBER( apollo_graphics_15i::apollo_mcr_r )
1105726{
1106727   UINT8 data;
1107728   switch (offset & 0x407)
r29303r29304
1140761   {
1141762      if (offset == 0)
1142763         status0 = data;
1143      DLOG1(("reading Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 1)));
764      MLOG1(("reading Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 1)));
1144765   }
1145766
1146767   return data;
1147768}
1148769
1149WRITE8_DEVICE_HANDLER( apollo_graphics::apollo_mcr_w )
770WRITE8_MEMBER( apollo_graphics_15i::apollo_mcr_w )
1150771{
1151   DLOG1(("writing Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 0)));
772   MLOG1(("writing Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 0)));
1152773   switch (offset & 0x407)
1153774   {
1154775   case 0:
r29303r29304
1176797      m_cr0 = data;
1177798      break;
1178799   case 0x402:
1179      set_cr1(device, data);
800      set_cr1(data);
1180801      break;
1181802   case 0x404:
1182803      m_cr2 = data;
r29303r29304
1187808      m_sr |= SR_R_M_W;
1188809      break;
1189810   case 0x406:
1190      set_cr3a(device, data);
811      set_cr3a(data);
1191812      break;
1192813   case 0x407: // A/D Channel Register
1193814      m_ad_pending = 1;
r29303r29304
1196817   }
1197818}
1198819
1199void apollo_graphics::set_status_rmw()
820void apollo_graphics_15i::set_status_rmw()
1200821{
1201822   UINT8 plane, d_plane_bit;
1202823   UINT32 rop_reg;
r29303r29304
1225846   }
1226847}
1227848
1228UINT16 apollo_graphics::rop(UINT16 dest_data, UINT16 src_data, UINT8 plane)
849UINT16 apollo_graphics_15i::rop(UINT16 dest_data, UINT16 src_data, UINT8 plane)
1229850{
1230851   UINT16 src_data1 = src_data;
1231852   if (m_cr1 & CR1_ROP_EN)
r29303r29304
1285906   return src_data;
1286907}
1287908
1288void apollo_graphics::set_source_data(UINT32 offset)
909void apollo_graphics_15i::set_source_data(UINT32 offset)
1289910{
1290911   if (m_n_planes == 1 || (m_cr1 & CR1_AD_BIT))
1291912   {
r29303r29304
1305926   }
1306927}
1307928
1308UINT32 apollo_graphics::get_source_data(UINT8 plane)
929UINT32 apollo_graphics_15i::get_source_data(UINT8 plane)
1309930{
1310931   UINT32 src_data;
1311932
r29303r29304
1344965   return src_data;
1345966}
1346967
1347void apollo_graphics::blt(UINT32 dest_addr, UINT16 mem_mask)
968void apollo_graphics_15i::blt(UINT32 dest_addr, UINT16 mem_mask)
1348969{
1349970   UINT16 src_data, dest_data;
1350971   UINT8 d_plane_bit;
r29303r29304
1372993 Color graphics memory space at A0000 - BFFFF
1373994 ***************************************************************************/
1374995
1375READ16_DEVICE_HANDLER( apollo_graphics::apollo_mem_r )
996READ16_MEMBER( apollo_graphics_15i::apollo_mem_r )
1376997{
1377998   UINT16 data;
1378999   UINT32 src_addr;
r29303r29304
13801001   if (offset >= m_image_memory_size)
13811002   {
13821003      // 128 kB display buffer of 15" screen seems to be shadowed from $fa0000 to $fc0000
1383      DLOG1(("reading Graphics Memory at invalid offset %05x", offset));
1004      MLOG1(("reading Graphics Memory at invalid offset %05x", offset));
13841005      offset %= m_image_memory_size;
13851006   }
13861007
r29303r29304
14021023   // omit excessive logging
14031024   if ((offset & (m_image_plane_size - 1)) < 8)
14041025   {
1405      DLOG1(("reading Graphics Memory with mode %d: src_addr %05x = %04x & %04x", CR0_MODE(m_cr0), src_addr, data, mem_mask));
1026      MLOG1(("reading Graphics Memory with mode %d: src_addr %05x = %04x & %04x", CR0_MODE(m_cr0), src_addr, data, mem_mask));
14061027   }
14071028   else if ((offset & (m_image_plane_size - 1)) == 8)
14081029   {
1409      DLOG1(("..."));
1030      MLOG1(("..."));
14101031   }
14111032   return data;
14121033}
14131034
1414WRITE16_DEVICE_HANDLER( apollo_graphics::apollo_mem_w )
1035WRITE16_MEMBER( apollo_graphics_15i::apollo_mem_w )
14151036{
14161037   UINT32 dest_addr;
14171038   UINT32 src_addr;
r29303r29304
14191040   if (offset >= m_image_memory_size)
14201041   {
14211042      // 128 kB display buffer of 15" screen seems to be shadowed from $fa0000 to $fc0000
1422      DLOG1(("writing Graphics Memory at invalid offset %05x = %04x & %04x ", offset, data, mem_mask));
1043      MLOG1(("writing Graphics Memory at invalid offset %05x = %04x & %04x ", offset, data, mem_mask));
14231044      offset %= m_image_memory_size;
14241045   }
14251046
14261047   // omit excessive logging
14271048   if (offset < 24)
14281049   {
1429      DLOG1(("writing Graphics Memory with mode %d: offset=%04x data=%04x mask=%04x", CR0_MODE(m_cr0), offset, data, mem_mask));
1050      MLOG1(("writing Graphics Memory with mode %d: offset=%04x data=%04x mask=%04x", CR0_MODE(m_cr0), offset, data, mem_mask));
14301051   }
14311052   else if (offset == 24)
14321053   {
1433      DLOG1(("..."));
1054      MLOG1(("..."));
14341055   }
14351056
14361057   switch (CR0_MODE(m_cr0))
r29303r29304
15181139      break;
15191140
15201141   default:
1521      DLOG(("writing Graphics Memory - unexpected cr0 mode %d", CR0_MODE(m_cr0)))
1142      MLOG(("writing Graphics Memory - unexpected cr0 mode %d", CR0_MODE(m_cr0)))
15221143      ;
15231144      break;
15241145   }
r29303r29304
15291150 Color Screen
15301151 ***************************************************************************/
15311152
1532READ8_DEVICE_HANDLER( apollo_graphics::apollo_ccr_r )
1153READ8_MEMBER( apollo_graphics_15i::apollo_ccr_r )
15331154{
15341155   UINT8 data;
15351156
r29303r29304
15441165         data = m_ad_result;
15451166         break;
15461167      default:
1547         return apollo_mcr_r(device, space, offset, mem_mask);
1168         return apollo_mcr_r(space, offset, mem_mask);
15481169      }
15491170   }
15501171   else if (m_n_planes == 8)
r29303r29304
15691190         }
15701191         else if ((m_lut_control & LUT_R_W) == 0)
15711192         {
1572            DLOG1(("apollo_graphics::apollo_ccr_r: reading LUT data register with unexpected RW = 0 in LUT Control register"));
1193            MLOG1(("apollo_graphics_15i::apollo_ccr_r: reading LUT data register with unexpected RW = 0 in LUT Control register"));
15731194            data = m_lut_data;
15741195         }
15751196         else if ((m_lut_control & LUT_AD_CS) == 0)
r29303r29304
15821203         }
15831204         else
15841205         {
1585            DLOG1(("apollo_graphics::apollo_ccr_r: reading LUT data register with unexpected CS in LUT Control register"));
1206            MLOG1(("apollo_graphics_15i::apollo_ccr_r: reading LUT data register with unexpected CS in LUT Control register"));
15861207            data = m_lut_data;
15871208         }
15881209         break;
r29303r29304
16031224         data = m_cr3b;
16041225         break;
16051226      default:
1606         return apollo_mcr_r(device, space, offset, mem_mask);
1227         return apollo_mcr_r(space, offset, mem_mask);
16071228      }
16081229   }
16091230   else
r29303r29304
16171238   {
16181239      if (offset == 0)
16191240         status1 = data;
1620      DLOG1(("reading Color Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 1)));
1241      MLOG1(("reading Color Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 1)));
16211242   }
16221243
16231244   return data;
16241245}
16251246
1626UINT8 apollo_graphics::get_pixel(UINT32 offset, UINT16 mask)
1247UINT8 apollo_graphics_15i::get_pixel(UINT32 offset, UINT16 mask)
16271248{
16281249   UINT8 data = 0;
16291250   UINT16 *source_ptr = m_image_memory + offset;
r29303r29304
16661287
16671288// read the 4-plane ADC value for data
16681289
1669UINT8 apollo_graphics::c4p_read_adc(UINT8 data)
1290UINT8 apollo_graphics_15i::c4p_read_adc(UINT8 data)
16701291{
16711292   UINT8 value = 0;
16721293
r29303r29304
17201341
17211342// read the 8-plane ADC value for data
17221343
1723UINT8 apollo_graphics::c8p_read_adc(UINT8 data)
1344UINT8 apollo_graphics_15i::c8p_read_adc(UINT8 data)
17241345{
17251346   UINT8 value = 0;
17261347
r29303r29304
17711392   return value;
17721393}
17731394
1774WRITE8_DEVICE_HANDLER( apollo_graphics::apollo_ccr_w )
1395WRITE8_MEMBER( apollo_graphics_15i::apollo_ccr_w )
17751396{
17761397   static const UINT8 rgb_value[16] =
17771398   { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
r29303r29304
18121433         m_sr |= SR_DONE;
18131434         break;
18141435      default:
1815         apollo_mcr_w(device, space, offset, data, mem_mask);
1436         apollo_mcr_w(space, offset, data, mem_mask);
18161437         return;
18171438      }
18181439   }
r29303r29304
18441465         m_lut_data = data;
18451466         if ((m_lut_control & LUT_R_W) == 1)
18461467         {
1847            DLOG1(("apollo_graphics::apollo_ccr_w: writing LUT data register with RW = 1 in LUT Control register"));
1468            MLOG1(("apollo_graphics_15i::apollo_ccr_w: writing LUT data register with RW = 1 in LUT Control register"));
18481469         }
18491470         else if ((m_lut_control & LUT_AD_CS) == 0)
18501471         {
r29303r29304
18621483         }
18631484         else
18641485         {
1865            DLOG1(("apollo_graphics::apollo_ccr_w: writing LUT data register with unexpected CS in LUT Control register"));
1486            MLOG1(("apollo_graphics_15i::apollo_ccr_w: writing LUT data register with unexpected CS in LUT Control register"));
18661487         }
18671488         break;
18681489      case 0x403:
18691490         // LUT control register
1870         set_lut_cr(device, data);
1491         set_lut_cr(data);
18711492         break;
18721493      case 0x404:
18731494         // cr2a
r29303r29304
18831504         break;
18841505      case 0x407:
18851506         // cr3b
1886         set_cr3b(device, data);
1507         set_cr3b(data);
18871508         break;
18881509      default:
1889         apollo_mcr_w(device, space, offset, data, mem_mask);
1510         apollo_mcr_w(space, offset, data, mem_mask);
18901511         return;
18911512      }
18921513   }
18931514
1894   DLOG1(("writing Color Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 0)));
1515   MLOG1(("writing Color Graphics Controller at offset %03x = %02x (%s)", offset, data, cr_text(offset, data, 0)));
18951516}
18961517
1897READ16_DEVICE_HANDLER( apollo_cgm_r )
1518READ16_MEMBER( apollo_graphics_15i::apollo_cgm_r )
18981519{
1899   apollo_graphics *apollo_graphics = get_safe_token(device);
1900   if (!apollo_graphics->is_mono())
1520   if (!is_mono())
19011521   {
1902      return apollo_graphics->apollo_mem_r(device, space, offset, mem_mask);
1522      return apollo_mem_r(space, offset, mem_mask);
19031523   }
19041524   else
19051525   {
r29303r29304
19071527   }
19081528}
19091529
1910WRITE16_DEVICE_HANDLER( apollo_cgm_w )
1530WRITE16_MEMBER( apollo_graphics_15i::apollo_cgm_w )
19111531{
1912   apollo_graphics *apollo_graphics = get_safe_token(device);
1913   if (!apollo_graphics->is_mono())
1532   if (!is_mono())
19141533   {
1915      apollo_graphics->apollo_mem_w(device, space, offset, data, mem_mask);
1534      apollo_mem_w(space, offset, data, mem_mask);
19161535   }
19171536}
19181537
r29303r29304
19201539 VIDEO HARDWARE
19211540 ***************************************************************************/
19221541
1923UINT32 apollo_graphics::screen_update(bitmap_rgb32 &bitmap,
1924      const rectangle &cliprect)
1542UINT32 apollo_graphics_15i::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
19251543{
19261544   int has_changed = 0;
19271545
r29303r29304
19361554   return has_changed ? 0 : UPDATE_HAS_NOT_CHANGED;
19371555}
19381556
1939void apollo_graphics::screen_update1(bitmap_rgb32 &bitmap,
1940      const rectangle &cliprect)
1557void apollo_graphics_15i::screen_update1(bitmap_rgb32 &bitmap, const rectangle &cliprect)
19411558{
19421559   UINT16 *source_ptr = m_image_memory;
19431560   int x, y;
r29303r29304
20411658 called on each state change of the VBLANK signal
20421659 -------------------------------------------------*/
20431660
2044void apollo_graphics::vblank_state_changed(device_t *device,
2045      screen_device &screen, bool vblank_state)
1661void apollo_graphics_15i::vblank_state_changed(screen_device &screen, bool vblank_state)
20461662{
20471663   if ((m_cr1 & CR1_RESET) && (m_cr1 & CR1_SYNC_EN))
20481664   {
r29303r29304
20771693   }
20781694}
20791695
2080void vblank_state_changed(device_t *device, screen_device &screen,
2081      bool vblank_state)
1696void apollo_graphics_15i::register_vblank_callback()
20821697{
2083   apollo_graphics *apollo_graphics = get_safe_token(device);
2084   apollo_graphics->vblank_state_changed(device, screen, vblank_state);
2085}
1698   MLOG1(("register_vblank_callback"));
20861699
2087static void register_vblank_callback(device_t *device)
2088{
2089   DLOG1(("register_vblank_callback"));
2090
20911700   /* register for VBLANK callbacks */
2092   screen_device *screen = (screen_device *) device->machine().device(
2093         VIDEO_SCREEN_TAG);
2094   screen->register_vblank_callback(vblank_state_delegate(
2095         FUNC(vblank_state_changed),device) );
1701   screen_device *screen = (screen_device *)machine().device(VIDEO_SCREEN_TAG);
1702   screen->register_vblank_callback(vblank_state_delegate(FUNC(apollo_graphics_15i::vblank_state_changed),this));
20961703}
20971704
2098UINT32 apollo_graphics_15i::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
2099{
2100   apollo_graphics *apollo_graphics = get_safe_token(this);
2101   return apollo_graphics->screen_update(bitmap, cliprect);
2102}
21031705
21041706/***************************************************************************
21051707 MACHINE DRIVERS
r29303r29304
21181720
21191721const device_type APOLLO_GRAPHICS = &device_creator<apollo_graphics_15i> ;
21201722
2121apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,
2122      const char *tag, device_t *owner, UINT32 clock) :
2123   device_t(mconfig, APOLLO_GRAPHICS, "Apollo Screen", tag, owner, clock,
2124         "apollo_graphics_15i", __FILE__)
1723apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,const char *tag, device_t *owner, UINT32 clock) :
1724   device_t(mconfig, APOLLO_GRAPHICS, "Apollo Screen", tag, owner, clock,"apollo_graphics_15i", __FILE__),
1725   m_lut_fifo(NULL),
1726   m_bt458(NULL)
21251727{
2126   m_token = new apollo_graphics;
1728   
21271729}
21281730
2129apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,
2130      const char *tag, device_t *owner, UINT32 clock, device_type type,
2131      const char *name, const char *shortname, const char *source) :
2132   device_t(mconfig, type, name, tag, owner, clock, shortname, source)
1731apollo_graphics_15i::apollo_graphics_15i(const machine_config &mconfig,const char *tag, device_t *owner, UINT32 clock, device_type type,const char *name, const char *shortname, const char *source) :
1732   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
1733   m_lut_fifo(NULL),
1734   m_bt458(NULL)
21331735{
2134   m_token = new apollo_graphics;
21351736}
21361737
21371738apollo_graphics_15i::~apollo_graphics_15i()
21381739{
2139   global_free(m_token);
1740   if (m_lut_fifo) global_free(m_lut_fifo);
1741   if (m_bt458) global_free(m_bt458);
21401742}
21411743
21421744//-------------------------------------------------
r29303r29304
21571759{
21581760   MLOG1(("apollo_graphics_15i::device_start"))
21591761
2160   apollo_graphics *apollo_graphics = get_safe_token(this);
2161   apollo_graphics->device_start(machine());
1762   m_n_planes = 0;
1763   m_width = 0;
1764   m_height = 0;
1765   m_buffer_width = 0;
1766   m_buffer_height = 0;
1767
1768   m_sr = 0;
1769   m_device_id = 0;
1770   m_write_enable_register = 0;
1771   m_rop_register = 0;
1772   m_diag_mem_request = 0;
1773   m_cr0 = 0;
1774   m_cr1 = 0;
1775   m_cr2 = 0;
1776   m_cr2b = 0;
1777   m_cr2_s_data = 0;
1778   m_cr2_s_plane = 0x00;
1779   m_cr2_d_plane = 0x0e;
1780   m_cr3a = 0;
1781   m_cr3b = 0;
1782   m_ad_result = 0;
1783   m_ad_pending = 0;
1784
1785   m_lut_control = 0;
1786   m_lut_data = 0;
1787
1788   m_update_flag = 0;
1789   m_update_pending = 0;
1790
1791   m_blt_cycle_count = 0;
1792   m_image_offset = 0;
1793   memset(m_guard_latch, 0, sizeof(m_guard_latch));
1794
1795   m_h_clock = 0;
1796   m_v_clock = 0;
1797   m_p_clock = 0;
1798   m_data_clock = 0;
1799
1800   m_image_memory = 0;
1801   m_image_plane_size = 0;
1802   m_image_memory_size = 0;
1803
1804   memset(m_color_lookup_table, 0, sizeof(m_color_lookup_table));
1805
1806   m_lut_fifo = NULL;
1807   m_bt458 = NULL;
21621808}
21631809
21641810//-------------------------------------------------
r29303r29304
21691815{
21701816   MLOG1(("apollo_graphics_15i::device_reset"));
21711817
2172   apollo_graphics *apollo_graphics = get_safe_token(this);
2173   apollo_graphics->device_reset();
1818   if (m_n_planes == 0)
1819   {
1820      if (apollo_config(APOLLO_CONF_MONO_19I))
1821      {
1822         // monochrome 1280x1024
1823         m_n_planes = 1;
1824         m_device_id = SCREEN_DEVICE_ID_19I;
1825         m_width = 1280;
1826         m_height = 1024;
1827         m_buffer_width = 2048;
1828         m_buffer_height = 1024;
1829      }
1830      else if (apollo_config(APOLLO_CONF_MONO_15I))
1831      {
1832         // monochrome 1024x800
1833         m_n_planes = 1;
1834         m_device_id = SCREEN_DEVICE_ID_15I;
1835         m_width = 1024;
1836         m_height = 800;
1837         m_buffer_width = 1024;
1838         m_buffer_height = 1024;
1839      }
1840      else if (apollo_config(APOLLO_CONF_4_PLANES))
1841      {
1842         // 4-planes color 1024x800
1843         m_n_planes = 4;
1844         m_device_id = SCREEN_DEVICE_ID_C4P;
1845         m_width = 1024;
1846         m_height = 800;
1847         m_buffer_width = 1024;
1848         m_buffer_height = 1024;
1849      }
1850      else
1851      {
1852         // 8-planes color 1024x800
1853         m_n_planes = 8;
1854         m_device_id = SCREEN_DEVICE_ID_C8P;
1855         m_width = 1024;
1856         m_height = 800;
1857         m_buffer_width = 1024;
1858         m_buffer_height = 1024;
21741859
2175   /* FIXME: register for VBLANK callbacks */
2176   register_vblank_callback(this);
2177}
1860         if (m_lut_fifo) global_free(m_lut_fifo);
1861         if (m_bt458) global_free(m_bt458);
21781862
2179READ8_DEVICE_HANDLER( apollo_ccr_r )
2180{
2181   apollo_graphics *apollo_graphics = get_safe_token(device);
2182   return apollo_graphics->apollo_ccr_r(device, space, offset, mem_mask);
2183}
1863         m_lut_fifo = global_alloc(lut_fifo);
21841864
2185WRITE8_DEVICE_HANDLER( apollo_ccr_w )
2186{
2187   apollo_graphics *apollo_graphics = get_safe_token(device);
2188   apollo_graphics->apollo_ccr_w(device, space, offset, data, mem_mask);
1865         m_bt458 = global_alloc(bt458(machine()));
1866         m_bt458->start();
1867         m_bt458->reset();
1868      }
1869   }
1870
1871   if (m_image_memory == NULL)
1872   {
1873      /* allocate the memory image */
1874      m_image_plane_size = m_buffer_height * m_buffer_width / 16;
1875      m_image_memory_size = m_image_plane_size * m_n_planes;
1876      m_image_memory
1877            = auto_alloc_array(machine(), UINT16, m_image_memory_size);
1878      assert(m_image_memory != NULL);
1879
1880      MLOG1(("device reset apollo graphics: buffer=%p size=%0x", m_image_memory, m_image_memory_size));
1881   }
1882
1883   memset(m_color_lookup_table, 0, sizeof(m_color_lookup_table));
1884   memset(m_image_memory, 0, m_image_memory_size * 2);
1885
1886   //  register_vblank_callback(this);
1887   
1888   /* FIXME: register for VBLANK callbacks */
1889   register_vblank_callback();
21891890}
21901891
21911892//-------------------------------------------------
r29303r29304
22401941{
22411942   MLOG1(("apollo_graphics_19i::device_reset"));
22421943
2243   apollo_graphics *apollo_graphics = get_safe_token(this);
2244   apollo_graphics->device_reset_mono19i();
1944   if (m_n_planes == 0)
1945   {
1946      // monochrome 1280x1024
1947      m_n_planes = 1;
1948      m_device_id = SCREEN_DEVICE_ID_19I;
1949      m_width = 1280;
1950      m_height = 1024;
1951      m_buffer_width = 2048;
1952      m_buffer_height = 1024;
1953   }
22451954
1955   apollo_graphics_15i::device_reset();
1956
22461957   /* FIXME: register for VBLANK callbacks */
2247   register_vblank_callback(this);
1958   register_vblank_callback();
22481959}
22491960
2250READ8_DEVICE_HANDLER( apollo_mcr_r )
2251{
2252   apollo_graphics *apollo_graphics = get_safe_token(device);
2253   return apollo_graphics->apollo_mcr_r(device, space, offset, mem_mask);
2254}
22551961
2256WRITE8_DEVICE_HANDLER( apollo_mcr_w )
2257{
2258   apollo_graphics *apollo_graphics = get_safe_token(device);
2259   apollo_graphics->apollo_mcr_w(device, space, offset, data, mem_mask);
2260}
2261
2262READ16_DEVICE_HANDLER( apollo_mgm_r )
2263{
2264   apollo_graphics *apollo_graphics = get_safe_token(device);
2265   if (apollo_graphics->is_mono())
1962READ16_MEMBER( apollo_graphics_15i::apollo_mgm_r )
1963{   
1964   if (is_mono())
22661965   {
2267      return apollo_graphics->apollo_mem_r(device, space, offset, mem_mask);
1966      return apollo_mem_r(space, offset, mem_mask);
22681967   }
22691968   else
22701969   {
r29303r29304
22721971   }
22731972}
22741973
2275WRITE16_DEVICE_HANDLER( apollo_mgm_w )
1974WRITE16_MEMBER( apollo_graphics_15i::apollo_mgm_w )
22761975{
2277   apollo_graphics *apollo_graphics = get_safe_token(device);
2278   if (apollo_graphics->is_mono())
1976   if (is_mono())
22791977   {
2280      apollo_graphics->apollo_mem_w(device, space, offset, data, mem_mask);
1978      apollo_mem_w(space, offset, data, mem_mask);
22811979   }
22821980}
shelves/new_menus/src/mess/video/abc1600.c
r29303r29304
1414    TODO:
1515
1616    - portrait/landscape detection is broken
17    - bottom border is not respected
1817
1918*/
2019
r29303r29304
254253//  abc1600_mover_device - constructor
255254//-------------------------------------------------
256255
257abc1600_mover_device::abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
258   : device_t(mconfig, ABC1600_MOVER, "ABC 1600 Mover", tag, owner, clock, "abc1600mover", __FILE__),
259      device_memory_interface(mconfig, *this),
260      m_space_config("vram", ENDIANNESS_BIG, 16, 18, -1, *ADDRESS_MAP_NAME(mover_map)),
261      m_crtc(*this, SY6845E_TAG),
262      m_palette(*this, "palette"),
263      m_wrmsk_rom(*this, "wrmsk"),
264      m_shinf_rom(*this, "shinf"),
265      m_drmsk_rom(*this, "drmsk")
256abc1600_mover_device::abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
257   device_t(mconfig, ABC1600_MOVER, "ABC 1600 Mover", tag, owner, clock, "abc1600mover", __FILE__),
258   device_memory_interface(mconfig, *this),
259   m_space_config("vram", ENDIANNESS_BIG, 16, 18, -1, *ADDRESS_MAP_NAME(mover_map)),
260   m_crtc(*this, SY6845E_TAG),
261   m_palette(*this, "palette"),
262   m_wrmsk_rom(*this, "wrmsk"),
263   m_shinf_rom(*this, "shinf"),
264   m_drmsk_rom(*this, "drmsk")
266265{
267266}
268267
Property changes on: shelves/new_menus
Modified: svn:mergeinfo
   Merged /trunk:r29153-29180

Previous 199869 Revisions Next


© 1997-2024 The MAME Team