So, I made a program that lets you scroll through strings. However, I am getting a bunch of junk when I quit the program? Could someone help me get rid of that? Smile Thanks
Here is the gif:



Here is the source:


Code:

;################
;# Asm Template #
;# -Switchblade #
;################

.nolist
   #include "ti83plus.inc"
.list
.org $9D93
.db t2ByteTok, tAsmCmp
_GetKeyRetOff .equ $500B   ;not using this line

   res AppAutoScroll, (IY + AppFlags)
   b_call(_RunIndicOff)
;startscreen
   b_call(_ClrLCDFull)
   b_call(_HomeUp)
   ld hl,starttext
   b_call(_PutS)
   b_call(_GetKey)

choosemap:
   ld a,(mapy)
   cp 1
   jr nz,next2
next:
   ld (mapy),a
   ld hl,map1
   push hl
   jr drawmap
next2:
   ld a,(mapy)
   cp 2
   jr nz,next3
   ld (mapy),a
   ld hl,map2
   push hl
   jr drawmap
next3:
   ld a,(mapy)
   cp 3
   jr nz,quitrpg
   ld (mapy),a
   ld hl,map3
   push hl
   jr drawmap

drawmap:
   b_call(_ClrLCDFull)
   b_call(_HomeUp)
   pop hl
   b_call(_PutS)

movemap:
   b_call(_GetKey)
   cp kUp
   jr z,increase
   cp kDown
   jr z,decrease
   cp kClear
   jr z,quitrpg
   jr movemap

quitrpg:

   ret

increase:
   ld a,(mapy)
   cp 3
   jr z,choosemap
   inc a
   ld (mapy),a
   jr choosemap
decrease:
   ld a,(mapy)
   cp 1
   jr z,choosemap
   dec a
   ld (mapy),a
   jr choosemap

starttext:
   .db "#################   RPG BASE   #################",0
mapy:
   .db 1

map1:
   .db "XXXX        XXXXXXX  XXXXXX  XXXXX  XXXXXXXX  XXXX  XXXXXXXX  XXXX            XXXX  XXXXXXXX  XXXX  XXXXXXXX  XXXX  XXXXXXXX  XX",0
map2:
   .db "XXXX        XXXXXXX  XXXXXX  XXXXXX  XXXXXXXXXXXXXX  XXXXXXXXXXXXXXX        XXXXXXXXXXXXXXX  XXXXXX  XXXXXX  XXXXXXX        XXXX,",0
map3:
   .db "XX  XXXXXXXX  XXXX    XXXX    XXXX  X  XX  X  XXXX  XX    XX  XXXX  XXX  XXX  XXXX  XXXXXXXX  XXXX  XXXXXXXX  XXXX  XXXXXXXX  XX",0
.end
.end
Use b_call(_ClrLCDFull) and b_call(_HomeUp) before returning to the OS. Not only do you want to do this to clear the map from the screen, but it will fix your bug, which is occurring because you exited with the cursor position off the bottom of the screen and the OS gets confused.

It may also be necessary to undo the flag change you made at the start of the program with set AppAutoScroll, (IY + AppFlags).
Thanks, I'll try that. Very Happy

Edit:
Sweet, it works. Thanks for your help. Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement