CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 95 users online: 3 members, 72 guests and 20 bots.
Members: critor, legodude.
Bots: VoilaBot (1), Baidu (1), Spinn3r (1), Magpie Crawler (3), Googlebot (13), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
Author Message
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55733
Location: Earth, Sol, Milky Way

Posted: 12 Apr 2012 11:16:07 am    Post subject:

zeldaking wrote:
KermMartian wrote:
Ask us if you need help; you're probably either using the sprite routines wrong or not properly erasing the sprite when a mouse movement event is occurring.

It was doing that before I added the movement code. :/
And does it always do it? I mean, what does it do exactly? Are you using the masked sprite routine or the non-masking overwriting one?
_________________


Back to top
zeldaking


Power User


Joined: 31 Jul 2011
Posts: 469
Location: Utah

Posted: 13 Apr 2012 09:53:39 am    Post subject:

Well, since I had to delete my 90-day trial emulator, I can't get a screenshot. So I will try to explain it. My sprite is pretty much the same as the DCS arrow, except more pixels, I have 4 grays in the sprite so I ran it through source coder and it gave me my data. In my program I call "CopySprite( curX, curY, 16, 16)" becuase my sprite is 16x16 pixels. After compiling and running it, what shows up on the screen is this: No color, just black and white sprite. Two of my sprites side to side. To top it off it drew a black box, 32x16 pixels right underneath both arrow sprites. The code is right... maybe.
Back to top
PierrotLL


Advanced Newbie


Joined: 29 Nov 2011
Posts: 71
Location: France

Posted: 13 Apr 2012 04:19:08 pm    Post subject:

About the emulator, you can install it on a virtual machin.

For the arrow, the problem could be in the sprite data, or in the sprite function. Verify first if data are correct.
_________________
My fx-9860G & Prizm games
My fx-9860G graphic library, MonochromeLib
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55733
Location: Earth, Sol, Milky Way

Posted: 14 Apr 2012 03:12:11 pm    Post subject:

You can also use the Screen Receiver application to take screenshots. It sounds to me as if you've mismatched the 8-bit and 16-bit sprites and routines, personally. Smile
_________________


Back to top
zeldaking


Power User


Joined: 31 Jul 2011
Posts: 469
Location: Utah

Posted: 15 Apr 2012 10:38:18 pm    Post subject:

I wasn't aware there was any differences in the 16-bit and 8-bit routines. Mind to fill me in?
Pierrot: Virtual machine?
Back to top
Ashbad


... I think redheaded girls are kind of cool


Joined: 01 Dec 2010
Posts: 2417
Location: Stomp Stomp Stomp, The Idiot Convention

Posted: 16 Apr 2012 06:04:49 am    Post subject:

zeldaking wrote:
I wasn't aware there was any differences in the 16-bit and 8-bit routines. Mind to fill me in?
Pierrot: Virtual machine?


8bit versus 16bit routines: 16bit routines take raw pixel data in RGB:5-6-5 format and simply draw them. 8bit routines use a palette of 256 colors, and sprite data made up of 8 bit values that correspond to colors in the palette.

As for a virtual machine, you can run another instance of Windows in a program such as VirtualBox and install it into that; the Prizm Emulation software will think you installed it on a whole new machine.
_________________
-Ashbad
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55733
Location: Earth, Sol, Milky Way

Posted: 16 Apr 2012 08:41:06 am    Post subject:

zeldaking wrote:
I wasn't aware there was any differences in the 16-bit and 8-bit routines. Mind to fill me in?
Pierrot: Virtual machine?
The 16-bit sprites and routines hold 16 bits of data per pixel, arranged as 5-6-5: 5 bits of red, 6 bits of green, 5 bits of blue. The 8-bit sprites and routines, on the other hand, work with 8 bits of data per pixel, as 3-3-2. The 8-bit sprites take up half the memory of the 16-bit sprites for a sprite of the same pixel dimensions, but can be made only of 1/256th the possible colors of the 16-bit versions.
_________________


Back to top
zeldaking


Power User


Joined: 31 Jul 2011
Posts: 469
Location: Utah

Posted: 16 Apr 2012 01:00:55 pm    Post subject:

Yeah I understand that, but what is the difference in the routines?
Back to top
zeldaking


Power User


Joined: 31 Jul 2011
Posts: 469
Location: Utah

Posted: 22 Apr 2012 06:42:17 pm    Post subject:

*Bump question

Code:

#include <color.h>
#include <display.h>
#include <display_syscalls.h>
#include <keyboard.hpp>
#include <string.h>
#include <keyboard_syscalls.h>
#include <system.h>
#include <stdlib.h>
#include <stdio.h>
#include "data.h"

#define true 1
#define LCD_WIDTH_PX 384 
#define LCD_HEIGHT_PX 216

void CopySprite(const void* data, int x, int y, int width, int height);
int keydownlast(int basic_keycode);
int curX=10;
int curY=10;

int main() {
   CopySprite(cursor, curX, curY, 16, 16);
   int key;
   while(true) {
      GetKey(&key);
      if (keydownlast(KEY_PRGM_UP) && curY > 8) {
         curY = curY-1;
         CopySprite(cursor, curX, curY, 16, 16);
         } else if (keydownlast(KEY_PRGM_DOWN) && curY < 160) {
         curY = curY+1;
         CopySprite(cursor, curX, curY, 16, 16);
      }

   Bdisp_PutDisp_DD();
}
return 0;
}
void CopySprite(const void* datar, int x, int y, int width, int height) {
   color_t*data = (color_t*) datar;
   color_t* VRAM = (color_t*)0xA8000000;
   VRAM += LCD_WIDTH_PX*y + x;
   for(int j=y; j<y+height; j++) {
      for(int i=x; i<x+width; i++) {
         *(VRAM++) = *(data++);
     }
     VRAM += LCD_WIDTH_PX-width;
   }
}
int keydownlast(int basic_keycode) {
   int row, col, word, bit;
   row = basic_keycode%10;
   col = basic_keycode/10-1;
   word = row>>1;
   bit = col + 8*(row&1);
   return (0 != (lastkey[word] & 1<<bit));
}

That is my code so far. Just very primitive cursor movements. But when I try to compile I get this:

Code:


C:\PrizmSDK-0.3\projects\Paint>..\..\bin\make.exe clean
rm -f -fr build C:/PrizmSDK-0.3/projects/Paint/Paint.bin C:/PrizmSDK-0.3/project
s/Paint/Paint.g3a

C:\PrizmSDK-0.3\projects\Paint>..\..\bin\make.exe
sh3eb-elf-gcc -MMD -MP -MF C:/PrizmSDK-0.3/projects/Paint/build/Paint.d -Os -Wal
l -std=c99 -mb -m4a-nofpu -mhitachi -nostdlib   -IC:/PrizmSDK-0.3/projects/Paint
/build -IC:/PrizmSDK-0.3/include -c C:/PrizmSDK-0.3/projects/Paint/src/Paint.c -
o Paint.o
C:/PrizmSDK-0.3/projects/Paint/src/Paint.c: In function 'keydownlast':
C:/PrizmSDK-0.3/projects/Paint/src/Paint.c:55:18: error: 'lastkey' undeclared (f
irst use in this function)
C:/PrizmSDK-0.3/projects/Paint/src/Paint.c:55:18: note: each undeclared identifi
er is reported only once for each function it appears in
C:/PrizmSDK-0.3/projects/Paint/src/Paint.c:50:18: warning: variable 'word' set b
ut not used [-Wunused-but-set-variable]
C:/PrizmSDK-0.3/projects/Paint/src/Paint.c:56:1: warning: control reaches end of
 non-void function [-Wreturn-type]
make[1]: *** [Paint.o] Error 1
make: *** [build] Error 2

C:\PrizmSDK-0.3\projects\Paint>pause
Press any key to continue . . .

I know I sound very dumb, but what is wrong? :/
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55733
Location: Earth, Sol, Milky Way

Posted: 22 Apr 2012 06:43:51 pm    Post subject:

Debugging compilation errors:

1) Find things that say "error". Fix them.
2) Find things that say "warning". Fix them.

For example, the thing to deal with first is this:

Code:
C:/PrizmSDK-0.3/projects/Paint/src/Paint.c:55:18: error: 'lastkey' undeclared (f
irst use in this function)
You didn't declare lastkey. Change int key; to int key,lastkey;, or add an int lastkey; somewhere in main().
_________________


Back to top
zeldaking


Power User


Joined: 31 Jul 2011
Posts: 469
Location: Utah

Posted: 26 Apr 2012 11:23:18 am    Post subject:

I have it figured out. It now has a moveable cursor.
Concern:
Before I used Getkey(&key); to quit when pushing menu it wouldn't quit, obviously. Now when I added that in you can quit by pushing menu, but the screen has the battery satus image and the line across the top. How do I get rid of that.
Also I need to re-xor my sprites so when I move it doesn't leave a trail. How would I do that? Thanks
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2, 3, 4
» View previous topic :: View next topic  
Page 4 of 4 » All times are GMT - 5 Hours

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.030874 seconds.