• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++objective-ccocoa誰得c#gamebathyscaphephplinuxrubyqtpythoncomegat翻訳windowstwitterguiframeworkbtronvb.netdirectxtestdom計画中(planning stage)previewerpukiwikimruby

BASIC compiler/interpreter for PIC32MX/MZ-80K


コミットメタ情報

リビジョン230 (tree)
日時2018-04-29 12:15:31
作者kmorimatsu

ログメッセージ

Move allocate_graphic_area() to envspecific.c

変更サマリ

差分

--- mips/branches/zoea/envspecific.c (revision 229)
+++ mips/branches/zoea/envspecific.c (revision 230)
@@ -18,7 +18,7 @@
1818 return KEYPORT;
1919 }
2020
21-void lib_scroll30(int x,int y){
21+void scroll30(int x,int y){
2222 int i,j;
2323 int vector=y*WIDTH_X1+x;
2424 if (vector<0) {
@@ -68,7 +68,7 @@
6868 }
6969 }
7070
71-void lib_scroll40(int x,int y){
71+void scroll40(int x,int y){
7272 int i,j;
7373 int vector=y*WIDTH_X2+x;
7474 if (vector<0) {
@@ -118,12 +118,21 @@
118118 }
119119 }
120120
121-void lib_scroll(int x, int y){
122- if (twidth==40) lib_scroll40(x,y);
123- else lib_scroll30(x,y);
121+void scroll(int x, int y){
122+ if (twidth==40) scroll40(x,y);
123+ else scroll30(x,y);
124124 }
125125
126-void lib_usegraphic(int mode){
126+void allocate_graphic_area(){
127+ if (!g_graphic_area) {
128+ // Use this pointer like unsigned short GVRAM[G_H_WORD*G_Y_RES] __attribute__ ((aligned (4)));
129+ g_graphic_area=alloc_memory(G_H_WORD*G_Y_RES/2,ALLOC_GRAPHIC_BLOCK);
130+ // Start graphic and clear screen
131+ init_graphic(g_graphic_area);
132+ }
133+}
134+
135+void usegraphic(int mode){
127136 // Modes; 0: stop GRAPHIC, 1: use GRAPHIC, 2: reset GRAPHIC and use it
128137 switch(mode){
129138 case 0:
--- mips/branches/zoea/envspecific.h (revision 229)
+++ mips/branches/zoea/envspecific.h (revision 230)
@@ -8,8 +8,8 @@
88 #define PERSISTENT_RAM_SIZE (1024*53)
99
1010 int readbuttons();
11-void lib_scroll(int x, int y);
12-void lib_usegraphic(int mode);
11+void scroll(int x, int y);
12+void usegraphic(int mode);
1313
1414 // 30 or 40 characters per line for Zoea
1515 #define printcomma() printstr(" "+rem10_32((unsigned int)(cursor-TVRAM)))
--- mips/branches/zoea/library.c (revision 229)
+++ mips/branches/zoea/library.c (revision 230)
@@ -435,6 +435,11 @@
435435 pcg[ascii+1]=(fontdata2>>24)|((fontdata2&0xff0000)>>8)|((fontdata2&0xff00)<<8)|(fontdata2<<24);
436436 }
437437
438+void lib_usegraphic(int mode){
439+ usegraphic(mode);
440+ // Move current point to (0,0)
441+ g_prev_x=g_prev_y=0;
442+}
438443 void lib_wait(int period){
439444 int i;
440445 unsigned short dcount;
@@ -447,17 +452,6 @@
447452 }
448453 }
449454
450-void allocate_graphic_area(){
451- if (!g_graphic_area) {
452- // Use this pointer like unsigned short GVRAM[G_H_WORD*G_Y_RES] __attribute__ ((aligned (4)));
453- g_graphic_area=alloc_memory(G_H_WORD*G_Y_RES/2,ALLOC_GRAPHIC_BLOCK);
454- // Start graphic and clear screen
455- init_graphic(g_graphic_area);
456- // Move current point to (0,0)
457- g_prev_x=g_prev_y=0;
458- }
459-}
460-
461455 int lib_graphic(int v0,enum functions func){
462456 unsigned char b;
463457 int x1=g_libparams[1];
@@ -776,7 +770,6 @@
776770 };
777771
778772 void lib_width(int width){
779-#ifdef ZOEA
780773 switch(width){
781774 case 30:
782775 if (twidth!=30) set_width(0);
@@ -787,7 +780,6 @@
787780 default:
788781 break;
789782 }
790-#endif // ZOEA
791783 }
792784
793785 int lib_file_textlen(FSFILE* fhandle){
@@ -1051,7 +1043,7 @@
10511043 lib_var_pop(a0,a1,g_libparams);
10521044 return v0;
10531045 case LIB_SCROLL:
1054- lib_scroll(g_libparams[1],v0);
1046+ scroll(g_libparams[1],v0);
10551047 return v0;
10561048 case LIB_FILE:
10571049 return lib_file((enum functions)(a3 & FUNC_MASK),g_libparams[1],g_libparams[2],v0);
--- mips/branches/zoea/music.c (revision 229)
+++ mips/branches/zoea/music.c (revision 230)
@@ -56,8 +56,8 @@
5656 1/(2^(1/12) ~= 1933/(2^11)
5757 */
5858
59-#define toneFlat(x) ((((unsigned long)x)*69433)>>16)
60-#define toneSharp(x) ((((unsigned long)x)*1933)>>11)
59+#define toneFlat(x) ((((unsigned long)(x))*69433)>>16)
60+#define toneSharp(x) ((((unsigned long)(x))*1933)>>11)
6161
6262 /* local global vars */
6363 static int* g_tones;