GSCats/fontEngine.s

46 lines
908 B
ArmAsm
Raw Normal View History

.include "equates.s"
.include "macros.s"
.org $0000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; renderString (Far entry point at $050000)
;
; Draws a Pascal string in any font
;
2023-07-13 21:33:34 +00:00
; PARAML0 = Pointer to string
; Y = VRAM position of lower right corner of string at which to draw
; A = Font index
;
; Trashes SCRATCHL,X,Y,A
;
renderString:
NATIVE
2023-07-13 21:33:34 +00:00
SAVE_DBR
2023-07-13 21:33:34 +00:00
asl
tax
jmp (fontJumpTable,x) ; Can't JSR here because we need the stack in a particular state (with DBR cached on top)
renderStringReturn:
2023-07-13 21:33:34 +00:00
RESTORE_DBR
rtl
2023-07-13 21:33:34 +00:00
fontJumpTable:
.addr renderString_tinyNum
.addr renderString_font8
2023-08-06 22:55:42 +00:00
.addr renderString_font16
2023-07-13 21:33:34 +00:00
.include "fonts.s"
2023-07-13 21:33:34 +00:00
; Suppress some linker warnings - Must be the last thing in the file
; This is because Quinn doesn't really know how to use ca65 properly
.SEGMENT "ZPSAVE"
.SEGMENT "EXEHDR"
.SEGMENT "STARTUP"
.SEGMENT "INIT"
.SEGMENT "LOWCODE"