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 Cellar Dweller
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User Post
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 243/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 08-31-05 03:43 PM, in PHP Function Needed Link
like this? :
/* exp2level -- Given an exp value, return the level */

function exp2level($exp)
{
$alevels=array(1 -> 1000, 1000, 3000, 6000, 10000, 15000, 21000, 28000, 36000, 45000,
55000, 66000, 78000, 91000, 105000, 120000, 136000, 153000, 171000, 190000);
$record = 1;
for($i=$record, $i<=20, $i++) {
if ($exp >= $alevels[$i]) {
$record=$i;
} else {
return $record;
}
}
return $record;
}


or like this? :
/* levelup -- Given a level value and an exp value, return true if the exp is for a higher level, else return false. */

function levelup($level, $exp)
{
$alevels=array(1 -> 1000, 1000, 3000, 6000, 10000, 15000, 21000, 28000, 36000, 45000,
55000, 66000, 78000, 91000, 105000, 120000, 136000, 153000, 171000, 190000);
$record = $level;
for($i=$record, $i<=20, $i++) {
if ($exp >= $alevels[$i]) {
$record=$i;
} else {
return ($record>$level);
}
}
return ($record>$level);
}
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 244/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-08-05 12:27 PM, in Mario 64 - Amazing Stuff Link
This may need some more verification, but I think that I have found the location of a copy of the segment table in a savestate. Using a PJ64 format savestate the location is 0x33bb60 in the savestate(subtract 0x75c to get 0x33b404 in RAM). The 7th 32 bit word points to the current level data. The decompression locations for the MIO0 files seem to be dynamic.

It is posible that this may not be the master copy of the segment table.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 245/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-08-05 04:29 PM, in AcmlmBoard And EasyPHP - Undefined Vars And Constants (Long) Link
Try looking for php.ini and adjusting the error_reporting option. Disabling E_NOTICE errors should make the messages stop.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 246/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-08-05 09:46 PM, in AcmlmBoard And EasyPHP - Undefined Vars And Constants (Long) Link
The default setting is "E_ALL & ~E_NOTICE". You can set it to that, or you can just delete or comment out the line.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 247/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-09-05 05:53 AM, in AcmlmBoard And EasyPHP - Undefined Vars And Constants (Long) Link
You may need to restart Apache to get the configuration file reloaded if EasyPHP uses the PHP Apache module.

The notice errors are to warn about possible misspelled variable names or bad coding style. In the case of AcmlmBoard the reason those errors appear is that AcmlmBoard is designed to use register_gloabals, and that appears to the PHP interpreter as the use of undefined variables. Also, AcmlmBoard uses unquoted strings(barewords) as array subscripts, which is considered bad style and my not work in future versions of PHP.

EDIT: neotransotaku: AcmlmBoard detects if register_globals is off and emulates register_globals if needed.


(edited by Cellar Dweller on 09-08-05 08:59 PM)
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 248/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-14-05 08:54 AM, in SetBitmapDimensionEx Link
I think that bitmaps can have dimensions in real world units independent of the size in pixels. This function, in effect, sets the conversion between pixels and .01mm units for the specified bitmap.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 249/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-18-05 03:26 PM, in Shopping for parts for a new computer Link
The following list is what I have picked out so far(all from TigerDirect). I plan on using GNU/Linux(most likely Debian) as my primary, if not only, OS. Can anyone tell me if any of the following products/brands have a bad reputation or are known to work poorly with Linux? Suggestions for changes are welcome, but payment via snail mail must be available.

A458-2102 :: Abit AV8 VIA Socket 939 ATX Motherboard / AGP 8X/4X / Audio / Gigabit LAN / USB 2.0 / Firewire / Serial ATA / RAID
$109.99

CP1-A64-4200 E :: AMD Athlon 64 X2 4200+ / 1MB Cache / 2000MHz FSB / Socket 939 / Dual-Core / Processor with Fan
$499.99

B452-1124 :: Just4PC 747 ATX Mid Tower Computer Case with Front USB and 425Watt Power Supply - Black
$39.99

TC1-6000 BL :: 1.44MB Floppy Disk Drive (Black)
$19.99

TSD-200M2 :: Maxtor / 200GB / 7200 / 8MB / SATA-150 / OEM / Hard Drive with NCQ
$109.99

P56-3912 :: PNY 1024MB PC3200 DDR 400MHz Memory
$124.99 * 2 = $249.98

P450-8536 :: XFX GeForce FX 5500 / 256MB DDR / AGP 8X / VGA / DVI / TV Out / Video Card
$59.99
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 250/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-19-05 01:01 AM, in Blocking view from guests Link
You could place the message in layout.php, and then set a variable in register.php and login.php that disables it.

function.php could set the variable to the value that indicates that the message should be displyed, to prevent bypassing the restriction by a guest setting the variable from the client. For the pages that don't need the message, set the variable in between the require statements for function.php and layout.php to the value that indiactes the that the message is not needed.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 251/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-22-05 02:39 PM, in Any tips for a Linux n00b? Link
I know that Debian, and many other distros, can be installed over the Internet that way.

I strongly urge against downloading whole CD images in favor of a network install. I have installed and upgraded Debian several times over a dialup connection, something that would not have been feasible with CD images, and should be easy on any broadband connection.


gzip -dv file
tar -xvf file


Why not just "tar -xvzf file"?
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 252/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-24-05 10:37 AM, in Shopping for parts for a new computer Link
Yiffy Kitten: I may end up getting a PCIe motherboard and a better video card. So far I have avoided any games with demanding hardware requirements because I did not have the hardware to run them. I also did not have them for the same reason that I didn\\\'t have the hardware to run them.(hint: the computer I am replacing was a discard from a school)

What is better about an nForce chipset? I know that nVidia provides binary drivers for the nForce on board devices, but the Via on board devices are already supported by the kernel.

I did intend to get a lot of RAM and CPU power from the start. To poke a hole in your logic, but not necessarily your conclusion, there are a lot of things that can really load a CPU and RAM but do not require much of the video hardware.

HyperHacker: What was painful about it? I doubt that local stores will have the selection of an online/mail order source.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 253/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-24-05 11:20 AM, in Shopping for parts for a new computer Link
ww: Back when the first Athlons were around I heard that they would overheat and destroy themselves if ran without a fan or if the heat sink got cloged up with dust. I\'ll make sure that the heat sink and fan are properly installed.

HH: I think that was temporary. A short while back I was shopping around their site and stuff was being put on notice of being removed. The selection seems to be stable now.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 254/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-24-05 12:24 PM, in 0 == -1 Link
Have you created multiple threads? Could another thread be calling ProcessMessages?

Why not just have a standard message loop and have windows gain access to their own data by using GetProp? When calling CreateWindow you can use the last parameter to communicate to the message procedure what data it should use, and save data with SetProp while handling WM_CREATE. You can cast a pointer(eg a pointer to the correct WindowInfo entry) or in integer(eg index into WindowInfo) to a HANDLE to store it with SetProp.

See the docs for CreateWindow, GetProp, SetProp, RemoveProp, and WM_CREATE for more info about my suggestion.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 255/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-24-05 02:29 PM, in 0 == -1 Link
Originally posted by HyperHacker
I only have one thread, but Windows calls the message handlers from a different thread.

MSDN seems to be missing their page on SetProp.


The only thing that I can think of, assuming that there are no other functions that set the variable, is that ProcessMessages is being reentered before it is finished by being called form within a window procedure. If you have some way to print two different messages, one at the start and one at the end of ProcessMessages, you could check to see if that is the case.(wait, this can\\\'t be because CurrentWindow would equal NumWindows when DispatchMessage returns from a guilty window procedure)

Is there is an assignment operator used where an equality operator was intended?

SetProp info
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 256/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-25-05 09:05 AM, in Mario 64 - Amazing Stuff Link
I have confirmed, by decompiling some functions, that 0x8033b400 is the start of the segment table as used by the game program.

Here are some more decompiled functions. I hope to find a function that processes level data.


28 posts!


EDIT: This just in: MUHHHHAHAHAHAHAHA!
80340a78: 27 bd ff e8  ADDIU sp, sp, 0xffffffe8 (-24)
80340a7c: af bf 00 14 SW ra, sp, 0x14 (20)

80340a80: 3c 0e 80 39 LUI t6, 0x8039
80340a84: 8d ce be 28 LW t6, t6, 0xffffbe28
80340a88: 85 c4 00 02 LH a0, t6, 0x2 (2)
80340a8c: 8d c5 00 04 LW a1, t6, 0x4 (4)
80340a90: 0c 09 e1 f6 JAL 0x802787d8 0x802787d8(*((short *)(*(0x8038be28)+2)), *(*(0x8038be28)+4), *(*(0x8038be28)+8));
80340a94: 8d c6 00 08 LW a2, t6, 0x8 (8)

80340a98: 3c 0f 80 39 LUI t7, 0x8039
80340a9c: 8d ef be 28 LW t7, t7, 0xffffbe28 t7 = *(0x8038be28)
80340aa0: 3c 01 80 39 LUI at, 0x8039
80340aa4: 91 f8 00 01 LBU t8, t7, 0x1 t8 = *(char)(*(0x8038be28) + 1)
80340aa8: 01 f8 c8 21 ADDU t9, t7, t8 t9 = *(0x8038be28) + *(char)(*(0x8038be28) + 1)
80340aac: ac 39 be 28 SW t9, at, 0xffffbe28 *(0x8038be28) = *(0x8038be28) + *(char)(*(0x8038be28) + 1)

80340ab0: 10 00 00 01 BEQ r0, r0, 0x80340ab4 (pc+0x4)
80340ab4: 00 00 00 00 NOP
80340ab8: 8f bf 00 14 LW ra, sp, 0x14 (20)
80340abc: 27 bd 00 18 ADDIU sp, sp, 0x18 (24)
80340ac0: 03 e0 00 08 JR ra
80340ac4: 00 00 00 00 NOP



struct mysterystruct {
char a;
char b; /* a displacement relative to the start of this struct */
short c; /* a segment */
long d; /* a start */
long e; /* an end */
};

struct mysterystruct *mystery_global_pointer;


void 0x80340a78()
{
0x802787d8(mystery_global_pointer->c, mystery_global_pointer->d, mystery_global_pointer->e);
mystery_global_pointer = (struct mysterystruct *)(((void *)mystery_global_pointer) + mystery_global_pointer->b);
}




(edited by Cellar Dweller on 09-25-05 02:49 AM)
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 257/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-26-05 01:54 AM, in Mario 64 - Amazing Stuff Link

struct mysterystruct {
char a;
char b; /* a displacement relative to the start of this struct */
short c; /* a segment */
long d; /* a start */
long e; /* an end */
};


This has the format of the 0x18 command. What is odd about this function is that it uses the "LH" instruction to load the segment number, which suggests that SM64 uses 16 bits for a segment value. The RSP microcode only supports 4 bits for 16 segments, so a byte would have been enough to store it.


struct mysterystruct *mystery_global_pointer;


This seems to be the working pointer of the level loader. Note below that it is increased by the value of the second byte in the struct.


void 0x80340a78()
{
0x802787d8(mystery_global_pointer->c, mystery_global_pointer->d, mystery_global_pointer->e);
mystery_global_pointer = (struct mysterystruct *)(((void *)mystery_global_pointer) + mystery_global_pointer->b);
}


The 0x802787d8 function seems to allocate a block of memory, decompesses a MIO0 block into it, and save the pointer to the decompressed data in the segment table. See the text file I linked to for more info. The second line of this function increases the pointer as described above.

This function is very likely part of the level loader.

As for being "optimized for speed and space", many of the functions that I have looked at seem to have been compiled by simple compiler, or one with optimizations turned off. There are may places where delay slots could have been taken better advantage of, instructions could have been omited, or instructions reorderd to minimize pipeline stalls.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 258/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-26-05 07:25 AM, in Mario 64 - Amazing Stuff Link
The N64 CPU is based on the CPUs SGI created for their workstations and has the same instruction set. The devkit that SGI created for Nintendo probably used the same compiler that SGI provided with their IRIX operating system. What I think is more likely is that Nintendo turned off optimizations while developing SM64 because the optimizations created N64 specific bugs.

Another possibility is that the compiler lacked optimization capabilities. Creating a good compiler is hard work, and even good compilers have weaknesses.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 259/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-26-05 02:22 PM, in Screenshots of new GUI for SMW Dev Env Link
I don't think that it is necessary to have a plugin system to allow development to go smoothly. If some thought is placed into how the program is structured and manages it data, then it should not be difficult to keep features from stepping on each others toes. A few strategies that may help are to use the fewest possible number of global variables, use object oriented techniques, and use a model-view-controller architecture. A good project leader would encourage people to submit good code, and reject bad code from entering the main code base. Also, once the project gains steam, it would be a good idea to use a system, like CVS, that allows every change to the code base to be versioned and logged, allowing faster turnaround without losing control.

There are advantages to having the features in the main code base. For example, if a major change is made to the core of the program, all of the features could be in the same place and could be updated along with the core. If a plugin system is used, the interface to the other features would be frozen, and a choice between creating kludges to keep the interfaces stable and dropping support for the plugins would need to be made.

(Ugh. This post could be better written, I think.)
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 260/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-27-05 01:34 PM, in Mario 64 - Amazing Stuff Link
I figured out that it was a function that processed 0x18 commands by decompiling it and by looking at what it did. It calls another function that I had previously decompiled and found out that it loads data from the ROM into RAM and decompresses it. I have not found the main level loading function, but I will be looking for it.

I suggest calling them "segments" because that is what SGI and Nintendo call them. The table of segment base pointers is in a fixed place, but the memory for the decompressed MIO0 files is dynamic. I found the table by searching a savestate for a copy of a decompressed MIO0 file, translating the savestate offset into a RAM address(that was the hard part), and scanning for a copy the pointer. The RSP has its own segment table, and the base pointers must be loaded into it using the graphics command I posted the format of in a previous post(we don't need to to this to edit the level; the game code does it using this table).

One thing that I should point out is that the game code works with virtual address and the hardware and RSP microcode use physical addresses. The N64 CPU and Ultralib support complex virtual memory layouts. SM64 does not use the complex memory management features available, but instead has a simple relationship between physical and virtual addresses. The virtual addresses have the high bit set and the physical addresses have the high bit clear. Virtual and physical addresses are otherwise identical.

EDIT: $%^&$#&^ !!!!
I just found out that not all of the game code is loaded into RAM using the same difference between RAM and ROM addresses. So far, to find the address in RAM of a function found in the ROM I added 0x80245000 to the ROM offset, but this will not work for all code. The loading functions and the table with their addresses has a RAM-ROM difference of 0x80283280.

The jump table is at 0x8038b8b8 in RAM and 0x108638 in ROM.

The last function I posted has the wrong RAM address.


(edited by Cellar Dweller on 09-27-05 06:17 AM)
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 261/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-28-05 01:55 PM, in Mario 64 - Amazing Stuff Link
The jump table I mentioned points to the functions that process the level commands. For example, the 0x18th entry points to the function that processes the command to load a compressed file.

I don't think that expanding MIO0 files will be a problem unless they get so big that all of the MIO0 files required by a level will fail to fit into memory. Dynamic memory means that the game code will allocate memory on an as needeed basis, and level data may be placed in different places each time a level is loaded.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 262/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 09-30-05 12:50 PM, in Mario 64 - Amazing Stuff Link
I have already disassembled the the function that handles the 0x36 command, and have started trying to figure out how it works. You can see what I have so far at http://s91407720.onlinehome.us/acmlmboard_files/romhacking/sm64/proc80380300_set_music_prelim.txt. The top half is the disassembly with decompilation notes on the right side. The bottom half is where I am trying to get an accurate decompilition.

Here are a few links that may help with understanding how the music system may work:
http://www.halleyscometsoftware.com/mboard/forum.php?showthread=881
http://www.halleyscometsoftware.com/mboard/forum.php?showthread=776

If anyone wants a copy of the disassembler I'm using, I can post a current copy in the commons. I have already posted an older version there, but I have fixed some bugs and added features in my current version. It is a simple command line tool.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Acmlm's Board - I2 Archive - - Posts by Cellar Dweller


ABII


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



Page rendered in 0.018 seconds.