Previous 15994 Revisions Next

r6350 Tuesday 10th November, 2009 at 16:56:55 UTC by Miodrag Milanović
[hec2hrp][interact] Interact, Hector1, Victor, HR, HR+, HRX MX40 and MX80 [JJ Stacino]
[docs]messnew.txt
[src/mess]mess.mak messdriv.c
[src/mess/drivers]hec2hrp.c interact.c
[src/mess/includes]hec2hrp.h* hectorkey.h*
[src/mess/machine]hec2hrp.c*
[src/mess/video]hec2video.c*

src/mess/video/hec2video.c
r0r6350
1/////////////////////////////////////////////////////////////////////////////////
2///// Hector vidéo
3/////////////////////////////////////////////////////////////////////////////////
4/*      Hector 2HR+
5        Victor
6        Hector 2HR
7        Hector HRX
8        Hector MX40c
9        Hector MX80c
10        Hector 1
11        Interact
12
13        12/05/2009 Skeleton driver - Micko : mmicko@gmail.com
14       31/06/2009 Video - Robbbert
15
16        29/10/2009 Update skeleton to functional machine
17                          by yo_fr       (jj.stac@aliceadsl.fr)
18               
19               => add Keyboard,
20               => add color,
21               => add cassette,
22               => add sn76477 sound and 1bit sound,
23               => add joysticks (stick, pot, fire)
24               => add BR/HR switching
25               => add bank switch for HRX
26               => add device MX80c and bank switching for the ROM
27    Importante note : the keyboard function add been piked from
28                      DChector project : http://dchector.free.fr/ made by DanielCoulom
29                      (thank's Daniel)
30    TODO : Add the cartridge function,
31           Adjust the one shot and A/D timing (sn76477)
32*/
33
34#include "driver.h"
35#include "sound/sn76477.h"   // for sn sound
36
37#include "includes/hec2hrp.h"
38
39// Color status
40UINT8 Col0, Col1,Col2,Col3;  // For actual colors
41
42
43
44void Init_Hector_Palette( running_machine  *machine)
45{
46   // basic colors !
47    Col0 = 0;  // fond (noir)
48    Col1 = 1;  // HECTOR HRX (rouge)
49    Col2 = 7; // Point interrogation (Blanc)
50    Col3 = 3; // Ecriture de choix (jaune)
51
52   // Color initialisation : full luminosité
53   palette_set_color( machine, 0,MAKE_RGB(000,000,000));//Noir
54   palette_set_color( machine, 1,MAKE_RGB(255,000,000));//Rouge
55   palette_set_color( machine, 2,MAKE_RGB(000,255,000));//Vert
56   palette_set_color( machine, 3,MAKE_RGB(255,255,000));//Jaune
57   palette_set_color( machine, 4,MAKE_RGB(000,000,255));//Bleu
58   palette_set_color( machine, 5,MAKE_RGB(255,000,255));//Magneta
59   palette_set_color( machine, 6,MAKE_RGB(000,255,255));//Cyan
60   palette_set_color( machine, 7,MAKE_RGB(255,255,255));//Blanc
61   // 1/2 luminosité
62   palette_set_color( machine, 8,MAKE_RGB(000,000,000));//Noir
63   palette_set_color( machine, 9,MAKE_RGB(128,000,000));//Rouge
64   palette_set_color( machine,10,MAKE_RGB(000,128,000));//Vert
65   palette_set_color( machine,11,MAKE_RGB(128,128,000));//Jaune
66   palette_set_color( machine,12,MAKE_RGB(000,000,128));//Bleu
67   palette_set_color( machine,13,MAKE_RGB(128,000,128));//Magneta
68   palette_set_color( machine,14,MAKE_RGB(000,128,128));//Cyan
69   palette_set_color( machine,15,MAKE_RGB(128,128,128));//Blanc
70}
71
72void hector_hr(bitmap_t *bitmap, UINT8 *page, int ymax, int yram)
73{
74   UINT8 gfx,y;
75   UINT16 sy=0,ma=0,x;
76   for (y = 0; y <= ymax; y++) {  //224
77      UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
78      for (x = ma; x < ma + yram; x++) {  // 64
79         gfx = *(page+x);
80         /* Display a scanline of a character (4 pixels !) */
81         switch (gfx & 0x03) {
82              case 0x00 : *p=Col0; break;
83              case 0x01 : *p=Col1; break;
84               case 0x02 : *p=Col2; break;
85              default   : *p=Col3; break;}
86         p++;   
87
88         switch (gfx & 0x0c)   {
89             case 0x00 : *p=Col0; break;
90              case 0x04 : *p=Col1; break;
91               case 0x08 : *p=Col2; break;
92              default   : *p=Col3; break;}
93         p++;   
94
95         switch (gfx & 0x30)   {
96              case 0x00 : *p=Col0; break;
97              case 0x10 : *p=Col1; break;
98               case 0x20 : *p=Col2; break;
99              default   : *p=Col3; break;}
100         p++;   
101
102         switch (gfx & 0xc0) {
103              case 0x00 : *p=Col0; break;
104              case 0x40 : *p=Col1; break;
105               case 0x80 : *p=Col2; break;
106              default   : *p=Col3; break;}
107         p++;
108      }
109      ma+=yram;
110   }
111}   
112
113void hector_80c(bitmap_t *bitmap, UINT8 *page, int ymax, int yram)
114{
115   UINT8 gfx,y;
116   UINT16 sy=0,ma=0,x;
117   for (y = 0; y <= ymax; y++) {  //224
118      UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
119      for (x = ma; x < ma + yram; x++) {  // 64
120         gfx = *(page+x);
121         /* Display a scanline of a character (8 pixels !) */
122         *p= (gfx &0x01 ) ? 7 : 0 ;
123         p++;
124         *p= (gfx &0x02 ) ? 7 : 0 ;
125         p++;
126         *p= (gfx &0x04 ) ? 7 : 0 ;
127         p++;
128         *p= (gfx &0x08 ) ? 7 : 0 ;
129         p++;
130         *p= (gfx &0x10 ) ? 7 : 0 ;
131         p++;
132         *p= (gfx &0x20 ) ? 7 : 0 ;
133         p++;
134         *p= (gfx &0x40 ) ? 7 : 0 ;
135         p++;
136         *p= (gfx &0x80 ) ? 7 : 0 ;
137         p++;
138      }
139      ma+=yram;
140   }
141}
src/mess/includes/hectorkey.h
r0r6350
1///////////////////////////////////////////////////////////////  Hectorkey.H
2// Thank's Daniel !
3/*      Hector 2HR+
4        Victor
5        Hector 2HR
6        Hector HRX
7        Hector MX40c
8        Hector MX80c
9        Hector 1
10        Interact
11             
12        29/10/2009 Update skeleton to functional machine
13                          by yo_fr       (jj.stac@aliceadsl.fr)
14               
15               => add Keyboard,
16               => add color,
17               => add cassette,
18               => add sn76477 sound and 1bit sound,
19               => add joysticks (stick, pot, fire)
20               => add BR/HR switching
21               => add bank switch for HRX
22               => add device MX80c and bank switching for the ROM
23    Importante note : the keyboard function add been piked from
24                      DChector project : http://dchector.free.fr/ made by DanielCoulom
25                      (thank's Daniel)
26    TODO : Add the cartridge function,
27           Adjust the one shot and A/D timing (sn76477)
28*/
29int hectorkey[0x100] = {
30
31///////////////////////////////////////// 0x00-0x0f
320xff, //0
330x00, //1= ESC --> Reset machine
340x11, //2=   1 --> 1
350x10, //3=   2 --> 2
360x27, //4=   3 --> 3
370x26, //5=   4 --> 4
380x25, //6=   5 --> 5
390x24, //7=   6 --> 6
400x23, //8=   7 --> 7
410x22, //9=   8 --> 8
420x21, //a=   9 --> 9
430x12, //b=   0 --> 0
440x15, //c=   ) --> -
450x17, //d=   = --> +
460x04, //e=BACK --> BACK
470x03, //f= TAB --> TAB
48
49///////////////////////////////////////// 0x10-0x1f
500x31, //0=   A --> A
510x60, //1=   Z --> Z
520x45, //2=   E --> E
530x50, //3=   R --> R
540x66, //4=   T --> T
550x61, //5=   Y --> Y
560x65, //6=   U --> U
570x41, //7=   I --> I
580x53, //8=   O --> O
590x52, //9=   P --> P
600xff, //a=   ^
610x35, //b=   $ --> =
620x02, //c= ENT --> RETURN
630x06, //d=CTRL --> CTRL
640x51, //e=   Q --> Q
650x67, //f=   S --> S
66
67///////////////////////////////////////// 0x20-0x2f
680x46, //0=   D --> D
690x44, //1=   F --> F
700x43, //2=   G --> G
710x42, //3=   H --> H
720x40, //4=   J --> J
730x57, //5=   K --> K
740x56, //6=   L --> L
750x55, //7=   M --> M
760x13, //8=   % --> / 
770x08, //9=   ² --> manette 0 ACTION
780x07, //a= MAJ --> SHIFT
790x00, //b=   * --> *
800x63, //c=   W --> W
810x62, //d=   X --> X
820x47, //e=   C --> C
830x64, //f=   V --> V
84
85///////////////////////////////////////// 0x30-0x3f
860x30, //0=   B --> B
870x54, //1=   N --> N
880x16, //2=   , --> ,
890x37, //3=   ; --> ;
900x14, //4=   : --> .
910x33, //5=   ! --> ?
920xff, //6= MAJ
930xff, //7
940xff, //8
950x01, //9=  SP --> SPACE
960x05, //a=LOCK --> LOCK
970xff, //b=  F1
980xff, //c=  F2
990xff, //d=  F3
1000xff, //e=  F4
1010xff, //f=  F5
102
103///////////////////////////////////////// 0x40-0x4f
1040xff, //0
1050xff, //1
1060xff, //2
1070xff, //3
1080xff, //4
1090xff, //5
1100xff, //6
1110x74, //7=   7 --> manette 1 GAUCHE
1120x77, //8=   8 --> manette 1 BAS
1130x75, //9=   9 --> manette 1 DROITE
1140x09, //a=   - --> manette 1 ACTION
1150x0b, //b=   <- --> pot0-
1160x72, //c=   5 --> manette 0 HAUT
1170x0a, //d=   <- --> pot0+
1180x08, //e=   + --> manette 0 ACTION
1190x70, //f=   1 --> manette 0 GAUCHE
120
121///////////////////////////////////////// 0x50-0x5f
1220x73, //0=   2 --> manette 0 BAS
1230x71, //1=   3 --> manette 0 DROITE
1240x0e, //2= INS --> pot1 ++
1250x0f, //3=SUPP -->^pot1 --
1260xff, //4
1270xff, //5
1280xff, //6    < -->
1290xff, //7
1300xff, //8
1310xff, //9
1320xff, //a
1330xff, //b
1340xff, //c
1350xff, //d
1360xff, //e
1370xff, //f
138
139///////////////////////////////////////// 0x60-0x6f
1400xff, //0= 
1410xff, //1
1420xff, //2
1430xff, //3
1440xff, //4
1450xff, //5
1460xff, //6
1470xff, //7
1480xff, //8
1490xff, //9
1500xff, //a
1510xff, //b
1520xff, //c
1530xff, //d
1540xff, //e
1550xff, //f
156
157///////////////////////////////////////// 0x70-0x7f
1580xff, //0
1590xff, //1
1600xff, //2
1610xff, //3
1620xff, //4
1630xff, //5
1640xff, //6
1650xff, //7
1660xff, //8
1670xff, //9
1680xff, //a
1690xff, //b
1700xff, //c
1710xff, //d
1720xff, //e
1730xff, //f
174
175///////////////////////////////////////// 0x80-0x8f
1760xff, //0
1770xff, //1
1780xff, //2
1790xff, //3
1800xff, //4
1810xff, //5
1820xff, //6
1830xff, //7
1840xff, //8
1850xff, //9
1860xff, //a
1870xff, //b
1880xff, //c
1890xff, //d
1900xff, //e
1910xff, //f
192
193///////////////////////////////////////// 0x90-0x9f
1940xff, //0
1950xff, //1
1960xff, //2
1970xff, //3
1980xff, //4
1990xff, //5
2000xff, //6
2010xff, //7
2020xff, //8
2030xff, //9
2040xff, //a
2050xff, //b
2060x08, //c= ENT --> manette 0 ACTION
2070xff, //d= CTRL droit
2080xff, //e
2090xff, //f
210
211///////////////////////////////////////// 0xa0-0xaf
2120xff, //0
2130xff, //1
2140xff, //2
2150xff, //3
2160xff, //4
2170xff, //5
2180xff, //6
2190xff, //7
2200xff, //8
2210xff, //9
2220xff, //a
2230xff, //b
2240xff, //c
2250xff, //d
2260xff, //e
2270xff, //f
228
229///////////////////////////////////////// 0xb0-0xbf
2300xff, //0
2310xff, //1
2320xff, //2
2330xff, //3
2340xff, //4
2350x76, //5=   / --> manette 1 HAUT
2360xff, //6
2370xff, //7
2380xff, //8
2390xff, //9
2400xff, //a
2410xff, //b
2420xff, //c
2430xff, //d
2440xff, //e
2450xff, //f
246
247///////////////////////////////////////// 0xc0-0xcf
2480xff, //0
2490xff, //1
2500xff, //2
2510xff, //3
2520xff, //4
2530xff, //5
2540xff, //6
2550xff, //7=HOME
2560x0d, //8=  UP 
2570x0f, //9= PUP
2580xff, //a
2590xff, //b
2600xff, //c
2610xff, //d
2620xff, //e
2630xff, //f= END
264
265///////////////////////////////////////// 0xd0-0xdf
2660x0c, //0=DOWN 
2670x0e, //1=PDWN
2680xff, //2= INS 
2690xff, //3= SUP
2700xff, //4
2710xff, //5
2720xff, //6
2730xff, //7
2740xff, //8
2750xff, //9
2760xff, //a
2770xff, //b
2780xff, //c
2790xff, //d
2800xff, //e
2810xff, //f
282
283///////////////////////////////////////// 0xe0-0xef
2840xff, //0
2850xff, //1
2860xff, //2
2870xff, //3
2880xff, //4
2890xff, //5
2900xff, //6
2910xff, //7
2920xff, //8
2930xff, //9
2940xff, //a
2950xff, //b
2960xff, //c
2970xff, //d
2980xff, //e
2990xff, //f
300
301///////////////////////////////////////// 0xf0-0xff
3020xff, //0
3030xff, //1
3040xff, //2
3050xff, //3
3060xff, //4
3070xff, //5
3080xff, //6
3090xff, //7
3100xff, //8
3110xff, //9
3120xff, //a
3130xff, //b
3140xff, //c
3150xff, //d
3160xff, //e
3170xff};//f
src/mess/includes/hec2hrp.h
r0r6350
1/////////////////////////////////////////////////////////////////////
2//////   HECTOR HEADER FILE /////////////////////////////////////////
3/////////////////////////////////////////////////////////////////////
4/*     
5        Hector 2HR+
6        Victor
7        Hector 2HR
8        Hector HRX
9        Hector MX40c
10        Hector MX80c
11        Hector1
12        Interact
13       
14        12/05/2009 Skeleton driver - Micko : mmicko@gmail.com
15       31/06/2009 Video - Robbbert
16
17        29/10/2009 Update skeleton to functional machine
18                          by yo_fr       (jj.stac@aliceadsl.fr)
19               
20               => add Keyboard,
21               => add color,
22               => add cassette,
23               => add sn76477 sound and 1bit sound,
24               => add joysticks (stick, pot, fire)
25               => add BR/HR switching
26               => add bank switch for HRX
27               => add device MX80c and bank switching for the ROM
28    Importante note : the keyboard function add been piked from
29                      DChector project : http://dchector.free.fr/ made by DanielCoulom
30                      (thank's Daniel)
31    TODO : Add the cartridge function,
32           Adjust the one shot and A/D timing (sn76477)
33*/
34
35// Protoype of memory Handler
36extern WRITE8_HANDLER( hector_switch_bank_w );
37extern void Key(int pccode, int state, running_machine *machine);
38extern READ8_HANDLER( hector_keyboard_r );
39extern WRITE8_HANDLER( hector_sn_2000_w );
40extern WRITE8_HANDLER( hector_sn_2800_w );
41extern WRITE8_HANDLER( hector_sn_3000_w );
42extern READ8_HANDLER( hector_cassette_r );
43extern WRITE8_HANDLER( hector_color_a_w );
44extern WRITE8_HANDLER( hector_color_b_w );
45
46
47extern READ8_HANDLER( hector_mx_io_port_r);
48extern WRITE8_HANDLER( hector_mx80_io_port_w);
49extern WRITE8_HANDLER( hector_mx40_io_port_w);
50
51
52// Prototype of video function
53extern void Init_Hector_Palette( running_machine  *machine);
54extern void hector_80c(bitmap_t *bitmap, UINT8 *page, int ymax, int yram) ;
55extern void hector_hr(bitmap_t *bitmap, UINT8 *page, int ymax, int yram) ;
56
57// Global variables used in extern modules
58
59// Status for screen definition
60extern UINT8 flag_hr;
61extern UINT8 flag_80c;
62// Status for CPU clock
63extern UINT8 flag_clk;  // 0 5MHz (HR machine) - 1  1.75MHz (BR machine)
64
65// Ram video BR :
66extern UINT8 videoramhector[0x04000];
67
68// Color status
69extern UINT8 Col0, Col1,Col2,Col3;  // For actual colors
70
71// Sound function
72extern void Mise_A_Jour_Etat(int Adresse, int Value );
73extern void Init_Value_SN76477_Hector(void);
74extern void Update_Sound(const address_space *space, UINT8 data);
75extern  sn76477_interface hector_sn76477_interface;
76
77
78//Keyboard / joystick / cassette
79extern UINT8 actions;
80extern UINT8 touches[8];
81extern UINT8 pot0, pot1;  // State for resistor
82extern UINT8 write_cassette;
83
84//TIMER definition
85extern TIMER_CALLBACK( Callback_CK );
86extern TIMER_CALLBACK( Callback_keyboard );
87extern  emu_timer *keyboard_timer;
88extern emu_timer *Cassette_timer;
89
90
91// Enum status for high memory bank (c000 - ffff)
92enum
93{
94   HECTOR_BANK_PROG = 0,              /* first BANK is program ram*/
95   HECTOR_BANK_VIDEO               /* second BANK is Video ram */
96};
97// Status for rom memory bank (0000 - 3fff) in MX machine
98enum
99{
100   HECTORMX_BANK_PAGE0 = 0,           /* first BANK is base rom*/
101   HECTORMX_BANK_PAGE1,            /* second BANK is basic rom */
102   HECTORMX_BANK_PAGE2                 /* 3 BANK is monitrix / assemblex rom */
103};
104
src/mess/messdriv.c
r6349r6350
14301430    DRIVER( h19 )
14311431    DRIVER( h89 )
14321432    DRIVER( hec2hrp )
1433    DRIVER( hec2hr )
14331434    DRIVER( hec2hrx )
1435    DRIVER( hec2mx80 )
1436    DRIVER( hec2mx40 )
14341437    DRIVER( hector1 )
1435    DRIVER( poly880 )
1438    DRIVER( victor )
1439   DRIVER( poly880 )
14361440    DRIVER( sc1 )
14371441    DRIVER( sc2 )
14381442    DRIVER( chessmst )
src/mess/machine/hec2hrp.c
r0r6350
1/////////////////////////////////////////////////////////////////////////
2// HEC2HRP.C  in machine
3/*      Hector 2HR+
4        Victor
5        Hector 2HR
6        Hector HRX
7        Hector MX40c
8        Hector MX80c
9        Hector 1
10        Interact
11
12        12/05/2009 Skeleton driver - Micko : mmicko@gmail.com
13       31/06/2009 Video - Robbbert
14
15        29/10/2009 Update skeleton to functional machine
16                          by yo_fr       (jj.stac@aliceadsl.fr)
17               
18               => add Keyboard,
19               => add color,
20               => add cassette,
21               => add sn76477 sound and 1bit sound,
22               => add joysticks (stick, pot, fire)
23               => add BR/HR switching
24               => add bank switch for HRX
25               => add device MX80c and bank switching for the ROM
26    Importante note : the keyboard function add been piked from
27                      DChector project : http://dchector.free.fr/ made by DanielCoulom
28                      (thank's Daniel)
29    TODO : Add the cartridge function,
30           Adjust the one shot and A/D timing (sn76477)
31*/
32
33#include "driver.h"
34#include "devices/cassette.h"
35#include "sound/sn76477.h"   // for sn sound
36#include "sound/wave.h"      // for K7 sound
37#include "sound/discrete.h"  // for 1 Bit sound
38#include "machine/pckeybrd.h"
39#include "deprecat.h"
40
41#include "includes/hectorkey.h"      // Keyboard mapping
42#include "includes/hec2hrp.h"
43
44const device_config *cassette_device_image(running_machine *machine);
45
46
47// Stat for the register in 0x3000
48UINT8 state3000=0;
49UINT8 write_cassette=0;
50
51// Keyboard timer
52TIMER_CALLBACK( Callback_keyboard );
53emu_timer *keyboard_timer;
54
55// Cassette timer
56TIMER_CALLBACK( Callback_CK );
57emu_timer *Cassette_timer;
58UINT8 CK_signal ;  // Synchro signal for K7
59
60
61UINT8 actions=0xff;               //  keyboard key off
62
63double Pin_Value[28][2]; // SN76477
64int AU[17];              // Pour les fils de bus audio du SN76477
65int ValMixer;            // for mixer
66int oldstate3000;        // Edge state mixer
67int oldstate1000;        // Edge state cassette
68
69
70//#include "drivers/hec2son.c" // need to create a header file...
71
72// Keyboard map
73UINT8 touches[8];
74UINT8 pot0 = 0x40, pot1 = 0x40;  // State for joy resistor
75
76// To generate the CK signal (K7)
77TIMER_CALLBACK( Callback_CK )
78{
79   CK_signal++;
80}
81
82TIMER_CALLBACK( Callback_keyboard )
83{
84int touche ;
85int Code0 ;
86
87// update pot position
88if((actions & 0x04) != 0) if(pot0 > 0x00) pot0--;   
89if((actions & 0x08) != 0) if(pot0 < 0x7f) pot0++;   
90if((actions & 0x40) != 0) if(pot1 > 0x00) pot1--;   
91if((actions & 0x80) != 0) if(pot1 < 0x7f) pot1++;
92 
93// Keyboard => read
94at_keyboard_polling();   
95touche = at_keyboard_read();
96if (touche ==-1) return; // Nothing to do => out!
97if ( (touche & 0x80) == 0 )
98{    // stroke on
99      Code0 = touche & 0x7F;
100      if (Code0==0x36) Code0=0x2A;  // Right shift
101      Key( Code0, 0x00, machine);
102}
103if ( (touche & 0x80) != 0 )
104{    // stroke off
105      Code0 = touche & 0x7F;
106      if (Code0==0x36) Code0=0x2A;  // Right shift
107      Key( Code0, 0x80, machine);
108}
109}
110
111void Key(int pccode, int state, running_machine *machine)
112{
113 // Mise a jour de l'image du clavier /////////////////////////////////////////
114int i, j, n;
115 n = hectorkey[(pccode & 0x7f) | ((pccode & 0x100) >> 1)];
116// printf("\n touche = %x",pccode);
117 if(n > 0x77) return;
118
119 switch(n)
120 {
121  // Si c'est une demande joystick -> sortie directe avec le code
122  case 0x08: if(state) actions |=   1; else actions &= 0xfe; return; //b0=action0 +
123  case 0x09: if(state) actions |=   2; else actions &= 0xfd; return; //b1=action1 -
124  case 0x0a: if(state) actions |=   4; else actions &= 0xfb; return; //b2=gauche
125  case 0x0b: if(state) actions |=   8; else actions &= 0xf7; return; //b3=droite
126  case 0x0c: if(state) actions |=  16; else actions &= 0xef; return; //b4=bas
127  case 0x0d: if(state) actions |=  32; else actions &= 0xdf; return; //b5=haut
128  case 0x0e: if(state) actions |=  64; else actions &= 0xbf; return; //b6=pdown
129  case 0x0f: if(state) actions |= 128; else actions &= 0x7f; return; //b7=pup
130 }
131 j = 1;
132 if (n==0x00) // Reset machine ! (on ESC key)
133  { 
134          cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
135          if (!strncmp(machine->gamedrv->name , "hec2xxxx" , 4) |
136              !strncmp(machine->gamedrv->name , "victor" , 6)     ) // aviable for all HR machines
137          {
138               memory_set_bank(machine, 1, HECTOR_BANK_PROG);
139               memory_set_bank(machine, 2, HECTORMX_BANK_PAGE0);
140               flag_hr=1;
141          }
142          else
143               flag_hr=0;
144          //Common flag
145          flag_80c=0;
146          flag_clk =0;
147          return ;
148 }
149 for(i = 0; i < (n & 7); i++)
150       j += j;
151 
152 i = (n >> 4) & 7;
153 if(state)
154      touches[i] |= j;
155 else
156      touches[i] &= ~j;
157}
158
159WRITE8_HANDLER( hector_switch_bank_w )
160{
161   if (offset==0x00)   {   // 0x800 et 0x000=> vidéo page, HR
162                           memory_set_bank(space->machine, 1, HECTOR_BANK_VIDEO);
163                     if (flag_clk ==1)
164                     {
165                              flag_clk=0;
166                        cputag_set_clock(space->machine, "maincpu", XTAL_5MHz);  // Augmentation CPU
167                     }
168                  }   
169   if (offset==0x04)   {   // 0x804 => vidéo page, BR
170                     flag_hr=0;     
171                           memory_set_bank(space->machine, 1, HECTOR_BANK_VIDEO);
172                     if (flag_clk ==0)
173                     {
174                        flag_clk=1;
175                        cputag_set_clock(space->machine, "maincpu", XTAL_1_75MHz);  // Ralentissement CPU
176                     }
177                  } 
178   if (offset==0x08)   {   // 0x808 => base page, HR
179                     memory_set_bank(space->machine, 1, HECTOR_BANK_PROG);
180                     if (flag_clk ==1)
181                     {
182                        flag_clk=0;
183                        cputag_set_clock(space->machine, "maincpu", XTAL_5MHz);  // Augmentation CPU
184                     }
185
186                  } 
187   if (offset==0x0c)   {   // 0x80c => base page, BR
188                     flag_hr=0;
189                           memory_set_bank(space->machine, 1, HECTOR_BANK_PROG);
190                     if (flag_clk ==0)
191                     {
192                        flag_clk=1;
193                        cputag_set_clock(space->machine, "maincpu", XTAL_1_75MHz);  // Ralentissement CPU
194                     }
195                  } 
196}
197
198READ8_HANDLER( hector_keyboard_r )
199{
200   return touches[offset]; //send the pre calculated value
201}
202
203WRITE8_HANDLER( hector_sn_2000_w )
204{
205      Mise_A_Jour_Etat( 0x2000+ offset, data);
206      Update_Sound(space, data);
207}
208WRITE8_HANDLER( hector_sn_2800_w )
209{
210   Mise_A_Jour_Etat( 0x2800+ offset, data);
211   Update_Sound(space, data);
212}
213READ8_HANDLER( hector_cassette_r )
214{
215double level;
216UINT8 value=0;
217static UINT8 cassette_bit=0;
218static UINT8 cassette_bit_mem=0;
219static UINT8 Data_K7=0;
220
221if ((state3000 & 0x38) != 0x38 )   // Selon Sb choix cassette ou timer (74153)
222{
223
224   Data_K7 =  0x00;  // No cassette => clear bit
225       switch (state3000 & 0x38 )
226       { 
227          case 0x08: value = (actions & 1) ? 0x80 : 0; break;    //(actions & 1) ? 0x80 : 0;
228          case 0x10: value = pot0; break;   
229         case 0x20: value = (actions & 2) ? 0x80 : 0; break;   //(actions & 2) ? 0x80 : 0;
230          case 0x28: value = pot1; break;
231          default: value = 0; break;
232       }
233}
234else
235{
236   if (write_cassette == 0)
237    {
238      // Accée à la cassette
239      level = cassette_input(cassette_device_image(space->machine));
240
241      // Travail du 741 en trigger
242      if  (level < -0.08)
243          cassette_bit = 0x00;
244      if (level > +0.08)
245         cassette_bit = 0x01;
246   }
247    // Programme du sn7474 (bascule) : Changement état bit Data K7 à chaque front montant de cassette_bit
248    if ((cassette_bit != cassette_bit_mem) && (cassette_bit !=0))
249    {
250       if (Data_K7 == 0x00)
251         Data_K7 =  0x80;// En poids fort
252       else
253          Data_K7 =  0x00;
254    }
255   value = ( CK_signal & 0x7F ) + Data_K7;
256    cassette_bit_mem = cassette_bit;  // Mémorisation état bit cassette
257}
258return value;
259}
260WRITE8_HANDLER( hector_sn_3000_w )
261{ // int i;
262    state3000 = data & 0xf8; // except bit 0 to 2
263//printf( "\n Etat registre 3000 =\"%x\"",data);
264   if ((data & 7) != oldstate3000 )
265       {
266           // Update sn76477 only when necessary!
267           Mise_A_Jour_Etat( 0x3000, data & 7 );
268          Update_Sound(space, data & 7);
269        }
270        oldstate3000 = data & 7;
271// affichage des valeurs saisies
272/*   for(i=0; i<24 ;i++ )
273   {
274      printf( "\n Etat 0 de la PIN %d DU SN76477 =\"%E\"",i,Pin_Value[i][0]);
275      printf( "\n Etat 1 de la PIN %d DU SN76477 =\"%E\"",i,Pin_Value[i][1]);
276   }
277   for(i=0; i<16 ;i++ )
278   {
279      printf( "\n Etat Au%d du SN76477 =\"%d\"",i,AU[i]);
280   }*/
281}
282/* Color Interface */
283WRITE8_HANDLER( hector_color_a_w )
284{
285static int counter_write=0; // Attente de quelque cycles avant demettre en route
286
287       if (data & 0x40)
288      {
289        // Bit 6 => motor ON/OFF => for cassette state!
290         if (write_cassette==0)
291         {
292          cassette_set_state(cassette_device_image(space->machine) , CASSETTE_PLAY || CASSETTE_SPEAKER_ENABLED);
293         }
294       }
295       else
296       {   // stop motor
297           cassette_set_state(cassette_device_image(space->machine) , CASSETTE_STOPPED);
298         write_cassette=0;
299         counter_write =0;
300       }
301      if (((data & 0x80) != (oldstate1000 & 0x80)) && ((oldstate1000 & 7)==(data & 7)) ) // Bit7 had change but not the color statement
302       {
303       // Bit 7 => Write bit for cassette!
304      counter_write +=1;
305
306      if (counter_write > 5)
307      {
308            // Wait several cycle before lauch the record to prevent somes bugs
309         counter_write = 6;
310         if (write_cassette==0)
311         {   // C'est la 1er fois => record
312            cassette_set_state(cassette_device_image(space->machine) , CASSETTE_RECORD );
313            write_cassette=1;
314         }
315      }
316      /* cassette data */
317      cassette_output(cassette_device_image(space->machine), ((data & 0x80) == 0x80) ? -1.0 : +1.0);
318      }
319
320        // Other bit : color definition   
321          Col0 =  data        & 0x07 ;
322      Col2 =((data >> 3)  & 0x07) | (Col2 & 0x40) ;
323
324      oldstate1000=data; // For next step
325}
326WRITE8_HANDLER( hector_color_b_w )
327{
328const device_config *discrete = devtag_get_device(space->machine, "discrete");
329          Col1 =  data        & 0x07 ;
330      Col3 = (data >> 3)  & 0x07;
331      // Half light on color 2 only on HR machines:
332      if (data & 0x40) Col2 |= 8; else Col2 &= 7;
333         // Play bit
334      discrete_sound_w(discrete, NODE_01,  (data & 0x80) ? 0:1 );
335}
336
337
338/******************************************************************************
339 Cassette Handling
340******************************************************************************/
341
342const device_config *cassette_device_image(running_machine *machine)
343{
344   return devtag_get_device(machine, "cassette");
345}
346
347
348
349/********************************************************************************
350 Port Handling
351********************************************************************************/
352 
353READ8_HANDLER( hector_mx_io_port_r)
354{
355   return 0;  // Imp ok
356}
357WRITE8_HANDLER( hector_mx40_io_port_w)
358{
359   if ((offset &0x0ff) == 0xf0) // Port A => to printer
360   {
361         printf("%c",data);
362         if (data==0x0d)
363                 printf("%c",0x0A);   // Add a CR to the LF (against printer).
364   }
365   if ((offset &0x0ff) == 0x40) // Port page 0
366      memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE0);
367   if ((offset &0x0ff) == 0x41) // Port page 1
368      {
369            memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE1);
370            flag_80c=0;
371      }
372   if ((offset &0x0ff) == 0x44) // Port page 2   // 42 pour MX80
373      memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE2);
374   if ((offset &0x0ff) == 0x49) // Port screen resolution
375      flag_80c=0;// No 80c in 40c !
376}
377
378WRITE8_HANDLER( hector_mx80_io_port_w)
379{
380   if ((offset &0x0ff) == 0xf0) // Port A => to printer
381   {
382         printf("%c",data);
383         if (data==0x0d)
384               printf("%c",0x0A);   // Add a CR to the LF (against printer).
385   }
386   if ((offset &0x0ff) == 0x40) // Port page 0
387      memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE0);
388   if ((offset &0x0ff) == 0x41) // Port page 1
389      {
390            memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE1);
391            flag_80c=0;
392      }
393   if ((offset &0x0ff) == 0x42) // Port page 2  => port different du MX40
394      memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE2);
395   if ((offset &0x0ff) == 0x49) // Port screen resolution
396      flag_80c=1;
397}
398
399///////////////////////////////////////////////////////////////////////
400// Gestion du son
401///////////////////////////////////////////////////////////////////////
402
403void Mise_A_Jour_Etat(int Adresse, int Value )
404{
405// Adjust value depending on I/O main CPU request
406 switch(Adresse )
407 {
408  case 0x2000:
409   // Modification AU0 / AU8
410   {  // AU0
411      AU[ 0] =  ((Value & 0x080 )==0) ? 0 : 1 ;
412      // AU8 : 0
413      AU[ 8] =  ((Value & 0x040 )==0) ? 0 : 1 ;   
414      break;
415   }
416  case 0x2001:
417   // Modification AU1 / AU9
418   {  // AU1
419      AU[ 1] =  ((Value & 0x080 )==0) ? 0 : 1 ;
420      // AU9
421      AU[ 9] =  ((Value & 0x040 )==0) ? 0 : 1 ;       
422      break;
423   }
424  case 0x2002:
425   // Modification AU2 / AU10
426   {  // AU2
427      AU[ 2] =  ((Value & 0x080 )==0) ? 0 : 1 ;
428      // AU10
429      AU[10] =  ((Value & 0x040 )==0) ? 0 : 1 ;       
430      break;   
431   }
432   case 0x2003:
433   // Modification AU3 / AU11
434   {  // AU3
435      AU[ 3] =  ((Value & 0x080 )==0) ? 0 : 1 ;
436      // AU11
437      AU[11] =  ((Value & 0x040 )==0) ? 0 : 1 ;           
438      break;
439   } 
440  case 0x2800:
441   // Modification AU4 / AU12
442   {  // AU4
443      AU[ 4] =  ((Value & 0x080 )==0) ? 0 : 1 ;
444      // AU8
445      AU[12] =  ((Value & 0x040 )==0) ? 0 : 1 ;         
446      break;
447   }
448  case 0x2801:
449   // Modification AU5 / AU13
450   {  // AU5
451      AU[ 5] =  ((Value & 0x080 )==0) ? 0 : 1 ;
452      // AU13
453      AU[13] =  ((Value & 0x040 )==0) ? 0 : 1 ;
454     break;
455   }
456  case 0x2802:
457   {  // Modification AU6 / AU14
458      // AU6
459      AU[ 6] = ((Value & 0x080 )==0) ? 0 : 1 ;
460      // AU14
461      AU[14] = ((Value & 0x040 )==0) ? 0 : 1 ;
462      break;     
463   }
464  case 0x2803:
465   // Modification AU7 / AU15
466   {  // AU7
467      AU[ 7] =  ((Value & 0x080 )==0) ? 0 : 1 ;
468      // AU15
469      AU[15] =  ((Value & 0x040 )==0) ? 0 : 1 ;
470      break;
471   }
472   case 0x3000:
473   // Mixer modification
474   { 
475      ValMixer = (Value & 7) ;
476       break;
477    }
478    default: break;
479   
480   } //switch
481}
482
483
484void Init_Value_SN76477_Hector(void)
485{
486     // Remplissage des valeurs de resistance et capacite d'Hector
487
488     // SetEnvelopControl( R10 , R7, C8 ) : Attack/Decay
489     // Decay R
490     Pin_Value[7][1] = RES_K(680.0); //680  vu
491     Pin_Value[7][0] = RES_K(222.325); // 142.325 (680 // 180KOhm)
492     
493     // Capa A/D
494     Pin_Value[8][0] = CAP_U(0.47); // 0.47uf
495     Pin_Value[8][1] = CAP_U(1.47);  // 1.47
496     
497     // ATTACK R
498     Pin_Value[10][1]= RES_K(180.0);   // 180
499     Pin_Value[10][0]= RES_K(32.054); // 32.054 (180 // 39 KOhm)
500     
501     // Version 3 : Ajusté pour les frequences mesurées :
502                // 4  0 SOUND 255 Hz => ajusté à l'oreille
503                // 4  4 SOUND  65 Hz => ajusté à l'oreille
504                // 4  8 SOUND  17 Hz =>  ajusté à l'oreille
505                // 4 12 SOUND 4,3 Hz =>  ajusté à l'oreille
506     // SLF C       Version 3
507     Pin_Value[21][0]= CAP_U(0.1);  //CAPU(0.1) vu
508     Pin_Value[21][1]= CAP_U(1.1);  //1.1
509     
510     //SLF R        Version 3
511     Pin_Value[20][1]= RES_K(180);    //180 vu
512     Pin_Value[20][0]= RES_K(37.268); //37.268 (47//180 KOhms)
513
514     // Capa VCO   
515     // Version 3 : Ajusté pour les frequences mesurées :
516             // 0 0  SOUND 5,5KHz => 5,1KHz
517             // 0 16 SOUND 1,3KHz => 1,2KHz
518             // 0 32 SOUND 580Hz  => 570Hz
519             // 0 48 SOUND 132Hz  => 120Hz   
520     Pin_Value[17][0] = CAP_N(47.0) ;  //47,0 mesure ok   // CAPU(0.047)
521     Pin_Value[17][1] = CAP_N(580.0) ; //580  mesure ok   // CAPU(0.517)
522     // R VCO   Version 3
523     Pin_Value[18][1] = RES_K(1400.0   );//1300 mesure ok    // au lieu de 1Mohm
524     Pin_Value[18][0] = RES_K( 203.548 );//223  mesure ok    // au lieu de 193.548 (1000 // 240KOhm)
525
526     // VCO Controle
527     Pin_Value[16][0] = 0.0;  //2.6; // Volts  // 0.1 vu
528     Pin_Value[16][1] = 1.41; //2;             // 2 =  10/15eme de 5V
529     
530     // Pitch
531     Pin_Value[19][0] = 0.0;   //2; // Volts  // 0 vu
532     Pin_Value[19][1] = 1.41; //0.2;           // 2
533     
534
535     // setVCO ( TOR_22)
536     Pin_Value[22][0] = 0; // TOR   //0
537     Pin_Value[22][1] = 1;          //1
538     
539     //setOneShot(R24, C23)
540     // R OneShot
541     Pin_Value[24][1] = RES_K(100);  //0
542     Pin_Value[24][0] = RES_K(1000);  //RES_M(1) infini sur Hector car non connectée
543
544     // Capa OneShot
545     Pin_Value[23][0] = 1.0;  //0     0.1 (0) et 0.0 (1)
546     Pin_Value[23][1] = 0.0;  //1   // Valeur Bidon sur Hector car mise au 5Volts sans capa
547
548     // Enabled
549     Pin_Value[9][0] = 0;          //0
550     Pin_Value[9][1] = 1;          //1
551     
552     // Volume
553     Pin_Value[11][0] = 128; // Rapport 50% et 100%  //128
554     Pin_Value[11][1] = 255;                         //255
555     
556     // Noise filter
557     Pin_Value[6][0] = CAP_U(0.390);    // 0.390
558     Pin_Value[6][1] = CAP_U(08.60);    // 0.48
559
560     // Valeur corrigé par rapport au schéma :
561     Pin_Value[5][1] = RES_K(3.30 ) ;     // 330Kohm
562     Pin_Value[5][0] = RES_K(1.76 ) ;     // 76 Kohm
563     
564     // Noise pas commandé par le bus audio !
565    // Seule la valeur [0] est documentée !
566     Pin_Value[4][0] = RES_K(47) ;      // 47 K ohm
567     Pin_Value[12][0] = RES_K(100);     // 100K ohm
568     Pin_Value[3][0] = 0 ;              // NC
569
570     // Gestion du type d'enveloppe
571     Pin_Value[ 1][0] = 0;
572     Pin_Value[ 1][1] = 1;
573     
574     Pin_Value[28][0] = 0;
575     Pin_Value[28][1] = 1;
576     
577     // Initialisation à 0 des pin du SN
578     AU[0]=0;
579     AU[1]=0;     
580     AU[2]=0;
581     AU[3]=0;
582     AU[4]=0;
583     AU[5]=0;     
584     AU[6]=0;
585     AU[7]=0;     
586     AU[8]=0;
587     AU[9]=0;     
588     AU[10]=0;
589     AU[11]=0;     
590     AU[12]=0;
591     AU[13]=0;     
592     AU[14]=0;
593     AU[15]=0;     
594     ValMixer = 0;
595}
596
597void Update_Sound(const address_space *space, UINT8 data)
598{
599   // keep device
600   const device_config *sn76477 = devtag_get_device(space->machine, "sn76477");
601
602   // MIXER
603   sn76477_mixer_a_w(sn76477, ((ValMixer & 0x04)==4) ? 1 : 0);
604   sn76477_mixer_b_w(sn76477, ((ValMixer & 0x01)==1) ? 1 : 0);
605   sn76477_mixer_c_w(sn76477, ((ValMixer & 0x02)==2) ? 1 : 0);// Revu selon mesure électronique
606
607    // VCO oscillateur
608    if (AU[12]==1)
609        sn76477_vco_res_w(      sn76477, Pin_Value[18][AU[10]]/12.0); // en non AU11
610    else
611        sn76477_vco_res_w(      sn76477, Pin_Value[18][AU[10]]); // en non AU11
612   
613    sn76477_vco_cap_w(      sn76477, Pin_Value[17][AU[2 ]]);
614    sn76477_pitch_voltage_w(sn76477, Pin_Value[19][AU[15]]);
615    sn76477_vco_voltage_w(   sn76477, Pin_Value[16][AU[15]]);
616    sn76477_vco_w(          sn76477, Pin_Value[22][AU[12]]); // VCO Select Ext/SLF
617
618   // SLF
619    sn76477_slf_res_w( sn76477, Pin_Value[20][AU[ 9]]);//AU10
620    sn76477_slf_cap_w( sn76477, Pin_Value[21][AU[1 ]]);
621   
622    // One Shot
623    sn76477_one_shot_res_w(sn76477, Pin_Value[24][     0]); // NC
624    sn76477_one_shot_cap_w(sn76477, Pin_Value[23][AU[13]]);
625   
626   // Ampli value
627    sn76477_amplitude_res_w(sn76477, Pin_Value[11][AU[5]]);
628   
629    // Attack / Decay
630    sn76477_attack_res_w(sn76477, Pin_Value[10][AU[ 8]]);
631    sn76477_decay_res_w( sn76477, Pin_Value[7 ][AU[11]]);//AU9
632    sn76477_attack_decay_cap_w(sn76477, Pin_Value[8][AU[0]]);
633   
634    // Filtre
635    sn76477_noise_filter_res_w(sn76477, Pin_Value[5][AU[4]]);
636    sn76477_noise_filter_cap_w(sn76477, Pin_Value[6][AU[3]]);
637   
638    // Clock Extern Noise
639    sn76477_noise_clock_res_w(sn76477, Pin_Value[4][0]); // fix   
640    sn76477_feedback_res_w(sn76477, Pin_Value[12][0]); //fix
641
642    //  Envelope
643    sn76477_envelope_1_w(sn76477, Pin_Value[1 ][AU[6]]);
644    sn76477_envelope_2_w(sn76477, Pin_Value[28][AU[7]]);
645   
646    // En dernier on lance (ou pas !)
647    sn76477_enable_w(sn76477, Pin_Value[9][AU[14]]);
648}
649
650sn76477_interface hector_sn76477_interface =
651{
652   RES_K(47),      //  4  noise_res
653   RES_K(330),      //  5  filter_res
654   CAP_P(390),      //  6  filter_cap
655   RES_K(680),      //  7  decay_res
656   CAP_U(47),      //  8  attack_decay_cap
657   RES_K(180),      // 10  attack_res
658   RES_K(33),      // 11  amplitude_res
659   RES_K(100),      // 12  feedback_res
660   2,            // 16  vco_voltage
661   CAP_N(47) ,      // 17  vco_cap
662   RES_K(1000),   // 18  vco_res
663   2,            // 19  pitch_voltage
664   RES_K(180),      // 20  slf_res
665   CAP_U(0.1),      // 21  slf_cap
666   CAP_U(1.00001),   // 23  oneshot_cap
667    RES_K(10000)   // 24  oneshot_res
668};
src/mess/mess.mak
r6349r6350
299299   $(MESSOBJ)/homebrew.a \
300300   $(MESSOBJ)/homelab.a \
301301   $(MESSOBJ)/hp.a \
302   $(MESSOBJ)/hec2hrp.a \
303   $(MESSOBJ)/interact.a \
302304   $(MESSOBJ)/intel.a \
303305   $(MESSOBJ)/intelgnt.a \
304306   $(MESSOBJ)/interton.a \
r6349r6350
886888   $(MESS_DRIVERS)/h8.o      \
887889   $(MESS_DRIVERS)/h19.o      \
888890   $(MESS_DRIVERS)/h89.o      \
889
891   
890892$(MESSOBJ)/hegener.a:         \
891893   $(MESS_DRIVERS)/glasgow.o   \
892894   $(MESS_DRIVERS)/mephisto.o   \
r6349r6350
906908   $(MESS_DEVICES)/xmodem.o   \
907909   $(MESS_DEVICES)/kermit.o   \
908910
911$(MESSOBJ)/hec2hrp.a:         \
912   $(MESS_DRIVERS)/hec2hrp.o   \
913   $(MESS_VIDEO)/hec2video.o   \
914   $(MESS_MACHINE)/hec2hrp.o   \
915
916$(MESSOBJ)/interact.a:         \
917   $(MESS_DRIVERS)/interact.o   \
918   $(MESS_VIDEO)/hec2video.o   \
919   $(MESS_MACHINE)/hec2hrp.o   \
920   
909921$(MESSOBJ)/intel.a:            \
910922   $(MESS_DRIVERS)/sdk86.o      \
911923
r6349r6350
14891501   $(MESS_VIDEO)/busicom.o      \
14901502   $(MESS_DRIVERS)/d6809.o      \
14911503   $(MESS_DRIVERS)/elwro800.o   \
1492   $(MESS_DRIVERS)/fk1.o      \
1493   $(MESS_DRIVERS)/interact.o   \
1494   $(MESS_DRIVERS)/hec2hrp.o   \
1504   $(MESS_DRIVERS)/fk1.o      \   
14951505   $(MESS_DRIVERS)/sys2900.o   \
14961506   $(MESS_DRIVERS)/xor100.o   \
14971507   $(MESS_DRIVERS)/iq151.o      \
src/mess/drivers/interact.c
r6349r6350
33        Interact Family Computer
44
55        12/05/2009 Skeleton driver - Micko
6    31/05/2009 Added notes and video - Robbbert
6   31/05/2009 Added notes and video - Robbbert
77
8    This was made by Interact Company of Ann Arbor, Michigan. However,
9    just after launch, the company collapsed. The liquidator, Protecto,
10    sold some and MicroVideo sold the rest. MicroVideo continued to
11    develop but went under 2 years later. Meanwhile, the French company
12    Lambda Systems sold a clone called the Victor Lambda. But, like the
13    Americans, Lambda Systems also collapsed. Another French company,
14    Micronique, purchased all remaining stock and intellectual rights
15    from Lambda Systems, Microvideo and Interact, and the computer becomes
16    wholly French. The computer has a name change, becoming the Hector.
17    This in turn gets upgraded (2HR, HRX, MX). The line is finally
18    retired in about 1985.
8   This was made by Interact Company of Ann Arbor, Michigan. However,
9   just after launch, the company collapsed. The liquidator, Protecto,
10   sold some and MicroVideo sold the rest. MicroVideo continued to
11   develop but went under 2 years later. Meanwhile, the French company
12   Lambda Systems sold a clone called the Victor Lambda. But, like the
13   Americans, Lambda Systems also collapsed. Another French company,
14   Micronique, purchased all remaining stock and intellectual rights
15   from Lambda Systems, Microvideo and Interact, and the computer becomes
16   wholly French. The computer has a name change, becoming the Hector.
17   This in turn gets upgraded (2HR, HRX, MX). The line is finally
18   retired in about 1985.
1919
20    TO DO:
21    Keyboard
22    Cassette
23    SN76477 / Sound
24    Colour
25    Cartload
20        Hector 2HR+
21        Victor
22        Hector 2HR
23        Hector HRX
24        Hector MX40c
25        Hector MX80c
26        Hector 1
27        Interact
28             
29        29/10/2009 Update skeleton to functional machine
30                          by yo_fr       (jj.stac@aliceadsl.fr)
31               
32               => add Keyboard,
33               => add color,
34               => add cassette,
35               => add sn76477 sound and 1bit sound,
36               => add joysticks (stick, pot, fire)
37               => add BR/HR switching
38               => add bank switch for HRX
39               => add device MX80c and bank switching for the ROM
40    Importante note : the keyboard function add been piked from
41                      DChector project : http://dchector.free.fr/ made by DanielCoulom
42                      (thank's Daniel)
43    TODO : Add the cartridge function,
44           Adjust the one shot and A/D timing (sn76477)
2645
2746****************************************************************************/
2847
2948#include "driver.h"
30#include "cpu/i8085/i8085.h"
49#include "cpu/z80/z80.h"   //i8085/i8085.h"
50#include "machine/pckeybrd.h"
51#include "devices/cassette.h"
52#include "sound/wave.h"      // for K7 sound
53#include "sound/sn76477.h"   // for sn sound
54#include "sound/discrete.h"  // for 1 Bit sound
3155
32static READ8_HANDLER( interact_keyboard_r )
33{
34   return 0x80;   // test only
35}
56#include "includes/hec2hrp.h"
3657
37static READ8_HANDLER( interact_videoram_r )
38{
39   return videoram[offset];
40}
58static ADDRESS_MAP_START(interact_mem, ADDRESS_SPACE_PROGRAM, 8)
59   ADDRESS_MAP_UNMAP_HIGH
60    // Hardward address mapping
61//   AM_RANGE(0x0800,0x0808) AM_WRITE( hector_switch_bank_w)// Bank management not udsed in BR machine
62   AM_RANGE(0x1000,0x1000) AM_WRITE( hector_color_a_w)  // Color c0/c1
63   AM_RANGE(0x1800,0x1800) AM_WRITE( hector_color_b_w)  // Color c2/c3
64   AM_RANGE(0x2000,0x2003) AM_WRITE( hector_sn_2000_w)  // Sound
65   AM_RANGE(0x2800,0x2803) AM_WRITE( hector_sn_2800_w)  // Sound
66   AM_RANGE(0x3000,0x3000) AM_READWRITE( hector_cassette_r, hector_sn_3000_w)// Write necessary
67   AM_RANGE(0x3800,0x3807) AM_READ( hector_keyboard_r)  // Keyboard
4168
42static WRITE8_HANDLER( interact_videoram_w )
43{
44   videoram[offset] = data;
45}
69    // Main ROM page
70   AM_RANGE(0x0000,0x3fff) AM_ROM  //BANK(2)
71 //   AM_RANGE(0x1000,0x3fff) AM_RAM
4672
47static ADDRESS_MAP_START(interact_mem, ADDRESS_SPACE_PROGRAM, 8)
48   ADDRESS_MAP_UNMAP_HIGH
49   AM_RANGE(0x0000,0x0fff) AM_ROM
50   AM_RANGE(0x3800,0x3807) AM_READ(interact_keyboard_r)
51   AM_RANGE(0x4000,0x47ff) AM_RAM AM_READWRITE(interact_videoram_r,interact_videoram_w) AM_BASE(&videoram)
52   AM_RANGE(0x4800,0x7fff) AM_RAM
73   // Vidéo br mapping
74   AM_RANGE(0x4000,0x49ff) AM_RAM AM_BASE(&videoram)
75   // continous RAM
76    AM_RANGE(0x4A00,0xffff) AM_RAM
77
5378ADDRESS_MAP_END
5479
55/* Input ports */
56static INPUT_PORTS_START( interact )
57INPUT_PORTS_END
80/* Cassette definition */
81const struct CassetteOptions interact_cassette_options = {
82   1,      /* channels */
83   16,      /* bits per sample */
84   44100   /* sample frequency */
85};
5886
87static const cassette_config interact_cassette_config =
88{
89   cassette_default_formats,
90   &interact_cassette_options,
91   CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER
92};
5993
94/* Discrete Sound */
95static DISCRETE_SOUND_START( hec2hrp )
96   DISCRETE_INPUT_LOGIC(NODE_01)
97   DISCRETE_OUTPUT(NODE_01, 5000)
98DISCRETE_SOUND_END
99
60100static MACHINE_RESET(interact)
61101{
102    flag_hr=0;
103    flag_clk =0;
104   write_cassette=0;
62105}
63106
107static MACHINE_START(interact)
108{
109UINT8 i;
110       
111   // Start keyboard
112    at_keyboard_init(machine, AT_KEYBOARD_TYPE_PC);
113    at_keyboard_reset();
114    at_keyboard_set_scan_code_set(2);
115    at_keyboard_reset();
116
117   // For keyboard
118    keyboard_timer = timer_alloc(machine, Callback_keyboard, 0);
119    timer_adjust_periodic(keyboard_timer, ATTOTIME_IN_MSEC(100), 0, ATTOTIME_IN_MSEC(20));//keyboard scan 25ms
120
121    for(i = 0; i < 8; i++) touches[i] = 0xff;     //all key off
122
123   // For Cassette synchro
124    Cassette_timer = timer_alloc(machine, Callback_CK, 0);
125    timer_adjust_periodic(Cassette_timer, ATTOTIME_IN_MSEC(100), 0, ATTOTIME_IN_USEC(64));// 11 * 6; 16 *4; 32 *2; 64 => real synchro scan speed for 15,624Khz
126 
127   // Sound sn76477
128   Init_Value_SN76477_Hector();  //init R/C value
129}
130
64131static VIDEO_START( interact )
65132{
133    Init_Hector_Palette(machine);
134    flag_hr=0;
66135}
67136
68137static VIDEO_UPDATE( interact )
69138{
70   UINT8 y,gfx;
71   UINT16 sy=0,ma=0,x;
72
73   for (y = 0; y < 64; y++)
74   {
75      UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
76
77      for (x = ma; x < ma + 32; x++)
78      {
79         gfx = videoram[x];
80
81         /* Display a scanline of a character (8 pixels) */
82         *p = ( gfx & 0x01 ) ? 1 : 0; p++;
83         *p = ( gfx & 0x02 ) ? 1 : 0; p++;
84         *p = ( gfx & 0x04 ) ? 1 : 0; p++;
85         *p = ( gfx & 0x08 ) ? 1 : 0; p++;
86         *p = ( gfx & 0x10 ) ? 1 : 0; p++;
87         *p = ( gfx & 0x20 ) ? 1 : 0; p++;
88         *p = ( gfx & 0x40 ) ? 1 : 0; p++;
89         *p = ( gfx & 0x80 ) ? 1 : 0; p++;
90      }
91      ma+=32;
92   }
139      video_screen_set_visarea(screen, 0, 113, 0, 75);
140    hector_hr( bitmap, videoram,  77, 32);
93141   return 0;
94142}
95143
96144static MACHINE_DRIVER_START( interact )
145
97146   /* basic machine hardware */
98   MDRV_CPU_ADD("maincpu",8080, XTAL_2MHz)
147   MDRV_CPU_ADD("maincpu", Z80, XTAL_1_75MHz)
99148   MDRV_CPU_PROGRAM_MAP(interact_mem)
100//  MDRV_CPU_VBLANK_INT("maincpu", interact_interrupt)
149    MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the 8080 irq in Hz
101150
102151   MDRV_MACHINE_RESET(interact)
152    MDRV_MACHINE_START(interact)
103153
104154   /* video hardware */
105155   MDRV_SCREEN_ADD("screen", RASTER)
r6349r6350
107157   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
108158   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
109159   MDRV_SCREEN_SIZE(256, 79)
110   MDRV_SCREEN_VISIBLE_AREA(0, 224, 0, 78)
111   MDRV_PALETTE_LENGTH(2)            // 8 colours, but only 4 at a time
160   MDRV_SCREEN_VISIBLE_AREA(0, 112, 0, 77)
161   MDRV_PALETTE_LENGTH(256)            // 8 colours, but only 4 at a time
112162   MDRV_PALETTE_INIT(black_and_white)
113163
114164   MDRV_VIDEO_START(interact)
115165   MDRV_VIDEO_UPDATE(interact)
166      /* sound hardware */
167   MDRV_SPEAKER_STANDARD_MONO("mono")
168   MDRV_SOUND_WAVE_ADD("wave", "cassette")
169   MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0
170
171   MDRV_SOUND_ADD("sn76477", SN76477, 0)
172   MDRV_SOUND_CONFIG(hector_sn76477_interface)
173   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1)
174   
175   MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit
176   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
177   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
178
179    // Gestion cassette
180    MDRV_CASSETTE_ADD( "cassette", interact_cassette_config )
181
116182MACHINE_DRIVER_END
117183
184/* Input ports */
185static INPUT_PORTS_START( interact )
186   PORT_INCLUDE( at_keyboard )
187INPUT_PORTS_END
188
189
190static SYSTEM_CONFIG_START(interact)
191SYSTEM_CONFIG_END
192
118193/* ROM definition */
119194ROM_START( interact )
120195   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
r6349r6350
126201   ROM_LOAD( "hector1.rom",  0x0000, 0x1000, CRC(3be6628b) SHA1(1c106d6732bed743d8283d39e5b8248271f18c42))
127202ROM_END
128203
129
130204/* Driver */
131205
132/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG      COMPANY   FULLNAME       FLAGS */
133COMP(1979, interact, 0,        0,       interact, interact, 0,   0,      "Interact",   "Interact Family Computer", GAME_NOT_WORKING)
134COMP(????, hector1,  interact, 0,    interact, interact, 0,  0,      "Micronique", "Hector 1",   GAME_NOT_WORKING)
135
206/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG       COMPANY   FULLNAME       FLAGS */
207COMP(1979, interact,        0, 0,   interact, interact,     0,   interact,      "Interact",   "Interact Family Computer", GAME_IMPERFECT_SOUND)
208COMP(????, hector1,  interact, 0,    interact, interact,     0,  interact,      "Micronique", "Hector 1",   GAME_IMPERFECT_SOUND)
src/mess/drivers/hec2hrp.c
r6349r6350
11/***************************************************************************
22
33        Hector 2HR+
4
4        Victor
5        Hector 2HR
6        Hector HRX
7        Hector MX40c
8        Hector MX80c
9       
510        12/05/2009 Skeleton driver - Micko
6    31/06/2009 Video - Robbbert
11       31/06/2009 Video - Robbbert
712
13        29/10/2009 Update skeleton to functional machine
14                          by yo_fr       (jj.stac@aliceadsl.fr)
15               
16               => add Keyboard,
17               => add color,
18               => add cassette,
19               => add sn76477 sound and 1bit sound,
20               => add joysticks (stick, pot, fire)
21               => add BR/HR switching
22               => add bank switch for HRX
23               => add device MX80c and bank switching for the ROM
24    Importante note : the keyboard function add been piked from
25                      DChector project : http://dchector.free.fr/ made by DanielCoulom
26                      (thank's Daniel)
27    TODO : Add the cartridge function,
28           Adjust the one shot and A/D timing (sn76477)
829****************************************************************************/
30//
31// Joystick 0 :
32// clavier numerique :
33//                (UP)5
34//  (left)1                     (right)3
35//               (down)2
36//
37// Fire <+>
38// Pot =>  UP/DOWN (arrows)
39//
40// Joystick 1 :
41// clavier numrique :
42//                (UP)/
43//  (left)7                     (right)9
44//               (down)8
45//
46// Fire <-> or <²>
47// Pot => INS /SUPPR
48// Cassete : wav file (1 way, 16 bits, 44100hz)
949
1050#include "driver.h"
51#include "machine/pckeybrd.h"
52#include "devices/cassette.h"
53#include "sound/wave.h"      // for K7 sound
54#include "sound/sn76477.h"   // for sn sound
55#include "sound/discrete.h"  // for 1 Bit sound
1156#include "cpu/z80/z80.h"
1257
13static READ8_HANDLER( hector_videoram_r )
14{
15   return videoram[offset];
16}
58#include "includes/hec2hrp.h"
1759
18static WRITE8_HANDLER( hector_videoram_w )
19{
20   videoram[offset] = data;
21}
2260
61// Rom page (MX machine)
62UINT8 rom_p1[0x04000]; // Basic 3x page
63UINT8 rom_p2[0x04000]; // Assemblex / Monitrix page
64
65// Ram video BR :
66UINT8 videoramhector[0x04000];
67// Status for screen definition
68UINT8 flag_hr=1;
69UINT8 flag_80c=0;
70// Status for CPU clock
71UINT8 flag_clk=0;  // 0 5MHz (HR machine) - 1  1.75MHz (BR machine)
72
73///////////////////////////////////////////////////////////////////////////////
2374static ADDRESS_MAP_START(hec2hrp_mem, ADDRESS_SPACE_PROGRAM, 8)
75///////////////////////////////////////////////////////////////////////////////
2476   ADDRESS_MAP_UNMAP_HIGH
25   AM_RANGE(0x0000,0x3fff) AM_ROM
26   AM_RANGE(0x4000,0xffff) AM_RAM
27   AM_RANGE(0xc000,0xf7ff) AM_READWRITE(hector_videoram_r,hector_videoram_w) AM_BASE(&videoram)
77
78    // Hardward address mapping
79   AM_RANGE(0x0800,0x0808) AM_WRITE( hector_switch_bank_w)// Bank management
80   AM_RANGE(0x1000,0x1000) AM_WRITE( hector_color_a_w)  // Color c0/c1
81   AM_RANGE(0x1800,0x1800) AM_WRITE( hector_color_b_w)  // Color c2/c3
82   AM_RANGE(0x2000,0x2003) AM_WRITE( hector_sn_2000_w)  // Sound
83   AM_RANGE(0x2800,0x2803) AM_WRITE( hector_sn_2800_w)  // Sound
84   AM_RANGE(0x3000,0x3000) AM_READWRITE( hector_cassette_r, hector_sn_3000_w)// Write necessary
85   AM_RANGE(0x3800,0x3807) AM_READ( hector_keyboard_r)  // Keyboard
86
87    // Main ROM page
88   AM_RANGE(0x0000,0x3fff) AM_ROMBANK(2)
89
90   // Vidéo br mapping
91   AM_RANGE(0x4000,0x49ff) AM_RAM AM_BASE(&videoram)
92   // continous RAM
93    AM_RANGE(0x4A00,0xbfff) AM_RAM
94   // from 0xC000 to 0xFFFF => Bank Ram for vidéo and data !
95   AM_RANGE(0xc000,0xffff) AM_RAMBANK(1)
2896ADDRESS_MAP_END
2997
3098static ADDRESS_MAP_START( hec2hrp_io , ADDRESS_SPACE_IO, 8)
3199   ADDRESS_MAP_UNMAP_HIGH
100    ADDRESS_MAP_GLOBAL_MASK(0xff)
32101ADDRESS_MAP_END
33102
103static ADDRESS_MAP_START( hec2mx40_io , ADDRESS_SPACE_IO, 8)
104   ADDRESS_MAP_UNMAP_HIGH
105    ADDRESS_MAP_GLOBAL_MASK(0xff)
106   AM_RANGE(0x000,0x0ff) AM_READWRITE( hector_mx_io_port_r, hector_mx40_io_port_w )
107ADDRESS_MAP_END
108
109static ADDRESS_MAP_START( hec2mx80_io , ADDRESS_SPACE_IO, 8)
110   ADDRESS_MAP_UNMAP_HIGH
111    ADDRESS_MAP_GLOBAL_MASK(0xff)
112   AM_RANGE(0x000,0x0ff) AM_READWRITE( hector_mx_io_port_r, hector_mx80_io_port_w )
113ADDRESS_MAP_END
114
34115/* Input ports */
35116static INPUT_PORTS_START( hec2hrp )
117   PORT_INCLUDE( at_keyboard )
36118INPUT_PORTS_END
37119
120///////////////////////////////////////////////////////////////////////////////
121static MACHINE_START( hec2hrp )
122///////////////////////////////////////////////////////////////////////////////
123{   
124UINT8 i;
38125
126UINT8 *RAM = memory_region(machine, "maincpu"); // pointer to mess ram
127UINT8 *ROM1 = memory_region(machine, "page1"); // pointer to rom page 1
128UINT8 *ROM2 = memory_region(machine, "page2"); // pointer to rom page 2
129
130    // Memory install for bank switching
131   memory_configure_bank(machine, 1, HECTOR_BANK_PROG , 1, &RAM[0xc000]  , 0); // Mess ram
132   memory_configure_bank(machine, 1, HECTOR_BANK_VIDEO, 1, videoramhector, 0); // Video ram
133
134    // Set bank HECTOR_BANK_PROG as basic bank
135   memory_set_bank(machine, 1, HECTOR_BANK_PROG);
136
137//////////////////////////////////////////////////////////SPECIFIQUE MX /////////////////
138   memory_configure_bank(machine, 2, HECTORMX_BANK_PAGE0 , 1, &RAM[0x0000]  , 0); // Mess ram
139   memory_configure_bank(machine, 2, HECTORMX_BANK_PAGE1 , 1, &ROM1[0x0000] , 0); // Rom page 1
140   memory_configure_bank(machine, 2, HECTORMX_BANK_PAGE2 , 1, &ROM2[0x0000] , 0); // Rom page 2
141   memory_set_bank(machine, 2, HECTORMX_BANK_PAGE0);
142//////////////////////////////////////////////////////////SPECIFIQUE MX /////////////////
143   // For keyboard
144    keyboard_timer = timer_alloc(machine, Callback_keyboard, 0);
145    timer_adjust_periodic(keyboard_timer, ATTOTIME_IN_MSEC(100), 0, ATTOTIME_IN_MSEC(20));//keyboard scan 25ms
146
147    // Start keyboard
148    at_keyboard_init(machine, AT_KEYBOARD_TYPE_PC);
149    at_keyboard_reset();
150    at_keyboard_set_scan_code_set(2);
151    at_keyboard_reset();
152
153    for(i = 0; i < 8; i++) touches[i] = 0xff;     //all key off
154
155   // For Cassette synchro
156    Cassette_timer = timer_alloc(machine, Callback_CK, 0);
157    timer_adjust_periodic(Cassette_timer, ATTOTIME_IN_MSEC(100), 0, ATTOTIME_IN_USEC(64));// 11 * 6; 16 *4; 32 *2; 64 => real synchro scan speed for 15,624Khz
158 
159   // Sound sn76477
160   Init_Value_SN76477_Hector();  //init R/C value
161}
162
39163static MACHINE_RESET(hec2hrp)
40164{
165   memory_set_bank(machine, 1, HECTOR_BANK_PROG);
166    memory_set_bank(machine, 2, HECTORMX_BANK_PAGE0);
167    flag_hr=1;
168    flag_clk =0;
169   write_cassette=0;
41170}
42171
172/* Cassette definition */
173const struct CassetteOptions hector_cassette_options = {
174   1,      /* channels */
175   16,      /* bits per sample */
176   44100   /* sample frequency */
177};
178
179static const cassette_config hector_cassette_config =
180{
181   cassette_default_formats,
182   &hector_cassette_options,
183   CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER
184};
185
186/* Discrete Sound */
187static DISCRETE_SOUND_START( hec2hrp )
188   DISCRETE_INPUT_LOGIC(NODE_01)
189   DISCRETE_OUTPUT(NODE_01, 5000)
190DISCRETE_SOUND_END
191
192///////////////////////////////////////////////////////////////////////////////
43193static VIDEO_START( hec2hrp )
194///////////////////////////////////////////////////////////////////////////////
44195{
196    Init_Hector_Palette(machine);
45197}
46198
47199static VIDEO_UPDATE( hec2hrp )
48200{
49   UINT8 gfx,y;
50   UINT16 sy=0,ma=0,x;
201    if (flag_hr==1)
202        {   
203           if (flag_80c==0)
204           {
205              video_screen_set_visarea(screen, 0, 243, 0, 227);
206              hector_hr( bitmap , &videoramhector[0], 227, 64);
207           }
208           else
209           {
210               video_screen_set_visarea(screen, 0, 243*2, 0, 227);
211               hector_80c( bitmap , &videoramhector[0], 227, 64);
212           }
213        }
214   else
215        {
216              video_screen_set_visarea(screen, 0, 113, 0, 75);
217            hector_hr( bitmap, videoram,  77, 32);
218        }
219    return 0;
220}
51221
52   for (y = 0; y < 224; y++)
53   {
54      UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
222///////////////////////////////////////////////////////////////////////////////
223static MACHINE_DRIVER_START( hec2hr )
224///////////////////////////////////////////////////////////////////////////////
225   /* basic machine hardware */
226   MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz)
227   MDRV_CPU_PROGRAM_MAP(hec2hrp_mem)
228   MDRV_CPU_IO_MAP(hec2hrp_io)
229   MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
230   MDRV_MACHINE_RESET(hec2hrp)
231   MDRV_MACHINE_START(hec2hrp)
55232
56      for (x = ma; x < ma + 64; x++)
57      {
58         gfx = videoram[x];
233   /* video hardware */
234   MDRV_SCREEN_ADD("screen", RASTER)
235   MDRV_SCREEN_REFRESH_RATE(50)
236   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(400)) /* 2500 not accurate */
237   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
238   MDRV_SCREEN_SIZE(512, 230) 
239   MDRV_SCREEN_VISIBLE_AREA(0, 243, 0, 227) 
240    MDRV_PALETTE_LENGTH(256)
241   MDRV_PALETTE_INIT(black_and_white)
242   MDRV_VIDEO_START(hec2hrp)
243   MDRV_VIDEO_UPDATE(hec2hrp)
59244
60         /* Display a scanline of a character (8 pixels) */
61         *p = ( gfx & 0x01 ) ? 1 : 0; p++;
62         *p = ( gfx & 0x02 ) ? 1 : 0; p++;
63         *p = ( gfx & 0x04 ) ? 1 : 0; p++;
64         *p = ( gfx & 0x08 ) ? 1 : 0; p++;
65         *p = ( gfx & 0x10 ) ? 1 : 0; p++;
66         *p = ( gfx & 0x20 ) ? 1 : 0; p++;
67         *p = ( gfx & 0x40 ) ? 1 : 0; p++;
68         *p = ( gfx & 0x80 ) ? 1 : 0; p++;
69      }
70      ma+=64;
71   }
72   return 0;
73}
245   /* sound hardware */
246   MDRV_SPEAKER_STANDARD_MONO("mono")
247   MDRV_SOUND_WAVE_ADD("wave", "cassette")
248   MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0
74249
75static MACHINE_DRIVER_START( hec2hrp )
250   MDRV_SOUND_ADD("sn76477", SN76477, 0)
251   MDRV_SOUND_CONFIG(hector_sn76477_interface)
252   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1)
253   
254   MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit
255   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
256   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
257
258    // Gestion cassette
259    MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
260
261MACHINE_DRIVER_END
262
263///////////////////////////////////////////////////////////////////////////////
264 MACHINE_DRIVER_START( hec2hrp )
265///////////////////////////////////////////////////////////////////////////////
76266   /* basic machine hardware */
77   MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)
267   MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz)
78268   MDRV_CPU_PROGRAM_MAP(hec2hrp_mem)
79269   MDRV_CPU_IO_MAP(hec2hrp_io)
270   MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
271   MDRV_MACHINE_RESET(hec2hrp)
272   MDRV_MACHINE_START(hec2hrp)
80273
274   /* video hardware */
275   MDRV_SCREEN_ADD("screen", RASTER)
276   MDRV_SCREEN_REFRESH_RATE(50)
277   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(400)) /* 2500 not accurate */
278   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
279   MDRV_SCREEN_SIZE(512, 230) 
280   MDRV_SCREEN_VISIBLE_AREA(0, 243, 0, 227) 
281    MDRV_PALETTE_LENGTH(256)
282   MDRV_PALETTE_INIT(black_and_white)
283   MDRV_VIDEO_START(hec2hrp)
284   MDRV_VIDEO_UPDATE(hec2hrp)
285
286   /* sound hardware */
287   MDRV_SPEAKER_STANDARD_MONO("mono")
288   MDRV_SOUND_WAVE_ADD("wave", "cassette")
289   MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0
290
291   MDRV_SOUND_ADD("sn76477", SN76477, 0)
292   MDRV_SOUND_CONFIG(hector_sn76477_interface)
293   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1)
294   
295   MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit
296   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
297   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
298
299    // Gestion cassette
300    MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
301
302MACHINE_DRIVER_END
303
304///////////////////////////////////////////////////////////////////////////////
305static MACHINE_DRIVER_START( hec2mx40 )
306///////////////////////////////////////////////////////////////////////////////
307   /* basic machine hardware */
308   MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz)
309   MDRV_CPU_PROGRAM_MAP(hec2hrp_mem)
310   MDRV_CPU_IO_MAP(hec2mx40_io)
311   MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
81312   MDRV_MACHINE_RESET(hec2hrp)
313   MDRV_MACHINE_START(hec2hrp)
82314
83315   /* video hardware */
84316   MDRV_SCREEN_ADD("screen", RASTER)
85317   MDRV_SCREEN_REFRESH_RATE(50)
86   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
318   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(400)) /* 2500 not accurate */
87319   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
88   MDRV_SCREEN_SIZE(512, 224)
89   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 223)
90   MDRV_PALETTE_LENGTH(2)
320   MDRV_SCREEN_SIZE(512, 230) 
321   MDRV_SCREEN_VISIBLE_AREA(0, 243, 0, 227) 
322    MDRV_PALETTE_LENGTH(256)
91323   MDRV_PALETTE_INIT(black_and_white)
324   MDRV_VIDEO_START(hec2hrp)
325   MDRV_VIDEO_UPDATE(hec2hrp)
92326
327   /* sound hardware */
328   MDRV_SPEAKER_STANDARD_MONO("mono")
329   MDRV_SOUND_WAVE_ADD("wave", "cassette")
330   MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0
331
332   MDRV_SOUND_ADD("sn76477", SN76477, 0)
333   MDRV_SOUND_CONFIG(hector_sn76477_interface)
334   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1)
335   
336   MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit
337   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
338   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
339
340    // Gestion cassette
341    MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
342
343MACHINE_DRIVER_END
344
345///////////////////////////////////////////////////////////////////////////////
346static MACHINE_DRIVER_START( hec2mx80 )
347///////////////////////////////////////////////////////////////////////////////
348   /* basic machine hardware */
349   MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz)
350   MDRV_CPU_PROGRAM_MAP(hec2hrp_mem)
351   MDRV_CPU_IO_MAP(hec2mx80_io)
352   MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
353   MDRV_MACHINE_RESET(hec2hrp)
354   MDRV_MACHINE_START(hec2hrp)
355
356   /* video hardware */
357   MDRV_SCREEN_ADD("screen", RASTER)
358   MDRV_SCREEN_REFRESH_RATE(50)
359   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(400)) /* 2500 not accurate */
360   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
361   MDRV_SCREEN_SIZE(512, 230) 
362   MDRV_SCREEN_VISIBLE_AREA(0, 243, 0, 227) 
363    MDRV_PALETTE_LENGTH(256)
364   MDRV_PALETTE_INIT(black_and_white)
93365   MDRV_VIDEO_START(hec2hrp)
94366   MDRV_VIDEO_UPDATE(hec2hrp)
367
368   /* sound hardware */
369   MDRV_SPEAKER_STANDARD_MONO("mono")
370   MDRV_SOUND_WAVE_ADD("wave", "cassette")
371   MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0
372
373   MDRV_SOUND_ADD("sn76477", SN76477, 0)
374   MDRV_SOUND_CONFIG(hector_sn76477_interface)
375   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1)
376   
377   MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit
378   MDRV_SOUND_CONFIG_DISCRETE( hec2hrp )
379   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
380
381    // Gestion cassette
382    MDRV_CASSETTE_ADD( "cassette", hector_cassette_config )
383
95384MACHINE_DRIVER_END
96385
97386/* ROM definition */
387ROM_START( hec2hr )
388   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
389   ROM_LOAD( "2hr.bin", 0x0000, 0x1000, CRC(84b9e672) SHA1(8c8b089166122eee565addaed10f84c5ce6d849b))
390   ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
391   ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
392ROM_END
393
394ROM_START( victor )
395   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
396   ROM_LOAD( "victor.rom",  0x0000, 0x1000, CRC(d1e9508f) SHA1(d0f1bdcd39917FAFC8859223AB38EEE2A7DC85FF))
397   ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
398   ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
399ROM_END
400
98401ROM_START( hec2hrp )
99402   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
100403   ROM_LOAD( "hector2hrp.rom", 0x0000, 0x4000, CRC(983f52e4) SHA1(71695941d689827356042ee52ffe55ce7e6b8ecd))
404   ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
405   ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
101406ROM_END
102407
103408ROM_START( hec2hrx )
104409   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
105410   ROM_LOAD( "hector2hrx.rom", 0x0000, 0x4000, CRC(f047c521) SHA1(744336b2acc76acd7c245b562bdc96dca155b066))
411   ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
412   ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
413ROM_END
414
415ROM_START( hec2mx80 )
416   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
417   ROM_LOAD( "mx80c_page0.rom" , 0x0000,0x4000, CRC(A75945CF) SHA1(542391E482271BE0997B069CF13C8B5DAE28FEEC))
418   ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
419   ROM_LOAD( "mx80c_page1.rom", 0x0000, 0x4000, CRC(4615f57c) SHA1(5de291bf3ae0320915133b99f1a088cb56c41658))
420   ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
421   ROM_LOAD( "mx80c_page2.rom" , 0x0000,0x4000, CRC(2D5D975E) SHA1(48307132E0F3FAD0262859BB8142D108F694A436))
106422ROM_END
107423
424ROM_START( hec2mx40 )
425   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
426   ROM_LOAD( "mx40c_page0.rom" , 0x0000,0x4000, CRC(9bb5566d) SHA1(0c8c2e396ec8eb995d2b621abe06b6968ca5d0aa))
427   ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF )
428   ROM_LOAD( "mx40c_page1.rom", 0x0000, 0x4000, CRC(192a76fa) SHA1(062aa6df0b554b85774d4b5edeea8496a4baca35))
429   ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF )
430   ROM_LOAD( "mx40c_page2.rom" , 0x0000,0x4000, CRC(ef1b2654) SHA1(66624ea040cb7ede4720ad2eca0738d0d3bad89a))
431ROM_END
432
108433/* Driver */
109434
110435/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG COMPANY   FULLNAME       FLAGS */
111COMP(1983, hec2hrp,  0,       0,     hec2hrp,    hec2hrp, 0,       0,      "Micronique",   "Hector 2HR+",   GAME_NOT_WORKING)
112COMP(????, hec2hrx,  hec2hrp, 0,     hec2hrp,    hec2hrp, 0,       0,      "Micronique",   "Hector 2HRX",   GAME_NOT_WORKING)
113
436COMP(1983, hec2hrp,  0,       0,     hec2hrp,    hec2hrp, 0,       0,      "Micronique",   "Hector 2HR+",   GAME_IMPERFECT_SOUND)
437COMP(????, victor,   hec2hrp, 0,     hec2hrp,   hec2hrp, 0,       0,      "Micronique",   "Victor",   GAME_IMPERFECT_SOUND)
438COMP(1983, hec2hr ,  hec2hrp, 0,     hec2hr,    hec2hrp, 0,       0,      "Micronique",   "Hector 2HR",   GAME_IMPERFECT_SOUND)
439COMP(1984, hec2hrx,  hec2hrp, 0,     hec2hrp,    hec2hrp, 0,       0,      "Micronique",   "Hector HRX",   GAME_IMPERFECT_SOUND)
440COMP(1985, hec2mx80, hec2hrp, 0,    hec2mx80,    hec2hrp, 0,       0,      "Micronique",   "Hector MX 80c" ,   GAME_IMPERFECT_SOUND)
441COMP(1985, hec2mx40, hec2hrp, 0,    hec2mx40,    hec2hrp, 0,       0,      "Micronique",   "Hector MX 40c" ,   GAME_IMPERFECT_SOUND)
docs/messnew.txt
r6349r6350
22
33New System Drivers Supported (in no particular order):
44------------------------------------------------------
5(none)
5- Hector MX40c [JJ Stacino]
6- Hector MX80c [JJ Stacino]
67
78
8
99Systems Promoted from GAME_NOT_WORKING:
1010---------------------------------------
11(none)
11- Hector 2HR+ [JJ Stacino]
12- Hector 2HR [JJ Stacino]
13- Hector HRX [JJ Stacino]
14- Victor [JJ Stacino]
1215
1316
14
1517Skeleton drivers:
1618-----------------
1719(none)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team