Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - Need VB help
  
User name:
Password:
Reply:
 

UserPost
Dish
Posts: 122/596
Originally posted by interdpth
I can still get help here if I dont understand somethings right?


Yah. In fact... I might as well print my previously mentioned code example just in case it might be useful ^^. It's in C, but you -should- be able to apply it (in some form) to VB... although I understand VB lacks some bitwise operators which really help =\. Anyway, something of this sort is what I've found to be the fastest/simplest method to decode NES 2bpp:


int j;
int pixel[8][8];
BYTE a;
BYTE b;
for(j = 0; j < 8; j++)
{
a = ROM[ offset + j ];
b = ROM[ offset + j + 8 ];
pixel[j][0] = ((a >> 7) & 1) | ((b >> 6) & 2);
pixel[j][1] = ((a >> 6) & 1) | ((b >> 5) & 2);
pixel[j][2] = ((a >> 5) & 1) | ((b >> 4) & 2);
pixel[j][3] = ((a >> 4) & 1) | ((b >> 3) & 2);
pixel[j][4] = ((a >> 3) & 1) | ((b >> 2) & 2);
pixel[j][5] = ((a >> 2) & 1) | ((b >> 1) & 2);
pixel[j][6] = ((a >> 1) & 1) | ((b >> 0) & 2);
pixel[j][7] = ((a >> 0) & 1) | ((b << 1) & 2);
}


After that, each byte in the 'pixel' array will be filled with a value from 0 to 3 representing the color of the pixel in the 8x8 image. The array is in [y][x] form, so [0][7] would be the upper right pixel and [7][0] would be the lower left.
Gavin
Posts: 155/799
and if you're going with FP's VB class by chance, i created a small tile editing example a long while ago:


http://gavin.panicus.org/downloads/NesTEE.rar

basically all you have to do with any tile editing/manipulation is alter the array that keeps the tiles, and have the dll/class update them on mouse movement and button presses.
interdpth
Posts: 238/527
I can still get help here if I dont understand somethings right?
Dish
Posts: 121/596
While looking for a link to a doc which explains the format (of which I was going to add to by supplying some of my own C code to sort of show how to apply it), I came across this link:

http://www.zophar.net/tech/files/vbgfxripping.zip

from this page:

http://www.zophar.net/tech/transdocs.html


The description says "This is a guide by The_Fake_God on how to read graphics from roms with Visual Basic.". I haven't checked it out yet but it seems to be exactly what you're looking for =P
interdpth
Posts: 235/527
Well Actually I wanna know how to decode the graphics then put them into a Picture box or something then be able to maniputlate them do you know what I mean now?
Gavin
Posts: 154/799
well, i think you've got it a tad mixed up. BitBlt is not used to decode or manipulate actual images in the way you're thinking. BitBlt is a fast processing for displaying and painting images.

if you're looking to decode NES/SNES graphics you will have to either code your own stuff, or use an existing dll/class file. TFG has NES and i beleive SNES graphics displaying DLL's. And FrendiedPanda created an NES tile Class in VB. FP's class can be found on my website: http://gavin.panicus.org/ and TFG's can be found on his website: http://tfg.panicus.org/. both are under the 'programming' sections.
interdpth
Posts: 234/527
Is there anyone that can teach me how to use bitblt to manipulate and decode graphics from a ROM real time? Tutorials don' t help me much and I can't find a decent commented amount code. Can anyone help?
Acmlm's Board - I2 Archive - Programming - Need VB help


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.010 seconds.