|
Post by Tom Maneiro on Jul 24, 2004 11:10:19 GMT -5
i was doing some wacky experiments with some Genesis ROMs, and i managed to extract a Magical intro from a Doraemon game. While doing this, i've discovered that &H05 24-bit value can define ROM entrypoint (may be not new for some users there....), and i even added that intro in one of my demo games coded with BasiEgaXorz. Talking about this, i tried to add a custom program applying the same trick for get it working as an intro, and surprise! some programs crashes the ROM, and some others (like BasiEgaXorz programs) jumps to a location near from &H0200 (normal ROM entrypoint), before reaching main program code (i suppose that is the initialization stuff). I want to use something like this:
intro: print "Hacked by Tom" sleep 120 asm "jmp $0200"
Yes, i am not an assembler guru, but at least know what does the instruction "jmp", and what it does. I made an small demo using these code, and it works, but when attaching it to a ROM, there's a point while demo jumps to &H0224 or something near (due it was hardcoded in the ROM). Is there a way to change ROM base address (at least in BasiEgaXorz) without wasting hours recoding bit by bit? For example to change from 0x0200 to something like 0xF000, and appplying this for the rest of ROM. I don't know how the Magical intros work, but if somebody are interested, i can post these intro here.
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Jul 25, 2004 23:06:56 GMT -5
The reason it dun work is b/c a basiegaxorz compiled rom is originated at address 0. The main subroutines that does all the displaying and etc is part of the first couple of kilobytes in the rom. moving the origination address to some other address will mess it up, since all jump are made using absolute addresses.
The only way to make this work is to compile your basic source code as a "sega program". "sega programs" originate at address $200000. To tack your basic program into your rom, you will need to pad the rom to $200000 bytes (2 megabytes). Then you can stick your compiled source code at $200000, and then change the jump pointer at $4.l to $200000. This is very similiar to the method you have already been using, except that you need to compile your source code as a "sega program", and move the code to $200000. Also, this makes small roms appear huge (>2mb), and this will not work with roms that are already bigger than 2mb.
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Jul 26, 2004 1:15:31 GMT -5
|
|
|
Post by Tom Maneiro on Jul 29, 2004 13:13:19 GMT -5
hmmm... nice app ;D
EDIT: Man, your app is so SLOOOOOOOOW!
EDIT2: It works very well.... but is there any way to define a "base entrypoint" for a program, instead of use fixed values?
For example
Option Entrypoint &H100000
and for asm: move blah,entrypoint+xxx
If this is not too hard (i.e. forcing to a major program rewrite), it should be implemented on next BasiEgaXorz version.
|
|
|
Post by Tom Maneiro on Jul 29, 2004 18:06:09 GMT -5
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Aug 6, 2004 0:30:30 GMT -5
damn, i removed 7zip from my computer
also, reallocating the code in basiegaxorz isn't possible yet, but its an easy fix
|
|
|
Post by Tom Maneiro on Aug 20, 2004 18:38:47 GMT -5
well... go to reinstall it, 'cause: 1)Zip is doomed... it will dead soon. 2)i only release sourcecode in 7z for web space saving purporses. 3)Please, support open source!!!! ;D ;D ;D
|
|