VGA Text Mode (ja) #1156
Replies: 6 comments 6 replies
-
If it isn't "println!("{}", info);" then wouldn't it be "println!("{}", _info);"? |
Beta Was this translation helpful? Give feedback.
-
in my environment(rust nightly 1.67), implement Formatting Macros by implement fmt::Write didn't work. rustc compliant that "method |
Beta Was this translation helpful? Give feedback.
-
I was wondering if the new_line method could be refactored to use iterators instead. I managed to do it for clear_row But every thing I have tried with new_line to make something similar ends up with an error because i can't zip a mutable iterator without encapsulating it and if i put the mutable iterator then zip it with an immutable one the borrow checker will tell me I can't do that. |
Beta Was this translation helpful? Give feedback.
-
Thanks what i meant is that I wrote clear_row like this fn clear_row(&mut self, row: usize) {
let blank = ScreenChar {
ascii_character: b' ',
color_code: self.color_code,
};
for _ in self.buffer.chars[row].iter_mut().map(|x| (*x).write(blank)) {}
} and I wanted to do something similar for new_line and came up with something like this fn new_line(&mut self) {
for (row, next_row) in self.buffer.chars.iter_mut().zip(self.buffer.chars.iter().next) {
for _ in row.iter_mut().zip(next_row.iter()).map(|(x, y)| {
let character = y.read();
(*x).write(character);
}) {}
}
self.clear_row(BUFFER_HEIGHT - 1);
self.column_position = 0;
} but i get the next error
|
Beta Was this translation helpful? Give feedback.
-
In my opinion, a |
Beta Was this translation helpful? Give feedback.
-
I believe an update for the |
Beta Was this translation helpful? Give feedback.
-
VGA Text Mode (ja)
VGAテキストモードは画面にテキストを出力するシンプルな方法です。この記事では、すべてのunsafeな要素を別のモジュールにカプセル化することで、それを安全かつシンプルに扱えるようにするインターフェースを作ります。また、Rustのフォーマッティングマクロのサポートも実装します。
https://os.phil-opp.com/ja/vga-text-mode/
Beta Was this translation helpful? Give feedback.
All reactions