ADFFS 2.71 beta

Discuss ADFFS development and download test releases
Post Reply
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: ADFFS 2.71 beta

Post by JonAbbott »

richw wrote: Sun Jan 27, 2019 10:01 pm JKSquash still jumps the intro, and moving the joystick starts accepting the menu options. Then I get stuck in a game I cannot control. Odd. Looks like it is hitting the joy_read swi but that is always returning zero.
I'll take a look at its code later, which might save you some head scratching.

EDIT: The intro is calling SWI &EFFC0 and &EFFC1 (@9BE0), if either return with (R0 AND &10)=0 it exits the intro and loads the main game. That sounds like a bug in its code to me. I've tried its JoyMod, which also returns 0 (@1364 in JoyMod) although I need to double check it on real hardware to be sure.

If the main game also has inverted controls, I'll need to correct its code as well.
richw
Posts: 159
Joined: Sat Sep 14, 2013 9:05 pm

Re: ADFFS 2.71 beta

Post by richw »

Ah, right. I noticed that it was calling for both sticks (from my debug), but didn't appreciate the impact on the intro.

The strange thing I cannot understand is why USBJoystick then returns zero, even if I hold the stick left!

I will have a look at the SWI calls in squashcode and see if I can make sense of any of it.
richw
Posts: 159
Joined: Sat Sep 14, 2013 9:05 pm

Re: ADFFS 2.71 beta

Post by richw »

I wonder if this game uses a slightly different variant of the Joy API? I don't think it was public, and each game came with its own copy. Maybe I could add in a configurable tweak?
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: ADFFS 2.71 beta

Post by JonAbbott »

richw wrote: Mon Jan 28, 2019 9:24 pm I wonder if this game uses a slightly different variant of the Joy API? I don't think it was public, and each game came with its own copy. Maybe I could add in a configurable tweak?
Only way to know is try all the games that support JoyMod and see if any more are broken:

F10034 Axis (1993) (TBA Software) - A; J
F10490 Champions: Jahangir Khan World Championship Squash (1992) (Krisalis Software) - J; S
F10081 Chuck Rock (1991) (Krisalis Software) - J; R
F10151 Fervour (1992) (Clares Micro Supplies) - A; J; S
F10154 Fire & Ice (1995) (Warner Interactive Entertainment) - A; J
F10188 Heimdall (1993) (Krisalis Software) - A; J; S
F10210 Jahangir Khan World Championship Squash (1991) (Krisalis Software) - J; S
F10649 Jahangir Khan World Championship Squash [BUZZ version] (1991) (Krisalis Software) - J; S
F10211 James Pond (1990) (Krisalis Software) - J; S
F10590 James Pond [BUZZ version] (1990) (Krisalis Software) - J; S
F10484 Krisalis Collection, The: Mad Professor Mariarti [BUZZ version] (1991) (Krisalis Software) - J
F10484 Krisalis Collection, The: Revelation! [BUZZ version] (1993) (Krisalis Software) - A; J; S
F10484 Krisalis Collection, The: Terramex (1993) (Grandslam Entertainments) - J; S
F10232 Lotus Turbo Challenge 2 (1992) (Krisalis Software) - A; J; S
F10233 Mad Professor Mariarti (1990) (Krisalis Software) - B; J
F10593 Mad Professor Mariarti [BUZZ version] (1991) (Krisalis Software) - B; J
F10242 Manchester United (1990) (Krisalis Software) - B; J; V
F10491 Manchester United Europe (1991) (Krisalis Software) - J; S
F10260 Nebulus (1992) (Krisalis Software) - A; J; S
F10447 Pac-mania [Learning Curve version] (1991) (Domark) - J
F10308 Revelation! (1992) (Krisalis Software) - A; J; S
F10595 Revelation! [BUZZ version] (1993) (Krisalis Software) - A; J; S
F10459 Sally and Wally (1995) (Oregan Developments) - A; J
F10338 SpeedBall 2 (1994) (Krisalis Software) - A; J; S
F10339 Spheres of Chaos (1992) (Matt Black) - A; J; M
F10351 Stunt Racer 2000 (1993) (The Fourth Dimension) - A; J; R
F10445 Stunt Racer 2000 [SA version] (1997) (The Fourth Dimension) - A; J; R
F10359 S.W.I.V. (1992) (Krisalis Software) - A; J; S
F10566 S.W.I.V. [BUZZ version] (1993) (Krisalis Software) - A; J; S
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: ADFFS 2.71 beta

Post by JonAbbott »

richw wrote: Mon Jan 28, 2019 9:24 pm I wonder if this game uses a slightly different variant of the Joy API? I don't think it was public, and each game came with its own copy. Maybe I could add in a configurable tweak?
It looks like a bug in the game code. I've just checked the JoyMod code and it's simply loading the value it returns, direct from the Econet port.
richw
Posts: 159
Joined: Sat Sep 14, 2013 9:05 pm

Re: ADFFS 2.71 beta

Post by richw »

OK, so the game and/or it's JoyMod might be broken. And maybe not even work on real hardware. That's understandable: maybe it wasn't even an official feature by the time the game shipped?

I still don't get how the value from the Joy_Read SWI handler in USBJoystick is zero. I can see it clearly in Reporter after I have been running the game. But if I hit the SWIs myself from BASIC, then they work nicely. It makes me wonder if the game is also doing some strange stuff which is screwing up USBJoystick, or perhaps triggering a strange big within it. Very strange.

I will try and give the other games a try, then if it looks like my current build works (apart from JKS) then it might be worth releasing.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: ADFFS 2.71 beta

Post by JonAbbott »

richw wrote: Tue Jan 29, 2019 10:55 am OK, so the game and/or it's JoyMod might be broken. And maybe not even work on real hardware. That's understandable: maybe it wasn't even an official feature by the time the game shipped?
I've put up the updated package for Jahangir Khan World Championship Squash with corrections to the code, if you want to test it.
richw wrote: Tue Jan 29, 2019 10:55 am I still don't get how the value from the Joy_Read SWI handler in USBJoystick is zero.
It doesn't call Joystick_Read only the JoyMod SWI's. I suspect you're seeing the Joystick_Read calls that ADFFS does to build the RTFM Econet register.
richw
Posts: 159
Joined: Sat Sep 14, 2013 9:05 pm

Re: ADFFS 2.71 beta

Post by richw »

Ah. I put extra debugging into my SWI handler for the JoyMod_Read (swi_joy_read() in the C code), which is hit via the UKSWIV handler (ukswiv_hook_handler() in the C code) when it detects SWI number 0xCFFC0 etc.

I had forgotten that USBJoystick is doing a little extra in this respect (I know it calls Joystick_Read for the keyboard emulation etc., but had forgotten about the RTFM detail). I wonder if that upsets things?
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: ADFFS 2.71 beta

Post by JonAbbott »

richw wrote: Tue Jan 29, 2019 1:49 pm I know it calls Joystick_Read for the keyboard emulation etc., but had forgotten about the RTFM detail). I wonder if that upsets things?
Do you want to add an SWI for ADFFS to read the state of Joy1/Joy2 that returns the RTFM port values in R0 / R1? My code that does this, looks like:

Code: Select all

.RTFM_Joystick
 STMFD   R13!, {R0-R7, R14}
 MOV     R6, R13
 MOV     R7, #1
 ._L1
   MOV     R0, R7
   SWI     XJoystick_Read		;add support for RTFM interface
   MOV     R3, #0			;R3=RTFM Joystick state
   MOV     R14, R0, LSL #24		;check Up/Down
   CMN     R14, #32 << 24
   ORRLT   R3, R3, #1 << 2		;Down
   CMP     R14, #32 << 24
   ORRGT   R3, R3, #1 << 3		;Up
   MOV     R14, R0, LSL #16		;check Left/Right
   CMN     R14, #32 << 24
   ORRLT   R3, R3, #1 << 1		;Left
   CMP     R14, #32 << 24
   ORRGT   R3, R3, #1			;Right
   TST     R0, #&FF << 16		;Fire (check all buttons)
   ORRNE   R3, R3, #1 << 4
    STR     R3, [R6], #4			;update R0, R1

   ADD     R7, R7, #1
   CMP     R7, #2
 BNE       _L1
 LDMFD   R13!, {R0-R7, PC}
I'm not sure how you're going to handle it though. An unused Joystick SWI# or a magic number in R0 on Joystick_Read?
Vanfanel wrote: Sat Jan 26, 2019 12:13 am PacMania (and others) is not smooth anymore, it has hiccups... :(
I really prefer smooth graphics for the games than HeroQuest compatibility.
2.71u package is now available, along with an updated Hero Quest. All games will use the threaded VSync (done at GPU VSync), except for Hero Quest which uses the unthreaded VSync (software VSync). Hopefully everything now works and is smooth scrolling at 50Hz.

I've fixed a few more bugs, mostly around support for DOS and Atari disks which previously didn't catalogue...now they do.
Vanfanel
Posts: 576
Joined: Mon Sep 16, 2013 12:01 am

Re: ADFFS 2.71 beta

Post by Vanfanel »

@Jon: We're back in smooth-land! yes! :)
Two observations:
-This version has wrong icon. It has the "sprites" file wrong. Easy to fix.
-HeroQuest works, but it skips the intro automatically. It goes straight to the language selection menu.
Post Reply