Final clean up

This commit is contained in:
Lucas Scharenbroich 2022-08-27 19:51:31 -05:00
parent 0b31e9ead2
commit 33da3d4a97
5 changed files with 6138 additions and 1876 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 B

After

Width:  |  Height:  |  Size: 847 B

View File

@ -8,13 +8,17 @@
"cadius": "C:\\Programs\\IIgsXDev\\bin\\Cadius.exe", "cadius": "C:\\Programs\\IIgsXDev\\bin\\Cadius.exe",
"gsport": "C:\\Programs\\gsport\\gsport_0.31\\GSPort.exe", "gsport": "C:\\Programs\\gsport\\gsport_0.31\\GSPort.exe",
"macros": "../../macros", "macros": "../../macros",
"crossrunner": "C:\\Programs\\Crossrunner\\Crossrunner.exe" "crossrunner": "C:\\Programs\\Crossrunner\\Crossrunner.exe",
"png2iigs": "../../tools/png2iigs.js"
}, },
"scripts": { "scripts": {
"gsport": "%npm_package_config_gsport%", "gsport": "%npm_package_config_gsport%",
"test": "npm run build && build-image.bat %npm_package_config_cadius% && %npm_package_config_gsport%", "test:all": "npm run build && npm run build:image && %npm_package_config_gsport%",
"build": "npm run build:tool && npm run build:sys16", "build": "npm run build:tool && npm run build:sys16",
"build:sys16": "iix compile tileData.c test.c && iix -DKeepType=S16 link test tileData keep=App", "test": "npm run build:sys16 && npm run build:image && %npm_package_config_gsport%",
"build:image": "build-image.bat %npm_package_config_cadius%",
"build:sys16": "iix compile foo.c test.c && iix -DKeepType=S16 link test foo keep=App",
"build:tiles": "node %npm_package_config_png2iigs% ./assets/tileset.png --format orcac --max-tiles 160 --as-tile-data --verbose > tileData.c",
"build:tool": "%npm_package_config_merlin32% -V %npm_package_config_macros% ../../src/Master.s", "build:tool": "%npm_package_config_merlin32% -V %npm_package_config_macros% ../../src/Master.s",
"debug": "%npm_package_config_crossrunner% ./App -Debug -CompatibilityLayer" "debug": "%npm_package_config_crossrunner% ./App -Debug -CompatibilityLayer"
} }

View File

@ -79,13 +79,13 @@ void main(void) {
/* GTESetScreenMode(160, 200); /* 160x200 is the default screen mode */ /* GTESetScreenMode(160, 200); /* 160x200 is the default screen mode */
GTESetPalette(0, (Pointer)tilesPalette); GTESetPalette(0, (Pointer)tilesPalette);
GTELoadTileSet(0, 50, tiles); /* Load in 50 tiles */ GTELoadTileSet(0, 160, tiles); /* Load in the tiles */
GTEFillTileStore(1); GTEFillTileStore(1);
GTERender(0); GTERender(0);
for (a = 3; a < 18; a++) { for (a = 3; a < 18; a++) {
GTESetTile(5, a, a); GTESetTile(a, a, 5);
} }
GTESetTile(1, 0, 34); GTESetTile(1, 0, 34);
GTESetTile(2, 0, 33); GTESetTile(2, 0, 33);
@ -96,7 +96,7 @@ void main(void) {
for (b = 4; b < 6; b++) { for (b = 4; b < 6; b++) {
for (a = 1; a < 10; a++) { for (a = 1; a < 10; a++) {
GTESetBG0Origin(a, b); GTESetBG0Origin(a, b);
tileId = (((b - 1) * 10) + a) | TILE_SOLID_BIT | TILE_HFLIP_BIT; tileId = (((b - 1) * 32) + a) | TILE_SOLID_BIT | TILE_HFLIP_BIT;
GTESetTile(a, b, tileId); GTESetTile(a, b, tileId);
GTERender(0); GTERender(0);
} }

File diff suppressed because it is too large Load Diff

View File

@ -319,7 +319,7 @@ function reverse(str) {
} }
function toHex(h) { function toHex(h) {
return h.toString(16).padStart(2, '0'); return h.toString(16).padStart(2, '0').toUpperCase();
} }
function swap(hex) { function swap(hex) {
@ -463,9 +463,10 @@ function writeTileToStream(stream, data) {
function writeTileToStreamORCAC(stream, data) { function writeTileToStreamORCAC(stream, data) {
// Output the tile data // Output the tile data
for (const row of data) { for (const row of data) {
const hex = row.map(d => toHex(d)).join(''); const hex = row.map(d => '0x' + toHex(d)).join(', ');
stream.write(' 0x' + hex + ',\n'); stream.write(' ' + hex + ',\n');
} }
stream.write('\n');
} }
function writeTilesToStream(options, stream, tiles, label='tiledata') { function writeTilesToStream(options, stream, tiles, label='tiledata') {
@ -484,12 +485,14 @@ function writeTilesToStream(options, stream, tiles, label='tiledata') {
} }
function writeTilesToStreamORCAC(options, stream, tiles, label='tiledata') { function writeTilesToStreamORCAC(options, stream, tiles, label='tiledata') {
stream.write(`long ${options.varName}[] = {\n`); stream.write(`Byte ${options.varName}[] = {\n`);
stream.write('/* Reserved space (tile 0 is special...) */\n'); stream.write('/* Reserved space (tile 0 is special...) */\n');
for (let i = 0; i < 8; i += 1) { for (let j = 0; j < 4; j += 1) {
stream.write(' 0x00000000L,0x00000000L,0x00000000L,0x00000000L,\n'); for (let i = 0; i < 8; i += 1) {
stream.write(' 0x00, 0x00, 0x00, 0x00,\n');
}
stream.write('\n');
} }
stream.write('\n');
let count = 0; let count = 0;
for (const tile of tiles.slice(0, options.maxTiles)) { for (const tile of tiles.slice(0, options.maxTiles)) {