Beam-Racing cycle-counted game [message #384424] |
Thu, 13 June 2019 19:04 |
Vince Weaver
Messages: 136 Registered: April 2013
Karma: 0
|
Senior Member |
|
|
So someone asked my how practical my bream-racing rasterbar demo was, so
I thought I'd see if I could used the enhanced lores colors to make a game.
Check it out here:
http://www.deater.net/weave/vmwprod/space_bars/
It's not much of a game, but it's playable. Really nice 192-line 60Hz smooth
vertical scrolling with a 15-color sprite. Of course horizontal scrolling
is always a problem in these lo-res modes.
In any case, the game is playable, but not really all that interesting.
I also used up pretty much all 4550 cycles in the VBLANK, but at the same
time the code is really inefficient in places. Cycle-counted code is such
a pain to write.
Vince
|
|
|
Re: Beam-Racing cycle-counted game [message #384426 is a reply to message #384424] |
Thu, 13 June 2019 23:50 |
|
Originally posted by: Anthony Adverse
> In any case, the game is playable, but not really all that interesting.
> I also used up pretty much all 4550 cycles in the VBLANK, but at the same
> time the code is really inefficient in places. Cycle-counted code is such
> a pain to write.
>
> Vince
That looks sexy!
A
|
|
|
|
Re: Beam-Racing cycle-counted game [message #384462 is a reply to message #384424] |
Sun, 16 June 2019 18:50 |
Michael AppleWin Debu
Messages: 1262 Registered: March 2013
Karma: 0
|
Senior Member |
|
|
On Thursday, June 13, 2019 at 4:04:01 PM UTC-7, vi...@pianoman.cluster.toy wrote:
> Cycle-counted code is such a pain to write.
Yup!
If you want to minimize some of that pain you can always use AppleWin's built-in debugger PROFILE command to help with this:
<F7>
PROFILE RESET
BPX ####
G
PROFILE LIST
This way you'll get a nice break-down of all the executed instruction and their total cycles and percentage. You can also continue to use PROFILE LIST to get a running total to-date of metrics. :-)
Of course if you are using it for disk access then all bets are due to not emulating the Disk II timing properly (well, until .WOZ gets supported.) :-/ Still, better then nothing!
Cheers,
Michael
|
|
|
Re: Beam-Racing cycle-counted game [message #384465 is a reply to message #384462] |
Sun, 16 June 2019 22:53 |
Vince Weaver
Messages: 136 Registered: April 2013
Karma: 0
|
Senior Member |
|
|
On 2019-06-16, Michael 'AppleWin Debugger Dev' <michael.pohoreski@gmail.com> wrote:
> On Thursday, June 13, 2019 at 4:04:01 PM UTC-7, vi...@pianoman.cluster.toy wrote:
>> Cycle-counted code is such a pain to write.
>
> Yup!
>
> If you want to minimize some of that pain you can always use
> AppleWin's built-in debugger PROFILE command to help with this:
Usually it's not a matter of knowing the cycle count per instruction, as
I've done this long enough I can easily add things up.
The big pain is when I add a few instructions and suddenly the vapor
lock is gone and I have to track down why. It's almost always because
some branches got pushed so they straddle a page boundary. There's not
much that can be done about that, though I sometimes add some ASSERTs to
the source code so I know where it's happening.
The same can happen if data crosses a page boundary, but I usually
just align everything to death so that doesn't happen.
The other annoyance is usually I have VBLANK routine that needs to be 4550
cycles, so I have a big delay at the end to make up the difference. But
every time I make changes, I have to go and update that delay so the total
is 4550 again. I could probably set up some tooling to do it at least
semi-automatically, but so far it hasn't been worth the trouble.
Vince
|
|
|