Previous 199869 Revisions Next

r19519 Thursday 13th December, 2012 at 12:41:31 UTC by Miodrag Milanović
specimx: made floppy boot with new core, still some stalling to fix (nw)
[src/mess/drivers]special.c
[src/mess/includes]special.h
[src/mess/machine]b2m.c special.c

trunk/src/mess/machine/special.c
r19518r19519
221221MACHINE_START_MEMBER(special_state,specimx)
222222{
223223   m_specimx_audio = machine().device("custom");
224   m_drive = 0;
225   m_fdc->setup_drq_cb(fd1793_t::line_cb(FUNC(special_state::fdc_drq), this));
224226}
225227
226228TIMER_CALLBACK_MEMBER(special_state::setup_pit8253_gates)
r19518r19519
236238{
237239   specimx_set_bank(2, 0); // Initiali load ROM disk
238240   machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(special_state::setup_pit8253_gates),this));
239   device_t *fdc = machine().device("wd1793");
240   wd17xx_set_pause_time(fdc,12);
241   wd17xx_dden_w(fdc, 0);
242241}
243242
244243READ8_MEMBER( special_state::specimx_disk_ctrl_r )
r19518r19519
246245   return 0xff;
247246}
248247
248void special_state::fdc_drq(bool state)
249{
250   /* Clears HALT state of CPU when data is ready to read */
251   if(state) {
252      m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
253   }
254}
255
249256WRITE8_MEMBER( special_state::specimx_disk_ctrl_w )
250257{
258   static const char *names[] = { "fd0", "fd1"};
259   floppy_image_device *floppy = NULL;
260   floppy_connector *con = machine().device<floppy_connector>(names[m_drive & 1]);
261   if(con)
262      floppy = con->get_device();
263
264   m_fdc->set_floppy(floppy);
265   floppy->mon_w(0);
266
251267   switch(offset)
252268   {
269      case 0 :
270            m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
271            break;
253272      case 2 :
254            wd17xx_set_side(m_fdc, data & 1);
273            floppy->ss_w(data & 1);
255274            break;
256275      case 3 :
257            wd17xx_set_drive(m_fdc, data & 1);
276            m_drive = data & 1;
258277            break;
259278   }
260279}
r19518r19519
380399
381400WRITE8_MEMBER( special_state::erik_disk_reg_w )
382401{
402/*
383403   wd17xx_set_side (m_fdc,data & 1);
384404   wd17xx_set_drive(m_fdc,(data >> 1) & 1);
385405   wd17xx_dden_w(m_fdc, BIT(data, 2));
386406   floppy_mon_w(floppy_get_device(machine(), BIT(data, 1)), 0);
387407   floppy_mon_w(floppy_get_device(machine(), BIT(data, 1) ^ 1), 1);
388   floppy_drive_set_ready_state(floppy_get_device(machine(), BIT(data, 1)), 1, 1);
408   floppy_drive_set_ready_state(floppy_get_device(machine(), BIT(data, 1)), 1, 1);*/
389409}
trunk/src/mess/machine/b2m.c
r19518r19519
226226   if (m_b2m_drive!=drive) {
227227      m_b2m_drive = drive;
228228   }
229   floppy->ss_w(side);
229   
230230   if (m_b2m_side!=side) {
231231      m_b2m_side = side;
232      floppy->ss_w(side);   
232233   }
233234   /*
234235      When bit 5 is set CPU is in HALT state and stay there until
trunk/src/mess/includes/special.h
r19518r19519
1515#include "machine/i8255.h"
1616#include "machine/pit8253.h"
1717#include "imagedev/cassette.h"
18#include "imagedev/flopdrv.h"
19#include "formats/basicdsk.h"
2018#include "formats/rk_cas.h"
21#include "formats/smx_dsk.h"
22#include "machine/wd17xx.h"
19#include "machine/wd_fdc.h"
2320#include "machine/ram.h"
2421
2522
r19518r19519
3027      : driver_device(mconfig, type, tag),
3128   m_maincpu(*this, "maincpu"),
3229   m_ppi(*this, "ppi8255"),
33   m_fdc(*this, "wd1793"),
30   m_fdc(*this, "fd1793"),
3431   m_dac(*this, "dac"),
3532   m_cass(*this, CASSETTE_TAG),
3633   m_ram(*this, RAM_TAG),
r19518r19519
7370   UINT8 m_RC_register;
7471   required_device<cpu_device> m_maincpu;
7572   optional_device<i8255_device> m_ppi;
76   optional_device<fd1793_device> m_fdc;
73   optional_device<fd1793_t> m_fdc;
7774   optional_device<dac_device> m_dac;
7875   optional_device<cassette_image_device> m_cass;
7976   optional_device<ram_device> m_ram;
8077   optional_shared_ptr<UINT8> m_p_videoram;
78   int m_drive;
8179   DECLARE_DRIVER_INIT(erik);
8280   DECLARE_DRIVER_INIT(special);
8381   DECLARE_MACHINE_RESET(special);
r19518r19519
9694   UINT32 screen_update_specimx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9795   TIMER_CALLBACK_MEMBER(special_reset);
9896   TIMER_CALLBACK_MEMBER(setup_pit8253_gates);
97   void fdc_drq(bool state);   
9998};
10099
101100
trunk/src/mess/drivers/special.c
r19518r19519
4444   AM_RANGE(0xf1, 0xf1) AM_READWRITE(erik_rr_reg_r, erik_rr_reg_w)
4545   AM_RANGE(0xf2, 0xf2) AM_READWRITE(erik_rc_reg_r, erik_rc_reg_w)
4646   AM_RANGE(0xf3, 0xf3) AM_READWRITE(erik_disk_reg_r, erik_disk_reg_w)
47   AM_RANGE(0xf4, 0xf4) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_status_r, wd17xx_command_w)
48   AM_RANGE(0xf5, 0xf5) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_track_r, wd17xx_track_w)
49   AM_RANGE(0xf6, 0xf6) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_sector_r, wd17xx_sector_w)
50   AM_RANGE(0xf7, 0xf7) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_data_r, wd17xx_data_w)
47   AM_RANGE(0xf4, 0xf7) AM_DEVREADWRITE("fd1793", fd1793_t, read, write)
5148ADDRESS_MAP_END
5249
5350static ADDRESS_MAP_START(specimx_mem, AS_PROGRAM, 8, special_state )
r19518r19519
5855   AM_RANGE( 0xffc0, 0xffdf ) AM_RAMBANK("bank4")
5956   AM_RANGE( 0xffe0, 0xffe3 ) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
6057   AM_RANGE( 0xffe4, 0xffe7 ) AM_RAM //external 8255
61   AM_RANGE( 0xffe8, 0xffe8 ) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_status_r,wd17xx_command_w)
62   AM_RANGE( 0xffe9, 0xffe9 ) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_track_r,wd17xx_track_w)
63   AM_RANGE( 0xffea, 0xffea ) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_sector_r,wd17xx_sector_w)
64   AM_RANGE( 0xffea, 0xffeb ) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_data_r,wd17xx_data_w)
58   AM_RANGE( 0xffe8, 0xffeb ) AM_DEVREADWRITE("fd1793", fd1793_t, read, write)
6559   AM_RANGE( 0xffec, 0xffef ) AM_DEVREADWRITE_LEGACY("pit8253", pit8253_r, pit8253_w)
6660   AM_RANGE( 0xfff0, 0xfff3 ) AM_READWRITE(specimx_disk_ctrl_r, specimx_disk_ctrl_w)
6761   AM_RANGE( 0xfff8, 0xfff8 ) AM_READWRITE(specimx_video_color_r,specimx_video_color_w)
r19518r19519
385379   NULL
386380};
387381
388static const floppy_interface specimx_floppy_interface =
389{
390   DEVCB_NULL,
391   DEVCB_NULL,
392   DEVCB_NULL,
393   DEVCB_NULL,
394   DEVCB_NULL,
395   FLOPPY_STANDARD_5_25_DSHD,
396   LEGACY_FLOPPY_OPTIONS_NAME(specimx),
397   NULL,
398   NULL
399};
382static SLOT_INTERFACE_START( specimx_floppies )
383   SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
384SLOT_INTERFACE_END
400385
401386/* Machine driver */
402387static MACHINE_CONFIG_START( special, special_state )
r19518r19519
459444   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
460445
461446   /* Devices */
462   MCFG_FD1793_ADD("wd1793", default_wd17xx_interface_2_drives )
463   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(specimx_floppy_interface)
447   MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
464448
449   MCFG_FLOPPY_DRIVE_ADD("fd0", specimx_floppies, "525dd", 0, floppy_image_device::default_floppy_formats)
450   MCFG_FLOPPY_DRIVE_ADD("fd1", specimx_floppies, "525dd", 0, floppy_image_device::default_floppy_formats)
451
465452   /* internal ram */
466453   MCFG_RAM_ADD(RAM_TAG)
467454   MCFG_RAM_DEFAULT_SIZE("128K")
r19518r19519
495482
496483   /* Devices */
497484   MCFG_CASSETTE_ADD( CASSETTE_TAG, special_cassette_interface )
498   MCFG_FD1793_ADD("wd1793", default_wd17xx_interface_2_drives )
499   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(specimx_floppy_interface)
500485   MCFG_I8255_ADD( "ppi8255", specialist_ppi8255_interface )
486   MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
501487
488   MCFG_FLOPPY_DRIVE_ADD("fd0", specimx_floppies, "525dd", 0, floppy_image_device::default_floppy_formats)
489   MCFG_FLOPPY_DRIVE_ADD("fd1", specimx_floppies, "525dd", 0, floppy_image_device::default_floppy_formats)   
490
502491   /* internal ram */
503492   MCFG_RAM_ADD(RAM_TAG)
504493   MCFG_RAM_DEFAULT_SIZE("192K")

Previous 199869 Revisions Next


© 1997-2024 The MAME Team