Development with MSX BASIC

Page 4/9
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9

Par baltasarq

Rookie (27)

Portrait de baltasarq

03-06-2011, 14:50

I guess that creating a text archive for data will be the best option. Where can I find a reference for MSX Basic? I'll need the specific uses of open close and read for files.

Par NYYRIKKI

Enlighted (6016)

Portrait de NYYRIKKI

03-06-2011, 14:57

Download ruMSX emulator... The emulator it self is outdated and not very accurate, but it has very good help files, that explain for example usage of MSX-BASIC.

The file reading goes something like this:

10 open "FILENAME" for input as #1
20 line input #1,A$
30 PRINT A$
40 if not eof(1) then 20
50 close

Par baltasarq

Rookie (27)

Portrait de baltasarq

03-06-2011, 17:02

Thank you all for your help. I expect that separating data about objects and locations, I will be able to have a working prototype soon.

Par Metalion

Paragon (1622)

Portrait de Metalion

03-06-2011, 18:09

In general, I have to say that this BASIC is probably the most limited one, compared at least to Sinclair's and Amstrads.
You got to be kidding, right ?
I cannot agree with you there ...
OK, perhaps the Amstrad BASIC is superior, it is indeed famous for being a very good BASIC.
But the Spectrum's ??? ... Come on !

Comparison to MSX Basic :
- No BASIC command for sprite definition and management
- No BASIC command for music play and sound parameters
- No "RENUM" command.
- No "ON INTERVAL" command
- No error management instructions
- No joystick management instructions
- Compulsory "LET" instruction, obfuscating the code
- String variables limited to 1 character
...

The MSX Basic was way ahead of the Spectrum's in every way.
I know, because that was one important criteria for me at the time.
I choose to buy an MSX because it's BASIC was so much more advanced than others !

I think that in your case, you just bumped into a major problem to port your game to MSX linked to the graphical possibilities of the machine. It is indeed impossible to have mutliple colors on the text modes (at least without having to work for it).

But the BASIC has nothing to do with it, it is just the hardware that is like that !

Par cax

Prophet (3740)

Portrait de cax

03-06-2011, 20:37

baltasarq, can you upload the current draft of your work, after code optimizing you've done, so we can look at source and make you better suggestions ?

Par baltasarq

Rookie (27)

Portrait de baltasarq

04-06-2011, 18:41

@Metalion, Spectrum Basic at least leaves most of the RAM (about 40k) for your program. The memory left by Microsoft Basic (28K) is ridicolous (even 5k less if you add a disk drive). Color management is actually (surprisingly) very limited (while the MSX1 is not a monochrome machine). String management in Sinclair Basic is awesome, even better than the one provided by Locomotive Basic.

These are facts; not opinions. Obviously, they are biased by my own experience (porting a text game). Maybe some other projects will experience more benefits from MSX Basic (sprites and so on).

Par baltasarq

Rookie (27)

Portrait de baltasarq

04-06-2011, 18:48

I've modified the code to load room descriptions and object descriptions from a text file. This worked as a charm for memory saving: 10k free after loading the code into memory. However, I get a "out of string space" memory error in line 5020. This is the code:

5000 LS=51:DIM H$(51)
5010 open "locdescs.txt" for input as #1
5015 FORN=1TOLS
5020 line input #1,H$[N]
5030 NEXT N
5040 close #1
5050 RETURN

The longest room description is of les than 180 bytes. I'm just expecting that each line of the locdescs.txt file will be read as a room description. Maybe is just a matter of the line ending (CR+LF, CR, LF?), or maybe I am missing something big. Any idea?

Thanks again,
Baltasar

Par baltasarq

Rookie (27)

Portrait de baltasarq

04-06-2011, 18:52

@cax, many thanks for your interest, I'll try to upload it on monday, I cannot do it now.

Par jltursan

Prophet (2619)

Portrait de jltursan

04-06-2011, 19:51

Prolly you need to increase the size of the string variables area. Try with CLEAR 10000 if you're going to load to memory all the room descriptions. Working this way, your recently saved 10K will be more or less wasted again...Evil

Try to create 51 description files and load them only on demand. Using individual data files you'll be easily able to add other info (attributes, graphics, etc.).

Par baltasarq

Rookie (27)

Portrait de baltasarq

04-06-2011, 20:20

@jltursan, it worked with CLEAR 5000, CLEAR 10000 was to harsh for memory and the basic program loaded. I printed the contents of H$(1) and it has various lines inside it, while each line in the data file holds just one description per line. I don't know whether the problem is that it is unable to read line by line, or that the end line char combination is not correct. I'll experiment with this a little bit, or try with the big ON x GOTO possibility.

Page 4/9
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9