From e17f3b6c02cb8674a87d245d3ec667b8cb6caf82 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 11 Jul 2019 14:04:32 -0400 Subject: [PATCH] png2rle: actually fix png2rle 4-bit mode forgot to mask colors --- gr-utils/loadpng.c | 4 ++-- ootw/ootw_graphics/l2jail/ootw_c2_jail.inc | 24 ++++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/gr-utils/loadpng.c b/gr-utils/loadpng.c index 725664eb..9df9e7e0 100644 --- a/gr-utils/loadpng.c +++ b/gr-utils/loadpng.c @@ -184,10 +184,10 @@ int loadpng(char *filename, unsigned char **image_ptr, int *xsize, int *ysize) { } else if (bit_depth==4) { /* top color */ - a2_color=row_pointers[y][x]; + a2_color=(row_pointers[y][x])&0xf; /* bottom color */ - color=row_pointers[y+1][x]; + color=(row_pointers[y+1][x])&0xf; a2_color|=(color<<4); diff --git a/ootw/ootw_graphics/l2jail/ootw_c2_jail.inc b/ootw/ootw_graphics/l2jail/ootw_c2_jail.inc index 8e9dd424..0c0e4cf8 100644 --- a/ootw/ootw_graphics/l2jail/ootw_c2_jail.inc +++ b/ootw/ootw_graphics/l2jail/ootw_c2_jail.inc @@ -244,17 +244,19 @@ jail4_rle: .byte $28 ; ysize=48 .byte $A0,$28,$00 .byte $A1 dome_rle: .byte $28 ; ysize=48 - .byte $A8,$66, $A3,$22, $A0,$12,$00, $A3,$22, $AE,$66, $A3,$22, $A0,$16,$00 - .byte $22,$22, $AC,$66, $A3,$22, $A0,$18,$00, $A3,$22, $A9,$66, $A3,$22 - .byte $A0,$1A,$00, $A3,$22, $A7,$66, $A3,$22, $A0,$1C,$00, $A3,$22, $A6,$66 - .byte $A3,$22, $A0,$1C,$00, $A3,$22, $A5,$66, $A3,$22, $A0,$1E,$00, $A3,$22 - .byte $A4,$66, $22,$22, $A0,$20,$00, $22,$22, $A3,$66, $A3,$22, $A0,$1B,$00 - .byte $77, $66, $55, $66, $00, $A3,$22, $66,$66 - .byte $22,$22, $A0,$1B,$00, $22, $77, $76, $75, $76 - .byte $60, $00, $22,$22, $66,$66, $22,$22, $A0,$1A,$00, $20 - .byte $22,$22, $77, $66, $55, $66, $00, $22,$22 - .byte $66, $A3,$22, $A0,$1A,$00, $A3,$22, $77, $66, $75 - .byte $66, $00, $A6,$22, $A0,$19,$00, $A7,$22, $00,$00, $A5,$22 + .byte $A7,$66, $26, $A3,$22, $A0,$12,$00, $A3,$22, $26, $AD,$66 + .byte $A3,$22, $A0,$16,$00, $22,$22, $26, $AA,$66, $26, $A3,$22 + .byte $A0,$18,$00, $A3,$22, $26, $A8,$66, $A3,$22, $A0,$1A,$00, $A3,$22 + .byte $A7,$66, $A3,$22, $A0,$1C,$00, $A3,$22, $A5,$66, $26, $22,$22 + .byte $02, $A0,$1C,$00, $02, $22,$22, $26, $A4,$66, $A3,$22 + .byte $A0,$1E,$00, $A3,$22, $A3,$66, $26, $22,$22, $A0,$20,$00, $22,$22 + .byte $26, $66,$66, $A3,$22, $A0,$1B,$00, $77, $66, $55 + .byte $66, $00, $A3,$22, $66,$66, $22,$22, $A0,$1B,$00, $22 + .byte $27, $76, $65, $56, $60, $00, $22,$22 + .byte $66, $26, $22,$22, $A0,$1A,$00, $20, $22,$22, $77 + .byte $66, $55, $66, $00, $22,$22, $26, $A3,$22 + .byte $A0,$1A,$00, $A3,$22, $27, $26, $25, $26, $00 + .byte $A5,$22, $02, $A0,$19,$00, $A7,$22, $00,$00, $02, $A4,$22 .byte $A0,$19,$00, $20, $A6,$22, $A4,$00, $A4,$22, $A0,$18,$00, $20 .byte $A7,$22, $A4,$00, $A4,$22, $A0,$17,$00, $20, $A7,$22, $A5,$00 .byte $22,$22, $A0,$11,$88, $A8,$00, $A0,$20,$88, $A8,$00, $A0,$20,$88, $A8,$00