Committing progres

This commit is contained in:
2022-01-06 09:22:49 -08:00
parent f339ce0713
commit 4ad29e981e
15 changed files with 74 additions and 320 deletions

View File

@@ -11,6 +11,9 @@ const DIR_GENERATED = path.resolve(DIR_BUILD, 'generated');
const DIR_OBJ = path.resolve(DIR_BUILD, 'obj');
const DIR_SRC = path.resolve('src');
const DIR_GBDK = path.resolve(process.env['GBDKDIR']);
const DIR_ASSETS = path.resolve('assets');
const DIR_IMAGES = path.resolve(DIR_ASSETS, 'images');
const FILE_OUT = path.resolve(DIR_BUILD, 'Penny.gb');
const FILE_LINKFILE = path.join(DIR_BUILD, `linkflile.lk`);
@@ -85,15 +88,21 @@ Object.entries(GAME_STRINGS).forEach(entry => {
compileC(fileC);
})
// Gen imagery
fs.readdirSync(DIR_IMAGES).forEach(img => {
const { fileC, fileH } = png2gb(
path.join(DIR_IMAGES, img), DIR_GENERATED,
path.basename(img, '.png').toUpperCase()
);
compileC(fileC);
})
// Get a list of sources and build each of them prior to linking.
const allSources = buildSourceFiles(DIR_SRC);
for(let i = 0; i < allSources.length; i++) {
compileC(allSources[i]);
}
// Gen imagery
// Generate a linkfile.
fs.writeFileSync(FILE_LINKFILE, compiledSources.map(cs=>{
return path.join(DIR_OBJ, cs);