[A83] Re: Inverting on home screen


[Prev][Next][Index][Thread]

[A83] Re: Inverting on home screen




Well, it helps to be specific in what you ask.  Quite often, the mere act of
expressing yourself fully so that others can understand what you will asking
will be sufficient to get you thinking and allow you to figure out the
problem on your own.

I assumed that you meant you wanted to xor the first ten characters on the
homescreen with a space.

_textShadow is merely the text representation of the homescreen.  Generally
you don't want to mess with it.  You probably should just render the
characters to the screen using _puts or whatever, and then just invert the
graphics data.

I'm assuming that when you use _puts that the pixel data gets written to
_plotSScreen.  If not, then I'm sure someone that programs for the 83 can
correct me.  By "spaces", do you mean pixels?  Thirty two pixels is four
bytes.  Let's assume that you want to do a box that is eight pixels high and
thirty two pixels wide.  That is four bytes wide and eight bytes high.
First, you need to compute the starting value in the screen buffer.  Since
the screen is twelve bytes wide, you multiply the number of pixels high by
twelve, and add the width offset in bytes.  Then you loop through and xor
the bytes:

 ld hl,_plotSScreen+(8*12)+2   ; pixel coordinates (16, 8) as (x, y)
 ld de,12-4    ; the starting byte in the next row will be that many bytes
off
 ld c,8  ; eight bytes tall
xor_screen:
 ld b,4  ; four bytes wide
xor_row:
 ld a,(hl)  ; grab byte
 xor $ff   ; invert it
 ld (hl),a  ; write it back
 inc hl     ; move to next byte
 djnz xor_row   ; loop through the row
 add hl,de   ; move to next row
 dec c   ; decrease row count
 jr nz,xor_screen   ; move through the screen

 bcall _GRBUFCPY     ; or ionfastcopy, or whatever you need here

> I still do not quite understand how it works, especially since it does not
> work in my program.  Perhaps I ought to be more specific:
> I'm trying to make a menu where by going up/down, your selection gets
> highlighted.  So, now I need to invert 32 spaces or 16, but I can figure
> that out myself.  I looked in the SDK, but I still do not understand
exactly
> how textshadow works.
> -Is it updated right away?
> -Is it cleared when "fastcopy" is called?
> -How can I change something in it at a certain point?






References: