trunk/src/build/makelist.py
| r244766 | r244767 | |
| 26 | 26 | srcptr+=1 |
| 27 | 27 | continue |
| 28 | 28 | if c==' ': |
| 29 | | continue; |
| 29 | continue |
| 30 | 30 | if in_comment==1 and c=='*' and line[srcptr]=='/' : |
| 31 | 31 | srcptr+=1 |
| 32 | | in_comment = 0; |
| 32 | in_comment = 0 |
| 33 | 33 | continue |
| 34 | | if (in_comment): |
| 34 | if in_comment: |
| 35 | 35 | continue |
| 36 | 36 | if c=='/' and line[srcptr]=='*' : |
| 37 | 37 | srcptr+=1 |
| 38 | | in_comment = 1; |
| 38 | in_comment = 1 |
| 39 | 39 | continue |
| 40 | 40 | if c=='/' and line[srcptr]=='/' : |
| 41 | 41 | break |
| 42 | 42 | drivname += c |
| 43 | 43 | drivname = drivname.strip() |
| 44 | | if (len(drivname)>0): |
| 44 | if len(drivname)>0: |
| 45 | 45 | if drivname[0]=='#': |
| 46 | 46 | sys.stderr.write("Importing drivers from '%s'\n" % drivname[1:]) |
| 47 | 47 | parse_file(drivname[1:]) |
| r244766 | r244767 | |
| 54 | 54 | return 0 |
| 55 | 55 | |
| 56 | 56 | |
| 57 | | if (len(sys.argv) < 2) : |
| 57 | if len(sys.argv) < 2: |
| 58 | 58 | print('Usage:') |
| 59 | 59 | print(' makelist <source.lst>') |
| 60 | 60 | sys.exit(0) |
| 61 | 61 | |
| 62 | | if (parse_file(sys.argv[1])) : |
| 62 | if parse_file(sys.argv[1]) : |
| 63 | 63 | sys.exit(1) |
| 64 | 64 | |
| 65 | 65 | # output a count |
| 66 | | if (len(drivlist)==0) : |
| 66 | if len(drivlist)==0 : |
| 67 | 67 | sys.stderr.write("No drivers found\n") |
| 68 | 68 | sys.exit(1) |
| 69 | 69 | |
| r244766 | r244767 | |
| 73 | 73 | drivlist.append("___empty") |
| 74 | 74 | |
| 75 | 75 | # start with a header |
| 76 | | print('#include "emu.h"\n'); |
| 77 | | print('#include "drivenum.h"\n'); |
| 76 | print('#include "emu.h"\n') |
| 77 | print('#include "drivenum.h"\n') |
| 78 | 78 | |
| 79 | 79 | #output the list of externs first |
| 80 | 80 | for drv in sorted(drivlist): |
| 81 | | print("GAME_EXTERN(%s);" % drv) |
| 81 | print("GAME_EXTERN(%s);" % drv) |
| 82 | 82 | print("") |
| 83 | 83 | |
| 84 | 84 | # then output the array |
| 85 | 85 | print("const game_driver * const driver_list::s_drivers_sorted[%d] =" % len(drivlist)) |
| 86 | 86 | print("{") |
| 87 | 87 | for drv in sorted(drivlist): |
| 88 | | print("\t&GAME_NAME(%s)," % drv) |
| 89 | | print("};"); |
| 90 | | print(""); |
| 88 | print("\t&GAME_NAME(%s)," % drv) |
| 89 | print("};") |
| 90 | print("") |
| 91 | 91 | |
| 92 | 92 | # also output a global count |
| 93 | 93 | print("int driver_list::s_driver_count = %d;\n" % len(drivlist)) |
trunk/src/regtests/jedutil/jedtest.py
| r244766 | r244767 | |
| 58 | 58 | for test in tests: |
| 59 | 59 | command = [jedUtilApp, "-view", test.jedFile, test.name] |
| 60 | 60 | if VERBOSE: |
| 61 | | print "Viewing the JED file: %s" % (test.jedFile) |
| 62 | | print "Command: %s" % ((" ").join(command)) |
| 61 | print "Viewing the JED file: %s" % test.jedFile |
| 62 | print "Command: %s" % " ".join(command) |
| 63 | 63 | |
| 64 | 64 | process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 65 | 65 | (stdout,stderr) = process.communicate() |
| r244766 | r244767 | |
| 84 | 84 | else: |
| 85 | 85 | jedUtilApp = os.path.normpath(os.path.join(currentDirectory, "..", "..", "..", "jedutil")) |
| 86 | 86 | |
| 87 | | if (VERBOSE): |
| 87 | if VERBOSE: |
| 88 | 88 | print "JED Path: %s" % jedsPath |
| 89 | 89 | print "Baseline Path: %s" % baselinePath |
| 90 | 90 | print "Output Path: %s" % outputPath |
| r244766 | r244767 | |
| 109 | 109 | |
| 110 | 110 | |
| 111 | 111 | # Setup the output paths |
| 112 | | if (VERBOSE): |
| 112 | if VERBOSE: |
| 113 | 113 | print "Cleaning the output directory" |
| 114 | 114 | print |
| 115 | 115 | if os.path.exists(outputPath): |