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
Memory Management
#4
boriel Wrote:Note: there is already both SetAttr and GetAttrAddr routines in <attr.bas>. Did you had a look to them? Maybe what you want was already there... I'm now checking this bug.

Thank you.

Yes, there was something there and here is the reworked version of the
sub.

Code:
Declare sub SetAttr (ByVal Line as ubyte, ByVal Column as ubyte, ByVal NumberOfCells as uinteger) Sub SetAttr (ByVal Line as ubyte, ByVal Column as ubyte, ByVal NumberOfCells as uinteger) Asm ld e, (ix+7) ld d, (ix+5) ld h, 0 ; 7 T-States ld a, d ; 4 T-States add a, a ; a * 2 ; 4 T-States add a, a ; a * 4 ; 4 T-States ld l, a ; HL = A * 4 ; 4 T-States add hl, hl ; HL = A * 8 ; 15 T-States add hl, hl ; HL = A * 16 ; 15 T-States add hl, hl ; HL = A * 32 ; 15 T-States ld d, 18h ; DE = 6144 + E. Note: 6144 is the screen size (before attr zone) add hl, de ld de, (SCREEN_ADDR) ; Adds the screen address add hl, de ;ld c, (ix+8) ;ld b, (ix+9) ;ld b, 0 ld b, (ix+8) ld a, (23693) ;ld e, a SetAttrCopy: ;ld (hl), e ld (hl), a inc hl djnz SetAttrCopy ;dec bc ;ld a, b ;or c ;jr nz, SetAttrCopy End asm End sub

Nothing in the global scope, some of this is inline addition from attr.asm.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)