- ’=====================
- ’CHARACTER EDITOR v2.1
- ’(c)SmileBoom Co.Ltd.
- ’・ハ゜レットカンケイシュウセイ
- ’=====================
- CLS:ICONCLR
- FOR P=1 TO 0 STEP -1
- GPAGE P,P,P:GCLS 0:GPRIO 3
- SPPAGE P:SPCLR
- BGPAGE P:BGCLR
- BGCLIP 0,0,31,23
- BGOFS 0,0,0:BGOFS 1,0,0
- NEXT
- VISIBLE 1,1,0,0,1,1
- ’---
- CLEAR
- DIM CBANK(3),CBMAX(3),CSTR$(3)
- DIM CS$(3,4),CTYPE$(3)
- DIM MD$(4),SPIN(5),OFS(8,8)
- DIM BCNT(4),ZST(4),BZC(4)
- DIM SW(8,8)
- ’--- キャラハ゛ンク
- DATA ”BGU”,4,”BG”
- DATA ”SPU”,8,”SP”
- DATA ”BGF”,1,”BG”
- FOR I=0 TO 2
- READ CSTR$(I),CBMAX(I),CTYPE$(I)
- NEXT
- ’---
- BCNT(0)=1:ZST(0)=8:BZC(0)=2
- BCNT(1)=2:ZST(1)=8:BZC(1)=2
- BCNT(2)=4:ZST(2)=4:BZC(2)=4
- BCNT(3)=8:ZST(3)=2:BZC(3)=8
- ’--- カ-ソル
- DATA ”й”,”и”,”ж”,”з”
- DATA ” ”,” ”,” ”,” ”
- FOR I=0 TO 1
- FOR J=0 TO 3
- READ CS$(I,J)
- NEXT
- NEXT
- ’--- モート゛モシ゛レツ
- DATA ” FILE”
- DATA ”CLEAR”
- DATA ”PAINT”
- DATA ” PEN”
- FOR I=0 TO 3
- READ MD$(I)
- NEXT
- ’--- スフ゜ライトホ゛タン
- _X=0:_Y=1:_N=2:_G=3
- _C=4:_T=5:_MAX=6
- TP=8:SPTOP=32:PR=0
- SBMAX=29:SPINTOP=19
- DIM SB(SBMAX,_MAX)
- ’---0-7:chr bank
- DATA 8,160,48,1,0,0
- DATA 24,160,49,1,0,0
- DATA 40,160,50,1,0,0
- DATA 56,160,51,1,0,0
- DATA 72,160,52,1,0,0
- DATA 88,160,53,1,0,0
- DATA 104,160,54,1,0,0
- DATA 120,160,55,1,0,0
- ’---8-10:bg/sp
- DATA 144,104,64,8,0,0
- DATA 144,120,67,8,0,1
- DATA 144,136,66,8,0,0
- ’---11-18:size
- DATA 192,128,76,11,0,0
- DATA 208,128,77,11,0,0
- DATA 224,128,78,11,0,0
- DATA 240,128,79,11,0,0
- DATA 192,144,76,15,0,0
- DATA 208,144,77,15,0,0
- DATA 224,144,78,15,0,0
- DATA 240,144,79,15,0,0
- ’---19-24:r,g,b
- DATA 152,24,92,0,0,0
- DATA 168,24,93,0,0,0
- DATA 152,48,92,0,0,0
- DATA 168,48,93,0,0,0
- DATA 152,72,92,0,0,0
- DATA 168,72,93,0,0,0
- ’---25-28:anim c,w
- DATA 224, 96,92,0,0,0
- DATA 240, 96,93,0,0,0
- DATA 224,112,92,0,0,0
- DATA 240,112,93,0,0,0
- ’---29
- SPPAGE 1
- FOR I=0 TO SBMAX-1
- FOR J=0 TO _MAX-1
- READ SB(I,J)
- NEXT
- SPSET I+SPTOP,SB(I,_N),0,0,0,PR
- SPOFS I+SPTOP,SB(I,_X),-16
- NEXT
- ’---
- FOR I=0 TO 3
- BREPEAT I,20,2
- NEXT
- ’--- ショキカ
- CPTP=-1:CTYPE=0
- GOSUB @SETCSTR
- PAL=0:COL=0:XC=7
- MODE=3:SPSW=FALSE
- CX=0:CY=0
- CSX=1:CSY=1:CSZ=1
- ZX=BCNT(CSX):ZY=BCNT(CSY)
- GOSUB @CALCZ:ZZ=BCNT(CSZ)
- GSX=256:ANTOP=84
- W1=0:W2=0:OLDAC=-1
- SPIN(3)=2:SPIN(4)=16
- GOSUB @ZSWON
- GOSUB @MKOFS
- GOSUB @SETCSUB
- GOSUB @DISPINIT
- ’+---------+
- ’| メインル-フ゜ |
- ’+---------+
- @MAIN
- ’
- OX=TX:OY=TY:OS=TS
- TX=TCHX:TY=TCHY:TS=TCHST
- OLDB=B:B=BTRIG():BN=BUTTON()
- OLDIC=IC:IC=ICONCHK()
- ’
- GOSUB @SPBUT
- GOSUB @SELCOL
- GOSUB @CSRMOVE
- GOSUB @COLCSR
- GOSUB @DRAWCOL
- GOSUB @CHKMODE
- GOSUB @SETAN
- ’
- VSYNC 1
- ’
- GOTO @MAIN
- ’====================
- @CSRMOVE ’ウエカ゛メンノカ-ソル
- ’====================
- VX=0:VY=0
- IF B AND 1 THEN VY=VY-1
- IF B AND 2 THEN VY=VY+1
- IF B AND 4 THEN VX=VX-1
- IF B AND 8 THEN VX=VX+1
- IF VX+VY==0 THEN @PUTCSR
- IF BN AND 256 THEN @LBUTSUB
- ’---
- GOSUB @CLRCSR
- GOSUB @CMCHECK
- GOSUB @MKOFS
- GOSUB @CHRZOOM
- ’---
- @PUTCSR
- N=OFS(0,0)+(CBANK(CTYPE)*256)
- LOCATE 23,23
- PRINT RIGHT$(” ”+STR$(N),4);
- LOCATE 28,23
- PRINT RIGHT$(” ”+STR$(CX),2);”,”;CY;
- COLOR CC:CC=CC+1
- CC=CC AND 15:N=0
- ’---
- @PCSRSUB
- IF CY THEN O=0:YO=CY-1:GOSUB @PCSRX
- IF CX THEN O=1:XO=CX-1:GOSUB @PCSRY
- O=2:YO=CY+ZY:GOSUB @PCSRX
- IF CX<32-ZX THEN O=3:XO=CX+ZX:GOSUB @PCSRY
- COLOR 0
- RETURN
- ’---
- @PCSRX
- FOR J=0 TO ZX-1
- IF CX+J<32 THEN LOCATE CX+J,YO:PRINT CS$(N,O)
- NEXT
- RETURN
- ’---
- @PCSRY
- FOR J=0 TO ZY-1
- LOCATE XO,CY+J:PRINT CS$(N,O)
- NEXT
- RETURN
- ’---
- @CLRCSR
- N=1:GOSUB @PCSRSUB
- RETURN
- ’====================
- @CMCHECK
- IF CTYPE!=1 THEN @CMS
- VX=VX*BZC(CSX)
- VY=VY*BZC(CSY)
- ’---
- @CMS
- CX=CX+VX
- IF CX<0 THEN CX=0
- IF CX>32-ZX THEN CX=32-ZX
- CY=CY+VY
- IF CY<0 THEN CY=0
- IF CY>8-ZY THEN CY=8-ZY
- ’---
- IF CTYPE!=1 THEN RETURN
- ’--- イチ ホセイ
- CX=FLOOR(CX/BZC(CSX))*BZC(CSX)
- CY=FLOOR(CY/BZC(CSY))*BZC(CSY)
- RETURN
- ’====================
- @SELCOL ’イロセンタク
- ’====================
- X=HDX:Y=HDY:W=255:H=15
- GOSUB @TOUCH
- IF R GOTO @_COLNEW
- ’--- ハ゛ンク
- X=PDX:Y=PDY:W=63:H=W
- GOSUB @TOUCH
- IF R==FALSE THEN RETURN
- X=FLOOR((X-PDX)/16)
- Y=FLOOR((Y-PDY)/16)
- SPCHR PAL+2,PAL+48,0,0,0,1
- C=PAL:PAL=Y*4+X
- SPCHR PAL+2,PAL+48,XC,0,0,1
- IF C==PAL THEN RETURN
- GOTO @SETCOLOR
- ’--- イロ
- @_COLNEW
- COL=FLOOR((X-HDX)/16)
- ’---
- @COLCSR
- X=COL*16:Y=0
- SPOFS 0,HDX+X,HDY+Y
- ’---
- @COLRGB
- X=19:C=PAL*16+COL
- COLREAD(CT$,C),SPIN(0),SPIN(1),SPIN(2)
- ’---
- @PUTSPIN
- N=0:Y= 2:C=13:GOSUB @PSPIN
- N=1:Y= 5:C= 4:GOSUB @PSPIN
- N=2:Y= 8:C=11:GOSUB @PSPIN
- X=24
- N=3:Y=12:C= 0:GOSUB @PSPIN
- N=4:Y=14:C= 0:GOSUB @PSPIN
- RETURN
- ’====================
- @COLBOX
- FOR I=0 TO 15
- X=I*16+HDX+1:Y=HDY+1
- GFILL X+1,Y,X+11,Y+12,PAL*16+I
- GFILL X,Y+1,X+12,Y+11,PAL*16+I
- NEXT
- X=HDX+1:Y=HDY+1
- GLINE X,Y+12,X+12,Y,PAL*16+15
- RETURN
- ’====================
- @DRAWCOL ’ト゛ットヲオク
- ’====================
- IF BN AND 256 THEN @_SPOIT
- IF TS GOTO @DRCHECK
- IF DR THEN @DCOLSUB
- RETURN
- ’---
- @DRCHECK
- X=EX:Y=EY:W=127:H=W
- GOSUB @TOUCH
- IF R==FALSE THEN RETURN
- ’---
- GOSUB @CALCZ:Z=ZST(CSZ)
- X=EX+(FLOOR((TX-EX)/Z)*Z)
- Y=EY+(FLOOR((TY-EY)/Z)*Z)
- C=PAL*16+COL:DR=TRUE
- IF (C AND 15)==0 THEN C=0
- IF MODE==1 GOTO @_CLEAR
- IF MODE==3 GOTO @_PEN
- ’---
- @_PAINT
- C2=C+16:C2=C2 AND 255
- GBOX EX-1,EY-1,EX+128,EY+128,C2
- GPAINT X,Y,C
- GOSUB @ZSWON
- RETURN
- ’---
- @_CLEAR
- Z=Z*8
- X=FLOOR((X-EX)/Z)
- Y=FLOOR((Y-EY)/Z)
- XX=EX+X*Z:YY=EY+Y*Z
- GFILL XX,YY,XX+Z-1,YY+Z-1,C
- GOSUB @ZSWSET
- RETURN
- ’---
- @_PEN
- GFILL X,Y,X+Z-1,Y+Z-1,C
- X=FLOOR((X-EX)/(Z*8))
- Y=FLOOR((Y-EY)/(Z*8))
- GOSUB @ZSWSET
- RETURN
- ’---
- @_SPOIT
- COL=GSPOIT(TX,TY) AND 15
- RETURN
- ’---
- @ZSWON
- N=1:GOTO @ZSW
- @ZSWOFF
- N=0
- @ZSW
- FOR Y=0 TO 7
- FOR X=0 TO 7
- SW(X,Y)=N
- NEXT
- NEXT
- RETURN
- ’---
- @ZSWSET
- SW(X,Y)=1
- RETURN
- ’====================
- @DCOLSUB ’ハナサレタラ サイヒ゛ョウカ゛
- GOSUB @REDO
- ’---
- @DRAWSUB
- SPPAGE 0:BGPAGE 0:GPAGE 1
- ZS=ZST(CSZ):ZD=ZS*8
- FOR YD=0 TO ZY-1
- FOR XD=0 TO ZX-1
- IF SW(XD,YD)==0 THEN @DSN
- X=EX+XD*ZD:Y=EY+YD*ZD
- I=OFS(XD,YD):GOSUB @SETCHR
- @DSN
- NEXT
- NEXT
- GOSUB @ZSWOFF
- SPPAGE 1:BGPAGE 1
- DR=FALSE
- RETURN
- ’---
- @SETCHR ’I=INDEX,X,Y=OFS
- CH$=””
- FOR IY=0 TO 7
- FOR IX=0 TO 7
- C=GSPOIT(IX*ZS+X,IY*ZS+Y)
- CH$=CH$+HEX$(C AND 15)
- NEXT
- NEXT
- ’---
- X=(CX+XD)*8:Y=(CY+YD)*8
- CHRSET CN$,I,CH$
- GPAGE 0
- GFILL X,Y,X+7,Y+7,0
- GPUTCHR X,Y,CN$,I,PAL,1
- GPAGE 1
- RETURN
- ’====================
- @CHKMODE ’モ-ト゛カクニン
- ’====================
- IF B==16 THEN @COPY
- IF B==32 THEN @PASTE
- IF B==64 THEN @REVH
- IF B==128 THEN @REVV
- IF B==512 THEN @UNDO
- ’---
- IF MODE==IC THEN RETURN
- IF IC==-1 THEN RETURN
- IF IC==0 GOTO @FILEMODE
- MODE=IC
- ’---
- @PUTMODE
- PNLSTR 27,20,MD$(MODE)
- RETURN
- ’====================
- @LBUTSUB ’ VX,VY
- GPAGE 0
- DX=ZX*8:XX=GX+DX-1
- DY=ZY*8:YY=GY+DY-1
- IF VY>0 THEN @SCRLD
- IF VY<0 THEN @SCRLU
- IF VX>0 THEN @SCRLR
- ’--- ←
- GCOPY GX,GY,GX,YY,GX+DX,GY,1
- GCOPY GX+1,GY,XX+2,YY,GX,GY,1
- GPAGE 1
- RETURN
- ’--- →
- @SCRLR
- GCOPY XX,GY,XX,YY,GX-1,GY,1
- GCOPY GX-2,GY,XX-1,YY,GX-1,GY,1
- GPAGE 1
- RETURN
- ’--- ↑
- @SCRLU
- GCOPY GX,GY,XX,GY,GX,GY+DY,1
- GCOPY GX,GY+1,XX,YY+2,GX,GY,1
- GPAGE 1
- RETURN
- ’--- ↓
- @SCRLD
- GCOPY GX,YY,XX,YY,GX,GY-1,1
- GCOPY GX,GY-2,XX,YY-1,GX,GY-1,1
- GPAGE 1
- RETURN
- ’--- ←→
- @REVH
- GPAGE 0
- X1=GX:X2=GX+(ZX*8)-1:X3=GX-1
- YY=GY+(ZY*8)-1:DX=FLOOR(ZX*4)
- FOR XX=0 TO DX-1
- GCOPY X1,GY,X1,YY,X3,GY,1
- GCOPY X2,GY,X2,YY,X1,GY,1
- GCOPY X3,GY,X3,YY,X2,GY,1
- GFILL X3,GY,X3,YY,0
- X1=X1+1:X2=X2-1
- NEXT
- GPAGE 1
- RETURN
- ’--- ↑↓
- @REVV
- GPAGE 0
- XX=GX+(ZX*8)-1:DY=FLOOR(ZY*4)
- Y1=GY:Y2=GY+(ZY*8)-1:Y3=GY-1
- FOR YY=0 TO DY-1
- GCOPY GX,Y1,XX,Y1,GX,Y3,1
- GCOPY GX,Y2,XX,Y2,GX,Y1,1
- GCOPY GX,Y3,XX,Y3,GX,Y2,1
- GFILL GX,Y3,XX,Y3,0
- Y1=Y1+1:Y2=Y2-1
- NEXT
- GPAGE 1
- RETURN
- ’---カンイコヒ゜-(ウエカ゛メンニノコス)
- @COPY
- IX=GX:IY=GY
- ’---
- @PUSHIMG
- GPAGE 0
- X=CX*8:Y=CY*8
- GFILL IX,IY,IX+63,IY+63,0
- J=((BN AND 256)!=0)
- GCOPY X,Y,X+ZX*8-1,Y+ZY*8-1,IX,IY,J
- GPAGE 1
- RETURN
- ’---REDO
- @REDO
- IX=RX:IY=RY
- GOSUB @PUSHIMG
- RETURN
- ’---UNDO
- @UNDO
- IX=RX:IY=RY
- GOTO @PSTSUB
- ’---PASTE
- @PASTE
- GOSUB @REDO
- IX=GX:IY=GY
- ’---
- @PSTSUB
- J=BN AND 256
- DX=ZST(CSZ):DY=ZST(CSZ)
- FOR YY=0 TO ZY*8-1
- FOR XX=0 TO ZX*8-1
- GPAGE 0
- I=GSPOIT(IX+XX,IY+YY)
- GPAGE 1
- IF J==0 THEN @PSTOK
- IF (I AND 15)==0 THEN @SKPPST
- @PSTOK
- GPSET EX+XX*DX,EY+YY*DY,I
- @SKPPST
- NEXT
- NEXT
- ’---
- GOSUB @ZSWON
- GOSUB @DRAWSUB
- GOSUB @CHRZOOM
- RETURN
- ’====================
- @SPBUT ’スフ゜ライトホ゛タン
- ’====================
- SBIX=-1
- IF SPSW==FALSE GOTO @_TOFF
- IF TS==0 GOTO @_TCLR0
- ’--- リヒ゜-トカクニン
- IF W1==30 GOTO @KR2
- W1=W1+1:IF W1<30 THEN RETURN
- GOTO @_TOFF
- @KR2
- W2=W2+1:IF W2<8 THEN RETURN
- GOTO @_TOFF
- ’--- スヒ゜ンホ゛タンカイホウ
- @_TCLR0
- W1=0:W2=0
- SPSW=FALSE
- ’---
- @_TCLR
- FOR I=SPINTOP TO SBMAX-1
- SB(I,_C)=0
- SPCHR I+SPTOP,SB(I,_N),SB(I,_C),0,0,PR
- SPOFS I+SPTOP,SB(I,_X),SB(I,_Y)
- NEXT
- RETURN
- ’---
- @_TOFF
- IF TS==FALSE THEN @_TCLR0
- SPSW=FALSE:W=15:H=W
- FOR I=0 TO SBMAX-1
- IF SPSW GOTO @_SKIPSP
- IF SB(I,_C)==XC THEN @SKIPSP
- X=SB(I,_X):Y=SB(I,_Y)
- GOSUB @TOUCH
- IF R==FALSE GOTO @_SKIPSP
- GOSUB @SETSB
- SPSW=TRUE
- @_SKIPSP
- NEXT
- RETURN
- ’--- ホ゛タンハ゛ンコ゛ウテ゛ショリ
- @SETSB
- OLDCB=CBANK(CTYPE)
- OLDCT=CTYPE
- OLDX=CSX:OLDY=CSY
- SBIX=I:G=SB(I,_G)
- IF G==1 THEN @SBCHRBK
- IF G==8 THEN @SBTYPE
- IF G==11 THEN @SBSX
- IF G==15 THEN @SBSY
- ’--- スヒ゜ンホ゛タンカイホウ
- GOSUB @_TCLR
- I=SBIX:C=6:SB(I,_C)=C
- SPCHR I+SPTOP,SB(I,_N),C,0,0,PR
- SPOFS I+SPTOP,SB(I,_X)+1,SB(I,_Y)+1
- ’--- スヒ゜ンヘンカ
- I=SBIX-SPINTOP
- V=-1:IF I AND 1 THEN V=1
- I=FLOOR(I/2)
- MI=1:MX=1024
- IF I<3 THEN V=V*8:MI=0:MX=255
- J=SPIN(I)+V
- IF J<MI THEN J=MI
- IF J>=MX THEN J=MX-1
- SPIN(I)=J
- IF I>2 THEN RETURN
- ’---
- C$=HEX$(SPIN(0),2)
- C$=C$+HEX$(SPIN(1),2)
- C$=C$+HEX$(SPIN(2),2)
- SPPAGE 0:BGPAGE 0
- P=COL+PAL*16:P2=COL
- GOSUB @CSET
- GOSUB @COLRGB
- GOSUB @SETCTYPE
- ’---
- @SETCOLOR
- GOSUB @SETCSUB
- GOSUB @CHRALL
- GOSUB @CHRZOOM
- RETURN
- ’--- set chrbank
- @SBCHRBK
- CBANK(CTYPE)=I
- GOTO @_SKIPSSB
- ’--- change BGU/SPU/BGF
- @SBTYPE
- GOSUB @CLRCSR
- CTYPE=I-G
- GOSUB @CMCHECK
- ’---
- @_SKIPSSB
- IF OLDCT!=CTYPE THEN @_SSBE
- IF OLDCB!=CBANK(CTYPE) THEN @_SSBE
- IF OLDX!=CSX THEN @_SSBE
- IF OLDY==CSY THEN RETURN
- @_SSBE
- GOSUB @SETCTYPE
- GOSUB @CHRALL
- GOSUB @CHRZOOM
- RETURN
- ’--- set size
- @SBSY
- CSY=I-G:GOSUB @CLRCSR
- IF CSY==3 AND CSX<2 THEN CSY=2:BEEP
- IF CSY<2 AND CSX==3 THEN CSX=2:BEEP
- GOTO @_SBSE
- ’---
- @SBSX
- CSX=I-G:GOSUB @CLRCSR
- IF CSX==3 AND CSY<2 THEN CSX=2:BEEP
- IF CSX<2 AND CSY==3 THEN CSY=2:BEEP
- ’---
- @_SBSE
- ZX=BCNT(CSX):ZY=BCNT(CSY)
- GOSUB @CALCZ:ZZ=BCNT(CSZ)
- IF CX+ZX>=32 THEN CX=32-ZX
- IF CY+ZY>=8 THEN CY=8-ZY
- CX=FLOOR(CX/ZX)*ZX
- CY=FLOOR(CY/ZY)*ZY
- GOTO @_SKIPSSB
- ’--- ハ゛ンクタンイテ゛イロヘンコウ
- @SETCSUB
- TMP=COL
- P=PAL*16
- FOR COL=0 TO 15
- SPPAGE 0:BGPAGE 0
- COLREAD(CT$,P),SPIN(0),SPIN(1),SPIN(2)
- C$=HEX$(SPIN(0),2)
- C$=C$+HEX$(SPIN(1),2)
- C$=C$+HEX$(SPIN(2),2)
- P2=P:GOSUB @CSET
- P=P+1
- NEXT
- COL=TMP
- GOTO @COLBOX
- ’---イロヘンコウ(スフ゜ライトBGト゛クリツ)
- @CSET
- FOR I=0 TO 1
- SPPAGE I:BGPAGE I:GPAGE I
- COLSET CT$,P,C$
- COLSET ”GRP”,P2,C$
- NEXT
- RETURN
- ’====================
- @SETCTYPE
- ’====================
- ’--- chr bank(off==minus)
- MAX=CBMAX(CTYPE)
- FOR I=0 TO 7
- SB(I,_Y)=ABS(SB(I,_Y))
- X=SB(I,_X):Y=SB(I,_Y):C=0
- IF I>MAX-1 THEN Y=-Y:SB(I,_Y)=Y
- IF CBANK(CTYPE)!=I GOTO @_CBKSKIP
- X=X+1:Y=Y+1:C=XC
- @_CBKSKIP
- SPCHR I+SPTOP,SB(I,_N),C,0,0,PR
- SPOFS I+SPTOP,X,Y
- NEXT
- ’--- chr type
- FOR I=8 TO 10
- X=SB(I,_X):Y=SB(I,_Y):C=0
- IF CTYPE==I-8 THEN X=X+1:Y=Y+1:C=XC
- SPCHR I+SPTOP,SB(I,_N),C,0,0,PR
- SPOFS I+SPTOP,X,Y
- NEXT
- ’--- size x
- FOR I=11 TO 14
- X=SB(I,_X):Y=SB(I,_Y):C=0
- IF CSX!=I-11 THEN @_CSX
- X=X+1:Y=Y+1:C=XC
- @_CSX
- SPCHR I+SPTOP,SB(I,_N),C,0,0,PR
- SPOFS I+SPTOP,X,Y
- NEXT
- ’--- size y
- FOR I=15 TO 18
- X=SB(I,_X):Y=SB(I,_Y):C=0
- IF CSY!=I-15 THEN @_CSY
- X=X+1:Y=Y+1:C=XC
- @_CSY
- SPCHR I+SPTOP,SB(I,_N),C,0,0,PR
- SPOFS I+SPTOP,X,Y
- NEXT
- ’--- キャラクタメイセイセイ
- @SETCSTR
- CN$=CSTR$(CTYPE)
- CN$=CN$+STR$(CBANK(CTYPE))
- CT$=CTYPE$(CTYPE)
- RETURN
- ’====================
- @SETAN ’アニメカンケイ
- ’====================
- IF CTYPE==1 THEN @ASTART
- IF OLDCT==CTYPE THEN RETURN
- ’--- erase
- OLDCT=CTYPE
- SPPAGE 0
- SPCLR ANTOP
- SPPAGE 1
- OLDAN=-1:OLDAP=-1:OLDAX=-1
- OLDAY=-1:OLDAC=-1:OLDAW=-1
- RETURN
- ’--- start
- @ASTART
- OLDCT=CTYPE:AX=ZX*8:AY=ZY*8
- C=SPIN(3):IF C<1 THEN C=1
- W=SPIN(4):IF W<1 THEN W=1
- N=(OFS(0,0)+CBANK(CTYPE)*256)
- N=FLOOR(N/(2*2)):’(BZC(CSX)*BZC(CSY)))
- ’---ヘンカシタカ?
- IF OLDAN!=N THEN @ATOP
- IF OLDAP!=PAL THEN @ATOP
- IF OLDAX!=AX THEN @ATOP
- IF OLDAY!=AY THEN @ATOP
- IF OLDAC!=C THEN @ATOP
- IF OLDAW==W THEN RETURN
- ’---
- @ATOP
- OLDAN=N:OLDAX=AX:OLDAY=AY
- OLDAP=PAL:OLDAC=C:OLDAW=W
- SPPAGE 0
- SPSET ANTOP,N,PAL,0,0,PR,AX,AY
- SPOFS ANTOP,184,80
- SPANIM ANTOP,C,W,0
- SPPAGE 1
- RETURN
- ’====================
- @DISPINIT ’カ゛メンノショキカ
- ’====================
- CLS:COLOR 0:GPAGE 0
- ’+---------+
- ’| ウエ カ゛メン |
- ’+---------+
- LOCATE 0,23
- PRINT”CHARACTER EDITOR v2.1”;
- COLOR 14:X=10:Y=9
- RX=(X+1)*8:RY=(Y+1)*8
- GOSUB @PUTWIN
- COLOR 7:X=0:Y=9
- GX=(X+1)*8:GY=(Y+1)*8
- GOSUB @PUTWIN
- LOCATE 0,19
- PRINT”А=COPY К=PASTE2”
- PRINT”Б=PASTE”
- PRINT”Ф=←→ Х=↑↓
- PRINT”КП=SCROLL”
- COLOR 0
- X=22:Y=9:GOSUB @PUTWIN
- LOCATE X,Y+1:COLOR 7
- PRINT ” SPANIM”:COLOR 0
- GFILL 0,67,255,68,15
- GOSUB @CHRALL
- ’+---------+
- ’| シタ カ゛メン |
- ’+---------+
- PNLTYPE ”OFF”
- GPAGE 1:GCOLOR 0:GCLS
- ’--- ヘンシュウエリア
- X=0:Y=2
- PNLSTR X,Y, ”┌”+”─”*16+”┐”
- FOR I=1 TO 16
- ’PNLSTR X,Y+I,”│”+”С”*16+”│”
- PNLSTR X,Y+I,”│”+” ”*16+”│”
- NEXT I
- I=Y+I:C$=”│”+” ”*16+”│”
- PNLSTR X,I+0, ”├”+”─”*16+”┤”
- PNLSTR X,I+1, C$
- PNLSTR X,I+2, C$
- PNLSTR X,I+3, ”└”+”─”*16+”┘”
- I=X+17:J=Y+10
- PNLSTR I,J , ”├──┐”
- FOR K=1 TO 6
- PNLSTR I,J+K,”│ │”
- NEXT
- PNLSTR I,J+K, ”┼──┘”
- ’---
- EX=(X+1)*8:EY=(Y+1)*8
- DR=FALSE
- GOSUB @CHRZOOM
- FOR I=0 TO SBMAX-1
- SPOFS I+SPTOP,SB(I,_X),SB(I,_Y)
- NEXT
- ’---
- PNLSTR 27,2,”color”,7
- PNLSTR 26,11,”SPANIM”,7
- PNLSTR 22,12,”cn”,7
- PNLSTR 22,14,”wa”,7
- PNLSTR 22,16,”sx”,7
- PNLSTR 22,18,”sy”,7
- ’--- イロミホン
- HX=0:HY=0:HDX=HX*8:HDY=HY*8
- GOSUB @COLBOX
- SPSET 0,103,0,0,0,0
- GOSUB @COLCSR
- GOSUB @SETCTYPE
- ’--- イロハ゛ンク
- X=23:Y=3
- PDX=X*8+8:PDY=Y*8
- FOR I=0 TO 15
- X=FLOOR(I%4)*16+PDX
- Y=FLOOR(I/4)*16+PDY
- SPSET I+2,I+48,0,0,0,PR
- SPOFS I+2,X,Y
- NEXT
- SPCHR PAL+2,PAL+48,XC,0,0,1
- ’--- システムアイコン
- ICONPUSE=FALSE
- ICONPAGE=0
- ICONPMAX=4
- ICONSET 0,59:’ERASE
- ICONSET 1,39:’FILE
- ICONSET 2,6 :’PAINT
- ICONSET 3,5 :’PEN
- GOSUB @PUTMODE
- GOSUB @PUTGRID
- RETURN
- ’---
- @PUTWIN
- LOCATE X,Y
- PRINT”┌”+”─”*8+”┐”:Y=Y+1
- FOR I=0 TO 7
- LOCATE X,Y:PRINT”│”+” ”*8+”│”
- Y=Y+1
- NEXT
- LOCATE X,Y
- PRINT”└”+”─”*8+”┘”
- RETURN
- ’---
- @PUTGRID
- GOSUB @CALCZ:Z=ZST(CSZ)
- FOR Y=0 TO 15
- J=FLOOR(Y%Z)
- FOR X=0 TO 15
- K=FLOOR(X%Z)
- GOSUB @MKGRID
- PNLSTR X+1,Y+3,C$
- NEXT
- NEXT
- RETURN
- ’---
- @MKGRID
- IF J==0 AND K==0 THEN C$=”С”:RETURN
- IF J!=0 AND K==0 THEN C$=”У”:RETURN
- IF K!=0 AND J==0 THEN C$=”Т”:RETURN
- C$=” ”
- RETURN
- ’====================
- @TOUCH ’アタリハンテイ
- R=FALSE
- IF TS==FALSE THEN RETURN
- IF TX<X THEN RETURN
- IF TX>X+W THEN RETURN
- IF TY<Y THEN RETURN
- IF TY>Y+H THEN RETURN
- X=TX AND &HF8
- Y=TY AND &HF8
- R=TRUE
- RETURN
- ’====================
- @PSPIN ’
- N=SPIN(N)
- @PUTNUM
- N$=RIGHT$(” ”+STR$(N),4)
- PNLSTR X,Y,N$,C
- RETURN
- ’====================
- @MKOFS ’テキセツナオフセットセッテイ
- IF CTYPE==1 GOTO @_OFSSP
- ’---
- CH=CY*32+CX
- FOR Y=0 TO ZY-1
- FOR X=0 TO ZX-1
- OFS(X,Y)=CH+X+(Y*32)
- NEXT
- NEXT
- RETURN
- ’---
- @_OFSSP
- X=BZC(CSX):Y=BZC(CSY)
- CH=FLOOR(CX/X)
- CH=CH+FLOOR(CY/Y)*(32/X)
- CH=CH*(X*Y)
- FOR Y=0 TO ZY-1
- FOR X=0 TO ZX-1
- OFS(X,Y)=CH+X+(Y*ZX)
- NEXT
- NEXT
- RETURN
- ’====================
- @CHRZOOM ’シタカ゛メンニキャラヒョウシ゛
- GOSUB @MKOFS
- GOSUB @CALCZ:Z=ZST(CSZ)
- SPPAGE 0:BGPAGE 0:GPAGE 1
- GFILL EX,EY,EX+127,EY+127,0
- FOR Y=0 TO ZY-1
- YO=EY+(Y*Z*8)
- FOR X=0 TO ZX-1
- XO=EX+(X*Z*8)
- GPUTCHR XO,YO,CN$,OFS(X,Y),PAL,Z
- NEXT
- NEXT
- SPPAGE 1:BGPAGE 1
- GOSUB @PUTGRID
- RETURN
- ’---
- @CALCZ
- CSZ=CSX
- IF CSZ<CSY THEN CSZ=CSY
- RETURN
- ’====================
- @CHRALL ’ウエカ゛メンニ1ハ゛ンクフ゛ンノキャラヒョウシ゛
- C$=CN$+”/”+CT$+”/(”
- C$=C$+STR$(ZX*8)+”,”
- C$=C$+STR$(ZY*8)+”) ”
- PNLSTR 1,23, C$
- SPPAGE 0:BGPAGE 0:GPAGE 0
- GFILL 0,0,255,63,0
- X=0:Y=0:I=0:S=ZX*ZY
- IF CTYPE==1 THEN GOSUB @CHRSP
- IF CTYPE!=1 THEN GOSUB @CHRBG
- SPPAGE 1:BGPAGE 1:GPAGE 1
- RETURN
- ’--- bg chr
- @CHRBG
- GPUTCHR X,Y,CN$,I,PAL,1
- X=X+8
- IF X>=GSX THEN X=0:Y=Y+8
- I=I+1
- IF I<256 THEN @CHRBG
- RETURN
- ’--- sprite chr
- @CHRSP
- YY=Y:DX=BZC(CSX):DY=BZC(CSY)
- FOR J=0 TO DY-1
- XX=X
- FOR K=0 TO DX-1
- GPUTCHR XX,YY,CN$,I,PAL,1
- XX=XX+8:I=I+1
- NEXT
- YY=YY+8
- NEXT
- X=X+DX*8
- IF X>=GSX THEN X=0:Y=Y+DY*8
- IF I<256 THEN @CHRSP
- RETURN
- ’====================
- @FILEMODE ’ファイルノヨミカキ
- ’====================
- PNLTYPE ”KYA”:ICONCLR
- GCLS 0
- GCOPY 0,0,0,255,63,0,0,TRUE
- GPAGE 0,1,1
- ’---
- @_FLOOP
- CLS
- LOCATE 0,8
- PRINT”─”*32;
- PRINT” L:CHRヨミコミ”
- PRINT” S:CHRホソ゛ン”
- PRINT”LC:イロヨミコミ”
- PRINT”SC:イロホソ゛ン”
- PRINT” Q:ファイルメニュ-オワリ”
- PRINT” E:ツ-ルオワリ”
- PRINT”─”*32;
- ’---
- INPUT”コマント゛”;K$
- IF K$==”Q” GOTO @_FQUIT
- IF K$==”E” GOTO @_FEXIT
- IF K$==”S” GOTO @_FSAVE
- IF K$==”L” GOTO @_FLOAD
- IF K$==”SC” GOTO @_FCSAVE
- IF K$==”LC” GOTO @_FCLOAD
- GOTO @_FLOOP
- ’---
- @LCSUB
- ’SYSBEEP=FALSE
- FOR I=0 TO 1
- BGPAGE I:SPPAGE I
- LOAD N$,FALSE
- NEXT
- ’SYSBEEP=TRUE
- RETURN
- ’---イロヨミコミ
- @_FCLOAD
- INPUT”スフ゜ライトノイロヲLOADシマスカ(Y/N)”;K$
- IF K$!=”Y” THEN @FLD_BG
- INPUT”SP/ヨミコムナマエ(COL):”;K$
- N$=”COL1:”+K$
- GOSUB @LCSUB
- ’
- @FLD_BG
- INPUT”BGノイロヲLOADシマスカ(Y/N)”;K$
- IF K$!=”Y” THEN @_FQUIT
- INPUT”BG/ヨミコムナマエ(COL):”;K$
- N$=”COL0:”+K$
- GOSUB @LCSUB
- GOTO @_FQUIT
- ’---イロホソ゛ン
- @_FCSAVE
- SPPAGE 0:BGPAGE 0
- INPUT”スフ゜ライトノイロヲSAVEシマスカ(Y/N)”;K$
- IF K$!=”Y” THEN @FSV_BG
- INPUT”SP:ホソ゛ンスルナマエ(COL):”;K$
- N$=”COL1:”+K$
- SAVE N$
- ’
- @FSV_BG
- INPUT”BGノイロヲSAVEシマスカ(Y/N)”;K$
- IF K$!=”Y” THEN @_FQUIT
- INPUT”BG:ホソ゛ンスルナマエ(COL):”;K$
- N$=”COL0:”+K$
- SAVE N$
- GOTO @_FQUIT
- ’---
- @_FLOAD
- INPUT”ヨミコムナマエ(CHR):”;K$
- K$=CN$+”:”+K$:PRINT K$
- BGPAGE 0:SPPAGE 0
- LOAD K$,FALSE
- BGPAGE 1:SPPAGE 1
- ’---スフ゜ライトハシタヲヨマナイ
- IF CTYPE==1 GOTO @_FQUIT
- LOAD K$,FALSE
- GOTO @_FQUIT
- ’---
- @_FSAVE
- INPUT”ホソ゛ンスルナマエ(CHR):”;K$
- K$=CN$+”:”+K$:PRINT K$
- BGPAGE 0:SPPAGE 0
- SAVE K$
- ’---
- @_FQUIT
- BGPAGE 1:SPPAGE 1
- GPAGE 0,0,0
- GOSUB @DISPINIT
- RETURN
- ’---
- @_FEXIT
- ICONCLR
- ACLS
- PRINT ”オツカレサマ!”
- END