diff --git a/Debug/MyProject.axf b/Debug/MyProject.axf index 2d42a78..24e4de8 100755 Binary files a/Debug/MyProject.axf and b/Debug/MyProject.axf differ diff --git a/Debug/MyProject.map b/Debug/MyProject.map index fac7f93..87770e0 100644 --- a/Debug/MyProject.map +++ b/Debug/MyProject.map @@ -250,7 +250,7 @@ END GROUP 0x20084000 __top_RamAHB32 = 0x20084000 0x20084000 __top_RAM2 = 0x20084000 -.text 0x00000000 0x3ab60 +.text 0x00000000 0x3ab70 FILL mask 0xff 0x00000000 __vectors_start__ = ABSOLUTE (.) *(.isr_vector) @@ -259,10 +259,10 @@ END GROUP 0x000000cc . = ALIGN (0x4) 0x000000cc __section_table_start = . 0x000000cc __data_section_table = . - 0x000000cc 0x4 LONG 0x3ab60 LOADADDR (.data) + 0x000000cc 0x4 LONG 0x3ab70 LOADADDR (.data) 0x000000d0 0x4 LONG 0x10000000 ADDR (.data) 0x000000d4 0x4 LONG 0x1c SIZEOF (.data) - 0x000000d8 0x4 LONG 0x3ab60 LOADADDR (.data_RAM2) + 0x000000d8 0x4 LONG 0x3ab70 LOADADDR (.data_RAM2) 0x000000dc 0x4 LONG 0x2007c000 ADDR (.data_RAM2) 0x000000e0 0x4 LONG 0x0 SIZEOF (.data_RAM2) 0x000000e4 __data_section_table_end = . @@ -447,63 +447,63 @@ END GROUP 0x000012e4 0x9c ./src/main.o 0x000012e4 CreatePlayer .text.RefreshPlayer - 0x00001380 0xd0 ./src/main.o + 0x00001380 0xd8 ./src/main.o 0x00001380 RefreshPlayer - .text.main 0x00001450 0x214 ./src/main.o - 0x00001450 main - .text.memcpy 0x00001664 0x4 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(memcpy.o) - 0x00001664 memcpy + .text.main 0x00001458 0x21c ./src/main.o + 0x00001458 main + .text.memcpy 0x00001674 0x4 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(memcpy.o) + 0x00001674 memcpy .text.__weak_main - 0x00001668 0x4 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(__weak__main.o) - 0x00001668 __main - 0x00001668 __weak_main + 0x00001678 0x4 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(__weak__main.o) + 0x00001678 __main + 0x00001678 __weak_main .text.__aeabi_memcpy - 0x0000166c 0x34 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7-m/nofp/libcr_eabihelpers.a(memcpy.o) - 0x0000166c __aeabi_memcpy - 0x00001676 __aeabi_memcpy4 - 0x00001676 __aeabi_memcpy8 + 0x0000167c 0x34 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7-m/nofp/libcr_eabihelpers.a(memcpy.o) + 0x0000167c __aeabi_memcpy + 0x00001686 __aeabi_memcpy4 + 0x00001686 __aeabi_memcpy8 *(.rodata .rodata.* .constdata .constdata.*) - .rodata.SMPTE 0x000016a0 0x38410 ./src/SPI.o + .rodata.SMPTE 0x000016b0 0x38410 ./src/SPI.o .rodata.ShipSprite1 - 0x00039ab0 0xc10 ./src/SPI.o - 0x00039ab0 ShipSprite1 + 0x00039ac0 0xc10 ./src/SPI.o + 0x00039ac0 ShipSprite1 .rodata.SmallFont - 0x0003a6c0 0x478 ./src/fonts.o - 0x0003a6c0 SmallFont + 0x0003a6d0 0x478 ./src/fonts.o + 0x0003a6d0 SmallFont .rodata.SCREEN - 0x0003ab38 0x10 ./src/main.o - 0x0003ab38 SCREEN - .rodata 0x0003ab48 0x18 ./src/main.o - 0x0003ab60 . = ALIGN (0x4) + 0x0003ab48 0x10 ./src/main.o + 0x0003ab48 SCREEN + .rodata 0x0003ab58 0x18 ./src/main.o + 0x0003ab70 . = ALIGN (0x4) -.glue_7 0x0003ab60 0x0 - .glue_7 0x0003ab60 0x0 linker stubs +.glue_7 0x0003ab70 0x0 + .glue_7 0x0003ab70 0x0 linker stubs -.glue_7t 0x0003ab60 0x0 - .glue_7t 0x0003ab60 0x0 linker stubs +.glue_7t 0x0003ab70 0x0 + .glue_7t 0x0003ab70 0x0 linker stubs -.vfp11_veneer 0x0003ab60 0x0 - .vfp11_veneer 0x0003ab60 0x0 linker stubs +.vfp11_veneer 0x0003ab70 0x0 + .vfp11_veneer 0x0003ab70 0x0 linker stubs -.v4_bx 0x0003ab60 0x0 - .v4_bx 0x0003ab60 0x0 linker stubs +.v4_bx 0x0003ab70 0x0 + .v4_bx 0x0003ab70 0x0 linker stubs -.iplt 0x0003ab60 0x0 - .iplt 0x0003ab60 0x0 ./src/SPI.o +.iplt 0x0003ab70 0x0 + .iplt 0x0003ab70 0x0 ./src/SPI.o -.rel.dyn 0x0003ab60 0x0 - .rel.iplt 0x0003ab60 0x0 ./src/SPI.o +.rel.dyn 0x0003ab70 0x0 + .rel.iplt 0x0003ab70 0x0 ./src/SPI.o .ARM.extab *(.ARM.extab* .gnu.linkonce.armextab.*) -.ARM.exidx 0x0003ab60 0x0 - 0x0003ab60 __exidx_start = . +.ARM.exidx 0x0003ab70 0x0 + 0x0003ab70 __exidx_start = . *(.ARM.exidx* .gnu.linkonce.armexidx.*) - 0x0003ab60 __exidx_end = . - 0x0003ab60 _etext = . + 0x0003ab70 __exidx_end = . + 0x0003ab70 _etext = . -.data_RAM2 0x2007c000 0x0 load address 0x0003ab60 +.data_RAM2 0x2007c000 0x0 load address 0x0003ab70 FILL mask 0xff [!provide] PROVIDE (__start_data_RAM2 = .) [!provide] PROVIDE (__start_data_RamAHB32 = .) @@ -524,7 +524,7 @@ END GROUP 0x10000000 . = ALIGN (0x4) 0x10000000 _end_uninit_RESERVED = . -.data 0x10000000 0x1c load address 0x0003ab60 +.data 0x10000000 0x1c load address 0x0003ab70 FILL mask 0xff 0x10000000 _data = . [!provide] PROVIDE (__start_data_RAM = .) @@ -552,7 +552,7 @@ END GROUP [!provide] PROVIDE (__end_data_RAM = .) [!provide] PROVIDE (__end_data_RamLoc32 = .) -.igot.plt 0x1000001c 0x0 load address 0x0003ab7c +.igot.plt 0x1000001c 0x0 load address 0x0003ab8c .igot.plt 0x1000001c 0x0 ./src/SPI.o .bss_RAM2 0x2007c000 0x0 @@ -614,21 +614,21 @@ END GROUP 0x10008000 PROVIDE (_vStackTop = DEFINED (__user_stack_top)?__user_stack_top:(__top_RamLoc32 - 0x0)) 0xefff74b2 PROVIDE (__valid_user_code_checksum = (0x0 - ((((((_vStackTop + (ResetISR + 0x1)) + (NMI_Handler + 0x1)) + (HardFault_Handler + 0x1)) + (DEFINED (MemManage_Handler)?MemManage_Handler:0x0 + 0x1)) + (DEFINED (BusFault_Handler)?BusFault_Handler:0x0 + 0x1)) + (DEFINED (UsageFault_Handler)?UsageFault_Handler:0x0 + 0x1)))) 0x00000000 _image_start = LOADADDR (.text) - 0x0003ab7c _image_end = (LOADADDR (.data) + SIZEOF (.data)) - 0x0003ab7c _image_size = (_image_end - _image_start) + 0x0003ab8c _image_end = (LOADADDR (.data) + SIZEOF (.data)) + 0x0003ab8c _image_size = (_image_end - _image_start) OUTPUT(MyProject.axf elf32-littlearm) LOAD linker stubs -.debug_info 0x00000000 0x18d0 +.debug_info 0x00000000 0x18c0 .debug_info 0x00000000 0x208 ./src/GPIO.o .debug_info 0x00000208 0xa58 ./src/SPI.o .debug_info 0x00000c60 0x29d ./src/cr_startup_lpc175x_6x.o .debug_info 0x00000efd 0x40 ./src/crp.o .debug_info 0x00000f3d 0xc9 ./src/fonts.o .debug_info 0x00001006 0xb5 ./src/init_clk.o - .debug_info 0x000010bb 0x6b2 ./src/main.o - .debug_info 0x0000176d 0x119 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(memcpy.o) - .debug_info 0x00001886 0x4a /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(__weak__main.o) + .debug_info 0x000010bb 0x6a2 ./src/main.o + .debug_info 0x0000175d 0x119 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(memcpy.o) + .debug_info 0x00001876 0x4a /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(__weak__main.o) .debug_abbrev 0x00000000 0x9b7 .debug_abbrev 0x00000000 0x12b ./src/GPIO.o @@ -687,18 +687,18 @@ LOAD linker stubs .debug_macro 0x000014d7 0x112 ./src/init_clk.o .debug_macro 0x000015e9 0x62 ./src/main.o -.debug_line 0x00000000 0x18c1 +.debug_line 0x00000000 0x18d1 .debug_line 0x00000000 0x358 ./src/GPIO.o .debug_line 0x00000358 0x8eb ./src/SPI.o .debug_line 0x00000c43 0x161 ./src/cr_startup_lpc175x_6x.o .debug_line 0x00000da4 0xb9 ./src/crp.o .debug_line 0x00000e5d 0x3a ./src/fonts.o .debug_line 0x00000e97 0x3c8 ./src/init_clk.o - .debug_line 0x0000125f 0x57d ./src/main.o - .debug_line 0x000017dc 0x9b /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(memcpy.o) - .debug_line 0x00001877 0x4a /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(__weak__main.o) + .debug_line 0x0000125f 0x58d ./src/main.o + .debug_line 0x000017ec 0x9b /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(memcpy.o) + .debug_line 0x00001887 0x4a /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(__weak__main.o) -.debug_str 0x00000000 0x5ddc +.debug_str 0x00000000 0x5dce .debug_str 0x00000000 0x5145 ./src/GPIO.o 0x51c4 (size before relaxing) .debug_str 0x00005145 0x3d3 ./src/SPI.o @@ -711,11 +711,11 @@ LOAD linker stubs 0x2e69 (size before relaxing) .debug_str 0x00005817 0x2e1 ./src/init_clk.o 0x53e9 (size before relaxing) - .debug_str 0x00005af8 0x190 ./src/main.o - 0x540f (size before relaxing) - .debug_str 0x00005c88 0x132 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(memcpy.o) + .debug_str 0x00005af8 0x182 ./src/main.o + 0x5401 (size before relaxing) + .debug_str 0x00005c7a 0x132 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(memcpy.o) 0x1bb (size before relaxing) - .debug_str 0x00005dba 0x22 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(__weak__main.o) + .debug_str 0x00005dac 0x22 /Applications/MCUXpressoIDE_11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libcr_c.a(__weak__main.o) 0x12a (size before relaxing) .comment 0x00000000 0x45 diff --git a/Debug/MyProject_Debug.ld b/Debug/MyProject_Debug.ld index 479524b..5e283ea 100644 --- a/Debug/MyProject_Debug.ld +++ b/Debug/MyProject_Debug.ld @@ -5,7 +5,7 @@ * Generated linker script file for LPC1769 * Created from linkscript.ldt by FMCreateLinkLibraries * Using Freemarker v2.3.30 - * MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05] on Jun 13, 2024, 5:27:15 PM + * MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05] on Jun 13, 2024, 5:53:52 PM */ INCLUDE "MyProject_Debug_library.ld" diff --git a/Debug/MyProject_Debug_library.ld b/Debug/MyProject_Debug_library.ld index 3429d57..756c6d2 100644 --- a/Debug/MyProject_Debug_library.ld +++ b/Debug/MyProject_Debug_library.ld @@ -5,7 +5,7 @@ * Generated linker script file for LPC1769 * Created from library.ldt by FMCreateLinkLibraries * Using Freemarker v2.3.30 - * MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05] on Jun 13, 2024, 5:27:15 PM + * MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05] on Jun 13, 2024, 5:53:52 PM */ GROUP ( diff --git a/Debug/MyProject_Debug_memory.ld b/Debug/MyProject_Debug_memory.ld index f586f26..1c8ba65 100644 --- a/Debug/MyProject_Debug_memory.ld +++ b/Debug/MyProject_Debug_memory.ld @@ -5,7 +5,7 @@ * Generated linker script file for LPC1769 * Created from memory.ldt by FMCreateLinkMemory * Using Freemarker v2.3.30 - * MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05] on Jun 13, 2024, 5:27:15 PM + * MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05] on Jun 13, 2024, 5:53:52 PM */ MEMORY diff --git a/Debug/src/main.o b/Debug/src/main.o index 351c013..0a1408d 100644 Binary files a/Debug/src/main.o and b/Debug/src/main.o differ diff --git a/Debug/src/main.su b/Debug/src/main.su index 3e71b33..69b147a 100644 --- a/Debug/src/main.su +++ b/Debug/src/main.su @@ -8,4 +8,4 @@ ../src/main.c:93:6:scroll_array 32 static ../src/main.c:102:8:CreatePlayer 80 static ../src/main.c:111:6:RefreshPlayer 72 static -../src/main.c:136:5:main 144 dynamic +../src/main.c:136:5:main 160 dynamic diff --git a/src/SPI.h b/src/SPI.h index 75d9ce8..cb45d00 100644 --- a/src/SPI.h +++ b/src/SPI.h @@ -38,6 +38,7 @@ void ILI9341_Initial(void); void Refresh_Area(Rectangle area); void Draw_stars(); void Resize_Window(Rectangle area); +void Refresh_Area(Rectangle area); void DrawPlayer(Player player, Rectangle areaToDraw); void DrawText(Point starting_point,char text[],Size charSize); diff --git a/src/main.c b/src/main.c index 8c99352..84c7381 100644 --- a/src/main.c +++ b/src/main.c @@ -110,7 +110,7 @@ Player CreatePlayer(){ void RefreshPlayer(Point vector){ if(player.Hitbox.Position.Y + vector.Y < 0){ - player.Hitbox.Position.Y = SCREEN_SIZE.Height - (0-vector.Y); + player.Hitbox.Position.Y = SCREEN_SIZE.Height + (player.Hitbox.Position.Y - (0-vector.Y)); }else{ if(player.Hitbox.Position.Y + vector.Y >= SCREEN_SIZE.Height){ player.Hitbox.Position.Y = vector.Y - (SCREEN_SIZE.Height - player.Hitbox.Position.Y); @@ -147,8 +147,9 @@ int main(void) { Draw_stars(); - int increment = 5; + int increment = 3; Point momentum = {0,0}; + Size charSize = {7,11}; while (true) { @@ -169,6 +170,7 @@ int main(void) { } if(need_to_scroll){ + //Refresh_Area((Rectangle){text_origin,(Size){charSize.Width * 3,charSize.Height}}); scroll(scrolling); player.Hitbox.Position.Y -= 1; need_to_scroll = false; @@ -176,28 +178,25 @@ int main(void) { int digits = number_of_digits(scrolling); char newStr[digits+1]; convert_to_string(scrolling,digits,&newStr); - Size charSize = {7,11}; - Point new_origin = {text_origin.X,(text_origin.Y + scrolling)%320}; DrawText(new_origin,newStr,charSize); - Rectangle areaToRefresh = {{new_origin.X,new_origin.Y + charSize.Height},{charSize.Width* 4,charSize.Height}}; - Refresh_Area(areaToRefresh); + Refresh_Area((Rectangle){(Point){new_origin.X,new_origin.Y + charSize.Height -1},(Size){charSize.Width * 3,charSize.Height - 2}}); } momentum.X += vec.X; momentum.Y += vec.Y; - if(momentum.X > 20) - momentum.X = 20; - if(momentum.X < -25) - momentum.X = -25; + if(momentum.X > 35) + momentum.X = 35; + if(momentum.X < -40) + momentum.X = -40; - if(momentum.Y > 20) - momentum.Y = 20; - if(momentum.Y < -20) - momentum.Y = -20; + if(momentum.Y > 35) + momentum.Y = 35; + if(momentum.Y < -35) + momentum.Y = -35; RefreshPlayer(momentum);