Sprite Size Value Out Of Range (Error Code 106)?

  • Thread starter Thread starter wojota_
  • Start date Start date
  • Views Views 430
  • Replies Replies 4

wojota_

Active Member
Newcomer
Joined
Jan 12, 2025
Messages
31
Reaction score
2
Trophies
0
XP
161
Country
United Kingdom
According to melonDS, the sprite size is "too large". I am on Windows, using BlocksDS and NFlib. This is a screenshot of melonDS:

1738349242132.png


And this is the code :

C:
#include <stdio.h>
#include <nds.h>
#include <filesystem.h>
#include <nf_lib.h>
#include <nf_basic.h>
#include <nf_sprite256.h>
#include <nf_2d.h>

int main(int argc, char **argv)
{
    consoleDemoInit();

    // Initialize NitroFS and set it as the root folder of the filesystem
    nitroFSInit(NULL);
    NF_SetRootFolder("NITROFS");

    //Sets up graphics display
    
    NF_Set2D(0, 0);
    NF_Set2D(1, 0);
    NF_InitSpriteBuffers();
    NF_InitSpriteSys(0, 128);
    NF_InitSpriteSys(1);

    //Loading graphics to RAM

    NF_LoadSpriteGfx("of40turret_-1", 0, 80, 80);
    NF_LoadSpriteGfx("of40turret_0", 1, 80, 80);
    NF_LoadSpriteGfx("of40turret_1", 2, 80, 80);
    NF_LoadSpriteGfx("of40turret_2", 3, 80, 80);
    NF_LoadSpriteGfx("of40hull", 4, 80, 80);
    NF_LoadSpritePal("of40turret", 0);
    NF_LoadSpritePal("of40hull", 1);

    //Loading graphics to VRAM

    NF_VramSpriteGfx(0, 1, 0, false);
    NF_VramSpriteGfx(0, 4, 1, false);
    NF_VramSpritePal(0, 0, 0);
    NF_VramSpritePal(0, 1, 1);

    //Creating sprite

    NF_CreateSprite(0, 0, 0, 0, 88, -58);
    NF_CreateSprite(0, 1, 1, 1, 88, -56);

    //Setting sprite

    NF_SpriteFrame(0, 0, 1);
    NF_SpriteFrame(0, 1, 1);
    NF_SpriteLayer(0, 0, 1);
    NF_SpriteLayer(0, 1, 2);

    while (1)
    {
        NF_SpriteOamSet(0);
        NF_SpriteOamSet(1);
        swiWaitForVBlank();
        oamUpdate(&oamMain);
        oamUpdate(&oamSub);
    }

    return 0;
}

I am trying to load an animated GFX which is 480 by 80 of which one "frame" is 80 by 80. If anyone has any suggestions then please feel free to reply. Thank you for all the help in advance.
Post automatically merged:

Is 64 by 64 the maximum size for sprites?
 
Last edited by wojota_,
You can try a different attempt, if you plan to use 80x80 object how about to use 4 sprites connected by edges.
 
The whole point of having it in one sprite was being able to rotate it. :)
Post automatically merged:

Unless there are other methods which I have not heard of.
 

Site & Scene News

Popular threads in this forum