Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Apple » Apple II » Lo-res Cycle-counting Transparent Waterfall Demo
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Lo-res Cycle-counting Transparent Waterfall Demo [message #371618] Fri, 03 August 2018 20:43 Go to next message
Vince Weaver is currently offline  Vince Weaver
Messages: 136
Registered: April 2013
Karma: 0
Senior Member
Got distracted on another lo-res cycle counting demo. This one
make a pseudo-transparent waterfall effect. Also water, and blinking
stars.

Video here:
https://www.youtube.com/watch?v=A9CyVvdw9mU

Disk image, source code here
http://www.deater.net/weave/vmwprod/waterfall_demo/

This ended up being a bit trickier than I thought.

When cycle-counting tried to make a jump table (as that's deterministic)
and then ran into the 6502/65c02 indirect JMP cycle difference. Fun.
Ended up using PHA/PHA/RTS instead.

This is more exact vapor-lock than previous (changing pages mid-scanline)
and so especially on old machines it's likely you might not get a lock
on the first try, you might need to boot a few times.
I need to read up on the best way to get an exact lock.

There's some mockingboard white-noise sound, with volume varying based
on proximity to the waterfall. Works great in the emulators, but still
my personal board has some issue where it glitches out at 25Hz.

Vince
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371634 is a reply to message #371618] Sat, 04 August 2018 07:39 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Tom Porter

Your stuff is fantastic!

I'm commenting because you mentioned having mockingboard trouble. I done a lot of work on mockingboard (maybe not ground-breaking)... but I was also having some weird noises... so in the last week went to revisit "everything". Come to find out, my earliest software cloned the Harvey construction set init process, but then I came up with my own that was a few bytes shorter... come to find out, my 'hacks' introduce random glitches... never thought it was a problem because sound outputs ok (for a while).. but these minor byte inits must do something internally. I'd look there for maybe potential problems? -Tom
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371640 is a reply to message #371618] Sat, 04 August 2018 12:08 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: frank_o_rama

Really liking these split-mode demos you're coming up with.

Maybe you could read the ROM machine ID bytes and use vapor lock on older machines, and poll $c019 on newer machines that have VBL? Also, some emulators like Virtual II just return $00 when reading the bus (Sweet16 always returns $16 after doing an STA $C04F, while AppleWin approximates the floating bus correctly).

f


On Friday, August 3, 2018 at 5:43:12 PM UTC-7, vi...@pianoman.cluster.toy wrote:

> I need to read up on the best way to get an exact lock.
>
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371649 is a reply to message #371640] Sat, 04 August 2018 13:21 Go to previous messageGo to next message
D Finnigan is currently offline  D Finnigan
Messages: 1154
Registered: October 2012
Karma: 0
Senior Member
frank_o_rama wrote:
> Really liking these split-mode demos you're coming up with.
>
> Maybe you could read the ROM machine ID bytes and use vapor lock on older
> machines, and poll $c019 on newer machines that have VBL? Also, some
> emulators like Virtual II just return $00 when reading the bus (Sweet16
> always returns $16 after doing an STA $C04F, while AppleWin approximates
> the floating bus correctly).

Who cares about emulators? The software should be written to run correctly
on real hardware, and then it's the responsibility of emulator authors to
fix their broken and buggy implementations.

If programmers are bending over backward to make their software work on
broken emulators, then there's something REALLY WRONG in the world. :-(


--
]DF$
The New Apple II User's Guide:
https://macgui.com/newa2guide/
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371659 is a reply to message #371649] Sat, 04 August 2018 15:08 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Tom Porter

I agree. I'm currently working on a project, and the software works perfectly fine on real hardware and in most emulators... but the other person I'm working with has their dev environment in (an unnamed emulator) that this software fails in, and because of that this driver has to be about 80 bytes larger to accommodate, and not only that, but it 'lessens' its potential capability by nearly half (admittedly only on that emulator). Its workable, but its extra work lol.

> The software should be written to run correctly
> on real hardware, and then it's the responsibility of emulator authors to
> fix their broken and buggy implementations.
>
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371661 is a reply to message #371640] Sat, 04 August 2018 15:35 Go to previous messageGo to next message
Vince Weaver is currently offline  Vince Weaver
Messages: 136
Registered: April 2013
Karma: 0
Senior Member
On 2018-08-04, frank_o_rama@hotmail.com <frank_o_rama@hotmail.com> wrote:
>
> Maybe you could read the ROM machine ID bytes and use vapor lock on
> older machines, and poll $c019 on newer machines that have VBL? Also,
> some emulators like Virtual II just return $00 when reading the bus
> (Sweet16 always returns $16 after doing an STA $C04F, while AppleWin
> approximates the floating bus correctly).

It should be fixable to get a better lock, I've just been lazy so far.
I should be writing a more complicated pattern out rather than just
looking for four repeats.

I should also go through the Don Lancaster articles, he had a fairly
complete solution but it looks really really complicated.

Part of the problem is my only actual hardware is an Apple IIe Platinum,
and from what I understand the floating bus works a bit differently on
the Platinum.

Vince
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371662 is a reply to message #371634] Sat, 04 August 2018 15:40 Go to previous messageGo to next message
Vince Weaver is currently offline  Vince Weaver
Messages: 136
Registered: April 2013
Karma: 0
Senior Member
On 2018-08-04, Tom Porter <laseractiveguy@gmail.com> wrote:

> I'm commenting because you mentioned having mockingboard trouble. I
> done a lot of work on mockingboard (maybe not ground-breaking)... but
> I was also having some weird noises... so in the last week went to
> revisit "everything". Come to find out, my earliest software cloned
> the Harvey construction set init process, but then I came up with my
> own that was a few bytes shorter... come to find out, my 'hacks'
> introduce random glitches... never thought it was a problem because
> sound outputs ok (for a while).. but these minor byte inits must do
> something internally. I'd look there for maybe potential problems?

What change did you make to your code? Was it in the init code or
the writing code?

I've spent a lot of time trying to track down the issue. It appears
that writes with just the right bit-combination/timing cause the
output register to glitch out for a full 10-bit clock period. It's a lot
easier to trigger on my Apple II than it is on my Raspberry Pi, possibly
because on the Apple the AY-3-8910 is using the same clock signal as
the CPU.

This waterfall demo is weird, as I'm only writing one register (the
A volume register) at roughly 30Hz, and typically the same value each
time, and it's enough to completely glitch out the signal as you
can hear in the video.

Vince
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371672 is a reply to message #371661] Sat, 04 August 2018 18:27 Go to previous messageGo to next message
Michael J. Mahon is currently offline  Michael J. Mahon
Messages: 1767
Registered: October 2012
Karma: 0
Senior Member
<vince@pianoman.cluster.toy> wrote:
> On 2018-08-04, frank_o_rama@hotmail.com <frank_o_rama@hotmail.com> wrote:
>>
>> Maybe you could read the ROM machine ID bytes and use vapor lock on
>> older machines, and poll $c019 on newer machines that have VBL? Also,
>> some emulators like Virtual II just return $00 when reading the bus
>> (Sweet16 always returns $16 after doing an STA $C04F, while AppleWin
>> approximates the floating bus correctly).
>
> It should be fixable to get a better lock, I've just been lazy so far.
> I should be writing a more complicated pattern out rather than just
> looking for four repeats.
>
> I should also go through the Don Lancaster articles, he had a fairly
> complete solution but it looks really really complicated.
>
> Part of the problem is my only actual hardware is an Apple IIe Platinum,
> and from what I understand the floating bus works a bit differently on
> the Platinum.
>
> Vince
>

Synchronizing with a polling loop is a good start, but then you need to run
some carefully thought out in-line code to “sneak up” on cycle-accurate
sync. Typically, you can “binary search” for exact lock, so it takes a few
of frame periods.

--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371698 is a reply to message #371662] Sat, 04 August 2018 21:14 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Tom Porter

Your YM chip translations are updating the chips at insane rates... my midi music only 'occasionally' needs to update regs, because the music is very straightforward, the rest of the time its counting down a 'timer' till the next note needs updating (based upon a simplified .ms (millisecond) timing scheme, basically from midi outputs themselves. I was init 255 to all the reg in the beginning (saving a few bytes)... but in the Harvey code it was doing 7's, 6's and other numbers. After making those changes (turning it back into the originals), some unexplainable anomalies went away... but octave1 still creates minor vibrato effects in/on some speakers... understandable since frequencies are so low... old 'partially' blown speakers is my explanation, some come out good, some just a little too vibrato.
Re: Lo-res Cycle-counting Transparent Waterfall Demo [message #371710 is a reply to message #371661] Sun, 05 August 2018 01:33 Go to previous message
mmphosis is currently offline  mmphosis
Messages: 163
Registered: November 2012
Karma: 0
Senior Member
I am taking a hiatus from coding on the Apple II, but I really have enjoyed
seeing what you've been able to accomplish. Maybe this routine might
help...

http://hoop-la.ca/apple2/2015/vbl/

If you do happen to test this routine on real hardware let me know if it
works or not.

It searches for a single byte on the hires screen. I read the parts of the
Sather books that cover the video scanning of memory. I would have liked to
have had it search on the lores screen like you are doing but I wasn't able
to make the lores search work everytime. I have no real hardware to test
on, so I am only going by what KEGS and Virtual II could do at the time
which were off by one scanline from each other, but maybe that is the
difference between the IIGS (KEGS) and the II (Virtual II.)

If there are more differences on how the floating bus works on different
models then that certainly complicates things even more. I like the idea of
only worrying about this for the II and II+, and polling $c019 for
everything else. I scanned through the Don Lancaster articles and I too
find his solutions complicated and much of it sounded like a hardware
solution running wires on the motherboard between various pins which is not
what I was looking to do. He did mention the different video timing on the
Franklin Ace which I found to be interesting. What does the floating bus do
on Apple II clones?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CarteBlanche 16KB Ram card project
Next Topic: A simple 256-byte IPL for Apple ///
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Apr 18 22:18:41 EDT 2024

Total time taken to generate the page: 0.04211 seconds