2008 DS T050049

Similar documents
2008 T050092

devkitpro msys

N(なんて)D(どうでもいい)S(作文だろうか)

C言語によるアルゴリズムとデータ構造

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 新装版 1 刷発行時のものです.

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

2009 T060050

PowerPoint Presentation

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

2009 T

‚æ4›ñ

I 2 tutimura/ I 2 p.1/??

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

2008chom.pdf


Java updated

Informatics 2014

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ }

64bit SSE2 SSE2 FPU Visual C++ 64bit Inline Assembler 4 FPU SSE2 4.1 FPU Control Word FPU 16bit R R R IC RC(2) PC(2) R R PM UM OM ZM DM IM R: reserved

untitled


P05.ppt

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return 0; 戻り値 1: main() 2.2 C main

:30 12:00 I. I VI II. III. IV. a d V. VI

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

r08.dvi

tuat1.dvi

mugensho.dvi

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

:30 12:00 I. I VI II. III. IV. a d V. VI

P06.ppt

プログラミング基礎

ohp08.dvi

(search: ) [1] ( ) 2 (linear search) (sequential search) 1


ERATO100913

Microsoft Word - SU1204教本(Driver)原稿.docx

r1.dvi

r11.dvi

ohp11.dvi

CAT.No. 1234

programmingII2019-v01

C B

課題

8 / 0 1 i++ i 1 i-- i C !!! C 2

新・明解C言語で学ぶアルゴリズムとデータ構造

, m 1 1 m m b

[1] #include<stdio.h> main() { printf("hello, world."); return 0; } (G1) int long int float ± ±

haskell.gby

r3.dvi

Java学習教材

C のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i<=10; i++) sum=sum + i; printf ("sum=%d n",sum); 2

Cプログラミング - 第8回 構造体と再帰

cpp4.dvi

joho09.ppt

(Version: 2017/4/18) Intel CPU 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU do

FS_handbook.indd

64bit SSE2 SSE2 FPU Visual C++ 64bit Inline Assembler 4 FPU SSE2 4.1 FPU Control Word FPU 16bit R R R IC RC(2) PC(2) R R PM UM OM ZM DM IM R: reserved

untitled

double float

program.dvi

untitled

Welfare Economics (1920) The main motive of economic study is to help social improvement help social improvement society society improvement help 1885

X Window System X X &

Informatics 2010.key

HPB16_表1-表4.ai

DNxHD_WEB_JP_ indd

新・明解C言語 実践編

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h>

玉島テレビ接続マニュアルHP用1504.indd


Informatics 2015

情報科学概論 第1回資料

2

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡

XMPによる並列化実装2

( CUDA CUDA CUDA CUDA ( NVIDIA CUDA I

Microsoft Word - C.....u.K...doc

C C UNIX C ( ) 4 1 HTML 1

N88 BASIC 0.3 C: My Documents 0.6: 0.3: (R) (G) : enterreturn : (F) BA- SIC.bas 0.8: (V) 0.9: 0.5:


Taro-リストⅢ(公開版).jtd

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

untitled

プログラミング基礎

NL-22/NL-32取扱説明書_操作編

O(N) ( ) log 2 N

VM-53PA1取扱説明書

大統一Debian勉強会 gdb+python拡張を使ったデバッグ手法

thesis.dvi

para02-2.dvi

1.3 ( ) ( ) C

1 # include < stdio.h> 2 # include < string.h> 3 4 int main (){ 5 char str [222]; 6 scanf ("%s", str ); 7 int n= strlen ( str ); 8 for ( int i=n -2; i

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i )

(2 Linux Mozilla [ ] [ ] [ ] [ ] URL 2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B

Transcription:

DS T050049. PSP DS DS DS RPG DS OS Windows XP DevkiPro OS DS CPU ARM devkitarm MSYS MinGW MSYS MinGW Unix OS C++ C++ make nds nds DS DS micro SD Card nds DS DS DS nds C Java C++ nds nds DS

2008 DS T050049

1 1 2 1 2.1 devkitpro.................................... 1 2.2 MinGW MSYS................................ 2 2.3 Emulator.................................... 4 3 DS 5 3.1 BG-MAP................................ 5 3.2........................ 5 4 6 4.1.......................... 6 4.2.......................... 7 5 8 5.1................................ 9 5.2.................................. 9 5.3.............................. 10 5.4 main..................................... 11 6 13 I 1

1 DS DS DS DS C++ DS DS 2 OS Windows XP DS C++ DS CPU ARM ARM devkitpro cpp nds MinGW MSYS cpp make nds NO$GBA Windows Vista make vista 2.1 devkitpro devkitpro DS PSP DS SOUCEFORGE.NET devkitpro 2.1 devkitpro devkitpro devkitproupdater-1.4.9.exe 1

2.1: devkitpro nds.h 2.2 2.2: 2.3: 2.3 Path C:devkitPro\devkitProARM\bin; nds.h nds.h 2.2 MinGW MSYS MinGW Windows GNU MSYS devkitpro 2

2.4: MinGW SOUCFORGE.NET MinGW 2.4 MinGW 2.5: MSYS devkitpro MinGW 5.1.4 MinGW MSYS MSYS MinGW Windows CUI MinGW Unix CUI 2.5 MSYS 3

devkitpro Path C:\MinGW\bin; C:\msys\1.0\bin; make 2.3 Emulator OS CPU OS(CPU) DS DS NO$GBA ( GBA) GBA GBA DS DS http://nocash.emubase.de/ NO$GBA NO$GBA 2.7: NO$GBA 2.6: Freeware 4

windows version devkitpro MinGW MSYS NO$GBA 3 DS 3.1 BG-MAP DS BG BG 1 Text Affine Extended Mode BG0 BG1 BG2 BG3 0 Text/3D Text Text Text 1 Text/3D Text Text Affine 2 Text/3D Text Affine Affine 3 Text/3D Text Text Extended 4 Text/3D Text Affine Extended 5 Text/3D Text Extended Extended 6 3D - Large - 1: BG Text 8x8 32x32 BG-Map Affine Text 8x8 16x16 128x128 Extended 32,768 Extendet Bitmap 3.2 DS grit bmp png DS devkitpro 5

devkitpro grit [4].grit sample.bmp 0 grit.exe sample.bmp -gt -gb8 build sample.grit # bitmap format -gt # 16 bit bitmap -gb8 data make 4 4.1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include <nds.h> #include <stdio.h> volatile int frame = 0; void vblank() { frame++; int main(void) { irqinit(); irqset(irq VBLANK, vblank); irqenable(irq VBLANK); videosetmode(0); videosetmodesub(mode 0 2D DISPLAY BG0 ACTIVE); vramsetbankc(vram C MAIN BG); 6

18 BG0 CR = BG MAP BASE(31); 19 20 21 22 23 24 25 26 27 28 SUB BG0 CR = BG MAP BASE(31); BG PALETTE SUB[255] = RGB15(31,31,31); consoleinitdefault((u16 )SCREEN BASE BLOCK(31), (u16 )CHAR BASE BLOCK(0), 16); for(;;) swiwaitforvblank(); 12 13 14 irqinit(); irqset(irq_vblank,vblank); irqenable(irq_vblank); 15 16 17 videosetmode(0); videosetmodesub(mode_0_2d) DISPLAY_BG0_ACTIVE); vramsetbankc(fram_c_main_bg); 3-1 15 16 (0) 4.2 #include <nds.h> #include <stdio.h> #include "othelloboard.h" int main(void) { irqinit(); irqset(irq VBLANK, 0); 7

videosetmode(mode 5 2D DISPLAY BG3 ACTIVE); vramsetbanka(vram A MAIN BG 0x06000000); lcdmainonbottom(); BG3 CR = BG BMP16 256x256 BG BMP BASE(0); BG3 YDX = 0; BG3 XDX = 1 8; BG3 XDY = 0; BG3 YDY = 1 8; BG3 CX = 0; BG3 CY = 0; for(int i = 0; i < 256 192; i++) { ((u16 )BG BMP RAM(0))[i] = ((u16 )othelloboardbitmap)[i] BIT(15);; while(1) { swiwaitforvblank(); return 0; lcdmainonbottom(); BG3_CR = BG_BMP16_256x256 BG_BMP_BASE(0); VRAM DS BG3_YDX = 0; BG3_CY = 0; for 5 DS 8

27 5.1 char levelmap[max_level][80] = { { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 3, 8, 13, 18, 23, 1, 1, 0, 0, 1, 4, 9, 14, 19, 24, 1, 1, 0, 0, 1, 5, 10, 15, 20, 25, 1, 1, 0, 0, 1, 6, 11, 16, 21, 26, 1, 1, 0, 0, 1, 7, 12, 17, 22, 27, 2, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 17, 3, 16, 21, 10, 1, 1, 0, 0, 1, 26, 13, 22, 9, 5, 1, 1, 0, 0, 1, 15, 8, 4, 14, 18, 1, 1, 0, 0, 1, 20, 24, 12, 11, 6, 1, 1, 0, 0, 1, 25, 19, 7, 23, 27, 2, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ; 27 5.2 void setvramfrommap(u16* mapmemory, char* map) { for(int y = 0; y < 8; y++) { for(int x = 0; x < 10; x++) { char c = (*map++) * 9; mapmemory[x * 3 + y * 3 * 32] = c; 9

mapmemory[x * 3 + y * 3 * 32 + 1] = c + 1; mapmemory[x * 3 + y * 3* 32 + 2] = c + 2; mapmemory[x * 3 + (y * 3 + 1) * 32] = c + 3; mapmemory[x * 3 + (y * 3 + 1) * 32 + 1] = c + 4; mapmemory[x * 3 + (y * 3 + 1) * 32 + 2] = c + 5; mapmemory[x * 3 + (y * 3 + 2) * 32] = c + 6; mapmemory[x * 3 + (y * 3 + 2) * 32 + 1] = c + 7; mapmemory[x * 3 + (y * 3 + 2) * 32 + 2] = c + 8; VRAM DS 8x8 24 24 *9 5.3 void move(int dx, int dy, char*map) { int pos = 0; int a, b, c, d, e, Q; Q = 2; while(map[pos]!= Q) { pos++; int dp = dx + dy * 10; a = map[pos + dp]; b = map[pos + dp + dp]; c = map[pos + dp + dp + dp]; d = map[pos + dp + dp + dp + dp]; e = map[pos + dp + dp + dp + dp + dp]; if(a == 1) { count--; return; 10

if(b == 1 (b > 2 && b <= 27) (c > 2 && c <= 27) (d > 2 && d <= 27) e == 1) { map[pos] = a; map[pos + dp] = Q; return; pos map Q = 2 while Q pos pos + dp a = map[pos + dp] b c d e if if (a == 1) count main if b e b, c, d pos + dp 5.4 main 5.1 5.2 5.3 main int main(void) { /* */ swicopy(soukobanpal, BG_PALETTE 256); /* */ swicopy(soukobantiles, tilememory, 24 * 24 * 28 / 2); char map[80]; swicopy(levelmap[0], map, 40); (1) scankeys(); if(kesdown()) { if(keysdown() & KEY_A) { (2) swicopy(levelmap[1], 40); 11

while(1) { iprintf("\x1b[10;0h count = %04d\n", count); scankeys(); if(keysdown()) { if(keyscown() & KEY_RIGHT){ count++; move(-1, 0, map); else if(keyscown() & KEY_LEFT){ count++; move(1, 0, map); else if(keyscown() & KEY_UP){ count++; move(0, -1, map); else if(keyscown() & KEY_DOWN){ count++; move(0, 1, map); else if(keyscown() & KEY_START){ swicopy(levelmap[stage],map, 40); count = 0; setbramfrommap(mapmemory, map); swiwaitforvblank(); return 0; (1) (2) DS A ( ) levelmap[1] While if count++; 5.3 count ; main count count 5.3 main count ; if else if(keysdown() & KEY_START) count 0 12

6 DS DS C++ [1] DS DS DS 13

[1] http://void-main.org/dsprogram/ Nintendo DS [2] http://meraman.dip.jp/index.php?frontpage [3] http://akkera102.sakura.ne.jp/gbadev/ GBA develop Wiki [4] http://www.coranac.com/man/grit/html/grit.htm i. Grit 0.8.3 : Table of Contents 14

I #include <nds.h> #include <stdio.h> #include "souko.h" #define MAX LEVEL (4) char levelmap[max LEVEL][80] = { { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 2, 9, 6, 1, 1, 1, 0, 0, 1, 1, 5, 8, 7, 1, 1, 1, 0, 0, 1, 1, 3, 4, 10, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0 ; void setvramfrommap(u16 mapmemory, char map) { for(int y = 0; y < 8; y++) { for(int x = 0; x < 10; x++) { char c = ( map++) 9; mapmemory[x 3 + y 3 32] = c; mapmemory[x 3 + y 3 32 + 1] = c + 1; mapmemory[x 3 + y 3 32 + 2] = c + 2; mapmemory[x 3 + (y 3 + 1) 32] = c + 3; mapmemory[x 3 + (y 3 + 1) 32 + 1] = c + 4; mapmemory[x 3 + (y 3 + 1) 32 + 2] = c + 5; mapmemory[x 3 + (y 3 + 2) 32] = c + 6; mapmemory[x 3 + (y 3 + 2) 32 + 1] = c + 7; mapmemory[x 3 + (y 3 + 2) 32 + 2] = c + 8; int checkclear(char map) { for(int i = 0; i < 80; i++) { 1

if(map[i] == 2) { return false; return true; void move(int dx, int dy, char map) { int pos = 0; int a,b, Q; Q = 10; while(map[pos] Q) { pos++; int dp = dx + dy 10; a = map[pos + dp]; b = map[pos + dp + dp]; if(a == 1) { return; if(b 9) { map[pos] = a; map[pos + dp] = Q; return; int main(void) { irqinit(); irqenable(irq VBLANK); videosetmode(mode 0 2D DISPLAY BG0 ACTIVE); videosetmodesub(mode 0 2D DISPLAY BG0 ACTIVE); vramsetmainbanks(vram A MAIN BG 0x06000000, VRAM B LCD, VRAM C SUB BG, VRAM D LCD); SUB BG0 CR = BG MAP BASE(31); BG PALETTE SUB[255] = RGB15(0,31,0); consoleinitdefault((u16 )SCREEN BASE BLOCK SUB(31), 2

(u16 )CHAR BASE BLOCK SUB(0), 16); lcdmainonbottom(); BG0 CR = BG 32x32 BG COLOR 256 BG MAP BASE(0) BG TILE BASE(1); swicopy(soukopal, BG PALETTE, 256); u8 tilememory = (u8 )BG TILE RAM(1); u16 mapmemory = (u16 )BG MAP RAM(0); swicopy(soukotiles, tilememory, 24 24 11 / 2); int stage = 0; int clear = 0; char map[80]; swicopy(levelmap[0], map, 40); while(1) { iprintf("\x1b[10;0h Stage %04d\n", stage + 1); scankeys(); if(keysdown()) { if(clear) { clear = 0; stage++; swicopy(levelmap[stage], map, 40); else if(keysdown() & KEY RIGHT) { move(1, 0, map); else if(keysdown() & KEY LEFT) { move( 1, 0, map); else if(keysdown() & KEY UP) { move(0, 1, map); else if(keysdown() & KEY DOWN) { move(0, 1, map); else if(keysdown() & KEY START) { swicopy(levelmap[stage], map, 40); setvramfrommap(mapmemory, map); swiwaitforvblank(); 3

return 0; 4