Jump to content

Photo

Trying to build a project, need help


76 replies to this topic

#51 ggn OFFLINE  

ggn

    Stargunner

  • 1,356 posts
  • Location:Athens, Greece

Posted Tue Mar 21, 2017 5:23 AM

I've sent ggn the code to reset the module.

 
And of course that didn't work :P.
 
After a lot of fiddling I did came up with a way to reset the module. I pushed an update to the repositories, so you have to get the updated rbasic.h from that for this method to work. What it boils down to is something like this:
  

        MODPLAY(0)
        SNDKILL(0)
        SNDKILL(1)
        SNDKILL(2)
        SNDKILL(3)
        VSYNC
        U235SE_modregdump[0]=0
        U235SE_modregdump[2]=0
        U235SE_modregdump[3]=0
        U235SE_modregdump[4]=0
        U235SE_modregdump[5]=0
        'Play module 2
        MODPLAY((int)strptr(Module2))
  • The first command will stop the module playing.
  • The next four will attempt to silence any samples played (some times this doesn't work, I couldn't figure out why).
  • The vsync was empirically added because I saw that this helped the code to be stable.
  • Then the U235SE's internal parameters are reset.
  • Finally the new module will start playing.

Not tested on real hardware - had to rely on VJ here. So who knows what happens!


Edited by ggn, Tue Mar 21, 2017 5:26 AM.


#52 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • 2,630 posts
  • Location:France

Posted Tue Mar 21, 2017 11:45 AM

I'd add SACRIFICE_GOAT just to be sure. Just don't tell Jeff Minter :D



#53 Gemintronic ONLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,027 posts

Posted Tue Mar 21, 2017 12:20 PM

Would setting a counter that loads the MOD file again be a viable workaround while this is being sorted out? Maybe something that increments during the vblank and gets triggered when the song is supposed to end?

Attached Files

  • Attached File  goat.jpg   126.14KB   1 downloads


#54 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Tue Mar 21, 2017 2:44 PM

Edit: It works great now! Thanks so much!


Edited by atari2600land, Tue Mar 21, 2017 2:48 PM.

  • ggn likes this

#55 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Tue Mar 21, 2017 2:57 PM

Here is the game in case anyone wants to try out the new code on real hardware. I wish I could, but I can't.

Attached Files



#56 CyranoJ OFFLINE  

CyranoJ

    Quadrunner

  • 5,317 posts
  • RAPTOR in LOCAL
  • Location:Adelaide, SA

Posted Tue Mar 21, 2017 3:29 PM

Really enjoying watching this one come along.

 

Video from real h/w.

 



#57 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Tue Mar 21, 2017 3:45 PM

Why don't the MODs play correctly?



#58 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Tue Mar 21, 2017 3:58 PM

See if this version plays them OK or not.

 

Attached Files



#59 ggn OFFLINE  

ggn

    Stargunner

  • 1,356 posts
  • Location:Athens, Greece

Posted Tue Mar 21, 2017 4:04 PM

I'd add SACRIFICE_GOAT just to be sure. Just don't tell Jeff Minter :D


Nope, but I can add MAKE_BAD_JOKES_WHILE_EATING_BAGUETTE if you like...

#60 CyranoJ OFFLINE  

CyranoJ

    Quadrunner

  • 5,317 posts
  • RAPTOR in LOCAL
  • Location:Adelaide, SA

Posted Wed Mar 22, 2017 4:11 AM

Sorry, been at work all day.

 

Here's a video of 13a.

 



#61 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Wed Mar 22, 2017 11:02 AM

Apparently ggn's code fix does not work on real hardware.



#62 ggn OFFLINE  

ggn

    Stargunner

  • 1,356 posts
  • Location:Athens, Greece

Posted Wed Mar 22, 2017 12:16 PM

Ok, so let's see now. I noticed that you include the code with the binary archives so I thought I'd take a peek if you don't mind.
 

	if Headturnanimframe=180 then

        MODPLAY(0)
        SNDKILL(0)
        SNDKILL(1)
        SNDKILL(2)
        SNDKILL(3)
        VSYNC
        U235SE_modregdump[0]=0
        U235SE_modregdump[2]=0
        U235SE_modregdump[3]=0
        U235SE_modregdump[4]=0
        U235SE_modregdump[5]=0	
		endif
	
	if Headturnanimframe>180 then 
		Fframe=3
	
		
	
	MODPLAY((int)strptr(MOD_ALTTSMUSIC)) 
		RSETOBJ(titlescreen,R_sprite_active,R_is_active)
		RSETOBJ(walrus,R_sprite_active,R_is_inactive)
		RSETOBJ(ingamebg,R_sprite_active,R_is_inactive)	

	endif
	if Headturnanimframe>220 then Fframe=2

Sorry, what? You're stopping the module at frame 180 and then starting it up again for 40 frames till the counter hits 220?

Also
 

sub move_eraser1



			MODPLAY((int)strptr(MOD_INGAMESONG)) 	
			MODVOL(15)


	RLOCATE 116,17
	PRINT "score=";score
Again: wat? You're starting up the main tune every frame ingame? How is that even supposed to work?

I'm not sure what happens inside the U235SE (that's for linkovitch to answer) but this is completely NOT what the guideline I posted above. I didn't say "oh please start up the mod every frame, that'll teach it a lesson, the old fool!", just "use this snippet to stop the module and then start it OCNE".

If I'm being a bit harsh, well, I'm getting a bit tired of "rb+ is broken" / "it's the others' fault, not mine" blame shifts. Please, do continue posting progress reports and questions, but leave the conclusions to the reader. Also, I didn't test it on a real machine but this might fix things up a bit.

Edited by ggn, Wed Mar 22, 2017 12:21 PM.


#63 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Wed Mar 22, 2017 5:00 PM

I had changed the code since then, It reads now:

...
    if Headturnanimframe=180 then
        MODPLAY(0)
        SNDKILL(0)
        SNDKILL(1)
        SNDKILL(2)
        SNDKILL(3)
        VSYNC
        U235SE_modregdump[0]=0
        U235SE_modregdump[2]=0
        U235SE_modregdump[3]=0
        U235SE_modregdump[4]=0
        U235SE_modregdump[5]=0    
        MODPLAY((int)strptr(MOD_ALTTSMUSIC))             
        endif

    if Headturnanimframe>180 then
        Fframe=3
        RSETOBJ(titlescreen,R_sprite_active,R_is_active)
        RSETOBJ(walrus,R_sprite_active,R_is_inactive)
        RSETOBJ(ingamebg,R_sprite_active,R_is_inactive)    
    endif

and

sub move_eraser1

            MODVOL(15)

    RLOCATE 116,17
    PRINT "score=";score
    scoretimer++
    if (scoretimer=59) then
    score++
    scoretimer=0

    endif
    RSETOBJ(eraser1,R_sprite_active,R_is_active)
...

I'm sorry, I should have posted the new code after realizing that that didn't work. I'm also sorry that I don't know very much about jaguar coding.

 

Attached Files



#64 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Wed Mar 22, 2017 6:54 PM

I moved the instances of the mod clearing code into one gosub then I called it every time I needed it. I don't know what to do here, and I'm sorry if I sound angry but I would really like the music to work good, even though it's only my first Jaguar game. Here is the most recent ROM and the most recent BAS. I cleaned up the code a little.

Attached Files



#65 ggn OFFLINE  

ggn

    Stargunner

  • 1,356 posts
  • Location:Athens, Greece

Posted Thu Mar 23, 2017 12:28 AM


I'm sorry, I should have posted the new code after realizing that that didn't work. I'm also sorry that I don't know very much about jaguar coding.

 

 

Nobody is accusing you of that. Nobody is perfect, and everyone started at zero knowledge. From personal experience, programming needs stubbornness and practice. I'm stubborn enough and don't want to admit defeat easily so I just keep bashing the problems till they work. When that happens then I sit down and try to find out why this works and the other thing didn't. And like I said above, it's not a crime to ask questions or report bugs. It just saves (at least me) a substantial amount of time looking for non-bugs, looking at other people's code.

 

What I'm simply asking is for people to put on some effort like I did when I was jamming everything together making rb+.


Edited by ggn, Thu Mar 23, 2017 12:30 AM.


#66 CyranoJ OFFLINE  

CyranoJ

    Quadrunner

  • 5,317 posts
  • RAPTOR in LOCAL
  • Location:Adelaide, SA

Posted Thu Mar 23, 2017 1:29 AM

I'll help anyone showing some spirit and willing to put in the effort.

 

Pressing CTRL-C/CTRL-V doesn't count.



#67 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Wed May 10, 2017 3:55 PM

Got back to working on this again. Figured out how to make your own font.

Attached File  stickmannewfont2.png   84.09KB   1 downloads



#68 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Wed May 10, 2017 6:40 PM

Is there any way to change the score color?



#69 CyranoJ OFFLINE  

CyranoJ

    Quadrunner

  • 5,317 posts
  • RAPTOR in LOCAL
  • Location:Adelaide, SA

Posted Wed May 10, 2017 7:03 PM

Is there any way to change the score color?

 

Change the colour in the font .bmp :)



#70 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Wed May 10, 2017 7:31 PM

I changed it to green and it shows up red.



#71 CyranoJ OFFLINE  

CyranoJ

    Quadrunner

  • 5,317 posts
  • RAPTOR in LOCAL
  • Location:Adelaide, SA

Posted Wed May 10, 2017 8:08 PM

Ah. With the api the font takes the palette from the partipal.bmp file. Not sure if rb is the same but check that.

#72 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,344 posts
  • Location:Salem, Oregon

Posted Wed May 10, 2017 9:02 PM

After fiddling with various files for 90 minutes, I finally made it green.
Attached File  stickmangreen.png   47.05KB   1 downloads



#73 Jeffrey_Bones OFFLINE  

Jeffrey_Bones

    Dragonstomper

  • 952 posts
  • Location:Charlotte, NC

Posted Wed May 10, 2017 11:39 PM

After fiddling with various files for 90 minutes, I finally made it green.
attachicon.gifstickmangreen.png

Good work, and nice font. Which one of the 3 .bmp files did you change, and how were you able to change the red to green? I assume you had to delete everything in the build folder?

#74 ggn OFFLINE  

ggn

    Stargunner

  • 1,356 posts
  • Location:Athens, Greece

Posted Thu May 11, 2017 12:35 AM

Good work, and nice font. Which one of the 3 .bmp files did you change, and how were you able to change the red to green? I assume you had to delete everything in the build folder?


Depends on the font size you want to print - 8x8, 8x16 or 16x16. You don't need to delete anything from the build folder as the current versions of the font files are being used with each build.

#75 CyranoJ OFFLINE  

CyranoJ

    Quadrunner

  • 5,317 posts
  • RAPTOR in LOCAL
  • Location:Adelaide, SA

Posted Thu May 11, 2017 1:04 AM

Titles, music, input, collision detection, animation, scoring: A+ for effort that man!

 

Onwards and upwards to better things :)





Reply to this topic



  


0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users