ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > The Junkyard > Legend Entertainment's Games Goto page Previous  1, 2, 3
Legend Entertainment's Games
  Author    Thread Reply to topic
dreammaster
ScummVM Developer


Joined: 04 Nov 2005
Posts: 319
Location: Boston, Massachusetts, USA
 

quote:
Originally posted by Risca
I've updated my too to allow selecting sub palettes. I also added a zoom slider. Code is on GitHub



It'll likely be difficult to come up with a general purpose solution without reversing the scene display code from the actual games, which I'll get around to eventually. But in the interim, every little bit you find out will help me eventually. So thanks Smile
 Reply with quote  
Post Wed Jun 07, 2017 3:17 am 
 View user's profile Send private message
Risca



Joined: 07 May 2012
Posts: 9
 

I've come back to this issue tonight to dig for some more information, but I can't wrap my head around it.
I added extra log outputs to dosbox-0.74 so that it would print out the palette when it's changed:

code:

--- dosbox-0.74/src/gui/render.cpp.old   2017-11-05 23:23:45.508654441 +0100
+++ dosbox-0.74/src/gui/render.cpp   2017-11-05 23:24:34.987851237 +0100
@@ -68,11 +68,16 @@
       break;
    case scalerMode32:
    default:
+      if (render.pal.first == 0) {
+         LOG_MSG("const uint32_t g_palette[256] = {\n");
+      }
+
       for (i=render.pal.first;i<=render.pal.last;i++) {
          Bit8u r=render.pal.rgb[i].red;
          Bit8u g=render.pal.rgb[i].green;
          Bit8u b=render.pal.rgb[i].blue;
          Bit32u newPal = GFX_GetRGB(r,g,b);
+         LOG_MSG("\t0x%08X,\n", newPal);
          if (newPal != render.pal.lut.b32[i]) {
             render.pal.changed = true;
             render.pal.modified[i] = 1;



I also added extra printouts for other system calls like file open, read, and close. Here's an example of the log output from a run of the game:
code:

   8281289: FILES:file open command 0 file DGATE010.FNT
SPEL\DGATE\DGATE010.FNT: reading 4096 bytes @ 0x00000000
   8303866: FILES:file close command: SPEL\DGATE\DGATE010.FNT
   8367343: FILES:file close command: SPEL\DGATE\DGATE000.PIC
   8372084: FILES:file open command 0 file C:\SPEL\DGATE\DGATE001.PIC
SPEL\DGATE\DGATE001.PIC: reading 4096 bytes @ 0x00000000
SPEL\DGATE\DGATE001.PIC: reading 4096 bytes @ 0x00001000
SPEL\DGATE\DGATE001.PIC: reading 5120 bytes @ 0x00002000
SPEL\DGATE\DGATE001.PIC: reading 4096 bytes @ 0x00003400
   8593830: FILES:file close command: SPEL\DGATE\DGATE001.PIC
   8598443: FILES:file open command 0 file C:\SPEL\DGATE\DGATE000.PIC
SPEL\DGATE\DGATE000.PIC: reading 4096 bytes @ 0x00000000
SPEL\DGATE\DGATE000.PIC: reading 4096 bytes @ 0x0000196D
   8702771: FILES:file close command: SPEL\DGATE\DGATE000.PIC
   8706810: FILES:file open command 0 file C:\SPEL\DGATE\DGATE001.PIC
SPEL\DGATE\DGATE001.PIC: reading 4096 bytes @ 0x00000000
SPEL\DGATE\DGATE001.PIC: reading 4096 bytes @ 0x0001311A
SPEL\DGATE\DGATE001.PIC: reading 4096 bytes @ 0x000062AC
   8779698: FILES:file open command 0 file C:\SPEL\DGATE\DGATE019.RGN
SPEL\DGATE\DGATE019.RGN: reading 4096 bytes @ 0x00000000
   8836227: FILES:file close command: SPEL\DGATE\DGATE001.PIC
   8840350: FILES:file open command 0 file C:\SPEL\DGATE\DGATE019.PIC
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00000000
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x0001EA98
SPEL\DGATE\DGATE019.PIC: reading 4608 bytes @ 0x0001FA98
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00020C98
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00021C98
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00022C98
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00023C98
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00024C98
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00025C98
   8894818: FILES:file close command: SPEL\DGATE\DGATE019.PIC
   8899704: FILES:file open command 0 file C:\SPEL\DGATE\DGATE057.PIC
SPEL\DGATE\DGATE057.PIC: reading 4096 bytes @ 0x00000000
SPEL\DGATE\DGATE057.PIC: reading 4096 bytes @ 0x0006FDE4
   8928523: FILES:file close command: SPEL\DGATE\DGATE057.PIC
   8933374: FILES:file open command 0 file C:\SPEL\DGATE\DGATE019.PIC
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00000000
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00028891
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x00026B68
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x0002865C
SPEL\DGATE\DGATE019.PIC: reading 4096 bytes @ 0x0002788A
const uint32_t g_palette[256] = {
   0x00000000,
   0x00101010,
...
   0x00414141,
   0x00FFFFFF,



There is much more in the log but I thought it best to keep it short. There is also a fading effect going on after the intro. This seems to be done with palette cycling; a lot of new palettes are getting applied while after the intro is done and the first scene fades in.

I've setup dosbox to automatically run the game and I hit the ESC button to skip any intro, which takes me directly to the first interactive screen. This is how that screen looks like:



By inspecting the log, and using my tool to open the resource files, I can see that the game extracts a few different images and layer them on top of each other. For example, DGATE019.PIC contains this image at offset 0x0001EA98



Notice how the right lamp post, Xar, and the Nexus seal piece above his head are missing. These are all also located in the DGATE019.PIC resource file, at the offsets indicated by the log file. However, and this is what really bothers me, if I take the exact palette that dosbox dumped in the log for me and apply it to those overlayed images, it shows the completely wrong colors (the "big" picture is fine). For example, here's what I believe is the lamp post and the nexus seal piece:



I feel like I'm missing something crucial in understanding either how palettes work or how death gate is handling these overlayed images. Maybe there is some kind of index translation going on?
There might be some clues in the DGATE019.RGN file that is opened just before DGATE019.PIC.

Test code is, as usual, available on GitHub

EDIT:
I feel that figuring out how the scene display code works is the major blocker for allowing me (and others) to work on an actual game engine for Death Gate. I'm running out of ideas and that's when the progress slows down. If only I could figure this out, it would be so much easier to start hacking away at getting an actual game running. It would definitely feel like it's progressing faster once you can actually interact with the game.
 Reply with quote  
Post Sun Nov 05, 2017 11:15 pm 
 View user's profile Send private message
dreammaster
ScummVM Developer


Joined: 04 Nov 2005
Posts: 319
Location: Boston, Massachusetts, USA
 

A bit of good news. Barring any other bugs turning up, I've finished development on the Starship Titanic engine, which now supports both the English and German versions. I'm now returning to work finishing up the Xeen engine, with the anticipation that I'll spend some more solid time working on the Legend games when I've done with it.

 Reply with quote  
Post Mon Nov 06, 2017 3:43 pm 
 View user's profile Send private message
Dark-Star



Joined: 30 Oct 2005
Posts: 126
Location: Reutlingen, GERMANY
 

quote:
Originally posted by dreammaster
A bit of good news [...] I'm now returning to work finishing up the Xeen engine...

Cool! Looking forward to saving Crodo once again Very Happy
 Reply with quote  
Post Tue Nov 07, 2017 10:20 pm 
 View user's profile Send private message
Risca



Joined: 07 May 2012
Posts: 9
 

Okay, I updated my resource manage to visually show me the palette of the "big" images. I also fixed a bug where the transparency of overlayed images where not working properly.

From what I can see, it seems quite common for the palette at index 17-80 to be all green and not used. It's only the smaller images that references that part of the palette, and they only reference index 17 (see attached picture).



The code is, as usual, available on GitHub

 Reply with quote  
Post Sat Nov 11, 2017 1:12 am 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 
Goto page Previous  1, 2, 3


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge