+atari2600land Posted July 9, 2016 Share Posted July 9, 2016 (edited) So I have been trying to get into ASM 2600 coding. I've been reading the tutorial by Andrew Davie (the link to DASM is dead, by the way). I have a program that displays a celery stalk, but it rolls for a few seconds before it sits still. I noticed that the first program that Andrew put on there does the same thing on Harmony. I was wondering if there is a way to stop it so it doesn't do that. Take a look at my code and perhaps see why it would do that. celery.asm Edited July 11, 2016 by atari2600land Quote Link to comment Share on other sites More sharing options...
Mr SQL Posted July 9, 2016 Share Posted July 9, 2016 Very interesting atari2600land, I tried this on 2600 and it rolls slowly and continuously on both my classic tube TV and also on my plasma set. Thing is stella shows the scanline count is stable at 262 so there's no real reason for it to roll unless you've selected the wrong background color - I've seen this occur before with just the right shade of red for the background but that only affected the plasma display (emulated NTSC), you've found a hue that can take down CRT's! I changed the background to black where you load COLUBK and the display is stable: Celery.bin Quote Link to comment Share on other sites More sharing options...
Lumi Posted July 9, 2016 Share Posted July 9, 2016 That's really weird. What happens if you try setting COLUBK to $00 during vertical blank and overscan? Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted July 9, 2016 Share Posted July 9, 2016 lda #0 sta PF1 inx cpx #192 bne Celery sta VBLANK ; end of screen - enter blanking When you're done with your Kernel you need to store 2 in VBLANK to turn off the image output, looks like you're storing 0. If you don't turn off video output it can interfere with the sync signal. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted July 9, 2016 Author Share Posted July 9, 2016 Changing that to two makes it roll continuously. Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted July 9, 2016 Share Posted July 9, 2016 (edited) Not sure if it matters but I think you are turning off VBLANK before your vertical blank loop starts Edited July 9, 2016 by BNE Jeff Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted July 9, 2016 Share Posted July 9, 2016 (edited) Its working fine for me in Stella already, but I moved your VBLANK here and it still worked. VerticalBlank sta WSYNC inx cpx #37 bne VerticalBlank lda #0 sta VBLANK Edited July 9, 2016 by BNE Jeff Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted July 9, 2016 Share Posted July 9, 2016 You're setting to to 0 again at StartOfFrame. Instead of this: StartOfFrame: lda #0 sta VBLANK lda #2 sta VSYNC Do this: StartOfFrame: lda #2 sta VSYNC Then set it to 0 before you start to draw the screen: lda #0 sta VBLANK Picture: sta WSYNC basically storing 2 will turn off video output, storing 0 will turn on video output. If video output is on it can interfere with the sync signal.Adding a colon at the end of each label helps if you need to search for routine. Search for "Picture:" takes you to the routine, search for "Picture" takes you to anyplace that references the routine.Have you checked out Collect? Step 1 is how to generate a stable display. Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted July 9, 2016 Share Posted July 9, 2016 This is part of your rolling problem: lda #2 sta VSYNC sta WSYNC sta WSYNC sta WSYNC ; 3 scanlines of VSYNC signal lda #0 sta VSYNC Change it to this: lda #2 sta WSYNC ; ADDED sta VSYNC sta WSYNC sta WSYNC lda #0 ; MOVED sta WSYNC ; 3 scanlines of VSYNC signal sta VSYNC At that point you will see your scanlines are now 263, so you will have to change "Overscan" so that it does 1 less loop. You also need to write "2" to VBLANK at the bottom (after you have drawn the screen), and "0" to VBLANK at the top (before you draw the screen). Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted July 9, 2016 Author Share Posted July 9, 2016 Omega's post fixed the rolling, but now the display is all ugly: How would I get the black areas to be white like they were? (Current code is attached.) celery2222.asm 1 Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted July 9, 2016 Author Share Posted July 9, 2016 I think I figured it out. Try this on your Harmony cart and see if it rolls. I did on mine and it didn't, but apparently my TV doesn't work as well as i thought, as post #2 proved. celery3.asm celery3.bin Quote Link to comment Share on other sites More sharing options...
Mr SQL Posted July 10, 2016 Share Posted July 10, 2016 Looks good on my CRT, haven't checked the plasma. What did you change from the black bottom image? Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted July 10, 2016 Author Share Posted July 10, 2016 (edited) I put lda #2 sta VBLANK inside the Overscan area. I've made a few changes and here's what I have now. I'm going to use a dot of the eye for the ball or, if I can, a missile. In batariBasic, you cannot use certain missiles with an asymmetrical playfield. Does assembly have the same limitations? celery20160709.zip Edited July 10, 2016 by atari2600land 1 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted July 10, 2016 Share Posted July 10, 2016 Atari2600, this is not a limitation of Batari per-se, but rather of the kernel in use. If you can find the time to enable the missile, you can use it. -Thom Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted July 10, 2016 Author Share Posted July 10, 2016 OK, just discovered some really interesting things. #1 - RESM1 actually does something. It determines where missile 1's X spot is. #2 - Activating missiles at certain spots in the code makes the missile show up. You can control the height of the missile by how long it's activated. For example, I put missile1y's starting code at the beginning of the eye part. And ended it at the end of the eye part. Thus, I was able to draw the dot of the eye using the missile. Nowhere is this stuff mentioned that I've seen anyway, so I had to discover it myself. celery5.zip Quote Link to comment Share on other sites More sharing options...
tschak909 Posted July 10, 2016 Share Posted July 10, 2016 Do you have the Stella Programmers Guide? If not, you really need it. -Thom Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted July 10, 2016 Share Posted July 10, 2016 Omega's post fixed the rolling, but now the display is all ugly: celery2222.png How would I get the black areas to be white like they were? (Current code is attached.) When you screen is set up properly you will have 262 line with a black bar at the top and bottom something like this: Those black bars are where VBLANK has '2' written to it. You should set up your screen to be like this. What you will need to change in your code is drawing a certain amount of empty lines below your celery stick before writing '2' to VBLANK. I also read another post that you are discovering some new things "RESM1" and missile height. This is good but keep going through Andrew's and Darrell's tutorials otherwise you will be hitting quite a few walls that you don't need to. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted July 10, 2016 Author Share Posted July 10, 2016 Do you have the Stella Programmers Guide? If not, you really need it. -Thom Where do I find it? Quote Link to comment Share on other sites More sharing options...
tschak909 Posted July 10, 2016 Share Posted July 10, 2016 Where do I find it?Get it here on this page: http://www.qotile.net/minidig/docs.html -Thom Sent from my SM-G920F using Tapatalk Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted July 10, 2016 Share Posted July 10, 2016 Where do I find it? That's the first thing I cover in Collect. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted July 11, 2016 Share Posted July 11, 2016 (edited) The MiniDig is an ancient site, from ancient times (when the Stella Programmers mailing List was still active), which ultimately collected all the bits and pieces that all its participants put in there over the years from 1995 until... around 2004 or so.... It is an indispensable treasure trove of documentation, and my personal favorite, COMMENTED DISASSEMBLIES. There are also some small discussions on certain tricks (early HMOVE, the 6-digit score kernel, etc..etc..etc..), and a few bits of demo code. -Thom Edited July 11, 2016 by tschak909 Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted July 11, 2016 Author Share Posted July 11, 2016 I have managed to put a little vegetarian in my game. The problem is, he's tiny. If he's 6 feet tall, that makes the celery 600 feet tall or so. I don't remember pixels being so small in 2600 games. Oh well. Since I am determined to make a thing out of this, I am going to make it like Street Racer, where the little guys are down at the bottom and so is a machine to kill them. A vegetarian incinerator if you will. The object of the game is to position the incinerator's y position to the same vegetarian's. Since I don't know how to do otherwise, all the action will take place at the bottom of the screen. I tried inserting the code from the Collect game, but it didn't want to work, so I had to manually draw the guy using 7 horizontal pixel lines. Enough for today, though. It's too hot to work on this longer. Angry + hot = sweating. celery6.zip Quote Link to comment Share on other sites More sharing options...
tschak909 Posted July 11, 2016 Share Posted July 11, 2016 I'm glad you finally made the jump to assembler. -Thom Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted July 11, 2016 Author Share Posted July 11, 2016 The hard part I think will be displaying a sort of score. I want to keep it as simple as possible, like the scoring in Superman. All the scores I use in my Odyssey 2 games are four digits, so it should be plenty. But that's a long way off at this point, one of the last things I think I'll work on. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted July 11, 2016 Share Posted July 11, 2016 scores aren't too bad, you have a bit of help actually with the 6502, it has a BCD mode, which can be mapped directly to score digits. Look at Collect for a quick example, and look at the 6 digit score kernel on the miniDig for the other major type of score display. -Thom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.