c++/rgb-assembler/commands/Color.h
changeset 24 e24883b00180
parent 20 b9ceffdcaf14
child 29 10d6964e7b4a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/c++/rgb-assembler/commands/Color.h	Sat Dec 23 23:47:37 2017 +0100
     1.3 @@ -0,0 +1,23 @@
     1.4 +#pragma once
     1.5 +
     1.6 +#include <wchar.h>
     1.7 +
     1.8 +#include "../Command.h"
     1.9 +
    1.10 +namespace commands {
    1.11 +
    1.12 +class Color : public Command {
    1.13 +public:
    1.14 +
    1.15 +	void process(octet_t* memory, address_t& index) override {
    1.16 +		led_t led = read<led_t>(memory, index);
    1.17 +		color_t r = read<color_t>(memory, index);
    1.18 +		color_t g = read<color_t>(memory, index);
    1.19 +		color_t b = read<color_t>(memory, index);
    1.20 +		wprintf(L"COLOR  %02X %02X %02X → %d\n", r, g, b, led);
    1.21 +	}
    1.22 +private:
    1.23 +
    1.24 +};
    1.25 +
    1.26 +}