Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
magic-lantern
magic-lantern
Commits
412ae1ea1f0c
Commit
d11d8309
authored
Jul 13, 2017
by
Alex
Browse files
Merged in daniel_fort/magic-lantern/find_fnt.py-update (pull request
#844
)
find_fnt.py update --HG-- branch : unified
parents
184e58a5ec53
bd7c2cb3c15a
Changes
1
Hide whitespace changes
Inline
Side-by-side
contrib/indy/find_fnt.py
View file @
412ae1ea
...
...
@@ -56,10 +56,12 @@ On the 5D there are the following fonts added to the stubs.S file:
0xf00d1110: HCanonGothic 36 px, ascii only (0xFFE2)
0xf00d585c: CanonMonoSpace 40 px, ascii only (0xFFD8)
Alex, 16Mar2011
https://bitbucket.org/hudson/magic-lantern/changeset/cfba492ea84d
Daniel Fort, 05Jul2017
https://bitbucket.org/hudson/magic-lantern/pull-requests/844/find_fntpy-update/diff
"""
...
...
@@ -105,6 +107,17 @@ def parseBitmap(m, off, base):
nb_byte
=
nb_byte
+
1
print
' bitmap size = 0x%x'
%
(
nb_byte
*
height
)
def
guess_load_addr
(
rom
,
name
):
if
rom
[
4
:
12
]
==
"gaonisoy"
:
return
0xFF010000
# assume old DIGIC 4 ROM dumped from 0xFF010000
if
"ROM0"
in
name
:
return
0xF0000000
# ROM0 from ML/LOGS/
if
"ROM1"
in
name
:
return
0xF8000000
# ROM1 from ML/LOGS/
# unknown, just report the offset inside the ROM.
return
0
f
=
open
(
sys
.
argv
[
1
],
'rb'
)
m
=
f
.
read
()
f
.
close
()
...
...
@@ -112,10 +125,11 @@ f.close()
if
(
len
(
sys
.
argv
)
>
2
):
base
=
int
(
sys
.
argv
[
2
],
16
)
else
:
base
=
0xff010000
base
=
guess_load_addr
(
m
,
sys
.
argv
[
1
])
print
'Find bitmap fonts in Canon DSLR firmwares'
print
'Arm.Indy. based on work by Pel, Trammel Hudson and A1ex
\n
'
print
'Arm.Indy. based on work by Pel, Trammel Hudson and A1ex'
print
'Assume ROM file was dumped from 0x%08x
\n
'
%
base
off
=
0
while
off
<
len
(
m
)
and
off
<>
-
1
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment