Previous 199869 Revisions Next

r19220 Thursday 29th November, 2012 at 19:01:03 UTC by Curt Coder
(MESS) tiki100: Floppy modernization. (nw)
[src/lib]lib.mak
[src/lib/formats]tiki100_dsk.c* tiki100_dsk.h*
[src/mess/drivers]tiki100.c
[src/mess/includes]tiki100.h

trunk/src/mess/includes/tiki100.h
r19219r19220
77#include "emu.h"
88#include "cpu/z80/z80.h"
99#include "cpu/z80/z80daisy.h"
10#include "formats/basicdsk.h"
11#include "imagedev/flopdrv.h"
10#include "formats/tiki100_dsk.h"
1211#include "machine/ram.h"
1312#include "machine/z80ctc.h"
1413#include "machine/z80dart.h"
1514#include "machine/z80pio.h"
16#include "machine/wd17xx.h"
15#include "machine/wd_fdc.h"
1716#include "sound/ay8910.h"
1817
1918#define SCREEN_TAG      "screen"
r19219r19220
4039        m_ctc(*this, Z80CTC_TAG),
4140        m_fdc(*this, FD1797_TAG),
4241        m_ram(*this, RAM_TAG),
43        m_floppy0(*this, FLOPPY_0),
44        m_floppy1(*this, FLOPPY_1)
42        m_floppy0(*this, FD1797_TAG":0"),
43        m_floppy1(*this, FD1797_TAG":1")
4544   { }
4645
4746   required_device<cpu_device> m_maincpu;
4847   required_device<z80ctc_device> m_ctc;
49   required_device<fd1797_device> m_fdc;
48   required_device<fd1797_t> m_fdc;
5049   required_device<ram_device> m_ram;
51   required_device<legacy_floppy_image_device> m_floppy0;
52   required_device<legacy_floppy_image_device> m_floppy1;
50   required_device<floppy_connector> m_floppy0;
51   required_device<floppy_connector> m_floppy1;
5352
5453   virtual void machine_start();
5554
r19219r19220
6463   DECLARE_WRITE8_MEMBER( system_w );
6564   DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
6665   DECLARE_WRITE8_MEMBER( video_scroll_w );
66   DECLARE_FLOPPY_FORMATS( floppy_formats );
6767
6868   void bankswitch();
6969
trunk/src/mess/drivers/tiki100.c
r19219r19220
1414
1515    - floppy broken
1616    - palette RAM should be written during HBLANK
17    - double sided disks have t0s0,t0s1,t1s0,t1s1... format
1817    - DART clocks
19    - daisy chain order?
2018    - winchester hard disk
2119    - analog/digital I/O
2220    - light pen
r19219r19220
176174
177175    */
178176
179   /* drive select */
180   if (BIT(data, 0)) wd17xx_set_drive(m_fdc, 0);
181   if (BIT(data, 1)) wd17xx_set_drive(m_fdc, 1);
177   // drive select
178   floppy_image_device *floppy = NULL;
182179
183   /* density select */
184   wd17xx_dden_w(m_fdc, BIT(data, 4));
180   if (BIT(data, 0)) floppy = m_floppy0->get_device();
181   if (BIT(data, 1)) floppy = m_floppy1->get_device();
185182
186   /* floppy motor */
187   floppy_mon_w(m_floppy0, !BIT(data, 6));
188   floppy_mon_w(m_floppy1, !BIT(data, 6));
189   floppy_drive_set_ready_state(m_floppy0, BIT(data, 6), 1);
190   floppy_drive_set_ready_state(m_floppy1, BIT(data, 6), 1);
183   m_fdc->set_floppy(floppy);
191184
185   // density select
186   m_fdc->dden_w(BIT(data, 4));
187
188   // floppy motor
189   if (floppy) floppy->mon_w(!BIT(data, 6));
190
192191   /* GRAFIKK key led */
193192   set_led_status(machine(), 1, BIT(data, 5));
194193
r19219r19220
218217   AM_RANGE(0x04, 0x07) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_cd_ba_r, z80dart_cd_ba_w)
219218   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE(Z80PIO_TAG, z80pio_device, read, write)
220219   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x03) AM_WRITE(video_mode_w)
221   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE_LEGACY(FD1797_TAG, wd17xx_r, wd17xx_w)
220   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(FD1797_TAG, fd1797_t, read, write)
222221   AM_RANGE(0x14, 0x14) AM_MIRROR(0x01) AM_WRITE(palette_w)
223222   AM_RANGE(0x16, 0x16) AM_DEVWRITE_LEGACY(AY8912_TAG, ay8910_address_w)
224223   AM_RANGE(0x17, 0x17) AM_DEVREADWRITE_LEGACY(AY8912_TAG, ay8910_r, ay8910_data_w)
225224   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
226225   AM_RANGE(0x1c, 0x1c) AM_MIRROR(0x03) AM_WRITE(system_w)
227//  AM_RANGE(0x20, 0x27) winchester controller
226   AM_RANGE(0x20, 0x27) AM_NOP // winchester controller
228227//  AM_RANGE(0x60, 0x6f) analog I/O (SINTEF)
229228//  AM_RANGE(0x60, 0x67) digital I/O (RVO)
230229//  AM_RANGE(0x70, 0x77) analog/digital I/O
r19219r19220
499498static Z80CTC_INTERFACE( ctc_intf )
500499{
501500   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   /* interrupt handler */
502   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF,z80ctc_device, trg2),   /* ZC/TO0 callback */
501   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF, z80ctc_device, trg2),   /* ZC/TO0 callback */
503502   DEVCB_DRIVER_LINE_MEMBER(tiki100_state, ctc_z1_w),      /* ZC/TO1 callback */
504   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF,z80ctc_device, trg3)   /* ZC/TO2 callback */
503   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF, z80ctc_device, trg3)   /* ZC/TO2 callback */
505504};
506505
507506/* FD1797 Interface */
508507
509static const wd17xx_interface fdc_intf =
510{
511   DEVCB_NULL,
512   DEVCB_NULL,
513   DEVCB_NULL,
514   { FLOPPY_0, FLOPPY_1, NULL, NULL }
515};
508FLOPPY_FORMATS_MEMBER( tiki100_state::floppy_formats )
509   FLOPPY_TIKI100_FORMAT
510FLOPPY_FORMATS_END
516511
512static SLOT_INTERFACE_START( tiki100_floppies )
513   SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) // Tead FD-55A
514   SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // Teac FD-55F
515SLOT_INTERFACE_END
516
517517/* AY-3-8912 Interface */
518518
519519WRITE8_MEMBER( tiki100_state::video_scroll_w )
r19219r19220
536536static const z80_daisy_config tiki100_daisy_chain[] =
537537{
538538   { Z80CTC_TAG },
539   { Z80PIO_TAG },
540539   { Z80DART_TAG },
540   { Z80PIO_TAG },
541541   { NULL }
542542};
543543
r19219r19220
572572   save_item(NAME(m_keylatch));
573573}
574574
575// physical disks have 2:1 sector interleave
576static LEGACY_FLOPPY_OPTIONS_START(tiki100)
577   LEGACY_FLOPPY_OPTION(tiki100, "dsk", "SSSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
578      HEADS([1])
579      TRACKS([40])
580      SECTORS([18])
581      SECTOR_LENGTH([128])
582      FIRST_SECTOR_ID([1]))
583   LEGACY_FLOPPY_OPTION(tiki100, "dsk", "SSDD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
584      HEADS([1])
585      TRACKS([40])
586      SECTORS([10])
587      SECTOR_LENGTH([512])
588      FIRST_SECTOR_ID([1]))
589   LEGACY_FLOPPY_OPTION(tiki100, "dsk", "DSDD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
590      HEADS([2])
591      TRACKS([40])
592      SECTORS([10])
593      SECTOR_LENGTH([512])
594      FIRST_SECTOR_ID([1]))
595   LEGACY_FLOPPY_OPTION(tiki100, "dsk", "DSHD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
596      HEADS([2])
597      TRACKS([80])
598      SECTORS([10])
599      SECTOR_LENGTH([512])
600      FIRST_SECTOR_ID([1]))
601LEGACY_FLOPPY_OPTIONS_END
602
603static const floppy_interface tiki100_floppy_interface =
604{
605   DEVCB_NULL,
606   DEVCB_NULL,
607   DEVCB_NULL,
608   DEVCB_NULL,
609   DEVCB_NULL,
610   FLOPPY_STANDARD_5_25_DSHD,
611   LEGACY_FLOPPY_OPTIONS_NAME(tiki100),
612   "floppy_5_25",
613   NULL
614};
615
616575/* Machine Driver */
617576
618577static MACHINE_CONFIG_START( tiki100, tiki100_state )
r19219r19220
638597   MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_8MHz/4, pio_intf)
639598   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_8MHz/4, ctc_intf)
640599   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", tiki100_state, ctc_tick, attotime::from_hz(XTAL_8MHz/4))
641   MCFG_FD1797_ADD(FD1797_TAG, fdc_intf) // FD1767PL-02 or FD1797-PL
642   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tiki100_floppy_interface)
600   MCFG_FD1797x_ADD(FD1797_TAG, XTAL_8MHz/8) // FD1767PL-02 or FD1797-PL
601   MCFG_FLOPPY_DRIVE_ADD(FD1797_TAG":0", tiki100_floppies, "525dd", NULL, tiki100_state::floppy_formats)
602   MCFG_FLOPPY_DRIVE_ADD(FD1797_TAG":1", tiki100_floppies, "525dd", NULL, tiki100_state::floppy_formats)
643603
644604   /* sound hardware */
645605   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/lib/formats/tiki100_dsk.c
r0r19220
1/***************************************************************************
2
3    Copyright Olivier Galibert
4    All rights reserved.
5
6    Redistribution and use in source and binary forms, with or without
7    modification, are permitted provided that the following conditions are
8    met:
9
10        * Redistributions of source code must retain the above copyright
11          notice, this list of conditions and the following disclaimer.
12        * Redistributions in binary form must reproduce the above copyright
13          notice, this list of conditions and the following disclaimer in
14          the documentation and/or other materials provided with the
15          distribution.
16        * Neither the name 'MAME' nor the names of its contributors may be
17          used to endorse or promote products derived from this software
18          without specific prior written permission.
19
20    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
21    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
24    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30    POSSIBILITY OF SUCH DAMAGE.
31
32****************************************************************************/
33
34/*********************************************************************
35
36    formats/tiki100_dsk.c
37
38    TIKI 100 disk image format
39
40*********************************************************************/
41
42#include "emu.h"
43#include "formats/tiki100_dsk.h"
44
45tiki100_format::tiki100_format() : wd177x_format(formats)
46{
47}
48
49const char *tiki100_format::name() const
50{
51   return "tiki100";
52}
53
54const char *tiki100_format::description() const
55{
56   return "TIKI 100 disk image";
57}
58
59const char *tiki100_format::extensions() const
60{
61   return "dsk";
62}
63
64// Unverified gap sizes
65// physical disks have 2:1 sector interleave
66// double sided disks have t0s0,t0s1,t1s0,t1s1... format
67const tiki100_format::format tiki100_format::formats[] = {
68   {   //  90K 5 1/4 inch single density single sided
69      floppy_image::FF_525, floppy_image::SSSD,
70      2000, 18, 40, 1, 128, {}, 1, {}, 80, 22, 20
71   },
72   {   //  200K 5 1/4 inch double density single sided
73      floppy_image::FF_525, floppy_image::SSDD,
74    2000, 10, 40, 1, 512, {}, 1, {}, 80, 22, 20
75   },
76   {   //  400K 5 1/4 inch double density
77      floppy_image::FF_525, floppy_image::DSDD,
78    2000, 10, 40, 2, 512, {}, 1, {}, 80, 22, 20
79   },
80   {   //  800K 5 1/4 inch quad density
81      floppy_image::FF_525, floppy_image::DSQD,
82    2000, 10, 80, 2, 512, {}, 1, {}, 80, 22, 20
83   },
84   {}
85};
86
87const floppy_format_type FLOPPY_TIKI100_FORMAT = &floppy_image_format_creator<tiki100_format>;
trunk/src/lib/formats/tiki100_dsk.h
r0r19220
1/*********************************************************************
2
3    formats/tiki100_dsk.h
4
5    TIKI 100 disk image format
6
7*********************************************************************/
8
9#ifndef TIKI100_DSK_H_
10#define TIKI100_DSK_H_
11
12#include "wd177x_dsk.h"
13
14class tiki100_format : public wd177x_format {
15public:
16   tiki100_format();
17
18   virtual const char *name() const;
19   virtual const char *description() const;
20   virtual const char *extensions() const;
21
22private:
23   static const format formats[];
24};
25
26extern const floppy_format_type FLOPPY_TIKI100_FORMAT;
27
28#endif
trunk/src/lib/lib.mak
r19219r19220
169169   $(LIBOBJ)/formats/thom_cas.o   \
170170   $(LIBOBJ)/formats/thom_dsk.o   \
171171   $(LIBOBJ)/formats/ti99_dsk.o   \
172   $(LIBOBJ)/formats/tiki100_dsk.o   \
172173   $(LIBOBJ)/formats/trd_dsk.o      \
173174   $(LIBOBJ)/formats/trs_cas.o      \
174175   $(LIBOBJ)/formats/trs_dsk.o      \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team