• R/O
  • SSH
  • HTTPS

chnosproject: Commit


Commit MetaInfo

Revisión72 (tree)
Tiempo2010-03-15 21:34:09
Autorhikarupsp

Log Message

sheet.cを追加。

Cambiar Resumen

Diferencia incremental

--- beta/tolset_chn_000/chnos_006/bootpack.c (revision 71)
+++ beta/tolset_chn_000/chnos_006/bootpack.c (revision 72)
@@ -23,6 +23,7 @@
2323 init_keyboard(&sysfifo, SYSFIFO_KEYB);
2424 init_mouse(&sysfifo, SYSFIFO_MOUSE, &mdec);
2525 init_pit(&time_tick);
26+ init_sheets(vinfo->PhysBasePtr,binfo->scrnx,binfo->scrny);
2627 pit_beep_off();
2728
2829
--- beta/tolset_chn_000/chnos_006/sheet.c (nonexistent)
+++ beta/tolset_chn_000/chnos_006/sheet.c (revision 72)
@@ -0,0 +1,44 @@
1+#include "core.h"
2+
3+struct SHTCTL *ctl;
4+
5+void init_sheets(unsigned int *vram, int xsize, int ysize)
6+{
7+ int i;
8+ ctl = (struct SHTCTL *)memman_alloc_4k(sizeof(struct SHTCTL));
9+ if(ctl == 0) goto err;
10+ ctl->vram = vram;
11+ ctl->xsize = xsize;
12+ ctl->ysize = ysize;
13+ ctl->top = -1;
14+ for(i = 0;i < MAX_SHEETS;i++){
15+ ctl->sheets0[i].flags = SHT_FLAGS_VOID;
16+ }
17+err:
18+ return;
19+
20+}
21+
22+struct SHEET *sheet_alloc(void)
23+{
24+ struct SHEET *sht;
25+ int i;
26+ for(i = 0;i < MAX_SHEETS;i++){
27+ if(ctl->sheets0[i].flags == SHT_FLAGS_VOID){
28+ sht = &ctl->sheets0[i];
29+ sht->flags = SHT_FLAGS_USE;
30+ sht->height = -1;
31+ return sht;
32+ }
33+ }
34+ return 0;
35+}
36+
37+void sheet_setbuf(struct SHEET *sht,unsigned int *buf,int xsize, int ysize, int col_inv)
38+{
39+ sht->buf = buf;
40+ sht->bxsize = xsize;
41+ sht->bysize = ysize;
42+ sht->col_inv = col_inv;
43+ return;
44+}
\ No newline at end of file
--- beta/tolset_chn_000/chnos_006/memory.c (revision 71)
+++ beta/tolset_chn_000/chnos_006/memory.c (revision 72)
@@ -114,4 +114,21 @@
114114 return -1;
115115 }
116116
117+unsigned int memman_alloc_4k(unsigned int size)
118+{
119+ unsigned int a;
120+ size = (size + 0xfff) & 0xfffff000;
121+ a = memman_alloc(size);
122+ return a;
123+}
117124
125+int memman_free_4k(unsigned int addr, unsigned int size)
126+{
127+ int i;
128+ size = (size + 0xfff) & 0xfffff000;
129+ i = memman_free(addr,size);
130+ return i;
131+}
132+
133+
134+
--- beta/tolset_chn_000/chnos_006/Makefile (revision 71)
+++ beta/tolset_chn_000/chnos_006/Makefile (revision 72)
@@ -1,4 +1,4 @@
1-OBJS_BOOTPACK = naskfunc.obj hankaku.obj graphic.obj gdtidt.obj int.obj io.obj fifo.obj keyboard.obj timer.obj mouse.obj memory.obj bootpack.obj
1+OBJS_BOOTPACK = naskfunc.obj hankaku.obj graphic.obj gdtidt.obj int.obj io.obj fifo.obj keyboard.obj timer.obj mouse.obj memory.obj sheet.obj bootpack.obj
22
33 TOOLPATH = ../z_tools/
44 INCPATH = ../z_tools/CHNOSProject/
--- beta/tolset_chn_000/chnos_006/core.h (revision 71)
+++ beta/tolset_chn_000/chnos_006/core.h (revision 72)
@@ -59,6 +59,11 @@
5959 #define MEMMAN_FREES 4090
6060 #define MEMMAN_ADDR 0x003c0000
6161
62+#define MAX_SHEETS 256
63+
64+#define SHT_FLAGS_VOID 0
65+#define SHT_FLAGS_USE 1
66+
6267 #define SYSFIFO_KEYB 0x100 /*256~511=keycode*/
6368 #define SYSFIFO_MOUSE 0x200 /*512~767=mouse*/
6469
@@ -117,6 +122,13 @@
117122 int p, q, size, free, flags;
118123 };
119124
125+struct SHTCTL {
126+ unsigned int *vram;
127+ int xsize,ysize,top;
128+ struct SHEET32 *sheets[MAX_SHEETS];
129+ struct SHEET32 sheets0[MAX_SHEETS];
130+};
131+
120132 struct MOUSE_DECODE {
121133 unsigned int buf[3];
122134 int x,y,btn;
@@ -192,13 +204,21 @@
192204 void init_pic(void);
193205
194206 /*memory.c メモリ管理関係*/
207+
195208 unsigned int memtest(unsigned int start, unsigned int end);
196209 void memman_init(struct MEMMAN *man);
197210 unsigned int memman_free_total(void);
198211 unsigned int memman_alloc(unsigned int size);
199212 int memman_free(unsigned int addr, unsigned int size);
213+unsigned int memman_alloc_4k(unsigned int size);
214+int memman_free_4k(unsigned int addr, unsigned int size);
200215
216+/*sheet.c 画面管理関係*/
201217
218+void init_sheets(unsigned int *vram, int xsize, int ysize);
219+struct SHEET *sheet_alloc(void);
220+void sheet_setbuf(struct SHEET *sht,unsigned int *buf,int xsize, int ysize, int col_inv );
221+
202222 /*keyboard.c キーボード関係*/
203223 void init_keyboard(struct FIFO32 *fifo, int data0);
204224 void inthandler21(int *esp);
Show on old repository browser