/[gxemul]/trunk/src/devices/dev_kn01.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_kn01.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_kn01.c,v 1.10 2007/01/05 15:20:06 debug Exp $   *  $Id: dev_kn01.c,v 1.11 2007/06/15 19:11:15 debug Exp $
29   *     *
30   *  KN01 stuff ("PMAX", DECstation type 1); CSR (System Control Register)   *  COMMENT: DEC KN01 ("PMAX", DECstation type 1) control register and VDAC
  *  and VDAC.  
31   *   *
32   *  TODO: The CSR isn't really complete.   *  TODO: The CSR isn't really complete.
33   *   *
# Line 236  DEVICE_ACCESS(vdac) Line 235  DEVICE_ACCESS(vdac)
235  void dev_vdac_init(struct memory *mem, uint64_t baseaddr,  void dev_vdac_init(struct memory *mem, uint64_t baseaddr,
236          unsigned char *rgb_palette, int color_fb_flag)          unsigned char *rgb_palette, int color_fb_flag)
237  {  {
238          struct vdac_data *d = malloc(sizeof(struct vdac_data));          struct vdac_data *d;
239          if (d == NULL) {  
240                  fprintf(stderr, "out of memory\n");          CHECK_ALLOCATION(d = malloc(sizeof(struct vdac_data)));
                 exit(1);  
         }  
241          memset(d, 0, sizeof(struct vdac_data));          memset(d, 0, sizeof(struct vdac_data));
242    
243          d->rgb_palette   = rgb_palette;          d->rgb_palette   = rgb_palette;
244          d->color_fb_flag = color_fb_flag;          d->color_fb_flag = color_fb_flag;
245    
# Line 255  void dev_vdac_init(struct memory *mem, u Line 253  void dev_vdac_init(struct memory *mem, u
253   */   */
254  void dev_kn01_init(struct memory *mem, uint64_t baseaddr, int color_fb)  void dev_kn01_init(struct memory *mem, uint64_t baseaddr, int color_fb)
255  {  {
256          struct kn01_data *d = malloc(sizeof(struct kn01_data));          struct kn01_data *d;
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
257    
258            CHECK_ALLOCATION(d = malloc(sizeof(struct kn01_data)));
259          memset(d, 0, sizeof(struct kn01_data));          memset(d, 0, sizeof(struct kn01_data));
         d->color_fb = color_fb;  
260    
261            d->color_fb = color_fb;
262          d->csr = 0;          d->csr = 0;
263          d->csr |= (color_fb? 0 : KN01_CSR_MONO);          d->csr |= (color_fb? 0 : KN01_CSR_MONO);
264    

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26