Skip to content

Commit 1eca69b

Browse files
committed
notes
1 parent 2fcdeb9 commit 1eca69b

7 files changed

Lines changed: 118 additions & 91 deletions

File tree

TODO

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,42 +43,11 @@ create new file | newFactory={(path)=>{}}
4343
04:43:53 <%Lil-G> i mean so when you do "delete unused tiles" it doesn't delete the tiles the other object uses
4444
backdrop-filter
4545
Support MainMemory's macros formats
46-
<H​itaxas> There is also a glitch where Flex will sometimes destroy mappings when saving. Unsure the cause, but this has happened to me twice in the past month. https://cdn.discordapp.com/attachments/718373949368696892/731396915052412958/unknown.png
46+
<Hitaxas> There is also a glitch where Flex will sometimes destroy mappings when saving. Unsure the cause, but this has happened to me twice in the past month. https://cdn.discordapp.com/attachments/718373949368696892/731396915052412958/unknown.png
4747
==
4848

4949
21:10 <+Dick-Cord> <A​kumaYin> Being able to load and edit files without using the project setup would be nice. That's one of the few things that I prefer about the original Flex, along with the ability to preview animations.
5050
do animations as a new tab - animation editor - load one at a time and FE changes the current index
5151
animation: play, pause
52-
document how to use project files
53-
54-
use 'sonic'; as custom mapping directive
5552

5653
art offset loading / arbitrary data loader tab
57-
firebase for stats
58-
http://sonicresearch.org/community/index.php?threads/flex-2.5177/#post-78014
59-
17:27:19 <%MainMemory> do you think you could add an option to export a sprite sheet in the future?
60-
17:28:38 <%MainMemory> as much as I like people using my programs, it would be more convenient if they didn't have to set up a separate project file just to use SpriteSheetGen
61-
17:17:46 <%MainMemory> I think you'll have to change the definition format
62-
17:18:01 <%snkenjoi> why
63-
17:19:20 <%snkenjoi> I just needs extending if anything
64-
17:19:34 <%MainMemory> well I consider that a change to the format
65-
17:20:19 <%snkenjoi> well yeah, it is
66-
17:20:36 <%MainMemory> S1 and S2 DPLC header is number of requests, S3K non-player DPLC header is number of requests minus one
67-
17:20:47 <%snkenjoi> I think it already supports N-1 and N
68-
17:20:52 <%snkenjoi> you just need to use a different letter
69-
17:22:01 <%MainMemory> I'm talking about headerSize(2)
70-
17:22:54 <%MainMemory> you need to be able to add one when reading and subtract one when writing
71-
17:23:04 <%snkenjoi> ah, to the header
72-
17:23:08 <%MainMemory> instead of just writing the entry count as-is
73-
17:23:17 <%snkenjoi> header(2, -1) would work
74-
17:23:23 <%snkenjoi> I mean
75-
17:23:25 <%snkenjoi> not atm
76-
17:23:29 <%snkenjoi> when I support it
77-
17:23:29 <%snkenjoi> lol
78-
17:23:35 <%MainMemory> sure
79-
17:23:43 <%snkenjoi> or headerMutation(-1)
80-
17:23:48 <%snkenjoi> as an addition
81-
17:24:20 <%MainMemory> and the rest is just swapping the order of the N and A lines
82-
17:24:28 <%snkenjoi> yeah which it already supports
83-
84-
17:47:50 <MainMemory> if you're interested, you can set a webhook in the repository settings with a URL like http://mmbot.reimuhakurei.net/github?key=secrethackingtools&network=BadnikZONE&channel=%23SSRG

app/formats/scripts/index.js

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,48 @@
1+
// script language
2+
13
// padding / fill
24
// optimizations(false);
35
// loadASM();
6+
// mappingHeader -> index 0
7+
// reverse endianness
8+
// end tokens
49

510
// ASM & BIN read / write
611

12+
// new Function('Flex2', script)({ read, write });
13+
// odd numbers of bits -
14+
// offset table built on other primitives (or default params)
15+
// assert everything on sprite is correcr
16+
// when write is a value of bigger than max safe int, or read value could be bbigger
17+
// read a byte at a time always
18+
19+
// asm read/write
20+
21+
// ASM parser: just read data, ignore everything else
22+
// use arcsecond or remove it
23+
24+
// UI
25+
26+
// file menu
27+
// remove acdeditor
728
// purple warning: arbitrary code - warning before yes
829
// derive UI from script - make dplcs still optional
9-
// assert everything on sprite is correcr
10-
// can read offset table
30+
31+
// other
32+
1133
// need an external scrtipts folder copied to the root on bundle
12-
// new Function('Flex2', script)({ read, write });
13-
// when write is a value of bigger than max safe int
14-
//
15-
// read a byte at a time always
16-
//
17-
// cystom screen
18-
//
19-
// ; sonic 1 mapping
20-
// (offset-table dc.b)
21-
// (mapping TTTTTTTT 0000 WW HH P CC Y X AAAAAAAAAAA LLLLLLLL)
22-
23-
// ; sonic 2 mapping
24-
25-
// ; sonic 1 dplc
26-
// (offset-table db.b)
27-
// (dplc-header LLLL)
28-
// (dplc NNNN AAAA AAAA AAAA)
29-
30-
// ; sonic 2/3&k dplc
31-
// (offset-table dc.w)
32-
// (dplc-header LLLLLLLL)
33-
// (dplc NNNN AAAA AAAA AAAA)
34-
35-
// ; sonic 2/3&k non-player dplc
36-
// (offset-table dc.w)
37-
// (dplc-header (sub #1 LLLL))
38-
// (dplc AAAA AAAA AAAA NNNN)
39-
//
40-
// TODO
34+
// example: HUD graphics
35+
36+
// formats to support
37+
4138
// kid chameleon
4239
// crackers
4340
// chaotix
44-
// github issues
45-
//
46-
// example: HUD graphics
41+
// plane mappings / snap to
4742
// s2 special stages
43+
// github issues
44+
45+
//unsigned int a = 0xABCDEF23;
46+
// a = ((a&(0x0000FFFF)) << 16) | ((a&(0xFFFF0000)) >> 16);
47+
// a = ((a&(0x00FF00FF)) << 8) | ((a&(0xFF00FF00)) >>8);
48+
// printf("%0x\n",a);

scripts/sonic1.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flex2 mapping definition - sonic 1 object sprites
1+
// Flex2 Mapping Definition
22

33
const {
44
info,
@@ -12,14 +12,10 @@ const {
1212
} = Flex2;
1313

1414
label('Sonic 1');
15-
info();
16-
offsetTable(dc.w);
17-
mappingHeader(
18-
(_mappings) => read(dc.b),
19-
(mappings) => write(dc.b, mappings.length),
20-
);
15+
offsetTable(dc.w, 'mappings');
2116
mappings(
22-
(mapping) => {
17+
(mapping, i) => {
18+
if (i === 0) read(dc.b);
2319
mapping.top = read(dc.b);
2420
read(nybble);
2521
mapping.width = read(2) + 1;
@@ -29,9 +25,10 @@ mappings(
2925
mapping.yflip = read(1);
3026
mapping.xflip = read(1);
3127
mapping.offset = read(11);
32-
mapping.left = read(dc.w);
28+
mapping.left = read(dc.b);
3329
},
34-
(mapping) => {
30+
(mapping, i) => {
31+
if (i === 0) write(dc.b, mapping.parent.length);
3532
write(dc.b, mapping.top);
3633
write(nybble, 0);
3734
write(2, mapping.width - 1);
@@ -41,19 +38,18 @@ mappings(
4138
write(1, mapping.yflip);
4239
write(1, mapping.xflip);
4340
write(11, mapping.offset);
44-
write(dc.w, mapping.left);
41+
write(dc.b, mapping.left);
4542
},
4643
);
47-
dplcHeader(
48-
(_dplcs) => read(dc.b),
49-
(dplcs) => write(dc.b, dplcs.length),
50-
);
44+
offsetTable(dc.w, 'dplcs');
5145
dplcs(
52-
(dplc) => {
46+
(dplc, i) => {
47+
if (i === 0) read(dc.b);
5348
dplc.size = read(nybble);
5449
dplc.offset = read(nybble * 3);
5550
},
56-
(dplc) => {
51+
(dplc, i) => {
52+
if (i === 0) write(dc.b, dplc.parent.length);
5753
write(nybble, dplc.size);
5854
write(nybblr * 3, dplc.offset);
5955
},

scripts/sonic2.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const {
1313
} = Flex2;
1414

1515
label('Sonic 2');
16-
info();
1716
offsetTable(dc.w);
1817
mappingHeader(
1918
(_mappings) => read(dc.w),
@@ -31,7 +30,7 @@ mappings(
3130
mapping.xflip = read(1);
3231
mapping.offset = read(1);
3332
read(dc.w);
34-
mapping.left = read(dc.l);
33+
mapping.left = read(dc.w);
3534
},
3635
(mapping) => {
3736
// top

scripts/sonic3k-objects.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Flex2 mapping definition
2+
3+
const {
4+
label,
5+
info,
6+
offsetTable,
7+
mapping,
8+
mappingHeader,
9+
write,
10+
read,
11+
nybble,
12+
dc,
13+
} = Flex2;
14+
15+
label('Sonic 3&K Objects');
16+
offsetTable(dc.w);
17+
mappingHeader(
18+
(_mappings) => read(dc.w),
19+
(mappings) => write(dc.w, mappings.length),
20+
);
21+
mappings(
22+
(mapping) => {
23+
mapping.top = read(dc.b);
24+
read(nybble);
25+
mapping.width = read(2) + 1;
26+
mapping.height = read(2) + 1;
27+
mapping.priority = read(1);
28+
mapping.palette = read(2);
29+
mapping.yflip = read(1);
30+
mapping.xflip = read(1);
31+
mapping.offset = read(1);
32+
mapping.left = read(dc.w);
33+
},
34+
(mapping) => {
35+
// top
36+
write(dc.b, mapping.top);
37+
write(nybble, 0);
38+
// size
39+
write(2, mapping.width - 1);
40+
write(2, mapping.height - 1);
41+
// 1 player
42+
write(1, mapping.priority);
43+
write(2, mapping.palette);
44+
write(1, mapping.yflip);
45+
write(1, mapping.xflip);
46+
write(11, mapping.offset);
47+
// left
48+
write(dc.w, mapping.left);
49+
},
50+
);
51+
dplcHeader(
52+
(_dplcs) => read(dc.w),
53+
(dplcs) => write(dc.w, dplcs.length - 1),
54+
);
55+
dplcs(
56+
(dplc) => {
57+
dplc.offset = read(nybble * 3);
58+
dplc.size = read(nybble);
59+
},
60+
(dplc) => {
61+
write(nybblr * 3, dplc.offset);
62+
write(nybble, dplc.size);
63+
},
64+
);
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ const {
1212
dc,
1313
} = Flex2;
1414

15-
label('Sonic 3&K');
16-
info();
15+
label('Sonic 3&K Player');
1716
offsetTable(dc.w);
1817
mappingHeader(
1918
(_mappings) => read(dc.w),
@@ -30,7 +29,7 @@ mappings(
3029
mapping.yflip = read(1);
3130
mapping.xflip = read(1);
3231
mapping.offset = read(1);
33-
mapping.left = read(dc.l);
32+
mapping.left = read(dc.w);
3433
},
3534
(mapping) => {
3635
// top

scripts/soniccd.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const {
1313
} = Flex2;
1414

1515
label('Sonic CD');
16-
info();
1716
offsetTable(dc.w);
1817
mappingHeader(
1918
(_mappings) => read(dc.b),
@@ -30,7 +29,7 @@ mappings(
3029
mapping.yflip = read(1);
3130
mapping.xflip = read(1);
3231
mapping.offset = read(1);
33-
mapping.left = read(dc.l);
32+
mapping.left = read(dc.b);
3433
},
3534
(mapping) => {
3635
// top
@@ -46,7 +45,7 @@ mappings(
4645
write(1, mapping.xflip);
4746
write(11, mapping.offset);
4847
// left
49-
write(dc.w, mapping.left);
48+
write(dc.b, mapping.left);
5049
},
5150
);
5251
dplcHeader(

0 commit comments

Comments
 (0)