PDA

View Full Version : TI-74 Program Help



mutantcamel
October 13th, 2009, 05:59 AM
Has anybody any idea what code you would use to save a game within a game on the TI-74? I want to add a load and save feature in the adventure game I modified. The routine should save the player's position in the game and what he's carrying etc...

I can get the messages to appear ok on screen and the program then starts to save, but it never stops.

I'm not sure if you have to name the file at all, "GAME". Also I think I'm using the correct syntax with the open and close bits. Can anyone spot anything obvious? I tried reading the user guide but that wasn't any help!


6000 INPUT "IS YOUR CASSETTE READY?";Y$
6010 IF Y$<>"Y"THEN 6000
6020 OPEN #1,"1.GAME",OUTPUT
6030 OUTPUT #1,RM
6040 FOR I=1 TO G
6050 OUTPUT #1,L(I)
6060 NEXT I
6070 FOR I=1 TO W
6080 OUTPUT #1,C(I),F(I)
6090 NEXT I
6100 CLOSE #1
6200 RETURN

7000 INPUT "ARE YOU READY TO LOAD?";Y$
7010 IF Y$<>"Y"THEN 7000
7020 OPEN #1,"1.GAME",INPUT
7030 INPUT #1,RM
7040 FOR I=1 TO G
7050 INPUT #1,L(I)
7060 NEXT I
7070 FOR I=1 TO W
7080 INPUT #1,C(I),F(I)
7090 NEXT I
7100 CLOSE #1
7200 RETURN

JGardner
October 13th, 2009, 06:43 AM
Have'nt wrestled with device #1 in a while, but IIRC

6080 OUTPUT #1,C(I),F(I)

Formats each value as part of a 255 byte record - This can take awhile.

Check the Programmers Reference Guide - "Input", "Output", & so on
for formatting info.

Jack

JGardner
October 13th, 2009, 06:57 AM
[
Check the Programmers Reference Guide - "Input", "Output", & so on
for formatting info.

/QUOTE]

Also "Open". It's a bit complicated, at least for my mental dentition - I
had to construct some test pgms to get it all straight. Of course now
I've forgotten it all...:stupid:

Jack

JGardner
October 13th, 2009, 03:05 PM
Another useful exercise is to write data to a file on your PC using the different
"OPEN" options, and then examine what's actually written to the file with DEBUG.

TIIF.exe will let you create random-access files, if you're interested in that.

Jack