Yes, I agree as well.
Code: Select all
{
"metasprites": [
{
"label": "playersprite1_idle",
"oam_entries": [
57, 32, 91, 3,
60, 32, 92, 3,
62, 40, 107, 3,
56, 40, 106, 3,
55, 56, 64, 3,
63, 56, 65, 3,
52, 31, 62, 1,
60, 31, 63, 1,
54, 40, 1, 2,
67, 40, 2, 2,
52, 48, 16, 2,
60, 48, 17, 2,
67, 48, 18, 2
]
},
{
"label": "playersprite1_run_03",
"oam_entries": [
57, 30, 91, 3,
60, 30, 92, 3,
62, 38, 107, 3,
56, 38, 106, 3,
50, 53, 72, 3,
58, 53, 73, 3,
66, 52, 70, 3,
52, 29, 62, 1,
60, 29, 63, 1,
51, 38, 8, 2,
66, 38, 10, 2,
50, 46, 24, 2,
58, 45, 25, 2,
66, 46, 26, 2
]
},
{
"label": "playersprite1_run_01",
"oam_entries": [
57, 32, 91, 3,
60, 32, 92, 3,
62, 40, 107, 3,
56, 40, 106, 3,
52, 56, 66, 3,
60, 56, 67, 3,
52, 31, 62, 1,
59, 29, 89, 129,
52, 40, 3, 2,
52, 48, 19, 2,
60, 48, 20, 2,
68, 48, 21, 2
]
},
{
"label": "playersprite1_run_02",
"oam_entries": [
56, 38, 6, 2,
56, 46, 22, 2,
64, 46, 23, 2,
57, 30, 91, 3,
60, 30, 92, 3,
62, 38, 107, 3,
56, 38, 106, 3,
52, 52, 68, 3,
60, 52, 69, 3,
68, 52, 70, 3,
52, 29, 62, 1,
60, 29, 63, 1
]
},
{
"label": "playersprite1_holding_weapon_run_01",
"oam_entries": [
49, 30, 62, 1,
55, 28, 89, 129,
54, 31, 94, 3,
62, 31, 95, 3,
54, 39, 110, 3,
62, 39, 111, 3,
52, 56, 66, 3,
60, 56, 67, 3,
46, 32, 11, 2,
46, 40, 27, 2,
54, 40, 12, 2,
62, 40, 13, 2,
70, 38, 14, 2,
54, 48, 28, 2,
62, 48, 29, 2
]
},
{
"label": "playersprite1_holding_weapon_run_02",
"oam_entries": [
49, 29, 62, 1,
57, 29, 63, 1,
54, 30, 94, 3,
62, 30, 95, 3,
54, 38, 110, 3,
62, 38, 111, 3,
52, 52, 68, 3,
60, 52, 69, 3,
68, 52, 70, 3,
46, 31, 11, 2,
46, 39, 27, 2,
54, 39, 12, 2,
62, 38, 13, 2,
70, 37, 14, 2,
54, 46, 28, 2,
62, 46, 29, 2
]
},
{
"label": "playersprite1_holding_weapon_run_03",
"oam_entries": [
49, 29, 62, 1,
57, 29, 63, 1,
54, 30, 94, 3,
62, 30, 95, 3,
54, 38, 110, 3,
62, 38, 111, 3,
58, 52, 73, 3,
50, 52, 72, 3,
66, 51, 70, 3,
46, 31, 11, 2,
46, 38, 27, 2,
54, 39, 12, 2,
62, 39, 13, 2,
70, 37, 14, 2,
54, 46, 28, 2,
62, 46, 29, 2
]
}
],
"animations": [
{
"label": "running",
"loop_frame": 0,
"frames": [
{
"delay": 4,
"metasprite": "playersprite1_run_01"
},
{
"delay": 4,
"metasprite": "playersprite1_run_02"
},
{
"delay": 4,
"metasprite": "playersprite1_run_01"
},
{
"delay": 4,
"metasprite": "playersprite1_run_03"
}
]
},
{
"label": "idle",
"loop_frame": 0,
"frames": [
{
"delay": 4,
"metasprite": "playersprite1_idle"
}
]
}
]
}
Code: Select all
#ifndef NESAC_MACROS
#define NESAC_MACROS
#define NESAC_LOBYTE(p) (((unsigned int) (p)) & 0xff)
#define NESAC_HIBYTE(p) (((unsigned int) (p)) >> 8)
#endif
const unsigned char playersprite1_idle[]={
57, 32, 0x5b, 3,
60, 32, 0x5c, 3,
62, 40, 0x6b, 3,
56, 40, 0x6a, 3,
55, 56, 0x40, 3,
63, 56, 0x41, 3,
52, 31, 0x3e, 1,
60, 31, 0x3f, 1,
54, 40, 0x01, 2,
67, 40, 0x02, 2,
52, 48, 0x10, 2,
60, 48, 0x11, 2,
67, 48, 0x12, 2,
128
};
const unsigned char playersprite1_run_03[]={
57, 30, 0x5b, 3,
60, 30, 0x5c, 3,
62, 38, 0x6b, 3,
56, 38, 0x6a, 3,
50, 53, 0x48, 3,
58, 53, 0x49, 3,
66, 52, 0x46, 3,
52, 29, 0x3e, 1,
60, 29, 0x3f, 1,
51, 38, 0x08, 2,
66, 38, 0x0a, 2,
50, 46, 0x18, 2,
58, 45, 0x19, 2,
66, 46, 0x1a, 2,
128
};
const unsigned char playersprite1_run_01[]={
57, 32, 0x5b, 3,
60, 32, 0x5c, 3,
62, 40, 0x6b, 3,
56, 40, 0x6a, 3,
52, 56, 0x42, 3,
60, 56, 0x43, 3,
52, 31, 0x3e, 1,
59, 29, 0x59, 129,
52, 40, 0x03, 2,
52, 48, 0x13, 2,
60, 48, 0x14, 2,
68, 48, 0x15, 2,
128
};
const unsigned char playersprite1_run_02[]={
56, 38, 0x06, 2,
56, 46, 0x16, 2,
64, 46, 0x17, 2,
57, 30, 0x5b, 3,
60, 30, 0x5c, 3,
62, 38, 0x6b, 3,
56, 38, 0x6a, 3,
52, 52, 0x44, 3,
60, 52, 0x45, 3,
68, 52, 0x46, 3,
52, 29, 0x3e, 1,
60, 29, 0x3f, 1,
128
};
const unsigned char* const test_metasprite_list[]={
playersprite1_idle,
playersprite1_run_03,
playersprite1_run_01,
playersprite1_run_02
};
const unsigned char running[]={
0, // index of frame to loop to.
4, // time delay for this frame.
NESAC_LOBYTE(&playersprite1_run_01),
NESAC_HIBYTE(&playersprite1_run_01),
4, // time delay for this frame.
NESAC_LOBYTE(&playersprite1_run_02),
NESAC_HIBYTE(&playersprite1_run_02),
4, // time delay for this frame.
NESAC_LOBYTE(&playersprite1_run_01),
NESAC_HIBYTE(&playersprite1_run_01),
4, // time delay for this frame.
NESAC_LOBYTE(&playersprite1_run_03),
NESAC_HIBYTE(&playersprite1_run_03)
};
const unsigned char idle[]={
0, // index of frame to loop to.
4, // time delay for this frame.
NESAC_LOBYTE(&playersprite1_idle),
NESAC_HIBYTE(&playersprite1_idle)
};
const unsigned char* const test[]={
NESAC_LOBYTE(&running),
NESAC_HIBYTE(&running),
NESAC_LOBYTE(&idle),
NESAC_HIBYTE(&idle)
};
So as you can see, I've tried to copy what NESST does but split up the metasprite data in separate arrays. I've still kept the list of pointers though.. don't know if that would come of any use to someone though, so maybe I should just cut it?
But idk, I mean I did add such a list for the animations as well and I'm actually using it (in asm form) in my own project. In the end I guess most people would favor the JSON export though, since it's easier to parse and do whatever you want with.
I've only tried compiling the C export for x86 but from what I can tell the macros seem to work as Nicole intended. One thing that I've cut out from the pasted code is all the unused metasprites. Unused as in not being part of an animation. I'm not sure whether I should check that each metasprite is used or just leave it up to the user. My thinking is there might be a case where you will need some animation that would need to be coded by hand (i have such animations myself) and in such a case you could still draw benefit from having those metasprites exported with their labels. What do you guys think?
EDIT: I just discovered that I don't store the metasprite offset from NESST anywhere in the tool. I'll add that to all of the exports ASAP.