From: Nick Downing Date: Mon, 15 Jul 2024 06:32:07 +0000 (+1000) Subject: Fix issues with object1080_(4dc0,4e30,4ea0,4f10) tables whose accesses were not trace... X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=421381ceb932f5723b170f48ee8cec385d9c5bb6;p=star_disasm.git Fix issues with object1080_(4dc0,4e30,4ea0,4f10) tables whose accesses were not traced well and therefore the references were disassembled as belonging to neighbouring items or item's size was inconsistent with neighbouring items --- diff --git a/star_blazer/star_blazer.asm.patch b/star_blazer/star_blazer.asm.patch index 3fae032..653ed6d 100644 --- a/star_blazer/star_blazer.asm.patch +++ b/star_blazer/star_blazer.asm.patch @@ -1,5 +1,5 @@ ---- star_blazer.asm0 2024-07-13 23:29:18.663311980 +1000 -+++ star_blazer.asm 2024-07-13 23:30:25.067420483 +1000 +--- star_blazer.asm0 2024-07-15 16:29:17.007858038 +1000 ++++ star_blazer.asm 2024-07-15 16:38:50.862930039 +1000 @@ -1,3 +1,10 @@ +UNREACHABLE = 1 +DHGR = 0 @@ -87,7 +87,147 @@ ; 24-bit register, repurposed for divide routine as ; accumulator: divisor ; accumulator + 1: remainder -@@ -1255,7 +1301,7 @@ +@@ -399,20 +445,20 @@ + sta object1080_velocity_y_hi - 0x10,x ; 0b53 -> 0b56 -> 0b59 r x=50..52 + rts ; 0b56 -> 0b59 -> 0fcb r s=f0 + get_object_velocity_x_and_calculate_a: +- lda object1080_velocity_y_hi + 0x60,y ; 0b5a r ++ lda object1080_velocity_x_lo - 0x10,y ;object1080_velocity_y_hi + 0x60,y ; 0b5a r + sta *accumulator ; 0b5d r +- lda object1080_state + 0x60,y ; 0b5f r ++ lda object1080_velocity_x_hi - 0x10,y ;object1080_state + 0x60,y ; 0b5f r + jmp loc_0b6d ; 0b62 r + get_object_velocity_y_and_calculate_a: +- lda object1080_velocity_x_lo + 0x60,y ; 0b65 r ++ lda object1080_velocity_y_lo - 0x10,y ;object1080_velocity_x_lo + 0x60,y ; 0b65 r + sta *accumulator ; 0b68 r +- lda object1080_velocity_x_hi + 0x60,y ; 0b6a r ++ lda object1080_velocity_y_hi - 0x10,y ;object1080_velocity_x_hi + 0x60,y ; 0b6a r + loc_0b6d: + sty *y_save ; 0b6d r + sta *accumulator + 1 ; 0b6f r +- lda object1080_velocity_y_random_range + 0x60,y ; 0b71 r ++ lda object1080_4dc0 - 0x10,y ;object1080_velocity_y_random_range + 0x60,y ; 0b71 r + sta *temp ; 0b74 r +- lda object1080_4dc0 + 0x60,y ; 0b76 r ++ lda object1080_4e30 - 0x10,y ;object1080_4dc0 + 0x60,y ; 0b76 r + ldy *temp ; 0b79 r + jsr get_scaled_accumulator_to_ya ; 0b7b r + tya ; 0b7e r +@@ -421,46 +467,46 @@ + move_object_pos_pos: + jsr get_object_velocity_x_and_calculate_a ; 0b82 r + clc ; 0b85 r +- adc object1080_shape + 0x60,y ; 0b86 r +- sta object1080_shape + 0x60,x ; 0b89 r ++ adc object1080_x_hi - 0x10,y ;object1080_shape + 0x60,y ; 0b86 r ++ sta object1080_x_hi - 0x10,x ;object1080_shape + 0x60,x ; 0b89 r + jsr get_object_velocity_y_and_calculate_a ; 0b8c r + clc ; 0b8f r +- adc object1080_x_hi + 0x60,y ; 0b90 r +- sta object1080_x_hi + 0x60,x ; 0b93 r ++ adc object1080_y_hi - 0x10,y ;object1080_x_hi + 0x60,y ; 0b90 r ++ sta object1080_y_hi - 0x10,x ;object1080_x_hi + 0x60,x ; 0b93 r + rts ; 0b96 r + move_object_neg_pos: + jsr get_object_velocity_y_and_calculate_a ; 0b97 r + jsr neg_a ; 0b9a r + clc ; 0b9d r +- adc object1080_shape + 0x60,y ; 0b9e r +- sta object1080_shape + 0x60,x ; 0ba1 r ++ adc object1080_x_hi - 0x10,y ;object1080_shape + 0x60,y ; 0b9e r ++ sta object1080_x_hi - 0x10,x ;object1080_shape + 0x60,x ; 0ba1 r + jsr get_object_velocity_x_and_calculate_a ; 0ba4 r + clc ; 0ba7 r +- adc object1080_x_hi + 0x60,y ; 0ba8 r +- sta object1080_x_hi + 0x60,x ; 0bab r ++ adc object1080_y_hi - 0x10,y ;object1080_x_hi + 0x60,y ; 0ba8 r ++ sta object1080_y_hi - 0x10,x ;object1080_x_hi + 0x60,x ; 0bab r + rts ; 0bae r + move_object_neg_neg: + jsr get_object_velocity_x_and_calculate_a ; 0baf r + jsr neg_a ; 0bb2 r + clc ; 0bb5 r +- adc object1080_shape + 0x60,y ; 0bb6 r +- sta object1080_shape + 0x60,x ; 0bb9 r ++ adc object1080_x_hi - 0x10,y ;object1080_shape + 0x60,y ; 0bb6 r ++ sta object1080_x_hi - 0x10,x ;object1080_shape + 0x60,x ; 0bb9 r + jsr get_object_velocity_y_and_calculate_a ; 0bbc r + jsr neg_a ; 0bbf r + clc ; 0bc2 r +- adc object1080_x_hi + 0x60,y ; 0bc3 r +- sta object1080_x_hi + 0x60,x ; 0bc6 r ++ adc object1080_y_hi - 0x10,y ;object1080_x_hi + 0x60,y ; 0bc3 r ++ sta object1080_y_hi - 0x10,x ;object1080_x_hi + 0x60,x ; 0bc6 r + rts ; 0bc9 r + move_object_pos_neg: + jsr get_object_velocity_y_and_calculate_a ; 0bca r + clc ; 0bcd r +- adc object1080_shape + 0x60,y ; 0bce r +- sta object1080_shape + 0x60,x ; 0bd1 r ++ adc object1080_x_hi - 0x10,y ;object1080_shape + 0x60,y ; 0bce r ++ sta object1080_x_hi - 0x10,x ;object1080_shape + 0x60,x ; 0bd1 r + jsr get_object_velocity_x_and_calculate_a ; 0bd4 r + jsr neg_a ; 0bd7 r + clc ; 0bda r +- adc object1080_x_hi + 0x60,y ; 0bdb r +- sta object1080_x_hi + 0x60,x ; 0bde r ++ adc object1080_y_hi - 0x10,y ;object1080_x_hi + 0x60,y ; 0bdb r ++ sta object1080_y_hi - 0x10,x ;object1080_x_hi + 0x60,x ; 0bde r + rts ; 0be1 r + get_object_velocity_x_and_calculate_ya: + lda object1080_velocity_x_lo - 0x10,y ; 0c06,0c3b -> 0be2 -> 0be5 r y=44..6a +@@ -494,14 +540,14 @@ + update_object_velocity_rotate_90: + jsr get_object_velocity_y_and_calculate_ya ; 0c1f r + jsr neg_ya ; 0c22 r +- sta object1080_velocity_y_hi + 0x60,x ; 0c25 r ++ sta object1080_velocity_x_lo - 0x10,x ;object1080_velocity_y_hi + 0x60,x ; 0c25 r + tya ; 0c28 r +- sta object1080_state + 0x60,x ; 0c29 r ++ sta object1080_velocity_x_hi - 0x10,x ;object1080_state + 0x60,x ; 0c29 r + ldy *y_save ; 0c2c r + jsr get_object_velocity_x_and_calculate_ya ; 0c2e r +- sta object1080_velocity_x_lo + 0x60,x ; 0c31 r ++ sta object1080_velocity_y_lo - 0x10,x ;object1080_velocity_x_lo + 0x60,x ; 0c31 r + tya ; 0c34 r +- sta object1080_velocity_x_hi + 0x60,x ; 0c35 r ++ sta object1080_velocity_y_hi - 0x10,x ;object1080_velocity_x_hi + 0x60,x ; 0c35 r + ldy *y_save ; 0c38 r + rts ; 0c3a r + update_object_velocity_rotate_180: +@@ -520,15 +566,15 @@ + rts ; 0c57 -> 0c59 -> 0fcb r s=f0 + update_object_velocity_rotate_270: + jsr get_object_velocity_y_and_calculate_ya ; 0c5a r +- sta object1080_velocity_y_hi + 0x60,x ; 0c5d r ++ sta object1080_velocity_x_lo - 0x10,x ;object1080_velocity_y_hi + 0x60,x ; 0c5d r + tya ; 0c60 r +- sta object1080_state + 0x60,x ; 0c61 r ++ sta object1080_velocity_x_hi - 0x10,x ;object1080_state + 0x60,x ; 0c61 r + ldy *y_save ; 0c64 r + jsr get_object_velocity_x_and_calculate_ya ; 0c66 r + jsr neg_ya ; 0c69 r +- sta object1080_velocity_x_lo + 0x60,x ; 0c6c r ++ sta object1080_velocity_y_lo - 0x10,x ;object1080_velocity_x_lo + 0x60,x ; 0c6c r + tya ; 0c6f r +- sta object1080_velocity_x_hi + 0x60,x ; 0c70 r ++ sta object1080_velocity_y_hi - 0x10,x ;object1080_velocity_x_hi + 0x60,x ; 0c70 r + ldy *y_save ; 0c73 r + rts ; 0c75 r + horizontal_collision: +@@ -570,8 +616,8 @@ + horizontal_collision_and_zero: + jsr horizontal_collision ; 0cc4 r + lda #0x00 ; 0cc7 r +- sta object1080_velocity_y_hi + 0x60,x ; 0cc9 r +- sta object1080_state + 0x60,x ; 0ccc r ++ sta object1080_velocity_x_lo - 0x10,x ;object1080_velocity_y_hi + 0x60,x ; 0cc9 r ++ sta object1080_velocity_x_hi - 0x10,x ;object1080_state + 0x60,x ; 0ccc r + rts ; 0ccf r + vertical_collision_and_zero: + jsr vertical_collision ; 1015 -> 0cd0 -> 0c9d r s=f5 +@@ -1258,7 +1304,7 @@ tsx ; 1095 -> 1097 -> 1098 r stx *ucode_sp ; 1097 -> 1098 -> 109a r ldx *ucode_x_save_c9 ; 1098 -> 109a -> 109c r @@ -96,7 +236,7 @@ sta *ucode_object_state ; 109c -> 109f -> 10a1 r ; alternative entry point for ucode_execute_words that comes from scoring? ucode_execute_words_entry: -@@ -1285,7 +1331,7 @@ +@@ -1288,7 +1334,7 @@ ; returns the current value of object1080_state for the object in x ; I think this might be to provide the correct flags return? ucode_execute_words_done: @@ -105,7 +245,7 @@ rts ; 10cd -> 10d0 -> 123e,143a,1615,1629,1633,1649,165b,1759 r s=f7..fd,02 ; it seems to read values from table at ucode_ptr_c0 with some complicated ; indirection (value from table = index to use for next read from table?) and -@@ -1802,16 +1848,20 @@ +@@ -1805,16 +1851,20 @@ bpl loc_14c9 ; 14a0 -> 14a3 -> 14a5,14c9 r n=0..1 iny ; 14a3 -> 14a5 -> 14a6 r bne ucode_test_fire_all_objects_active ; 14a5 -> 14a6 -> 149b r z=0 @@ -127,7 +267,7 @@ ; opcode is followed by null-terminated list of objects to test ; note: some of these opcodes never executed in the trace ; references to object1080_y1 + 0x60 should be object1080_state - 0x10 -@@ -1845,17 +1895,21 @@ +@@ -1848,17 +1898,21 @@ bmi loc_14c9 ; 14d5 -> 14d8 -> 14da r n=0 iny ; 14d8 -> 14da -> 14db r bne ucode_test_fire_any_object_active ; 14da -> 14db -> 14d0 r z=0 @@ -150,7 +290,7 @@ test_object_fire_in_state_f0: lda object6080_fire_count - 0x60,x ; 1668 -> 14ef -> 14f2 r x=60..7f beq test_object_fire_false ; 14ef -> 14f2 -> 14f4,153f r z=0..1 -@@ -2219,10 +2273,35 @@ +@@ -2222,10 +2276,35 @@ sta *button_state ; 17ce r rts_17d0: rts ; 17ab,17ca -> 17d0 -> 1768,176f r s=fd @@ -187,7 +327,7 @@ ldx #0x01 ; 17db r 0$: jsr ROM_PREAD ; 17dd r cpy #0xff ; 17e0 r -@@ -2233,7 +2312,12 @@ +@@ -2236,7 +2315,12 @@ sta bvar_179e ; 17e9 r sta bvar_17a3 ; 17ec r sta bvar_1e0e ; 17ef r @@ -201,7 +341,7 @@ .area text1 -@@ -2301,10 +2385,12 @@ +@@ -2304,10 +2388,12 @@ lda *result + 1 ; 186e r ldy *result + 2 ; 1870 r rts ; 1872 r @@ -214,7 +354,7 @@ random_init: lda *random_seed ; 16ae -> 187a -> 187c r ora #0x01 ; 187a -> 187c -> 187e r -@@ -2463,16 +2549,30 @@ +@@ -2467,16 +2553,30 @@ ldx #>HIRES_SCREEN ; 199b -> 199d -> 199f r stx *video_line_ptr + 1 ; 199d -> 199f -> 19a1 r tay ; 199f -> 19a1 -> 19a2 r @@ -246,7 +386,7 @@ rts ; 19b5 -> 19b8 -> 1713 r s=fd video_clear_rectangle: ldx *clip_y0 ; 1064 -> 19b9 -> 19bb r -@@ -2480,8 +2580,20 @@ +@@ -2484,8 +2584,20 @@ sta *video_line_ptr ; 19bb -> 19be -> 19c0 r lda video_line_table_hi - 0x20,x ; 19be -> 19c0 -> 19c3 r x=28..cf sta *video_line_ptr + 1 ; 19c0 -> 19c3 -> 19c5 r @@ -267,7 +407,7 @@ 1$: sta (*video_line_ptr),y ; 19c7,19ce -> 19c9 -> 19cb r y=6c..93 iny ; 19c9 -> 19cb -> 19cc r cpy *clip_x1 ; 19cb -> 19cc -> 19ce r y=6d..94 -@@ -2530,6 +2642,7 @@ +@@ -2534,6 +2646,7 @@ sta object1080_y0 - 0x10,x ; 1a1b -> 1a1e -> 1a21 r x=10..7f adc #0x01 ; 1a1e -> 1a21 -> 1a23 r c=0..1 d=0 sta object1080_y1 - 0x10,x ; 1a21 -> 1a23 -> 1a26 r x=10..7f @@ -275,7 +415,7 @@ rts ; 1a23 -> 1a26 -> 1076,1179,1602 r s=f1..f9,02 pixel_data_table_left: .db 0x83 ; 1a27 r -@@ -2612,14 +2725,17 @@ +@@ -2616,14 +2729,17 @@ lda object1080_onscreen_shape_ptr_hi - 0x10,x ; 1aa5 -> 1aa7 -> 1aaa r x=20..4f ora (*video_line_ptr),y ; 1aa7 -> 1aaa -> 1aac r y=6d..93,02 sta (*video_line_ptr),y ; 1aaa -> 1aac -> 1aae r y=6d..93,02 @@ -293,7 +433,7 @@ lda object1080_y0 - 0x10,x ; 1ab9 -> 1abb -> 1abe r x=14..77 cmp object1080_y1 - 0x10,x ; 1abb -> 1abe -> 1ac1 r a=11..d4 x=14..77 bcs rts_1aae ; 1abe -> 1ac1 -> 1ac3 r c=0 -@@ -2672,7 +2788,12 @@ +@@ -2676,7 +2792,12 @@ stx *x_save ; 1b32 -> 1b35 -> 1b37 r lda *draw_y ; 1b35 -> 1b37 -> 1b39 r cmp *clip_y0 ; 1b37 -> 1b39 -> 1b3b r a=11..d4 @@ -306,7 +446,7 @@ lda *clip_y1 ; 1b3b -> 1b3d -> 1b3f r cmp *draw_y1 ; 1b3d -> 1b3f -> 1b41 r a=d0 bcc 8$ ; 1b3f -> 1b41 -> 1b43,1b83 r c=0..1 -@@ -2683,16 +2804,59 @@ +@@ -2687,16 +2808,59 @@ cmp *draw_x1 ; 1b49 -> 1b4b -> 1b4d r a=94 bcc 8$ ; 1b4b -> 1b4d -> 1b4f,1b83 r c=0..1 lda object1080_onscreen_shape_ptr_lo - 0x10,x ; 1b4d -> 1b4f -> 1b52 r x=14..77 @@ -366,7 +506,7 @@ 6$: .db 0xbd ; 1b69,1b76 -> 1b6b -> 1b6e r "lda bvar_6f9f,x" x=00..39 7$: .dw 0x6f9f ; 1b6c rw ora (*video_line_ptr),y ; 1b6b -> 1b6e -> 1b70 r y=6c..93 -@@ -2709,16 +2873,50 @@ +@@ -2713,16 +2877,50 @@ rts ; 1b80 -> 1b82 -> 15cd r s=fb 8$: inc object1080_onscreen_clipped - 0x10,x ; 1b3b,1b41,1b47,1b4d -> 1b83 -> 1b86 r x=14..77 lda object1080_onscreen_shape_ptr_lo - 0x10,x ; 1b83 -> 1b86 -> 1b89 r x=14..77 @@ -419,7 +559,7 @@ 10$: lda *draw_y ; 1ba0,1bbf -> 1ba2 -> 1ba4 r cmp *clip_y0 ; 1ba2 -> 1ba4 -> 1ba6 r a=11..d8 bcc 12$ ; 1ba4 -> 1ba6 -> 1ba8,1bbb r c=0..1 -@@ -2728,6 +2926,16 @@ +@@ -2732,6 +2930,16 @@ bcc 12$ ; 1bac -> 1bae -> 1bb0,1bbb r c=0..1 cpy *clip_x1 ; 1bae -> 1bb0 -> 1bb2 r y=6c..a4 bcs 12$ ; 1bb0 -> 1bb2 -> 1bb4,1bbb r c=0..1 @@ -436,7 +576,7 @@ .db 0xbd ; 1bb2 -> 1bb4 -> 1bb7 r "lda 0x6fab,x" x=00..39 11$: .dw 0x6fab ; 1bb5 rw ora (*video_line_ptr),y ; 1bb4 -> 1bb7 -> 1bb9 r y=6c..93 -@@ -2741,6 +2949,7 @@ +@@ -2745,6 +2953,7 @@ cpy *draw_y1 ; 1bc3 -> 1bc5 -> 1bc7 r y=12..d9 bcc 9$ ; 1bc5 -> 1bc7 -> 1b96,1bc9 r c=0..1 ldx *x_save ; 1bc7 -> 1bc9 -> 1bcb r @@ -444,7 +584,7 @@ rts ; 1bc9 -> 1bcb -> 15cd r s=fb erase_pixel_object: lda #0x00 ; 1c12 -> 1bcc -> 1bce r -@@ -2772,12 +2981,15 @@ +@@ -2776,12 +2985,15 @@ eor #0xff ; 1c03 -> 1c06 -> 1c08 r and (*video_line_ptr),y ; 1c06 -> 1c08 -> 1c0a r y=6d..93,02 sta (*video_line_ptr),y ; 1c08 -> 1c0a -> 1c0c r y=6d..93,02 @@ -460,7 +600,7 @@ lda #0x00 ; 1c12 -> 1c14 -> 1c16 r sta object1080_onscreen - 0x10,x ; 1c14 -> 1c16 -> 1c19 r x=14..77 lda object1080_onscreen_x0 - 0x10,x ; 1c16 -> 1c19 -> 1c1c r x=14..77 -@@ -2792,16 +3004,61 @@ +@@ -2796,16 +3008,61 @@ stx *x_save ; 1c2d -> 1c30 -> 1c32 r bne 3$ ; 1c30 -> 1c32 -> 1c34,1c6a r z=0..1 lda object1080_onscreen_shape_ptr_lo - 0x10,x ; 1c32 -> 1c34 -> 1c37 r x=14..77 @@ -522,7 +662,7 @@ 1$: .db 0xbd ; 1c4e,1c5d -> 1c50 -> 1c53 r "lda 0x6f93,x" x=00..39 2$: .dw 0x6f93 ; 1c51 rw eor #0xff ; 1c50 -> 1c53 -> 1c55 r -@@ -2818,16 +3075,51 @@ +@@ -2822,16 +3079,51 @@ ldx *x_save ; 1c65 -> 1c67 -> 1c69 r rts ; 1c67 -> 1c69 -> 1076,16a8 r s=f3..f9,02 3$: lda object1080_onscreen_shape_ptr_lo - 0x10,x ; 1c32 -> 1c6a -> 1c6d r x=14..77 @@ -576,7 +716,7 @@ 5$: lda *draw_y ; 1c84,1ca5 -> 1c86 -> 1c88 r cmp *clip_y0 ; 1c86 -> 1c88 -> 1c8a r a=11..d8 bcc 7$ ; 1c88 -> 1c8a -> 1c8c,1ca1 r c=0..1 -@@ -2837,6 +3129,17 @@ +@@ -2841,6 +3133,17 @@ bcc 7$ ; 1c90 -> 1c92 -> 1c94,1ca1 r c=0..1 cpy *clip_x1 ; 1c92 -> 1c94 -> 1c96 r y=6c..a4 bcs 7$ ; 1c94 -> 1c96 -> 1c98,1ca1 r c=0..1 @@ -594,7 +734,7 @@ .db 0xbd ; 1c96 -> 1c98 -> 1c9b r "lda 0x6fab,x" x=00..39 6$: .dw 0x6fab ; 1c99 rw eor #0xff ; 1c98 -> 1c9b -> 1c9d r -@@ -2856,9 +3159,24 @@ +@@ -2860,9 +3163,24 @@ stx *x_save ; 1db0 -> 1cb2 -> 1cb4 r tay ; 1cb2 -> 1cb4 -> 1cb5 r lda shape_data_ptr_lo,y ; 1cb4 -> 1cb5 -> 1cb8 r y=16..ff @@ -619,7 +759,7 @@ lda shape_width_bytes,y ; 1cbe -> 1cc1 -> 1cc4 r y=16..ff clc ; 1cc1 -> 1cc4 -> 1cc5 r adc *draw_x0 ; 1cc4 -> 1cc5 -> 1cc7 r c=0 d=0 -@@ -2866,6 +3184,11 @@ +@@ -2870,6 +3188,11 @@ lda *draw_x0 ; 1cc7 -> 1cc9 -> 1ccb r lsr a ; 1cc9 -> 1ccb -> 1ccc r bcc 0$ ; 1ccb -> 1ccc -> 1cce,1cd4 r c=0..1 @@ -631,7 +771,7 @@ lda *draw_misc_mask ; 1ccc -> 1cce -> 1cd0 r eor *draw_misc_mask_xor ; 1cce -> 1cd0 -> 1cd2 r sta *draw_misc_mask ; 1cd0 -> 1cd2 -> 1cd4 r -@@ -2881,9 +3204,56 @@ +@@ -2885,9 +3208,56 @@ lda video_line_table_hi,y ; 1ce5 -> 1ce7 -> 1cea r y=00..bc adc #0x00 ; 1ce7 -> 1cea -> 1cec r c=0..1 d=0 sta *video_line_ptr + 1 ; 1cea -> 1cec -> 1cee r @@ -688,7 +828,7 @@ 2$: lda *draw_y ; 1cf2,1d0f -> 1cf4 -> 1cf6 r cmp #0xc0 ; 1cf4 -> 1cf6 -> 1cf8 r a=00..bc bcs 4$ ; 1cf6 -> 1cf8 -> 1cfa r c=0 -@@ -2903,7 +3273,12 @@ +@@ -2907,7 +3277,12 @@ inc *draw_y ; 1d0f -> 1d11 -> 1d13 r ldy *draw_y ; 1d11 -> 1d13 -> 1d15 r cpy *draw_y1 ; 1d13 -> 1d15 -> 1d17 r y=01..bd @@ -701,7 +841,7 @@ ldx *x_save ; 1d17 -> 1d19 -> 1d1b r rts ; 1d19 -> 1d1b -> 1db3 r s=ec..f5 draw_misc_from_table: -@@ -2916,7 +3291,7 @@ +@@ -2920,7 +3295,7 @@ asl a ; 1d23 -> 1d24 -> 1d25 r sta *draw_misc_ptr ; 1d24 -> 1d25 -> 1d27 r lda #0x00 ; 1d25 -> 1d27 -> 1d29 r @@ -710,7 +850,7 @@ sta *draw_misc_ptr + 1 ; 1d29 -> 1d2b -> 1d2d r lda *half_dimension ; 1d2b -> 1d2d -> 1d2f r lsr a ; 1d2d -> 1d2f -> 1d30 r -@@ -2925,10 +3300,20 @@ +@@ -2929,10 +3304,20 @@ lsr a ; 1d31 -> 1d32 -> 1d33 r lsr a ; 1d32 -> 1d33 -> 1d34 r tay ; 1d33 -> 1d34 -> 1d35 r @@ -731,7 +871,7 @@ lda *half_dimension ; 1d3d -> 1d3f -> 1d41 r and #0x1f ; 1d3f -> 1d41 -> 1d43 r cmp #0x08 ; 1d41 -> 1d43 -> 1d45 r a=00..1f -@@ -2946,6 +3331,14 @@ +@@ -2950,6 +3335,14 @@ iny ; 1d57 -> 1d59 -> 1d5a r 1$: lda (*draw_misc_ptr),y ; 1d59,1d69 -> 1d5a -> 1d5c r y=03..0c beq 2$ ; 1d5a -> 1d5c -> 1d5e,1d61 r z=0..1 @@ -746,7 +886,7 @@ jsr do_draw_misc ; 1d5c -> 1d5e -> 1da6 r s=f3..f9,02 2$: iny ; 1d5c,1db5 -> 1d61 -> 1d62 r cpy #0x10 ; 1d61 -> 1d62 -> 1d64 r y=04..0d -@@ -3001,6 +3394,84 @@ +@@ -3005,6 +3398,84 @@ ldy *draw_misc_y_save ; 1d1b -> 1db3 -> 1db5 r rts_1db5: rts ; 1da1,1db3 -> 1db5 -> 1076,1d61,1d7d,1d82,1d87 r s=ee..f7 @@ -831,7 +971,7 @@ draw_misc_mask_table: .db 0xff ; 1db6 r .db 0x00 ; 1db7 r -@@ -3011,14 +3482,15 @@ +@@ -3015,14 +3486,15 @@ .db 0xd5 ; 1dbc r .db 0xff ; 1dbd r draw_misc_mask_xor_table: @@ -855,7 +995,7 @@ .area text2 -@@ -3323,6 +3795,15 @@ +@@ -3334,6 +3806,15 @@ .area data2 @@ -871,7 +1011,7 @@ shape_data_ptr_lo: .db