2 ; Ullrich von Bassewitz, 2009-11-05
4 ; Helper function for graphics functions: Multiply two values, one being
5 ; an 8.8 fixed point one, and return the rounded and scaled result.
7 ; The module has two entry points: One is C callable and expects the
8 ; parameters in ax and the stack, the second is assembler callable and
9 ; expects the parameters in ax and ptr1
13 .export _tgi_imulround, tgi_imulround
14 .import popax, imul16x16r32
16 .include "zeropage.inc"
19 ;----------------------------------------------------------------------------
24 ; C callable entry point
33 ; ASM callable entry point
42 cmp #$80 ; Frac(x) >= 0.5?
44 ldy sreg+1 ; Check sign