questions about chaos engine/soldiers of fortune graphics

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

chaos_theory
Interested
Posts: 15
Joined: Sun Jun 15, 2008 6:47 pm
Location: D-town of us of a

questions about chaos engine/soldiers of fortune graphics

Post by chaos_theory »

Hi guys, im, im new here and have been searching far and wide for someone to help me with a problem. I am using (neogenesis) a port of gens for xbox and am having severe troubles with a game called soldiers of fortune. I have read about the vdp fifo and timing, and was wondering is there a way to make a fix for the soldeirs of fortune??

i have tried to use the savestate editor for genesis and have tried hex editing the rom itself but no luck, i know nothing about where to look or what to do honestly. i have asked in multiple threads but received mimimal answers.

i would appreciate it if someone might be able to help. perhaps is there a way to make an ips patch that will fix this? this game is my favorite game of all time for genesis, and i have to be the oddball to find the game with an issue. :D

if anyone can let me know anything please let me know. i know i could always use the pc and all, but i prefer the xbox and am trying to use this as a learning experience. I have released small updates for other emus for xbox but this is really stumping me!! the gens code is in assembly and the only vdp fix i can find is in C++. I hope someone can help me on this day! 8)

edit** i have the source for the current gens if someone would like to take a look at it.

thanks!

CT-
notaz
Very interested
Posts: 193
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz »

The best solution would be adding VDP FIFO support to Gens, but if you can't do that, and don't mind having special version of Gens made specially for that game, just add this hack:

Do_Genesis_Frame() function, very first first 'for' loop, after these lines

Code: Select all

Fix_Controllers();
Cycles_M68K += CPL_M68K;
Cycles_Z80 += CPL_Z80;
if (DMAT_Lenght) main68k_addCycles(Update_DMA());
add this:

Code: Select all

main68k_addCycles(CPL_M68K/2);
This will break loads of other games of course, so you can add this as an option or do game detection or something.

The ROM itself can be hacked too, but that would be more difficult, IMO.
chaos_theory
Interested
Posts: 15
Joined: Sun Jun 15, 2008 6:47 pm
Location: D-town of us of a

Post by chaos_theory »

thanks alot notaz!! so you do know that i am using neogenesis for xbox correct? I am not sure if the gens for pc uses its vdp code in assembly like the xbox port does. :o

none the less i will give this code a try and see what happens. Yea i tried the romhacking department and that part i know nothing about. Thanks for the information notaz i will test it out and post my results for you.

If anyone else has any input please post here and let me know. I would love to hear.

CT-
AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Post by AamirM »

Hi,

I think you forgot to mention that you were running xbox port of Gens on other forums. Anyways, I remember there is a project called Gens4All (google it) which is a conversion of Gens from x86 asm to C/C++ to run on some other consoles, written by Stef (author of Gens) himself. So you can apply that VDP C++ fix to it and try run it on xbox. Good luck!

stay safe,

AamirM
chaos_theory
Interested
Posts: 15
Joined: Sun Jun 15, 2008 6:47 pm
Location: D-town of us of a

Post by chaos_theory »

thanks! i have the source and a means to compile for the current version of neogenesis, all i need to do is figure out where to put that one line of code or what-not for soldiers of fortune to run correctly. It will have to be a stand alone version though since some games will break as previously posted by notaz

i just need to figure out if that line of code i have is assembly, that's all. The vdp is in assembly for xbox, dont know about the actual gens pc though. Hence why i said i would let someone take a look at it if they want. Im a beggining coder but only know means of C++ and i would like to use this experience as a learning experience to learn some ins and outs of assembly. So if someone wants to take a look at the vdp code for noegenesis (xbox) i will gladly send it to them. i greatly appreciate everyones help and answers thus far.

i guess my question is this code i now have in assembly? Im right here at the fix, its been bugging me for a long time. 8)

CT-
Eke
Very interested
Posts: 885
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke »

this part of code that notaz mentionned is not in ASM in gens, and I don't think the xbox port use a modified code

just look for Do_Genesis_Frame() function in Gens.cpp, this is the main emulation frame code and this were you should add the code that notaz gave you

what the additional code do is "freezing" the 68000 for some cycles, this is necessary for that particular game to display correctly, but this does not affect the VDP code at all
chaos_theory
Interested
Posts: 15
Joined: Sun Jun 15, 2008 6:47 pm
Location: D-town of us of a

Post by chaos_theory »

Thanks alot!! i will try this out immediately, looking at my neogenesis source i did indeed find the gens.cpp file, now i have to fix the gensx.cpp file which i am sure is the neogenesis.

i will post back some results once i can implement this and test out.

thanks and im hoping that this does it. i appreciate everyones help in the matter. 8)

CT-
chaos_theory
Interested
Posts: 15
Joined: Sun Jun 15, 2008 6:47 pm
Location: D-town of us of a

Post by chaos_theory »

thanks for all the help guys!! i added the one line of code into the gens.cpp and i am getting ready to compile. my other question is the gens.cpp file is in the source for gens, and there is another .cpp file named gensx.cpp, do i need to add code into this as well? im assuming this is the cpp file for the xbox port of gens.

here is a download link for the gensx.cpp file if anyone wants to take a look at it and let me know if i need to add anything. Im assuming i might have to add something along the lines of what i added to gens.cpp

http://www.4shared.com/file/51754624/d43c7513/gens.html
Last edited by chaos_theory on Wed Jun 18, 2008 4:10 am, edited 2 times in total.
Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

If you're gonna post code, at least put it in code tags! :evil: :D
chaos_theory
Interested
Posts: 15
Joined: Sun Jun 15, 2008 6:47 pm
Location: D-town of us of a

Post by chaos_theory »

sorry about that chilly willy. i fixed it and added a download link to the file itself instead.

please note that even though this says gens.cpp this is actually the gensx.cpp so dont get those 2 mistaken. like i said i added the code to the original gens.cpp file that is included with the gens source i am compiling.

CT-
Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

Thanks! That's much better. :)
Eke
Very interested
Posts: 885
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke »

well, why don't you just look at the makefile or whatever the xbox binary use to compile and see what source files are used ?

I highly doubt that both of them are used, the x version has probably been a little modified for the porting and is the one you should care of... and if you doubt, just modify both, it a simple line of code to add, not really a big deal, even if you don't have any ideas about what you are doing...
chaos_theory
Interested
Posts: 15
Joined: Sun Jun 15, 2008 6:47 pm
Location: D-town of us of a

Post by chaos_theory »

Eke wrote:well, why don't you just look at the makefile or whatever the xbox binary use to compile and see what source files are used ?

I highly doubt that both of them are used, the x version has probably been a little modified for the porting and is the one you should care of... and if you doubt, just modify both, it a simple line of code to add, not really a big deal, even if you don't have any ideas about what you are doing...
thanks eke, i did look through the gensx.cpp and could not find where i should put it, it's weird because in the gens.cpp file i have, i noticed where xbox was typed out in some places.

i will take another look through it though and after looking through what i have to compile i actually have like 2 or 3 gens.cpp files so i added the code where appropriate in those. It's just im not sure if i need to modify the genx.cpp file.

beleive me i am not trying to get someone to do it for me persay, but if anyone was interested in seeing how the xbox gensx.cpp file looked i put it up for them to look at it. that's all.

you are very right in what you say, it is just one line of code, but i am a beginner coder so please bare with me. :oops: :D

i dont want my topic to be locked. i will post you guys a result when this gets compiled and tested. i do appreciate everything that everyone has done!!

CT-
chaos_theory
Interested
Posts: 15
Joined: Sun Jun 15, 2008 6:47 pm
Location: D-town of us of a

Post by chaos_theory »

the build was compiled and the glitch is still there. anything i could be doing wrong?? The build was tested to see if it was executing that line and it is. :?

i did not modify the gensx.cpp but i will have to try that.

CT-
notaz
Very interested
Posts: 193
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz »

I've tested this on Gens Linux port and it works. You probably placed it in wrong function or in wrong loop.
gensx.cpp you posted before is not related to emulation much, it's just xbox specific code, you don't need to modify it.
Post Reply