funkheld Wrote:how can you use $c000 as a screen?
can you print at $c000?
how can you direct the output to $c000 with asm?
thanks.
regards
Yes. All standard routines support printing and drawing in any RAM address ("standard" means, they came bundled with the compiler).
The same for attributes. You can draw attributes in a different region of the screen: this is useful if you want to use only a small buffer (i.e. 2/3 of the screen) and put the attributes just after that, so saving 2k of (scarce ram).
Code:
#include <scrbuffer.bas>
#include <memcopy.bas>
DIM scr_addr, attr_addr as UInteger
CLS: PRINT "PRESS A KEY"
scr_addr = GetScreenBufferAddr() : REM Original screen address ($4000)
attr_addr = GetAttrBufferAddr(): REM Original Attr address
SetScreenBufferAddr($C000)
SetAttrBufferAddr($C000 + 6144) :REM uses standard screen + attribute region
CLS: REM Clears new Screen (it may contain random bits)
PRINT INK 6; PAPER 1; "HELLO WORLD"
PAUSE 0
MemCopy(0xC000, scr_addr, 6144) : REM Copy only pixels region
PAUSE 0
MemCopy(0xC000 + 6144, attr_addr, 32 * 24): REM Copy attributes region
This example (untested, typed here directly), PRINTS in another region. Then copy (blits) the pixels to the actual screen and later the attributes.
If the buffer is in a contiguous region, you can copy all the buffer in one single MemCopy call.
EDIT: Program fixed and tested :-)