Skip to content

Commit

Permalink
DREAMWEB: added banner to autogenerated files
Browse files Browse the repository at this point in the history
  • Loading branch information
whoozle committed Jun 15, 2011
1 parent 4e75c4b commit 3b85ded
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
20 changes: 13 additions & 7 deletions devtools/tasmrecover/tasm/cpp.py
Expand Up @@ -16,8 +16,16 @@ def __init__(self, context, namespace, skip_first = 0, blacklist = []):
self.namespace = namespace
fname = namespace + ".cpp"
header = namespace + ".h"
banner = "/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */"
self.fd = open(fname, "wt")
self.hd = open(header, "wt")
hid = "TASMRECOVER_%s_STUBS_H__" %namespace.upper()
self.hd.write("""#ifndef %s
#define %s
%s
""" %(hid, hid, banner))
self.context = context
self.data_seg = context.binary_data
self.procs = context.proc_list
Expand All @@ -29,11 +37,13 @@ def __init__(self, context, namespace, skip_first = 0, blacklist = []):
self.translated = []
self.proc_addr = []
self.forwards = []
self.fd.write("""#include \"%s\"
self.fd.write("""%s
#include \"%s\"
namespace %s {
""" %(header, namespace))
""" %(banner, header, namespace))

def expand_cb(self, match):
name = match.group(0).lower()
Expand Down Expand Up @@ -531,12 +541,8 @@ def generate(self, start):
if (n & 0xf) == 0:
data_impl += "\n\t\t"
data_impl += "};\n\tcontext.ds.assign(src, src + sizeof(src));\n"
hid = "TASMRECOVER_%s_STUBS_H__" %self.namespace.upper()
self.hd.write("""#ifndef %s
#define %s
""" %(hid, hid))
self.hd.write(
"""\n#\tinclude "runtime.h"
"""\n#include "dreamweb/runtime.h"
namespace %s {
Expand Down
12 changes: 12 additions & 0 deletions engines/dreamweb/README
@@ -0,0 +1,12 @@

WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

Some files(dreamgen.*) in this directory is auto-generated. This means
(at least for some time) any changes to them will be lost.

Please look into /devtools/tasmrecover directory, patch assembler source
or translator and run ./tasm-recover script.

Then copy dreamgen.cpp/dreamgen.h to engine/dreamweb and check the diffs.

If you'd like to reimplement something, blacklist it, then run script.
2 changes: 2 additions & 0 deletions engines/dreamweb/dreamgen.cpp
@@ -1,3 +1,5 @@
/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */

#include "dreamgen.h"

namespace dreamgen {
Expand Down
5 changes: 4 additions & 1 deletion engines/dreamweb/dreamgen.h
@@ -1,7 +1,10 @@
#ifndef TASMRECOVER_DREAMGEN_STUBS_H__
#define TASMRECOVER_DREAMGEN_STUBS_H__

# include "runtime.h"
/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */


#include "dreamweb/runtime.h"

namespace dreamgen {

Expand Down

0 comments on commit 3b85ded

Please sign in to comment.