src/mess/machine/hec2hrp.c
| r14548 | r14549 | |
| 29 | 29 | => Note that actually the DISK II boot (loading CPM : OK) but do not run (don't run the CPM...). |
| 30 | 30 | 20/11/2010 : synchronization between uPD765 and Z80 are now OK, CP/M runnig! JJStacino |
| 31 | 31 | 11/11/2011 : add the minidisque support -3 pouces 1/2 driver- JJStacino (jj.stac @ aliceadsl.fr) |
| 32 | | |
| 32 | 19/02/2012 : few adjustment for the hrp and hr machine - JJStacino |
| 33 | |
| 33 | 34 | don't forget to keep some information about these machines, see DChector project : http://dchector.free.fr/ made by DanielCoulom |
| 34 | 35 | (and thank's to Daniel!) and Yves site : http://hectorvictor.free.fr/ (thank's too Yves!) |
| 35 | 36 | |
| r14548 | r14549 | |
| 71 | 72 | /* Helper function*/ |
| 72 | 73 | static int isHectorWithDisc2(running_machine &machine) |
| 73 | 74 | { |
| 74 | | return ((strncmp(machine.system().name , "hec2hrx" , 7)==0) || |
| 75 | | (strncmp(machine.system().name , "hec2hmx40" , 9)==0) || |
| 76 | | (strncmp(machine.system().name , "hec2hmx80" , 9)==0)); |
| 75 | return ((strncmp(machine.system().name , "hec2hrx" , 7)==0) || |
| 76 | (strncmp(machine.system().name , "hec2mx40" , 8)==0) || |
| 77 | (strncmp(machine.system().name , "hec2mx80" , 8)==0)); |
| 77 | 78 | } |
| 78 | 79 | |
| 79 | 80 | static int isHectorWithMiniDisc(running_machine &machine) |
| 80 | 81 | { |
| 81 | | return ((strncmp(machine.system().name , "hec2mdhrx" , 9)==0)); |
| 82 | return ((strncmp(machine.system().name , "hec2mdhrx", 9)==0)); |
| 82 | 83 | } |
| 83 | 84 | |
| 84 | 85 | static int isHectorHR(running_machine &machine) |
| 85 | 86 | { |
| 86 | | return ((strncmp(machine.system().name , "hec2hr" , 6)==0) || |
| 87 | | (strncmp(machine.system().name , "hec2mdhrx" , 9)==0) || |
| 88 | | (strncmp(machine.system().name , "victor" , 6)==0) || |
| 89 | | (strncmp(machine.system().name , "hec2hmx40" , 9)==0) || |
| 90 | | (strncmp(machine.system().name , "hec2hmx80" , 9)==0)); |
| 87 | return ((strncmp(machine.system().name , "hec2hr" , 6)==0) || //Aviable for hr & hrp |
| 88 | (strncmp(machine.system().name , "hec2mdhrx", 9)==0) || |
| 89 | (strncmp(machine.system().name , "victor" , 6)==0) || |
| 90 | (strncmp(machine.system().name , "hec2mx40" , 8)==0) || |
| 91 | (strncmp(machine.system().name , "hec2mx80" , 8)==0)); |
| 91 | 92 | } |
| 92 | 93 | |
| 94 | static int isHectoreXtend(running_machine &machine) |
| 95 | { |
| 96 | return ((strncmp(machine.system().name , "hec2mdhrx", 9)==0) || |
| 97 | (strncmp(machine.system().name , "hec2hrx" , 7)==0) || |
| 98 | (strncmp(machine.system().name , "hec2mx40" , 8)==0) || |
| 99 | (strncmp(machine.system().name , "hec2mx80" , 8)==0)); |
| 100 | } |
| 101 | |
| 93 | 102 | /* Cassette timer*/ |
| 94 | 103 | static TIMER_CALLBACK( Callback_CK ) |
| 95 | 104 | { |
| r14548 | r14549 | |
| 181 | 190 | { |
| 182 | 191 | hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>(); |
| 183 | 192 | if (offset==0x00) { /* 0x800 et 0x000=> video page, HR*/ |
| 184 | | memory_set_bank(space->machine(), "bank1", HECTOR_BANK_VIDEO); |
| 193 | if (isHectoreXtend(space->machine())) |
| 194 | memory_set_bank(space->machine(), "bank1", HECTOR_BANK_VIDEO); |
| 185 | 195 | if (state->m_flag_clk ==1) |
| 186 | 196 | { |
| 187 | 197 | state->m_flag_clk=0; |
| 188 | | space->machine().device("maincpu")->set_unscaled_clock(XTAL_5MHz); /* Augmentation CPU*/ |
| 198 | space->machine().device("maincpu")->set_unscaled_clock(XTAL_5MHz); /* increase CPU*/ |
| 189 | 199 | } |
| 190 | 200 | } |
| 191 | 201 | if (offset==0x04) { /* 0x804 => video page, BR*/ |
| 192 | 202 | state->m_hector_flag_hr=0; |
| 193 | | memory_set_bank(space->machine(), "bank1", HECTOR_BANK_VIDEO); |
| 203 | if (isHectoreXtend(space->machine())) |
| 204 | memory_set_bank(space->machine(), "bank1", HECTOR_BANK_VIDEO); |
| 194 | 205 | if (state->m_flag_clk ==0) |
| 195 | 206 | { |
| 196 | 207 | state->m_flag_clk=1; |
| 197 | | space->machine().device("maincpu")->set_unscaled_clock(XTAL_1_75MHz); /* Ralentissement CPU*/ |
| 208 | space->machine().device("maincpu")->set_unscaled_clock(XTAL_1_75MHz); /* slowdown CPU*/ |
| 198 | 209 | } |
| 199 | 210 | } |
| 200 | 211 | if (offset==0x08) { /* 0x808 => base page, HR*/ |
| 201 | | memory_set_bank(space->machine(), "bank1", HECTOR_BANK_PROG); |
| 212 | if (isHectoreXtend(space->machine())) |
| 213 | memory_set_bank(space->machine(), "bank1", HECTOR_BANK_PROG); |
| 202 | 214 | if (state->m_flag_clk ==1) |
| 203 | 215 | { |
| 204 | 216 | state->m_flag_clk=0; |
| 205 | | space->machine().device("maincpu")->set_unscaled_clock(XTAL_5MHz); /* Augmentation CPU*/ |
| 217 | space->machine().device("maincpu")->set_unscaled_clock(XTAL_5MHz); /* increase CPU*/ |
| 206 | 218 | } |
| 207 | 219 | |
| 208 | 220 | } |
| 209 | 221 | if (offset==0x0c) { /* 0x80c => base page, BR*/ |
| 210 | 222 | state->m_hector_flag_hr=0; |
| 211 | | memory_set_bank(space->machine(), "bank1", HECTOR_BANK_PROG); |
| 223 | if (isHectoreXtend(space->machine())) |
| 224 | memory_set_bank(space->machine(), "bank1", HECTOR_BANK_PROG); |
| 212 | 225 | if (state->m_flag_clk ==0) |
| 213 | 226 | { |
| 214 | 227 | state->m_flag_clk=1; |
| 215 | | space->machine().device("maincpu")->set_unscaled_clock(XTAL_1_75MHz); /* Ralentissement CPU*/ |
| 228 | space->machine().device("maincpu")->set_unscaled_clock(XTAL_1_75MHz); /* slowdown CPU*/ |
| 216 | 229 | } |
| 217 | 230 | } |
| 218 | 231 | } |
| r14548 | r14549 | |
| 238 | 251 | if (data & 0x01) /* Reset machine ! (on ESC key)*/ |
| 239 | 252 | { |
| 240 | 253 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE); |
| 241 | | state->m_hector_flag_hr=1; |
| 242 | | if (isHectorHR(machine)) /* aviable for HRX and up */ |
| 254 | if (isHectorHR(machine)) /* aviable for HR and up */ |
| 243 | 255 | { |
| 244 | | memory_set_bank(machine, "bank1", HECTOR_BANK_PROG); |
| 245 | | memory_set_bank(machine, "bank2", HECTORMX_BANK_PAGE0); |
| 246 | | |
| 256 | state->m_hector_flag_hr=1; |
| 257 | if (isHectoreXtend(machine)) |
| 258 | { |
| 259 | memory_set_bank(machine, "bank1", HECTOR_BANK_PROG); |
| 260 | memory_set_bank(machine, "bank2", HECTORMX_BANK_PAGE0); |
| 261 | } |
| 247 | 262 | //RESET DISC II unit |
| 248 | 263 | if (isHectorWithDisc2(machine) ) |
| 249 | 264 | hector_disc2_reset(machine); |
| 250 | 265 | |
| 251 | | /* floppy master reset */ |
| 266 | /* floppy md master reset */ |
| 252 | 267 | if (isHectorWithMiniDisc(machine)) |
| 253 | 268 | wd17xx_mr_w(machine.device("wd179x"), 1); |
| 254 | 269 | |
| r14548 | r14549 | |
| 369 | 384 | { |
| 370 | 385 | /* Bit 6 => motor ON/OFF => for cassette state!*/ |
| 371 | 386 | if (state->m_write_cassette==0) |
| 372 | | cassette_device_image(space->machine())->set_state((cassette_state)(CASSETTE_PLAY | CASSETTE_SPEAKER_ENABLED)); |
| 387 | { |
| 388 | cassette_device_image(space->machine())->change_state( |
| 389 | CASSETTE_MOTOR_ENABLED , |
| 390 | CASSETTE_MASK_MOTOR); |
| 391 | // cassette_device_image(space->machine())->set_state((cassette_state)(CASSETTE_PLAY | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED )); |
| 392 | } |
| 373 | 393 | } |
| 374 | 394 | else |
| 375 | 395 | { /* stop motor*/ |
| r14548 | r14549 | |
| 388 | 408 | state->m_counter_write = 6; |
| 389 | 409 | if (state->m_write_cassette==0) |
| 390 | 410 | { /* C'est la 1er fois => record*/ |
| 411 | cassette_device_image(space->machine())->change_state( |
| 412 | CASSETTE_MOTOR_ENABLED , |
| 413 | CASSETTE_MASK_MOTOR); |
| 391 | 414 | cassette_device_image(space->machine())->set_state(CASSETTE_RECORD); |
| 392 | 415 | state->m_write_cassette=1; |
| 393 | 416 | } |
src/mess/drivers/hec2hrp.c
| r14548 | r14549 | |
| 120 | 120 | /*****************************************************************************/ |
| 121 | 121 | ADDRESS_MAP_UNMAP_HIGH |
| 122 | 122 | /* Hardware address mapping*/ |
| 123 | | // AM_RANGE(0x0800,0x0808) AM_WRITE( hector_switch_bank_w)/* Bank management*/ |
| 123 | AM_RANGE(0x0800,0x0808) AM_WRITE( hector_switch_bank_w)/* Bank management*/ |
| 124 | 124 | AM_RANGE(0x1000,0x1000) AM_WRITE( hector_color_a_w) /* Color c0/c1*/ |
| 125 | 125 | AM_RANGE(0x1800,0x1800) AM_WRITE( hector_color_b_w) /* Color c2/c3*/ |
| 126 | 126 | AM_RANGE(0x2000,0x2003) AM_WRITE( hector_sn_2000_w) /* Sound*/ |
| r14548 | r14549 | |
| 256 | 256 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 257 | 257 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 258 | 258 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 259 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) |
| 259 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR('M') |
| 260 | 260 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 261 | 261 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 262 | 262 | |
| r14548 | r14549 | |
| 399 | 399 | { |
| 400 | 400 | hector_cassette_formats, |
| 401 | 401 | &hector_cassette_options, |
| 402 | | (cassette_state)(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER), |
| 402 | (cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED), |
| 403 | 403 | NULL, |
| 404 | 404 | NULL |
| 405 | 405 | }; |
| r14548 | r14549 | |
| 597 | 597 | MCFG_SCREEN_UPDATE_STATIC(hec2hrp) |
| 598 | 598 | |
| 599 | 599 | MCFG_PALETTE_LENGTH(16) |
| 600 | | MCFG_PALETTE_INIT(black_and_white) |
| 601 | 600 | MCFG_VIDEO_START(hec2hrp) |
| 602 | 601 | |
| 603 | 602 | /* sound hardware */ |