forked from kotetuco/Rust-BareMetal-GBA-Sample
-
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.
Merge pull request kotetuco#5 from kotetuco/feature/draw_string
文字列表示処理を実装。
- Loading branch information
Showing
11 changed files
with
379 additions
and
100 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,31 +1,7 @@ | ||
.text | ||
|
||
.global _start | ||
.global _start | ||
_start: | ||
b entry @ Branch to entry() | ||
b entry @ Branch to entry() | ||
loop: | ||
b loop | ||
|
||
@ multi-threading is also not supportd | ||
.global __sync_val_compare_and_swap_1 | ||
.global __sync_val_compare_and_swap_2 | ||
.global __sync_val_compare_and_swap_4 | ||
__sync_val_compare_and_swap_1: | ||
__sync_val_compare_and_swap_2: | ||
__sync_val_compare_and_swap_4: | ||
1: b 1b | ||
|
||
@ floating point operations are not supported | ||
.global __aeabi_ul2f | ||
.global __aeabi_ul2d | ||
.global __aeabi_fmul | ||
.global __aeabi_fdiv | ||
.global __aeabi_dmul | ||
.global __aeabi_ddiv | ||
__aeabi_ul2f: | ||
__aeabi_ul2d: | ||
__aeabi_fmul: | ||
__aeabi_fdiv: | ||
__aeabi_dmul: | ||
__aeabi_ddiv: | ||
1: b 1b | ||
b loop |
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,32 @@ | ||
// | ||
// kotetuco, 2017 | ||
// | ||
|
||
use font_def::FONT_DATAS; | ||
|
||
pub struct Font { | ||
size_width: u16, | ||
size_height: u16, | ||
} | ||
|
||
impl Font { | ||
pub fn new() -> Self { | ||
Font { | ||
size_width: 8, | ||
size_height: 16, | ||
} | ||
} | ||
|
||
pub fn get_character(&self, ch: char) -> [u8; 16] { | ||
let index = ch as usize; | ||
return FONT_DATAS[index]; | ||
} | ||
|
||
pub fn font_width(&self) -> u16 { | ||
return self.size_width; | ||
} | ||
|
||
pub fn font_height(&self) -> u16 { | ||
return self.size_height; | ||
} | ||
} |
Oops, something went wrong.