From 72f37b4dfb9de86d8f7385e87abd42954344c629 Mon Sep 17 00:00:00 2001 From: jeffman Date: Tue, 11 Apr 2017 17:39:56 -0400 Subject: [PATCH] Moved print_space to vwf.c --- compiled/vwf.c | 6 ++++++ compiled/vwf.h | 1 + m2-vwf-entries.asm | 3 ++- m2-vwf.asm | 18 ------------------ 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/compiled/vwf.c b/compiled/vwf.c index 28b991b..c2e10d7 100644 --- a/compiled/vwf.c +++ b/compiled/vwf.c @@ -177,3 +177,9 @@ void copy_tile_up(int x, int y) { copy_tile(x, y, x, y - 2); } + +void print_space(WINDOW *window) +{ + byte space = 0x50; + weld_entry(window, &space); +} diff --git a/compiled/vwf.h b/compiled/vwf.h index 1f8078a..c7187e9 100644 --- a/compiled/vwf.h +++ b/compiled/vwf.h @@ -19,6 +19,7 @@ void clear_window(WINDOW *window); void print_blankstr(int x, int y, int width); void copy_tile(int xSource, int ySource, int xDest, int yDest); void copy_tile_up(int x, int y); +void print_space(WINDOW *window); extern unsigned short const m2_coord_table[]; extern int const m2_bits_to_nybbles[]; diff --git a/m2-vwf-entries.asm b/m2-vwf-entries.asm index e3141b8..677df5d 100644 --- a/m2-vwf-entries.asm +++ b/m2-vwf-entries.asm @@ -540,9 +540,10 @@ pop {r1-r4,pc} //============================================================================== // Print a space before the Greek letter d3934_print_space: -push {lr} +push {r2-r3,lr} mov r0,r4 bl print_space +pop {r2-r3} // Clobbered code ldrb r1,[r3,1] diff --git a/m2-vwf.asm b/m2-vwf.asm index a6adf10..2bd2fab 100644 --- a/m2-vwf.asm +++ b/m2-vwf.asm @@ -61,21 +61,3 @@ pop {r4-r7} pop {r2} bx r2 .pool - - -//============================================================================== -// void print_space(WINDOW* window) -// In: -// r0: window pointer -//============================================================================== - -// - prints a space character to window -print_space: -push {r0-r3,lr} -add sp,-4 -mov r1,0x50 -str r1,[sp,0] -mov r1,sp -bl weld_entry -add sp,4 -pop {r0-r3,pc}