Shop OBEX P1 Docs P2 Docs Learn Events
P2 Invaders 2.0 - Their back! — Parallax Forums

P2 Invaders 2.0 - Their back!

ozpropdevozpropdev Posts: 2,792
edited 2018-04-17 01:44 in Propeller 2
Hi All

Here's the new version of Invaders for the P2.
This time around the code design is quite a departure from the original P2-Hot version.
In this version the system uses a "sprite engine" instead of a video frame buffer.
The same also applies for the 2 * "text engines" that build the video lines on the fly.
The sprite/text engines take advantage of the "masked write" WMLONG instruction.
The video driver and sprite/text engines are all sync'd with the COGATN mechanism.
Sound is generated using a simple 4 bit resistor ladder fed by the new streamer hardware.
The "game engine" utilizes cog/lut and hub exec modes.
The cordic solver is used in some of the animation/effects code.

The code runs on all 3 test platforms that support VGA connection (P123-A7,P123-A9 and DE2-115 with add-on board).

Code only runs on P123-A9 FPGA board with 8 cogs now.
Hope you have as much fun playing the game and pulling the code apart as i did writing it.

oz

Update 17th April 2018: Latest version for 32b FPGA image

All3FPGA.jpg

Comments

  • cgraceycgracey Posts: 14,152
    edited 2016-10-19 02:36
    Neat, Ozpropdev!

    How did it feel different to write from the P2-Hot version? Was it easier or harder? Did you feel you had more or less flexibility? Which one was more fun to work on? I'm wondering about the programming ergonomics.

    How many cogs did you wind up using? Were you forced to under-utilize any cogs, or could you spread the workload evenly? How about compared to P2-Hot?
  • cgracey wrote: »
    Neat, Ozpropdev!

    How did it feel different to write from the P2-Hot version? Was it easier or harder? Did you feel you had more or less flexibility? Which one was more fun to work on? I'm wondering about the programming ergonomics.

    How many cogs did you wind up using? Were you forced to under-utilize any cogs, or could you spread the workload evenly? How about compared to P2-Hot?

    When I started on the P2-Hot version I only had a 1 cog Nano to develop on.
    This forced me down the multi-tasking road and writing some tight code which takes longer and gets a bit messy.
    This time around I wanted to try and make it simpler so in the end I used seven cogs.
    I am still exposed to P2-Hot code as well as the latest P2 incarnation and find them both a joy to code.
    Even though P2-Hot had 1 clock instructions I think the new P2 compensates nicely with lut execution, smartpins, new hub scheme and 16 cogs.
    I personally don't find one harder/easier than the other, just a little different.

    I am a big fan of both variants so it's hard to pick a favourite, I'd buy both. :)





  • Great questions and great answers.
    I hope someday we can buy both. :)
  • Cluso99Cluso99 Posts: 18,069
    Well done Brian !!!

    IIRC the P2-Hot only had 128KB of hub ram. I would have loved to see P2-HOT silicon tho'. Perhaps just splitting the hub ram into 16KB blocks would have helped the hub power section. Certainly would be interesting to see the real power usage under normal operating conditions - not the contrived flat out operating conditions.

    In the current P2, if we have all 16 cogs running hubexec, I expect to see something towards "hot" style power consumption. But the removal of quad cog ram/lut and quad threads per cog should save power.

    And now OnSemi is offering low leakage transistors too. It all adds up ;)

  • Another 3 cheers from me!
    Very very cool.

    Almost makes me wanna get a P2 setup to play with.
    (Almost- because I'd probably never finish anything else I'm suppose to be doing... that fear will keep me away a bit longer!)

    :)



  • Random question: why was it called P2-HOT?
  • Final design would have required 5 watts and a Ball Gate Array package.

  • evanhevanh Posts: 15,915
    Ball Grid Array
  • I'm leaving it, because funny.

    Dang android. I swear, I've gotten really good on mobile. Some days, can do all my work on a Note 5. (My 4 got mangled) That includes CAD!

    Did it at the beach once, just because.

    Most can be touch and voice input too. Some needs Bluetooth keyboard mouse. And it is possible to be productive with all that. (Hint: get a tween or 20 something to run through how they work. It's different.)

    But automangle just isn't there. It's supposed to get good as I use it. Fail.

    And the worst is when it makes the edits. I tend to glance when making input actions. And the latency is enough, I will see it, verify state of input matches my running intent, then glance away, and then it does it.

    Sneaky.



  • Can't wait to get back to my P2 and run this. Thanks for sharing it.

    :D

  • rjo__rjo__ Posts: 2,114
    OPD,

    I broke into a cold sweat when my monitor showed 640x480 input, but nothing but a black screen. But since I have been suspecting my monitor for a while, I finally dug out a recent vintage, 12 inch VGA LCD and as if by magic, my pictures match your pictures.

    YES!!!

    I really like the way you have segmented the code. It makes re-using and playing with various parts so much easier.

    Thanks

    p.s.

    If anyone has a 32" recent make Vizio, give this a shot. Is it Vizio? or just my particular monitor?
  • This looks really good, OzPropDev!.

    How did you go with attempting to exercise most/all instructions?
  • Tubular wrote: »
    How did you go with attempting to exercise most/all instructions?

    Analysis shows I missed the mark by more than I thought.
    Instruction usage analysis of file :  P2 Invaders 2.0.41_v12.spin2
    
    Total instructions available (V12) = 268
    
    1 : ABS * 3
    2 : ADD * 128
    3 : ADDCT1 * 7
    4 : ADDCT2 * 1
    5 : ADDCT3 * 2
    6 : ADDX * 2
    7 : ALTD * 9
    8 : ALTI * 4
    9 : AND * 17
    10 : ANDN * 1
    11 : ANYB * 4
    12 : CALL * 220
    13 : CALLD * 3
    14 : CLKSET * 1
    15 : CLRB * 19
    16 : CMP * 48
    17 : CMPR * 1
    18 : CMPS * 4
    19 : CMPSUB * 1
    20 : COGATN * 22
    21 : COGID * 2
    22 : COGINIT * 6
    23 : DECOD * 2
    24 : DIRH * 3
    25 : DJNS * 6
    26 : DJNZ * 27
    27 : GETBYTE * 2
    28 : GETCT * 7
    29 : GETNIB * 2
    30 : GETQX * 16
    31 : GETQY * 4
    32 : GETRND * 10
    33 : GETWORD * 5
    34 : INCMOD * 22
    35 : JMP * 112
    36 : JMPREL * 2
    37 : LOC * 104
    38 : MAX * 3
    39 : MIN * 1
    40 : MINS * 1
    41 : MOV * 350
    42 : MOVBYTS * 8
    43 : MUL * 20
    44 : MULPIX * 2
    45 : NEG * 1
    46 : NOTB * 1
    47 : OR * 5
    48 : OUTN * 2
    49 : POLLATN * 2
    50 : POLLCT1 * 4
    51 : POLLCT2 * 1
    52 : POLLXFI * 1
    53 : POP * 5
    54 : PUSH * 5
    55 : QDIV * 10
    56 : QFRAC * 2
    57 : QMUL * 1
    58 : QROTATE * 3
    59 : QSQRT * 1
    60 : RCL * 5
    61 : RCR * 2
    62 : RDBYTE * 7
    63 : RDFAST * 2
    64 : RDLONG * 58
    65 : RDLUT * 17
    66 : RDPIN * 2
    67 : REP * 19
    68 : RET * 133
    69 : RFBYTE * 1
    70 : ROL * 6
    71 : ROLWORD * 4
    72 : ROR * 2
    73 : SETB * 15
    74 : SETBC * 4
    75 : SETBNZ * 1
    76 : SETBYTS * 5
    77 : SETBZ * 2
    78 : SETCI * 1
    79 : SETCMOD * 1
    80 : SETCQ * 1
    81 : SETCY * 1
    82 : SETCZ * 6
    83 : SETD * 3
    84 : SETINT1 * 1
    85 : SETINT3 * 1
    86 : SETQ * 7
    87 : SETQ2 * 6
    88 : SETS * 1
    89 : SETWORD * 3
    90 : SETXFRQ * 2
    91 : SHL * 19
    92 : SHR * 15
    93 : SUB * 34
    94 : SUBR * 8
    95 : TESTB * 42
    96 : TESTIN * 4
    97 : TJNZ * 3
    98 : TJZ * 10
    99 : TOPONE * 1
    100 : WAITATN * 15
    101 : WAITCT1 * 2
    102 : WAITX * 2
    103 : WFLONG * 2
    104 : WMLONG * 3
    105 : WRBYTE * 8
    106 : WRFAST * 1
    107 : WRLONG * 68
    108 : WRLUT * 13
    109 : WRPIN * 8
    110 : WXPIN * 3
    111 : WYPIN * 1
    112 : XCONT * 4
    113 : XINIT * 1
    114 : XOR * 1
    115 : XZERO * 2
    --------------------------------------------------------------------------------
    Instructions not used
    1 CCCC 1010010 00I DDDDDDDDD SSSSSSSSS        ADDPIX  D,S/#
    2 CCCC 0001010 CZI DDDDDDDDD SSSSSSSSS        ADDS    D,S/#       {WC,WZ}
    3 CCCC 0001011 CZI DDDDDDDDD SSSSSSSSS        ADDSX   D,S/#       {WC,WZ}
    4 CCCC 1101011 000 000100000 000100100        ALLOWI
    5 CCCC 1001111 01I DDDDDDDDD SSSSSSSSS        ALTR    D,S/#
    6 CCCC 1001111 11I DDDDDDDDD SSSSSSSSS        ALTS    D,S/#
    7 CCCC 11111nn nnn nnnnnnnnn nnnnnnnnn        AUGD    #23bits
    8 CCCC 11110nn nnn nnnnnnnnn nnnnnnnnn        AUGS    #23bits
    9 CCCC 1010010 10I DDDDDDDDD SSSSSSSSS        BLNPIX  D,S/#
    10 CCCC 1001101 00I DDDDDDDDD SSSSSSSSS    *   BMASK   D,S/#
    11 CCCC 0111011 CZI DDDDDDDDD SSSSSSSSS        BOTONE  D,S/#       {WC,WZ}
    12 CCCC 1101101 Rnn nnnnnnnnn nnnnnnnnn        CALL    #abs/#rel
    13 CCCC 1101011 CZ0 DDDDDDDDD 000101110        CALLA   D           {WC,WZ}
    14 CCCC 1101110 Rnn nnnnnnnnn nnnnnnnnn        CALLA   #abs/#rel
    15 CCCC 1101011 CZ0 DDDDDDDDD 000101111        CALLB   D           {WC,WZ}
    16 CCCC 1101111 Rnn nnnnnnnnn nnnnnnnnn        CALLB   #abs/#rel
    17 CCCC 11100ww Rnn nnnnnnnnn nnnnnnnnn        CALLD   reg,#abs/#rel
    18 CCCC 1011110 0LI DDDDDDDDD SSSSSSSSS    *   CALLPA  D/#,S/#
    19 CCCC 1011110 1LI DDDDDDDDD SSSSSSSSS    *   CALLPB  D/#,S/#
    20 CCCC 0010101 CZI DDDDDDDDD SSSSSSSSS        CMPM    D,S/#       {WC,WZ}
    21 CCCC 0010011 CZI DDDDDDDDD SSSSSSSSS        CMPSX   D,S/#       {WC,WZ}
    22 CCCC 0010001 CZI DDDDDDDDD SSSSSSSSS        CMPX    D,S/#       {WC,WZ}
    23 CCCC 1101011 00L DDDDDDDDD 000000011        COGSTOP D/#
    24 CCCC 0111001 CZI DDDDDDDDD SSSSSSSSS        DECMOD  D,S/#       {WC,WZ}
    25 CCCC 1101011 CZL DDDDDDDDD 001000010        DIRC    D/#         {WC,WZ}
    26 CCCC 1101011 CZL DDDDDDDDD 001000000        DIRL    D/#         {WC,WZ}
    27 CCCC 1101011 CZL DDDDDDDDD 001000110        DIRN    D/#         {WC,WZ}
    28 CCCC 1101011 CZL DDDDDDDDD 001000011        DIRNC   D/#         {WC,WZ}
    29 CCCC 1101011 CZL DDDDDDDDD 001000101        DIRNZ   D/#         {WC,WZ}
    30 CCCC 1101011 CZL DDDDDDDDD 001000100        DIRZ    D/#         {WC,WZ}
    31 CCCC 1011011 10I DDDDDDDDD SSSSSSSSS        DJS     D,S/#rel9
    32 CCCC 1011011 00I DDDDDDDDD SSSSSSSSS        DJZ     D,S/#rel9
    33 CCCC 1100100 1LI DDDDDDDDD SSSSSSSSS        FBLOCK  D/#,S/#
    34 CCCC 1101011 000 DDDDDDDDD 000110101        GETINT  D
    35 CCCC 1101011 000 DDDDDDDDD 000110100        GETPTR  D
    36 CCCC 1101011 000 DDDDDDDDD 000011110        GETXCOS D
    37 CCCC 1101011 000 DDDDDDDDD 000011111        GETXSIN D
    38 CCCC 1011010 11I DDDDDDDDD SSSSSSSSS        IJNS    D,S/#rel9
    39 CCCC 1011010 01I DDDDDDDDD SSSSSSSSS        IJNZ    D,S/#rel9
    40 CCCC 1011010 10I DDDDDDDDD SSSSSSSSS        IJS     D,S/#rel9
    41 CCCC 1011010 00I DDDDDDDDD SSSSSSSSS        IJZ     D,S/#rel9
    42 CCCC 0100000 CZI DDDDDDDDD SSSSSSSSS        ISOB    D,S/#       {WC,WZ}
    43 CCCC 1101100 Rnn nnnnnnnnn nnnnnnnnn        JMP     #abs/#rel
    44 CCCC 1011101 1LI DDDDDDDDD SSSSSSSSS        JNP     D/#,S/#rel9
    45 CCCC 1011101 0LI DDDDDDDDD SSSSSSSSS        JP      D/#,S/#rel9
    46 CCCC 1101011 C0L DDDDDDDDD 000000110        LOCKCLR D/#         {WC}
    47 CCCC 1101011 CZ0 DDDDDDDDD 000000100        LOCKNEW D           {WC,WZ}
    48 CCCC 1101011 00L DDDDDDDDD 000000101        LOCKRET D/#
    49 CCCC 1101011 C0L DDDDDDDDD 000000111        LOCKSET D/#         {WC}
    50 CCCC 0011011 CZI DDDDDDDDD SSSSSSSSS        MAXS    D,S/#       {WC,WZ}
    51 CCCC 1001011 01I DDDDDDDDD SSSSSSSSS        MERGEB  D,S/#
    52 CCCC 1001011 11I DDDDDDDDD SSSSSSSSS        MERGEW  D,S/#
    53 CCCC 1010010 11I DDDDDDDDD SSSSSSSSS        MIXPIX  D,S/#
    54 CCCC 1010000 1ZI DDDDDDDDD SSSSSSSSS        MULS    D,S/#       {WZ}
    55 CCCC 0101100 CZI DDDDDDDDD SSSSSSSSS        MUXC    D,S/#       {WC,WZ}
    56 CCCC 0101101 CZI DDDDDDDDD SSSSSSSSS        MUXNC   D,S/#       {WC,WZ}
    57 CCCC 0101111 CZI DDDDDDDDD SSSSSSSSS        MUXNZ   D,S/#       {WC,WZ}
    58 CCCC 0101110 CZI DDDDDDDDD SSSSSSSSS        MUXZ    D,S/#       {WC,WZ}
    59 CCCC 0110100 CZI DDDDDDDDD SSSSSSSSS        NEGC    D,S/#       {WC,WZ}
    60 CCCC 0110101 CZI DDDDDDDDD SSSSSSSSS        NEGNC   D,S/#       {WC,WZ}
    61 CCCC 0110111 CZI DDDDDDDDD SSSSSSSSS        NEGNZ   D,S/#       {WC,WZ}
    62 CCCC 0110110 CZI DDDDDDDDD SSSSSSSSS        NEGZ    D,S/#       {WC,WZ}
    63 CCCC 0110001 CZI DDDDDDDDD SSSSSSSSS        NOT     D,S/#       {WC,WZ}
    64 CCCC 1101011 CZL DDDDDDDDD 001001010        OUTC    D/#         {WC,WZ}
    65 CCCC 1101011 CZL DDDDDDDDD 001001001        OUTH    D/#         {WC,WZ}
    66 CCCC 1101011 CZL DDDDDDDDD 001001000        OUTL    D/#         {WC,WZ}
    67 CCCC 1101011 CZL DDDDDDDDD 001001011        OUTNC   D/#         {WC,WZ}
    68 CCCC 1101011 CZL DDDDDDDDD 001001101        OUTNZ   D/#         {WC,WZ}
    69 CCCC 1101011 CZL DDDDDDDDD 001001100        OUTZ    D/#         {WC,WZ}
    70 CCCC 1101011 C00 000000011 000100100        POLLCT3             {WC}
    71 CCCC 1101011 C00 000001001 000100100        POLLFBW             {WC}
    72 CCCC 1101011 C00 000000000 000100100        POLLINT             {WC}
    73 CCCC 1101011 C00 000001000 000100100        POLLPAT             {WC}
    74 CCCC 1101011 C00 000001111 000100100        POLLQMT             {WC}
    75 CCCC 1101011 C00 000000100 000100100        POLLSE1             {WC}
    76 CCCC 1101011 C00 000000101 000100100        POLLSE2             {WC}
    77 CCCC 1101011 C00 000000110 000100100        POLLSE3             {WC}
    78 CCCC 1101011 C00 000000111 000100100        POLLSE4             {WC}
    79 CCCC 1101011 C00 000001010 000100100        POLLXMT             {WC}
    80 CCCC 1101011 C00 000001101 000100100        POLLXRL             {WC}
    81 CCCC 1101011 C00 000001100 000100100        POLLXRO             {WC}
    82 CCCC 1101011 00L DDDDDDDDD 000001111        QEXP    D/#
    83 CCCC 1101011 00L DDDDDDDDD 000001110        QLOG    D/#
    84 CCCC 1101010 1LI DDDDDDDDD SSSSSSSSS        QVECTOR D/#,S/#
    85 CCCC 1010111 CZI DDDDDDDDD SSSSSSSSS        RDWORD  D,S/#/PTRx  {WC,WZ}
    86 CCCC 1101011 CZ0 000000000 000110010        RETA                {WC,WZ}
    87 CCCC 1101011 CZ0 000000000 000110011        RETB                {WC,WZ}
    88 CCCC 1001110 00I DDDDDDDDD SSSSSSSSS        REV     D,S/#
    89 CCCC 1101011 CZ0 DDDDDDDDD 000010010        RFLONG  D           {WC,WZ}
    90 CCCC 1101011 CZ0 DDDDDDDDD 000010001        RFWORD  D           {WC,WZ}
    91 CCCC 1001100 11I DDDDDDDDD SSSSSSSSS        RGBEXP  D,S/#
    92 CCCC 1001100 10I DDDDDDDDD SSSSSSSSS        RGBSQZ  D,S/#
    93 CCCC 1001000 nnI DDDDDDDDD SSSSSSSSS        ROLBYTE D,S/#,#n
    94 CCCC 100010n nnI DDDDDDDDD SSSSSSSSS        ROLNIB  D,S/#,#n
    95 CCCC 0000111 CZI DDDDDDDDD SSSSSSSSS        SAL     D,S/#       {WC,WZ}
    96 CCCC 0000110 CZI DDDDDDDDD SSSSSSSSS        SAR     D,S/#       {WC,WZ}
    97 CCCC 1010001 1ZI DDDDDDDDD SSSSSSSSS        SCL     D,S/#       {WZ}
    98 CCCC 1010001 0ZI DDDDDDDDD SSSSSSSSS        SCLU    D,S/#       {WZ}
    99 CCCC 0100101 CZI DDDDDDDDD SSSSSSSSS        SETBNC  D,S/#       {WC,WZ}
    100 CCCC 1101011 00L DDDDDDDDD 000110110        SETBRK  D/#
    101 CCCC 1000110 nnI DDDDDDDDD SSSSSSSSS        SETBYTE D,S/#,#n
    102 CCCC 1101011 00L DDDDDDDDD 000111011        SETCFRQ D/#
    103 CCCC 1101011 00L DDDDDDDDD 000011100        SETDACS D/#
    104 CCCC 1101011 00L DDDDDDDDD 000100110        SETINT2 D/#
    105 CCCC 1101011 00L DDDDDDDDD 000110111        SETLUT  D/#
    106 CCCC 100000n nnI DDDDDDDDD SSSSSSSSS        SETNIB  D,S/#,#n
    107 CCCC 1011111 0LI DDDDDDDDD SSSSSSSSS    *   SETPEQ  D/#,S/#
    108 CCCC 1101011 00L DDDDDDDDD 000111110        SETPIV  D/#
    109 CCCC 1101011 00L DDDDDDDDD 000111101        SETPIX  D/#
    110 CCCC 1011111 1LI DDDDDDDDD SSSSSSSSS    *   SETPNE  D/#,S/#
    111 CCCC 1001110 01I DDDDDDDDD SSSSSSSSS        SETR    D,S/#
    112 CCCC 1101011 00L DDDDDDDDD 000100000        SETSE1  D/#
    113 CCCC 1101011 00L DDDDDDDDD 000100001        SETSE2  D/#
    114 CCCC 1101011 00L DDDDDDDDD 000100010        SETSE3  D/#
    115 CCCC 1101011 00L DDDDDDDDD 000100011        SETSE4  D/#
    116 CCCC 1001100 00I DDDDDDDDD SSSSSSSSS        SEUSSF  D,S/#
    117 CCCC 1001100 01I DDDDDDDDD SSSSSSSSS        SEUSSR  D,S/#
    118 CCCC 1001011 00I DDDDDDDDD SSSSSSSSS        SPLITB  D,S/#
    119 CCCC 1001011 10I DDDDDDDDD SSSSSSSSS        SPLITW  D,S/#
    120 CCCC 1101011 000 000100001 000100100        STALLI
    121 CCCC 0001110 CZI DDDDDDDDD SSSSSSSSS        SUBS    D,S/#       {WC,WZ}
    122 CCCC 0001111 CZI DDDDDDDDD SSSSSSSSS        SUBSX   D,S/#       {WC,WZ}
    123 CCCC 0001101 CZI DDDDDDDDD SSSSSSSSS        SUBX    D,S/#       {WC,WZ}
    124 CCCC 0011100 CZI DDDDDDDDD SSSSSSSSS        SUMC    D,S/#       {WC,WZ}
    125 CCCC 0011101 CZI DDDDDDDDD SSSSSSSSS        SUMNC   D,S/#       {WC,WZ}
    126 CCCC 0011111 CZI DDDDDDDDD SSSSSSSSS        SUMNZ   D,S/#       {WC,WZ}
    127 CCCC 0011110 CZI DDDDDDDDD SSSSSSSSS        SUMZ    D,S/#       {WC,WZ}
    128 CCCC 0111101 CZI DDDDDDDDD SSSSSSSSS        TEST    D,S/#       {WC,WZ}
    129 CCCC 0111100 CZI DDDDDDDDD SSSSSSSSS        TESTN   D,S/#       {WC,WZ}
    130 CCCC 1101011 CZL DDDDDDDDD 001001111        TESTNIN D/#         {WC,WZ}
    131 CCCC 1011100 11I DDDDDDDDD SSSSSSSSS        TJNS    D,S/#rel9
    132 CCCC 1011100 10I DDDDDDDDD SSSSSSSSS        TJS     D,S/#rel9
    133 CCCC 1101011 000 000100010 000100100        TRGINT1
    134 CCCC 1101011 000 000100011 000100100        TRGINT2
    135 CCCC 1101011 000 000100100 000100100        TRGINT3
    136 CCCC 1001101 01I DDDDDDDDD SSSSSSSSS    *   TRIML   D,S/#
    137 CCCC 1001101 10I DDDDDDDDD SSSSSSSSS    *   TRIMR   D,S/#
    138 CCCC 1101011 C00 000010010 000100100        WAITCT2             {WC}
    139 CCCC 1101011 C00 000010011 000100100        WAITCT3             {WC}
    140 CCCC 1101011 C00 000011001 000100100        WAITFBW             {WC}
    141 CCCC 1101011 C00 000010000 000100100        WAITINT             {WC}
    142 CCCC 1101011 C00 000011000 000100100        WAITPAT             {WC}
    143 CCCC 1101011 C00 000010100 000100100        WAITSE1             {WC}
    144 CCCC 1101011 C00 000010101 000100100        WAITSE2             {WC}
    145 CCCC 1101011 C00 000010110 000100100        WAITSE3             {WC}
    146 CCCC 1101011 C00 000010111 000100100        WAITSE4             {WC}
    147 CCCC 1101011 C00 000011011 000100100        WAITXFI             {WC}
    148 CCCC 1101011 C00 000011010 000100100        WAITXMT             {WC}
    149 CCCC 1101011 C00 000011101 000100100        WAITXRL             {WC}
    150 CCCC 1101011 C00 000011100 000100100        WAITXRO             {WC}
    151 CCCC 1101011 00L DDDDDDDDD 000010011        WFBYTE  D/#
    152 CCCC 1101011 00L DDDDDDDDD 000010100        WFWORD  D/#
    153 CCCC 1100010 1LI DDDDDDDDD SSSSSSSSS        WRWORD  D/#,S/#/PTRx
    

    With a bit more "free time" I could weave more of these into the code but i'm back onto smartpin stuff now and preparing for analog testing. :)





  • cgraceycgracey Posts: 14,152
    Ozpropdev,

    It looks like you used SETBYTS five times. I just got rid of that to allow ALTB for addressing multi-long bit fields.

    I'm thinking maybe TRIML should be gotten rid of, TRIMR changed to BTRIM, and SETBYTS put back in. What do you think? SETBYTS does save an instruction (MOV reg,value + MOVBYTS reg,#%00_00_00_00), but in the case where you just want to copy the bottom byte to the others, MOVBYTS is sufficient. What do you think?
  • IMO ALTB sounds more useful than SETBYTS and as you pointed out MOVBYTS ca be used as a close substitute.
    Keeping TRIML also seems more useful to keep at the expense of losing SETBYTS.

  • cgraceycgracey Posts: 14,152
    ozpropdev wrote: »
    IMO ALTB sounds more useful than SETBYTS and as you pointed out MOVBYTS ca be used as a close substitute.
    Keeping TRIML also seems more useful to keep at the expense of losing SETBYTS.

    Ok. Thanks.
  • Nice thorough analysis. I'm sure the out instructions could find a purpose. Seussf/r?
  • Update for FPGA Image V13 added to first post.
  • Updated to V32b image. See top post.

    BTW Only runs on P123-A9 boards now.
    Sorry code is a bit messy. Lots of changes along the way from V13 image. :)
  • Sweet, I am running this now on my A9 board. Not sure what I need to rig up to get sound though...
  • jmgjmg Posts: 15,173
    ozpropdev wrote: »
    Updated to V32b image. See top post.

    BTW Only runs on P123-A9 boards now.
    Sorry code is a bit messy. Lots of changes along the way from V13 image. :)

    Is the new code smaller and faster ? ( V13 -> V32b ?)

  • Roy Eltham wrote: »
    Sweet, I am running this now on my A9 board. Not sure what I need to rig up to get sound though...
    I'm using a 4 bit R2R resistor ladder on P11:P8 as a basic DAC.
    Coupled via a cap to drive an audio amp.
    Not very "Hi-Fi" but enough to add to the overall game atmosphere. :)
    Haven't got component values handy at the moment.


  • Any reason not to use one of the available DACs on the A9 board?
  • ozpropdevozpropdev Posts: 2,792
    edited 2018-04-17 03:49
    jmg wrote: »
    Is the new code smaller and faster ? ( V13 -> V32b ?)
    Speed is the same and code size is slightly larger but not by much.
    The bulk of the changes have been related to changes to instruction operation.
    IIRC here's some of the things that changed along the way that broke my code temporarily.

    The WMLONG instruction transparent value changed from FF to 00.
    The CT overflow check changed which affected my time delay operation.
    The Z flag changed to a inverted state.
    Some instructions were deleted from the instructions set and therefore needed substation.
    I'm sure there were more than that, but that's all I can remember at the moment.


  • Roy Eltham wrote: »
    Any reason not to use one of the available DACs on the A9 board?
    On the P123-A9 board we can only access the 1 DAC and all 4 channels are used for RGB and sync.
    The circuit changed from the P123-A7 board which was easier for Chip to map the second DAC.
    It would have been nice to get to the second DAC.

    When we get our silicon P2's we can have sound on any pin we like. :)



  • Oh, so the A9 board has a second DAC we can't use :( seems like a waste.
Sign In or Register to comment.