|
Post by gaffa2002 on Aug 9, 2010 21:44:03 GMT -5
Hello everyone This is my first post in this forum, nice to meet you all.
I am trying to develop a game for the sega genesis in assembly, I read all the official documentation and checked out some examples and was able to create a sprite and move it through the screen. Problem is: My game is working on Kega Fusion, but for some reason it is not working on Gens. I`ve tried to open the game in Gens GS using its debug tool and found out that for some reason when the game accesses one of my subroutines it "gets lost", like, it starts to execute a lot of weird instructions. I`m using a lot of included files instead of only one (I preffer to program in separated files to organize the code in a better way). If I put all the code in the same file, the problem changes: It enters the subroutine, but it fails when returning from it (gets lost again). In Kega, the game runs perfectly, but It doesn`t have a debug tool. Did anyone had any problem like this?
Taking the oportunity, another question: When you guys program something for the genesis, how do you run it on the real hardware? The only way is using a flash cart, or are there cheaper ways?
Thanks a lot! I plan to participate a lot in this forum (not only asking but helping too) And sorry for my english, I`m Brazillian.
|
|
|
Post by Tom Maneiro on Aug 9, 2010 23:23:38 GMT -5
As for the real hardware thing, your only option are these flashcarts. If your ROM is small (up to 40KB), you could use a loader like LAKABAJO, but for most projects, the flashcart is the only way to go.
|
|
mic
Moldy Popcorn
Posts: 27
|
Post by mic on Aug 10, 2010 2:45:45 GMT -5
Unaligned code maybe? Or you forgot to set up the stack pointer? Or you're using A7 (SP) as a general register somewhere and don't restore it? Id' recommend you to set up some breakpoints and step through the relevant code (if Gens supports breakpoints - I don't remember).
Regarding flash carts, the Everdrive is probably your best option. It costs $65, shipping included (you'll also need an SD card if you don't already have one).
|
|
|
Post by gaffa2002 on Aug 10, 2010 8:46:05 GMT -5
Thanks for the replies. ;D Regarding the real hardware, I will take a look at the everdrive cart. And regarding my game: -The stack pointer is set in the header file I`m using for the program (sega.s). -I`m not using A7 as a regular register anywhere in the code -I`m a newbie in assembly so, what you mean with unaligned code? -Never heard of brakpoints on Gens, do you know any other emulator or debug tool that have this functionality? I`ve uploaded the source code in case one of you guys might want to take a look on it. rapidshare.com/files/412134854/smercs.zipThanks again for all the help. Edit: Nevermind, I was able to make it work. ;D Looks like gens is much more restrictive regarding memory addresses: The problem was a line break between a dc.l instruction and a label, this messed up everything below it. The line break was removed. I also had to organize better my code by separating the subroutines from game data. Data being declared after all the logic. In Kega fusion this wasn`t causing any problem.
|
|
|
Post by TheMVRules on Aug 10, 2010 10:28:07 GMT -5
Always have some error handling code. Anything simple, like changing the background color.
Also, you can use a Sega/Mega CD, but it's harder to program for.
|
|
|
Post by gaffa2002 on Aug 11, 2010 11:04:28 GMT -5
What are the main differences programming for the Sega CD?
The idea of converting my game to sega cd is very good, plus I can use the extra resources of the addon (audio CD tracks for example).
|
|
|
Post by TheMVRules on Aug 11, 2010 12:41:58 GMT -5
You'll have 2 CPU's. One is for the game and one is controlling the CD stuff (drive, PCM chip etc.) The MegaCD has a so-called "Word RAM", which is at 2 megabit. Some games store graphics, but you can run code from it. Only one CPU can access it at a time. The BIOS provides some routines to make life easier for programmers.
|
|
|
Post by gaffa2002 on Aug 11, 2010 13:30:18 GMT -5
Great, do you know a place to find some documentation regarding the sega CD? I`ve found in Kaneda web page I believe, but the link was broken.
And by 2 CPUs you mean the genesis 68K and the sega CD? Or without counting the genesis 68K?
Thanks a lot for the advice.
|
|
|
Post by TheMVRules on Aug 11, 2010 14:02:05 GMT -5
I'm counting the MD 68K, obviously. You could look at basicasm.cni if you want to know how the MCD works.
|
|
|
Post by gaffa2002 on Aug 11, 2010 14:29:27 GMT -5
Thanks my friend, I will take a look on it.
|
|