From: Robin Krens Date: Sat, 11 Jun 2022 20:02:44 +0000 (+0200) Subject: main: inport calls X-Git-Url: https://robinkrens.nl/gitweb/?a=commitdiff_plain;h=d8e97c9bdd1e1e67f13f289daa780755ad4d307c;p=swan-dev main: inport calls --- diff --git a/src/main.c b/src/main.c index bd4a86b..6558f99 100644 --- a/src/main.c +++ b/src/main.c @@ -45,6 +45,20 @@ void outport(unsigned char portnr, unsigned char val) :); } +unsigned char inport(unsigned char portnr) +{ + unsigned char val; + __asm__( + "mov %1, %%dl\n\t" + "in (%%dx), %%al\n\t" + "mov %%al, %0" + : "=r"(val) + : "r"(portnr) + :); + + return val; +} + __attribute__ ((naked)) void * dummy_isr(void) { int a = 2; @@ -70,13 +84,17 @@ void init_video(void) int main(void) { - lol[0] = 0xDD; - lol[1] = 0xDD; + outport(0x15, 0x99); + unsigned char ret = inport(0x15); + + lol[0] = 0xAA; + lol[1] = ret; blaat[0] = 0xEE; blaat[1] = 0xEE; blaat[32] = 0xEE; + setup_ivec(); init_video(); outport(IO_VIDEO_MODE, VMODE_16C_CHK | VMODE_CLEANINIT);