Skip to content

Commit ffc9f3d

Browse files
committed
improving s3k support
1 parent 19f5e9e commit ffc9f3d

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

TODO

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ post image of project / some custom mappings, saying it's ready for testing
1010
BUFFER
1111
==
1212

13-
// save mappings
14-
// s3k snowboard
15-
1613
// rawBytes()
1714
// art ffset save message / input size
1815
// copy to project

app/components/file/file-object.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { workspace } from '#store/workspace';
1616
import ErrorMsg from './error';
1717
import SaveLoad from './save-load';
1818
import { promises } from 'fs';
19-
import { basename, extname } from 'path';
19+
import { extname } from 'path';
2020

2121
const fs = promises;
2222
const compressionList = Object.keys(compressionFormats);
@@ -106,10 +106,9 @@ export const FileObject = observer(({ obj }) => {
106106
obj.dplcs.enabled &&
107107
environment.dplcs.length < mappings.sprites.length
108108
) {
109-
const qty = mappings.sprites.length - environment.dplcs.length;
110-
for (let i = 0; i < qty; i++) {
111-
environment.dplcs.push([]);
112-
}
109+
environment.dplcs.push(...Array.from({
110+
length: mappings.sprites.length - environment.dplcs.length,
111+
}, () => []));
113112
}
114113
});
115114
}
@@ -122,7 +121,7 @@ export const FileObject = observer(({ obj }) => {
122121
await fs.writeFile(path, writeBIN(mappings));
123122
} else {
124123
const label =
125-
obj.mappings.label || basename(obj.mappings.path, '.asm');
124+
obj.mappings.label || 'Mappings';
126125
await fs.writeFile(path, writeASM(label, mappings));
127126
}
128127
});
@@ -151,7 +150,7 @@ export const FileObject = observer(({ obj }) => {
151150
await fs.writeFile(path, writeBIN(dplcs));
152151
} else {
153152
const label =
154-
obj.dplcs.label || basename(obj.dplcs.path, '.asm');
153+
obj.dplcs.label || 'DPLCS';
155154
await fs.writeFile(path, writeASM(label, dplcs));
156155
}
157156
});

0 commit comments

Comments
 (0)