Hello, I'm trying to port snes9x to the GP2X (just for fun, I know it's already done)
Now I got it compiling and added some code to initialise snes9x and load a ROM (and try to play it)
now first I get some warning when compiling it that could cause the malfunction like these:
---------------------------
594 D:\temp\snes9x-1.5-src\snes9x-1.5-src\srtc.cpp [Warning] right shift count >= width of type
595 D:\temp\snes9x-1.5-src\snes9x-1.5-src\srtc.cpp [Warning] right shift count >= width of type
----------------
(I downloaded the 1.5 source from snes9x.com)
I don't know if that part could cause any troubles.
The port crashes at the main loop of snes9x. Here is the debugging output (on the gp2x itself)
---------------------------------
Found ROM file header (and ignored it)."CHRONO TRIGGER" [checksum ok] HiROM, 32M
bits, Type: ROM+RAM+BAT, Mode: 21, TV: NTSC, S-RAM: 8KB, ROMId: ACTE Company: C3
CRC32: 2D206BF7LOADING ROM DONE
Program received signal SIGSEGV, Segmentation fault.
0x000477a4 in Immediate8 (a=JUMP) at cpuaddr.h:158
158 cpuaddr.h: No such file or directory.
in cpuaddr.h
(gdb) backtrace
#0 0x000477a4 in Immediate8 (a=JUMP) at cpuaddr.h:158
#1 0x0005af7c in Relative (a=JUMP) at cpuaddr.h:194
#2 0x0005c754 in Op80Slow () at cpuops.cpp:1591
#3 0x00046544 in S9xMainLoop () at cpuexec.cpp:273
#4 0x0000ae30 in main (argc=1, argv=0xbffffdf4) at main.cpp:158
----------------------------------
as you can see the rom is loaded (chrono trigger), but somewhere in the inline function:
-----
STATIC inline uint8 Immediate8 (AccessMode a) {
uint8 val = CPU.PCBase[Registers.PCw];
-----
(at the second line) it goes wrong. (segmentation fault)
At the point of the error, CPU.PCBase = 0x0
---
(gdb) print CPU.PCBase
$1 = (uint8 *) 0x0
---
Now I am not really into emulators, so I can't easily find out what's wrong. Maybe someone with knowledge of snes9x has any idea where this error comes from?
or maybe knows a good way to find out where the error comes from?
thanks!
Now I got it compiling and added some code to initialise snes9x and load a ROM (and try to play it)
now first I get some warning when compiling it that could cause the malfunction like these:
---------------------------
594 D:\temp\snes9x-1.5-src\snes9x-1.5-src\srtc.cpp [Warning] right shift count >= width of type
595 D:\temp\snes9x-1.5-src\snes9x-1.5-src\srtc.cpp [Warning] right shift count >= width of type
----------------
(I downloaded the 1.5 source from snes9x.com)
I don't know if that part could cause any troubles.
The port crashes at the main loop of snes9x. Here is the debugging output (on the gp2x itself)
---------------------------------
Found ROM file header (and ignored it)."CHRONO TRIGGER" [checksum ok] HiROM, 32M
bits, Type: ROM+RAM+BAT, Mode: 21, TV: NTSC, S-RAM: 8KB, ROMId: ACTE Company: C3
CRC32: 2D206BF7LOADING ROM DONE
Program received signal SIGSEGV, Segmentation fault.
0x000477a4 in Immediate8 (a=JUMP) at cpuaddr.h:158
158 cpuaddr.h: No such file or directory.
in cpuaddr.h
(gdb) backtrace
#0 0x000477a4 in Immediate8 (a=JUMP) at cpuaddr.h:158
#1 0x0005af7c in Relative (a=JUMP) at cpuaddr.h:194
#2 0x0005c754 in Op80Slow () at cpuops.cpp:1591
#3 0x00046544 in S9xMainLoop () at cpuexec.cpp:273
#4 0x0000ae30 in main (argc=1, argv=0xbffffdf4) at main.cpp:158
----------------------------------
as you can see the rom is loaded (chrono trigger), but somewhere in the inline function:
-----
STATIC inline uint8 Immediate8 (AccessMode a) {
uint8 val = CPU.PCBase[Registers.PCw];
-----
(at the second line) it goes wrong. (segmentation fault)
At the point of the error, CPU.PCBase = 0x0
---
(gdb) print CPU.PCBase
$1 = (uint8 *) 0x0
---
Now I am not really into emulators, so I can't easily find out what's wrong. Maybe someone with knowledge of snes9x has any idea where this error comes from?
or maybe knows a good way to find out where the error comes from?
thanks!