Re: LZ: ME AGAIN ANOTHER PROBLEM


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

Re: LZ: ME AGAIN ANOTHER PROBLEM



Frank wrote:
> 
> Here i am again...well my program seemed to be working, but i found a new
> bug.... which i have no clue why it is happening... it will only draw left
> 1-5(changes everytime?) pixels then it stops until you go another
> direction...this is ONLY WHEN WITH LEFT.... well if ya can help try ...
> 
> #include "ti-85.h"
> .org 0
> .db "By Frank Apap",0
> 
> Init:
>  ld a,4
>  out (5),a
>  ROM_CALL(CLEARLCD)
>  ld b,40                   ; x start
>  ld c,40                   ; y start
> 
> Start:
>     call GET_KEY   ; get a key
      cp 0			;\_add these lines
      JUMP_Z(Start)		;/
>     cp $04         ; up ?	;\
>      jr nz,nextkey		; \
>     CALL_Z(up)		;  > remove there lines
>      JUMP_(Start)		; /
> > nextkey:			;/
>     cp $01         ; down
>     CALL_Z(down)
> 
>     cp $02           ; left?
>     CALL_Z(left)
> 
>     cp $03        ; right
>     CALL_Z(right)
> 
      cp K_UP		; add these lines	K_UP = $04
      CALL_Z(up)	; add these lines


>     cp $37              ;exit
>     JUMP_Z(exit)
> 
>     cp $0F   ;clear
>     JUMP_Z(clear)
> 
>     JUMP_(Start)    ; loop
> up:
>   inc c  ; x=x+1
>   CALL_(PlotPixel) ; draw it
>   ret
> 
> down:
>      dec c ; x=x-1
>      CALL_(PlotPixel)
>      ret
> 
> right:
>   inc b  ; y=y+1
>   CALL_(PlotPixel) ; draw it
>   ret    ; go back
> 
> left:                                       ;SOMETHING MUST BE WRONG AROUND
>                                           ;HERE
>   dec b  ; y=y-1
>   CALL_(PlotPixel) ; draw it
>   ret   ; go back
> clear:
>     ROM_CALL(CLEARLCD)
>     JUMP_(init)
> 
> PlotPixel:
>     ROM_CALL(FIND_PIXEL)
>     ld de,$FC00
>     add hl,de
>     or (HL)
>     ld (HL),a
>     ret
> 
> exit:
>      ROM_CALL(CLEARLCD)
>      ld hl,$1A1A
>      ld ($8333), hl
>      ld hl, (PROGRAM_ADDR)
>      ld de,bye
>      add hl,de
>      ROM_CALL(D_ZM_STR)
> exitloop:
>    call GET_KEY
>    cp $37
>    ret z
>    jr nz,exitloop
> 
> bye: .db "BYE THANKS FOR TESTING",0
> .end
> 
hmm it appears that i don't know what your problem is. i also noted that
you didn't use the macros that are in the TI-85.H file(K_UP, K_DOWN,
K_RIGHT, etc). Try adding and removing the lines that are marked to see
what that does.
PCoMP
Visit Maximus Productions home page at: http://www.ntsource.com/~pcmop


References: