From a855d6202536ff28e5aae4f22a0f31d8f5b325d0 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 21 Jan 2017 15:18:31 -0500 Subject: Port of Duke Nukem 3D This ports Fabien Sanglard's Chocolate Duke to run on a version of SDL for Rockbox. Change-Id: I8f2c4c78af19de10c1633ed7bb7a997b43256dd9 --- apps/plugins/sdl/src/hermes/x86_main.asm | 75 ++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 apps/plugins/sdl/src/hermes/x86_main.asm (limited to 'apps/plugins/sdl/src/hermes/x86_main.asm') diff --git a/apps/plugins/sdl/src/hermes/x86_main.asm b/apps/plugins/sdl/src/hermes/x86_main.asm new file mode 100644 index 0000000000..f7dd3db70c --- /dev/null +++ b/apps/plugins/sdl/src/hermes/x86_main.asm @@ -0,0 +1,75 @@ +; +; x86 format converters for HERMES +; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at) +; This source code is licensed under the GNU LGPL +; +; Please refer to the file COPYING.LIB contained in the distribution for +; licensing conditions +; +; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission +; + +BITS 32 + +%include "common.inc" + +SDL_FUNC _ConvertX86 + +SECTION .text + +;; _ConvertX86: +;; [ESP+8] ConverterInfo* +;; -------------------------------------------------------------------------- +;; ConverterInfo (ebp+..) +;; 0: void *s_pixels +;; 4: int s_width +;; 8: int s_height +;; 12: int s_add +;; 16: void *d_pixels +;; 20: int d_width +;; 24: int d_height +;; 28: int d_add +;; 32: void (*converter_function)() +;; 36: int32 *lookup + +_ConvertX86: + push ebp + mov ebp,esp + +; Save the registers used by the blitters, necessary for optimized code + pusha + + mov eax,[ebp+8] + + cmp dword [eax+4],BYTE 0 + je endconvert + + mov ebp,eax + + mov esi,[ebp+0] + mov edi,[ebp+16] + +y_loop: + mov ecx,[ebp+4] + + call [ebp+32] + + add esi,[ebp+12] + add edi,[ebp+28] + + dec dword [ebp+8] + jnz y_loop + +; Restore the registers used by the blitters, necessary for optimized code + popa + + pop ebp + +endconvert: + ret + + + +%ifidn __OUTPUT_FORMAT__,elf32 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif -- cgit v1.2.3