English Amiga Board


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

 
 
Thread Tools
Old 23 February 2016, 22:42   #401
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 168
@jotd PM sent
jayminer is offline  
AdSense AdSense  
Old 23 February 2016, 23:16   #402
Amigajay
醉拳
Amigajay's Avatar
 
Join Date: Jan 2010
Location: England
Posts: 1,727
Quote:
Originally Posted by jotd View Post
@amigajay:
Parasol Stars works fine here with RNCD option on Winuae.
To slow down the Bubble Bobble game use NOCACHE
Thanks for BB trick, works fine now on cd32load.

Still no luck with Parasol Stars though, what version slave are you using 1.4? I'm using the rncd option (otherwise it doesn't load at all) on winuae too.
Amigajay is online now  
Old 24 February 2016, 09:52   #403
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,205
@earok: Jurassic Park starts with RESLOAD_TOP=0x1E0000 but locks up just before game.
Probe games don't seem to like Psygore CD loader (or the contrary )

That gives matter for thought! I'm still struggling with a few games that refuse to work. When I find the root cause for that, we'll have made progress.

Edit: I have found the cause of the problem (which hopefully could explain the lockup of Parasol Stars)

The Psygore CD routine seems to return to those games (Probe) with repeated & infinite level 2 interrupts. Even if the interrupts are cleared (intreq), it happens over and over, and never gets out of it, hence the lockup.
I'm not very good at understanding interrupts but I suppose that the CD hardware keeps sending level 2 interrupts (not keyboard!) after the Psygore routine has returned, and the keyboard handling routine is not able to clear it properly: even if INTREQ is cleared, the CIAs re-trigger the interrupts somehow (maybe a timer interrupt with a timeout of 0)
Only happens in a few games.

What could we do to prevent that from happening? We're close to a solution if we do.

Prince Of Persia crashes with Psygore OR RN loader, so RN loader must do some bad stuff too.

Last edited by jotd; 24 February 2016 at 10:14.
jotd is offline  
Old 24 February 2016, 11:23   #404
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,174
At least when using ROM driver, it can keep generating many interrupts after last requested CD sector has been read. It always requests CD hardware to DMA current + following 15 sectors (Hardware can automatically, without software help, transfer max 16 sectors at once), each transferred sector generates an interrupt.

Clearing B80008.L will disable all Akiko CD interrupts. B80004.L is interrupt request register.

btw, UAE does not emulate Akiko (or CDTV) CD DMA contention. This combined with above prefetch feature may explain the difference between real and emulated behavior.

Unfortunately I don't know what kind of DMA sequences it uses. Does it always transfer whole CD sector at once (stealing all CPU cycles during the transfer), or is there some kind "blitter nasty" priority level? Or does it transfer for example 16 bytes at once, then wait for some internal buffer to fill and next 16 bytes and so on.
Toni Wilen is online now  
Old 24 February 2016, 13:10   #405
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,205
once again Toni without you we wouldn't have the solution:

before calling Psygore routine, I just move -1 => B80008, and clear it on exit. Mortal Kombat now works!!
I'll post a beta in a few hours. Worth a shot with Parasol Stars on real HW.
jotd is offline  
Old 24 February 2016, 13:14   #406
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,174
Quote:
Originally Posted by jotd View Post
once again Toni without you we wouldn't have the solution:

before calling Psygore routine, I just move -1 => B80008, and clear it on exit. Mortal Kombat now works!!
I'll post a beta in a few hours. Worth a shot with Parasol Stars on real HW.
I'd recommend not to set all bits, there are undefined bits and some interrupt bits that probably should not be enabled when only doing normal CD reads (no audio playing).

It is read-write register, (not write-only), just store the original value first. It probably is also good idea to zero interrupt request Akiko register before enabling any interrupts to prevent accidental spurious interrupts.
Toni Wilen is online now  
Old 24 February 2016, 13:59   #407
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 168
@jotd Souds great, I can try it on real HW right away after you release it!
jayminer is offline  
Old 24 February 2016, 16:22   #408
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,205
in da zone!
jotd is offline  
Old 24 February 2016, 16:28   #409
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,174
It probably is also good idea to clear B80024.L to disable all Akiko DMA, it also aborts all still active transfers.

EDIT: Actually it is safer to only clear bits 27, 29, 30 and 31 (DMA bits) and not touch other bits (flags/control bits).

Last edited by Toni Wilen; 24 February 2016 at 17:05.
Toni Wilen is online now  
Old 24 February 2016, 17:16   #410
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 168
Quick report, Parasol Stars works fine on real hardware now with Psygores loader! Awesome work guys

Gonna do some more testing now!
jayminer is offline  
Old 24 February 2016, 17:43   #411
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 168
I'm guessing it's because interrupts are being disabled, but there are lots more audio-hiccups in this version when a game is loading from CD while playing music :/
jayminer is offline  
Old 24 February 2016, 19:08   #412
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 168
This might be a little off-topic, but I'd thought I'd share since I'm very happy with how this all worked out and it might perhaps be off interest to people in this thread.

I have been working on automating the building of the CD I'm working on and found that ISOCD actually has some arguments for batch-building ISO:s, the biggest hurdle was that it requires a layout-file and the layout-file can not be generated from CLI, it requires the use of it's GUI - and must be updated if directories are added or removed to the CD.

Thankfully patrik (the other guy working on this CD) took a look at the layout-file and made a python-script that can generate a ISOCD-compatible layout-file eliminating the need to use the GUI for anything.

Here's a quick video I made of how easy it now is for me to make an updated iso:
[ Show youtube player ]

And here are links to the scripts used:
http://driar.se/cd32scripts/

I added some comments to the bash-script hopefully explaining how things work, the only really undocumented thing is the inetd-part on the amiga-side, but all I did was add a service called buildcd under the host OS (in my case Linux so I added it to /etc/services and assigned port 1234 to it) and then added a line to inetd under AmigaOS to launch my script from C:build_cd32cd.

Hope this can help someone, it really saves me time each time I make a small change and want to update my iso
jayminer is offline  
Old 25 February 2016, 02:50   #413
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,205
@Toni: duly noted, thanks. Prince of Persia does not like the last CD access when reading highscores, RN or Psygore loader: still crashes.

@jayminer: AWESOME news for CD32load & ISO! I'll probably switch to windows (dark) side for Python. I already made a script to scan the "GAMES" directory and generate launch commands for each game according to a CSV file (scanning the slave info in the .slave file, computing which "data" directory to use, detecting XPKF-packed files and generating the unpacking commands on the amiga side)
Patrik is one python freak! I am another! Python completes nicely ASM or other low-level language.
Maybe it would even be possible to run ISOCD in batch mode from Vamos (windows 68k command line emulation). Couldn't make it work ATM, but I will

About the music not playing while loading, wasn't it like this before?
You can try NOCDFREEZE tooltype and tell me if it's better. But maybe RN loader allows that, but not Psygore's.
For os-swap nostalgics, I can even reproduce OS flashing by turning off DMA while loading Let me know I'll add a OSFLASH tooltype
jotd is offline  
Old 25 February 2016, 03:08   #414
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,205
Nice Windows/WinUAE communication stuff! Sound complicated on the amiga side, and the "NC" command I don't know of.
I was wondering if Patrik's script could be run from Amiga/WinUAE side, using Python 2.3 for Amiga? That would create a native solution, and maybe wouldn't even need an amiga script. Everything could be python-driven on the amiga side.
(we should create a separate thread for this)

Patrik seems to know a lot about ISO. Why wouldn't he write a ISO creator with CD32.TM support, in Python / batch mode ? He has ISOCD image as reference. Maybe it's not that difficult, and would provide a standalone/scripted solution to create ISOs.
That's something I could be interested in doing too (but I'd have to read a lot about ISO format first).

Last edited by jotd; 25 February 2016 at 03:20.
jotd is offline  
Old 25 February 2016, 06:52   #415
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,205
Toni, I have zoned a CD ISO (created thanks to Patrik layout creator in batch mode thanks for that, I'll post the Windows port)

It boots Prince Of Persia with a modified CD32Load version. When the screen has cycling colors, break and search for "SHIT" string (sorry!!). You'll find it around 001F58D0

Here is the CD32load code where it re-enables the interrupts after having loaded "prince.high" from CD.

Code:
	and.l	#$0FFFFFFF,AKIKO_DMA
	move.l	#0,AKIKO_INTREQ	; disable all Akiko CD pending interrupts
	move.l	#0,AKIKO_INTENA	; disable all Akiko CD interrupts
	
	TSTVAR_L	nocdfreeze_flag
	bne.b	.norestore		; if flag is set, then don't freeze interrupts when loading
	or.w	#$8000,D4
	move.l	#"SHIT",$1D0000
	move.w	#$7FFF,$DFF09C	; clear interrupt requests
	move.w	D4,$dff09a	; restore interrupt register state
	move.l	#"HELP",$1D0000
Break around there, and you'll see that you never reach move HELP: an interrupt occurs just after interrupts have been re-enabled.

Can you help? thanks
jotd is offline  
Old 25 February 2016, 08:40   #416
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,174
Quote:
Originally Posted by jotd View Post
Break around there, and you'll see that you never reach move HELP: an interrupt occurs just after interrupts have been re-enabled.
Which interrupt? Set UAE debugger breakpoint or memwatch point to break just before INTREQ write, then trace over the INTREQ, where does it jump? (which interrupt vector). Any CIA interrupts enabled?

Or enable interrupts one by one until something happens?

(I guess UAE debugger should also collect interrupt state internally, when and what interrupt started where. INTREQ bits are not that helpful when there is extra interrupt lines connected to interrupt levels 2 and 6)
Toni Wilen is online now  
Old 25 February 2016, 09:05   #417
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,205
Toni

I knew that, and I have put some special code to save/restore CIA state, but I was calling this code AFTER having reenabled the interrupts.
I moved the restore code (and thus clearing the interrupt lines) BEFORE the interrupt enable and it worked. Thanks! (you don't have to test the image then!)

Funny enough this game is the only one tested where the problem appeared, and appeared both with Psygore code AND Rob Northen code. I'll test some other games that weren't working now.
jotd is offline  
Old 25 February 2016, 18:03   #418
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,205
Okay, version 0.16 is available from my website.

- Now tested on a 68000 A600/2MB too (IDE RN mode). Maybe people will use it instead of WHDLoad on low memory configurations to avoid OS flashes.
- Fixed slave data directory (had to be forced most of the time)
- Prince Of Persia now works, better compatibility with real CD32 hardware
jotd is offline  
Old 25 February 2016, 18:24   #419
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 168
@jotd: Gonna try the new CD32Load right away and start updating the trello!

Regarding the automation of the iso-creation process, I'll start a thread about it soon if no-one does it before me, so we can keep this one focused on CD32Load But I'll add this, Vamos is an idea that has crossed my mind but I don't think vamos will be able to run ISOCD since it opens it's GUI even when launched from command-line and closes it when a build is done (but if there is some error or something you need to interact with it).

Setting up the inetd-stuff wasn't hard at all though, but there may better ways to signal UAE from the terminal, it was just the easiest solution I could think of since I already had inetd. I can make a more detailed guide about it if you're interested? nc = netcat and is a simple program which just can talk to a specifik port and send and recieve raw data, kinda like telnet but without the extra stuff telnet has. It woks with telnet as well!
jayminer is offline  
Old 25 February 2016, 19:50   #420
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 168
I tried the latest version a bit, and sad to say not much at all is working for me now. I used data=data as an argument for all games launching from our menu since I like keeping all data-files in a separate directory - and whenever data=data is used CD32Load just seems to get stuck, it still shows the AmigaDOS window when it locks up if I'm running using "boot with no startup-sequence"

I had a few games on the CD without a data-directory (because of path-table stuff and RN-Loader testing) and I tried launching Parasol Stars (as usual ) and got a WHD_Abort Code $00000009. It works under FS-UAE but the data=data problem occurs there aswell.

Oh and by the way, the link on you website still points to 0.15 (http://jotd.pagesperso-orange.fr/mis...load_v0.15.zip), I just changed it manually to http://jotd.pagesperso-orange.fr/mis...load_v0.16.zip and nabbed a file, was that the correct one?
jayminer is offline  
AdSense AdSense  
 


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 12:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.12796 seconds with 15 queries