-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
2,511 additions
and
142 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Pointer Finder finds pointers | ||
# Given Rom, Pointer, New Pointer | ||
# prints event format to stdout | ||
|
||
import struct | ||
|
||
def to_bytes(val): | ||
#pack into little endian, signed halfwords | ||
return struct.pack('<h', val) | ||
|
||
|
||
def main(): | ||
|
||
with open('pleftmatrix.dmp', 'wb') as out: | ||
# angle 0 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(- (zdist - (zdist>>2) - (zdist>>5))) | ||
out.write(bytevalue) | ||
#angle 1 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(- ((zdist>>1) - (zdist>>3))) | ||
out.write(bytevalue) | ||
# angle 2 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(0) | ||
out.write(bytevalue) | ||
#angle 3 | ||
for zdist in range(256): | ||
bytevalue = to_bytes((zdist>>1) - (zdist>>3)) | ||
out.write(bytevalue) | ||
# angle 4 | ||
for zdist in range(256): | ||
bytevalue = to_bytes((zdist - (zdist>>2) - (zdist>>5))) | ||
out.write(bytevalue) | ||
#angle 5 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(zdist - (zdist>>4) - (zdist>>6)) | ||
out.write(bytevalue) | ||
# angle 6 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(zdist) | ||
out.write(bytevalue) | ||
#angle 7 | ||
for zdist in range(256): | ||
bytevalue = to_bytes((zdist - (zdist>>4) - (zdist>>6))) | ||
out.write(bytevalue) | ||
# angle 8 | ||
for zdist in range(256): | ||
bytevalue = to_bytes((zdist - (zdist>>2) - (zdist>>5))) | ||
out.write(bytevalue) | ||
#angle 9 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(((zdist>>1) - (zdist>>3))) | ||
out.write(bytevalue) | ||
# angle 10 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(0) | ||
out.write(bytevalue) | ||
#angle 11 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(- ((zdist>>1) - (zdist>>3))) | ||
out.write(bytevalue) | ||
# angle 12 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(- (zdist - (zdist>>2) - (zdist>>5))) | ||
out.write(bytevalue) | ||
#angle 13 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(- (zdist - (zdist>>4) - (zdist>>6))) | ||
out.write(bytevalue) | ||
# angle 14 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(-zdist) | ||
out.write(bytevalue) | ||
#angle 15 | ||
for zdist in range(256): | ||
bytevalue = to_bytes(- (zdist - (zdist>>4) - (zdist>>6))) | ||
out.write(bytevalue) | ||
print("done!") | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.