A few questions :)
Moderator: BigEvilCorporation
A few questions :)
Hey everyone, I have a few questions about the Genny/MD:
Question 1: Is there an easy way to determine if a Game Genie, 32x, or Sega CD is attached to the console? What about copiers? I'd like to put in some commands or functions into SecondBASIC that would return a 1 if the above is detected, and a 0 if the peripherals aren't connected. If this is something that is pretty straight forward, any help would be greatly appreciated
Question 2: I'd like to make a function set do work with 4 player controls for SecondBASIC. I don't know a lick about doing this (I'm very inexperienced with ASM), and I know it's a lot to ask, but would anyone be willing to work with me to make this a reality? Since I'm using the BEX library, I was wondering if it would be possible to build off of that (if it would make things easier).
Question 3: Sega CD Mode 1 - I believe Chilli had posted the ASM source on how to do this, but again, I'd need some help implementing this in SecondBASIC.
I know questions 2 and 3 are asking a lot, so to garner some incentive for the help, I'm willing to compensate whoever helps (either in games, or money)
Question 1: Is there an easy way to determine if a Game Genie, 32x, or Sega CD is attached to the console? What about copiers? I'd like to put in some commands or functions into SecondBASIC that would return a 1 if the above is detected, and a 0 if the peripherals aren't connected. If this is something that is pretty straight forward, any help would be greatly appreciated
Question 2: I'd like to make a function set do work with 4 player controls for SecondBASIC. I don't know a lick about doing this (I'm very inexperienced with ASM), and I know it's a lot to ask, but would anyone be willing to work with me to make this a reality? Since I'm using the BEX library, I was wondering if it would be possible to build off of that (if it would make things easier).
Question 3: Sega CD Mode 1 - I believe Chilli had posted the ASM source on how to do this, but again, I'd need some help implementing this in SecondBASIC.
I know questions 2 and 3 are asking a lot, so to garner some incentive for the help, I'm willing to compensate whoever helps (either in games, or money)
Re: A few questions :)
The 32X is easy. Just look for the ASCII string "MARS" (4D 41 52 53) at $A130EC. If it says MARS, then a 32x is attached.
For the SEGA CD, you could try writing to the SCD's RAM, and try reading back to see if the value was stored. There is probably a better way though.
I'm not sure about Game Genie or game copiers.
I'm not sure about your other questions, although I'm also interested in SEGA CD mode 1 booting.
I was able to dig up this documentation on the SEGA multitap. Maybe it can help.
http://www.raphnet.net/divers/documenta ... ltitap.txt
For the SEGA CD, you could try writing to the SCD's RAM, and try reading back to see if the value was stored. There is probably a better way though.
I'm not sure about Game Genie or game copiers.
I'm not sure about your other questions, although I'm also interested in SEGA CD mode 1 booting.
I was able to dig up this documentation on the SEGA multitap. Maybe it can help.
http://www.raphnet.net/divers/documenta ... ltitap.txt
Visit my web site at http://www.mode5.net/!
Re: A few questions :)
Thanks for the info about the 32x! I'll take a look at the link as well Thanks dude
-
- Very interested
- Posts: 209
- Joined: Sat Sep 08, 2012 10:41 am
- Contact:
Re: A few questions :)
For MegaCD detection, see if this has the info you need:
Mileage may vary, I only wrote it for Genesis dev on a Cross Products devkit, never been tried with retail units.
Code: Select all
; ************************************
; Mega-CD
; ************************************
; BIOS addresses for various MegaCD types
mcd_bios_addr_1 equ 0x00415800 ; SEGA Model 1
mcd_bios_addr_2 equ 0x00416000 ; SEGA Model 2
mcd_bios_addr_3 equ 0x00416000 ; WonderMega/X'Eye
mcd_bios_addr_4 equ 0x0041AD00 ; LaserActive
; MegaCD signatures
mcd_sig_1: dc.b 'SEGA',0
mcd_sig_2: dc.b 'SEGA',0
mcd_sig_3: dc.b 'WONDER',0
mcd_sig_4: dc.b 'SEGA',0
; Offset into BIOS to find signature
mcd_sig_offset equ 0x6D
; Checks if MegaCD is attached and returns BIOS type
; d0 - Return value: BIOS index if MCD present, 0 if not
GetMCDType:
; Check BIOS signature 1
lea mcd_sig_1, a0
lea mcd_bios_addr_1+mcd_sig_offset, a1
jsr CompareString
cmp.b #0x0, d0
bne @NotType1
move.l #0x1, d0 ; Found type 1
rts
@NotType1:
lea mcd_sig_2, a0
lea mcd_bios_addr_2+mcd_sig_offset, a1
jsr CompareString
cmp.b #0x0, d0
bne @NotType2
move.l #0x2, d0 ; Found type 2
rts
@NotType2:
lea mcd_sig_3, a0
lea mcd_bios_addr_3+mcd_sig_offset, a1
jsr CompareString
cmp.b #0x0, d0
bne @NotType3
move.l #0x3, d0 ; Found type 3
rts
@NotType3:
lea mcd_sig_4, a0
lea mcd_bios_addr_4+mcd_sig_offset, a1
jsr CompareString
cmp.b #0x0, d0
bne @NotType4
move.l #0x4, d0 ; Found type 4
rts
@NotType4:
clr.l d0 ; MegaCD not found
rts
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk
Re: A few questions :)
You can detect if Mega CD is connected by checking bit6 of I/O version register ($A10001): if bit6 is cleared, it means Mega CD unit is connected (and powered ON).
Re: A few questions :)
Yeah, the F bit in $A10001 is the intended way to check for the Sega CD (don't get fooled by its name in the docs, that's because the floppy drive was originally going to be where the Sega CD ended up).
Why would you want to check the Game Genie though? o.o
EDIT: oh also
Mode 1 is a way of getting the Sega CD firmware to boot from the cartridge instead of from the CD drive (which requires !CART_IN to be wired as if there was no cartridge, by the way), let's not spread misinformation please. The usual hack is to instead scan for the BIOS at known locations, but that's not mode 1 (can we please find a different name for this?).
Why would you want to check the Game Genie though? o.o
EDIT: oh also
That's not mode 1! >_>elusive wrote:Question 3: Sega CD Mode 1 - I believe Chilli had posted the ASM source on how to do this, but again, I'd need some help implementing this in SecondBASIC.
Mode 1 is a way of getting the Sega CD firmware to boot from the cartridge instead of from the CD drive (which requires !CART_IN to be wired as if there was no cartridge, by the way), let's not spread misinformation please. The usual hack is to instead scan for the BIOS at known locations, but that's not mode 1 (can we please find a different name for this?).
Sik is pronounced as "seek", not as "sick".
Re: A few questions :)
Booting from cartridge (CART_IN low) with Sega CD BIOS located at 0x4xxxxxx is actually called "Mode 1" in official docs.The usual hack is to instead scan for the BIOS at known locations, but that's not mode 1 (can we please find a different name for this?).
Booting from Sega CD BIOS (CART_IN high) with cartridge located at 0x4xxxxx is called "Mode 2 Type 2"
- Attachments
-
- image.jpg (236.52 KiB) Viewed 12325 times
Re: A few questions :)
WTF what page is that?
Also doesn't explain then the boot code Nemesis founds where the firmware looks for a header in the cartridge and boots from there.
Also doesn't explain then the boot code Nemesis founds where the firmware looks for a header in the cartridge and boots from there.
Sik is pronounced as "seek", not as "sick".
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: A few questions :)
This page comes from the official Mega-CD documentation, i saw it as well and there is others references to Mode 1 in MegaCD as the cartridge boot :
Re: A few questions :)
It's page 5 of the Mega CD hardware manual which has been available online for some years.Sik wrote:WTF what page is that?
This was likely done for the Mega CD diagnostic cartridge which is described in the Service Manual. It's just that some BIOS were developped to run some code from the cartridge if a specific header was found, but this is described here as Mode 2 Type 2 anyway, with special function cartridge available at 0x4xxxxx and initial booting from Mega CD internal ROM.Sik wrote: Also doesn't explain then the boot code Nemesis founds where the firmware looks for a header in the cartridge and boots from there.
The mode used by Pier Solar, Flux, Wonder Library and the few ROM hacks with added CDDA support, where you boot from cartridge ROM and have access to Mega CD BIOS (as well as PRG-RAM & Word-RAM) at 0x4xxxxx is somehow "officially" called Mode 1 (again Type 2).
-
- Very interested
- Posts: 292
- Joined: Sat Apr 21, 2007 1:14 am
Re: A few questions :)
The Game Genie disables all the user-accessible registers when it is running a game. The only thing you could do is checksum the ROM and verify if it is bad or not, which would indicate the Genie was patching one or more locations.
I can't remember if the Genie software fully clears out RAM and VRAM before running, so maybe you could scan that for "leftovers" from when the Genie menu was running.
I can't remember if the Genie software fully clears out RAM and VRAM before running, so maybe you could scan that for "leftovers" from when the Genie menu was running.
Re: A few questions :)
Thanks for all of the information everyone!
charles, thanks for that bit of info. I guess using a checksum routine would be the way to go for game genie detection
As for why I want to know, it's just for general information.
charles, thanks for that bit of info. I guess using a checksum routine would be the way to go for game genie detection
As for why I want to know, it's just for general information.
Re: A few questions :)
Why do you want to detect the Game Genie, anyway?
Sik is pronounced as "seek", not as "sick".
Re: A few questions :)
Why not? It could be used as an easter egg
Re: A few questions :)
Hey everyone, I have a few more questions
First new question: Is there a way to trigger a soft reset without having to write your own "reboot" process. I know you can check in the bootup vector to see if the console had a soft reset or a hard reset, but unsure if there's a way through code to "push the reset button" for you, so to speak. I thought I found a thread on here some time ago, but I cannot find it for the life of me, so I may have been dreaming
Question 2: I've run into a nasty issue with SecondBASIC - when I compile past a certain length of code*, it seems the ROM becomes corrupt and when it launches in an emulator, the title is displayed as random text (like 8 'F %2C 91 A I A<) and not the title of the game. What is the cause of it appearing corrupt (ie, data isn't aligned properly, something is bloating the header, etc.). I think this might be a long shot of a question.
* I say past a certain length because it's when the issue shows up, but I know it's an issue somewhere else rather than the command that's blowing up my project. Any general information on what would cause it to mess up like that would be helpful.
I found the issue for this and it's because I wasn't aligning the music files properly Found the problem right after I posted this lol
Thanks!
First new question: Is there a way to trigger a soft reset without having to write your own "reboot" process. I know you can check in the bootup vector to see if the console had a soft reset or a hard reset, but unsure if there's a way through code to "push the reset button" for you, so to speak. I thought I found a thread on here some time ago, but I cannot find it for the life of me, so I may have been dreaming
Question 2: I've run into a nasty issue with SecondBASIC - when I compile past a certain length of code*, it seems the ROM becomes corrupt and when it launches in an emulator, the title is displayed as random text (like 8 'F %2C 91 A I A<) and not the title of the game. What is the cause of it appearing corrupt (ie, data isn't aligned properly, something is bloating the header, etc.). I think this might be a long shot of a question.
* I say past a certain length because it's when the issue shows up, but I know it's an issue somewhere else rather than the command that's blowing up my project. Any general information on what would cause it to mess up like that would be helpful.
I found the issue for this and it's because I wasn't aligning the music files properly Found the problem right after I posted this lol
Thanks!