Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
24 May, 2013, 13:50:30 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 ... 4 5 [6] 7 8 ... 13   Go Down
  Print  
Author Topic: Post your Nspire routines here! -  (Read 15457 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
bwang
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 11 August, 2012, 12:59:06
Date Registered: 20 June, 2009, 01:42:58
Posts: 632

Topic starter
Total Post Ratings: +19

View Profile
« Reply #75 on: 08 July, 2010, 04:18:40 »
0

Are you supposed to be able to use floats as arguments to the sprite routine?
No.
@apcalc: Post your modified scrollScreen().
Logged
apcalc
The Game
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 16:59:33
Date Registered: 20 March, 2010, 16:31:47
Location: 2003 UB313
Posts: 1393


Total Post Ratings: +118

View Profile
« Reply #76 on: 08 July, 2010, 05:12:42 »
0

bwang, that was the problem.  I had SCREEN_BYTES_SIZE+bytesOffset, which probably made it larger that it could handle.  Thank you so much for your help, I feel so stupid when it is a simple error like this. Smiley You might want to modify the utils.h/.c header to include functions for scrolling the screen up and down.  Here are my (hopefully working Smiley) modified versions:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

void scrollScreenDown(char* scrbuf, char* tmpbuf, int lines)
{
  int bytesOffset = 160 * lines;
  int cpysize = SCREEN_BYTES_SIZE - bytesOffset;
  memcpy(tmpbuf, scrbuf - bytesOffset, cpysize);
  memcpy(scrbuf, tmpbuf, cpysize);
  memset(scrbuf + cpysize, 0xFF, bytesOffset);
}

void scrollScreenUp(char* scrbuf, char* tmpbuf, int lines)
{
  int bytesOffset = 160 * lines;
  int cpysize = SCREEN_BYTES_SIZE - bytesOffset;
  memcpy(tmpbuf, scrbuf + bytesOffset, cpysize);
  memcpy(scrbuf, tmpbuf, cpysize);
  memset(scrbuf + cpysize, 0xFF, bytesOffset);
}

[\code]
Logged


bwang
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 11 August, 2012, 12:59:06
Date Registered: 20 June, 2009, 01:42:58
Posts: 632

Topic starter
Total Post Ratings: +19

View Profile
« Reply #77 on: 08 July, 2010, 05:26:18 »
0

Glad to hear its working Smiley
I should probably move the scroll functions to graphics.h.
Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 08:21:29
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #78 on: 08 July, 2010, 07:11:29 »
0

Glad it's working. I wish you good luck in your projects, if any (Starcraft Nspire... j/k Grin )
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #79 on: 08 July, 2010, 15:14:02 »
0

We really need some documentation for these functions. I've started on it, and will post it when I'm done.
Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #80 on: 09 July, 2010, 17:39:32 »
0

How do you convert an integer to a string? I wanted to display the score in a dialog box upon exiting my game.

Also, the documentation is almost complete for utils.h, except for fade, scrollscreen, and WAIT. What do all the arguments do in these functions?
Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Online Online

Gender: Male
Last Login: Today at 13:47:46
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #81 on: 09 July, 2010, 18:10:11 »
0

Hmm, to convert an integer to a string, don't you do sprintf(string_ptr,"%i",score)
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #82 on: 09 July, 2010, 20:48:40 »
0

Unfortunately, sprintf hasn't been written yet. There was another, simpler function, itoa, but it depends on this standard library function.
Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Online Online

Gender: Male
Last Login: Today at 13:47:46
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #83 on: 09 July, 2010, 21:07:36 »
0

I thought sprintf is part of the OS, and we are able to use it. Was I mistaken?
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
bwang
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 11 August, 2012, 12:59:06
Date Registered: 20 June, 2009, 01:42:58
Posts: 632

Topic starter
Total Post Ratings: +19

View Profile
« Reply #84 on: 09 July, 2010, 22:17:11 »
0

sprintf is part of the OS (at least it's defined in os.h).

scrollScreen() arguments:

1
2
scrollScreen(char* scrbuf, char* tmpbuf, int lines)
Scroll the screen buffer scrbuf up lines rows. tmpbuf is a temporary buffer of the same size as scrbuf used by the routine internally.
« Last Edit: 09 July, 2010, 22:20:03 by bwang » Logged
t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #85 on: 10 July, 2010, 17:53:39 »
0

I never thought of looking there for sprintf. Thanks!

Also, at least on windows, the windows and linux makeTNS binaries can coexist peacefully, and I have a hunch it will be the same on linux, though someone should confirm it.
« Last Edit: 10 July, 2010, 19:25:44 by fb39ca4 » Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

bwang
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 11 August, 2012, 12:59:06
Date Registered: 20 June, 2009, 01:42:58
Posts: 632

Topic starter
Total Post Ratings: +19

View Profile
« Reply #86 on: 23 July, 2010, 03:34:40 »
0

I updated the first post with a better graphics.h.
Logged
apcalc
The Game
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 16:59:33
Date Registered: 20 March, 2010, 16:31:47
Location: 2003 UB313
Posts: 1393


Total Post Ratings: +118

View Profile
« Reply #87 on: 23 July, 2010, 18:27:02 »
0

I found a small error in common.h.

The "?" key, named "KEY_NSPIRE_?" causes an error when compiling because of the ?.

I have attached a fixed version with this key named "KEY_NSPIRE_QUES"

* common.h (8.57 KB - downloaded 76 times.)
Logged


bwang
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 11 August, 2012, 12:59:06
Date Registered: 20 June, 2009, 01:42:58
Posts: 632

Topic starter
Total Post Ratings: +19

View Profile
« Reply #88 on: 24 July, 2010, 03:06:09 »
0

Fixed in the first post Smiley Thanks for the bugfix!
Can someone verify whether the Linux and Windows versions of the tools can coexist in the same directory? That way I can merge the two skeletons.
« Last Edit: 24 July, 2010, 03:06:57 by bwang » Logged
t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #89 on: 25 July, 2010, 20:17:44 »
0

I already said they can coexist on windows in a previous post here.
Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

Pages: 1 ... 4 5 [6] 7 8 ... 13   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.189 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.