I think there is a problem with sprintf.
int le=1;
char strng[40];
sprintf(strng, "%d", le);
printf("LE=%d LE=%s\n", le, strng);
I get
LE=1 LE=15
V.
Search found 63 matches
- Sun Nov 04, 2012 9:58 pm
- Forum: C programming
- Topic: sprintf
- Replies: 2
- Views: 10518
- Sun Nov 04, 2012 9:46 pm
- Forum: C programming
- Topic: C - Assembly
- Replies: 5
- Views: 14539
Re: C - Assembly
Depends of the performance you are looking for, but the PLOT and SCRN functions can be implemented like that in C: void PLOT(unsigned char x,unsigned char y,unsigned char car) { unsigned char* screen=(unsigned char*)0xBB80; screen[x+(int)y*40]=car; } unsigned char SCRN(unsigned char x,unsigned char...
- Sun Nov 04, 2012 9:42 pm
- Forum: C programming
- Topic: RND
- Replies: 5
- Views: 14137
Re: RND
I used the following function. This function returns pseudo-random numbers that are power of 2. The argument n is used to define the upper limit of the returned values, the higher the n the lower the upper limit (e.g. for n=6 the function returns values 0, 1, 2 and 3). int rseed=3; int rnd(char n) {...
- Wed Oct 31, 2012 1:52 pm
- Forum: C programming
- Topic: RND
- Replies: 5
- Views: 14137
Re: RND
I don't need anything advanced. If rand() returns numbers between 0 and 1 is all I need.
Thanks
V.
Thanks
V.
- Wed Oct 31, 2012 9:04 am
- Forum: C programming
- Topic: RND
- Replies: 5
- Views: 14137
RND
Any ideas how to implement Basic's RND (random numbers between
0 and 1with uniform distribution)?
Thanks
V.
0 and 1with uniform distribution)?
Thanks
V.
- Mon Oct 29, 2012 7:05 am
- Forum: C programming
- Topic: C - Assembly
- Replies: 5
- Views: 14539
Re: C - Assembly
Thanks Dbug. I will use this for the moment, see how things go
and decide if I need something funkier.
V.
and decide if I need something funkier.
V.
- Sun Oct 28, 2012 8:29 pm
- Forum: C programming
- Topic: C - Assembly
- Replies: 5
- Views: 14539
C - Assembly
I am planning to do something in C for Oric and I need the Basic's functions PLOT and SCRN. In the OSDK the hello_world_advanced is included in the C samples. In this project there is a function written in assembly which is called AdvancedPrint and is equivalent to PLOT (I think so). Is the Basic's ...
- Fri Oct 19, 2012 6:59 pm
- Forum: Emulators
- Topic: Oricutron slow in kernel 3.0.0-15
- Replies: 10
- Views: 21612
Re: Oricutron slow in kernel 3.0.0-15
I retested Oricutron on kernel 3.0.0-26 and looks improved. Oric can now be simulated at 66% of its original speed. I did some experiments. In the picture OricutronUp.png Oricutron is up and running. Three processes (oricutron, pulseaudio and X) consume 100% of the CPU. In the picture OricutronDown....
- Mon Oct 08, 2012 9:59 pm
- Forum: Games
- Topic: Damsel In Distress
- Replies: 8
- Views: 12870
Re: Damsel In Distress
Are you talking about an annoying high frequency sound? I am experiencing it too.
Xubuntu 11.10, oricutron 0.9.
Xubuntu 11.10, oricutron 0.9.
- Thu May 31, 2012 10:50 pm
- Forum: Games
- Topic: Scuba Diver
- Replies: 2
- Views: 6252
Re: Scuba Diver
Spectrum version is really good. Sharks look very realistic. Oric version is just decent. The C64 version is a pure joke:
http://www.youtube.com/watch?v=4tnUs4uV2jw
V.
http://www.youtube.com/watch?v=4tnUs4uV2jw
V.
- Tue Apr 24, 2012 8:37 am
- Forum: BASIC programming
- Topic: Convert to present value
- Replies: 5
- Views: 15381
Re: Convert to present value
These are the data for Greece. Data was taken from www.global-rates.com. See also Spain form more metadata information. 10 DATA 340.75 20 DATA 5.00, 5.00, 5.00, 5.00, 5.00 25 DATA 5.00, 6.40, 1.34, 3.33, 1.39 30 DATA 1.37, 2.14, 0.47, 2.69, 1.50 35 DATA 1.24, 4.35, 4.67,-0.87, 2.60 40 DATA 2.41, 3.1...
- Tue Apr 24, 2012 8:21 am
- Forum: BASIC programming
- Topic: Convert to present value
- Replies: 5
- Views: 15381
Re: Convert to present value
These are the data for Norway. For metadata information see Spain above. 10 DATA 1 20 DATA 5.00, 5.00, 5.00, 5.00, 5.00 25 DATA 5.00, 4.11, 2.47, 6.35,-0.09 30 DATA -0.09, 3.99, 4.12, 3.07, 5.43 35 DATA 2.09, 4.39, 4.45, 3.07, 5.97 40 DATA 12.40, 4.92, 7.09, 7.68,11.16 45 DATA 9.78, 8.01, 9.46, 5.19...
- Wed Apr 11, 2012 7:19 am
- Forum: BASIC programming
- Topic: Convert to present value
- Replies: 5
- Views: 15381
Re: Convert to present value
This is the data for Spain. Data from 1980 till present was taken from: http://www.indexmundi.com/spain/inflation_rate_%28consumer_prices%29.html. The data from 1955 up to 1979 was derived from the image provided at http://www.global-rates.com/economic-indicators/inflation/consumer-prices/cpi/spain....
- Mon Apr 09, 2012 9:55 pm
- Forum: BASIC programming
- Topic: Convert to present value
- Replies: 5
- Views: 15381
Re: Convert to present value
This is the data for France. Values for inflation were taken from http://france-inflation.com/inflation-depuis-1901.php 10 DATA 6.56 20 DATA 10,16.3,11.9,-1.8,0.5 25 DATA 1,4.3,2.9,15.2,6 30 DATA 3.8,3.3,4.8,4.8,3.4 35 DATA 2.5,2.7,2.7,4.5,6.5 40 DATA 5.2,5.7,6.2,9.2,13.7 45 DATA 11.8,9.6,9.4,9.1,10...
- Mon Apr 09, 2012 9:40 pm
- Forum: BASIC programming
- Topic: A little game like Driver.
- Replies: 11
- Views: 23374
Re: A little game like Driver.
Impressive! A complete scrolling game with just a few Basic lines.
V.
V.