Do no display unused macros anymore
This commit is contained in:
parent
08f20d35c8
commit
83de614e53
|
@ -31,10 +31,10 @@ contexts:
|
||||||
scope: entity.name.type.typedef
|
scope: entity.name.type.typedef
|
||||||
pop: true
|
pop: true
|
||||||
- match: '\;(\S+)\sLDA2'
|
- match: '\;(\S+)\sLDA2'
|
||||||
scope: constant.numeric
|
scope: entity.name.type.typedef
|
||||||
pop: true
|
pop: true
|
||||||
- match: '\;(\S+)\sLDA'
|
- match: '\;(\S+)\sLDA'
|
||||||
scope: constant.numeric
|
scope: entity.name.type.typedef
|
||||||
pop: true
|
pop: true
|
||||||
# set
|
# set
|
||||||
- match: '\.(\S+)\sDEO2'
|
- match: '\.(\S+)\sDEO2'
|
||||||
|
@ -56,10 +56,10 @@ contexts:
|
||||||
scope: constant.numeric
|
scope: constant.numeric
|
||||||
pop: true
|
pop: true
|
||||||
- match: '\;(\S+)\sSTA2'
|
- match: '\;(\S+)\sSTA2'
|
||||||
scope: entity.name.type.typedef
|
scope: constant.numeric
|
||||||
pop: true
|
pop: true
|
||||||
- match: '\;(\S+)\sSTA'
|
- match: '\;(\S+)\sSTA'
|
||||||
scope: entity.name.type.typedef
|
scope: constant.numeric
|
||||||
pop: true
|
pop: true
|
||||||
|
|
||||||
# label
|
# label
|
||||||
|
@ -70,6 +70,10 @@ contexts:
|
||||||
- match: '\&(\S+)\s?'
|
- match: '\&(\S+)\s?'
|
||||||
scope: string.control
|
scope: string.control
|
||||||
pop: true
|
pop: true
|
||||||
|
# include
|
||||||
|
- match: 'include'
|
||||||
|
scope: string.control
|
||||||
|
pop: true
|
||||||
|
|
||||||
# jump
|
# jump
|
||||||
- match: '\|(\S+)\s?'
|
- match: '\|(\S+)\s?'
|
||||||
|
|
|
@ -20,7 +20,6 @@ typedef unsigned short Uint16;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char name[64], items[256][64];
|
char name[64], items[256][64];
|
||||||
Uint8 len;
|
Uint8 len;
|
||||||
Uint16 refs;
|
|
||||||
} Macro;
|
} Macro;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -154,7 +153,7 @@ makemacro(char *name, FILE *f)
|
||||||
return error("Macro duplicate", name);
|
return error("Macro duplicate", name);
|
||||||
if(sihx(name) && slen(name) % 2 == 0)
|
if(sihx(name) && slen(name) % 2 == 0)
|
||||||
return error("Macro name is hex number", name);
|
return error("Macro name is hex number", name);
|
||||||
if(findopcode(name) || scmp(name, "BRK", 4) || !slen(name))
|
if(findopcode(name) || scmp(name, "BRK", 4) || !slen(name) || scmp(name,"include",8))
|
||||||
return error("Macro name is invalid", name);
|
return error("Macro name is invalid", name);
|
||||||
m = &p.macros[p.mlen++];
|
m = &p.macros[p.mlen++];
|
||||||
scpy(name, m->name, 64);
|
scpy(name, m->name, 64);
|
||||||
|
@ -280,7 +279,7 @@ parsetoken(char *w)
|
||||||
for(i = 0; i < m->len; ++i)
|
for(i = 0; i < m->len; ++i)
|
||||||
if(!parsetoken(m->items[i]))
|
if(!parsetoken(m->items[i]))
|
||||||
return error("Invalid macro", m->name);
|
return error("Invalid macro", m->name);
|
||||||
return ++m->refs;
|
return 1;
|
||||||
}
|
}
|
||||||
return error("Invalid token", w);
|
return error("Invalid token", w);
|
||||||
}
|
}
|
||||||
|
@ -380,9 +379,6 @@ cleanup(char *filename)
|
||||||
continue; /* Ignore capitalized labels(devices) */
|
continue; /* Ignore capitalized labels(devices) */
|
||||||
else if(!p.labels[i].refs)
|
else if(!p.labels[i].refs)
|
||||||
fprintf(stderr, "--- Unused label: %s\n", p.labels[i].name);
|
fprintf(stderr, "--- Unused label: %s\n", p.labels[i].name);
|
||||||
for(i = 0; i < p.mlen; ++i)
|
|
||||||
if(!p.macros[i].refs)
|
|
||||||
fprintf(stderr, "--- Unused macro: %s\n", p.macros[i].name);
|
|
||||||
printf("Assembled %s(%d bytes), %d labels, %d macros.\n", filename, (p.length - TRIM), p.llen, p.mlen);
|
printf("Assembled %s(%d bytes), %d labels, %d macros.\n", filename, (p.length - TRIM), p.llen, p.mlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,14 +112,7 @@ redraw(Uxn *u)
|
||||||
{
|
{
|
||||||
if(devsystem->dat[0xe])
|
if(devsystem->dat[0xe])
|
||||||
inspect(&ppu, u->wst.dat, u->wst.ptr, u->rst.ptr, u->ram.dat);
|
inspect(&ppu, u->wst.dat, u->wst.ptr, u->rst.ptr, u->ram.dat);
|
||||||
if(rgbaSurface == NULL)
|
|
||||||
SDL_BlitScaled(idxSurface, NULL, winSurface, &gRect);
|
|
||||||
else if(zoom == 1)
|
|
||||||
SDL_BlitSurface(idxSurface, NULL, winSurface, &gRect);
|
SDL_BlitSurface(idxSurface, NULL, winSurface, &gRect);
|
||||||
else {
|
|
||||||
SDL_BlitSurface(idxSurface, NULL, rgbaSurface, NULL);
|
|
||||||
SDL_BlitScaled(rgbaSurface, NULL, winSurface, &gRect);
|
|
||||||
}
|
|
||||||
SDL_UpdateWindowSurface(gWindow);
|
SDL_UpdateWindowSurface(gWindow);
|
||||||
reqdraw = 0;
|
reqdraw = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue