__lastrepo_xxx variable goes back to repo for each platform

This commit is contained in:
Steven Hugg 2019-08-10 11:11:22 -04:00
parent 40f24233b1
commit f06d338091
4 changed files with 16 additions and 13 deletions

View File

@ -175,6 +175,7 @@ TODO:
- popup
- convert binary to hex stmts
- "suggestions" (vblank overrun, variable # scanlines, etc)
- spinner doesn't always spin on sms
WEB WORKER FORMAT

View File

@ -109,12 +109,12 @@ function getCurrentPresetTitle() : string {
function setLastPreset(id:string) {
if (hasLocalStorage) {
if (repo_id)
localStorage.setItem("__lastrepo", repo_id);
if (repo_id && platform_id)
localStorage.setItem("__lastrepo_" + platform_id, repo_id);
else
localStorage.removeItem("__lastrepo");
localStorage.removeItem("__lastrepo_" + platform_id);
localStorage.setItem("__lastplatform", platform_id);
localStorage.setItem("__lastid_"+store_id, id);
localStorage.setItem("__lastid_" + store_id, id);
}
}
@ -1836,8 +1836,13 @@ export function startUI(loadplatform : boolean) {
importProjectFromGithub(qs['githubURL'], true);
return;
}
// add default platform?
platform_id = qs['platform'] || (hasLocalStorage && localStorage.getItem("__lastplatform"));
if (!platform_id) {
platform_id = qs['platform'] = "vcs";
}
// lookup repository
repo_id = qs['repo']; // TODO? || (hasLocalStorage && localStorage.getItem("__lastrepo"));
repo_id = qs['repo'] || (hasLocalStorage && localStorage.getItem("__lastrepo_" + platform_id));
if (hasLocalStorage && repo_id && repo_id !== '/') {
var repo = getRepos()[repo_id];
if (repo) {
@ -1845,17 +1850,13 @@ export function startUI(loadplatform : boolean) {
if (!qs['file'])
qs['file'] = repo.mainPath;
if (!qs['platform'])
qs['platform'] = repo.platform_id;
qs['platform'] = platform_id = repo.platform_id;
}
} else {
repo_id = '';
delete qs['repo'];
}
// add default platform?
platform_id = qs['platform'] || (hasLocalStorage && localStorage.getItem("__lastplatform"));
if (!platform_id) {
platform_id = qs['platform'] = "vcs";
}
// update UI
$("#item_platform_"+platform_id).addClass("dropdown-item-checked");
$("#platform_name").text(platform_id);
setupSplits();

View File

@ -721,7 +721,7 @@ export class SMSVDP extends TMS9918A {
if (this.writeToCRAM) {
var palindex = this.addressRegister++ & (this.cram.length-1);
this.cram[palindex] = i;
this.cpalette[palindex] = RGBA((i&3)<<6, ((i>>2)&3)<<6, ((i>>4)&3)<<6);
this.cpalette[palindex] = RGBA((i&3)*85, ((i>>2)&3)*85, ((i>>4)&3)*85);
this.prefetchByte = i;
this.addressRegister &= this.ramMask;
this.redrawRequired = true;

View File

@ -1296,11 +1296,12 @@ function linkSDLDZ80(step:BuildStep)
// return unchanged if no files changed
if (!anyTargetChanged(step, ["main.ihx", "main.noi"]))
return;
// parse binary file
var binout = parseIHX(hexout, params.rom_start!==undefined?params.rom_start:params.code_start, params.rom_size, errors);
if (errors.length) {
return {errors:errors};
}
// parse listings
var listings = {};
for (var fn of step.files) {
if (fn.endsWith('.lst')) {