The NEW Palette Patch: smooth fading and custom darkness pal

Completed patches for Keen1.
User avatar
Fleexy
Site Admin
Posts: 490
Joined: Fri Dec 12, 2008 1:33 am
Location: Bloogton Tower

Post by Fleexy »

Make light rooms dark and dark rooms light!
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Added to the keen wiki here: http://www.shikadi.net/keenwiki/Patch:P ... olor_patch

I hope I commented on it correctly?
Mink
Posts: 192
Joined: Sat Nov 03, 2007 4:08 pm
Location: Providence, RI, US

Post by Mink »

So I had been holding off testing this since I figured it was pretty much just another not really noticeable palette patch, and wow I stand corrected; that is some seriously nice patching, Dr K - it makes everything else feel clunky! Like THC was saying, this'll have a fair bit of repercussions on mods' styles, and man I am excited for the possibilities.
Dr. Kylstein
Posts: 120
Joined: Wed Dec 16, 2009 5:20 pm

Post by Dr. Kylstein »

levellass wrote:Added to the keen wiki here: http://www.shikadi.net/keenwiki/Patch:P ... olor_patch

I hope I commented on it correctly?
Those values you highlighted in the the fade functions are not delay values and should not be modified. $40 = 64, or max brightness + 1, the number of shade levels the fade loops through. The fades are synchronized to the video update, so the only way to speed them up is to make them double-step.

Also, I'm pretty sure the sprites are frozen during the original fade routines. If you can prove otherwise, I'll fix that.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

Sprites are not drawn until fade in has completed.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

However, since the fades are much smoother than the originals, this is more readily noticeable. Also, I have managed to shorten the fade time by changing those two values to half (32, $20), which works better for my mod, what effect does this have? Can it cause a crash or graphics problems?
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Finally got around to trying it. Very, very tasty.

I'm not finding everything 'clunky' after seeing it. In fact, the contrast makes me appreciate the graphics even more.
Dr. Kylstein
Posts: 120
Joined: Wed Dec 16, 2009 5:20 pm

Post by Dr. Kylstein »

levellass wrote:However, since the fades are much smoother than the originals, this is more readily noticeable. Also, I have managed to shorten the fade time by changing those two values to half (32, $20), which works better for my mod, what effect does this have? Can it cause a crash or graphics problems?
It shouldn't cause any serious problems, but it will only fade to/from half-darkened instead of black.

Edit: Here's a version that double-steps.

Code: Select all

# Set the palette when we go into graphics mode
%patch $6E46 $E8 $64 $FE $90 $90

#support functions
%patch $5B3D $BA $DA $03 $EC $A8 $08 $75 $FB $EC $A8 $08 $74 $FB $C3 $55 $89
             $E5 $E8 $EC $FF $BA $DA $03 $EC $BA $C0 $03 $EC $50 $B0 $14 $EE
             $8B $46 $04 $EE $58 $EE $89 $EC $5D $C3 $55 $89 $E5 $83 $EC $08
             $31 $C0 $31 $DB $89 $46 $F8 $8A $87 $00 $E8 $2A $46 $04 $73 $02
             $31 $C0 $89 $46 $FA $43 $8A $87 $00 $E8 $2A $46 $04 $73 $02 $31
             $C0 $89 $46 $FC $43 $8A $87 $00 $E8 $2A $46 $04 $73 $02 $31 $C0
             $89 $46 $FE $43 $E8 $B9 $10 $FF $46 $F8 $83 $FB $60 $75 $C8 $89
             $EC $5D $C3

#VGA palette fading
%patch $6C49 $B9 $20 $00 $E8 $EE $EE $89 $C8 $D1 $E0 $48 $50 $E8 $0F $EF $44
             $44 $E2 $F0 $C3 $55 $89 $E5 $BA $C8 $03 $8B $46 $04 $EE $BA $C9
             $03 $8B $46 $06 $EE $8B $46 $08 $EE $8B $46 $0A $EE $89 $EC $5D
             $C3 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00
             $00 $00 $00 $00 $B9 $20 $00 $E8 $AA $EE $B8 $40 $00 $D1 $E1 $29
             $C8 $50 $E8 $C9 $EE $44 $44 $D1 $E9 $E2 $EC $31 $C0 $50 $E8 $A1
             $EE $44 $44 $C3 $B8 $0D $00 $CD $10 $B8 $13 $10 $BB $00 $01 $CD
             $10 $B8 $02 $10 $1E $07 $BA $3B $25 $CD $10 $B8 $12 $10 $B9 $20
             $00 $31 $DB $BA $00 $E8 $CD $10 $C3

#VGA lights
%patch $3592 $C7 $06 $1E $82 $01 $00 $B8 $01 $00 $50 $E8 $43 $8B $44 $44 $31
             $C0 $50 $E8 $A4 $25 $44 $44 $C3 $00 $00 $00 $00 $00 $00 $00 $00
             $C7 $06 $1E $82 $00 $00 $B8 $01 $00 $50 $E8 $23 $8B $44 $44 $B8
             $01 $00 $50 $E8 $83 $25 $44 $44 $C3

%patch	$3596 $01 $00 #lights on delay
%patch	$35B9 $01 $00 #lights off delay
I think this may be closer to the pace of the original routines.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Added to the wiki. I assume the above patch needs the two palettes and the Set EGA color register values code.
Dr. Kylstein
Posts: 120
Joined: Wed Dec 16, 2009 5:20 pm

Post by Dr. Kylstein »

levellass wrote:Added to the wiki. I assume the above patch needs the two palettes and the Set EGA color register values code.
Yes. I've updated the wiki article to make the two patches more consistent and tweak the formatting a bit.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Cool, cleared up the commentary just a bit. This is excellent stuff!
Post Reply