@includefrom superfx.asm pushpc ORG $04D6E9 JSL LoadTriangles pullpc LoadTriangles: REP #$20 LDY.b #Triangles>>16 LDA.w #Triangles JSR $1E80 RTL arch superfx Triangles: iwt R9, #$0F from R9 ramb iwt R9, #$4000 ldb (R10) inc R9 ntri: from R10 beq finalend from R9 to R9 ldw (R3) add #2 ldw (R4) add #2 ldw (R5) add #2 iwt R6,#0 ; Use IBT instead, it is shorter and will clear all bits iwt R7,#0 ; Also it is smaller iwt R8,#0 iwt R12,#$F000 cache move R13,R15 move R0,R3 from R0 ;\ No need to specify R0 as source/destination to R0 ;/ Such thing is done automatically after using other opcodes except ALTx/Bxx/WITH/TO/FROM or R4 or R5 bpl toplot nop from R0 to R0 sub R0 color plot afterplot: from R9 to R9 ldw (R11) add #2 from R3 to R3 add R11 from R9 to R9 ldw (R11) add #2 from R4 to R4 add R11 from R9 to R9 ldw (R11) sub #4 from R5 to R5 add R11 from R12 to R0 lob dec R0 beq test nop aftertest: loop nop dec R10 from R9 to R9 add #13 bra ntri nop toplot: from R9 to R9 add #12 getc plot sub #12 bra afterplot nop test: from R9 to R9 add #6 ldw (R11) add #2 from R6 to R6 add R11 from R9 to R9 ldw (R11) add #2 from R7 to R7 add R11 from R9 to R9 ldw (R11) sub #10 from R8 to R8 add R11 move R3,R6 move R4,R7 move R5,R8 bra aftertest nop finalend: stop arch 65816