File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
core/graphics/pixelPipeline Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -197,12 +197,17 @@ function _tryToFetchWindow(): boolean {
197
197
let tileLine : i32 = Graphics . scanlineRegister - windowY ;
198
198
tileLine = tileLine & 7 ;
199
199
200
- // Find the x/y coordinates of the tile on the 256x256 Bg map
201
- let pixelXPositionInMap = PixelFifo . currentIndex + windowX ;
200
+ // Find the x/y coordinates of the tile
201
+
202
+ // Get our Current X position of our pixel on the on the 160x144 camera
203
+ // this is done by getting the current scroll X position,
204
+ // and adding it do what X Value the scanline is drawing on the camera.
205
+ let pixelXPositionInMap = PixelFifo . currentIndex - windowX ;
202
206
// This is to compensate wrapping
203
207
if ( pixelXPositionInMap >= 0x100 ) {
204
208
pixelXPositionInMap -= 0x100 ;
205
209
}
210
+ // Get our current pixel y positon on the 160x144 camera (Row that the scanline draws across)
206
211
let pixelYPositionInMap = Graphics . scanlineRegister - windowY ;
207
212
208
213
// Get the location of our tileId on the tileMap
You can’t perform that action at this time.
0 commit comments