Previous 15994 Revisions Next

r3740 Friday 5th December, 2008 at 21:31:17 UTC by Miodrag Milanović
[VECTOR06] Fixed graphics
[src/mess/drivers]vector06.c
[src/mess/includes]vector06.h
[src/mess/machine]vector06.c
[src/mess/video]vector06.c

src/mess/video/vector06.c
r3739r3740
1717VIDEO_UPDATE( vector06 )
1818{
1919    UINT8 code1,code2,code3,code4;
20    UINT8 col;
20    UINT8 col;//,col1,col2;
2121   int y, x, b;
2222
23   rectangle screen_area = {0,256+64-1,0,256+64-1};
23   int width = (vector_video_mode==0x00) ? 256 : 512;     
24   rectangle screen_area = {0,width+64-1,0,256+64-1};
2425   // fill border color
25   fillbitmap(bitmap, 0, &screen_area);
26   fillbitmap(bitmap, vector_color_index, &screen_area);
2627
2728   // draw image
2829   for (x = 0; x < 32; x++)
r3739r3740
3637         for (b = 0; b < 8; b++)
3738         {
3839            col = ((code1 >> b) & 0x01) * 8 + ((code2 >> b) & 0x01) * 4 + ((code3 >> b) & 0x01)* 2+ ((code4 >> b) & 0x01);
39            *BITMAP_ADDR16(bitmap, 255-y+32, x*8+(7-b)+32) =  col;
40            if (vector_video_mode==0x00) {
41               *BITMAP_ADDR16(bitmap, 255-y+32, x*8+(7-b)+32) =  col;
42            } else {
43               *BITMAP_ADDR16(bitmap, 255-y+32, x*16+(7-b)*2+1+32) =  ((code2 >> b) & 0x01) * 2;
44               *BITMAP_ADDR16(bitmap, 255-y+32, x*16+(7-b)*2+32)   =  ((code3 >> b) & 0x01) * 2;
45            }
4046         }
4147      }
4248   }
43
44
4549   return 0;
4650}
4751
src/mess/includes/vector06.h
r3739r3740
2525extern WRITE8_HANDLER(vector_8255_2_w);
2626
2727extern WRITE8_HANDLER(vector06_color_set);
28extern UINT8 vector_color_index;
29extern UINT8 vector_video_mode;
2830/*----------- defined in video/vector06.c -----------*/
2931
3032extern PALETTE_INIT( vector06 );
src/mess/machine/vector06.c
r3739r3740
1414#include "includes/vector06.h"
1515
1616static int vector06_keyboard_mask;
17static UINT8 vector_color_index;
17UINT8 vector_color_index;
18UINT8 vector_video_mode;
1819
1920/* Driver initialization */
2021DRIVER_INIT(vector06)
r3739r3740
3334   if ((vector06_keyboard_mask & 0x20)!=0) { key &= input_port_read(device->machine,"LINE5"); }
3435   if ((vector06_keyboard_mask & 0x40)!=0) { key &= input_port_read(device->machine,"LINE6"); }
3536   if ((vector06_keyboard_mask & 0x80)!=0) { key &= input_port_read(device->machine,"LINE7"); }
36      logerror("vector06_8255_portb_r %02x %02x\n",vector06_keyboard_mask,key);
3737   return key;
3838}
3939
r3739r3740
5252   vector06_keyboard_mask = data ^ 0xff;
5353}
5454
55static void vector_set_video_mode(running_machine *machine, int width) {
56   rectangle visarea;
57   
58   visarea.min_x = 0;
59   visarea.min_y = 0;
60   visarea.max_x = width+64-1;
61   visarea.max_y = 256+64-1;
62   video_screen_configure(machine->primary_screen, width+64, 256+64, &visarea, video_screen_get_frame_period(machine->primary_screen).attoseconds);   
63}
64
5565static WRITE8_DEVICE_HANDLER (vector06_8255_portb_w )
5666{
57   vector_color_index = data;
67   vector_color_index = data & 0x0f;
68   if ((data & 0x10) != vector_video_mode)
69   {
70      vector_video_mode = data & 0x10;
71      vector_set_video_mode(device->machine,(vector_video_mode==0x10) ? 512 : 256);
72   }   
5873}
5974
6075WRITE8_HANDLER(vector06_color_set)
6176{
62   UINT8 r = (data & 7) << 4;
63   UINT8 g = ((data >> 3) & 7) << 4;
64   UINT8 b = ((data >>6) & 3) << 5;
77   UINT8 r = (data & 7) << 5;
78   UINT8 g = ((data >> 3) & 7) << 5;
79   UINT8 b = ((data >>6) & 3) << 6;
6580   palette_set_color( space->machine, vector_color_index, MAKE_RGB(r,g,b) );
6681}
6782
r3739r3740
168183   memory_set_bankptr(machine, 4, mess_ram + 0x8000);
169184
170185   vector06_keyboard_mask = 0;
171   
186   vector_color_index = 0;
187   vector_video_mode = 0;
172188   timer_pulse(ATTOTIME_IN_HZ(10), NULL, 0, reset_check_callback);
173189
174190}
src/mess/drivers/vector06.c
r3739r3740
129129/* Machine driver */
130130static MACHINE_DRIVER_START( vector06 )
131131  /* basic machine hardware */
132//     MDRV_CPU_ADD("main", 8080, 3000000)
133   MDRV_CPU_ADD("main", Z80, 3000000)
132     MDRV_CPU_ADD("main", 8080, 3000000)
133//   MDRV_CPU_ADD("main", Z80, 3000000)
134134     MDRV_CPU_PROGRAM_MAP(vector06_mem, 0)
135135     MDRV_CPU_IO_MAP(vector06_io, 0)
136136     MDRV_CPU_VBLANK_INT("main", vector06_interrupt)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team