Previous 15994 Revisions Next

r9228 Sunday 26th September, 2010 at 20:03:39 UTC by Miodrag Milanović
[HECTOR] Added initial support for DISK II unit [JJ Stacino]
[docs]messnew.txt
[src/mess]mess.mak
[src/mess/drivers]hec2hrp.c
[src/mess/includes]hec2hrp.h
[src/mess/machine]hec2hrp.c hecdisk2.c*

src/mess/machine/hecdisk2.c
r0r9228
1/*******************************************************/
2/************ HECDISK2.C  in machine  ******************/
3/*******************************************************/
4
5/* Lecteur de disquette DISK II pour les machines :
6        Hector HRX
7        Hector MX40c
8        Hector MX80c
9
10      JJStacino  jj.stacino@aliceadsl.fr
11     
12   26/09/2010 : first sending with bug2 (the first "dir" command finih with a crash of the Z80 disk II proc)
13*/
14/* explication bug 1.
15A Y E : Les interruptions pour venir en 6C4 se font à un rythme trop grand : des que le processeur
16à envoyé la commande au uPD celui ci repond NMI.
17sans laisser le temps au prog d'avancer !!!
18Ensuite à chaque pas apres un IN j'ai une nouvelle interruption sans avoir termine la precedente. C'est
19pourquoi en visu cela ne fait que de in en 6b4 sans jamais pouvoir aller en inc HL !!! Le positonnement de
20HL se faisant apres le pop HL de x0687 - e ne se faisait pas !!!!
21(ff09 etait l'adresse du dernier octet de commande au uPD !!!
22bug 2 : Revoir les interruptionse & NMI.
23*/
24
25#include "emu.h"
26
27#include "sound/sn76477.h"   /* for sn sound*/
28#include "sound/wave.h"      /* for K7 sound*/
29#include "sound/discrete.h"  /* for 1 Bit sound*/
30#include "machine/upd765.h"   /* for floppy disc controller */
31#include "formats/basicdsk.h"
32#include "cpu/z80/z80.h"
33
34#include "includes/hec2hrp.h"
35
36/* Disquette timer*/
37static TIMER_CALLBACK( Callback_DMA_irq );
38static emu_timer *DMA_timer;
39static TIMER_CALLBACK( Callback_INT_irq );
40static emu_timer *INT_timer;
41
42
43/* Callback uPD request */
44UPD765_DMA_REQUEST( disk2_fdc_dma_irq );
45
46UINT8 Disk2memory[0x10000];  /* Memory space for Disk II unit*/
47UINT8 Mem_RNMI =0xff;
48/* Buffer of the 74374 (IC1 and IC4) linked to the Hector port */
49UINT8 disk2_data_r_ready=0x0; /* =ff when PC2 = true and data in read buffer (disk2_data_read) */
50UINT8 disk2_data_w_ready=0x0; /* =ff when Disk 2 Port 40 had send a data in write buffer (disk2_data_write) */
51UINT8 disk2_data_read=0;    /* Data send by Hector to Disk 2 when PC2=true */
52UINT8 disk2_data_write=0;   /* Data send by Disk 2 to Hector when Write Port I/O 40 */
53UINT8 disk2_RNMI = 0;      /* State of I/O 50 D5 = authorization for INT / NMI */
54static int NMI_current_state=0;
55static int INT_current_state=0;
56static int Time_arq = 4000;
57
58/* Fonctionnement du uPD765 :
59
60               * ecriture du N° de comande suivi des octets necessaire a la commande (selon doc uPD) OUT ($61)
61               * Lecture ou ecriture des data en dma :
62                         Demande DMA uPD => Z80 : NMI,
63                         Lecture  octet IN  ($70) par le Z80 => DRQ uPD ou
64                         Ecriture octet OUT ($70) par le Z80 => DRQ uPD
65               * En fin d'execution commande => INT.
66               * ff12 = 12 lors de l'INT,
67               * Sortie du programme d'attente => vers lecture compte rendu
68               * Lecture des octets de compte rendu IN ($61)
69
70*/
71                         
72FLOPPY_OPTIONS_START( hector_disk2 )
73   FLOPPY_OPTION( disk2_h, "td0", "Disk II Micronique disk image", basicdsk_identify_default, basicdsk_construct_default,
74      HEADS([1])
75      TRACKS([40])
76      SECTORS([10])
77      SECTOR_LENGTH([512])
78      FIRST_SECTOR_ID([00]))
79FLOPPY_OPTIONS_END
80/* Lorsque systemMX.td0 est traduit avec TD02IMD :
81IMD TD 1.5 5.25 LD MFM S-step, 1 sides 9/08/2009 20:10:17
82HECTOR SYSTEM CP/M 2.2 Disk
83*/
84
85/* Hector Disk II uPD765 interface use interrupts and DMA! */
86const upd765_interface disk2_upd765_interface =
87{
88   DEVCB_LINE(disk2_fdc_interrupt),
89   disk2_fdc_dma_irq,
90    NULL,  //   disk2_fdc_get_image,
91   UPD765_RDY_PIN_NOT_CONNECTED,  //NOT_
92   {FLOPPY_0,FLOPPY_1, NULL, NULL}
93};
94
95// Source  : System.cfg
96//Capacité    Faces    Densité Codage Pistes Secteurs    Taille     Lecteurs / Ordinateurs
97//   (Ko)                                 (octet)
98//   200       1    DD       MFM    40      10       512       Micronique Hector
99//   800       2    DD       MFM    80       10       512       Micronique Hector
100const floppy_config disk2_floppy_config =
101{
102   DEVCB_NULL,  //
103   DEVCB_NULL,
104   DEVCB_NULL,
105   DEVCB_NULL,
106   DEVCB_NULL,
107   FLOPPY_STANDARD_5_25_DSDD,    //DSHD, for other 800Ko disk
108   FLOPPY_OPTIONS_NAME(hector_disk2),
109//   FLOPPY_OPTIONS_NAME(default),
110   NULL
111};
112
113WRITE8_HANDLER( hector_disk2_w )
114{
115//if ((offset >= 0x0fff)) // || (offset == 0x066) || (offset == 0x067) || (offset == 0x068))
116   Disk2memory[offset]= data;
117   
118/* Autorisation d'ecriture uniquement dans les zones autorisees
119if (offset == 0x066)
120      Disk2memory[offset]= data;
121if (offset == 0x067)
122      Disk2memory[offset]= data;
123if (offset == 0x068)
124      Disk2memory[offset]= data;
125if (offset == 0x038)
126      Disk2memory[offset]= data;
127if (offset == 0x039)
128      Disk2memory[offset]= data;
129if (offset == 0x03A)
130      Disk2memory[offset]= data;*/
131}
132
133READ8_HANDLER( hector_disk2_r )
134{
135UINT8 data =0;
136data = Disk2memory[offset];
137//if (offset == 0xff6b)
138//   data = 0x0ff; // force mode verbose on Hector !
139return data;
140}
141
142void valid_interrupt( running_machine *machine)
143{
144/* Called at each rising state of INT / NMI and RNMI ! */
145
146/* Take NMI / INT  only if RNMI ok*/
147
148/* Checking for NMI interrupt */
149if ((disk2_RNMI ==0x00) && (NMI_current_state!=0))
150    {   
151      cputag_set_input_line(machine, "disk2cpu", INPUT_LINE_NMI, CLEAR_LINE); // NMI...
152      timer_adjust_oneshot(DMA_timer, ATTOTIME_IN_NSEC(Time_arq), 0 );
153        Time_arq = 4000; //  6900us for next step !
154        NMI_current_state=0; /* clear the current request*/
155   }
156
157/* Checking for INT interrupt */
158if ((disk2_RNMI ==0x00) && (INT_current_state!=0))
159    {
160      cputag_set_input_line(machine, "disk2cpu", INPUT_LINE_IRQ0, CLEAR_LINE); //INT...
161      timer_adjust_oneshot(INT_timer, ATTOTIME_IN_MSEC(400), 0 ); //2010  =  8000
162       INT_current_state=0; /* clear the current request*/
163      //printf("\nLancement interruption !");
164    }
165 
166}           
167
168void Init_Timer_DiskII( running_machine *machine)
169{
170       DMA_timer = timer_alloc(machine, Callback_DMA_irq, 0);
171       INT_timer = timer_alloc(machine, Callback_INT_irq, 0);
172}
173
174static TIMER_CALLBACK( Callback_DMA_irq )
175{
176/* To generate the NMI signal (late) when uPD DMA request*/
177cputag_set_input_line(machine, "disk2cpu", INPUT_LINE_NMI, ASSERT_LINE);  //NMI...
178
179}
180static TIMER_CALLBACK( Callback_INT_irq )
181{
182/* To generate the INT signal (late) when uPD INT request*/
183cputag_set_input_line(machine, "disk2cpu", INPUT_LINE_IRQ0, ASSERT_LINE);  //INT...
184}
185     
186/* upd765 INT is connected to interrupt of Z80 */
187WRITE_LINE_DEVICE_HANDLER( disk2_fdc_interrupt )
188{
189    INT_current_state = state;
190    valid_interrupt(device->machine);
191}
192/* upd765 DRQ is connected to NMI of Z80 within a RNMI hardware authorization*/
193UPD765_DMA_REQUEST( disk2_fdc_dma_irq )
194{
195     NMI_current_state = state;                 
196     valid_interrupt(device->machine);
197}
198/////////////////////////////////////
199// Port handling of the Disk II unit
200/////////////////////////////////////
201READ8_HANDLER( disk2_io30_port_r)
202{
203 return disk2_data_r_ready;
204}
205WRITE8_HANDLER( disk2_io30_port_w)
206{
207}
208READ8_HANDLER( disk2_io40_port_r)
209{
210UINT8 data;
211
212data = disk2_data_read;
213disk2_data_r_ready = 0x00; /* Raz memoire info read dispo*/
214return data;   /* send thez data !*/
215}
216WRITE8_HANDLER( disk2_io40_port_w)
217{
218/* Write a data */
219disk2_data_write = data;   /* Memorisation donnee*/
220disk2_data_w_ready = 0xff;  /* Memorisation donnee dispo*/
221}
222
223READ8_HANDLER( disk2_io50_port_r)
224{
225return disk2_data_w_ready;
226}
227WRITE8_HANDLER( disk2_io50_port_w)
228{
229/* FDC Motor Control - Bit 0/1 defines the state of the FDD motor:
230                * "1" the FDD motor will be active.
231                * "0" the FDD motor will be in-active.*/
232
233running_device *fdc = space->machine->device("upd765");
234
235floppy_mon_w(floppy_get_device(space->machine, 0), !BIT(data, 0));
236floppy_mon_w(floppy_get_device(space->machine, 1), !BIT(data, 1));
237floppy_drive_set_ready_state(floppy_get_device(space->machine, 0), 1,1);
238floppy_drive_set_ready_state(floppy_get_device(space->machine, 1), 1,1);
239
240upd765_tc_w(fdc, ASSERT_LINE);
241
242/* Ecriture bit TC uPD765 sur D4 du port 50 */
243if (BIT(data, 4))
244   upd765_tc_w(fdc, 1);
245else
246   upd765_tc_w(fdc, 0);
247
248/* Authorization interrupt and NMI */
249if BIT(data, 5)
250   disk2_RNMI=0xff;
251else
252   disk2_RNMI=0x00;
253
254/* if the programm give the authorization => try to interrupt and NMI ! */
255//if    (disk2_RNMI==0xff)
256//  valid_interrupt(space->machine);
257 
258}
259
260
261READ8_HANDLER( disk2_io60_port_r)
262{
263/* Lecture du status uPD*/
264UINT8 data=0;
265 running_device *fdc = space->machine->device("upd765");
266 
267data = upd765_status_r(fdc, 0);
268
269return data; 
270}
271READ8_HANDLER( disk2_io61_port_r)
272{
273/* Lecture d'une data uPD*/
274UINT8 data=0;
275 running_device *fdc = space->machine->device("upd765");
276 
277data=upd765_data_r(fdc, 0); /* when pin A0 =1 */
278
279return data; 
280}
281WRITE8_HANDLER( disk2_io60_port_w)
282{
283/* Ecriture du status uPD ??? impossible ! */
284 running_device *fdc = space->machine->device("upd765");
285
286upd765_data_w(fdc, 0,data);  //upd765_data_w(device, offset, data);
287
288}
289WRITE8_HANDLER( disk2_io61_port_w)
290{
291/* Ecriture d'une data uPD*/
292 running_device *fdc = space->machine->device("upd765");
293
294upd765_data_w(fdc, 0,data);  //upd765_data_w(device, offset, data);
295
296}
297READ8_HANDLER( disk2_io70_port_r)
298{
299/* Read DMA Data of FDC */
300UINT8 data=0;
301//UINT16 hlreg;/*Used to debug*/
302
303running_device *fdc = space->machine->device("upd765");
304data=upd765_dack_r(fdc, 1); /* when pin A0 =1*/
305//hlreg = cpu_get_reg(space->machine->device("disk2cpu"), Z80_HL); // voir H   L
306
307//printf("%c",hlreg);
308return data; 
309}
310WRITE8_HANDLER( disk2_io70_port_w)
311{
312running_device *fdc = space->machine->device("upd765");
313/* Write DMA Data on FDC */
314upd765_dack_w(fdc, 0,data);
315}
src/mess/machine/hec2hrp.c
r9227r9228
2525               => add device MX80c and bank switching for the ROM
2626       03/01/2010 Update and clean prog  by yo_fr       (jj.stac@aliceadsl.fr)
2727               => add the port mapping for keyboard
28       28/09/2010 add the DISK II support by yo_fr      (jj.stac@aliceadsl.fr)
29               => Note that actually the DISK II boot (loading CPM : OK) but do not run (don't run the CPM...).
2830
2931      don't forget to keep some information about these machines, see DChector project : http://dchector.free.fr/ made by DanielCoulom
3032      (and thank's to Daniel!)
r9227r9228
4042#include "sound/wave.h"      /* for K7 sound*/
4143#include "sound/discrete.h"  /* for 1 Bit sound*/
4244#include "deprecat.h"
45#include "machine/upd765.h"   /* for floppy disc controller */
46#include "formats/basicdsk.h"
47
48#include "formats/hect_tap.h"
4349#include "includes/hec2hrp.h"
4450
4551
r9227r9228
7177static UINT8 pot0 = 0x40, pot1 = 0x40;  /* State for joy resistor*/
7278static UINT8 actions;               /* joy button off*/
7379
80// Etat des ports Hector (8255)
81
82UINT8 hector_port_a=0;
83UINT8 hector_port_b=0;
84UINT8 hector_port_c_h=0;
85UINT8 hector_port_c_l=0;
86UINT8 hector_port_cmd=0;
7487static TIMER_CALLBACK( Callback_CK )
7588{
7689/* To generate the CK signal (K7)*/
r9227r9228
322335 Port Handling
323336********************************************************************************/
324337
325READ8_HANDLER( hector_mx_io_port_r)
338/*******************  Lecture PIO 8255 *******************/
339READ8_HANDLER( hector_io_8255_r)
326340{
327   return 0;  // printer ok
341
342/* 8255 in mode 0 */
343UINT8 data =0;
344UINT8 data_l=0;
345UINT8 data_h=0;
346//hector_port_cmd = 0x8a; // FORCAGE **********************************************************************************************
347if ((offset & 0x3) == 0x0) /* Port A */
348   data = hector_port_a;
349if ((offset & 0x3) == 0x1) /* Port B */
350   data = hector_port_b;
351if ((offset & 0x3) == 0x2) /* Port C */
352   {
353       data_l = (hector_port_c_l & 0x0f);
354       data_h = (hector_port_c_h & 0xf0);
355       
356      if (BIT(hector_port_cmd, 0))   /* Quartet inf en entree ?*/
357                data_l = (hector_port_c_l & 0x0f); /*no change*/
358
359      if (BIT(hector_port_cmd, 3))            /* Quartet sup en entree ?*/
360      {
361           hector_port_c_h = (hector_port_c_h & 0x0c0);   /* Raz de l'etat des bits 4 et 5*/
362           
363         if (disk2_data_w_ready != 0x00)
364                hector_port_c_h = hector_port_c_h + 0x010;   // PC4 (donnee dispo en provenance du Disk II)
365
366           if (disk2_data_r_ready != 0x00)
367            hector_port_c_h = hector_port_c_h + 0x020;   // PC5 (donnee pas encore lue par Disk II)
368         
369           data_h =  hector_port_c_h;         
370      }
371   data= data_l + data_h;
372   }
373return data;  // Retour de la valeur !
328374}
375/*******************  Ecriture PIO 8255 *******************/
376WRITE8_HANDLER( hector_io_8255_w)
377{
378/* 8255 in mode 0 */
379if ((offset & 0x3) == 0x0) /* Port A => to printer or Disk II*/
380   hector_port_a = data;
381   //ex :   printer_output(devtag_get_device(space->machine, "printer"), data);
382
383   if ((offset & 0x3) == 0x1) /* Port B */
384   hector_port_b = data;
385
386
387if ((offset & 0x3) == 0x2) /* Port C => depending cmd word */
388   {
389      if (!BIT(hector_port_cmd, 0))    /* cmd -> Quartet inf en sortie ?*/
390      {
391         hector_port_c_l = data & 0x0f;
392
393         // Utilisation des bit du port C : PC1 // PC2
394         if BIT(hector_port_c_l, 1)      // PC1 (bit X1)= true
395         {   
396               // Lecture effectuee => RAZ memoire donnee disk2_data_write dispo   
397            hector_port_b = disk2_data_write; // Mep sur port B si 2eme 74374 existant !
398            disk2_data_w_ready = 0x00;
399         }
400         if BIT(hector_port_c_l, 2)      // PC2 (bit X2)= true
401         {
402            disk2_data_read = hector_port_a; /* mise en place de l'info presente sur le port A */
403            disk2_data_r_ready = 0xff;       /* memorisation de l'info */
404         }
405
406      }
407      if (!BIT(hector_port_cmd, 3))    /* cmd -> Quartet sup en sortie ?*/
408         hector_port_c_h = (data & 0xf0);
409   }
410
411if ((offset & 0x3) == 0x3) /* Port commande */
412{
413    hector_port_cmd = data; // 8a sur MX40!
414  //  printf("Port de commande = %x",data);
415}
416} /* End of 8255 managing */
417
418
419/*******************  Ecriture PIO specifique machine MX40 *******************/
329420WRITE8_HANDLER( hector_mx40_io_port_w)
330421{
422/* Bank switching on several address */
331423   if ((offset &0x0ff) == 0xf0) /* Port A => to printer*/
332424      printer_output(space->machine->device("printer"), data);
333425   if ((offset &0x0ff) == 0x40) /* Port page 0*/
r9227r9228
343435      hector_flag_80c=0;/* No 80c in 40c !*/
344436}
345437
438/*******************  Ecriture PIO specifique machine MX80 *******************/
346439WRITE8_HANDLER( hector_mx80_io_port_w)
347440{
348441   if ((offset &0x0ff) == 0xf0) /* Port A => to printer*/
r9227r9228
633726   hector_flag_hr = hr;
634727   flag_clk = 0;
635728   write_cassette = 0;
729   //const device_config *fdc = devtag_get_device(space->machine, "upd765");
730   //upd765_reset_w(fdc, 1);
731
732   cputag_set_input_line(machine, "disk2cpu", INPUT_LINE_RESET, PULSE_LINE);
733
636734}
637735
638736void hector_init(running_machine *machine)
src/mess/includes/hec2hrp.h
r9227r9228
3535           Adjust the one shot and A/D timing (sn76477)
3636*/
3737
38#include "machine/upd765.h"
3839
3940/* Enum status for high memory bank (c000 - ffff)*/
4041enum
r9227r9228
8283extern READ8_HANDLER( hector_mx_io_port_r );
8384extern WRITE8_HANDLER( hector_mx80_io_port_w );
8485extern WRITE8_HANDLER( hector_mx40_io_port_w );
86extern  READ8_HANDLER( hector_io_8255_r);
87extern WRITE8_HANDLER( hector_io_8255_w);
8588
86
8789/*----------- defined in video/hec2video.c -----------*/
8890
8991extern void hector_80c(bitmap_t *bitmap, UINT8 *page, int ymax, int yram) ;
r9227r9228
102104
103105/* Color status*/
104106extern UINT8 hector_color[4];
107
108/* Sound function*/
109extern sn76477_interface hector_sn76477_interface;
110
111// state Hector's port
112extern UINT8 hector_port_a;
113extern UINT8 hector_port_b;
114extern UINT8 hector_port_c_h;
115extern UINT8 hector_port_c_l;
116extern UINT8 hector_port_cmd;
117
118// state disk2 port
119extern UINT8 disk2_data_r_ready; /* =ff when PC2 = true and data in read buffer (disk2_data_read) */
120extern UINT8 disk2_data_w_ready; /* =ff when Disk 2 Port 40 had send a data in write buffer (disk2_data_write) */
121extern UINT8 disk2_data_read;    /* Data send by Hector to Disk 2 when PC2=true */
122extern UINT8 disk2_data_write;   /* Data send by Disk 2 to Hector when Write Port I/O 40 */
123
124// disk2 handling
125extern WRITE_LINE_DEVICE_HANDLER( disk2_fdc_interrupt );
126
127extern READ8_HANDLER(  disk2_io30_port_r);
128extern WRITE8_HANDLER( disk2_io30_port_w);
129extern READ8_HANDLER(  disk2_io40_port_r);
130extern WRITE8_HANDLER( disk2_io40_port_w);
131extern READ8_HANDLER(  disk2_io50_port_r);
132extern WRITE8_HANDLER( disk2_io50_port_w);
133extern READ8_HANDLER(  disk2_io60_port_r);
134extern WRITE8_HANDLER( disk2_io60_port_w);
135extern READ8_HANDLER(  disk2_io61_port_r);
136extern WRITE8_HANDLER( disk2_io61_port_w);
137extern READ8_HANDLER(  disk2_io70_port_r);
138extern WRITE8_HANDLER( disk2_io70_port_w);
139
140extern WRITE8_HANDLER( hector_disk2_w );
141extern READ8_HANDLER(  hector_disk2_r );
142
143extern void Init_Timer_DiskII( running_machine *machine);
144
145extern const upd765_interface disk2_upd765_interface;
146extern const floppy_config    disk2_floppy_config;
147
148/* Disk II Memory */
149extern UINT8 Disk2memory[0x10000];  /* Memory space for Disk II unit*/
No newline at end of file
src/mess/mess.mak
r9227r9228
991991$(MESSOBJ)/hec2hrp.a:         \
992992   $(MESS_DRIVERS)/hec2hrp.o   \
993993   $(MESS_VIDEO)/hec2video.o   \
994   $(MESS_MACHINE)/hecdisk2.o  \
994995   $(MESS_MACHINE)/hec2hrp.o   \
995996
996997$(MESSOBJ)/interact.a:         \
src/mess/drivers/hec2hrp.c
r9227r9228
1616    victor - press R then L
1717
1818        12/05/2009 Skeleton driver - Micko
19       31/06/2009 Video - Robbbert
1920
2021        29/10/2009 Update skeleton to functional machine
2122                          by yo_fr       (jj.stac@aliceadsl.fr)
r9227r9228
6869#include "sound/sn76477.h"   /* for sn sound*/
6970#include "sound/wave.h"      /* for K7 sound*/
7071#include "sound/discrete.h"  /* for 1 Bit sound*/
72#include "machine/upd765.h"   /* for floppy disc controller */
73#include "devices/flopdrv.h"
74#include "formats/basicdsk.h"
7175#include "cpu/z80/z80.h"
7276
7377#include "includes/hec2hrp.h"
7478
79/*****************************************************************************/
80static ADDRESS_MAP_START(hecdisk2_mem, ADDRESS_SPACE_PROGRAM, 8)
81/*****************************************************************************/
82   ADDRESS_MAP_UNMAP_HIGH
7583
84    /* Hardward address mapping*/
85   AM_RANGE( 0x0000, 0x0fff ) AM_ROM AM_REGION("disk2cpu", 0)            /* rom memory ->passage en RAM pour ecriture en zone 0x0066 */
86   AM_RANGE( 0x0000, 0xffff ) AM_READWRITE( hector_disk2_r, hector_disk2_w)/* ram memory */
87
88ADDRESS_MAP_END
89
90static ADDRESS_MAP_START( hecdisk2_io , ADDRESS_SPACE_IO, 8)
91   ADDRESS_MAP_UNMAP_HIGH
92    ADDRESS_MAP_GLOBAL_MASK(0xff)
93   AM_RANGE(0x030,0x03f) AM_READWRITE( disk2_io30_port_r, disk2_io30_port_w )
94   AM_RANGE(0x040,0x04f) AM_READWRITE( disk2_io40_port_r, disk2_io40_port_w )
95   AM_RANGE(0x050,0x05f) AM_READWRITE( disk2_io50_port_r, disk2_io50_port_w )
96   AM_RANGE(0x060,0x060) AM_READWRITE( disk2_io60_port_r, disk2_io60_port_w )
97   AM_RANGE(0x061,0x061) AM_READWRITE( disk2_io61_port_r, disk2_io61_port_w )
98   AM_RANGE(0x070,0x07f) AM_READWRITE( disk2_io70_port_r, disk2_io70_port_w )
99ADDRESS_MAP_END
76100/*****************************************************************************/
77101static ADDRESS_MAP_START(hec2hrp_mem, ADDRESS_SPACE_PROGRAM, 8)
78102/*****************************************************************************/
r9227r9228
103127   ADDRESS_MAP_GLOBAL_MASK(0xff)
104128ADDRESS_MAP_END
105129
130static ADDRESS_MAP_START( hec2hrx_io , ADDRESS_SPACE_IO, 8)
131   ADDRESS_MAP_UNMAP_HIGH
132    ADDRESS_MAP_GLOBAL_MASK(0xff)
133   AM_RANGE(0x0f0,0x0ff) AM_READWRITE( hector_io_8255_r, hector_io_8255_w )
134ADDRESS_MAP_END
135
106136static ADDRESS_MAP_START( hec2mx40_io , ADDRESS_SPACE_IO, 8)
107137   ADDRESS_MAP_UNMAP_HIGH
108138   ADDRESS_MAP_GLOBAL_MASK(0xff)
109   AM_RANGE(0x000,0x0ff) AM_READWRITE( hector_mx_io_port_r, hector_mx40_io_port_w )
139   AM_RANGE(0x000,0x0ef) AM_WRITE(     hector_mx40_io_port_w )
140   AM_RANGE(0x0f0,0x0f3) AM_READWRITE( hector_io_8255_r, hector_io_8255_w )
110141ADDRESS_MAP_END
111142
112143static ADDRESS_MAP_START( hec2mx80_io , ADDRESS_SPACE_IO, 8)
113144   ADDRESS_MAP_UNMAP_HIGH
114   ADDRESS_MAP_GLOBAL_MASK(0xff)
115   AM_RANGE(0x000,0x0ff) AM_READWRITE( hector_mx_io_port_r, hector_mx80_io_port_w )
145ADDRESS_MAP_GLOBAL_MASK(0xff)// sure ?
146   AM_RANGE(0x000,0x0ef) AM_WRITE(     hector_mx80_io_port_w )
147
148   AM_RANGE(0x000,0x0ff) AM_READWRITE( hector_io_8255_r, hector_io_8255_w )
116149ADDRESS_MAP_END
117150
118151/* Input ports */
r9227r9228
211244/*****************************************************************************/
212245{
213246   UINT8 *RAM = memory_region(machine, "maincpu"); // pointer to mess ram
247    UINT8 *RAMD2 = memory_region(machine, "disk2cpu"); // pointer to mess ram
214248   UINT8 *ROM1 = memory_region(machine, "page1"); // pointer to rom page 1
215249   UINT8 *ROM2 = memory_region(machine, "page2"); // pointer to rom page 2
250UINT32 index=0;
251//Patch rom possible !
252//RAMD2[0xff6b] = 0x0ff; // force verbose mode hector !
216253
254//Initialisation ROM
255while (index <0x01001)
256{   
257   Disk2memory[index] = RAMD2[index];
258   index++;
259}
260   cputag_set_input_line(machine, "disk2cpu", INPUT_LINE_RESET, PULSE_LINE);
261   cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
262//    cputag_set_input_line(machine, "disk2cpu", INPUT_LINE_IRQ0, CLEAR_LINE); //INT / NMI...
263
217264    // Memory install for bank switching
218265   memory_configure_bank(machine, "bank1", HECTOR_BANK_PROG , 1, &RAM[0xc000]  , 0); // Mess ram
219266   memory_configure_bank(machine, "bank1", HECTOR_BANK_VIDEO, 1, hector_videoram, 0); // Video ram
r9227r9228
228275   memory_set_bank(machine, "bank2", HECTORMX_BANK_PAGE0);
229276/******************************************************SPECIFIQUE MX ***************************/
230277   hector_init(machine);
278   Init_Timer_DiskII(machine); // Init of the Disk II !
231279}
232280
233281static MACHINE_RESET(hec2hrp)
r9227r9228
293341   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
294342   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
295343
344    /* Gestion cassette*/
296345   MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
297346
298347   /* printer */
r9227r9228
335384   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
336385   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
337386
387   /* Gestion cassette*/
338388   MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
339389
340390   /* printer */
r9227r9228
353403   MDRV_MACHINE_RESET(hec2hrp)
354404   MDRV_MACHINE_START(hec2hrp)
355405
406   /* Disk II unit */
407   MDRV_CPU_ADD("disk2cpu",Z80, XTAL_4MHz)
408   MDRV_CPU_PROGRAM_MAP(hecdisk2_mem)
409   MDRV_CPU_IO_MAP(hecdisk2_io)
410//   MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
411   MDRV_UPD765A_ADD("upd765", disk2_upd765_interface)
412   MDRV_FLOPPY_2_DRIVES_ADD(disk2_floppy_config)
356413   /* video hardware */
357414   MDRV_SCREEN_ADD("screen", RASTER)
358415   MDRV_SCREEN_REFRESH_RATE(50)
r9227r9228
377434   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
378435   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
379436
437    /* Gestion cassette*/
380438   MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
381439
382440   /* printer */
383441   MDRV_PRINTER_ADD("printer")
384442
385443MACHINE_CONFIG_END
444/*****************************************************************************/
445static MACHINE_CONFIG_START( hec2hrx, driver_device )
446/*****************************************************************************/
447/* basic machine hardware */
448   MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz)
449   MDRV_CPU_PROGRAM_MAP(hec2hrp_mem)
450   MDRV_CPU_IO_MAP(hec2hrx_io)
451   MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
452   MDRV_MACHINE_RESET(hec2hrp)
453   MDRV_MACHINE_START(hec2hrp)
386454
455   /* Disk II unit */
456   MDRV_CPU_ADD("disk2cpu",Z80, XTAL_4MHz)
457   MDRV_CPU_PROGRAM_MAP(hecdisk2_mem)
458   MDRV_CPU_IO_MAP(hecdisk2_io)
459   MDRV_UPD765A_ADD("upd765", disk2_upd765_interface)
460   MDRV_FLOPPY_2_DRIVES_ADD(disk2_floppy_config)
461
462
463   /* video hardware */
464   MDRV_SCREEN_ADD("screen", RASTER)
465   MDRV_SCREEN_REFRESH_RATE(50)
466   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(400)) /* 2500 not accurate */
467   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
468   MDRV_SCREEN_SIZE(512, 230)
469   MDRV_SCREEN_VISIBLE_AREA(0, 243, 0, 227)
470    MDRV_PALETTE_LENGTH(16)
471   MDRV_PALETTE_INIT(black_and_white)
472   MDRV_VIDEO_START(hec2hrp)
473   MDRV_VIDEO_UPDATE(hec2hrp)
474
475   /* sound hardware */
476   MDRV_SPEAKER_STANDARD_MONO("mono")
477   MDRV_SOUND_WAVE_ADD("wave", "cassette")
478   MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0
479
480   MDRV_SOUND_ADD("sn76477", SN76477, 0)
481   MDRV_SOUND_CONFIG(hector_sn76477_interface)
482   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1)
483
484   MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit
485   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
486   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
487
488    // Gestion cassette
489    MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
490
491   /* printer */
492   MDRV_PRINTER_ADD("printer")
493
494MACHINE_CONFIG_END
387495/*****************************************************************************/
388496static MACHINE_CONFIG_START( hec2mx80, hec2hrp_state )
389497/*****************************************************************************/
r9227r9228
419527   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
420528   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
421529
530   /* Gestion cassette*/
422531   MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
423532
424533   /* printer */
r9227r9228
453562   ROM_LOAD( "hector2hrx.rom", 0x0000, 0x4000, CRC(f047c521) SHA1(744336b2acc76acd7c245b562bdc96dca155b066))
454563   ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
455564   ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
565   ROM_REGION( 0x10000, "disk2cpu", ROMREGION_ERASEFF )
566   ROM_LOAD( "d800k.bin" , 0x0000,0x1000, CRC(831bd584) SHA1(9782ee58f570042608d9d568b2c3fc4c6d87d8b9))
456567ROM_END
457568
458569ROM_START( hec2mx80 )
r9227r9228
471582   ROM_LOAD( "mx40c_page1.rom", 0x0000, 0x4000, CRC(192a76fa) SHA1(062aa6df0b554b85774d4b5edeea8496a4baca35))
472583   ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
473584   ROM_LOAD( "mx40c_page2.rom" , 0x0000,0x4000, CRC(ef1b2654) SHA1(66624ea040cb7ede4720ad2eca0738d0d3bad89a))
585   ROM_REGION( 0x10000, "disk2cpu", ROMREGION_ERASEFF )
586//   ROM_REGION( 0x10000, "rom_disk2", ROMREGION_ERASEFF ) // Marche avec cela sauf ecr en ram !!!!
587//   ROM_LOAD( "d360k.bin" , 0x0000,0x4000, CRC(2454eacb) SHA1(dc0d5a7d5891a7e422d9d142a2419527bb15dfd5))
588   ROM_LOAD( "d800k.bin" , 0x0000,0x1000, CRC(831bd584) SHA1(9782ee58f570042608d9d568b2c3fc4c6d87d8b9))
589//   ROM_LOAD( "d200k.bin" , 0x0000,0x4000, CRC(e2801377) SHA1(0926df5b417ecd8013e35c71b76780c5a25c1cbf))
590
474591ROM_END
475592
476593/* Driver */
r9227r9228
479596COMP(1983, hec2hrp,  0, interact,    hec2hrp,   hec2hrp, 0,     "Micronique",   "Hector 2HR+",   GAME_IMPERFECT_SOUND)
480597COMP(1980, victor,   hec2hrp, 0,     hec2hrp,   hec2hrp, 0,      "Micronique",   "Victor",   GAME_IMPERFECT_SOUND)
481598COMP(1983, hec2hr ,  hec2hrp, 0,     hec2hr,   hec2hrp, 0,     "Micronique",   "Hector 2HR",   GAME_IMPERFECT_SOUND)
482COMP(1984, hec2hrx,  hec2hrp, 0,     hec2hrp,   hec2hrp, 0,     "Micronique",   "Hector HRX",   GAME_IMPERFECT_SOUND)
599COMP(1984, hec2hrx,  hec2hrp, 0,     hec2hrx,   hec2hrp, 0,     "Micronique",   "Hector HRX",   GAME_IMPERFECT_SOUND)
483600COMP(1985, hec2mx80, hec2hrp, 0,     hec2mx80,   hec2hrp, 0,     "Micronique",   "Hector MX 80c" ,   GAME_IMPERFECT_SOUND)
484601COMP(1985, hec2mx40, hec2hrp, 0,     hec2mx40,   hec2hrp, 0,     "Micronique",   "Hector MX 40c" ,   GAME_IMPERFECT_SOUND)
docs/messnew.txt
r9227r9228
4848
4949- [ABC806] Added enhanced options ROM. [exon, Curt Coder]
5050
51- [HECTOR] Added initial support for DISK II unit [JJ Stacino]
5152
52
5353Imgtool Changes:
5454----------------
5555(none)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team