01 August 2008, 12:35 | #1 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Weird problem
As some of you know I am writing a WHD slave for Croak!
I have come to a particularly strange problem. I have managed to get my slave to recognise and support both the original af35 powerpacked version, and also unpacked version! The patches I have done so far work flawlessly on the uncompressed version (Inf lives and vblank timing) but for the packed version I have the strangest error with the vblank timing! The game waits 200 frames before the vblank actually kicks in. I have tested and the patch is in the right place and anything I put outside my vblank loop is executed fine, but the loop itself isn't run for the first 200 frames, despite me having it set to run every 2nd frame! Any ideas? my loop code is: Code:
_waitvb movem.l a0/a1,-(a7) lea delay(pc),a0 lea count(pc),a1 addq.l #1,(a1) subq.w #1,(a0) bne.b .skip move.w #$2,(a0) waitvb blitz clr.l (a1) .skip movem.l (a7)+,a0/a1 cmp.l #7,d0 ; code we removed rts ; return to game |
01 August 2008, 12:42 | #2 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
what are you doing with "count"? Can't see it used anywhere except for the addq.l #1,(a1)/clr.l (a1).
Edit: I guess I know what you're using count for. As for the rest, I don't think it is possible to find the problem without looking at the game code as the code for the delay is correct. |
01 August 2008, 13:11 | #3 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Hi
Quote:
Regards |
|
01 August 2008, 13:19 | #4 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
The file is an executable file which is loaded using LoadSeg(), slave uses Kick1.3 emu. resload_LoadFileDecrunch can't be used here. Last edited by StingRay; 01 August 2008 at 13:32. Reason: typo |
|
01 August 2008, 13:28 | #5 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Hi,
Quote:
Regards Last edited by Asman; 01 August 2008 at 13:47. |
|
01 August 2008, 18:45 | #6 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
LoadFileDecrunch + Relocate would work but using LoadSeg is much simpler here (and makes more sense anyway). Also, the kick1.3 emu is necessary as the game is using a lot of system functions.
|
01 August 2008, 21:57 | #7 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
the count is used simply to count up.. I used that to determine the 200 frames before it actually started executing the vblank!
I waited until blitz was called (freeze system) and then I checked the location held in count! |
01 August 2008, 22:44 | #8 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
I have now checked the offsets of the crunched file in comparison to the uncrunched file and it's err.. identical, 100% identical.. so why is it doing this?
|
02 August 2008, 01:40 | #9 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Initial value of delay getting messed up most likely. A pointer stepping outside its supposed bounds and writing delay by mistake perhaps? Are you using the correct word size for reserving space and setting the delay value initially? Check the outside code, f.ex what does the code look like from where you jump into _waitvb? There's nothing wrong in the _waitvb routine itself.
|
02 August 2008, 04:15 | #10 |
Total Chaos AGA is fun!
Join Date: Jun 2005
Location: USA
Posts: 873
|
Powerpacker is trashing some memory. I have seen it trash ram before. That is why I generally avoid powerpacker.
|
02 August 2008, 12:42 | #11 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Quote:
- I can relocate hunks into FAST memory ( speed up ) - I can pack files ( safe disk space ) Of course LoadFileDecrunch + Relocate costs work a bit ( sometimes a lot ). Regards |
|
02 August 2008, 14:57 | #12 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
I am not using powerpacker myself. It is compressed with it on the coverdisk, and I just wanted to add direct support for the coverdisk version!
I am more than happy to decrunch it during install and using it uncompressed (it's only 151kb). The game passes the load address to a5 and then copies itself to $f2 where it does a jmp address.. I simply break into the uncompress routine and change the jsr to an rts and copy the load address to my location instead of the game. After that powerpacker is finished and I can work on patching the game itself. So in theory powerpacker cannot trash memory, esp whd memory as it is confined to the area I gave it to work with and the slave is naturally outside of this area, and the game has not been patched! |
03 August 2008, 14:21 | #13 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Leffman you are correct. I was doing the following
Code:
move.b #$75,(-1,a5) ; Make the game RTS back to slave lea _fileaddress(pc),a5 ; Change location game will put jsr address move.l a0,d0 ; Following 3 lines are code we overwrote lsr.l #2,d0 move.l d0,(a4) I put that inside a routine to test if it had been run once, and now it works fine Thanks guys for all your help.. next highscore patching |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Weird Directory Problem? | Unregistered | support.WinUAE | 5 | 18 June 2021 16:02 |
Weird problem | tesla | support.Other | 2 | 28 March 2013 01:57 |
Very weird problem | alkis21 | project.WHDLoad | 13 | 28 September 2010 20:49 |
Weird CF problem (maybe...) | squidbass | support.Other | 10 | 01 March 2009 14:45 |
Weird AIAB problem | mousenator | New to Emulation or Amiga scene | 0 | 12 May 2008 23:48 |
|
|