mirror of
https://github.com/cc65/cc65.git
synced 2025-01-21 15:32:41 +00:00
Added assembly level function to set cbm working screen along C prototype
This commit is contained in:
parent
a633e1060d
commit
bc4c36579a
@ -313,5 +313,15 @@ void __fastcall__ cbm_closedir (unsigned char lfn);
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Supplemental cbm functions */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
int __fastcall__ cbm_set_working_screen(unsigned char screen_hi);
|
||||
/* Sets the address of the working screen (no switching of viewport) to screen_hi*0x100.
|
||||
Checks, if the screen_hi is a multiple of 4. If not, fails with EXIT_FAILURE. */
|
||||
|
||||
/* End of cbm.h */
|
||||
#endif
|
||||
|
28
libsrc/cbm/workingscreenaddr.s
Normal file
28
libsrc/cbm/workingscreenaddr.s
Normal file
@ -0,0 +1,28 @@
|
||||
;
|
||||
; Stefan 'MonteCarlos' Andree, 26.08.2024
|
||||
;
|
||||
; int __fastcall__ _set_working_screen(unsigned char screen_hi);
|
||||
;
|
||||
|
||||
.include "cbm.inc"
|
||||
.include "c64.inc"
|
||||
|
||||
.export _cbm_set_working_screen
|
||||
|
||||
_cbm_set_working_screen:
|
||||
tax
|
||||
and #3
|
||||
bne @error
|
||||
stx SCREEN_HI
|
||||
sec
|
||||
jsr PLOT ; Get cursor position ...
|
||||
clc
|
||||
jsr PLOT ; ... and set it again to update address of char below cursor with new hi-byte
|
||||
|
||||
lda #0
|
||||
tax
|
||||
rts
|
||||
@error:
|
||||
lda #$ff
|
||||
tax
|
||||
rts
|
Loading…
x
Reference in New Issue
Block a user