Subject: cirrus-3 Spectrum 2MB patch
To: amiga-dev <amiga-dev@NetBSD.ORG>
From: Sascha Groening <groening@fmi.uni-passau.de>
List: amiga-dev
Date: 02/13/1995 14:30:06
This is a patch to get Spectrum 2MB cards running under NetBSD 1.0.
You should get a message like 
grfcl0 attached to Spectrum 
on startup.
Please tell me if this works for you, too.

CD to /src/sys/arch/amiga
and apply the patch with 
patch < patch2MB


      greetings 
					  Sascha Groening
					  groening@fmi.uni-passau.de

---------------- CUT here ---------------------
*** dev/grf_cl.c.orig	Mon Feb 13 21:18:59 1995
--- dev/grf_cl.c	Mon Feb 13 21:25:25 1995
***************
*** 1865,1904 ****
  
                          }
                          break;
!                 case 2193:
!                 /* numbers were reversed.. Ezy */
!                 /* Spectrum */
!                         switch (zap->prodid) {
!                         case 1:
!                                 if((cl_fbsize=zap->size)< 1024*1024){
!                                         printf("grf_cl: too little display memory\n");
!                                         return(0);
!                                 }
!                                 if (cl_regaddr == 0) {
!                                         printf("grf_cl: registers not found.\n");
!                                         return(0);
!                                 }
!         /* Ezy, why do this here? is zap->size incorrect? Are there Spectrum
! with 1MB avail? ill */
! 
!                                 cl_fbsize = 1024*1024*2;
!                                 cl_fbaddr = zap->va;    /* pa? */
!                                 break;
! 
!                         case 2:
!                                 cl_regaddr = zap->va;
!                                 cltype = SPECTRUM;
!                                 wakepass = 0x1f;
!                                 onpass = 0x4f;
!                                 offpass = 0x6f;
!                                 return(1);
!                                 break;
! 
!                         default:
!                                 return(0);
!                                 break;
!                         }
!                         break;
                  case 2195:
                  /* Piccolo */
      /* Added/changed by MiL */
--- 1865,1913 ----
  
                          }
                          break;
! 
!      case 2193:
!      /* numbers were reversed.. Ezy */
!      /* Spectrum */
!      switch (zap->prodid) {
! 
!            /* config memory */
!            case 1:
!                 if((cl_fbsize=zap->size)< 1024*1024){
!                      printf("grf_cl: too little display memory\n");
!                      return(0);
!                 }
! 
!                 /* Changed from 2MB->1MB      -SG- */
!                 /* Put a 1024*1024 here if you have 1MB Spectrum */
! 
!                 zap->size = cl_fbsize = 1024*1024*2;
! 
!                 /* needs to be mapped */
!                 /* this is the importent line */
! 
!                 zap->va = cl_fbaddr = (void *)zthreemap(zap->pa, zap->size);     /* va? */
!                 return(0);
! 
!            /* config registers */
!            case 2:
!                 cl_regaddr = zap->va;
!                 if (cl_regaddr == 0) {
!                     printf("grf_cl: registers not found.\n");
!                     return(0);
!                 }
!                 cltype = SPECTRUM;
!                 wakepass = 0x1f;
!                 onpass = 0x4f;
!                 offpass = 0x6f;
!                 break;
! 
!            default:
!                 return(0);
!                 break;
!            }
!      break;
! 
                  case 2195:
                  /* Piccolo */
      /* Added/changed by MiL */