2 An issue that resulted in a value in register hl being overwritten on z80.
7 /// Test derived from code by SF user "Under4Mhz" in 2022.
13 #define PICTURE_TILE_COUNT 4
14 #define PICTURE1_TILES 34
15 #define PICTURE2_TILES ( PICTURE1_TILES + PICTURE_TILE_COUNT )
17 ///< Is matching tiles
18 bool IsSameTile( int8_t tile1
, int8_t tile2
) {
20 if ( tile1
<= 0 || tile2
<= 0 ) return false;
22 bool same
= tile1
== tile2
;
23 bool flowers
= tile1
> PICTURE1_TILES
&& tile1
<= PICTURE2_TILES
&& tile2
> PICTURE1_TILES
&& tile2
<= PICTURE2_TILES
;
24 bool seasons
= tile1
> PICTURE2_TILES
&& tile2
> PICTURE2_TILES
;
26 return same
|| seasons
|| flowers
;
31 ASSERT ( IsSameTile(PICTURE1_TILES
+ 1, PICTURE1_TILES
+ 2) );
32 ASSERT ( IsSameTile(PICTURE2_TILES
+ 2, PICTURE2_TILES
+ 3) );
33 ASSERT ( IsSameTile(PICTURE1_TILES
+ 2, PICTURE1_TILES
+ 3) );
34 ASSERT ( IsSameTile(PICTURE2_TILES
+ 1, PICTURE2_TILES
+ 2) );