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

Re: 80 Columns under cc65?



John B. Matthews wrote:
In article <g4cog9$q9e$1@online.de>, ol.sc@web.de (Oliver Schmidt) wrote:


How do I get an 80-column text mode on an Apple 2 under cc65?

It looks like the cc65 conio library goes to some lengths to avoid changing whatever your program loader sets.

That's very true. And in fact it goes beyond that: In contrast to at
least some other cc65 targets the Apple2 conio implementation allows
you to mix stdio and conio. Additionally you can use the well-known
Apple2 zero-page variables to restrict the output to a certain window
both for stdio and conio.


Oliver: thanks for expanding on this. I'm still new to cc65:-)


        LDA MACHID
        AND #2
        BEQ NO80COL
        JSR $C300

I've tried recently to do that from within a cc65 program via inline
assembler but that mixed up something with ProDOS so file I/O didn't
work anymore. I'll have to investigate but my current work life
situation doesn't allow for that. So the current workaround is to set
80-column mode before starting the cc65 program.


Oliver: the code above was from a ProDOS system program. A non-system cc65 program launched from the Basic prompt under ProDOS is running alongside BASIC.SYSTEM. It might be necessary to update the BASIC Global Page Default I/O vectors after initializing the card:

BE30:  VECTOUT   DW  COUT1       ;Current character output routine
BE32:  VECTIN    DW  CHIN1       ;Current character input routine

I'll have to learn enough inline assembler to try it myself, but experimenting from the Basic prompt seems to confirm this. I'm tempted to just try printing control-DPR#3.

Interestingly, not updating the vectors appears to turn on trace!

]mtr
*c300g
*^c
]10 ?"Hello"
]run
#10 Hello

ProDOS is also disconnected, but call 976 ($3d0) restores normalcy.

BASIC.SYSTEM runs with "real" trace turned on all the time--that's
how it gets control for continuous garbage collection.  So if you
disconnect it without its cooperation, you'll see the trace output.

-michael

AppleCrate: An Apple II "blade server"!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it's seriously underused."