Skip to content

Commit

Permalink
Fix rightmost column.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHarte committed Nov 18, 2024
1 parent d7d3f65 commit e93af68
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 6 deletions.
15 changes: 9 additions & 6 deletions preprocessor/Map Preprocessor/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,19 @@ - (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 @[right, left]) {
if(!name.length) continue;

[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"];
}
Expand Down Expand Up @@ -458,7 +461,7 @@ - (void)compileTiles:(std::vector<TileSerialiser<TileSize>> &)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"];
Expand Down
64 changes: 64 additions & 0 deletions src/generated/tiles.z80s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/per_buffer_code.z80s
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ ENDIF

ld de, @+next
@jp_sliver:
IF @column_loop > 0
jp right_slivers
ELSE
jp left_slivers
ENDIF
@next:

NEXT @sliver_loop
Expand Down

0 comments on commit e93af68

Please sign in to comment.