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
Acmlm's Board - I2 Archive - - Posts by beneficii
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
User Post
beneficii

Lakitu
Level: 36

Posts: 421/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-22-05 03:11 AM, in Question about SMB3 Discombobulator Link
LOL,

"I'm so lazy I once took lessons on a player piano!"
beneficii

Lakitu
Level: 36

Posts: 422/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-22-05 09:01 AM, in Question about SMB3 Discombobulator Link
Originally posted by 123ANDREW456
Ok I did that but now it says Run-Time error 6 Over flow! How do I fix this?


What did you do?
beneficii

Lakitu
Level: 36

Posts: 423/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-22-05 07:20 PM, in another memory management issue qq Link
Originally posted by sloat
With Visual Studio, I'm pretty sure you have to run the app through the IDE. I'm not 100% sure though and I'm not sure if that applies to Bloodshed. It could also be that your breakpoint is just never reached.


I was thinking that the breakpoint was not being reached also, so I put it in the first line of the WM_CREATE of my main window (which did load), but the program still did not break execution.

I'm not entirely sure how Bloodshed does it. I read through the help file. (I think the Help file has bad formatting, too). Here is text from it:

Launching your program into the debugger is easy. Just go to the Debug menu and click on Debug (shortcut : F8).
If you do not have debugging information set in your project, Dev-C++ will ask you if you want to rebuild your program with these information enabled. You can manually select that option in Compiler Option in the Linker section. After your project has been rebuild, you can launch Debug again.


The debugger has now loaded your program and runs it. but until that you can learn to control several aspects of the debugger :

- Setting Breakpoints in your codeID_BREAKPOINT

- Stepping in your codeID_STEPDEBUG

- Displaying variables value and classes/structures membersID_DISPLAYDEBUG

- BacktracingID_BACKTRACE

- Using the CPU WindowID_CPUWINDOW

The output Dev-C++ receives from GDB is displayed in the Debug Output sheet at the bottom of Dev-C++.

This output is probably only interesting if you are familiar with GDB. You can also send commands directly to it (if you do not know GDB, you can type the help command for to have a list) by using the edit box just above the output (see screenshot below).


I'm not entirely sure what debugger information is, but I did set a breakpoint in the code and click Debug. It asked me if I wanted to compile with information and I said yes. It compiled, I then simply ran it. The breakpoint was set on the first line of the code in the body of case WM_CREATE in the WndProc's switch(msg) statement. The windows loads fine, but the program does not break. Perhaps there is somebody familiar with Bloodshed here?


(edited by beneficii on 08-22-05 12:49 PM)
beneficii

Lakitu
Level: 36

Posts: 424/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-22-05 09:50 PM, in another memory management issue qq Link
Originally posted by Kawa-oneechan
I myself required some nice debugging myself. YDimGame kept resetting to zero! So I peppered my code with printf("DEBUG: YDimGame is now %d\n", ydimgame); lines.

Eventually, I found that my game's config routines were loading the player's pant color into ydimgame


So yeah, PrintF for the win.

In VB, I just click auto-comment and remove apostrophes until it breaks, basically.


Hmm, commenting it out until it breaks actually seems to be a good idea. Thanks Kawa!
beneficii

Lakitu
Level: 36

Posts: 425/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-23-05 12:40 AM, in Ask your questions about hacking here! Link
Originally posted by Smallhacker
how do u maek smb 4 teh nes uze 3D grafix buy canging an max off 10 bytes?

...What? It IS a question about Rom Hacking.


i goto barfnad rnew graphcis fior zelda 63 howw to i chaegne them to gaem/?

LOL, this thread's so going down. When a moderator hijacks a thread, you know it's gone down the crapper.
beneficii

Lakitu
Level: 36

Posts: 426/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-23-05 12:58 AM, in another memory management issue qq Link
For me, I think that using break or goto to test your program would be easier then commenting out a bunch of your code. I actually did the goto statement (I know I know the goto statement is evil; I only am using it for testing) in a function and the problem that turned out was a flag that got set that caused another function later on to get messed up (I have a couple ideas to what it is). I thought the problem was a lot more complicated, but I'm starting to get a little confident again.

When I get home from work tonight, I'm going to set to it.
beneficii

Lakitu
Level: 36

Posts: 427/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-24-05 10:35 AM, in Regional Misconceptions Link
Tennessee:

All Tennesseans are rednecks or hillbillies: Pretty untrue. I know very few and there are actually many intellectuals here.

Tennessee is a backward state with little relevance to the national and global economies: Very untrue. FedEx is based in Memphis and Memphis Int'l Airport has more cargo go through it than any other airport in the world (including airports like Hong Kong, Tokyo, London, Dusseldorf, New York, Los Angeles, etc.). Tennessee is also a major central area.

Tennessee has little relevance to national politics: Untrue. Bill Frist, one of our senators, is the majority leader in the Senate. Lamar Alexander, our other senator, was an actor. Harold Ford, Jr., a U.S. Representative from a Memphis district, also made a attempt recently to become the House minority leader.

Tennessee is a red state: Untrue. We were red in the presidential election 2004, but our governor is Democrat and our legislature is controlled by the Democrats.

Also:

Memphis has more hospitals in it than any other city in the world. Albert Gore, Sr., (the former veep's father) rose to power in defiance of E.H. Crump, a former political boss in Memphis.
beneficii

Lakitu
Level: 36

Posts: 428/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-24-05 12:57 PM, in another memory management issue qq Link
OMG OMG OMG I just found out what was wrong with my program!

The problem was in a careless variable initialization in a class method that caused it to sometimes try to read from a NULL pointer as though it were an arrary. It's so embarrassing.

I am getting tired for playing these search around games, but thankfully they're getting less and less.
beneficii

Lakitu
Level: 36

Posts: 429/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-24-05 11:45 PM, in Personal quirks. Link
In response to the first post, I do not believe in wearing a long-sleeved shirt and shorts.
beneficii

Lakitu
Level: 36

Posts: 430/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-27-05 10:01 PM, in WM_KEYDOWN Issue Link
I have an issue when the user holds down a key for too long. When pipes are loaded in my SMB3 Map Editor, you can switch between various pipe sets with the page up and page down keys (which are read through the WM_KEYDOWN message). When you press one of them, it unloads the old pipe set and loads the new one and draws it to the screen. Unfortunately, if the user tries to go through the pipe sets by holding page up/down, then the program will freeze. My guess is that the window is receiving the keyboard input that is too fast for it to handle, and so it locks up. Is there a way of slowing down this input for the window when the user holds it down (without making the user go to the control panel to slow it down and without changing it for the whole system) or is there some other way around this?

Thanks.

UPDATE: I tried putting them under WM_KEYUP, but doing it too fast still causes it to freeze up.


(edited by beneficii on 08-27-05 01:30 PM)
(edited by beneficii on 08-27-05 01:35 PM)
beneficii

Lakitu
Level: 36

Posts: 431/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 12:06 AM, in WM_KEYDOWN Issue Link
Originally posted by Disch
the WM_KEYDOWN repeat rate is one of the user preferences set in Windows (the speed can be changed in one of the control panels), so no, you're program can't (or at least shouldn't) try to change the speed at which WM_KEYDOWN messages are sent.

The obvious solution here sounds to me like you should just not process WM_KEYDOWN messages if your program is too far behind. This could be done by doing some checks in your message pump:




MSG msg;
int ok_to_sleep;
while( program_open )
{
ok_to_sleep = 1;
while( PeekMessage( your_wnd, &msg, 0, 0, PM_REMOVE) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
ok_to_sleep = 0;
}

program_busy = 0; // queue is clear, program is no longer busy

if(ok_to_sleep)
Sleep(1);
}




Then in your ChangePipeSets function or whatever.. just do a check to see if the program is busy before continuing:




void ChangePipeSets()
{
if(program_busy) return; //abort, program is too busy

program_busy = 1; //this will make the program busy

// do the rest of the work here
}





This seems like quite a thing to implement. Is there any simpler way?
beneficii

Lakitu
Level: 36

Posts: 432/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 08:13 AM, in WM_KEYDOWN Issue Link
OK, implementing.


(edited by beneficii on 08-27-05 11:13 PM)
beneficii

Lakitu
Level: 36

Posts: 433/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 11:34 AM, in New Orleans: Meet Katrina Link
I'm surprised that no-one has had anything to say on Hurricane Katrina at all on this board. Right now, New Orleans is marked in the bullseye for this strong Category 4 hurricane. There is a nightmare worst-case scenario out, because of New Orleans being below sea level. If a very powerful hurricane hits New Orleans head-on or just to the west, the city could be turned into a poisonous lake, with dangerous creatures stuck floating in the water (such as fire ants that clump into balls in-water unclumping onto and stinging anything they touch--including humans) and poison being present because it would leak from the factories, cars, etc. in the city.

Here is the National Hurricane Service page on Hurricane Katrina:

http://www.nhc.noaa.gov/refresh/graphics_at2+shtml/060711.shtml?5day

With 90 degree SST's and precious little shear ahead of it, Katrina could be a monstrous Category 5 when it makes landfall.

It's sustained winds right now at 145 mph (about 232 kph).


(edited by beneficii on 08-28-05 02:35 AM)
(edited by beneficii on 08-28-05 02:35 AM)
(edited by beneficii on 08-28-05 02:40 AM)
beneficii

Lakitu
Level: 36

Posts: 434/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 11:44 AM, in New Orleans: Meet Katrina Link
Originally posted by Snika
Oh no! Save the Mardi Gras beads!
Stalk up on Cajun food and other sterotypes!
Evacuate to France!


The threat is real and serious:

http://americanradioworks.publicradio.org/features/wetlands/hurricane1.html

"Basically, the part of New Orleans that most Americans--most people around the world--think is New Orleans, would disappear."

Here's another article:

http://www.bestofneworleans.com/dispatch/2002-10-15/commentary.html

And another:

http://www.findarticles.com/p/articles/mi_m0BJK/is_15_11/ai_68642805

And from Louisiana State University:

http://hurricane.lsu.edu/_in_the_news/april21_advocate.htm


(edited by beneficii on 08-28-05 02:44 AM)
(edited by beneficii on 08-28-05 02:45 AM)
(edited by beneficii on 08-28-05 02:45 AM)
(edited by beneficii on 08-28-05 02:47 AM)
(edited by beneficii on 08-28-05 02:48 AM)
beneficii

Lakitu
Level: 36

Posts: 435/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 11:49 AM, in New Orleans: Meet Katrina Link
Originally posted by Snika
It would just go underwater?
Would any other states be effected?


It would be underwater, yes, and no, not really, none of the other states would go underwater. Of course they'd affected by the high winds and heavy rains of the storm.
beneficii

Lakitu
Level: 36

Posts: 436/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 11:53 AM, in New Orleans: Meet Katrina Link
Originally posted by Snika
That must suck! Isn't there anything we can do?


Not really, except try to evacuate. We can't control the weather yet (and whether that would be desirable is another matter). Unfortunately, people have been too lax in evacuating thus far; now it's sorta too late to evacuate the whole city.

One could only hope that Katrina wobbles to the east on her way there (or somehow weaken--though except for eyewall replacement cycles, which don't last long enough and never permanently cripple the storms and actually can help to strengthen them after they're done, this doesn't seem very likely at all), because if she makes landfall east of New Orleans, the city would not be affected nearly as much by storm surge.



http://en.wikipedia.org/wiki/Eyewall_replacement_cycle


(edited by beneficii on 08-28-05 02:54 AM)
(edited by beneficii on 08-28-05 02:55 AM)
(edited by beneficii on 08-28-05 02:55 AM)
beneficii

Lakitu
Level: 36

Posts: 437/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 12:01 PM, in New Orleans: Meet Katrina Link
Originally posted by Snika
I'll alert the president!


Well, he's already declared a state of emergency for the state:

http://www.miami.com/mld/miamiherald/news/12494800.htm
beneficii

Lakitu
Level: 36

Posts: 438/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 12:06 PM, in New Orleans: Meet Katrina Link
Originally posted by Snika
Oh, thats a good thing that the president declared a state of emergency.
It cracks me up that he was vacationing when he got the memo.


Well, I'm just not sure what the difference would be if he declared it now or declared after the storm hit, except to prepeare the rescuers.

Some estimates of the death toll I've seen run into the thousands....


(edited by beneficii on 08-28-05 03:06 AM)
beneficii

Lakitu
Level: 36

Posts: 439/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 01:25 PM, in New Orleans: Meet Katrina Link
Originally posted by Bella
New Orleans sinking? doesn't seem very likely

I didn't even know there was a hurricane heading there until this morning since I haven't really checked the news when I log on.


It is quite unbelievable, isn't it? Nevertheless, there is scientific justification for it being likely. First, the swamps that normally would protect New Orleans from storm surges are being largely cleared away, making New Orleans more vulnerable. New Orleans is below sea level surrounded by three bodies of water: Lake Pontchartrain, the Mississippi River, and the Gulf of Mexico. Now, from what I understand, there are concerete walls place on these bodies of water to protect them from overflowing. Nevertheless, a poweful hurricane could put this arrangement under stress; if it hits New Orleans head-on or just to the west, then the onshore winds could cause storm surges of greater than 10 feet to spill over those walls. The strong winds could also cause damage to the walls allowing water to come pouring out undaunted and into the city. Heavy rains (and Katrina is moving somewhat slowly) could also cause the water to overflow. New Orleans could end up being underneath more than 20 feet of water, which I would define as being sunk. Please read the articles I posted for a better description of the possible situation.

Of course, there are factors the scientists may be missing, and hopefully Katrina veers to the east where there wouldn't be onshore winds but offshore ones (reducing the storm surges to virtually 0). I personally hope that either or both of these factors are true, because that would save thousands of lives.

EDIT: Here's an article on storm surge:

http://en.wikipedia.org/wiki/Storm_surge

EDIT 2: Here's a link to a map describing what could happen in New Orleans:

http://www5.wright-weather.com/bb/attachment.php?s=&postid=452136

Since it's a big picture, I linked to it instead of displaying it here.


(edited by beneficii on 08-28-05 04:30 AM)
(edited by beneficii on 08-28-05 04:33 AM)
(edited by beneficii on 08-28-05 04:44 AM)
(edited by beneficii on 08-28-05 05:08 AM)
beneficii

Lakitu
Level: 36

Posts: 440/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 08-28-05 03:02 PM, in Delete a byte. Link
Originally posted by HyperHacker
Presumably a really simple question, but I can't seem to find an answer. How can I delete a byte from the middle of a file (in Binary mode, in C)?


My solution would be to store the file size in memory (like an int variable), load the file into memory, starting at the byte after the byte you're trying to delete shift every byte one byte left, decrement the file size, and then save the file.

EDIT: Here's some code that probably does what you are describing. It's untested, but I think that it probably works:


#include <malloc.h>
#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>

int deletebyte(const char *filename, int address) {
int size, handle, *data;
FILE *nfo;

handle = open(filename, O_RDONLY); /* getting file size */
size = filelength(handle);
close(handle);

data = malloc(sizeof(int) * size); /* creating data space in memory to store file*/

nfo = fopen(filename, "rb"); /* loading the file */
for(int i = 0; i < size; i++)
data[i] = fgetc(nfo);
fclose(nfo);

for(int i = address + 1; i < size; i++) /* starting at the byte following the specified address */
data[i - 1] = data[i]; /* shifting each byte left */

size--; /* decrementing the size */

nfo = fopen(filename, "wb"); /* reopening the file to write to it */
for(int i = 0; i < size; i++) /* writing to it */
fputc(data[i], nfo);
fclose(nfo);

/* now that we did it, it's time to return our value and free our dynamically allocated array */

free(data);

return size; /* returning our new file size */
}

/* if you want to use this function call it: the first parameter is the file name and the second parameter is the address that you want to delete; the function returns an int, the new filesize of the file. */


(edited by beneficii on 08-28-05 06:18 AM)
(edited by beneficii on 08-28-05 06:19 AM)
(edited by beneficii on 08-28-05 06:20 AM)
(edited by beneficii on 08-28-05 06:21 AM)
(edited by beneficii on 08-28-05 06:44 AM)
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Acmlm's Board - I2 Archive - - Posts by beneficii


ABII


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



Page rendered in 0.009 seconds.