Page 1 of 1

Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Mon Aug 14, 2017 4:57 am
by polluks
pixel wrote:When the hardware check shows up, Arukanoido actually scans memory for add-ons. (There'll be one for the Ultimem expansion at least.)
Power20 hangs at 08
>36BC: 36 00 6F 02 FB nv-BdIZc LDA 9111
>36BF: 34 6F 6F 02 FB nv-BdIzc AND #10
>36C1: 36 00 6F 02 FB nv-BdIZc BEQ 36BC

>VIA1 Zustand (Versatile Interface Adapter $9110-$911F)
> PortB Daten: $00 (%00000000)
> PortB Richtg.: $00 (%00000000)
>
> PortA Daten: $6F (%01101111)
> PortA Richtg.: $80 (%10000000)
>
> Timer1: An (Systemtakt (ø2), Automat. Neustart)
> Zählerstand: $A520 - Startwert: $FFFF
>
> Timer2: An (PB6 Impuls, Stop bei Erreichen von Null)
> Zählerstand: $8826 - Startwert: $--00
>
> Aux. Control Reg: $40 (%01000000)
> Periph. Cntr. Reg: $FE (%11111110)
>
> Serielle Daten: $00
> Serieller Modus: Eingabe - Leerlauf
>
> Zugelassene Interr.: Keine
> Anstehende Interr.: Timer2 - Timer1

Re: Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Mon Aug 14, 2017 8:20 am
by pixel
polluks wrote:
pixel wrote:When the hardware check shows up, Arukanoido actually scans memory for add-ons. (There'll be one for the Ultimem expansion at least.)
Power20 hangs at 08
Oh. I'm sorry about that. Looks like a bug in power20. Please let the developer of power20 know about it.

IMHO VICE is the emulator of choice – also on Mac. :)

Re: Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Mon Aug 14, 2017 6:15 pm
by polluks
At least I made a patch

Code: Select all

a36c1
,36C1:  EA        NOP
,36C2:  EA        NOP
,36C3: 
g
it may help with other buggy VIAs.
Please go on!

Re: Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Tue Aug 15, 2017 2:46 am
by Mike
No point patching a program to work with a defective emulator.

Please try out your Power20 with this simple BASIC program (download). It reads out the joystick with essentially the same method as shown in the WIKI, just it uses 37137 (=$9111) instead of the more easier to remember 37151 (both registers work on real hardware, they just show different behaviour when it comes to handshake control on port A, which isn't relevant here):

Code: Select all

1 S=PEEK(37137):POKE37154,127:T=PEEK(37152):POKE37154,255
2 IF(16ANDS)=0THENPRINT"LEFT ";
3 IF(128ANDT)=0THENPRINT"RIGHT ";
4 IF(4ANDS)=0THENPRINT"UP ";
5 IF(8ANDS)=0THENPRINT"DOWN ";
6 IF(32ANDS)=0THENPRINT"FIRE ";
7 PRINT:GOTO1
P.S. I saved this with a load address of $1201, so you'll have to activate at least a +8K RAM expansion.

Re: Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Wed Aug 23, 2017 7:23 am
by polluks
Mike wrote:No point patching a program to work with a defective emulator.

Please try out your Power20 with this simple BASIC program. It reads out the joystick with essentially the same method as shown in the WIKI, just it uses 37137 (=$9111) instead of the more easier to remember 37151 (both registers work on real hardware, they just show different behaviour when it comes to handshake control on port A, which isn't relevant here):
joystick.zip

Code: Select all

1 S=PEEK(37137):POKE37154,127:T=PEEK(37152):POKE37154,255
2 IF(16ANDS)=0THENPRINT"LEFT ";
3 IF(128ANDT)=0THENPRINT"RIGHT ";
4 IF(4ANDS)=0THENPRINT"UP ";
5 IF(8ANDS)=0THENPRINT"DOWN ";
6 IF(32ANDS)=0THENPRINT"FIRE ";
7 PRINT:GOTO1
Indeed, left is always set. I wonder why it works at all but Arukanoido.

Re: Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Wed Aug 23, 2017 11:24 am
by Mike
polluks wrote:Indeed, left is always set. I wonder why it works at all but Arukanoido.
You should now cross check like thus:

1. replace 37137 in the test programm with 37151 to confirm (in Power-20) the joystick routine indeed works as intended with the other register, and

2. in my Games Collection, start the game "Workman". Incidentally, this also uses 37137 in its joystick routine. It was published 1985 as type-in in the German computer magazine "Computronic", so one can't insinuate it was written to make life hard for Power-20. ;)

If the tests give the results I expect, there's only one thing you can do: ditch Power-20 and use a current build of VICE. Power-20 already appeared non fanciable in its emulation fidelity in earlier times, and there have been no updates since 2011 ...

Re: Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Thu Aug 24, 2017 12:25 pm
by polluks
Mike, I found the cause of the problem: It's the paddle emulation!
Paddle sets joystick left.
Light pen sets joystick left and right.
Strange...

BTW Power20 includes a 1351 emulation, funny.
However my Vice 3.0 is very slow...

Re: Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Thu Aug 24, 2017 2:14 pm
by Mike
polluks wrote:Paddle sets joystick left.
Light pen sets joystick left and right.
Strange...

BTW Power20 includes a 1351 emulation, funny.
Neither of these three use cases show sensible behaviour in Power-20. On real h/w:

- the paddles for sure assert two of the joystick lines *when* their fire buttons are pressed (IIRC, left or right directions for left or right player, not necessarily fire),
- light pens *) use the fire line with a short low-pulse to signal the electron beam has just passed, optionally one of the joystick directions to signal a trigger switch has been pressed, and
- the 1351 mouse doesn't work at all in proportional mode.



*) just for the 'fun' of it, you could try whether you can get MINISKETCH working at all in Power-20. Especially getting beyond the calibration screen.

Re: Emulation problems with Power-20 (split from: "WIP: Arukanoido")

Posted: Mon Aug 28, 2017 5:00 am
by polluks
Indeed, the calibration hangs.
By the way my Trojan light pen has no trigger, maybe there should be a fallback. How about the shift key?