src/mess/machine/hec2hrp.c
| r6902 | r6903 | |
| 23 | 23 | => add BR/HR switching |
| 24 | 24 | => add bank switch for HRX |
| 25 | 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) |
| 26 | 03/01/2010 Update and clean prog by yo_fr (jj.stac@aliceadsl.fr) |
| 27 | => add the port mapping for keyboard |
| 28 | |
| 29 | don't forget to keep some information about these machines, see DChector project : http://dchector.free.fr/ made by DanielCoulom |
| 30 | (and thank's to Daniel!) |
| 31 | |
| 29 | 32 | TODO : Add the cartridge function, |
| 30 | 33 | Adjust the one shot and A/D timing (sn76477) |
| 31 | 34 | */ |
| r6902 | r6903 | |
| 33 | 36 | #include "driver.h" |
| 34 | 37 | #include "devices/cassette.h" |
| 35 | 38 | #include "devices/printer.h" |
| 36 | | #include "sound/sn76477.h" // for sn sound |
| 37 | | #include "sound/wave.h" // for K7 sound |
| 38 | | #include "sound/discrete.h" // for 1 Bit sound |
| 39 | | #include "machine/pckeybrd.h" |
| 39 | #include "sound/sn76477.h" /* for sn sound*/ |
| 40 | #include "sound/wave.h" /* for K7 sound*/ |
| 41 | #include "sound/discrete.h" /* for 1 Bit sound*/ |
| 40 | 42 | #include "deprecat.h" |
| 41 | | |
| 42 | | #include "includes/hectorkey.h" // Keyboard mapping |
| 43 | 43 | #include "includes/hec2hrp.h" |
| 44 | 44 | |
| 45 | 45 | |
| r6902 | r6903 | |
| 48 | 48 | |
| 49 | 49 | static const device_config *cassette_device_image(running_machine *machine); |
| 50 | 50 | |
| 51 | | static void Key(int pccode, int state, running_machine *machine); |
| 52 | | |
| 53 | | // Stat for the register in 0x3000 |
| 51 | /* Stat for the register in 0x3000*/ |
| 54 | 52 | static UINT8 state3000=0; |
| 55 | 53 | static UINT8 write_cassette=0; |
| 56 | 54 | |
| 57 | | // Keyboard timer |
| 58 | | static TIMER_CALLBACK( Callback_keyboard ); |
| 59 | | static emu_timer *keyboard_timer; |
| 60 | | |
| 61 | | // Cassette timer |
| 55 | /* Cassette timer*/ |
| 62 | 56 | static TIMER_CALLBACK( Callback_CK ); |
| 63 | 57 | static emu_timer *Cassette_timer; |
| 64 | | static UINT8 CK_signal ; // Synchro signal for K7 |
| 58 | static UINT8 CK_signal ; /* Synchro signal for K7*/ |
| 65 | 59 | |
| 66 | | // Status for CPU clock |
| 67 | | static UINT8 flag_clk=0; // 0 5MHz (HR machine) - 1 1.75MHz (BR machine) |
| 60 | /* Status for CPU clock*/ |
| 61 | static UINT8 flag_clk=0; /* 0 5MHz (HR machine) - 1 1.75MHz (BR machine)*/ |
| 68 | 62 | |
| 63 | static double Pin_Value[29][2]; /* SN76477*/ |
| 64 | static int AU[17]; /* Pour les fils de bus audio du SN76477*/ |
| 65 | static int ValMixer; /* for mixer*/ |
| 66 | static int oldstate3000; /* Edge state mixer*/ |
| 67 | static int oldstate1000; /* Edge state cassette*/ |
| 69 | 68 | |
| 70 | 69 | |
| 71 | | static UINT8 actions=0xff; // keyboard key off |
| 70 | /* joy map*/ |
| 71 | static UINT8 pot0 = 0x40, pot1 = 0x40; /* State for joy resistor*/ |
| 72 | static UINT8 actions; /* joy button off*/ |
| 72 | 73 | |
| 73 | | static double Pin_Value[29][2]; // SN76477 |
| 74 | | static int AU[17]; // Pour les fils de bus audio du SN76477 |
| 75 | | static int ValMixer; // for mixer |
| 76 | | static int oldstate3000; // Edge state mixer |
| 77 | | static int oldstate1000; // Edge state cassette |
| 78 | | |
| 79 | | |
| 80 | | //#include "drivers/hec2son.c" // need to create a header file... |
| 81 | | |
| 82 | | // Keyboard map |
| 83 | | static UINT8 touches[8]; |
| 84 | | static UINT8 pot0 = 0x40, pot1 = 0x40; // State for joy resistor |
| 85 | | |
| 86 | | // To generate the CK signal (K7) |
| 87 | 74 | static TIMER_CALLBACK( Callback_CK ) |
| 88 | 75 | { |
| 76 | /* To generate the CK signal (K7)*/ |
| 89 | 77 | CK_signal++; |
| 90 | 78 | } |
| 91 | 79 | |
| 92 | | static TIMER_CALLBACK( Callback_keyboard ) |
| 93 | | { |
| 94 | | int touche ; |
| 95 | | int Code0 ; |
| 96 | | |
| 97 | | // update pot position |
| 98 | | if((actions & 0x04) != 0) if(pot0 > 0x00) pot0--; |
| 99 | | if((actions & 0x08) != 0) if(pot0 < 0x7f) pot0++; |
| 100 | | if((actions & 0x40) != 0) if(pot1 > 0x00) pot1--; |
| 101 | | if((actions & 0x80) != 0) if(pot1 < 0x7f) pot1++; |
| 102 | | |
| 103 | | // Keyboard => read |
| 104 | | at_keyboard_polling(); |
| 105 | | touche = at_keyboard_read(); |
| 106 | | if (touche ==-1) return; // Nothing to do => out! |
| 107 | | if ( (touche & 0x80) == 0 ) |
| 108 | | { // stroke on |
| 109 | | Code0 = touche & 0x7F; |
| 110 | | if (Code0==0x36) Code0=0x2A; // Right shift |
| 111 | | Key( Code0, 0x00, machine); |
| 112 | | } |
| 113 | | if ( (touche & 0x80) != 0 ) |
| 114 | | { // stroke off |
| 115 | | Code0 = touche & 0x7F; |
| 116 | | if (Code0==0x36) Code0=0x2A; // Right shift |
| 117 | | Key( Code0, 0x80, machine); |
| 118 | | } |
| 119 | | } |
| 120 | | |
| 121 | | static void Key(int pccode, int state, running_machine *machine) |
| 122 | | { |
| 123 | | // Mise a jour de l'image du clavier ///////////////////////////////////////// |
| 124 | | int i, j, n; |
| 125 | | n = hectorkey[(pccode & 0x7f) | ((pccode & 0x100) >> 1)]; |
| 126 | | // printf("\n touche = %x",pccode); |
| 127 | | if(n > 0x77) return; |
| 128 | | |
| 129 | | switch(n) |
| 130 | | { |
| 131 | | // Si c'est une demande joystick -> sortie directe avec le code |
| 132 | | case 0x08: if(state) actions |= 1; else actions &= 0xfe; return; //b0=action0 + |
| 133 | | case 0x09: if(state) actions |= 2; else actions &= 0xfd; return; //b1=action1 - |
| 134 | | case 0x0a: if(state) actions |= 4; else actions &= 0xfb; return; //b2=gauche |
| 135 | | case 0x0b: if(state) actions |= 8; else actions &= 0xf7; return; //b3=droite |
| 136 | | case 0x0c: if(state) actions |= 16; else actions &= 0xef; return; //b4=bas |
| 137 | | case 0x0d: if(state) actions |= 32; else actions &= 0xdf; return; //b5=haut |
| 138 | | case 0x0e: if(state) actions |= 64; else actions &= 0xbf; return; //b6=pdown |
| 139 | | case 0x0f: if(state) actions |= 128; else actions &= 0x7f; return; //b7=pup |
| 140 | | } |
| 141 | | j = 1; |
| 142 | | if (n==0x00) // Reset machine ! (on ESC key) |
| 143 | | { |
| 144 | | cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE); |
| 145 | | if (!strncmp(machine->gamedrv->name , "hec2xxxx" , 4) | |
| 146 | | !strncmp(machine->gamedrv->name , "victor" , 6) ) // aviable for all HR machines |
| 147 | | { |
| 148 | | memory_set_bank(machine, "bank1", HECTOR_BANK_PROG); |
| 149 | | memory_set_bank(machine, "bank2", HECTORMX_BANK_PAGE0); |
| 150 | | hector_flag_hr=1; |
| 151 | | } |
| 152 | | else |
| 153 | | hector_flag_hr=0; |
| 154 | | //Common flag |
| 155 | | hector_flag_80c = 0; |
| 156 | | flag_clk = 0; |
| 157 | | return ; |
| 158 | | } |
| 159 | | for(i = 0; i < (n & 7); i++) |
| 160 | | j += j; |
| 161 | | |
| 162 | | i = (n >> 4) & 7; |
| 163 | | if(state) |
| 164 | | touches[i] |= j; |
| 165 | | else |
| 166 | | touches[i] &= ~j; |
| 167 | | } |
| 168 | | |
| 169 | 80 | WRITE8_HANDLER( hector_switch_bank_w ) |
| 170 | 81 | { |
| 171 | | if (offset==0x00) { // 0x800 et 0x000=> vid??o page, HR |
| 82 | if (offset==0x00) { /* 0x800 et 0x000=> video page, HR*/ |
| 172 | 83 | memory_set_bank(space->machine, "bank1", HECTOR_BANK_VIDEO); |
| 173 | 84 | if (flag_clk ==1) |
| 174 | 85 | { |
| 175 | 86 | flag_clk=0; |
| 176 | | cputag_set_clock(space->machine, "maincpu", XTAL_5MHz); // Augmentation CPU |
| 87 | cputag_set_clock(space->machine, "maincpu", XTAL_5MHz); /* Augmentation CPU*/ |
| 177 | 88 | } |
| 178 | 89 | } |
| 179 | | if (offset==0x04) { // 0x804 => vid??o page, BR |
| 90 | if (offset==0x04) { /* 0x804 => video page, BR*/ |
| 180 | 91 | hector_flag_hr=0; |
| 181 | 92 | memory_set_bank(space->machine, "bank1", HECTOR_BANK_VIDEO); |
| 182 | 93 | if (flag_clk ==0) |
| 183 | 94 | { |
| 184 | 95 | flag_clk=1; |
| 185 | | cputag_set_clock(space->machine, "maincpu", XTAL_1_75MHz); // Ralentissement CPU |
| 96 | cputag_set_clock(space->machine, "maincpu", XTAL_1_75MHz); /* Ralentissement CPU*/ |
| 186 | 97 | } |
| 187 | 98 | } |
| 188 | | if (offset==0x08) { // 0x808 => base page, HR |
| 99 | if (offset==0x08) { /* 0x808 => base page, HR*/ |
| 189 | 100 | memory_set_bank(space->machine, "bank1", HECTOR_BANK_PROG); |
| 190 | 101 | if (flag_clk ==1) |
| 191 | 102 | { |
| 192 | 103 | flag_clk=0; |
| 193 | | cputag_set_clock(space->machine, "maincpu", XTAL_5MHz); // Augmentation CPU |
| 104 | cputag_set_clock(space->machine, "maincpu", XTAL_5MHz); /* Augmentation CPU*/ |
| 194 | 105 | } |
| 195 | 106 | |
| 196 | 107 | } |
| 197 | | if (offset==0x0c) { // 0x80c => base page, BR |
| 108 | if (offset==0x0c) { /* 0x80c => base page, BR*/ |
| 198 | 109 | hector_flag_hr=0; |
| 199 | 110 | memory_set_bank(space->machine, "bank1", HECTOR_BANK_PROG); |
| 200 | 111 | if (flag_clk ==0) |
| 201 | 112 | { |
| 202 | 113 | flag_clk=1; |
| 203 | | cputag_set_clock(space->machine, "maincpu", XTAL_1_75MHz); // Ralentissement CPU |
| 114 | cputag_set_clock(space->machine, "maincpu", XTAL_1_75MHz); /* Ralentissement CPU*/ |
| 204 | 115 | } |
| 205 | 116 | } |
| 206 | 117 | } |
| 207 | 118 | |
| 208 | 119 | WRITE8_HANDLER( hector_keyboard_w ) |
| 209 | 120 | { |
| 210 | | //nothing to do => Key() function manage the value |
| 121 | /*nothing to do => read function manage the value*/ |
| 211 | 122 | } |
| 212 | 123 | |
| 213 | 124 | READ8_HANDLER( hector_keyboard_r ) |
| 214 | 125 | { |
| 215 | | return touches[offset]; //send the pre calculated value |
| 126 | UINT8 data = 0xff; |
| 127 | running_machine *machine = space->machine; |
| 128 | |
| 129 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8" }; |
| 130 | |
| 131 | if (offset ==7) /* Only when joy reading*/ |
| 132 | { |
| 133 | /* Read special key for analog joystick emulation only (button and pot are analog signal!) and the reset */ |
| 134 | data=input_port_read(machine, keynames[8]); |
| 135 | |
| 136 | if (data & 0x01) /* Reset machine ! (on ESC key)*/ |
| 137 | { |
| 138 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE); |
| 139 | if (!strncmp(machine->gamedrv->name , "hec2xxxx" , 4) | |
| 140 | !strncmp(machine->gamedrv->name , "victor" , 6) ) /* aviable for all HR machines*/ |
| 141 | { |
| 142 | memory_set_bank(machine, "bank1", HECTOR_BANK_PROG); |
| 143 | memory_set_bank(machine, "bank2", HECTORMX_BANK_PAGE0); |
| 144 | hector_flag_hr=1; |
| 145 | } |
| 146 | else |
| 147 | hector_flag_hr=0; |
| 148 | /*Common flag*/ |
| 149 | hector_flag_80c = 0; |
| 150 | flag_clk = 0; |
| 151 | |
| 152 | } |
| 153 | |
| 154 | actions = 0; |
| 155 | if (data & 0x02) /* Fire(0)*/ |
| 156 | actions += 1; |
| 157 | |
| 158 | if (data & 0x04) /* Fire(1)*/ |
| 159 | actions += 2; |
| 160 | |
| 161 | if (data & 0x08) /* Pot(0)+*/ |
| 162 | pot0 += 1; |
| 163 | if (pot0>128) pot0 = 128; |
| 164 | |
| 165 | if (data & 0x10) /* Pot(0)-*/ |
| 166 | pot0 -= 1; |
| 167 | |
| 168 | if (pot0>250) pot0 = 0; |
| 169 | |
| 170 | if (data & 0x20) /* Pot(1)+*/ |
| 171 | pot1 += 1; |
| 172 | if (pot1>128) pot1 = 128; |
| 173 | |
| 174 | if (data & 0x40) /* Pot(1)-*/ |
| 175 | pot1 -= 1; |
| 176 | |
| 177 | if (pot1>250) pot1 = 0; |
| 178 | } |
| 179 | |
| 180 | /* in all case return the request value*/ |
| 181 | return input_port_read(space->machine, keynames[offset]); |
| 216 | 182 | } |
| 217 | 183 | |
| 218 | 184 | WRITE8_HANDLER( hector_sn_2000_w ) |
| r6902 | r6903 | |
| 233 | 199 | static UINT8 cassette_bit_mem=0; |
| 234 | 200 | static UINT8 Data_K7=0; |
| 235 | 201 | |
| 236 | | if ((state3000 & 0x38) != 0x38 ) // Selon Sb choix cassette ou timer (74153) |
| 202 | if ((state3000 & 0x38) != 0x38 ) /* Selon Sb choix cassette ou timer (74153)*/ |
| 237 | 203 | { |
| 238 | 204 | |
| 239 | | Data_K7 = 0x00; // No cassette => clear bit |
| 205 | Data_K7 = 0x00; /* No cassette => clear bit*/ |
| 240 | 206 | switch (state3000 & 0x38 ) |
| 241 | 207 | { |
| 242 | | case 0x08: value = (actions & 1) ? 0x80 : 0; break; //(actions & 1) ? 0x80 : 0; |
| 208 | case 0x08: value = (actions & 1) ? 0x80 : 0; break; |
| 243 | 209 | case 0x10: value = pot0; break; |
| 244 | | case 0x20: value = (actions & 2) ? 0x80 : 0; break; //(actions & 2) ? 0x80 : 0; |
| 210 | case 0x20: value = (actions & 2) ? 0x80 : 0; break; |
| 245 | 211 | case 0x28: value = pot1; break; |
| 246 | 212 | default: value = 0; break; |
| 247 | 213 | } |
| r6902 | r6903 | |
| 250 | 216 | { |
| 251 | 217 | if (write_cassette == 0) |
| 252 | 218 | { |
| 253 | | // Acc??e ?? la cassette |
| 219 | /* Accee a la cassette*/ |
| 254 | 220 | level = cassette_input(cassette_device_image(space->machine)); |
| 255 | 221 | |
| 256 | | // Travail du 741 en trigger |
| 222 | /* Travail du 741 en trigger*/ |
| 257 | 223 | if (level < -0.08) |
| 258 | 224 | cassette_bit = 0x00; |
| 259 | 225 | if (level > +0.08) |
| 260 | 226 | cassette_bit = 0x01; |
| 261 | 227 | } |
| 262 | | // Programme du sn7474 (bascule) : Changement ??tat bit Data K7 ?? chaque front montant de cassette_bit |
| 228 | /* Programme du sn7474 (bascule) : Changement ??tat bit Data K7 ?? chaque front montant de cassette_bit*/ |
| 263 | 229 | if ((cassette_bit != cassette_bit_mem) && (cassette_bit !=0)) |
| 264 | 230 | { |
| 265 | 231 | if (Data_K7 == 0x00) |
| 266 | | Data_K7 = 0x80;// En poids fort |
| 232 | Data_K7 = 0x80;/* En poids fort*/ |
| 267 | 233 | else |
| 268 | 234 | Data_K7 = 0x00; |
| 269 | 235 | } |
| 270 | 236 | value = ( CK_signal & 0x7F ) + Data_K7; |
| 271 | | cassette_bit_mem = cassette_bit; // M??morisation ??tat bit cassette |
| 237 | cassette_bit_mem = cassette_bit; /* Memorisation etat bit cassette*/ |
| 272 | 238 | } |
| 273 | 239 | return value; |
| 274 | 240 | } |
| 275 | 241 | WRITE8_HANDLER( hector_sn_3000_w ) |
| 276 | 242 | { |
| 277 | | state3000 = data & 0xf8; // except bit 0 to 2 |
| 243 | state3000 = data & 0xf8; /* except bit 0 to 2*/ |
| 278 | 244 | if ((data & 7) != oldstate3000 ) |
| 279 | 245 | { |
| 280 | | // Update sn76477 only when necessary! |
| 246 | /* Update sn76477 only when necessary!*/ |
| 281 | 247 | Mise_A_Jour_Etat( 0x3000, data & 7 ); |
| 282 | 248 | Update_Sound(space, data & 7); |
| 283 | 249 | } |
| r6902 | r6903 | |
| 287 | 253 | /* Color Interface */ |
| 288 | 254 | WRITE8_HANDLER( hector_color_a_w ) |
| 289 | 255 | { |
| 290 | | static int counter_write=0; // Attente de quelque cycles avant demettre en route |
| 256 | static int counter_write=0; /* Attente de quelque cycles avant demettre en route*/ |
| 291 | 257 | |
| 292 | 258 | if (data & 0x40) |
| 293 | 259 | { |
| 294 | | // Bit 6 => motor ON/OFF => for cassette state! |
| 260 | /* Bit 6 => motor ON/OFF => for cassette state!*/ |
| 295 | 261 | if (write_cassette==0) |
| 296 | 262 | { |
| 297 | 263 | cassette_set_state(cassette_device_image(space->machine) , CASSETTE_PLAY || CASSETTE_SPEAKER_ENABLED); |
| 298 | 264 | } |
| 299 | 265 | } |
| 300 | 266 | else |
| 301 | | { // stop motor |
| 267 | { /* stop motor*/ |
| 302 | 268 | cassette_set_state(cassette_device_image(space->machine) , CASSETTE_STOPPED); |
| 303 | 269 | write_cassette=0; |
| 304 | 270 | counter_write =0; |
| 305 | 271 | } |
| 306 | | if (((data & 0x80) != (oldstate1000 & 0x80)) && ((oldstate1000 & 7)==(data & 7)) ) // Bit7 had change but not the color statement |
| 272 | if (((data & 0x80) != (oldstate1000 & 0x80)) && ((oldstate1000 & 7)==(data & 7)) ) /* Bit7 had change but not the color statement*/ |
| 307 | 273 | { |
| 308 | | // Bit 7 => Write bit for cassette! |
| 274 | /* Bit 7 => Write bit for cassette!*/ |
| 309 | 275 | counter_write +=1; |
| 310 | 276 | |
| 311 | 277 | if (counter_write > 5) |
| 312 | 278 | { |
| 313 | | // Wait several cycle before lauch the record to prevent somes bugs |
| 279 | /* Wait several cycle before lauch the record to prevent somes bugs*/ |
| 314 | 280 | counter_write = 6; |
| 315 | 281 | if (write_cassette==0) |
| 316 | | { // C'est la 1er fois => record |
| 282 | { /* C'est la 1er fois => record*/ |
| 317 | 283 | cassette_set_state(cassette_device_image(space->machine) , CASSETTE_RECORD ); |
| 318 | 284 | write_cassette=1; |
| 319 | 285 | } |
| r6902 | r6903 | |
| 322 | 288 | cassette_output(cassette_device_image(space->machine), ((data & 0x80) == 0x80) ? -1.0 : +1.0); |
| 323 | 289 | } |
| 324 | 290 | |
| 325 | | // Other bit : color definition |
| 291 | /* Other bit : color definition*/ |
| 326 | 292 | hector_color[0] = data & 0x07 ; |
| 327 | 293 | hector_color[2] = ((data >> 3) & 0x07) | (hector_color[2] & 0x40); |
| 328 | 294 | |
| 329 | | oldstate1000=data; // For next step |
| 295 | oldstate1000=data; /* For next step*/ |
| 330 | 296 | } |
| 331 | 297 | WRITE8_HANDLER( hector_color_b_w ) |
| 332 | 298 | { |
| r6902 | r6903 | |
| 334 | 300 | hector_color[1] = data & 0x07; |
| 335 | 301 | hector_color[3] = (data >> 3) & 0x07; |
| 336 | 302 | |
| 337 | | // Half light on color 2 only on HR machines: |
| 303 | /* Half light on color 2 only on HR machines:*/ |
| 338 | 304 | if (data & 0x40) hector_color[2] |= 8; else hector_color[2] &= 7; |
| 339 | 305 | |
| 340 | | // Play bit |
| 306 | /* Play bit*/ |
| 341 | 307 | discrete_sound_w(discrete, NODE_01, (data & 0x80) ? 0:1 ); |
| 342 | 308 | } |
| 343 | 309 | |
| r6902 | r6903 | |
| 358 | 324 | |
| 359 | 325 | READ8_HANDLER( hector_mx_io_port_r) |
| 360 | 326 | { |
| 361 | | return 0; // Imp ok |
| 327 | return 0; // printer ok |
| 362 | 328 | } |
| 363 | 329 | WRITE8_HANDLER( hector_mx40_io_port_w) |
| 364 | 330 | { |
| 365 | | if ((offset &0x0ff) == 0xf0) // Port A => to printer |
| 331 | if ((offset &0x0ff) == 0xf0) /* Port A => to printer*/ |
| 366 | 332 | printer_output(devtag_get_device(space->machine, "printer"), data); |
| 367 | | if ((offset &0x0ff) == 0x40) // Port page 0 |
| 333 | if ((offset &0x0ff) == 0x40) /* Port page 0*/ |
| 368 | 334 | memory_set_bank(space->machine, "bank2", HECTORMX_BANK_PAGE0); |
| 369 | | if ((offset &0x0ff) == 0x41) // Port page 1 |
| 335 | if ((offset &0x0ff) == 0x41) /* Port page 1*/ |
| 370 | 336 | { |
| 371 | 337 | memory_set_bank(space->machine, "bank2", HECTORMX_BANK_PAGE1); |
| 372 | 338 | hector_flag_80c=0; |
| 373 | 339 | } |
| 374 | | if ((offset &0x0ff) == 0x44) // Port page 2 // 42 pour MX80 |
| 340 | if ((offset &0x0ff) == 0x44) /* Port page 2 => 42 pour MX80*/ |
| 375 | 341 | memory_set_bank(space->machine, "bank2", HECTORMX_BANK_PAGE2); |
| 376 | | if ((offset &0x0ff) == 0x49) // Port screen resolution |
| 377 | | hector_flag_80c=0;// No 80c in 40c ! |
| 342 | if ((offset &0x0ff) == 0x49) /* Port screen resolution*/ |
| 343 | hector_flag_80c=0;/* No 80c in 40c !*/ |
| 378 | 344 | } |
| 379 | 345 | |
| 380 | 346 | WRITE8_HANDLER( hector_mx80_io_port_w) |
| 381 | 347 | { |
| 382 | | if ((offset &0x0ff) == 0xf0) // Port A => to printer |
| 348 | if ((offset &0x0ff) == 0xf0) /* Port A => to printer*/ |
| 383 | 349 | printer_output(devtag_get_device(space->machine, "printer"), data); |
| 384 | | if ((offset &0x0ff) == 0x40) // Port page 0 |
| 350 | if ((offset &0x0ff) == 0x40) /* Port page 0*/ |
| 385 | 351 | memory_set_bank(space->machine, "bank2", HECTORMX_BANK_PAGE0); |
| 386 | | if ((offset &0x0ff) == 0x41) // Port page 1 |
| 352 | if ((offset &0x0ff) == 0x41) /* Port page 1*/ |
| 387 | 353 | { |
| 388 | 354 | memory_set_bank(space->machine, "bank2", HECTORMX_BANK_PAGE1); |
| 389 | 355 | hector_flag_80c=0; |
| 390 | 356 | } |
| 391 | | if ((offset &0x0ff) == 0x42) // Port page 2 => port different du MX40 |
| 357 | if ((offset &0x0ff) == 0x42) /* Port page 2 => port different du MX40*/ |
| 392 | 358 | memory_set_bank(space->machine, "bank2", HECTORMX_BANK_PAGE2); |
| 393 | | if ((offset &0x0ff) == 0x49) // Port screen resolution |
| 359 | if ((offset &0x0ff) == 0x49) /* Port screen resolution*/ |
| 394 | 360 | hector_flag_80c=1; |
| 395 | 361 | } |
| 396 | 362 | |
| 397 | | /////////////////////////////////////////////////////////////////////// |
| 398 | | // Gestion du son |
| 399 | | /////////////////////////////////////////////////////////////////////// |
| 363 | /******************************************************************************** |
| 364 | sound managment |
| 365 | ********************************************************************************/ |
| 400 | 366 | |
| 401 | 367 | void Mise_A_Jour_Etat(int Adresse, int Value ) |
| 402 | 368 | { |
| 403 | | // Adjust value depending on I/O main CPU request |
| 369 | /* Adjust value depending on I/O main CPU request*/ |
| 404 | 370 | switch(Adresse ) |
| 405 | 371 | { |
| 406 | 372 | case 0x2000: |
| 407 | | // Modification AU0 / AU8 |
| 408 | | { // AU0 |
| 373 | /* Modification AU0 / AU8*/ |
| 374 | { /* AU0*/ |
| 409 | 375 | AU[ 0] = ((Value & 0x080 )==0) ? 0 : 1 ; |
| 410 | | // AU8 : 0 |
| 376 | /* AU8 : 0*/ |
| 411 | 377 | AU[ 8] = ((Value & 0x040 )==0) ? 0 : 1 ; |
| 412 | 378 | break; |
| 413 | 379 | } |
| 414 | 380 | case 0x2001: |
| 415 | | // Modification AU1 / AU9 |
| 416 | | { // AU1 |
| 381 | /* Modification AU1 / AU9*/ |
| 382 | { /* AU1*/ |
| 417 | 383 | AU[ 1] = ((Value & 0x080 )==0) ? 0 : 1 ; |
| 418 | | // AU9 |
| 384 | /* AU9*/ |
| 419 | 385 | AU[ 9] = ((Value & 0x040 )==0) ? 0 : 1 ; |
| 420 | 386 | break; |
| 421 | 387 | } |
| 422 | 388 | case 0x2002: |
| 423 | | // Modification AU2 / AU10 |
| 424 | | { // AU2 |
| 389 | /* Modification AU2 / AU10*/ |
| 390 | { /* AU2*/ |
| 425 | 391 | AU[ 2] = ((Value & 0x080 )==0) ? 0 : 1 ; |
| 426 | | // AU10 |
| 392 | /* AU10*/ |
| 427 | 393 | AU[10] = ((Value & 0x040 )==0) ? 0 : 1 ; |
| 428 | 394 | break; |
| 429 | 395 | } |
| 430 | 396 | case 0x2003: |
| 431 | | // Modification AU3 / AU11 |
| 432 | | { // AU3 |
| 397 | /* Modification AU3 / AU11*/ |
| 398 | { /* AU3*/ |
| 433 | 399 | AU[ 3] = ((Value & 0x080 )==0) ? 0 : 1 ; |
| 434 | | // AU11 |
| 400 | /* AU11*/ |
| 435 | 401 | AU[11] = ((Value & 0x040 )==0) ? 0 : 1 ; |
| 436 | 402 | break; |
| 437 | 403 | } |
| 438 | 404 | case 0x2800: |
| 439 | | // Modification AU4 / AU12 |
| 440 | | { // AU4 |
| 405 | /* Modification AU4 / AU12*/ |
| 406 | { /* AU4*/ |
| 441 | 407 | AU[ 4] = ((Value & 0x080 )==0) ? 0 : 1 ; |
| 442 | | // AU8 |
| 408 | /* AU8*/ |
| 443 | 409 | AU[12] = ((Value & 0x040 )==0) ? 0 : 1 ; |
| 444 | 410 | break; |
| 445 | 411 | } |
| 446 | 412 | case 0x2801: |
| 447 | | // Modification AU5 / AU13 |
| 448 | | { // AU5 |
| 413 | /* Modification AU5 / AU13*/ |
| 414 | { /* AU5*/ |
| 449 | 415 | AU[ 5] = ((Value & 0x080 )==0) ? 0 : 1 ; |
| 450 | | // AU13 |
| 416 | /* AU13*/ |
| 451 | 417 | AU[13] = ((Value & 0x040 )==0) ? 0 : 1 ; |
| 452 | 418 | break; |
| 453 | 419 | } |
| 454 | 420 | case 0x2802: |
| 455 | | { // Modification AU6 / AU14 |
| 456 | | // AU6 |
| 421 | { /* Modification AU6 / AU14*/ |
| 422 | /* AU6*/ |
| 457 | 423 | AU[ 6] = ((Value & 0x080 )==0) ? 0 : 1 ; |
| 458 | | // AU14 |
| 424 | /* AU14*/ |
| 459 | 425 | AU[14] = ((Value & 0x040 )==0) ? 0 : 1 ; |
| 460 | 426 | break; |
| 461 | 427 | } |
| 462 | 428 | case 0x2803: |
| 463 | | // Modification AU7 / AU15 |
| 464 | | { // AU7 |
| 429 | /* Modification AU7 / AU15*/ |
| 430 | { /* AU7*/ |
| 465 | 431 | AU[ 7] = ((Value & 0x080 )==0) ? 0 : 1 ; |
| 466 | | // AU15 |
| 432 | /* AU15*/ |
| 467 | 433 | AU[15] = ((Value & 0x040 )==0) ? 0 : 1 ; |
| 468 | 434 | break; |
| 469 | 435 | } |
| 470 | 436 | case 0x3000: |
| 471 | | // Mixer modification |
| 437 | /* Mixer modification*/ |
| 472 | 438 | { |
| 473 | 439 | ValMixer = (Value & 7) ; |
| 474 | 440 | break; |
| 475 | 441 | } |
| 476 | 442 | default: break; |
| 477 | 443 | |
| 478 | | } //switch |
| 444 | } /*switch*/ |
| 479 | 445 | } |
| 480 | 446 | |
| 481 | 447 | |
| 482 | 448 | static void Init_Value_SN76477_Hector(void) |
| 483 | 449 | { |
| 484 | | // Remplissage des valeurs de resistance et capacite d'Hector |
| 450 | /* Remplissage des valeurs de resistance et capacite d'Hector*/ |
| 485 | 451 | |
| 486 | | // SetEnvelopControl( R10 , R7, C8 ) : Attack/Decay |
| 487 | | // Decay R |
| 488 | | Pin_Value[7][1] = RES_K(680.0); //680 vu |
| 489 | | Pin_Value[7][0] = RES_K(252.325); // 142.325 (680 // 180KOhm) |
| 452 | /* Decay R*/ |
| 453 | Pin_Value[7][1] = RES_K(680.0); /*680K */ |
| 454 | Pin_Value[7][0] = RES_K(252.325); /* 142.325 (680 // 180KOhm)*/ |
| 490 | 455 | |
| 491 | | // Capa A/D |
| 492 | | Pin_Value[8][0] = CAP_U(0.47); // 0.47uf |
| 493 | | Pin_Value[8][1] = CAP_U(1.47); // 1.47 |
| 456 | /* Capa A/D*/ |
| 457 | Pin_Value[8][0] = CAP_U(0.47); /* 0.47uf*/ |
| 458 | Pin_Value[8][1] = CAP_U(1.47); /* 1.47*/ |
| 494 | 459 | |
| 495 | | // ATTACK R |
| 496 | | Pin_Value[10][1]= RES_K(180.0); // 180 |
| 497 | | Pin_Value[10][0]= RES_K(32.054); // 32.054 (180 // 39 KOhm) |
| 460 | /* ATTACK R*/ |
| 461 | Pin_Value[10][1]= RES_K(180.0); /* 180*/ |
| 462 | Pin_Value[10][0]= RES_K(32.054); /* 32.054 (180 // 39 KOhm)*/ |
| 498 | 463 | |
| 499 | | // Version 3 : Ajust?? pour les frequences mesur??es : |
| 500 | | // 4 0 SOUND 255 Hz => ajust?? ?? l'oreille |
| 501 | | // 4 4 SOUND 65 Hz => ajust?? ?? l'oreille |
| 502 | | // 4 8 SOUND 17 Hz => ajust?? ?? l'oreille |
| 503 | | // 4 12 SOUND 4,3 Hz => ajust?? ?? l'oreille |
| 504 | | // SLF C Version 3 |
| 505 | | Pin_Value[21][0]= CAP_U(0.1); //CAPU(0.1) vu |
| 506 | | Pin_Value[21][1]= CAP_U(1.1); //1.1 |
| 464 | /* Version 3 : Ajuste pour les frequences mesurees : |
| 465 | // 4 0 SOUND 255 Hz => ajuste a l'oreille |
| 466 | // 4 4 SOUND 65 Hz => ajuste a l'oreille |
| 467 | // 4 8 SOUND 17 Hz => ajuste a l'oreille |
| 468 | // 4 12 SOUND 4,3 Hz => ajuste a l'oreille*/ |
| 469 | /* SLF C Version 3*/ |
| 470 | Pin_Value[21][0]= CAP_U(0.1); /*CAPU(0.1) */ |
| 471 | Pin_Value[21][1]= CAP_U(1.1); /*1.1*/ |
| 507 | 472 | |
| 508 | | //SLF R Version 3 |
| 473 | /*SLF R Version 3*/ |
| 509 | 474 | Pin_Value[20][1]= RES_K(180); //180 vu |
| 510 | 475 | Pin_Value[20][0]= RES_K(37.268); //37.268 (47//180 KOhms) |
| 511 | 476 | |
| 512 | | // Capa VCO |
| 513 | | // Version 3 : Ajust?? pour les frequences mesur??es : |
| 477 | /* Capa VCO*/ |
| 478 | /* Version 3 : Ajust?? pour les frequences mesur??es : |
| 514 | 479 | // 0 0 SOUND 5,5KHz => 5,1KHz |
| 515 | 480 | // 0 16 SOUND 1,3KHz => 1,2KHz |
| 516 | 481 | // 0 32 SOUND 580Hz => 570Hz |
| 517 | | // 0 48 SOUND 132Hz => 120Hz |
| 518 | | Pin_Value[17][0] = CAP_N(47.0) ; //47,0 mesure ok // CAPU(0.047) |
| 519 | | Pin_Value[17][1] = CAP_N(580.0) ; //580 mesure ok // CAPU(0.517) |
| 520 | | // R VCO Version 3 |
| 521 | | Pin_Value[18][1] = RES_K(1400.0 );//1300 mesure ok // au lieu de 1Mohm |
| 522 | | Pin_Value[18][0] = RES_K( 203.548 );//223 mesure ok // au lieu de 193.548 (1000 // 240KOhm) |
| 482 | // 0 48 SOUND 132Hz => 120Hz*/ |
| 483 | Pin_Value[17][0] = CAP_N(47.0) ; /*47,0 mesure ok */ |
| 484 | Pin_Value[17][1] = CAP_N(580.0) ; /*580 mesure ok */ |
| 485 | /* R VCO Version 3*/ |
| 486 | Pin_Value[18][1] = RES_K(1400.0 );/*1300 mesure ok // au lieu de 1Mohm*/ |
| 487 | Pin_Value[18][0] = RES_K( 203.548 );/*223 mesure ok // au lieu de 193.548 (1000 // 240KOhm)*/ |
| 523 | 488 | |
| 524 | | // VCO Controle |
| 525 | | Pin_Value[16][0] = 0.0; //2.6; // Volts // 0.1 vu |
| 526 | | Pin_Value[16][1] = 1.41; //2; // 2 = 10/15eme de 5V |
| 489 | /* VCO Controle*/ |
| 490 | Pin_Value[16][0] = 0.0; /* Volts */ |
| 491 | Pin_Value[16][1] = 1.41; /* 2 = 10/15eme de 5V*/ |
| 527 | 492 | |
| 528 | | // Pitch |
| 529 | | Pin_Value[19][0] = 0.0; //2; // Volts // 0 vu |
| 530 | | Pin_Value[19][1] = 1.41; //0.2; // 2 |
| 493 | /* Pitch*/ |
| 494 | Pin_Value[19][0] = 0.0; /*Volts */ |
| 495 | Pin_Value[19][1] = 1.41; |
| 531 | 496 | |
| 532 | 497 | |
| 533 | | // setVCO ( TOR_22) |
| 534 | | Pin_Value[22][0] = 0; // TOR //0 |
| 535 | | Pin_Value[22][1] = 1; //1 |
| 498 | Pin_Value[22][0] = 0; /* TOR */ |
| 499 | Pin_Value[22][1] = 1; |
| 536 | 500 | |
| 537 | | //setOneShot(R24, C23) |
| 538 | | // R OneShot |
| 539 | | Pin_Value[24][1] = RES_K(100); //0 |
| 540 | | Pin_Value[24][0] = RES_K(1000); //RES_M(1) infini sur Hector car non connect??e |
| 501 | /* R OneShot*/ |
| 502 | Pin_Value[24][1] = RES_K(100); |
| 503 | Pin_Value[24][0] = RES_K(1000); /*RES_M(1) infini sur Hector car non connectee*/ |
| 541 | 504 | |
| 542 | | // Capa OneShot |
| 543 | | Pin_Value[23][0] = 1.0; //0 0.1 (0) et 0.0 (1) |
| 544 | | Pin_Value[23][1] = 0.0; //1 // Valeur Bidon sur Hector car mise au 5Volts sans capa |
| 505 | /* Capa OneShot*/ |
| 506 | Pin_Value[23][0] = 1.0; |
| 507 | Pin_Value[23][1] = 0.0; /* Valeur Bidon sur Hector car mise au 5Volts sans capa*/ |
| 545 | 508 | |
| 546 | | // Enabled |
| 547 | | Pin_Value[9][0] = 0; //0 |
| 548 | | Pin_Value[9][1] = 1; //1 |
| 509 | /* Enabled*/ |
| 510 | Pin_Value[9][0] = 0; |
| 511 | Pin_Value[9][1] = 1; |
| 549 | 512 | |
| 550 | | // Volume |
| 551 | | Pin_Value[11][0] = 128; // Rapport 50% et 100% //128 |
| 552 | | Pin_Value[11][1] = 255; //255 |
| 513 | /* Volume*/ |
| 514 | Pin_Value[11][0] = 128; /* Rapport 50% et 100% 128*/ |
| 515 | Pin_Value[11][1] = 255; /* 255*/ |
| 553 | 516 | |
| 554 | | // Noise filter |
| 555 | | Pin_Value[6][0] = CAP_U(0.390); // 0.390 |
| 556 | | Pin_Value[6][1] = CAP_U(08.60); // 0.48 |
| 517 | /* Noise filter*/ |
| 518 | Pin_Value[6][0] = CAP_U(0.390); /* 0.390*/ |
| 519 | Pin_Value[6][1] = CAP_U(08.60); /* 0.48*/ |
| 557 | 520 | |
| 558 | | // Valeur corrig?? par rapport au sch??ma : |
| 559 | | Pin_Value[5][1] = RES_K(3.30 ) ; // 330Kohm |
| 560 | | Pin_Value[5][0] = RES_K(1.76 ) ; // 76 Kohm |
| 521 | /* Valeur corrige par rapport au schema :*/ |
| 522 | Pin_Value[5][1] = RES_K(3.30 ) ; /* 330Kohm*/ |
| 523 | Pin_Value[5][0] = RES_K(1.76 ) ; /* 76 Kohm*/ |
| 561 | 524 | |
| 562 | | // Noise pas command?? par le bus audio ! |
| 563 | | // Seule la valeur [0] est document??e ! |
| 564 | | Pin_Value[4][0] = RES_K(47) ; // 47 K ohm |
| 565 | | Pin_Value[12][0] = RES_K(100); // 100K ohm |
| 566 | | Pin_Value[3][0] = 0 ; // NC |
| 525 | /* Noise pas commande par le bus audio !*/ |
| 526 | /* Seule la valeur [0] est documentee !*/ |
| 527 | Pin_Value[4][0] = RES_K(47) ; /* 47 K ohm*/ |
| 528 | Pin_Value[12][0] = RES_K(100); /* 100K ohm*/ |
| 529 | Pin_Value[3][0] = 0 ; /* NC*/ |
| 567 | 530 | |
| 568 | | // Gestion du type d'enveloppe |
| 531 | /* Gestion du type d'enveloppe*/ |
| 569 | 532 | Pin_Value[ 1][0] = 0; |
| 570 | 533 | Pin_Value[ 1][1] = 1; |
| 571 | 534 | |
| 572 | 535 | Pin_Value[28][0] = 0; |
| 573 | 536 | Pin_Value[28][1] = 1; |
| 574 | 537 | |
| 575 | | // Initialisation ?? 0 des pin du SN |
| 538 | /* Initialisation a 0 des pin du SN*/ |
| 576 | 539 | AU[0]=0; |
| 577 | 540 | AU[1]=0; |
| 578 | 541 | AU[2]=0; |
| r6902 | r6903 | |
| 594 | 557 | |
| 595 | 558 | void Update_Sound(const address_space *space, UINT8 data) |
| 596 | 559 | { |
| 597 | | // keep device |
| 560 | /* keep device*/ |
| 598 | 561 | const device_config *sn76477 = devtag_get_device(space->machine, "sn76477"); |
| 599 | 562 | |
| 600 | | // MIXER |
| 563 | /* MIXER*/ |
| 601 | 564 | sn76477_mixer_a_w(sn76477, ((ValMixer & 0x04)==4) ? 1 : 0); |
| 602 | 565 | sn76477_mixer_b_w(sn76477, ((ValMixer & 0x01)==1) ? 1 : 0); |
| 603 | | sn76477_mixer_c_w(sn76477, ((ValMixer & 0x02)==2) ? 1 : 0);// Revu selon mesure ??lectronique |
| 566 | sn76477_mixer_c_w(sn76477, ((ValMixer & 0x02)==2) ? 1 : 0);/* Revu selon mesure electronique sur HRX*/ |
| 604 | 567 | |
| 605 | | // VCO oscillateur |
| 568 | /* VCO oscillateur*/ |
| 606 | 569 | if (AU[12]==1) |
| 607 | | sn76477_vco_res_w( sn76477, Pin_Value[18][AU[10]]/12.0); // en non AU11 |
| 570 | sn76477_vco_res_w( sn76477, Pin_Value[18][AU[10]]/12.0); /* en non AU11*/ |
| 608 | 571 | else |
| 609 | | sn76477_vco_res_w( sn76477, Pin_Value[18][AU[10]]); // en non AU11 |
| 572 | sn76477_vco_res_w( sn76477, Pin_Value[18][AU[10]]); /* en non AU11*/ |
| 610 | 573 | |
| 611 | 574 | sn76477_vco_cap_w( sn76477, Pin_Value[17][AU[2 ]]); |
| 612 | 575 | sn76477_pitch_voltage_w(sn76477, Pin_Value[19][AU[15]]); |
| 613 | 576 | sn76477_vco_voltage_w( sn76477, Pin_Value[16][AU[15]]); |
| 614 | | sn76477_vco_w( sn76477, Pin_Value[22][AU[12]]); // VCO Select Ext/SLF |
| 577 | sn76477_vco_w( sn76477, Pin_Value[22][AU[12]]); /* VCO Select Ext/SLF*/ |
| 615 | 578 | |
| 616 | | // SLF |
| 617 | | sn76477_slf_res_w( sn76477, Pin_Value[20][AU[ 9]]);//AU10 |
| 579 | /* SLF*/ |
| 580 | sn76477_slf_res_w( sn76477, Pin_Value[20][AU[ 9]]);/*AU10*/ |
| 618 | 581 | sn76477_slf_cap_w( sn76477, Pin_Value[21][AU[1 ]]); |
| 619 | 582 | |
| 620 | | // One Shot |
| 621 | | sn76477_one_shot_res_w(sn76477, Pin_Value[24][ 0]); // NC |
| 583 | /* One Shot*/ |
| 584 | sn76477_one_shot_res_w(sn76477, Pin_Value[24][ 0]); /* NC*/ |
| 622 | 585 | sn76477_one_shot_cap_w(sn76477, Pin_Value[23][AU[13]]); |
| 623 | 586 | |
| 624 | | // Ampli value |
| 587 | /* Ampli value*/ |
| 625 | 588 | sn76477_amplitude_res_w(sn76477, Pin_Value[11][AU[5]]); |
| 626 | 589 | |
| 627 | | // Attack / Decay |
| 590 | /* Attack / Decay*/ |
| 628 | 591 | sn76477_attack_res_w(sn76477, Pin_Value[10][AU[ 8]]); |
| 629 | | sn76477_decay_res_w( sn76477, Pin_Value[7 ][AU[11]]);//AU9 |
| 592 | sn76477_decay_res_w( sn76477, Pin_Value[7 ][AU[11]]);/*AU9*/ |
| 630 | 593 | sn76477_attack_decay_cap_w(sn76477, Pin_Value[8][AU[0]]); |
| 631 | 594 | |
| 632 | | // Filtre |
| 595 | /* Filtre*/ |
| 633 | 596 | sn76477_noise_filter_res_w(sn76477, Pin_Value[5][AU[4]]); |
| 634 | 597 | sn76477_noise_filter_cap_w(sn76477, Pin_Value[6][AU[3]]); |
| 635 | 598 | |
| 636 | | // Clock Extern Noise |
| 637 | | sn76477_noise_clock_res_w(sn76477, Pin_Value[4][0]); // fix |
| 638 | | sn76477_feedback_res_w(sn76477, Pin_Value[12][0]); //fix |
| 599 | /* Clock Extern Noise*/ |
| 600 | sn76477_noise_clock_res_w(sn76477, Pin_Value[4][0]); /* fix*/ |
| 601 | sn76477_feedback_res_w(sn76477, Pin_Value[12][0]); /*fix*/ |
| 639 | 602 | |
| 640 | | // Envelope |
| 603 | /* Envelope*/ |
| 641 | 604 | sn76477_envelope_1_w(sn76477, Pin_Value[1 ][AU[6]]); |
| 642 | 605 | sn76477_envelope_2_w(sn76477, Pin_Value[28][AU[7]]); |
| 643 | 606 | |
| 644 | | // En dernier on lance (ou pas !) |
| 607 | /* En dernier on lance (ou pas !)*/ |
| 645 | 608 | sn76477_enable_w(sn76477, Pin_Value[9][AU[14]]); |
| 646 | 609 | } |
| 647 | 610 | |
| 648 | 611 | sn76477_interface hector_sn76477_interface = |
| 649 | 612 | { |
| 650 | | RES_K(47), // 4 noise_res |
| 651 | | RES_K(330), // 5 filter_res |
| 652 | | CAP_P(390), // 6 filter_cap |
| 653 | | RES_K(680), // 7 decay_res |
| 654 | | CAP_U(47), // 8 attack_decay_cap |
| 655 | | RES_K(180), // 10 attack_res |
| 656 | | RES_K(33), // 11 amplitude_res |
| 657 | | RES_K(100), // 12 feedback_res |
| 658 | | 2, // 16 vco_voltage |
| 659 | | CAP_N(47) , // 17 vco_cap |
| 660 | | RES_K(1000), // 18 vco_res |
| 661 | | 2, // 19 pitch_voltage |
| 662 | | RES_K(180), // 20 slf_res |
| 663 | | CAP_U(0.1), // 21 slf_cap |
| 664 | | CAP_U(1.00001), // 23 oneshot_cap |
| 665 | | RES_K(10000) // 24 oneshot_res |
| 613 | RES_K(47), /* 4 noise_res*/ |
| 614 | RES_K(330), /* 5 filter_res*/ |
| 615 | CAP_P(390), /* 6 filter_cap*/ |
| 616 | RES_K(680), /* 7 decay_res*/ |
| 617 | CAP_U(47), /* 8 attack_decay_cap*/ |
| 618 | RES_K(180), /* 10 attack_res*/ |
| 619 | RES_K(33), /* 11 amplitude_res*/ |
| 620 | RES_K(100), /* 12 feedback_res*/ |
| 621 | 2, /* 16 vco_voltage*/ |
| 622 | CAP_N(47) , /* 17 vco_cap*/ |
| 623 | RES_K(1000), /* 18 vco_res*/ |
| 624 | 2, /* 19 pitch_voltage*/ |
| 625 | RES_K(180), /* 20 slf_res*/ |
| 626 | CAP_U(0.1), /* 21 slf_cap*/ |
| 627 | CAP_U(1.00001), /* 23 oneshot_cap*/ |
| 628 | RES_K(10000) /* 24 oneshot_res*/ |
| 666 | 629 | }; |
| 667 | 630 | |
| 668 | 631 | void hector_reset(running_machine *machine, int hr) |
| r6902 | r6903 | |
| 674 | 637 | |
| 675 | 638 | void hector_init(running_machine *machine) |
| 676 | 639 | { |
| 677 | | int i; |
| 678 | | |
| 679 | | // For keyboard |
| 680 | | keyboard_timer = timer_alloc(machine, Callback_keyboard, 0); |
| 681 | | timer_adjust_periodic(keyboard_timer, ATTOTIME_IN_MSEC(100), 0, ATTOTIME_IN_MSEC(20));//keyboard scan 25ms |
| 682 | | |
| 683 | | for(i = 0; i < 8; i++) touches[i] = 0xff; //all key off |
| 684 | | |
| 685 | | // For Cassette synchro |
| 640 | /* For Cassette synchro*/ |
| 686 | 641 | Cassette_timer = timer_alloc(machine, Callback_CK, 0); |
| 687 | | 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 |
| 642 | timer_adjust_periodic(Cassette_timer, ATTOTIME_IN_MSEC(100), 0, ATTOTIME_IN_USEC(64));/* => real synchro scan speed for 15,624Khz*/ |
| 688 | 643 | |
| 689 | | // Sound sn76477 |
| 690 | | Init_Value_SN76477_Hector(); //init R/C value |
| 644 | /* Sound sn76477*/ |
| 645 | Init_Value_SN76477_Hector(); /*init R/C value*/ |
| 691 | 646 | } |
src/mess/drivers/interact.c
| r6902 | r6903 | |
| 37 | 37 | => add BR/HR switching |
| 38 | 38 | => add bank switch for HRX |
| 39 | 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) |
| 40 | 03/01/2010 Update and clean prog by yo_fr (jj.stac@aliceadsl.fr) |
| 41 | => add the port mapping for keyboard |
| 42 | |
| 43 | don't forget to keep some information about these machine see DChector project : http://dchector.free.fr/ made by DanielCoulom |
| 44 | (and thank's to Daniel!) |
| 45 | |
| 43 | 46 | TODO : Add the cartridge function, |
| 44 | 47 | Adjust the one shot and A/D timing (sn76477) |
| 45 | 48 | |
| 46 | 49 | ****************************************************************************/ |
| 50 | /* Mapping for joystick see hec2hrp.c*/ |
| 47 | 51 | |
| 48 | 52 | #include "driver.h" |
| 49 | 53 | #include "cpu/z80/z80.h" |
| 50 | 54 | #include "cpu/i8085/i8085.h" |
| 51 | | #include "machine/pckeybrd.h" |
| 52 | 55 | #include "devices/cassette.h" |
| 53 | 56 | #include "formats/hect_tap.h" |
| 54 | 57 | #include "devices/printer.h" |
| 55 | | #include "sound/wave.h" // for K7 sound |
| 56 | | #include "sound/sn76477.h" // for sn sound |
| 57 | | #include "sound/discrete.h" // for 1 Bit sound |
| 58 | #include "sound/wave.h" /* for K7 sound*/ |
| 59 | #include "sound/sn76477.h" /* for sn sound*/ |
| 60 | #include "sound/discrete.h" /* for 1 Bit sound*/ |
| 58 | 61 | |
| 59 | 62 | #include "includes/hec2hrp.h" |
| 60 | 63 | |
| 61 | 64 | static ADDRESS_MAP_START(interact_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 62 | 65 | ADDRESS_MAP_UNMAP_HIGH |
| 63 | | // Hardward address mapping |
| 64 | | // AM_RANGE(0x0800,0x0808) AM_WRITE( hector_switch_bank_w)// Bank management not udsed in BR machine |
| 65 | | AM_RANGE(0x1000,0x1000) AM_WRITE( hector_color_a_w) // Color c0/c1 |
| 66 | | AM_RANGE(0x1800,0x1800) AM_WRITE( hector_color_b_w) // Color c2/c3 |
| 67 | | AM_RANGE(0x2000,0x2003) AM_WRITE( hector_sn_2000_w) // Sound |
| 68 | | AM_RANGE(0x2800,0x2803) AM_WRITE( hector_sn_2800_w) // Sound |
| 69 | | AM_RANGE(0x3000,0x3000) AM_READWRITE( hector_cassette_r, hector_sn_3000_w)// Write necessary |
| 70 | | AM_RANGE(0x3800,0x3807) AM_READWRITE( hector_keyboard_r, hector_keyboard_w) // Keyboard |
| 66 | /* Hardward address mapping*/ |
| 67 | /* AM_RANGE(0x0800,0x0808) AM_WRITE( hector_switch_bank_w)// Bank management not udsed in BR machine*/ |
| 68 | AM_RANGE(0x1000,0x1000) AM_WRITE( hector_color_a_w) /* Color c0/c1*/ |
| 69 | AM_RANGE(0x1800,0x1800) AM_WRITE( hector_color_b_w) /* Color c2/c3*/ |
| 70 | AM_RANGE(0x2000,0x2003) AM_WRITE( hector_sn_2000_w) /* Sound*/ |
| 71 | AM_RANGE(0x2800,0x2803) AM_WRITE( hector_sn_2800_w) /* Sound*/ |
| 72 | AM_RANGE(0x3000,0x3000) AM_READWRITE( hector_cassette_r, hector_sn_3000_w)/* Write necessary*/ |
| 73 | AM_RANGE(0x3800,0x3807) AM_READWRITE( hector_keyboard_r, hector_keyboard_w) /* Keyboard*/ |
| 71 | 74 | |
| 72 | | // Main ROM page |
| 73 | | AM_RANGE(0x0000,0x3fff) AM_ROM //BANK(2) |
| 74 | | // AM_RANGE(0x1000,0x3fff) AM_RAM |
| 75 | /* Main ROM page*/ |
| 76 | AM_RANGE(0x0000,0x3fff) AM_ROM /*BANK(2)*/ |
| 77 | /* AM_RANGE(0x1000,0x3fff) AM_RAM*/ |
| 75 | 78 | |
| 76 | | // Vid??o br mapping |
| 79 | /* Video br mapping*/ |
| 77 | 80 | AM_RANGE(0x4000,0x49ff) AM_RAM AM_BASE_GENERIC(videoram) |
| 78 | | // continous RAM |
| 81 | /* continous RAM*/ |
| 79 | 82 | AM_RANGE(0x4A00,0xffff) AM_RAM |
| 80 | 83 | |
| 81 | 84 | ADDRESS_MAP_END |
| r6902 | r6903 | |
| 107 | 110 | |
| 108 | 111 | static MACHINE_START(interact) |
| 109 | 112 | { |
| 110 | | // Start keyboard |
| 111 | | at_keyboard_init(machine, AT_KEYBOARD_TYPE_PC); |
| 112 | | at_keyboard_reset(machine); |
| 113 | | at_keyboard_set_scan_code_set(2); |
| 114 | | at_keyboard_reset(machine); |
| 115 | | |
| 116 | 113 | hector_init(machine); |
| 117 | 114 | } |
| 118 | 115 | |
| r6902 | r6903 | |
| 128 | 125 | /* basic machine hardware */ |
| 129 | 126 | MDRV_CPU_ADD("maincpu", 8080, XTAL_2MHz) |
| 130 | 127 | MDRV_CPU_PROGRAM_MAP(interact_mem) |
| 131 | | MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) // put on the 8080 irq in Hz |
| 128 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) /* put on the 8080 irq in Hz*/ |
| 132 | 129 | |
| 133 | 130 | MDRV_MACHINE_RESET(interact) |
| 134 | 131 | MDRV_MACHINE_START(interact) |
| r6902 | r6903 | |
| 140 | 137 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 141 | 138 | MDRV_SCREEN_SIZE(256, 79) |
| 142 | 139 | MDRV_SCREEN_VISIBLE_AREA(0, 112, 0, 77) |
| 143 | | MDRV_PALETTE_LENGTH(16) // 8 colours, but only 4 at a time |
| 140 | MDRV_PALETTE_LENGTH(16) /* 8 colours, but only 4 at a time*/ |
| 144 | 141 | MDRV_PALETTE_INIT(black_and_white) |
| 145 | 142 | |
| 146 | 143 | MDRV_VIDEO_START(hec2hrp) |
| r6902 | r6903 | |
| 148 | 145 | /* sound hardware */ |
| 149 | 146 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 150 | 147 | MDRV_SOUND_WAVE_ADD("wave", "cassette") |
| 151 | | MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0 |
| 148 | MDRV_SOUND_ROUTE(0, "mono", 0.1) /* Sound level for cassette, as it is in mono => output channel=0*/ |
| 152 | 149 | |
| 153 | 150 | MDRV_SOUND_ADD("sn76477", SN76477, 0) |
| 154 | 151 | MDRV_SOUND_CONFIG(hector_sn76477_interface) |
| 155 | 152 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) |
| 156 | 153 | |
| 157 | | MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit |
| 154 | MDRV_SOUND_ADD("discrete", DISCRETE, 0) /* Son 1bit*/ |
| 158 | 155 | MDRV_SOUND_CONFIG_DISCRETE( hec2hrp ) |
| 159 | 156 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 160 | 157 | |
| 161 | | // Gestion cassette |
| 158 | /* Gestion cassette*/ |
| 162 | 159 | MDRV_CASSETTE_ADD( "cassette", interact_cassette_config ) |
| 163 | 160 | |
| 164 | 161 | /* printer */ |
| r6902 | r6903 | |
| 171 | 168 | /* basic machine hardware */ |
| 172 | 169 | MDRV_CPU_ADD("maincpu", Z80, XTAL_1_75MHz) |
| 173 | 170 | MDRV_CPU_PROGRAM_MAP(interact_mem) |
| 174 | | MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) // put on the 8080 irq in Hz |
| 171 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) /* put on the 8080 irq in Hz*/ |
| 175 | 172 | |
| 176 | 173 | MDRV_MACHINE_RESET(interact) |
| 177 | 174 | MDRV_MACHINE_START(interact) |
| r6902 | r6903 | |
| 183 | 180 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 184 | 181 | MDRV_SCREEN_SIZE(256, 79) |
| 185 | 182 | MDRV_SCREEN_VISIBLE_AREA(0, 112, 0, 77) |
| 186 | | MDRV_PALETTE_LENGTH(16) // 8 colours, but only 4 at a time |
| 183 | MDRV_PALETTE_LENGTH(16) /* 8 colours, but only 4 at a time*/ |
| 187 | 184 | MDRV_PALETTE_INIT(black_and_white) |
| 188 | 185 | |
| 189 | 186 | MDRV_VIDEO_START(hec2hrp) |
| r6902 | r6903 | |
| 191 | 188 | /* sound hardware */ |
| 192 | 189 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 193 | 190 | MDRV_SOUND_WAVE_ADD("wave", "cassette") |
| 194 | | MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0 |
| 191 | MDRV_SOUND_ROUTE(0, "mono", 0.1)/* Sound level for cassette, as it is in mono => output channel=0*/ |
| 195 | 192 | |
| 196 | 193 | MDRV_SOUND_ADD("sn76477", SN76477, 0) |
| 197 | 194 | MDRV_SOUND_CONFIG(hector_sn76477_interface) |
| 198 | 195 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) |
| 199 | 196 | |
| 200 | | MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit |
| 197 | MDRV_SOUND_ADD("discrete", DISCRETE, 0) /* Son 1bit*/ |
| 201 | 198 | MDRV_SOUND_CONFIG_DISCRETE( hec2hrp ) |
| 202 | 199 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 203 | 200 | |
| 204 | | // Gestion cassette |
| 201 | /* Gestion cassette*/ |
| 205 | 202 | MDRV_CASSETTE_ADD( "cassette", interact_cassette_config ) |
| 206 | 203 | |
| 207 | 204 | /* printer */ |
| r6902 | r6903 | |
| 211 | 208 | |
| 212 | 209 | /* Input ports */ |
| 213 | 210 | static INPUT_PORTS_START( interact ) |
| 214 | | PORT_INCLUDE( at_keyboard ) |
| 211 | /* keyboard input */ |
| 212 | PORT_START("KEY0") /* [0] - port 3000 @ 0 */ |
| 213 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') |
| 214 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) |
| 215 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 216 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) |
| 217 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("<--") PORT_CODE(KEYCODE_BACKSPACE) |
| 218 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) |
| 219 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) |
| 220 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 221 | PORT_START("KEY1") /* [1] - port 3000 @ 1 */ /* touches => 2 1 0 / . - , + */ |
| 222 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 \"") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 223 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 >") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 224 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 <") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 225 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 226 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 227 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') |
| 228 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) |
| 229 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') |
| 230 | |
| 231 | PORT_START("KEY2") /* [1] - port 3000 @ 2 */ /* touches => .. 9 8 7 6 5 4 3 */ |
| 232 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 233 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 )") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 234 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 (") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 235 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 :") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 236 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 !") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 237 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 238 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 239 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 /") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 240 | PORT_START("KEY3") /* [1] - port 3000 @ 3 */ /* touches => B A .. ? .. = .. ; */ |
| 241 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 242 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 243 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 244 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') |
| 245 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 246 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') |
| 247 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 248 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 249 | PORT_START("KEY4") /* [1] - port 3000 @ 4 */ |
| 250 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 251 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 252 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 253 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 254 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 255 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 256 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 257 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 258 | |
| 259 | PORT_START("KEY5") /* [1] - port 3000 @ 5 */ |
| 260 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 261 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 262 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 263 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 264 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 265 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) |
| 266 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 267 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 268 | |
| 269 | PORT_START("KEY6") /* [1] - port 3000 @ 6 */ |
| 270 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 271 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 272 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 273 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 274 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 275 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 276 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 277 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 278 | |
| 279 | PORT_START("KEY7") /* [1] - port 3000 @ 7 JOYSTICK */ |
| 280 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 281 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 282 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) UP") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 283 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 284 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) LEFT") PORT_CODE(KEYCODE_1_PAD) /* Joy(1) on numpad*/ |
| 285 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) RIGHT") PORT_CODE(KEYCODE_3_PAD) |
| 286 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) UP") PORT_CODE(KEYCODE_5_PAD) |
| 287 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) DOWN") PORT_CODE(KEYCODE_2_PAD) |
| 288 | |
| 289 | PORT_START("KEY8") /* [1] - port 3000 @ 8 not for the real machine, but to emulate the analog signal of the joystick */ |
| 290 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) |
| 291 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) FIRE") PORT_CODE(KEYCODE_0_PAD) |
| 292 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) FIRE") PORT_CODE(KEYCODE_PLUS_PAD) |
| 293 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pot(0)+") PORT_CODE(KEYCODE_INSERT) |
| 294 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pot(0)-") PORT_CODE(KEYCODE_DEL) |
| 295 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pot(1)+") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) |
| 296 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pot(1)-") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) |
| 297 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 215 | 298 | INPUT_PORTS_END |
| 216 | 299 | |
| 217 | 300 | /* ROM definition */ |
| r6902 | r6903 | |
| 229 | 312 | |
| 230 | 313 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 231 | 314 | COMP(1979, interact, 0, 0, interact, interact, 0, "Interact", "Interact Family Computer", GAME_IMPERFECT_SOUND) |
| 232 | | COMP(????, hector1, interact, 0, hector1, interact, 0, "Micronique", "Hector 1", GAME_IMPERFECT_SOUND) |
| 315 | COMP(1983, hector1, interact, 0, hector1, interact, 0, "Micronique", "Hector 1", GAME_IMPERFECT_SOUND) |
src/mess/drivers/hec2hrp.c
| r6902 | r6903 | |
| 21 | 21 | => add BR/HR switching |
| 22 | 22 | => add bank switch for HRX |
| 23 | 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) |
| 24 | 03/01/2010 Update and clean prog by yo_fr (jj.stac@aliceadsl.fr) |
| 25 | => add the port mapping for keyboard |
| 26 | |
| 27 | don't forget to keep some information about these machine see DChector project : http://dchector.free.fr/ made by DanielCoulom |
| 28 | (and thank's to Daniel!) |
| 29 | |
| 27 | 30 | TODO : Add the cartridge function, |
| 28 | 31 | Adjust the one shot and A/D timing (sn76477) |
| 29 | 32 | ****************************************************************************/ |
| 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) |
| 33 | /* Joystick 1 : |
| 34 | clavier numerique : |
| 35 | (UP)5 |
| 36 | (left)1 (right)3 |
| 37 | (down)2 |
| 49 | 38 | |
| 39 | Fire <+> |
| 40 | Pot => home/end */ |
| 41 | |
| 42 | /* Joystick 0 : |
| 43 | arrows |
| 44 | (UP)^ |
| 45 | (left)<- (right)-> |
| 46 | (down)v |
| 47 | |
| 48 | Fire <0> on numpad |
| 49 | Pot => INS /SUPPR |
| 50 | Cassete : wav file (1 way, 16 bits, 44100hz) |
| 51 | K7 file (For data and games) |
| 52 | FOR file (for forth screen data) |
| 53 | */ |
| 54 | |
| 50 | 55 | #include "driver.h" |
| 51 | | #include "machine/pckeybrd.h" |
| 56 | |
| 52 | 57 | #include "devices/cassette.h" |
| 53 | 58 | #include "formats/hect_tap.h" |
| 54 | 59 | #include "devices/printer.h" |
| 55 | | #include "sound/wave.h" // for K7 sound |
| 56 | | #include "sound/sn76477.h" // for sn sound |
| 57 | | #include "sound/discrete.h" // for 1 Bit sound |
| 60 | #include "sound/sn76477.h" /* for sn sound*/ |
| 61 | #include "sound/wave.h" /* for K7 sound*/ |
| 62 | #include "sound/discrete.h" /* for 1 Bit sound*/ |
| 58 | 63 | #include "cpu/z80/z80.h" |
| 59 | 64 | |
| 60 | 65 | #include "includes/hec2hrp.h" |
| 61 | 66 | |
| 62 | 67 | |
| 63 | | /////////////////////////////////////////////////////////////////////////////// |
| 68 | /*****************************************************************************/ |
| 64 | 69 | static ADDRESS_MAP_START(hec2hrp_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 65 | | /////////////////////////////////////////////////////////////////////////////// |
| 70 | /*****************************************************************************/ |
| 66 | 71 | ADDRESS_MAP_UNMAP_HIGH |
| 67 | 72 | |
| 68 | | // Hardward address mapping |
| 69 | | AM_RANGE(0x0800,0x0808) AM_WRITE( hector_switch_bank_w)// Bank management |
| 70 | | AM_RANGE(0x1000,0x1000) AM_WRITE( hector_color_a_w) // Color c0/c1 |
| 71 | | AM_RANGE(0x1800,0x1800) AM_WRITE( hector_color_b_w) // Color c2/c3 |
| 72 | | AM_RANGE(0x2000,0x2003) AM_WRITE( hector_sn_2000_w) // Sound |
| 73 | | AM_RANGE(0x2800,0x2803) AM_WRITE( hector_sn_2800_w) // Sound |
| 74 | | AM_RANGE(0x3000,0x3000) AM_READWRITE( hector_cassette_r, hector_sn_3000_w)// Write necessary |
| 75 | | AM_RANGE(0x3800,0x3807) AM_READWRITE( hector_keyboard_r, hector_keyboard_w) // Keyboard |
| 73 | /* Hardward address mapping*/ |
| 74 | AM_RANGE(0x0800,0x0808) AM_WRITE( hector_switch_bank_w)/* Bank management*/ |
| 75 | AM_RANGE(0x1000,0x1000) AM_WRITE( hector_color_a_w) /* Color c0/c1*/ |
| 76 | AM_RANGE(0x1800,0x1800) AM_WRITE( hector_color_b_w) /* Color c2/c3*/ |
| 77 | AM_RANGE(0x2000,0x2003) AM_WRITE( hector_sn_2000_w) /* Sound*/ |
| 78 | AM_RANGE(0x2800,0x2803) AM_WRITE( hector_sn_2800_w) /* Sound*/ |
| 79 | AM_RANGE(0x3000,0x3000) AM_READWRITE( hector_cassette_r, hector_sn_3000_w)/* Write necessary*/ |
| 80 | AM_RANGE(0x3800,0x3807) AM_READWRITE( hector_keyboard_r, hector_keyboard_w) /* Keyboard*/ |
| 76 | 81 | |
| 77 | | // Main ROM page |
| 82 | /* Main ROM page*/ |
| 78 | 83 | AM_RANGE(0x0000,0x3fff) AM_ROMBANK("bank2") |
| 79 | 84 | |
| 80 | | // Vid??o br mapping |
| 85 | /* Video br mapping*/ |
| 81 | 86 | AM_RANGE(0x4000,0x49ff) AM_RAM AM_BASE_GENERIC(videoram) |
| 82 | | // continous RAM |
| 87 | /* continous RAM*/ |
| 83 | 88 | AM_RANGE(0x4A00,0xbfff) AM_RAM |
| 84 | | // from 0xC000 to 0xFFFF => Bank Ram for vid??o and data ! |
| 89 | /* from 0xC000 to 0xFFFF => Bank Ram for video and data !*/ |
| 85 | 90 | AM_RANGE(0xc000,0xffff) AM_RAMBANK("bank1") |
| 86 | 91 | ADDRESS_MAP_END |
| 87 | 92 | |
| r6902 | r6903 | |
| 104 | 109 | |
| 105 | 110 | /* Input ports */ |
| 106 | 111 | static INPUT_PORTS_START( hec2hrp ) |
| 107 | | PORT_INCLUDE( at_keyboard ) |
| 112 | /* keyboard input */ |
| 113 | PORT_START("KEY0") /* [0] - port 3000 @ 0 */ |
| 114 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') |
| 115 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) |
| 116 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 117 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) |
| 118 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("<--") PORT_CODE(KEYCODE_BACKSPACE) |
| 119 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) |
| 120 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) |
| 121 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 122 | PORT_START("KEY1") /* [1] - port 3000 @ 1 */ /* touches => 2 1 0 / . - , + */ |
| 123 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 \"") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 124 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 >") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 125 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 <") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 126 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 127 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 128 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') |
| 129 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) |
| 130 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') |
| 131 | |
| 132 | PORT_START("KEY2") /* [1] - port 3000 @ 2 */ /* touches => .. 9 8 7 6 5 4 3 */ |
| 133 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 134 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 )") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 135 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 (") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 136 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 :") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 137 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 !") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 138 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 139 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 140 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 /") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 141 | PORT_START("KEY3") /* [1] - port 3000 @ 3 */ /* touches => B A .. ? .. = .. ; */ |
| 142 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 143 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 144 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 145 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') |
| 146 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 147 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') |
| 148 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 149 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 150 | PORT_START("KEY4") /* [1] - port 3000 @ 4 */ |
| 151 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 152 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 153 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 154 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 155 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 156 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 157 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 158 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 159 | |
| 160 | PORT_START("KEY5") /* [1] - port 3000 @ 5 */ |
| 161 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 162 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 163 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 164 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 165 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 166 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) |
| 167 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 168 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 169 | |
| 170 | PORT_START("KEY6") /* [1] - port 3000 @ 6 */ |
| 171 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 172 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 173 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 174 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 175 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 176 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 177 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 178 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 179 | |
| 180 | PORT_START("KEY7") /* [1] - port 3000 @ 7 JOYSTICK */ |
| 181 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 182 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 183 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) UP") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 184 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 185 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) LEFT") PORT_CODE(KEYCODE_1_PAD) // Joy(1) on numpad |
| 186 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) RIGHT") PORT_CODE(KEYCODE_3_PAD) |
| 187 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) UP") PORT_CODE(KEYCODE_5_PAD) |
| 188 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) DOWN") PORT_CODE(KEYCODE_2_PAD) |
| 189 | |
| 190 | PORT_START("KEY8") /* [1] - port 3000 @ 8 not for the real machine, but to emulate the analog signal of the joystick */ |
| 191 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) |
| 192 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) FIRE") PORT_CODE(KEYCODE_0_PAD) |
| 193 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) FIRE") PORT_CODE(KEYCODE_PLUS_PAD) |
| 194 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pot(0)+") PORT_CODE(KEYCODE_INSERT) |
| 195 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pot(0)-") PORT_CODE(KEYCODE_DEL) |
| 196 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pot(1)+") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) |
| 197 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pot(1)-") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) |
| 198 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 108 | 199 | INPUT_PORTS_END |
| 109 | 200 | |
| 110 | | /////////////////////////////////////////////////////////////////////////////// |
| 201 | /*****************************************************************************/ |
| 111 | 202 | static MACHINE_START( hec2hrp ) |
| 112 | | /////////////////////////////////////////////////////////////////////////////// |
| 203 | /*****************************************************************************/ |
| 113 | 204 | { |
| 114 | 205 | UINT8 *RAM = memory_region(machine, "maincpu"); // pointer to mess ram |
| 115 | 206 | UINT8 *ROM1 = memory_region(machine, "page1"); // pointer to rom page 1 |
| r6902 | r6903 | |
| 122 | 213 | // Set bank HECTOR_BANK_PROG as basic bank |
| 123 | 214 | memory_set_bank(machine, "bank1", HECTOR_BANK_PROG); |
| 124 | 215 | |
| 125 | | //////////////////////////////////////////////////////////SPECIFIQUE MX ///////////////// |
| 216 | /******************************************************SPECIFIQUE MX ***************************/ |
| 126 | 217 | memory_configure_bank(machine, "bank2", HECTORMX_BANK_PAGE0 , 1, &RAM[0x0000] , 0); // Mess ram |
| 127 | 218 | memory_configure_bank(machine, "bank2", HECTORMX_BANK_PAGE1 , 1, &ROM1[0x0000] , 0); // Rom page 1 |
| 128 | 219 | memory_configure_bank(machine, "bank2", HECTORMX_BANK_PAGE2 , 1, &ROM2[0x0000] , 0); // Rom page 2 |
| 129 | 220 | memory_set_bank(machine, "bank2", HECTORMX_BANK_PAGE0); |
| 130 | | //////////////////////////////////////////////////////////SPECIFIQUE MX ///////////////// |
| 131 | | |
| 132 | | // Start keyboard |
| 133 | | at_keyboard_init(machine, AT_KEYBOARD_TYPE_PC); |
| 134 | | at_keyboard_reset(machine); |
| 135 | | at_keyboard_set_scan_code_set(2); |
| 136 | | at_keyboard_reset(machine); |
| 137 | | |
| 138 | | |
| 139 | | hector_init(machine); |
| 221 | /******************************************************SPECIFIQUE MX ***************************/ |
| 222 | hector_init(machine); |
| 140 | 223 | } |
| 141 | 224 | |
| 142 | 225 | static MACHINE_RESET(hec2hrp) |
| r6902 | r6903 | |
| 166 | 249 | DISCRETE_OUTPUT(NODE_01, 5000) |
| 167 | 250 | DISCRETE_SOUND_END |
| 168 | 251 | |
| 169 | | /////////////////////////////////////////////////////////////////////////////// |
| 252 | /******************************************************************************/ |
| 170 | 253 | static MACHINE_DRIVER_START( hec2hr ) |
| 171 | | /////////////////////////////////////////////////////////////////////////////// |
| 254 | /******************************************************************************/ |
| 172 | 255 | /* basic machine hardware */ |
| 173 | 256 | MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz) |
| 174 | 257 | MDRV_CPU_PROGRAM_MAP(hec2hrp_mem) |
| 175 | 258 | MDRV_CPU_IO_MAP(hec2hrp_io) |
| 176 | | MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) // put on the Z80 irq in Hz |
| 259 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) /* put on the Z80 irq in Hz*/ |
| 177 | 260 | MDRV_MACHINE_RESET(hec2hrp) |
| 178 | 261 | MDRV_MACHINE_START(hec2hrp) |
| 179 | 262 | |
| r6902 | r6903 | |
| 192 | 275 | /* sound hardware */ |
| 193 | 276 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 194 | 277 | MDRV_SOUND_WAVE_ADD("wave", "cassette") |
| 195 | | MDRV_SOUND_ROUTE(0, "mono", 0.1)// Sound level for cassette, as it is in mono => output channel=0 |
| 278 | MDRV_SOUND_ROUTE(0, "mono", 0.1) |
| 196 | 279 | |
| 197 | 280 | MDRV_SOUND_ADD("sn76477", SN76477, 0) |
| 198 | 281 | MDRV_SOUND_CONFIG(hector_sn76477_interface) |
| 199 | 282 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) |
| 200 | 283 | |
| 201 | | MDRV_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit |
| 284 | MDRV_SOUND_ADD("discrete", DISCRETE, 0) /* Son 1bit*/ |
| 202 | 285 | MDRV_SOUND_CONFIG_DISCRETE( hec2hrp ) |
| 203 | 286 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 204 | 287 | |
| 205 | | // Gestion cassette |
| 288 | /* Gestion cassette*/ |
| 206 | 289 | MDRV_CASSETTE_ADD( "cassette", hector_cassette_config ) |
| 207 | 290 | |
| 208 | 291 | /* printer */ |
| r6902 | r6903 | |
| 210 | 293 | |
| 211 | 294 | MACHINE_DRIVER_END |
| 212 | 295 | |
| 213 | | /////////////////////////////////////////////////////////////////////////////// |
| 296 | /*****************************************************************************/ |
| 214 | 297 | static MACHINE_DRIVER_START( hec2hrp ) |
| 215 | | /////////////////////////////////////////////////////////////////////////////// |
| 216 | | /* basic machine hardware */ |
| 298 | /*****************************************************************************/ |
| 299 | /* basic machine hardware */ |
| 217 | 300 | MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz) |
| 218 | 301 | MDRV_CPU_PROGRAM_MAP(hec2hrp_mem) |
| 219 | 302 | MDRV_CPU_IO_MAP(hec2hrp_io) |
| 220 | | MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) // put on the Z80 irq in Hz |
| 303 | MDRV_CPU_PERIODIC_INT(irq0_line_hold,50) /* put on the Z80 irq in Hz*/ |
| 221 | 304 | MDRV_MACHINE_RESET(hec2hrp) |
| 222 | 305 | MDRV_MACHINE_START(hec2hrp) |
| 223 | 306 | |
| r6902 | r6903 | |
| 254 | 337 | |
| 255 | 338 | MACHINE_DRIVER_END |
| 256 | 339 | |
| 257 | | /////////////////////////////////////////////////////////////////////////////// |
| 340 | /*****************************************************************************/ |
| 258 | 341 | static MACHINE_DRIVER_START( hec2mx40 ) |
| 259 | | /////////////////////////////////////////////////////////////////////////////// |
| 260 | | /* basic machine hardware */ |
| 342 | /*****************************************************************************/ |
| 343 | /* basic machine hardware */ |
| 261 | 344 | MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz) |
| 262 | 345 | MDRV_CPU_PROGRAM_MAP(hec2hrp_mem) |
| 263 | 346 | MDRV_CPU_IO_MAP(hec2mx40_io) |
| r6902 | r6903 | |
| 298 | 381 | |
| 299 | 382 | MACHINE_DRIVER_END |
| 300 | 383 | |
| 301 | | /////////////////////////////////////////////////////////////////////////////// |
| 384 | /*****************************************************************************/ |
| 302 | 385 | static MACHINE_DRIVER_START( hec2mx80 ) |
| 303 | | /////////////////////////////////////////////////////////////////////////////// |
| 304 | | /* basic machine hardware */ |
| 386 | /*****************************************************************************/ |
| 387 | /* basic machine hardware */ |
| 305 | 388 | MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz) |
| 306 | 389 | MDRV_CPU_PROGRAM_MAP(hec2hrp_mem) |
| 307 | 390 | MDRV_CPU_IO_MAP(hec2mx80_io) |