diff --git a/Cargo.lock b/Cargo.lock index fb7bb7e9..7172fee1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,21 +17,6 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "anyhow" version = "1.0.92" @@ -110,26 +95,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "crossbeam-queue" version = "0.3.11" @@ -208,7 +173,6 @@ checksum = "05669f8e7e2d7badc545c513710f0eba09c2fbef683eb859fd79c46c355048e0" dependencies = [ "bitflags 1.3.2", "byteorder", - "chrono", "log", ] @@ -264,12 +228,12 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#513d2c71276441d1951281eef0f27d5f94d1f738" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#0374848b283f29547625c76e7629d5d61bac3109" [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#513d2c71276441d1951281eef0f27d5f94d1f738" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#0374848b283f29547625c76e7629d5d61bac3109" dependencies = [ "hashbrown 0.15.1", "hbbytecode", @@ -281,34 +245,11 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#513d2c71276441d1951281eef0f27d5f94d1f738" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#0374848b283f29547625c76e7629d5d61bac3109" dependencies = [ "hbbytecode", ] -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "icu_collections" version = "1.5.0" @@ -458,15 +399,6 @@ dependencies = [ "hashbrown 0.15.1", ] -[[package]] -name = "js-sys" -version = "0.3.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "kernel" version = "0.2.0" @@ -567,15 +499,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - [[package]] name = "once_cell" version = "1.20.2" @@ -986,61 +909,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasm-bindgen" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" - [[package]] name = "webpki-roots" version = "0.26.6" @@ -1050,15 +918,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.52.0" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 3f7e4bcb..9cbe8956 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -24,10 +24,6 @@ version = "0.3" default-features = false features = ["alloc", "nightly"] -# [dependencies.clparse] -# git = "https://git.ablecorp.us/ableos/ableos_userland" -# default-features = false - [dependencies.derive_more] version = "1" default-features = false diff --git a/repbuild/Cargo.toml b/repbuild/Cargo.toml index a681d458..2b7fc845 100644 --- a/repbuild/Cargo.toml +++ b/repbuild/Cargo.toml @@ -6,29 +6,15 @@ edition = "2021" [dependencies] str-reader = "0.1" derive_more = { version = "1", default-features = false, features = [ - "add", - "add_assign", - "constructor", "display", - "from", - "into", - "mul", - "mul_assign", - "not", - "sum", ] } error-stack = "0.5" -fatfs = "0.3" -toml = "0.8" -hblang = { git = "https://git.ablecorp.us/AbleOS/holey-bytes.git", features = [ +fatfs = { version = "0.3", default-features = false, features = [ "std", - # "opts", -], default-features = false } + "alloc", +] } +toml = "0.8" +hblang.git = "https://git.ablecorp.us/AbleOS/holey-bytes.git" log = "0.4" raw-cpuid = "11" ureq = { version = "2", default-features = false, features = ["tls"] } - -# [dependencies.reqwest] -# version = "0.12" -# default-features = false -# features = ["rustls-tls", "blocking"] diff --git a/sysdata/libraries/stn/src/assets/sin_table b/sysdata/libraries/stn/src/assets/sin_table deleted file mode 100644 index 0d1c9d8b..00000000 Binary files a/sysdata/libraries/stn/src/assets/sin_table and /dev/null differ diff --git a/sysdata/libraries/stn/src/assets/this-is-temporary b/sysdata/libraries/stn/src/assets/this-is-temporary deleted file mode 100644 index e69de29b..00000000 diff --git a/sysdata/libraries/stn/src/math.hb b/sysdata/libraries/stn/src/math.hb index 9d0910de..64ba6b82 100644 --- a/sysdata/libraries/stn/src/math.hb +++ b/sysdata/libraries/stn/src/math.hb @@ -33,8 +33,6 @@ Vec2 := fn($Expr: type): type { /* source: https://github.com/baker-Xie/FastMath/blob/master/include/fast_math.h */ -// ! heavily broken, possibly due to compiler bug... or skill issues - PI := 3.14159265358979323846 SIN_TABLE := [f32].(0.0, 0.02454122852291229, 0.04906767432741801, 0.07356456359966743, 0.0980171403295606, 0.1224106751992162, 0.1467304744553617, 0.1709618887603012, 0.1950903220161282, 0.2191012401568698, 0.2429801799032639, 0.2667127574748984, 0.2902846772544623, 0.3136817403988915, 0.3368898533922201, 0.3598950365349881, 0.3826834323650898, 0.4052413140049899, 0.4275550934302821, 0.4496113296546065, 0.4713967368259976, 0.492898192229784, 0.5141027441932217, 0.5349976198870972, 0.5555702330196022, 0.5758081914178453, 0.5956993044924334, 0.6152315905806268, 0.6343932841636455, 0.6531728429537768, 0.6715589548470183, 0.6895405447370668, 0.7071067811865475, 0.7242470829514669, 0.7409511253549591, 0.7572088465064845, 0.773010453362737, 0.7883464276266062, 0.8032075314806448, 0.8175848131515837, 0.8314696123025452, 0.844853565249707, 0.8577286100002721, 0.8700869911087113, 0.8819212643483549, 0.8932243011955153, 0.9039892931234433, 0.9142097557035307, 0.9238795325112867, 0.9329927988347388, 0.9415440651830208, 0.9495281805930367, 0.9569403357322089, 0.9637760657954398, 0.970031253194544, 0.9757021300385286, 0.9807852804032304, 0.9852776423889412, 0.989176509964781, 0.99247953459871, 0.9951847266721968, 0.9972904566786902, 0.9987954562051724, 0.9996988186962042, 1.0, 0.9996988186962042, 0.9987954562051724, 0.9972904566786902, 0.9951847266721969, 0.99247953459871, 0.989176509964781, 0.9852776423889412, 0.9807852804032304, 0.9757021300385286, 0.970031253194544, 0.9637760657954398, 0.9569403357322089, 0.9495281805930367, 0.9415440651830208, 0.9329927988347388, 0.9238795325112867, 0.9142097557035307, 0.9039892931234434, 0.8932243011955152, 0.881921264348355, 0.8700869911087115, 0.8577286100002721, 0.8448535652497072, 0.8314696123025455, 0.8175848131515837, 0.8032075314806449, 0.7883464276266063, 0.7730104533627371, 0.7572088465064847, 0.740951125354959, 0.7242470829514669, 0.7071067811865476, 0.6895405447370671, 0.6715589548470186, 0.6531728429537766, 0.6343932841636455, 0.6152315905806269, 0.5956993044924335, 0.5758081914178454, 0.5555702330196022, 0.5349976198870972, 0.5141027441932218, 0.4928981922297841, 0.4713967368259979, 0.4496113296546069, 0.427555093430282, 0.4052413140049899, 0.3826834323650899, 0.3598950365349883, 0.3368898533922203, 0.3136817403988914, 0.2902846772544624, 0.2667127574748985, 0.2429801799032641, 0.21910124015687, 0.1950903220161286, 0.1709618887603012, 0.1467304744553618, 0.1224106751992163, 0.09801714032956083, 0.07356456359966773, 0.04906767432741797, 0.02454122852291233, 0.0, -0.02454122852291208, -0.04906767432741772, -0.0735645635996675, -0.09801714032956059, -0.1224106751992161, -0.1467304744553616, -0.170961888760301, -0.1950903220161284, -0.2191012401568698, -0.2429801799032638, -0.2667127574748983, -0.2902846772544621, -0.3136817403988912, -0.3368898533922201, -0.3598950365349881, -0.3826834323650897, -0.4052413140049897, -0.4275550934302818, -0.4496113296546067, -0.4713967368259976, -0.4928981922297839, -0.5141027441932216, -0.5349976198870969, -0.555570233019602, -0.5758081914178453, -0.5956993044924332, -0.6152315905806267, -0.6343932841636453, -0.6531728429537765, -0.6715589548470184, -0.6895405447370668, -0.7071067811865475, -0.7242470829514668, -0.7409511253549589, -0.7572088465064842, -0.7730104533627367, -0.7883464276266059, -0.8032075314806451, -0.8175848131515838, -0.8314696123025452, -0.844853565249707, -0.857728610000272, -0.8700869911087113, -0.8819212643483549, -0.8932243011955152, -0.9039892931234431, -0.9142097557035305, -0.9238795325112865, -0.932992798834739, -0.9415440651830208, -0.9495281805930367, -0.9569403357322088, -0.9637760657954398, -0.970031253194544, -0.9757021300385285, -0.9807852804032303, -0.9852776423889411, -0.9891765099647809, -0.9924795345987101, -0.9951847266721969, -0.9972904566786902, -0.9987954562051724, -0.9996988186962042, -1.0, -0.9996988186962042, -0.9987954562051724, -0.9972904566786902, -0.9951847266721969, -0.9924795345987101, -0.9891765099647809, -0.9852776423889412, -0.9807852804032304, -0.9757021300385286, -0.970031253194544, -0.96377606579544, -0.9569403357322089, -0.9495281805930368, -0.9415440651830209, -0.9329927988347391, -0.9238795325112866, -0.9142097557035306, -0.9039892931234433, -0.8932243011955153, -0.881921264348355, -0.8700869911087115, -0.8577286100002722, -0.8448535652497072, -0.8314696123025455, -0.817584813151584, -0.8032075314806453, -0.7883464276266061, -0.7730104533627369, -0.7572088465064846, -0.7409511253549591, -0.724247082951467, -0.7071067811865477, -0.6895405447370672, -0.6715589548470187, -0.6531728429537771, -0.6343932841636459, -0.6152315905806274, -0.5956993044924332, -0.5758081914178452, -0.5555702330196022, -0.5349976198870973, -0.5141027441932219, -0.4928981922297843, -0.4713967368259979, -0.449611329654607, -0.4275550934302825, -0.4052413140049904, -0.3826834323650904, -0.359895036534988, -0.33688985339222, -0.3136817403988915, -0.2902846772544625, -0.2667127574748986, -0.2429801799032642, -0.2191012401568702, -0.1950903220161287, -0.1709618887603018, -0.1467304744553624, -0.122410675199216, -0.09801714032956051, -0.07356456359966741, -0.04906767432741809, -0.02454122852291245) diff --git a/sysdata/programs/render_example/src/examples/text.hb b/sysdata/programs/render_example/src/examples/text.hb index d0490345..67b9d9d0 100644 --- a/sysdata/programs/render_example/src/examples/text.hb +++ b/sysdata/programs/render_example/src/examples/text.hb @@ -1,19 +1,42 @@ .{memory, log, string} := @use("../../../../libraries/stn/src/lib.hb") render := @use("../../../../libraries/render/src/lib.hb") -/* expected result: - trash notepad app, colours should change with r,g,b,w keys */ +/* expected result: almost-not-trash notepad app + very jank + ----------------- + features: + - basic keys + - holding support with DAS + - visible cursor + - shift key support +*/ psf := @embed("../../../../consolefonts/tamsyn/10x20r.psf") -send_byte := fn(byte: u8): u8 { - memory.outb(96, byte) - return memory.inb(96) +handle_char := fn(char: u8, cursor: ^u8, buf: ^u8): ^u8 { + if char == 0 { + return cursor + } + if char != 0x8 { + *cursor = char + return cursor + 1 + } else if char == 0xA { + *cursor = 32 + cursor += 1; + *cursor = 92 + return cursor + 1 + } else if cursor > buf { + cursor -= 1; + *cursor = 32 + return cursor + } + return cursor } example := fn(): void { screen := render.init(true) - font := render.text.font_from_psf2(@bitcast(&psf), false) + window := render.new_surface(480, 340) + font := render.text.font_from_psf2(@bitcast(&psf), true) msg := "ableboard (tm) (patent pending):\n\0" msg_len := string.length(msg) @@ -25,147 +48,86 @@ example := fn(): void { if font == null { return - } + }; - _ = send_byte(238) - log.info("PS/2 Driver Loaded\0") - if send_byte(238) == 238 { - log.info("PS/2 Keyboard Echoed\0") - } - if send_byte(244) == 250 { - log.info("Enabled scanning\0") - } + *cursor = 95 + draw(screen, window, font, buf); + *cursor = 0 - color := render.white + memory.outb(96, 238) + memory.outb(96, 238) + memory.outb(96, 244) + + prev_input := @as(u8, 0xFF) + current_key := @as(u8, 0) + holding_timer := @as(u32, 0) + is_shift_pressed := @as(bool, false) + + initial_delay := @as(u32, 50) + repeat_delay := @as(u32, 7) - prev_input := 250 loop { input := memory.inb(96) - if input != prev_input { - prev_input = input - char := map_keys(input) - if char != 0 { - if char == 0xA { - *cursor = 32 - cursor += 1; - *cursor = 92 - cursor += 1 - } else if char == 0x72 { - color = render.red - } else if char == 0x67 { - color = render.green - } else if char == 0x62 { - color = render.blue - } else if char == 0x77 { - color = render.white - } else if char == 0xE { - cursor -= 1; - *cursor = 32 + is_release := (input & 0x80) != 0 + key_code := input & 0x7F - continue - }; - *cursor = char - cursor += 1 + if input != prev_input { + if is_release { + if key_code == current_key { + current_key = 0 + holding_timer = 0 + } else if input == 0xAA | input == 0xB6 { + is_shift_pressed = false + } + } else { + if input == 0x2A | input == 0x36 { + is_shift_pressed = true + } else { + current_key = input + holding_timer = 1 + cursor = handle_char(map_keys(current_key, is_shift_pressed), cursor, buf) + } + } + prev_input = input + } + + if current_key != 0 & holding_timer > 0 { + holding_timer += 1 + + if holding_timer >= initial_delay { + cursor = handle_char(map_keys(current_key, is_shift_pressed), cursor, buf) + holding_timer = initial_delay - repeat_delay + } + }; + *cursor = 95 + draw(screen, window, font, buf); + *cursor = 0 + + if holding_timer > 0 & current_key != 0 { + if (memory.inb(96) & 0x80) != 0 { + current_key = 0 + holding_timer = 0 } } - render.clear(screen, render.black) - render.put_rect(screen, .(0, 0), .(screen.width - 1, screen.height - 1), render.white) - render.put_text(screen, font, .(0, 0), color, buf) - - render.sync(screen) } return } -map_keys := fn(inp: u8): u8 { - if inp == 0x29 { - return 0x7E - } else if inp == 0x2 { - return 0x31 - } else if inp == 0x3 { - return 0x32 - } else if inp == 0x4 { - return 0x33 - } else if inp == 0x5 { - return 0x34 - } else if inp == 0x6 { - return 0x35 - } else if inp == 0x7 { - return 0x36 - } else if inp == 0x8 { - return 0x37 - } else if inp == 0x9 { - return 0x38 - } else if inp == 0xA { - return 0x39 - } else if inp == 0xB { - return 0x30 - } else if inp == 0xC { - return 0x2D - } else if inp == 0xD { - return 0x3D - } else if inp == 0xE { - return 0xE - } else if inp == 0x1C { - return 0xA - } else if inp == 0x10 { - return 0x71 - } else if inp == 0x11 { - return 0x77 - } else if inp == 0x12 { - return 0x65 - } else if inp == 0x13 { - return 0x72 - } else if inp == 0x14 { - return 0x74 - } else if inp == 0x15 { - return 0x79 - } else if inp == 0x16 { - return 0x75 - } else if inp == 0x17 { - return 0x69 - } else if inp == 0x18 { - return 0x6F - } else if inp == 0x19 { - return 0x70 - } else if inp == 0x1E { - return 0x61 - } else if inp == 0x1F { - return 0x73 - } else if inp == 0x20 { - return 0x64 - } else if inp == 0x21 { - return 0x66 - } else if inp == 0x22 { - return 0x67 - } else if inp == 0x23 { - return 0x68 - } else if inp == 0x24 { - return 0x6A - } else if inp == 0x25 { - return 0x6B - } else if inp == 0x26 { - return 0x6C - } else if inp == 0x2C { - return 0x7A - } else if inp == 0x2D { - return 0x78 - } else if inp == 0x2E { - return 0x63 - } else if inp == 0x2F { - return 0x76 - } else if inp == 0x30 { - return 0x62 - } else if inp == 0x31 { - return 0x6E - } else if inp == 0x32 { - return 0x6D - } else if inp == 0x2B { - return 0x5C - } else if inp == 0x39 { - return 32 - } else { - return 0 +draw := fn(screen: render.Surface, window: render.Surface, font: render.text.Font, buf: ^u8): void { + render.clear(screen, render.black) + render.clear(window, render.black) + render.put_rect(window, .(0, 0), .(window.width - 1, window.height - 1), render.white) + render.put_text(window, font, .(7, 7), render.gray, buf) + render.put_surface(screen, window, .(100, 100), false) + render.sync(screen) +} + +ps2_table := [u8].(0x0, 0x1B, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x2D, 0x3D, 0x8, 0x9, 0x71, 0x77, 0x65, 0x72, 0x74, 0x79, 0x75, 0x69, 0x6F, 0x70, 0x5B, 0x5D, 0xA, 0x0, 0x61, 0x73, 0x64, 0x66, 0x67, 0x68, 0x6A, 0x6B, 0x6C, 0x3B, 0x27, 0x60, 0x0, 0x5C, 0x7A, 0x78, 0x63, 0x76, 0x62, 0x6E, 0x6D, 0x2C, 0x2E, 0x2F, 0x0, 0x2A, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1B, 0x21, 0x40, 0x23, 0x24, 0x25, 0x5E, 0x26, 0x2A, 0x28, 0x29, 0x5F, 0x2B, 0x8, 0x9, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, 0x4F, 0x50, 0x7B, 0x7D, 0xA, 0x0, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4A, 0x4B, 0x4C, 0x3A, 0x22, 0x7E, 0x0, 0x7C, 0x5A, 0x58, 0x43, 0x56, 0x42, 0x4E, 0x4D, 0x3C, 0x3E, 0x3F, 0x0, 0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + +map_keys := fn(scancode: u8, shift: bool): u8 { + if shift { + return ps2_table[scancode + 0x40] } + return ps2_table[scancode] } \ No newline at end of file diff --git a/sysdata/programs/render_example/src/main.hb b/sysdata/programs/render_example/src/main.hb index 06644f71..77cb04c0 100644 --- a/sysdata/programs/render_example/src/main.hb +++ b/sysdata/programs/render_example/src/main.hb @@ -1 +1 @@ -.{example: main} := @use("./examples/image.hb") \ No newline at end of file +.{example: main} := @use("./examples/text.hb") \ No newline at end of file diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 082f3611..34b3a7ba 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -28,8 +28,8 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.diskio_driver] # path = "boot:///diskio_driver.hbf" -# [boot.limine.ableos.modules.render_example] -# path = "boot:///render_example.hbf" +[boot.limine.ableos.modules.render_example] +path = "boot:///render_example.hbf" # [boot.limine.ableos.modules.serial_driver] # path = "boot:///serial_driver.hbf"