Previous 15994 Revisions Next

r8748 Monday 9th August, 2010 at 17:05:40 UTC by Angelo Salese
[PC-6001]: Emulated gfx mode 4 user-selectable colors
[src/mess/drivers]pc6001.c

src/mess/drivers/pc6001.c
r8747r8748
1010    - cassette handling requires a decap of the MCU. It could be possible to
1111      do some tight synch between the master CPU and a code simulation,but I think
1212      it's not worth the effort...
13   - joypad polling probably needs some kind of masking when you're on BASIC.
14    - make the later model to work;
13   - joypad polling actually doesn't work, the joycode stuff currently hooked up is just the
14     keyboard arrow keys;
15    - make PC-6600 model to work;
1516    - Currently rewriting the video part without the MC6847 for two reasons:
1617        A) the later models have a custom video chip in the place of the MC6847,
1718           so this implementation will be used in the end.
r8747r8748
1920           have any docs atm.
2021
2122   TODO (game specific):
22   - The Outlaw (AX-10): is now broken due of the joycode stuff
23   - Portpia: hangs after a bunch of text screens
23   - (several AX* games, namely Simon, Arabian Rhapsody and others): inputs doesn't work
24   - AX6 - Demo: When AY-based speech talks, screen should be a solid green (plain PC-6001) or solid white (Mk2 version)
25   - AX10 - The Outlaw: gameplay is now broken due of the joycode stuff
2426   - Galaxy Mission Part I / II: can't start a play
25   - Yakyukyo (MK2): waits for an irq, check which one;
26   - Forts 2 (MK2): ASCII gfxs are missing;
27   - Hydlide (MK2): pressing down makes the player to die instantly
28   - American Truck (MK2): Screen is offset at the loading screen
29   - Castle Excellent (MK2): copyright text drawing is quite bogus.
30   - Pac-Man (MK2): gameplay is too fast
27   - Portopia Renzoku Satsujin Jiken: hangs after a bunch of text screens
28   (Mk2 mode 5 games)
29   - American Truck: Screen is offset at the loading screen, loading bug?
30   - Castle Excellent: copyright text drawing is quite bogus, scans text in vertical instead of horizontal?
31   - Forts 2: ASCII gfxs are missing;
32   - Hydlide: pressing down makes the player to die instantly
33   - Pac-Man: gameplay is too fast
34   - Yakyukyo: waits for an irq, check which one;
3135
3236========================================================================================================================================================
3337
r8747r8748
152156   pc6001_video_ram = auto_alloc_array(machine, UINT8, 0x4000);
153157}
154158
155static void draw_bitmap_1bpp(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int attr)
159/* this is known as gfx mode 4 */
160static void draw_gfx_mode4(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int attr)
156161{
157162   int x,y,xi;
158163   int fgcol,color;
164   int col_setting;
165   static const UINT8 pen_gattr[4][4] = {
166      { 0, 1, 6, 2 }, //Red / Blue
167      { 0, 6, 1, 2 }, //Blue / Red
168      { 0, 5, 2, 2 }, //Pink / Green
169      { 0, 2, 5, 2 }, //Green / Pink
170   };
171   static const UINT8 pen_wattr[4][4] = {
172      { 0, 1, 6, 7 }, //Red / Blue
173      { 0, 6, 1, 7 }, //Blue / Red
174      { 0, 5, 2, 7 }, //Pink / Green
175      { 0, 2, 5, 7 }, //Green / Pink
176   };
177   col_setting = input_port_read(machine,"MODE4_DSW") & 7;
159178
160   fgcol = (attr & 2) ? 7 : 2;
161
162179   for(y=0;y<192;y++)
163180   {
164181      for(x=0;x<32;x++)
165182      {
166183         int tile = pc6001_video_ram[(x+(y*32))+0x200];
167184
168         for(xi=0;xi<8;xi++)
185         if(col_setting == 0x00) //monochrome
169186         {
170            color = ((tile)>>(7-xi) & 1) ? fgcol : 0;
187            for(xi=0;xi<8;xi++)
188            {
189               fgcol = (attr & 2) ? 7 : 2;
171190
172            *BITMAP_ADDR16(bitmap, (y+24), (x*8+xi)+32) = machine->pens[color];
191               color = ((tile)>>(7-xi) & 1) ? fgcol : 0;
192
193               *BITMAP_ADDR16(bitmap, (y+24), (x*8+xi)+32) = machine->pens[color];
194            }
173195         }
196         else
197         {
198            for(xi=0;xi<4;xi++)
199            {
200               fgcol = ((tile)>>(6-(xi*2)) & 3);
201
202               color = (attr & 2) ? (pen_wattr[col_setting-1][fgcol]) : (pen_gattr[col_setting-1][fgcol]);
203
204               *BITMAP_ADDR16(bitmap, (y+24), ((x*8+xi*2)+0)+32) = machine->pens[color];
205               *BITMAP_ADDR16(bitmap, (y+24), ((x*8+xi*2)+1)+32) = machine->pens[color];
206            }
207         }
174208      }
175209   }
176210}
r8747r8748
309343   {
310344      if(attr & 0x10) // 256x192x1 mode (FIXME: might be a different trigger)
311345      {
312         draw_bitmap_1bpp(machine,bitmap,cliprect,attr);
346         draw_gfx_mode4(machine,bitmap,cliprect,attr);
313347      }
314348      else // 128x192x2 mode
315349      {
r8747r8748
11461180
11471181/* Input ports */
11481182static INPUT_PORTS_START( pc6001 )
1183   PORT_START("MODE4_DSW") //TODO: is this really a DSW? bit arrangement is also unknown if so.
1184   PORT_DIPNAME( 0x07, 0x00, "Mode 4 GFX colors" )
1185   PORT_DIPSETTING(    0x00, "Monochrome" )
1186   PORT_DIPSETTING(    0x01, "Red/Blue" )
1187   PORT_DIPSETTING(    0x02, "Blue/Red" )
1188   PORT_DIPSETTING(    0x03, "Pink/Green" )
1189   PORT_DIPSETTING(    0x04, "Green/Pink" )
1190   //5-6-7 is presumably invalid
1191
11491192   /* TODO: these two are unchecked */
11501193   PORT_START("P1")
11511194   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY

Previous 15994 Revisions Next


© 1998-2018 The MESS Team