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

BGREAD

Root / Programming Questions / [.]

12Me21Created:
In PTC there was a command called "BGREAD" what is the smilebasic equivilant?

Not super familiar with PTC, but maybe the BGGET command is what you are after?

Not super familiar with PTC, but maybe the BGGET command is what you are after?
There's ptc manuals on the internet, ya know. That might help you and other people understand what it is. Edit: like one of these. http://petitcomputer.wikia.com/wiki/Petit_Computer_Function_Guide

I did read that, or rather this https://docs.google.com/document/d/1ByVIMbeoNfpY7NjwHqUBqspQjbj1aR4CS-F2fZRtAtQ/edit, which is why I suggested BGGET. It seems to serve the same purpose, but I never used PTC so I'm guessing based on the documentation, hence my trepidation.

The reason I need to know this is because I'm translating tristones to smilebasic, and it uses BGREAD (and also COLREAD) a lot, so I will have to find a replacement. Progress: -transferred code to smilebasic -changed % to MOD, array() to array[], etc. (now code runs without immediately giving a syntax error) Next: -translate sprite and background (and color) commands -fix unknown incompatabilities. I found something like this: IF ... THEN X=1:@LABEL Which seems to work in PTC, but it isn't allowed in smilebasic

The reason I need to know this is because I'm translating tristones to smilebasic, and it uses BGREAD (and also COLREAD) a lot, so I will have to find a replacement. Progress: -transferred code to smilebasic -changed % to MOD, array() to array[], etc. (now code runs without immediately giving a syntax error) Next: -translate sprite and background (and color) commands -fix unknown incompatabilities. I found something like this: IF ... THEN X=1:@LABEL Which seems to work in PTC, but it isn't allowed in smilebasic EDIT: I found this in the documentation: BGREAD(layer0-1, xTile0-63 ,yTile0-63), userVariable , userVariable , userVariable , userVariable Apparently, BGREAD is like the OUT commands in smilebasic. Unfortunately, BGGET (the SB equvilant) outputs the result in only one variable for some reason: Variable=BGGET( Layer, X, Y [,Coordinate system flag] ) So I think I'll make a function: DEF BGREAD (layer,x,y) OUT id,palette,horizontalrotation,verticalrotation

Unfortunately, BGGET (the SB equvilant) outputs the result in only one variable for some reason: Variable=BGGET( Layer, X, Y [,Coordinate system flag] )
At least the smilebasic docs tell you which bits contain what values (lucky!). I suppose you could BGGET, and then just mask and shift each component in your function, but I'm sure you already figured that out. I never played Tristones, but it looks really neat. Good luck with your port!