Re: A86: Need help
[Prev][Next][Index][Thread]
Re: A86: Need help
Hmm, how do you mean getting smaller? Like you input the border of the screen
and it shrinks inwards til it hits the center? Ok, here's something like that
which uses "_Iline"... Try this:
Label:
ld bc, 0*256+0
ld de, 127*256+63
ld l, 32 ;Im going to decrement 'l' and not use 'djnz' because 'b' is already
used.
;And Im using 32 cuz it will take 32 times for the
;Y coordinates, at 0 and64, to get to the center.
Loop:
call DrawBox
inc b ;\ Doing this because there are double the amount of
dec d ; | X coordinates as Y coordiantes and changing them
call DrawBox ;/ twice, but changing Y only once in each loop
dec c
dec e
dec l ; Decrementing the variable used for the loop.
ld a, l ;
jp nz, Loop ; Checking if it has gotten to the center yet...
jp Done ;Jump to somewhere else in your prog after this.
DrawBox:
push bc ;Save the current
push de ;Coordinates.
ld h, 1 ;Set Pixel Color to Black
ld e, c ;Draw from (b,c) to (d,c)
call _Iline
pop de ;Retrieving Current Coords
pop bc ;After altering them...
push bc
push de
ld h, 1
ld b, d ;Draw from (d,c) to (d,e)
call _Iline
pop de
pop bc
push bc
push de
ld h, 1
ld c, e ;Draw from (b,e) to (d,e)
call _Iline
pop de
pop bc
push bc
push de
ld h, 1
ld d, b ;Draw from (b,c) to (b,e)
call _ILine
pop de
pop bc
ret
I think that is what you are trying to do, as how I read your question. Oh
wait, did you want it to shrink towards the center and leave the rest Black or
did you need just a box to be seen getting smaller (erase the previously drawn
boxes)? Write back if thats the case, but if not, hope I could be of help...
=)
--Jason K.
In a message dated 12/01/98 11:51:47 PM, PsyKaBek@aol.com writes:
>okay i want to have a box starting on the outside and getting smaller this
>is
>the code I have now. Pleeze fix it up
>
>#include "ti86asm.inc"
>
>.org _asm_exec_ram
>Zip_out:
>
> ld b,0
> ld c,0
> ld d,0
> ld e,64
> ld h,1
> call _ILine
> ld b,126
> ld c,0
> ld d,126
> ld e,64
> ld h,1
> call _ILine
> ld c,63
> ld d,128
> ld e,63
> ld h,1
> call _ILine
> ld b,0
> ld c,1
> ld d,128
> ld e,1
> ld h,1
> call _ILine
>quit:
> call _clrlcd
>.end