News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Yoshimaster96

Pages: [1]
1
ROM Hacking Discussion / smbdis.asm is wrong!
« on: June 30, 2018, 09:04:48 pm »
Trying to compile Super Mario Bros using the SMBDIS assembly and ASM6 results in an error stating that the label "MushLExit" is undefined (it actually just gives a line number, but that seems to be the problem).

Second, after adding the label where it should be (in front of the RTS instruction in PullyRopeObject, from what I can gather), the resulting PRG ROM is 2 bytes too short.

Third, after adding a .org $FFFA statement before the interrupt vectors, the game works (at least the first two levels which I played), but is not the same as the original game. HxD reveals that there are thousands of differences.



These issues should probably be fixed.

2
Programming / (Homebrew) Help with ASM6!
« on: July 20, 2017, 07:51:47 pm »
When compiling my source code, I end up with a "Value out of range." error for banks 1 through 29 of my NES homebrew game
Code: [Select]
pass 1..
pass 2..
PRG/PRG01.asm(1): Value out of range.
PRG/PRG02.asm(1): Value out of range.
PRG/PRG03.asm(1): Value out of range.
PRG/PRG04.asm(1): Value out of range.
PRG/PRG05.asm(1): Value out of range.
PRG/PRG06.asm(1): Value out of range.
PRG/PRG07.asm(1): Value out of range.
PRG/PRG08.asm(1): Value out of range.
PRG/PRG09.asm(1): Value out of range.
PRG/PRG10.asm(1): Value out of range.
PRG/PRG11.asm(1): Value out of range.
PRG/PRG12.asm(1): Value out of range.
PRG/PRG13.asm(1): Value out of range.
PRG/PRG14.asm(1): Value out of range.
PRG/PRG15.asm(1): Value out of range.
PRG/PRG16.asm(1): Value out of range.
PRG/PRG17.asm(1): Value out of range.
PRG/PRG18.asm(1): Value out of range.
PRG/PRG19.asm(1): Value out of range.
PRG/PRG20.asm(1): Value out of range.
PRG/PRG21.asm(1): Value out of range.
PRG/PRG22.asm(1): Value out of range.
PRG/PRG23.asm(1): Value out of range.
PRG/PRG24.asm(1): Value out of range.
PRG/PRG25.asm(1): Value out of range.
PRG/PRG26.asm(1): Value out of range.
PRG/PRG27.asm(1): Value out of range.
PRG/PRG28.asm(1): Value out of range.
PRG/PRG29.asm(1): Value out of range.

Here are a few source files:

MAIN.asm
Code: [Select]
.include INES.inc

.include PRG/PRG00.asm
.include PRG/PRG01.asm
.include PRG/PRG02.asm
.include PRG/PRG03.asm
.include PRG/PRG04.asm
.include PRG/PRG05.asm
.include PRG/PRG06.asm
.include PRG/PRG07.asm
.include PRG/PRG08.asm
.include PRG/PRG09.asm
.include PRG/PRG10.asm
.include PRG/PRG11.asm
.include PRG/PRG12.asm
.include PRG/PRG13.asm
.include PRG/PRG14.asm
.include PRG/PRG15.asm
.include PRG/PRG16.asm
.include PRG/PRG17.asm
.include PRG/PRG18.asm
.include PRG/PRG19.asm
.include PRG/PRG20.asm
.include PRG/PRG21.asm
.include PRG/PRG22.asm
.include PRG/PRG23.asm
.include PRG/PRG24.asm
.include PRG/PRG25.asm
.include PRG/PRG26.asm
.include PRG/PRG27.asm
.include PRG/PRG28.asm
.include PRG/PRG29.asm
.include PRG/PRG30.asm
.include PRG/PRG31.asm

.incbin CHR/CHR.bin

INES.inc
Code: [Select]
.db $4E,$45,$53,$1A,$10,$10,$4A,$00,$00,$00,$00,$00,$00,$00,$00,$00
PRG/PRG00.asm
Code: [Select]
.org $8000
.dw BitmapLogo,BitmapTitle,BitmapFileSel,$0000
.dw BitmapBonus,BitmapCredits,BitmapGameOver,BitmapDebug

BitmapLogo:
.incbin PRG/BMP/BMP0A.bin
.incbin PRG/BMP/BMP0B.bin

BitmapTitle:
.incbin PRG/BMP/BMP1A.bin
.incbin PRG/BMP/BMP1B.bin

BitmapFileSel:
.incbin PRG/BMP/BMP2A.bin
.incbin PRG/BMP/BMP2B.bin

BitmapBonus:
.incbin PRG/BMP/BMP4A.bin
.incbin PRG/BMP/BMP4B.bin

BitmapCredits:
.incbin PRG/BMP/BMP5A.bin
.incbin PRG/BMP/BMP5B.bin

BitmapGameOver:
.incbin PRG/BMP/BMP6A.bin
.incbin PRG/BMP/BMP6B.bin

BitmapDebug:
.incbin PRG/BMP/BMP7A.bin
.incbin PRG/BMP/BMP7B.bin

PRG/PRG01.asm (also for banks 2-23)
Code: [Select]
.org $8000
PRG/PRG24.asm (also for banks 25-29)
Code: [Select]
.org $A000
How can any value be out of range if there is no code?

3
ROM Hacking Discussion / GBA 3D model data (SMBJR)
« on: December 25, 2014, 03:10:12 pm »
Where do I start looking for the 3D model data (levels specifically) for Super Monkey Ball Jr.?

[EDIT]

The following debug texts:
addQuad
addTri
addUTexQuad
addUTexTri
suggests that the values 0-3 or 1-4 are used for drawing polygons.
The debug string:
addVert
suggests that vertices are declared via an indexing system rather than implicitly for each polygon.

4
Programming / Utility coding, in need of coders!
« on: July 22, 2014, 09:01:00 pm »
Anyone skilled enough to make an obj/mtl to gma/tpl converter? I've got gma/tpl specs here.

[EDIT]
I really need help here.

5
Programming / RDP emulation?
« on: June 14, 2014, 06:55:08 pm »
Hello once again! I have a question:
Code: [Select]
#include <stdio.h>
#include <math.h>
#include "glut.h"
#pragma comment (lib,"glut32.lib")

unsigned char redfr,greenfr,bluefr,alphafr;
float redfo,greenfo,bluefo,alphafo;
float redenv,greenenv,blueenv,alphaenv;
float redbl,greenbl,bluebl,alphabl;
float redpr,greenpr,bluepr,alphapr;
float cr,cg,cb,sr,sg,sb,wr,wg,wb;
short k0,k1,k2,k3,k4,k5;

void execucode(unsigned char ucode[176])
{
switch(ucode[0]&0x3F)
{
case 0x00:
{
//NOOP
break;
}
case 0x08:
{
//TRI
float fucode[176];
for(int i=0; i<176; i++)
{
fucode[i] = ucode[i];
}
bool flip = (ucode[1]&0x80) ? true : false;
char mipmaps = (ucode[1]&0x38)>>3;
char tile = ucode[1]&0x07;
float yl = (ucode[2]&0x1F)*64 + (fucode[3]/4);
if(ucode[2]&0x20) yl -= 2048;
float ym = (ucode[4]&0x1F)*64 + (fucode[5]/4);
if(ucode[4]&0x20) ym -= 2048;
float yh = (ucode[6]&0x1F)*64 + (fucode[7]/4);
if(ucode[6]&0x20) yl -= 2048;
float xl = (fucode[8]*256) + (fucode[9]) + (fucode[10]/256) + (fucode[11]/65536);
if(ucode[8]&0x80) xl -= 65536;
float dxldy = (fucode[12]*256) + (fucode[13]) + (fucode[14]/256) + (fucode[15]/65536);
if(ucode[12]&0x80) dxldy -= 65536;
float xh = (fucode[16]*256) + (fucode[17]) + (fucode[18]/256) + (fucode[19]/65536);
if(ucode[16]&0x80) xh -= 65536;
float dxhdy = (fucode[20]*256) + (fucode[21]) + (fucode[22]/256) + (fucode[23]/65536);
if(ucode[20]&0x80) dxhdy -= 65536;
float xm = (fucode[24]*256) + (fucode[25]) + (fucode[26]/256) + (fucode[27]/65536);
if(ucode[24]&0x80) xm -= 65536;
float dxmdy = (fucode[28]*256) + (fucode[29]) + (fucode[30]/256) + (fucode[31]/65536);
if(ucode[28]&0x80) dxmdy -= 65536;
if(flip)
{
glBegin(GL_TRIANGLES);
glVertex2f(xh-(dxhdy*(yl-floor(yh))),yl);
glVertex2f(xl+(dxldy*(ceil(ym)-ym)),ym);
glVertex2f(xm+(dxmdy*(yh-floor(yh))),yh);
glEnd();
}
else
{
glBegin(GL_TRIANGLES);
glVertex2f(xh+(dxhdy*(yl-floor(yh))),yl);
glVertex2f(xl-(dxldy*(ceil(ym)-ym)),ym);
glVertex2f(xm-(dxmdy*(yh-floor(yh))),yh);
glEnd();
}
break;
}
case 0x09:
{
//TRI_Z
float fucode[176];
for(int i=0; i<176; i++)
{
fucode[i] = ucode[i];
}
bool flip = (ucode[1]&0x80) ? true : false;
char mipmaps = (ucode[1]&0x38)>>3;
char tile = ucode[1]&0x07;
float yl = (ucode[2]&0x1F)*64 + (fucode[3]/4);
if(ucode[2]&0x20) yl -= 2048;
float ym = (ucode[4]&0x1F)*64 + (fucode[5]/4);
if(ucode[4]&0x20) ym -= 2048;
float yh = (ucode[6]&0x1F)*64 + (fucode[7]/4);
if(ucode[6]&0x20) yl -= 2048;
float xl = (fucode[8]*256) + (fucode[9]) + (fucode[10]/256) + (fucode[11]/65536);
if(ucode[8]&0x80) xl -= 65536;
float dxldy = (fucode[12]*256) + (fucode[13]) + (fucode[14]/256) + (fucode[15]/65536);
if(ucode[12]&0x80) dxldy -= 65536;
float xh = (fucode[16]*256) + (fucode[17]) + (fucode[18]/256) + (fucode[19]/65536);
if(ucode[16]&0x80) xh -= 65536;
float dxhdy = (fucode[20]*256) + (fucode[21]) + (fucode[22]/256) + (fucode[23]/65536);
if(ucode[20]&0x80) dxhdy -= 65536;
float xm = (fucode[24]*256) + (fucode[25]) + (fucode[26]/256) + (fucode[27]/65536);
if(ucode[24]&0x80) xm -= 65536;
float dxmdy = (fucode[28]*256) + (fucode[29]) + (fucode[30]/256) + (fucode[31]/65536);
if(ucode[28]&0x80) dxmdy -= 65536;
float z = (fucode[28]*256) + (fucode[29]) + (fucode[30]/256) + (fucode[31]/65536);
if(ucode[28]&0x80) z -= 65536;
float dzdx = (fucode[28]*256) + (fucode[29]) + (fucode[30]/256) + (fucode[31]/65536);
if(ucode[28]&0x80) dzdx -= 65536;
float dzde = (fucode[28]*256) + (fucode[29]) + (fucode[30]/256) + (fucode[31]/65536);
if(ucode[28]&0x80) dzde -= 65536;
float dzdy = (fucode[28]*256) + (fucode[29]) + (fucode[30]/256) + (fucode[31]/65536);
if(ucode[28]&0x80) dzdy -= 65536;
if(flip)
{
glBegin(GL_TRIANGLES);
glVertex3f(xh-(dxhdy*(yl-floor(yh))),yl,0);
glVertex3f(xl+(dxldy*(ceil(ym)-ym)),ym,0);
glVertex3f(xm+(dxmdy*(yh-floor(yh))),yh,0);
glEnd();
}
else
{
glBegin(GL_TRIANGLES);
glVertex3f(xh+(dxhdy*(yl-floor(yh))),yl,0);
glVertex3f(xl-(dxldy*(ceil(ym)-ym)),ym,0);
glVertex3f(xm-(dxmdy*(yh-floor(yh))),yh,0);
glEnd();
}
break;
}
case 0x0A:
{
//TRI_TEX
break;
}
case 0x0B:
{
//TRI_TEX_Z
break;
}
case 0x0C:
{
//TRI_SHADE
break;
}
case 0x0D:
{
//TRI_SHADE_Z
break;
}
case 0x0E:
{
//TRI_TEX_SHADE
break;
}
case 0x0F:
{
//TRI_TEX_SHADE_Z
break;
}
case 0x24:
{
//TEX_RECT
float x1 = (ucode[1]*4) + ((ucode[2]&0xF0)/64);
float y1 = ((ucode[2]&0x0F)*64) + (ucode[3]/4);
char tile = ucode[4]&0x07;
float x2 = (ucode[5]*4) + ((ucode[6]&0xF0)/64);
float y2 = ((ucode[6]&0x0F)*64) + (ucode[7]/4);
float s = (ucode[8]*32) + (ucode[9]/8);
if(ucode[8]&0x80) s *= -1;
float t = (ucode[10]*32) + (ucode[11]/8);
if(ucode[10]&0x80) s *= -1;
float dsdx = (ucode[12]/8) + (ucode[13]/2048);
if(ucode[12]&0x80) dsdx *= -1;
float dtdy = (ucode[14]/8) + (ucode[15]/2048);
if(ucode[14]&0x80) dtdy *= -1;
glBegin(GL_QUADS);
glTexCoord2f(s,t);
glVertex2f(x1,y1);
glTexCoord2f(s,t+(dtdy*(y2-y1)));
glVertex2f(x1,y2);
glTexCoord2f(s+(dsdx*(x2-x1)),t+(dtdy*(y2-y1)));
glVertex2f(x2,y2);
glTexCoord2f(s+(dsdx*(x2-x1)),t);
glVertex2f(x2,y1);
glEnd();
break;
}
case 0x25:
{
//TEX_RECT_FLIP
float x1 = (ucode[1]*4) + ((ucode[2]&0xF0)/64);
float y1 = ((ucode[2]&0x0F)*64) + (ucode[3]/4);
char tile = ucode[4]&0x07;
float x2 = (ucode[5]*4) + ((ucode[6]&0xF0)/64);
float y2 = ((ucode[6]&0x0F)*64) + (ucode[7]/4);
float s = (ucode[8]*32) + (ucode[9]/8);
if(ucode[8]&0x80) s *= -1;
float t = (ucode[10]*32) + (ucode[11]/8);
if(ucode[10]&0x80) s *= -1;
float dsdx = (ucode[12]/8) + (ucode[13]/2048);
if(ucode[12]&0x80) dsdx *= -1;
float dtdy = (ucode[14]/8) + (ucode[15]/2048);
if(ucode[14]&0x80) dtdy *= -1;
glBegin(GL_QUADS);
glTexCoord2f(-s,-t);
glVertex2f(x1,y1);
glTexCoord2f(-s,-t-(dtdy*(y2-y1)));
glVertex2f(x1,y2);
glTexCoord2f(-s-(dsdx*(x2-x1)),-t-(dtdy*(y2-y1)));
glVertex2f(x2,y2);
glTexCoord2f(-s-(dsdx*(x2-x1)),-t);
glVertex2f(x2,y1);
glEnd();
break;
}
case 0x26:
{
//SYNC_LOAD
break;
}
case 0x27:
{
//SYNC_PIPE
break;
}
case 0x28:
{
//SYNC_TILE
break;
}
case 0x29:
{
//SYNC_FULL
break;
}
case 0x2A:
{
//KEY_GB
cg = ucode[4]/255;
sg = ucode[5]/255;
wg = (ucode[1]<<4 + (ucode[2]&0xF0)>>4)/255;
cb = ucode[6]/255;
sb = ucode[7]/255;
wb = ((ucode[2]&0x0F)<<8 + ucode[3])/255;
break;
}
case 0x2B:
{
//KEY_R
cr = ucode[6]/255;
sr = ucode[7]/255;
wr = ((ucode[4]&0x0F)<<8 + ucode[5])/255;
break;
}
case 0x2C:
{
//SET_CONVERT
k0 = (ucode[1]&0x3F)<<3 + (ucode[2]&0xE0)>>5;
k1 = (ucode[2]&0x1F)<<4 + (ucode[3]&0xF0)>>4;
k2 = (ucode[3]&0x0F)<<5 + (ucode[2]&0xF8)>>3;
k3 = (ucode[2]&0x07)<<6 + (ucode[3]&0xFC)>>2;
k4 = (ucode[1]&0x03)<<7 + (ucode[2]&0xFE)>>1;
k5 = (ucode[2]&0x01)<<8 + (ucode[3]&0xFF);
break;
}
case 0x2D:
{
//SET_SCISSOR
float x1 = (ucode[1]*16) + ((ucode[2]&0xF0)/16);
float y1 = ((ucode[2]&0x0F)*256) + ucode[3];
float x2 = (ucode[5]*16) + ((ucode[6]&0xF0)/16);
float y2 = ((ucode[6]&0x0F)*256) + ucode[7];
glOrtho(x1,y2,x2,y1,-128,128);
break;
}
case 0x2E:
{
//SET_PRIM_DEPTH
break;
}
case 0x2F:
{
//SET_OTHER_MODE
break;
}
case 0x30:
{
//LOAD_TLUT
break;
}
case 0x32:
{
//SET_TILE_SIZE
break;
}
case 0x33:
{
//LOAD_BLOCK
break;
}
case 0x34:
{
//LOAD_TILE
break;
}
case 0x35:
{
//SET_TILE
break;
}
case 0x36:
{
//FILL_RECT
glColor4ub(redfr,greenfr,bluefr,alphafr);
short x1 = (ucode[1]*4) + ((ucode[2]&0xF0)/64);
short y1 = ((ucode[2]&0x0F)*64) + (ucode[3]/4);
short x2 = (ucode[5]*4) + ((ucode[6]&0xF0)/64);
short y2 = ((ucode[6]&0x0F)*64) + (ucode[7]/4);
glBegin(GL_QUADS);
glVertex2f(x1,y1);
glVertex2f(x1,y2);
glVertex2f(x2,y2);
glVertex2f(x2,y1);
glEnd();
glColor4ub(255,255,255,255);
break;
}
case 0x37:
{
//SET_FILL_COLOR
redfr = ucode[4];
greenfr = ucode[5];
bluefr = ucode[6];
alphafr = ucode[7];
break;
}
case 0x38:
{
//SET_FOG_COLOR
redfo = ucode[4]/255;
greenfo = ucode[5]/255;
bluefo = ucode[6]/255;
alphafo = ucode[7]/255;
glEnable(GL_FOG);
float fo[4] = {redfo,greenfo,bluefo,alphafo};
glFogfv(GL_FOG_COLOR,fo);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogi(GL_FOG_START,-128);
glFogi(GL_FOG_END,128);
break;
}
case 0x39:
{
//SET_BLEND_COLOR
redbl = ucode[4]/255;
greenbl = ucode[5]/255;
bluebl = ucode[6]/255;
alphabl = ucode[7]/255;
break;
}
case 0x3A:
{
//SET_PRIM_COLOR
redpr = ucode[4]/255;
greenpr = ucode[5]/255;
bluepr = ucode[6]/255;
alphapr = ucode[7]/255;
break;
}
case 0x3B:
{
//SET_ENV_COLOR
redenv = ucode[4]/255;
greenenv = ucode[5]/255;
blueenv = ucode[6]/255;
alphaenv = ucode[7]/255;
glClearColor(redenv,greenenv,blueenv,alphaenv);
glClear(GL_COLOR_BUFFER_BIT);
break;
}
case 0x3C:
{
//SET_COMBINE
break;
}
case 0x3D:
{
//SET_TEXTURE_IMAGE
char format = (ucode[1]&0xE0)>>5;
char psize = (ucode[1]&0x18)>>3;
short size = (ucode[2]&0x03)<<8 + ucode[3];
long addr = ((ucode[4]&0x03)<<24) + (ucode[5]<<16) + (ucode[6]<<8) + ucode[7];
break;
}
case 0x3E:
{
//SET_MASK_IMAGE
long addr = ((ucode[4]&0x03)<<24) + (ucode[5]<<16) + (ucode[6]<<8) + ucode[7];
break;
}
case 0x3F:
{
//SET_COLOR_IMAGE
char format = (ucode[1]&0xE0)>>5;
char psize = (ucode[1]&0x18)>>3;
short size = (ucode[2]&0x03)<<8 + ucode[3];
long addr = ((ucode[4]&0x03)<<24) + (ucode[5]<<16) + (ucode[6]<<8) + ucode[7];
break;
}
}
}

void display()
{
unsigned char inst[176];
inst[0] = 0x08;
inst[1] = 0x00;
inst[2] = 0x03;
inst[3] = 0x00;
inst[4] = 0x02;
inst[5] = 0x00;
inst[6] = 0x01;
inst[7] = 0x00;
inst[8] = 0x00;
inst[9] = 0x40;
inst[10] = 0x00;
inst[11] = 0x00;
inst[12] = 0x00;
inst[13] = 0x02;
inst[14] = 0x00;
inst[15] = 0x00;
inst[16] = 0x00;
inst[17] = 0x80;
inst[18] = 0x00;
inst[19] = 0x00;
inst[20] = 0x00;
inst[21] = 0x00;
inst[22] = 0x80;
inst[23] = 0x00;
inst[24] = 0x00;
inst[25] = 0x80;
inst[26] = 0x00;
inst[27] = 0x00;
inst[28] = 0xFF;
inst[29] = 0xFF;
inst[30] = 0x00;
inst[31] = 0x00;
execucode(inst);
glFlush();
}

int main(int argc, char ** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(0,0);
glutInitWindowSize(256,256);
glutCreateWindow("UCODE");
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
glOrtho(0,256,256,0,-128,128);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
On the TRI_Z command, what X and Y coordinate is the z variable based on? I need to know so I can use it, dzdx, dzde, and dzdy to find the Z coordinate for each vertex.

6
Personal Projects / Super Monkey Ball Hacking!
« on: June 14, 2014, 01:58:30 pm »
I know I originally posted this in the screenshots/videos thread, but I thought I'd give it its own thread. Also, I'll explain in more detail.
This is my first attempt, where I found out that the collision wasn't quite right. I later found that the collision was in a separate file:


This is my attempt at vertex shading. Stages such as Master 2 use this:

This is my custom texture test. You can tell what it's a picture of:

I tried SMB2, the files were exactly the same:


I later edited the lz file (which is compressed). My first attempts crashed the game, but later attempts I placed some objects.

Note that none of these have the correct collision, or in the case of the last one, has no collision at all. And there you have it. Me hacking Super Monkey Ball! Seriously!

Pages: [1]