Jump to content
johnnywc

Ladybug - 2600

Recommended Posts

Been a while since I've played arcade Ladybug, but it sounds almost exactly like the arcade to my ear. Wonderful work!

Sounds pretty much spot-on, to me. :thumbsup:

 

 

Thanks, guys. It was fun, sitting in my office at home with my guitar picking out the harmonies from the arcade version :D

Share this post


Link to post
Share on other sites

I noticed the Stella jittering in the most recent build, but not in the previous ones. I'll check it on on real hardware tonight.

I notice jittering in both z26 and Stella if the phosphor effect isn't turned on. I think this is the 30Hz flicker that you're seeing. If I launch z26 with '-f77', the flicker goes away. But if you launch Stella with '-pp yes', it also removes the flicker. As a further test in Stella, run the game normally, without any commandline options. Now hit Alt-p (Shift-Cmd-p for OSX) and see if the flicker goes away. If so, then everything is working as it should be. Before a final release, I'll need a properties entry for this ROM, so that the phosphor effect will be set automatically.

Not quite. I haven't seen the jitter in z26, it might be there, but I guarantee that the jitter is there in Stella 2.2, regardless of whether the phosphor effect is on or off.

 

If I remember correctly, Stella doesn't handle the timers correctly after they hit zero.

 

From the Stella guide:

The PIA decrements the value or count loaded into it once each interval until it reaches 0. It holds that 0 counts for one interval, then the counter flips to FF(HEX) and decrements once each clock cycle, rather than once per interval. The purpose of this feature is to allow the programmer to determine how long ago the timer zeroed out in the event the timer was read after it passed zero.

I don't remember what Stella does instead of that, but it is something different. I think it immediately begins decrementing once per clock cycle. Something. Anyway,

 

A better way to check the RIOT timers than reading INTIM is to check the interrupt flag, I think. Once it is set (or cleared?) it won't ever change (unlike INTIM, which will hit zero, hold, and then resume counting). There's more info on this somewhere but I've been searching for the last 20 minutes and I can't find it.

Share this post


Link to post
Share on other sites

Thanks for the advice, stephana. I put that into the ROM properties command line overwrite for running Z26 through QuickPlay, and it does bring the annoying flickering of the playfield down to nil. Much more fun now to play.

Share this post


Link to post
Share on other sites

I notice jittering in both z26 and Stella if the phosphor effect isn't turned on. I think this is the 30Hz flicker that you're seeing. If I launch z26 with '-f77', the flicker goes away. But if you launch Stella with '-pp yes', it also removes the flicker. As a further test in Stella, run the game normally, without any commandline options. Now hit Alt-p (Shift-Cmd-p for OSX) and see if the flicker goes away. If so, then everything is working as it should be. Before a final release, I'll need a properties entry for this ROM, so that the phosphor effect will be set automatically.

 

The flicker goes away, the jitter does not. Every so often, the entire screen "hops" up and down by a scanline.

Share this post


Link to post
Share on other sites

If I remember correctly, Stella doesn't handle the timers correctly after they hit zero.

 

From the Stella guide:

The PIA decrements the value or count loaded into it once each interval until it reaches 0. It holds that 0 counts for one interval, then the counter flips to FF(HEX) and decrements once each clock cycle, rather than once per interval. The purpose of this feature is to allow the programmer to determine how long ago the timer zeroed out in the event the timer was read after it passed zero.

I don't remember what Stella does instead of that, but it is something different. I think it immediately begins decrementing once per clock cycle. Something. Anyway,

 

A better way to check the RIOT timers than reading INTIM is to check the interrupt flag, I think. Once it is set (or cleared?) it won't ever change (unlike INTIM, which will hit zero, hold, and then resume counting). There's more info on this somewhere but I've been searching for the last 20 minutes and I can't find it.

There was a discussion about that on [stella] or maybe in one of the blogs here, but I'm too lazy to look for it.

 

I've been doing something different since then. I set TIM64T for $7F+timer value and check INTIM for the sign flag. If your code runs too slow, this also gives an accurate indication of excess cycles since it keeps counting down at 64 clocks per interval instead of one, as is the case when you check INTIM for zero.

Share this post


Link to post
Share on other sites

Hello all,

 

Minor update:

 

- fixed an issue where the activate sound wouldn't play if 4 insects were out and one got killed by a skull after the activate sound trigger point

- insects reverse less on ADVANCED mode, making them more difficult to avoid

 

No progress on the Stella jitter issue. I have compared changes from a previous version and see nothing that would cause the shaking. The VBLANK timer doesn't even come close to expiring; neither does the overscan. Any other thoughts are welcomed.

 

Thanks,

ladybug.bin

Share this post


Link to post
Share on other sites

Hello all,

 

Minor update:

 

- fixed an issue where the activate sound wouldn't play if 4 insects were out and one got killed by a skull after the activate sound trigger point

- insects reverse less on ADVANCED mode, making them more difficult to avoid

 

No progress on the Stella jitter issue. I have compared changes from a previous version and see nothing that would cause the shaking. The VBLANK timer doesn't even come close to expiring; neither does the overscan. Any other thoughts are welcomed.

 

Thanks,

What are you doing during VSYNC? Anything? I have this recollection...[goes to look for...something]

Share this post


Link to post
Share on other sites

I just played two full games in ALT-9 mode on Z26 and the scannline count seemed a rock-solid 262 :)

 

Thanks for the feedback! Is there anyway in Stella to generate a log file? It appears that the screen jumps up one pixel; does this mean the VBLANK is ending a line early? I checked the z26 log and the VBLANK and overscan are starting and ending at the same exact time (scanline/cycle) for each frame.

 

Any ideas are welcomed.

 

Thanks,

Share this post


Link to post
Share on other sites

Hello all,

 

Minor update:

Uhm, the playfield reflection bug is back. Just press RESET when the game starts (tested with z26).

Share this post


Link to post
Share on other sites

Hello all,

 

Minor update:

 

- fixed an issue where the activate sound wouldn't play if 4 insects were out and one got killed by a skull after the activate sound trigger point

- insects reverse less on ADVANCED mode, making them more difficult to avoid

 

No progress on the Stella jitter issue. I have compared changes from a previous version and see nothing that would cause the shaking. The VBLANK timer doesn't even come close to expiring; neither does the overscan. Any other thoughts are welcomed.

 

Thanks,

What are you doing during VSYNC? Anything? I have this recollection...[goes to look for...something]

 

Yes - I am doing stuff during VSYNC - incrementing the frame and cycling the bonus color. I'm setting the timer right after starting VSYNC and before the code.

 

Here is a version with the code moved out of VSYNC (hopefully it doesn't overrun VBLANK). Does this stop the shaking?

ladybug.bin

Share this post


Link to post
Share on other sites
Any ideas are welcomed.
:idea: Add WSYNC before the 1st VSYNC.

 

Best just use the VERTICAL_SYNC macro and don't do anything else. (Actually this macros main purpose is preventing people from doing funky stuff, like redering their display unstable :lol:)

Share this post


Link to post
Share on other sites

Hello all,

 

Minor update:

Uhm, the playfield reflection bug is back. Just press RESET when the game starts (tested with z26).

 

Hi Thomas,

 

My bad! I didn't realize you could press RESET from the startup screen! :) I had moved the init code into another bank that would execute after the init screen was done.

 

Here's another build:

 

- fixes the issue when you press RESET from the startup screen and the reflect bit isn't set properly (also proper sets other startup variables).

- also: added a sta WSYNC right before the VSYNC, per TJ's suggestion

 

Question: should I allow for RESET during the startup screen?

 

Thanks Thomas!

 

- John

ladybug.bin

Share this post


Link to post
Share on other sites

Best just use the VERTICAL_SYNC macro and don't do anything else. (Actually this macros main purpose is preventing people from doing funky stuff, like redering their display unstable :lol:)

Though the code between looks ok to me. :ponder:

Share this post


Link to post
Share on other sites

Aren't you the same person that made such versions from other games? :? and anyway he is not even done with the game yet.

 

Yup, the bug is fixed now. I also noticed a slight color problem with the dots at the very right. I hope you can fix that one too.

 

 

BTW: Any chance for a PAL or PAL-60 version? The flicker just doesn't work that well in PAL.

Share this post


Link to post
Share on other sites
Best just use the VERTICAL_SYNC macro and don't do anything else. (Actually this macros main purpose is preventing people from doing funky stuff, like redering their display unstable :lol:)
Though the code between looks ok to me. :ponder:

 

Oh... I didn't go so far and disassemble it :)

I think plain RAM fiddling is supposed to be save, but I wouldn't even dare to do that :ponder:

 

Did you check VBLANK? Any funky stuff like you did in Splatform?

Share this post


Link to post
Share on other sites

Aren't you the same person that made such versions from other games? :?

Yup, but not from homebrews. It's much easier when you know the code.

 

and anyway he is not even done with the game yet.

Sure, but PAL-60 requires only adjusting the colors. Pretty simple job, especially when you have to code. And it would make testing on real hardware in PAL countries much better (and more fun :)).

Share this post


Link to post
Share on other sites
And it would make testing on real hardware in PAL countries much better (and more fun :)).

 

So did you buy a Kroko cart lately? :)

Share this post


Link to post
Share on other sites

Ok, I tracked down the offending stuff in both z26 log files (ugh) and in Stella's debugger. The issue is that sometimes the stuff you have in VSYNC sometimes takes too long! z26, apparently, doesn't give a damn and will still give you a stable display, while Stella jitters the display up a line (don't ask me why).

 

Here's the trace from z26:

This code is normal:

(318 263  36  40) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5dd: 85 00	sta  VSYNC   
(319   1  39  49) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5df: 85 02	sta  WSYNC   
(319   2   0 -68) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5e1: e6 80	inc  80	  
(319   2   5 -53) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5e3: d0 06	bne  b5eb	
(319   2   8 -44) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5eb: a5 81	lda  81	  
(319   2  11 -35) ( 55  63   8   2  83) nVBdIzC 41 fd 00 fd  b5ed: d0 05	bne  b5f4	
(319   2  14 -26) ( 55  63   8   2  83) nVBdIzC 41 fd 00 fd  b5f4: 85 02	sta  WSYNC   
(319   3   0 -68) ( 55  63   8   2  83) nVBdIzC 41 fd 00 fd  b5f6: a9 2c	lda #2c	  
(319   3   2 -62) ( 55  63   8   2  83) nVBdIzC 2c fd 00 fd  b5f8: 8d 96 02 sta  TIM64T  
(319   3   6 -50) ( 55  63   8   2  83) nVBdIzC 2c fd 00 fd  b5fb: a5 82	lda  82	  
(319   3   9 -41) ( 55  63   8   2  83) nVBdIzC 08 fd 00 fd  b5fd: c9 11	cmp #11	  
(319   3  11 -35) ( 55  63   8   2  83) NVBdIzc 08 fd 00 fd  b5ff: f0 38	beq  b639	
(319   3  13 -29) ( 55  63   8   2  83) NVBdIzc 08 fd 00 fd  b601: a5 8a	lda  8a	  
(319   3  16 -20) ( 55  63   8   2  83) nVBdIzc 4b fd 00 fd  b603: 29 80	and #80	  
(319   3  18 -14) ( 55  63   8   2  83) nVBdIZc 00 fd 00 fd  b605: d0 32	bne  b639	
(319   3  20  -8) ( 55  63   8   2  83) nVBdIZc 00 fd 00 fd  b607: a5 80	lda  80	  
(319   3  23   1) ( 55  63   8   2  83) nVBdIzc 3f fd 00 fd  b609: 29 3f	and #3f	  
(319   3  25   7) ( 55  63   8   2  83) nVBdIzc 3f fd 00 fd  b60b: d0 2c	bne  b639	
(319   3  28  16) ( 55  63   8   2  83) nVBdIzc 3f fd 00 fd  b639: a9 00	lda #00	  
(319   3  30  22) ( 55  63   8   2  83) nVBdIZc 00 fd 00 fd  b63b: 85 02	sta  WSYNC   
(319   4   0 -68) ( 55  63   8   2  83) nVBdIZc 00 fd 00 fd  b63d: 85 00	sta  VSYNC   

Note that we start on scanline 263 and end on scanline 4.

 

Here's the jittery portion:

(319 263  36  40) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5dd: 85 00	sta  VSYNC   
(320   1  39  49) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5df: 85 02	sta  WSYNC   
(320   2   0 -68) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5e1: e6 80	inc  80	  
(320   2   5 -53) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5e3: d0 06	bne  b5eb	
(320   2   8 -44) ( 55  63   8   2  83) nVBdIzC 02 fd 00 fd  b5eb: a5 81	lda  81	  
(320   2  11 -35) ( 55  63   8   2  83) nVBdIzC 41 fd 00 fd  b5ed: d0 05	bne  b5f4	
(320   2  14 -26) ( 55  63   8   2  83) nVBdIzC 41 fd 00 fd  b5f4: 85 02	sta  WSYNC   
(320   3   0 -68) ( 55  63   8   2  83) nVBdIzC 41 fd 00 fd  b5f6: a9 2c	lda #2c	  
(320   3   2 -62) ( 55  63   8   2  83) nVBdIzC 2c fd 00 fd  b5f8: 8d 96 02 sta  TIM64T  
(320   3   6 -50) ( 55  63   8   2  83) nVBdIzC 2c fd 00 fd  b5fb: a5 82	lda  82	  
(320   3   9 -41) ( 55  63   8   2  83) nVBdIzC 08 fd 00 fd  b5fd: c9 11	cmp #11	  
(320   3  11 -35) ( 55  63   8   2  83) NVBdIzc 08 fd 00 fd  b5ff: f0 38	beq  b639	
(320   3  13 -29) ( 55  63   8   2  83) NVBdIzc 08 fd 00 fd  b601: a5 8a	lda  8a	  
(320   3  16 -20) ( 55  63   8   2  83) nVBdIzc 4b fd 00 fd  b603: 29 80	and #80	  
(320   3  18 -14) ( 55  63   8   2  83) nVBdIZc 00 fd 00 fd  b605: d0 32	bne  b639	
(320   3  20  -8) ( 55  63   8   2  83) nVBdIZc 00 fd 00 fd  b607: a5 80	lda  80	  
(320   3  23   1) ( 55  63   8   2  83) nVBdIzc 40 fd 00 fd  b609: 29 3f	and #3f	  
(320   3  25   7) ( 55  63   8   2  83) nVBdIZc 00 fd 00 fd  b60b: d0 2c	bne  b639	
(320   3  27  13) ( 55  63   8   2  83) nVBdIZc 00 fd 00 fd  b60d: a5 87	lda  87	  
(320   3  30  22) ( 55  63   8   2  83) nVBdIzc 12 fd 00 fd  b60f: 38	   sec		  
(320   3  32  28) ( 55  63   8   2  83) nVBdIzC 12 fd 00 fd  b610: e9 10	sbc #10	  
(320   3  34  34) ( 55  63   8   2  83) nvBdIzC 02 fd 00 fd  b612: 85 87	sta  87	  
(320   3  37  43) ( 55  63   8   2  83) nvBdIzC 02 fd 00 fd  b614: 29 f0	and #f0	  
(320   3  39  49) ( 55  63   8   2  83) nvBdIZC 00 fd 00 fd  b616: d0 21	bne  b639	
(320   3  41  55) ( 55  63   8   2  83) nvBdIZC 00 fd 00 fd  b618: a5 87	lda  87	  
(320   3  44  64) ( 55  63   8   2  83) nvBdIzC 02 fd 00 fd  b61a: 29 03	and #03	  
(320   3  46  70) ( 55  63   8   2  83) nvBdIzC 02 fd 00 fd  b61c: d0 04	bne  b622	
(320   3  49  79) ( 55  63   8   2  83) nvBdIzC 02 fd 00 fd  b622: 38	   sec		  
(320   3  51  85) ( 55  63   8   2  83) nvBdIzC 02 fd 00 fd  b623: e9 01	sbc #01	  
(320   3  53  91) ( 55  63   8   2  83) nvBdIzC 01 fd 00 fd  b625: 85 84	sta  84	  
(320   3  56 100) ( 55  63   8   2  83) nvBdIzC 01 fd 00 fd  b627: aa	   tax		  
(320   3  58 106) ( 55  63   8   2  83) nvBdIzC 01 01 00 fd  b628: a5 8b	lda  8b	  
(320   3  61 115) ( 55  63   8   2  83) nvBdIzC 40 01 00 fd  b62a: 29 c0	and #c0	  
(320   3  63 121) ( 55  63   8   2  83) nvBdIzC 40 01 00 fd  b62c: f0 05	beq  b633	
(320   3  65 127) ( 55  63   8   2  83) nvBdIzC 40 01 00 fd  b62e: bd fd bc lda  bcfd,x  = bcfe	
(320   3  69 139) ( 55  63   8   2  83) nvBdIzC 40 01 00 fd  b631: d0 02	bne  b635	
(320   3  72 148) ( 55  63   8   2  83) nvBdIzC 40 01 00 fd  b635: 05 84	ora  84	  
(320   3  75 157) ( 55  63   8   2  83) nvBdIzC 41 01 00 fd  b637: 85 87	sta  87	  
(320   4   2 -62) ( 55  63   8   2  83) nvBdIzC 41 01 00 fd  b639: a9 00	lda #00	  
(320   4   4 -56) ( 55  63   8   2  83) nvBdIZC 00 01 00 fd  b63b: 85 02	sta  WSYNC   
(320   5   0 -68) ( 55  63   8   2  83) nvBdIZC 00 01 00 fd  b63d: 85 00	sta  VSYNC   

Here you start in the same place (line 263) but end at line 5. Stella doesn't like that.

 

EDIT: By the way, it is completely predictable: start the binary, hold down the fire button, and it will always jitter on frame 320.

Edited by vdub_bobby

Share this post


Link to post
Share on other sites

Oh... I didn't go so far and disassemble it :)

Just looking into the z26 log file.

 

I think plain RAM fiddling is supposed to be save, but I wouldn't even dare to do that :ponder:

I did in Thrust. AFAIK everthing except HMOVE is ok during VSYNC.

 

Did you check VBLANK? Any funky stuff like you did in Splatform?

On at line 40, off at line 241.

Edited by Thomas Jentzsch

Share this post


Link to post
Share on other sites

Ok, I tracked down the offending stuff in both z26 log files (ugh) and in Stella's debugger. The issue is that sometimes the stuff you have in VSYNC sometimes takes too long! z26, apparently, doesn't give a damn and will still give you a stable display, while Stella jitters the display up a line (don't ask me why).

 

Thanks Bob! I've moved the code out of VSYNC in the latest build so everything should be ok now.

 

Thanks again!

Share this post


Link to post
Share on other sites
Any ideas are welcomed.
:idea: Add WSYNC before the 1st VSYNC.

 

Best just use the VERTICAL_SYNC macro and don't do anything else. (Actually this macros main purpose is preventing people from doing funky stuff, like redering their display unstable :lol:)

Yeah, but the problem is that many versions of macro.h, and perhaps the current one, contain the 9-byte VSYNC that seems to cause problems on some games and some hardware.

 

I don't think anyone knows the cause, but using the routine did seem to cause at least one game to roll, and on my hardware it caused one game to display with the TV's frame stable but shifted down so the bottom of the screen was cut off. In each case, switching back to the older VSYNC routine fixed the problems.

 

This is enough for me to avoid the macro and manually insert the old one that's known to work.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...