Program Sprite Editor adalah program utility untuk menghasilkan gambar-gambar sprite yang dapat digunakan dalam program kita. Program game yang pernah saya buat, sprite-spritenya saya gambar dengan program ini. Program ini pada awalnya bernama program Shape Editor yang ditulisa oleh Sdr. Hendra dalam bukunya terbitan Elex Media dan didesain hanya untuk mode Screen 1 dengan ukuran maksimum 20×20 pixel, tetapi telah saya modifikasi sedikit agar dapat digunakan untuk mode Screen 13 (256 color), dengan ukuran sprite maksimum 45×45 pixel. Tanpa basa-basi lagi berikut ini adalah source codenya;

‘*****************************************************’

‘ Program SPRITE EDITOR Version 2.00
‘ Dikembangkan dari Program Shape Editor oleh Sdr. Hendra
‘ dari Buku Program Permainan dengan Basic terbitan Elex Media
‘ Support 45 x 45 Pixel
‘ Support in 320 x 200 x 256 Colors

‘*****************************************************’
‘$DYNAMIC
DEFINT A-Z

CONST pixel = 4
CONST max.row.len = 45
CONST max.col.len = 45
CONST xawal = 185
CONST yawal = 10
CONST xakhir = 315
CONST yakhir = 175

COMMON SHARED col.len AS INTEGER, row.len AS INTEGER
COMMON SHARED move.draw AS INTEGER, c AS INTEGER, edit AS INTEGER
COMMON SHARED help.init AS INTEGER, palet AS INTEGER
COMMON SHARED x AS INTEGER, y AS INTEGER, oldx AS INTEGER, oldy AS INTEGER

DECLARE SUB box (x1%, y1%, x2%, y2%, c1%, c2%, c3%, c4%)
DECLARE SUB draw.cel.frame ()
DECLARE SUB draw.ima.frame ()
DECLARE SUB draw.edit.area ()
DECLARE SUB writeln (rloc AS INTEGER, cloc AS INTEGER, stm$)
DECLARE SUB putfont (col, row, text$)
DECLARE SUB delln (bar!)
DECLARE SUB wait.time ()
DECLARE SUB set.cel.frame (celnum AS INTEGER, switch AS INTEGER)
DECLARE SUB msg (rl AS INTEGER, cl AS INTEGER, message$)
DECLARE FUNCTION get.filename$ (rowloc AS INTEGER, colloc AS INTEGER, length AS INTEGER)

ON ERROR GOTO ErrorProc

size% = 4 + INT((((xakhir + 5) – (xawal – 5) + 1) * 8 + 7) / 8) * 1 * ((yakhir + 5) – (yawal – 5) + 1)
DIM save.screen%(size%)
DIM main.ima(222) AS INTEGER
DIM image(222), ima(max.row.len, max.col.len), Cel(2), Pal(9)
DIM SHARED ba(42): FOR i = 0 TO 42: READ ba(i): NEXT
DIM SHARED bb(42): FOR i = 0 TO 42: READ bb(i): NEXT
DIM SHARED bc(42): FOR i = 0 TO 42: READ bc(i): NEXT
DIM SHARED bd(42): FOR i = 0 TO 42: READ bd(i): NEXT
DIM SHARED be(42): FOR i = 0 TO 42: READ be(i): NEXT
DIM SHARED BF(42): FOR i = 0 TO 42: READ BF(i): NEXT
DIM SHARED bg(42): FOR i = 0 TO 42: READ bg(i): NEXT
DIM SHARED bh(42): FOR i = 0 TO 42: READ bh(i): NEXT
DIM SHARED bi(38): FOR i = 0 TO 38: READ bi(i): NEXT
DIM SHARED bj(42): FOR i = 0 TO 42: READ bj(i): NEXT
DIM SHARED bk(42): FOR i = 0 TO 42: READ bk(i): NEXT
DIM SHARED bl(38): FOR i = 0 TO 38: READ bl(i): NEXT
DIM SHARED bm(42): FOR i = 0 TO 42: READ bm(i): NEXT
DIM SHARED bn(42): FOR i = 0 TO 42: READ bn(i): NEXT
DIM SHARED bo(42): FOR i = 0 TO 42: READ bo(i): NEXT
DIM SHARED bp(42): FOR i = 0 TO 42: READ bp(i): NEXT
DIM SHARED bq(42): FOR i = 0 TO 42: READ bq(i): NEXT
DIM SHARED br(42): FOR i = 0 TO 42: READ br(i): NEXT
DIM SHARED bs(42): FOR i = 0 TO 42: READ bs(i): NEXT
DIM SHARED bt(38): FOR i = 0 TO 38: READ bt(i): NEXT
DIM SHARED bu(42): FOR i = 0 TO 42: READ bu(i): NEXT
DIM SHARED bv(42): FOR i = 0 TO 42: READ bv(i): NEXT
DIM SHARED bw(42): FOR i = 0 TO 42: READ bw(i): NEXT
DIM SHARED bx(42): FOR i = 0 TO 42: READ bx(i): NEXT
DIM SHARED by(38): FOR i = 0 TO 38: READ by(i): NEXT
DIM SHARED bz(42): FOR i = 0 TO 42: READ bz(i): NEXT
DIM SHARED f0(42): FOR i = 0 TO 42: READ f0(i): NEXT
DIM SHARED f1(38): FOR i = 0 TO 38: READ f1(i): NEXT
DIM SHARED f2(42): FOR i = 0 TO 42: READ f2(i): NEXT
DIM SHARED f3(42): FOR i = 0 TO 42: READ f3(i): NEXT
DIM SHARED f4(42): FOR i = 0 TO 42: READ f4(i): NEXT
DIM SHARED f5(42): FOR i = 0 TO 42: READ f5(i): NEXT
DIM SHARED f6(42): FOR i = 0 TO 42: READ f6(i): NEXT
DIM SHARED f7(42): FOR i = 0 TO 42: READ f7(i): NEXT
DIM SHARED f8(42): FOR i = 0 TO 42: READ f8(i): NEXT
DIM SHARED f9(42): FOR i = 0 TO 42: READ f9(i): NEXT
DIM SHARED titik(20): FOR i = 0 TO 20: READ titik(i): NEXT
DIM SHARED seru(20): FOR i = 0 TO 20: READ seru(i): NEXT
CLOSE #1

status.awal = 0
yes = 1
No = 0
move.draw = -1
c = 1
x = 1
y = 1
oldx = 1
oldy = 1
edit = 0
edt = 0
help.init = 0
palet = 0
FOR i = 1 TO 2
Cel(i) = 0
NEXT
FOR i = 0 TO 9
Pal(i) = 0
NEXT
col.len = 20
row.len = 20

SCREEN 13
CLS
COLOR 15
CALL putfont(30, 185, “COPYRIGHT BY MAGICTOUCH SOFTWARE INC.”)
CALL putfont(192, 0, “SPRITE EDITOR”)
CALL putfont(192, 63, “SIZE.”)
CALL putfont(192, 71, “X. . “)
CALL putfont(192, 79, “Y. . “)
CALL putfont(192, 88, “COLOR.”)
CALL putfont(192, 96, “STATUS.”)
CALL putfont(250, 96, “MOVING.”)
CALL draw.edit.area
CALL draw.cel.frame
CALL draw.ima.frame
GOTO help

edit:
‘Redraw edit.area
LINE ((x – 1) * pixel, (y – 1) * pixel)-((x – 1) * pixel + pixel, (y – 1) * pixel + pixel), 0, B

e1:
LOCATE 9, 30
PRINT ; col.len; “x”; row.len
LOCATE 10, 27
PRINT USING “###”; x
LOCATE 11, 27
PRINT USING “###”; y
LOCATE 12, 33
PRINT ; c
IF move.draw = 1 THEN
LINE (250, 96)-(310, 104), 0, BF
CALL putfont(250, 96, “DRAWING.”)
ELSE
LINE (250, 96)-(310, 104), 0, BF
CALL putfont(250, 96, “MOVING.”)
END IF

e2:
t$ = INKEY$
IF t$ = “” THEN GOTO e2
IF t$ = CHR$(13) THEN move.draw = move.draw * -1: GOTO e1
IF t$ = “H” OR t$ = “h” THEN GOTO help
IF t$ = “P” OR t$ = “p” THEN GOTO set.palet
IF t$ = “C” OR t$ = “c” THEN GOTO colors
IF t$ = “R” OR t$ = “r” THEN GOTO clearing
IF t$ = “S” OR t$ = “s” THEN GOTO save
IF t$ = “L” OR t$ = “l” THEN GOTO load
IF t$ = “Q” OR t$ = “q” THEN GOTO quit
IF t$ = “W” OR t$ = “w” THEN GOTO mirror
IF t$ = “D” OR t$ = “d” THEN GOTO del
IF t$ = “T” OR t$ = “t” THEN GOTO transfer
IF t$ = “G” OR t$ = “g” THEN GOTO resize.grid
IF t$ = “O” OR t$ = “o” THEN GOTO cropping
IF t$ = “0” THEN c = Pal(0): GOTO e1
IF t$ = “1” THEN c = Pal(1): GOTO e1
IF t$ = “2” THEN c = Pal(2): GOTO e1
IF t$ = “3” THEN c = Pal(3): GOTO e1
IF t$ = “4” THEN c = Pal(4): GOTO e1
IF t$ = “5” THEN c = Pal(5): GOTO e1
IF t$ = “6” THEN c = Pal(6): GOTO e1
IF t$ = “7” THEN c = Pal(7): GOTO e1
IF t$ = “8” THEN c = Pal(8): GOTO e1
IF t$ = “9” THEN c = Pal(9): GOTO e1
IF LEN(t$) = 1 THEN GOTO e2 ELSE t$ = RIGHT$(t$, 1)
IF t$ = “H” THEN y = y – 1: IF y = 0 THEN y = row.len ‘Kursor atas
IF t$ = “K” THEN x = x – 1: IF x = 0 THEN x = col.len ‘Kursor kiri
IF t$ = “P” THEN y = y + 1: IF y > row.len THEN y = 1 ‘Kursor bawah
IF t$ = “M” THEN x = x + 1: IF x > col.len THEN x = 1 ‘Kursor kanan
IF t$ = “G” THEN
x = x – 1
y = y – 1
IF x = 0 THEN x = 1
IF y = 0 THEN y = 1
END IF
IF t$ = “I” THEN
x = x + 1
y = y – 1
IF x > col.len THEN x = col.len
IF y = 0 THEN y = 1
END IF
IF t$ = “O” THEN
x = x – 1
y = y + 1
IF x = 0 THEN x = 1
IF y > row.len THEN y = row.len
END IF
IF t$ = “Q” THEN
x = x + 1
y = y + 1
IF x > col.len THEN x = col.len
IF y > row.len THEN y = row.len
END IF

IF x = oldx AND y = oldy THEN GOTO e2

LINE ((oldx – 1) * pixel, (oldy – 1) * pixel)-((oldx – 1) * pixel + pixel, (oldy – 1) * pixel + pixel), 7, B
‘Kerjakan proses menggambar
IF move.draw = 1 THEN
FOR i = (oldx – 1) * pixel + 1 TO (oldx – 1) * pixel + (pixel – 1)
FOR j = (oldy – 1) * pixel + 1 TO (oldy – 1) * pixel + (pixel – 1)
PSET (i, j), c ‘Hidupkan pixel pada edit.area
NEXT
NEXT
PSET (194 + oldx, 11 + oldy), c ‘Hidupkan pixel pada frame
ima(oldx, oldy) = c ‘Simpan data warna pada array ima
edit = 1
END IF
oldx = x
oldy = y
GOTO edit

help:
GET (xawal, yawal)-(xakhir, yakhir), save.screen%
CALL box(xawal, yawal, xakhir, yakhir, 15, 9, 12, 1)
CALL putfont(200, 17, “FUNCTION KEYS.”)
CALL putfont(195, 30, “C . . . . . . SET COLOR”)
CALL putfont(195, 40, “D . . . . . . . . . DELETE”)
CALL putfont(195, 50, “G . . . RESIZE AREA”)
CALL putfont(195, 60, “H . . . . . . . . . . . . HELP”)
CALL putfont(195, 70, “L . . . . LOAD IMAGE”)
CALL putfont(195, 80, “P . . . SET PALETTE”)
CALL putfont(195, 90, “Q . . . . . . . . . . . . QUIT”)
CALL putfont(195, 100, “R . . . . CLEAR AREA”)
CALL putfont(195, 110, “S . . . . SAVE IMAGE”)
CALL putfont(195, 120, “T . . . . . . . TRANSFER”)
CALL putfont(195, 130, “W . . . . SWAP IMAGE”)
CALL putfont(195, 140, “0…9 FILL PALETTE”)
CALL putfont(195, 150, “CR. TOGGLE STATUS”)
CALL putfont(195, 160, “ARR. MOVE CURSOR”)
a$ = INPUT$(1)
IF status.awal = 0 THEN
LINE (2, 87)-(178, 178), 0, BF
status.awal = 1
END IF
LINE (xawal – 3, yawal – 3)-(xakhir + 3, yakhir + 3), 0, BF
PUT (xawal, yawal), save.screen%
GOTO edit

colors:
CALL putfont(192, 160, “COLOR . . .”)
c = oldc
LINE (290, 161)-(295, 166), c, BF
c1:
DO
LOCATE 21, 33: PRINT USING “###”; c;
t$ = INKEY$
IF t$ = “” THEN GOTO c1
IF LEN(t$) <> 1 THEN t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN
IF c = 0 THEN c = 250 ELSE c = c – 1
LINE (290, 161)-(295, 166), c, BF
END IF
IF t$ = “M” THEN
IF c = 250 THEN c = 0 ELSE c = c + 1
LINE (290, 161)-(295, 166), c, BF
END IF
LOOP UNTIL t$ = CHR$(13)
oldc = c
CALL delln(21)
GOTO e1

set.palet:
CALL putfont(192, 160, “PALET 0 . . . 9”)
Pal$ = INPUT$(1)
Pal = VAL(Pal$)
CALL delln(21)
IF Pal < 0 OR Pal > 9 THEN GOTO set.palet
CALL delln(21)
CALL putfont(192, 160, “COLOR . . .”)
c = oldc
LINE (290, 161)-(295, 166), c, BF
sp1:
DO
LOCATE 21, 33: PRINT USING “###”; c;
t$ = INKEY$
IF t$ = “” THEN GOTO sp1
IF LEN(t$) <> 1 THEN t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN
IF c = 0 THEN c = 250 ELSE c = c – 1
LINE (290, 161)-(295, 166), c, BF
END IF
IF t$ = “M” THEN
IF c = 250 THEN c = 0 ELSE c = c + 1
LINE (290, 161)-(295, 166), c, BF
END IF
LOOP UNTIL t$ = CHR$(13)
Pal(Pal) = c
CALL delln(21)
GOTO e1

quit:
CALL putfont(192, 160, “QUIT . . . Y N”)
t$ = INPUT$(1)
IF t$ = “Y” OR t$ = “y” THEN SCREEN 0, 0: WIDTH 80: END
CALL delln(21)
GOTO e2

clearing:
CALL putfont(192, 160, “CLEARING . . .”)
FOR i = 1 TO col.len
FOR i1 = 1 TO row.len
ima(i, i1) = 0
FOR j = (i – 1) * pixel + 1 TO (i – 1) * pixel + (pixel – 1)
FOR k = (i1 – 1) * pixel + 1 TO (i1 – 1) * pixel + (pixel – 1)
PSET (j, k), 0 ‘Ganti warna dengan 0 pada edit.area
NEXT
NEXT
PSET (194 + i, 11 + i1), 0 ‘Ganti warna dengan 0 pada frame
NEXT
NEXT
edit = 0
CALL delln(21)
GOTO e2

transfer:
CALL putfont(192, 160, “TO OR FROM CEL”)
t$ = INPUT$(1)
CALL delln(21)

IF t$ = “t” OR t$ = “T” THEN
CALL putfont(192, 160, “CEL NO . . . 1 2”)
Cel$ = INPUT$(1)
Cel = VAL(Cel$)
CALL delln(21)
IF Cel < 1 OR Cel > 2 THEN GOTO transfer
IF Cel(Cel) = 1 THEN
CALL putfont(192, 160, “CANNOT TRANSFER !”)
CALL wait.time
CALL delln(21)
GOTO transfer
END IF
GET (195, 12)-(194 + col.len, 11 + row.len), image ‘Simpan image
PUT ((Cel – 1) * 50 + 193 + 2, 107), image ‘Put image di cel
CALL set.cel.frame(Cel, yes)
Cel(Cel) = 1
END IF

IF t$ = “F” OR t$ = “f” THEN
IF edit = 1 THEN
CALL putfont(192, 160, “CANNOT TRANSFER !”)
CALL wait.time
CALL delln(21)
GOTO e2
END IF
CALL putfont(192, 160, “CEL NO . . . 1 2”)
Cel$ = INPUT$(1)
Cel = VAL(Cel$)
CALL delln(21)
IF Cel < 1 OR Cel > 2 THEN GOTO transfer
IF Cel(Cel) = 0 THEN
CALL putfont(192, 160, “CANNOT TRANSFER !”)
CALL wait.time
CALL delln(21)
GOTO transfer
END IF

LINE ((x – 1) * pixel, (y – 1) * pixel)-((x – 1) * pixel + pixel, (y – 1) * pixel + pixel), 3, B
FOR i = 107 TO 106 + row.len
FOR j = (Cel – 1) * 50 + 193 + 2 TO (Cel – 1) * 50 + 193 + 1 + col.len
y1 = (i – 106)
x1 = (j – ((Cel – 1) * 50 + 193 + 2) + 1)
a = POINT(j, i)
ima(x1, y1) = a
FOR i1 = (x1 – 1) * pixel + 1 TO (x1 – 1) * pixel + (pixel – 1)
FOR j1 = (y1 – 1) * pixel + 1 TO (y1 – 1) * pixel + (pixel – 1)
PRESET (i1, j1), a
NEXT
NEXT
PRESET (194 + x1, 11 + y1), a
NEXT
NEXT
LINE ((x – 1) * pixel, (y – 1) * pixel)-((x – 1) * pixel + pixel, (y – 1) * pixel + pixel), 0, B
edit = 1
END IF
CALL delln(21)
GOTO e2

del:
CALL putfont(192, 160, “DELETE . . . Y N”)
t$ = INPUT$(1)
CALL delln(21)
IF t$ = “Y” OR t$ = “y” THEN GOTO d1
GOTO e2

d1:
CALL putfont(192, 160, “CEL NO . . . 1 2”)
Cel$ = INPUT$(1)
Cel = VAL(Cel$)
CALL delln(21)
IF Cel < 1 OR Cel > 2 THEN GOTO del
IF Cel(Cel) = 0 THEN
CALL putfont(192, 160, “CANNOT DELETE !”)
CALL wait.time
CALL delln(21)
GOTO del
END IF

GET ((Cel – 1) * 50 + 193 + 2, 107)-((Cel – 1) * 50 + 193 + 1 + col.len, 106 + row.len), image
PUT ((Cel – 1) * 50 + 193 + 2, 107), image
CALL set.cel.frame(Cel, No)
Cel(Cel) = 0
GOTO e2

mirror:
CALL putfont(192, 160, “SWAP . . . H V”)
t$ = INPUT$(1)
CALL delln(21)

IF t$ = “H” OR t$ = “h” THEN
CALL putfont(192, 160, “SWAPING . . .”)
FOR i = 1 TO col.len
FOR j = 1 TO (row.len + 1) / 2
SWAP ima(i, j), ima(i, row.len + 1 – j)
NEXT
NEXT
END IF

IF t$ = “V” OR t$ = “v” THEN
CALL putfont(192, 160, “SWAPING . . .”)
FOR i = 1 TO (col.len + 1) / 2
FOR j = 1 TO row.len
SWAP ima(i, j), ima(col.len + 1 – i, j)
NEXT
NEXT
END IF

FOR i = 1 TO col.len
FOR j = 1 TO row.len
FOR i1 = (i – 1) * pixel + 1 TO (i – 1) * pixel + (pixel – 1)
FOR j1 = (j – 1) * pixel + 1 TO (j – 1) * pixel + (pixel – 1)
PRESET (i1, j1), ima(i, j)
NEXT
NEXT
PRESET (194 + i, 11 + j), ima(i, j)
NEXT
NEXT
CALL delln(21)
GOTO e2

resize.grid:
FOR i = 1 TO 2
IF Cel(i) = 1 THEN edt = 1
NEXT
FOR i = 1 TO col.len
FOR j = 1 TO row.len
IF ima(i, j) <> 0 THEN edt = 1
NEXT
NEXT
IF edt = 1 THEN
CALL putfont(192, 160, “CLEAR ALL FIRST !”)
CALL wait.time
CALL delln(21)
edt = 0
GOTO e2
END IF

r1:
CALL delln(21)
CALL putfont(192, 160, “RESIZE . . . Y N”)
t$ = INPUT$(1)
CALL delln(21)
IF t$ = “Y” OR t$ = “y” THEN GOTO r2
GOTO e2

r2:
CALL delln(21)
yg = col.len
CALL putfont(192, 160, “COL.”)
LOCATE 21, 29
PRINT yg
xg = row.len
CALL putfont(260, 160, “ROW.”)
LOCATE 21, 37
PRINT xg

r3:
t$ = INKEY$
IF t$ = “” THEN GOTO r3
IF t$ = CHR$(27) THEN CALL delln(21): GOTO r1
IF t$ = CHR$(13) THEN GOTO r4
IF LEN(t$) = 1 THEN GOTO r3 ELSE t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN yg = yg – 1: IF yg = 2 THEN yg = max.col.len
IF t$ = “M” THEN yg = yg + 1: IF yg = max.col.len + 1 THEN yg = 3
LOCATE 21, 29
PRINT yg
GOTO r3

r4:
t$ = INKEY$
IF t$ = “” THEN GOTO r4
IF t$ = CHR$(27) THEN CALL delln(21): GOTO r1
IF t$ = CHR$(13) THEN GOTO r5
IF LEN(t$) = 1 THEN GOTO r4 ELSE t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN xg = xg – 1: IF xg = 2 THEN xg = max.row.len
IF t$ = “M” THEN xg = xg + 1: IF xg = max.row.len + 1 THEN xg = 3
LOCATE 21, 37
PRINT xg
GOTO r4

r5:
new.col = yg
new.row = xg
GOSUB change.grid
CALL delln(21)
GOTO edit

change.grid:
CALL delln(21)
CALL putfont(192, 160, “RESIZING AREA”)
old.col = col.len
old.row = row.len
col.len = new.col
row.len = new.row
x = 1
y = 1
oldx = 1
oldy = 1
total.byte = 4 + INT(((col.len + 1) * 8 + 7) / 8) * (row.len + 1)
ima.dim = INT(total.byte / 2)
ERASE image
REDIM image(ima.dim)
FOR i = 1 TO 2
LINE ((i – 1) * 50 + 193, 105)-((i – 1) * 50 + 193 + old.col + 3, 108 + old.row), 0, B
NEXT
CALL draw.cel.frame
LINE (193, 10)-(196 + old.col, 13 + old.row), 0, B
CALL draw.ima.frame
LINE (0, 0)-((old.col – 1) * pixel + pixel, (old.row – 1) * pixel + pixel), 0, BF
CALL draw.edit.area
LINE ((x – 1) * pixel, (y – 1) * pixel)-((x – 1) * pixel + pixel, (y – 1) * pixel + pixel), 0, B
CALL delln(21)
RETURN

refresh.grid:
CALL delln(21)
CALL putfont(192, 160, “RESIZING AREA”)
x = 1
y = 1
oldx = 1
oldy = 1

Cel(1) = 0: Cel(2) = 0
‘Refresh Draw Cell Frame
LINE (190, 105)-(300, 180), 0, BF
‘Refresh Draw Image Frame
LINE (190, 10)-(300, 60), 0, BF
‘Refresh Edit Area
LINE (0, 0)-(180, 180), 0, BF
FOR i = 1 TO 2
LINE ((i – 1) * 50 + 193, 105)-((i – 1) * 50 + 193 + col.len + 3, 108 + row.len), 0, B
NEXT
CALL draw.cel.frame
LINE (193, 10)-(196 + col.len, 13 + row.len), 0, B
CALL draw.ima.frame
LINE (0, 0)-((col.len – 1) * pixel + pixel, (row.len – 1) * pixel + pixel), 0, BF
CALL draw.edit.area
LINE ((x – 1) * pixel, (y – 1) * pixel)-((x – 1) * pixel + pixel, (y – 1) * pixel + pixel), 0, B
‘Put Image on Active Cell
PUT (195, 12), image
‘Draw Image on Edit Area
FOR i = 12 TO 11 + row.len
FOR j = 193 + 2 TO 193 + 1 + col.len
y1 = (i – 11)
x1 = (j – (193 + 2) + 1)
a = POINT(j, i)
ima(x1, y1) = a
FOR i1 = (x1 – 1) * pixel + 1 TO (x1 – 1) * pixel + (pixel – 1)
FOR j1 = (y1 – 1) * pixel + 1 TO (y1 – 1) * pixel + (pixel – 1)
PRESET (i1, j1), a
NEXT
NEXT
NEXT
NEXT
CALL delln(21)
RETURN

cropping:
FOR i = 1 TO col.len
FOR j = 1 TO row.len
IF ima(i, j) <> 0 THEN edt = 1
NEXT
NEXT
IF edt = 0 THEN
CALL putfont(192, 160, “LOAD TO EDIT AREA”)
CALL wait.time
CALL delln(21)
GOTO e2
END IF

CALL delln(21)
CALL putfont(192, 160, “UP LFT RGT DWN”)
k$ = INPUT$(1)
CALL delln(21)
IF k$ = “U” OR k$ = “u” THEN GOTO o1
IF k$ = “L” OR k$ = “l” THEN GOTO o2
IF k$ = “R” OR k$ = “r” THEN GOTO o3
IF k$ = “D” OR k$ = “d” THEN GOTO o4
GOTO e2

o1:
CALL delln(21)
CALL putfont(192, 160, “TOTAL ROWS”)
o11:
DO
LOCATE 21, 35: PRINT USING “###”; pix;
t1$ = INKEY$
IF t1$ = “” THEN GOTO o11
IF LEN(t1$) <> 1 THEN t1$ = RIGHT$(t1$, 1)
IF t1$ = “K” THEN
IF pix = 0 THEN pix = 3 ELSE pix = pix – 1
END IF
IF t1$ = “M” THEN
IF pix = 3 THEN pix = 0 ELSE pix = pix + 1
END IF
LOOP UNTIL t1$ = CHR$(13)
CALL delln(21)
‘Ambil Gambar di cell aktif
row.len = row.len – pix
total.byte = 4 + INT(((col.len + 1) * 8 + 7) / 8) * (row.len + 1)
ima.dim = INT(total.byte / 2)
ERASE image
REDIM image(ima.dim)
GET (195, 12 + pix)-(194 + col.len, 11 + row.len + pix), image
GOSUB refresh.grid
GOTO edit

o2:
CALL delln(21)
CALL putfont(192, 160, “TOTAL COLS”)
o21:
DO
LOCATE 21, 35: PRINT USING “###”; pix;
t$ = INKEY$
IF t$ = “” THEN GOTO o21
IF LEN(t$) <> 1 THEN t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN
IF pix = 0 THEN pix = 3 ELSE pix = pix – 1
END IF
IF t$ = “M” THEN
IF pix = 3 THEN pix = 0 ELSE pix = pix + 1
END IF
LOOP UNTIL t$ = CHR$(13)
CALL delln(21)
‘Ambil Gambar di cell aktif
col.len = col.len – pix
total.byte = 4 + INT(((col.len + 1) * 8 + 7) / 8) * (row.len + 1)
ima.dim = INT(total.byte / 2)
ERASE image
REDIM image(ima.dim)
GET (195 + pix, 12)-(194 + col.len + pix, 11 + row.len), image
GOSUB refresh.grid
GOTO edit

o3:
CALL delln(21)
CALL putfont(192, 160, “TOTAL COLS”)
o31:
DO
LOCATE 21, 35: PRINT USING “###”; pix;
t$ = INKEY$
IF t$ = “” THEN GOTO o31
IF LEN(t$) <> 1 THEN t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN
IF pix = 0 THEN pix = 3 ELSE pix = pix – 1
END IF
IF t$ = “M” THEN
IF pix = 3 THEN pix = 0 ELSE pix = pix + 1
END IF
LOOP UNTIL t$ = CHR$(13)
CALL delln(21)
‘Ambil Gambar di cell aktif
col.len = col.len – pix
total.byte = 4 + INT(((col.len + 1) * 8 + 7) / 8) * (row.len + 1)
ima.dim = INT(total.byte / 2)
ERASE image
REDIM image(ima.dim)
GET (195, 12)-(194 + col.len, 11 + row.len), image
GOSUB refresh.grid
GOTO edit

o4:
CALL delln(21)
CALL putfont(192, 160, “TOTAL ROWS”)
o41:
DO
LOCATE 21, 35: PRINT USING “###”; pix;
t$ = INKEY$
IF t$ = “” THEN GOTO o41
IF LEN(t$) <> 1 THEN t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN
IF pix = 0 THEN pix = 3 ELSE pix = pix – 1
END IF
IF t$ = “M” THEN
IF pix = 3 THEN pix = 0 ELSE pix = pix + 1
END IF
LOOP UNTIL t$ = CHR$(13)
CALL delln(21)
‘Ambil Gambar di cell aktif
row.len = row.len – pix
total.byte = 4 + INT(((col.len + 1) * 8 + 7) / 8) * (row.len + 1)
ima.dim = INT(total.byte / 2)
ERASE image
REDIM image(ima.dim)
GET (195, 12)-(194 + col.len, 11 + row.len), image
GOSUB refresh.grid
GOTO edit

save:
CALL putfont(192, 160, “SAVE . . . Y N”)
t$ = INPUT$(1)
CALL delln(21)
IF t$ = “Y” OR t$ = “y” THEN GOTO s0 ELSE GOTO e2

s0:
cn = 1
CALL putfont(192, 160, “SAVE CEL NO. “)
LOCATE 21, 37
PRINT cn

s1:
t$ = INKEY$
IF t$ = “” THEN GOTO s1
IF t$ = CHR$(27) THEN CALL delln(21): GOTO save
IF t$ = CHR$(13) THEN CALL delln(21): GOTO s2
IF LEN(t$) = 1 THEN GOTO s1 ELSE t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN cn = cn – 1: IF cn = 0 THEN cn = 2
IF t$ = “M” THEN cn = cn + 1: IF cn = 3 THEN cn = 1
LOCATE 21, 37
PRINT cn
GOTO s1

s2:
IF Cel(cn) = 1 THEN GOTO s3
CALL putfont(192, 160, “CANNOT SAVE”)
CALL wait.time
CALL delln(21)
GOTO save

s3:
total.bytes = 4 + INT(((col.len + 1) * 8 + 7) / 8) * (row.len + 1)
ima.dim = INT(total.bytes / 2)
ERASE main.ima
REDIM main.ima(ima.dim) AS INTEGER
GET ((cn – 1) * 50 + 193 + 2, 107)-((cn – 1) * 50 + 193 + 1 + col.len, 106 + row.len), main.ima
file.name$ = get.filename(21, 25, 15)
CALL delln(21)
file.shp$ = file.name$ + “.SHP”
CALL putfont(192, 160, “SAVING . . .”)
OPEN file.shp$ FOR OUTPUT AS #1
FOR init = 0 TO ima.dim
WRITE #1, main.ima(init)
NEXT
CLOSE #1
CALL delln(21)
GOTO e2

load:
CALL putfont(192, 160, “LOAD . . . Y N”)
t$ = INPUT$(1)
CALL delln(21)
IF t$ = “Y” OR t$ = “y” THEN GOTO l0 ELSE GOTO e2

l0:
cn = 1
CALL putfont(192, 160, “INTO CEL NO. “)
LOCATE 21, 37
PRINT cn

l1:
t$ = INKEY$
IF t$ = “” THEN GOTO l1
IF t$ = CHR$(27) THEN CALL delln(21): GOTO load
IF t$ = CHR$(13) THEN CALL delln(21): GOTO l2
IF LEN(t$) = 1 THEN GOTO l1 ELSE t$ = RIGHT$(t$, 1)
IF t$ = “K” THEN cn = cn – 1: IF cn = 0 THEN cn = 2
IF t$ = “M” THEN cn = cn + 1: IF cn = 3 THEN cn = 1
LOCATE 21, 37
PRINT cn
GOTO l1

l2:
IF Cel(cn) = 0 THEN GOTO l3
CALL putfont(192, 160, “CANNOT LOAD”)
CALL wait.time
CALL delln(21)
GOTO load

l3:
total.bytes = 4 + INT(((col.len + 1) * 8 + 7) / 8) * (row.len + 1)
ima.dim = INT(total.bytes / 2)
ERASE main.ima
REDIM main.ima(ima.dim) AS INTEGER
file.name$ = get.filename(21, 25, 15)
CALL delln(21)
file.shp$ = file.name$ + “.SHP”
CALL putfont(192, 160, “LOADING. . .”)
OPEN file.shp$ FOR INPUT AS #1
INPUT #1, col.load
INPUT #1, row.load
IF (col.load = col.len * 8) AND (row.load = row.len) THEN
main.ima(0) = col.load
main.ima(1) = row.load
FOR init = 2 TO ima.dim
INPUT #1, buffers%
main.ima(init) = buffers%
NEXT
CLOSE #1
PUT ((cn – 1) * 50 + 193 + 2, 107), main.ima
Cel(cn) = 1
CALL set.cel.frame(cn, yes)
CALL delln(21)
GOTO load
END IF
CALL delln(21)
CALL putfont(192, 160, “CANNOT LOAD”)
CALL wait.time
CALL delln(21)
CALL putfont(192, 160, “SIZE “)
LOCATE 21, 30
PRINT STR$(col.load / 8); ” x”; STR$(row.load)
CALL wait.time
CALL delln(21)
CLOSE #1
GOTO load

ErrorProc:
CALL delln(21)
CALL putfont(192, 160, “ERROR.”)
LOCATE 21, 35
PRINT ; ERR
CALL wait.time
CALL delln(21)
RESUME e2
CALL delln(21)
GOTO e2

‘Huruf A
DATA 64 , 8 , 0 , 3855 , 2319 , 0 , 3840 , 2319 , 3855 , 9
DATA 3855 , 2313 , 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 3855
DATA 3855 , 2319 , 3855 , 2313 , 3849 , 2319 , 3855 , 9 , 3840 , 2319
DATA 2313 , 9 , 2304 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf B
DATA 64 , 8 , 3855 , 3855 , 3855 , 9 , 3855 , 2313 , 3849 , 2319
DATA 3855 , 9 , 3840 , 2319 , 3855 , 3855 , 3855 , 9 , 3855 , 2313
DATA 3849 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 3855 , 3855 , 2313
DATA 2313 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf C
DATA 64 , 8 , 0 , 3855 , 3855 , 0 , 3840 , 2319 , 3849 , 2319
DATA 3855 , 2313 , 2304 , 2313 , 3855 , 9 , 0 , 0 , 3855 , 9
DATA 0 , 0 , 3840 , 2319 , 3840 , 2319 , 0 , 3855 , 3855 , 2313
DATA 0 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf D
DATA 64 , 8 , 3855 , 3855 , 2319 , 0 , 3855 , 2313 , 3855 , 9
DATA 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 9
DATA 3840 , 2319 , 3855 , 9 , 3855 , 2313 , 3855 , 3855 , 2319 , 9
DATA 2313 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf E
DATA 64 , 8 , 3855 , 3855 , 3855 , 2319 , 3855 , 2313 , 2313 , 2313
DATA 3855 , 9 , 0 , 0 , 3855 , 3855 , 3855 , 9 , 3855 , 2313
DATA 2313 , 9 , 3855 , 9 , 0 , 0 , 3855 , 3855 , 3855 , 2319
DATA 2313 , 2313 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf F
DATA 64 , 8 , 3855 , 3855 , 3855 , 2319 , 3855 , 2313 , 2313 , 2313
DATA 3855 , 9 , 0 , 0 , 3855 , 3855 , 3855 , 9 , 3855 , 2313
DATA 2313 , 9 , 3855 , 9 , 0 , 0 , 3855 , 9 , 0 , 0
DATA 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf G
DATA 64 , 8 , 0 , 3855 , 3855 , 2319 , 3840 , 2319 , 2313 , 2313
DATA 3855 , 9 , 0 , 0 , 3855 , 9 , 3855 , 2319 , 3855 , 9
DATA 3849 , 2319 , 3840 , 2319 , 3840 , 2319 , 0 , 3855 , 3855 , 2319
DATA 0 , 2313 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf H
DATA 64 , 8 , 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319
DATA 3855 , 9 , 3840 , 2319 , 3855 , 3855 , 3855 , 2319 , 3855 , 2313
DATA 3849 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319
DATA 2313 , 9 , 2304 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf I
DATA 56 , 8 , 3855 , 3855 , 3855 , 2313 , 3849 , 2319 , 2313 , 0
DATA 3855 , 9 , 0 , 3840 , 2319 , 0 , 0 , 3855 , 9 , 0
DATA 3840 , 2319 , 0 , 3855 , 3855 , 3855 , 2313 , 2313 , 2313 , 2313
DATA 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
‘Huruf J
DATA 64 , 8 , 0 , 3840 , 3855 , 2319 , 0 , 2304 , 3849 , 2319
DATA 0 , 0 , 3840 , 2319 , 0 , 0 , 3840 , 2319 , 3855 , 9
DATA 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 2313
DATA 2304 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf K
DATA 64 , 8 , 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3855 , 2313
DATA 3855 , 3849 , 2319 , 9 , 3855 , 3855 , 2313 , 0 , 3855 , 3855
DATA 15 , 0 , 3855 , 3849 , 3855 , 0 , 3855 , 9 , 3855 , 2319
DATA 2313 , 9 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf L
DATA 56 , 8 , 3855 , 9 , 0 , 3840 , 2319 , 0 , 0 , 3855
DATA 9 , 0 , 3840 , 2319 , 0 , 0 , 3855 , 9 , 0 , 3840
DATA 2319 , 0 , 0 , 3855 , 3855 , 3855 , 2313 , 2313 , 2313 , 2313
DATA 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
‘Huruf M
DATA 64 , 8 , 3855 , 9 , 3840 , 2319 , 3855 , 2319 , 3855 , 2319
DATA 3855 , 3855 , 3855 , 2319 , 3855 , 3855 , 3855 , 2319 , 3855 , 3849
DATA 3849 , 2319 , 3855 , 2313 , 3849 , 2319 , 3855 , 9 , 3840 , 2319
DATA 2313 , 9 , 2304 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf N
DATA 64 , 8 , 3855 , 9 , 3840 , 2319 , 3855 , 2319 , 3840 , 2319
DATA 3855 , 3855 , 3849 , 2319 , 3855 , 3855 , 3855 , 2319 , 3855 , 3849
DATA 3855 , 2319 , 3855 , 9 , 3855 , 2319 , 3855 , 9 , 3840 , 2319
DATA 2313 , 9 , 2304 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf O
DATA 64 , 8 , 3840 , 3855 , 3855 , 9 , 3855 , 2313 , 3849 , 2319
DATA 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 9
DATA 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 9
DATA 2304 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf P
DATA 64 , 8 , 3855 , 3855 , 3855 , 9 , 3855 , 2313 , 3849 , 2319
DATA 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 3855
DATA 3855 , 2313 , 3855 , 2313 , 2313 , 9 , 3855 , 9 , 0 , 0
DATA 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf Q
DATA 64 , 8 , 3840 , 3855 , 3855 , 9 , 3855 , 2313 , 3849 , 2319
DATA 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 3849
DATA 3855 , 2319 , 3855 , 2313 , 3855 , 2313 , 3840 , 3855 , 2319 , 2319
DATA 2304 , 2313 , 9 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf R
DATA 64 , 8 , 3855 , 3855 , 3855 , 9 , 3855 , 2313 , 3849 , 2319
DATA 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3855 , 2319 , 3855 , 3855
DATA 2319 , 2313 , 3855 , 3849 , 3855 , 0 , 3855 , 9 , 3855 , 2319
DATA 2313 , 9 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf S
DATA 64 , 8 , 3840 , 3855 , 2319 , 0 , 3855 , 2313 , 3855 , 9
DATA 3855 , 9 , 2313 , 9 , 3840 , 3855 , 3855 , 9 , 2304 , 2313
DATA 3849 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 2313
DATA 2304 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf T
DATA 56 , 8 , 3855 , 3855 , 3855 , 2313 , 3849 , 2319 , 2313 , 0
DATA 3855 , 9 , 0 , 3840 , 2319 , 0 , 0 , 3855 , 9 , 0
DATA 3840 , 2319 , 0 , 0 , 3855 , 9 , 0 , 2304 , 2313 , 0
DATA 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
‘Huruf U
DATA 64 , 8 , 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319
DATA 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 9
DATA 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 2313
DATA 2304 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf V
DATA 64 , 8 , 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319
DATA 3855 , 9 , 3840 , 2319 , 3855 , 2319 , 3855 , 2319 , 3840 , 3855
DATA 3855 , 2313 , 0 , 3855 , 2319 , 9 , 0 , 3840 , 2313 , 0
DATA 0 , 2304 , 9 , 0 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf W
DATA 64 , 8 , 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3840 , 2319
DATA 3855 , 3849 , 3849 , 2319 , 3855 , 3855 , 3855 , 2319 , 3855 , 3855
DATA 3855 , 2319 , 3855 , 2319 , 3855 , 2319 , 3855 , 2313 , 3840 , 2319
DATA 2313 , 9 , 2304 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf X
DATA 64 , 8 , 3855 , 9 , 3840 , 2319 , 3855 , 2319 , 3855 , 2319
DATA 3840 , 3855 , 3855 , 2313 , 0 , 3855 , 2319 , 9 , 3840 , 3855
DATA 3855 , 0 , 3855 , 2319 , 3855 , 2319 , 3855 , 2313 , 3840 , 2319
DATA 2313 , 9 , 2304 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Huruf Y
DATA 56 , 8 , 3855 , 9 , 3855 , 3849 , 2319 , 3840 , 2319 , 3855
DATA 9 , 3855 , 9 , 3855 , 3855 , 2313 , 0 , 3855 , 2313 , 0
DATA 3840 , 2319 , 0 , 0 , 3855 , 9 , 0 , 2304 , 2313 , 0
DATA 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
‘Huruf Z
DATA 64 , 8 , 3855 , 3855 , 3855 , 2319 , 2313 , 2313 , 3855 , 2319
DATA 0 , 3840 , 3855 , 2313 , 0 , 3855 , 2319 , 9 , 3840 , 3855
DATA 2313 , 0 , 3855 , 2319 , 9 , 0 , 3855 , 3855 , 3855 , 2319
DATA 2313 , 2313 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Nol
DATA 64 , 8 , 0 , 0 , 0 , 0 , 3840 , 3855 , 3855 , 9
DATA 3855 , 2313 , 3849 , 2319 , 3855 , 9 , 3840 , 2319 , 3855 , 9
DATA 3840 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 9
DATA 0 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Satu
DATA 56 , 8 , 0 , 0 , 0 , 0 , 3840 , 2319 , 0 , 3840
DATA 3855 , 9 , 0 , 3840 , 2319 , 0 , 0 , 3855 , 9 , 0
DATA 3840 , 2319 , 0 , 3855 , 3855 , 3855 , 2313 , 2313 , 2313 , 2313
DATA 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
‘Dua
DATA 64 , 8 , 0 , 0 , 0 , 0 , 3840 , 3855 , 3855 , 9
DATA 3855 , 9 , 3840 , 2319 , 0 , 3840 , 3855 , 2313 , 3840 , 3855
DATA 2319 , 9 , 3855 , 2319 , 2313 , 0 , 3855 , 3855 , 3855 , 2319
DATA 2313 , 2313 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Tiga
DATA 64 , 8 , 0 , 0 , 0 , 0 , 3840 , 3855 , 3855 , 2319
DATA 0 , 3840 , 2319 , 9 , 0 , 3855 , 3855 , 0 , 0 , 2313
DATA 3849 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 2313
DATA 2304 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Empat
DATA 64 , 8 , 0 , 0 , 0 , 0 , 0 , 3840 , 3855 , 9
DATA 0 , 3855 , 3855 , 9 , 3840 , 2319 , 3855 , 9 , 3855 , 2313
DATA 3855 , 9 , 3855 , 3855 , 3855 , 2319 , 2313 , 2313 , 3855 , 2313
DATA 0 , 0 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Lima
DATA 64 , 8 , 0 , 0 , 0 , 0 , 3855 , 3855 , 3855 , 9
DATA 3855 , 2313 , 2313 , 9 , 3855 , 3855 , 3855 , 0 , 2313 , 2313
DATA 3849 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 2313
DATA 2304 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Enam
DATA 64 , 8 , 0 , 0 , 0 , 0 , 3840 , 3855 , 3855 , 9
DATA 3855 , 2313 , 0 , 0 , 3855 , 3855 , 3855 , 9 , 3855 , 2313
DATA 3849 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 2313
DATA 2304 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Tujuh
DATA 64 , 8 , 0 , 0 , 0 , 0 , 3855 , 3855 , 3855 , 2319
DATA 3855 , 2313 , 3849 , 2319 , 2313 , 9 , 3855 , 2313 , 0 , 3840
DATA 2319 , 9 , 0 , 3855 , 2313 , 0 , 0 , 3855 , 9 , 0
DATA 0 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Delapan
DATA 64 , 8 , 0 , 0 , 0 , 0 , 3840 , 3855 , 3855 , 9
DATA 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 9 , 3855 , 2313
DATA 3849 , 2319 , 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 2313
DATA 2304 , 2313 , 2313 , 9 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Sembilan
DATA 64 , 8 , 0 , 0 , 0 , 0 , 3840 , 3855 , 3855 , 9
DATA 3855 , 9 , 3840 , 2319 , 3840 , 3855 , 3855 , 2319 , 2304 , 2313
DATA 3849 , 2319 , 0 , 0 , 3855 , 2313 , 3840 , 3855 , 2319 , 9
DATA 2304 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0 , 0 , 0
‘Titik
DATA 24 , 8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3840
DATA 2319 , 3855 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0
‘Tanda Seru
DATA 24 , 8 , 3855 , 3849 , 2319 , 3855 , 3849 , 2319 , 3855 , 2313
DATA 9 , 3855 , 2313 , 2313 , 0 , 0 , 0 , 0 , 0 , 0
DATA 0

REM $STATIC
SUB box (x1%, y1%, x2%, y2%, c1%, c2%, c3%, c4%)
LINE (x1 – 1, y1 – 1)-(x1 + 3, y1 + 3), c1, B
LINE (x1, y1)-(x1 + 2, y1 + 2), c3, BF
LINE (x2 – 1, y1 – 1)-(x2 + 3, y1 + 3), c1, B
LINE (x2, y1)-(x2 + 2, y1 + 2), c3, BF
LINE (x1 + 4, y1)-(x2 – 2, y1), c1
LINE (x1 + 4, y1 + 1)-(x2 – 2, y1 + 1), c2
LINE (x1 + 4, y1 + 2)-(x2 – 2, y1 + 2), c1
LINE (x1 + 4, y1 + 3)-(x2 – 4, y1 + 3), 0
LINE (x1 + 3, y1 + 4)-(x2 – 3, y1 + 4), 0
FOR i = y1 + 4 TO y2 – 2
LINE (x1 – 1, y1 + 4)-(x1 – 1, i), 0
LINE (x1, y1 + 4)-(x1, i), c1
LINE (x1 + 1, y1 + 4)-(x1 + 1, i), c2
LINE (x1 + 2, y1 + 4)-(x1 + 2, i), c1
LINE (x1 + 3, y1 + 4)-(x1 + 3, i), 0
LINE (x2 – 1, y1 + 4)-(x2 – 1, i), 0
LINE (x2, y1 + 4)-(x2, i), c1
LINE (x2 + 1, y1 + 4)-(x2 + 1, i), c2
LINE (x2 + 2, y1 + 4)-(x2 + 2, i), c1
LINE (x2 + 3, y1 + 4)-(x2 + 3, i), 0
FOR z = 1 TO 3000: NEXT
LINE (x1 – 1, (i + 1) – 1)-(x1 + 3, (i + 1) + 3), c1, B
LINE (x1, (i + 1))-(x1 + 2, (i + 1) + 2), c3, BF
LINE (x2 – 1, (i + 1) – 1)-(x2 + 3, (i + 1) + 3), c1, B
LINE (x2, (i + 1))-(x2 + 2, (i + 1) + 2), c3, BF
LINE (x1 + 4, (i + 1))-(x2 – 2, (i + 1)), c1
LINE (x1 + 4, (i + 1))-(x2 – 2, (i + 1)), 0
LINE (x1 + 4, (i + 1) + 1)-(x2 – 2, (i + 1) + 1), c2
LINE (x1 + 4, (i + 1) + 2)-(x2 – 2, (i + 1) + 2), c1
NEXT
LINE (x1 + 4, i)-(x2 – 2, i), c1
PAINT (INT((x2 – x1) / 2) + x1, INT((y2 – y1) / 2) + y1), c4, c1
END SUB

DEFSNG A-Z
SUB delln (bar!)
LOCATE bar, 25
PRINT STRING$(15, 32)
END SUB

SUB draw.cel.frame
FOR i = 1 TO 2
LINE ((i – 1) * 50 + 193, 105)-((i – 1) * 50 + 193 + col.len + 3, 108 + row.len), 7, B
NEXT
END SUB

SUB draw.edit.area
FOR i = 1 TO row.len
FOR j = 1 TO col.len
LINE ((j – 1) * pixel, (i – 1) * pixel)-((j – 1) * pixel + pixel, (i – 1) * pixel + pixel), 7, B
NEXT
NEXT
END SUB

SUB draw.ima.frame
LINE (193, 10)-(196 + col.len, 13 + row.len), 3, B, &HAAAA
END SUB

FUNCTION get.filename$ (rowloc AS INTEGER, colloc AS INTEGER, length AS INTEGER)
buff$ = “”
LOCATE rowloc, colloc
GOTO get.it

cursor.cont:
colloct = (colloc – 1) * 8
rowloct = (rowloc – 1) * 8

cc1:
w$ = INKEY$
IF w$ <> “” THEN RETURN
ca = ca + 1
IF ca < 150 THEN GOTO cc1
ca = 0
fl = NOT fl
IF fl THEN
LINE (colloct, rowloct)-(colloct + 7, rowloct + 7), 3, BF: GOTO cc1
ELSE
LINE (colloct, rowloct)-(colloct + 7, rowloct + 7), 0, BF: GOTO cc1
END IF
RETURN

get.it:
GOSUB cursor.cont
IF LEN(w$) = 2 THEN GOTO get.it
IF w$ = CHR$(13) THEN GOTO ending
IF w$ = CHR$(8) THEN
IF buff$ = “” THEN
GOTO get.it
ELSE
PRINT ” “; CHR$(29); CHR$(29); : colloc = colloc – 1
buff$ = LEFT$(buff$, LEN(buff$) – 1): GOTO get.it
END IF
END IF
IF w$ < “” OR w$ > CHR$(127) THEN GOTO get.it
IF LEN(buff$) = length THEN
GOTO get.it
ELSE
PRINT w$; : buff$ = buff$ + w$: colloc = colloc + 1: GOTO get.it
END IF

ending:
get.filename$ = buff$
END FUNCTION

SUB msg (rl AS INTEGER, cl AS INTEGER, message$)
CALL writeln(rl, cl, message$)
CALL wait.time
CALL delln(21)
END SUB

DEFINT A-Z
SUB putfont (col, row, text$)
spasi = 0
GOSUB cetak
EXIT SUB

cetak:
FOR xx = 1 TO LEN(text$)
num = ASC(MID$(text$, xx, 1))
IF num > 47 AND num < 58 THEN
ON num – 47 GOSUB 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
END IF
IF num > 64 AND num < 91 THEN
ON num – 64 GOSUB ba, bb, bc, bd, be, BF, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz
END IF
IF num = 33 THEN GOSUB seru
IF num = 46 THEN GOSUB titik

‘dimension 3 x 8, 7 x 8, 8 x 8
SELECT CASE num
CASE 32, 33, 46
col = col + 3 + spasi
CASE 49, 73, 76, 84, 89
col = col + 7 + spasi
CASE ELSE
col = col + 8 + spasi
END SELECT
NEXT
RETURN

0 : PUT (col, row), f0: RETURN
1 : PUT (col, row), f1: RETURN
2 : PUT (col, row), f2: RETURN
3 : PUT (col, row), f3: RETURN
4 : PUT (col, row), f4: RETURN
5 : PUT (col, row), f5: RETURN
6 : PUT (col, row), f6: RETURN
7 : PUT (col, row), f7: RETURN
8 : PUT (col, row), f8: RETURN
9 : PUT (col, row), f9: RETURN

ba: PUT (col, row), ba: RETURN
bb: PUT (col, row), bb: RETURN
bc: PUT (col, row), bc: RETURN
bd: PUT (col, row), bd: RETURN
be: PUT (col, row), be: RETURN
BF: PUT (col, row), BF: RETURN
bg: PUT (col, row), bg: RETURN
bh: PUT (col, row), bh: RETURN
bi: PUT (col, row), bi: RETURN
bj: PUT (col, row), bj: RETURN
bk: PUT (col, row), bk: RETURN
bl: PUT (col, row), bl: RETURN
bm: PUT (col, row), bm: RETURN
bn: PUT (col, row), bn: RETURN
bo: PUT (col, row), bo: RETURN
bp: PUT (col, row), bp: RETURN
bq: PUT (col, row), bq: RETURN
br: PUT (col, row), br: RETURN
bs: PUT (col, row), bs: RETURN
bt: PUT (col, row), bt: RETURN
bu: PUT (col, row), bu: RETURN
bv: PUT (col, row), bv: RETURN
bw: PUT (col, row), bw: RETURN
bx: PUT (col, row), bx: RETURN
by: PUT (col, row), by: RETURN
bz: PUT (col, row), bz: RETURN

titik: PUT (col, row), titik: RETURN
seru: PUT (col, row), seru: RETURN

END SUB

DEFSNG A-Z
SUB set.cel.frame (celnum AS INTEGER, switch AS INTEGER)
SELECT CASE switch
CASE 0
LINE ((celnum – 1) * 50 + 193, 105)-((celnum – 1) * 50 + 193 + col.len + 3, 108 + row.len), 7, B
CASE 1
LINE ((celnum – 1) * 50 + 193, 105)-((celnum – 1) * 50 + 193 + col.len + 3, 108 + row.len), 0, B
LINE ((celnum – 1) * 50 + 193, 105)-((celnum – 1) * 50 + 193 + col.len + 3, 108 + row.len), 3, B, &HAAAA
END SELECT
END SUB

SUB wait.time

again:
r$ = INKEY$
IF r$ = “” THEN GOTO again
END SUB

SUB writeln (rloc AS INTEGER, cloc AS INTEGER, stm$)
LOCATE rloc, cloc
PRINT stm$
END SUB

Program Sprite Editor diatas ditulis dalam bahasa Quick Basic. Jika kita perhatikan sekilas, banyak sekali lompatan-lompatan GOTO dan GOSUB yang digunakan, disamping ada juga beberapa subrutin yang digunakan. Program Sprite Editor terbagi menjadi area menggambar, lalu sebuah cell (kotak kecil) untuk memantau hasil gambar di bagian kanan atas, lalu disediakan dua buah cell lagi untuk menampung hasil akhir sprite yang dapat disimpan menjadi file. Gunakan tombol ENTER untuk berpindah antara mode menggambar dan menggerakkan kursor. Jika pada mode menggambar, menggerakkan kursor akan mewarnai gambar sprite kita. Ubah warna yang digunakan dengan tombol C, pilih warna dengan menggerakkan tombol panah kanan dan kiri. Tombol T digunakan untuk mentransfer sprite dari area menggambar ke cell di bawah, lalu kita dapat simpan dengan menekan tombol S. Penamaan file masih mengikuti aturan DOS, yaitu tidak boleh lebih dari 8 karakter dan tanpa ekstension.
Cobalah anda buat dan desain bentuk-bentuk sprite sesuai desain dan kreatifitas anda sendiri. Yang perlu diingat adalah dimensi sprite maksimum adalah 45×45 pixel dengan maksimum warna sebanyak 256 warna.