From 146427a32c400a2578d5a0fd278ce359b5f4ec4b Mon Sep 17 00:00:00 2001 From: Michel vespier Date: Thu, 19 Mar 2020 23:51:17 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20CPC.g1a=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20b?= =?UTF-8?q?uild-fx/CPC.bin=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20build-fx/CPC.elf=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20build-fx/map=20=09modifi=C3=A9=C2=A0:=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20build-fx/src/main.c.o=20=09modifi=C3=A9=C2=A0:?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20src/main.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPC.g1a | Bin 22688 -> 22688 bytes build-fx/CPC.bin | Bin 22176 -> 22176 bytes build-fx/CPC.elf | Bin 35096 -> 35096 bytes build-fx/map | 109 +++++++++++++++++++++--------------------- build-fx/src/main.c.o | Bin 3816 -> 3812 bytes src/main.c | 56 +++++++++++----------- 6 files changed, 83 insertions(+), 82 deletions(-) diff --git a/CPC.g1a b/CPC.g1a index 9d8e5405a8f298f6ac1b25b4a5424e343b0698c4..04060e7f674a44e036ab70c23c79e0a32b276b86 100644 GIT binary patch delta 550 zcmX|7O-LI-6rN`jaot^6WAkh3t}%bKwwX35Hr0bmJ(WTNDi#zPP^)Oo41 z6kI0sywF1f3N_57r=9}l;K7Bo^`;h~y_7DbpkNPuNlPER@8kPs=6%ews$f-NYoarI z<5oJ8t=@mt?amY0zr_!`MSu-rbu3Kx;(9mL?}7vnP zBc2lb>f>fPyV!jCaP_h-W`5g=#pY_4E-p0fczX6jrH3&J;pD%h*oaq50%rmha#m!=~xwKXmT<0}sQfV*mg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^*5sWQQ0Y56!@_NZz4s6F7f22*qd|u7GM(hN;~`9iA=u3te~+k^lez diff --git a/build-fx/map b/build-fx/map index 31acc1e..a2d7e69 100644 --- a/build-fx/map +++ b/build-fx/map @@ -244,61 +244,62 @@ LOAD /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgcc .text 0x0000000000300b2c 0xe0 build-fx/src/main.c.o 0x0000000000300b2c _tile 0x0000000000300be8 _perso - .text.startup 0x0000000000300c0c 0x114 build-fx/src/main.c.o + .text.startup 0x0000000000300c0c 0x110 build-fx/src/main.c.o 0x0000000000300c0c _main - .text 0x0000000000300d20 0x3fc /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(keysc.c.o) - 0x0000000000300ec8 _pollevent - 0x000000000030100c _waitevent - 0x0000000000301058 _clearevents - 0x0000000000301078 _keydown - 0x00000000003010a4 _keydown_all - 0x00000000003010e0 _keydown_any - .text 0x000000000030111c 0x124 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(iokbd.c.o) - 0x0000000000301128 _iokbd_row - 0x0000000000301210 _iokbd_scan - .text 0x0000000000301240 0x0 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(hardware.c.o) - .text 0x0000000000301240 0x0 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(start.c.o) - .text 0x0000000000301240 0x56c /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(tmu.c.o) - 0x0000000000301560 _timer_setup - 0x00000000003015f0 _timer_delay - 0x0000000000301650 _timer_start - 0x0000000000301684 _timer_reload - 0x00000000003016a4 _timer_pause - 0x00000000003016d8 _timer_stop - 0x0000000000301734 _timer_timeout - 0x0000000000301740 _timer_address - 0x000000000030177c _timer_clear - .text 0x00000000003017ac 0x0 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(inth.s.o) - .text 0x00000000003017ac 0xdc /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(memory.c.o) - 0x00000000003017ac _memcpy - 0x0000000000301866 __memmove - 0x000000000030186a __memcmp - 0x000000000030186e _memset - .text 0x0000000000301888 0xf4 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(gimage.c.o) - 0x0000000000301888 _gimage - 0x00000000003018f8 _gsubimage - .text 0x000000000030197c 0x5c /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(gclear.c.o) - 0x000000000030197c _gclear - .text 0x00000000003019d8 0x17c /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(engine.c.o) - 0x00000000003019d8 _gray_int - 0x0000000000301a28 _gray_start - 0x0000000000301a98 _gray_stop - 0x0000000000301ab4 _gray_delays - 0x0000000000301ac0 _gray_config - 0x0000000000301ae4 _gupdate - 0x0000000000301af4 _gvram - 0x0000000000301b24 _gvraml - 0x0000000000301b3c _gvramd - .text.startup 0x0000000000301b54 0x40 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(engine.c.o) - .text.exit 0x0000000000301b94 0x28 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(engine.c.o) - .text 0x0000000000301bbc 0x410 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(bopti.c.o) - 0x0000000000301bbc _bopti_grid - 0x0000000000301d30 _bopti_render - 0x0000000000301e60 _bopti_render_clip - 0x0000000000301f74 _bopti_render_noclip - .text 0x0000000000301fcc 0x24 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(dupdate.c.o) - 0x0000000000301fcc _dupdate - 0x0000000000301fe4 _dupdate_noint + .text 0x0000000000300d1c 0x3fc /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(keysc.c.o) + 0x0000000000300ec4 _pollevent + 0x0000000000301008 _waitevent + 0x0000000000301054 _clearevents + 0x0000000000301074 _keydown + 0x00000000003010a0 _keydown_all + 0x00000000003010dc _keydown_any + .text 0x0000000000301118 0x124 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(iokbd.c.o) + 0x0000000000301124 _iokbd_row + 0x000000000030120c _iokbd_scan + .text 0x000000000030123c 0x0 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(hardware.c.o) + .text 0x000000000030123c 0x0 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(start.c.o) + .text 0x000000000030123c 0x56c /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(tmu.c.o) + 0x000000000030155c _timer_setup + 0x00000000003015ec _timer_delay + 0x000000000030164c _timer_start + 0x0000000000301680 _timer_reload + 0x00000000003016a0 _timer_pause + 0x00000000003016d4 _timer_stop + 0x0000000000301730 _timer_timeout + 0x000000000030173c _timer_address + 0x0000000000301778 _timer_clear + .text 0x00000000003017a8 0x0 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(inth.s.o) + .text 0x00000000003017a8 0xdc /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(memory.c.o) + 0x00000000003017a8 _memcpy + 0x0000000000301862 __memmove + 0x0000000000301866 __memcmp + 0x000000000030186a _memset + .text 0x0000000000301884 0xf4 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(gimage.c.o) + 0x0000000000301884 _gimage + 0x00000000003018f4 _gsubimage + .text 0x0000000000301978 0x5c /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(gclear.c.o) + 0x0000000000301978 _gclear + .text 0x00000000003019d4 0x17c /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(engine.c.o) + 0x00000000003019d4 _gray_int + 0x0000000000301a24 _gray_start + 0x0000000000301a94 _gray_stop + 0x0000000000301ab0 _gray_delays + 0x0000000000301abc _gray_config + 0x0000000000301ae0 _gupdate + 0x0000000000301af0 _gvram + 0x0000000000301b20 _gvraml + 0x0000000000301b38 _gvramd + .text.startup 0x0000000000301b50 0x40 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(engine.c.o) + .text.exit 0x0000000000301b90 0x28 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(engine.c.o) + .text 0x0000000000301bb8 0x410 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(bopti.c.o) + 0x0000000000301bb8 _bopti_grid + 0x0000000000301d2c _bopti_render + 0x0000000000301e5c _bopti_render_clip + 0x0000000000301f70 _bopti_render_noclip + .text 0x0000000000301fc8 0x24 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(dupdate.c.o) + 0x0000000000301fc8 _dupdate + 0x0000000000301fe0 _dupdate_noint + *fill* 0x0000000000301fec 0x4 .text 0x0000000000301ff0 0x150 /home/michel/Documents/gcc/sh-elf-2.34-9.2.0/lib/gcc/sh3eb-elf/9.2.0/libgint-fx.a(bopti-asm-gray.s.o) 0x0000000000301ff0 _bopti_gasm_mono 0x000000000030202c _bopti_gasm_mono_alpha diff --git a/build-fx/src/main.c.o b/build-fx/src/main.c.o index 9363de7f688a1e094c9c17b66df1fe88a960f86b..c51f75cc34380bd0686a4a35a3f5ab19b9a33fa1 100644 GIT binary patch delta 323 zcmaDM`$TqvGUJ_%D(%dQ@%~Eo5)T>lh2#Y<8r?8*UT1K2Nbs{ahAND&oj(^5>#@>gQ4pNA8r*7u7(zE~q*H$wVH* zhF+;;=1J;?3cWlD!X0J(_Y;gKDk?}$R4@?eWqio^kYW8bdBKSi3C2J%F}Tlh2#Y<8r?8*3$!Hu-Z=BlUABha-2&=Zk6}`3q_eKr)fX zu%TBfnR$}Bp+YZDf^bJ!|Gfm`iHZu66BP^udKn)wK4e&bRbFtSM1nC;Objk|T3_g* z7|5IljMJIzYy8zFXRwG*R%RBQJc&h!B_p#Wb+RI}=;oa)a?Fe(n{Tk^u^2HjFfed{ z2q0i&VPN2bu{jtR%wTLD1_pB&TVQep&v8bM$qu~p85Jf!;MHannasnd%y?(A0iQbK Yp2-nF^1|c>Aek_E1(0l+e1T5{0Kd&t^Z)<= diff --git a/src/main.c b/src/main.c index 49c4a21..baa49fa 100644 --- a/src/main.c +++ b/src/main.c @@ -4,8 +4,8 @@ #include //Boucle qui va afficher l'image correspondante à l'emplacement dans le tableau 'map' -void tile(int* map, int* img, int* sup); -void perso(int* tp, int* perso); +void tile(int* map, image_t** img, image_t** sup); +void perso(int* tp, image_t** perso); int main(void) { @@ -60,25 +60,25 @@ int main(void) //2xx: Rebond //{, , , , , , , , , , , , , , , } //La carte de l'ecran pour les tiles - int map[8][16] = { - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {15, 115, 215, 315, 415, 515, 615, 715, 815, 915, 1015, 1115, 1215, 1315, 1415, 1515}, - {17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}, - {6, 1614, 1714, 12, 16, 17, 6, 14, 14, 14, 14, 14, 14, 14, 14, 12}, - {7, 15, 15, 115, 14, 14, 815, 15, 15, 15, 15, 15, 15, 15, 15, 13}, - {3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9}, - {17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}, - {17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}}; + int map[128] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 15, 115, 215, 315, 415, 515, 615, 715, 815, 915, 1015, 1115, 1215, 1315, 1415, 1515, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 6, 1614, 1714, 12, 16, 17, 6, 14, 14, 14, 14, 14, 14, 14, 14, 12, + 7, 15, 15, 115, 14, 14, 815, 15, 15, 15, 15, 15, 15, 15, 15, 13, + 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}; //Les pointeurs des images - int p_img[17] = {&img_t0, &img_t1, &img_t2, &img_t3, &img_t4, &img_t5, &img_t6, &img_t7, &img_t8, &img_t9, &img_t10, &img_t11, &img_t12, &img_t13, &img_t14, &img_t15, &img_Porte}; - int p_sup[17] = {&img_1, &img_2, &img_3, &img_4, &img_5, &img_6, &img_7, &img_8, &img_9, &img_10, &img_11, &img_12, &img_13, &img_14, &img_15, &img_Vitesse, &img_Rebond}; - int p_perso[3] = {&img_G, &img_N, &img_D}; + image_t* p_img[17] = {&img_t0, &img_t1, &img_t2, &img_t3, &img_t4, &img_t5, &img_t6, &img_t7, &img_t8, &img_t9, &img_t10, &img_t11, &img_t12, &img_t13, &img_t14, &img_t15, &img_Porte}; + image_t* p_sup[17] = {&img_1, &img_2, &img_3, &img_4, &img_5, &img_6, &img_7, &img_8, &img_9, &img_10, &img_11, &img_12, &img_13, &img_14, &img_15, &img_Vitesse, &img_Rebond}; + image_t* p_perso[3] = {&img_G, &img_N, &img_D}; //Le dessin ^^ while (boucle == 0) { - gclear('white'); - tile(&map, &p_img, &p_sup); - perso(&tp, &p_perso); + gclear(C_WHITE); + tile(map, p_img, p_sup); + perso(tp, p_perso); //L'affichage gupdate(); touche = pollevent(); @@ -106,18 +106,18 @@ int main(void) return 1; } -void tile(int* map, int* img, int* sup) +void tile(int* map, image_t** img, image_t** sup) { for (int i = 0 ; i <= 7 ; i++) { for (int j = 0 ; j <= 15 ; j++) { - if (*(map + 16*i + j) != 17) + if (map[16*i + j] != 17) { - gimage(8*j, 8*i, *(img + *(map + 16*i + j) - 100 * (*(map + 16*i + j) / 100))); - if (*(map + 16*i + j) > 99) + gimage(8*j, 8*i, img[map[16*i+j]-(map[16*i+j]/100)*100]/**(img + *(map + 16*i + j) - 100 * (*(map + 16*i + j) / 100))*/); + if (map[16*i+j] > 99) { - gimage(8*j, 8*i, *(sup + (*(map + 16*i + j) / 100) -1)); + gimage(8*j, 8*i, sup[(map[16*i+j]/100)-1]); } } @@ -125,12 +125,12 @@ void tile(int* map, int* img, int* sup) } } -void perso(int* tp, int* perso) +void perso(int* tp, image_t** perso) { - if (*tp == 1) - gimage(2, 18, *perso); - else if (*(tp+1) == 1) - gimage(2, 18, *(perso+2)); + if (tp[0] == 1) + gimage(2, 18, perso[0]); + else if (tp[1] == 1) + gimage(2, 18, perso[2]); else - gimage(2, 18, *(perso+1)); + gimage(2, 18, perso[1]); }