Crates.io | olympia_derive |
lib.rs | olympia_derive |
version | 0.3.0 |
source | src |
created_at | 2020-05-10 14:14:30.6748 |
updated_at | 2020-05-10 14:14:30.6748 |
description | Olympia is a gameboy emulator and toolkit, intended to run as a native or web assembly application targeting a cycle count accurate emulation. olympia_derive provides a couple of proc macros used for olympia implementation. |
homepage | https://gitlab.com/tonyfinn/olympia |
repository | https://gitlab.com/tonyfinn/olympia |
max_upload_size | |
id | 239690 |
size | 61,134 |
olympia_derive currently provides one derive macro, OlympiaInstruction.
A usage example for a two argument instruction is below:
#[derive(OlympiaInstruction)]
#[olympia(
opcode=0x00AA_A111,
label="LD",
excluded(0b1010_1100)
)]
struct LoadRegisterConstant8 {
#[olympia(dest, mask=0xA)]
dest: ByteRegisterLookup,
#[olympia(src)]
src: u8,
}
A usage example for one argument instruction is below:
#[derive(OlympiaInstruction)]
#[olympia(
opcode=0x110A_A000,
label="RET",
)]
struct ReturnIf {
#[olympia(single, mask=0xA)]
dest: ByteRegisterLookup,
}
A usage example for no argument instruction is below:
#[derive(OlympiaInstruction)]
#[olympia(
opcode=0x1100_1001,
label="RET",
)]
struct ReturnIf;