From e93a967cb0fd945bea593c7984da7642764461dd Mon Sep 17 00:00:00 2001 From: tangstad Date: Sat, 26 Nov 2005 19:00:33 +0000 Subject: [PATCH] Added smoke when driving. Removed chasers for now. --- gba/cartest/data/smoke.bin | Bin 0 -> 384 bytes gba/cartest/data/smoke.xcf | Bin 0 -> 2818 bytes gba/cartest/src/cartest.c | 60 ++++++++++++++++++++++++++++--------- 3 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 gba/cartest/data/smoke.bin create mode 100644 gba/cartest/data/smoke.xcf diff --git a/gba/cartest/data/smoke.bin b/gba/cartest/data/smoke.bin new file mode 100644 index 0000000000000000000000000000000000000000..1b325c1b18bbff7b13c32994a74ae37f1113b7e5 GIT binary patch literal 384 zcmaJ(TMEE12onbV5e&QkWoMIYg%#>g%rj!Ul2Z53W7u+Mp{|ikR0`9(=UPN5jsgn} v781uQWCP5B7tu2mn!4}Yf2-Sa5OZkKS0JZJ)$%tm?LLEuxwb4ZpwxOFu&e}1 literal 0 HcmV?d00001 diff --git a/gba/cartest/data/smoke.xcf b/gba/cartest/data/smoke.xcf new file mode 100644 index 0000000000000000000000000000000000000000..583f045ef95d20d8316b9915510a8044558a9fad GIT binary patch literal 2818 zcmeHJO>fgc5FID6H)1$4!h6#Ur9xtwtX>2!eq2;@#aMeWzz%jp1-O8WG~rXfz&=;}|J0j5xRR9rz!1 zpac;bE(BeGn`?VS?68Y)ToS=wmYDM{A^$qs#SmAl5^dE(zY=z%4N!csG;_JvA2fY0 zYW4kY&u{djcB{8yEeBzv-E4QgWzkf+;dBI@ zQkDl$bE&iEd};b~3Di1KNcGJ$r@!MkLx(PA!dH>MG&*p}#iM{lSM~^H=&n-4vmR4^ zizl06mIb)k+lm1{=UDhcyYxJArDWka=%D{gKiaB$x{M$U^ zEcwizwtRk>q~#w=kdU9>NOSo<#|6^d9DHK)sq3x=t&Zy=B6rGW(QD6DeUm3TE7hz} znt5LVw9MmmH(#bX^EJmMnm9IPX&+i0r0t{O_<)6%=86@6OwLLy-*;&Ran%qcj=1nZ zc1o@w?*A3Y%NjzSV{bWq0*oRY!i%%G*TPWP$boc_Fd59>Wq3RV47I^Sa&-aqD#S1l*OF9K)bFjaav fU7Ga`KphQu>xb-+ob{9Aa(qZ}F3yn7U@86!RNc^4 literal 0 HcmV?d00001 diff --git a/gba/cartest/src/cartest.c b/gba/cartest/src/cartest.c index a5a4b27..f345176 100644 --- a/gba/cartest/src/cartest.c +++ b/gba/cartest/src/cartest.c @@ -14,8 +14,7 @@ // headers for binary data generated by bin2o macro in makefile #include "car_pal_bin.h" #include "car_bin.h" -#include "chaser_bin.h" - +#include "smoke_bin.h" #include "sinlut.h" @@ -30,11 +29,12 @@ typedef s32 FIXED; // 32bit FIXED in 24.8 format #define lut_cos(x) _sinLUT[(x + (SIN_SIZE>>2)) & SIN_MASK] -#define NUMCHASERS 10 +#define NUMSMOKES 20 u16 PaletteBuffer[256]; -OBJATTR oe_buffer[1+NUMCHASERS]; +OBJATTR oe_buffer[1+NUMSMOKES]; OBJAFFINE *const oa_buffer = (OBJAFFINE*)oe_buffer; +s8 smoke_frame[NUMSMOKES]; unsigned int frame; @@ -48,8 +48,8 @@ int main(void) { OBJATTR*car = &oe_buffer[0]; OBJAFFINE*car_aff = &oa_buffer[0]; - // We'll make a few chasers - OBJATTR*chasers = &oe_buffer[1]; + // We'll make a few smoke clouds + OBJATTR*smokes = &oe_buffer[1]; // Set up the interrupt handlers InitInterrupt(); @@ -72,20 +72,23 @@ int main(void) void* free_space = BITMAP_OBJ_BASE_ADR; CpuFastSet(car_bin, free_space, COPY32 | car_bin_size/4); free_space += car_bin_size; - CpuFastSet(chaser_bin, free_space, COPY32 | chaser_bin_size/4); - free_space += chaser_bin_size; + CpuFastSet(car_pal_bin, OBJ_COLORS, COPY32 | car_pal_bin_size/4); + // load smoke + CpuFastSet(smoke_bin, free_space, COPY32 | smoke_bin_size/4); + free_space += smoke_bin_size; + car->attr2 = OBJ_CHAR(512); - s32 base = (s32)(0.707106781 * 256); - s32 one = 1 << 8; + u8 next_smoke = 0; u8 i; - for (i=0; iattr1 = OBJ_SIZE(1) | OBJ_X(FIX2INT(x)); car->attr0 = OBJ_256_COLOR | OBJ_DOUBLE | OBJ_ROT_SCALE_ON | OBJ_Y(FIX2INT(y)); + // Update smoke cloud frames + if ((frame & 3) == 3) { + for (i=0; i=NUMSMOKES) { + next_smoke = 1; + } + + for (i=0; i