English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Releases

 
 
Thread Tools
Old 13 October 2012, 13:53   #81
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,646
Buttons 1 and 2 on the Sega Master System joypad correlate with buttons B and C on a Sega Megadrive pad and, as such, work with an Amiga too. However, I found on games that usually the Master System pads work more often than the Megadrive pads, in games like R-Type 2 and Alien Breed, the second button acts as if it was the spacebar (and tehse games are really old), so there *might* be some difference in the wiring.
Amiga1992 is offline  
Old 13 October 2012, 18:19   #82
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
@Akira
If you are having problems with the Sega Genesis "C" button on the Amiga, some versions of WHDLoad cause a problem and some cheap Sega style controllers are not fully compatible. I've never had a compatibility problem here.
matthey is offline  
Old 13 October 2012, 18:47   #83
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,646
Quote:
Originally Posted by matthey View Post
@Akira
If you are having problems with the Sega Genesis "C" button on the Amiga, some versions of WHDLoad cause a problem and some cheap Sega style controllers are not fully compatible. I've never had a compatibility problem here.
I always had a fully official Sega Genesis pad, one of the good ones.
Old games don't do anything on the second button, stuff like R-Type II was way beyond games started to implement joypad functionality in them. However Master System pads apply button 2 as if it was the spacebar. Give it a try.

I know WHDLoad has problems and, as said by Cammy before, that seems to be a problem of WHDLoad.
Amiga1992 is offline  
Old 14 October 2012, 17:12   #84
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Cool, thanks guys.
Leffmann is offline  
Old 18 October 2012, 14:55   #85
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,521
Attached is a test version which additionally uses the 2nd button for jumping. Would be nice when any joypad user could tell me if this is ok.

Last edited by phx; 07 December 2020 at 11:51.
phx is offline  
Old 18 October 2012, 16:25   #86
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,646
Tested on my A1200.

CD-32 pad: Red button brings up menu, blue button jumps. Awesome
Sega Genesis original 6-button pad: B brings up menu, C jumps. Fantastic!
Sega Genesis original Megafire pad: B menu C jumps
Sega Megadrive (JP) original pad: B menu C jump

Awesome work phx! This is a lot more comfortable for me now!
I hope someone can test a Master System pad to be thorough. I don't have one, unfortunately (should get one)

I did notice a strange thing now: when you first start the game, the scrolling is not as smooth as it should be. feels like it's updating at 25FPS. Once you lose a life, the scrolling is smoother.

I am running this in an A1200 with a 030@50 with 882 FPU @ 50. I thought it could be a workbench thing conflicting but I tested on a clean, no startup sequence setup, and the same happens. I don't know if this happens on my A600 or if it happened before, I should check but now I gotta run.
Amiga1992 is offline  
Old 18 October 2012, 19:47   #87
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by phx View Post
Attached is a test version which additionally uses the 2nd button for jumping. Would be nice when any joypad user could tell me if this is ok.
It works great here on my Sega joypad! Freedom to choose is good. Thanks.
matthey is offline  
Old 19 October 2012, 10:21   #88
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,521
Thanks for the tests!

Quote:
Originally Posted by Akira View Post
I did notice a strange thing now: when you first start the game, the scrolling is not as smooth as it should be. feels like it's updating at 25FPS. Once you lose a life, the scrolling is smoother.
Already in the last version (v1.1) I tried to improve the scrolling by measuring the worst frame rate and then keeping it constant. This looks better than changing the frame rate several times a second.
Your system might be at the border between 25 and 50fps. The frame rate measurement is resetted every time a level restarts.
phx is offline  
Old 19 October 2012, 11:35   #89
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,646
But why does it happen always like that and, more importantly, why do i have such a problem in quite a fast system?
Amiga1992 is offline  
Old 22 October 2012, 09:44   #90
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,521
Do you really want to hear it again?

Ok. Because the scrolling is crap! I took the easiest approach, in the hope it will be sufficient for such an easy game. I am redrawing *all* blocks in the display, every frame, instead of just drawing new blocks in the borders.

Certainly I won't do that again, but changing it means to rewrite all drawing routines. So also Sqrxz2 will use the same suboptimal scrolling.
phx is offline  
Old 22 October 2012, 09:57   #91
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,521
Quote:
Originally Posted by phx View Post
Attached is a test version which additionally uses the 2nd button for jumping. Would be nice when any joypad user could tell me if this is ok.
BTW, I heard from testers using the latest WinUAE version that joystick control didn't work anymore, since I implemented the 2nd button for joypads.

I would tend to ignore that bug, since I couldn't reproduce it with my E-UAE versions. But then it occured on my A3000! Unfortunately only once, completely unreproducible!

Can anybody confirm that jumping no longer works when pushing the stick up, but only when releasing it, after pushing it down? I have no idea what is causing that. It feels like bit 10 of POTGOR is stuck at 0, which should only happen when the 2nd button remains pressed.
phx is offline  
Old 22 October 2012, 10:40   #92
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,545
This is the usual pullup resistor issue.

No pullup joystick 2nd/3rd button only works properly if button pin is set to output mode (POTGO, forces it high when button not pressed), if it is in input mode, it may get stuck (probably depends on Amiga model, component tolerances etc..) because pin is floating when not pressed.
Toni Wilen is offline  
Old 22 October 2012, 11:03   #93
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Hi phx

you can use/check this asm joypad routine,

Regards
Asman is offline  
Old 22 October 2012, 11:33   #94
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,646
Quote:
Originally Posted by phx View Post
Do you really want to hear it again?

Ok. Because the scrolling is crap! I took the easiest approach, in the hope it will be sufficient for such an easy game. I am redrawing *all* blocks in the display, every frame, instead of just drawing new blocks in the borders.
Well i thought this was a problem only with the intro screen. Also, the very first time you play it is choppy but it isnt after you loose a life on the exact same level. If this made any sense the speed would always be the same on the same level or constant throughout the game, wouldn't it? Perhaps the problem is in the calculation and forced limiting of the scrolling. Ocasional slowdown i feel is ten times better than constant choppiness decided by the computer.
Amiga1992 is offline  
Old 22 October 2012, 15:54   #95
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,521
Quote:
Originally Posted by Toni Wilen View Post
No pullup joystick 2nd/3rd button only works properly if button pin is set to output mode (POTGO, forces it high when button not pressed), if it is in input mode, it may get stuck (probably depends on Amiga model, component tolerances etc..) because pin is floating when not pressed.
Very interesting! Thanks for the information.

But what do I have exactly to do to check the 2nd button in a compatible way? I tried to set all lines to output and the data bits to 1. For example:
Code:
        move.w  #$ffff,POTGO(a6)
        btst    #6,POTGOR(a6)
But now the 2nd button is always off (logical 1).

Asman's joypad routine also sets POTGO to $ffff at the end of the function. So I guess it will still have this state when the 2nd button is checked in POTGOR next time.
phx is offline  
Old 22 October 2012, 16:17   #96
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,545
Quote:
Originally Posted by phx View Post
Very interesting! Thanks for the information.

But what do I have exactly to do to check the 2nd button in a compatible way? I tried to set all lines to output and the data bits to 1. For example:
Code:
        move.w  #$ffff,POTGO(a6)
        btst    #6,POTGOR(a6)
But now the 2nd button is always off (logical 1).

Asman's joypad routine also sets POTGO to $ffff at the end of the function. So I guess it will still have this state when the 2nd button is checked in POTGOR next time.
Either write FF00 to POTGO, or do the FFFF write _after_ reading POTGOR. (Note that there is guarantee that this works with all UAE versions)

Interesting method, this will work in input mode, even without button pullups.

Writing 1 to first bit charges POT capacitors (if button is not pressed), next vblank is guaranteed to return correct pin state. Nice idea

btw, technically FFFF should be FF01 but of course chipset won't care.
Toni Wilen is offline  
Old 22 October 2012, 16:55   #97
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,521
I'm still confused. What I did last time was to write $ffff into POTGO once, when the game starts. Then I never touched POTGO again, and hoped to read the correct pin state from POTGOR. That failed.

I'm not sure what you mean. Should I now:

1. Write $ff00 to POTGO once, then read the button bit from POTGOR on each controller-check.

2. Write $ff00 to POTGO each time at the beginning of the controller-check, followed by reading POTGOR.

3. First read from POTGOR in the controller-check routine, and then write $ff01 to POTGO at the end.

4. In the controller-check routine: first write $ff00 to POTGO, then read the button from POTOGR and finally write $ff01 to POTGO to recharge.

It would be nice to know exactly what to do, because I have no joypad to experiment with and I could only reproduce the floating-pin problem once during several dozends of tests in the last three days.
phx is offline  
Old 22 October 2012, 18:07   #98
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,545
Output mode: Write FF00 once (or multiple times, it does not matter), read normally, anytime.

Input mode using method in linked example: in vblank, set 2nd button to input mode by writing to POTGO, read normally, write FF01 (or FFFF) to POTGO. (I am still not sure whats the point of this extra complexity. I guess I must be missing something.)
Toni Wilen is offline  
Old 23 October 2012, 08:03   #99
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Quote:
Originally Posted by phx View Post
For example:
Code:
        move.w  #$ffff,POTGO(a6)
        btst    #6,POTGOR(a6)
But now the 2nd button is always off (logical 1).
Hi phx,

After move.w #$ffff,POTGO(a6) you should wait a bit (I read in some book about 300 miliseconds) and then you can read POTGOR. but as far as I remember bits 1-7 are useless, so checking bit 6 is useless if I understand correct. Check read_potinp.c. In that example there is simple wait done by getchar() function.

Joypad routine it is interpretation of joypad routine from Aminet + some things from lowlevel.library + my approach about reading joystick direction.

I still don't understand what this code doing (I saw that too in Lowlevel.library)
Code:
		bset	d3,(ciapra,a1)
		bclr	d3,(ciapra,a1)
any ideas why we change for a very quick moment pin 6 of game port ( if I understand correctly above two lines )

Regards
Asman is offline  
Old 23 October 2012, 08:12   #100
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,545
Quote:
I read in some book about 300 miliseconds
That can't be right, 300ms = 15 PAL frames!

Quote:
checking bit 6 is useless if I understand correct
It is bit 6+8=14 that is checked. btst that accesses memory is always byte wide.

Quote:
any ideas why we change for a very quick moment pin 6 of game port ( if I understand correctly above two lines )
It advances CD32 pad's shift register by one so that next button can be read.

Where did FFFF POTGO write originate? Lowlevel.library or some other routine?
Toni Wilen is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sqrxz 2 for AmigaOCS vitux Amiga scene 11 25 November 2013 02:21
WTB: Plastic Dust Cover for Amiga 500 & Amiga 600 S0nic MarketPlace 0 14 February 2013 16:41
Compatibility with Amiga 500 and 500+ games ErickDF Amiga scene 2 23 May 2008 20:16
WTB: Amiga 600, 500, 500 +, 1200 (NTSC) JeremyDay MarketPlace 2 30 November 2006 03:27
Will the Amiga 500 or Amiga 1000 run workbench 2? anim8 support.Hardware 12 18 August 2001 05:02

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 22:51.

Top

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