.stri16 \ By this point we have smoothed the whole strip, so we \ can now copy the smoothed tile data back into the \ tileData table LDX #31 \ Set A counter in X to work through the tile data for \ the 32 tiles in the strip we just smoothed .stri17 TXA \ Set A to the tile index BIT processAction \ If bit 7 of processAction is clear then we are BPL stri18 \ smoothing a row of tiles at z-coordinate zTile, so \ jump to stri18 to iterate across xTile STA zTile \ If we get here then we are smoothing a column of tiles \ so set zTile to the counter in X so we iterate along \ the z-coordinate (i.e. coming out of the screen) JMP stri19 \ Jump to stri19 to skip the following .stri18 STA xTile \ If we get here then we are smoothing a row of tiles \ so set xTile to the counter in X so we iterate along \ the x-coordinate (i.e. from right to left) .stri19 JSR GetTileData \ Set A to the tile data for the tile anchored at \ (xTile, zTile), which we ignore, but this also sets \ the tile page in tileDataPage and the index in Y, so \ tileDataPage+Y now points to the tile data entry in \ the tileData table LDA stripData,X \ Copy the X-th byte of tile data from the smoothed STA (tileDataPage),Y \ strip into the corresponding entry for (xTile, zTile) \ in the tileData table DEX \ Decrement the tile counter in X so we work our way \ along to the next tile in the strip we are smoothing BPL stri17 \ Loop back to smooth the next tile until we have \ smoothed the whole strip RTS \ Return from the subroutineName: SmoothTileCorners (Part 4 of 4) [Show more] Type: Subroutine Category: Landscape Summary: Copy the smoothed strip data back into the tileData tableContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
This part copies the smoothed strip back into the tileData table.
[X]
Subroutine GetTileData (category: Landscape)
Get the tile data and tile data address for a specific tile
[X]
Variable processAction in workspace Zero page
Defines the following
[X]
Label stri17 is local to this routine
[X]
Label stri18 is local to this routine
[X]
Label stri19 is local to this routine
[X]
Variable stripData (category: Landscape)
Storage for tile data when smoothing strips of tiles during the landscape generation process
[X]
Variable tileDataPage in workspace Zero page
The address of the tileData page containing the current tile's data