Mario Kart 64 Hacking General Discussion « 1 2 3 4 5 6 ... 16 »
Users browsing this thread: 1 Guest(s)

Incredible ! I trust in you and in your talent.
(This post was last modified: 06-11-2015, 09:13 PM by zouzzz.)

Is this going to be a level editor!?! Either way great work so far!

Here all gs code for Widescreen : pal (1.0, 1.1), japan (1.0,1.1) and US version.
And gs code for all character co-playable for pal and us version.
http://x-community.grafbb.com/t1740-n64-mario-kart-64-etudes-et-tp

I see that this thread has been inactive for a few months now. I have some data that I wish to share that was documented by zzt32/Marshall.

Player data

Pointers to the 8 individual drivers are at 0x800DC4DC. Each driver structure appears to be 3544 bytes long.
Code:
struct mk64_player
{
   float unkn;
   u32 u1;
   u32 u2;
   u32 u3;
   u32 u4;

   float x, y, z;
   u16 u5;
   u16 rotation;

   float unkn;

   float x_accel, y_accel, z_accel;
};

Map data

The code that processes the DMA and decompression of map files is dynamically loaded.
Code:
0x802AA918:  sll             t6,a0,2
0x802AA91C:  subu            t6,t6,a0
0x802AA920:  lui             t7,0x802c
0x802AA924:  addiu           t7,t7,-29312
0x802AA928:  sll             t6,t6,4
0x802AA92C:  addu            v0,t6,t7
0x802AA930:  addiu           $sp,$sp,-96
0x802AA934:  lui             v1,0x800e
0x802AA938:  lw              v1,-15092(v1)
0x802AA93C:  lw              t8,0(v0)
0x802AA940:  lw              t9,4(v0)
0x802AA944:  lw              t0,8(v0)
0x802AA948:  lw              t1,12(v0)
0x802AA94C:  lw              t2,40(v0)
0x802AA950:  lw              t3,24(v0)
0x802AA954:  lw              t4,32(v0)
0x802AA958:  lw              t5,28(v0)
0x802AA95C:  lw              t6,36(v0)
0x802AA960:  lhu             t7,44(v0)
0x802AA964:  li              $at,5
0x802AA968:  sw              $ra,20($sp)
0x802AA96C:  lw              a2,16(v0)
0x802AA970:  lw              a1,20(v0)
0x802AA974:  sw              t8,72($sp)
0x802AA978:  sw              t9,68($sp)
0x802AA97C:  sw              t0,64($sp)
0x802AA980:  sw              t1,60($sp)
0x802AA984:  sw              t2,48($sp)
0x802AA988:  sw              t3,44($sp)
0x802AA98C:  sw              t4,40($sp)
0x802AA990:  sw              t5,36($sp)
0x802AA994:  sw              t6,32($sp)
0x802AA998:  beq             v1,$at,0x802AA9AC
0x802AA99C:  sw              t7,28($sp)
0x802AA9A0:  li              $at,9
0x802AA9A4:  bne             v1,$at,0x802AA9BC
0x802AA9A8:  lui             t9,0x8028
0x802AA9AC:  lui             t8,0x8028
0x802AA9B0:  lui             $at,0x8016
0x802AA9B4:  b               0x802AA9C8
0x802AA9B8:  sw              t8,-2260($at)
0x802AA9BC:  ori             t9,t9,0xdf00
0x802AA9C0:  lui             $at,0x8016
0x802AA9C4:  sw              t9,-2260($at)
0x802AA9C8:  jal             0x802A7D70
0x802AA9CC:  or              a0,a2,$zero
0x802AA9D0:  li              a0,9
0x802AA9D4:  jal             0x802A7B94
0x802AA9D8:  or              a1,v0,$zero
0x802AA9DC:  lui             t0,0x800e
0x802AA9E0:  lw              t0,-15092(t0)
0x802AA9E4:  li              $at,5
0x802AA9E8:  lw              a0,72($sp)
0x802AA9EC:  beq             t0,$at,0x802AAA08
0x802AA9F0:  nop
0x802AA9F4:  jal             0x802AA88C         /* Map is decompressed further down the line here */
0x802AA9F8:  lw              a1,68($sp)
0x802AA9FC:  li              a0,6

Stack trace hereto:

(m64p) bt
Stack trace for thread 5 (0x801589D0):
#00 0x800400D0 SRC:0x802AA8E8 ARG:{0x802899C0,0x801CCF10,0x00000001,0x802BA360}
   $sp:0x8015AA90  size: 48b
#01 0x802AA88C SRC:0x802AA9F4 ARG:{0x0084E8E0,0x00852E20,0x00000001,0x802BA360}
   $sp:0x8015AAC0  size: 96b
#02 0x802AA918 SRC:0x80002AF4 ARG:{0x00000008,0x0002C470,0x00000001,0x802BA360}
   $sp:0x8015AB20  size: 24b
#03 0x80002A18 SRC:0x8000271C ARG:{0x8028DF00,0x0002C470,0x00000001,0x802BA360}
   $sp:0x8015AB38  size: 24b
#04 0x80002684 SRC:0x80002884 ARG:{0x00000001,0x00006D6E,0x00000000,0x00000000}
   $sp:0x8015AB50  size: ?
For the record, he loaded the first track of the first series.

Storage

The map data array begins at 0x802B8D80. The records are 48 bytes each. The structure appears to follow this format:
Code:
struct mk64_map_data_t
{
   unsigned rom_start;
   unsigned rom_end;
   ...
};


====================================
A code he made to log the DMA controller which was assembled (iirc) with his program Galatea.

Code:
.org 0x800D2FC4
.set noreorder
.set noat
#include <mips.h>

j hook

.global after
after:


.org 0x80400000
.set noreorder
.set noat
#include <mips.h>

.global hook
hook:
sltiu v0,a3,0x100

beq $zero,v0,log
sw a3,0x34($sp)

cont:
j after
nop

log:
la v0,stackp
lw v1,0(v0)

lui $at,0x8080
beq $at,v1,cont
lui             $gp,%hi(exempt)

/* Check exemptions */
addiu           $gp,$gp,%lo(exempt)
loop:
lw              $at,0($gp)
beq             $at,a3,cont
addiu           $gp,$gp,4
bnez            $at,loop
nop

sw a0,0(v1)
sw a1,4(v1)
sw a2,8(v1)
sw a3,12(v1)

/* store line */
li              $at,(('!' << 24) | ('!' << 16) | ('!' << 8) | '!')
sw              $at,16(v1)
sw              $at,20(v1)
sw              $at,24(v1)
sw              $at,28(v1)

addiu v1,32
j cont
sw v1,0(v0)

/* Exempt from logging */
exempt:
       .word           0x5A0
       .word           0x100
       .word           0       /* Zero terminate list */

stackp:
.word stack

stack:
.word 0


Edit: I also know that Mario Kart 64 uses F3DEX2 instead of F3DZEX, however the two are evidently nearly identical. With that said, here is an informative wiki page for the F3DZEX microcodes.
(This post was last modified: 19-11-2015, 12:00 AM by vexiant.)

Any notable progress on this to report?

I'm going to guess not. The last update to the Github project was right before October, and I haven't heard anything.

I'm still willing to help out if anyone wants to give it a try, but I've got enough on my plate trying to work with Starfox64 and LoZ:OoT.

The progress on this is incredible! I really hope we can get a level editor sometime soon!

Sorry for the lack of updates, I've been busy with other projects. If I pick this up again I think it would be best to start porting/rewriting the level viewer into an environment more suitable for a full blown level editor. In-browser Javascript isn't great for file management and I wouldn't want to inconvenience people with downloading something like node-webkit as it's somewhat esoteric.

Hey guys, I found this forum searching for progress on a level editor. I'd be willing to pay for a level editor if anyone has the ability to get one done. I don't have the skill to make it happen, but if anyone can devote the time to getting something together let me know what features you might be able to include and what you think a fair price would be. Even something as simple as the ability to drop walls on stages like rainbow road or banshee boardwalk would be an awesome way to add some variety to existing levels.

I'm most interested in the ability to alter levels in vs mode above anything.

Thanks!
(This post was last modified: 06-02-2016, 01:04 AM by bgritt.)

I'd also contribute towards someone investing their time in this project.

Mario Kart 64 Hacking General Discussion « 1 2 3 4 5 6 ... 16 »
Users browsing this thread: 1 Guest(s)