Previous 199869 Revisions Next

r19223 Thursday 29th November, 2012 at 19:02:30 UTC by Curt Coder
(MESS) vixen: Floppy modernization. (nw)
[src/mess/drivers]vixen.c
[src/mess/includes]vixen.h

trunk/src/mess/drivers/vixen.c
r19222r19223
5454*/
5555
5656
57#include "emu.h"
58#include "cpu/z80/z80.h"
59#include "imagedev/flopdrv.h"
60#include "machine/ram.h"
61#include "machine/i8155.h"
62#include "machine/ieee488.h"
63#include "machine/i8251.h"
64#include "machine/wd17xx.h"
65#include "sound/discrete.h"
6657#include "includes/vixen.h"
6758
6859
r19222r19223
242233
243234    */
244235
245   UINT8 data = 0xff; //0xfc;
236   UINT8 data = 0xff;
246237
247238   // TODO ring indicator
248   //data |= rs232_ri_r(m_rs232);
249239
250240   // TODO data carrier detect
251   //data |= rs232_dcd_r(m_rs232) << 1;
252241
253242   return data;
254243}
r19222r19223
277266static ADDRESS_MAP_START( vixen_io, AS_IO, 8, vixen_state )
278267   ADDRESS_MAP_UNMAP_HIGH
279268   ADDRESS_MAP_GLOBAL_MASK(0xff)
280   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY(FDC1797_TAG, wd17xx_r, wd17xx_w)
269   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE(FDC1797_TAG, fd1797_t, read, write)
281270   AM_RANGE(0x04, 0x04) AM_MIRROR(0x03) AM_READWRITE(status_r, cmd_w)
282271   AM_RANGE(0x08, 0x08) AM_MIRROR(0x01) AM_DEVREADWRITE(P8155H_TAG, i8155_device, read, write)
283272   AM_RANGE(0x0c, 0x0d) AM_DEVWRITE(P8155H_TAG, i8155_device, ale_w)
r19222r19223
422411
423412
424413//-------------------------------------------------
425//  SCREEN_UPDATE_IND16( vixen )
414//  SCREEN_UPDATE( vixen )
426415//-------------------------------------------------
427416
428UINT32 vixen_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
417UINT32 vixen_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
429418{
430419   for (int txadr = 0; txadr < 26; txadr++)
431420   {
r19222r19223
470459            {
471460               int color = (BIT(char_data, 7 - x) ^ reverse) & !blank;
472461
473               bitmap.pix16((txadr * 10) + scan, (chadr * 8) + x) = color;
462               bitmap.pix32((txadr * 10) + scan, (chadr * 8) + x) = RGB_MONOCHROME_AMBER[color];
474463            }
475464         }
476465      }
r19222r19223
532521
533522        bit     description
534523
535        0       DSEL1
536        1       DSEL2
537        2       DDEN
538        3       ALT CHARSET
524        0       DSEL1/
525        1       DSEL2/
526        2       DDEN/
527        3       ALT CHARSET/
539528        4       256 CHARS
540529        5       BEEP ENB
541530        6
r19222r19223
544533    */
545534
546535   // drive select
547   if (!BIT(data, 0)) wd17xx_set_drive(m_fdc, 0);
548   if (!BIT(data, 1)) wd17xx_set_drive(m_fdc, 1);
536   floppy_image_device *floppy = NULL;
549537
538   if (!BIT(data, 0)) floppy = m_floppy0->get_device();
539   if (!BIT(data, 1)) floppy = m_floppy1->get_device();
540
541   m_fdc->set_floppy(floppy);
542
543   if (floppy) floppy->mon_w(0);
544
550545   // density select
551   wd17xx_dden_w(m_fdc, BIT(data, 2));
546   m_fdc->dden_w(BIT(data, 2));
552547
553548   // charset
554549   m_alt = BIT(data, 3);
r19222r19223
720715   DEVCB_NULL
721716};
722717
718static SLOT_INTERFACE_START( vixen_floppies )
719   SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
720SLOT_INTERFACE_END
723721
724//-------------------------------------------------
725//  wd17xx_interface fdc_intf
726//-------------------------------------------------
727
728static const floppy_interface vixen_floppy_interface =
722void vixen_state::fdc_intrq_w(bool state)
729723{
730    DEVCB_NULL,
731   DEVCB_NULL,
732    DEVCB_NULL,
733    DEVCB_NULL,
734    DEVCB_NULL,
735    FLOPPY_STANDARD_5_25_SSDD_40,
736    LEGACY_FLOPPY_OPTIONS_NAME(default),
737    "floppy_5_25",
738   NULL
739};
740
741WRITE_LINE_MEMBER( vixen_state::fdint_w )
742{
743724   m_fdint = state;
744725   update_interrupt();
745726}
746727
747static const wd17xx_interface fdc_intf =
748{
749   DEVCB_NULL,
750    DEVCB_DRIVER_LINE_MEMBER(vixen_state, fdint_w),
751   DEVCB_NULL,
752   { FLOPPY_0, FLOPPY_1, NULL, NULL }
753};
754728
755729
756
757730//**************************************************************************
758731//  MACHINE INITIALIZATION
759732//**************************************************************************
r19222r19223
822795   m_cmd_d0 = 0;
823796   m_cmd_d1 = 0;
824797   update_interrupt();
798
799   m_fdc->reset();
800   m_io_i8155->reset();
801   m_usart->reset();
825802}
826803
827804
r19222r19223
846823   MCFG_SCREEN_RAW_PARAMS(XTAL_23_9616MHz/2, 96*8, 0*8, 81*8, 27*10, 0*10, 26*10)
847824   MCFG_TIMER_DRIVER_ADD_SCANLINE("vsync", vixen_state, vsync_tick, SCREEN_TAG, 26*10, 27*10)
848825
849   MCFG_PALETTE_LENGTH(2)
850   MCFG_PALETTE_INIT(monochrome_amber)
851
852826   // sound hardware
853827   MCFG_SPEAKER_STANDARD_MONO("mono")
854828   MCFG_SOUND_ADD(DISCRETE_TAG, DISCRETE, 0)
r19222r19223
859833   MCFG_I8155_ADD(P8155H_TAG, XTAL_23_9616MHz/6, i8155_intf)
860834   MCFG_I8155_ADD(P8155H_IO_TAG, XTAL_23_9616MHz/6, io_i8155_intf)
861835   MCFG_I8251_ADD(P8251A_TAG, usart_intf)
862   MCFG_FD1797_ADD(FDC1797_TAG, fdc_intf)
863   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(vixen_floppy_interface)
836   MCFG_FD1797x_ADD(FDC1797_TAG, XTAL_23_9616MHz/24)
837   MCFG_FLOPPY_DRIVE_ADD(FDC1797_TAG":0", vixen_floppies, "525dd", NULL, floppy_image_device::default_floppy_formats)
838   MCFG_FLOPPY_DRIVE_ADD(FDC1797_TAG":1", vixen_floppies, "525dd", NULL, floppy_image_device::default_floppy_formats)
864839   MCFG_IEEE488_BUS_ADD(ieee488_intf)
865840
866841   /* software lists */
867   MCFG_SOFTWARE_LIST_ADD("disk_list","vixen")
842   MCFG_SOFTWARE_LIST_ADD("disk_list", "vixen")
868843
869844   // internal ram
870845   MCFG_RAM_ADD(RAM_TAG)
trunk/src/mess/includes/vixen.h
r19222r19223
33#ifndef __VIXEN__
44#define __VIXEN__
55
6#include "emu.h"
7#include "cpu/z80/z80.h"
8#include "machine/i8155.h"
9#include "machine/i8251.h"
10#include "machine/ieee488.h"
611#include "machine/ram.h"
12#include "machine/wd_fdc.h"
13#include "sound/discrete.h"
714
815#define Z8400A_TAG      "5f"
916#define FDC1797_TAG      "5n"
r19222r19223
2532        m_discrete(*this, DISCRETE_TAG),
2633        m_ieee488(*this, IEEE488_TAG),
2734        m_ram(*this, RAM_TAG),
28        m_floppy0(*this, FLOPPY_0),
29        m_floppy1(*this, FLOPPY_1),
35        m_floppy0(*this, FDC1797_TAG":0"),
36        m_floppy1(*this, FDC1797_TAG":1"),
3037        m_fdint(0),
3138        m_vsync(0),
3239        m_srq(1),
r19222r19223
3744   { }
3845
3946   required_device<cpu_device> m_maincpu;
40   required_device<fd1797_device> m_fdc;
47   required_device<fd1797_t> m_fdc;
4148   required_device<i8155_device> m_io_i8155;
4249   required_device<i8251_device> m_usart;
4350   required_device<discrete_sound_device> m_discrete;
4451   required_device<ieee488_device> m_ieee488;
4552   required_device<ram_device> m_ram;
46   required_device<legacy_floppy_image_device> m_floppy0;
47   required_device<legacy_floppy_image_device> m_floppy1;
53   required_device<floppy_connector> m_floppy0;
54   required_device<floppy_connector> m_floppy1;
4855
4956   virtual void machine_start();
5057   virtual void machine_reset();
5158
5259   virtual void video_start();
53   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
60   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5461
5562   void update_interrupt();
5663
r19222r19223
6976   DECLARE_WRITE_LINE_MEMBER( atn_w );
7077   DECLARE_WRITE_LINE_MEMBER( rxrdy_w );
7178   DECLARE_WRITE_LINE_MEMBER( txrdy_w );
72   DECLARE_WRITE_LINE_MEMBER( fdint_w );
79   void fdc_intrq_w(bool state);
7380   DIRECT_UPDATE_MEMBER(vixen_direct_update_handler);
7481
7582   // memory state
r19222r19223
8289   int m_cmd_d0;
8390   int m_cmd_d1;
8491
85   int m_fdint;
92   bool m_fdint;
8693   int m_vsync;
8794
8895   int m_srq;
r19222r19223
104111   const UINT8 *m_sync_rom;
105112   const UINT8 *m_char_rom;
106113   DECLARE_DRIVER_INIT(vixen);
107   UINT32 screen_update_vixen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
108114   TIMER_DEVICE_CALLBACK_MEMBER(vsync_tick);
109115};
110116

Previous 199869 Revisions Next


© 1997-2024 The MAME Team