OSDN Git Service

Initial commit
authoryamat0jp <yamat0jp@yahoo.co.jp>
Wed, 27 Jun 2018 20:55:38 +0000 (05:55 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Wed, 27 Jun 2018 20:55:38 +0000 (05:55 +0900)
.gitattributes [new file with mode: 0644]
.gitignore [new file with mode: 0644]
asmhead.pas [new file with mode: 0644]
bootpack.pas [new file with mode: 0644]
hankaku.bin [new file with mode: 0644]
wand.dpr [new file with mode: 0644]
wand.dproj [new file with mode: 0644]
wand.res [new file with mode: 0644]

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..dfe0770
--- /dev/null
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..19864c6
--- /dev/null
@@ -0,0 +1,66 @@
+# Uncomment these types if you want even more clean repository. But be careful.
+# It can make harm to an existing project source. Read explanations below.
+#
+# Resource files are binaries containing manifest, project icon and version info.
+# They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
+#*.res
+#
+# Type library file (binary). In old Delphi versions it should be stored.
+# Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
+#*.tlb
+#
+# Diagram Portfolio file. Used by the diagram editor up to Delphi 7.
+# Uncomment this if you are not using diagrams or use newer Delphi version.
+#*.ddp
+#
+# Visual LiveBindings file. Added in Delphi XE2.
+# Uncomment this if you are not using LiveBindings Designer.
+#*.vlb
+#
+# Deployment Manager configuration file for your project. Added in Delphi XE2.
+# Uncomment this if it is not mobile development and you do not use remote debug feature.
+#*.deployproj
+# 
+# C++ object files produced when C/C++ Output file generation is configured.
+# Uncomment this if you are not using external objects (zlib library for example).
+#*.obj
+#
+
+# Delphi compiler-generated binaries (safe to delete)
+*.exe
+*.dll
+*.bpl
+*.bpi
+*.dcp
+*.so
+*.apk
+*.drc
+*.map
+*.dres
+*.rsm
+*.tds
+*.dcu
+*.lib
+*.a
+*.o
+*.ocx
+
+# Delphi autogenerated files (duplicated info)
+*.cfg
+*.hpp
+*Resource.rc
+
+# Delphi local files (user-specific info)
+*.local
+*.identcache
+*.projdata
+*.tvsconfig
+*.dsk
+
+# Delphi history and backups
+__history/
+__recovery/
+*.~*
+
+# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
+*.stat
diff --git a/asmhead.pas b/asmhead.pas
new file mode 100644 (file)
index 0000000..fe52ceb
--- /dev/null
@@ -0,0 +1,140 @@
+unit asmhead;
+
+interface
+
+procedure io_halt;
+procedure io_cli;
+procedure io_sti;
+procedure io_stihlt;
+function io_in8(port: integer): integer;
+function io_in16(port: integer): integer;
+function io_in32(port: integer): integer;
+procedure io_out8(port, data: integer);
+procedure io_out16(port, data: integer);
+procedure io_out32(port, data: integer);
+function io_load_eflags: integer;
+procedure io_store_eflags(eflags: integer);
+procedure load_gdtr(limit, addr: integer);
+procedure load_idtr(limit, addr: integer);
+function load_cr0: integer;
+procedure store_cr0(cr0: integer);
+
+implementation
+
+procedure io_halt;
+asm
+  HLT;
+  RET;
+end;
+
+procedure io_cli;
+asm
+  CLI;
+  RET;
+end;
+
+procedure io_sti;
+asm
+  STI;
+  RET;
+end;
+
+procedure io_stihlt;
+asm
+  STI;
+  HLT;
+  RET;
+end;
+
+function io_in8(port: integer): integer;
+asm
+  MOV   EDX,[ESP+4];
+  MOV   EAX,0;
+  IN    AL,DX;
+  RET;
+end;
+
+function io_in16(port: integer): integer;
+asm
+  MOV   EDX,[ESP+4];
+  MOV   EAX,0;
+  IN    AX,DX;
+  RET;
+end;
+
+function io_in32(port: integer): integer;
+asm
+  MOV   EDX,[ESP+4];
+  IN   EAX,DX;
+  RET;
+end;
+
+procedure io_out8(port, data: integer);
+asm
+  MOV   EDX,[ESP+4];
+  MOV   AL,[ESP+8];
+  OUT   DX,AL;
+  RET;
+end;
+
+procedure io_out16(port, data: integer);
+asm
+  MOV   EDX,[ESP+4];
+  MOV   EAX,[ESP+8];
+  OUT   DX,AX;
+  RET;
+end;
+
+procedure io_out32(port, data: integer);
+asm
+  MOV   EDX,[ESP+4];
+  MOV   EAX,[ESP+8];
+  OUT   DX,EAX;
+  RET;
+end;
+
+function io_load_eflags: integer;
+asm
+  PUSHFD;
+  POP   EAX;
+  RET;
+end;
+
+procedure io_store_eflags(eflags: integer);
+asm
+  MOV   EAX,[ESP+4];
+  PUSH  EAX;
+  POPFD;
+  RET;
+end;
+
+procedure load_gdtr(limit, addr: integer);
+asm
+  MOV   AX,[ESP+4];
+  MOV   [ESP+6],AX;
+  LGDT  [ESP+6];
+  RET;
+end;
+
+procedure load_idtr(limit, addr: integer);
+asm
+  MOV   AX,[ESP+4];
+  MOV   [ESP+6],AX;
+  LIDT  [ESP+6];
+  RET;
+end;
+
+function load_cr0: integer;
+asm
+  MOV   EAX,CR0
+  RET;
+end;
+
+procedure store_cr0(cr0: integer);
+asm
+  MOV   EAX,[ESP+4];
+  MOV   CR0,EAX;
+  RET;
+end;
+
+end.
diff --git a/bootpack.pas b/bootpack.pas
new file mode 100644 (file)
index 0000000..b2aa293
--- /dev/null
@@ -0,0 +1,684 @@
+unit bootpack;
+
+interface
+
+uses
+  System.Classes, System.Generics.Collections, System.SysUtils, System.Types;
+
+type
+  TBOOTINFO = record
+    cyls, legs, vmode, reserve: Int8;
+    scrnx, scrny: Int16;
+    vram: TBytes;
+  end;
+
+  TPallet = class
+  private
+    // function hankaku: TBytes; external 'hankaku.bin';
+  public
+    procedure Init;
+    procedure setp(start, endpos: integer; rgb: TBytes);
+    procedure putfont8(vram: TBytes; xsize, x, y: integer; c: Int8;
+      font: TBytes);
+    procedure putfont8_asc(vram: TBytes; xsize, x, y: integer; c: Int8;
+      s: UInt8);
+    procedure mouse_cursor8(mouse: TBytes; bc: Int8);
+  end;
+
+  TScreen = class
+  public
+    procedure Init(vram: TBytes; x, y: integer);
+    procedure boxfill8(vram: TBytes; xsize: integer; c: UInt8;
+      x0, y0, x1, y1: integer);
+  end;
+
+  TFIFO8 = record
+    buf: TBytes;
+    p, q, size, free, flags: integer;
+  end;
+
+  TFifo = class
+  public
+    procedure Init(var fifo: TFIFO8; size: integer; buf: TBytes);
+    function Put(var fifo: TFIFO8; data: Byte): integer;
+    function Get(var fifo: TFIFO8): SmallInt;
+    function Status(var fifo: TFIFO8): integer;
+  end;
+
+  TKeyboard = class
+  const
+    PORT_KEYDAT = $0060;
+    PORT_KEYSTA = $0064;
+    PORT_KEYCMD = $0064;
+    KEYSTA_SEND_NOTREADY = $02;
+    KEYCMD_WRITE_MODE = $60;
+    KBC_MODE = $47;
+  private
+    procedure wait_KBC_sendready;
+  public
+    fifo: TFIFO8;
+    keyfifo: TFifo;
+    constructor Create;
+    destructor Destroy; override;
+    procedure Init;
+    procedure inthandler21(var esp: integer);
+  end;
+
+  TMemtest = class
+  private
+    function memtest_sub(start, endpos: Cardinal): Cardinal;
+  public
+    function memtest(start, endpos: Cardinal): Cardinal;
+  end;
+
+  TFREEINFO = record
+    addr, size: Cardinal;
+  end;
+
+  TMEMMAN = class
+  public
+    frees, maxfrees, lostsize, losts: integer;
+    free: TList<TFREEINFO>;
+    constructor Create;
+    destructor Destroy; override;
+  end;
+
+  TMem = class
+  public
+    procedure Init(mem: TMEMMAN);
+    function total(mem: TMEMMAN): Cardinal;
+    function alloc(mem: TMEMMAN; size: Cardinal): Cardinal;
+    function memfree(mem: TMEMMAN; addr, size: Cardinal): integer;
+  end;
+
+  TSHEET = record
+    buf: TBytes;
+    bxsize, bysize, vx0, vy0, col_inv, flags: integer;
+    visible: Boolean;
+  end;
+
+  TShtCtl = class
+  public
+    vram: TBytes;
+    xsize, ysize: integer;
+    sheets: TList<TSHEET>;
+    constructor Create;
+    destructor Destroy; override;
+    procedure Init(mem: TMEMMAN; x, y: integer);
+    function allock: integer;
+    procedure setbuf(index: integer; buffer: TBytes;
+      xsize, ysize, col_inv: integer);
+    procedure updown(index, height: integer);
+    procedure refresh(rect: TRect);
+    procedure slide(index, x, y: integer);
+    procedure delete(index: integer);
+  end;
+
+const
+  FLAGSOVERRUN = $0001;
+
+  PIC0_ICW1 = $0020;
+  PIC0_OCW2 = $0020;
+  PIC0_IMR = $0021;
+  PIC0_ICW2 = $0021;
+  PIC0_ICW3 = $0021;
+  PIC0_ICW4 = $0021;
+  PIC1_ICW1 = $00A0;
+  PIC1_OCW2 = $00A0;
+  PIC1_IMR = $00A1;
+  PIC1_ICW2 = $00A1;
+  PIC1_ICW3 = $00A1;
+  PIC1_ICW4 = $00A1;
+
+  COL8_000000 = 0;
+  COL8_FF0000 = 1;
+  COL8_00FF00 = 2;
+  COL8_FFFF00 = 3;
+  COL8_0000FF = 4;
+  COL8_FF00FF = 5;
+  COL8_00FFFF = 6;
+  COL8_FFFFFF = 7;
+  COL8_C6C6C6 = 8;
+  COL8_840000 = 9;
+  COL8_008400 = 10;
+  COL8_848400 = 11;
+  COL8_000084 = 12;
+  COL8_840084 = 13;
+  COL8_008484 = 14;
+  COL8_848484 = 15;
+
+  ADR_BOOTINFO = $00000ff0;
+
+implementation
+
+{ TFIFO8 }
+
+uses asmhead;
+
+function TFifo.Get(var fifo: TFIFO8): SmallInt;
+begin
+  if fifo.free = fifo.size then
+  begin
+    result := -1;
+    Exit;
+  end;
+  result := fifo.buf[fifo.q];
+  inc(fifo.q);
+  if fifo.q = fifo.size then
+    fifo.q := 0;
+  inc(fifo.free);
+end;
+
+procedure TFifo.Init(var fifo: TFIFO8; size: integer; buf: TBytes);
+begin
+  fifo.size := size;
+  fifo.buf := buf;
+  fifo.free := size;
+  fifo.flags := 0;
+  fifo.p := 0;
+  fifo.q := 0;
+end;
+
+function TFifo.Put(var fifo: TFIFO8; data: Byte): integer;
+begin
+  if fifo.free = 0 then
+  begin
+    fifo.flags := FLAGSOVERRUN;
+    result := -1;
+    Exit;
+  end;
+  fifo.buf[fifo.p] := data;
+  inc(fifo.p);
+  if fifo.p = fifo.size then
+    fifo.p := 0;
+  dec(fifo.free);
+  result := 0;
+end;
+
+function TFifo.Status(var fifo: TFIFO8): integer;
+begin
+  result := fifo.size - fifo.free;
+end;
+
+{ TKeyboard }
+
+constructor TKeyboard.Create;
+begin
+  inherited;
+  keyfifo := TFifo.Create;
+end;
+
+destructor TKeyboard.Destroy;
+begin
+  keyfifo.free;
+  inherited;
+end;
+
+procedure TKeyboard.Init;
+begin
+  wait_KBC_sendready;
+  io_out8(PORT_KEYCMD, KEYCMD_WRITE_MODE);
+  wait_KBC_sendready;
+  io_out8(PORT_KEYDAT, KBC_MODE)
+end;
+
+procedure TKeyboard.inthandler21(var esp: integer);
+var
+  i: UInt8;
+begin
+  io_out8(PIC0_OCW2, $61);
+  i := io_in8(PORT_KEYDAT);
+  keyfifo.Put(fifo, i);
+end;
+
+procedure TKeyboard.wait_KBC_sendready;
+begin
+  while True do
+    if io_in8(PORT_KEYSTA) and KEYSTA_SEND_NOTREADY = 0 then
+      break;
+end;
+
+{ TMemtest }
+
+function TMemtest.memtest(start, endpos: Cardinal): Cardinal;
+const
+  EFLAGS_AC_BIT = $00040000;
+  CR0_CASH_DISABLE = $60000000;
+var
+  flag486: UInt8;
+  eflg, cr0: UInt32;
+begin
+  flag486 := 0;
+  eflg := io_load_eflags;
+  eflg := eflg or EFLAGS_AC_BIT;
+  io_store_eflags(eflg);
+  eflg := io_load_eflags();
+  if eflg and EFLAGS_AC_BIT <> 0 then
+    flag486 := 1;
+  eflg := eflg and EFLAGS_AC_BIT;
+  io_store_eflags(eflg);
+  if flag486 <> 0 then
+  begin
+    cr0 := load_cr0();
+    cr0 := cr0 or CR0_CASH_DISABLE;
+    store_cr0(cr0);
+  end;
+  result := memtest_sub(start, endpos);
+  if flag486 <> 0 then
+  begin
+    cr0 := load_cr0();
+    cr0 := cr0 and CR0_CASH_DISABLE;
+    store_cr0(cr0);
+  end;
+end;
+
+function TMemtest.memtest_sub(start, endpos: Cardinal): Cardinal;
+const
+  pat0 = $AA55AA55;
+  pat1 = $55AA55AA;
+var
+  i, old: UInt32;
+  p: ^UInt32;
+label not_memory;
+begin
+  i := start;
+  while i <= endpos do
+  begin
+    p := Pointer(i + $FFC);
+    old := p^;
+    p^ := pat0;
+    p^ := p^ XOR $FFFFFFFF;
+    if p^ <> pat1 then
+    begin
+    not_memory:
+      p^ := old;
+      break;
+    end;
+    p^ := p^ XOR $FFFFFFFF;
+    if p^ <> pat0 then
+      goto not_memory;
+    p^ := old;
+    inc(i, $1000);
+  end;
+  result := i;
+end;
+
+{ TMem }
+
+function TMem.alloc(mem: TMEMMAN; size: Cardinal): Cardinal;
+var
+  i: integer;
+  s: TFREEINFO;
+begin
+  result := 0;
+  for i := 0 to mem.free.Count - 1 do
+    if mem.free[i].size >= size then
+    begin
+      s := mem.free[i];
+      result := s.addr;
+      inc(s.addr, size);
+      dec(s.size, size);
+      if s.size = 0 then
+        mem.free.delete(i)
+      else
+        mem.free[i] := s;
+      break;
+    end;
+end;
+
+procedure TMem.Init(mem: TMEMMAN);
+begin
+  mem.free.Clear;
+  mem.maxfrees := 0;
+  mem.lostsize := 0;
+  mem.losts := 0;
+end;
+
+function TMem.memfree(mem: TMEMMAN; addr, size: Cardinal): integer;
+var
+  i, j: integer;
+  s: TFREEINFO;
+begin
+  j := 0;
+  for i := 0 to mem.free.Count - 1 do
+    if mem.free[i].addr > addr then
+    begin
+      j := i;
+      break;
+    end;
+  if i > 0 then
+    if mem.free[i - 1].addr + mem.free[i - 1].size = addr then
+    begin
+      s := mem.free[i - 1];
+      inc(s.size, size);
+      if addr + size = s.addr then
+      begin
+        inc(s.size, mem.free[i].size);
+        mem.free.delete(i);
+      end;
+      mem.free[i - 1] := s;
+      result := 0;
+      Exit;
+    end;
+  if addr + size = mem.free[i].addr then
+  begin
+    s := mem.free[i];
+    s.addr := addr;
+    inc(s.size, size);
+    mem.free[i] := s;
+  end
+  else
+  begin
+    s.addr := addr;
+    s.size := size;
+    mem.maxfrees := mem.free.Count;
+    mem.free.Insert(i, s);
+  end;
+end;
+
+function TMem.total(mem: TMEMMAN): Cardinal;
+var
+  i: integer;
+begin
+  result := 0;
+  for i := 0 to mem.free.Count - 1 do
+    inc(result, mem.free[i].size);
+end;
+
+{ TMEMMAN }
+
+constructor TMEMMAN.Create;
+begin
+  inherited;
+  free := TList<TFREEINFO>.Create;
+end;
+
+destructor TMEMMAN.Destroy;
+begin
+  free.free;
+  inherited;
+end;
+
+{ TShtCtl }
+
+constructor TShtCtl.Create;
+begin
+  sheets := TList<TSHEET>.Create;
+end;
+
+procedure TShtCtl.delete(index: integer);
+begin
+  sheets.delete(index);
+end;
+
+destructor TShtCtl.Destroy;
+begin
+  sheets.free;
+  inherited;
+end;
+
+function TShtCtl.allock: integer;
+const
+  SHEET_USE = 1;
+var
+  s: TSHEET;
+begin
+  s.flags := SHEET_USE;
+  s.visible := True;
+  result := sheets.Add(s);
+end;
+
+procedure TShtCtl.Init(mem: TMEMMAN; x, y: integer);
+begin
+  xsize := x;
+  ysize := y;
+  sheets.Clear;
+end;
+
+procedure TShtCtl.refresh(rect: TRect);
+var
+  i: integer;
+  x: integer;
+  y: integer;
+  vx, vy: integer;
+  c: Byte;
+  clip: TRect;
+begin
+  if rect.Left < 0 then
+    rect.Left := 0;
+  if rect.Right >= xsize then
+    rect.Right := xsize;
+  if rect.Top < 0 then
+    rect.Top := 0;
+  if rect.Bottom >= ysize then
+    rect.Bottom := ysize;
+  for i := 0 to sheets.Count - 1 do
+    with sheets[i] do
+    begin
+      clip.Left := rect.Left - vx0;
+      clip.Right := rect.Right - vx0;
+      clip.Top := rect.Top - vy0;
+      clip.Bottom := rect.Bottom - vy0;
+      if clip.Left < 0 then
+        clip.Left := 0;
+      if clip.Right > bxsize then
+        clip.Right := bxsize;
+      if clip.Top < 0 then
+        clip.Top := 0;
+      if clip.Bottom > bysize then
+        clip.Bottom := bysize;
+      for y := clip.Top to clip.Bottom - 1 do
+      begin
+        vy := vy0 + y;
+        for x := clip.Left to clip.Right - 1 do
+        begin
+          vx := vx0 + x;
+          c := buf[y * bxsize + x];
+          if c <> col_inv then
+            vram[vy * xsize + vx] := c;
+        end;
+      end;
+    end;
+end;
+
+procedure TShtCtl.setbuf(index: integer; buffer: TBytes;
+  xsize, ysize, col_inv: integer);
+var
+  s: TSHEET;
+begin
+  s.buf := buffer;
+  s.bxsize := xsize;
+  s.bysize := ysize;
+  s.col_inv := col_inv;
+  sheets[index] := s;
+end;
+
+procedure TShtCtl.slide(index, x, y: integer);
+var
+  i, j: integer;
+  p: ^TSHEET;
+begin
+  p := TList(sheets)[index];
+  with p^ do
+  begin
+    i := vx0;
+    j := vy0;
+    vx0 := x;
+    vy0 := y;
+    if visible = True then
+    begin
+      refresh(rect(i, j, i + bxsize, j + bysize));
+      refresh(rect(x, y, x + bxsize, y + bysize));
+    end;
+  end;
+end;
+
+procedure TShtCtl.updown(index, height: integer);
+var
+  p: ^TSHEET;
+begin
+  if height >= sheets.Count then
+    height := sheets.Count - 1;
+  if height < -1 then
+    height := -1;
+  if height >= 0 then
+  begin
+    sheets.Move(index, height);
+    if sheets[height].visible = false then
+    begin
+      p := TList(sheets)[height];
+      p^.visible := True;
+    end;
+  end
+  else
+  begin
+    p := TList(sheets)[index];
+    p^.visible := false;
+  end;
+end;
+
+{ TPallet }
+
+procedure TPallet.Init;
+const
+  table: array [0 .. 14, 0 .. 2] of Byte = (($00, $00, $00), ($FF, $00, $00),
+    ($00, $FF, $00), ($FF, $FF, $00), ($00, $00, $FF), ($FF, $00, $FF),
+    ($00, $FF, $FF), ($C6, $C6, $C6), ($84, $00, $00), ($00, $84, $00),
+    ($84, $84, $00), ($00, $00, $84), ($84, $00, $84), ($00, $84, $84),
+    ($84, $84, $84));
+begin
+  setp(0, 15, @table);
+end;
+
+procedure TPallet.mouse_cursor8(mouse: TBytes; bc: Int8);
+const
+  cursor: array [0 .. 15] of string[16] = ( //
+    ('**************..'), //
+    ('*00000000000*...'), //
+    ('*0000000000*....'), //
+    ('*000000000*.....'), //
+    ('*00000000*......'), //
+    ('*0000000*.......'), //
+    ('*0000000*.......'), //
+    ('*00000000*......'), //
+    ('*0000**000*.....'), //
+    ('*000*..*000*....'), //
+    ('*00*....*000*...'), //
+    ('*0*......*000*..'), //
+    ('**........*000*.'), //
+    ('*..........*000*'), //
+    ('............*00*'), //
+    ('.............***') //
+    );
+var
+  x: integer;
+  y: integer;
+begin
+  for y := 0 to 15 do
+    for x := 0 to 15 do
+      case cursor[y][x] of // x , y ?
+        '*':
+          mouse[y * 16 + x] := COL8_000000;
+        '0':
+          mouse[y * 16 + x] := COL8_FFFFFF;
+        '.':
+          mouse[y * 16 + x] := bc;
+      end;
+end;
+
+procedure TPallet.putfont8(vram: TBytes; xsize, x, y: integer; c: Int8;
+  font: TBytes);
+var
+  i: integer;
+  p: TBytes;
+  d: Byte;
+begin
+  for i := 0 to 16 do
+  begin
+    p := @vram[(y + i) * xsize + x];
+    d := font[i];
+    if d and $80 <> 0 then
+      p[0] := c;
+    if d and $40 <> 0 then
+      p[1] := c;
+    if d and $20 <> 0 then
+      p[2] := c;
+    if d and $10 <> 0 then
+      p[3] := c;
+    if d and $08 <> 0 then
+      p[4] := c;
+    if d and $04 <> 0 then
+      p[5] := c;
+    if d and $02 <> 0 then
+      p[6] := c;
+    if d and $01 <> 0 then
+      p[7] := c;
+  end;
+end;
+
+procedure TPallet.putfont8_asc(vram: TBytes; xsize, x, y: integer; c: Int8;
+  s: UInt8);
+var
+  hankaku: TBytes;
+begin
+  while s <> $00 do
+  begin
+    putfont8(vram, xsize, x, y, c, @hankaku[s * 16]);
+    inc(s);
+    inc(x, 8);
+  end;
+end;
+
+procedure TPallet.setp(start, endpos: integer; rgb: TBytes);
+var
+  eflags: integer;
+  i, j: integer;
+begin
+  eflags := io_load_eflags;
+  io_cli;
+  io_out8($03C8, start);
+  j := 0;
+  for i := start to endpos - 1 do
+  begin
+    io_out8($03C9, rgb[j + 0] div 4);
+    io_out8($03C9, rgb[j + 1] div 4);
+    io_out8($03C9, rgb[j + 2] div 4);
+    inc(j, 3);
+  end;
+  io_store_eflags(eflags);
+end;
+
+{ TScreen }
+
+procedure TScreen.boxfill8(vram: TBytes; xsize: integer; c: UInt8;
+  x0, y0, x1, y1: integer);
+var
+  y: integer;
+  x: integer;
+begin
+  for y := y0 to y1 do
+    for x := x0 to x1 do
+      vram[y * xsize + x] := c;
+end;
+
+procedure TScreen.Init(vram: TBytes; x, y: integer);
+begin
+  boxfill8(vram, x, COL8_008484, 0, 0, x - 1, y - 29);
+  boxfill8(vram, x, COL8_C6C6C6, 0, y - 28, x - 1, y - 28);
+  boxfill8(vram, x, COL8_FFFFFF, 0, y - 27, x - 1, y - 27);
+  boxfill8(vram, x, COL8_C6C6C6, 0, y - 26, x - 1, y - 1);
+
+  boxfill8(vram, x, COL8_FFFFFF, 3, y - 24, 59, y - 24);
+  boxfill8(vram, x, COL8_FFFFFF, 2, y - 24, 2, y - 4);
+  boxfill8(vram, x, COL8_848484, 3, y - 4, 59, y - 4);
+  boxfill8(vram, x, COL8_848484, 59, y - 23, 59, y - 5);
+  boxfill8(vram, x, COL8_000000, 2, y - 3, 59, y - 3);
+  boxfill8(vram, x, COL8_000000, 60, y - 24, 60, y - 3);
+
+  boxfill8(vram, x, COL8_848484, x - 47, y - 24, x - 4, y - 24);
+  boxfill8(vram, x, COL8_848484, x - 47, y - 23, x - 47, y - 4);
+  boxfill8(vram, x, COL8_FFFFFF, x - 47, y - 3, x - 4, y - 3);
+  boxfill8(vram, x, COL8_FFFFFF, x - 3, y - 24, x - 3, y - 3);
+end;
+
+end.
diff --git a/hankaku.bin b/hankaku.bin
new file mode 100644 (file)
index 0000000..171b735
Binary files /dev/null and b/hankaku.bin differ
diff --git a/wand.dpr b/wand.dpr
new file mode 100644 (file)
index 0000000..5d9d827
--- /dev/null
+++ b/wand.dpr
@@ -0,0 +1,90 @@
+program wand;
+
+uses
+  System.SysUtils,
+  bootpack in 'bootpack.pas',
+  asmhead in 'asmhead.pas';
+
+const
+  MEMMAN_ADDR = $003C0000;
+
+var
+  binfo: ^TBOOTINFO = Pointer(ADR_BOOTINFO);
+  screen: TScreen;
+  keyboard: TKeyboard;
+  keybuf: TBytes;
+  i: SmallInt;
+  memtest: TMemtest;
+  memtotal: Cardinal;
+  memman: ^TMEMMAN = Pointer(MEMMAN_ADDR);
+  mem: TMem;
+  sheet: TShtCtl;
+  mouse, win, back: integer;
+
+procedure window8(buf: array of Byte; xsize, ysize: integer; var title: string);
+const
+  closebtn: array [0 .. 14, 0 .. 15] of Char = (('0', '0', '0', '0', '0', '0',
+    '0', '0', '0', '0', '0', '0', '0', '0', '0', '@'),
+    ('0', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', '$',
+    '@'), ('0', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q',
+    '$', '@'), ('0', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q',
+    'Q', '$', '@'), ('0', 'Q', 'Q', 'Q', '@', '@', 'Q', 'Q', 'Q', 'Q', '@', '@',
+    'Q', 'Q', '$', '@'), ('0', 'Q', 'Q', 'Q', 'Q', '@', '@', 'Q', 'Q', '@', '@',
+    'Q', 'Q', 'Q', '$', '@'), ('0', 'Q', 'Q', 'Q', 'Q', 'Q', '@', '@', '@', '@',
+    'Q', 'Q', 'Q', 'Q', '$', '@'), ('0', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', '@', '@',
+    'Q', 'Q', 'Q', 'Q', 'Q', '$', '@'), ('0', 'Q', 'Q', 'Q', 'Q', 'Q', '@', '@',
+    '@', '@', 'Q', 'Q', 'Q', 'Q', '$', '@'), ('0', 'Q', 'Q', 'Q', 'Q', '@', '@',
+    'Q', 'Q', '@', '@', 'Q', 'Q', 'Q', '$', '@'), ('0', 'Q', 'Q', 'Q', '@', '@',
+    'Q', 'Q', 'Q', 'Q', '@', '@', 'Q', 'Q', '$', '@'),
+    ('0', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', '$',
+    '@'), ('0', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q', 'Q',
+    '$', '@'), ('0', '$', '$', '$', '$', '$', '$', '$', '$', '$', '$', '$', '$',
+    '$', '$', '@'), ('@', '@', '@', '@', '@', '@', '@', '@', '@', '@', '@', '@',
+    '@', '@', '@', '@'));
+begin
+
+end;
+
+begin
+  screen:=TScreen.Create;
+  screen.Init(binfo^.vram,binfo^.scrnx,binfo^.scrny);
+  keyboard := TKeyboard.Create;
+  SetLength(keybuf, 32);
+  with keyboard do
+  begin
+    keyfifo.Init(fifo, 32, keybuf);
+    while True do
+    begin
+      io_cli;
+      if keyfifo.Status(fifo) = 0 then
+        // ioshift()
+      else
+      begin
+        i := keyfifo.Get(fifo);
+        io_sti;
+        // sprintf
+        // boxfill8
+        // putfonts8
+      end;
+    end;
+  end;
+  {
+    memtest:=TMemtest.Create;
+    memtotal:=memtest.memtest($00400000,$bfffffff);
+    mem:=TMem.Create;
+    mem.Init(memman);
+    mem.memfree(memman,$00001000,$0009e000);
+    mem.memfree(memman,$00400000,memtotal-$00400000);
+    mem.Free;
+    memtest.Free;
+  }
+  sheet := TShtCtl.Create;
+  back := sheet.allock;
+  mouse := sheet.allock;
+  win := sheet.allock;
+  sheet.slide(mouse, 10, 10);
+  sheet.slide(win, 80, 72);
+  sheet.Free;
+  keyboard.Free;
+  screen.Free;
+end.
diff --git a/wand.dproj b/wand.dproj
new file mode 100644 (file)
index 0000000..322f5c1
--- /dev/null
@@ -0,0 +1,510 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{319E3DAD-6128-46F4-A56E-ABE7603D2EB4}</ProjectGuid>
+        <ProjectVersion>16.1</ProjectVersion>
+        <FrameworkType>None</FrameworkType>
+        <MainSource>wand.dpr</MainSource>
+        <Base>True</Base>
+        <Config Condition="'$(Config)'==''">Debug</Config>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
+        <TargetedPlatforms>1</TargetedPlatforms>
+        <AppType>Console</AppType>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Android' and '$(Base)'=='true') or '$(Base_Android)'!=''">
+        <Base_Android>true</Base_Android>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='iOSDevice' and '$(Base)'=='true') or '$(Base_iOSDevice)'!=''">
+        <Base_iOSDevice>true</Base_iOSDevice>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='iOSSimulator' and '$(Base)'=='true') or '$(Base_iOSSimulator)'!=''">
+        <Base_iOSSimulator>true</Base_iOSSimulator>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='OSX32' and '$(Base)'=='true') or '$(Base_OSX32)'!=''">
+        <Base_OSX32>true</Base_OSX32>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+        <Base_Win32>true</Base_Win32>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+        <Base_Win64>true</Base_Win64>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
+        <Cfg_1>true</Cfg_1>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
+        <Cfg_1_Win32>true</Cfg_1_Win32>
+        <CfgParent>Cfg_1</CfgParent>
+        <Cfg_1>true</Cfg_1>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
+        <Cfg_2>true</Cfg_2>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base)'!=''">
+        <SanitizedProjectName>wand</SanitizedProjectName>
+        <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
+        <DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
+        <DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
+        <DCC_E>false</DCC_E>
+        <DCC_N>false</DCC_N>
+        <DCC_S>false</DCC_S>
+        <DCC_F>false</DCC_F>
+        <DCC_K>false</DCC_K>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Android)'!=''">
+        <Android_LauncherIcon36>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png</Android_LauncherIcon36>
+        <Android_LauncherIcon48>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png</Android_LauncherIcon48>
+        <Android_SplashImage960>$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png</Android_SplashImage960>
+        <Android_SplashImage426>$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png</Android_SplashImage426>
+        <Android_LauncherIcon96>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png</Android_LauncherIcon96>
+        <Android_SplashImage470>$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png</Android_SplashImage470>
+        <DCC_UsePackage>FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;xmlrtl;DataSnapNativeClient;ibxpress;SOEngine;IndyProtocols;FireDACCommonDriver;bindengine;bindcompdbx;soaprtl;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
+        <Android_LauncherIcon144>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png</Android_LauncherIcon144>
+        <Android_SplashImage640>$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png</Android_SplashImage640>
+        <Android_LauncherIcon72>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png</Android_LauncherIcon72>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_iOSDevice)'!=''">
+        <DCC_UsePackage>FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindengine;bindcompdbx;soaprtl;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_iOSSimulator)'!=''">
+        <DCC_UsePackage>FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;xmlrtl;DataSnapNativeClient;ibxpress;SOEngine;IndyProtocols;FireDACCommonDriver;bindengine;bindcompdbx;soaprtl;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_OSX32)'!=''">
+        <DCC_ConsoleTarget>true</DCC_ConsoleTarget>
+        <DCC_UsePackage>FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;DBXOracleDriver;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;inetdbxpress;dsnapxml;FireDACASADriver;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindengine;bindcompdbx;soaprtl;FMXTee;emsclient;FireDACMSSQLDriver;FireDAC;DBXInformixDriver;DataSnapServerMidas;DBXFirebirdDriver;inet;fmxobj;FireDACMySQLDriver;soapmidas;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win32)'!=''">
+        <DCC_ConsoleTarget>true</DCC_ConsoleTarget>
+        <VerInfo_Locale>1033</VerInfo_Locale>
+        <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+        <DCC_UsePackage>FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;frxe21;TeeDB;tethering;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapServer;frx21;DataSnapCommon;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DBXMSSQLDriver;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;CodeSiteExpressPkg;DataSnapFireDAC;FireDACDBXDriver;soapserver;inetdbxpress;dsnapxml;FireDACInfxDriver;FireDACDb2Driver;adortl;FireDACASADriver;Intraweb_14_DXE7;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;frxTee21;FireDACCommon;bindcomp;inetdb;Tee;DBXOdbcDriver;frxDB21;vclFireDAC;xmlrtl;DataSnapNativeClient;svnui;ibxpress;SOEngine;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;vclactnband;bindengine;bindcompdbx;soaprtl;FMXTee;TeeUI;bindcompvcl;vclie;FireDACADSDriver;vcltouch;emsclient;VCLRESTComponents;FireDACMSSQLDriver;FireDAC;VclSmp;DBXInformixDriver;DataSnapConnectors;Python_XE7;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;inet;fmxobj;FireDACMySQLDriver;soapmidas;vclx;svn;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
+        <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win64)'!=''">
+        <DCC_ConsoleTarget>true</DCC_ConsoleTarget>
+        <DCC_UsePackage>FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;TeeDB;tethering;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DBXMSSQLDriver;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;inetdbxpress;dsnapxml;FireDACInfxDriver;FireDACDb2Driver;adortl;FireDACASADriver;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;Tee;DBXOdbcDriver;vclFireDAC;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;vclactnband;bindengine;bindcompdbx;soaprtl;FMXTee;TeeUI;bindcompvcl;vclie;FireDACADSDriver;vcltouch;emsclient;VCLRESTComponents;FireDACMSSQLDriver;FireDAC;VclSmp;DBXInformixDriver;DataSnapConnectors;Python_XE7;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;inet;fmxobj;FireDACMySQLDriver;soapmidas;vclx;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_1)'!=''">
+        <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+        <DCC_DebugDCUs>true</DCC_DebugDCUs>
+        <DCC_Optimize>false</DCC_Optimize>
+        <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+        <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
+        <DCC_RemoteDebug>true</DCC_RemoteDebug>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
+        <DCC_RemoteDebug>false</DCC_RemoteDebug>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2)'!=''">
+        <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+        <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+        <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+        <DCC_DebugInformation>0</DCC_DebugInformation>
+    </PropertyGroup>
+    <ItemGroup>
+        <DelphiCompile Include="$(MainSource)">
+            <MainSource>MainSource</MainSource>
+        </DelphiCompile>
+        <DCCReference Include="bootpack.pas"/>
+        <DCCReference Include="asmhead.pas"/>
+        <BuildConfiguration Include="Release">
+            <Key>Cfg_2</Key>
+            <CfgParent>Base</CfgParent>
+        </BuildConfiguration>
+        <BuildConfiguration Include="Base">
+            <Key>Base</Key>
+        </BuildConfiguration>
+        <BuildConfiguration Include="Debug">
+            <Key>Cfg_1</Key>
+            <CfgParent>Base</CfgParent>
+        </BuildConfiguration>
+    </ItemGroup>
+    <ProjectExtensions>
+        <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+        <Borland.ProjectType>Application</Borland.ProjectType>
+        <BorlandProject>
+            <Delphi.Personality>
+                <Source>
+                    <Source Name="MainSource">wand.dpr</Source>
+                </Source>
+            </Delphi.Personality>
+            <Deployment>
+                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="OSX32">
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="Win32\Debug\wand.exe" Configuration="Debug" Class="ProjectOutput">
+                    <Platform Name="Win32">
+                        <RemoteName>wand.exe</RemoteName>
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployClass Required="true" Name="DependencyPackage">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                        <Extensions>.bpl</Extensions>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DependencyModule">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                        <Extensions>.dll;.bpl</Extensions>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2048">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectOSXInfoPList">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSDeviceDebug">
+                    <Platform Name="iOSDevice">
+                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage470">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-normal</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeX86File">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\x86</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSResource">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectOSXEntitlements">
+                    <Platform Name="OSX32">
+                        <RemoteDir>../</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidGDBServer">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch640">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage960">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xlarge</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon96">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch320">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon144">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeMipsFile">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\mips</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashImageDef">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DebugSymbols">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DependencyFramework">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>1</Operation>
+                        <Extensions>.framework</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage426">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-small</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSEntitlements">
+                    <Platform Name="iOSDevice">
+                        <RemoteDir>../</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AdditionalDebugSymbols">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidClassesDexFile">
+                    <Platform Name="Android">
+                        <RemoteDir>classes</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSInfoPList">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1024">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_DefaultAppIcon">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectOSXResource">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\Resources</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSDeviceResourceRules">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch768">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Required="true" Name="ProjectOutput">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeArmeabiFile">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage640">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-large</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="File">
+                    <Platform Name="iOSDevice">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="Android">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS</RemoteDir>
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch640x1136">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon36">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-ldpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashStyles">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1536">
+                    <Platform Name="iOSDevice">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon48">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon72">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectAndroidManifest">
+                    <Platform Name="Android">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="iOSDevice" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
+            </Deployment>
+            <Platforms>
+                <Platform value="Android">False</Platform>
+                <Platform value="iOSDevice">False</Platform>
+                <Platform value="iOSSimulator">False</Platform>
+                <Platform value="OSX32">False</Platform>
+                <Platform value="Win32">True</Platform>
+                <Platform value="Win64">False</Platform>
+            </Platforms>
+        </BorlandProject>
+        <ProjectFileVersion>12</ProjectFileVersion>
+    </ProjectExtensions>
+    <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
+    <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
+    <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
+</Project>
diff --git a/wand.res b/wand.res
new file mode 100644 (file)
index 0000000..7435995
Binary files /dev/null and b/wand.res differ