From cd779b951147c9b3c37e4d8201f736e8fba397ce Mon Sep 17 00:00:00 2001 From: Vegard Nossum Date: Thu, 11 Jun 2009 09:14:19 +0200 Subject: [PATCH] asm: moved includes to include/asm/ Signed-off-by: Vegard Nossum --- {src/asm/include => include/asm}/asm.h | 11 +- {src/asm/include => include/asm}/fstack.h | 10 +- {src/asm/include => include/asm}/lexer.h | 7 +- {src/asm/include => include/asm}/main.h | 4 +- {src/asm/include => include/asm}/mylink.h | 4 +- {src/asm/include => include/asm}/mymath.h | 6 +- {src/asm/include => include/asm}/output.h | 8 +- {src/asm/include => include/asm}/rpn.h | 4 +- {src/asm/include => include/asm}/symbol.h | 6 +- {src/asm/include => include/asm}/types.h | 4 +- src/asm/Makefile | 2 +- src/asm/fstack.c | 11 +- src/asm/gameboy/locallex.c | 8 +- src/asm/globlex.c | 15 ++- src/asm/include/gbasmy.h | 151 ---------------------- src/asm/lexer.c | 15 ++- src/asm/main.c | 9 +- src/asm/math.c | 7 +- src/asm/output.c | 15 ++- src/asm/rpn.c | 14 +- src/asm/symbol.c | 11 +- src/asm/yaccprt1.y | 19 +-- 22 files changed, 101 insertions(+), 240 deletions(-) rename {src/asm/include => include/asm}/asm.h (85%) rename {src/asm/include => include/asm}/fstack.h (85%) rename {src/asm/include => include/asm}/lexer.h (95%) rename {src/asm/include => include/asm}/main.h (92%) rename {src/asm/include => include/asm}/mylink.h (96%) rename {src/asm/include => include/asm}/mymath.h (80%) rename {src/asm/include => include/asm}/output.h (87%) rename {src/asm/include => include/asm}/rpn.h (98%) rename {src/asm/include => include/asm}/symbol.h (96%) rename {src/asm/include => include/asm}/types.h (84%) delete mode 100644 src/asm/include/gbasmy.h diff --git a/src/asm/include/asm.h b/include/asm/asm.h similarity index 85% rename from src/asm/include/asm.h rename to include/asm/asm.h index 078e0aa2..fc2ecfed 100644 --- a/src/asm/include/asm.h +++ b/include/asm/asm.h @@ -6,14 +6,17 @@ * */ -#ifndef ASM_H -#define ASM_H +#ifndef ASMOTOR_ASM_ASM_H +#define ASMOTOR_ASM_ASM_H #include #include -#include "types.h" -#include "symbol.h" + +#include "asm/types.h" +#include "asm/symbol.h" + #include "localasm.h" + #include "asmotor.h" extern SLONG nLineNo; diff --git a/src/asm/include/fstack.h b/include/asm/fstack.h similarity index 85% rename from src/asm/include/fstack.h rename to include/asm/fstack.h index a32eb6fd..9978a3e2 100644 --- a/src/asm/include/fstack.h +++ b/include/asm/fstack.h @@ -6,12 +6,12 @@ * */ -#ifndef FSTACK_H -#define FSTACK_H +#ifndef ASMOTOR_ASM_FSTACK_H +#define ASMOTOR_ASM_FSTACK_H -#include "asm.h" -#include "types.h" -#include "lexer.h" +#include "asm/asm.h" +#include "asm/types.h" +#include "asm/lexer.h" struct sContext { YY_BUFFER_STATE FlexHandle; diff --git a/src/asm/include/lexer.h b/include/asm/lexer.h similarity index 95% rename from src/asm/include/lexer.h rename to include/asm/lexer.h index 22118100..522b1216 100644 --- a/src/asm/include/lexer.h +++ b/include/asm/lexer.h @@ -1,9 +1,10 @@ -#ifndef LEXER_H -#define LEXER_H +#ifndef ASMOTOR_ASM_LEXER_H +#define ASMOTOR_ASM_LEXER_H -#include "types.h" #include +#include "asm/types.h" + #define LEXHASHSIZE 512 struct sLexInitString { diff --git a/src/asm/include/main.h b/include/asm/main.h similarity index 92% rename from src/asm/include/main.h rename to include/asm/main.h index c789cf4e..9a5621d1 100644 --- a/src/asm/include/main.h +++ b/include/asm/main.h @@ -1,5 +1,5 @@ -#ifndef MAIN_H -#define MAIN_H +#ifndef ASMOTOR_MAIN_H +#define ASMOTOR_MAIN_H struct sOptions { ULONG endian; diff --git a/src/asm/include/mylink.h b/include/asm/mylink.h similarity index 96% rename from src/asm/include/mylink.h rename to include/asm/mylink.h index 0f9c1339..94a76eee 100644 --- a/src/asm/include/mylink.h +++ b/include/asm/mylink.h @@ -1,5 +1,5 @@ -#ifndef LINK_H -#define LINK_H 1 +#ifndef ASMOTOR_ASM_LINK_H +#define ASMOTOR_ASM_LINK_H /* RGB0 .obj format: * diff --git a/src/asm/include/mymath.h b/include/asm/mymath.h similarity index 80% rename from src/asm/include/mymath.h rename to include/asm/mymath.h index fad63ea1..8c543b88 100644 --- a/src/asm/include/mymath.h +++ b/include/asm/mymath.h @@ -1,7 +1,7 @@ -#ifndef MATH_H -#define MATH_H +#ifndef ASMOTOR_ASM_MATH_H +#define ASMOTOR_ASM_MATH_H -#include "types.h" +#include "asm/types.h" void math_DefinePI(void); void math_Print(SLONG i); diff --git a/src/asm/include/output.h b/include/asm/output.h similarity index 87% rename from src/asm/include/output.h rename to include/asm/output.h index 780c1aad..94272b50 100644 --- a/src/asm/include/output.h +++ b/include/asm/output.h @@ -1,8 +1,8 @@ -#ifndef OUTPUT_H -#define OUTPUT_H 1 +#ifndef ASMOTOR_ASM_OUTPUT_H +#define ASMOTOR_ASM_OUTPUT_H -#include "rpn.h" -#include "types.h" +#include "asm/rpn.h" +#include "asm/types.h" struct Section { char *pzName; diff --git a/src/asm/include/rpn.h b/include/asm/rpn.h similarity index 98% rename from src/asm/include/rpn.h rename to include/asm/rpn.h index 13509274..b9c0aec0 100644 --- a/src/asm/include/rpn.h +++ b/include/asm/rpn.h @@ -1,5 +1,5 @@ -#ifndef RPN_H -#define RPN_H 1 +#ifndef ASMOTOR_ASM_RPN_H +#define ASMOTOR_ASM_RPN_H struct Expression { SLONG nVal; diff --git a/src/asm/include/symbol.h b/include/asm/symbol.h similarity index 96% rename from src/asm/include/symbol.h rename to include/asm/symbol.h index 3d5303e0..ad36cb63 100644 --- a/src/asm/include/symbol.h +++ b/include/asm/symbol.h @@ -1,7 +1,7 @@ -#ifndef SYMBOL_H -#define SYMBOL_H 1 +#ifndef ASMOTOR_SYMBOL_H +#define ASMOTOR_SYMBOL_H -#include "types.h" +#include "asm/types.h" #define HASHSIZE 73 #define MAXSYMLEN 256 diff --git a/src/asm/include/types.h b/include/asm/types.h similarity index 84% rename from src/asm/include/types.h rename to include/asm/types.h index 36699c99..c0c88c0e 100644 --- a/src/asm/include/types.h +++ b/include/asm/types.h @@ -1,5 +1,5 @@ -#ifndef TYPES_H -#define TYPES_H 1 +#ifndef ASMOTOR_ASM_TYPES_H +#define ASMOTOR_ASM_TYPES_H #if defined(AMIGA) || defined(__GNUC__) #define _MAX_PATH 512 diff --git a/src/asm/Makefile b/src/asm/Makefile index 1efd3618..d286124d 100644 --- a/src/asm/Makefile +++ b/src/asm/Makefile @@ -20,7 +20,7 @@ rgbasm: $(obj) gcc -Wall -o $@ $^ -lm .c.o: - gcc -Wall -DGAMEBOY -I. -I.. -Iinclude -Igameboy -g -c -o $@ $< + gcc -Wall -DGAMEBOY -I. -I.. -I../../include -Igameboy -g -c -o $@ $< .y.c: bison -d -o $@ $^ diff --git a/src/asm/fstack.c b/src/asm/fstack.c index 6318a837..8e0e95ca 100644 --- a/src/asm/fstack.c +++ b/src/asm/fstack.c @@ -8,11 +8,12 @@ #include #include #include -#include "symbol.h" -#include "fstack.h" -#include "types.h" -#include "main.h" -#include "lexer.h" + +#include "asm/symbol.h" +#include "asm/fstack.h" +#include "asm/types.h" +#include "asm/main.h" +#include "asm/lexer.h" /* * RGBAsm - FSTACK.C (FileStack routines) diff --git a/src/asm/gameboy/locallex.c b/src/asm/gameboy/locallex.c index 982429a9..57e0f682 100644 --- a/src/asm/gameboy/locallex.c +++ b/src/asm/gameboy/locallex.c @@ -1,7 +1,7 @@ -#include "symbol.h" -#include "lexer.h" -#include "rpn.h" -#include "asmy.h" +#include "asm/symbol.h" +#include "asm/lexer.h" +#include "asm/rpn.h" +#include "asm/asmy.h" struct sLexInitString localstrings[] = { { "adc", T_Z80_ADC }, diff --git a/src/asm/globlex.c b/src/asm/globlex.c index 72495102..243837bf 100644 --- a/src/asm/globlex.c +++ b/src/asm/globlex.c @@ -1,10 +1,11 @@ -#include "asm.h" -#include "symbol.h" -#include "rpn.h" -#include "asmy.h" -#include "symbol.h" -#include "main.h" -#include "lexer.h" +#include "asm/asm.h" +#include "asm/symbol.h" +#include "asm/rpn.h" +#include "asm/asmy.h" +#include "asm/symbol.h" +#include "asm/main.h" +#include "asm/lexer.h" + #include #include #include diff --git a/src/asm/include/gbasmy.h b/src/asm/include/gbasmy.h deleted file mode 100644 index bb8ea969..00000000 --- a/src/asm/include/gbasmy.h +++ /dev/null @@ -1,151 +0,0 @@ -typedef union { - char tzSym[MAXSYMLEN + 1]; - char tzString[256]; - struct Expression sVal; - SLONG nConstValue; -} YYSTYPE; -#define T_NUMBER 258 -#define T_STRING 259 -#define T_OP_LOGICNOT 260 -#define T_OP_LOGICOR 261 -#define T_OP_LOGICAND 262 -#define T_OP_LOGICEQU 263 -#define T_OP_LOGICGT 264 -#define T_OP_LOGICLT 265 -#define T_OP_LOGICGE 266 -#define T_OP_LOGICLE 267 -#define T_OP_LOGICNE 268 -#define T_OP_ADD 269 -#define T_OP_SUB 270 -#define T_OP_OR 271 -#define T_OP_XOR 272 -#define T_OP_AND 273 -#define T_OP_SHL 274 -#define T_OP_SHR 275 -#define T_OP_MUL 276 -#define T_OP_DIV 277 -#define T_OP_MOD 278 -#define T_OP_NOT 279 -#define T_OP_DEF 280 -#define T_OP_BANK 281 -#define T_OP_SIN 282 -#define T_OP_COS 283 -#define T_OP_TAN 284 -#define T_OP_ASIN 285 -#define T_OP_ACOS 286 -#define T_OP_ATAN 287 -#define T_OP_ATAN2 288 -#define T_OP_FDIV 289 -#define T_OP_FMUL 290 -#define T_OP_STRCMP 291 -#define T_OP_STRIN 292 -#define T_OP_STRSUB 293 -#define T_OP_STRLEN 294 -#define T_OP_STRCAT 295 -#define T_OP_STRUPR 296 -#define T_OP_STRLWR 297 -#define NEG 298 -#define T_LABEL 299 -#define T_ID 300 -#define T_POP_EQU 301 -#define T_POP_SET 302 -#define T_POP_EQUS 303 -#define T_POP_INCLUDE 304 -#define T_POP_PRINTF 305 -#define T_POP_PRINTT 306 -#define T_POP_PRINTV 307 -#define T_POP_IF 308 -#define T_POP_ELSE 309 -#define T_POP_ENDC 310 -#define T_POP_IMPORT 311 -#define T_POP_EXPORT 312 -#define T_POP_GLOBAL 313 -#define T_POP_DB 314 -#define T_POP_DS 315 -#define T_POP_DW 316 -#define T_POP_SECTION 317 -#define T_POP_RB 318 -#define T_POP_RW 319 -#define T_POP_MACRO 320 -#define T_POP_ENDM 321 -#define T_POP_RSRESET 322 -#define T_POP_RSSET 323 -#define T_POP_INCBIN 324 -#define T_POP_REPT 325 -#define T_POP_SHIFT 326 -#define T_POP_ENDR 327 -#define T_POP_FAIL 328 -#define T_POP_WARN 329 -#define T_SECT_BSS 330 -#define T_SECT_VRAM 331 -#define T_SECT_CODE 332 -#define T_SECT_HOME 333 -#define T_SECT_HRAM 334 -#define T_Z80_ADC 335 -#define T_Z80_ADD 336 -#define T_Z80_AND 337 -#define T_Z80_BIT 338 -#define T_Z80_CALL 339 -#define T_Z80_CCF 340 -#define T_Z80_CP 341 -#define T_Z80_CPL 342 -#define T_Z80_DAA 343 -#define T_Z80_DEC 344 -#define T_Z80_DI 345 -#define T_Z80_EI 346 -#define T_Z80_EX 347 -#define T_Z80_HALT 348 -#define T_Z80_INC 349 -#define T_Z80_JP 350 -#define T_Z80_JR 351 -#define T_Z80_LD 352 -#define T_Z80_LDIO 353 -#define T_Z80_NOP 354 -#define T_Z80_OR 355 -#define T_Z80_POP 356 -#define T_Z80_PUSH 357 -#define T_Z80_RES 358 -#define T_Z80_RET 359 -#define T_Z80_RETI 360 -#define T_Z80_RST 361 -#define T_Z80_RL 362 -#define T_Z80_RLA 363 -#define T_Z80_RLC 364 -#define T_Z80_RLCA 365 -#define T_Z80_RR 366 -#define T_Z80_RRA 367 -#define T_Z80_RRC 368 -#define T_Z80_RRCA 369 -#define T_Z80_SBC 370 -#define T_Z80_SCF 371 -#define T_Z80_STOP 372 -#define T_Z80_SLA 373 -#define T_Z80_SRA 374 -#define T_Z80_SRL 375 -#define T_Z80_SUB 376 -#define T_Z80_SWAP 377 -#define T_Z80_XOR 378 -#define T_MODE_A 379 -#define T_MODE_B 380 -#define T_MODE_C 381 -#define T_MODE_C_IND 382 -#define T_MODE_D 383 -#define T_MODE_E 384 -#define T_MODE_H 385 -#define T_MODE_L 386 -#define T_MODE_AF 387 -#define T_MODE_BC 388 -#define T_MODE_BC_IND 389 -#define T_MODE_DE 390 -#define T_MODE_DE_IND 391 -#define T_MODE_SP 392 -#define T_MODE_SP_IND 393 -#define T_MODE_HL 394 -#define T_MODE_HL_IND 395 -#define T_MODE_HL_INDDEC 396 -#define T_MODE_HL_INDINC 397 -#define T_CC_NZ 398 -#define T_CC_Z 399 -#define T_CC_NC 400 - -extern YYSTYPE yylval; diff --git a/src/asm/lexer.c b/src/asm/lexer.c index 36e2c210..72422a92 100644 --- a/src/asm/lexer.c +++ b/src/asm/lexer.c @@ -1,10 +1,11 @@ -#include "asm.h" -#include "lexer.h" -#include "types.h" -#include "main.h" -#include "rpn.h" -#include "asmy.h" -#include "fstack.h" +#include "asm/asm.h" +#include "asm/lexer.h" +#include "asm/types.h" +#include "asm/main.h" +#include "asm/rpn.h" +#include "asm/asmy.h" +#include "asm/fstack.h" + #include #include #include diff --git a/src/asm/main.c b/src/asm/main.c index 5e781a2e..1778377f 100644 --- a/src/asm/main.c +++ b/src/asm/main.c @@ -10,10 +10,11 @@ #include #include #include -#include "symbol.h" -#include "fstack.h" -#include "output.h" -#include "main.h" + +#include "asm/symbol.h" +#include "asm/fstack.h" +#include "asm/output.h" +#include "asm/main.h" int yyparse(void); void setuplex(void); diff --git a/src/asm/math.c b/src/asm/math.c index f4eb17d6..9b3680da 100644 --- a/src/asm/math.c +++ b/src/asm/math.c @@ -7,9 +7,10 @@ #include #include -#include "types.h" -#include "mymath.h" -#include "symbol.h" + +#include "asm/types.h" +#include "asm/mymath.h" +#include "asm/symbol.h" #define fix2double(i) ((double)(i/65536.0)) #define double2fix(d) ((SLONG)(d*65536.0)) diff --git a/src/asm/output.c b/src/asm/output.c index 0edfe660..8ae0a878 100644 --- a/src/asm/output.c +++ b/src/asm/output.c @@ -8,13 +8,14 @@ #include #include #include -#include "asm.h" -#include "output.h" -#include "symbol.h" -#include "mylink.h" -#include "main.h" -#include "rpn.h" -#include "fstack.h" + +#include "asm/asm.h" +#include "asm/output.h" +#include "asm/symbol.h" +#include "asm/mylink.h" +#include "asm/main.h" +#include "asm/rpn.h" +#include "asm/fstack.h" #define SECTIONCHUNK 0x4000 diff --git a/src/asm/rpn.c b/src/asm/rpn.c index 8809755f..77d0b372 100644 --- a/src/asm/rpn.c +++ b/src/asm/rpn.c @@ -5,16 +5,16 @@ * */ -#include "mylink.h" -#include "types.h" -#include "symbol.h" -#include "asm.h" -#include "main.h" -#include "rpn.h" - #include #include +#include "asm/mylink.h" +#include "asm/types.h" +#include "asm/symbol.h" +#include "asm/asm.h" +#include "asm/main.h" +#include "asm/rpn.h" + void mergetwoexpressions(struct Expression *expr, struct Expression *src1, struct Expression *src2) { diff --git a/src/asm/symbol.c b/src/asm/symbol.c index 4fa9349d..2379a546 100644 --- a/src/asm/symbol.c +++ b/src/asm/symbol.c @@ -8,11 +8,12 @@ #include #include #include -#include "asm.h" -#include "symbol.h" -#include "main.h" -#include "mymath.h" -#include "output.h" + +#include "asm/asm.h" +#include "asm/symbol.h" +#include "asm/main.h" +#include "asm/mymath.h" +#include "asm/output.h" /* * RGBAsm - SYMBOL.C - Symboltable stuff diff --git a/src/asm/yaccprt1.y b/src/asm/yaccprt1.y index ddd88928..c94f0e5e 100644 --- a/src/asm/yaccprt1.y +++ b/src/asm/yaccprt1.y @@ -1,18 +1,19 @@ %{ -#include "symbol.h" -#include "asm.h" -#include "output.h" -#include "mylink.h" -#include "fstack.h" -#include "mymath.h" -#include "rpn.h" -#include "main.h" -#include "lexer.h" #include #include #include #include +#include "asm/symbol.h" +#include "asm/asm.h" +#include "asm/output.h" +#include "asm/mylink.h" +#include "asm/fstack.h" +#include "asm/mymath.h" +#include "asm/rpn.h" +#include "asm/main.h" +#include "asm/lexer.h" + char *tzNewMacro; ULONG ulNewMacroSize;