Skip to content

Instantly share code, notes, and snippets.

View ao-kenji's full-sized avatar

Kenji Aoyama ao-kenji

View GitHub Profile
@ao-kenji
ao-kenji / yaft-luna88k-8bpp-20140810a.diff
Created August 10, 2014 11:16
yaft ( http://uobikiemukot.github.io/yaft/ ) on OpenBSD/luna88k, take 3. Now we can also use 12x24 font.
diff --git a/draw.h b/draw.h
index 9871ba3..b31bd02 100644
--- a/draw.h
+++ b/draw.h
@@ -1,6 +1,8 @@
/* See LICENSE for licence details. */
static inline void draw_sixel(struct framebuffer *fb, int line, int col, uint8_t *bitmap)
{
+ /* XXX: Maybe need to re-write on LUNA */
+
@ao-kenji
ao-kenji / yaft-luna88k-8bpp-sixel-20140812.diff
Created August 12, 2014 14:23
yaft ( http://uobikiemukot.github.io/yaft/ ) on OpenBSD/luna88k, sixel drawing diff.
diff --git a/draw.h b/draw.h
index 9871ba3..ad594f8 100644
--- a/draw.h
+++ b/draw.h
@@ -3,29 +3,68 @@ static inline void draw_sixel(struct framebuffer *fb, int line, int col, uint8_t
{
int h, w, src_offset, dst_offset;
uint32_t pixel, color = 0;
+ int x, y, i;
+ uint32_t *p0, *p;
@ao-kenji
ao-kenji / yaft-luna88k-8bpp-20140813.diff
Created August 13, 2014 10:47
yaft ( http://uobikiemukot.github.io/yaft/ ) on OpenBSD/luna88k, take 4. 8bpp and sixel supported, clean-up version.
diff --git a/draw.h b/draw.h
index 541688d..afa3ef0 100644
--- a/draw.h
+++ b/draw.h
@@ -1,6 +1,49 @@
/* See LICENSE for licence details. */
+
+/*
+ * LUNA framebuffer support is based on:
+ * OpenBSD:src/sys/arch/luna88k/dev/omrasops.c
@ao-kenji
ao-kenji / yaft-luna88k-8bpp-20140827.diff
Created August 27, 2014 12:56
yaft ( http://uobikiemukot.github.io/yaft/ ) on OpenBSD/luna88k, take 5. Add getting back to original screen mode when exit, etc.
diff --git a/draw.h b/draw.h
index 541688d..afa3ef0 100644
--- a/draw.h
+++ b/draw.h
@@ -1,6 +1,49 @@
/* See LICENSE for licence details. */
+
+/*
+ * LUNA framebuffer support is based on:
+ * OpenBSD:src/sys/arch/luna88k/dev/omrasops.c
console is keyboard/display
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved. http://www.OpenBSD.org
OpenBSD 5.6-current (GENERIC) #197: Tue Aug 26 19:38:01 MDT 2014
[email protected]:/usr/src/sys/arch/sparc64/compile/GENERIC
real mem = 671088640 (640MB)
avail mem = 645857280 (615MB)
mpath0 at root
scsi-initiator-id=7
keyboard-click?=false
keymap=
ttyb-rts-dtr-off=false
ttyb-ignore-cd=true
ttya-rts-dtr-off=false
ttya-ignore-cd=true
ttyb-mode=9600,8,n,1,-
ttya-mode=9600,8,n,1,-
pcia-probe-list=1
@ao-kenji
ao-kenji / yaft-obsd-sparc64-20140831.diff
Created August 31, 2014 11:41
yaft ( http://uobikiemukot.github.io/yaft/ ) on OpenBSD/sparc64 (with creator(4) frame buffer).
diff --git a/fb/openbsd.h b/fb/openbsd.h
index 05903c6..6938097 100644
--- a/fb/openbsd.h
+++ b/fb/openbsd.h
@@ -14,6 +14,7 @@ typedef unsigned long u_long;
#include <dev/wscons/wsksymdef.h>
/* some structs for OpenBSD */
+/* XXX: actually not used in OpenBSD/sparc64 */
enum term_size {
@ao-kenji
ao-kenji / luna88k-rop-140917-2.diff
Created September 17, 2014 14:01
Using 'OR2' ROP version.
Index: omrasops.c
===================================================================
RCS file: /cvs/src/sys/arch/luna88k/dev/omrasops.c,v
retrieving revision 1.11
diff -u -r1.11 omrasops.c
--- omrasops.c 2 Jan 2014 15:30:34 -0000 1.11
+++ omrasops.c 17 Sep 2014 13:53:16 -0000
@@ -158,7 +158,7 @@
struct rasops_info *ri = cookie;
u_int8_t *p;
@ao-kenji
ao-kenji / luna88k-rop-140919-1.diff
Created September 19, 2014 13:22
[Merged into original tree] A trial to use LUNA frame buffer's ROP function on OpenBSD/luna88k. It makes 4bpp putchar about 20% faster.
Index: sys/arch/luna88k/dev/omrasops.c
===================================================================
RCS file: /cvs/src/sys/arch/luna88k/dev/omrasops.c,v
retrieving revision 1.11
diff -u -r1.11 omrasops.c
--- sys/arch/luna88k/dev/omrasops.c 2 Jan 2014 15:30:34 -0000 1.11
+++ sys/arch/luna88k/dev/omrasops.c 19 Sep 2014 13:22:11 -0000
@@ -175,8 +175,15 @@
width = ri->ri_font->fontwidth + align;
lmask = ALL1BITS >> align;
@ao-kenji
ao-kenji / luna88k-rop-140924-1.diff
Created September 24, 2014 12:04
Change the drawing order, but the speed is almost the same as luna88k-rop-140919-1.diff.
Index: sys/arch/luna88k/dev/omrasops.c
===================================================================
RCS file: /cvs/src/sys/arch/luna88k/dev/omrasops.c,v
retrieving revision 1.11
diff -u -r1.11 omrasops.c
--- sys/arch/luna88k/dev/omrasops.c 2 Jan 2014 15:30:34 -0000 1.11
+++ sys/arch/luna88k/dev/omrasops.c 24 Sep 2014 11:55:24 -0000
@@ -175,8 +175,15 @@
width = ri->ri_font->fontwidth + align;
lmask = ALL1BITS >> align;