From b26afb99fb1a118d344b6a42b5d40c3d78b5b913 Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Tue, 12 Mar 2019 14:18:37 +0800 Subject: gpu_unai: Buildfix --- plugins/gpu_unai/gpu_arm.S | 56 ++++++++++++++++++++++++++++++++++++++++++ plugins/gpu_unai/gpu_arm.s | 55 ----------------------------------------- plugins/gpu_unai/gpulib_if.cpp | 8 +++--- 3 files changed, 60 insertions(+), 59 deletions(-) create mode 100644 plugins/gpu_unai/gpu_arm.S delete mode 100644 plugins/gpu_unai/gpu_arm.s (limited to 'plugins') diff --git a/plugins/gpu_unai/gpu_arm.S b/plugins/gpu_unai/gpu_arm.S new file mode 100644 index 0000000..ec87f21 --- /dev/null +++ b/plugins/gpu_unai/gpu_arm.S @@ -0,0 +1,56 @@ +/* + * (C) Gražvydas "notaz" Ignotas, 2011 + * + * This work is licensed under the terms of GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "arm_features.h" + +.text +.align 2 + +@ in: r0=dst, r2=pal, r12=0x1e +@ trashes r6-r8,lr,flags +.macro do_4_pixels rs ibase obase +.if \ibase - 1 < 0 + and r6, r12, \rs, lsl #1 +.else + and r6, r12, \rs, lsr #\ibase-1 +.endif + and r7, r12, \rs, lsr #\ibase+3 + and r8, r12, \rs, lsr #\ibase+7 + and lr, r12, \rs, lsr #\ibase+11 + ldrh r6, [r2, r6] + ldrh r7, [r2, r7] + ldrh r8, [r2, r8] + ldrh lr, [r2, lr] + tst r6, r6 + strneh r6, [r0, #\obase+0] + tst r7, r7 + strneh r7, [r0, #\obase+2] + tst r8, r8 + strneh r8, [r0, #\obase+4] + tst lr, lr + strneh lr, [r0, #\obase+6] +.endm + +.global draw_spr16_full @ (u16 *d, void *s, u16 *pal, int lines) +draw_spr16_full: + stmfd sp!, {r4-r8,lr} + mov r12, #0x1e @ empty pixel + +0: + ldmia r1, {r4,r5} + do_4_pixels r4, 0, 0 + do_4_pixels r4, 16, 8 + do_4_pixels r5, 0, 16 + do_4_pixels r5, 16, 24 + subs r3, r3, #1 + add r0, r0, #2048 + add r1, r1, #2048 + bgt 0b + + ldmfd sp!, {r4-r8,pc} + +@ vim:filetype=armasm diff --git a/plugins/gpu_unai/gpu_arm.s b/plugins/gpu_unai/gpu_arm.s deleted file mode 100644 index 8fa44a7..0000000 --- a/plugins/gpu_unai/gpu_arm.s +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (C) Gražvydas "notaz" Ignotas, 2011 - * - * This work is licensed under the terms of GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - - -.text -.align 2 - -@ in: r0=dst, r2=pal, r12=0x1e -@ trashes r6-r8,lr,flags -.macro do_4_pixels rs ibase obase -.if \ibase - 1 < 0 - and r6, r12, \rs, lsl #1 -.else - and r6, r12, \rs, lsr #\ibase-1 -.endif - and r7, r12, \rs, lsr #\ibase+3 - and r8, r12, \rs, lsr #\ibase+7 - and lr, r12, \rs, lsr #\ibase+11 - ldrh r6, [r2, r6] - ldrh r7, [r2, r7] - ldrh r8, [r2, r8] - ldrh lr, [r2, lr] - tst r6, r6 - strneh r6, [r0, #\obase+0] - tst r7, r7 - strneh r7, [r0, #\obase+2] - tst r8, r8 - strneh r8, [r0, #\obase+4] - tst lr, lr - strneh lr, [r0, #\obase+6] -.endm - -.global draw_spr16_full @ (u16 *d, void *s, u16 *pal, int lines) -draw_spr16_full: - stmfd sp!, {r4-r8,lr} - mov r12, #0x1e @ empty pixel - -0: - ldmia r1, {r4,r5} - do_4_pixels r4, 0, 0 - do_4_pixels r4, 16, 8 - do_4_pixels r5, 0, 16 - do_4_pixels r5, 16, 24 - subs r3, r3, #1 - add r0, r0, #2048 - add r1, r1, #2048 - bgt 0b - - ldmfd sp!, {r4-r8,pc} - -@ vim:filetype=armasm diff --git a/plugins/gpu_unai/gpulib_if.cpp b/plugins/gpu_unai/gpulib_if.cpp index 2dedbf8..087bb42 100644 --- a/plugins/gpu_unai/gpulib_if.cpp +++ b/plugins/gpu_unai/gpulib_if.cpp @@ -297,7 +297,7 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) case 0x48 ... 0x4F: { u32 num_vertexes = 1; - u32 *list_position = &(list[2]); + u32 *list_position = (u32*)&(list[2]); gpuDrawLF(gpuPixelDrivers [ (Blending_Mode | Masking | Blending | (PixelMSB>>3)) >> 1]); @@ -308,7 +308,7 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) gpuDrawLF(gpuPixelDrivers [ (Blending_Mode | Masking | Blending | (PixelMSB>>3)) >> 1]); num_vertexes++; - if(list_position >= list_end) { + if(list_position >= (u32*)list_end) { cmd = -1; goto breakloop; } @@ -330,7 +330,7 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) case 0x58 ... 0x5F: { u32 num_vertexes = 1; - u32 *list_position = &(list[2]); + u32 *list_position = (u32*)&(list[2]); gpuDrawLG(gpuPixelDrivers [ (Blending_Mode | Masking | Blending | (PixelMSB>>3)) >> 1]); @@ -343,7 +343,7 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) gpuDrawLG(gpuPixelDrivers [ (Blending_Mode | Masking | Blending | (PixelMSB>>3)) >> 1]); num_vertexes++; - if(list_position >= list_end) { + if(list_position >= (u32*)list_end) { cmd = -1; goto breakloop; } -- cgit v1.2.3