mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-06-07 17:29:31 +00:00
ecs: temp symbols, not equates
This commit is contained in:
parent
75f36d95dc
commit
b4dbcb83eb
|
@ -386,14 +386,17 @@ class DataSegment {
|
||||||
let ofs = this.symbols[name];
|
let ofs = this.symbols[name];
|
||||||
if (ofs == null) {
|
if (ofs == null) {
|
||||||
ofs = this.size;
|
ofs = this.size;
|
||||||
this.symbols[name] = ofs;
|
this.declareSymbol(name, ofs);
|
||||||
if (!this.ofs2sym.has(ofs))
|
|
||||||
this.ofs2sym.set(ofs, []);
|
|
||||||
this.ofs2sym.get(ofs)?.push(name);
|
|
||||||
this.size += bytes;
|
this.size += bytes;
|
||||||
}
|
}
|
||||||
return ofs;
|
return ofs;
|
||||||
}
|
}
|
||||||
|
declareSymbol(name: string, ofs: number) {
|
||||||
|
this.symbols[name] = ofs;
|
||||||
|
if (!this.ofs2sym.has(ofs))
|
||||||
|
this.ofs2sym.set(ofs, []);
|
||||||
|
this.ofs2sym.get(ofs)?.push(name);
|
||||||
|
}
|
||||||
// TODO: optimize shared data
|
// TODO: optimize shared data
|
||||||
allocateInitData(name: string, bytes: Uint8Array) {
|
allocateInitData(name: string, bytes: Uint8Array) {
|
||||||
let ofs = this.allocateBytes(name, bytes.length);
|
let ofs = this.allocateBytes(name, bytes.length);
|
||||||
|
@ -1311,11 +1314,12 @@ export class EntityScope implements SourceLocated {
|
||||||
if (!pack.pack()) console.log('cannot pack temporary local vars'); // TODO
|
if (!pack.pack()) console.log('cannot pack temporary local vars'); // TODO
|
||||||
//console.log('tempvars', pack);
|
//console.log('tempvars', pack);
|
||||||
if (bssbin.extents.right > 0) {
|
if (bssbin.extents.right > 0) {
|
||||||
this.bss.allocateBytes('TEMP', bssbin.extents.right);
|
let tempofs = this.bss.allocateBytes('TEMP', bssbin.extents.right);
|
||||||
for (let b of pack.boxes) {
|
for (let b of pack.boxes) {
|
||||||
let inst : SystemInstance = (b as any).inst;
|
let inst : SystemInstance = (b as any).inst;
|
||||||
//console.log(inst.system.name, b.box?.left);
|
//console.log(inst.system.name, b.box?.left);
|
||||||
this.bss.equates[this.dialect.tempLabel(inst)] = `TEMP+${b.box?.left}`;
|
if (b.box) this.bss.declareSymbol(this.dialect.tempLabel(inst), tempofs + b.box.left);
|
||||||
|
//this.bss.equates[this.dialect.tempLabel(inst)] = `TEMP+${b.box?.left}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ BCDScore2_digits_b0:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
TEMP:
|
TEMP:
|
||||||
|
Kernel6Digit__2__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
|
@ -31,11 +32,10 @@ TEMP:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
|
Kernel2Digit__4__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
Kernel6Digit__2__tmp = TEMP+0
|
|
||||||
Kernel2Digit__4__tmp = TEMP+15
|
|
||||||
.code
|
.code
|
||||||
Main__INITDATA:
|
Main__INITDATA:
|
||||||
.byte 86
|
.byte 86
|
||||||
|
|
|
@ -26,6 +26,13 @@ SpriteSlot_sprite_b0:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
TEMP:
|
TEMP:
|
||||||
|
Kernel2Sprite__2__tmp:
|
||||||
|
Joystick__3__tmp:
|
||||||
|
.res 1
|
||||||
|
SpriteShuffler__8__tmp:
|
||||||
|
.res 1
|
||||||
|
.res 1
|
||||||
|
SpriteHider__9__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
|
@ -36,13 +43,6 @@ TEMP:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
|
||||||
.res 1
|
|
||||||
.res 1
|
|
||||||
Kernel2Sprite__2__tmp = TEMP+0
|
|
||||||
Joystick__3__tmp = TEMP+0
|
|
||||||
SpriteShuffler__8__tmp = TEMP+1
|
|
||||||
SpriteHider__9__tmp = TEMP+3
|
|
||||||
.code
|
.code
|
||||||
KernelSection_lines_b0:
|
KernelSection_lines_b0:
|
||||||
.byte 192
|
.byte 192
|
||||||
|
|
|
@ -26,6 +26,13 @@ HasColormap_colormap_b0:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
TEMP:
|
TEMP:
|
||||||
|
Kernel2Sprite__2__tmp:
|
||||||
|
Joystick__3__tmp:
|
||||||
|
.res 1
|
||||||
|
SpriteShuffler__8__tmp:
|
||||||
|
.res 1
|
||||||
|
.res 1
|
||||||
|
SpriteHider__9__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
|
@ -36,13 +43,6 @@ TEMP:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
|
||||||
.res 1
|
|
||||||
.res 1
|
|
||||||
Kernel2Sprite__2__tmp = TEMP+0
|
|
||||||
Joystick__3__tmp = TEMP+0
|
|
||||||
SpriteShuffler__8__tmp = TEMP+1
|
|
||||||
SpriteHider__9__tmp = TEMP+3
|
|
||||||
.code
|
.code
|
||||||
KernelSection_lines_b0:
|
KernelSection_lines_b0:
|
||||||
.byte 192
|
.byte 192
|
||||||
|
|
|
@ -28,6 +28,8 @@ Room_gfx_b0:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
TEMP:
|
TEMP:
|
||||||
|
Kernel2Sprite__2__tmp:
|
||||||
|
Joystick__3__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
|
@ -41,11 +43,9 @@ TEMP:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
|
VersatilePlayfield__10__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
Kernel2Sprite__2__tmp = TEMP+0
|
|
||||||
Joystick__3__tmp = TEMP+0
|
|
||||||
VersatilePlayfield__10__tmp = TEMP+13
|
|
||||||
.code
|
.code
|
||||||
KernelSection_lines_b0:
|
KernelSection_lines_b0:
|
||||||
.byte 192
|
.byte 192
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
.scope Main
|
.scope Main
|
||||||
.zeropage
|
.zeropage
|
||||||
TEMP:
|
TEMP:
|
||||||
|
Kernel48Pixel__2__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
Kernel48Pixel__2__tmp = TEMP+0
|
|
||||||
.code
|
.code
|
||||||
KernelSection_lines_b0:
|
KernelSection_lines_b0:
|
||||||
.byte 10
|
.byte 10
|
||||||
|
|
|
@ -4,8 +4,8 @@ PFColor_pfcolor_b0:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
TEMP:
|
TEMP:
|
||||||
|
Local__6__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
Local__6__tmp = TEMP+0
|
|
||||||
.code
|
.code
|
||||||
KernelSection_lines_b0:
|
KernelSection_lines_b0:
|
||||||
.byte 2
|
.byte 2
|
||||||
|
|
|
@ -4,8 +4,8 @@ PFColor_pfcolor_b0:
|
||||||
.res 1
|
.res 1
|
||||||
.res 1
|
.res 1
|
||||||
TEMP:
|
TEMP:
|
||||||
|
Local__6__tmp:
|
||||||
.res 1
|
.res 1
|
||||||
Local__6__tmp = TEMP+0
|
|
||||||
.code
|
.code
|
||||||
KernelSection_lines_b0:
|
KernelSection_lines_b0:
|
||||||
.byte 2
|
.byte 2
|
||||||
|
|
Loading…
Reference in New Issue
Block a user