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
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - mario land 2 level data | |
Pages: 1 2Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
The Kins

Kodondo
Level: 38

Posts: 547/595
EXP: 354733
For next: 15714

Since: 03-15-04
From: Melbourne, VIC, Australia

Since last post: 2 days
Last activity: 9 hours
Posted on 08-02-05 09:55 AM Link | Quote
That's pretty ace Coolman. If you want I can send you the two different US versions (1.0 and 1.2) for proper compadibility.

I look forward to making a SML2 hack.
Coolman

Goomba
Level: 10

Posts: 11/32
EXP: 3753
For next: 661

Since: 08-29-04
From:
Germany
FWB

Since last post: 5 days
Last activity: 21 hours
Posted on 08-03-05 04:03 PM Link | Quote
Has somebody already found the enemey data?
I've found the basics about the sprite engine but don't know how it works in detail...
stag019

Snifit
Level: 23

Posts: 232/299
EXP: 62259
For next: 5464

Since: 06-10-05
From: C:\Documents and Settings\stag019\Desktop

Since last post: 9 days
Last activity: 7 hours
Posted on 08-04-05 12:46 AM Link | Quote
Originally posted by Coolman
Has somebody already found the enemey data?
I've found the basics about the sprite engine but don't know how it works in detail...
We've been working on this for a while with no luck. I'll keep looking. Anybody else?
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 6276/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 08-04-05 04:59 AM Link | Quote
I suppose I can take a peek at the sprite code tomorrow or possibly Friday with my "31337 G4M3B0Y A5M 5K1LLZ". I'm seeding a torrent right now, though, so there's no way I'd get the debugger to run at any reasonable speed.


(edited by The Crimson Chin on 08-03-05 07:59 PM)
midget35

Paragoomba
Level: 13

Posts: 49/70
EXP: 8877
For next: 1390

Since: 03-17-05

Since last post: 3 days
Last activity: 14 hours
Posted on 08-04-05 05:19 PM Link | Quote
Don't know what to tell you. I'm using corrupters, cheat searches... everything I can think of to find enemy data.

I'm going through the hex at an almost value-by-value level at the moment.

Will keep looking.
Coolman

Goomba
Level: 10

Posts: 13/32
EXP: 3753
For next: 661

Since: 08-29-04
From:
Germany
FWB

Since last post: 5 days
Last activity: 21 hours
Posted on 08-04-05 05:44 PM Link | Quote
I've made a litte public pre alpha version.

You can download it here:
Download

But attention:
This version is only for testing and presentation purpose.


(edited by Coolman on 08-04-05 08:45 AM)
(edited by Coolman on 08-07-05 02:02 PM)
Someguy

Buzzy Beetle
It seems as though the girl you've fallen for is also a pyromaniac.
Level: 32

Posts: 360/397
EXP: 193329
For next: 13113

Since: 03-15-04
From: I'm proud to be an American... I think...

Since last post: 1 day
Last activity: 5 hours
Posted on 08-04-05 11:46 PM Link | Quote
Wow, looking at the levels with this shows how big each level is for a GB game, and it's all one single level and not multiple smaller rooms...

A quick note that I found out that I've been telling some, Super Mario Land 2 somehow contains the entire credits from Metroid II inside the rom! They do share several people, including the Producer and some programmers and all, so it's possible they share formats for other things, being that the credits are both in ascii and are simular enough to copy and paste each credits line.
midget35

Paragoomba
Level: 13

Posts: 50/70
EXP: 8877
For next: 1390

Since: 03-17-05

Since last post: 3 days
Last activity: 14 hours
Posted on 08-05-05 04:18 AM Link | Quote
Hi Stag, Hi Coolman.

That front-end looks sweet! I'm very impressed!

I've been bed-bound w/ Tonsillitis the last few days, so progress has come to a hault. I don't seem to be getting better in a hurry so I thought I'd post the very small info I have on enemy data in the meantime ...


By changing the values of some hex, some enemies are added/removed. Examples (all l1):

$8C3A (Removed- Goomba, after star)

$8C7E (Added- Koopa, just after star)

$8C83 (Removed- Flying Goomba)

$8C84 (I forget, possibly Koopa removed just after star)

just change the value slightly and the change should take effect (normally just by +/- 1 or 2).

Strange thing is though- I don't think this is the enemy location data .

There seems to be no rhyme or reason in any of the values at the addresses I listed above, or any significance in changing the values immediately around them.

More-over- removing an enemy in l1 sometimes removes an enemy from a later level. Strange. Maybe this has more to do with the easy/normal/hard mode than true enemy data.

I'm sorry that all I seem to do is pose more questions than answers, but maybe someone could double check those addresses in case I missed something.

Cheers

ps.
"Super Mario Land 2 somehow contains the entire credits from Metroid II"
"so it's possible they share formats for other things"

Anyone know anything about this? I nearly laughed it off but there might be something in it. If M2 is, in turn, anything like the original Metroid, though, then there are virtually NO comparisons. Still- nice thinking 'outside the box'.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 6300/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 08-05-05 07:26 AM Link | Quote
Well I poked at the code and figured out the very complicated sprite data. At $E037 is a 2-byte pointer table, indexed by level number, to the sprite data (all data is in ROM bank 3). Level number can be retrieved from RAM address $A269. (For some reason this game keeps everything in SRAM. ) The first level is 0, Tree Zone 1 is 1, that auto-scroll level near the tree is 0x19 and so on. Level 00's data can be found at $E077. Each sprite is 3 bytes. Sprite data ends when the first byte is 0xFF. This is where it gets "fun"... It's easiest if you divide the 3 bytes into groups of bits.

Level 00, first Goomba (21 3B 3E @ $E077):
ABCD EFGH-IJK LMNOP-QRS TUVWX
0010 0001-001 11011-001 11110


Byte 1 = A-H
Byte 2 = I-P
Byte 3 = Q-X

The sprite's X position in pixels, starting from the leftmost point in the level, is determined as such:
0000 EFGH LMNO P000

The sprite's Y position in pixels, starting from the highest point in the level, is determined as such:
???? ???? TUVW X000
(Not sure how it gets the high byte... this code is the work of satan. )

The sprite's type is determined through this nightmarish formula:
1: Get the first byte
2: Rotate it right twice, and clear the low 2 and high 2 bits (AND 0x3C)
3: If bit 2 is set, clear it and set bit 6
4: x = result
5: Get the second byte
6: Rotate right once
7: Swap the low and high halves (eg 1F -> F1)
8: Clear all but the low 3 bits (AND 7)
9: Add x

So to shorten that a bit, I think it would look like: (0FCD E000) + (0000 0IJK).

Also, not sure about X/Y. I think they start from the absolute highest/left-most position possible, but it might just be relative to the highest/left-most position in the level. Have fun!

Also, these RAM addresses might be useful:
AF30: Mario's X position, 16-bit, low byte first
AF32: Mario's Y position, same as x
there are several other position counters here, each with different values, but they only change when the screen scrolls. Most of them appear to have the high byte first. Changing this value doesn't move Mario...
FF97, FFF0 = frame counters; FFF0 stops when game is paused
FF80 = joypad input

AF06=Spriteset, 0-1 (images + behaviour - try 01 in Tree Zone 1!)
AF2B=Seems to indicate what a sprite is doing; changes to 0x20 when a Koopa is moving right and 0 when it's moving left
FFD5=Different values depending on current sprite being processed (01=Koopa, 02=Shell, 03=Thrown shell, 04=Held shell, 08=Paragoomba, 09=Goomba, 0A=Dead Goomba)
FFD9=Current sprite's Y position relative to top of screen
FFDA=Current sprite's X position relative to left of screen
FFDB=Current sprite type

FFDB changes to different animation frames of the current sprite... the game must swap sprite data into these addresses before processing it (hence why changing them won't affect the sprite)

AD00 = Sprite info for sprites that are on the screen
AB00-AB05 = unused (set to 0xFF @ level start)
AB06 = sprite info for entire level

At AB06 the sprite data is decompressed into a nice neat format:
Byte 1, 2: X position, 16-bit, high byte first
Byte 3: Dunno
Byte 4, 5: Y position, 16-bit, high byte first
Byte 6: Sprite type

At AD00, the sprites that are currently active are copied from AB06, and 10 additional bytes are added:
Byte 7, 8: Dunno
Byte 9: Anything besides 02 makes it disappear until you change it back, except for 01 which the game just changes to 02.
Byte 10: How many pixels it is from the left edge of the screen. If it's more than 255 pixels away it becomes inactive. Not sure how it handles sprites being past the left edge.
Byte 11: Current animation frame. Looks like it, anyway.
Byte 12, 13, 14: Colour-related. Changing to 0x10 (or 0x0F for byte 14) changes colours.
Byte 15: Which way the sprite is moving. 1=Left, 2=Right.

Also, the sprite-loading code is at 03:6BBB ($EBBB).

Finally, here's how to decode the sprite graphics:
At 03:40B1 (spriteset 0) or 03:4F11 (spriteset 1) is a 2-byte pointer table to sprite image data, indexed by image number. Image number isn't the same as sprite number. 00 is Goomba, 04 is Koopa. Take the sprite number and multiply by 2, and add to either $40B1 or $4F11 depending on spriteset. This is the pointer to the sprite's image, low byte first, ROM bank 3. Here you'll find a series of 4-byte sprite attributes. Byte 1 is Y position, byte 2 is X position, byte 3 is tile #, byte 4 is tile attributes, just like in the GB's sprite memory. The data ends when byte 1 = 0x80. I'm not sure exactly what the X/Y location are for... if you change them, the sprite's image will keep jumping around.

Goomba's data is at 03:4213:
y x t a
F0 F8 B1 00
F0 00 B1 20
F8 F8 B2 00
F8 FF B4 20
80
which means:
-tile B1, attribute 00, at X=F8, Y=F0
-tile B1, attribute 20, at X=00, Y=F0
-tile B2, attribute 00, at X=F8, Y=F8
-tile B4, attribute 20, at X=FF, Y-F8
-end of data

And here's the graphic loading code I just described, "re-written" in C:
#define SpriteSet 0xAF06
#define FreeOAMSlot 0xFF8D
#define CurrentSpriteY 0xFFD9
#define CurrentSpriteX 0xFFDA
#define CurrentSprite 0xFFDB
mem[SpriteSet] = 0;
mem[0xAF2B] = 0;
mem[FreeOAMSlot] = 0x18;
mem[CurrentSpriteY] = 0;
mem[CurrentSpriteX] = 0;
mem[CurrentSprite] = 0;

//A, B, C, D, E, H, L, BC, DE and HL are CPU registers.
//mem[] refers to GB memory.
//rl() refers to GB opcode 'rl' (rotate left).

void LoadSpriteTSA() //03:4000
{
if(mem[SpriteSet]) = 0
HL = 0x40B1;
else
HL = 0x4F11;
D = 0;
E = mem[CurrentSprite];
E = E << 1;
D = rl(D); //Will rotate the high bit of the previous operation into D
HL += DE; //HL must point to a pointer table of some sort now (0x40C7 for Goomba)
E = mem[HL];
D = mem[HL + 1]; //Because DE now points to the sprite TSA data (0x42C9)
HL = 0xA100 + mem[FreeOAMSlot]; //A100 is a mirror of OAM (FE00)
B = mem[CurrentSpriteY];
C = mem[CurrentSpriteX];
while(mem[DE] != 0x80); //DE = Tile Y position
{
if(mem[0xAF2B] & 0x40)
A = (mem[DE] ^ 0xFF) - 7;
else
A = mem[DE];
A += B;
if(A < 0xA0)
{
mem[HL] = A;
HL++;
DE++; //DE = Tile X position
if(!mem[0xAF2B] & 0x20)
A = mem[DE];
else
A = (mem[DE] ^ 0xFF) - 7;
A += C;
if(A < 0xA8)
{
mem[HL] = A;
HL++;
DE++; //DE = Tile #
mem[HL] = mem[DE];
HL++;
DE++; //DE = Attribute
A = mem[DE] ^ mem[0xAF2B]
mem[hl] = A;
mem[FreeOAMSlot] = L;
DE++; //DE = Y position (next tile)
}
else
{
L--;
mem[HL] = 0;
DE += 3; //DE = Y position (next tile)
}
}
else
DE += 4; //DE = Y position (next tile)
}
}



(edited by The Crimson Chin on 08-04-05 10:36 PM)
(edited by The Crimson Chin on 08-04-05 10:58 PM)
Someguy

Buzzy Beetle
It seems as though the girl you've fallen for is also a pyromaniac.
Level: 32

Posts: 361/397
EXP: 193329
For next: 13113

Since: 03-15-04
From: I'm proud to be an American... I think...

Since last post: 1 day
Last activity: 5 hours
Posted on 08-05-05 07:31 AM Link | Quote
Originally posted by midget35
Anyone know anything about this? I nearly laughed it off but there might be something in it. If M2 is, in turn, anything like the original Metroid, though, then there are virtually NO comparisons. Still- nice thinking 'outside the box'.


This is quite possible, because these games share some of the same programmers as well as many other things in the credits, so it's quite possible the same basic tools were used, such as tilemap creators and probably level compression formats. Tons of GBA games use nearly if not exactly the same compression and music formats, and OoT was based off of a heavilly modded SM64 engine believe it or not.

Then again it could be a misplaced source file, some graphics from other games have been found in the Sonic 2 prototype for example.
midget35

Paragoomba
Level: 13

Posts: 51/70
EXP: 8877
For next: 1390

Since: 03-17-05

Since last post: 3 days
Last activity: 14 hours
Posted on 08-05-05 10:50 PM Link | Quote
Awesome work Crimson.

I haven't seen anything this complicated before. It looks almost like an encryption routine rather than compression.

Again- brilliant.

Off-topic: I noticed your Mario Kart hack on your homepage. You say you can't get the AI to co-operate. Any progress since then?
Coolman

Goomba
Level: 10

Posts: 14/32
EXP: 3753
For next: 661

Since: 08-29-04
From:
Germany
FWB

Since last post: 5 days
Last activity: 21 hours
Posted on 08-05-05 11:11 PM Link | Quote
Good work @Crimson

Does anybody know anything about sound, overworld and collision data? Or about warps?
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 6313/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 08-05-05 11:37 PM Link | Quote
Originally posted by midget35
Off-topic: I noticed your Mario Kart hack on your homepage. You say you can't get the AI to co-operate. Any progress since then?

I'm done with that hack. I might make a better SMK hack sometime, but that one... I dunno WTF I was thinking.

[edit] Just pondering the sprite coords a bit. Notice that the game forces the low 3 bits to be zero; this means sprites can only be placed at multiples of 16 pixels (just like Super Mario World). However, the individual sprite image data specifies X/Y pixel locations relative to the top left of the screen (close to it, anyway). This might be used to fine-tune certain sprites' locations.

Also, bits A and X don't seem to be in any of those. They might be used to determine the high byte of the Y coord. I probably won't have much time to check in the next whole, though. (The code does a lot of rotates and shifts all over the place... really hard to follow especially when you don't quite know what all the dozens of different shift instructions are supposed to do. )


(edited by The Crimson Chin on 08-05-05 11:36 PM)
Coolman

Goomba
Level: 10

Posts: 15/32
EXP: 3753
For next: 661

Since: 08-29-04
From:
Germany
FWB

Since last post: 5 days
Last activity: 21 hours
Posted on 08-06-05 04:37 PM Link | Quote
y = (byte3 and $7F) * 8
This should be right...

if (byte3 and $80) = $80 then enemy doesn't appear in easy mode...

x = (byte1 and $0f) * 256 + (byte2 and $1f) * 8

sprite's type = (byte1 and $F0) / 4
if sprite's type and 4 = 1 then sprite's type = sprite's type + $3c
sprite's type = sprite's type + (byte2 and $E0) / $20

so it's built up like this:
ABCDEFGH-IJKLMNOP-QRSTUVWX
ssssxxxx-sssxxxxx-eyyyyyyy

where s = sprite's type and e = easy mode
x = 0000EFGH LMNOP000
e = 0000000Q
y = 000000RS TUVWX000
s = 0DABCIJK


anything wrong?

Btw: The Version which is linked above can now edit the tile map, but doesn't repoint it...


(edited by Coolman on 08-06-05 07:42 AM)
(edited by Coolman on 08-06-05 07:44 AM)
(edited by Coolman on 08-06-05 07:46 AM)
(edited by Coolman on 08-06-05 08:04 AM)
(edited by Coolman on 08-06-05 08:08 AM)
(edited by Coolman on 08-06-05 08:09 AM)
(edited by Coolman on 08-06-05 08:11 AM)
(edited by Coolman on 08-06-05 08:12 AM)
(edited by Coolman on 08-06-05 08:12 AM)
(edited by Coolman on 08-06-05 08:16 AM)
(edited by Coolman on 08-06-05 08:23 AM)
(edited by Coolman on 08-06-05 08:33 AM)
(edited by Coolman on 08-06-05 08:33 AM)
(edited by Coolman on 08-06-05 08:34 AM)
Someguy

Buzzy Beetle
It seems as though the girl you've fallen for is also a pyromaniac.
Level: 32

Posts: 366/397
EXP: 193329
For next: 13113

Since: 03-15-04
From: I'm proud to be an American... I think...

Since last post: 1 day
Last activity: 5 hours
Posted on 08-06-05 09:31 PM Link | Quote
Just a little bit of info I learned with this editor on how pipes work that should be known.

The pipe tiles that let you go down and up need to be set up correctly or they will either be inenterable except the sides, send you through the ground till you enter an odd glitchy land, or both.

Image hosted by Photobucket.com

This image demonstrates a working pipe.(well, technically it didn't work downwards but the reason for that is offscreen so ignore it) I put an invisible layer of colors ontop of the image, the green is where the left side of a pipe needs to be, the blue is where the right side should be. Strange things will happen if it's positioned wrong. I've made an image of all the problems that I've come acrost with pipes.

Image hosted by Photobucket.com

A shows the right way to align a pipe, Mario goes down it in the center, and everything looks and acts correct up there.

B shows the wrong way, this pipe is misaligned, and Mario goes down the sides of the pipe and not the center.

C shows how the end of each pipe should be, correctly. There needs to be a two tile by two tile set of moveable space for Mario to enter into, even if he is Small Mario, for a pipe to work right.

D shows what happens if you leave one tile or less of free space for Mario to move in. Even as Small Mario he will ignore it and continue to move through the ground until he finds room, leading to an odd glitch area below the actual level.

E shows what happens if you mistakenly use the wrong tile. This is an invisible solid tile, possibly an invisible block of somesuch. It's easilly thought to be air, however, it is solid and Mario passes right through it looking for true free space!

F shows an example of a culprit tile that causes this.

G shows a proper free space air tile.

H shows the tile numbers on the side of the editor, you should try and remember which tile number is for free space if you plan on making new pipes and rooms. The left one is the currently selected tile, the right is which one your mouse is over in the tile selector.


And that's it for this time class! Tune in next time for more Super Mario Land 2 Editing Class!
Coolman

Goomba
Level: 10

Posts: 16/32
EXP: 3753
For next: 661

Since: 08-29-04
From:
Germany
FWB

Since last post: 5 days
Last activity: 21 hours
Posted on 08-08-05 03:17 PM Link | Quote
Hi,
I've designed a litte page.
URL: http://marcas.de.vu/

Tell me how you like the page and give me feedback for the editor!
legoman

Paragoomba
Level: 12

Posts: 23/75
EXP: 6907
For next: 1014

Since: 07-12-05
From: finland (jokirinteelä)

Since last post: 16 hours
Last activity: 3 hours
Posted on 08-08-05 03:53 PM Link | Quote
Originally posted by Coolman
I've made a litte public pre alpha version.

You can download it here:
Download

But attention:
This version is only for testing and presentation purpose.

bug:

Coolman

Goomba
Level: 10

Posts: 17/32
EXP: 3753
For next: 661

Since: 08-29-04
From:
Germany
FWB

Since last post: 5 days
Last activity: 21 hours
Posted on 08-08-05 05:06 PM Link | Quote
Could you perhaps tell me, when it appears?
It's very hard to find a bug if I don't know where I have to search for it
legoman

Paragoomba
Level: 12

Posts: 24/75
EXP: 6907
For next: 1014

Since: 07-12-05
From: finland (jokirinteelä)

Since last post: 16 hours
Last activity: 3 hours
Posted on 08-08-05 06:38 PM Link | Quote
Originally posted by Coolman
Could you perhaps tell me, when it appears?
It's very hard to find a bug if I don't know where I have to search for it

I download super mario land 2 level editor and me download super mario land 2 gb rom and I opten super mario land 2 level editor and:

Coolman

Goomba
Level: 10

Posts: 18/32
EXP: 3753
For next: 661

Since: 08-29-04
From:
Germany
FWB

Since last post: 5 days
Last activity: 21 hours
Posted on 08-08-05 07:13 PM Link | Quote
Hi,
could please translate the error message, which is behind the number?
Which rom version do you use?
Pages: 1 2Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - mario land 2 level data | |


ABII


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



Page rendered in 0.021 seconds.