Subversion Repositories Kolibri OS

Rev

Rev 4457 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4457 Rev 4587
Line 764... Line 764...
764
; Enable timer IRQ (IRQ0) and co-processor IRQ (IRQ13)
764
; Enable timer IRQ (IRQ0) and co-processor IRQ (IRQ13)
765
; they are used: when partitions are scanned, hd_read relies on timer
765
; they are used: when partitions are scanned, hd_read relies on timer
766
        call    unmask_timer
766
        call    unmask_timer
767
        stdcall enable_irq, 2               ; @#$%! PIC
767
        stdcall enable_irq, 2               ; @#$%! PIC
768
        stdcall enable_irq, 13              ; co-processor
768
        stdcall enable_irq, 13              ; co-processor
-
 
769
;-----------------------------------------------------------------------------
-
 
770
; show SVN version of kernel on the message board
-
 
771
;-----------------------------------------------------------------------------
-
 
772
        mov     eax, [version_inf.rev]
-
 
773
        DEBUGF  1, "K : kernel SVN r%d\n", eax
-
 
774
;-----------------------------------------------------------------------------
-
 
775
; show CPU count on the message board
-
 
776
;-----------------------------------------------------------------------------
-
 
777
        mov     eax, [cpu_count]
-
 
778
        test    eax, eax
-
 
779
        jnz     @F
-
 
780
        mov     al, 1                             ; at least one CPU
769
 
781
@@:
-
 
782
        DEBUGF  1, "K : %d CPU detected\n", eax
-
 
783
;-----------------------------------------------------------------------------
-
 
784
; detect Floppy drives
-
 
785
;-----------------------------------------------------------------------------
-
 
786
        mov     esi, boot_detectfloppy
-
 
787
        call    boot_log
-
 
788
include 'detect/dev_fd.inc'
-
 
789
;-----------------------------------------------------------------------------
-
 
790
; START of initialisation IDE ATA code
-
 
791
;-----------------------------------------------------------------------------
770
        cmp     [IDEContrProgrammingInterface], 0
792
        cmp     [IDEContrProgrammingInterface], 0
771
        je      @f
793
        je      @f
Line 772... Line 794...
772
 
794
 
773
        mov     esi, boot_disabling_ide
795
        mov     esi, boot_disabling_ide
Line 784... Line 806...
784
        out     dx, al
806
        out     dx, al
785
        mov     dx, [IDE_BAR3_val] ;0x374
807
        mov     dx, [IDE_BAR3_val] ;0x374
786
        add     dx, 2 ;0x376
808
        add     dx, 2 ;0x376
787
        out     dx, al
809
        out     dx, al
788
@@:
810
@@:
-
 
811
; show base variables of IDE controller 
-
 
812
        DEBUGF  1, "K : BAR0 %x \n", [IDE_BAR0_val]:4
-
 
813
        DEBUGF  1, "K : BAR1 %x \n", [IDE_BAR1_val]:4
-
 
814
        DEBUGF  1, "K : BAR2 %x \n", [IDE_BAR2_val]:4
-
 
815
        DEBUGF  1, "K : BAR3 %x \n", [IDE_BAR3_val]:4
-
 
816
        DEBUGF  1, "K : BAR4 %x \n", [IDEContrRegsBaseAddr]:4
-
 
817
        DEBUGF  1, "K : IDEContrProgrammingInterface %x \n", [IDEContrProgrammingInterface]:4
-
 
818
        DEBUGF  1, "K : IDE_Interrupt %x \n", [IDE_Interrupt]:4
789
;-----------------------------------------------------------------------------
819
;-----------------------------------------------------------------------------
790
;!!!!!!!!!!!!!!!!!!!!!!!!!!
-
 
791
;        mov     esi, boot_detectdisks
-
 
792
;        call    boot_log
-
 
793
;include 'detect/disks.inc'
-
 
794
        mov     esi, boot_detectfloppy
-
 
795
        call    boot_log
-
 
796
include 'detect/dev_fd.inc'
-
 
797
        mov     esi, boot_detecthdcd
820
        mov     esi, boot_detecthdcd
798
        call    boot_log
821
        call    boot_log
799
include 'detect/dev_hdcd.inc'
822
include 'detect/dev_hdcd.inc'
800
        mov     esi, boot_getcache
823
        mov     esi, boot_getcache
801
        call    boot_log
824
        call    boot_log
802
include 'detect/getcache.inc'
825
include 'detect/getcache.inc'
803
        mov     esi, boot_detectpart
826
        mov     esi, boot_detectpart
804
        call    boot_log
827
        call    boot_log
805
include 'detect/sear_par.inc'
828
include 'detect/sear_par.inc'
-
 
829
;-----------------------------------------------------------------------------
-
 
830
        mov     dx, [IDEContrRegsBaseAddr]
-
 
831
; test whether it is our interrupt?
-
 
832
        add     dx, 2
-
 
833
        in      al, dx
806
;!!!!!!!!!!!!!!!!!!!!!!!!!!
834
        test    al, 100b
-
 
835
        jz      @f
-
 
836
; clear Bus Master IDE Status register
-
 
837
; clear Interrupt bit
-
 
838
        out     dx, al
-
 
839
@@:
-
 
840
        add     dx, 8
-
 
841
; test whether it is our interrupt?
-
 
842
        in      al, dx
-
 
843
        test    al, 100b
-
 
844
        jz      @f
-
 
845
; clear Bus Master IDE Status register
-
 
846
; clear Interrupt bit
-
 
847
        out     dx, al
-
 
848
@@:
-
 
849
; read status register and remove the interrupt request
-
 
850
        mov     dx, [IDE_BAR0_val] ;0x1F0
-
 
851
        add     dx, 0x7 ;0x1F7
-
 
852
        in      al, dx
-
 
853
        mov     dx, [IDE_BAR2_val] ;0x170
-
 
854
        add     dx, 0x7 ;0x177
-
 
855
        in      al, dx
-
 
856
;-----------------------------------------------------------------------------
-
 
857
        push    eax edx
-
 
858
        mov     dx, [IDEContrRegsBaseAddr]
-
 
859
        xor     eax, eax
-
 
860
        add     dx, 2
-
 
861
        in      al, dx
-
 
862
        DEBUGF  1, "K : Primary Bus Master IDE Status Register %x\n", eax
-
 
863
 
-
 
864
        add     dx, 8
-
 
865
        in      al, dx
-
 
866
        DEBUGF  1, "K : Secondary Bus Master IDE Status Register %x\n", eax
-
 
867
        pop     edx eax
Line -... Line 868...
-
 
868
 
-
 
869
        cmp     [IDEContrRegsBaseAddr], 0
-
 
870
        setnz   [dma_hdd]
-
 
871
 
-
 
872
        cmp     [IDEContrProgrammingInterface], 0
-
 
873
        je      set_interrupts_for_IDE_controllers.continue
-
 
874
;-----------------------------------------------------------------------------
-
 
875
; set interrupts for IDE Controller
-
 
876
;-----------------------------------------------------------------------------
-
 
877
        mov     esi, boot_set_int_IDE
-
 
878
        call    boot_log
-
 
879
set_interrupts_for_IDE_controllers:
-
 
880
        mov     ax, [IDEContrProgrammingInterface]
-
 
881
        cmp     ax, 0x0180
-
 
882
        je      .pata_ide
-
 
883
 
-
 
884
        cmp     ax, 0x018a
-
 
885
        jne     .sata_ide
-
 
886
;--------------------------------------
-
 
887
.pata_ide:
-
 
888
        cmp     [IDEContrRegsBaseAddr], 0
-
 
889
        je      .end_set_interrupts
-
 
890
 
-
 
891
        stdcall attach_int_handler, 14, IDE_irq_14_handler, 0
-
 
892
        DEBUGF  1, "K : Set IDE IRQ14 return code %x\n", eax
-
 
893
        stdcall attach_int_handler, 15, IDE_irq_15_handler, 0
-
 
894
        DEBUGF  1, "K : Set IDE IRQ15 return code %x\n", eax
-
 
895
        jmp     .enable_IDE_interrupt
-
 
896
;--------------------------------------
-
 
897
.sata_ide:
-
 
898
        cmp     ax, 0x0185
-
 
899
        je      .sata_ide_1
-
 
900
 
-
 
901
        cmp     ax, 0x018f
-
 
902
        jne     .end_set_interrupts
-
 
903
;--------------------------------------
-
 
904
.sata_ide_1:
-
 
905
        cmp     [IDEContrRegsBaseAddr], 0
-
 
906
        je      .end_set_interrupts
-
 
907
 
-
 
908
        mov     ax, [IDE_Interrupt]
-
 
909
        movzx   eax, al
-
 
910
        stdcall attach_int_handler, eax, IDE_common_irq_handler, 0
-
 
911
        DEBUGF  1, "K : Set IDE IRQ%d return code %x\n", [IDE_Interrupt]:1, eax
-
 
912
;--------------------------------------
-
 
913
.enable_IDE_interrupt:
-
 
914
        mov     esi, boot_enabling_ide
-
 
915
        call    boot_log
-
 
916
; Enable interrupts in IDE controller for DMA
-
 
917
        mov     al, 0
-
 
918
        mov     ah, [DRIVE_DATA+1]
-
 
919
        test    ah, 10100000b
-
 
920
        jz      @f
-
 
921
 
-
 
922
        DEBUGF  1, "K : IDE CH1 PIO, because ATAPI drive present\n"
-
 
923
        jmp     .ch2_check
-
 
924
@@:
-
 
925
        mov     dx, [IDE_BAR1_val] ;0x3F4
-
 
926
        add     dx, 2 ;0x3F6
-
 
927
        out     dx, al
-
 
928
        DEBUGF  1, "K : IDE CH1 DMA enabled\n"
-
 
929
.ch2_check:
-
 
930
        test    ah, 1010b
-
 
931
        jz      @f
-
 
932
 
-
 
933
        DEBUGF  1, "K : IDE CH2 PIO, because ATAPI drive present\n"
-
 
934
        jmp     .end_set_interrupts
-
 
935
@@:
-
 
936
        mov     dx, [IDE_BAR3_val] ;0x374
-
 
937
        add     dx, 2 ;0x376
-
 
938
        out     dx, al
-
 
939
        DEBUGF  1, "K : IDE CH2 DMA enabled\n"
-
 
940
;--------------------------------------
-
 
941
.end_set_interrupts:
-
 
942
;-----------------------------------------------------------------------------
-
 
943
        cmp     [dma_hdd], 0
-
 
944
        je      .print_pio
-
 
945
.print_dma:
-
 
946
        DEBUGF  1, "K : IDE DMA mode\n"
-
 
947
        jmp     .continue
-
 
948
 
-
 
949
.print_pio:
-
 
950
        DEBUGF  1, "K : IDE PIO mode\n"
-
 
951
.continue:
-
 
952
;-----------------------------------------------------------------------------
-
 
953
; END of initialisation IDE ATA code
807
 
954
;-----------------------------------------------------------------------------
808
        mov     esi, boot_init_sys
955
        mov     esi, boot_init_sys
809
        call    boot_log
956
        call    boot_log
Line 810... Line 957...
810
        call    Parser_params
957
        call    Parser_params
Line 815... Line 962...
815
 
962
 
816
;!!!!!!!!!!!!!!!!!!!!!!!
963
;!!!!!!!!!!!!!!!!!!!!!!!
817
include 'boot/rdload.inc'
964
include 'boot/rdload.inc'
818
;!!!!!!!!!!!!!!!!!!!!!!!
965
;!!!!!!!!!!!!!!!!!!!!!!!
819
end if
-
 
Line 820... Line 966...
820
;    mov    [dma_hdd],1
966
end if
821
 
967
 
822
if 0
968
if 0
823
        mov     ax, [OS_BASE+0x10000+bx_from_load]
969
        mov     ax, [OS_BASE+0x10000+bx_from_load]
Line 869... Line 1015...
869
;        mov     esi, boot_devices
1015
;        mov     esi, boot_devices
870
;        call    boot_log
1016
;        call    boot_log
Line 871... Line 1017...
871
 
1017
 
872
        mov     [pci_access_enabled], 1
1018
        mov     [pci_access_enabled], 1
873
        call    pci_enum
-
 
874
;-----------------------------------------------------------------------------
1019
        call    pci_enum
875
        mov     dx, [IDEContrRegsBaseAddr]
-
 
876
; test whether it is our interrupt?
-
 
877
        add     dx, 2
-
 
878
        in      al, dx
-
 
879
        test    al, 100b
-
 
880
        jz      @f
-
 
881
; clear Bus Master IDE Status register
-
 
882
; clear Interrupt bit
-
 
883
        out     dx, al
1020
        call    clear_pci_ide_interrupts
884
@@:
-
 
885
        add     dx, 8
-
 
886
; test whether it is our interrupt?
-
 
887
        in      al, dx
-
 
888
        test    al, 100b
-
 
889
        jz      @f
-
 
890
; clear Bus Master IDE Status register
-
 
891
; clear Interrupt bit
-
 
892
        out     dx, al
-
 
893
@@:
-
 
894
; read status register and remove the interrupt request
-
 
895
        mov     dx, [IDE_BAR0_val] ;0x1F0
-
 
896
        add     dx, 0x7 ;0x1F7
-
 
897
        in      al, dx
-
 
898
        mov     dx, [IDE_BAR2_val] ;0x170
-
 
899
        add     dx, 0x7 ;0x177
-
 
900
        in      al, dx
-
 
901
;-----------------------------------------------------------------------------
1021
 
Line 902... Line 1022...
902
include "detect/vortex86.inc"                     ; Vortex86 SoC detection code
1022
include "detect/vortex86.inc"                     ; Vortex86 SoC detection code
Line 903... Line 1023...
903
 
1023
 
Line 1067... Line 1187...
1067
     ;// mike.dld ]
1187
     ;// mike.dld ]
1068
        stdcall attach_int_handler, 1, irq1, 0
1188
        stdcall attach_int_handler, 1, irq1, 0
1069
        DEBUGF  1, "K : IRQ1 error code %x\n", eax
1189
        DEBUGF  1, "K : IRQ1 error code %x\n", eax
1070
.no_keyboard:
1190
.no_keyboard:
Line 1071... Line 1191...
1071
 
1191
 
Line 1072... Line 1192...
1072
; SET MOUSE
1192
; Load PS/2 mouse driver
1073
 
1193
 
Line 1074... Line 1194...
1074
        stdcall load_driver, szPS2MDriver
1194
        stdcall load_driver, szPS2MDriver
1075
;        stdcall load_driver, szCOM_MDriver
1195
;        stdcall load_driver, szCOM_MDriver
1076
 
1196
 
Line 1077... Line 1197...
1077
        mov     esi, boot_setmouse
1197
        mov     esi, boot_setmouse
1078
        call    boot_log
-
 
1079
        call    setmouse
1198
        call    boot_log
Line -... Line 1199...
-
 
1199
        call    setmouse
-
 
1200
 
-
 
1201
; Setup serial output console (if enabled)
-
 
1202
if defined debug_com_base
1080
 
1203
 
Line -... Line 1204...
-
 
1204
        ; reserve port so nobody else will use it
1081
; Setup serial output console (if enabled)
1205
        xor     ebx, ebx
1082
 
1206
        mov     ecx, debug_com_base
1083
if defined debug_com_base
1207
        mov     edx, debug_com_base+7
Line 1084... Line 1208...
1084
 
1208
        call    r_f_port_area
1085
        ; enable Divisor latch
-
 
1086
 
1209
 
1087
        mov     dx, debug_com_base+3
1210
        ; enable Divisor latch
1088
        mov     al, 1 shl 7
1211
        mov     dx, debug_com_base+3
Line 1089... Line 1212...
1089
        out     dx, al
1212
        mov     al, 1 shl 7
1090
 
1213
        out     dx, al
1091
        ; Set speed to 115200 baud (max speed)
1214
 
Line 1092... Line 1215...
1092
 
1215
        ; Set speed to 115200 baud (max speed)
1093
        mov     dx, debug_com_base
-
 
1094
        mov     al, 0x01
1216
        mov     dx, debug_com_base
1095
        out     dx, al
1217
        mov     al, 0x01
1096
 
1218
        out     dx, al
Line 1097... Line 1219...
1097
        mov     dx, debug_com_base+1
1219
 
1098
        mov     al, 0x00
-
 
1099
        out     dx, al
1220
        mov     dx, debug_com_base+1
1100
 
1221
        mov     al, 0x00
1101
        ; No parity, 8bits words, one stop bit, dlab bit back to 0
1222
        out     dx, al
Line 1102... Line 1223...
1102
 
1223
 
1103
        mov     dx, debug_com_base+3
-
 
1104
        mov     al, 3
1224
        ; No parity, 8bits words, one stop bit, dlab bit back to 0
1105
        out     dx, al
1225
        mov     dx, debug_com_base+3
1106
 
1226
        mov     al, 3
Line 1107... Line -...
1107
        ; disable interrupts
-
 
1108
 
1227
        out     dx, al
1109
        mov     dx, debug_com_base+1
-
 
1110
        mov     al, 0
-
 
1111
        out     dx, al
-
 
1112
 
-
 
1113
        ; clear +  enable fifo (64 bits)
-
 
1114
 
-
 
1115
        mov     dx, debug_com_base+2
-
 
1116
        mov     al, 0x7 + 1 shl 5
-
 
1117
        out     dx, al
-
 
1118
 
-
 
1119
 
-
 
1120
end if
-
 
1121
        mov     eax, [version_inf.rev]
-
 
1122
        DEBUGF  1, "K : kernel SVN r%d\n", eax
-
 
1123
 
-
 
1124
        mov     eax, [cpu_count]
-
 
1125
        test    eax, eax
-
 
1126
        jnz     @F
-
 
1127
        mov     al, 1                             ; at least one CPU
1228
 
Line 1128... Line 1229...
1128
@@:
1229
        ; disable interrupts
1129
        DEBUGF  1, "K : %d CPU detected\n", eax
1230
        mov     dx, debug_com_base+1
1130
 
1231
        mov     al, 0
Line 1146... Line 1247...
1146
        in      al, 0x60        ; wait for ESC key press
1247
        in      al, 0x60        ; wait for ESC key press
1147
        cmp     al, 129
1248
        cmp     al, 129
1148
        jne     .bll1
1249
        jne     .bll1
1149
end if
1250
end if
Line 1150... Line -...
1150
 
-
 
1151
        push    eax edx
-
 
1152
        mov     dx, [IDEContrRegsBaseAddr]
-
 
1153
        xor     eax, eax
-
 
1154
        add     dx, 2
-
 
1155
        in      al, dx
-
 
1156
        DEBUGF  1, "K : Primary Bus Master IDE Status Register %x\n", eax
-
 
1157
 
-
 
1158
        add     dx, 8
-
 
1159
        in      al, dx
-
 
1160
        DEBUGF  1, "K : Secondary Bus Master IDE Status Register %x\n", eax
-
 
1161
        pop     edx eax
-
 
1162
 
-
 
1163
        cmp     [IDEContrRegsBaseAddr], 0
-
 
1164
        setnz   [dma_hdd]
-
 
1165
 
-
 
1166
        cmp     [IDEContrProgrammingInterface], 0
-
 
1167
        je      set_interrupts_for_IDE_controllers.continue
-
 
1168
;-----------------------------------------------------------------------------
-
 
1169
; set interrupts for IDE Controller
-
 
1170
;-----------------------------------------------------------------------------
-
 
1171
        mov     esi, boot_set_int_IDE
-
 
1172
        call    boot_log
-
 
1173
set_interrupts_for_IDE_controllers:
-
 
1174
        mov     ax, [IDEContrProgrammingInterface]
-
 
1175
        cmp     ax, 0x0180
-
 
1176
        je      .pata_ide
-
 
1177
 
-
 
1178
        cmp     ax, 0x018a
-
 
1179
        jne     .sata_ide
-
 
1180
;--------------------------------------
-
 
1181
.pata_ide:
-
 
1182
        cmp     [IDEContrRegsBaseAddr], 0
-
 
1183
        je      .end_set_interrupts
-
 
1184
 
-
 
1185
        stdcall attach_int_handler, 14, IDE_irq_14_handler, 0
-
 
1186
        DEBUGF  1, "K : Set IDE IRQ14 return code %x\n", eax
-
 
1187
        stdcall attach_int_handler, 15, IDE_irq_15_handler, 0
-
 
1188
        DEBUGF  1, "K : Set IDE IRQ15 return code %x\n", eax
-
 
1189
        jmp     .enable_IDE_interrupt
-
 
1190
;--------------------------------------
-
 
1191
.sata_ide:
-
 
1192
        cmp     ax, 0x0185
-
 
1193
        je      .sata_ide_1
-
 
1194
 
-
 
1195
        cmp     ax, 0x018f
-
 
1196
        jne     .end_set_interrupts
-
 
1197
;--------------------------------------
-
 
1198
.sata_ide_1:
-
 
1199
        cmp     [IDEContrRegsBaseAddr], 0
-
 
1200
        je      .end_set_interrupts
-
 
1201
 
-
 
1202
        mov     ax, [IDE_Interrupt]
-
 
1203
        movzx   eax, al
-
 
1204
        stdcall attach_int_handler, eax, IDE_common_irq_handler, 0
-
 
1205
        DEBUGF  1, "K : Set IDE IRQ%d return code %x\n", [IDE_Interrupt]:1, eax
-
 
1206
;--------------------------------------
-
 
1207
.enable_IDE_interrupt:
-
 
1208
        mov     esi, boot_enabling_ide
-
 
1209
        call    boot_log
-
 
1210
; Enable interrupts in IDE controller for DMA
-
 
1211
        mov     al, 0
-
 
1212
        mov     ah, [DRIVE_DATA+1]
-
 
1213
        test    ah, 10100000b
-
 
1214
        jz      @f
-
 
1215
 
-
 
1216
        DEBUGF  1, "K : IDE CH1 PIO, because ATAPI drive present\n"
-
 
1217
        jmp     .ch2_check
-
 
1218
@@:
-
 
1219
        mov     dx, [IDE_BAR1_val] ;0x3F4
-
 
1220
        add     dx, 2 ;0x3F6
-
 
1221
        out     dx, al
-
 
1222
        DEBUGF  1, "K : IDE CH1 DMA enabled\n"
-
 
1223
.ch2_check:
-
 
1224
        test    ah, 1010b
-
 
1225
        jz      @f
-
 
1226
 
-
 
1227
        DEBUGF  1, "K : IDE CH2 PIO, because ATAPI drive present\n"
-
 
1228
        jmp     .end_set_interrupts
-
 
1229
@@:
-
 
1230
        mov     dx, [IDE_BAR3_val] ;0x374
-
 
1231
        add     dx, 2 ;0x376
-
 
1232
        out     dx, al
-
 
1233
        DEBUGF  1, "K : IDE CH2 DMA enabled\n"
-
 
1234
;--------------------------------------
-
 
1235
.end_set_interrupts:
-
 
1236
;-----------------------------------------------------------------------------
-
 
1237
        cmp     [dma_hdd], 0
-
 
1238
        je      .print_pio
-
 
1239
.print_dma:
-
 
1240
        DEBUGF  1, "K : IDE DMA mode\n"
-
 
1241
        jmp     .continue
-
 
1242
 
-
 
1243
.print_pio:
-
 
1244
        DEBUGF  1, "K : IDE PIO mode\n"
-
 
1245
.continue:
-
 
1246
 
1251
 
Line 1247... Line 1252...
1247
        mov     [timer_ticks_enable], 1         ; for cd driver
1252
        mov     [timer_ticks_enable], 1         ; for cd driver
1248
 
1253
 
Line 1944... Line 1949...
1944
        jnz     ngsyse5
1949
        jnz     ngsyse5
1945
        mov     eax, [syslang]
1950
        mov     eax, [syslang]
1946
        mov     [esp+32], eax
1951
        mov     [esp+32], eax
1947
        ret
1952
        ret
1948
ngsyse5:
1953
ngsyse5:
1949
;     cmp  eax,7
-
 
1950
        sub     ebx, 2
-
 
1951
        jnz     ngsyse7
-
 
1952
        xor     eax, eax
-
 
1953
        mov     [esp+32], eax
-
 
1954
        ret
-
 
1955
ngsyse7:
-
 
1956
;     cmp  eax,8
-
 
1957
        dec     ebx
-
 
1958
        jnz     ngsyse8
-
 
1959
        mov     eax, [fat32part]
-
 
1960
        mov     [esp+32], eax
-
 
1961
        ret
-
 
1962
ngsyse8:
-
 
1963
;     cmp  eax,9
1954
;     cmp  eax,9
1964
        dec     ebx
1955
        sub     ebx, 4
1965
        jnz     ngsyse9
1956
        jnz     ngsyse9
1966
        mov     eax, [timer_ticks];[0xfdf0]
1957
        mov     eax, [timer_ticks];[0xfdf0]
1967
        mov     [esp+32], eax
1958
        mov     [esp+32], eax
1968
        ret
1959
        ret
1969
ngsyse9:
1960
ngsyse9:
Line 2214... Line 2205...
2214
        mov     eax, [def_cursor]
2205
        mov     eax, [def_cursor]
2215
        mov     [ecx+APPDATA.cursor], eax
2206
        mov     [ecx+APPDATA.cursor], eax
Line 2216... Line 2207...
2216
 
2207
 
2217
        movzx   eax, word [MOUSE_Y]
2208
        movzx   eax, word [MOUSE_Y]
2218
        movzx   ebx, word [MOUSE_X]
-
 
2219
;        mov     ecx, [Screen_Max_X]
-
 
2220
;        inc     ecx
-
 
2221
;        mul     ecx
2209
        movzx   ebx, word [MOUSE_X]
Line 2222... Line 2210...
2222
        mov     eax, [d_width_calc_area + eax*4]
2210
        mov     eax, [d_width_calc_area + eax*4]
2223
 
2211
 
2224
        add     eax, [_WinMapAddress]
2212
        add     eax, [_WinMapAddress]