File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -2873,7 +2873,7 @@ gfx_TilePtr:
2873
2873
ld ix , 0
2874
2874
add ix , sp
2875
2875
ld iy , (ix + 6 )
2876
- ld hl , (ix + x_offset )
2876
+ ld hl , (ix + 9 )
2877
2877
ld a , (iy + t_type_width)
2878
2878
or a , a
2879
2879
jr nz , .fastdiv0
@@ -2890,7 +2890,7 @@ gfx_TilePtr:
2890
2890
djnz .div0
2891
2891
.widthnotpow2:
2892
2892
ex de , hl
2893
- ld hl , (ix + y_offset )
2893
+ ld hl , (ix + 12 )
2894
2894
ld a , (iy + t_type_height)
2895
2895
or a , a
2896
2896
jr nz , .fastdiv1
@@ -2927,17 +2927,18 @@ gfx_TilePtrMapped:
2927
2927
pop de ; return vector
2928
2928
pop iy ; tilemap struct
2929
2929
pop bc ; x offset
2930
- ex ( sp ) , hl ; y offset
2931
- push bc
2930
+ pop hl ; y offset
2931
+ push hl
2932
2932
push bc
2933
+ push iy
2934
+ push de
2933
2935
ld h , (iy + 13 ) ; tilemap width
2934
2936
mlt hl
2935
2937
ld b , 0
2936
2938
add .s hl , bc
2937
2939
ld bc , (iy + 0 ) ; tilemap data
2938
2940
add hl , bc
2939
- ex de , hl
2940
- jp (hl)
2941
+ ret
2941
2942
2942
2943
;-------------------------------------------------------------------------------
2943
2944
gfx_GetTextX:
Original file line number Diff line number Diff line change @@ -416,7 +416,8 @@ void gfx_TransparentTilemap_NoClip(gfx_tilemap_t *tilemap,
416
416
417
417
/**
418
418
* Gets a pointer to a particular tile given an initialized tilemap
419
- * structure and pixel offsets.
419
+ * structure and pixel offsets. Measurement is done from the actual
420
+ * tilemap, not the drawn offset location.
420
421
*
421
422
* @param tilemap Pointer to initialized tilemap structure.
422
423
* @param x_offset Offset in pixels from the left of the tilemap.
You can’t perform that action at this time.
0 commit comments