diff --git a/preprocessor/Map Preprocessor/AppDelegate.mm b/preprocessor/Map Preprocessor/AppDelegate.mm index 9453f85..f786d0a 100644 --- a/preprocessor/Map Preprocessor/AppDelegate.mm +++ b/preprocessor/Map Preprocessor/AppDelegate.mm @@ -262,17 +262,20 @@ - (void)dissect:(NSImage *)image destination:(NSString *)directory { - (NSString *)tileDeclarationPairLeft:(NSString *)left right:(NSString *)right count:(size_t)count page:(int)page { NSMutableString *code = [[NSMutableString alloc] init]; - for(NSString *name in @[left, right]) { - if(!name.length) continue; - + for(NSString *name in @[right, left]) { [code appendFormat:@"\tds align 256\n"]; - [code appendFormat:@"\ttiles_%@_page: EQU %d + 0b00100000\n", name, page]; - [code appendFormat:@"\ttiles_%@:\n", name]; + NSString *set_name = name; + if(name.length) { + [code appendFormat:@"\ttiles_%@_page: EQU %d + 0b00100000\n", name, page]; + [code appendFormat:@"\ttiles_%@:\n", name]; + } else { + set_name = right; + } for(size_t c = 0; c < count; c++) { if(c) { [code appendString:@"\t\tnop\n"]; } - [code appendFormat:@"\t\tjp @+%@_%d\n", name, int(c)]; + [code appendFormat:@"\t\tjp @+%@_%d\n", set_name, int(c)]; } [code appendString:@"\n\n"]; } @@ -458,7 +461,7 @@ - (void)compileTiles:(std::vector> &)tiles directory:(N [code appendString:@"\t;\n\n"]; [code appendString:@"\tORG 0\n\tDUMP 16, 0\n"]; - [code appendString:[self tileDeclarationPairLeft:@"full" right:@"" count:tiles.size() page:16]]; + [code appendString:[self tileDeclarationPairLeft:@"" right:@"full" count:tiles.size() page:16]]; [code appendString:[self tiles:@"full" slice:0 source:tiles page:16]]; [code appendString:@"\tORG 0\n\tDUMP 17, 0\n"]; @@ -650,10 +653,10 @@ - (void)writeColumnFunctions:(NSString *)directory { [code appendString:@"\t; four bit code implied by its function number.\n"]; [code appendString:@"\t;\n"]; [code appendString:@"\t; i.e."]; - [code appendString:@"\t; * draw_sliver0 draws zero tiles because all dirty bits are clear;\n"]; - [code appendString:@"\t; * draw_sliver1 draws the first tile in its collection of four, but no others;\n"]; - [code appendString:@"\t; * draw_sliver9 draws the first and fourth tiles; and\n"]; - [code appendString:@"\t; * draw_sliver15 draws all four tiles.\n"]; + [code appendString:@"\t; * draw_left_sliver0 draws zero tiles because all dirty bits are clear;\n"]; + [code appendString:@"\t; * draw_left_sliver1 draws the first tile in its collection of four, but no others;\n"]; + [code appendString:@"\t; * draw_left_sliver9 draws the first and fourth tiles; and\n"]; + [code appendString:@"\t; * draw_left_sliver15 draws all four tiles.\n"]; [code appendString:@"\t; In all cases the first tile is the one lowest down the screen."]; [code appendString:@"\t;\n"]; [code appendString:@"\t; At exit:\n"]; @@ -664,73 +667,67 @@ - (void)writeColumnFunctions:(NSString *)directory { [code appendString:@"\t;\n\n"]; [code appendString:@"\tds align 256\n"]; - [code appendString:@"\tslivers:\n"]; + [code appendString:@"\tleft_slivers:\n"]; for(int c = 0; c < 16; c++) { if(c) [code appendString:@"\t\tnop\n"]; - - // Three was the current threshold for using a JR rather than a JP, empirically. - // Might be improveable if sliver code gets slimmer. - if(c < 3) { - [code appendFormat:@"\t\tjr @+draw_sliver%d\n", c]; - [code appendString:@"\t\tnop\n"]; - - } else { - [code appendFormat:@"\t\tjp @+draw_sliver%d\n", c]; - } + [code appendFormat:@"\t\tjp @+draw_left_sliver%d\n", c]; } [code appendString:@"\n"]; - + [code appendString:@"\tds align 256\n"]; + [code appendString:@"\tright_slivers:\n"]; for(int c = 0; c < 16; c++) { - // On input: IX points one beyond the next tile ID. - // A contains the top byte of the tile dispatch table. - // DE acts as the link register. - - [code appendFormat:@"\t@draw_sliver%d:\n", c]; - [code appendString:@"\t\tld (@+return + 1), de\n"]; + if(c) [code appendString:@"\t\tnop\n"]; + [code appendFormat:@"\t\tjp @+draw_right_sliver%d\n", c]; + } + [code appendString:@"\n"]; - // Store dispatch address. - for(int p = 0; p < __builtin_popcount(c); p++) { - [code appendFormat:@"\t\tld (@+jpslot%d + 2), a\n", p]; - } - [code appendString:@"\n"]; - - int mask = 1; - int offset = 0; - auto append_offset = [&] { - if(offset) { - [code appendFormat:@"\t\tld bc, -%d\n", offset]; - [code appendString:@"\t\tadd hl, bc\n"]; - } - offset = 0; - }; + for(NSString *side in @[@"left", @"right"]) { + for(int c = 0; c < 16; c++) { + // On input: IX points one beyond the next tile ID. + // A contains the top byte of the tile dispatch table. + // DE acts as the link register. + + [code appendFormat:@"\t@draw_%@_sliver%d:\n", side, c]; + [code appendString:@"\t\tld (@+return + 1), de\n"]; + + int mask = 1; + int offset = 0; + auto append_offset = [&] { + if(offset) { + [code appendFormat:@"\t\tld bc, -%d\n", offset]; + [code appendString:@"\t\tadd hl, bc\n"]; + } + offset = 0; + }; + + int load_slot = 0; + int ix_offset = 1; + while(mask < 16) { + if(c & mask) { + append_offset(); + offset = 128; + + const auto slot = load_slot++; + [code appendFormat:@"\t\tld a, (ix - %d)\n", ix_offset]; + [code appendFormat:@"\t\tld (@+jpslot%d + 1), a\n", slot]; + [code appendString:@"\t\tld de, @+end_dispatch\n"]; + [code appendFormat:@"\t@jpslot%d:\n", slot]; + [code appendFormat:@"\t\tjp tiles_%@_7\n", side]; + [code appendString:@"\t@end_dispatch:\n"]; + [code appendString:@"\n"]; + } else { + offset += 16*128; + } - int load_slot = 0; - int ix_offset = 1; - while(mask < 16) { - if(c & mask) { - append_offset(); - offset = 128; - - const auto slot = load_slot++; - [code appendFormat:@"\t\tld a, (ix - %d)\n", ix_offset]; - [code appendFormat:@"\t\tld (@+jpslot%d + 1), a\n", slot]; - [code appendString:@"\t\tld de, @+end_dispatch\n"]; - [code appendFormat:@"\t@jpslot%d:\n", slot]; - [code appendString:@"\t\tjp 1234\n"]; - [code appendString:@"\t@end_dispatch:\n"]; - [code appendString:@"\n"]; - } else { - offset += 16*128; + mask <<= 1; + ++ix_offset; } - - mask <<= 1; - ++ix_offset; + append_offset(); + [code appendString:@"\t\tld bc, -4\n"]; + [code appendString:@"\t\tadd ix, bc\n"]; + [code appendString:@"\t@return:\n"]; + [code appendString:@"\t\tjp 1234\n\n"]; } - append_offset(); - [code appendString:@"\t\tld bc, -4\n"]; - [code appendString:@"\t\tadd ix, bc\n"]; - [code appendString:@"\t@return:\n"]; - [code appendString:@"\t\tjp 1234\n\n"]; } [code writeToFile:[directory stringByAppendingPathComponent:@"slivers.z80s"] atomically:NO encoding:NSUTF8StringEncoding error:nil]; diff --git a/src/buffer_setup.z80s b/src/buffer_setup.z80s index 68de200..ea9eb22 100644 --- a/src/buffer_setup.z80s +++ b/src/buffer_setup.z80s @@ -76,7 +76,7 @@ NEXT @address_loop ld (column_address{column_count-1} + 1), a ; Second page onwards: use appropriate left and right - ; tables for first and last column; if this is an + ; pages for first and last column; if this is an ; odd page (i.e. one in which the clipped tiles are ; an odd number of bytes wide), also decrease the initial ; and final column start address by 1 as per the different @@ -88,17 +88,9 @@ NEXT @address_loop ld a, tiles_left_{@page_loop+1}_page ld (tile_page0+1), a - ld a, tiles_left_{@page_loop+1} >> 8 - ld (tile_address0_0+1), a - ld (tile_address0_1+1), a - ld (tile_address0_2+1), a ld a, tiles_right_{7-@page_loop}_page ld (tile_page{column_count-1}+1), a - ld a, tiles_right_{7-@page_loop} >> 8 - ld (tile_address{column_count-1}_0+1), a - ld (tile_address{column_count-1}_1+1), a - ld (tile_address{column_count-1}_2+1), a IF (@page_loop & 1) == 0 ld hl, (column_address0+1) diff --git a/src/generated/slivers.z80s b/src/generated/slivers.z80s index 6234d52..e1c3a80 100644 --- a/src/generated/slivers.z80s +++ b/src/generated/slivers.z80s @@ -1,43 +1,89 @@ + ; The following routines are automatically generated. Each one performs the + ; action of drawing only the subset of tiles marked as dirty according to the + ; four bit code implied by its function number. + ; + ; i.e. ; * draw_left_sliver0 draws zero tiles because all dirty bits are clear; + ; * draw_left_sliver1 draws the first tile in its collection of four, but no others; + ; * draw_left_sliver9 draws the first and fourth tiles; and + ; * draw_left_sliver15 draws all four tiles. + ; In all cases the first tile is the one lowest down the screen. ; + ; At exit: + ; * IX has been decremented by four; and + ; * HL points to the start address for the first tile above this group, if any. + ; + ; An initial sequence of JP statements provides for fast dispatch into the appropriate sliver. + ; + ds align 256 - slivers: - jr @+draw_sliver0 + left_slivers: + jp @+draw_left_sliver0 + nop + jp @+draw_left_sliver1 + nop + jp @+draw_left_sliver2 + nop + jp @+draw_left_sliver3 + nop + jp @+draw_left_sliver4 + nop + jp @+draw_left_sliver5 + nop + jp @+draw_left_sliver6 + nop + jp @+draw_left_sliver7 + nop + jp @+draw_left_sliver8 + nop + jp @+draw_left_sliver9 + nop + jp @+draw_left_sliver10 + nop + jp @+draw_left_sliver11 + nop + jp @+draw_left_sliver12 nop + jp @+draw_left_sliver13 nop - jr @+draw_sliver1 + jp @+draw_left_sliver14 nop + jp @+draw_left_sliver15 + + ds align 256 + right_slivers: + jp @+draw_right_sliver0 nop - jr @+draw_sliver2 + jp @+draw_right_sliver1 nop + jp @+draw_right_sliver2 nop - jp @+draw_sliver3 + jp @+draw_right_sliver3 nop - jp @+draw_sliver4 + jp @+draw_right_sliver4 nop - jp @+draw_sliver5 + jp @+draw_right_sliver5 nop - jp @+draw_sliver6 + jp @+draw_right_sliver6 nop - jp @+draw_sliver7 + jp @+draw_right_sliver7 nop - jp @+draw_sliver8 + jp @+draw_right_sliver8 nop - jp @+draw_sliver9 + jp @+draw_right_sliver9 nop - jp @+draw_sliver10 + jp @+draw_right_sliver10 nop - jp @+draw_sliver11 + jp @+draw_right_sliver11 nop - jp @+draw_sliver12 + jp @+draw_right_sliver12 nop - jp @+draw_sliver13 + jp @+draw_right_sliver13 nop - jp @+draw_sliver14 + jp @+draw_right_sliver14 nop - jp @+draw_sliver15 + jp @+draw_right_sliver15 - @draw_sliver0: + @draw_left_sliver0: ld (@+return + 1), de - ld bc, -8192 add hl, bc ld bc, -4 @@ -45,15 +91,13 @@ @return: jp 1234 - @draw_sliver1: + @draw_left_sliver1: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld a, (ix - 1) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -6272 @@ -63,17 +107,15 @@ @return: jp 1234 - @draw_sliver2: + @draw_left_sliver2: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld bc, -2048 add hl, bc ld a, (ix - 2) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -4224 @@ -83,16 +125,13 @@ @return: jp 1234 - @draw_sliver3: + @draw_left_sliver3: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld a, (ix - 1) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -101,7 +140,7 @@ ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -4224 @@ -111,17 +150,15 @@ @return: jp 1234 - @draw_sliver4: + @draw_left_sliver4: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld bc, -4096 add hl, bc ld a, (ix - 3) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -2176 @@ -131,16 +168,13 @@ @return: jp 1234 - @draw_sliver5: + @draw_left_sliver5: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld a, (ix - 1) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -2176 @@ -149,7 +183,7 @@ ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -2176 @@ -159,18 +193,15 @@ @return: jp 1234 - @draw_sliver6: + @draw_left_sliver6: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld bc, -2048 add hl, bc ld a, (ix - 2) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -179,7 +210,7 @@ ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -2176 @@ -189,17 +220,13 @@ @return: jp 1234 - @draw_sliver7: + @draw_left_sliver7: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld (@+jpslot2 + 2), a - ld a, (ix - 1) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -208,7 +235,7 @@ ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -217,7 +244,7 @@ ld (@+jpslot2 + 1), a ld de, @+end_dispatch @jpslot2: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -2176 @@ -227,17 +254,15 @@ @return: jp 1234 - @draw_sliver8: + @draw_left_sliver8: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld bc, -6144 add hl, bc ld a, (ix - 4) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -247,16 +272,13 @@ @return: jp 1234 - @draw_sliver9: + @draw_left_sliver9: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld a, (ix - 1) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -4224 @@ -265,7 +287,7 @@ ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -275,18 +297,15 @@ @return: jp 1234 - @draw_sliver10: + @draw_left_sliver10: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld bc, -2048 add hl, bc ld a, (ix - 2) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -2176 @@ -295,7 +314,7 @@ ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -305,17 +324,13 @@ @return: jp 1234 - @draw_sliver11: + @draw_left_sliver11: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld (@+jpslot2 + 2), a - ld a, (ix - 1) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -324,7 +339,7 @@ ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -2176 @@ -333,7 +348,7 @@ ld (@+jpslot2 + 1), a ld de, @+end_dispatch @jpslot2: - jp 1234 + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -343,27 +358,137 @@ @return: jp 1234 - @draw_sliver12: + @draw_left_sliver12: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld bc, -4096 add hl, bc ld a, (ix - 3) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 4) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld bc, -4 + add ix, bc + @return: jp 1234 + + @draw_left_sliver13: + ld (@+return + 1), de + ld a, (ix - 1) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_left_7 + @end_dispatch: + + ld bc, -2176 + add hl, bc + ld a, (ix - 3) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_left_7 @end_dispatch: ld bc, -128 add hl, bc ld a, (ix - 4) + ld (@+jpslot2 + 1), a + ld de, @+end_dispatch + @jpslot2: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + + @draw_left_sliver14: + ld (@+return + 1), de + ld bc, -2048 + add hl, bc + ld a, (ix - 2) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 3) ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 4) + ld (@+jpslot2 + 1), a + ld de, @+end_dispatch + @jpslot2: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld bc, -4 + add ix, bc + @return: jp 1234 + + @draw_left_sliver15: + ld (@+return + 1), de + ld a, (ix - 1) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 2) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 3) + ld (@+jpslot2 + 1), a + ld de, @+end_dispatch + @jpslot2: + jp tiles_left_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 4) + ld (@+jpslot3 + 1), a + ld de, @+end_dispatch + @jpslot3: + jp tiles_left_7 @end_dispatch: ld bc, -128 @@ -373,35 +498,187 @@ @return: jp 1234 - @draw_sliver13: + @draw_right_sliver0: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld (@+jpslot2 + 2), a + ld bc, -8192 + add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + @draw_right_sliver1: + ld (@+return + 1), de ld a, (ix - 1) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -6272 + add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + + @draw_right_sliver2: + ld (@+return + 1), de + ld bc, -2048 + add hl, bc + ld a, (ix - 2) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -4224 + add hl, bc + ld bc, -4 + add ix, bc + @return: jp 1234 + + @draw_right_sliver3: + ld (@+return + 1), de + ld a, (ix - 1) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 2) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -4224 + add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + + @draw_right_sliver4: + ld (@+return + 1), de + ld bc, -4096 + add hl, bc + ld a, (ix - 3) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 @end_dispatch: ld bc, -2176 add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + + @draw_right_sliver5: + ld (@+return + 1), de + ld a, (ix - 1) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -2176 + add hl, bc + ld a, (ix - 3) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -2176 + add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + + @draw_right_sliver6: + ld (@+return + 1), de + ld bc, -2048 + add hl, bc + ld a, (ix - 2) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc ld a, (ix - 3) ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -2176 + add hl, bc + ld bc, -4 + add ix, bc + @return: jp 1234 + + @draw_right_sliver7: + ld (@+return + 1), de + ld a, (ix - 1) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 @end_dispatch: ld bc, -128 add hl, bc - ld a, (ix - 4) + ld a, (ix - 2) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 3) ld (@+jpslot2 + 1), a ld de, @+end_dispatch @jpslot2: + jp tiles_right_7 + @end_dispatch: + + ld bc, -2176 + add hl, bc + ld bc, -4 + add ix, bc + @return: jp 1234 + + @draw_right_sliver8: + ld (@+return + 1), de + ld bc, -6144 + add hl, bc + ld a, (ix - 4) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 @end_dispatch: ld bc, -128 @@ -411,28 +688,135 @@ @return: jp 1234 - @draw_sliver14: + @draw_right_sliver9: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld (@+jpslot2 + 2), a + ld a, (ix - 1) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + ld bc, -4224 + add hl, bc + ld a, (ix - 4) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + + @draw_right_sliver10: + ld (@+return + 1), de ld bc, -2048 add hl, bc ld a, (ix - 2) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -2176 + add hl, bc + ld a, (ix - 4) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld bc, -4 + add ix, bc + @return: jp 1234 + + @draw_right_sliver11: + ld (@+return + 1), de + ld a, (ix - 1) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 2) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -2176 + add hl, bc + ld a, (ix - 4) + ld (@+jpslot2 + 1), a + ld de, @+end_dispatch + @jpslot2: + jp tiles_right_7 @end_dispatch: ld bc, -128 add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + + @draw_right_sliver12: + ld (@+return + 1), de + ld bc, -4096 + add hl, bc ld a, (ix - 3) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 4) ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld bc, -4 + add ix, bc + @return: jp 1234 + + @draw_right_sliver13: + ld (@+return + 1), de + ld a, (ix - 1) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + + ld bc, -2176 + add hl, bc + ld a, (ix - 3) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_right_7 @end_dispatch: ld bc, -128 @@ -441,7 +825,7 @@ ld (@+jpslot2 + 1), a ld de, @+end_dispatch @jpslot2: - jp 1234 + jp tiles_right_7 @end_dispatch: ld bc, -128 @@ -451,18 +835,49 @@ @return: jp 1234 - @draw_sliver15: + @draw_right_sliver14: ld (@+return + 1), de - ld (@+jpslot0 + 2), a - ld (@+jpslot1 + 2), a - ld (@+jpslot2 + 2), a - ld (@+jpslot3 + 2), a + ld bc, -2048 + add hl, bc + ld a, (ix - 2) + ld (@+jpslot0 + 1), a + ld de, @+end_dispatch + @jpslot0: + jp tiles_right_7 + @end_dispatch: + ld bc, -128 + add hl, bc + ld a, (ix - 3) + ld (@+jpslot1 + 1), a + ld de, @+end_dispatch + @jpslot1: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld a, (ix - 4) + ld (@+jpslot2 + 1), a + ld de, @+end_dispatch + @jpslot2: + jp tiles_right_7 + @end_dispatch: + + ld bc, -128 + add hl, bc + ld bc, -4 + add ix, bc + @return: + jp 1234 + + @draw_right_sliver15: + ld (@+return + 1), de ld a, (ix - 1) ld (@+jpslot0 + 1), a ld de, @+end_dispatch @jpslot0: - jp 1234 + jp tiles_right_7 @end_dispatch: ld bc, -128 @@ -471,7 +886,7 @@ ld (@+jpslot1 + 1), a ld de, @+end_dispatch @jpslot1: - jp 1234 + jp tiles_right_7 @end_dispatch: ld bc, -128 @@ -480,7 +895,7 @@ ld (@+jpslot2 + 1), a ld de, @+end_dispatch @jpslot2: - jp 1234 + jp tiles_right_7 @end_dispatch: ld bc, -128 @@ -489,7 +904,7 @@ ld (@+jpslot3 + 1), a ld de, @+end_dispatch @jpslot3: - jp 1234 + jp tiles_right_7 @end_dispatch: ld bc, -128 diff --git a/src/generated/tiles.z80s b/src/generated/tiles.z80s index 11d9574..9477683 100644 --- a/src/generated/tiles.z80s +++ b/src/generated/tiles.z80s @@ -88,6 +88,70 @@ jp @+full_30 + ds align 256 + jp @+full_0 + nop + jp @+full_1 + nop + jp @+full_2 + nop + jp @+full_3 + nop + jp @+full_4 + nop + jp @+full_5 + nop + jp @+full_6 + nop + jp @+full_7 + nop + jp @+full_8 + nop + jp @+full_9 + nop + jp @+full_10 + nop + jp @+full_11 + nop + jp @+full_12 + nop + jp @+full_13 + nop + jp @+full_14 + nop + jp @+full_15 + nop + jp @+full_16 + nop + jp @+full_17 + nop + jp @+full_18 + nop + jp @+full_19 + nop + jp @+full_20 + nop + jp @+full_21 + nop + jp @+full_22 + nop + jp @+full_23 + nop + jp @+full_24 + nop + jp @+full_25 + nop + jp @+full_26 + nop + jp @+full_27 + nop + jp @+full_28 + nop + jp @+full_29 + nop + jp @+full_30 + + @full_8: ld (@+return+1), de ld sp, hl @@ -4188,72 +4252,6 @@ ORG 0 DUMP 17, 0 - ds align 256 - tiles_left_7_page: EQU 17 + 0b00100000 - tiles_left_7: - jp @+left_7_0 - nop - jp @+left_7_1 - nop - jp @+left_7_2 - nop - jp @+left_7_3 - nop - jp @+left_7_4 - nop - jp @+left_7_5 - nop - jp @+left_7_6 - nop - jp @+left_7_7 - nop - jp @+left_7_8 - nop - jp @+left_7_9 - nop - jp @+left_7_10 - nop - jp @+left_7_11 - nop - jp @+left_7_12 - nop - jp @+left_7_13 - nop - jp @+left_7_14 - nop - jp @+left_7_15 - nop - jp @+left_7_16 - nop - jp @+left_7_17 - nop - jp @+left_7_18 - nop - jp @+left_7_19 - nop - jp @+left_7_20 - nop - jp @+left_7_21 - nop - jp @+left_7_22 - nop - jp @+left_7_23 - nop - jp @+left_7_24 - nop - jp @+left_7_25 - nop - jp @+left_7_26 - nop - jp @+left_7_27 - nop - jp @+left_7_28 - nop - jp @+left_7_29 - nop - jp @+left_7_30 - - ds align 256 tiles_right_1_page: EQU 17 + 0b00100000 tiles_right_1: @@ -4320,6 +4318,72 @@ jp @+right_1_30 + ds align 256 + tiles_left_7_page: EQU 17 + 0b00100000 + tiles_left_7: + jp @+left_7_0 + nop + jp @+left_7_1 + nop + jp @+left_7_2 + nop + jp @+left_7_3 + nop + jp @+left_7_4 + nop + jp @+left_7_5 + nop + jp @+left_7_6 + nop + jp @+left_7_7 + nop + jp @+left_7_8 + nop + jp @+left_7_9 + nop + jp @+left_7_10 + nop + jp @+left_7_11 + nop + jp @+left_7_12 + nop + jp @+left_7_13 + nop + jp @+left_7_14 + nop + jp @+left_7_15 + nop + jp @+left_7_16 + nop + jp @+left_7_17 + nop + jp @+left_7_18 + nop + jp @+left_7_19 + nop + jp @+left_7_20 + nop + jp @+left_7_21 + nop + jp @+left_7_22 + nop + jp @+left_7_23 + nop + jp @+left_7_24 + nop + jp @+left_7_25 + nop + jp @+left_7_26 + nop + jp @+left_7_27 + nop + jp @+left_7_28 + nop + jp @+left_7_29 + nop + jp @+left_7_30 + + @left_7_8: ld (@+return+1), de ld sp, hl @@ -10494,72 +10558,6 @@ ORG 0 DUMP 18, 0 - ds align 256 - tiles_left_6_page: EQU 18 + 0b00100000 - tiles_left_6: - jp @+left_6_0 - nop - jp @+left_6_1 - nop - jp @+left_6_2 - nop - jp @+left_6_3 - nop - jp @+left_6_4 - nop - jp @+left_6_5 - nop - jp @+left_6_6 - nop - jp @+left_6_7 - nop - jp @+left_6_8 - nop - jp @+left_6_9 - nop - jp @+left_6_10 - nop - jp @+left_6_11 - nop - jp @+left_6_12 - nop - jp @+left_6_13 - nop - jp @+left_6_14 - nop - jp @+left_6_15 - nop - jp @+left_6_16 - nop - jp @+left_6_17 - nop - jp @+left_6_18 - nop - jp @+left_6_19 - nop - jp @+left_6_20 - nop - jp @+left_6_21 - nop - jp @+left_6_22 - nop - jp @+left_6_23 - nop - jp @+left_6_24 - nop - jp @+left_6_25 - nop - jp @+left_6_26 - nop - jp @+left_6_27 - nop - jp @+left_6_28 - nop - jp @+left_6_29 - nop - jp @+left_6_30 - - ds align 256 tiles_right_2_page: EQU 18 + 0b00100000 tiles_right_2: @@ -10626,6 +10624,72 @@ jp @+right_2_30 + ds align 256 + tiles_left_6_page: EQU 18 + 0b00100000 + tiles_left_6: + jp @+left_6_0 + nop + jp @+left_6_1 + nop + jp @+left_6_2 + nop + jp @+left_6_3 + nop + jp @+left_6_4 + nop + jp @+left_6_5 + nop + jp @+left_6_6 + nop + jp @+left_6_7 + nop + jp @+left_6_8 + nop + jp @+left_6_9 + nop + jp @+left_6_10 + nop + jp @+left_6_11 + nop + jp @+left_6_12 + nop + jp @+left_6_13 + nop + jp @+left_6_14 + nop + jp @+left_6_15 + nop + jp @+left_6_16 + nop + jp @+left_6_17 + nop + jp @+left_6_18 + nop + jp @+left_6_19 + nop + jp @+left_6_20 + nop + jp @+left_6_21 + nop + jp @+left_6_22 + nop + jp @+left_6_23 + nop + jp @+left_6_24 + nop + jp @+left_6_25 + nop + jp @+left_6_26 + nop + jp @+left_6_27 + nop + jp @+left_6_28 + nop + jp @+left_6_29 + nop + jp @+left_6_30 + + @left_6_8: ld (@+return+1), de ld sp, hl @@ -16355,72 +16419,6 @@ ORG 0 DUMP 19, 0 - ds align 256 - tiles_left_5_page: EQU 19 + 0b00100000 - tiles_left_5: - jp @+left_5_0 - nop - jp @+left_5_1 - nop - jp @+left_5_2 - nop - jp @+left_5_3 - nop - jp @+left_5_4 - nop - jp @+left_5_5 - nop - jp @+left_5_6 - nop - jp @+left_5_7 - nop - jp @+left_5_8 - nop - jp @+left_5_9 - nop - jp @+left_5_10 - nop - jp @+left_5_11 - nop - jp @+left_5_12 - nop - jp @+left_5_13 - nop - jp @+left_5_14 - nop - jp @+left_5_15 - nop - jp @+left_5_16 - nop - jp @+left_5_17 - nop - jp @+left_5_18 - nop - jp @+left_5_19 - nop - jp @+left_5_20 - nop - jp @+left_5_21 - nop - jp @+left_5_22 - nop - jp @+left_5_23 - nop - jp @+left_5_24 - nop - jp @+left_5_25 - nop - jp @+left_5_26 - nop - jp @+left_5_27 - nop - jp @+left_5_28 - nop - jp @+left_5_29 - nop - jp @+left_5_30 - - ds align 256 tiles_right_3_page: EQU 19 + 0b00100000 tiles_right_3: @@ -16487,6 +16485,72 @@ jp @+right_3_30 + ds align 256 + tiles_left_5_page: EQU 19 + 0b00100000 + tiles_left_5: + jp @+left_5_0 + nop + jp @+left_5_1 + nop + jp @+left_5_2 + nop + jp @+left_5_3 + nop + jp @+left_5_4 + nop + jp @+left_5_5 + nop + jp @+left_5_6 + nop + jp @+left_5_7 + nop + jp @+left_5_8 + nop + jp @+left_5_9 + nop + jp @+left_5_10 + nop + jp @+left_5_11 + nop + jp @+left_5_12 + nop + jp @+left_5_13 + nop + jp @+left_5_14 + nop + jp @+left_5_15 + nop + jp @+left_5_16 + nop + jp @+left_5_17 + nop + jp @+left_5_18 + nop + jp @+left_5_19 + nop + jp @+left_5_20 + nop + jp @+left_5_21 + nop + jp @+left_5_22 + nop + jp @+left_5_23 + nop + jp @+left_5_24 + nop + jp @+left_5_25 + nop + jp @+left_5_26 + nop + jp @+left_5_27 + nop + jp @+left_5_28 + nop + jp @+left_5_29 + nop + jp @+left_5_30 + + @left_5_8: ld (@+return+1), de ld sp, hl @@ -22643,72 +22707,6 @@ ORG 0 DUMP 20, 0 - ds align 256 - tiles_left_4_page: EQU 20 + 0b00100000 - tiles_left_4: - jp @+left_4_0 - nop - jp @+left_4_1 - nop - jp @+left_4_2 - nop - jp @+left_4_3 - nop - jp @+left_4_4 - nop - jp @+left_4_5 - nop - jp @+left_4_6 - nop - jp @+left_4_7 - nop - jp @+left_4_8 - nop - jp @+left_4_9 - nop - jp @+left_4_10 - nop - jp @+left_4_11 - nop - jp @+left_4_12 - nop - jp @+left_4_13 - nop - jp @+left_4_14 - nop - jp @+left_4_15 - nop - jp @+left_4_16 - nop - jp @+left_4_17 - nop - jp @+left_4_18 - nop - jp @+left_4_19 - nop - jp @+left_4_20 - nop - jp @+left_4_21 - nop - jp @+left_4_22 - nop - jp @+left_4_23 - nop - jp @+left_4_24 - nop - jp @+left_4_25 - nop - jp @+left_4_26 - nop - jp @+left_4_27 - nop - jp @+left_4_28 - nop - jp @+left_4_29 - nop - jp @+left_4_30 - - ds align 256 tiles_right_4_page: EQU 20 + 0b00100000 tiles_right_4: @@ -22775,6 +22773,72 @@ jp @+right_4_30 + ds align 256 + tiles_left_4_page: EQU 20 + 0b00100000 + tiles_left_4: + jp @+left_4_0 + nop + jp @+left_4_1 + nop + jp @+left_4_2 + nop + jp @+left_4_3 + nop + jp @+left_4_4 + nop + jp @+left_4_5 + nop + jp @+left_4_6 + nop + jp @+left_4_7 + nop + jp @+left_4_8 + nop + jp @+left_4_9 + nop + jp @+left_4_10 + nop + jp @+left_4_11 + nop + jp @+left_4_12 + nop + jp @+left_4_13 + nop + jp @+left_4_14 + nop + jp @+left_4_15 + nop + jp @+left_4_16 + nop + jp @+left_4_17 + nop + jp @+left_4_18 + nop + jp @+left_4_19 + nop + jp @+left_4_20 + nop + jp @+left_4_21 + nop + jp @+left_4_22 + nop + jp @+left_4_23 + nop + jp @+left_4_24 + nop + jp @+left_4_25 + nop + jp @+left_4_26 + nop + jp @+left_4_27 + nop + jp @+left_4_28 + nop + jp @+left_4_29 + nop + jp @+left_4_30 + + @left_4_8: ld (@+return+1), de ld sp, hl @@ -28506,72 +28570,6 @@ ORG 0 DUMP 21, 0 - ds align 256 - tiles_left_3_page: EQU 21 + 0b00100000 - tiles_left_3: - jp @+left_3_0 - nop - jp @+left_3_1 - nop - jp @+left_3_2 - nop - jp @+left_3_3 - nop - jp @+left_3_4 - nop - jp @+left_3_5 - nop - jp @+left_3_6 - nop - jp @+left_3_7 - nop - jp @+left_3_8 - nop - jp @+left_3_9 - nop - jp @+left_3_10 - nop - jp @+left_3_11 - nop - jp @+left_3_12 - nop - jp @+left_3_13 - nop - jp @+left_3_14 - nop - jp @+left_3_15 - nop - jp @+left_3_16 - nop - jp @+left_3_17 - nop - jp @+left_3_18 - nop - jp @+left_3_19 - nop - jp @+left_3_20 - nop - jp @+left_3_21 - nop - jp @+left_3_22 - nop - jp @+left_3_23 - nop - jp @+left_3_24 - nop - jp @+left_3_25 - nop - jp @+left_3_26 - nop - jp @+left_3_27 - nop - jp @+left_3_28 - nop - jp @+left_3_29 - nop - jp @+left_3_30 - - ds align 256 tiles_right_5_page: EQU 21 + 0b00100000 tiles_right_5: @@ -28638,6 +28636,72 @@ jp @+right_5_30 + ds align 256 + tiles_left_3_page: EQU 21 + 0b00100000 + tiles_left_3: + jp @+left_3_0 + nop + jp @+left_3_1 + nop + jp @+left_3_2 + nop + jp @+left_3_3 + nop + jp @+left_3_4 + nop + jp @+left_3_5 + nop + jp @+left_3_6 + nop + jp @+left_3_7 + nop + jp @+left_3_8 + nop + jp @+left_3_9 + nop + jp @+left_3_10 + nop + jp @+left_3_11 + nop + jp @+left_3_12 + nop + jp @+left_3_13 + nop + jp @+left_3_14 + nop + jp @+left_3_15 + nop + jp @+left_3_16 + nop + jp @+left_3_17 + nop + jp @+left_3_18 + nop + jp @+left_3_19 + nop + jp @+left_3_20 + nop + jp @+left_3_21 + nop + jp @+left_3_22 + nop + jp @+left_3_23 + nop + jp @+left_3_24 + nop + jp @+left_3_25 + nop + jp @+left_3_26 + nop + jp @+left_3_27 + nop + jp @+left_3_28 + nop + jp @+left_3_29 + nop + jp @+left_3_30 + + @left_3_8: ld (@+return+1), de ld sp, hl @@ -34775,72 +34839,6 @@ ORG 0 DUMP 22, 0 - ds align 256 - tiles_left_2_page: EQU 22 + 0b00100000 - tiles_left_2: - jp @+left_2_0 - nop - jp @+left_2_1 - nop - jp @+left_2_2 - nop - jp @+left_2_3 - nop - jp @+left_2_4 - nop - jp @+left_2_5 - nop - jp @+left_2_6 - nop - jp @+left_2_7 - nop - jp @+left_2_8 - nop - jp @+left_2_9 - nop - jp @+left_2_10 - nop - jp @+left_2_11 - nop - jp @+left_2_12 - nop - jp @+left_2_13 - nop - jp @+left_2_14 - nop - jp @+left_2_15 - nop - jp @+left_2_16 - nop - jp @+left_2_17 - nop - jp @+left_2_18 - nop - jp @+left_2_19 - nop - jp @+left_2_20 - nop - jp @+left_2_21 - nop - jp @+left_2_22 - nop - jp @+left_2_23 - nop - jp @+left_2_24 - nop - jp @+left_2_25 - nop - jp @+left_2_26 - nop - jp @+left_2_27 - nop - jp @+left_2_28 - nop - jp @+left_2_29 - nop - jp @+left_2_30 - - ds align 256 tiles_right_6_page: EQU 22 + 0b00100000 tiles_right_6: @@ -34907,6 +34905,72 @@ jp @+right_6_30 + ds align 256 + tiles_left_2_page: EQU 22 + 0b00100000 + tiles_left_2: + jp @+left_2_0 + nop + jp @+left_2_1 + nop + jp @+left_2_2 + nop + jp @+left_2_3 + nop + jp @+left_2_4 + nop + jp @+left_2_5 + nop + jp @+left_2_6 + nop + jp @+left_2_7 + nop + jp @+left_2_8 + nop + jp @+left_2_9 + nop + jp @+left_2_10 + nop + jp @+left_2_11 + nop + jp @+left_2_12 + nop + jp @+left_2_13 + nop + jp @+left_2_14 + nop + jp @+left_2_15 + nop + jp @+left_2_16 + nop + jp @+left_2_17 + nop + jp @+left_2_18 + nop + jp @+left_2_19 + nop + jp @+left_2_20 + nop + jp @+left_2_21 + nop + jp @+left_2_22 + nop + jp @+left_2_23 + nop + jp @+left_2_24 + nop + jp @+left_2_25 + nop + jp @+left_2_26 + nop + jp @+left_2_27 + nop + jp @+left_2_28 + nop + jp @+left_2_29 + nop + jp @+left_2_30 + + @left_2_8: ld (@+return+1), de ld sp, hl @@ -40669,72 +40733,6 @@ ORG 0 DUMP 23, 0 - ds align 256 - tiles_left_1_page: EQU 23 + 0b00100000 - tiles_left_1: - jp @+left_1_0 - nop - jp @+left_1_1 - nop - jp @+left_1_2 - nop - jp @+left_1_3 - nop - jp @+left_1_4 - nop - jp @+left_1_5 - nop - jp @+left_1_6 - nop - jp @+left_1_7 - nop - jp @+left_1_8 - nop - jp @+left_1_9 - nop - jp @+left_1_10 - nop - jp @+left_1_11 - nop - jp @+left_1_12 - nop - jp @+left_1_13 - nop - jp @+left_1_14 - nop - jp @+left_1_15 - nop - jp @+left_1_16 - nop - jp @+left_1_17 - nop - jp @+left_1_18 - nop - jp @+left_1_19 - nop - jp @+left_1_20 - nop - jp @+left_1_21 - nop - jp @+left_1_22 - nop - jp @+left_1_23 - nop - jp @+left_1_24 - nop - jp @+left_1_25 - nop - jp @+left_1_26 - nop - jp @+left_1_27 - nop - jp @+left_1_28 - nop - jp @+left_1_29 - nop - jp @+left_1_30 - - ds align 256 tiles_right_7_page: EQU 23 + 0b00100000 tiles_right_7: @@ -40801,6 +40799,72 @@ jp @+right_7_30 + ds align 256 + tiles_left_1_page: EQU 23 + 0b00100000 + tiles_left_1: + jp @+left_1_0 + nop + jp @+left_1_1 + nop + jp @+left_1_2 + nop + jp @+left_1_3 + nop + jp @+left_1_4 + nop + jp @+left_1_5 + nop + jp @+left_1_6 + nop + jp @+left_1_7 + nop + jp @+left_1_8 + nop + jp @+left_1_9 + nop + jp @+left_1_10 + nop + jp @+left_1_11 + nop + jp @+left_1_12 + nop + jp @+left_1_13 + nop + jp @+left_1_14 + nop + jp @+left_1_15 + nop + jp @+left_1_16 + nop + jp @+left_1_17 + nop + jp @+left_1_18 + nop + jp @+left_1_19 + nop + jp @+left_1_20 + nop + jp @+left_1_21 + nop + jp @+left_1_22 + nop + jp @+left_1_23 + nop + jp @+left_1_24 + nop + jp @+left_1_25 + nop + jp @+left_1_26 + nop + jp @+left_1_27 + nop + jp @+left_1_28 + nop + jp @+left_1_29 + nop + jp @+left_1_30 + + @left_1_8: ld (@+return+1), de ld sp, hl diff --git a/src/per_buffer_code.z80s b/src/per_buffer_code.z80s index 1d5db93..6945203 100644 --- a/src/per_buffer_code.z80s +++ b/src/per_buffer_code.z80s @@ -22,12 +22,13 @@ ENDIF ld a, (@diff_address) ; Get dirty flags. ld (@+jp_sliver+1), a ; Use flags directly to select lower byte of jump target. -tile_address{@column_loop}_{@sliver_loop}: - ld a, tiles_full >> 8 ld de, @+next - @jp_sliver: - jp slivers +IF @column_loop > 0 + jp right_slivers +ELSE + jp left_slivers +ENDIF @next: NEXT @sliver_loop