Previous 15994 Revisions Next

r5920 Wednesday 30th September, 2009 at 00:32:00 UTC by Angelo Salese
[PC6001]: Implemented 128x192x2 support, most games uses this mode
[src/mess/drivers]pc6001.c

src/mess/drivers/pc6001.c
r5919r5920
1313         so this implementation will be used in the end.
1414      B) It's easier to me to see what the attribute vram does since I don't
1515         have any docs atm.
16   - IRQ vector 0x06 is clearly used on some games otherwise they locks,
17     check what is supposed to be.
1618
1719==================================================================================
1820
r5919r5920
7274irq vector 00: writes 0x00 to [$fa19]
7375irq vector 02: (A = 0, B = 0) tests ppi port c, does something with ay ports (plus more?) ;keyboard data ready, no kanji lock, no caps lock
7476irq vector 04: uart irq
75irq vector 06: operates with $fa28, $fa2e, $fd1b
77irq vector 06: operates with $fa28, $fa2e, $fd1b ;hblank? joypad irq?
7678irq vector 08: tests ppi port c, puts port A to $fa1d,puts 0x02 to [$fa19] ;tape data ready
7779irq vector 0A: writes 0x00 to [$fa19]
7880irq vector 0C: writes 0x00 to [$fa19]
r5919r5920
9799static UINT8 irq_vector = 0x00;
98100static UINT8 cas_switch,sys_latch;
99101
102#define CAS_LENGTH 0x1655
103
100104static VIDEO_START( pc6001 )
101105{
102106   #if 0
r5919r5920
109113   cfg.get_char_rom = pc6001_get_char_rom;
110114   m6847_init(machine, &cfg);
111115   #endif
112   pc6001_video_ram = auto_alloc_array(machine, UINT8, 0x1000); //0x400? We'll see...
116   pc6001_video_ram = auto_alloc_array(machine, UINT8, 0x2000); //0x400? We'll see...
113117}
114118
115119static VIDEO_UPDATE( pc6001 )
r5919r5920
119123   int tile,attr,pen,color;
120124   int fgcol;
121125
122   for(y=0;y<16;y++)
126   attr = pc6001_video_ram[0];
127
128   if(attr & 0x80) // 128x192 4 colors mode
123129   {
124      for(x=0;x<32;x++)
130      int shrink_x = 2*4;
131      int shrink_y = (attr & 8) ? 1 : 2;
132      int w = (shrink_x == 8) ? 32 : 16;
133
134      for(y=0;y<(192/shrink_y);y++)
125135      {
126         tile = pc6001_video_ram[(x+(y*32))+0x200];
127         attr = pc6001_video_ram[(x+(y*32)) & 0x1ff] ;
128
129         if(attr & 0x40)
136         for(x=0;x<w;x++)
130137         {
131            pen = (tile & 0xc0) >> 6 | (attr & 2)<<1;
138            tile = pc6001_video_ram[(x+(y*32))+0x200];
132139
133            for(yi=0;yi<12;yi++)
140            for(yi=0;yi<shrink_y;yi++)
134141            {
135               for(xi=0;xi<8;xi++)
142               for(xi=0;xi<shrink_x;xi++)
136143               {
137144                  int i;
138                  i = (xi & 4)>>2; //x-axis
139                  i+= (yi & 4)>>1; //y-axis 1
140                  i+= (yi & 8)>>1; //y-axis 2
145                  i = (shrink_x == 8) ? (xi & 0x06) : (xi & 0x0c)>>1;
146                  color = ((tile >> i) & 3)+8;
141147
142                  color = ((tile >> i) & 1) ? pen+8 : 0;
143
144                  *BITMAP_ADDR16(bitmap, ((y*12+(11-yi))+24), (x*8+(7-xi))+32) = screen->machine->pens[color];
148                  *BITMAP_ADDR16(bitmap, ((y*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = screen->machine->pens[color];
145149               }
146150            }
147151         }
148         else
152      }
153   }
154   else // text mode
155   {
156      for(y=0;y<16;y++)
157      {
158         for(x=0;x<32;x++)
149159         {
150            for(yi=0;yi<12;yi++)
160            tile = pc6001_video_ram[(x+(y*32))+0x200];
161            attr = pc6001_video_ram[(x+(y*32)) & 0x1ff];
162
163            if(attr & 0x40)
151164            {
152               for(xi=0;xi<8;xi++)
165               pen = (tile & 0xc0) >> 6 | (attr & 2)<<1;
166
167               for(yi=0;yi<12;yi++)
153168               {
154                  pen = gfx_data[(tile*0x10)+yi]>>(7-xi) & 1;
169                  for(xi=0;xi<8;xi++)
170                  {
171                     int i;
172                     i = (xi & 4)>>2; //x-axis
173                     i+= (yi & 4)>>1; //y-axis 1
174                     i+= (yi & 8)>>1; //y-axis 2
155175
156                  fgcol = (attr & 2) ? 2 : 7;
176                     color = ((tile >> i) & 1) ? pen+8 : 0;
157177
158                  if(attr & 1)
159                     color = pen ? 0 : fgcol;
160                  else
161                     color = pen ? fgcol : 0;
178                     *BITMAP_ADDR16(bitmap, ((y*12+(11-yi))+24), (x*8+(7-xi))+32) = screen->machine->pens[color];
179                  }
180               }
181            }
182            else
183            {
184               for(yi=0;yi<12;yi++)
185               {
186                  for(xi=0;xi<8;xi++)
187                  {
188                     pen = gfx_data[(tile*0x10)+yi]>>(7-xi) & 1;
162189
190                     fgcol = (attr & 2) ? 2 : 7;
191
192                     if(attr & 1)
193                        color = pen ? 0 : fgcol;
194                     else
195                        color = pen ? fgcol : 0;
196
163197                     *BITMAP_ADDR16(bitmap, ((y*12+yi)+24), (x*8+xi)+32) = screen->machine->pens[color];
198                  }
164199               }
165200            }
166201         }
r5919r5920
472507   {
473508      cur_keycode = gfx_data[i++];
474509      //popmessage("%04x",i);
475      if(i >= 0x34c6)
510      if(i >= CAS_LENGTH)
476511      {
477512         i = 0;
478513         cas_switch = 0;
r5919r5920
592627   ROM_LOAD( "cgrom60.60", 0x0000, 0x1000, CRC(b0142d32) SHA1(9570495b10af5b1785802681be94b0ea216a1e26) )
593628
594629   ROM_REGION( 0x10000, "cas", ROMREGION_ERASEFF )
595   /* Load here your tape for now (and change line 475 with the length value that MESS returns) */
596   //ROM_LOAD( "demo.cas", 0x0000, 0x34c6, CRC(1) SHA1(1) )
630   /* Load here your tape for now (and change the cas length macro according to what MESS returns) */
631//   ROM_LOAD( "car.cas", 0x0000, CAS_LENGTH, CRC(1) SHA1(1) )
597632ROM_END
598633
599634ROM_START( pc6001a )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team