c++/rgb-assembler/commands/Color.h
author František Kučera <franta-hg@frantovo.cz>
Sat, 23 Dec 2017 23:47:37 +0100
changeset 24 e24883b00180
parent 20 c++/rgb-assembler/commands/Goto.h@b9ceffdcaf14
child 29 10d6964e7b4a
permissions -rw-r--r--
COLOR in class
franta-hg@20
     1
#pragma once
franta-hg@20
     2
franta-hg@20
     3
#include <wchar.h>
franta-hg@20
     4
franta-hg@20
     5
#include "../Command.h"
franta-hg@20
     6
franta-hg@20
     7
namespace commands {
franta-hg@20
     8
franta-hg@24
     9
class Color : public Command {
franta-hg@20
    10
public:
franta-hg@20
    11
franta-hg@20
    12
	void process(octet_t* memory, address_t& index) override {
franta-hg@24
    13
		led_t led = read<led_t>(memory, index);
franta-hg@24
    14
		color_t r = read<color_t>(memory, index);
franta-hg@24
    15
		color_t g = read<color_t>(memory, index);
franta-hg@24
    16
		color_t b = read<color_t>(memory, index);
franta-hg@24
    17
		wprintf(L"COLOR  %02X %02X %02X → %d\n", r, g, b, led);
franta-hg@20
    18
	}
franta-hg@20
    19
private:
franta-hg@20
    20
franta-hg@20
    21
};
franta-hg@20
    22
franta-hg@20
    23
}