--- np2/i286x/memory.x86 2004/01/25 05:41:29 1.9 +++ np2/i286x/memory.x86 2005/02/08 09:18:59 1.13 @@ -82,15 +82,15 @@ section .text %if USE_EGCASM - extern _egca_read - extern _egca_read_w - extern _egca_write - extern _egca_write_w + extern egc_read + extern egc_read_w + 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 @@ -120,6 +120,8 @@ wtram_a: cmp ecx, 000a3fe0h jc short wtram_m cmp ecx, 000a4000h jnc wcgwindow_s + test ecx, 2 + je short wtram_m cmp byte [_gdcs + gdcs_t.msw_accessable], 0 je short wtram_e wtram_m: shr ebx, 1 @@ -260,12 +262,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 _egca_write + jmp egc_write %else pushad - call @egc_write@8 + call @memegc_wr8@8 popad ret %endif @@ -381,12 +385,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 _egca_read + jmp egc_read %else pushad - call @egc_read@4 + call @memegc_rd8@4 mov [esp + 28], al popad ret @@ -452,6 +458,8 @@ wtramw_a: je short wword_a1fffh jc short wtramw_m cmp ecx, 000a3fffh jnc wcgwindoww_s + test ecx, 2 + je short wtramw_m cmp byte [_gdcs + gdcs_t.msw_accessable], 0 je short wtramw_e wtramw_m: and ebx, 1fffh @@ -613,26 +621,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 _egca_write_w + 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 @@ -773,38 +769,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 _egca_read_w + 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 _egca_read - mov ah, al - dec ecx - jmp _egca_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