0 Members and 1 Guest are viewing this topic.
ld hl,9340h ld bc,3 ld a,(hl) cpl ld (hl),a inc hl djnz $-4 dec c jr nz,-7 ret
updateRotation: ld a,(xOff) ;what is the xOffset? and 7 ;we're only interested in the lower three bits (essentially xOff % 8) ld hl,gbufMask ld e,a ld d,0 add hl,de ;pointer to the rotation mask ld a,(hl) ld hl,maskLeft ld (hl),a ld hl,maskRight cpl ;xor $FF ld (hl),a;... retgbufMask:.db %11111111 ;0 display all of the first byte, none of the second.db %11111110 ;1 after rotating left once, we only want the 7 leftern most bits of byte 1, and rightmost bit of byte 2.db %11111100 ;2.db %11111000 ;3.db %11110000 ;4.db %11100000 ;5.db %11000000 ;6.db %10000000 ;7
xor a__FreqOutLoop1: push bc ld e,a__FreqOutLoop2: ld a,h or l jr z,__FreqOutDone dec hl dec bc ld a,b or c jr nz,__FreqOutLoop2 ld a,e xor %00000011 scf__FreqOutDone: pop bc out ($00),a ret nc jr __FreqOutLoop1
GetPixelLoc:;Input:; b is X; c is y;Output:; HL points to byte; A is the mask; nc if not computed, c if computed ld a,c cp 64 \ ret nc ld a,b cp 96 \ ret nc ld l,c ld h,0 ld b,h add hl,hl add hl,bc add hl,hl add hl,hl ld b,a rrca \ rrca \ rrca and 0Fh ld c,a ld a,b ld b,0 add hl,bc ld bc,(BufPtr) add hl,bc and 7 ld b,a inc b ld a,1 rrca djnz $-1 scf ret
OP1NameLength:;Returns the name length in HL ld hl,8478hNameLength: xor a \ ld b,a \ ld c,a cpir ld h,a \ ld l,a scf \ sbc hl,bc ret
SearchLine:;Inputs:; HL points to the start; BC is the number of bytes to search; DE is the line number; A is the line byte;Outputs:; A is not changed; BC is the number of bytes left for the search; DE points to the line; HL is the length of the line;=============================================================== dec de \ inc d \ inc e or a ld (TempWord1),hlSearchLoop: cpir ;21X-5 jp po,EndSearchLoop+1 dec e \ jr nz,SearchLoop-3 dec d \ jr nz,SearchLoop-3EndSearchLoop: scf ld de,(TempWord1) sbc hl,de ret
ld a, %10000000or %10000001 ;The first and last bits will be set no matter what. All others will not be affected.
ld hl, 10000ld de, 5000or asbc hl, de ;Now it's guranteed that HL = 5000 instead of 4999.
;===============================================================PlotPixel:;===============================================================;Inputs:; B is the x-coordinate; C is the y-coordinate; D=Method; 1=Test; 2=Off; 3=On; (BufPtr) points to the buffer to draw to;Outputs:; BC is equal to (BufPtr); DE not modified; HL points to the byte the pixel is drawn to; When using the pixel test method:; z means pixel off; nz means pixel on;Destroys:; A;=============================================================== ld a,3Fh ;7 srl b \ rra ;12 19 srl b \ rra ;12 31 srl b \ rra ;12 43 cpl ;4 47 or d ;4 51 rrca \ rrca ;8 59 ld (Method),a ;13 72 ld a,b ;4 76 ld b,0 ;7 83 ld h,b \ ld l,c ;4 87 add hl,bc ;11 98 add hl,bc ;11 109 add hl,hl ;11 120 add hl,hl ;11 131 ld c,a ;4 135 add hl,bc ;11 146 ld bc,(BufPtr) ;20 166 BufPtr points to the buffer add hl,bc ;11 177 .db $CB ;15 192 First byte of BITMethod: .db 46h ; second byte of the BIT instruction ret ;10 202 37 bytes
bit 5,abit 3,a