Previous 15994 Revisions Next

r14549 Monday 20th February, 2012 at 08:15:36 UTC by Miodrag Milanović
-hec2hp: Fixed regressions [JJ Stacino]
[src/mess/drivers]hec2hrp.c
[src/mess/machine]hec2hrp.c

src/mess/machine/hec2hrp.c
r14548r14549
2929                => Note that actually the DISK II boot (loading CPM : OK) but do not run (don't run the CPM...).
3030        20/11/2010 : synchronization between uPD765 and Z80 are now OK, CP/M runnig! JJStacino
3131        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     
3334    don't forget to keep some information about these machines, see DChector project : http://dchector.free.fr/ made by DanielCoulom
3435        (and thank's to Daniel!) and Yves site : http://hectorvictor.free.fr/ (thank's too Yves!)
3536
r14548r14549
7172/* Helper function*/
7273static int isHectorWithDisc2(running_machine &machine)
7374{
74return ((strncmp(machine.system().name , "hec2hrx"     , 7)==0) ||
75      (strncmp(machine.system().name , "hec2hmx40"   , 9)==0) ||
76      (strncmp(machine.system().name , "hec2hmx80"   , 9)==0));
75return ((strncmp(machine.system().name , "hec2hrx"    , 7)==0) ||
76      (strncmp(machine.system().name , "hec2mx40"   , 8)==0) ||
77      (strncmp(machine.system().name , "hec2mx80"   , 8)==0));
7778}
7879
7980static int isHectorWithMiniDisc(running_machine &machine)
8081{
81return ((strncmp(machine.system().name , "hec2mdhrx"   , 9)==0));
82return ((strncmp(machine.system().name , "hec2mdhrx", 9)==0));
8283}
8384
8485static int isHectorHR(running_machine &machine)
8586{
86return ((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));
87return ((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));
9192}
9293
94static int isHectoreXtend(running_machine &machine)
95{
96return ((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
93102/* Cassette timer*/
94103static TIMER_CALLBACK( Callback_CK )
95104{
r14548r14549
181190{
182191   hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
183192   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);
185195                     if (state->m_flag_clk ==1)
186196                     {
187197                        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*/
189199                     }
190200                  }
191201   if (offset==0x04)   {   /* 0x804 => video page, BR*/
192202                     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);
194205                     if (state->m_flag_clk ==0)
195206                     {
196207                        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*/
198209                     }
199210                  }
200211   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);
202214                     if (state->m_flag_clk ==1)
203215                     {
204216                        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*/
206218                     }
207219
208220                  }
209221   if (offset==0x0c)   {   /* 0x80c => base page, BR*/
210222                     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);
212225                     if (state->m_flag_clk ==0)
213226                     {
214227                        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*/
216229                     }
217230                  }
218231}
r14548r14549
238251      if (data & 0x01) /* Reset machine ! (on ESC key)*/
239252      {
240253        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 */
243255         {
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               }
247262            //RESET DISC II unit
248263            if (isHectorWithDisc2(machine) )
249264               hector_disc2_reset(machine);
250265
251            /* floppy master reset */
266            /* floppy md master reset */
252267            if (isHectorWithMiniDisc(machine))
253268               wd17xx_mr_w(machine.device("wd179x"), 1);
254269
r14548r14549
369384   {
370385      /* Bit 6 => motor ON/OFF => for cassette state!*/
371386      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      }
373393   }
374394   else
375395   {   /* stop motor*/
r14548r14549
388408         state->m_counter_write = 6;
389409         if (state->m_write_cassette==0)
390410         {   /* C'est la 1er fois => record*/
411                      cassette_device_image(space->machine())->change_state(
412                  CASSETTE_MOTOR_ENABLED ,
413                  CASSETTE_MASK_MOTOR);
391414            cassette_device_image(space->machine())->set_state(CASSETTE_RECORD);
392415            state->m_write_cassette=1;
393416         }
src/mess/drivers/hec2hrp.c
r14548r14549
120120/*****************************************************************************/
121121   ADDRESS_MAP_UNMAP_HIGH
122122   /* 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*/
124124   AM_RANGE(0x1000,0x1000) AM_WRITE( hector_color_a_w)  /* Color c0/c1*/
125125   AM_RANGE(0x1800,0x1800) AM_WRITE( hector_color_b_w)  /* Color c2/c3*/
126126   AM_RANGE(0x2000,0x2003) AM_WRITE( hector_sn_2000_w)  /* Sound*/
r14548r14549
256256      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P)         PORT_CHAR('P')
257257      PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O)         PORT_CHAR('O')
258258      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')
260260      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L)         PORT_CHAR('L')
261261      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K)         PORT_CHAR('K')
262262
r14548r14549
399399{
400400   hector_cassette_formats,
401401   &hector_cassette_options,
402   (cassette_state)(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER),
402   (cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED),
403403   NULL,
404404   NULL
405405};
r14548r14549
597597   MCFG_SCREEN_UPDATE_STATIC(hec2hrp)
598598
599599   MCFG_PALETTE_LENGTH(16)
600   MCFG_PALETTE_INIT(black_and_white)
601600   MCFG_VIDEO_START(hec2hrp)
602601
603602   /* sound hardware */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team