Files
cc65/libsrc/nes/setcursor.s
T
Brandon 476588db62 NES Library update
- Provided an implementation for textcolor(char color) in conio.h
- Updated the header to NES2.0
-Updated the .gitattributes to prefer LF line endings
- Stored CHR-ROM in a binary file (instead of .byte commands)
- Freed up some memory, increased the C stack size from $300 to $400
- Fixed issues #2989, #1570
- Fixed the first frame of startup displaying an uninitialized nametable
- Fixed the conio peek functions causing graphical glitches
- Made the waitvsync() function more robust
- Various other code optimizations
2026-09-20 15:55:27 -04:00

38 lines
912 B
ArmAsm

;
; Written by Groepaz/Hitmen <groepaz@gmx.net>
; Cleanup by Ullrich von Bassewitz <uz@cc65.org>
; Rewritten by Brandon Woodward
;
; Set the cursor position and screen position
.export setcursor_pos, setcursor_posx, setcursor_screenptr
.export setcursor_screenptr
.include "nes.inc"
;-----------------------------------------------------------------------------
;y+(++x*32)+$2000
setcursor_pos:
STX CURS_Y
setcursor_posx:
STY CURS_X ; Fallthrough
.proc setcursor_screenptr
sty SCREEN_PTR ; Target val: --1000xx xxxyyyyy
inx
txa
sec
ror A
ror A
ror a
sta SCREEN_PTR+1 ; Contains garbage in the most significant 2 bits
and #%11000000
ROR A
adc SCREEN_PTR
sta SCREEN_PTR
rts
.endproc