swapd0 Posted February 6, 2022 Share Posted February 6, 2022 This is my cartridge boot code, it just copy the code to address 0x4000 and jumps there, but it doesn't work with TombRaider. But if I upload the out.jag file to the Jaguar RAM at 0x4000 and have "this" ROM burned into the skunk board it works (I need it to load the assets). What on the hell I'm doing wrong?, there are any difference (jaguar status) when I press up to launch the ROM and when I upload something using jcp? This is driving me crazy. ? .include "jaguar/jaguar.inc" .org ROM + $2000 boot_code: move.w #$2700,sr ; disable all interrups move.w #0xffff,VI lea code_start,a0 lea $4000.w,a1 move.l #code_end,d7 sub.l a0,d7 asr.l #2,d7 .loop: move.l (a0)+,(a1)+ dbf d7,.loop jmp $4000.w .long assets: .incbin "assets.fs" .long code_start: .incbin "out.jag" .long code_end: Quote Link to comment Share on other sites More sharing options...
42bs Posted February 6, 2022 Share Posted February 6, 2022 (edited) Is out.jag a pure binary? JCP will strip a header. I will check my JagTris code, where I do the same. Edited February 6, 2022 by 42bs Quote Link to comment Share on other sites More sharing options...
swapd0 Posted February 6, 2022 Author Share Posted February 6, 2022 out.jag has no header, also I'm using this in BurgerTom and it works. Quote Link to comment Share on other sites More sharing options...
42bs Posted February 6, 2022 Share Posted February 6, 2022 What about the size? Is it <= 256k? Did you try subq.l/bne instead dbra? Quote Link to comment Share on other sites More sharing options...
swapd0 Posted February 6, 2022 Author Share Posted February 6, 2022 (edited) out.jag is 291,574 bytes. By the way, it hangs before C main() function is called. Edited February 6, 2022 by swapd0 Quote Link to comment Share on other sites More sharing options...
42bs Posted February 6, 2022 Share Posted February 6, 2022 You cannot copy with dbra then. Dbra uses the lower 16bits of the register. You need a sub.l #0x10000,D7 after the dbra. 2 Quote Link to comment Share on other sites More sharing options...
42bs Posted February 6, 2022 Share Posted February 6, 2022 Or copy 8 byte wise. Quote Link to comment Share on other sites More sharing options...
swapd0 Posted February 6, 2022 Author Share Posted February 6, 2022 1 hour ago, 42bs said: You cannot copy with dbra then. Dbra uses the lower 16bits of the register. You need a sub.l #0x10000,D7 after the dbra. Lol, what a stupid mistake!, it was a long time ago since I don't code for the 68000, only small routines, I bet that with a debugger I could find it very quickly. 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted February 7, 2022 Share Posted February 7, 2022 6 hours ago, swapd0 said: Lol, what a stupid mistake!, it was a long time ago since I don't code for the 68000, only small routines, I bet that with a debugger I could find it very quickly. I know this. I mainly program ARM (work) and 65C02 (fun). When I switch to 68K or GPU/DSP I need to check back with the manual for certain opcodes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.