LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Screenshot Ideas

Root / Talk About Programs / [.]

NathanielCreated:
As you may know, Miiverse will most likely be ending soon. And along with Miiverse, the ability to take screenshots might also end. So, instead of relying on Nintendo for help, what if we made a function that takes screenshots for us. This function would take anything from the color of sprites to coordinates of BG layers and create an image on a graphics page. On this thread, you can post suggestions or answers to questions I have.

It's not possible. Impossible: ▢ getting text color ▢ getting text depth ▢ getting graphics depth ▢ getting BGSHOW/HIDE state Maybe impossible: ▢ getting BG layer size ▢ getting the XSCREEN mode ▢ getting BG tile size Really hard: ▢ drawing rotated/scaled sprites/bg ▢ DIALOG Specific games could implement their own screenshot system, but you won't be able to make a general function.

We could also replace commands with functions like:
LOCATE X,Y,Z
COLOR 9
PRINT "TEXT"
with:
LOCATE_2 X,Y,Z 'stores z-coordinate
COLOR_2 9 'stores color
PRINT_2 "TEXT" 'stores current z-coordinte and color in array

We could also replace commands with functions like:
LOCATE X,Y,Z
COLOR 9
PRINT "TEXT"
with:
LOCATE_2 X,Y,Z 'stores z-coordinate
COLOR_2 9 'stores color
PRINT_2 "TEXT" 'stores current z-coordinte and color in array
I guess, but then it would be annoying to print multiple things at once, or use optional arguments in COLOR and LOCATE.

We could also replace commands with functions like:
LOCATE X,Y,Z
COLOR 9
PRINT "TEXT"
with:
LOCATE_2 X,Y,Z 'stores z-coordinate
COLOR_2 9 'stores color
PRINT_2 "TEXT" 'stores current z-coordinte and color in array
I guess, but then it would be annoying to print multiple things at once, or use optional arguments in COLOR and LOCATE.
True, but anything is better than nothing.

We could also replace commands with functions like:
LOCATE X,Y,Z
COLOR 9
PRINT "TEXT"
with:
LOCATE_2 X,Y,Z 'stores z-coordinate
COLOR_2 9 'stores color
PRINT_2 "TEXT" 'stores current z-coordinte and color in array
I guess, but then it would be annoying to print multiple things at once, or use optional arguments in COLOR and LOCATE.
True, but anything is better than nothing.
I suppose. We still need to handle rotation and scaling though, and alpha blending also won't be too easy. I think it might be possible to detect BG tile size using BGCOORD or whatever, and layer size by using BGLOAD/BGSAVE.
DEF BGCHARSIZE(LAYER)
 VAR X,SX,SY,X1
 BGOFS LAYER OUT X,
 BGSCALE LAYER OUT SX,SY
 BGSCALE LAYER,1,SY
 BGCOORD LAYER,32-X,0,1 OUT X1,
 BGSCALE LAYER,SX,SY
 RETURN 32/X1
END

We still need to handle rotation and scaling though, and alpha blending also won't be too easy. I think it might be possible to detect BG tile size using BGCOORD or whatever, and layer size by using BGLOAD/BGSAVE.
I already have a piece of code that uses a BG layer's scale, rotation, and tiles to generate an image on a graphics page. Alpha bleeding and DIALOG could be a problem though... BGSAVE stores information into a 1D array. This means it's nearly impossible to guess the size of the BG layer. But, we can still use functions.

It's possible to get the layer width*height using the output array size, and you can make a 0 length array, and keep loading + PUSHing until you get a tile on the second row, which gives the width. OR BGGET using pixel coordinates will not give out of range errors. you can fill the array with tile 1 (or anything nonzero) and keep checking until BGGET(layer,x,0,true) returns 0, which means you've reached the right edge, and that will also tell you the width. This also won't fail if the height is only 1.
DEF BGSCREEN_ LAYER OUT W,H,S
 'store state and reset
 VAR X,Y,SX,SY,HX,HY
 BGOFS LAYER OUT X,Y
 BGSCALE LAYER OUT SX,SY
 BGOFS LAYER,0,0
 BGSCALE LAYER,1,1
 VAR R=BGROT(LAYER)
 BGROT LAYER,0
 BGHOME LAYER OUT HX,HY
 BGHOME LAYER,0,0
 'get tile size
 VAR X1,M=32
 BGCOORD LAYER,M,0,1 OUT X1,
 S=M/X1
 'get width*height
 DIM ARRAY[0]
 BGSAVE LAYER,ARRAY
 VAR WH=LEN(ARRAY)
 'get width
 DIM ARRAY2[WH]
 FILL ARRAY2,1
 BGLOAD LAYER,ARRAY2
 W=0
 WHILE BGGET(LAYER,W,0,TRUE)
  INC W,S
 WEND
 W=W/S
 'get height
 H=WH/W
 'reset
 BGOFS LAYER,X,Y
 BGSCALE LAYER,SX,SY
 BGROT LAYER,R
 BGHOME LAYER,HX,HY
 BGLOAD LAYER,ARRAY
END

Add BGHOME and BGROT to "store state and reset" and "reset" sections. Thx

Maybe there could be a way to scan each pixel's color on the screen and save it as a GRP file, kinda like how a printer does it?

One possible solution, that would certainly work for the scaled/rotated sprites would be to output a definition file which would be loaded on a PC that can then re-render the sprites. (You'd need to use petit modem, or equivalent to transfer this def over) You could probably do it in html+css if you were feeling masochistic enough.

One possible solution, that would certainly work for the scaled/rotated sprites would be to output a definition file which would be loaded on a PC that can then re-render the sprites. (You'd need to use petit modem, or equivalent to transfer this def over) You could probably do it in html+css if you were feeling masochistic enough.
This gave me the idea of using otyasmilebasic for pc. A user can transfer the code using petit modem and take a screenshot there. But, we should worry about this after Miiverse goes down just in case they add in a new screenshot feature.

If the theory about CFW 24 bit colors is true, there must be a way to fix it. Right?
Probably... I'll see what I can find when I have time.

HALO CE!