Previous 15994 Revisions Next

r5935 Thursday 1st October, 2009 at 12:45:20 UTC by Angelo Salese
[PC6001]: Implemented STOP TAPE cmd
[src/mess/drivers]pc6001.c

src/mess/drivers/pc6001.c
r5934r5935
9696static UINT8 *pc6001_video_ram;
9797static UINT8 irq_vector = 0x00;
9898static UINT8 cas_switch,sys_latch;
99static UINT32 cas_offset;
99100
100#define CAS_LENGTH 0x3b9c
101#define CAS_LENGTH 0x64c8
101102
102103static VIDEO_START( pc6001 )
103104{
r5934r5935
127128   {
128129      if(attr & 0x10) // 256x192x1 mode (FIXME: might be a different trigger)
129130      {
131         int fgcol = (attr & 2) ? 7 : 2;
132
130133         for(y=0;y<192;y++)
131134         {
132135            for(x=0;x<32;x++)
r5934r5935
135138
136139               for(xi=0;xi<8;xi++)
137140               {
138                  color = ((tile)>>(7-xi) & 1) ? 7 : 0;
141                  color = ((tile)>>(7-xi) & 1) ? fgcol : 0;
139142
140143                  *BITMAP_ADDR16(bitmap, (y+24), (x*8+xi)+32) = screen->machine->pens[color];
141144               }
r5934r5935
241244
242245   pc6001_video_ram =  pc6001_ram + startaddr[(data >> 1) & 0x03] - 0x8000;
243246
244   if((!(sys_latch & 8)) && data & 0x8)
247   if((!(sys_latch & 8)) && data & 0x8) //PLAY tape cmd
245248      cas_switch = 1;
249   if((sys_latch & 8) && ((data & 0x8) == 0)) //STOP tape cmd
250   {
251      cas_switch = 0;
252      irq_vector = 0x00;
253      cputag_set_input_line(space->machine,"maincpu", 0, ASSERT_LINE);
254   }
246255
247256   sys_latch = data;
248257   printf("%02x\n",data);
r5934r5935
574583static TIMER_CALLBACK(cassette_callback)
575584{
576585   UINT8 *gfx_data = memory_region(machine, "cas");
577   static UINT32 i;
578586
579587   if(cas_switch == 1)
580588   {
581      cur_keycode = gfx_data[i++];
582      //popmessage("%04x",i);
583      if(i >= CAS_LENGTH)
589      cur_keycode = gfx_data[cas_offset++];
590      //popmessage("%04x %02x",cas_offset,cas_switch);
591      if(cas_offset >= CAS_LENGTH)
584592      {
585         i = 0;
593         cas_offset = 0;
586594         cas_switch = 0;
587595         irq_vector = 0x12;
588596         cputag_set_input_line(machine,"maincpu", 0, ASSERT_LINE);
r5934r5935
637645   timer_pulse(machine, ATTOTIME_IN_HZ(250), NULL, 0, keyboard_callback);
638646   timer_pulse(machine, ATTOTIME_IN_HZ(160), NULL, 0, cassette_callback);
639647   cas_switch = 0;
648   cas_offset = 0;
640649}
641650
642651static const rgb_t defcolors[] =
r5934r5935
712721
713722   ROM_REGION( 0x10000, "cas", ROMREGION_ERASEFF )
714723   /* Load here your tape for now (and change the cas length macro according to what MESS returns) */
715//   ROM_LOAD( "the amazon.cas", 0x0000, CAS_LENGTH, CRC(1) SHA1(1) )
724//   ROM_LOAD( "trick boy.cas", 0x0000, CAS_LENGTH, CRC(1) SHA1(1) )
716725ROM_END
717726
718727ROM_START( pc6001a )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team