[hatari-devel] small bug in emutos with cartridge |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hello
adding TT ram raises quite a lot of problems, because it implies to run
the cpu with 32 bit addressing, while up to now Hatari was more likely
to run in 24 bit mode.
In 24 bit mode, upper 8 bits are ignored, so if an address has "garbage"
in the upper byte, it is masked anyway with something like 0x00ffffff.
So, while booting emutos 0.9.3 with my devel version in 32 bit mode,I
notice I get a crash during the boot (it displays emutos' debugger
screen after a bus error).
The problem is when emutos tries to run our cartridge code located at
$fa0000 that we use for HD emulation.
Emutos does :
$e0010e : 41f9 00fa 0000 lea $fa0000,a0
$e00114 : 0c98 abcd ef42 cmpi.l #$abcdef42,(a0)+
$e0011a : 6600 0020 bne $e0013c
$e0011e : 0128 0004 btst d0,4(a0)
$e00122 : 6700 0010 beq $e00134
$e00126 : 48e7 fffe movem.l d0-d7/a0-a6,-(sp)
$e0012a : 2068 0004 movea.l 4(a0),a0
$e0012e : 4e90 jsr (a0)
But the TOS does :
$e00bbc : 41f9 00fa 0000 lea $fa0000,a0
$e00bc2 : 0c98 abcd ef42 cmpi.l #$abcdef42,(a0)+
$e00bc8 : 6622 bne.s $e00bec
$e00bca : 0128 0004 btst d0,4(a0)
$e00bce : 6716 beq.s $e00be6
$e00bd0 : 48e7 fffe movem.l d0-d7/a0-a6,-(sp)
$e00bd4 : 2028 0004 move.l 4(a0),d0
$e00bd8 : c0bc 00ff ffff and.l #$ffffff,d0
$e00bde : 2040 movea.l d0,a0
$e00be0 : 4e90 jsr (a0)
See the difference ? Address is masked with $ffffff before doing the
jsr. In Emutos, the jsr is made directly without masking, but as the
value at $fa0008 is 08FA023E ... bang! bus error in 32 bit mode :(
(upper byte at $fa0008 is used to choose the boot order, so it's not 0)
So, emutos can't run for now in TT mode with the 68030 in 32 bit mode
and HD emulation (using fake cartridge at $fa0000) at the same time
under Hatari.
A new 0.9.4 version will be needed soon :)
Nicolas