Previous Thread
Next Thread
Print Thread
Page 26 of 51 1 2 24 25 26 27 28 50 51
Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #114684 02/15/19 08:22 PM
Joined: Feb 2014
Posts: 358
G
Golden Child Offline
Senior Member
Offline
Senior Member
G
Joined: Feb 2014
Posts: 358
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]

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]


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]

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.

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #114685 02/15/19 09:40 PM
Joined: Mar 2001
Posts: 16,420
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,420
Thanks, I'll adjust the values in the source to 10800 nsec so we get better joystick reading.

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: R. Belmont] #114686 02/16/19 12:06 PM
Joined: Feb 2014
Posts: 358
G
Golden Child Offline
Senior Member
Offline
Senior Member
G
Joined: Feb 2014
Posts: 358
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

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #114687 02/16/19 12:25 PM
Joined: Mar 2001
Posts: 16,420
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,420
It needs to return the floating bus on bits other than 7, I'll fix that. Thanks for the great report!

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #114689 02/16/19 08:33 PM
Joined: Mar 2001
Posts: 16,420
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,420
I've committed both of these fixes for all Apple II models. Thanks again!

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: R. Belmont] #114690 02/16/19 10:35 PM
Joined: Jul 2007
Posts: 32
anoid Offline
Member
Offline
Member
Joined: Jul 2007
Posts: 32
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

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #114691 02/17/19 12:22 AM
Joined: Mar 2001
Posts: 16,420
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,420
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.
Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #114693 02/17/19 01:14 AM
Joined: Mar 2001
Posts: 16,420
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,420
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.

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #114694 02/17/19 01:44 AM
Joined: Jul 2007
Posts: 32
anoid Offline
Member
Offline
Member
Joined: Jul 2007
Posts: 32
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

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #114695 02/17/19 02:17 AM
Joined: Mar 2001
Posts: 16,420
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,420
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 51 1 2 24 25 26 27 28 50 51

Who's Online Now
2 registered members (zillion, Reznor007), 182 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,734
Posts114,829
Members4,879
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3