PT_ wrote:
the only thing I need to do is doing weird stuff with C functions and get that working Smile


After you finish off putting this in C, how easy would it be to add your own C (or ASM) functions to the ICE compiler?
If you mean new functions like GetBASICVar( etc, pretty easy. Basically the framework is already done for every function, I just need to add the code Smile
TheLastMillennial wrote:
...a program I never touched with ICE installed got changed.
It changed every 'Sy' with 'GetBasicVar('

Here's an idea: only change the tokens/only have the hooks when editing a program with the proper header.
Also, it's burdensome to keep referencing the command list. If something like the catalog help could be worked into ICE, that would be great!
(Same goes for colors, except they are harder. How about something like Merthsoft's GOL color chooser to automatically insert the color code?)
I do most of my programs on TI Connect CE, so I have to use custom tokens like: maxY for DefineSprite(. It would be nice to just be able to enter DefineSprite( for DefineSprite(.


Full Listing of ICE Tokens:

Code:
minY : ExecHex(
maxY : DefineSprite(
    : Call
Σy   : CompilePrgm(
Σy²  : SetBASICVar(
Sy   : GetBASICVar(


Also, I Found some problems:

Code:
[i]FAIL
(C*C)/(S*S)-(D*D)/(S*S)+(G*S)/(S*S)→E
2*C*D/SS+HS/SS→F
If (((E*E)+(F*F))/(S*S)))>4
det(2,1+remainder(θ,256)
det(6,A,B
100→θ
End

Freezes ICE when it is told to compile it.


Code:
[i]FAIL
If L₆(2)≤L₂(2)
End


I assume this is similar to the < problem.

I would also like to know what the max values for a sprite are.
Yep, it is indeed the same bug as the < problem, and I still need to solve it somehow Sad

The max values for a sprite are its dimensions? If so, 255x255, but that is way too large, your program can't fit that Razz

EDIT: I've fixed it, whenever it has been accepted into the Archives, you can download the new one.
Fixed the thing that YMAX isn't set correctly in SetClipRegion, most of the time, re-uploaded, but not accepted yet.

In my C version, I'm very good busy now, I got C functions done! (well, no, but now they have the same structure as normal functions, cleanup works right etc), and I hope to make good progress, despite CC20 and AoCE Smile
So PT_, this is sort of what I was talking to you about earlier. Why doesn't it work?


Code:

AAA
det(0)
det(5,255
det(2,100
det(42,0,0,100,100
det(2,20
det(43,0,0,10,10
det(36,0,0,10,10
0→G
Repeat G=15
getKey→G
If G=4
det(46,2
End
If G=1
det(45,2
End
If G=2
det(47,2
End
If G=3
det(48,2
End
End
det(1)
Why does this not work? You are shifting the clip, but that doesn't mean the clip bounds get shifted, so you are shifting within the clip, which means you see nothing changes, because the entire shift is a single color Wink
PT_ wrote:
Why does this not work? You are shifting the clip, but that doesn't mean the clip bounds get shifted, so you are shifting within the clip, which means you see nothing changes, because the entire shift is a single color Wink

Are you saying that when I shift the clip I need to move the clip region? My goal in the above code was to move a small square around the screen, the det(36,0,0,10,10. I'm not sure I quite understand what you are saying.
The clip is (0,0,10,10), so despite you shift the screen, everything will still be displayed in the clip. If you change your clip to (0,0,50,50), you would see a better result.
Hmm... I but when I set the clip region to (0,0,100,100), the entire background square seems to move even though it is a det(42. I think I may just avoid clipping for now. Thanks for your help PT_!
How is the C version going ?
Hey Everyone,

I've been trying to work on the hunting part of the Oregon Trail, but I've ran into a bit of an issue. At the moment I'm trying to make a hit-box system that checks if you hit an animal.
It goes like this:

Code:
Lbl HIT
120->X
160->Y
remainder(rand,230)->V
0->Z
Y+10->L3(1)
Z+32->L3(2)
V+18->L3(3)
   If L3(1)>=Z and L3(1)<=L3(2)
      If X>=V and X<=L3(3)
         det(18,"Hit!",70,180
      End
   End
Return

So what it's supposed to do is detect if the x coordinates are in a certain range, then, if they are, does the same with the Y. The problem is that when compiling, ICE stops at line 10 of this code and says "Something went wrong! Please report it!". I have no idea what's causing this, and I've become stuck. Any help would be greatly appreciated.

Thanks!

-OldNewTimer
Rewrite L3(1)<=L3(2) or download the latest ICE Compiler Wink
PT_ wrote:
Rewrite L3(1)<=L3(2) or download the latest ICE Compiler Wink


Thanks for the advice PT_ Very Happy I literally just flipped L3(1) and L3(2) around and it seemed to do the trick Razz

After I fixed it, I moved on to the saving part of The Oregon Trail and ran into another problem.

Here's the Code (only the saving part):

The BASIC Program To Start The Save Process and Start The Game:
(It Stores the list of the previous game variables to the OS Variables, then starts the game. Afterwords it asks to save and stores the variables into that same list.)

Code:

ClrHome
SetUpEditor ORG
ORG(1)->A
ORG(2)->H
ORG(3)->I
ORG(4)->J
ORG(5)->K
ORG(6)->L
ORG(7)->M
ORG(8)->N
ORG(9)->O
ORG(10)->S
Asm(prgmOREGON
Menu("Save Game?","Yes",A,"No",B)
Lbl A
Disp "SAVING..."
{A,H,I,J,K,L,M,N,O,S}->ORG
ClrHome
Disp "GAME SAVED!"
Lbl B
Disp "PRESS ANY KEY"
Pause
ClrHome
Disp "Thanks for playing!
Stop


It then goes into the main ICE program.

Saving:
(It stores the ICE variables to the OS variables, ends, then resumes the BASIC program)

Code:

[i]End Program
Lbl STOP
L1(1)->A
SetBASICVar(A,A
L1(2)->A
SetBASICVar(B,A
L1(3)->A
SetBASICVar(C,A
L1(4)->A
SetBASICVar(D,A
L1(5)->A
SetBASICVar(H,D
SetBASICVar(I,E
SetBASICVar(J,F
SetBASICVar(K,H
SetBASICVar(M,K
SetBASICVar(N,L
SetBASICVar(O,M
SetBASICVar(S,T
det(1


Loading:
(Takes the OS variables and stores them into the ICE variables, then resumes play at the "size up the situation" menu.

Code:

GetBASICVar(A,A
A->L1(1)
GetBASICVar(B,A
A->L1(2)
GetBASICVar(C,A
A->L1(3)
GetBASICVar(D,A
A->L1(4)
GetBASICVar(E,A
A->L1(5)
GetBASICVar(H,D
GetBASICVar(I,E
GetBASICVar(J,F
GetBASICVar(K,H
GetBASICVar(M,K
GetBASICVar(N,L
GetBASICVar(O,M
GetBASICVar(S,T
Goto SIZE


When I play the game and save it, everything works fine. However, when I try to load the game, my RAM resets. The only time when loading does work is when I set all of the variables to 0. Any and all help would be greatly appreciated! Thanks! Very Happy

-OldNewTimer
OldNewTimer wrote:
PT_ wrote:
Rewrite L3(1)<=L3(2) or download the latest ICE Compiler Wink


Thanks for the advice PT_ Very Happy I literally just flipped L3(1) and L3(2) around and it seemed to do the trick Razz

After I fixed it, I moved on to the saving part of The Oregon Trail and ran into another problem.

Here's the Code (only the saving part):

The BASIC Program To Start The Save Process and Start The Game:
(It Stores the list of the previous game variables to the OS Variables, then starts the game. Afterwords it asks to save and stores the variables into that same list.)

Code:

ClrHome
SetUpEditor ORG
ORG(1)->A
ORG(2)->H
ORG(3)->I
ORG(4)->J
ORG(5)->K
ORG(6)->L
ORG(7)->M
ORG(8)->N
ORG(9)->O
ORG(10)->S
Asm(prgmOREGON
Menu("Save Game?","Yes",A,"No",B)
Lbl A
Disp "SAVING..."
{A,H,I,J,K,L,M,N,O,S}->ORG
ClrHome
Disp "GAME SAVED!"
Lbl B
Disp "PRESS ANY KEY"
Pause
ClrHome
Disp "Thanks for playing!
Stop


It then goes into the main ICE program.

Saving:
(It stores the ICE variables to the OS variables, ends, then resumes the BASIC program)

Code:

[i]End Program
Lbl STOP
L1(1)->A
SetBASICVar(A,A
L1(2)->A
SetBASICVar(B,A
L1(3)->A
SetBASICVar(C,A
L1(4)->A
SetBASICVar(D,A
L1(5)->A
SetBASICVar(H,D
SetBASICVar(I,E
SetBASICVar(J,F
SetBASICVar(K,H
SetBASICVar(M,K
SetBASICVar(N,L
SetBASICVar(O,M
SetBASICVar(S,T
det(1


Loading:
(Takes the OS variables and stores them into the ICE variables, then resumes play at the "size up the situation" menu.

Code:

GetBASICVar(A,A
A->L1(1)
GetBASICVar(B,A
A->L1(2)
GetBASICVar(C,A
A->L1(3)
GetBASICVar(D,A
A->L1(4)
GetBASICVar(E,A
A->L1(5)
GetBASICVar(H,D
GetBASICVar(I,E
GetBASICVar(J,F
GetBASICVar(K,H
GetBASICVar(M,K
GetBASICVar(N,L
GetBASICVar(O,M
GetBASICVar(S,T
Goto SIZE


When I play the game and save it, everything works fine. However, when I try to load the game, my RAM resets. The only time when loading does work is when I set all of the variables to 0. Any and all help would be greatly appreciated! Thanks! Very Happy

-OldNewTimer


Nevermind. I Fixed It. Razz
All I had to do was add a few necessary commands in the basic program to get it working... It's kinda hard to load variables when they don't exist Razz
Alvajoy123 wrote:
How is the C version going ?

Pretty well Very Happy
C functions are pretty much done, and we had a discussion yesterday about implementing 1-, 2- and 3-byte integers, and eventually floats (read: Mateo and Adriweb were discussing things, I only had to listen Razz )

I also confirmed that I understand ASM better than English Evil or Very Mad
Quote 136.

256th post on this thread, yay....

Anyways, I think that even if, say, there were only 4 decimal places available, a whole new door would be opened (with a slam), and I would use ICE for a LOT more than gimmicky graphics and speedy stuff.
You may want to consider doing 16.8 fixed point arithmetic; this would be not too bad on the eZ80 architecture Razz Or you can design wrappers and functions around the IEEE floating point routines Smile
If you would be willing to add an extra byte to the extra byte to the start of the compiled output; it would allow programs to be detected as compiled ICE programs rather than asm programs, just like how C is in Cesium. It's up to you though Razz Simply put, after the $ef,$7b byes just add a single $7f byte Smile
MateoConLechuga wrote:
If you would be willing to add an extra byte to the extra byte to the start of the compiled output; it would allow programs to be detected as compiled ICE programs rather than asm programs, just like how C is in Cesium. It's up to you though Razz Simply put, after the $ef,$7b byes just add a single $7f byte Smile

Okay, that is surely doable. Did you already add that to Cesium? 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
» Goto page Previous  1, 2, 3 ... 12, 13, 14 ... 31, 32, 33  Next
» View previous topic :: View next topic  
Page 13 of 33
» 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