(Z80) Setting a BITMAP

From: CTG (spamtrap_at_crayne.org)
Date: 09/16/04


Date: Thu, 16 Sep 2004 01:24:14 +0000 (UTC)

TThis routine is clumsy and only deals with setting bitmaps up to bit
64
and fails after (65)
Does anyone know of any piece of reliable code that would go beyond
the 8th Byte and set bits up to 128

Thanks

;--------------------------------------------------------------------
; set the bit in the bitmap for an added field
; On entry: A = bit to set (1-64)
; BITMPTR holds address of bitmap in request
; On exit: A = 0 (False) if bit invalid, else A = True
SET_MBIT_LONG
; check that bit is valid (1-64)
        OR A
        RET Z
        CP 65
        JR C,BIT_OK
        XOR A
        RET

BIT_OK
; point to bitmap in request message
        LD HL,(BITMPTR)
        LD B,A
        XOR A
        SCF
;loop til pointer & mask correct
BIT_LOOP1
        RRA
        JR NC,BIT_CHECK
;select next byte of bitmap
        RRA
        INC HL
BIT_CHECK
        DJNZ BIT_LOOP1

; set bit in correct location
        OR (HL)
        LD (HL),A
    LD A,TRUE
    RET



Relevant Pages

  • Re: (Z80) Setting a BITMAP
    ... > and fails after ... > Does anyone know of any piece of reliable code that would go beyond ... set the bit in the bitmap for an added field ... Pete ...
    (comp.lang.asm.x86)
  • Re: (Z80) Setting a BITMAP
    ... > and fails after ... > Does anyone know of any piece of reliable code that would go beyond ... set the bit in the bitmap for an added field ... Pete ...
    (alt.lang.asm)
  • (Z80) Setting a BITMAP
    ... and fails after ... Does anyone know of any piece of reliable code that would go beyond ... set the bit in the bitmap for an added field ... ;loop til pointer & mask correct ...
    (alt.lang.asm)
  • Re: (Z80) Setting a BITMAP
    ... set the bit in the bitmap for an added field ... | RET Z ... |;loop til pointer & mask correct ... | RRA ...
    (alt.lang.asm)
  • Re: Out of Memory exception when trying to Clone a Bitmap
    ... looking to do is simply copy and crop a bitmap image. ... If I clone using the EXACT bounds of the original bitmap it works fine. ... If I clone using anything smaller then it fails. ... bounding rectangle described with floating point bounds. ...
    (microsoft.public.win32.programmer.gdi)