Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
4921c2ac
Commit
4921c2ac
authored
7 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add new pputtext() and pgettext() which also get palette info.
parent
51b74a0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/conio/ciolib.c
+36
-5
36 additions, 5 deletions
src/conio/ciolib.c
src/conio/ciolib.h
+2
-0
2 additions, 0 deletions
src/conio/ciolib.h
with
38 additions
and
5 deletions
src/conio/ciolib.c
+
36
−
5
View file @
4921c2ac
...
...
@@ -103,7 +103,9 @@ CIOLIBEXPORT void CIOLIBCALL ciolib_highvideo(void);
CIOLIBEXPORT
void
CIOLIBCALL
ciolib_lowvideo
(
void
);
CIOLIBEXPORT
void
CIOLIBCALL
ciolib_normvideo
(
void
);
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_puttext
(
int
a
,
int
b
,
int
c
,
int
d
,
void
*
e
);
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_pputtext
(
int
a
,
int
b
,
int
c
,
int
d
,
void
*
e
,
uint32_t
*
f
,
uint32_t
*
g
);
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_gettext
(
int
a
,
int
b
,
int
c
,
int
d
,
void
*
e
);
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_pgettext
(
int
a
,
int
b
,
int
c
,
int
d
,
void
*
e
,
uint32_t
*
f
,
uint32_t
*
g
);
CIOLIBEXPORT
void
CIOLIBCALL
ciolib_textattr
(
int
a
);
CIOLIBEXPORT
void
CIOLIBCALL
ciolib_delay
(
long
a
);
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_putch
(
int
a
);
...
...
@@ -1277,6 +1279,26 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_gettext(int a,int b,int c,int d,void *e)
return
ret
;
}
/* Optional */
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_pgettext
(
int
a
,
int
b
,
int
c
,
int
d
,
void
*
e
,
uint32_t
*
f
,
uint32_t
*
g
)
{
CIOLIB_INIT
();
if
(
cio_api
.
pgettext
==
NULL
)
return
ciolib_gettext
(
a
,
b
,
c
,
d
,
e
);
return
cio_api
.
pgettext
(
a
,
b
,
c
,
d
,
e
,
f
,
g
);
}
/* Optional */
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_pputtext
(
int
a
,
int
b
,
int
c
,
int
d
,
void
*
e
,
uint32_t
*
f
,
uint32_t
*
g
)
{
CIOLIB_INIT
();
if
(
cio_api
.
pputtext
==
NULL
)
return
ciolib_puttext
(
a
,
b
,
c
,
d
,
e
);
return
cio_api
.
pputtext
(
a
,
b
,
c
,
d
,
e
,
f
,
g
);
}
/* Optional */
CIOLIBEXPORT
void
CIOLIBCALL
ciolib_textattr
(
int
a
)
{
...
...
@@ -1303,7 +1325,7 @@ CIOLIBEXPORT void CIOLIBCALL ciolib_delay(long a)
}
/* Optional */
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_putch
(
int
a
)
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_
c
putch
(
uint32_t
fg
,
uint32_t
bg
,
int
a
)
{
unsigned
char
a1
=
a
;
unsigned
char
buf
[
2
];
...
...
@@ -1407,13 +1429,18 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_putch(int a)
}
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_cputch
(
uint32_t
fg_palette
,
uint32_t
bg_palette
,
int
a
)
/* Optional */
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_putch
(
int
a
)
{
CIOLIB_INIT
();
if
(
cio_api
.
cputch
==
NULL
)
return
ciolib_putch
(
a
);
return
cio_api
.
cputch
(
fg_palette
,
bg_palette
,
a
);
if
(
cio_api
.
putch
==
NULL
)
{
uint32_t
fg
,
bg
;
ciolib_attr2palette
(
cio_textinfo
.
attribute
,
&
fg
,
&
bg
);
return
ciolib_cputch
(
fg
,
bg
,
a
);
}
return
cio_api
.
putch
(
a
);
}
CIOLIBEXPORT
int
CIOLIBCALL
ciolib_ccputs
(
uint32_t
fg_palette
,
uint32_t
bg_palette
,
const
char
*
s
)
...
...
@@ -1632,5 +1659,9 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_attr2palette(uint8_t attr, uint32_t *fg, uint
{
if
(
cio_api
.
attr2palette
)
return
cio_api
.
attr2palette
(
attr
,
fg
,
bg
);
/*
* TODO: If we want to be able to cross screens, we need some
* mapping for non-plaette aware things.
*/
return
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
src/conio/ciolib.h
+
2
−
0
View file @
4921c2ac
...
...
@@ -259,7 +259,9 @@ typedef struct {
int
mouse
;
void
(
*
clreol
)
(
void
);
int
(
*
puttext
)
(
int
,
int
,
int
,
int
,
void
*
);
int
(
*
pputtext
)
(
int
,
int
,
int
,
int
,
void
*
,
uint32_t
*
,
uint32_t
*
);
int
(
*
gettext
)
(
int
,
int
,
int
,
int
,
void
*
);
int
(
*
pgettext
)
(
int
,
int
,
int
,
int
,
void
*
,
uint32_t
*
,
uint32_t
*
);
void
(
*
textattr
)
(
int
);
int
(
*
kbhit
)
(
void
);
void
(
*
delay
)
(
long
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment