tschak909 Posted March 12, 2007 Share Posted March 12, 2007 I am in the process of doing a port of Bill Williams' great game Salmon Run, originally done on the Atari 800. So far, I have been able to get smooth scrolling working (and have cleaned up a few of the little glitches that have been popping up in the kernel...) however, I have a bit of a problem.... as it stands, I need to be able to vary the scrolling of the game based on how long the joystick has been pushed upward... I can have this if I do all of the coarse and fine scrolling calculations inside the vertical blank. However, once the entire buffer has been scrolled, it resets the entire moving window to the start. I want the moving window to be able to wrap around..... Nukey Shay suggested the calculations should be done in kernel, which I understand why, it allows for the next river line to be immediatelly pulled, without the jump caused by the entire window being calculated at the vertical blank..........however......... it also makes varying the scroll speed ____MUCH____ more difficult, and I am trying to come up with a solution which will allow me to control the scrolling velocity...... but i seem to be STUCK..... does anyone have a better approach? I am pasting a current copy of the kernel so you guys can see...... salmonrun_070312.zip Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted March 12, 2007 Share Posted March 12, 2007 (edited) However, once the entire buffer has been scrolled, it resets the entire moving window to the start. I want the moving window to be able to wrap around..... You have two minor problems (I edited your code slightly-- changed tabs to spaces, removed the comments, and put the line labels on separate lines): GameDisplay LDA #$FF STA PF0 LDX CRSSCROLLCTR AND #$1F TopRiver In the above section, the AND doesn't have any effect on the X register, so you can take it out-- it isn't needed, anyway, since you take care of that later on when you increment CRSSCROLLCTR. Here is where your real problem is: MidRiver REPEAT 20 LDA PF1DATA,X STA PF1 LDA PF2DATA,X STA PF2 STA WSYNC STA WSYNC STA WSYNC STA WSYNC STA WSYNC STA WSYNC STA WSYNC DEX STA WSYNC REPEND When you decrement X, it can go from 0 to 255, so you need to do that AND here. But AND works on the accumulator, not on X, so you can do this... STA WSYNC DEX TXA ; <--- Add these three AND #$1F ; <--- lines right after TAX ; <--- you do DEX STA WSYNC Michael Edited March 12, 2007 by SeaGtGruff Quote Link to comment Share on other sites More sharing options...
tschak909 Posted March 12, 2007 Author Share Posted March 12, 2007 Thanks! how did I miss that? :-/ Okay, moving on to the joystick/velocity code. -Thom Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted March 12, 2007 Share Posted March 12, 2007 (I edited your code slightly-- changed tabs to spaces, removed the comments, and put the line labels on separate lines): By the way, sorry about that-- it was my stupidity, actually. Whenever I tried to compile your code, I would get weird compile errors right after the first copy of the MidRiver section (which is repeated 20 times), and I was trying every zany thing I could think of to fix it. The other night I actually removed the REPEAT and REPEND, and just copied and pasted those lines of code 20 times! So tonight, after I tried changing tabs to spaces, taking out the comments, moving the line labels to their own lines, etc., I *finally* figured out that it was because you're on Unix and I'm on Windows... so all I *really* needed to do was convert the file to CR/LF format! I should know better! But the weird thing was, DASM for DOS/Windows didn't care that the file wasn't in CR/LF, *except* when it came to the REPEAT and REPEND section, which got garbled after the first copy. Michael Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted March 12, 2007 Share Posted March 12, 2007 I am in the process of doing a port of Bill Williams' great game Salmon Run, originally done on the Atari 800. So far, I have been able to get smooth scrolling working (and have cleaned up a few of the little glitches that have been popping up in the kernel...) however, I have a bit of a problem.... as it stands, I need to be able to vary the scrolling of the game based on how long the joystick has been pushed upward... I can have this if I do all of the coarse and fine scrolling calculations inside the vertical blank. However, once the entire buffer has been scrolled, it resets the entire moving window to the start. I want the moving window to be able to wrap around..... Couldn't you make the end of the buffer the same as the beginning...like this: Now: With end the same as beginning: It uses more ROM but simplifies your kernel and you get smooth wraparound. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted March 12, 2007 Author Share Posted March 12, 2007 actually the fix that SeaStGruff proposed fixed the problem (I was overflowing the index). I am currently working on the joystick support code. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted March 13, 2007 Share Posted March 13, 2007 What's it about for people who don't know (myself included). Quote Link to comment Share on other sites More sharing options...
tschak909 Posted March 13, 2007 Author Share Posted March 13, 2007 Salmon Run is a game in which you are a salmon which is swimming upstream. The object is to swim upstream as fast as possible, jumping against waves, while avoiding bears, fishermen with nets, and birds, which will stop at nothing to snatch you from the water. If you swim far enough, you will reach the lake, at which point you will meet up with a girl salmon, and.... :-) well you know.... so... anyway, you get an extra life. :-) I am attaching both a binary and a screenshot. <-- atari 800 salmon run Salmon_Run.zip Quote Link to comment Share on other sites More sharing options...
tschak909 Posted March 18, 2007 Author Share Posted March 18, 2007 Just giving a quick status update, I am rewriting the kernel to display an asymmetrical playfield for the river display. After a few false starts, I have been able to simplify to a list of page offsets to up to 256 possible combinations of river, biased by the difficulty switch and the current level. -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted March 29, 2007 Author Share Posted March 29, 2007 Just giving a quick status update, I am rewriting the kernel to display an asymmetrical playfield for the river display. After a few false starts, I have been able to simplify to a list of page offsets to up to 256 possible combinations of river, biased by the difficulty switch and the current level. -Thom still working on it, i had to slow down considerably due to work obligations, but things are stabilising again. I have calculated 1024 bytes of playfield data, and am in the process of entering it all (I am throwing together a quick script to take the playfield i drew manually and provide the PF1/PF2 data.) Then I can do a pass on the new kernel. I've been studying a lot of disassemblies, and learning VERY quickly....) -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted April 6, 2007 Author Share Posted April 6, 2007 I am resuming work on Salmon Run, I had to calculate 255 possible random combinations for playfield state, I did it all inside a text file, separated into columns in which I first drew the binary patterns, and then calculated the PF1, PF2, PF3, and PF4 data accordingly.... A snippet of the graphic notepad file: RIVER1 RIVER2 RIVER3 RIVER4 PF1 PF2 PF2 PF1 Normal Reversed Normal Reversed --------------------------------------------- 00 11000000 00000000 00000000 00000011 192 0 0 192 01 11110000 00000000 00000000 00001111 240 0 0 240 02 11111100 00000000 00000000 00111111 252 0 0 252 03 11111111 00000000 00000000 11111111 255 0 0 255 04 11111111 11000000 00000011 11111111 255 3 3 255 05 11111111 11110000 00001111 11111111 255 15 15 255 06 11111111 11111100 00111111 11111111 255 63 63 255 07 11000000 00000000 00000011 11111111 192 0 3 255 08 11110000 00000000 00001111 11111111 240 0 15 255 I have attached the code here: riverdata.zip I also developed a quick tool to output the necessary .byte statements using Ruby: # salmon run graphic dump dev tool # t.cherryhomes 2007-04-05 pf1data = Array.new pf2data = Array.new pf3data = Array.new pf4data = Array.new pf1binary = Array.new pf2binary = Array.new pf3binary = Array.new pf4binary = Array.new l = 0 File.open("riverdata.txt") do |f| while line = f.gets if (l < 4) then # do nothing. else currentLine = line.split(/\t/); currentBinary = currentLine[1].split pf1data.push(currentLine[2]); pf2data.push(currentLine[3]); pf3data.push(currentLine[4]); pf4data.push(currentLine[5]); pf1binary.push(currentBinary[0]); pf2binary.push(currentBinary[1]); pf3binary.push(currentBinary[2]); pf4binary.push(currentBinary[3]); end l+=1; end end File.open("riverdata.asm","w") do |f| f.puts "PF1Data" pf1data.each do |i| f.puts "\t.byte " << i end f.puts "PF2Data" pf2data.each do |i| f.puts "\t.byte " << i end f.puts "PF3Data" pf3data.each do |i| f.puts "\t.byte " << i end f.puts "PF4Data" pf3data.each do |i| f.puts "\t.byte " << i end end puts "Done.\n" and it works just fine. :-) Now, I am going to hammer out the asym kernel, will keep you guys posted :-) -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.