HardWareMan wrote:KanedaFr wrote:Great!
now your next challenge will be to use a game selector ON SCREEN
It's something I personnaly would like to be able to do...
it means reset/switch by software (or electronic stuff) and it's something I don't see how to do ... even if some of you already
explained it to me
It's pretty easy. Use resetable register, wich will be cleared by !VRES signal from slot. Inputs connect to data bus, outputs to high addresses of ROM. For write strobe you can use !TIME signal ORed with !LWR signal. So, after reset this register automatically select zero page of ROM and launch the menu program. When user selected desired game, launch code copying to RAM and it's write to this register number of page, and then launch the game:
Code: Select all
move.l $000000,a0
move.l $000004,a7
jmp (a0)
Ofcourse, there can be game in zero page too. But, you will need to modify start vector of this game to menu code, wich must be in this page too (after game for example). Ofcourse, you must remember start vector of this game in order to launch it.
A boot menu needs a little more on the reset and the start code than just
Code: Select all
move.l $000000,a0
move.l $000004,a7
jmp (a0)
That will not work (completely) for some games, leaving the audio in a bad state among other things. Some games simply won't work right after another game without a more comprehensive reset. Also, if one of the games is a 32X game, you need to blank the display and reset the 32X. You can see what I do for the Neo MD Myth menu to handle all that in the crt0.s and neo2.s files.
You can find that source in the Neo Myth Menu thread in the Genesis forum.
The very least you need to do for most MD games is
Code: Select all
lea 0xA10000,a0
moveq #0,d0
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)+
move.b d0,(a0)
move.w #0x8104,0xC00004 /* display off, vblank disabled */
move.l $000000,a0
move.l $000004,a7
jmp (a0)
Clearing all the IO locations forces the game launched to do the equivalent of a hard reset/cold start. If you don't, the majority of game will do a hot start, which skips most of the hardware setting a game will do the first time it starts.