Set FP_OFF (), FP_SEG() for the callback function at interrupt setting in WonderWitch
Adjust appropriately according to the setting method. (Fit to wwterm)
UNIXTimer.c: UNIXTimer_Unpause()
((unix_timer -> pause == 1) && (unix_timer -> interrupt_in_pause == 0))
Fixed a bug that was not unix_timer-> pause--; when it was.
(It was not unposted when interrupt was not applied during pause)
Serial receive interrupt, keyboard interrupt added. (corresponding to wwterm, operation confirmed)
Added UNIXSerialPort class.
With this, at WonderWitch,
com_intvector.callback = (void (near *) ()) FP_OFF (com_handler);
com_intvector.cs = _ asm_inline ("\tmov \tax, cs");
com_intvector.ds = _ asm_inline ("\tmov \tax, ds");
sys_interrupt_set_hook (SYS_INT_RECEIVEREADY,
& com_intvector, & com_last_intvector);
Interrupt setting like that shown in Fig.
For warning, add WonX_Warning ().
Move WonX_Error () to WonX.c.
comm_send_string (), text_put_string (), text_put_substring () When executed
Fix output message.
Implement cursor display function. (Add WWCursor class) (Do not blink. Display only)
When displaying the cursor, text information inside WWDisplay_DrawLCDPanel ()
Since we need to be able to read it, we will discontinue the WonXText class and add the WWText class
I moved to a member of the WWDisplay class.
In palette_get_color (), transparent color is displayed when executing WWPalette_GetMappedColors ()
Since it was not considered to be returned as -1, palette_get_color ()
Fixed a bug where return value was wrong value.
Character color palette, LCD color palette initial value, with WonderWitch
It was made to coincide with the initial value.
As a sample, add wwterm - b 05. (Add wwterm target to Makefile)
Version 1.1 - from wonx-1.1.tar.gz
114 lines
3.1 KiB
C
114 lines
3.1 KiB
C
/*****************************************************************************/
|
|
/* ここから */
|
|
/*****************************************************************************/
|
|
|
|
#include "WWPaletteP.h"
|
|
#include "WonX.h"
|
|
#include "etc.h"
|
|
|
|
/*****************************************************************************/
|
|
/* メンバ関数の定義 */
|
|
/*****************************************************************************/
|
|
|
|
int WWPalette_GetNumber(WWPalette p) { return (p->number); }
|
|
int WWPalette_SetNumber(WWPalette p, int n) { return (p->number = n); }
|
|
|
|
int WWPalette_GetTransparent(WWPalette p) { return (p->transparent); }
|
|
int WWPalette_SetTransparent(WWPalette p, int f)
|
|
{ return (p->transparent = f); }
|
|
|
|
WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent)
|
|
{
|
|
WWPalette palette;
|
|
|
|
palette = (WWPalette)malloc(sizeof(_WWPalette));
|
|
if (palette == NULL)
|
|
WonX_Error("WWPalette_Create", "Cannot allocate memory");
|
|
|
|
WWPalette_SetNumber(palette, number);
|
|
WWPalette_SetTransparent(palette, transparent);
|
|
WWPalette_SetMappedColors(palette, mapped_colors);
|
|
|
|
return (palette);
|
|
}
|
|
|
|
WWPalette WWPalette_Destroy(WWPalette palette)
|
|
{
|
|
if (palette == NULL) return (NULL);
|
|
free(palette);
|
|
return (NULL);
|
|
}
|
|
|
|
int * WWPalette_GetMappedColors(WWPalette palette, int * mapped_colors)
|
|
{
|
|
int i;
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
mapped_colors[i] = WWPalette_GetMappedColor(palette, i);
|
|
}
|
|
|
|
return (mapped_colors);
|
|
}
|
|
|
|
int WWPalette_SetMappedColors(WWPalette palette, int * mapped_colors)
|
|
{
|
|
int i;
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
if (mapped_colors == NULL) {
|
|
WWPalette_SetMappedColor(palette, i, (i * 2) + ((i == 3) ? 1 : 0));
|
|
} else {
|
|
WWPalette_SetMappedColor(palette, i, mapped_colors[i]);
|
|
}
|
|
}
|
|
|
|
return (0);
|
|
}
|
|
|
|
int WWPalette_GetMappedColor(WWPalette palette, int color)
|
|
{
|
|
int pixel;
|
|
|
|
pixel = palette->mapped_color[color];
|
|
if (WWPalette_GetTransparent(palette) && (pixel == 0)) {
|
|
pixel = -1;
|
|
}
|
|
return (pixel);
|
|
}
|
|
|
|
int WWPalette_SetMappedColor(WWPalette palette, int color, int mapped_color)
|
|
{
|
|
if (mapped_color == -1) mapped_color = 0;
|
|
return (palette->mapped_color[color] = mapped_color);
|
|
}
|
|
|
|
int WWPalette_PrintData(WWPalette p, FILE * f)
|
|
{
|
|
int i, n;
|
|
|
|
n = WWPalette_GetNumber(p);
|
|
|
|
fprintf(f, "\n");
|
|
|
|
fprintf(f, "palette[%d] :\tnumber = %d\n", n, WWPalette_GetNumber(p));
|
|
fprintf(f, "palette[%d] :\ttransparent = %s\n",
|
|
n, wonx_true_false(WWPalette_GetTransparent(p)));
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
fprintf(f, "palette[%d] :\tcolor[%d] = %d\n",
|
|
n, i, WWPalette_GetMappedColor(p, i));
|
|
}
|
|
|
|
fflush(f);
|
|
|
|
return (0);
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
/* ここまで */
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
/* End of File. */
|
|
/*****************************************************************************/
|