Skip to content

Commit

Permalink
delete numopcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
randomdude999 committed Jan 22, 2024
1 parent 22d283c commit cc48974
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions src/asar/arch-65816.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "asar_math.h"

#define write1 write1_pick
extern int recent_opcode_num;

void asinit_65816()
{
Expand Down Expand Up @@ -238,7 +237,6 @@ void thenext8(insn_context& arg) {
int64_t rep_count = getnum(parsed_str);
if(foundlabel) asar_throw_error(0, error_type_block, error_id_no_labels_here);
for (int64_t i=0;i<rep_count;i++) { write1(accum_opc); }
recent_opcode_num = accum_opc;
return;
}
if(kind == K::a || kind == K::imp) {
Expand Down Expand Up @@ -327,7 +325,6 @@ void implied_rep(insn_context& arg) {
int64_t rep_count = getnum(parse_result.second);
if(foundlabel) asar_throw_error(0, error_type_block, error_id_no_labels_here);
for (int64_t i=0;i<rep_count;i++) { write1(opc); }
recent_opcode_num = rep_count;
}
}

Expand Down
8 changes: 0 additions & 8 deletions src/asar/assembleblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,13 @@ inline void write1_65816(unsigned int num)
ratsmetastate=ratsmeta_ban;
}

int recent_opcode_num = 0;

void write1_pick(unsigned int num)
{
write1_65816(num);
}

static bool asblock_pick(char** word, int numwords)
{
recent_opcode_num = 1;

if (arch==arch_spc700 || in_spcblock) return asblock_spc700(word, numwords);
if (arch==arch_65816) return asblock_65816(word, numwords);
if (arch==arch_superfx) return asblock_superfx(word, numwords);
Expand Down Expand Up @@ -630,8 +626,6 @@ static void freespaceend()
freespaceid = 0;
}

int numopcodes;

static void adddefine(const string & key, string & value)
{
if (!defines.exists(key)) defines.create(key) = value;
Expand Down Expand Up @@ -679,7 +673,6 @@ void initstuff()
realstartpos= (int)0xFFFFFFFF;
freespaceidnext=1;
freespaceid=0;
numopcodes=0;
incsrcdepth = 0;

optimizeforbank = -1;
Expand Down Expand Up @@ -1203,7 +1196,6 @@ void assembleblock(const char * block, int& single_line_for_tracker)
else if (asblock_pick(word, numwords))
{
add_addr_to_line(addrToLinePos);
numopcodes += recent_opcode_num;
}
else if (numwords > 1 && (is("db") || is("dw") || is("dl") || is("dd")))
{
Expand Down
2 changes: 0 additions & 2 deletions src/asar/assembleblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ extern int realstartpos;

extern int bytes;

extern int numopcodes;

extern int numif;
extern int numtrue;

Expand Down
1 change: 0 additions & 1 deletion src/asar/interface-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ EXPORT const struct labeldata * asar_getalllabels(int * count)
*/
EXPORT int asar_getlabelval(const char * name)
{
if (!stricmp(name, ":$:opcodes:$:")) return numopcodes;//aaah, you found me
int i;
try {
i=(int)labelval(&name).pos;
Expand Down

0 comments on commit cc48974

Please sign in to comment.