• R/O
  • SSH
  • HTTPS

haribote: Commit


Commit MetaInfo

Revision193 (tree)
Time2010-03-04 13:27:22
Authortatsupc

Log Message

orbspace

Change Summary

Incremental Difference

--- haribote/trunk/orbspace/mkorbfs/mkorbfs.c (revision 192)
+++ haribote/trunk/orbspace/mkorbfs/mkorbfs.c (revision 193)
@@ -1,6 +1,24 @@
1+#include "..\orbspace\orbfs.h"
2+/* io_img.c */
3+int io_img_init(unsigned char *name, unsigned int size, unsigned char *iplname);
4+int io_img_final(void);
5+
16 #include <stdio.h>
7+#include <stdlib.h>
28
39 int main(int argc, char **argv)
410 {
11+ if (argc < 4) {
12+ puts("Syntax error");
13+ return 1;
14+ }
15+ if (io_img_init(argv[1], atoi(argv[2]), argv[3]) != 0) {
16+ puts("File error");
17+ return 1;
18+ }
19+ if (io_img_final() != 0) {
20+ puts("File error");
21+ return 1;
22+ }
523 return 0;
624 }
--- haribote/trunk/orbspace/mkorbfs/io_img.c (nonexistent)
+++ haribote/trunk/orbspace/mkorbfs/io_img.c (revision 193)
@@ -0,0 +1,41 @@
1+#include "..\orbspace\io.h"
2+#include <stdio.h>
3+#include <stdlib.h>
4+#include <string.h>
5+
6+FILE *imgfp;
7+unsigned char *imgbuf;
8+unsigned int imgsize;
9+
10+unsigned char ptable[16] = {
11+ 0x80, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
12+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
13+};
14+
15+int io_img_init(unsigned char *name, unsigned int size, unsigned char *iplname)
16+{
17+ FILE *fp;
18+
19+ if ((imgfp = fopen(name, "wb")) == 0) {
20+ return 1;
21+ }
22+ imgsize = size * 1024;
23+ imgbuf = (unsigned char *) malloc(imgsize);
24+ memset(imgbuf, 0, imgsize);
25+ if ((fp = fopen(iplname, "rb")) == 0) {
26+ return 1;
27+ }
28+ fread(imgbuf, 1, 446, fp);
29+ memcpy(imgbuf + 446, ptable, 16);
30+ *((int *) (imgbuf + 446 + 0xc)) = imgsize / 512;
31+ imgbuf[510] = 0x55; imgbuf[511] = 0xaa;
32+ return 0;
33+}
34+
35+int io_img_final(void)
36+{
37+ if (fwrite(imgbuf, 1, imgsize, imgfp) != imgsize) {
38+ return 1;
39+ }
40+ return 0;
41+}
--- haribote/trunk/orbspace/mkorbfs/Makefile (revision 192)
+++ haribote/trunk/orbspace/mkorbfs/Makefile (revision 193)
@@ -1,6 +1,6 @@
11 TARGET = mkorbfs
22 MODE = exe
3-OBJS = $(TARGET).obj
3+OBJS = $(TARGET).obj io_img.obj ..\orbspace\orbfs.obj
44 STACKSIZE = 0x1000000 # 16MB (default)
55
66 INCPATH = ../../z_tools/win32/
--- haribote/trunk/orbspace/Makefile (revision 192)
+++ haribote/trunk/orbspace/Makefile (revision 193)
@@ -1,5 +1,7 @@
1-config:
1+default:
22 make -C mkorbfs
3+ make -C orbspace
34
45 clean:
5- make -C mkorbfs clean
\ No newline at end of file
6+ make -C mkorbfs clean
7+ make -C orbspace clean
--- haribote/trunk/orbspace/orbspace/orbfs.h (nonexistent)
+++ haribote/trunk/orbspace/orbspace/orbfs.h (revision 193)
@@ -0,0 +1 @@
1+#include "io.h"
--- haribote/trunk/orbspace/orbspace/make.bat (nonexistent)
+++ haribote/trunk/orbspace/orbspace/make.bat (revision 193)
@@ -0,0 +1 @@
1+..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
\ No newline at end of file
--- haribote/trunk/orbspace/orbspace/Makefile (nonexistent)
+++ haribote/trunk/orbspace/orbspace/Makefile (revision 193)
@@ -0,0 +1,12 @@
1+TOOLPATH = ../../z_tools/
2+NASK = $(TOOLPATH)nask.exe
3+
4+default:
5+ make ipl.bin
6+
7+ipl.bin: ipl.nas Makefile
8+ $(NASK) ipl.nas ipl.bin ipl.lst
9+
10+clean:
11+ del *.obj
12+ del *.map
Show on old repository browser