MSX-DOS batch menu (1chipMSX launch game)

Page 1/2
| 2

By Atheus

Expert (73)

Atheus's picture

27-05-2009, 10:06

Hello,

i'm trying to built a game launch menu for my 1chipMSX (under MSX-DOS 2.30).

It's not possible to use the "IF" command with MSX-DOS 2.30, so with a menu like (for exemple) :

Launch menu

1- Mog
2- Penguin

Choice ?

When i try :

If errorlevel 1 goto mog
:mog
romload mog.rom /c /e /s

It doesn't work ...
The "IFF" command is a possible way with command2.com 2.41 ... But what's the correct syntax ?

Other way ; to launch a basic menu with basic menu.bat, but how to use romload, FDE or anything else from basic ???

Thx for your help.

(hope to be clear)
Crying

Login or register to post comments

By MicroTech

Champion (386)

MicroTech's picture

27-05-2009, 14:33

Try: CALL SYSTEM( "yourcmd" ) from BASIC.
Obviously replace yourcmd with your command/batch file name.

Alternatively you should be able to create/modify a "REBOOT.BAT" batch file containing your command, this file should be automatically executed when reentering in DOS from BASIC.

Hope it helps

By NYYRIKKI

Enlighted (5398)

NYYRIKKI's picture

27-05-2009, 14:49

Both solutions are possible... In DOS 2.4x you can do something like:

rem SELECT.BTM
~loop
cls
echo 1-Mog
echo 2-Penguin
echo Q-Quit
input %%key
iff !%KEY%==!1
  echo Loading MOG
  romload mog.rom /c /e /s
endiff
if !%KEY%==!2 romload penguin.rom
if !%KEY%==!Q or !%KEY%==!q goto ~bye
goto ~loop
~bye
cls
echo Bye!

In BASIC you can define what to start in CALL SYSTEM command.
Example:

100 REM load MOG.ROM
110 CALL SYSTEM ("romload mog.rom /c /e /s")

By Atheus

Expert (73)

Atheus's picture

27-05-2009, 18:16

Works great ! MANY MANY thanks !!!
in Dos 2.30 with command2.com (2.41) it works but i got an error message : *** unrecognized command, probably due to msxdos2.sys which is always in 2.30.

Where can I find a msxdos2.sys in 2.41 for FAT16 ?

By Manuel

Ascended (15821)

Manuel's picture

27-05-2009, 19:48

By the way, is there a way to calculate something in DOS 2.41? E.g. I want to map SCSI partition numbers (which start at 1) to IDE partition numbers (which start at 0) in a batch file which is a front end for switching partitions, independent of the actually used system... So, I need something like:

PARTIT.BAT

SET %NR% %2
SET %NR% %NR%-1
IDEPAR %1:%NR%

or whatever the format is.

By msd

Paragon (1372)

msd's picture

27-05-2009, 20:17

you don't need msxdos2.sys v2.30, beter use msxdos2.sys ver 2.20. It uses less ram

By NYYRIKKI

Enlighted (5398)

NYYRIKKI's picture

28-05-2009, 07:24

@Atheus: Nothing to do with MSXDOS.SYS....
ren SELECT.BAT SELECT.BTM
Ok?

By NYYRIKKI

Enlighted (5398)

NYYRIKKI's picture

28-05-2009, 08:05

@manuel: DOS is not a number cruncher... You may anyway try to get around the problem with something like:

SET NR=%@LEFT[!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,%2%]%
SET NR=%@LEFT[%NR%,-1]%
IDEPAR %1:%@LEN[%NR%]%

By Manuel

Ascended (15821)

Manuel's picture

28-05-2009, 18:41

NYYRIKKI: um, how does that work??

An alternative is a calc.com program, but how do you get the result in a batch variable?

By NYYRIKKI

Enlighted (5398)

NYYRIKKI's picture

29-05-2009, 00:47

Line 1: Let's take %2 characters from "random string that is long enough" and put it to NR
Line 2: Let's remove one character from right (still NR)
Line 3: Let's calculate characters of NR and pass the lenght as parameter

Hmm... Maybe this is more easy solution (if 1-9 is enough):

IDEPAR %1%:%@INSTR[1,23456789,%2%]%

If you like to use external program, then better to look (make) one that handles variables internally.

By RetroTechie

Paragon (1563)

RetroTechie's picture

29-05-2009, 01:27


i'm trying to built a game launch menu for my 1chipMSX
(..)
Other way ; to launch a basic menu with basic menu.bat, but how to use romload, FDE or anything else from basic ???

Another way could be to (ab)use the keyboard buffer: you write a menu program in BASIC, make it poke the right keystrokes (ehm... codes) into the keyboard buffer (and a length byte somewhere, IIRC), then do a _SYSTEM. When DOS starts, the keyboard buffer's contents is processed, and effect is like you're typing a command yourself.

I wrote a menu program once that takes different actions (depending on extension of file-to-start), and uses this method to execute .BAT and .COM files. If I'm not mistaken, this works with DOS1 as well as DOS2, so you could use the same menu program for floppy disk and HDD/Flash disk menu's.

Page 1/2
| 2