--- np2/i286x/memory.x86 2004/01/31 08:34:41 1.11 +++ np2/i286x/memory.x86 2005/03/18 06:49:17 1.14 @@ -3,16 +3,14 @@ ; ToDo: egc word-boundary %include 'x86/np2asm.inc' +%include '../io/x86/iocore.inc' section .bss global _mem extern _i286core - extern _grcg - extern _gdcs extern _tramupdate extern _vramupdate - extern _cgwindow extern _vramop _mem resb 0x200000 @@ -87,10 +85,10 @@ section .text extern egc_write extern egc_write_w %else - extern @egc_read@4 - extern @egc_read_w@4 - extern @egc_write@8 - extern @egc_write_w@8 + extern @memegc_rd8@4 + extern @memegc_rd16@4 + extern @memegc_wr8@8 + extern @memegc_wr16@8 %endif ; normal memory @@ -262,12 +260,14 @@ grcgtdw_end: pop ecx ; EGC bridge align 16 @egc_wt: VRAMTRACE + mov ebx, [_vramop + vramop_t.grcgwait] + sub [_i286core + i286core_t.remainclock], ebx pop ebx %if USE_EGCASM jmp egc_write %else pushad - call @egc_write@8 + call @memegc_wr8@8 popad ret %endif @@ -383,12 +383,14 @@ grcgtcr_end: not al ; EGC bridge align 16 -@egc_rd: pop ebx +@egc_rd: mov ebx, [_vramop + vramop_t.grcgwait] + sub [_i286core + i286core_t.remainclock], ebx + pop ebx %if USE_EGCASM jmp egc_read %else pushad - call @egc_read@4 + call @memegc_rd8@4 mov [esp + 28], al popad ret @@ -617,26 +619,14 @@ grcgwtdw_end: pop ecx ; EGC bridge align 16 @egcw_wt: VRAMTRACE_W + mov ebx, [_vramop + vramop_t.grcgwait] + sub [_i286core + i286core_t.remainclock], ebx pop ebx %if USE_EGCASM jmp egc_write_w %else - test ecx, 1 - jne short egcw_wtodd - pushad - call @egc_write_w@8 - popad - ret -egcw_wtodd: pushad - push ecx - push edx - call @egc_write@8 - pop edx - pop ecx - inc ecx - shr edx, 8 - call @egc_write@8 + call @memegc_wr16@8 popad ret %endif @@ -777,38 +767,19 @@ grcgwtcr_end: not ax ; EGC bridge align 16 -@egcw_rd: pop ebx - test ecx, 1 - jne short egcw_rdodd +@egcw_rd: mov ebx, [_vramop + vramop_t.grcgwait] + sub [_i286core + i286core_t.remainclock], ebx + pop ebx %if USE_EGCASM jmp egc_read_w %else pushad - call @egc_read_w@4 + call @memegc_rd16@4 mov [esp + 28], ax popad ret %endif -egcw_rdodd: -%if USE_EGCASM - inc ecx - call egc_read - mov ah, al - dec ecx - jmp egc_read -%else - pushad - push ecx - call @egc_read@4 - pop ecx - mov [esp+28], al - inc ecx - call @egc_read@4 - mov [esp+29], al - popad -%endif - ret ; EMM read align 16