Author: calcdude84se
Posted: 11 Dec 2012 04:33:34 pm (GMT -5)
The short answer to your question is "no".
The longer answer is "It depends on what exactly you want."
Given the talk of curRow, I take it you're drawing things to the homescreen. I'm also going to assume you're using bcall(_PutMap) to place characters, with the effect that the OS never scrolls the screen, and that you're not reading textShadow at any point.
There's no support for drawing a character backwards. You have to do that yourself. With the assumptions listed above, your best choice is direct LCD output! Refer to http://wikiti.brandonw.net/index.php?title=83Plus:Ports:10 as I continue.
Basically, you'll have to draw any "special" characters yourself. Here's some untested, unoptimized, but commented code that can do that. Follow along with the comments in order to understand it.
Code:
So, just point HL at the sprite and call the routine and it will display the sprite. I don't know if there's a bcall to get the sprite for a certain character, but it would definitely be easier just to include the reversed sprite in your program.
Edit: I have tested similar code since starting to write this post that works, so it's sound at least in principle.
_________________
People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster.
-Adam Osborne
Posted: 11 Dec 2012 04:33:34 pm (GMT -5)
The short answer to your question is "no".
The longer answer is "It depends on what exactly you want."
Given the talk of curRow, I take it you're drawing things to the homescreen. I'm also going to assume you're using bcall(_PutMap) to place characters, with the effect that the OS never scrolls the screen, and that you're not reading textShadow at any point.
There's no support for drawing a character backwards. You have to do that yourself. With the assumptions listed above, your best choice is direct LCD output! Refer to http://wikiti.brandonw.net/index.php?title=83Plus:Ports:10 as I continue.
Basically, you'll have to draw any "special" characters yourself. Here's some untested, unoptimized, but commented code that can do that. Follow along with the comments in order to understand it.
Code:
putMapSprite:
;Draws the 8-byte sprite at HL to the screen in the same position that bcall(_PutMap) would
call lcd_wait ;Makes sure the LCD is ready. Defined below
xor a ;load a with 0. This is the LCD command to set 6-bit mode, which is what you need for the homescreen
out ($10),a ;$10 is the LCD command port
call lcd_wait
ld a,5
out ($10),a ;Set X-increment mode. This means data will be written to the screen downwards
;Note: 6-bit needs to be set; X-Incr should already be set, but it doesn't hurt
call lcd_wait
ld a,(curRow)
add a,a
add a,a
add a,a
or $80
out ($10),a ;Set the row to (curRow)*8--each character is 8 lines high
call lcd_wait
ld a,(curCol)
or $20
out ($10),a ;Set the column to (curCol)
;The "or"s above are to get the right command prefix
ld b,8 ;8 rows to copy
pms_loop:
call lcd_wait
ld a,(hl) ;get the byte at HL, where the sprite is
out ($11),a ;Write the byte to the LCD
inc hl ;move to the next byte
djnz pms_loop
call lcd_wait
ld a,1
out ($10),a ;Return the LCD to 8-bit mode, as various OS routines expect it to be so. You might be able to get away without this.
ret
lcd_wait:
in a,($10)
jp m,lcd_wait ;High bit of port $10 is set if busy
ret
So, just point HL at the sprite and call the routine and it will display the sprite. I don't know if there's a bcall to get the sprite for a certain character, but it would definitely be easier just to include the reversed sprite in your program.
Edit: I have tested similar code since starting to write this post that works, so it's sound at least in principle.
_________________
People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster.
-Adam Osborne