Skip to content

Commit

Permalink
get ready for the next adventure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor committed Nov 25, 2024
1 parent 44a8d54 commit 3c94b5a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
34 changes: 29 additions & 5 deletions samples/hello_world.yag
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,34 @@ fn main() {
[LCDC] = a

// Copy Tile Data
//todo
//todo bc = size_of_static!(TILE_DATA);
//todo de = &TILE_DATA
//todo hl = TILE_BLOCK_2
//todo loop {
//todo a = [de]
//todo [hl++] = a
//todo de++
//todo bc--
//todo a = b | c
//todo if a == 0 {
//todo break
//todo }
//todo }

// Copy Tilemap Data
//todo
//todo bc = size_of_static!(TILEMAP_DATA);
//todo de = &TILEMAP_DATA
//todo hl = TILE_MAP_0
//todo loop {
//todo a = [de]
//todo [hl++] = a
//todo de++
//todo bc--
//todo a = b | c
//todo if a == 0 {
//todo break
//todo }
//todo }

loop{}
}
Expand All @@ -32,15 +56,15 @@ const LCDC = $FF40
// LCD Y coordinate (aka "current scanline")
const LY = $FF44

// Background Palette
// Background Palette setting
const BGP = $FF47

const TILE_BLOCK_2 = $9000

const TILE_MAP_0 = $9800

// tile data
/* todo static TILE_DATA: [u8] = [
/* todo static TILE_DATA: [u8; _] = [
$00,$ff, $00,$ff, $00,$ff, $00,$ff, $00,$ff, $00,$ff, $00,$ff, $00,$ff,
$00,$ff, $00,$80, $00,$80, $00,$80, $00,$80, $00,$80, $00,$80, $00,$80,
$00,$ff, $00,$7e, $00,$7e, $00,$7e, $00,$7e, $00,$7e, $00,$7e, $00,$7e,
Expand Down Expand Up @@ -115,7 +139,7 @@ const TILE_MAP_0 = $9800
*/

// tilemap data
/* todo static TILEMAP_DATA: [u8] = [
/* todo static TILEMAP_DATA: [u8; _] = [
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, 0,0,0,0,0,0,0,0,0,0,0,0,
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, 0,0,0,0,0,0,0,0,0,0,0,0,
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, 0,0,0,0,0,0,0,0,0,0,0,0,
Expand Down
3 changes: 3 additions & 0 deletions src/ast/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ pub enum Token {
GreaterThan,
#[regex(r"<", priority = 2)]
LessThan,
#[regex(r"&", priority = 2)]
Ampersand,

/// `//` starts a single-line comment, which goes to the end of the line.
#[regex(r"//[^\r\n]*", priority = 2)]
Expand Down Expand Up @@ -237,6 +239,7 @@ impl core::fmt::Display for Token {
Token::TokenError => write!(f, "TokenError"),
Token::GreaterThan => write!(f, ">"),
Token::LessThan => write!(f, "<"),
Token::Ampersand => write!(f, "&"),
}
}
}

0 comments on commit 3c94b5a

Please sign in to comment.