private void GetSprites() { //Sprite List - https://smwspeedruns.com/index.php/Sprites _sprites = new List <InputDetail>(); for (int i = 0; i <= 11; i++) { //Position Sprite uint spriteNumber = 0; //Low byte is the position in pixels on the screen uint xLowByte = 0; uint yLowByte = 0; //High byte is screen number uint xHighByte = 0; uint yHighByte = 0; uint currentStatus = _wramDump[Convert.ToInt32("0x14C8", 16) + i]; if (currentStatus != 0) { spriteNumber = _wramDump[Convert.ToInt32("0x9E", 16) + i]; xLowByte = _wramDump[Convert.ToInt32("0xE4", 16) + i]; yLowByte = _wramDump[Convert.ToInt32("0xD8", 16) + i]; xHighByte = _wramDump[Convert.ToInt32("0x14E0", 16) + i]; yHighByte = _wramDump[Convert.ToInt32("0x14D4", 16) + i]; uint calcx = (256 * xHighByte) + xLowByte; uint calcy = (256 * yHighByte) + yLowByte; //Debug.Print(string.Format("Pos: {0} Sprite: {1} - xLowByte:{2} xHighByte:{3} yLowByte:{4} yHighByte:{5} - x calc:{6} || y calc:{7}", i, spriteNumber, xLowByte, xHighByte, yLowByte, yHighByte, calcx, calcy)); InputDetail inputDetail = new InputDetail(); inputDetail.Index = i; inputDetail.X = (int)calcx; inputDetail.Y = (int)calcy; _sprites.Add(inputDetail); } } }
private void GetExtendedSprites() { //Sprite List - http://old.smwiki.net/wiki/RAM_Address/$7E:170B _extendedSprites = new List <InputDetail>(); for (int i = 0; i <= 9; i++) { //Position Sprite uint spriteNumber = _wramDump[Convert.ToInt32("0x170B", 16) + i]; //Low byte is the position in pixels on the screen uint xLowByte = 0; uint yLowByte = 0; //High byte is screen number uint xHighByte = 0; uint yHighByte = 0; if (spriteNumber != 0) { xLowByte = _wramDump[Convert.ToInt32("0x171F", 16) + i]; yLowByte = _wramDump[Convert.ToInt32("0x1715", 16) + i]; xHighByte = _wramDump[Convert.ToInt32("0x1733", 16) + i]; yHighByte = _wramDump[Convert.ToInt32("0x1729", 16) + i]; uint calcx = (256 * xHighByte) + xLowByte; uint calcy = (256 * yHighByte) + yLowByte; //Debug.Print(string.Format("Pos: {0} Extended Sprite: {1} - xLowByte:{2} xHighByte:{3} yLowByte:{4} yHighByte:{5} - x calc:{6} || y calc:{7}", i, spriteNumber, xLowByte, xHighByte, yLowByte, yHighByte, calcx, calcy)); InputDetail inputDetail = new InputDetail(); inputDetail.Index = i; inputDetail.X = (int)calcx; inputDetail.Y = (int)calcy; _extendedSprites.Add(inputDetail); } } }