Skip to content

Commit e75d59e

Browse files
Add missing or a,a to graphx to fix tilemaps
1 parent 81b330d commit e75d59e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

CEdev/lib/src/graphics/graphx/v3/graphics_lib.asm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,11 +2252,11 @@ _: ld (DrawTile_SMC),hl \.r
22522252
_: srl h
22532253
rr l
22542254
djnz -_
2255-
ld (ix+-4),l ; y = y_offset / tilemap->tile_height
2256-
ld (ix+12),bc ; y_offset = y_offset % tilemap->tile_height;
2255+
ld (ix+-4),l ; y = y_offset / tilemap->tile_height
2256+
ld (ix+12),bc ; y_offset = y_offset % tilemap->tile_height;
22572257
22582258
ld b,(iy+10)
2259-
ld hl,(ix+9)
2259+
ld hl,(ix+9) ; x offset
22602260
ld c,(iy+7)
22612261
dec c
22622262
ld a,l
@@ -2268,8 +2268,9 @@ _: srl h
22682268
ld a,l
22692269
ld (X_Res_SMC),a \.r
22702270
ld hl,(iy+15)
2271+
or a,a
22712272
sbc hl,bc
2272-
ld (X_Draw_SMC),hl \.r ; x_draw = tilemap->x_loc-x_offset;
2273+
ld (X_Draw_SMC),hl \.r ; x_draw = tilemap->x_loc-x_offset;
22732274
22742275
or a,a
22752276
sbc hl,hl

0 commit comments

Comments
 (0)