Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jerros

Pages: 1 ... 7 8 [9] 10
121
ASM / Re: Weird "Call" command error, please help! (ASM TI-84+)
« on: May 18, 2010, 04:56:07 am »
I need to convert the .z80 into a .bin for that...
Can tasm do that?
I've loked into some forums, but all the instructions fail...
Keep getting:

            source file open error on *MyProgram'sName*

122
ASM / Re: Weird "Call" command error, please help! (ASM TI-84+)
« on: May 18, 2010, 03:42:19 am »
Game is practically working (exept that it isn't because of the 8 kB limit).
All thats left is to work out the achievements/score system.
Game is nearly finished, but I'm still struggling with converting my prog to an app.
I found the Wabbitsign tool, but I must be doing something wrong, since i get a "source file open error" when I do what wabbitsign tells me:
It sayd I've got to:

Do the following at the command line to assemble your code into binary format and then sign.

   tasm -80 -i -b infile.z80 outfile.bin
   wabbit outfile.bin App.8xk

So I go to my c:\asm\tasm and there I type the first line (with infile and outfile filled in ofcourse), but then I get that "source file open error".

But first I must learn how to turn my program into an application, THEN i can use AppVars :P



Anyway, I'll struggle on and see where I strand, you've really been a big help Quigibo!

123
ASM / Re: Weird "Call" command error, please help! (ASM TI-84+)
« on: May 18, 2010, 02:31:28 am »
Oh, are they just simple non-executing data?  Much simpler!  You can create variables in ram instead of in the rom (as long as they fit there) by just defining them to be there.  If they need to start initialized with some value, just make sure you initialize it all at the beginning of the program.  

Nice, it's working!
And when I edit the program, then re-send it to my calc, the scores won't disappear, which is great to! (else every time I'd release an improved version of my game, all scores/progress would be lost).
I don't really get how it works though, is it save?
Or do the variables easely get overwritten?

Ah, I suppose it doesn't matter.
It's working like a charm right now, so all is fine.
Now I just need to find out how to turn the programm into an app, which I'm sure google will help me with that  ;).

anyway, thank you for this.

124
ASM / Re: Weird "Call" command error, please help! (ASM TI-84+)
« on: May 17, 2010, 10:54:06 am »
Brilliant, though I'm not sure I completely understand...
I'm not saving complicated stuff (no routines, just data), just numbers (Hi-Scores ect.).
The way I'm saving stuf now is with:

Code: [Select]
    b_call(_PushRealO1)    ; First line of the programm
stuff
stuff
stuff
LabelQuit:
   b_call(_PopRealO1)
    b_call(_ChkFindSym)
    LD    HL, DataStart - $9D95 + 4
    ADD    HL, DE
    EX    DE, HL
    LD    HL, DataStart
    LD    BC, DataEnd - DataStart
    LDIR
     ret

DataStart:
Score1: .DB 0, 0       ; Here goes the stuff
Points2:  .DB        0           ; I want to save.
DataEnd:

If you can give me a concrete exemple of how I save stuff "outside" the programm, so I can turn it into an APP for the 16kB limit, that would be great.
thnx

125
ASM / Re: Weird "Call" command error, please help! (ASM TI-84+)
« on: May 17, 2010, 02:00:28 am »
Good advice to turn it into an app, though I don't know how, but that should'nt be hard to figure out.
As for DJ Omnimagas idea, I don't think that's going to be possible in my programm, but thanks for the idea.

I do have self-modifieing code in it (hi-scores, achievements ect.), but you're suggesting I store that outside of the main programm, into a smaller programm just for the scores?
No idea how to, but I'll do some reading and reasearching and stuff.

Thank's for the reply, I've been stuck with big questionmarks for weeks, since I didnt knew a progream should stay under 8 kB, so I was thinking the errors were in my script.
It made me crazy to go over and over the script again, searching for an error that wasn't there...

Thanks.

126
ASM / Weird "Call" command error, please help! (ASM TI-84+)
« on: May 16, 2010, 09:24:11 am »
There's no reason why my script isnt working:
(Do I have to post what's "inside" the calls? I dont think its relevant...)
Code: [Select]
*some codes*
CALL newsprr1n1 ;Just some stuff, not important I think...
LD B, 6 ;
CALL hidemoveshowncount ;
JP Label ;Gets executed, nothing wrong

;But if I do this:
*some codes*
CALL test123 ;Ram-Reset :C
JP Label ;Doesn't get executed. Ram resets the previous line.

test123:
CALL newsprr1n1 ;The EXACT same stuff!
LD B, 6 ;
CALL hidemoveshowncount ;
ret

What is the matter?
Am I missing something obvious?
Why does the call result in a crash?

MAYBE it has something to do with the fact that my program is over 8kB.
I've read (in the ASM-in-28-Days tutorial) that I should keep programs for the TI 84+ below 8kB, but that's impossible since I'm making a game.
But why shouldnt programms be larger then 8kB?

That might not be related to the errors though, I'm just guessing (and I want to know what's the deal with that 8kB limit).

ANY help at all would be greatly appreciated!

*EDIT*

Okay, I'm quite sure it has something to do with the limit now.
I moved the piece of malfunctioning script from the bottom of my script to the top, and now it's working perfectly fine.
Please explain the WHY, and HOW I fix it?

127
ASM / Re: Whats wrong with my dividing script? ASM TI 83/84+
« on: May 12, 2010, 01:25:53 am »
Loading directly into B is much smarter ofcourse, I do that everywhere.
I'm not sure why I didn't do that here :O
But you can't do:

   LD   B, (label)

Right?
That would still need the:

   Ld   A, label
   Ld   B, A

Apart from that, the    CALL   hidemoveshowncount    Started with:
Code: [Select]
hidemoveshowncount:
LD A, B
LD (counter), A
           ---code with lots of stuff, calls ect.---
LD A, (counter)
LD B, A
ret
But I'm using puch/pop now.
push/pop is smarter, thnx, that works perfectly fine.

Anyway, the main problem was:
Why did the 16th "   LD   A, *number*" caused a crash?
Do I have to post the big "hidemoveshowcount" routine for that?
It's quite large...

I suppose it doesnt really matter now that I'm avoiding that command and just load things directly into B, but I'm still curious, and it might error again.
I need to test some more things, but for now I'm avoiding the problem, rather then fixing it.

Oh, and one last question, is it possible to do something like:
Code: [Select]
djnz "CHANGING LABEL"
I mean having a Jump command to a different label each time it passes that line?

Once again, BIG Thank-You! to the people that helped me here (especcially Quigibo again n_n)

128
ASM / Re: Whats wrong with my dividing script? ASM TI 83/84+
« on: May 11, 2010, 08:56:33 am »
Ok, good reason not to delete ^^
I found WHAT is making the lot crash, but I'm really really puzzled on WHY its making things crash.
Heres the thing:
(this is just a small piece, there's more but I dont want to bother you with it unless you think it might be usefull to post)

Code: [Select]

             CALL gamescreen
CALL newsprr1n1
LD A, 9
LD B, A
tbdn1:
CALL hidemoveshowncount
djnz tbdn1
CALL newsprr2n2
LD A, 9
LD B, A
tbdn2:
CALL hidemoveshowncount
djnz tbdn2
CALL newsprr3n3
LD A, 9
LD B, A
tbdn3:
CALL hidemoveshowncount
djnz       tbdn3
ect. ect. ect. ect. untill:
CALL newsprr4n14
LD A, 9
LD B, A
tbdn14:
CALL hidemoveshowncount
djnz tbdn14
CALL newsprr5n15
LD A, 9
LD B, A
tbdn15:
CALL hidemoveshowncount
djnz tbdn15
CALL newsprr1n16       ; THIS is where it crashes. Works fine up to this point. It doesnt matter what number I use, newsprr@@n$$ (with @@ being a number between 1-5 and $$ is 1-16) wil ALWAYS result in ram-cleared.

To help you help me, the "CALL   newsprr@@n$$" (with @@ being a number between 1-5 and $$ is 1-16) is this:

Code: [Select]
newsprr@@n$$:
CALL newrow@@call    <-- here
CALL newspr$$call ; THIS doesnt ever get executed, so the problem must be   ^
CALL putnewcall
ret

The error must be in    "CALL   newrow@@call", because If I remove the rest, the script still fails:

Code: [Select]
tbdn15:
CALL hidemoveshowncount
djnz tbdn15
JP thebluedanubescrn  ; WORKS! it jumps and all is OK.


tbdn15:
CALL hidemoveshowncount
djnz tbdn15
CALL newrow@@call ; FAILS, the jump doesnt get executed and the program crashes.
JP thebluedanubescrn

So what's in "newrow@@call" ?
This is:
(remember, @@ = 1 to 5, but it doesnt matter what I use, it always fails)

Code: [Select]
newrow@@call:
LD A, "insert any number here"
LD (xpos), A
ret

Now , lets remove the call So I can see what causes the trouble:

Code: [Select]
tbdn15:
CALL hidemoveshowncount
djnz tbdn15
LD A, "insert any number here" ; = CALL newrow@@call
LD (xpos), A ; = CALL newrow@@call
JP thebluedanubescrn ; Doesnt get executed, ram-reset here ^


The above fails, So I remove 1 line to close in the Problem:

Code: [Select]
tbdn15:
CALL hidemoveshowncount
djnz tbdn15
LD A, "insert any number here"
; Removed "LD (xpos), A"
JP thebluedanubescrn ; Still doesnt get executed, ram-resets.

So now we've got:

Code: [Select]
[code]
tbdn15:
CALL hidemoveshowncount
djnz tbdn15
JP thebluedanubescrn ; Works!

tbdn15:
CALL hidemoveshowncount
djnz tbdn15
LD A, "insert any number here" ; FAILS HERE
JP thebluedanubescrn ; doesnt get executed, ram-resets.

So the problem in the line --LD      A, "insert random number"---
WHY does loading something into A make my ram reset?
And, whats even stranger, WHY doesnt it fail the 15 times before that?

This is why I didnt post so many details earlier, i dont wanna bother anyone...
But still, ANY help would be greatly appreciated :P
It's just that I'm getting really close to finish the game, but I'm puzzled by this error...[/code]

129
ASM / Re: Whats wrong with my dividing script? ASM TI 83/84+
« on: May 11, 2010, 06:45:00 am »
Thanks for your reply, tr1p1ea, but I stick with waht Quigibo told me.
That looks like it works fine, so my problem must be somewhere else.

Can't I delete my topic once I've had my answer? :O

130
ASM / Re: Whats wrong with my dividing script? ASM TI 83/84+
« on: May 11, 2010, 01:34:18 am »
Thanks, there should be nothing wrong with the division now, so (Scoremeter) should hold 63-((score)/16).
This means that when the score is
0-15, (scoremeter) holds 63
16-31, (scoremeter) holds 62
32-47, (scoremeter) holds 61
ect.
This still isn't working, but at least now the problem isn't this part of the script, but I still can't spot anything why my script still isnt working...
There's 2 things not workingin my script, this and something else, so there might be a connection.
I don't want to post the whole thing, since I cant ask from anyone to quickly correct quite a big piece of code.

Anyway, thanks for your help.
I hope I can figure things out myself, but otherwhise I might need your help once more >.<
My game is nearly finished, and it hurts to see things not working properly when I'm so close to the finish line...
So thanks for helping me with the division part!

131
ASM / Re: Whats wrong with my dividing script? ASM TI 83/84+
« on: May 10, 2010, 01:22:13 am »
Ok, I'll try that, thanks.
Oh, and "Score" and "score" are the same variable, just a typo from me >.<
The Idea was that ny multiplying, I would get the Division into H:

Code: [Select]
    LD    HL, (Score)      ; Score holds any number from 0 to 992 (16*62)

; 256 ÷ 16 = 16, find (Score) × 16
; Lets say (score) = 139, so I want 8 as my answer:
    ADD    HL, HL    ; HL = $0116
    ADD    HL, HL    ; HL = $022C
    ADD    HL, HL    ; HL = $0458
    ADD    HL, HL    ; HL = $08B0      ; Tadaa! H holds 8 right? which is 139/16!

LD DE, $100
ADD HL, DE       ; HL = $09B0
LD A, H          ; A = 9
NEG                       ; A = -9
LD B, 63
ADD A, B         ; A = 54
LD (ScoreMeter), A      ; Scoremeter = 54! Exept that it isn't for some reason...

Somewhere's a flaw, but I dont see it...
Anyway, I'll try your code, it seems shorter, faster and thus better, so if that works it's not really important why my script doesnt work.
Thanks again Quigibo, this is the 3rd time already you've helped me  ;D

132
ASM / Whats wrong with my dividing script? ASM TI 83/84+
« on: May 09, 2010, 11:23:32 am »
What I want the next piece of scrip to do is:
-Increase (score) by 1
-Divide (score)/16 (lets just call the result "P")
-I only care about WHOLE numbers, I don't need the remainder.
-Do: 63-P (which will result, lets say: "Q")
-Load Q into (scoreMeter)

Code: [Select]
LD A, (Score)
INC A
LD (Score), A
LD HL, (score)
ADD HL, HL
ADD HL, HL
ADD HL, HL
ADD HL, HL
LD DE, $100
ADD HL, DE
LD A, H
NEG
LD B, 63
ADD A, B
LD (ScoreMeter), A

The idea is that there's a meter to show you you're score.
The value in (scoremeter) will be used as an Y-coordinate for the sprite of the meter.
But the above script doesnt really work (which you of course find obvious n_n).

Any help would be apreciated!
Thank you in advance.

133
Perfect!
Thanks alot.
This will certainly help me much, thanks for the trouble.

134
I got a bunch of sprites on the screen, and now I want to check wich (if any) match some coordinates set by me.
So, lets say, there are 10 8x8 sprites on the screen, and I want to check if one has Xpos=30 and Ypos=40, plus I want to know which sprite that would be.
Is the code going to look like this?:

(...)
     LD     A, (XposSprite1)
     CP    30
     JP     Z, Sprite1XisTrue
     LD     A, (XposSprite2)
     CP     30
     JP     Z, Sprite2XisTrue
     LD     A, (XposSprite3)
     CP     30
     JP     Z, Sprite3XisTrue
ect.

And then make another for all Y-coordinates.
This doesn't look very efficient, so I wonder if anyone can make a small example of how to do this much better.

Thanks in advance!

135
First of all, thank you for your kind reply.
It's true that I'm quite new to assembly, but I've managed to do quite much in only about 2 months.
As for the routine suggested byQuigibo, I'll try that out, thanks.

I'm very imatience, so I indeed might be rushing into things I dont have a clear understanding of, but I'm a fast learner n_n.
Just one more thing though, you were talking about a "pause for timing" part, but I guess that's just made of some time-consuming commands that don't actually do something, right? (like some NOP's os something... I'll look into that later).

Thank's a lot, I'll see how far I come now!

Pages: 1 ... 7 8 [9] 10