[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aztec C



On Mar 23, 11:49 pm, "BluPhoenyx"
<bluphoe...@a2central.com.remove-11s8-this> wrote:
>   To: Bill Buckels
> Excellent archive and source of information regarding Aztec C. For those
> who wish them, there is a scan PDF of the Aztec doc's on the A2 Gmail
> account.
>
> It should be mentioned that Phade Software released their doc's and
> libraries as copyrighted freeware. While this is a technical distinction
> and allows free use they are still under copyright. I like the idea of
> html conversion. Wish I had thought of that when I acquired their
> release. :)
>

Yes, whatever were you thinking Mike:) and for me the manpages are
unusable (pointlessly complicated in this day and age really) so for a
few hours effort I thought foks like you would enjoy the html. I was
just doing my little bit and knew you'd probably see it if you were
still around.

> I have not read all the source and I'm curious about your use of
> auxiliary ram. Is it simply used for storage?
>

Why haven't you? <g> Anyway, yes. Well I guess I could have done more
but I was just trying to get the thing out the door in those days. The
kids needed food and Momma was only working part time. That was the
first marriage back then. Here's what it is: (some examples)

There is a lot more to this of course, and it didn't seem simple
then...

x--- snip ---x

#define PUT 0    /* action verbs for putimage */
#define GET 1    /* expand as required */
#define P_STIX  2
#define P_BLACK 3
#define P_WHITE 4
#define P_AND   5
#define P_XOR   6



/* emsputimage() */
/* handles screen manipulation of image fragments             */
/* both gets and puts and uses ems memory for the IO buffer   */
/* for screen puts other than memory moves a buffer is used   */

/* since a full screen stored in our .BOT format has a
   file size of 7680 bytes there is room in the upper ram bank
   to store 6 full screens (6x7680=46080 bytes) */


extern unsigned HB[];

emsputimage(emsarraybase,width,height,xorg,yorg,action)
unsigned emsarraybase;
int width,height,xorg,yorg,action;
{
   int ctr;
   char *ptr,*ptr2;
   int temp;
   /* the ems buffer starts above the 2nd page of text screen */
   /* in auxilliary memory */

   unsigned hitemp=emsarraybase+0x0C00;
   int bos=yorg+height;
   char tempbyte='\x80';
   char arrayname[40] ;

   if(action==P_WHITE)tempbyte='\xff';


   while(yorg<bos)
   {
     temp = HB[yorg];

     ptr = (char *)&arrayname[0];
     ptr2 = (char *)(temp+xorg);

     /* expand action verbs as required */
     switch(action)
     {
        case P_XOR  : /* reverse video */
                      auxtomain(hitemp,hitemp+width-1,&arrayname[0]);

                      for(ctr=0;ctr<width;ctr++)
                      {
                       *ptr2=(*ptr^0x7f);
                       *ptr2++;
                       *ptr++;
                       }
                       break;


                      /* bitwise ANDing the background... */
                      /* works best with white */
        case P_AND  :
                      auxtomain(hitemp,hitemp+width-1,&arrayname[0]);

                      for(ctr=0;ctr<width;ctr++)
                      {
                       *ptr2|=*ptr;
                       *ptr2++;
                       *ptr++;
                       }
                       break;

                      /* if the image byte is black don't erase the */
                      /* background                                 */
        case P_STIX :
                      auxtomain(hitemp,hitemp+width-1,&arrayname[0]);

                      for(ctr=0;ctr<width;ctr++)
                      {
                        tempbyte=*ptr++;
                        if(tempbyte=='\x80'||tempbyte=='\x00')*ptr2++;
                        else *ptr2++=tempbyte;
                        }
                      break;

                   /* clear an area the size of the image fragment */
                   /* to black or white */
        case P_BLACK:
        case P_WHITE:
                      for(ctr=0;ctr<width;ctr++)*ptr2+
+=tempbyte;break;


                  /* read each raster into ems */
        case GET:  maintoaux((temp+xorg),(temp+xorg+width-1),hitemp);
                   break;

        case PUT: /* read each raster to the screen */
        default :  auxtomain(hitemp,hitemp+width-1,(temp+xorg));
                   break;
     }
     yorg++;
     hitemp+=width;
     }
}

x--- snip ---x

/* the address of 2048 in main memory is used             */
/* for the ems signature which reserves 40 bytes          */
/* this is the first line of the text screen page 2       */
/* the ems buffer start is set to 0x0C00 in aux memory    */

/* this is the area directly above the secondary page of video ram
*/
/* the auxilliary memory map for the apple 2C indicates that areas
*/
/* below this have memory "holes" which are reserved or assigned even
*/
/* though zero page and the hardware stack finish at 0x200
*/

/* in Main Memory... */
/* a 4000 byte buffer is used above where we store the font   */
/* at 0x0C00+1096+24 =4192 as a temporary IO buffer           */
/* to transfer the data to the upper ram banks                */
/* this avoids text screen page 2 and is below the prodos load address
*/


#include <stdio.h>
#include <fcntl.h>
#include <prodos.h>
#include <sgtty.h>
#include <device.h>
#include <sysfunc.h>


/* loads a library file */
emslode(name,libsize)
char *name;
unsigned libsize;
{
   int fh;
   int emscheck();
   unsigned int i;
   unsigned packet, straggler;
   unsigned himem,lomem;

   /* don't load the library if it's too big...               */
   /* don't load the library if it's in high memory already   */
   /* step 1... get the signature... this is the library name */
   /* if the library is already in memory this will likely be there
*/
   /* when we exit we erase this to make sure. */

   /* step 2... compare and return -2 if it's already there */
   /* otherwise continue */

   if(libsize>46080)return -3;

   if(emscheck(name)!=0)return -2;

   if((fh = open(name,O_RDONLY,0xC3))==-1)
   {
    emsoff();
    return -1;
    }

   packet=    libsize/4000;         /* primary number of reads */
   straggler= libsize%4000;         /* remainder of reads      */

   himem = 0x0C00;
   lomem = 0x0C00+1096+24;

   /* do the bulk of the work and then the remainder */


   i=0;
   while(i<packet)
   {
   read(fh,(char *)lomem,4000);
   maintoaux(lomem,lomem+4000-1,himem);
   himem+=4000;
   i++;
   }

   if(straggler>0)
   {
   read(fh,(char *)lomem,straggler);
   maintoaux(lomem,lomem+straggler-1,himem);
   }
   close(fh);

   strcpy((char *)2048,name);
   /* Step 3... now do the signature... and return */
   return 0;

}



/* sign off the upper memory at 2048  */
/* the apple has no standard for this */
/* unlike the IBM LIM convention      */

emscheck(name)
char *name;
{
   char *sigbuf=(char *)2048;
   int target;

   unsigned int i;

   /* don't load the library if it's in high memory already   */
   /* step 1... get the signature... this is the library name */
   /* if the library is already in memory this will likely be there
*/
   /* when we exit we erase this to make sure. */

   target=strlen(name);

   /* step 2... compare and return -2 if it's already there */
   /* otherwise return 0 */

   i=0;
   while(i<target)
   {
     if(name[i]!=sigbuf[i])return 0;
     i++;
     }

   return -2;
}


/* don't care what's there... unsign the ems when we leave */
/* that way we're not tripping over ourselves...           */
/* all we need to do is put zeros there...                 */
/* names don't contain zeros...                            */

emsoff()
{
   char *signoff=(char *)2048;
   int i=0;

   while(i++<40)*signoff++=0;
}

x--- snip ---x




> FWIW, I had managed to contact one of the programmers. His response was,
> the software belonged solely to Manx as all developers were employees at
> the time of development. The best you could hope for would be to locate
> which (if any) company acquired the Manx assets.
>

I have Harry Suckow's phone etc. He is still in Freehold, NJ. I talked
to Carl Sassenrath and know where Jim Goodnow is too. Thomas Fenwick
may still be at Microsoft. He may also have gone underground after he
directed the devlopement of WIndows CE. As far asw Mike Spille goes, I
haven't talked to him since the early 90's and he is probably still
living in Greenwich Village or may have moved upstate for all I know.
I want to finish the site off before I ask Harry the question. The use
is still fair especially under the Berne Convention 3 test clause
which is what we Canadians go by, but I want their help in getting all
the versions of everything, so I need to make a better effort than I
have so far.


> I don't want to belittle this excellent addition to the II library but I
> would mention, for those who are concerned with copyright ethics and
> prefer using a cross-compiler, CC65 functions pretty well.
>
> Cheers,
> Mike T.
> --- Synchronet 3.14a-Win32 NewsLink 1.85
> A2Central.com - Your total source for Apple II computing.

The Aztec stuff that I have put on line is a period piece and runs
without tweaking under XP. It comes with a fully functional
development environment coutesy of yours truly and strictly speaking
is much more than a compiler. If CC65 comes with all that then that is
wonderful. I had a look at one point and it just looked like a whole
lot of work to me.

I don't really know what else to say about all that except to say that
If you are not using Aztec-C  Fairly, please let me know so I can
write some Apple II programs for resale too:) Other than that I'll let
the shot on ethics go and I'll say cheers to all and if you know those
archivers over at asimov why not ask them not to delete my work and I
will put some of this over there too.

Later,

Bill