avatar
Articles
29
Tags
25
Categories
16
Home
Tags
Categories
Archives
Food
Link
About
r1cebank's code & 🍗 & ✈️Useful Rust crates
Home
Tags
Categories
Archives
Food
Link
About

Useful Rust crates

Created2020-12-03|Updated2025-01-06|ProgrammingLearnings
|Post Views:

static_assertions

https://crates.io/crates/static_assertions

compile time assertions for rust

rusty-fork

https://crates.io/crates/rusty-fork

provide a way to run unit test in “forks”

insta

https://crates.io/crates/insta

snapshot testing in rust

quote

https://crates.io/crates/quote

marco to turn rust syntax tree data structure into token of source code

Author: r1cebank
Link: https://r1ce.net/2020/12/04/rust-useful-crates-1/
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
programmingrust
cover of previous post
Previous
How Pokemon Red implemented flashing stars
I’ve been writing my gameboy emulator in rust and I had a lot of issues getting this startup screen to display properly, later I’ve realized it was achieved using the clever pallet swapping in runtime. For pokemon red, the start screen flashing start is made possible by changing palette during runtime. 12345let palette_num = if sprite.use_palette_1 { self.op1 } else { self.op0 ...
cover of next post
Next
Sega Nu keychip (part 1)
IntroductionIn the Sega Nu systems, system boot and application start is gated by the mysterious “keychip”. A lot of systems sold online do not include the keychip since they are property of Sega and needed to be returned once the operator terminate contract with Sega. I was lucky enough to find two keychip being auctioned and I want to document my reverse engineering efforts. Hopefull later people are able to use this information to reconstruct keychip for the game they want to launch and...
Related Articles
cover
2020-11-26
Emulating Gameboy with Rust
It’s been a while since I finished the CHIP-8 emulator, the CHIP-8 emulator was mostly capable of running PONG, but at the end I still haven’t figured out how to get input work correctly. This time I want to try to experiment with the Gameboy, it will be much harder to emulate given the increased number of instructions and a palette. DMG-01 Also known as the “original gameboy” Hardware Overview CPU: Custom 8-bit sharp at 4.19MHZ Resolution: 160*144 Framerate: 59.727hz Memory: 8KiB...
cover
2020-12-07
How Pokemon Red implemented flashing stars
I’ve been writing my gameboy emulator in rust and I had a lot of issues getting this startup screen to display properly, later I’ve realized it was achieved using the clever pallet swapping in runtime. For pokemon red, the start screen flashing start is made possible by changing palette during runtime. 12345let palette_num = if sprite.use_palette_1 { self.op1 } else { self.op0 ...
cover
2020-06-24
StyleGAN2 generation with Genome
Previously I have written a simple library called genome using Javascript repo. The idea came to me when I wanted to build something like cryptokittie (crypto cat breeding and trading). I wanted a way to generate random values that can be used to generate random things, also the ability to merge these values. The project is really crude, it basically stores 4 markers and 1 influence as number. When merging two DNA together, there is random change that one gene might mutate. There are 5 type...
cover
2020-11-09
Modules in Rust 2018
Modules in Rust 2018https://doc.rust-lang.org/nightly/edition-guide/rust-2018/module-system/path-clarity.html Rust 2015.├── lib.rs└── foo/ ├── mod.rs └── bar.rs Rust 2018.├── lib.rs├── foo.rs└── foo/ └── bar.rs In top level, the same level of the main.rs 123// module.rspub fn some_module_fn() {} Then if you want to add more stuff in the module, helper functions, sub-modules, add them in the folder named the same name as your module. 123// In...
avatar
r1cebank
Articles
29
Tags
25
Categories
16
Follow Me
Announcement
Welcome to my blog, this is where I record learnings and write about random stuff. Enjoy ❤️
旧博客内容导入完成,会时不时的更新新内容
Contents
  1. 1. static_assertions
  2. 2. rusty-fork
  3. 3. insta
  4. 4. quote
Recent Posts
2024 Review
2024 Review2025-01-06
Private Pilot License Study Plan 1
Private Pilot License Study Plan 12024-05-25
Sega Nu Preservation
Sega Nu Preservation2023-12-22
Alchitry Cu Review
Alchitry Cu Review2022-05-11
在家工作简单食谱
在家工作简单食谱2022-02-26
©2021 - 2025 By r1cebank
Framework Hexo|Theme Butterfly
Made with ❤️ in Vancouver