Previous Thread
Next Thread
Print Thread
Page 26 of 80 1 2 24 25 26 27 28 79 80
Joined: Feb 2014
Posts: 1,159
Likes: 209
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,159
Likes: 209
Stupid fun with the Joystick Calibration value:

I was reading the apple2.cpp source and noticed that the calibration for the x and y axes is different.
The x has 12 msec and the y has 13 msec.

/src/mame/drivers/apple2.cpp:316: m_x_calibration = attotime::from_usec(12).as_double();
/src/mame/drivers/apple2.cpp:317: m_y_calibration = attotime::from_usec(13).as_double();


[Linked Image from i.imgur.com]

According to the Apple II reference manual, 3060 ms is how long it should take to read the joystick which sounds right: 12ms * 256 = 3072 ms.

If you divide 3060 ms/256 you get 11.953 ms.


My calibration "program" is just a little applesoft one-liner:

100 PRINT PDL(0),PDL(1): GOTO 100

This would report 142 at rest for the PDL(0) and 154 at rest for PDL(1).

[Linked Image from i.imgur.com]


What if I set both to 12 msec? Then I got 142 at rest for both axes.

I got to thinking, what's the minimum values that would give the "full range" and 128 at rest.


It appears to be around 10800 nsec (or 10.8 msec)

// precalculate joystick time constants
m_x_calibration = attotime::from_nsec(10800).as_double();
m_y_calibration = attotime::from_nsec(10700).as_double();


[Linked Image from i.imgur.com]

With 10800 nsec, I can get 0 to 255. With 10700 nsec, the range reported is from 0 to 253.

A value too small won't give you a wide enough range.


Just for fun, I thought I'd see how Stellar 7 plays under the IIgs, but I noticed that it doesn't read the joystick properly with the faster CPU speed. Stellar 7 doesn't have any kind of pre-game joystick calibration.

So if I set the calibration down to 6 msec in the IIGS driver, the joystick reads properly and it's playable at the faster IIgs speed. Now Stellar 7 is a fast action game! Whee!

Interestingly, Stellar 7 loads very slowly (or it feels very slow to load) under the IIgs. I wonder why? I thought it'd be faster all around or at least the same speed.


Joined: Mar 2001
Posts: 17,250
Likes: 265
R
Very Senior Member
Very Senior Member
R Online: Content
Joined: Mar 2001
Posts: 17,250
Likes: 265
Thanks, I'll adjust the values in the source to 10800 nsec so we get better joystick reading.

Joined: Feb 2014
Posts: 1,159
Likes: 209
G
Very Senior Member
Very Senior Member
G Offline
Joined: Feb 2014
Posts: 1,159
Likes: 209
Hi guys,

I was trying to play serpentine and I noticed that it would hang. I tried every image I could find and it still would freeze.

So I fired up the debugger and it seems to cycle on a loop reading c060 which is the cassette input port. If I peek (49248) I always get a value of 0. Just to experiment, I changed it to return some random "noise" and it seems to run.

It must use it for some kind of random number generator. Clearly 0-127 is perhaps too much noise I'll see if a small value like 0-15 will work.

I just tried rand()%15 and it seems to work fine.

Yes! What a great game!

Code
READ8_MEMBER(apple2_state::flags_r)
{
	// Y output of 74LS251 at H14 read as D7
	switch (offset)
	{
	case 0: // cassette in
		return m_cassette->input() > 0.0 ? 0x80 : rand()%15;

Code
http://www.kreativekorp.com/miscpages/a2info/iomemory.shtml

Comp:  O = Apple II+  E = Apple IIe  C = Apple IIc  G = Apple IIgs
Act:   R = Read       W = Write      7 = Bit 7      V = Value


C060 49248 TAPEIN       OE    R7  Read Cassette Input
                          C   R7  Status of 80/40 Column Switch
           BUTN3           G  R7  Switch Input 3

Joined: Mar 2001
Posts: 17,250
Likes: 265
R
Very Senior Member
Very Senior Member
R Online: Content
Joined: Mar 2001
Posts: 17,250
Likes: 265
It needs to return the floating bus on bits other than 7, I'll fix that. Thanks for the great report!

Joined: Mar 2001
Posts: 17,250
Likes: 265
R
Very Senior Member
Very Senior Member
R Online: Content
Joined: Mar 2001
Posts: 17,250
Likes: 265
I've committed both of these fixes for all Apple II models. Thanks again!

Joined: Jul 2007
Posts: 43
Likes: 4
Member
Member
Joined: Jul 2007
Posts: 43
Likes: 4
Thanks for the recent fixes.

Would the joystick fixes have any impact to HERO (WOZ image), where the character will always drop dynamite (press down) when landing on the ground?

Any impact to the freeze in Joust (WOZ image) after a few seconds of play?

Thanks,

A-Noid

Joined: Mar 2001
Posts: 17,250
Likes: 265
R
Very Senior Member
Very Senior Member
R Online: Content
Joined: Mar 2001
Posts: 17,250
Likes: 265
This is the first I've heard of either of those things; please report that kind of stuff ASAP smile

Joust I thought might be a protection problem, but even the San Inc crack fails the same way so I'm not sure what's going on. Peter, any ideas?

HERO sounds like you have a button stuck?

Last edited by R. Belmont; 02/17/19 12:38 AM.
Joined: Mar 2001
Posts: 17,250
Likes: 265
R
Very Senior Member
Very Senior Member
R Online: Content
Joined: Mar 2001
Posts: 17,250
Likes: 265
Joust was suffering from relying on uninitialized memory; I've added a preliminary fill pattern on power-up that makes it happy. I'll have to see exactly what AppleWin's doing for that these days.

Joined: Jul 2007
Posts: 43
Likes: 4
Member
Member
Joined: Jul 2007
Posts: 43
Likes: 4
Arbee,

Thanks for your quick fix and dedication. Much appreciated. I have been playing with WOZ images recently and hitting a bunch of games.

- HERO behaves the same on multiple machines including online at <a href="https://archive.org/details/wozaday_HERO">WOZ HERO</a>
- Hard Hat Mack will register multiple key presses for each jump, making it hard to play. You can press down to cancel the extra jump. I don't remember having to do that on the Apple II back in the day.
- Swashbuckler has frequent random graphics corruption (lines) during play. I've seen at least one other game that also had the same graphics corruption.

One other thing. Is there a way to cycle power for Apple II in MAME without restarting MAME? F3 does a soft reset and will reset to game menu or apple prompt. It would be nice to be able to power off / on the Apple within the emulator.

Thanks again... and no demands for fixes, just enthusiasm.

A-Noid

Joined: Mar 2001
Posts: 17,250
Likes: 265
R
Very Senior Member
Very Senior Member
R Online: Content
Joined: Mar 2001
Posts: 17,250
Likes: 265
Shift + F3 does a "hard reset", which completely tears down and restarts MAME and the emulated system, it's effectively like power cycling the Apple.

Page 26 of 80 1 2 24 25 26 27 28 79 80

Link Copied to Clipboard
Who's Online Now
0 members (), 131 guests, and 0 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,345
Posts122,350
Members5,082
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Powered by UBB.threads™ PHP Forum Software 8.0.0