Diff for /np2/i286x/memory.x86 between versions 1.5 and 1.8

version 1.5, 2003/12/12 01:04:40 version 1.8, 2004/01/10 17:24:01
Line 264  grcgtdw_end:  pop  ecx Line 264  grcgtdw_end:  pop  ecx
 @egc_wt:                        VRAMTRACE  @egc_wt:                        VRAMTRACE
                                         pop             ebx                                          pop             ebx
 %if USE_EGCASM  %if USE_EGCASM
                                         jmp             _egca_write                                                     ; ver0.26                                          jmp             _egca_write
 %else  %else
                                         pushad                                          pushad
                                         call    @egc_write@8                                          call    @egc_write@8
Line 280  grcgtdw_end:  pop  ecx Line 280  grcgtdw_end:  pop  ecx
                                         shr             ebx, 12                                          shr             ebx, 12
                                         and             ebx, byte (3*4)                                          and             ebx, byte (3*4)
                                         add             ecx, [_extmem + extmem_t.pageptr + ebx]                                          add             ecx, [_extmem + extmem_t.pageptr + ebx]
                                         mov             [EXTMEMORY + ecx], dl                                   ; ver0.28                                          mov             [EXTMEMORY + ecx], dl
                                         pop             ecx                                          pop             ecx
                                         pop             ebx                                          pop             ebx
                                         ret                                          ret
   
   @i286_wb:                       mov             [MAINMEMORY + 1c8000h - 0e8000h + ecx], dl
                                           pop             ebx
                                           ret
   
 ; non writable memory  ; non writable memory
                                         align   16                                          align   16
 @i286_wn:                       pop             ebx  @i286_wn:                       pop             ebx
Line 381  grcgtcr_end:  not  al Line 385  grcgtcr_end:  not  al
                                         align   16                                          align   16
 @egc_rd:                        pop             ebx  @egc_rd:                        pop             ebx
 %if USE_EGCASM  %if USE_EGCASM
                                         jmp             _egca_read                                                      ; ver0.26                                          jmp             _egca_read
 %else  %else
                                         pushad                                          pushad
                                         call    @egc_read@4                                          call    @egc_read@4
Line 399  grcgtcr_end:  not  al Line 403  grcgtcr_end:  not  al
                                         shr             ebx, 12                                          shr             ebx, 12
                                         and             ebx, byte (3*4)                                          and             ebx, byte (3*4)
                                         add             ecx, [_extmem + extmem_t.pageptr + ebx]                                          add             ecx, [_extmem + extmem_t.pageptr + ebx]
                                         mov             al, [EXTMEMORY + ecx]                                   ; ver0.28                                          mov             al, [EXTMEMORY + ecx]
                                         pop             ecx                                          pop             ecx
                                         pop             ebx                                          pop             ebx
                                         ret                                          ret
   
 ; BIOS or ITF  ; BIOS or ITF
                                         align   16                                          align   16
 @i286_itf:                      cmp             byte [_i286core + i286core_t.itfbank], 0  @i286_rb:                       pop             ebx
                                         jne             readmem_itr                                          cmp             byte [_i286core + i286core_t.itfbank], 0
                                           jne             readmem_itf
                                         mov             al, [MAINMEMORY + ecx]                                          mov             al, [MAINMEMORY + ecx]
                                         pop             ebx  
                                         ret                                          ret
                                         align   16  readmem_itf:            mov             al, [MAINMEMORY + VRAM_STEP + ecx]
 readmem_itr:            mov             ebx, ecx  
                                         and             ebx, 00007fffh  
                                         mov             al, [MAINMEMORY + ITF_ADRS + ebx]  
                                         pop             ebx  
                                         ret                                          ret
   
 ; ----------------------------------------------------------------- write word  ; ----------------------------------------------------------------- write word
Line 617  grcgwtdw_end:  pop  ecx Line 617  grcgwtdw_end:  pop  ecx
 @egcw_wt:                       VRAMTRACE_W  @egcw_wt:                       VRAMTRACE_W
                                         pop             ebx                                          pop             ebx
 %if USE_EGCASM  %if USE_EGCASM
                                         jmp             _egca_write_w                                           ; ver0.26                                          jmp             _egca_write_w
 %else  %else
                                         test    ecx, 1                                          test    ecx, 1
                                         jne             short egcw_wtodd                                          jne             short egcw_wtodd
Line 647  egcw_wtodd: Line 647  egcw_wtodd:
                                         shr             ebx, 12                                          shr             ebx, 12
                                         and             ebx, byte (3*4)                                          and             ebx, byte (3*4)
                                         add             ecx, [_extmem + extmem_t.pageptr + ebx]                                          add             ecx, [_extmem + extmem_t.pageptr + ebx]
                                         mov             [EXTMEMORY + ecx], dx                                   ; ver0.28                                          mov             [EXTMEMORY + ecx], dx
                                         pop             ecx                                          pop             ecx
                                         pop             ebx                                          pop             ebx
                                         ret                                          ret
   
   @i286w_wb:                      mov             [MAINMEMORY + 1c8000h - 0e8000h + ecx], dx
                                           pop             ebx
                                           ret
   
 ; ------------------------------------------------------------------ read word  ; ------------------------------------------------------------------ read word
   
 ; normal memory  ; normal memory
Line 775  grcgwtcr_end:  not  ax Line 779  grcgwtcr_end:  not  ax
                                         test    ecx, 1                                          test    ecx, 1
                                         jne             short egcw_rdodd                                          jne             short egcw_rdodd
 %if USE_EGCASM  %if USE_EGCASM
                                         jmp             _egca_read_w                                            ; ver0.26                                          jmp             _egca_read_w
 %else  %else
                                         pushad                                          pushad
                                         call    @egc_read_w@4                                          call    @egc_read_w@4
Line 785  grcgwtcr_end:  not  ax Line 789  grcgwtcr_end:  not  ax
 %endif  %endif
   
 egcw_rdodd:  egcw_rdodd:
 %if USE_EGCASM                                                                                          ; ver0.26  %if USE_EGCASM
                                         inc             ecx                                          inc             ecx
                                         call    _egca_read                                          call    _egca_read
                                         mov             ah, al                                          mov             ah, al
Line 812  egcw_rdodd: Line 816  egcw_rdodd:
                                         shr             ebx, 12                                          shr             ebx, 12
                                         and             ebx, byte (3*4)                                          and             ebx, byte (3*4)
                                         add             ecx, [_extmem + extmem_t.pageptr + ebx]                                          add             ecx, [_extmem + extmem_t.pageptr + ebx]
                                         mov             ax, [EXTMEMORY + ecx]                                   ; ver0.28                                          mov             ax, [EXTMEMORY + ecx]
                                         pop             ecx                                          pop             ecx
                                         pop             ebx                                          pop             ebx
                                         ret                                          ret
   
 ; BIOS or ITF  ; BIOS or ITF
                                         align   16                                          align   16
 @i286w_itf:                     cmp             byte [_i286core + i286core_t.itfbank], 0  @i286w_rb:                      pop             ebx
                                         jne             readwmem_itr                                          cmp             byte [_i286core + i286core_t.itfbank], 0
                                           jne             readwmem_itf
                                         mov             ax, [MAINMEMORY + ecx]                                          mov             ax, [MAINMEMORY + ecx]
                                         pop             ebx  
                                         ret                                          ret
                                         align   16  readwmem_itf:           mov             ax, [MAINMEMORY + VRAM_STEP + ecx]
 readwmem_itr:           mov             ebx, ecx  
                                         and             ebx, 00007fffh  
                                         mov             ax, [MAINMEMORY + ITF_ADRS + ebx]  
                                         pop             ebx  
                                         ret                                          ret
   
   
 section .data  section .data
   
 ; ---------------------------------------------------------------------- table  ; ---------------------------------------------------------------------- table
   
         global  _memory_write  
         global  _memory_read          global  _memory_read
           global  _memory_write
   
   _memory_read    dd      @i286_rd,               @i286_rd                ; 00
                                   dd      @i286_rd,               @i286_rd                ; 10
                                   dd      @i286_rd,               @i286_rd                ; 20
                                   dd      @i286_rd,               @i286_rd                ; 30
                                   dd      @i286_rd,               @i286_rd                ; 40
                                   dd      @i286_rd,               @i286_rd                ; 50
                                   dd      @i286_rd,               @i286_rd                ; 60
                                   dd      @i286_rd,               @i286_rd                ; 70
                                   dd      @i286_rd,               @i286_rd                ; 80
                                   dd      @i286_rd,               @i286_rd                ; 90
                                   dd      @tram_rd,               @vram_r0                ; a0
                                   dd      @vram_r0,               @vram_r0                ; b0
                                   dd      @emmc_rd,               @emmc_rd                ; c0
                                   dd      @i286_rd,               @i286_rd                ; d0
                                   dd      @vram_r0,               @i286_rd                ; e0
                                   dd      @i286_rd,               @i286_rb                ; f0
   
 _memory_write   dd      @i286_wt,               @i286_wt                ; 00  _memory_write   dd      @i286_wt,               @i286_wt                ; 00
                                 dd      @i286_wt,               @i286_wt                ; 10                                  dd      @i286_wt,               @i286_wt                ; 10
Line 855  _memory_write dd @i286_wt,  @i286_wt  ;  Line 873  _memory_write dd @i286_wt,  @i286_wt  ; 
                                 dd      @vram_w0,               @i286_wn                ; e0                                  dd      @vram_w0,               @i286_wn                ; e0
                                 dd      @i286_wn,               @i286_wn                ; f0                                  dd      @i286_wn,               @i286_wn                ; f0
   
 _memory_read    dd      @i286_rd,               @i286_rd                ; 00  _memword_read   dd      @i286w_rd,              @i286w_rd               ; 00
                                 dd      @i286_rd,               @i286_rd                ; 10                                  dd      @i286w_rd,              @i286w_rd               ; 10
                                 dd      @i286_rd,               @i286_rd                ; 20                                  dd      @i286w_rd,              @i286w_rd               ; 20
                                 dd      @i286_rd,               @i286_rd                ; 30                                  dd      @i286w_rd,              @i286w_rd               ; 30
                                 dd      @i286_rd,               @i286_rd                ; 40                                  dd      @i286w_rd,              @i286w_rd               ; 40
                                 dd      @i286_rd,               @i286_rd                ; 50                                  dd      @i286w_rd,              @i286w_rd               ; 50
                                 dd      @i286_rd,               @i286_rd                ; 60                                  dd      @i286w_rd,              @i286w_rd               ; 60
                                 dd      @i286_rd,               @i286_rd                ; 70                                  dd      @i286w_rd,              @i286w_rd               ; 70
                                 dd      @i286_rd,               @i286_rd                ; 80                                  dd      @i286w_rd,              @i286w_rd               ; 80
                                 dd      @i286_rd,               @i286_rd                ; 90                                  dd      @i286w_rd,              @i286w_rd               ; 90
                                 dd      @tram_rd,               @vram_r0                ; a0                                  dd      @tramw_rd,              @vramw_r0               ; a0
                                 dd      @vram_r0,               @vram_r0                ; b0                                  dd      @vramw_r0,              @vramw_r0               ; b0
                                 dd      @emmc_rd,               @emmc_rd                ; c0                                  dd      @emmcw_rd,              @emmcw_rd               ; c0
                                 dd      @i286_rd,               @i286_rd                ; d0                                  dd      @i286w_rd,              @i286w_rd               ; d0
                                 dd      @vram_r0,               @i286_rd                ; e0                                  dd      @vramw_r0,              @i286w_rd               ; e0
                                 dd      @i286_rd,               @i286_itf               ; f0                                  dd      @i286w_rd,              @i286w_rb               ; f0
   
 _memword_write  dd      @i286w_wt,              @i286w_wt               ; 00  _memword_write  dd      @i286w_wt,              @i286w_wt               ; 00
                                 dd      @i286w_wt,              @i286w_wt               ; 10                                  dd      @i286w_wt,              @i286w_wt               ; 10
Line 889  _memword_write dd @i286w_wt,  @i286w_wt  Line 907  _memword_write dd @i286w_wt,  @i286w_wt 
                                 dd      @vramw_w0,              @i286_wn                ; e0                                  dd      @vramw_w0,              @i286_wn                ; e0
                                 dd      @i286_wn,               @i286_wn                ; f0                                  dd      @i286_wn,               @i286_wn                ; f0
   
 _memword_read   dd      @i286w_rd,              @i286w_rd               ; 00  section .rdata
                                 dd      @i286w_rd,              @i286w_rd               ; 10  
                                 dd      @i286w_rd,              @i286w_rd               ; 20  
                                 dd      @i286w_rd,              @i286w_rd               ; 30  
                                 dd      @i286w_rd,              @i286w_rd               ; 40  
                                 dd      @i286w_rd,              @i286w_rd               ; 50  
                                 dd      @i286w_rd,              @i286w_rd               ; 60  
                                 dd      @i286w_rd,              @i286w_rd               ; 70  
                                 dd      @i286w_rd,              @i286w_rd               ; 80  
                                 dd      @i286w_rd,              @i286w_rd               ; 90  
                                 dd      @tramw_rd,              @vramw_r0               ; a0  
                                 dd      @vramw_r0,              @vramw_r0               ; b0  
                                 dd      @emmcw_rd,              @emmcw_rd               ; c0  
                                 dd      @i286w_rd,              @i286w_rd               ; d0  
                                 dd      @vramw_r0,              @i286w_rd               ; e0  
                                 dd      @i286w_rd,              @i286w_itf              ; f0  
   
 _vram_write             dd      @vram_w0,               @vram_w1                ; 00  memmap                  dd      @i286_rd,               @i286_rb                ; NEC
                                 dd      @vram_w0,               @vram_w1                                  dd      @i286_wn,               @i286_wn
                                 dd      @vram_w0,               @vram_w1                ; 40                                  dd      @i286w_rd,              @i286w_rb
                                 dd      @vram_w0,               @vram_w1                                  dd      @i286_wn,               @i286_wn
                                 dd      @grcg_tdw0,             @grcg_tdw1              ; 80 tdw/tcr  
                                 dd      @egc_wt,                @egc_wt                                  dd      @i286_rb,               @i286_rb                ; EPSON
                                 dd      @grcg_rmw0,             @grcg_rmw1              ; c0 rmw                                  dd      @i286_wt,               @i286_wb
                                 dd      @egc_wt,                @egc_wt                                  dd      @i286w_rb,              @i286w_rb
                                   dd      @i286w_wt,              @i286w_wb
   
 _vram_read              dd      @vram_r0,               @vram_r1                ; 00  
   vram_read               dd      @vram_r0,               @vram_r1                ; 00
                                 dd      @vram_r0,               @vram_r1                                  dd      @vram_r0,               @vram_r1
                                 dd      @vram_r0,               @vram_r1                ; 40                                  dd      @vram_r0,               @vram_r1                ; 40
                                 dd      @vram_r0,               @vram_r1                                  dd      @vram_r0,               @vram_r1
Line 924  _vram_read  dd @vram_r0,  @vram_r1  ; 00 Line 929  _vram_read  dd @vram_r0,  @vram_r1  ; 00
                                 dd      @vram_r0,               @vram_r1                ; c0 rmw                                  dd      @vram_r0,               @vram_r1                ; c0 rmw
                                 dd      @egc_rd,                @egc_rd                                  dd      @egc_rd,                @egc_rd
   
 _vramw_write    dd      @vramw_w0,              @vramw_w1               ; 00  vram_write              dd      @vram_w0,               @vram_w1                ; 00
                                 dd      @vramw_w0,              @vramw_w1                                  dd      @vram_w0,               @vram_w1
                                 dd      @vramw_w0,              @vramw_w1               ; 40                                  dd      @vram_w0,               @vram_w1                ; 40
                                 dd      @vramw_w0,              @vramw_w1                                  dd      @vram_w0,               @vram_w1
                                 dd      @grcgw_tdw0,    @grcgw_tdw1             ; 80 tdw/tcr                                  dd      @grcg_tdw0,             @grcg_tdw1              ; 80 tdw/tcr
                                 dd      @egcw_wt,               @egcw_wt                                  dd      @egc_wt,                @egc_wt
                                 dd      @grcgw_rmw0,    @grcgw_rmw1             ; c0 rmw                                  dd      @grcg_rmw0,             @grcg_rmw1              ; c0 rmw
                                 dd      @egcw_wt,               @egcw_wt                                  dd      @egc_wt,                @egc_wt
   
 _vramw_read             dd      @vramw_r0,              @vramw_r1               ; 00  vramw_read              dd      @vramw_r0,              @vramw_r1               ; 00
                                 dd      @vramw_r0,              @vramw_r1                                  dd      @vramw_r0,              @vramw_r1
                                 dd      @vramw_r0,              @vramw_r1               ; 40                                  dd      @vramw_r0,              @vramw_r1               ; 40
                                 dd      @vramw_r0,              @vramw_r1                                  dd      @vramw_r0,              @vramw_r1
Line 942  _vramw_read  dd @vramw_r0,  @vramw_r1  ; Line 947  _vramw_read  dd @vramw_r0,  @vramw_r1  ;
                                 dd      @vramw_r0,              @vramw_r1               ; c0 rmw                                  dd      @vramw_r0,              @vramw_r1               ; c0 rmw
                                 dd      @egcw_rd,               @egcw_rd                                  dd      @egcw_rd,               @egcw_rd
   
   vramw_write             dd      @vramw_w0,              @vramw_w1               ; 00
                                   dd      @vramw_w0,              @vramw_w1
                                   dd      @vramw_w0,              @vramw_w1               ; 40
                                   dd      @vramw_w0,              @vramw_w1
                                   dd      @grcgw_tdw0,    @grcgw_tdw1             ; 80 tdw/tcr
                                   dd      @egcw_wt,               @egcw_wt
                                   dd      @grcgw_rmw0,    @grcgw_rmw1             ; c0 rmw
                                   dd      @egcw_wt,               @egcw_wt
   
   
   
 section .text  section .text
   
           global  @i286_memorymap@4
         global  @i286_vram_dispatch@4          global  @i286_vram_dispatch@4
   
         global  @i286_memorywrite@8          global  @i286_memorywrite@8
Line 1083  readmemory_b: Line 1099  readmemory_b:
                                         mov             ax, 0ffffh                                          mov             ax, 0ffffh
                                         ret                                          ret
   
   
                                           align   16
   @i286_memorymap@4:      and             ecx, 1
                                           shl             ecx, 5
                                           lea             ecx, [memmap + ecx]
                                           mov             edx, _memory_read
                                           mov             eax, [ecx]
                                           mov             [edx + 74h], eax
                                           mov             [edx + 78h], eax
                                           mov             eax, [ecx+4]
                                           mov             [edx + 7ch], eax
                                           mov             eax, [ecx+8]
                                           mov             edx, _memory_write
                                           mov             [edx + 68h], eax
                                           mov             [edx + 6ch], eax
                                           mov             eax, [ecx+12]
                                           mov             [edx + 74h], eax
                                           mov             [edx + 78h], eax
                                           mov             [edx + 7ch], eax
                                           mov             eax, [ecx+16]
                                           mov             edx, _memword_read
                                           mov             [edx + 74h], eax
                                           mov             [edx + 78h], eax
                                           mov             eax, [ecx+20]
                                           mov             [edx + 7ch], eax
                                           mov             eax, [ecx+24]
                                           mov             edx, _memword_write
                                           mov             [edx + 68h], eax
                                           mov             [edx + 6ch], eax
                                           mov             eax, [ecx+28]
                                           mov             [edx + 74h], eax
                                           mov             [edx + 78h], eax
                                           mov             [edx + 7ch], eax
                                           ret
   
                                         align   16                                          align   16
 @i286_vram_dispatch@4:  @i286_vram_dispatch@4:
                                         mov             edx, ecx                                          mov             edx, ecx
                                         and             edx, byte 15                                          and             edx, byte 15
                                         mov             eax, [_vram_write + edx*4]                                          mov             eax, [vram_read + edx*4]
                                         mov             [_memory_write + 54h], eax              ; VRAM_B  
                                         mov             [_memory_write + 58h], eax              ; VRAM_R  
                                         mov             [_memory_write + 5ch], eax              ; VRAM_G  
                                         mov             [_memory_write + 70h], eax              ; VRAM_E  
                                         mov             eax, [_vram_read + edx*4]  
                                         mov             [_memory_read + 54h], eax               ; VRAM_B                                          mov             [_memory_read + 54h], eax               ; VRAM_B
                                         mov             [_memory_read + 58h], eax               ; VRAM_R                                          mov             [_memory_read + 58h], eax               ; VRAM_R
                                         mov             [_memory_read + 5ch], eax               ; VRAM_G                                          mov             [_memory_read + 5ch], eax               ; VRAM_G
                                         mov             [_memory_read + 70h], eax               ; VRAM_E                                          mov             [_memory_read + 70h], eax               ; VRAM_E
                                         mov             eax, [_vramw_write + edx*4]                                          mov             eax, [vram_write + edx*4]
                                         mov             [_memword_write + 54h], eax             ; VRAM_B                                          mov             [_memory_write + 54h], eax              ; VRAM_B
                                         mov             [_memword_write + 58h], eax             ; VRAM_R                                          mov             [_memory_write + 58h], eax              ; VRAM_R
                                         mov             [_memword_write + 5ch], eax             ; VRAM_G                                          mov             [_memory_write + 5ch], eax              ; VRAM_G
                                         mov             [_memword_write + 70h], eax             ; VRAM_E                                          mov             [_memory_write + 70h], eax              ; VRAM_E
                                         mov             eax, [_vramw_read + edx*4]                                          mov             eax, [vramw_read + edx*4]
                                         mov             [_memword_read + 54h], eax              ; VRAM_B                                          mov             [_memword_read + 54h], eax              ; VRAM_B
                                         mov             [_memword_read + 58h], eax              ; VRAM_R                                          mov             [_memword_read + 58h], eax              ; VRAM_R
                                         mov             [_memword_read + 5ch], eax              ; VRAM_G                                          mov             [_memword_read + 5ch], eax              ; VRAM_G
                                         mov             [_memword_read + 70h], eax              ; VRAM_E                                          mov             [_memword_read + 70h], eax              ; VRAM_E
                                           mov             eax, [vramw_write + edx*4]
                                           mov             [_memword_write + 54h], eax             ; VRAM_B
                                           mov             [_memword_write + 58h], eax             ; VRAM_R
                                           mov             [_memword_write + 5ch], eax             ; VRAM_G
                                           mov             [_memword_write + 70h], eax             ; VRAM_E
                                         test    ecx, 10h                                          test    ecx, 10h
                                         jne             short degtaldispatch_e                                          jne             short degtaldispatch_e
                                         mov             eax, @i286_nonram_w@8                                          mov             eax, @i286_nonram_w@8

Removed from v.1.5  
changed lines
  Added in v.1.8


RetroPC.NET-CVS <cvs@retropc.net>