Homebrew Homebrew Development

ernilos

Well-Known Member
Member
Joined
Aug 28, 2013
Messages
145
Trophies
0
Location
CAT
XP
280
Country
United States
Those cosine "pillars" to write fonts are very useful for embedded systems.. in print.h..

Did you make them?

I don't undesrtand what functions are you saying...
sprintf function I made with some help of google, specially with stdarg, and draw_string I don't remember where i gotted it and i used with my ARM9 homebrew, I only rewritted and adapted to ARM11 app's
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
Country
Chile
I don't undesrtand what functions are you saying...
sprintf function I made with some help of google, specially with stdarg, and draw_string I don't remember where i gotted it and i used with my ARM9 homebrew, I only rewritted and adapted to ARM11 app's


These ones:

costable.h
Code:
s32 costable[] = {4096, 4095, 4094, 4093, 4091, 4088, 4084, 4080, 4076, 4071, 4065, 4058, 4051, 4044, 4035, 4026, 4017, 4007, 3996, 3985, 3973, 3960, 3947, 3934, 3919, 3904, 3889, 3873, 3856, 3839, 3821, 3803, 3784, 3765, 3744, 3724, 3703, 3681, 3659, 3636, 3612, 3588, 3564, 3539, 3513, 3487, 3461, 3434, 3406, 3378, 3349, 3320, 3290, 3260, 3229, 3198, 3167, 3135, 3102, 3069, 3035, 3002, 2967, 2932, 2897, 2861, 2825, 2788, 2751, 2714, 2676, 2638, 2599, 2560, 2521, 2481, 2441, 2401, 2360, 2318, 2277, 2235, 2193, 2150, 2107, 2064, 2020, 1976, 1932, 1888, 1843, 1798, 1753, 1707, 1662, 1616, 1569, 1523, 1476, 1429, 1382, 1334, 1287, 1239, 1191, 1143, 1095, 1046, 997, 949, 900, 851, 801, 752, 703, 653, 603, 554, 504, 454, 404, 354, 304, 254, 204, 153, 103, 53, 3, -46, -97, -147, -197, -247, -297, -347, -398, -448, -497, -547, -597, -647, -696, -746, -795, -844, -893, -942, -991, -1040, -1088, -1137, -1185, -1233, -1281, -1328, -1376, -1423, -1470, -1517, -1563, -1610, -1656, -1701, -1747, -1792, -1837, -1882, -1927, -1971, -2015, -2058, -2102, -2144, -2187, -2229, -2271, -2313, -2354, -2395, -2436, -2476, -2516, -2555, -2594, -2633, -2671, -2709, -2747, -2784, -2820, -2857, -2892, -2928, -2963, -2997, -3031, -3065, -3098, -3130, -3163, -3194, -3225, -3256, -3286, -3316, -3345, -3374, -3402, -3430, -3457, -3484, -3510, -3536, -3561, -3585, -3609, -3633, -3656, -3678, -3700, -3721, -3742, -3762, -3782, -3801, -3819, -3837, -3854, -3871, -3887, -3902, -3917, -3932, -3946, -3959, -3971, -3983, -3995, -4005, -4016, -4025, -4034, -4042, -4050, -4057, -4064, -4070, -4075, -4080, -4084, -4087, -4090, -4092, -4094, -4095, -4095, -4095, -4094, -4093, -4091, -4088, -4085, -4081, -4076, -4071, -4066, -4059, -4052, -4045, -4036, -4028, -4018, -4008, -3997, -3986, -3974, -3962, -3949, -3935, -3921, -3906, -3891, -3875, -3858, -3841, -3824, -3805, -3787, -3767, -3747, -3727, -3705, -3684, -3662, -3639, -3615, -3592, -3567, -3542, -3517, -3491, -3464, -3437, -3409, -3381, -3353, -3324, -3294, -3264, -3233, -3202, -3171, -3139, -3106, -3073, -3040, -3006, -2972, -2937, -2902, -2866, -2830, -2793, -2756, -2719, -2681, -2643, -2604, -2565, -2526, -2486, -2446, -2406, -2365, -2324, -2282, -2240, -2198, -2156, -2113, -2069, -2026, -1982, -1938, -1894, -1849, -1804, -1759, -1713, -1668, -1622, -1575, -1529, -1482, -1435, -1388, -1341, -1293, -1245, -1197, -1149, -1101, -1052, -1004, -955, -906, -857, -808, -758, -709, -660, -610, -560, -510, -460, -411, -360, -310, -260, -210, -160, -110, -60, -9, 40, 90, 140, 191, 241, 291, 341, 391, 441, 491, 541, 591, 640, 690, 739, 789, 838, 887, 936, 985, 1033, 1082, 1130, 1179, 1227, 1274, 1322, 1370, 1417, 1464, 1511, 1557, 1604, 1650, 1695, 1741, 1786, 1831, 1876, 1921, 1965, 2009, 2053, 2096, 2139, 2182, 2224, 2266, 2308, 2349, 2390, 2431, 2471, 2511, 2550, 2589, 2628, 2666, 2704, 2742, 2779, 2816, 2852, 2888, 2923, 2958, 2993, 3027, 3060, 3093, 3126, 3158, 3190, 3221, 3252, 3282, 3312, 3342, 3370, 3399, 3426, 3454, 3480, 3507, 3532, 3557, 3582, 3606, 3630, 3653, 3675, 3697, 3718, 3739, 3759, 3779, 3798, 3817, 3835, 3852, 3869, 3885, 3900, 3915, 3930, 3944, 3957, 3970, 3982, 3993, 4004, 4014, 4024, 4033, 4041, 4049, 4056, 4063, 4069, 4074, 4079, 4083, 4087, 4090, 4092, 4094, 4095};

main.c
Code:
s32 pcCos(u16 v)
{
return costable[v&0x1FF]; //9 MSB from costable
}
 
void renderEffect()
{
u8* bufAdr=&gspHeap[0x46500*currentBuffer];
 
int i, j;
for(i=1;i<400;i++)
{
 
//(assuming 3DS screens use swap'd coords (y as base, x as offset)
for(j=1;j<240;j++)
{
u32 v=(j+i*240)*3;
 
bufAdr[v]=(pcCos(i+cnt)+4096)/32;
//vbuffer[vertical line index]<=Y: grab and store from a default cosine table [range 4095--4095], (Y+i) + cnt (frame counter ) starting from 4096,
//resulting in small chunks of 32 fragments (....4x8 matrix domain of Y?)  
 
bufAdr[v+1]=(pcCos(j-256+cnt)+4096)/64;
//vbuffer[vertical line index+1]<= X: same except cosine table index is decreased by 1/16th of 4096, plus (X+j+cnt), //starting from 128 resulting in small chunks of 64 fragments //(....8x8 matrix domain of X?)
 
bufAdr[v+2]=(pcCos(i+128-cnt)+4096)/32;
//vbuffer[vertical line index+2]<=X same, except cosine index starts by 1/32th of 4096 backwards framecounter , starting from 4096,
//resulting in small chunks of 32 fragments. (....a second 4x8 matrix of the same Y but from a different cartesian coordinate. )
}
}
cnt++;
}

These ones. I'm not sure I've translated them correctly,but that particular renderEffect(); seems interesting.
 

ernilos

Well-Known Member
Member
Joined
Aug 28, 2013
Messages
145
Trophies
0
Location
CAT
XP
280
Country
United States
These ones:

costable.h
Code:
s32 costable[] = {4096, 4095, 4094, 4093, 4091, 4088, 4084, 4080, 4076, 4071, 4065, 4058, 4051, 4044, 4035, 4026, 4017, 4007, 3996, 3985, 3973, 3960, 3947, 3934, 3919, 3904, 3889, 3873, 3856, 3839, 3821, 3803, 3784, 3765, 3744, 3724, 3703, 3681, 3659, 3636, 3612, 3588, 3564, 3539, 3513, 3487, 3461, 3434, 3406, 3378, 3349, 3320, 3290, 3260, 3229, 3198, 3167, 3135, 3102, 3069, 3035, 3002, 2967, 2932, 2897, 2861, 2825, 2788, 2751, 2714, 2676, 2638, 2599, 2560, 2521, 2481, 2441, 2401, 2360, 2318, 2277, 2235, 2193, 2150, 2107, 2064, 2020, 1976, 1932, 1888, 1843, 1798, 1753, 1707, 1662, 1616, 1569, 1523, 1476, 1429, 1382, 1334, 1287, 1239, 1191, 1143, 1095, 1046, 997, 949, 900, 851, 801, 752, 703, 653, 603, 554, 504, 454, 404, 354, 304, 254, 204, 153, 103, 53, 3, -46, -97, -147, -197, -247, -297, -347, -398, -448, -497, -547, -597, -647, -696, -746, -795, -844, -893, -942, -991, -1040, -1088, -1137, -1185, -1233, -1281, -1328, -1376, -1423, -1470, -1517, -1563, -1610, -1656, -1701, -1747, -1792, -1837, -1882, -1927, -1971, -2015, -2058, -2102, -2144, -2187, -2229, -2271, -2313, -2354, -2395, -2436, -2476, -2516, -2555, -2594, -2633, -2671, -2709, -2747, -2784, -2820, -2857, -2892, -2928, -2963, -2997, -3031, -3065, -3098, -3130, -3163, -3194, -3225, -3256, -3286, -3316, -3345, -3374, -3402, -3430, -3457, -3484, -3510, -3536, -3561, -3585, -3609, -3633, -3656, -3678, -3700, -3721, -3742, -3762, -3782, -3801, -3819, -3837, -3854, -3871, -3887, -3902, -3917, -3932, -3946, -3959, -3971, -3983, -3995, -4005, -4016, -4025, -4034, -4042, -4050, -4057, -4064, -4070, -4075, -4080, -4084, -4087, -4090, -4092, -4094, -4095, -4095, -4095, -4094, -4093, -4091, -4088, -4085, -4081, -4076, -4071, -4066, -4059, -4052, -4045, -4036, -4028, -4018, -4008, -3997, -3986, -3974, -3962, -3949, -3935, -3921, -3906, -3891, -3875, -3858, -3841, -3824, -3805, -3787, -3767, -3747, -3727, -3705, -3684, -3662, -3639, -3615, -3592, -3567, -3542, -3517, -3491, -3464, -3437, -3409, -3381, -3353, -3324, -3294, -3264, -3233, -3202, -3171, -3139, -3106, -3073, -3040, -3006, -2972, -2937, -2902, -2866, -2830, -2793, -2756, -2719, -2681, -2643, -2604, -2565, -2526, -2486, -2446, -2406, -2365, -2324, -2282, -2240, -2198, -2156, -2113, -2069, -2026, -1982, -1938, -1894, -1849, -1804, -1759, -1713, -1668, -1622, -1575, -1529, -1482, -1435, -1388, -1341, -1293, -1245, -1197, -1149, -1101, -1052, -1004, -955, -906, -857, -808, -758, -709, -660, -610, -560, -510, -460, -411, -360, -310, -260, -210, -160, -110, -60, -9, 40, 90, 140, 191, 241, 291, 341, 391, 441, 491, 541, 591, 640, 690, 739, 789, 838, 887, 936, 985, 1033, 1082, 1130, 1179, 1227, 1274, 1322, 1370, 1417, 1464, 1511, 1557, 1604, 1650, 1695, 1741, 1786, 1831, 1876, 1921, 1965, 2009, 2053, 2096, 2139, 2182, 2224, 2266, 2308, 2349, 2390, 2431, 2471, 2511, 2550, 2589, 2628, 2666, 2704, 2742, 2779, 2816, 2852, 2888, 2923, 2958, 2993, 3027, 3060, 3093, 3126, 3158, 3190, 3221, 3252, 3282, 3312, 3342, 3370, 3399, 3426, 3454, 3480, 3507, 3532, 3557, 3582, 3606, 3630, 3653, 3675, 3697, 3718, 3739, 3759, 3779, 3798, 3817, 3835, 3852, 3869, 3885, 3900, 3915, 3930, 3944, 3957, 3970, 3982, 3993, 4004, 4014, 4024, 4033, 4041, 4049, 4056, 4063, 4069, 4074, 4079, 4083, 4087, 4090, 4092, 4094, 4095};

main.c
Code:
s32 pcCos(u16 v)
{
return costable[v&0x1FF]; //9 MSB from costable
}
 
void renderEffect()
{
u8* bufAdr=&gspHeap[0x46500*currentBuffer];
 
int i, j;
for(i=1;i<400;i++)
{
 
//(assuming 3DS screens use swap'd coords (y as base, x as offset)
for(j=1;j<240;j++)
{
u32 v=(j+i*240)*3;
 
bufAdr[v]=(pcCos(i+cnt)+4096)/32;
//vbuffer[vertical line index]<=Y: grab and store from a default cosine table [range 4095--4095], (Y+i) + cnt (frame counter ) starting from 4096,
//resulting in small chunks of 32 fragments (....4x8 matrix domain of Y?) 
 
bufAdr[v+1]=(pcCos(j-256+cnt)+4096)/64;
//vbuffer[vertical line index+1]<= X: same except cosine table index is decreased by 1/16th of 4096, plus (X+j+cnt), //starting from 128 resulting in small chunks of 64 fragments //(....8x8 matrix domain of X?)
 
bufAdr[v+2]=(pcCos(i+128-cnt)+4096)/32;
//vbuffer[vertical line index+2]<=X same, except cosine index starts by 1/32th of 4096 backwards framecounter , starting from 4096,
//resulting in small chunks of 32 fragments. (....a second 4x8 matrix of the same Y but from a different cartesian coordinate. )
}
}
cnt++;
}

These ones. I'm not sure I've translated them correctly,but that particular renderEffect(); seems interesting.

They are from smealum, I used the base of arm11u (https://github.com/smealum/ctrulib/tree/master/arm11u)
 
  • Like
Reactions: redact

Gadorach

Electronics Engineering Technologist
Member
Joined
Jan 22, 2014
Messages
970
Trophies
0
Location
Canada
XP
956
Country
Canada
How do I install any off these homebrew programs.
Some are only publicly usable on the Gateway hardware, some are launcher.dat homebrew that can be run with just a DS-Mode flash cart. Read the first post to find the majority of the information you want.
 

st4rk

nah
Member
Joined
Feb 11, 2014
Messages
542
Trophies
0
Website
st4rk.net
XP
815
Country
Brazil
Here a little preview of 3DNES, have a lot of bug to fix.

Working with some games, the new version have a lot of mappers and PPU re-writed and bug fix.

How it work ? Just put in 3DS SD your game with name "jogo.nes", after it, open the 3DNES with gateway and enjoy.

a video:


Download: http://filetrip.net/dl?39rrOrQUwQ

I am working on the new version with menu and other features, just wait XD.

Ps: Some games don't work, because have bugs on PPU and need a lot of mappers to work.
Ps²: Need a lot of work on joypad ;]

Special Thanks to gdkchan :]
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Well start walking towards them +1