If you search in OSDK\lib, you will find a "library.ndx" file, which contains the list of all supported routines, including paper and ink:
Code: Select all
-graphics.s
(...)
_paper
_ink
(...)
from that you can see that paper and ink are in "graphics.s" which is at the same location:
Code: Select all
_paper
ldx #1 ;Get one parm
jsr getXparm
jsr $f204 ;paper
jmp grexit ;common exit point
_ink
ldx #1 ;Get one parm
jsr getXparm
jsr $f210 ;ink
jmp grexit ;common exit point
the getXparm is also in the index file:
which is implemented that way:
Code: Select all
getXparm ; Get X params (16bit) from stack
ldy #0 ; X is the number of params
sty $2e0 ; Zero error indicator.
stx tmp ; store X in storage byte
ldx #0
getXloop
lda (sp),y
sta $2e1,x
inx
iny
lda (sp),y
sta $2e1,x
inx
iny ;
dec tmp ; decrement pointer
bne getXloop
rts
So basically what the code does, is to take the input parameter on the C stack and it writes it to the array that starts in $2E0 (PARAMS) which is used by all the graphics functions, $2E0 itself is used as the error code in case of wrong parameters.
So I guess in your case if you want to call these functions, all you need to do is:
- Clear $2E0
- Write the INK or COLOR value in $2E1
- Call either $f204 or $f210
That being said, if you do that, you are basically calling the ROM; which means you are forfeiting the top 16K of overlay memory, so I would suggest to use your own routine to do that, which additionally allows you to put the color attributes were you want, like INK first and then PAPER, to limit the visually lost column used by INK, all you need is a simple loop that write two bytes from A000 to A000+40*200, skipping every 40 bytes