The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PutTile16x16 Pixels + Attributes
#8
Here's a start point for you, LCD:

(We'll need these functions! for the FourSpriter version anyway - and that will be quite long, if fast....)

Code:
FUNCTION scrAddress(x as uByte, y as uByte) as Uinteger asm ; This function returns the address into HL of the screen address ; x,y in character grid notation. ; Original code was extracted by BloodBaz - Adapted for ZX BASiC by Britlion from Na_TH_AN's fourspriter ; x Arrives in A, y is in stack. and 31 ld l,a ld a,(IX+7) ; Y value ld d,a and 24 add a,64 ld h,a ld a,d and 7 rrca rrca rrca or l ld l,a end asm END FUNCTION

Code:
FUNCTION attrAddress (x as uByte, y as uByte) as uInteger ';; This function returns the memory address of the Character Position ';; x,y in the attribute screen memory. ';; Adapted from code by Jonathan Cauldwell - Adapted for ZX BASiC by Britlion from Na_TH_AN's fourspriter asm ld a,(IX+7) ;ypos rrca rrca rrca ; Multiply by 32 ld l,a ; Pass to L and 3 ; Mask with 00000011 add a,88 ; 88 * 256 = 22528 - start of attributes. ld h,a ; Put it in the High Byte ld a,l ; We get y value *32 and 224 ; Mask with 11100000 ld l,a ; Put it in L ld a,(IX+5) ; xpos add a,l ; Add it to the Low byte ld l,a ; Put it back in L, and we're done. HL=Address. end asm END FUNCTION
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)