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

Re: 80-column mode with Aztec C SYS files?



"datajerk" <datajerk@gmail.com> wrote:

>I am using the MS-DOS Aztec cross-compilers to create PRODOS SYS files for 
>the //e.  My only problem so far is that I cannot figure out how to get the 
>program to run in 80-column mode.

Hi there. The following demo prodos sys program written in Aztec C uses 
crt80(); to set 80 column mode. This code is directly from the Aztec C 
Website courtesy of AZTECPLUS by BluPhoenyx (Mike T.) & MacProber.

http://www.aztecmuseum.ca/docs/AztecPlus65.txt
http://www.aztecmuseum.ca/AztecPlus65.zip

I am assuming that you are using my AppleX distribution.

http://www.aztecmuseum.ca/compilers.htm#applecross

The code from the native mode compiler can be added to the cross-compiler 
libraries without a problem.

>PRODOS boots into 80-column mode and presents me with a menu, but when I 
>select my program for execution it runs in 40-column mode.

But of course, so why not use the following Aztec C code and next time you 
need some help with Aztec C just save yourself some pain and send me your 
question private mail.

Regards,

Bill

x--- snip ---x

/**************************************************
    screen 80 column lib
 **************************************************/

crt80()
  {
#asm
  jsr $c300
#endasm
  }

int scr_read80(x,y)
  int x;
  int y;
{
#asm
SPP EQU $02
R0 EQU $08
    ldy #0
    sty R0+1
    ldy #$0d    ;y offset
    lda (SPP),y ;get y location
    jsr $fc24 ;set basl
    ldy #$0b
    lda (SPP),y
    lsr a
    tay
    bcs rd1a
    sta $c055
rd1a
    lda ($28),y
    sta $c054
    sta R0
    lda $25
    jsr $fc24
#endasm
}

int scr_write80(x,y,c)
  int x;
  int y;
  char c;
{
#asm
    ldy #$0f
    lda (SPP),y
    tax
    ldy #$0d    ;y offset
    lda (SPP),y ;get y location
    jsr $fc24 ;set basl
    ldy #$0b
    lda (SPP),y
    lsr a
    tay
    bcs wr1a
    sta $c055
wr1a
    txa ;restore char from x
    sta ($28),y
    sta $c054
    lda $25
    jsr $fc24
#endasm
}

getbuf(x,y,w,h,bbuf)
  int x,y,w,h;
  char *bbuf;
  {
    int l1,l2;
    for (l1=0;l1<=h;l1++)
      {
        for(l2=0;l2<=w;l2++)
          {
            *bbuf=scr_read80(l2+x,l1+y);
            bbuf++;
          }/* for l2 */
      }/* for l1 */
  }


putbuf(x,y,w,h,bbuf)
  int x,y,w,h;
  char *bbuf;
  {
    int l1,l2;
    for (l1=0;l1<=h;l1++)
      {
        for(l2=0;l2<=w;l2++)
          {
            scr_write80(l2+x,l1+y,*bbuf);
            bbuf++;
          }/* for l2 */
      }/* for l1 */
  }



main()
{

 double jk;

    scr_clear();
    crt80();
    jk = 3.1416;
    printf("PI is %f\nPress a key to exit.\n",jk);
    getch();
    scr_clear();
    _exit();

}