src/mess/video/hec2video.c
| r0 | r6350 | |
| 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 |
| 40 | UINT8 Col0, Col1,Col2,Col3; // For actual colors |
| 41 | |
| 42 | |
| 43 | |
| 44 | void 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 | |
| 72 | void 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 | |
| 113 | void 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/machine/hec2hrp.c
| r0 | r6350 | |
| 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 | |
| 44 | const device_config *cassette_device_image(running_machine *machine); |
| 45 | |
| 46 | |
| 47 | // Stat for the register in 0x3000 |
| 48 | UINT8 state3000=0; |
| 49 | UINT8 write_cassette=0; |
| 50 | |
| 51 | // Keyboard timer |
| 52 | TIMER_CALLBACK( Callback_keyboard ); |
| 53 | emu_timer *keyboard_timer; |
| 54 | |
| 55 | // Cassette timer |
| 56 | TIMER_CALLBACK( Callback_CK ); |
| 57 | emu_timer *Cassette_timer; |
| 58 | UINT8 CK_signal ; // Synchro signal for K7 |
| 59 | |
| 60 | |
| 61 | UINT8 actions=0xff; // keyboard key off |
| 62 | |
| 63 | double Pin_Value[28][2]; // SN76477 |
| 64 | int AU[17]; // Pour les fils de bus audio du SN76477 |
| 65 | int ValMixer; // for mixer |
| 66 | int oldstate3000; // Edge state mixer |
| 67 | int oldstate1000; // Edge state cassette |
| 68 | |
| 69 | |
| 70 | //#include "drivers/hec2son.c" // need to create a header file... |
| 71 | |
| 72 | // Keyboard map |
| 73 | UINT8 touches[8]; |
| 74 | UINT8 pot0 = 0x40, pot1 = 0x40; // State for joy resistor |
| 75 | |
| 76 | // To generate the CK signal (K7) |
| 77 | TIMER_CALLBACK( Callback_CK ) |
| 78 | { |
| 79 | CK_signal++; |
| 80 | } |
| 81 | |
| 82 | TIMER_CALLBACK( Callback_keyboard ) |
| 83 | { |
| 84 | int touche ; |
| 85 | int Code0 ; |
| 86 | |
| 87 | // update pot position |
| 88 | if((actions & 0x04) != 0) if(pot0 > 0x00) pot0--; |
| 89 | if((actions & 0x08) != 0) if(pot0 < 0x7f) pot0++; |
| 90 | if((actions & 0x40) != 0) if(pot1 > 0x00) pot1--; |
| 91 | if((actions & 0x80) != 0) if(pot1 < 0x7f) pot1++; |
| 92 | |
| 93 | // Keyboard => read |
| 94 | at_keyboard_polling(); |
| 95 | touche = at_keyboard_read(); |
| 96 | if (touche ==-1) return; // Nothing to do => out! |
| 97 | if ( (touche & 0x80) == 0 ) |
| 98 | { // stroke on |
| 99 | Code0 = touche & 0x7F; |
| 100 | if (Code0==0x36) Code0=0x2A; // Right shift |
| 101 | Key( Code0, 0x00, machine); |
| 102 | } |
| 103 | if ( (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 | |
| 111 | void Key(int pccode, int state, running_machine *machine) |
| 112 | { |
| 113 | // Mise a jour de l'image du clavier ///////////////////////////////////////// |
| 114 | int 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 | |
| 159 | WRITE8_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 | |
| 198 | READ8_HANDLER( hector_keyboard_r ) |
| 199 | { |
| 200 | return touches[offset]; //send the pre calculated value |
| 201 | } |
| 202 | |
| 203 | WRITE8_HANDLER( hector_sn_2000_w ) |
| 204 | { |
| 205 | Mise_A_Jour_Etat( 0x2000+ offset, data); |
| 206 | Update_Sound(space, data); |
| 207 | } |
| 208 | WRITE8_HANDLER( hector_sn_2800_w ) |
| 209 | { |
| 210 | Mise_A_Jour_Etat( 0x2800+ offset, data); |
| 211 | Update_Sound(space, data); |
| 212 | } |
| 213 | READ8_HANDLER( hector_cassette_r ) |
| 214 | { |
| 215 | double level; |
| 216 | UINT8 value=0; |
| 217 | static UINT8 cassette_bit=0; |
| 218 | static UINT8 cassette_bit_mem=0; |
| 219 | static UINT8 Data_K7=0; |
| 220 | |
| 221 | if ((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 | } |
| 234 | else |
| 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 | } |
| 258 | return value; |
| 259 | } |
| 260 | WRITE8_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 */ |
| 283 | WRITE8_HANDLER( hector_color_a_w ) |
| 284 | { |
| 285 | static 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 | } |
| 326 | WRITE8_HANDLER( hector_color_b_w ) |
| 327 | { |
| 328 | const 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 | |
| 342 | const 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 | |
| 353 | READ8_HANDLER( hector_mx_io_port_r) |
| 354 | { |
| 355 | return 0; // Imp ok |
| 356 | } |
| 357 | WRITE8_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 | |
| 378 | WRITE8_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 | |
| 403 | void 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 | |
| 484 | void 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 | |
| 597 | void 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 | |
| 650 | sn76477_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/drivers/interact.c
| r6349 | r6350 | |
| 3 | 3 | Interact Family Computer |
| 4 | 4 | |
| 5 | 5 | 12/05/2009 Skeleton driver - Micko |
| 6 | | 31/05/2009 Added notes and video - Robbbert |
| 6 | 31/05/2009 Added notes and video - Robbbert |
| 7 | 7 | |
| 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. |
| 19 | 19 | |
| 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) |
| 26 | 45 | |
| 27 | 46 | ****************************************************************************/ |
| 28 | 47 | |
| 29 | 48 | #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 |
| 31 | 55 | |
| 32 | | static READ8_HANDLER( interact_keyboard_r ) |
| 33 | | { |
| 34 | | return 0x80; // test only |
| 35 | | } |
| 56 | #include "includes/hec2hrp.h" |
| 36 | 57 | |
| 37 | | static READ8_HANDLER( interact_videoram_r ) |
| 38 | | { |
| 39 | | return videoram[offset]; |
| 40 | | } |
| 58 | static 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 |
| 41 | 68 | |
| 42 | | static 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 |
| 46 | 72 | |
| 47 | | static 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 | |
| 53 | 78 | ADDRESS_MAP_END |
| 54 | 79 | |
| 55 | | /* Input ports */ |
| 56 | | static INPUT_PORTS_START( interact ) |
| 57 | | INPUT_PORTS_END |
| 80 | /* Cassette definition */ |
| 81 | const struct CassetteOptions interact_cassette_options = { |
| 82 | 1, /* channels */ |
| 83 | 16, /* bits per sample */ |
| 84 | 44100 /* sample frequency */ |
| 85 | }; |
| 58 | 86 | |
| 87 | static const cassette_config interact_cassette_config = |
| 88 | { |
| 89 | cassette_default_formats, |
| 90 | &interact_cassette_options, |
| 91 | CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER |
| 92 | }; |
| 59 | 93 | |
| 94 | /* Discrete Sound */ |
| 95 | static DISCRETE_SOUND_START( hec2hrp ) |
| 96 | DISCRETE_INPUT_LOGIC(NODE_01) |
| 97 | DISCRETE_OUTPUT(NODE_01, 5000) |
| 98 | DISCRETE_SOUND_END |
| 99 | |
| 60 | 100 | static MACHINE_RESET(interact) |
| 61 | 101 | { |
| 102 | flag_hr=0; |
| 103 | flag_clk =0; |
| 104 | write_cassette=0; |
| 62 | 105 | } |
| 63 | 106 | |
| 107 | static MACHINE_START(interact) |
| 108 | { |
| 109 | UINT8 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 | |
| 64 | 131 | static VIDEO_START( interact ) |
| 65 | 132 | { |
| 133 | Init_Hector_Palette(machine); |
| 134 | flag_hr=0; |
| 66 | 135 | } |
| 67 | 136 | |
| 68 | 137 | static VIDEO_UPDATE( interact ) |
| 69 | 138 | { |
| 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); |
| 93 | 141 | return 0; |
| 94 | 142 | } |
| 95 | 143 | |
| 96 | 144 | static MACHINE_DRIVER_START( interact ) |
| 145 | |
| 97 | 146 | /* basic machine hardware */ |
| 98 | | MDRV_CPU_ADD("maincpu",8080, XTAL_2MHz) |
| 147 | MDRV_CPU_ADD("maincpu", Z80, XTAL_1_75MHz) |
| 99 | 148 | 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 |
| 101 | 150 | |
| 102 | 151 | MDRV_MACHINE_RESET(interact) |
| 152 | MDRV_MACHINE_START(interact) |
| 103 | 153 | |
| 104 | 154 | /* video hardware */ |
| 105 | 155 | MDRV_SCREEN_ADD("screen", RASTER) |
| r6349 | r6350 | |
| 107 | 157 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 108 | 158 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 109 | 159 | 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 |
| 112 | 162 | MDRV_PALETTE_INIT(black_and_white) |
| 113 | 163 | |
| 114 | 164 | MDRV_VIDEO_START(interact) |
| 115 | 165 | 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 | |
| 116 | 182 | MACHINE_DRIVER_END |
| 117 | 183 | |
| 184 | /* Input ports */ |
| 185 | static INPUT_PORTS_START( interact ) |
| 186 | PORT_INCLUDE( at_keyboard ) |
| 187 | INPUT_PORTS_END |
| 188 | |
| 189 | |
| 190 | static SYSTEM_CONFIG_START(interact) |
| 191 | SYSTEM_CONFIG_END |
| 192 | |
| 118 | 193 | /* ROM definition */ |
| 119 | 194 | ROM_START( interact ) |
| 120 | 195 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| r6349 | r6350 | |
| 126 | 201 | ROM_LOAD( "hector1.rom", 0x0000, 0x1000, CRC(3be6628b) SHA1(1c106d6732bed743d8283d39e5b8248271f18c42)) |
| 127 | 202 | ROM_END |
| 128 | 203 | |
| 129 | | |
| 130 | 204 | /* Driver */ |
| 131 | 205 | |
| 132 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 133 | | COMP(1979, interact, 0, 0, interact, interact, 0, 0, "Interact", "Interact Family Computer", GAME_NOT_WORKING) |
| 134 | | COMP(????, 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 */ |
| 207 | COMP(1979, interact, 0, 0, interact, interact, 0, interact, "Interact", "Interact Family Computer", GAME_IMPERFECT_SOUND) |
| 208 | COMP(????, hector1, interact, 0, interact, interact, 0, interact, "Micronique", "Hector 1", GAME_IMPERFECT_SOUND) |
src/mess/drivers/hec2hrp.c
| r6349 | r6350 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | 3 | Hector 2HR+ |
| 4 | | |
| 4 | Victor |
| 5 | Hector 2HR |
| 6 | Hector HRX |
| 7 | Hector MX40c |
| 8 | Hector MX80c |
| 9 | |
| 5 | 10 | 12/05/2009 Skeleton driver - Micko |
| 6 | | 31/06/2009 Video - Robbbert |
| 11 | 31/06/2009 Video - Robbbert |
| 7 | 12 | |
| 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) |
| 8 | 29 | ****************************************************************************/ |
| 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) |
| 9 | 49 | |
| 10 | 50 | #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 |
| 11 | 56 | #include "cpu/z80/z80.h" |
| 12 | 57 | |
| 13 | | static READ8_HANDLER( hector_videoram_r ) |
| 14 | | { |
| 15 | | return videoram[offset]; |
| 16 | | } |
| 58 | #include "includes/hec2hrp.h" |
| 17 | 59 | |
| 18 | | static WRITE8_HANDLER( hector_videoram_w ) |
| 19 | | { |
| 20 | | videoram[offset] = data; |
| 21 | | } |
| 22 | 60 | |
| 61 | // Rom page (MX machine) |
| 62 | UINT8 rom_p1[0x04000]; // Basic 3x page |
| 63 | UINT8 rom_p2[0x04000]; // Assemblex / Monitrix page |
| 64 | |
| 65 | // Ram video BR : |
| 66 | UINT8 videoramhector[0x04000]; |
| 67 | // Status for screen definition |
| 68 | UINT8 flag_hr=1; |
| 69 | UINT8 flag_80c=0; |
| 70 | // Status for CPU clock |
| 71 | UINT8 flag_clk=0; // 0 5MHz (HR machine) - 1 1.75MHz (BR machine) |
| 72 | |
| 73 | /////////////////////////////////////////////////////////////////////////////// |
| 23 | 74 | static ADDRESS_MAP_START(hec2hrp_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 75 | /////////////////////////////////////////////////////////////////////////////// |
| 24 | 76 | 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) |
| 28 | 96 | ADDRESS_MAP_END |
| 29 | 97 | |
| 30 | 98 | static ADDRESS_MAP_START( hec2hrp_io , ADDRESS_SPACE_IO, 8) |
| 31 | 99 | ADDRESS_MAP_UNMAP_HIGH |
| 100 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 32 | 101 | ADDRESS_MAP_END |
| 33 | 102 | |
| 103 | static 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 ) |
| 107 | ADDRESS_MAP_END |
| 108 | |
| 109 | static 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 ) |
| 113 | ADDRESS_MAP_END |
| 114 | |
| 34 | 115 | /* Input ports */ |
| 35 | 116 | static INPUT_PORTS_START( hec2hrp ) |
| 117 | PORT_INCLUDE( at_keyboard ) |
| 36 | 118 | INPUT_PORTS_END |
| 37 | 119 | |
| 120 | /////////////////////////////////////////////////////////////////////////////// |
| 121 | static MACHINE_START( hec2hrp ) |
| 122 | /////////////////////////////////////////////////////////////////////////////// |
| 123 | { |
| 124 | UINT8 i; |
| 38 | 125 | |
| 126 | UINT8 *RAM = memory_region(machine, "maincpu"); // pointer to mess ram |
| 127 | UINT8 *ROM1 = memory_region(machine, "page1"); // pointer to rom page 1 |
| 128 | UINT8 *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 | |
| 39 | 163 | static MACHINE_RESET(hec2hrp) |
| 40 | 164 | { |
| 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; |
| 41 | 170 | } |
| 42 | 171 | |
| 172 | /* Cassette definition */ |
| 173 | const struct CassetteOptions hector_cassette_options = { |
| 174 | 1, /* channels */ |
| 175 | 16, /* bits per sample */ |
| 176 | 44100 /* sample frequency */ |
| 177 | }; |
| 178 | |
| 179 | static 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 */ |
| 187 | static DISCRETE_SOUND_START( hec2hrp ) |
| 188 | DISCRETE_INPUT_LOGIC(NODE_01) |
| 189 | DISCRETE_OUTPUT(NODE_01, 5000) |
| 190 | DISCRETE_SOUND_END |
| 191 | |
| 192 | /////////////////////////////////////////////////////////////////////////////// |
| 43 | 193 | static VIDEO_START( hec2hrp ) |
| 194 | /////////////////////////////////////////////////////////////////////////////// |
| 44 | 195 | { |
| 196 | Init_Hector_Palette(machine); |
| 45 | 197 | } |
| 46 | 198 | |
| 47 | 199 | static VIDEO_UPDATE( hec2hrp ) |
| 48 | 200 | { |
| 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 | } |
| 51 | 221 | |
| 52 | | for (y = 0; y < 224; y++) |
| 53 | | { |
| 54 | | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 222 | /////////////////////////////////////////////////////////////////////////////// |
| 223 | static 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) |
| 55 | 232 | |
| 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) |
| 59 | 244 | |
| 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 |
| 74 | 249 | |
| 75 | | static 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 | |
| 261 | MACHINE_DRIVER_END |
| 262 | |
| 263 | /////////////////////////////////////////////////////////////////////////////// |
| 264 | MACHINE_DRIVER_START( hec2hrp ) |
| 265 | /////////////////////////////////////////////////////////////////////////////// |
| 76 | 266 | /* basic machine hardware */ |
| 77 | | MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz) |
| 267 | MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz) |
| 78 | 268 | MDRV_CPU_PROGRAM_MAP(hec2hrp_mem) |
| 79 | 269 | 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) |
| 80 | 273 | |
| 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 | |
| 302 | MACHINE_DRIVER_END |
| 303 | |
| 304 | /////////////////////////////////////////////////////////////////////////////// |
| 305 | static 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 |
| 81 | 312 | MDRV_MACHINE_RESET(hec2hrp) |
| 313 | MDRV_MACHINE_START(hec2hrp) |
| 82 | 314 | |
| 83 | 315 | /* video hardware */ |
| 84 | 316 | MDRV_SCREEN_ADD("screen", RASTER) |
| 85 | 317 | 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 */ |
| 87 | 319 | 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) |
| 91 | 323 | MDRV_PALETTE_INIT(black_and_white) |
| 324 | MDRV_VIDEO_START(hec2hrp) |
| 325 | MDRV_VIDEO_UPDATE(hec2hrp) |
| 92 | 326 | |
| 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 | |
| 343 | MACHINE_DRIVER_END |
| 344 | |
| 345 | /////////////////////////////////////////////////////////////////////////////// |
| 346 | static 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) |
| 93 | 365 | MDRV_VIDEO_START(hec2hrp) |
| 94 | 366 | 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 | |
| 95 | 384 | MACHINE_DRIVER_END |
| 96 | 385 | |
| 97 | 386 | /* ROM definition */ |
| 387 | ROM_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 ) |
| 392 | ROM_END |
| 393 | |
| 394 | ROM_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 ) |
| 399 | ROM_END |
| 400 | |
| 98 | 401 | ROM_START( hec2hrp ) |
| 99 | 402 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 100 | 403 | ROM_LOAD( "hector2hrp.rom", 0x0000, 0x4000, CRC(983f52e4) SHA1(71695941d689827356042ee52ffe55ce7e6b8ecd)) |
| 404 | ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF ) |
| 405 | ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF ) |
| 101 | 406 | ROM_END |
| 102 | 407 | |
| 103 | 408 | ROM_START( hec2hrx ) |
| 104 | 409 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 105 | 410 | ROM_LOAD( "hector2hrx.rom", 0x0000, 0x4000, CRC(f047c521) SHA1(744336b2acc76acd7c245b562bdc96dca155b066)) |
| 411 | ROM_REGION( 0x4000, "page1", ROMREGION_ERASEFF ) |
| 412 | ROM_REGION( 0x4000, "page2", ROMREGION_ERASEFF ) |
| 413 | ROM_END |
| 414 | |
| 415 | ROM_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)) |
| 106 | 422 | ROM_END |
| 107 | 423 | |
| 424 | ROM_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)) |
| 431 | ROM_END |
| 432 | |
| 108 | 433 | /* Driver */ |
| 109 | 434 | |
| 110 | 435 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 111 | | COMP(1983, hec2hrp, 0, 0, hec2hrp, hec2hrp, 0, 0, "Micronique", "Hector 2HR+", GAME_NOT_WORKING) |
| 112 | | COMP(????, hec2hrx, hec2hrp, 0, hec2hrp, hec2hrp, 0, 0, "Micronique", "Hector 2HRX", GAME_NOT_WORKING) |
| 113 | | |
| 436 | COMP(1983, hec2hrp, 0, 0, hec2hrp, hec2hrp, 0, 0, "Micronique", "Hector 2HR+", GAME_IMPERFECT_SOUND) |
| 437 | COMP(????, victor, hec2hrp, 0, hec2hrp, hec2hrp, 0, 0, "Micronique", "Victor", GAME_IMPERFECT_SOUND) |
| 438 | COMP(1983, hec2hr , hec2hrp, 0, hec2hr, hec2hrp, 0, 0, "Micronique", "Hector 2HR", GAME_IMPERFECT_SOUND) |
| 439 | COMP(1984, hec2hrx, hec2hrp, 0, hec2hrp, hec2hrp, 0, 0, "Micronique", "Hector HRX", GAME_IMPERFECT_SOUND) |
| 440 | COMP(1985, hec2mx80, hec2hrp, 0, hec2mx80, hec2hrp, 0, 0, "Micronique", "Hector MX 80c" , GAME_IMPERFECT_SOUND) |
| 441 | COMP(1985, hec2mx40, hec2hrp, 0, hec2mx40, hec2hrp, 0, 0, "Micronique", "Hector MX 40c" , GAME_IMPERFECT_SOUND) |