Author Topic: Gens KMod modifications for mapping  (Read 129409 times)

0 Members and 1 Guest are viewing this topic.

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
Gens KMod modifications for mapping
« on: July 13, 2007, 09:11:23 am »
I'm messing with the source to Gens KMod now. With a huge proviso that I can't guarantee to achieve anything, and I may not have much time to spend on it, what mapping features can you think of that I could add to it? On my list there is:



- better background colour when layers are disabled

- a better keyboard shortcut for screenshots, like PrintScreen perhaps

Offline TerraEsperZ

  • Hero Member
  • *****
  • Posts: 2326
RE: Gens KMod modifications for mapping
« Reply #1 on: July 13, 2007, 07:40:32 pm »
Personally, only the first two would be of real use to me. Regarding the background color, it should either be an RGB value chosen by the user, or else a color whose RGB value could never be produced by the Genesis color palette, both in 16 and 32 bits color mode.



If you can do this, I'll have to think of some kind of prize to send you.



*searches piles of unsorted stuff*



...well, I have the first 3 or 4 volumes of the old Evangelion DVD edition, the one with shitty sound and image. It wouldn't be much, but nobody's willing to pay me more than 12$ for the lot (brand new too) so I say screw that. How's that for motivation ;) ?



---

"With the first link, the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably." [...] The first time any man's freedom is trodden on, we're all damaged. - Captain Jean-Luc Picard



B*tch, meet reality. Reality, meet b*tch. - Me
Current project:
Mega Man: Powered Up (PSP)

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 640
RE: Gens KMod modifications for mapping
« Reply #2 on: July 14, 2007, 05:29:25 am »
The only thing I was going to do was change the color when you disabled a palette to something like 0xFF00FF, or something close to that.  So if you end up doing that then I won't have any need to swim through the code.



The other alternative is to dump an indexed image like Genecyst does, but I think Gens mostly deals with RGB colors, so that may be a harder route.

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
RE: Gens KMod modifications for mapping
« Reply #3 on: July 14, 2007, 07:57:01 am »
It works internally with a 256-colour palette, so an indexed dumper might be possible, but it'd die when you came to any game that changes the palette mid-frame.



I'm hoping to make the colour configurable, else something fixed that's impossible to get with the MD palette. It'll be a hack though, and probably a speed hit.



The palette disabling thing might be a way to go too. Hopefully I'll get time to mess with it today or tomorrow. Another option that might be good would be to allow you to edit the palette in a "forceful" way that would override any later updates. It might also solve the black-on-black problem.



I might get technical on this later if I'm in need of some ideas on how to approach it.

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
RE: Gens KMod modifications for mapping
« Reply #4 on: July 14, 2007, 03:15:36 pm »
Hooray!



http://www.smspower.org/maxim/forumstuff/gens_kmod_maxim_001.zip



- Magic Pink background option when layer B disabled



And a few little things I fixed along the way:

- Auto screenshots no longer get slower as the number increases

- Nicer window title text

- Screenshot limit increased

- Screenshot, etc dump filename selection no longer screwed up by dots in the filename



http://www.smspower.org/maxim/forumstuff/gens_kmod_maxim_001.zip



I'll release source soonish.

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 640
RE: Gens KMod modifications for mapping
« Reply #5 on: July 14, 2007, 04:00:47 pm »
I will use this on my next Genesis project.  I already started ToeJam & Earl with Genecyst and the two emulators interpret the colors a little differently.



Hey Terra, get back to work on Sonic CD, my special stage maps are lonely.

Offline TerraEsperZ

  • Hero Member
  • *****
  • Posts: 2326
RE: Gens KMod modifications for mapping
« Reply #6 on: July 14, 2007, 04:24:05 pm »
I won't have time to try it until tomorrow, but if this works as well for Sonic CD, I'll be resuming work on it as soon as I'm finished with my present project (Gradius: The Interstellar Assault), which  means probably by the end of the weekend. I can't wait :) !



---

"With the first link, the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably." [...] The first time any man's freedom is trodden on, we're all damaged. - Captain Jean-Luc Picard



B*tch, meet reality. Reality, meet b*tch. - Me
Current project:
Mega Man: Powered Up (PSP)

Offline TerraEsperZ

  • Hero Member
  • *****
  • Posts: 2326
RE: Gens KMod modifications for mapping
« Reply #7 on: July 14, 2007, 08:29:45 pm »
IT'S FREAKING WORKING!!! WOOHOO! LONG LIVE MAXIM!



*ahem*



With a good ISO, all the stages work perfectly and it looks like I can finally continue mapping Sonic CD! By the way Maxim, if you're interested, I wasn't joking about those DVDs you know. It's not worth much, but I'd prefer to give them to someone rather than to see them wasting space on my shelves :)



---

"With the first link, the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably." [...] The first time any man's freedom is trodden on, we're all damaged. - Captain Jean-Luc Picard



B*tch, meet reality. Reality, meet b*tch. - Me
Current project:
Mega Man: Powered Up (PSP)

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
RE: Gens KMod modifications for mapping
« Reply #8 on: July 15, 2007, 03:28:15 am »
I have no idea what they are, and I don't have a DVD player (apart from the one in the computer)... <wikipedia> Aha, anime... not my thing, sadly.



Anyway, the exe is small because I tend to UPX compress programs that look scarily big, even though it's kind of pointless.



Regarding colour differences between emulators: it might be something I can mod. Gens is producing its 24bpp screenshots by left-shifting the internal 15- or 16-bit image, which means for example that a full-on 5-bit red value becomes an 8-bit %11111000 = 0xf8, when you might hope for 0xff. It would be relatively easy to modify it to do that, but it would make it incompatible with any older images you have.



Using PSP7's "Curves" dialog, I mapped input red and blue 0..248 to 0..255, and green 0..252 to 0..255, which gives the result I would expect. Does that match what you'd want?



Before:

User posted image

After:

User posted image



Does the second match what Genecyst produces? Should I make Gens only produce that? Maybe I can make it optional...

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 640
RE: Gens KMod modifications for mapping
« Reply #9 on: July 15, 2007, 07:37:28 am »
I can get you a PCX shot from Genecyst, but don't worry about coding something just for me.  Only if you want to do it.  I've got an old Win98 machine next to my modern one and they are on a KVM switch, so it's no problem for me to use Genecyst. Gens will just be a little easier in the future.  Since I can run it on the same machine and don't have to deal with PCX.

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
RE: Gens KMod modifications for mapping
« Reply #10 on: July 15, 2007, 09:25:38 am »
Well, I added it as an option.



http://www.smspower.org/maxim/forumstuff/gens_kmod_maxim_002.zip



If you enable colour masking with layer B on, you get this secret message in Sonic 1. I wonder if the Sonic fanboys know about it?



User posted image

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
RE: Gens KMod modifications for mapping
« Reply #11 on: July 26, 2007, 04:59:15 am »
So it turns out the secret credits screen can be shown, in the original Japanese release (the one with the double-spike-death bug), with a certain keypress (CCCCCCUDLR, wait for demo, A+B+C+D+Start, apparently). Never mind.



Anywho, I had a stab at mapping a stage from Sonic 1 using my autostitcher a few days ago. It worked fairly well but the palette rotation for waterfalls confused it (since when that's all you can see, it looks like scrolling). So, my solution is to try to modify Gens again with a checkbox that will, when checked, disable all palette changes (ie. maintain the current palette and ignore updates). I imagine this will be useful for a lot of other games too, but if you reply here with encouragement it'll increase the probability that I'll actually persevere with it.



Technical note: the palette (CRAM) can be updated in four or five different ways on the Mega Drive, and unfortunately some of those ways are things like DMA which will be a bitch to filter (and also probably slow things down a bit). My first approach was to neuter the code that updates the internal 16-bit palette lookup table based on the current CRAM contents, but it never quite worked right and it's hell to debug because it's in assembler. I may persevere with this a bit. My next approach will probably be to take a palette snapshot and force-apply it at the start of every rendered line, but that adds up to 3.5MB/s of writing...

Offline TerraEsperZ

  • Hero Member
  • *****
  • Posts: 2326
RE: Gens KMod modifications for mapping
« Reply #12 on: July 26, 2007, 06:14:58 am »
Oh, that would be nice! It's been a while since I've hit a stage with a changing palette, but they slow my work considerably since I pretty much have to adjust all the changing colors by hand before pasting every screenshot.



Looks like you just created more work for yourself :D !



---

"With the first link, the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably." [...] The first time any man's freedom is trodden on, we're all damaged. - Captain Jean-Luc Picard



B*tch, meet reality. Reality, meet b*tch. - Me
Current project:
Mega Man: Powered Up (PSP)

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 640
RE: Gens KMod modifications for mapping
« Reply #13 on: July 26, 2007, 12:46:28 pm »
I just open the VDP Debug Window and pause the emulation when the colors cycle to the correct position.  The real challenge is games that don't use a palette cycle for animated water, etc.



How about a cheat finder Maxim?

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
RE: Gens KMod modifications for mapping
« Reply #14 on: July 26, 2007, 04:31:10 pm »
That's hard work, and Kega works fine for that already. It seems you have to tweak its codes a bit when transferring to Gens, though; I'm not sure who's to blame.