Re: A86: Re: sprites


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

Re: A86: Re: sprites




Oh ok you are talking about if HL starts in vid memory, not regular memory..
ahhhh..

Hmm.. try adding 16, not 15.

>because each byte needs to be written to the next row (+16)
>
>Matt2000 wrote:
>
>> Why cant you do:
>>
>> ld hl, SpriteLocation
>> ;de set?
>> ld bc, 8
>> ldir
>>
>> SpriteLocation:
>>     .db %00000000
>>     .db %00000000
>>
>> Later,
>>     Matt
>>
>> >What's wrong with this bit of code?
>> >
>> >
>> >;copy 8x8 sprite at hl to de
>> >
>> >copy_sprite:
>> > ld bc,8                   ;sprite size
>> > ld a,15
>> >the_loop:
>> > ldi
>> > ret po                       ;return when bc is 0
>> > add a,e
>> > ld e,a                       ;make de point to next row
>> > jr nc,the_loop
>> > inc d                        ;add carry
>> > jr the_loop
>> >
>> >
>
>
>
>


Follow-Ups: