MSX BASIC: How to combine .BAS and .SC1 to one (.BAS?) .ROM file?

Page 1/2
| 2

By ray2day

Hero (662)

ray2day's picture

09-02-2011, 18:20

Slowly I am starting up a new MSX BASIC game project. And this time I use the 'SCREEN1 EDITOR'-programm (from the 'MSX Gids' magazine) to design characters and graphics. It is much easier to design this way and easier to put it directly into my MSX memory. The output, as most of you know, is a binairy .SC1 file. At the moment I bload it directly in my computers memory using BLOAD "FILE.SC1",r in the MSX BASIC listing.

I'm testing and planing everything. Therefore I'm having the next question;

What is the easiest way to 'integrate' this binairy .SC1 file later on in- or with my .BAS file to one .ROM-file?
And can someone give me an example how to do that in a simple way?

(with Mission2Mir I typed the data manually in the listing / and finally I used JLTurSan's ROMCreator en BiFi's BAS2ROM to create my .ROM-file)

Hoping someone can help me with this question...

Regards,
ray2day

www.raymondmsx.nl

Login or register to post comments

By ray2day

Hero (662)

ray2day's picture

10-02-2011, 20:43

anyone?

By Tanni

Hero (556)

Tanni's picture

10-02-2011, 21:02

I don't know the program you mention, and I don't know if I understand you correctly, but what about the classical way with DATA lines? You can write a little program for reading the .SC1 file and creating a text files with the approbriate DATA lines. Then merge it to the BASIC program.

By Fabf

Champion (258)

Fabf's picture

10-02-2011, 21:04

A rom with basic is limited to 16KB
How long is your SC1 file ?
If it's short enought you can copy it to ram, BSAVE it and after add it to basic with ROMcreator
Then just transfert data from RAM to VRAM with basic if you have time or with asm in half a second

By NYYRIKKI

Enlighted (5837)

NYYRIKKI's picture

10-02-2011, 23:04

@ray2day
can you please do:

OPEN "FILE.SC1" FOR INPUT AS #1:A$=INPUT$(1,1):FORI=0to2:?HEX$(ASC(INPUT$(1,1))+ASC(INPUT$(1,1))*256):NEXT:CLOSE

... and post the result... After that it is easyer to reply...

By ray2day

Hero (662)

ray2day's picture

10-02-2011, 23:06

Thanks guys for the feedback.

@Tanni; Nothing wrong putting it as DATA lines in my BASIC listing.
- But indeed then I have to convert the .SC1 file to text cq. data lines. How to do that? In fact that is part of my question.

@Fabf; Thanks for giving me advice about the other option. I read indeed ROMcreator has the option to add binairy data. Don't know the .SC1 size yet, that's the reason why I'm examining this before.
- So BLOAD-ing it into my computers RAM memory and then BSAVE-ing it (as .BIN file I asume) will give me a pure binair file (suitable for adding it to BASIC using ROMcreator)?
- Like you said a ROM with BASIC is limited to 16KB (I faced that problem while making Mission2Mir also). Does this simply mean that file size .BAS + file size .SC1 =< 16KB -in theory- will be workable?
- And when you say 'just transfer the data from RAM to VRAM' you mean I have to call/do/include this in my BASIC code? How to do that? Is there a possible ML routine I can use in my BASIC code to speed this process up?

Thanks again...

By ray2day

Hero (662)

ray2day's picture

10-02-2011, 23:17

@NYYRIKKI; My .SC1-file is not completely finished yet, but for 'MSX learning@MRC' here is an example of the result at the moment;

0
AC00
FF00

By NYYRIKKI

Enlighted (5837)

NYYRIKKI's picture

10-02-2011, 23:23

Eh... In this case doing BLOAD "FILE.SC1",R will crash your MSX... and no, there is no way to put this file to normal ROM, it is way too big.

By Imanok

Paragon (1188)

Imanok's picture

11-02-2011, 00:18

I think the easier way to do it, is putting all the files into a DSK with an AUTOEXEC.BAS and convert it into a ROM with DSK2ROM Smile

By Tanni

Hero (556)

Tanni's picture

11-02-2011, 00:57

Thanks guys for the feedback.

@Tanni; Nothing wrong putting it as DATA lines in my BASIC listing.
- But indeed then I have to convert the .SC1 file to text cq. data lines. How to do that? In fact that is part of my question.

What does cq. mean?

You could write a little BASIC program which generates a line number, puts it on the screen. Then it should issue the word DATA and then a list of values in whatever form you like read form your input file. I recommend hex encoding, because it needs less space then decimal. You also could encode it in a string, but then be careful about the quotes. (If a quote occures as part of the data, you must encode it somewhat different.) Then it should locate the cursor somewhere in that line, increase the line number variable by the desired amount and terminate. You just need to press the RETURN key and start the program again with a GOTO to the line where your little BASIC program starts to generate the DATA line. This is essential, because starting it with a RUN will reset all variables. Best, the program prints a GOTO to said line right after the generated DATA line. Then you just need to press RETURN twice. Note that you must not jump to the line which initializes the line number variable. Be careful that the numbers generated by your program aren't the same like the line numbers of that program, otherwise you will replace your programm code by a DATA line. At least that is the way to go, IIRC. I once used that method to generate data lines for whatever. I'm not sure if it was on MSX or on VZ200. It is best to do a CLS before printing the DATA line.

By ray2day

Hero (662)

ray2day's picture

11-02-2011, 18:31

cq. (casu quo) means something like and/or

Thanks for the info. Sounds easy, but to programm that is I think difficult (for me). I have to try.

Do you know if there is such programm (which converts into the RAM bloaded DATA to MSX BASIC DATA-lines) for MSX to find on the internet maybe?

Page 1/2
| 2