Shop OBEX P1 Docs P2 Docs Learn Events
PROP2 Invaders - 1 Cog (Now with sound effects!) - Page 3 — Parallax Forums

PROP2 Invaders - 1 Cog (Now with sound effects!)

13

Comments

  • ozpropdevozpropdev Posts: 2,791
    edited 2013-09-16 02:59
    Sapieha wrote:

    In Your code You used instruction
    testb - Can You point me to place this instruction is described

    Hi Sapieha

    Good Question.
    I looked through all the documentation I've got and couldn't find it?
    The only reference I found was in Chip's Spin2 Interpreter. (Just x1 occurrence)
    I'm not sure now where I read it!
    I'll have to check but I think it's a variant of the ISOB instruction?

    I'll keep looking for you.

    Brian
  • SapiehaSapieha Posts: 2,964
    edited 2013-09-16 03:34
    Hi ozpropdev

    Thanks

    I found place Andy point that instruction
    http://forums.parallax.com/showthread.php/144683-Propeller-II-programing-questions-to-Chip?p=1175667&viewfull=1#post1175667

    I to don't find it in any of Chip's descriptions --- It is why I asked

    ozpropdev wrote: »
    Hi Sapieha

    Good Question.
    I looked through all the documentation I've got and couldn't find it?
    The only reference I found was in Chip's Spin2 Interpreter. (Just x1 occurrence)
    I'm not sure now where I read it!
    I'll have to check but I think it's a variant of the ISOB instruction?

    I'll keep looking for you.

    Brian
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-09-29 19:24
    Hey, Brian. Just noticed that you updated your counter-rotating props cap avatar to be more menacing. Cool! Space Invaders in 1 cog on the Prop 2 is indeed a signature achievement and worthy of its own logo.
  • David BetzDavid Betz Posts: 14,511
    edited 2013-10-01 13:43
    I'm finally getting around to trying Space Invaders but I'm not sure I know how to get it loaded and running. I'm afraid my mistake may be that I updated the FPGA configuration on my DE0-Nano and am using Chip's new PNut.exe. Will this work with the existing version of Space Invaders or does SI have to be updated for Chip's latest P2 changes?

    Edit: I guess there is at least one reason why this won't work on Chip's new P2 configurations. The new ones run at 80mhz. I guess I'll have to wait for ozpropdev issues an updated version.
  • cgraceycgracey Posts: 14,133
    edited 2013-10-01 14:23
    David Betz wrote: »
    I'm finally getting around to trying Space Invaders but I'm not sure I know how to get it loaded and running. I'm afraid my mistake may be that I updated the FPGA configuration on my DE0-Nano and am using Chip's new PNut.exe. Will this work with the existing version of Space Invaders or does SI have to be updated for Chip's latest P2 changes?

    Edit: I guess there is at least one reason why this won't work on Chip's new P2 configurations. The new ones run at 80mhz. I guess I'll have to wait for ozpropdev issues an updated version.

    Yes, he'll need to retime it. Also, he can get rid of the polling before WAITVID, since it will now loop in place until it executes. He can also use the new serial port to reduce his serial implementation.

    BTW, TESTB is ISOB NR (no result).
  • ozpropdevozpropdev Posts: 2,791
    edited 2013-10-01 16:10
    David Betz wrote: »
    I'm finally getting around to trying Space Invaders but I'm not sure I know how to get it loaded and running. I'm afraid my mistake may be that I updated the FPGA configuration on my DE0-Nano and am using Chip's new PNut.exe. Will this work with the existing version of Space Invaders or does SI have to be updated for Chip's latest P2 changes?

    Edit: I guess there is at least one reason why this won't work on Chip's new P2 configurations. The new ones run at 80mhz. I guess I'll have to wait for ozpropdev issues an updated version.

    Hi David

    I upgraded my DE0 late last night and tried to get invaders going.
    A few tweaks and I should have a new version later today.

    Cheers
    Brian
  • David BetzDavid Betz Posts: 14,511
    edited 2013-10-01 17:00
    ozpropdev wrote: »
    Hi David

    I upgraded my DE0 late last night and tried to get invaders going.
    A few tweaks and I should have a new version later today.

    Cheers
    Brian
    Great! I can't say I'm doing quite so well getting PropGCC working again on the P2. I think my problem may be the 20mhz startup clock.
  • cgraceycgracey Posts: 14,133
    edited 2013-10-01 17:34
    David Betz wrote: »
    Great! I can't say I'm doing quite so well getting PropGCC working again on the P2. I think my problem may be the 20mhz startup clock.

    The new configurations make the FPGAs behave more like the actual chip, which is running at 20MHz when the loader is loaded and executed. You can do CLKSET D, with D holding %mmmm_11_11, where clock frequency will be (%mmmm+1) * 5MHz. So, %1111_11_11 will set 80MHz.
  • David BetzDavid Betz Posts: 14,511
    edited 2013-10-01 18:22
    cgracey wrote: »
    The new configurations make the FPGAs behave more like the actual chip, which is running at 20MHz when the loader is loaded and executed. You can do CLKSET D, with D holding %mmmm_11_11, where clock frequency will be (%mmmm+1) * 5MHz. So, %1111_11_11 will set 80MHz.
    Thanks! I'm just for the moment assuming that the P2 always runs at 20mhz but that doesn't seem to be working. I changed the encoding of the settask instruction like you described in your original message about these changes. As far as I can tell, that is the only instruction that changed opcodes that I'm currently using. I'm basically using a modified version of your original serial driver that runs in a separate thread. Is there any reason that shouldn't work in the new modified FPGA code?
  • ozpropdevozpropdev Posts: 2,791
    edited 2013-10-01 20:48
    Hi Guys

    I just posted a new 80MHz version of invaders.
    It has been tested on my DE0 board but not on a my new DE2 board. I haven't got a DE2 add-on board for that yet.
    Let me know how it goes on a DE2.

    Cheers
    Brian
  • David BetzDavid Betz Posts: 14,511
    edited 2013-10-01 20:49
    ozpropdev wrote: »
    Hi Guys

    I just posted a new 80MHz version of invaders.
    It has been tested on my DE0 board but not on a my new DE2 board. I haven't got a DE2 add-on board for that yet.
    Let me know how it goes on a DE2.

    Cheers
    Brian
    Thanks! I'll try it tomorrow. Too tired to fire up the DE0-Nano tonight.... zzzz
  • David BetzDavid Betz Posts: 14,511
    edited 2013-10-02 07:21
    I just tried the 80mhz version on my D0-Nano and didn't get any output on my VGA monitor. Is there some jumper than needs to be installed or some other configuration that needs to be done for this to work?
  • cgraceycgracey Posts: 14,133
    edited 2013-10-02 09:25
    David Betz wrote: »
    I just tried the 80mhz version on my D0-Nano and didn't get any output on my VGA monitor. Is there some jumper than needs to be installed or some other configuration that needs to be done for this to work?

    I don't have the file on this computer, but I believe that pins 3 and 5 on the upward-facing header (when the Nano is plugged into the Prop2 base board) need to be jumpered.
  • David BetzDavid Betz Posts: 14,511
    edited 2013-10-02 11:36
    cgracey wrote: »
    I don't have the file on this computer, but I believe that pins 3 and 5 on the upward-facing header (when the Nano is plugged into the Prop2 base board) need to be jumpered.
    Thanks! Adding that jumper worked. I'm now able to run Space Invaders on my DE0-Nano!
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-10-03 10:08
    Brian,
    Looking at your code, you have the audio on P0-3. What is your preferred R2R resistor values and what decoupling C did you use? Presume you feed that to headphones or amplified speaker. Might try hooking it up in the morning.
  • ozpropdevozpropdev Posts: 2,791
    edited 2013-10-03 17:24
    Hi Ray

    I used a 270R R2R ladder only because I already had it and a big greencap.
    I don't know the value as I grabbed it out of my junk box (no markings)
    Heres what Tubular used
    Tubular wrote: »
    I hooked up the scope to verify and then some headphones, 47 ohm and 82 ohm resistors for the R2R, and a big series cap to AC couple.

    The base pin for the R2R is set at P5 (see game1 config section)
    ame1			long	@video1
    			long	left_button
    			long	right_button
    			long	fire_button
    			long	%1111			'pin mask for P0..P3
    			long	%1111_101100000		'pin configuration for video DAC
    			long	@pallette1
    			long	5   'lsb of r2r ladder for sound
    			long	0  'window
    


    From memory I started at P5 to skip the video sync signal on P0 or P4?
    Hooked it up to a MP3 dock/speakers and my house sounded like a video game arcade!

    Cheers
    Brian
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-10-03 18:20
    Brian,
    Congrats!!! This is really neato. I have it running on my DE0 - without sound - didn't bother as I have other things to do :)
  • ozpropdevozpropdev Posts: 2,791
    edited 2013-10-04 00:14
    Hi Guys

    I just upgraded to Version 1.57
    The main changes are the use of the new P2 instructions and serial sub-system.
    Video performance has been improved as well as reduced in size.
    Video task now only uses 12.5% of COG time.
    Improvements were also made to the diagnostic monitor speed and code size.
    Comms is now @ 3M instead of 115.2K. Live data updates now 2x previous frame rate.
    An overall reduction in main code size of 32 Longs!
    The new P2 enhancements have worked in very nicely.
    Thanks Chip!

    Cheers
    Brian

    P.S. I am currently working on a new DE2 version which takes advantage of the 128K hub ram. (More sound, multiple games and other enhancements)
  • potatoheadpotatohead Posts: 10,254
    edited 2013-10-05 20:14
    I just ran it on a DE2 and got no output. Chip's VGA sample worked, so I know the FPGA is at least working as it should.

    Never mind. F11 :)
  • ColeyColey Posts: 1,108
    edited 2013-10-08 14:19
    Yeah I just ran this too with F11, it's simply brilliant, 1 cog too!

    Thanks Ozpropdev ;-)
    potatohead wrote: »
    I just ran it on a DE2 and got no output. Chip's VGA sample worked, so I know the FPGA is at least working as it should.

    Never mind. F11 :)
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-10-08 15:44
    baggers: Have you tried leaving the orgs and fills the same and using Ctl-M to compile and then P2load to load as you did before? Just a thought.
  • BaggersBaggers Posts: 3,019
    edited 2013-10-11 01:59
    Ah, not tried that Cluso99, I'll give it a try tonight cheers ;)
  • ozpropdevozpropdev Posts: 2,791
    edited 2013-10-21 22:48
    Hi Guys

    New Version 1.60 now available with a 4 game variant for the DE2 board.
    The 4 game version has the diagnostic monitor disabled.
    It will support 4 sets of controls and sound if you have 4 ladders connected.
    Video has been tweaked to accommodate some video monitor differences. (Border and dot clock changes.)
    Let me know if any screens are being chopped at all.

    Enjoy!

    Cheers
    Brian

    Edit: 25th October 2013
    Make sure SW0 is OFF on the DE2 board if running the 4 game version.
    This will allow 4 x DEMO's to run correctly. :)
    See game configuration tables for more info.

  • ozpropdevozpropdev Posts: 2,791
    edited 2013-10-31 03:46
    Update: 31st October 2013
    Version 1.61 single game variants for DE0 and DE2
    Version 1.62 for DE2 -4 game variant - Fixed video glitch (Double-buffer issue)
    See first post for zip file
  • ozpropdevozpropdev Posts: 2,791
    edited 2014-01-13 18:34
    Hi All,
    Here are the updated versions for the Nov 27 2013 FPGA core. (Use F11 to run)

    @Chip
    Hope this helps to test your new FPGA code. :)


    Cheers
    Brian

    P.S. Did yoy get CORDIC BUGZ going yet?
  • cgraceycgracey Posts: 14,133
    edited 2014-01-13 19:38
    ozpropdev wrote: »
    Hi All,
    Here are the updated versions for the Nov 27 2013 FPGA core. (Use F11 to run)

    @Chip
    Hope this helps to test your new FPGA code. :)


    Cheers
    Brian

    P.S. Did yoy get CORDIC BUGZ going yet?


    Thanks, Brian.

    I didn't get CORDIC BUGZ going yet and I'm personally between the last and next update, so I don't have compatibility with anything that anyone else has right now. After the next big update, you'll probably get these applications all fixed up and I'll be able to see them.
  • ozpropdevozpropdev Posts: 2,791
    edited 2014-01-20 04:20
    Hi All

    I finally got around to update the 5 Cog-4 Player DE2 version of Invaders to the 27th Nov 2013 FPGA code.
    In the process I discovered a "bug" that took me quite a while to track down. It's all good now and
    the single player DE0/DE2 versions have been fixed too.

    Sorry the code is a bit of a "mess", but I have modified the code a few times now to
    keep with the changes to the FPGA over the past 12 months.

    Soon I hope to start on a new version that will use the new hub exec mode and
    some of the other new stuff.
    I am planning on documenting the process from the beginning and try and explain my process of
    development as I go, including testing and bug chasing. A "warts and all" account.
    Hopefully it will shed some light on the P2's cool features and instruction set.


    Feel free to quiz me about anything I have done here, and I try and answer as clearly as possible. :)

    Cheers
    Brian
  • ozpropdevozpropdev Posts: 2,791
    edited 2014-03-24 15:52
    Here the latest versions to suit the FPGA Build (20 March 2014). :)
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-24 16:15
    Space_Invaders_prop2_C.jpg


    Thanks! Brian. I tried it on a Nano DE0. Looks great!!
    708 x 441 - 118K
  • RaymanRayman Posts: 13,883
    edited 2014-03-24 16:45
    Thanks for updating this. My nano feels a bit less useless now...
    I think this example really shows the power of multitasking with P2...
Sign In or Register to comment.