GensKMod on Git

Talk about development tools here

Moderator: BigEvilCorporation

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Sun Dec 29, 2013 12:32 am

really....Strange ! ;)
need to check this!

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Mon Feb 10, 2014 2:23 pm

for info 0.7.2 is available on Git
I'll upload an exe tonight on http://gendev.spritesmind.net/page-gensK.html but I wanted to share this info with anyone involved in the Git source

While I alread did it so many times this past month, I won't thank enough Graz who devoted so many hours to add/fix feature for this new version.

If you're not already sitting on a chair, please do because here come the changes :
- z80 bug issue from last release fixed
- rom drag&drop support
- added always on top option (easier for debugging)
- optimized tiles, sprite and register windows
- 16 bit color depth issue fixed (:shock:)
- plane explorer (:shock::shock:)
- gdb server (:shock::shock::shock::shock::shock:)
- gdb server for every CPU (:shock::shock::shock::shock::shock::shock::shock::shock::shock::shock::shock::shock::shock::shock::shock:)

Plane explorer is a feature I never took the time to add but was dreaming of
GDB support...well... you already know what I think no ? I said to so many people it wasn't possible that when I first step it my test program with gdb, I almost cried.... :oops:

I tried to use it with Eclipse but unfortunatly I was unable to do so...
Eclipse uses too much gdb command for simple step...
So, only commandline tool (gdb or ddd) are working right now
This is how to do it:

update the makefile to disable optimisation and include debug info

Code: Select all

ifdef DEBUG
FLAGS+= -DDEBUG=1 -g
else
FLAGS+= -O1
endif
keep the out file

Code: Select all

.SECONDARY:
	out/rom.out
open the bin file on gensKmod 0.7.2, it will launch like before

launch gdb-68k with the out file

Code: Select all

m68k-elf-gdb my/directory/out/rom.out
inside gdb command line, move the working directory (else it won't find code source)

Code: Select all

cd my/directory
connect to gensKmod

Code: Select all

target remote localhost:6868 
reset to start

Code: Select all

break main 
jump _Entry_Point
your game is now paused, you can set your breakpoint, etc... and run!

Code: Select all

continue
perhaps you'll need this too ;)
http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Mon Feb 10, 2014 6:15 pm

Awesome!

Noob question time:

SGDK projects work with the gdb?
Variables and function names are shown and not just addresses?
Do the kdeug messages appear in gdb output?

Graz
Very interested
Posts: 81
Joined: Thu Aug 23, 2007 12:36 am
Location: Orlando, FL

Post by Graz » Tue Feb 11, 2014 12:46 am

KanedaFr wrote:While I alread did it so many times this past month, I won't thank enough Graz who devoted so many hours to add/fix feature for this new version.
Sure - no problem. I was mostly adding things that I needed. No point in hoarding. Thanks for taking the patches.

Anyway, there are some caveats. The only thing that's really tested is the main 68K debugger. Sub 68K should work for the CD, though debugger initiated register writes probably won't work. The SH2s are really rough. You can connect to them, inspect memory, look at registers, etc., but things can get hairy quickly. In particular, you can add a breakpoint, but if it gets hit it can send the emulation core into brain failure from which it cannot recover without restarting the emulator. Single stepping doesn't work either. Also, in my tests, GDB can't walk the frame. I think the PR register isn't getting reported correctly.

I'm probably going to do more work on the 32X, so I'll be fixing those things up as I get a chance, as well as some 32X VDP work.
KanedaFr wrote:I tried to use it with Eclipse but unfortunatly I was unable to do so...
Eclipse uses too much gdb command for simple step...
I've never really messed with Eclipse enough to set it up for cross debugging. If there's GDB protocol missing, post instructions on what you're doing to get as far as you have and I will add the missing parts.
djcouchycouch wrote:SGDK projects work with the gdb?
Probably, never tried.
djcouchycouch wrote:Variables and function names are shown and not just addresses?
If you have debugging symbols, yes.
djcouchycouch wrote:Do the kdeug messages appear in gdb output?
No. That could be added. I haven't looked into it.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Feb 13, 2014 12:24 pm

Now available :
http://gendev.spritesmind.net/page-gensK.html

And yes, of course, it works with SGDK...it's the one I use!


If you find bugs, just fix and pull request them!

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Thu Feb 13, 2014 3:12 pm

KanedaFr wrote: And yes, of course, it works with SGDK...it's the one I use!
Do you need to change the default makefile to get GDB to work? I haven't had the chance to try it yet.

I really like the idea of being able to see the whole plane in real time. I think what would also be really handy would be a view that shows the screen and some area around it to see the sprites that have been set but are off screen.

Normal view:

0 -> screen
X -> sprites

Code: Select all

00000000
00X00000
00000X00
00000000
"expanded" view

Code: Select all

-------------x--------
----------------------
-------00000000-------
-------00X00000-------
--x----00000X00---x---
-------00000000-------
----------------------
---xx-----------------

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Feb 13, 2014 3:21 pm

djcouchycouch wrote:
KanedaFr wrote: And yes, of course, it works with SGDK...it's the one I use!
Do you need to change the default makefile to get GDB to work? I haven't had the chance to try it yet.
see what to change in 2 msgs before... (remove optimisation, add debug support, keep rom.out file)

I think Stef'll be able to add support for debug on SGDK next version...

bastien
Very interested
Posts: 208
Joined: Mon Jun 25, 2007 7:19 pm
Location: Besançon,France
Contact:

Post by bastien » Thu Feb 13, 2014 4:56 pm

I don't have the words for say's how awesome is that !
i use kmods for a long time now and see a new version is just amazing
Thanks you both for your works !

P.S : yeah a direct 3D fix :twisted:

Aly James
Very interested
Posts: 74
Joined: Sun Mar 31, 2013 11:34 pm
Location: FRANCE
Contact:

Post by Aly James » Fri Feb 14, 2014 2:27 am

Awesome :)
Some quick correction to the YM2612 & PSG debug,
Please correct these lines in kmod.c

Code: Select all

//////////////////YM2612
//line 7805
 		if (YM2612.REG[part][0x60 + chan + 4*op]&0x80)
			lstrcat(debug_string, "ON\n");
		else
			lstrcat(debug_string, "OFF\n"); // correct handling of AM on/off

//line 7834
wsprintf(tmp_string,"0x%0.2X\n", YM2612.REG[part][0xB4 + chan]&0x07); //correct handling of FMS modulation.

//////////////////PSG
//line 8256
	wsprintf(debug_string,"%s", (PSG.Register[6]>>2)==1 ? "White" : "Periodic"); // simply invert white & periodic status :)

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Fri Feb 14, 2014 1:41 pm

Probably, there is a lot of bugs from previous version. If you want full list, then ask me to create it.
But main reason why I would not use now this Mod it's lack of M68k debugger . Second reason: lack of Lua Scripts. May be I don't know something... But nevermind :)
Image

feos
Newbie
Posts: 2
Joined: Wed Oct 16, 2013 7:02 pm

Post by feos » Fri Feb 14, 2014 4:16 pm

Seems to be built as x64. "Isn't a win32 application". Can I have the x86 build?

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Sat Mar 29, 2014 1:38 pm

Just tried this as well. Doesn't run on 32bit XP.

Ktulu
Newbie
Posts: 1
Joined: Thu Aug 28, 2014 9:28 pm

Post by Ktulu » Thu Aug 28, 2014 9:37 pm

Sorry to dig an old post but it can help people willing to run v0.72 on XP (Google sends me to this thread while searching for it) ;)
djcouchycouch wrote:Just tried this as well. Doesn't run on 32bit XP.
Hi, Visual Studio 2012 doesn't produce XP compatible binaries by default.

Try to recompile it with at least VS2012 SP1 to enable XP compatibility.

In project properties -> general -> platform toolset replace "visual studio 2012 (v110)" by "visual studio 2012 - windows xp (v110_xp)".

I issued the same problem (my oldgen dev machine is still under XP) so I recompiled the sources with VS2012SP4 on a W8 machine with no problem.

ryanfaescotland
Very interested
Posts: 53
Joined: Mon Feb 09, 2015 10:46 pm
Contact:

Not Frontpage News?

Post by ryanfaescotland » Fri Feb 13, 2015 2:14 pm

Isn't this worthy of appearing in the News section on the homepage? I'd certainly say so...

I'm not one for making introductory topics so I'll just say hey here. Hey, I'm Ryan, a developer from the sunny shores of Scotland. If you know Scotland (or the UK at all for that matter) you'll know that that was most definitely a joke and that although I am certainly from the shores (Aberdeen to be exact) there has been any sun sighted in Scotland since 1902 (and even then it may have been a weather balloon).


I've been spending some time looking into the possibility of contributing to the development of a hacking based emulator and GensKMod looks to make the most sense as a starting point.

You can see my thought process here RHDN Topic but basically it comes down to Kega and Mame/Mess are more accuracy focused, Regen and Exodus didn't have anything in the feature list that jumped out at me (granted I still actually have to use them to see what they are really like) and they are closed source. GensKMod looks more hacker based, especially when factoring in Gens Hacking Version and Gens Tracer as well.

Would this be a fair assessment?

I'm not certain I can actually be of any help yet, just now everything is ground work and research, and I haven't even got my environment set up. Any gotchas I need to watch out for beyond what is documented in this thread?

And finally I'll get my little gush out of the way: Thanks for all the work on GensKMod and all the docs Kaneda, they've came in really handy over the years. </gushing>
Last edited by ryanfaescotland on Fri Feb 13, 2015 9:21 pm, edited 1 time in total.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Feb 13, 2015 2:42 pm

In my last attempt to put GensKMod and GDB working together i had some troubles with GDB commands. Breakpoints were not always taken and sometime at the wrong location... to a point it was not really usable. The thing is that i do not know if the problem come from code::block, the GDB version i am using or GensKMod itself. I upgraded to Code::Blocks 12 but without success...
I guess i have to give another try :D
By the way Kaneda, which IDE and which version of GDB are you using ?

Ah yeah, i always forgot to specify that one: there is a very annoying issue with the output message console. You limit the maximum of character so after sometime you don't see any new messages i it. It would be very nice to allow more characters (or set it as a parameter) :)

Post Reply