agipal on ScummVm

Ask for help with ScummVM problems

Moderator: ScummVM Team

User avatar
sev
ScummVM Lead
Posts: 2304
Joined: Wed Sep 21, 2005 1:06 pm
Contact:

Post by sev »

Buddha wrote:Also what did you use to test your games as I don't know of
any AGI-interpreter that supports AGIPAL-files with more
than 6 bits per color component?
It may be my memory, but did not original AGIPAL hack just performed x & 0x3f on each color component without any checks? The disassembly could be rechecked and game screenshots compared.


Eugene
Buddha
ScummVM Developer
Posts: 53
Joined: Mon Apr 16, 2007 4:18 pm
Location: Turku, Finland
Contact:

Post by Buddha »

sev wrote:
Buddha wrote:Also what did you use to test your games as I don't know of
any AGI-interpreter that supports AGIPAL-files with more
than 6 bits per color component?
It may be my memory, but did not original AGIPAL hack just performed x & 0x3f on each color component without any checks? The disassembly could be rechecked and game screenshots compared.
I just happened to check the original AGIPAL-hack's
disassembly a little while ago with IDA and what it does
in the AGI003-file in sub_24F is that it just reads 192
bytes from the chosen AGIPAL-file straight into memory and
uses that data without any modification to set the palette.

Here's the palette setting part from it:

; ES:DX is already pointing to the AGIPAL-data's start
seg000:02B6 mov ax, 1012h
seg000:02B9 xor bx, bx
seg000:02BB mov cx, 64
seg000:02BE int 10h
; - VIDEO - SET BLOCK OF DAC REGISTERS (EGA, VGA/MCGA)
; BX = starting color register, CX = number of registers to set
; ES:DX -> table of 3*CX bytes where each 3 byte group represents one
; byte each of red, green and blue (0-63)

I suspect the weird layout of the AGIPAL-files is because
of VGA's mapping of the 16 EGA colors to the VGA-color
indices. Although I don't still understand how the color 6
(brown) would map correctly... The mapping from EGA color
index to VGA color index is this:

0 -> 0
1 -> 1
2 -> 2
3 -> 3
4 -> 4
5 -> 5
6 -> 20
7 -> 7
8 -> 56
9 -> 57
10 -> 58
11 -> 59
12 -> 60
13 -> 61
14 -> 62
15 -> 63

The original AGIPAL-hack I checked is the one made by
Dark Minister and it can be found at the FilePlanet at
http://dl.fileplanet.com/dl/dl.asp?Clas ... agipal.zip

Checked the disassembly of AGI Mouse v1.1 that has AGIPAL
support too. It does the palette changing exactly the
same way as the original AGIPAL hack by Dark Minister.
AGI Mouse v1.1 can be found at the FilePlanet at
http://dl.fileplanet.com/dl/dl.asp?Clas ... imse11.zip
Buddha
ScummVM Developer
Posts: 53
Joined: Mon Apr 16, 2007 4:18 pm
Location: Turku, Finland
Contact:

Post by Buddha »

Hi Robin,
Robin_Gravel wrote: Sometimes, pcx2pal gives you 8 bits per color and 6 bits.
I don't know why.
My first guess would be that the PCX-files are somehow
different and that's why the pal.10* files are too.
Could you please try using pcx2pal on some of the
files you've got and see if some file always gives you
8 bits per color component. If you find at least one such
file, then please e-mail me that file (And possibly also the
information about what painting program you used to make
that file). You can find my e-mail address at my wiki-page
at http://wiki.scummvm.org/index.php/User:Buddha%5E
User avatar
Robin_Gravel
Posts: 12
Joined: Sat Jan 26, 2008 5:06 pm
Contact:

Post by Robin_Gravel »

Buddha wrote:Hi Robin,
Robin_Gravel wrote: Sometimes, pcx2pal gives you 8 bits per color and 6 bits.
I don't know why.
My first guess would be that the PCX-files are somehow
different and that's why the pal.10* files are too.
Could you please try using pcx2pal on some of the
files you've got and see if some file always gives you
8 bits per color component. If you find at least one such
file, then please e-mail me that file (And possibly also the
information about what painting program you used to make
that file). You can find my e-mail address at my wiki-page
at http://wiki.scummvm.org/index.php/User:Buddha%5E
Please check your PM from this messageboard.

I have problem with your email address.


Robin Gravel
User avatar
df
ScummVM Developer
Posts: 38
Joined: Thu May 25, 2006 2:05 pm

Post by df »

when pulling from the pcx pallete, the r/g/b should be shifted 2 bits to the right (>> 2). pcx liked to promote its r/g/b's, from memory.
Post Reply