mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 11:12:07 +00:00
Get rid of asm.h and localasm.h
No need to make them global
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asm/asm.h"
|
||||
#include "asm/charmap.h"
|
||||
#include "asm/main.h"
|
||||
#include "asm/output.h"
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "asm/warning.h"
|
||||
#include "platform.h" /* S_ISDIR (stat macro) */
|
||||
|
||||
#define MAXINCPATHS 128
|
||||
|
||||
#ifdef LEXER_DEBUG
|
||||
#define dbgPrint(...) fprintf(stderr, "[lexer] " __VA_ARGS__)
|
||||
#else
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "extern/utf8decoder.h"
|
||||
#include "platform.h" /* For `ssize_t` */
|
||||
|
||||
#include "asm/asm.h"
|
||||
#include "asm/lexer.h"
|
||||
#include "asm/format.h"
|
||||
#include "asm/fstack.h"
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asm/asm.h"
|
||||
#include "asm/macro.h"
|
||||
#include "asm/warning.h"
|
||||
|
||||
#define MAXMACROARGS 99999
|
||||
|
||||
/*
|
||||
* Your average macro invocation does not go past the tens, but some go further
|
||||
* This ensures that sane and slightly insane invocations suffer no penalties,
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asm/asm.h"
|
||||
#include "asm/charmap.h"
|
||||
#include "asm/fstack.h"
|
||||
#include "asm/main.h"
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asm/asm.h"
|
||||
#include "asm/charmap.h"
|
||||
#include "asm/format.h"
|
||||
#include "asm/fstack.h"
|
||||
@@ -354,6 +353,41 @@ void yyerror(char const *str)
|
||||
free(buf);
|
||||
}
|
||||
|
||||
// The CPU encodes instructions in a logical way, so most instructions actually follow patterns.
|
||||
// These enums thus help with bit twiddling to compute opcodes
|
||||
enum {
|
||||
REG_B = 0,
|
||||
REG_C,
|
||||
REG_D,
|
||||
REG_E,
|
||||
REG_H,
|
||||
REG_L,
|
||||
REG_HL_IND,
|
||||
REG_A
|
||||
};
|
||||
|
||||
enum {
|
||||
REG_BC_IND = 0,
|
||||
REG_DE_IND,
|
||||
REG_HL_INDINC,
|
||||
REG_HL_INDDEC,
|
||||
};
|
||||
|
||||
enum {
|
||||
REG_BC = 0,
|
||||
REG_DE = 1,
|
||||
REG_HL = 2,
|
||||
REG_SP = 3,
|
||||
REG_AF = 3
|
||||
};
|
||||
|
||||
enum {
|
||||
CC_NZ = 0,
|
||||
CC_Z,
|
||||
CC_NC,
|
||||
CC_C
|
||||
};
|
||||
|
||||
%}
|
||||
|
||||
%union
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asm/asm.h"
|
||||
#include "asm/main.h"
|
||||
#include "asm/output.h"
|
||||
#include "asm/rpn.h"
|
||||
#include "asm/section.h"
|
||||
#include "asm/symbol.h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "asm/output.h"
|
||||
#include "asm/rpn.h"
|
||||
#include "asm/section.h"
|
||||
#include "asm/symbol.h"
|
||||
#include "asm/warning.h"
|
||||
|
||||
#include "extern/err.h"
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "asm/asm.h"
|
||||
#include "asm/fstack.h"
|
||||
#include "asm/macro.h"
|
||||
#include "asm/main.h"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asm/fstack.h"
|
||||
|
||||
Reference in New Issue
Block a user