comparison scan.c @ 14:84c0facfc43c

Merge changes from upstream v0.1.4.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 14 Oct 2021 01:38:52 +0300
parents fe4d840c13eb
children a2a81589380d
comparison
equal deleted inserted replaced
13:cfa260872b23 14:84c0facfc43c
1 /*\ 1 /*\
2 * dxa v0.1.1 -- symbolic 65xx disassembler 2 * dxa -- symbolic 65xx disassembler
3 * 3 *
4 * Copyright (C) 1993, 1994 Marko M\"akel\"a 4 * Copyright (C) 1993, 1994 Marko M\"akel\"a
5 * Copyright (C) 2019 Cameron Kaiser
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or 9 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version. 10 * (at your option) any later version.
15 * 16 *
16 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 * 20 *
20 * Contacting the author:
21 *
22 * Via Internet E-mail:
23 * <Marko.Makela@FTP.FUNET.FI>
24 *
25 * Via Snail Mail:
26 * Marko M\"akel\"a
27 * Sillitie 10 A
28 * FIN-01480 VANTAA
29 * Finland
30 \*/ 21 \*/
31 22
32 #define _SCAN_C_ 23 #define _SCAN_C_
33 #include <stdio.h> 24 #include <stdio.h>
34 #include "proto.h" 25 #include "proto.h"
40 { 31 {
41 ADDR_T address, addr; 32 ADDR_T address, addr;
42 opcodes *instr; 33 opcodes *instr;
43 34
44 unsigned int size, counter; 35 unsigned int size, counter;
36 if (fVerbose)
37 fprintf(stderr, "\n%s: scanning sure section $%04x", prog, scanstart);
45 38
46 for (address = scanstart;; address += size) { 39 for (address = scanstart;; address += size) {
47 if (GetMemFlag (address)) /* rest of routine not valid */ 40 if (GetMemFlag (address)) /* rest of routine not valid */
48 return ((Options & M_DATA_BLOCKS) == O_DBL_STRICT); 41 return ((Options & M_DATA_BLOCKS) == O_DBL_STRICT);
49 42
586 if (ScanSure (entry->address)) { 579 if (ScanSure (entry->address)) {
587 fprintf(stderr,"For routine specified at %i:", 580 fprintf(stderr,"For routine specified at %i:",
588 (unsigned int)entry->address); 581 (unsigned int)entry->address);
589 return 1; 582 return 1;
590 } 583 }
591 entry = FindNextEntryType (NULL, ~0, RTN_SURE); 584 entry = FindNextEntryType (NULL, ~0, RTN_SURE); // valgrind fart
592 DeleteEntry (entry); 585 DeleteEntry (entry);
593 } 586 }
594 587
595 return 0; 588 return 0;
596 } 589 }
799 AddEntry (address + sizes[rel], address, 792 AddEntry (address + sizes[rel], address,
800 RTN_SUSPECTED | RTN_B_TEMPORARY); 793 RTN_SUSPECTED | RTN_B_TEMPORARY);
801 } 794 }
802 795
803 if (fVerbose) 796 if (fVerbose)
804 fprintf (stderr, "\r%s: scanning at %X", prog, address); 797 fprintf (stderr, "\n%s: scanning at $%04x", prog, address);
805 798
806 if (!ScanPotential (address)) { 799 if (!ScanPotential (address)) {
807 while ((entry = FindNextEntryType (NULL, ~RTN_B_TEMPORARY, 800 while ((entry = FindNextEntryType (NULL, ~RTN_B_TEMPORARY,
808 RTN_SUSPECTED))) { 801 RTN_SUSPECTED))) {
809 entry->type |= RTN_B_PROCESSED; 802 entry->type |= RTN_B_PROCESSED;