Page 1 of 1

Meido Menu v1.2

Posted: February 4th, 2014, 1:34 am
by LameGuy64

Meido Menu

Username: Lameguy64
Project Title: Meido Menu
Time to Complete: 1 week
SDK: Psy-Q
Genre: Boot Menu
Latest Release: 1.2
In Development: No (for now)
Initial Release Date: 03-FEBRUARY-2014
Last Date Updated: 21-FEBRUARY-2014
Controller: STANDARD PAD
Players: 1
Memory Card: None
Languages: English
Region: Auto
Burn and Play: Yes
Executable Included: Yes
Source Included: Yes

This is a multi-purpose boot menu program I've put together to help Shadow create compilation discs for this year's CodeBlast competition and as a nice contribution to the community since there hasn't been a decent boot menu ever since other than Loser's Boot Menu which was ugly and hard to use.

Features:
- Automatic NTSC/PAL selection (through checking the system's BIOS).
- Cool screen clearing effect on start-up (does not work in emulators).
- Simple yet pretty looking menu presented in hi-res 640x480 mode.
- Background music using Silpheed/HITMEN's HITMOD library.
- Can display up to 32 titles but can be expanded by altering the source.
- Can load EXEs of up to 1672KB in size.
- Includes a 'returner' library for implementing an option into your homebrew game/app to 'return' back to this menu.

Image
(All titles in the screenshot except Marilyn are fake)

PS-EXE, ISO and Source Code: http://www.mediafire.com/download/19t10 ... _(v1.2).7z
PS-EXE, ISO and Source Code Mirror: http://www.psxdev.net/forum/download/fi ... iew&id=502


Re: Meido Menu (A Multi-purpose Boot Menu for the PlayStatio

Posted: February 4th, 2014, 4:52 am
by Shendo
Great job. Looks awesome.

Also, if a launched application returns from a main function there is a way to run the menu again.
Check out Martin's document for more info.

Re: Meido Menu (A Multi-purpose Boot Menu for the PlayStatio

Posted: February 4th, 2014, 8:16 am
by jman
Thanks for sharing!

Re: Meido Menu (A Multi-purpose Boot Menu for the PlayStatio

Posted: February 4th, 2014, 10:34 am
by LameGuy64
Shendo wrote:Great job. Looks awesome.

Also, if a launched application returns from a main function there is a way to run the menu again.
Check out Martin's document for more info.
I don't think that is possible with my menu as it is more than likely destroyed by the time the game has taken over (it loads itself in 0x80160000 while games usually load in 0x80010000)... Unless LoadExec() is called there to load the menu back. I made it this way as it is the most stable loader method that I could come up with so far.

Re: Meido Menu (currently broken)

Posted: February 11th, 2014, 7:04 pm
by LameGuy64
I recently found a serious problem in this menu where it cannot load any EXE when run on a real PlayStation for some reason... This is going to be a tough one to fix as it works perfectly on a PS2 (under compatibility mode) and an emulator but not on real hardware.

Re: Meido Menu v1.2

Posted: February 21st, 2014, 10:53 pm
by LameGuy64
I finally found another way to load EXEs other than LoadExec() that actually works on a real PlayStation. Also, I've optimized the memory usage so it can now load EXEs of up to 1672KB in size.

Re: Meido Menu v1.2

Posted: February 22nd, 2014, 8:28 am
by Shendo
Glad you got it sorted out. It's weird though, LoadExec() while buggy should work for launching EXEs from CD.

Re: Meido Menu v1.2

Posted: March 6th, 2014, 1:14 pm
by Shadow
LoadExec() works fine if you use it right. Remove StopTAP() and UnprepareXA() accordingly to your use. IE: StopTAP may need to be replaced with PadStop(). You can understand the gist of what needs to be done though :P

Code: Select all

StopTAP();
UnprepareXA(Oldcallback);
CdSync(0, 0);
ResetGraph(3);
StopCallback();
printf("\nMAIN.EXE PS-EXE [RESTART]\n\n");
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); // 40 x returns
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); // 40 x returns
_96_remove();
_96_init();
LoadExec("cdrom:\\MAIN.EXE;1", 0x801FFFF0, 0); // restart from the PS-EXE on the CD-ROM

Re: Meido Menu v1.2

Posted: March 6th, 2014, 4:35 pm
by LameGuy64
I still prefer loading EXEs manually as I can do a little animation while the EXE is being loaded though that method, giving that illusion of very fast loading times.

Also, can you confirm if LoadExec() can load another EXE that reside in the same address where your main program is loaded? The last time I tried doing that ended up crashing the system.

Re: Meido Menu v1.2

Posted: August 25th, 2014, 8:41 pm
by cosi
Thank you for this awesome menu.

I just need to change menu music (Put FFV Intro) and add some game rips to menu. As you see, i am newbie :D on this subject and ask you if there is a tutorial or method to put games on the list (change which file after putting game files to each folder etc...)

Thanks in advance.......

Re: Meido Menu v1.2

Posted: August 25th, 2014, 10:05 pm
by LameGuy64
For now, you can't change the menu's background music as it is in a form of a specially converted MOD file... As for adding game rips to your compilation, your mileage on it may vary as it can get very complicated sometimes depending on the game you wish to add and it requires use of special CD mastering tools that may not work well on new computers.

Re: Meido Menu v1.2

Posted: November 1st, 2014, 11:26 am
by Shadow
Here is some useful code for HITMOD I wrote a while back.
It can make images or sprites dance in beat with the MOD fairly accurately.
Perhaps it will be useful for other projects :shrug

Code: Select all

// tweaking and experimenting is required for different MOD files
if((MOD_LastSample[3]==7) || MOD_LastSample[3]==21) Tim.v=0;
else Tim.v=35;
Also, I noticed you're loading child PS-EXE's and not parent PS-EXE's over the top of your menu?

Re: Meido Menu v1.2

Posted: November 1st, 2014, 11:44 am
by LameGuy64
No, the menu loads itself high above the 2MB memory space and stores its resources at 0x80010000. When a game is selected, it'll load the game's PS-EXE to its respective memory address (usually at 0x80010000) and then execute it... Its a very simple trick yet it works extremely well so far.

Re: Meido Menu v1.2

Posted: November 1st, 2014, 11:54 am
by Shadow
LameGuy64 wrote:No, the menu loads itself high above the 2MB memory space and stores its resources at 0x80010000. When a game is selected, it'll load the game's PS-EXE to its respective memory address (usually at 0x80010000) and then execute it... Its a very simple trick yet it works extremely well so far.
I take it that's a typo. You can't load above the 2MB limit (0x80200000) unless you have >2MB of DRAM :P

That's interesting, because you can actually load the new PS-EXE directly over the existing one.
That technique is what I did in the PSIO Menu System and it works rather well.
Using the child technique is only useful if you wish to return back to it.

For example, DEMO's used this technique and I take it SIOCONS for the Net Yaroze too. PSXSERIAL also uses the child technique so the user can jump back to the start address (0x80010000) and load in another PS-EXE via serial.

Your method suits the Meido Menu nicely though because LoadExec(); directly has no return, but really a child process should not be used so it provides you will much higher RAM. Now, i've read that ACCOLADE (the guys who made the infamous "Bubsy 3D" >_>) would memcpy(); the LoadExec function to a safe place in RAM so they could actually escape back from it on error, thus not overwriting the parent PS-EXE and crashing the game.
I have not been able to replicate this technique however. Instead, the PSIO menu will hang if an invalid image is attempted for load.

More information from Sony:

Code: Select all

$PSDocId: Document Release 1.0 for Run-time Library Release 4.4$       

module: Program reading and execution

                       Copyright(C) 1997 Sony Computer Entertainment Inc.
                                                     All rights reserved.
                                               Aug 15, 1997 Ver.1.4 yoshi

<Description>

There are 3 ways to read programs on a CD-ROM to execute.

   1. Executing the Exec() after reading EXE file with the CD function 
      or the Load()
   2. Using the LoadExec()
   3. Using the overlay

Each feature is described as follows. 
Refer to the following files for specific explanation, <How to Execute>
and <Controller Button Assignment>.

  PSX\SAMPLE\MODULE\EXECMENU\README_E.TXT
  PSX\SAMPLE\MODULE\OVERMENU\README_E.TXT


1) Executing the Exec() after reading EXE file with the CD function or 
   the Load()
  Advantage: The child program can start up by itself.
             This will be useful in developing multiple child programs
             in parallel.

  Disadvantage: Every interrupt must be stopped when the processing 
             switches between the parent and the child because the 
             libraries are linked to both the parent and the child.
             Memory efficiency is not good.

  Memory structure example:
  
      +---------------+ Initial value of stack pointer of parent
      |               |    The stack is consumed downward.
      |               |
      +---------------+ Initial value of stack pointer of child
      |               |    The stack is consumed downward.
      |               |
      |               |
      |               |
      +---------------+
      |     library   |
      |       --------+
      |               |
      | Child (.EXE)  |
      +---------------+ Child-loaded address
      |     library   |
      |       --------+ 
      |               |
      | Parent (.EXE) |
      +---------------+ Parent-loaded address
      | System area   |
      +---------------+

2) Using the LoadExec()
  Advantage: The child program can start up by itself.
             This will be useful in developing multiple child
             programs in parallel. The child process can be loaded
             over the parent, and in this case, both processes can use full
             2M bytes, and it is easier to develop. 

  Disadvantage: Every interrupt must be stopped when the processing 
             switches between the parent and the child because the 
             libraries are linked to both the parent and the child.
             The processing speed is slow because this function must be 
             called after _96_init() execution. 

Memory structure example:
( when the child is loaded over the parent.)

 
      +---------------+ Initial value of stack pointer 
      |               | 
      |               |
      |               |
      |               |
      |               |
      |               |
      |               |
      +---------------+
      |     Library   |
      |       --------+
      |               |
      | Parent (.EXE) |
      | Child (.EXE)  |
      +---------------+ Loaded address of parent and child
      | System area   | 
      +---------------+


3) Using the overlay
Advantage: The child process can be called by function.
            (Loading must be managed by the user.)
            The libraries are shared by the parent and the child, so
            the interrupts don't have to be stopped. Therefore, it is 
            possible to carry out other processing during loading.
            Memory efficiency is good.

Disadvantage: Some make-operations are needed, such as creating the 
            link-file, and setting the compile-options.
            Usually, since all libraries are linked to the parent, 
            the parent size will be larger.
            (If you want to link the library to the child, you should see
            PSYQ\PREFSMPL.)
           
    Memory structure example:

      +---------------+ Initial value of stack pointer
      |               |                ( shared by parent and child)
      |               |
      |               |
      |               |
      |               |
      |               |
      |               |
      +---------------+
      |               |
      | Child(.BIN)   |
      +---------------+ Child-loaded address
      |     Library   |
      |       (shared)|
      |       --------+
      |               |
      |               |
      | Parent (.EXE) |
      +---------------+ Parent-loaded address
      | System area   |
      +---------------+

Re: Meido Menu v1.2

Posted: November 2nd, 2014, 12:18 am
by LameGuy64
Shadow wrote:I take it that's a typo. You can't load above the 2MB limit (0x80200000) unless you have >2MB of DRAM :P
Whoops, silly me... :oops: What I meant was that the menu loads itself somewhere high above where PS-EXEs are usually loaded in (somewhere above the 1MB memory area) and most of its resources (such as the MOD music) are loaded at base address (0x80010000).

When a PS-EXE is to be loaded, it simply loads the PS-EXE to its respective memory area (usually below where the menu is loaded) and then executes it. At this point, the loaded PS-EXE can safely overwrite the menu program which isn't active anymore.

Another advantage of this trick is that the loaded PS-EXE can optionally reload the menu program back provided that nothing important resides in the same area where the menu program is loaded which is great when making homebrew compilations (and is the reason why my Marilyn game has an Exit option that is only active if Meido Menu or a similar menu is present on the CD)... That is if the loaded PS-EXE is programmed to have such an option of course.

Re: Meido Menu v1.2

Posted: July 23rd, 2015, 10:49 am
by Danick8989
Nice work! Its really awesome! But im getting some problems like: When i put an PS-EXE in a folder like it is recommended, the program don't works well and got stucked! And i cant license the ISO! It get somehow corrupted(i use gridfix, but i dont think the problem is with it because i used it in other isos and it worked well) I'm a newbie like you can see now.

Re: Meido Menu v1.2

Posted: July 23rd, 2015, 12:27 pm
by LameGuy64
I think it most likely has something to do with how you created the ISO image. Are you trying to make a compilation with a game that uses CD-XA tracks and what ISO creation tool are you using?

Re: Meido Menu v1.2

Posted: July 23rd, 2015, 5:38 pm
by Shadow
Also, don't use GridFix. It's so old, and it doesn't even inject the correct license data. Use PSXLICENSE.

Re: Meido Menu v1.2

Posted: July 24th, 2015, 6:10 am
by Danick8989
Thanks guys. Im using IMGburn to create the ISO and i want to put the IMBnes, Master System emulator and a gameshark in one CD(the disk space is OK). And also, i want to know if i can put an game that don't have an PS-EXE(that ones with SCXXXXX.XX i don't know the name sorry :-) ) i could put that type of game in the paradox menu(i think this is the name) and worked well. Aldo i will try the psxlicense to see if the problem is on gridfix.

Re: Meido Menu v1.2

Posted: July 24th, 2015, 10:44 am
by Danick8989
I got it working with the Hitmen License tool, and the NES emulator works but the master system give some error! In the PSXfin emulator log it says something about "R3000 illegal opcode" and the emulator don't initialize!