Re: hp50g single "CLICK" from the beeper
- From: "manjo" <ooo@xxxxxxxxxxxxxx>
- Date: Tue, 30 Sep 2008 11:48:56 +0200
The thing you're describing is not really a bug, it's 'by design' behavior
Here's why:
ARM has 3 timers so designers chose to couple one of those
to the beeper (the same way it's done on your desktop PC)
That way while timer is doing sound CPU runs uninterrupted
(cpu doesn't triger te beeper up-down the way it used to)
Just to be clear:
The 'new way' to make sound is much better and has
much more to offer, only drawback: it's not compatible with the 'old way' by
default.
Pathcing the firmware is not realy an option for a couple of other resons.
The CPU in 49G+/50G (like most ARM based CPUs) is remarkable in that way
it has several modes for most of it's pins and can be reprogrammed by
software for
one of the available functions. So the beeper can be reprogramed as well.
Generally you can take 2 major directions in this matter:
1. reprogram ARM timer to PWM(poulse width modulation) mode
in that case you would calculate how long you want your poulse to be, rather
than timing it yourself or
2. reprogram ARM pin to standard output pin rather than timer
in that case you would triger the speaker just like it was done on real
saturn (bit 11 of OUT reg.)
Since the 'klicking' sound is a part of delay routine which handles game
speed i belive it's easiest to keep
it the way it is (most probably the solution no.2 is the one to take)
I wrote a small piece for Hrast Programmer (he uses it in 49G+ and 50G
versions of emulators)
which emulates bit 11 of OUT register (compatibile with OUT C) instuction of
the Saturn.
Instead of calling ROM's OUTC routine (since OUTC must execute from even
address)
you call my 'substitute' routine and speaker will work more-less the way it
used to :-)
more-less means:
These dayse there is a lot more going on in the box, and your calculator is
not
dedicated to trigering speaker with such devotion as it used to be :-)
The execution timing is not the same as it would be on 49G and many other
resons...
BUT you would get sound and with proper adjustment -you could make it sound
just right :-)
The routine i speak of does just the thing you need,
-all YOU need to do is load/store the routine to 32-bit aligned address
and call it with GOSBVL where you'd normally call GOSBVL =OUTC
regards,
manjo
What this shows is the emulation works by using a sample of a sine
wave, with a minimum of 2 cycles. The way the duration is used is to
calculate the number of times that output needs to be repeated,
rounded up. So the minimum possible duartion at 1 HZ is 2 sine waves
so 2 seconds, including two maxes and two mins, accounting for the
four clicks.
Yes that was the idea to emulate true frequency so minimum 2 full
waves
are required. However using a piezoelectric speaker, the designers
haven't been aware of the fact that even 1 full wave pulse can have
'frequency' or better say range of frequencies (speaker enclosure, air
and human ear will do complex fourier transform and make a carefully
timed 'click' have 'tone'). So it's pity that BEEP2 (that user rpl
command
calls after checking beep flag) can't send short pulses.
Also very annoying is exceeding the requested duration of a single
CPU command to 2 seconds!
It would be nice if hp50g would release new firmware with this bugs
patched and also with decimal mode fixed (if non-bcd number in
decimal mode is incremented, it will mess the register)
Anyone attempted to patch the hp50g firmware?
.
- References:
- hp50g single "CLICK" from the beeper
- From: davoremard
- Re: hp50g single "CLICK" from the beeper
- From: username localhost
- Re: hp50g single "CLICK" from the beeper
- From: davoremard
- hp50g single "CLICK" from the beeper
- Prev by Date: Re: hp50g single "CLICK" from the beeper
- Next by Date: Re: HP Req: Question? Why is Mod = 13 ?
- Previous by thread: Re: hp50g single "CLICK" from the beeper
- Next by thread: Page-Flipping mode on newest ARM HP49+/50G
- Index(es):
Relevant Pages
|