tape-kernel 1.0
a modular modern independent kernel
Loading...
Searching...
No Matches
cm.c File Reference
#include "../lib/types.h"
#include "cm.h"
#include "vga.h"
#include "io.h"
#include "../lib/err.h"
Include dependency graph for cm.c:

Go to the source code of this file.

Functions

void __cnb (int *x, int *y)
 cnb syncs current cursor vals too 2 ptrs of vars for them
void __cob (int x, int y)
 cob exports cursor positions
void __scur (void)
 scur shows the hardware text cursor
void __hcur (void)
 hcur hides the hardware text cursor

Function Documentation

◆ __cnb()

void __cnb ( int * x,
int * y )

cnb syncs current cursor vals too 2 ptrs of vars for them

cnb is a function that gets the current cursors x and y position

a common way to use it is

#include "../io/cm.h" //or just cm.h
int cx, cy; //cursor x and cursor y
cnb(&cx, &cy);
#define cnb
Definition cm.h:6
See also
cob()

Definition at line 22 of file cm.c.

References inb, and outb.

◆ __cob()

void __cob ( int x,
int y )

cob exports cursor positions

cob is a function that sets the cursor to a x and y position

use cob with

#include "../io/cm.h" //or just cm.h
cob(0, 0); //or your values
#define cob
Definition cm.h:7
Warning
when coding after running cob you must re-sync your cx and cy, DO NOT DO
cnb(&cx, &cy);
cob(cx, cy + 1);
(rest of code)

the rest of the code will still have the old cursor values and not be syncd, instead do

cnb(&cx, &cy);
cob(cx, cy + 1);
cnb(&cx, &cy);
(rest of code)

this is good because the rest of your code will have up to date cursor positions

See also
cnb()

Definition at line 63 of file cm.c.

References outb, and scrl.

◆ __hcur()

void __hcur ( void )

hcur hides the hardware text cursor

hcur is a function that disables the vga text cursor by setting bit 5 of the cursor start register, making the cursor invisible

using hcur is done with

#include "../io/cm.h" //or just cm.h
hcur();
#define hcur
Definition cm.h:9
See also
scur(), cob()

Definition at line 116 of file cm.c.

References outb.

◆ __scur()

void __scur ( void )

scur shows the hardware text cursor

scur is a function that enables the vga text cursor by writing cursor start and end scanlines to the crtc registers

using scur is done with

#include "../io/cm.h" //or just cm.h
scur();
#define scur
Definition cm.h:8
See also
hcur(), cob()

Definition at line 95 of file cm.c.

References outb.