Previous 15994 Revisions Next

r10164 Sunday 23rd January, 2011 at 21:39:33 UTC by Nathan Woods
1. [BBC] Made the SAA505x implementation a device. [Atari Ace]

2. [PDP1] Made the CRT implementation a device. [Atari Ace]
[docs]messnew.txt
[src/mess/drivers]bbc.c pdp1.c tx0.c
[src/mess/includes]bbc.h pdp1.h tx0.h
[src/mess/machine]pdp1.c tx0.c
[src/mess/video]bbc.c crt.c crt.h pdp1.c saa505x.c saa505x.h tx0.c

src/mess/machine/pdp1.c
r10163r10164
970970
971971   x = ((ac+0400000) & 0777777) >> 8;
972972   y = (((*io)+0400000) & 0777777) >> 8;
973   pdp1_plot(x, y);
973   pdp1_plot(device->machine, x, y);
974974
975975   /* light pen 32 support */
976976   state->io_status &= ~io_st_pen;
src/mess/machine/tx0.c
r10163r10164
394394   ac = cpu_get_reg(device, TX0_AC);
395395   x = ac >> 9;
396396   y = ac & 0777;
397   tx0_plot(x, y);
397   tx0_plot(device->machine, x, y);
398398
399399   timer_adjust_oneshot(state->dis_timer, ATTOTIME_IN_USEC(50), 0);
400400}
src/mess/video/pdp1.c
r10163r10164
6565
6666   bitmap_fill(state->typewriter_bitmap, &typewriter_bitmap_bounds, pen_typewriter_bg);
6767
68   /* initialize CRT */
69   video_start_crt(machine, pen_crt_num_levels, crt_window_offset_x, crt_window_offset_y, crt_window_width, crt_window_height);
68   state->crt = machine->device("crt");
7069}
7170
7271
72VIDEO_EOF( pdp1 )
73{
74   pdp1_state *state = machine->driver_data<pdp1_state>();
75
76   crt_eof(state->crt);
77}
78
7379/*
7480    schedule a pixel to be plotted
7581*/
76void pdp1_plot(int x, int y)
82void pdp1_plot(running_machine *machine, int x, int y)
7783{
84   pdp1_state *state = machine->driver_data<pdp1_state>();
7885   /* compute pixel coordinates and plot */
7986   x = x*crt_window_width/01777;
8087   y = y*crt_window_height/01777;
81   crt_plot(x, y);
88   crt_plot(state->crt, x, y);
8289}
8390
8491
r10163r10164
8996{
9097   pdp1_state *state = screen->machine->driver_data<pdp1_state>();
9198   pdp1_erase_lightpen(state, bitmap);
92   VIDEO_UPDATE_CALL(crt);
99   crt_update(state->crt, bitmap);
93100   pdp1_draw_lightpen(state, bitmap);
94101
95102   pdp1_draw_panel(screen->machine, state->panel_bitmap);
src/mess/video/saa505x.c
r10163r10164
33653365};
33663366
33673367
3368static int teletext_data;
3369static int teletext_LOSE;
3368typedef struct
3369{
3370   int data;
3371   int lose;
33703372
3371static const char *tt_lookup;
3372static const char *tt_graphics;
3373static int tt_colour;
3374static int tt_rcolour;
3375static int tt_bgcolour=0;
3376static int tt_start_line=0;
3377static int tt_double_height=0;
3378static int tt_double_height_set=0;
3379static int tt_double_height_offset=0;
3380static int tt_linecount=0;
3381static int tt_flash=0;
3382static int tt_holdgraphics=0;
3383static int tt_lastcode=0;
3373   const char *lookup;
3374   const char *graphics;
3375   int colour;
3376   int rcolour;
3377   int bgcolour;
3378   int start_line;
3379   int double_height;
3380   int double_height_set;
3381   int double_height_offset;
3382   int linecount;
3383   int flash;
3384   int holdgraphics;
3385   int lastcode;
33843386
3385static int tt_frame_count=0;
3387   int frame_count;
3388   const saa505x_interface *intf;
3389} teletext_t;
33863390
3387// local copy of the 6845 external procedure calls
3388static struct saa505x_interface saa505x_calls;
33893391
3392INLINE teletext_t *get_safe_token( device_t *device )
3393{
3394   assert(device != NULL);
3395   assert(device->type() == SAA505X);
33903396
3391void saa505x_config(const struct saa505x_interface *intf)
3397   return (teletext_t *)downcast<legacy_device_base *>(device)->token();
3398}
3399
3400static DEVICE_START( saa505x )
33923401{
3393   tt_lookup=teletext_saa5050_characters;
3394   tt_graphics=teletext_graphics;
3395   tt_colour=7;
3396   saa505x_calls.out_Pixel_func=*intf->out_Pixel_func;
3402   teletext_t *tt = get_safe_token(device);
3403   tt->lookup=teletext_saa5050_characters;
3404   tt->graphics=teletext_graphics;
3405   tt->colour=7;
3406   tt->intf = (const saa505x_interface *)device->baseconfig().static_config();
33973407}
33983408
3409DEVICE_GET_INFO( saa505x )
3410{
3411   switch (state)
3412   {
3413      /* --- the following bits of info are returned as 64-bit signed integers --- */
3414      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(teletext_t);               break;
33993415
3416      /* --- the following bits of info are returned as pointers to data or functions --- */
3417      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(saa505x);      break;
34003418
3401void teletext_data_w(int offset, int data)
3419      /* --- the following bits of info are returned as NULL-terminated strings --- */
3420      case DEVINFO_STR_NAME:                     strcpy(info->s, "SAA505x Video");               break;
3421      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "SAA505x Video");               break;
3422      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                     break;
3423      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                  break;
3424      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright MESS Team");         break;
3425   }
3426}
3427
3428DEFINE_LEGACY_DEVICE(SAA505X, saa505x);
3429
3430void teletext_data_w(device_t *device, int offset, int data)
34023431{
3403   teletext_data=data & 0x7f;
3432   teletext_t *tt = get_safe_token(device);
3433   tt->data=data & 0x7f;
34043434}
34053435
3406void teletext_DEW(void)
3436void teletext_DEW(device_t *device)
34073437{
3408   tt_linecount=9;
3409   tt_double_height=0;
3410   tt_double_height_set=0;
3411   tt_double_height_offset=0;
3412   tt_frame_count=(tt_frame_count+1)%50;
3438   teletext_t *tt = get_safe_token(device);
3439   tt->linecount=9;
3440   tt->double_height=0;
3441   tt->double_height_set=0;
3442   tt->double_height_offset=0;
3443   tt->frame_count=(tt->frame_count+1)%50;
34133444}
34143445
3415void teletext_LOSE_w(int offset, int data)
3446void teletext_LOSE_w(device_t *device, int offset, int data)
34163447{
3417   if ((data)&&(!teletext_LOSE))
3448   teletext_t *tt = get_safe_token(device);
3449
3450   if ((data)&&(!tt->lose))
34183451   {
34193452
3420      tt_lookup=teletext_saa5050_characters;
3421      tt_colour=7;
3422      tt_bgcolour=0;
3423      tt_graphics=teletext_graphics;
3424      tt_linecount=(tt_linecount+1)%10;
3425      tt_start_line=0;
3426      tt_double_height=0;
3427      tt_flash=0;
3428      tt_holdgraphics=0;
3429      tt_lastcode=0x20;
3453      tt->lookup=teletext_saa5050_characters;
3454      tt->colour=7;
3455      tt->bgcolour=0;
3456      tt->graphics=teletext_graphics;
3457      tt->linecount=(tt->linecount+1)%10;
3458      tt->start_line=0;
3459      tt->double_height=0;
3460      tt->flash=0;
3461      tt->holdgraphics=0;
3462      tt->lastcode=0x20;
34303463
34313464      // only check the double height stuff if at the first row of a new line
3432      if (!tt_linecount)
3465      if (!tt->linecount)
34333466      {
3434         tt_double_height_offset=((!tt_double_height_set)||tt_double_height_offset)?0:10;
3435         tt_double_height_set=0;
3467         tt->double_height_offset=((!tt->double_height_set)||tt->double_height_offset)?0:10;
3468         tt->double_height_set=0;
34363469      }
34373470
34383471   }
34393472
3440   teletext_LOSE=data;
3473   tt->lose=data;
34413474}
34423475
34433476
3444void teletext_F1(running_machine *machine)
3477void teletext_F1(device_t *device)
34453478{
3479   teletext_t *tt = get_safe_token(device);
34463480   int sc1;
34473481   int code;
3448   code=teletext_data;
3482   code=tt->data;
34493483
34503484   switch (code)
34513485   {
r10163r10164
34533487
34543488      case 0x01: case 0x02: case 0x03: case 0x04:
34553489      case 0x05: case 0x06: case 0x07:
3456         tt_lookup=teletext_saa5050_characters;
3457         tt_colour=code;
3490         tt->lookup=teletext_saa5050_characters;
3491         tt->colour=code;
34583492         break;
34593493
34603494
34613495      case 0x08:  // Flash
3462         tt_flash=tt_frame_count<20?1:0;
3496         tt->flash=tt->frame_count<20?1:0;
34633497         break;
34643498      case 0x09:  // Steady
3465         tt_flash=0;
3499         tt->flash=0;
34663500         break;
34673501
34683502      // 0x0a     End Box    NOT USED
34693503      // 0x0b     Start Box  NOT USED
34703504
34713505      case 0x0c:   // Normal Height
3472         tt_double_height=0;
3473         tt_start_line=0;
3506         tt->double_height=0;
3507         tt->start_line=0;
34743508         break;
34753509      case 0x0d:   // Double Height
3476         tt_double_height=1;
3477         tt_double_height_set=1;
3478         tt_start_line=tt_double_height_offset;
3510         tt->double_height=1;
3511         tt->double_height_set=1;
3512         tt->start_line=tt->double_height_offset;
34793513         break;
34803514
34813515      // 0x0e     S0         NOT USED
r10163r10164
34843518
34853519      case 0x11: case 0x12: case 0x13: case 0x14:
34863520      case 0x15: case 0x16: case 0x17:
3487         tt_lookup=tt_graphics;
3488         tt_colour=code&0x07;
3521         tt->lookup=tt->graphics;
3522         tt->colour=code&0x07;
34893523         break;
34903524
34913525      // 0x18     Conceal Display
34923526
34933527      case 0x19:   //  Contiguois Graphics
3494         tt_graphics=teletext_graphics;
3495         if (tt_lookup!=teletext_saa5050_characters)
3496            tt_lookup=tt_graphics;
3528         tt->graphics=teletext_graphics;
3529         if (tt->lookup!=teletext_saa5050_characters)
3530            tt->lookup=tt->graphics;
34973531         break;
34983532      case 0x1a:   //  Separated Graphics
3499         tt_graphics=teletext_separated_graphics;
3500         if (tt_lookup!=teletext_saa5050_characters)
3501            tt_lookup=tt_graphics;
3533         tt->graphics=teletext_separated_graphics;
3534         if (tt->lookup!=teletext_saa5050_characters)
3535            tt->lookup=tt->graphics;
35023536         break;
35033537
35043538      // 0x1b     ESC        NOT USED
35053539
35063540      case 0x1c:  //  Black Background
3507         tt_bgcolour=0;
3541         tt->bgcolour=0;
35083542         break;
35093543      case 0x1d:  //  New Background
3510         tt_bgcolour=tt_colour;
3544         tt->bgcolour=tt->colour;
35113545         break;
35123546
35133547      case 0x1e:
3514         tt_holdgraphics=1;
3548         tt->holdgraphics=1;
35153549         break;
35163550
35173551      case 0x1f:
3518         tt_holdgraphics=0;
3552         tt->holdgraphics=0;
35193553         break;
35203554   }
35213555
3522   if (teletext_LOSE)
3556   if (tt->lose)
35233557   {
3524      tt_rcolour=tt_flash?tt_bgcolour:tt_colour;
3558      tt->rcolour=tt->flash?tt->bgcolour:tt->colour;
35253559      if (code<0x20) {
3526         if (tt_holdgraphics) {
3527            code=tt_lastcode;
3560         if (tt->holdgraphics) {
3561            code=tt->lastcode;
35283562         } else {
35293563            code=0x20;
35303564         }
35313565      }
3532      tt_lastcode=code;
3533      code=(code-0x20)*60+(6*((tt_linecount+tt_start_line)>>tt_double_height));
3566      tt->lastcode=code;
3567      code=(code-0x20)*60+(6*((tt->linecount+tt->start_line)>>tt->double_height));
35343568      for(sc1=0;sc1<6;sc1++)
35353569      {
3536         (saa505x_calls.out_Pixel_func)(machine,0,tt_lookup[code++]?tt_rcolour:tt_bgcolour);
3570         (tt->intf->out_Pixel_func)(device,0,tt->lookup[code++]?tt->rcolour:tt->bgcolour);
35373571      }
35383572   } else {
35393573
3540      (saa505x_calls.out_Pixel_func)(machine,0,0);
3541      (saa505x_calls.out_Pixel_func)(machine,0,0);
3542      (saa505x_calls.out_Pixel_func)(machine,0,0);
3543      (saa505x_calls.out_Pixel_func)(machine,0,0);
3544      (saa505x_calls.out_Pixel_func)(machine,0,0);
3545      (saa505x_calls.out_Pixel_func)(machine,0,0);
3574      (tt->intf->out_Pixel_func)(device,0,0);
3575      (tt->intf->out_Pixel_func)(device,0,0);
3576      (tt->intf->out_Pixel_func)(device,0,0);
3577      (tt->intf->out_Pixel_func)(device,0,0);
3578      (tt->intf->out_Pixel_func)(device,0,0);
3579      (tt->intf->out_Pixel_func)(device,0,0);
35463580   }
35473581}
src/mess/video/saa505x.h
r10163r10164
1
21/************************************************************************
32    saa505x
43
r10163r10164
109 ************************************************************************/
1110
1211
13struct saa505x_interface
12typedef struct _saa505x_interface saa505x_interface;
13struct _saa505x_interface
1414{
15   void (*out_Pixel_func)(running_machine *machine, int offset, int data);
15   void (*out_Pixel_func)(device_t *device, int offset, int data);
1616};
1717
18void saa505x_config(const struct saa505x_interface *intf);
18void teletext_DEW(device_t *device);
19void teletext_LOSE_w(device_t *device, int offset, int data);
20void teletext_data_w(device_t *device, int offset, int data);
21void teletext_F1(device_t *device);
1922
23DECLARE_LEGACY_DEVICE(SAA505X, saa505x);
2024
21void teletext_DEW(void);
22void teletext_LOSE_w(int offset, int data);
23
24void teletext_data_w(int offset, int data);
25void teletext_F1(running_machine *machine);
26
25#define MCFG_SAA505X_VIDEO_ADD(_tag, _intf) \
26   MCFG_DEVICE_ADD(_tag, SAA505X, 0) \
27   MCFG_DEVICE_CONFIG(_intf)
src/mess/video/tx0.c
r10163r10164
5252
5353   bitmap_fill(state->typewriter_bitmap, &typewriter_bitmap_bounds, pen_typewriter_bg);
5454
55   /* initialize CRT */
56   video_start_crt(machine, pen_crt_num_levels, crt_window_offset_x, crt_window_offset_y, crt_window_width, crt_window_height);
55   state->crt = machine->device("crt");
5756}
5857
5958
59VIDEO_EOF( tx0 )
60{
61   tx0_state *state = machine->driver_data<tx0_state>();
62
63   crt_eof(state->crt);
64}
65
66
6067/*
6168    schedule a pixel to be plotted
6269*/
63void tx0_plot(int x, int y)
70void tx0_plot(running_machine *machine, int x, int y)
6471{
72   tx0_state *state = machine->driver_data<tx0_state>();
73
6574   /* compute pixel coordinates and plot */
6675   x = x*crt_window_width/0777;
6776   y = y*crt_window_height/0777;
68   crt_plot(x, y);
77   crt_plot(state->crt, x, y);
6978}
7079
7180
r10163r10164
7584VIDEO_UPDATE( tx0 )
7685{
7786   tx0_state *state = screen->machine->driver_data<tx0_state>();
78   VIDEO_UPDATE_CALL(crt);
87   crt_update(state->crt, bitmap);
7988
8089   tx0_draw_panel(screen->machine, state->panel_bitmap);
8190   copybitmap(bitmap, state->panel_bitmap, 0, 0, panel_window_offset_x, panel_window_offset_y, cliprect);
src/mess/video/crt.c
r10163r10164
3939   int next;         /* index of next pixel in list */
4040} point;
4141
42static point *list;      /* array of (crt_window_width*crt_window_height) point */
43static int *list_head;   /* head of the list of lit pixels (index in the array) */
44                     /* keep a separate list for each display line (makes the video code slightly faster) */
45
46static int decay_counter;   /* incremented each frame (tells for how many frames the CRT has decayed between two screen refresh) */
47
48/* CRT window */
49static int window_offset_x, window_offset_y, window_width, window_height;
50
5142enum
5243{
5344   intensity_pixel_not_in_list = -1   /* special value that tells that the node is not in list */
5445};
55static int num_intensity_levels;
56#define intensity_new_pixel num_intensity_levels
5746
47typedef struct
48{
49   point *list;      /* array of (crt_window_width*crt_window_height) point */
50   int *list_head;   /* head of the list of lit pixels (index in the array) */
51                     /* keep a separate list for each display line (makes the video code slightly faster) */
5852
59/*
60    video_start_crt
53   int decay_counter;   /* incremented each frame (tells for how many frames the CRT has decayed between two screen refresh) */
6154
62    video init
63*/
64int video_start_crt(running_machine *machine, int num_levels, int offset_x, int offset_y, int width, int height)
55   /* CRT window */
56   int num_intensity_levels;
57   int window_offset_x, window_offset_y;
58   int window_width, window_height;
59} crt_t;
60
61
62INLINE crt_t *get_safe_token(device_t *device)
6563{
64   assert(device != NULL);
65   assert(device->type() == CRT);
66
67   return (crt_t *)downcast<legacy_device_base *>(device)->token();
68}
69
70static DEVICE_START( crt )
71{
72   crt_t *crt = get_safe_token(device);
73   const crt_interface *intf = (const crt_interface *)device->baseconfig().static_config();
74   int width = intf->width;
75   int height = intf->height;
6676   int i;
6777
68   num_intensity_levels = num_levels;
69   window_offset_x = offset_x;
70   window_offset_y = offset_y;
71   window_width = width;
72   window_height = height;
78   crt->num_intensity_levels = intf->num_levels;
79   crt->window_offset_x = intf->offset_x;
80   crt->window_offset_y = intf->offset_y;
81   crt->window_width = width;
82   crt->window_height = height;
7383
7484   /* alloc the arrays */
75   list = auto_alloc_array(machine, point, window_width * window_height);
85   crt->list = auto_alloc_array(device->machine, point, width * height);
7686
77   list_head = auto_alloc_array(machine, int, window_height);
87   crt->list_head = auto_alloc_array(device->machine, int, height);
7888
7989   /* fill with black and set up list as empty */
80   for (i=0; i<(window_width * window_height); i++)
90   for (i=0; i<(width * height); i++)
8191   {
82      list[i].intensity = intensity_pixel_not_in_list;
92      crt->list[i].intensity = intensity_pixel_not_in_list;
8393   }
8494
85   for (i=0; i<window_height; i++)
86      list_head[i] = -1;
95   for (i=0; i<height; i++)
96      crt->list_head[i] = -1;
8797
88   decay_counter = 0;
98   crt->decay_counter = 0;
99}
89100
90   return 0;
101
102DEVICE_GET_INFO( crt )
103{
104   switch (state)
105   {
106      /* --- the following bits of info are returned as 64-bit signed integers --- */
107      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(crt_t);               break;
108
109      /* --- the following bits of info are returned as pointers to data or functions --- */
110      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(crt);      break;
111
112      /* --- the following bits of info are returned as NULL-terminated strings --- */
113      case DEVINFO_STR_NAME:                     strcpy(info->s, "CRT Video");               break;
114      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "CRT Video");               break;
115      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                     break;
116      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                  break;
117      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright MESS Team");         break;
118   }
91119}
92120
121DEFINE_LEGACY_DEVICE(CRT, crt);
93122
94123/*
95124    crt_plot
96125
97126    schedule a pixel to be plotted
98127*/
99void crt_plot(int x, int y)
128void crt_plot(device_t *device, int x, int y)
100129{
130   crt_t *crt = get_safe_token(device);
101131   point *node;
102132   int list_index;
103133
104134   /* compute pixel coordinates */
105135   if (x<0) x=0;
106136   if (y<0) y=0;
107   if ((x>(window_width-1)) || ((y>window_height-1)))
137   if ((x>(crt->window_width-1)) || ((y>crt->window_height-1)))
108138      return;
109   y = (window_height-1) - y;
139   y = (crt->window_height-1) - y;
110140
111141   /* find entry in list */
112   list_index = x + y*window_width;
142   list_index = x + y*crt->window_width;
113143
114   node = & list[list_index];
144   node = &crt->list[list_index];
115145
116146   if (node->intensity == intensity_pixel_not_in_list)
117147   {   /* insert node in list if it is not in it */
118      node->next = list_head[y];
119      list_head[y] = list_index;
148      node->next = crt->list_head[y];
149      crt->list_head[y] = list_index;
120150   }
121151   /* set intensity */
122   node->intensity = intensity_new_pixel;
152   node->intensity = crt->num_intensity_levels;
123153}
124154
125155
126156/*
127    VIDEO_EOF( crt )
157    crt_eof
128158
129159    keep track of time
130160*/
131VIDEO_EOF( crt )
161void crt_eof(device_t *device)
132162{
133   decay_counter++;
163   crt_t *crt = get_safe_token(device);
164   crt->decay_counter++;
134165}
135166
136167
137168/*
138    VIDEO_UPDATE( crt )
169    crt_update
139170
140171    update the bitmap
141172*/
142VIDEO_UPDATE( crt )
173void crt_update(device_t *device, bitmap_t *bitmap)
143174{
175   crt_t *crt = get_safe_token(device);
144176   int i, p_i;
145177   int y;
146178
147   //if (decay_counter)
179   //if (crt->decay_counter)
148180   {
149181      /* some time has elapsed: let's update the screen */
150      for (y=0; y<window_height; y++)
182      for (y=0; y<crt->window_height; y++)
151183      {
152         UINT16 *line = BITMAP_ADDR16(bitmap, y+window_offset_y, 0);
184         UINT16 *line = BITMAP_ADDR16(bitmap, y+crt->window_offset_y, 0);
153185
154186         p_i = -1;
155187
156         for (i=list_head[y]; (i != -1); i=list[i].next)
188         for (i=crt->list_head[y]; (i != -1); i=crt->list[i].next)
157189         {
158            point *node = & list[i];
159            int x = (i % window_width) + window_offset_x;
190            point *node = &crt->list[i];
191            int x = (i % crt->window_width) + crt->window_offset_x;
160192
161            if (node->intensity == intensity_new_pixel)
193            if (node->intensity == crt->num_intensity_levels)
162194               /* new pixel: set to max intensity */
163               node->intensity = num_intensity_levels-1;
195               node->intensity = crt->num_intensity_levels-1;
164196            else
165197            {
166198               /* otherwise, apply intensity decay */
167               node->intensity -= decay_counter;
199               node->intensity -= crt->decay_counter;
168200               if (node->intensity < 0)
169201                  node->intensity = 0;
170202            }
171203
172204            /* draw pixel on screen */
173            //plot_pixel(bitmap, x, y+crt_window_offset_y, node->intensity);
205            //plot_pixel(bitmap, x, y+crt->window_offset_y, node->intensity);
174206            line[x] = node->intensity;
175207
176208            if (node->intensity != 0)
r10163r10164
179211            {   /* delete current node */
180212               node->intensity = intensity_pixel_not_in_list;
181213               if (p_i != -1)
182                  list[p_i].next = node->next;
214                  crt->list[p_i].next = node->next;
183215               else
184                  list_head[y] = node->next;
216                  crt->list_head[y] = node->next;
185217            }
186218         }
187219      }
188220
189      decay_counter = 0;
221      crt->decay_counter = 0;
190222   }
191
192   return 0;
193223}
src/mess/video/crt.h
r10163r10164
1212
1313/*----------- defined in video/crt.c -----------*/
1414
15int video_start_crt(running_machine *machine, int num_levels, int offset_x, int offset_y, int width, int height);
16void crt_plot(int x, int y);
17VIDEO_EOF( crt );
18VIDEO_UPDATE( crt );
15typedef struct _crt_interface crt_interface;
16struct _crt_interface
17{
18   int num_levels;
19   int offset_x, offset_y;
20   int width, height;
21};
1922
23void crt_plot(device_t *device, int x, int y);
24void crt_eof(device_t *device);
25void crt_update(device_t *device, bitmap_t *bitmap);
2026
27DECLARE_LEGACY_DEVICE(CRT, crt);
28
29#define MCFG_CRT_ADD(_tag, _interface) \
30   MCFG_DEVICE_ADD(_tag, CRT, 0) \
31   MCFG_DEVICE_CONFIG(_interface)
32
2133#endif /* CRT_H_ */
src/mess/video/bbc.c
r10163r10164
1717static void BBC_draw_hi_res(running_machine* machine);
1818static void BBC_draw_teletext(running_machine *machine);
1919
20static void BBC_draw_RGB_in(running_machine *machine, int offset,int data);
21
2220/************************************************************************
2321 * video_refresh flag is used in optimising the screen redrawing
2422 * it is set whenever a 6845 or VideoULA registers are change.
r10163r10164
178176
179177
180178
181static const struct saa505x_interface BBCsaa5050 =
182{
183   BBC_draw_RGB_in,
184};
185
186179static void BBC_draw_teletext(running_machine *machine)
187180{
188181   bbc_state *state = machine->driver_data<bbc_state>();
r10163r10164
191184   //Teletext Latch bit 6 is only passed onto bits 6 on the Teletext chip if DE is true
192185   //Teletext Latch bit 7 goes to LOSE on the Teletext chip
193186
194    int meml;
187   int meml;
195188
196   teletext_LOSE_w(0,(state->Teletext_Latch>>7)&1);
189   teletext_LOSE_w(state->saa505x, 0, (state->Teletext_Latch>>7)&1);
197190
198   teletext_F1(machine);
191   teletext_F1(state->saa505x);
199192
200   teletext_data_w(0,(state->Teletext_Latch&0x3f)|((state->Teletext_Latch&0x40)|(state->BBC_DE?0:0x40)));
193   teletext_data_w(state->saa505x, 0, (state->Teletext_Latch&0x3f)|((state->Teletext_Latch&0x40)|(state->BBC_DE?0:0x40)));
201194
202195   meml=m6845_memory_address_r(0);
203196
r10163r10164
389382
390383// RGB input to the Video ULA from the Teletext IC
391384// Just pass on the output at the correct pixel size.
392static void BBC_draw_RGB_in(running_machine *machine, int offset,int data)
385void bbc_draw_RGB_in(device_t *device, int offset,int data)
393386{
394   bbc_state *state = machine->driver_data<bbc_state>();
387   bbc_state *state = device->machine->driver_data<bbc_state>();
395388   BBC_ula_drawpixel(state, data, state->emulation_pixels_per_real_pixel);
396389}
397390
r10163r10164
469462
470463      state->BBC_display = state->BBC_display_left + state->x_screen_offset;
471464
472      teletext_DEW();
465      teletext_DEW(state->saa505x);
473466   }
474467   state->BBC_VSync=data;
475468
r10163r10164
654647
655648   set_pixel_lookup(state);
656649   m6845_config(&BBC6845);
657   saa505x_config(&BBCsaa5050);
650   state->saa505x = machine->device("saa505x");
658651
659652   state->BBC_Video_RAM = machine->region("maincpu")->base();
660653   state->vidmem_RAM = state->vidmem;
src/mess/includes/pdp1.h
r10163r10164
254254   lightpen_t previous_lightpen_state;
255255   int pos;
256256   int case_shift;
257   device_t *crt;
257258};
258259
259260
r10163r10164
282283/*----------- defined in video/pdp1.c -----------*/
283284
284285VIDEO_START( pdp1 );
286VIDEO_EOF( pdp1 );
285287VIDEO_UPDATE( pdp1 );
286288
287void pdp1_plot(int x, int y);
289void pdp1_plot(running_machine *machine, int x, int y);
288290void pdp1_typewriter_drawchar(running_machine *machine, int character);
289291void pdp1_update_lightpen_state(running_machine *machine, const lightpen_t *new_state);
290292
src/mess/includes/tx0.h
r10163r10164
144144   bitmap_t *typewriter_bitmap;
145145   int pos;
146146   int case_shift;
147   device_t *crt;
147148};
148149
149150
r10163r10164
176177/*----------- defined in video/tx0.c -----------*/
177178
178179VIDEO_START( tx0 );
179void tx0_plot(int x, int y);
180VIDEO_EOF( tx0 );
180181VIDEO_UPDATE( tx0 );
182
183void tx0_plot(running_machine *machine, int x, int y);
181184void tx0_typewriter_drawchar(running_machine *machine, int character);
182185
183186/* defines for each bit and mask in input port "CSW" */
src/mess/includes/bbc.h
r10163r10164
8989   int BBC_VSync;
9090   int BBC_Character_Row;
9191   int BBC_DE;
92   device_t *saa505x;
9293   int Teletext_Latch_Input_D7;
9394   int Teletext_Latch;
9495   int VideoULA_DE;
r10163r10164
202203VIDEO_START( bbcm );
203204VIDEO_UPDATE( bbc );
204205
206void bbc_draw_RGB_in(device_t *device, int offset, int data);
205207void bbc_set_video_memory_lookups(running_machine *machine, int ramsize);
206208void bbc_frameclock(running_machine *machine);
207209void bbc_setscreenstart(running_machine *machine, int b4, int b5);
src/mess/drivers/pdp1.c
r10163r10164
346346}
347347
348348
349static const crt_interface pdp1_crt_interface =
350{
351   pen_crt_num_levels,
352   crt_window_offset_x, crt_window_offset_y,
353   crt_window_width, crt_window_height
354};
355
349356static MACHINE_CONFIG_START( pdp1, pdp1_state )
350357
351358   /* basic machine hardware */
r10163r10164
365372   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
366373   MCFG_SCREEN_SIZE(virtual_width, virtual_height)
367374   MCFG_SCREEN_VISIBLE_AREA(0, virtual_width-1, 0, virtual_height-1)
375   MCFG_CRT_ADD( "crt", pdp1_crt_interface )
368376
369377   MCFG_GFXDECODE(pdp1)
370378   MCFG_PALETTE_LENGTH(pen_crt_num_levels + sizeof(pdp1_colors) / 3 + sizeof(pdp1_palette))
371379
372380   MCFG_PALETTE_INIT(pdp1)
373381   MCFG_VIDEO_START(pdp1)
374   MCFG_VIDEO_EOF(crt)
382   MCFG_VIDEO_EOF(pdp1)
375383   MCFG_VIDEO_UPDATE(pdp1)
376384MACHINE_CONFIG_END
377385
src/mess/drivers/tx0.c
r10163r10164
316316   tx0_io_reset_callback
317317};
318318
319static const crt_interface tx0_crt_interface =
320{
321   pen_crt_num_levels,
322   crt_window_offset_x, crt_window_offset_y,
323   crt_window_width, crt_window_height
324};
319325
320326static MACHINE_CONFIG_START( tx0_64kw, tx0_state )
321327   /* basic machine hardware */
r10163r10164
336342   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
337343   MCFG_SCREEN_SIZE(virtual_width, virtual_height)
338344   MCFG_SCREEN_VISIBLE_AREA(0, virtual_width-1, 0, virtual_height-1)
345   MCFG_CRT_ADD( "crt", tx0_crt_interface )
339346
340347   MCFG_GFXDECODE(tx0)
341348   MCFG_PALETTE_LENGTH(pen_crt_num_levels + sizeof(tx0_colors) / 3 + sizeof(tx0_palette))
342349
343350   MCFG_PALETTE_INIT(tx0)
344351   MCFG_VIDEO_START(tx0)
345   MCFG_VIDEO_EOF(crt)
352   MCFG_VIDEO_EOF(tx0)
346353   MCFG_VIDEO_UPDATE(tx0)
347354MACHINE_CONFIG_END
348355
src/mess/drivers/bbc.c
r10163r10164
1414#include "cpu/m6502/m6502.h"
1515#include "machine/6522via.h"
1616#include "machine/mc146818.h"
17#include "includes/bbc.h"
1817#include "machine/upd7002.h"
1918#include "machine/ctronics.h"
2019#include "imagedev/flopdrv.h"
r10163r10164
2423#include "formats/uef_cas.h"
2524#include "formats/csw_cas.h"
2625#include "sound/sn76496.h"
26#include "video/saa505x.h"
27#include "includes/bbc.h"
2728
2829
2930/******************************************************************************
r10163r10164
781782   NULL
782783};
783784
785static const saa505x_interface bbc_saa505x_intf =
786{
787   bbc_draw_RGB_in,
788};
789
784790static MACHINE_CONFIG_FRAGMENT( bbc_cartslot )
785791   MCFG_CARTSLOT_ADD("cart1")
786792   MCFG_CARTSLOT_EXTENSION_LIST("rom")
r10163r10164
823829   MCFG_SCREEN_VISIBLE_AREA(0,800-1,0,300-1)
824830   MCFG_PALETTE_LENGTH(16)
825831   MCFG_PALETTE_INIT(bbc)
832   MCFG_SAA505X_VIDEO_ADD("saa505x", bbc_saa505x_intf)
826833
827834   MCFG_VIDEO_START(bbca)
828835   MCFG_VIDEO_UPDATE(bbc)
r10163r10164
914921   MCFG_SCREEN_VISIBLE_AREA(0,800-1,0,300-1)
915922   MCFG_PALETTE_LENGTH(16)
916923   MCFG_PALETTE_INIT(bbc)
924   MCFG_SAA505X_VIDEO_ADD("saa505x", bbc_saa505x_intf)
917925
918926   MCFG_VIDEO_START(bbcm)
919927   MCFG_VIDEO_UPDATE(bbc)
docs/messnew.txt
r10163r10164
2323----------------------
2424- [ADAM] Added dumps of the internal M6801 ROMs. [KevinP]
2525
26- [BBC] Made the SAA505x implementation a device.  [Atari Ace]
27
2628- [GBA] Fixed EEPROM detection for "Banjo-Kazooie" and "Custom Robo GX".
2729  [Tim Schuerewegen]
2830
r10163r10164
3941- [GBA] Allow reading of the BLDALPHA register. This fixes the lockup in
4042  "Donkey Kong Country". [Tim Schuerewegen]
4143
44- [PDP1] Made the CRT implementation a device.  [Atari Ace]
45
4246- [PIPPIN] Added pre release rom
4347
4448- [PV1000] 4 new cartridge dumps for the software list.  [anondumper]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team