Skip to content

Commit

Permalink
Fix: station not recognizing platform from other grfs
Browse files Browse the repository at this point in the history
  • Loading branch information
WenSimEHRP committed May 15, 2024
1 parent 63ec0e8 commit 0011d4b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/defines.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

#define STANDARD_PLATFORM_BITS 3 << 14

#define NPLAT_BIT 0 // 0 only
#define NPLAT_BIT 7 // 0 only
#define SPLAT_BIT 1 // 1 only
#define SHELTER_BIT 2 // 2 only
#define PLATFORM_SPRITESET_BITS 3 // 3 and 4
Expand Down
58 changes: 29 additions & 29 deletions src/testing.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ spriteset (s_test_fence, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
}*/

#define GET_NPLAT_FORMATION \
((getbits(LOAD_TEMP(TILE_X_SW), NPLAT_BIT, 1) | getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_SW, 1)) << 0|\
(getbits(LOAD_TEMP(TILE_X_NE), NPLAT_BIT, 1) | getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_NE, 1)) << 1)
((getbits(LOAD_TEMP(TILE_X_SW), NPLAT_BIT, 1) ^ getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_SW, 1)) << 0|\
(getbits(LOAD_TEMP(TILE_X_NE), NPLAT_BIT, 1) ^ getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_NE, 1)) << 1)

#define GET_SPLAT_FORMATION \
((getbits(LOAD_TEMP(TILE_X_SW), SPLAT_BIT, 1) | getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_SW, 1)) << 0|\
(getbits(LOAD_TEMP(TILE_X_NE), SPLAT_BIT, 1) | getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_NE, 1)) << 1)
((getbits(LOAD_TEMP(TILE_X_SW), SPLAT_BIT, 1) ^ getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_SW, 1)) << 0|\
(getbits(LOAD_TEMP(TILE_X_NE), SPLAT_BIT, 1) ^ getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_NE, 1)) << 1)

spritelayout sp_test_x(hide_platform_nw, hide_platform_se, hide_shelter) {
ground {sprite: GROUNDSPRITE_RAIL_X;}
Expand Down Expand Up @@ -177,42 +177,42 @@ spritelayout sp_test_y(hide_platform_ne, hide_platform_sw, hide_shelter) {
}
}
/* about registers
*
*
*/
switch (FEAT_STATIONS, SELF, sw_check_rail_continuation,
hasbit(rail_continuation, 1) << TILE_X_NE|
hasbit(rail_continuation, 0) << TILE_X_SW) {return;}


switch (FEAT_STATIONS, SELF, sw_check_nearby_tile_station,
nearby_tile_is_station(-1, 0) << TILE_X_NE|
nearby_tile_is_station( 1, 0) << TILE_X_SW|
nearby_tile_is_station( 0,-1) << TILE_X_NW|
nearby_tile_is_station( 0, 1) << TILE_X_SE|
nearby_tile_is_station(-1,-1) << TILE_X_N|
nearby_tile_is_station( 1, 1) << TILE_X_S|
nearby_tile_is_station( 1,-1) << TILE_X_W|
nearby_tile_is_station(-1, 1) << TILE_X_E) {return;}
(nearby_tile_is_station(-1, 0) == 1) << TILE_X_NE|
(nearby_tile_is_station( 1, 0) == 1) << TILE_X_SW|
(nearby_tile_is_station( 0,-1) == 1) << TILE_X_NW|
(nearby_tile_is_station( 0, 1) == 1) << TILE_X_SE|
(nearby_tile_is_station(-1,-1) == 1) << TILE_X_N|
(nearby_tile_is_station( 1, 1) == 1) << TILE_X_S|
(nearby_tile_is_station( 1,-1) == 1) << TILE_X_W|
(nearby_tile_is_station(-1, 1) == 1) << TILE_X_E) {return;}

switch (FEAT_STATIONS, SELF, sw_check_nearby_tile_perpendicular,
nearby_tile_perpendicular(-1, 0) << TILE_X_NE|
nearby_tile_perpendicular( 1, 0) << TILE_X_SW|
nearby_tile_perpendicular( 0,-1) << TILE_X_NW|
nearby_tile_perpendicular( 0, 1) << TILE_X_SE|
nearby_tile_perpendicular(-1,-1) << TILE_X_N|
nearby_tile_perpendicular( 1, 1) << TILE_X_S|
nearby_tile_perpendicular( 1,-1) << TILE_X_W|
nearby_tile_perpendicular(-1, 1) << TILE_X_E) {return;}
(nearby_tile_perpendicular(-1, 0) == 1) << TILE_X_NE|
(nearby_tile_perpendicular( 1, 0) == 1) << TILE_X_SW|
(nearby_tile_perpendicular( 0,-1) == 1) << TILE_X_NW|
(nearby_tile_perpendicular( 0, 1) == 1) << TILE_X_SE|
(nearby_tile_perpendicular(-1,-1) == 1) << TILE_X_N|
(nearby_tile_perpendicular( 1, 1) == 1) << TILE_X_S|
(nearby_tile_perpendicular( 1,-1) == 1) << TILE_X_W|
(nearby_tile_perpendicular(-1, 1) == 1) << TILE_X_E) {return;}

switch (FEAT_STATIONS, SELF, sw_check_nearby_tile_grf,
nearby_tile_same_grf(-1, 0) << TILE_X_NE|
nearby_tile_same_grf( 1, 0) << TILE_X_SW|
nearby_tile_same_grf( 0,-1) << TILE_X_NW|
nearby_tile_same_grf( 0, 1) << TILE_X_SE|
nearby_tile_same_grf(-1,-1) << TILE_X_N|
nearby_tile_same_grf( 1, 1) << TILE_X_S|
nearby_tile_same_grf( 1,-1) << TILE_X_W|
nearby_tile_same_grf(-1, 1) << TILE_X_E) {return;}
(nearby_tile_same_grf(-1, 0) == 1) << TILE_X_NE|
(nearby_tile_same_grf( 1, 0) == 1) << TILE_X_SW|
(nearby_tile_same_grf( 0,-1) == 1) << TILE_X_NW|
(nearby_tile_same_grf( 0, 1) == 1) << TILE_X_SE|
(nearby_tile_same_grf(-1,-1) == 1) << TILE_X_N|
(nearby_tile_same_grf( 1, 1) == 1) << TILE_X_S|
(nearby_tile_same_grf( 1,-1) == 1) << TILE_X_W|
(nearby_tile_same_grf(-1, 1) == 1) << TILE_X_E) {return;}

switch (FEAT_STATIONS, SELF, sw_test, [
STORE_TEMP(sw_check_rail_continuation(), TEMP_RAIL_CONTINUATION),
Expand Down

0 comments on commit 0011d4b

Please sign in to comment.