forked from AbleOS/ableos
Compare commits
No commits in common. "master" and "master" have entirely different histories.
|
@ -406,8 +406,6 @@ fn run(release: bool, target: Target, do_accel: bool) -> Result<(), Error> {
|
|||
"-parallel", "none",
|
||||
"-monitor", "none",
|
||||
"-machine", accel,
|
||||
"-audiodev", "pa,id=speaker",
|
||||
"-machine", "pcspk-audiodev=speaker",
|
||||
"-cpu", "max",
|
||||
"-device", "isa-debug-exit,iobase=0xf4,iosize=0x04",
|
||||
]);
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
- Surface Operations:
|
||||
- FlipV
|
||||
- FlipH
|
||||
- Resize
|
||||
- Wrap the colour operations
|
||||
- Tile
|
||||
- Gradient overlay
|
||||
|
|
|
@ -40,7 +40,6 @@ put_filled_rect := mode.put_filled_rect
|
|||
put_line := mode.put_line
|
||||
clear := mode.clear
|
||||
put_surface := mode.put_surface
|
||||
put_scaled := mode.put_scaled
|
||||
// thanks peony for these three!
|
||||
put_trirect := mode.put_trirect
|
||||
put_vline := mode.put_vline
|
||||
|
|
|
@ -203,77 +203,6 @@ put_surface := fn(surface: Surface, top: Surface, pos: Vec2(int), flip_v: bool):
|
|||
return
|
||||
}
|
||||
|
||||
put_scaled := fn(surface: Surface, source: Surface, pos: Vec2(int), size: Vec2(int)): void {
|
||||
step := Vec2(int).(1, 1)
|
||||
if size.x < 0 {
|
||||
pos.x += source.width - 1
|
||||
size.x = -size.x
|
||||
step.x = -1
|
||||
}
|
||||
if size.y < 0 {
|
||||
pos.y += source.height - 1
|
||||
size.y = -size.y
|
||||
step.y = -1
|
||||
}
|
||||
surface_idx := @inline(index, surface, pos.x, pos.y)
|
||||
|
||||
source_pos := Vec2(int).(0, 0)
|
||||
subpixel_pos := Vec2(int).(0, 0)
|
||||
step_size := size / .(source.width, source.height)
|
||||
if size.x < source.width {
|
||||
step_size.x = source.width / size.x
|
||||
}
|
||||
if size.y < source.height {
|
||||
step_size.y = source.height / size.y
|
||||
}
|
||||
one_up_step := size / (size - step_size * .(source.width, source.height))
|
||||
|
||||
pos = .(0, 0)
|
||||
loop if pos.y >= size.y break else {
|
||||
loop if pos.x >= size.x break else {
|
||||
*surface_idx = *@inline(index, source, source_pos.x, source_pos.y)
|
||||
surface_idx += step.x
|
||||
|
||||
if size.x < source.width {
|
||||
if source_pos.x % one_up_step.x == 0 {
|
||||
source_pos.x += 1
|
||||
}
|
||||
source_pos.x += step_size.x
|
||||
} else {
|
||||
subpixel_pos.x += 1
|
||||
if subpixel_pos.x > step_size.x | source_pos.x % one_up_step.x == 0 & subpixel_pos.x >= step_size.x {
|
||||
source_pos.x += 1
|
||||
subpixel_pos.x = 0
|
||||
}
|
||||
}
|
||||
|
||||
pos.x += 1
|
||||
}
|
||||
|
||||
if size.y < source.height {
|
||||
if source_pos.y % one_up_step.y == 0 {
|
||||
source_pos.y += 1
|
||||
}
|
||||
source_pos.y += step_size.y
|
||||
} else {
|
||||
subpixel_pos.y += 1
|
||||
if subpixel_pos.y > step_size.y | source_pos.y % one_up_step.y == 0 & subpixel_pos.y >= step_size.y {
|
||||
source_pos.y += 1
|
||||
subpixel_pos.y = 0
|
||||
}
|
||||
}
|
||||
|
||||
surface_idx += surface.width * step.y - size.x * step.x
|
||||
|
||||
source_pos.x = 0
|
||||
pos.x = 0
|
||||
|
||||
pos.y += 1
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// peony-made
|
||||
put_trirect := fn(surface: Surface, pos: Vec2(int), size: Vec2(int), color0: Color, color1: Color): void {
|
||||
step := Vec2(int).(1, 1)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Simple sound driver.
|
|
@ -1,23 +0,0 @@
|
|||
.{memory, log, string} := @use("../../stn/src/lib.hb")
|
||||
|
||||
start := fn(): void {
|
||||
memory.outb(0x61, memory.inb(0x61) | 3)
|
||||
return
|
||||
}
|
||||
|
||||
stop := fn(): void {
|
||||
memory.outb(0x61, memory.inb(0x61) & 0xFC)
|
||||
return
|
||||
}
|
||||
|
||||
set_frequency := fn(frequency: u16): void {
|
||||
dfreq := 0xFFFE & 1193180 / frequency
|
||||
memory.outb(0x43, 0xB6)
|
||||
fmtpage := memory.request_page(1)
|
||||
log.info(string.display_int(@as(u8, @intcast(dfreq) & 0xFF), fmtpage))
|
||||
log.info(string.display_int(@as(u8, @intcast(dfreq >> 8) & 0xFF), fmtpage))
|
||||
memory.outb(0x42, @as(u8, @intcast(dfreq) & 0xFF))
|
||||
memory.outb(0x42, @as(u8, @intcast(dfreq >> 8) & 0xFF))
|
||||
//memory.outb(0x20, 0x20)
|
||||
return
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
[package]
|
||||
name = "mouse_driver"
|
||||
authors = ["peony"]
|
||||
|
||||
[dependants.libraries]
|
||||
|
||||
[dependants.binaries]
|
||||
hblang.version = "1.0.0"
|
||||
|
||||
[build]
|
||||
command = "hblang src/main.hb"
|
|
@ -1,55 +0,0 @@
|
|||
.{memory, buffer, log, string} := @use("../../../libraries/stn/src/lib.hb")
|
||||
|
||||
wait_for := fn(for: u8): void {
|
||||
loop {
|
||||
if (memory.inb(0x64) & 2 >> for) == for {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
send_info := fn(info: u8): void {
|
||||
wait_for(1)
|
||||
memory.outb(0x64, info)
|
||||
}
|
||||
|
||||
send_command := fn(command: u8): void {
|
||||
@inline(send_info, 0xD4)
|
||||
@inline(wait_for, 1)
|
||||
memory.outb(0x60, command)
|
||||
return
|
||||
}
|
||||
|
||||
get_response := fn(): u8 {
|
||||
@inline(wait_for, 0)
|
||||
return memory.inb(0x60)
|
||||
}
|
||||
|
||||
main := fn(): int {
|
||||
format_page := memory.alloc(u8, 1024)
|
||||
|
||||
wait_for(1)
|
||||
memory.outb(0x64, 0xA8)
|
||||
log.info("Aux mouse device enabled.\0")
|
||||
|
||||
send_command(0xF6)
|
||||
get_response()
|
||||
|
||||
send_command(0xF4)
|
||||
get_response()
|
||||
|
||||
loop {
|
||||
loop {
|
||||
if (memory.inb(0x64) & 0x21) == 0x21 break
|
||||
}
|
||||
status := memory.inb(0x60)
|
||||
//log.info("NEGATIVE Y MOVEMENT\0\0")
|
||||
log.info(string.display_int(status, format_page))
|
||||
d_x := memory.inb(0x60)
|
||||
log.info(string.display_int(d_x, format_page))
|
||||
d_y := memory.inb(0x60)
|
||||
log.info(string.display_int(d_y, format_page))
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
[package]
|
||||
name = "mouse_test"
|
||||
authors = ["peony"]
|
||||
|
||||
[dependants.libraries]
|
||||
|
||||
[dependants.binaries]
|
||||
hblang.version = "1.0.0"
|
||||
|
||||
[build]
|
||||
command = "hblang src/main.hb"
|
|
@ -1,3 +0,0 @@
|
|||
main := fn(): int {
|
||||
return 0
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
.{Vec2} := @use("../../../../libraries/stn/src/lib.hb").math
|
||||
render := @use("../../../../libraries/render/src/lib.hb")
|
||||
|
||||
bmp_1 := @embed("./assets/able.bmp")
|
||||
bmp_2 := @embed("./assets/mini.bmp")
|
||||
|
||||
example := fn(): void {
|
||||
screen := render.init(true)
|
||||
|
||||
image := render.image.surface_from_bmp(@bitcast(&bmp_2))
|
||||
|
||||
loop {
|
||||
render.clear(screen, render.black)
|
||||
render.put_scaled(screen, image, .(100, 100), .(image.width / 2 + image.width / 4, image.height * 3))
|
||||
render.sync(screen)
|
||||
}
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
.{example} := @use("./examples/scale.hb")
|
||||
.{example} := @use("./examples/surface.hb")
|
||||
|
||||
main := example
|
|
@ -1,24 +1,13 @@
|
|||
.{log, string, memory, buffer} := @use("../../../libraries/stn/src/lib.hb")
|
||||
sound := @use("../../../libraries/sound/src/lib.hb")
|
||||
|
||||
service_search := fn(): void {
|
||||
a := "\{01}\0"
|
||||
@eca(3, 0, a, 2)
|
||||
return
|
||||
}
|
||||
|
||||
beep := fn(): void {
|
||||
sound.set_frequency(1024)
|
||||
sound.start()
|
||||
return
|
||||
}
|
||||
|
||||
main := fn(): int {
|
||||
//loop {
|
||||
// memory.outb(0x61, memory.inb(0x61) & 0xFE | 1)
|
||||
// memory.outb(0x61, memory.inb(0x61) & 0xFE)
|
||||
//}
|
||||
beep()
|
||||
//service_search()
|
||||
buf := "\0\0\0\0"
|
||||
x := 0
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
default_entry = 1
|
||||
timeout = 0
|
||||
verbose = false
|
||||
interface_resolution = "1600x900x24"
|
||||
# interface_resolution = "640x480x32"
|
||||
# interface_resolution = "1920x1080x24"
|
||||
interface_resolution = "1024x768x24"
|
||||
# interface_resolution = "640x480x24"
|
||||
# Terminal related settings
|
||||
# term_wallpaper = "boot:///background.bmp"
|
||||
term_wallpaper = "boot:///empty-background.bmp"
|
||||
|
@ -15,8 +16,9 @@ comment = "Default AbleOS boot entry."
|
|||
protocol = "limine"
|
||||
kernel_path = "boot:///kernel_${ARCH}"
|
||||
kernel_cmdline = ""
|
||||
# resolution = "640x480x32"
|
||||
resolution = "1600x900x24"
|
||||
# resolution = "1920x1080x24"
|
||||
resolution = "1024x768x24"
|
||||
# resolution = "640x480x24"
|
||||
|
||||
[boot.limine.ableos.modules]
|
||||
|
||||
|
@ -29,8 +31,8 @@ resolution = "1600x900x24"
|
|||
# [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_test]
|
||||
# path = "boot:///serial_driver_test.hbf"
|
||||
|
@ -56,8 +58,5 @@ resolution = "1600x900x24"
|
|||
# [boot.limine.ableos.modules.pumpkin_print]
|
||||
# path = "boot:///pumpkin_print.hbf"
|
||||
|
||||
[boot.limine.ableos.modules.mouse_driver]
|
||||
path = "boot:///mouse_driver.hbf"
|
||||
|
||||
[boot.limine.ableos.modules.mouse_test]
|
||||
path = "boot:///mouse_test.hbf"
|
||||
# [boot.limine.ableos.modules.tetris]
|
||||
# path = "boot:///tetris.hbf"
|
||||
|
|
Loading…
Reference in a new issue