src/mess/video/hec2video.c
| r6460 | r6461 | |
| 37 | 37 | #include "includes/hec2hrp.h" |
| 38 | 38 | |
| 39 | 39 | // Color status |
| 40 | | UINT8 Col0, Col1,Col2,Col3; // For actual colors |
| 40 | UINT8 hector_color[4]; // For actual colors |
| 41 | // Ram video BR : |
| 42 | UINT8 hector_videoram[0x04000]; |
| 43 | // Status for screen definition |
| 44 | UINT8 hector_flag_hr; |
| 45 | UINT8 hector_flag_80c; |
| 41 | 46 | |
| 42 | 47 | |
| 43 | 48 | |
| 44 | | void Init_Hector_Palette( running_machine *machine) |
| 49 | static void Init_Hector_Palette( running_machine *machine) |
| 45 | 50 | { |
| 46 | 51 | // 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) |
| 52 | hector_color[0] = 0; // fond (noir) |
| 53 | hector_color[1] = 1; // HECTOR HRX (rouge) |
| 54 | hector_color[2] = 7; // Point interrogation (Blanc) |
| 55 | hector_color[3] = 3; // Ecriture de choix (jaune) |
| 51 | 56 | |
| 52 | 57 | // Color initialisation : full luminosité |
| 53 | 58 | palette_set_color( machine, 0,MAKE_RGB(000,000,000));//Noir |
| r6460 | r6461 | |
| 79 | 84 | gfx = *(page+x); |
| 80 | 85 | /* Display a scanline of a character (4 pixels !) */ |
| 81 | 86 | 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;} |
| 87 | case 0x00 : *p=hector_color[0]; break; |
| 88 | case 0x01 : *p=hector_color[1]; break; |
| 89 | case 0x02 : *p=hector_color[2]; break; |
| 90 | default : *p=hector_color[3]; break;} |
| 86 | 91 | p++; |
| 87 | 92 | |
| 88 | 93 | 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;} |
| 94 | case 0x00 : *p=hector_color[0]; break; |
| 95 | case 0x04 : *p=hector_color[1]; break; |
| 96 | case 0x08 : *p=hector_color[2]; break; |
| 97 | default : *p=hector_color[3]; break;} |
| 93 | 98 | p++; |
| 94 | 99 | |
| 95 | 100 | 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;} |
| 101 | case 0x00 : *p=hector_color[0]; break; |
| 102 | case 0x10 : *p=hector_color[1]; break; |
| 103 | case 0x20 : *p=hector_color[2]; break; |
| 104 | default : *p=hector_color[3]; break;} |
| 100 | 105 | p++; |
| 101 | 106 | |
| 102 | 107 | 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;} |
| 108 | case 0x00 : *p=hector_color[0]; break; |
| 109 | case 0x40 : *p=hector_color[1]; break; |
| 110 | case 0x80 : *p=hector_color[2]; break; |
| 111 | default : *p=hector_color[3]; break;} |
| 107 | 112 | p++; |
| 108 | 113 | } |
| 109 | 114 | ma+=yram; |
| r6460 | r6461 | |
| 139 | 144 | ma+=yram; |
| 140 | 145 | } |
| 141 | 146 | } |
| 147 | |
| 148 | VIDEO_START( hec2hrp ) |
| 149 | { |
| 150 | Init_Hector_Palette(machine); |
| 151 | } |
| 152 | |
| 153 | VIDEO_UPDATE( hec2hrp ) |
| 154 | { |
| 155 | if (hector_flag_hr==1) |
| 156 | { |
| 157 | if (hector_flag_80c==0) |
| 158 | { |
| 159 | video_screen_set_visarea(screen, 0, 243, 0, 227); |
| 160 | hector_hr( bitmap , &hector_videoram[0], 227, 64); |
| 161 | } |
| 162 | else |
| 163 | { |
| 164 | video_screen_set_visarea(screen, 0, 243*2, 0, 227); |
| 165 | hector_80c( bitmap , &hector_videoram[0], 227, 64); |
| 166 | } |
| 167 | } |
| 168 | else |
| 169 | { |
| 170 | video_screen_set_visarea(screen, 0, 113, 0, 75); |
| 171 | hector_hr( bitmap, videoram, 77, 32); |
| 172 | } |
| 173 | |
| 174 | return 0; |
| 175 | } |
| 176 | |
src/mess/includes/pdp1.h
| r6460 | r6461 | |
| 16 | 16 | #define MEMORY_WRITE_START18(name) MEMORY_WRITE32_START(name) |
| 17 | 17 | |
| 18 | 18 | |
| 19 | | /*----------- defined in drivers/pdp1.c -----------*/ |
| 20 | | |
| 21 | 19 | /* defines for each bit and mask in input port "CSW" */ |
| 22 | 20 | enum |
| 23 | 21 | { |
| r6460 | r6461 | |
| 101 | 99 | pdp1_fontdata_size = 8 * pdp1_charnum |
| 102 | 100 | }; |
| 103 | 101 | |
| 104 | | extern pdp1_reset_param_t pdp1_reset_param; |
| 105 | 102 | |
| 106 | | |
| 107 | 103 | /*----------- defined in machine/pdp1.c -----------*/ |
| 108 | 104 | |
| 109 | | extern int *pdp1_memory; |
| 105 | extern pdp1_reset_param_t pdp1_reset_param; |
| 110 | 106 | |
| 111 | 107 | MACHINE_START( pdp1 ); |
| 112 | 108 | MACHINE_RESET( pdp1 ); |
| r6460 | r6461 | |
| 118 | 114 | DEVICE_IMAGE_LOAD( pdp1_tape ); |
| 119 | 115 | DEVICE_IMAGE_UNLOAD( pdp1_tape ); |
| 120 | 116 | |
| 121 | | void pdp1_tape_read_binary(const device_config *device); |
| 122 | | void iot_rpa(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 123 | | void iot_rpb(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 124 | | void iot_rrb(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 125 | | void iot_ppa(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 126 | | void iot_ppb(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 127 | | |
| 128 | 117 | DEVICE_IMAGE_LOAD(pdp1_typewriter); |
| 129 | 118 | DEVICE_IMAGE_UNLOAD(pdp1_typewriter); |
| 130 | | void iot_tyo(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 131 | | void iot_tyi(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 132 | 119 | |
| 133 | | void iot_dpy(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 134 | | |
| 135 | 120 | DEVICE_IMAGE_LOAD(pdp1_drum); |
| 136 | 121 | DEVICE_IMAGE_UNLOAD(pdp1_drum); |
| 137 | | void iot_dia(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 138 | | void iot_dba(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 139 | | void iot_dcc(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 140 | | void iot_dra(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 141 | 122 | |
| 142 | | void iot_011(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 143 | | |
| 144 | | void iot_cks(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 145 | | void pdp1_io_sc_callback(const device_config *device); |
| 146 | | |
| 147 | 123 | INTERRUPT_GEN( pdp1_interrupt ); |
| 148 | 124 | |
| 149 | 125 | void pdp1_get_open_mode(int id, unsigned int *readable, unsigned int *writeable, unsigned int *creatable); |
src/mess/machine/dgn_beta.c
| r6460 | r6461 | |
| 75 | 75 | |
| 76 | 76 | static UINT8 *system_rom; |
| 77 | 77 | |
| 78 | // Ram banking handlers. |
| 79 | static WRITE8_HANDLER( dgnbeta_ram_b0_w ); |
| 80 | static WRITE8_HANDLER( dgnbeta_ram_b1_w ); |
| 81 | static WRITE8_HANDLER( dgnbeta_ram_b2_w ); |
| 82 | static WRITE8_HANDLER( dgnbeta_ram_b3_w ); |
| 83 | static WRITE8_HANDLER( dgnbeta_ram_b4_w ); |
| 84 | static WRITE8_HANDLER( dgnbeta_ram_b5_w ); |
| 85 | static WRITE8_HANDLER( dgnbeta_ram_b6_w ); |
| 86 | static WRITE8_HANDLER( dgnbeta_ram_b7_w ); |
| 87 | static WRITE8_HANDLER( dgnbeta_ram_b8_w ); |
| 88 | static WRITE8_HANDLER( dgnbeta_ram_b9_w ); |
| 89 | static WRITE8_HANDLER( dgnbeta_ram_bA_w ); |
| 90 | static WRITE8_HANDLER( dgnbeta_ram_bB_w ); |
| 91 | static WRITE8_HANDLER( dgnbeta_ram_bC_w ); |
| 92 | static WRITE8_HANDLER( dgnbeta_ram_bD_w ); |
| 93 | static WRITE8_HANDLER( dgnbeta_ram_bE_w ); |
| 94 | static WRITE8_HANDLER( dgnbeta_ram_bF_w ); |
| 95 | static WRITE8_HANDLER( dgnbeta_ram_bG_w ); |
| 96 | |
| 97 | |
| 78 | 98 | #define VERBOSE 0 |
| 79 | 99 | |
| 80 | 100 | |
| r6460 | r6461 | |
| 140 | 160 | |
| 141 | 161 | static int SelectedKeyrow(int Rows); |
| 142 | 162 | |
| 143 | | int dgnbeta_font=0; |
| 144 | | |
| 145 | 163 | const pia6821_interface dgnbeta_pia_intf[] = |
| 146 | 164 | { |
| 147 | 165 | /* PIA 0 at $FC20-$FC23 I46 */ |
| r6460 | r6461 | |
| 403 | 421 | PageRegs[TaskReg][bank].memory[offset]=data; |
| 404 | 422 | } |
| 405 | 423 | |
| 406 | | WRITE8_HANDLER( dgnbeta_ram_b0_w ) |
| 424 | static WRITE8_HANDLER( dgnbeta_ram_b0_w ) |
| 407 | 425 | { |
| 408 | 426 | dgn_beta_bank_memory(offset,data,0); |
| 409 | 427 | } |
| 410 | 428 | |
| 411 | | WRITE8_HANDLER( dgnbeta_ram_b1_w ) |
| 429 | static WRITE8_HANDLER( dgnbeta_ram_b1_w ) |
| 412 | 430 | { |
| 413 | 431 | dgn_beta_bank_memory(offset,data,1); |
| 414 | 432 | } |
| 415 | 433 | |
| 416 | | WRITE8_HANDLER( dgnbeta_ram_b2_w ) |
| 434 | static WRITE8_HANDLER( dgnbeta_ram_b2_w ) |
| 417 | 435 | { |
| 418 | 436 | dgn_beta_bank_memory(offset,data,2); |
| 419 | 437 | } |
| 420 | 438 | |
| 421 | | WRITE8_HANDLER( dgnbeta_ram_b3_w ) |
| 439 | static WRITE8_HANDLER( dgnbeta_ram_b3_w ) |
| 422 | 440 | { |
| 423 | 441 | dgn_beta_bank_memory(offset,data,3); |
| 424 | 442 | } |
| 425 | 443 | |
| 426 | | WRITE8_HANDLER( dgnbeta_ram_b4_w ) |
| 444 | static WRITE8_HANDLER( dgnbeta_ram_b4_w ) |
| 427 | 445 | { |
| 428 | 446 | dgn_beta_bank_memory(offset,data,4); |
| 429 | 447 | } |
| 430 | 448 | |
| 431 | | WRITE8_HANDLER( dgnbeta_ram_b5_w ) |
| 449 | static WRITE8_HANDLER( dgnbeta_ram_b5_w ) |
| 432 | 450 | { |
| 433 | 451 | dgn_beta_bank_memory(offset,data,5); |
| 434 | 452 | } |
| 435 | 453 | |
| 436 | | WRITE8_HANDLER( dgnbeta_ram_b6_w ) |
| 454 | static WRITE8_HANDLER( dgnbeta_ram_b6_w ) |
| 437 | 455 | { |
| 438 | 456 | dgn_beta_bank_memory(offset,data,6); |
| 439 | 457 | } |
| 440 | 458 | |
| 441 | | WRITE8_HANDLER( dgnbeta_ram_b7_w ) |
| 459 | static WRITE8_HANDLER( dgnbeta_ram_b7_w ) |
| 442 | 460 | { |
| 443 | 461 | dgn_beta_bank_memory(offset,data,7); |
| 444 | 462 | } |
| 445 | 463 | |
| 446 | | WRITE8_HANDLER( dgnbeta_ram_b8_w ) |
| 464 | static WRITE8_HANDLER( dgnbeta_ram_b8_w ) |
| 447 | 465 | { |
| 448 | 466 | dgn_beta_bank_memory(offset,data,8); |
| 449 | 467 | } |
| 450 | 468 | |
| 451 | | WRITE8_HANDLER( dgnbeta_ram_b9_w ) |
| 469 | static WRITE8_HANDLER( dgnbeta_ram_b9_w ) |
| 452 | 470 | { |
| 453 | 471 | dgn_beta_bank_memory(offset,data,9); |
| 454 | 472 | } |
| 455 | 473 | |
| 456 | | WRITE8_HANDLER( dgnbeta_ram_bA_w ) |
| 474 | static WRITE8_HANDLER( dgnbeta_ram_bA_w ) |
| 457 | 475 | { |
| 458 | 476 | dgn_beta_bank_memory(offset,data,10); |
| 459 | 477 | } |
| 460 | 478 | |
| 461 | | WRITE8_HANDLER( dgnbeta_ram_bB_w ) |
| 479 | static WRITE8_HANDLER( dgnbeta_ram_bB_w ) |
| 462 | 480 | { |
| 463 | 481 | dgn_beta_bank_memory(offset,data,11); |
| 464 | 482 | } |
| 465 | 483 | |
| 466 | | WRITE8_HANDLER( dgnbeta_ram_bC_w ) |
| 484 | static WRITE8_HANDLER( dgnbeta_ram_bC_w ) |
| 467 | 485 | { |
| 468 | 486 | dgn_beta_bank_memory(offset,data,12); |
| 469 | 487 | } |
| 470 | 488 | |
| 471 | | WRITE8_HANDLER( dgnbeta_ram_bD_w ) |
| 489 | static WRITE8_HANDLER( dgnbeta_ram_bD_w ) |
| 472 | 490 | { |
| 473 | 491 | dgn_beta_bank_memory(offset,data,13); |
| 474 | 492 | } |
| 475 | 493 | |
| 476 | | WRITE8_HANDLER( dgnbeta_ram_bE_w ) |
| 494 | static WRITE8_HANDLER( dgnbeta_ram_bE_w ) |
| 477 | 495 | { |
| 478 | 496 | dgn_beta_bank_memory(offset,data,14); |
| 479 | 497 | } |
| 480 | 498 | |
| 481 | | WRITE8_HANDLER( dgnbeta_ram_bF_w ) |
| 499 | static WRITE8_HANDLER( dgnbeta_ram_bF_w ) |
| 482 | 500 | { |
| 483 | 501 | dgn_beta_bank_memory(offset,data,15); |
| 484 | 502 | } |
| 485 | 503 | |
| 486 | | WRITE8_HANDLER( dgnbeta_ram_bG_w ) |
| 504 | static WRITE8_HANDLER( dgnbeta_ram_bG_w ) |
| 487 | 505 | { |
| 488 | 506 | dgn_beta_bank_memory(offset,data,16); |
| 489 | 507 | } |
| r6460 | r6461 | |
| 1048 | 1066 | ScanInKeyboard(); |
| 1049 | 1067 | } |
| 1050 | 1068 | |
| 1069 | #ifdef UNUSED_FUNCTION |
| 1051 | 1070 | void dgn_beta_line_interrupt (int data) |
| 1052 | 1071 | { |
| 1053 | 1072 | // /* Set PIA line, so it recognises inturrupt */ |
| r6460 | r6461 | |
| 1060 | 1079 | // pia_0_cb1_w(machine, 0,CLEAR_LINE); |
| 1061 | 1080 | // } |
| 1062 | 1081 | } |
| 1082 | #endif |
| 1063 | 1083 | |
| 1064 | 1084 | |
| 1065 | 1085 | /********************************* Machine/Driver Initialization ****************************************/ |
src/mess/machine/pdp1.c
| r6460 | r6461 | |
| 41 | 41 | static TIMER_CALLBACK(dpy_callback); |
| 42 | 42 | static void pdp1_machine_stop(running_machine *machine); |
| 43 | 43 | |
| 44 | static void pdp1_tape_read_binary(const device_config *device); |
| 45 | static void pdp1_io_sc_callback(const device_config *device); |
| 44 | 46 | |
| 47 | static void iot_rpa(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 48 | static void iot_rpb(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 49 | static void iot_rrb(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 50 | static void iot_ppa(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 51 | static void iot_ppb(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 52 | |
| 53 | static void iot_tyo(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 54 | static void iot_tyi(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 55 | |
| 56 | static void iot_dpy(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 57 | |
| 58 | static void iot_dia(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 59 | static void iot_dba(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 60 | static void iot_dcc(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 61 | static void iot_dra(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 62 | |
| 63 | static void iot_011(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 64 | |
| 65 | static void iot_cks(const device_config *device, int op2, int nac, int mb, int *io, int ac); |
| 66 | |
| 45 | 67 | /* pointer to pdp-1 RAM */ |
| 46 | | int *pdp1_memory; |
| 68 | static int *pdp1_memory; |
| 47 | 69 | |
| 48 | 70 | |
| 49 | 71 | /* |
| r6460 | r6461 | |
| 154 | 176 | } |
| 155 | 177 | |
| 156 | 178 | |
| 179 | pdp1_reset_param_t pdp1_reset_param = |
| 180 | { |
| 181 | { /* external iot handlers. NULL means that the iot is unimplemented, unless there are |
| 182 | parentheses around the iot name, in which case the iot is internal to the cpu core. */ |
| 183 | /* I put a ? when the source is the handbook, since a) I have used the maintainance manual |
| 184 | as the primary source (as it goes more into details) b) the handbook and the maintainance |
| 185 | manual occasionnally contradict each other. */ |
| 186 | /* dia, dba, dcc, dra are documented in MIT PDP-1 COMPUTER MODIFICATION |
| 187 | BULLETIN no. 2 (drumInstrWriteup.bin/drumInstrWriteup.txt), and are |
| 188 | similar to IOT documented in Parallel Drum Type 23 Instruction Manual. */ |
| 189 | /* (iot) rpa rpb tyo tyi ppa ppb dpy */ |
| 190 | NULL, iot_rpa, iot_rpb, iot_tyo, iot_tyi, iot_ppa, iot_ppb, iot_dpy, |
| 191 | /* spacewar */ |
| 192 | NULL, iot_011, NULL, NULL, NULL, NULL, NULL, NULL, |
| 193 | /* lag glf?/jsp? gpl?/gpr?/gcf? */ |
| 194 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 195 | /* rrb rcb? rcc? cks mcs mes mel */ |
| 196 | iot_rrb, NULL, NULL, iot_cks, NULL, NULL, NULL, NULL, |
| 197 | /* cad? rac? rbc? pac lpr/lfb/lsp swc/sci/sdf?/shr? scv? */ |
| 198 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 199 | /* (dsc) (asc) (isb) (cac) (lsm) (esm) (cbs) */ |
| 200 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 201 | /* icv? dia dba dcc dra mri|rlc? mrf/inr?/ccr? */ |
| 202 | NULL, iot_dia, iot_dba, iot_dcc, iot_dra, NULL, NULL, NULL, |
| 203 | /* mcb|dur? mwc|mtf? mrc|sfc?... msm|cgo? (eem/lem) mic muf */ |
| 204 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 205 | }, |
| 206 | pdp1_tape_read_binary, |
| 207 | pdp1_io_sc_callback, |
| 208 | 0, /* extend mode support defined in input ports and pdp1_init_machine */ |
| 209 | 0, /* hardware multiply/divide support defined in input ports and pdp1_init_machine */ |
| 210 | 0 /* type 20 sequence break system support defined in input ports and pdp1_init_machine */ |
| 211 | }; |
| 212 | |
| 157 | 213 | MACHINE_RESET( pdp1 ) |
| 158 | 214 | { |
| 159 | 215 | int config; |
| r6460 | r6461 | |
| 591 | 647 | * IO Bits 10 11 12 13 14 15 16 17 |
| 592 | 648 | * TAPE CHANNELS 8 7 6 5 4 3 2 1 |
| 593 | 649 | */ |
| 594 | | void iot_rpa(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 650 | static void iot_rpa(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 595 | 651 | { |
| 596 | 652 | if (LOG_IOT_EXTRA) |
| 597 | 653 | logerror("Warning, RPA instruction not fully emulated: mb=0%06o, (%s)\n", (unsigned) mb, cpuexec_describe_context(device->machine)); |
| r6460 | r6461 | |
| 628 | 684 | * different (730002 or 724002) the 18-bit word read from tape is automatically |
| 629 | 685 | * transferred to the IO Register via the Reader Buffer. |
| 630 | 686 | */ |
| 631 | | void iot_rpb(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 687 | static void iot_rpb(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 632 | 688 | { |
| 633 | 689 | if (LOG_IOT_EXTRA) |
| 634 | 690 | logerror("Warning, RPB instruction not fully emulated: mb=0%06o, (%s)\n", (unsigned) mb, cpuexec_describe_context(device->machine)); |
| r6460 | r6461 | |
| 639 | 695 | /* |
| 640 | 696 | rrb iot callback |
| 641 | 697 | */ |
| 642 | | void iot_rrb(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 698 | static void iot_rrb(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 643 | 699 | { |
| 644 | 700 | if (LOG_IOT_EXTRA) |
| 645 | 701 | logerror("RRB instruction: mb=0%06o, (%s)\n", (unsigned) mb, cpuexec_describe_context(device->machine)); |
| r6460 | r6461 | |
| 662 | 718 | * For each In-Out Transfer instruction one line of tape is punched. In-Out Register |
| 663 | 719 | * Bit 17 conditions Hole 1. Bit 16 conditions Hole 2, etc. Bit 10 conditions Hole 8 |
| 664 | 720 | */ |
| 665 | | void iot_ppa(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 721 | static void iot_ppa(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 666 | 722 | { |
| 667 | 723 | if (LOG_IOT_EXTRA) |
| 668 | 724 | logerror("PPA instruction: mb=0%06o, (%s)\n", (unsigned) mb, cpuexec_describe_context(device->machine)); |
| r6460 | r6461 | |
| 690 | 746 | * Bit 5 conditions Hole 1. Bit 4 conditions Hole 2, etc. Bit 0 conditions Hole 6. |
| 691 | 747 | * Hole 7 is left blank. Hole 8 is always punched in this mode. |
| 692 | 748 | */ |
| 693 | | void iot_ppb(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 749 | static void iot_ppb(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 694 | 750 | { |
| 695 | 751 | if (LOG_IOT_EXTRA) |
| 696 | 752 | logerror("PPB instruction: mb=0%06o, (%s)\n", (unsigned) mb, cpuexec_describe_context(device->machine)); |
| r6460 | r6461 | |
| 856 | 912 | /* |
| 857 | 913 | tyo iot callback |
| 858 | 914 | */ |
| 859 | | void iot_tyo(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 915 | static void iot_tyo(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 860 | 916 | { |
| 861 | 917 | int ch, delay; |
| 862 | 918 | |
| r6460 | r6461 | |
| 909 | 965 | * clears the In-Out Register before transferring the information and also clears |
| 910 | 966 | * the type-in status bit. |
| 911 | 967 | */ |
| 912 | | void iot_tyi(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 968 | static void iot_tyi(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 913 | 969 | { |
| 914 | 970 | if (LOG_IOT_EXTRA) |
| 915 | 971 | logerror("Warning, TYI instruction not fully emulated: mb=0%06o, (%s)\n", (unsigned) mb, cpuexec_describe_context(device->machine)); |
| r6460 | r6461 | |
| 974 | 1030 | |
| 975 | 1031 | Light on one pixel on CRT |
| 976 | 1032 | */ |
| 977 | | void iot_dpy(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1033 | static void iot_dpy(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 978 | 1034 | { |
| 979 | 1035 | int x; |
| 980 | 1036 | int y; |
| r6460 | r6461 | |
| 1062 | 1118 | parallel_drum.fd = NULL; |
| 1063 | 1119 | } |
| 1064 | 1120 | |
| 1065 | | void iot_dia(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1121 | static void iot_dia(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1066 | 1122 | { |
| 1067 | 1123 | parallel_drum.wfb = ((*io) & 0370000) >> 12; |
| 1068 | 1124 | parallel_drum_set_il((*io) & 0007777); |
| r6460 | r6461 | |
| 1070 | 1126 | parallel_drum.dba = 0; /* right? */ |
| 1071 | 1127 | } |
| 1072 | 1128 | |
| 1073 | | void iot_dba(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1129 | static void iot_dba(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1074 | 1130 | { |
| 1075 | 1131 | parallel_drum.wfb = ((*io) & 0370000) >> 12; |
| 1076 | 1132 | parallel_drum_set_il((*io) & 0007777); |
| r6460 | r6461 | |
| 1111 | 1167 | } |
| 1112 | 1168 | } |
| 1113 | 1169 | |
| 1114 | | void iot_dcc(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1170 | static void iot_dcc(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1115 | 1171 | { |
| 1116 | 1172 | attotime delay; |
| 1117 | 1173 | int dc; |
| r6460 | r6461 | |
| 1150 | 1206 | cpu_set_reg(cputag_get_cpu(device->machine, "maincpu"), PDP1_PC, cpu_get_reg(cputag_get_cpu(device->machine, "maincpu"), PDP1_PC)+1); |
| 1151 | 1207 | } |
| 1152 | 1208 | |
| 1153 | | void iot_dra(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1209 | static void iot_dra(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1154 | 1210 | { |
| 1155 | 1211 | (*io) = attotime_mul( |
| 1156 | 1212 | timer_timeelapsed(parallel_drum.rotation_timer), |
| r6460 | r6461 | |
| 1172 | 1228 | fire rocket, and fire torpedo. low order 4 bits, same for |
| 1173 | 1229 | other ship. routine is entered by jsp cwg. |
| 1174 | 1230 | */ |
| 1175 | | void iot_011(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1231 | static void iot_011(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1176 | 1232 | { |
| 1177 | 1233 | int key_state = input_port_read(device->machine, "SPACEWAR"); |
| 1178 | 1234 | int reply; |
| r6460 | r6461 | |
| 1211 | 1267 | |
| 1212 | 1268 | check IO status |
| 1213 | 1269 | */ |
| 1214 | | void iot_cks(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1270 | static void iot_cks(const device_config *device, int op2, int nac, int mb, int *io, int ac) |
| 1215 | 1271 | { |
| 1216 | 1272 | if (LOG_IOT_EXTRA) |
| 1217 | 1273 | logerror("CKS instruction: mb=0%06o, (%s)\n", (unsigned) mb, cpuexec_describe_context(device->machine)); |
src/mess/machine/hec2hrp.c
| r6460 | r6461 | |
| 42 | 42 | #include "includes/hectorkey.h" // Keyboard mapping |
| 43 | 43 | #include "includes/hec2hrp.h" |
| 44 | 44 | |
| 45 | | const device_config *cassette_device_image(running_machine *machine); |
| 46 | 45 | |
| 46 | static void Mise_A_Jour_Etat(int Adresse, int Value ); |
| 47 | static void Update_Sound(const address_space *space, UINT8 data); |
| 47 | 48 | |
| 49 | static const device_config *cassette_device_image(running_machine *machine); |
| 50 | |
| 51 | static void Key(int pccode, int state, running_machine *machine); |
| 52 | |
| 48 | 53 | // Stat for the register in 0x3000 |
| 49 | | UINT8 state3000=0; |
| 50 | | UINT8 write_cassette=0; |
| 54 | static UINT8 state3000=0; |
| 55 | static UINT8 write_cassette=0; |
| 51 | 56 | |
| 52 | 57 | // Keyboard timer |
| 53 | | TIMER_CALLBACK( Callback_keyboard ); |
| 54 | | emu_timer *keyboard_timer; |
| 58 | static TIMER_CALLBACK( Callback_keyboard ); |
| 59 | static emu_timer *keyboard_timer; |
| 55 | 60 | |
| 56 | 61 | // Cassette timer |
| 57 | | TIMER_CALLBACK( Callback_CK ); |
| 58 | | emu_timer *Cassette_timer; |
| 59 | | UINT8 CK_signal ; // Synchro signal for K7 |
| 62 | static TIMER_CALLBACK( Callback_CK ); |
| 63 | static emu_timer *Cassette_timer; |
| 64 | static UINT8 CK_signal ; // Synchro signal for K7 |
| 60 | 65 | |
| 66 | // Status for CPU clock |
| 67 | static UINT8 flag_clk=0; // 0 5MHz (HR machine) - 1 1.75MHz (BR machine) |
| 61 | 68 | |
| 62 | | UINT8 actions=0xff; // keyboard key off |
| 63 | 69 | |
| 64 | | double Pin_Value[29][2]; // SN76477 |
| 65 | | int AU[17]; // Pour les fils de bus audio du SN76477 |
| 66 | | int ValMixer; // for mixer |
| 67 | | int oldstate3000; // Edge state mixer |
| 68 | | int oldstate1000; // Edge state cassette |
| 69 | 70 | |
| 71 | static UINT8 actions=0xff; // keyboard key off |
| 70 | 72 | |
| 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 | |
| 71 | 80 | //#include "drivers/hec2son.c" // need to create a header file... |
| 72 | 81 | |
| 73 | 82 | // Keyboard map |
| 74 | | UINT8 touches[8]; |
| 75 | | UINT8 pot0 = 0x40, pot1 = 0x40; // State for joy resistor |
| 83 | static UINT8 touches[8]; |
| 84 | static UINT8 pot0 = 0x40, pot1 = 0x40; // State for joy resistor |
| 76 | 85 | |
| 77 | 86 | // To generate the CK signal (K7) |
| 78 | | TIMER_CALLBACK( Callback_CK ) |
| 87 | static TIMER_CALLBACK( Callback_CK ) |
| 79 | 88 | { |
| 80 | 89 | CK_signal++; |
| 81 | 90 | } |
| 82 | 91 | |
| 83 | | TIMER_CALLBACK( Callback_keyboard ) |
| 92 | static TIMER_CALLBACK( Callback_keyboard ) |
| 84 | 93 | { |
| 85 | 94 | int touche ; |
| 86 | 95 | int Code0 ; |
| r6460 | r6461 | |
| 109 | 118 | } |
| 110 | 119 | } |
| 111 | 120 | |
| 112 | | void Key(int pccode, int state, running_machine *machine) |
| 121 | static void Key(int pccode, int state, running_machine *machine) |
| 113 | 122 | { |
| 114 | 123 | // Mise a jour de l'image du clavier ///////////////////////////////////////// |
| 115 | 124 | int i, j, n; |
| r6460 | r6461 | |
| 138 | 147 | { |
| 139 | 148 | memory_set_bank(machine, 1, HECTOR_BANK_PROG); |
| 140 | 149 | memory_set_bank(machine, 2, HECTORMX_BANK_PAGE0); |
| 141 | | flag_hr=1; |
| 150 | hector_flag_hr=1; |
| 142 | 151 | } |
| 143 | 152 | else |
| 144 | | flag_hr=0; |
| 153 | hector_flag_hr=0; |
| 145 | 154 | //Common flag |
| 146 | | flag_80c=0; |
| 147 | | flag_clk =0; |
| 155 | hector_flag_80c = 0; |
| 156 | flag_clk = 0; |
| 148 | 157 | return ; |
| 149 | 158 | } |
| 150 | 159 | for(i = 0; i < (n & 7); i++) |
| r6460 | r6461 | |
| 168 | 177 | } |
| 169 | 178 | } |
| 170 | 179 | if (offset==0x04) { // 0x804 => vidéo page, BR |
| 171 | | flag_hr=0; |
| 180 | hector_flag_hr=0; |
| 172 | 181 | memory_set_bank(space->machine, 1, HECTOR_BANK_VIDEO); |
| 173 | 182 | if (flag_clk ==0) |
| 174 | 183 | { |
| r6460 | r6461 | |
| 186 | 195 | |
| 187 | 196 | } |
| 188 | 197 | if (offset==0x0c) { // 0x80c => base page, BR |
| 189 | | flag_hr=0; |
| 198 | hector_flag_hr=0; |
| 190 | 199 | memory_set_bank(space->machine, 1, HECTOR_BANK_PROG); |
| 191 | 200 | if (flag_clk ==0) |
| 192 | 201 | { |
| r6460 | r6461 | |
| 314 | 323 | } |
| 315 | 324 | |
| 316 | 325 | // Other bit : color definition |
| 317 | | Col0 = data & 0x07 ; |
| 318 | | Col2 =((data >> 3) & 0x07) | (Col2 & 0x40) ; |
| 326 | hector_color[0] = data & 0x07 ; |
| 327 | hector_color[2] = ((data >> 3) & 0x07) | (hector_color[2] & 0x40); |
| 319 | 328 | |
| 320 | | oldstate1000=data; // For next step |
| 329 | oldstate1000=data; // For next step |
| 321 | 330 | } |
| 322 | 331 | WRITE8_HANDLER( hector_color_b_w ) |
| 323 | 332 | { |
| 324 | | const device_config *discrete = devtag_get_device(space->machine, "discrete"); |
| 325 | | Col1 = data & 0x07 ; |
| 326 | | Col3 = (data >> 3) & 0x07; |
| 327 | | // Half light on color 2 only on HR machines: |
| 328 | | if (data & 0x40) Col2 |= 8; else Col2 &= 7; |
| 329 | | // Play bit |
| 330 | | discrete_sound_w(discrete, NODE_01, (data & 0x80) ? 0:1 ); |
| 333 | const device_config *discrete = devtag_get_device(space->machine, "discrete"); |
| 334 | hector_color[1] = data & 0x07; |
| 335 | hector_color[3] = (data >> 3) & 0x07; |
| 336 | |
| 337 | // Half light on color 2 only on HR machines: |
| 338 | if (data & 0x40) hector_color[2] |= 8; else hector_color[2] &= 7; |
| 339 | |
| 340 | // Play bit |
| 341 | discrete_sound_w(discrete, NODE_01, (data & 0x80) ? 0:1 ); |
| 331 | 342 | } |
| 332 | 343 | |
| 333 | 344 | |
| r6460 | r6461 | |
| 335 | 346 | Cassette Handling |
| 336 | 347 | ******************************************************************************/ |
| 337 | 348 | |
| 338 | | const device_config *cassette_device_image(running_machine *machine) |
| 349 | static const device_config *cassette_device_image(running_machine *machine) |
| 339 | 350 | { |
| 340 | 351 | return devtag_get_device(machine, "cassette"); |
| 341 | 352 | } |
| r6460 | r6461 | |
| 356 | 367 | if ((offset &0x0ff) == 0x40) // Port page 0 |
| 357 | 368 | memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE0); |
| 358 | 369 | if ((offset &0x0ff) == 0x41) // Port page 1 |
| 359 | | { |
| 360 | | memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE1); |
| 361 | | flag_80c=0; |
| 362 | | } |
| 370 | { |
| 371 | memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE1); |
| 372 | hector_flag_80c=0; |
| 373 | } |
| 363 | 374 | if ((offset &0x0ff) == 0x44) // Port page 2 // 42 pour MX80 |
| 364 | 375 | memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE2); |
| 365 | 376 | if ((offset &0x0ff) == 0x49) // Port screen resolution |
| 366 | | flag_80c=0;// No 80c in 40c ! |
| 377 | hector_flag_80c=0;// No 80c in 40c ! |
| 367 | 378 | } |
| 368 | 379 | |
| 369 | 380 | WRITE8_HANDLER( hector_mx80_io_port_w) |
| r6460 | r6461 | |
| 373 | 384 | if ((offset &0x0ff) == 0x40) // Port page 0 |
| 374 | 385 | memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE0); |
| 375 | 386 | if ((offset &0x0ff) == 0x41) // Port page 1 |
| 376 | | { |
| 377 | | memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE1); |
| 378 | | flag_80c=0; |
| 379 | | } |
| 387 | { |
| 388 | memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE1); |
| 389 | hector_flag_80c=0; |
| 390 | } |
| 380 | 391 | if ((offset &0x0ff) == 0x42) // Port page 2 => port different du MX40 |
| 381 | 392 | memory_set_bank(space->machine, 2, HECTORMX_BANK_PAGE2); |
| 382 | 393 | if ((offset &0x0ff) == 0x49) // Port screen resolution |
| 383 | | flag_80c=1; |
| 394 | hector_flag_80c=1; |
| 384 | 395 | } |
| 385 | 396 | |
| 386 | 397 | /////////////////////////////////////////////////////////////////////// |
| r6460 | r6461 | |
| 468 | 479 | } |
| 469 | 480 | |
| 470 | 481 | |
| 471 | | void Init_Value_SN76477_Hector(void) |
| 482 | static void Init_Value_SN76477_Hector(void) |
| 472 | 483 | { |
| 473 | 484 | // Remplissage des valeurs de resistance et capacite d'Hector |
| 474 | 485 | |
| r6460 | r6461 | |
| 653 | 664 | CAP_U(1.00001), // 23 oneshot_cap |
| 654 | 665 | RES_K(10000) // 24 oneshot_res |
| 655 | 666 | }; |
| 667 | |
| 668 | void hector_reset(running_machine *machine, int hr) |
| 669 | { |
| 670 | hector_flag_hr = hr; |
| 671 | flag_clk = 0; |
| 672 | write_cassette = 0; |
| 673 | } |
| 674 | |
| 675 | void hector_init(running_machine *machine) |
| 676 | { |
| 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 |
| 686 | 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 |
| 688 | |
| 689 | // Sound sn76477 |
| 690 | Init_Value_SN76477_Hector(); //init R/C value |
| 691 | } |
src/mess/drivers/pdp1.c
| r6460 | r6461 | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | |
| 370 | | pdp1_reset_param_t pdp1_reset_param = |
| 371 | | { |
| 372 | | { /* external iot handlers. NULL means that the iot is unimplemented, unless there are |
| 373 | | parentheses around the iot name, in which case the iot is internal to the cpu core. */ |
| 374 | | /* I put a ? when the source is the handbook, since a) I have used the maintainance manual |
| 375 | | as the primary source (as it goes more into details) b) the handbook and the maintainance |
| 376 | | manual occasionnally contradict each other. */ |
| 377 | | /* dia, dba, dcc, dra are documented in MIT PDP-1 COMPUTER MODIFICATION |
| 378 | | BULLETIN no. 2 (drumInstrWriteup.bin/drumInstrWriteup.txt), and are |
| 379 | | similar to IOT documented in Parallel Drum Type 23 Instruction Manual. */ |
| 380 | | /* (iot) rpa rpb tyo tyi ppa ppb dpy */ |
| 381 | | NULL, iot_rpa, iot_rpb, iot_tyo, iot_tyi, iot_ppa, iot_ppb, iot_dpy, |
| 382 | | /* spacewar */ |
| 383 | | NULL, iot_011, NULL, NULL, NULL, NULL, NULL, NULL, |
| 384 | | /* lag glf?/jsp? gpl?/gpr?/gcf? */ |
| 385 | | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 386 | | /* rrb rcb? rcc? cks mcs mes mel */ |
| 387 | | iot_rrb, NULL, NULL, iot_cks, NULL, NULL, NULL, NULL, |
| 388 | | /* cad? rac? rbc? pac lpr/lfb/lsp swc/sci/sdf?/shr? scv? */ |
| 389 | | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 390 | | /* (dsc) (asc) (isb) (cac) (lsm) (esm) (cbs) */ |
| 391 | | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 392 | | /* icv? dia dba dcc dra mri|rlc? mrf/inr?/ccr? */ |
| 393 | | NULL, iot_dia, iot_dba, iot_dcc, iot_dra, NULL, NULL, NULL, |
| 394 | | /* mcb|dur? mwc|mtf? mrc|sfc?... msm|cgo? (eem/lem) mic muf */ |
| 395 | | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 396 | | }, |
| 397 | | pdp1_tape_read_binary, |
| 398 | | pdp1_io_sc_callback, |
| 399 | | 0, /* extend mode support defined in input ports and pdp1_init_machine */ |
| 400 | | 0, /* hardware multiply/divide support defined in input ports and pdp1_init_machine */ |
| 401 | | 0 /* type 20 sequence break system support defined in input ports and pdp1_init_machine */ |
| 402 | | }; |
| 403 | | |
| 404 | | |
| 405 | 370 | static MACHINE_DRIVER_START(pdp1) |
| 406 | 371 | |
| 407 | 372 | /* basic machine hardware */ |
src/mess/drivers/hec2hrp.c
| r6460 | r6461 | |
| 59 | 59 | #include "includes/hec2hrp.h" |
| 60 | 60 | |
| 61 | 61 | |
| 62 | | // Rom page (MX machine) |
| 63 | | UINT8 rom_p1[0x04000]; // Basic 3x page |
| 64 | | UINT8 rom_p2[0x04000]; // Assemblex / Monitrix page |
| 65 | | |
| 66 | | // Ram video BR : |
| 67 | | UINT8 videoramhector[0x04000]; |
| 68 | | // Status for screen definition |
| 69 | | UINT8 flag_hr=1; |
| 70 | | UINT8 flag_80c=0; |
| 71 | | // Status for CPU clock |
| 72 | | UINT8 flag_clk=0; // 0 5MHz (HR machine) - 1 1.75MHz (BR machine) |
| 73 | | |
| 74 | 62 | /////////////////////////////////////////////////////////////////////////////// |
| 75 | 63 | static ADDRESS_MAP_START(hec2hrp_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 76 | 64 | /////////////////////////////////////////////////////////////////////////////// |
| r6460 | r6461 | |
| 122 | 110 | static MACHINE_START( hec2hrp ) |
| 123 | 111 | /////////////////////////////////////////////////////////////////////////////// |
| 124 | 112 | { |
| 125 | | UINT8 i; |
| 126 | | |
| 127 | 113 | UINT8 *RAM = memory_region(machine, "maincpu"); // pointer to mess ram |
| 128 | 114 | UINT8 *ROM1 = memory_region(machine, "page1"); // pointer to rom page 1 |
| 129 | 115 | UINT8 *ROM2 = memory_region(machine, "page2"); // pointer to rom page 2 |
| 130 | 116 | |
| 131 | 117 | // Memory install for bank switching |
| 132 | 118 | memory_configure_bank(machine, 1, HECTOR_BANK_PROG , 1, &RAM[0xc000] , 0); // Mess ram |
| 133 | | memory_configure_bank(machine, 1, HECTOR_BANK_VIDEO, 1, videoramhector, 0); // Video ram |
| 119 | memory_configure_bank(machine, 1, HECTOR_BANK_VIDEO, 1, hector_videoram, 0); // Video ram |
| 134 | 120 | |
| 135 | 121 | // Set bank HECTOR_BANK_PROG as basic bank |
| 136 | 122 | memory_set_bank(machine, 1, HECTOR_BANK_PROG); |
| r6460 | r6461 | |
| 141 | 127 | memory_configure_bank(machine, 2, HECTORMX_BANK_PAGE2 , 1, &ROM2[0x0000] , 0); // Rom page 2 |
| 142 | 128 | memory_set_bank(machine, 2, HECTORMX_BANK_PAGE0); |
| 143 | 129 | //////////////////////////////////////////////////////////SPECIFIQUE MX ///////////////// |
| 144 | | // For keyboard |
| 145 | | keyboard_timer = timer_alloc(machine, Callback_keyboard, 0); |
| 146 | | timer_adjust_periodic(keyboard_timer, ATTOTIME_IN_MSEC(100), 0, ATTOTIME_IN_MSEC(20));//keyboard scan 25ms |
| 147 | 130 | |
| 148 | 131 | // Start keyboard |
| 149 | 132 | at_keyboard_init(machine, AT_KEYBOARD_TYPE_PC); |
| r6460 | r6461 | |
| 151 | 134 | at_keyboard_set_scan_code_set(2); |
| 152 | 135 | at_keyboard_reset(); |
| 153 | 136 | |
| 154 | | for(i = 0; i < 8; i++) touches[i] = 0xff; //all key off |
| 155 | 137 | |
| 156 | | // For Cassette synchro |
| 157 | | Cassette_timer = timer_alloc(machine, Callback_CK, 0); |
| 158 | | 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 |
| 159 | | |
| 160 | | // Sound sn76477 |
| 161 | | Init_Value_SN76477_Hector(); //init R/C value |
| 138 | hector_init(machine); |
| 162 | 139 | } |
| 163 | 140 | |
| 164 | 141 | static MACHINE_RESET(hec2hrp) |
| 165 | 142 | { |
| 166 | 143 | memory_set_bank(machine, 1, HECTOR_BANK_PROG); |
| 167 | | memory_set_bank(machine, 2, HECTORMX_BANK_PAGE0); |
| 168 | | flag_hr=1; |
| 169 | | flag_clk =0; |
| 170 | | write_cassette=0; |
| 144 | memory_set_bank(machine, 2, HECTORMX_BANK_PAGE0); |
| 145 | hector_reset(machine, 1); |
| 171 | 146 | } |
| 172 | 147 | |
| 173 | 148 | /* Cassette definition */ |
| 174 | | const struct CassetteOptions hector_cassette_options = { |
| 149 | static const struct CassetteOptions hector_cassette_options = { |
| 175 | 150 | 1, /* channels */ |
| 176 | 151 | 16, /* bits per sample */ |
| 177 | 152 | 44100 /* sample frequency */ |
| r6460 | r6461 | |
| 191 | 166 | DISCRETE_SOUND_END |
| 192 | 167 | |
| 193 | 168 | /////////////////////////////////////////////////////////////////////////////// |
| 194 | | static VIDEO_START( hec2hrp ) |
| 195 | | /////////////////////////////////////////////////////////////////////////////// |
| 196 | | { |
| 197 | | Init_Hector_Palette(machine); |
| 198 | | } |
| 199 | | |
| 200 | | static VIDEO_UPDATE( hec2hrp ) |
| 201 | | { |
| 202 | | if (flag_hr==1) |
| 203 | | { |
| 204 | | if (flag_80c==0) |
| 205 | | { |
| 206 | | video_screen_set_visarea(screen, 0, 243, 0, 227); |
| 207 | | hector_hr( bitmap , &videoramhector[0], 227, 64); |
| 208 | | } |
| 209 | | else |
| 210 | | { |
| 211 | | video_screen_set_visarea(screen, 0, 243*2, 0, 227); |
| 212 | | hector_80c( bitmap , &videoramhector[0], 227, 64); |
| 213 | | } |
| 214 | | } |
| 215 | | else |
| 216 | | { |
| 217 | | video_screen_set_visarea(screen, 0, 113, 0, 75); |
| 218 | | hector_hr( bitmap, videoram, 77, 32); |
| 219 | | } |
| 220 | | return 0; |
| 221 | | } |
| 222 | | |
| 223 | | /////////////////////////////////////////////////////////////////////////////// |
| 224 | 169 | static MACHINE_DRIVER_START( hec2hr ) |
| 225 | 170 | /////////////////////////////////////////////////////////////////////////////// |
| 226 | 171 | /* basic machine hardware */ |
| r6460 | r6461 | |
| 265 | 210 | MACHINE_DRIVER_END |
| 266 | 211 | |
| 267 | 212 | /////////////////////////////////////////////////////////////////////////////// |
| 268 | | MACHINE_DRIVER_START( hec2hrp ) |
| 213 | static MACHINE_DRIVER_START( hec2hrp ) |
| 269 | 214 | /////////////////////////////////////////////////////////////////////////////// |
| 270 | 215 | /* basic machine hardware */ |
| 271 | 216 | MDRV_CPU_ADD("maincpu",Z80, XTAL_5MHz) |