Use stdbool.h.

This commit is contained in:
Eric Smith 2018-03-08 15:32:24 -07:00
parent 0e9139e700
commit 9962af1740
8 changed files with 41 additions and 26 deletions

9
dis.h
View File

@ -1,8 +1,7 @@
/*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
*
* $Id: dis.h 26 2004-01-17 23:28:23Z eric $
* Copyright 2000-2016 Eric Smith <spacewar@gmail.com>
* Copyright 2000-2018 Eric Smith <spacewar@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -21,7 +20,7 @@
*/
extern int sevenbit; /* if true, mask character data with 0x7f
extern bool sevenbit; /* if true, mask character data with 0x7f
to ignore MSB */
typedef uint16_t addr_t;
@ -41,6 +40,10 @@ extern int base_address, vector_address;
extern int entry_count;
extern int entry_address[MAX_ENTRY];
extern bool prodos;
extern int asmout;
extern unsigned char f[];
extern unsigned char d[];

View File

@ -1,10 +1,8 @@
/*
*
* dis [-p predefineds] file
*
* The -p option may be repeated.
* Copyright 2001-2018 Eric Smith <spacewar@gmail.com>
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@ -37,7 +35,8 @@ void usage (void)
" -p <file> predefs\n"
" -e <address> alternate entry point address\n"
" -v <address> alternate vector address\n"
" -7 mask character data to 7-bit",
" -7 mask character data to 7-bit\n"
" -P decode ProDOS MLI calls\n",
progname);
exit (1);
}
@ -96,7 +95,10 @@ void initopts (int argc, char *argv[])
bopt = ATARI_BOOT;
break;
case '7':
sevenbit = 1;
sevenbit = true;
break;
case 'P':
prodos = true;
break;
default: crash("Invalid option letter");
}

4
lex.l
View File

@ -1,8 +1,7 @@
/*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
*
* $Id: lex.l 26 2004-01-17 23:28:23Z eric $
* Copyright 2001-2014 Eric Smith <eric@brouhaha.com>
* Copyright 2001-2018 Eric Smith <spacewar@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -23,6 +22,7 @@
%{
#undef ECHO
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

19
main.c
View File

@ -1,8 +1,7 @@
/*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
*
* $Id: main.c 26 2004-01-17 23:28:23Z eric $
* Copyright 2000-2016 Eric Smith <eric@brouhaha.com>
* Copyright 2000-2018 Eric Smith <spacewar@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -21,6 +20,7 @@
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@ -28,7 +28,8 @@
#include "dis.h"
int sevenbit = 0; /* if true, mask character data with 0x7f to ignore MSB */
bool sevenbit = false; /* if true, mask character data with 0x7f to ignore MSB */
bool prodos = false;
#define NTSTART 500
@ -122,6 +123,18 @@ void trace_inst (addr_t addr)
break;
}
// handle ProDOS MLI calls
if (prodos && (opcode == 0x20) && (operand == 0xbf00))
{
f[addr++] |= TDONE; // system call number
uint16_t parameter_list = getword(addr);
f[addr++] |= TDONE;
f[addr++] |= TDONE;
f[parameter_list] |= DREF;
save_ref(istart, operand);
continue;
}
/* Mark data references */
switch (ip->flag & ADRMASK)

View File

@ -1,8 +1,7 @@
/*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
*
* $Id: print.c 26 2004-01-17 23:28:23Z eric $
* Copyright 2000-2014 Eric Smith <eric@brouhaha.com>
* Copyright 2000-2018 Eric Smith <spacewar@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -20,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@ -247,7 +246,7 @@ int print_data (addr_t i)
i++;
for (j = 1; j < 8; j++) {
if (f[i] & (JREF | SREF | DREF) || ((f[i] & LOADED) == 0))
if (f[i] & (JREF | SREF | DREF | ISOP) || ((f[i] & LOADED) == 0))
break;
else
printf(",$%02x", getbyte(i));

4
ref.c
View File

@ -1,8 +1,7 @@
/*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
*
* $Id: ref.c,v 1.5 2003/09/15 21:49:25 eric Exp $
* Copyright 2001-2003 Eric Smith <eric@brouhaha.com>
* Copyright 2001-2018 Eric Smith <spacewar@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -21,6 +20,7 @@
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

5
tbl.c
View File

@ -1,8 +1,7 @@
/*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
*
* $Id: tbl.c 26 2004-01-17 23:28:23Z eric $
* Copyright 2001-2014 Eric Smith <eric@brouhaha.com>
* Copyright 2001-2018 Eric Smith <spacewar@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -20,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

View File

@ -1,8 +1,7 @@
/*
* dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith
*
* $Id: trace_queue.c,v 1.2 2003/09/15 21:49:25 eric Exp $
* Copyright 2000-2003 Eric Smith <eric@brouhaha.com>
* Copyright 2000-2018 Eric Smith <spacewar@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@ -20,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "dis.h"