09 March 2019, 18:17 | #841 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,303
|
this timing issue looks like a legend. It is a legend, except for the CD32 buttons. I've zoned 2 source files that I'm using for my whdload slaves (read the buttons, read the whole joystick).
It has been elaborated various EAB threads (the authors are mentionned) - original code by asman with timing fix by wepl "getting joypad keys (cd32)" http://eab.abime.net/showthread.php?t=29768 - adapted to single read of both joysticks thanks to Girv - added detection of joystick/joypad by JOTD, thanks to EAB thread: http://eab.abime.net/showthread.php?...51#post1175551 |
09 March 2019, 18:54 | #842 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
I've highlighted in Red the calls where the 2nd button reads/writes are done. It would seem I'm doing things the wrong way round... Each frame I read POTGOR then write to POTGO straight afterwards. I probably should write to POTGO straight after the vertical blanking wait, then read the buttons much later in the frame. Code:
.wait: bsr WAIT_FOR_VERTICAL_BLANK tst.w RYGAR_LIVES bmi .start_game bsr CHECK_EVENTS tst.w d0 bmi.s .wait bsr UPDATE_TIMER bsr CYCLE_COLOURS bsr PAN_CAMERA_POSITION ; Read POTGOR bits here move.w #$c000,POTGO(a5) bsr SANCTUARY bsr DBUFF bsr UPDATE_COPPER_SPRITES bsr COPY_BG_TO_SCREEN tst.w UPDATE_SCORE beq.s .skip_score_update clr.w UPDATE_SCORE bsr UPDATE_PLAYER_SCORE .skip_score_update IFNE DEBUG_TEXT_ENABLE bsr DEBUG_TEXT ENDC bsr ANIMATE_SPRITES bsr RESTORE_ALL_SPRITES bsr REST_DISKARM_BACKGROUND bsr BLIT_TILE_ONSCROLL_X bsr BLIT_TILE_ONSCROLL_Y bsr HDL_STONES bsr HDL_ITEMS bsr HDL_DISKARM bsr PLOT_ALL_SPRITES moveq #8,d0 bsr UPDATE_ROUND_GUIDE bsr SPAWN_ENEMIES add.l #1,FRAME_COUNTER addq.w #1,FRAME_BG bra .wait Last edited by mcgeezer; 09 March 2019 at 19:00. |
|
09 March 2019, 20:00 | #843 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Hi Geezer, I normally do a single initial write to POTGO (#$FF00).
And then you can read all joystick state in one go (per frame). This works properly for joystick with 2nd button tied to ground when closed (like on mouse). Probably the best thing to do for other configurations is an option menu in game. |
09 March 2019, 20:19 | #844 |
´040 User
Join Date: Jun 2008
Location: Emsland/Germany
Age: 51
Posts: 450
|
@mcgeezer and jeff:Okay, just I tried it with original CD32 joypad, and the main character can jump again even on the 040 CPU. (WHD and ADF Ver.) Of course the joystick I have has two buttons. I did not know that the game works only with some joysticks types correctly. (I mean the jump of course) However, it is a bit strange that jumping with joystick on a small Amiga configuration worked for a few seconds and did not work on bigger ones.
@Toni:I played the game under WinUAE with the keyboard. I had no control problems there. @Nightshft:Of course, I also noticed the graphical glitches in the game on both Amiga configurations and WinUAE. |
09 March 2019, 20:27 | #845 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Ok, I have a half guess (only half ) why it does not work in some conditions.
Geezer, PM |
09 March 2019, 20:59 | #846 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
|
Writing same value should not make any difference (except if also bit 0 is set).
But KS ROM vertical blank routine is still active and it writes $0F00 to DFF034 which surely causes issues. |
09 March 2019, 21:06 | #847 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Quote:
Just a curiosity, cut/paste: Code:
To sense whether the right mouse button is being pressed on a mouse plugged into game port 0, you must first set pin 9 to output. (i.e.: OUTLY = 1 and DATLY = 1 or write $0c00 to POTGO. For a mouse plugged into port 1, use OUTRY and DATRY instead.) Finally, wait about 300 µs for the voltage to reach the game port - and then read the status of pin 9 via the DATLY bit in POTGOR. |
|
09 March 2019, 21:27 | #848 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
|
There are capacitors in POT lines that takes some time to charge/discharge (needed for POTxDAT support) but in my measurements it only takes less than 20us when button is pressed (short to ground) but I am not sure how long it takes when output is Paula pin. (=pin is output and button is not pressed). It probably is very short delay in "digital" read mode because button needs to be almost shorted (very low resistance) for Paula to detect pressed button.
When reading analog joystick and POTGO bit 0 is set, Paula has 7 (NTSC) or 8 (PAL) scan line capacitor discharge delay. So 8 lines should be "officially" long enough Another possibility is simply almost 30 year old capacitors causing side-effects. |
09 March 2019, 21:29 | #849 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
Thanks
|
09 March 2019, 21:56 | #850 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,303
|
the workaround to avoid waiting is to read POTGOR first, then write to POTGO.
The very first read is likely to fail, but all others will work. About what Toni said: "KS ROM vertical blank routine is still active and it writes $0F00 to DFF034 which surely causes issues." The fact that it writes in DFF034 is also likely to fix the read issue for a game using OS. But I wouldn't recommend that. Irek I suggest that you try whdload version with 2-button joystick and you tell me if it works. |
09 March 2019, 22:12 | #851 | |
Registered User
Join Date: Mar 2018
Location: Austria
Posts: 617
|
Quote:
Irek you could use a multimeter to check if Button 2 connects Pin 9 with Gnd (Pin 8) or +5V (Pin 7). Whats your Joystick model if you want to tell? |
|
10 March 2019, 08:49 | #852 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
|
It would not work at all if button connects to +5v, at least when using current reading method.
I am quite sure the real cause is KS ROM POTGO writes: Line 305: POTGO_R: 5500 00025492 (game read) Line 306: POTGO_W: C000 00031F98 (game write) Line 15: POTGO_R: 5500 00FC7696 (KS read) Line 16: POTGO_W: 0F00 00FCD476 (KS write) KS write "overrides" game's POTGO write and I guess 306-16 lines can be enough for capacitor to lose all charge even when button is not pressed (+capacitor quality, Paula input line quality, +5v power supply level and perhaps others) and always returning button pushed state. If you need active system interrupts, one simple solution would be to add lowest level (=runs last in interrupt chain) vertical blank interrupt that writes to POTGO. Or use potgo.resource to allocate and set correct bits. |
10 March 2019, 10:13 | #853 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
I actually don't need to run the system interrupts... it's just I have simply forgotten to turn them off. It is likely the cause of other intermittent issues that I am seeing with the colour loading as sometimes the background colours are screwed up and transparent through the front playfield. I confirmed that there is something else in ROM writing to POTGO with the WinUAE debugger (w 0 $dff034 2 W) and sure enough I get two writes per frame. Trying to fix now... I'm assuming a move.w #$7fff,INTENA(a5) will be a good start... Appreciate everyone's help with this. Graeme |
|
10 March 2019, 18:07 | #854 | ||
´040 User
Join Date: Jun 2008
Location: Emsland/Germany
Age: 51
Posts: 450
|
Quote:
I tried the WHDLoad version and as I wrote yesterday, the jump function does not work. The two joystick buttons cause always a shoot. By accident, I discovered that the left mouse button also made a shot of fire and killing all enemies. Would it be possible to take out the second button as a jump, and make the jump with simple movement of the joystick?( just an idea) The WHDLoad version crashes from time to time with a fault. (see attachment) Quote:
|
||
10 March 2019, 18:17 | #855 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,303
|
Irek, I have removed the extra stuff I was doing to "fix" the jump. Was already done in the game, and I incorrectly didn't see it.
Also the fact that the game crashes is because there are wrong reads/writes. Rygar team should fix it, since their code does nothing useful at this point (besides being wrong) where the code is probably intended to do something. In the meanwhile, use MMU=NONE if it works. Seems that code crashes in the image decode routine: Code:
$5bf0f5ba rts ›1m$5bf0f5bc cmpi.l #$434d4150,(a0) ;a0 = $0fff0fff , compare against "CMAP" ›22m$5bf0f5c2 beq.b $5bf0f5c8 $5bf0f5c4 addq.w #2,a0 |
10 March 2019, 19:46 | #856 | |
Registered User
Join Date: Jan 2010
Location: N/A
Posts: 873
|
Quote:
created a floppy from the adf and used that instead no problems. great job on the conversion. Feels like i was playing the arcade game on mame. I did notice some slowdown on a later level once. Not complaining just wondering if all these sprites and parallax are pushing even AGA? |
|
10 March 2019, 20:03 | #857 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
Yes, the engine really is pushing the AGA... an OCS Amiga couldn't do it. |
|
10 March 2019, 22:06 | #858 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Added more enemies... see if you can spot them. I'm particularly pleased with the Dragon Rider as it can traverse the entire map scaling and jumping obstacles.
[ Show youtube player ] |
10 March 2019, 22:43 | #859 |
Registered User
|
The 4 enemies @24''
Excellent! |
11 March 2019, 01:03 | #860 |
Registered User
Join Date: Feb 2013
Location: Dublin/Ireland
Posts: 403
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Entry: Rygar AGA Edition | mcgeezer | Coders. Entries | 75 | 28 February 2019 20:41 |
On the Ball - World Cup Edition AGA | djcasey | request.Old Rare Games | 4 | 25 January 2013 12:39 |
On The Ball League Edition AGA , Player Manager 2 | StarEye | Games images which need to be WHDified | 11 | 22 January 2010 18:21 |
The Vague #1 AGA-RTG edition is released ! | kas1e | Amiga scene | 12 | 30 October 2007 00:27 |
On The Ball: World Cup Edition AGA | CodyJarrett | request.Old Rare Games | 11 | 27 May 2003 06:14 |
|
|