I'm looking to dynamically update the size of a program with alot of data. To decrease the size of the program, I will write the map data to an appvar, then remove the map data from the program itself. I do this with the following code:



Code:
Start:
   ld hl,InstallStatus
   ld a,(hl)
   cp 0
   jr z,InstallGame



InstallGame:
   ld hl,MapsEnd-WorldMap
   b_call(_EnoughMem)
   jr c,Error
   ex bc,hl
   ld hl,AppVar
   rst 20h
   ld hl,MapsEnd-WorldMap
   b_call(_CreateAppVar)
   ld hl,WorldMap
   ldir
   ld hl,InstallStatus
   ld a,1
   ld a,(hl)
   ld hl,WorldMap
   ld de,MapsEnd-WorldMap
   b_call(_DelMem)
**need to update size field. How?
   jr Start   

Error:
   ld hl,$0000
   ld (CurCol),hl
   ld hl,ErrMem
   b_call(_PutS)
   b_call(_getKey)
   b_call(_ClrLCDFull)
   ret

AppVar:
.db AppVarObj,"ZelMap",0
ErrMem:
.db "Err: Memory",0

;################
;Install Status

InstallStatus:
.db 0

;################
;Map Data Start

WorldMap:
;data here
MapsEnd:
Not sure about the answer, but here are sone general corrections:
Code:
Start: 
   ld a,(InstallStatus)
   or a
   jr z,InstallGame 



InstallGame: 
   ld hl,MapsEnd-WorldMap 
   b_call(_EnoughMem) 
   jr c,Error 
   ex bc,hl 
   ld hl,AppVar 
   rst 20h 
   ld hl,MapsEnd-WorldMap 
   b_call(_CreateAppVar) 
   ld hl,WorldMap 
   ldir 
   ld a,1
   ld (InstallStatus),a
   ld hl,WorldMap 
   ld de,MapsEnd-WorldMap 
   b_call(_DelMem) 
**need to update size field. How? 
   jr Start    

Error: 
   ld hl,$0000 
   ld (CurCol),hl 
   ld hl,ErrMem 
   b_call(_PutS) 
   b_call(_getKey) 
   b_call(_ClrLCDFull) 
   ret 

AppVar: 
.db AppVarObj,"ZelMap",0 
ErrMem: 
.db "Err: Memory",0 

;################ 
;Install Status 

InstallStatus: 
.db 0 

;################ 
;Map Data Start 

WorldMap: 
;data here 
MapsEnd:
(Start: and the part where you set the InstallEtatus "flag" were broken/unoptimized)
Thanks. Those corrections have been made. I still need to know how to change the size field.

Also, I'm making this an app, using wabbitcode. Does that program set up the appropriate header, or must i still do something? Also, what must be different in an app? What b_calls don't work? Anything else I should know.

I currently am getting 2 build errors. One is in the DCS7 include file.
1. Expression is too deep. Only 20 levels allowed-->points to "#define GUIFindNext() call GUIFindNext"
2. The last page must have room for the signature.
What am I doing wrong? I'm currently set up as such:


Code:
;; Zelda.asm
;; Zelda
;; Legend of Zelda RPG v1.0
;; Created by Anthony Cagliano on 07/04/2011

.nolist
#include   "ti83plus.inc"
#include   "dcs7.inc"
#include   "app.inc"
.list
What assembler/suite are you using? If you're not using the DCS SDK, then I strongly, strongly suggest that you switch to it. If you are, then just comment out that line in the include file; your assembler is just too dumb to know not to infinitely recursively try to expand the macro. Also, you're trying to make an App _and_ you're trying to use DCS functions? That's not going to work well. If you're making an App, kill the dcs7.inc include, and lay out the framework for the signature and header.
Kerm, I'm using Wabbitcode. And, I just realized the stupidity of throwing the dcs7.inc in there, but thanks for the textual facepalm about it.
  
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 4 of 4
» 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