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.
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.