Skip to content

Commit

Permalink
Objects (#2)
Browse files Browse the repository at this point in the history
* start talkin objects.

* .

* progress

* progress.

* .

* .

* more object progress.

* note that our start is incomplete.

* expand example 3

* finish example 3
  • Loading branch information
Lokathor committed Oct 17, 2023
1 parent b855466 commit 8487834
Show file tree
Hide file tree
Showing 10 changed files with 878 additions and 15 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license = "Zlib OR Apache-2.0 OR MIT"
publish = false

[dependencies]
bitfrob = "1.3.0"
voladdress = "1.3.0"

[profile.dev]
Expand Down
1 change: 1 addition & 0 deletions book_src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

* [A Basic Executable](ex1.md)
* [User Input](ex2.md)
* [Objects / Sprites](ex3.md)
Binary file modified book_src/ex2-white-line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions book_src/ex2.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ With the C ABI the caller will never pass data through `r12`, and functions are
That's all that `_start` has to do for now.
Later it will have some setup work to do before calling `main`, but not yet.

### This Is An Incomplete Start Function

**NOTE:** This `_start` function is "incomplete" in the sense that it doesn't initialize RAM.
This means that you can't use any static mutable data with non-zero initial values.
We're not doing that right now, so that's not a problem for us right now, and we'll get to that eventually.
But it is a non-obvious limitation worth mentioning.

## Adding `main` To `ex2.rs`

Now in `ex2.rs` we need to have a `main` function that's `no_mangle`, `extern "C"`, and that doesn't ever return.
Expand Down
Binary file added book_src/ex3-working-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8487834

Please sign in to comment.