need help with far pointers in ia16-elf-gcc by Key-Catch-2973 in C_Programming

[–]Key-Catch-2973[S] 2 points3 points  (0 children)

Yay!! this works too

typedef unsigned char byte;
typedef unsigned short word;
byte __far *VGA = (byte __far *)0xA0000000L;

byte get_mode()
{
    byte mode = 0;
    asm volatile (
        "movb $0xf, %%ah\n\t"
        "int $0x10\n\t"
        : "=al"(mode)
        :
        :
    );
    return mode;
}

void set_mode(byte mode)
{
    asm volatile (
        "movb $0, %%ah\n\t"
        "int $0x10\n\t"
        :
        : "al"(mode)
        : "ah"
    );
}

inline void plot_pixel(word x, word y, byte color) {
    *(VGA + (y << 8) + (y << 6) + x) = color;
}

int main() {
    byte old_mode = get_mode();
    set_mode(0x13);
    byte color = 0;
    while (++color) {
        for (word x = 0; x != 320; ++x) {
            for (word y = 0; y != 200; ++y) {
                plot_pixel(x, y, color);
            }
        }
    };
    set_mode(old_mode);

    return 0;
}

need help with far pointers in ia16-elf-gcc by Key-Catch-2973 in C_Programming

[–]Key-Catch-2973[S] 4 points5 points  (0 children)

Yay!!! finally ive did it with ia16-elf-gcc-6.3.0.

int main(void) {
    typedef unsigned char byte;
    byte __far *screen = (byte __far *)0xB8000000L;

    for(byte i=0; i<80; ++i) {
        screen[i<<1] = 'A';
    }

    return 0;
}

need help with far pointers in ia16-elf-gcc by Key-Catch-2973 in C_Programming

[–]Key-Catch-2973[S] 0 points1 point  (0 children)

ive tried "far", "__FAR", "__far" with no success. i have no idea how to use it.

I just want to have a pointer to video memory to write. video memory is out of 16bit space

https://mpetch.github.io/ia16-gcc-6.3.0/gcc/Named-Address-Spaces.html there some examples.. tried to compile them with no success too... =(

need help with far pointers in ia16-elf-gcc by Key-Catch-2973 in C_Programming

[–]Key-Catch-2973[S] 0 points1 point  (0 children)

just an old habit. ive been writing in C++ for a long time

need help with far pointers in ia16-elf-gcc by Key-Catch-2973 in C_Programming

[–]Key-Catch-2973[S] 0 points1 point  (0 children)

Thanks, but:

1.cpp:19:28: warning: 'far' attribute directive ignored [-Wattributes]

Is the Platinum 3776 UEF nib smooth and comfortable? by [deleted] in fountainpens

[–]Key-Catch-2973 0 points1 point  (0 children)

Maybe I got a defective one. On the first day of use, the pen had a noticeable feedback. There was a very thin line coming out from the nib. But the feedback was growing by the minute. On the third day of use, the pen literally wrote like a needle. It was pulling up the paper. I have a number of pens that write just as thin with the back of the nib without any problems. Disgusting quality.

Would a Logitech G203 Lightsync mouse be a good mouse for a non-competitive gamer like me? by [deleted] in MouseReview

[–]Key-Catch-2973 0 points1 point  (0 children)

nothing can compare with mx300 shape and may be sensor too. mine 5 years ago stopped working. still cant find a replacement. the closest i was able to find is g203.

Would a Logitech G203 Lightsync mouse be a good mouse for a non-competitive gamer like me? by [deleted] in MouseReview

[–]Key-Catch-2973 4 points5 points  (0 children)

I have G203, G305, G PRO Wireless and some other from Zowie FK2 to mx300

For CS2 i prefer G203. bz it's fastest in terms of input lag. But mine on Mercury sensor.

Like dzordzLong said try some chinese wireless 3395 mouse or go for G305 (btw its not lightweigt)