olympia_derive

Crates.ioolympia_derive
lib.rsolympia_derive
version0.3.0
sourcesrc
created_at2020-05-10 14:14:30.6748
updated_at2020-05-10 14:14:30.6748
descriptionOlympia 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.
homepagehttps://gitlab.com/tonyfinn/olympia
repositoryhttps://gitlab.com/tonyfinn/olympia
max_upload_size
id239690
size61,134
Tony Finn (tonyfinn)

documentation

https://docs.rs/olympia_derive

README

olympia_derive

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;
Commit count: 154

cargo fmt