File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,18 +73,18 @@ class ProcessView {
7373 }
7474
7575 getAddress ( x , y ) {
76- x = mod ( x , this . world_width )
77- y = mod ( y , this . world_height )
7876 return this . region [ 0 ] + x + y * this . world_width
7977 }
8078
8179 getByteSync ( x , y , l ) {
80+ x = mod ( x , this . world_width )
81+ y = mod ( y , this . world_height )
8282 try {
83- if ( x + l >= this . world_width ) {
83+ if ( x + l > this . world_width ) {
8484 let leftlength = this . world_width - x
8585 let leftdata = this . mem . read ( this . getAddress ( x , y ) , leftlength )
86- let rightdata = this . mem . read ( this . getAddress ( x + leftlength , y ) , l - leftlength )
87- return leftdata . concat ( rightdata )
86+ let rightdata = this . mem . read ( this . getAddress ( 0 , y ) , l - leftlength )
87+ return Array . from ( leftdata ) . concat ( Array . from ( rightdata ) )
8888 }
8989 return this . mem . read ( this . getAddress ( x , y ) , l )
9090 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments