# # BETATRON high level library for platform and action arcade games. # Copyright (C) 1997 Liouros Thanasis, liouros@hotmail.com # # TIMERAS.S: This file is part of the BETATRON library and can be used # and/or distributed only under the terms of the GNU Library # General Public License. See doc/readme.1st for details. # .data .globl _pl_int08handler .globl _pl_int08handler_save_ds .globl _pl_int08handler_end # long pl_dtime[3] .extern _pl_dtime # pl_usertimehandler() .extern _pl_timeruserhandler .extern _pl_cyclesno .extern _pl_timercount .extern _pl_oldint08adr # edo sozetai o ds oste na fortothei apo ton handler gia kathe endexomeno .text _pl_int08handler_save_ds: .word 0 _pl_int08handler: pushl %ecx pushl %edx pushw %ds pushl %edi pushl %eax pushl %ebx xor %ebx,%ebx movw %cs:_pl_int08handler_save_ds,%bx movw %bx,%ds movl _pl_timeruserhandler,%eax testl %eax,%eax jz DefaultHandling call *%eax jmp checkforchain DefaultHandling: # pl_dtime[0]++, pl_dtime[1]++, pl_dtime[2]++ movl $_pl_dtime,%edi incl (%edi) incl 4(%edi) incl 8(%edi) checkforchain: movl _pl_timercount,%eax addl %eax, _pl_cyclesno cmpl $0xffff,_pl_cyclesno ########### jle skipchain subl $0x10000, _pl_cyclesno pushfl lcall _pl_oldint08adr popl %ebx popl %eax popl %edi popw %ds popl %edx popl %ecx sti iret skipchain: movb $0x20,%al outb %al,$0x20 popl %ebx popl %eax popl %edi popw %ds popl %edx popl %ecx sti iret _pl_int08handler_end: .END