• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BASIC compiler/interpreter for PIC32MX/MZ-80K (suspended)


Commit MetaInfo

Revision144 (tree)
Time2016-07-31 11:59:17
Authorkmorimatsu

Log Message

1) ver: KM-1200 2) "USEGRAPHIC 0" feature modification 3) Shift current point after GPRINT statement

Change Summary

Incremental Difference

--- mips/branches/zoea/help.txt (revision 143)
+++ mips/branches/zoea/help.txt (revision 144)
@@ -137,9 +137,10 @@
137137 様々なシステム値の設定を行なう。<SYSTEM>の項を参照。
138138 USEGRAPHIC [x]
139139 グラフィックディスプレイを使用、もしくは使用停止する。x=0で使用停止、
140- x=1で使用、x=2でキャラクターをリセットして使用、x=3でグラフィック領域
141- を確保するが表示はキャラクターディスプレイのまま。xを省略した場合は、
142- x=1と同じ。
140+ x=1で使用、x=2で画面とパレットをクリアーして使用、x=3でグラフィック領
141+ 域を確保するが表示はキャラクターディスプレイのまま。ただし、グラフィッ
142+ クディスプレイ未使用の状態でx=0の場合は、領域を確保する。xを省略した場
143+ 合は、x=1と同じ。
143144 USEPCG [x]
144145 PCGを使用、もしくは使用停止する。x=0で使用停止、x=1で使用、x=2で
145146 キャラクターをリセットして使用。xを省略した場合は、x=1と同じ。
@@ -475,7 +476,7 @@
475476 SYSTEM$(1)
476477 MachiKania バージョン文字列、"1.0"等を返す。
477478 SYSTEM$(2)
478- BASIC バージョン文字列、"KM-1130"等を返す。
479+ BASIC バージョン文字列、"KM-1200"等を返す。
479480 SYSTEM$(3)
480481 現在実行中のHEXファイル名、"ZOEA.HEX"等を返す。
481482 SYSTEM(20)
@@ -541,7 +542,7 @@
541542 てみて下さい。
542543
543544 <バージョン履歴>
544-・KM-1130 2016年公開。
545+・KM-1200 2016年8月公開。
545546  1.グラフィックディスプレイ機能および、関連のステートメント群を追加。
546547  2.浮動小数点演算機能、及び、算術演算関数群を追加。
547548  3.VAR, BREAK, SYSTEMステートメントを追加。
--- mips/branches/zoea/main.h (revision 143)
+++ mips/branches/zoea/main.h (revision 144)
@@ -7,7 +7,7 @@
77
88 #define SYSVER1 "Zoea"
99 #define SYSVER2 "0.5"
10-#define BASVER "KM-1130"
10+#define BASVER "KM-1200"
1111
1212 #define FILENAME_FLASH_ADDRESS 0x9D005800
1313 #define PIC32MX_RAMSIZE 0x10000
--- mips/branches/zoea/library.c (revision 143)
+++ mips/branches/zoea/library.c (revision 144)
@@ -501,14 +501,28 @@
501501 }
502502 }
503503
504+void allocate_graphic_area(){
505+ if (!g_graphic_area) {
506+ // Use this pointer like unsigned short GVRAM[G_H_WORD*G_Y_RES] __attribute__ ((aligned (4)));
507+ g_graphic_area=(unsigned short*)alloc_memory(G_H_WORD*G_Y_RES/2,ALLOC_GRAPHIC_BLOCK);
508+ // Start graphic and clear screen
509+ init_graphic(g_graphic_area);
510+ // Move current point to (0,0)
511+ g_prev_x=g_prev_y=0;
512+ }
513+}
514+
504515 void lib_usegraphic(int mode){
505516 // Modes; 0: stop GRAPHIC, 1: use GRAPHIC, 2: reset GRAPHIC and use it
506517 switch(mode){
507518 case 0:
508- // Stop GRAPHIC
509519 if (g_use_graphic){
520+ // Stop GRAPHIC if used
510521 set_graphmode(0);
511522 g_use_graphic=0;
523+ } else {
524+ // Prepare GRAPHIC area if not used and not allcated.
525+ allocate_graphic_area();
512526 }
513527 break;
514528 case 2:
@@ -519,12 +533,8 @@
519533 case 3:
520534 default:
521535 // Use GRAPHIC
522- if (!g_graphic_area) {
523- // Use this pointer like unsigned short GVRAM[G_H_WORD*G_Y_RES] __attribute__ ((aligned (4)));
524- g_graphic_area=(unsigned short*)alloc_memory(G_H_WORD*G_Y_RES/2,ALLOC_GRAPHIC_BLOCK);
525- // Start graphic and clear screen
526- init_graphic(g_graphic_area);
527- }
536+ allocate_graphic_area();
537+ // Start showing GRAPHIC with mode 1, but not with mode 3
528538 if (mode !=3 && !g_use_graphic){
529539 set_graphmode(1);
530540 g_use_graphic=1;
@@ -534,6 +544,7 @@
534544 }
535545
536546 int lib_graphic(int a0, int a1, int v0){
547+ unsigned char b;
537548 enum functions func=(enum functions)(a0>>24);
538549 int x1=(a0>>12)&0x0FFF;
539550 int y1=a0&0x0FFF;
@@ -586,6 +597,16 @@
586597 break;
587598 case FUNC_GPRINT:// X1,Y1,C,BC,S$
588599 g_printstr(x1,y1,x2,y2,(unsigned char*)v0);
600+ // Move current X,Y according to the string
601+ while(b=((unsigned char*)v0)[0]){
602+ v0++;
603+ if (b==0x0d) {
604+ x1=0;
605+ y1+=8;
606+ } else {
607+ x1+=8;
608+ }
609+ }
589610 g_prev_x=x1;
590611 g_prev_y=y1;
591612 break;
@@ -928,6 +949,7 @@
928949 return v0;
929950 case LIB_GCLS:
930951 if (g_graphic_area) g_clearscreen();
952+ g_prev_x=g_prev_y=0;
931953 return v0;
932954 case LIB_COLOR:
933955 setcursorcolor(v0);