mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Use the options parameter provided for command line options. Specifically, for haltnop.
This commit is contained in:
@@ -8,6 +8,7 @@ struct sOptions {
|
|||||||
char binary[2];
|
char binary[2];
|
||||||
SLONG fillchar;
|
SLONG fillchar;
|
||||||
bool verbose;
|
bool verbose;
|
||||||
|
bool haltnop;
|
||||||
//-1 == random
|
//-1 == random
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
%{
|
%{
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -18,8 +17,6 @@
|
|||||||
#include "asm/main.h"
|
#include "asm/main.h"
|
||||||
#include "asm/lexer.h"
|
#include "asm/lexer.h"
|
||||||
|
|
||||||
extern bool haltnop;
|
|
||||||
|
|
||||||
char *tzNewMacro;
|
char *tzNewMacro;
|
||||||
ULONG ulNewMacroSize;
|
ULONG ulNewMacroSize;
|
||||||
|
|
||||||
@@ -1264,7 +1261,7 @@ z80_ex : T_Z80_EX T_MODE_HL comma T_MODE_SP_IND
|
|||||||
z80_halt: T_Z80_HALT
|
z80_halt: T_Z80_HALT
|
||||||
{
|
{
|
||||||
out_AbsByte(0x76);
|
out_AbsByte(0x76);
|
||||||
if (haltnop) {
|
if (CurrentOptions.haltnop) {
|
||||||
out_AbsByte(0x00);
|
out_AbsByte(0x00);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -30,8 +29,6 @@ void setuplex(void);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool haltnop;
|
|
||||||
|
|
||||||
clock_t nStartClock, nEndClock;
|
clock_t nStartClock, nEndClock;
|
||||||
SLONG nLineNo;
|
SLONG nLineNo;
|
||||||
ULONG nTotalLines, nPass, nPC, nIFDepth, nErrors;
|
ULONG nTotalLines, nPass, nPC, nIFDepth, nErrors;
|
||||||
@@ -260,7 +257,7 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
char *tzMainfile;
|
char *tzMainfile;
|
||||||
|
|
||||||
haltnop = true;
|
|
||||||
|
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
@@ -275,6 +272,7 @@ main(int argc, char *argv[])
|
|||||||
DefaultOptions.binary[1] = '1';
|
DefaultOptions.binary[1] = '1';
|
||||||
DefaultOptions.fillchar = 0;
|
DefaultOptions.fillchar = 0;
|
||||||
DefaultOptions.verbose = false;
|
DefaultOptions.verbose = false;
|
||||||
|
DefaultOptions.haltnop = true;
|
||||||
|
|
||||||
opt_SetCurrentOptions(&DefaultOptions);
|
opt_SetCurrentOptions(&DefaultOptions);
|
||||||
|
|
||||||
@@ -303,7 +301,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
haltnop = false;
|
newopt.haltnop = false;
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
fstk_AddIncludePath(optarg);
|
fstk_AddIncludePath(optarg);
|
||||||
|
|||||||
Reference in New Issue
Block a user