English Amiga Board


Go Back   English Amiga Board > Other Projects > project.CD32 Conversion

 
 
Thread Tools
Old 27 May 2016, 07:27   #801
earok
Registered User

 
Join Date: Dec 2013
Location: Auckland
Posts: 2,319
Re: Jungle Strike.. could you run an NTSC mode utility before opening the executable, and see if that works?

From memory the Jungle Strike CD32 executable runs from HDD anyway, so theoretically no WHDLoad required.
earok is offline  
Old 27 May 2016, 11:43   #802
Whitesnake
Martin Shaw

Whitesnake's Avatar
 
Join Date: Nov 2005
Location: United Kingdom
Posts: 400
Quote:
Originally Posted by earok View Post
Re: Jungle Strike.. could you run an NTSC mode utility before opening the executable, and see if that works?

From memory the Jungle Strike CD32 executable runs from HDD anyway, so theoretically no WHDLoad required.
I tried that once before with an NTSC switch program on aminet, When Jungle Strike CD32 starts it switches back to 50hz. However on WinUAE you can switch it back to NTSC in the emulator settings while the game is running and it runs good. Also centers the image nicely.
Whitesnake is offline  
Old 27 May 2016, 19:31   #803
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,092
I can patch the executable if you want. Well I did not find any references to BEAMCON0. Maybe more difficult than that...

Last edited by jotd; 27 May 2016 at 19:36.
jotd is offline  
Old 27 May 2016, 20:16   #804
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 46
Posts: 7,585
Quote:
Originally Posted by jotd View Post
I can patch the executable if you want. Well I did not find any references to BEAMCON0. Maybe more difficult than that...
Set in the copperlist?
Galahad/FLT is offline  
Old 27 May 2016, 22:42   #805
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,092
Quote:
Originally Posted by Galahad/FLT View Post
Set in the copperlist?
yeah did not think of that one. But since Whitesnake could switch to NTSC after having started it, either it is in a early copperlist, not in the game, or it uses a system call to force PAL.
Well, I could do a nasty hack which works most of the time if game ran from CD32load (Jungle Strike works): forcing display when FlushCache is called from the slave. Works for redirecting joypad to keys on 68000.

Edit: tested it with CD32load & floppy version: NTSC option does the trick. HDD option must call some system screenmode stuff that forces PAL.

Last edited by jotd; 28 May 2016 at 10:12.
jotd is offline  
Old 29 May 2016, 13:53   #806
earok
Registered User

 
Join Date: Dec 2013
Location: Auckland
Posts: 2,319
Thanks to JOTD I've been able to compile CD32Load again


I've zoned a virtual mouse fix. The problem was (as previously reported in the other thread) in Hunter it autoclicked through menus on real hardware, I'm not totally sure what was causing the issue but removing some POTGO related stuff I was doing (an attempt to emulate right mouse click) seemed to fix it.

(The downside of this is that there's no right mouse emulation, but that didn't seem to work anyway.. I'll have another go at fixing that in the future)


Edit: I've just left the binary up there without the new virtual mouse source code, it's bit of a mess so it's not worth integrating with main CD32Load until I've at least gone through and tidied it up.

Last edited by earok; 29 May 2016 at 13:59.
earok is offline  
Old 29 May 2016, 16:06   #807
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,092
I just played Desert Strike with whdload but I killed the agent with a missile instead of picking him up!! Damn!
jotd is offline  
Old 29 May 2016, 17:55   #808
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,814
Remaining hang/grinding bug seems to be caused by bug in cd loader (I have seen same to happen with RNC loader in some games), if command buffer wraps around, loader fails to put checksum byte in correct place, this causes drive to return checksum error which confuses the loader in some situations (usually it just retries but it seems to cause trouble if "led off"/pause command at the end of load triggers it)

Explanation for difference in emulation vs real cd32 is quite simple, it is not fully known when drive returns status reports causing wraparound bug situation to be not happen or happen somewhere else.

for example:

IN CMD=05 IDX=0xFE-0x03 LEN=2:C5 00 (00) checksum error

Command's first byte is at 1F0200+FE, command length is 2 bytes (+1 checksum byte), 0xFF is second byte, checksum should be at 0x00 but loader actually puts it at 0x100! (so wraparound check is missing).

This should be easy fix, even without sources. It seems to be this code: Oddly it has no wraparound handling at all, except D2 add which correctly uses .B (A1 points to 1f0200)

Code:
 001FF8A0 226c 001c                MOVEA.L (A4, $001c) == $001ffcd6,A1
 001FF8A4 d3c2                     ADDA.L D2,A1
 001FF8A6 d401                     ADD.B D1,D2
 001FF8A8 70ff                     MOVE.L #$ffffffff,D0
 001FF8AA 9010                     SUB.B (A0),D0
 001FF8AC 12d8                     MOVE.B (A0)+,(A1)+
 001FF8AE 5301                     SUB.B #$00000001,D1
 001FF8B0 66f8                     BNE.B #$fffffff8 == $001ff8aa
 001FF8B2 1280                     MOVE.B D0,(A1)
 001FF8B4 5202                     ADD.B #$00000001,D2
I think it should be something like this:

moveq #-1,d0
.copy1
sub.b (a0),d0
move.b (a0)+,0(a1,d2.w) ;command bytes
addq.b #1,d2
subq.b #1,d1
bne.s .copy1
move.b d0,0(a1,d2.w) ;checksum byte
addq.b #1,d2


This handles wraparound automatically.

Grinding probably happens when data load finishes but pause command fails due to checksum error and without pause laser continously reseeks back to last read sector.
Toni Wilen is offline  
Old 29 May 2016, 19:02   #809
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,092
Thanks Toni, I think I got it. Pity I'll have to patch Psygore's binary loader instead of source, but I'll do it, and will check at least with WinUAE if it still work, and then will test on real hardware.
jotd is offline  
Old 29 May 2016, 19:51   #810
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 46
Posts: 7,585
Quote:
Originally Posted by jotd View Post
Thanks Toni, I think I got it. Pity I'll have to patch Psygore's binary loader instead of source, but I'll do it, and will check at least with WinUAE if it still work, and then will test on real hardware.
Rob Northens code generally resources with no problems whatsoever Jeff.
Galahad/FLT is offline  
Old 29 May 2016, 21:29   #811
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,092
Not a problem. I'll patch Psygore code, I found the location. It's just that Psygore did not provide the source and now he's AWOL.

Edit: applied your patch but did nothing good: the code now cannot init CD drive. Anyway, that seems logical: the data in the buffer is now stored some other way, not only the checksum right? So the rest of the code should be adapted too or it will not work...

Edit2: wrong use of D2 in your patch. I use zeroed D3 (and save it!)

Code:
	move.w	d3,-(a7)
	clr.w	d3
.copy1
	sub.b (a0),d0
	move.b (a0)+,0(a1,d3.w) ;command bytes
	addq.b #1,d3
	subq.b #1,d1
	bne.s .copy1
	move.b d0,0(a1,d3.w) ;checksum byte
	move.w	(a7)+,d3
Now it runs on WinUAE. Needs to be tested on real hardware to see if it changes something.

Last edited by jotd; 29 May 2016 at 22:18.
jotd is offline  
Old 30 May 2016, 18:10   #812
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,814
Quote:
Originally Posted by earok View Post
I've zoned a virtual mouse fix. The problem was (as previously reported in the other thread) in Hunter it autoclicked through menus on real hardware, I'm not totally sure what was causing the issue but removing some POTGO related stuff I was doing (an attempt to emulate right mouse click) seemed to fix it.
Do you mean it did not happen in emulation? If yes, describe this in detail

Edit: I've just left the binary up there without the new virtual mouse source code, it's bit of a mess so it's not worth integrating with main CD32Load until I've at least gone through and tidied it up.

Quote:
Originally Posted by jotd View Post
Edit2: wrong use of D2 in your patch. I use zeroed D3 (and save it!)
Your code can't be right. (Command start offset is now always zero)

My suggestion was nearly correct: Both "ADD.L D2,A1" and "ADD.B D1,D2" must be removed (D2 = command start offset, D1 = command length, copy loop does the addition now).
Toni Wilen is offline  
Old 30 May 2016, 19:32   #813
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,092
fortunately i did not burn a cd to test this fiasco! thanks, and thanks for contributing to the vm stuff too. if your cd fix is working, a lot more games will suddenly work, possibly all those running on winuae

question 1: my wrong code works on winuae. is it normal?
question 2: i had added delays after cd reads. are they still needed?

Edit: just applied the changes you suggested, and Stardust works on WinUAE (it did not work before!)

So I guess this has done something! I can't wait to test on real hardware, will do tonight.

Edit: tested on real hardware, well, it's worse. No grinding, right, but loading is awfully slow compared to the previous loader with the potential problem.
And Mortal Kombat II still fails with an error like before.
That plus the isocdWin test I did: bad day for the wrongly-burned CDs.

Last edited by jotd; 30 May 2016 at 23:32.
jotd is offline  
Old 31 May 2016, 02:20   #814
earok
Registered User

 
Join Date: Dec 2013
Location: Auckland
Posts: 2,319
Toni, I think the version of Hunter that's online (http://cd32covers.blogspot.co.nz/201...nter-cd32.html) has different behaviour on WinUAE and HW, on WinUAE I think virtual mouse clicks (from port 2) work fine but on real HW it auto clicks.

I take full blame for this though, my "virtual mouse" implementation was ill-thought out and not properly developed. I no longer attempt to emulate the right mouse button (eg press RMB on port 2 to trigger RMB on port 1) so I no longer touch the POTGO at all.
earok is offline  
Old 31 May 2016, 08:18   #815
StatMat
Code Fiddler
StatMat's Avatar
 
Join Date: Apr 2016
Location: UK
Age: 44
Posts: 53
Quote:
Originally Posted by jotd View Post
Edit: tested on real hardware, well, it's worse. No grinding, right, but loading is awfully slow compared to the previous loader with the potential problem.
And Mortal Kombat II still fails with an error like before.
That plus the isocdWin test I did: bad day for the wrongly-burned CDs.
Oh dear. Did ISOCD-Win create some bad images? Sorry if that was the case.
StatMat is offline  
Old 31 May 2016, 08:24   #816
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,814
Quote:
Originally Posted by jotd View Post
Edit: tested on real hardware, well, it's worse. No grinding, right, but loading is awfully slow compared to the previous loader with the potential problem.
And Mortal Kombat II still fails with an error like before.
Image please.

This is much "better" difference than a hang

Quote:
Originally Posted by earok View Post
Toni, I think the version of Hunter that's online (http://cd32covers.blogspot.co.nz/201...nter-cd32.html) has different behaviour on WinUAE and HW, on WinUAE I think virtual mouse clicks (from port 2) work fine but on real HW it auto clicks.
Does it also happen if real normal joystick is connected? (not cd32 pad)

Quote:
I take full blame for this though, my "virtual mouse" implementation was ill-thought out and not properly developed. I no longer attempt to emulate the right mouse button (eg press RMB on port 2 to trigger RMB on port 1) so I no longer touch the POTGO at all.
It does not matter if it is wrong or not
Toni Wilen is offline  
Old 31 May 2016, 09:44   #817
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,092
Quote:
Originally Posted by StatMat View Post
Oh dear. Did ISOCD-Win create some bad images? Sorry if that was the case.
Yes it did, but it was subtle: the image booted on winuae, not on the real console.
the CD looks like all the data is there, but boot is not visible.

@Toni: I'll create a small ISO with new "fixed" version. Personally I prefered the old behaviour with occasional grindings because new loader is slooooowwwwwww and does not seem to fix more stuff on real HW.
but I think you are on the right track, because Stardust works now on WinUAE (do you explain that??) whereas you said the change had no impact on WinUAE.
jotd is offline  
Old 31 May 2016, 10:21   #818
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,814
Quote:
Originally Posted by jotd View Post
Yes it did, but it was subtle: the image booted on winuae, not on the real console.
the CD looks like all the data is there, but boot is not visible.
Does it read if you boot from floppy disk?

Sounds like some physical problem with the CD or TOC has something that CD32 CD microcontroller fails to understand.

Quote:
@Toni: I'll create a small ISO with new "fixed" version. Personally I prefered the old behaviour with occasional grindings because new loader is slooooowwwwwww and does not seem to fix more stuff on real HW.
but I think you are on the right track, because Stardust works now on WinUAE (do you explain that??) whereas you said the change had no impact on WinUAE.
The more differences in behavior, the more clues we have to find the actual reason.
Toni Wilen is offline  
Old 31 May 2016, 12:30   #819
StatMat
Code Fiddler
StatMat's Avatar
 
Join Date: Apr 2016
Location: UK
Age: 44
Posts: 53
Quote:
Originally Posted by jotd View Post
Yes it did, but it was subtle: the image booted on winuae, not on the real console.
the CD looks like all the data is there, but boot is not visible.

@Toni: I'll create a small ISO with new "fixed" version. Personally I prefered the old behaviour with occasional grindings because new loader is slooooowwwwwww and does not seem to fix more stuff on real HW.
but I think you are on the right track, because Stardust works now on WinUAE (do you explain that??) whereas you said the change had no impact on WinUAE.
I see. I'm sorry to hear that. Any chance could also provide an ISO created from the same files with ISOCD-Win such that I can diff them to see what differences there are?
StatMat is offline  
Old 31 May 2016, 21:34   #820
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,092
Toni: I built a .ISO with a small sample of games, including MK2 that does not work on real hardware.
https://www.dropbox.com/s/oizz6gubm9bgbe4/TONI.zip?dl=0

instructions about where to find the routine location (patched according to your instructions) inside the .zip

Statmat: https://www.dropbox.com/s/3vzl0ovfyl...diffs.zip?dl=0
ISOCD & ISOCDWin same data, no layout for ISOCD
jotd is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.11488 seconds with 13 queries