From dbd902a52a742563abac281778c92b5ef5ccd4c7 Mon Sep 17 00:00:00 2001
From: "B. Watson" <yalhcru@gmail.com>
Date: Mon, 5 Sep 2016 05:16:16 -0400
Subject: now I know what the all-black shapes are

---
 jumpmanjr.dasm  | 15 +++++++++------
 jumpmanjr.info  |  6 +++---
 main.info       |  6 +++---
 renderlevels.pl | 13 +++++++++++++
 4 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/jumpmanjr.dasm b/jumpmanjr.dasm
index 9ab269d..b303023 100644
--- a/jumpmanjr.dasm
+++ b/jumpmanjr.dasm
@@ -1,5 +1,5 @@
 ; da65 V2.15 - Git 104f898
-; Created:    2016-09-04 17:23:00
+; Created:    2016-09-05 05:15:49
 ; Input file: jumpmanjr.rom
 ; Page:       1
 
@@ -4174,7 +4174,8 @@ sh_girder:
         .byte   $04,$00,$00,$01,$01,$01,$01,$04 ; 9C33 04 00 00 01 01 01 01 04  ........
         .byte   $00,$01,$01,$00,$01,$00,$04,$00 ; 9C3B 00 01 01 00 01 00 04 00  ........
         .byte   $02,$01,$01,$01,$01,$FF         ; 9C43 02 01 01 01 01 FF        ......
-sh_blank_4x4:
+; all the bombs on blackout are drawn as this
+sh_black_4x3:
         .byte   $04,$00,$00,$00,$00,$00,$00,$04 ; 9C49 04 00 00 00 00 00 00 04  ........
         .byte   $00,$01,$00,$00,$00,$00,$04,$00 ; 9C51 00 01 00 00 00 00 04 00  ........
         .byte   $02,$00,$00,$00,$00,$FF         ; 9C59 02 00 00 00 00 FF        ......
@@ -4185,8 +4186,9 @@ sh_ladder:
         .byte   $02,$02,$02,$02,$02,$02,$02,$02 ; 9C77 02 02 02 02 02 02 02 02  ........
         .byte   $00,$03,$02,$02,$02,$06,$03,$02 ; 9C7F 00 03 02 02 02 06 03 02  ........
         .byte   $02,$FF                         ; 9C87 02 FF                    ..
-; dunno, solid black shape
-sh_9c89:.byte   $02,$00,$00,$00,$00,$02,$06,$00 ; 9C89 02 00 00 00 00 02 06 00  ........
+; ladder in black pixels, used for erasing ladders
+sh_black_ladder:
+        .byte   $02,$00,$00,$00,$00,$02,$06,$00 ; 9C89 02 00 00 00 00 02 06 00  ........
         .byte   $00,$00,$02,$00,$01,$00,$00,$02 ; 9C91 00 00 02 00 01 00 00 02  ........
         .byte   $06,$01,$00,$00,$08,$00,$02,$00 ; 9C99 06 01 00 00 08 00 02 00  ........
         .byte   $00,$00,$00,$00,$00,$00,$00,$02 ; 9CA1 00 00 00 00 00 00 00 02  ........
@@ -4203,8 +4205,9 @@ sh_down_rope:
         .byte   $01,$00,$00,$02,$01,$00,$01,$02 ; 9CDA 01 00 00 02 01 00 01 02  ........
         .byte   $01,$01,$02,$02,$01,$01,$03,$02 ; 9CE2 01 01 02 02 01 01 03 02  ........
         .byte   $FF                             ; 9CEA FF                       .
-; dunno, solid black shape
-sh_9ceb:.byte   $02,$00,$00,$00,$00,$02,$00,$01 ; 9CEB 02 00 00 00 00 02 00 01  ........
+; not sure where this is used, probably for erasing ropes
+sh_black_2x4:
+        .byte   $02,$00,$00,$00,$00,$02,$00,$01 ; 9CEB 02 00 00 00 00 02 00 01  ........
         .byte   $00,$00,$02,$00,$02,$00,$00,$02 ; 9CF3 00 00 02 00 02 00 00 02  ........
         .byte   $00,$03,$00,$00,$FF             ; 9CFB 00 03 00 00 FF           .....
 ; jumpman's animation frames and other sprites, seem to be 10 bytes per sprite
diff --git a/jumpmanjr.info b/jumpmanjr.info
index 46e83c7..1b62dee 100644
--- a/jumpmanjr.info
+++ b/jumpmanjr.info
@@ -527,13 +527,13 @@ range { name "color0_table"; start $9728; end $972b; type bytetable; };
 range { name "color0_table_minus_one"; start $9727; end $9727; type bytetable; };
 range { name "level_gfx"; start $9C21; end $9cff; type bytetable; comment "definitions for level graphics objects aka shapes. (girder segment, ladder, rope, etc)"; };
 label { name "sh_girder"; addr $9C33; comment "3 rows of pixels. 1st: 04 = 4 pixels wide, 00 00 = no X/Y offset, 01 01 01 01 = actual pixel data (4 color0 pixels). see level_maps.txt"; };
-label { name "sh_blank_4x4"; addr $9C49; };
+label { name "sh_black_4x3"; addr $9C49; comment "all the bombs on blackout are drawn as this"; };
 label { name "sh_ladder"; addr $9C5F; };
-label { name "sh_9c89"; addr $9c89; comment "dunno, solid black shape"; };
+label { name "sh_black_ladder"; addr $9c89; comment "ladder in black pixels, used for erasing ladders"; };
 label { name "sh_bomb"; addr $9cb3; };
 label { name "sh_up_rope"; addr $9cc9; };
 label { name "sh_down_rope"; addr $9cda; };
-label { name "sh_9ceb"; addr $9ceb; comment "dunno, solid black shape"; };
+label { name "sh_black_2x4"; addr $9ceb; comment "not sure where this is used, probably for erasing ropes"; };
 range { name "sprite_table"; start $9d00; end $9dff; type bytetable; comment "jumpman's animation frames and other sprites, seem to be 10 bytes per sprite"; };
 range { name "sxf_teleport"; start $b319; end $b31f; type bytetable; comment "referenced by herethere_bomb_sub"; };
 range { name "herethere_sprite0"; start $b2a8; end $B2b1; type bytetable; comment "portal animation frames"; };
diff --git a/main.info b/main.info
index 507f535..1a5ea58 100644
--- a/main.info
+++ b/main.info
@@ -525,13 +525,13 @@ range { name "color0_table"; start $9728; end $972b; type bytetable; };
 range { name "color0_table_minus_one"; start $9727; end $9727; type bytetable; };
 range { name "level_gfx"; start $9C21; end $9cff; type bytetable; comment "definitions for level graphics objects aka shapes. (girder segment, ladder, rope, etc)"; };
 label { name "sh_girder"; addr $9C33; comment "3 rows of pixels. 1st: 04 = 4 pixels wide, 00 00 = no X/Y offset, 01 01 01 01 = actual pixel data (4 color0 pixels). see level_maps.txt"; };
-label { name "sh_blank_4x4"; addr $9C49; };
+label { name "sh_black_4x3"; addr $9C49; comment "all the bombs on blackout are drawn as this"; };
 label { name "sh_ladder"; addr $9C5F; };
-label { name "sh_9c89"; addr $9c89; comment "dunno, solid black shape"; };
+label { name "sh_black_ladder"; addr $9c89; comment "ladder in black pixels, used for erasing ladders"; };
 label { name "sh_bomb"; addr $9cb3; };
 label { name "sh_up_rope"; addr $9cc9; };
 label { name "sh_down_rope"; addr $9cda; };
-label { name "sh_9ceb"; addr $9ceb; comment "dunno, solid black shape"; };
+label { name "sh_black_2x4"; addr $9ceb; comment "not sure where this is used, probably for erasing ropes"; };
 range { name "sprite_table"; start $9d00; end $9dff; type bytetable; comment "jumpman's animation frames and other sprites, seem to be 10 bytes per sprite"; };
 range { name "sxf_teleport"; start $b319; end $b31f; type bytetable; comment "referenced by herethere_bomb_sub"; };
 range { name "herethere_sprite0"; start $b2a8; end $B2b1; type bytetable; comment "portal animation frames"; };
diff --git a/renderlevels.pl b/renderlevels.pl
index 8d0140c..e967991 100644
--- a/renderlevels.pl
+++ b/renderlevels.pl
@@ -8,6 +8,9 @@
 
 $verbose = 0; # 0 = quiet, 2 = very chatty
 
+$black_is_white = 0; # 1 = draw all-black shapes in white. only affects
+                     # level09.png (the bombs are invisible there).
+
 use Image::Magick;
 use bytes;
 
@@ -35,6 +38,13 @@ sub getdelta {
 sub draw {
 	my ($img, $shape, $dx, $dy, $xpos, $ypos, $copies) = @_;
 	warn sprintf "drawing shape %04x at $xpos, $ypos, $copies copies, delta ($dx, $dy)\n", $shape if $verbose > 1;
+	my $white = 0;
+	if($black_is_white && ($shape == 0x9c89 || $shape == 0x9ceb || $shape == 0x9c49)) {
+		warn "drawing all-black shape in white\n";
+		$white = 1;
+		#$shape = 0x9c89; # see the other black shapes in level09.png
+		#$shape = 0x9ceb;
+	}
 	while($copies--) {
 		my $width;
 		my $addr = $shape;
@@ -44,6 +54,9 @@ sub draw {
 			for(my $p = 0; $p < $width; $p++) {
 				my $pixel = getbyte($addr++);
 				my $color = $palette{$pixel};
+				if($white) {
+					$color = [ 0xffff, 0xffff, 0xffff]; # make invisible stuff show up white
+				}
 				$img->SetPixel(x => $xpos + $xoffs + $p, y => $ypos + $yoffs, color => $color);
 			}
 		}
-- 
cgit v1.2.3