Skip to content

Commit

Permalink
Preliminary 8086 version of FreeGEOS. #672
Browse files Browse the repository at this point in the history
  • Loading branch information
Falk Rehwagen committed Oct 15, 2024
1 parent 0a96969 commit b589c65
Show file tree
Hide file tree
Showing 50 changed files with 388 additions and 337 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,14 @@ if not _NEWDESK
; first check if NewDesk is running. if so just quit.

push es
push ' '
push 'sk'
push 'de'
push 'is'
mov ax, ' '
push ax
mov ax, 'sk'
push ax
mov ax, 'de'
push ax
mov ax, 'is'
push ax
segmov es, ss
mov di, sp
mov ax, 8
Expand Down
4 changes: 2 additions & 2 deletions Appl/FileMgrs2/CommonDesktop/CFolder/cfolderButton.asm
Original file line number Diff line number Diff line change
Expand Up @@ -809,11 +809,11 @@ if _NEWDESK
; If we're trying to open a window by opening an object on the
; desktop, then make a new window instead of trying to reuse an
; existing one.
pusha ;ax, bx, cx, dx, si, bp
push ax, bx, cx, dx, si, bp
mov bx, ds:[0]
mov si, FOLDER_OBJECT_OFFSET
call checkIfDesktop
popa ;ax, bx, cx, dx, si, bp
pop ax, bx, cx, dx, si, bp
jc openNewWindow
if 0
;
Expand Down
3 changes: 2 additions & 1 deletion Appl/FileMgrs2/CommonDesktop/CFolder/cfolderDisplay.asm
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ haveRGB:
add al, bh
adc ah, 0 ; ax = 2R + B
clr bh
shl bx, 2 ; bx = 4G
shl bx;, 2 ; bx = 4G
shl bx
add ax, bx ; ax = 2R + B + 4G
mov bx, (255*7)/2
sub bx, ax ; C set if > (255*7)/2
Expand Down
21 changes: 14 additions & 7 deletions Appl/FileMgrs2/CommonDesktop/CMain/cmainInit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3177,11 +3177,16 @@ token local 10 dup (char)
clr ah
add al, 'a'
push ax
push 'n '
push 'co'
push 'ei'
push 'iv'
push 'dr'
mov ax, 'n '
push ax
mov ax, 'co'
push ax
mov ax, 'ei'
push ax
mov ax, 'iv'
push ax
mov ax, 'dr'
push ax

; read from .ini file

Expand Down Expand Up @@ -3656,11 +3661,13 @@ moniker local optr
mov ss:[moniker].handle, bx
pop ax, bx

mov cx, (VMS_ICON shl offset VMSF_STYLE) or mask VMSF_GSTRING
push cx
mov cx, 0 ; unused buffer size
push cx
mov si, di ; ax:bx:si = GeodeToken
mov dh, ss:[desktopDisplayType]
mov cx, ss:[moniker].handle ; allocate chunk in block
push (VMS_ICON shl offset VMSF_STYLE) or mask VMSF_GSTRING
push 0 ; unused buffer size
call TokenLoadMoniker ; ^lcx:di = icon moniker
mov ss:[moniker].offset, di
LONG jc done
Expand Down
6 changes: 4 additions & 2 deletions Appl/FileMgrs2/CommonDesktop/CUtil/cutilFileOpHigh.asm
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,17 @@ quickNotifyFlags local ClipboardQuickNotifyFlags \

.enter

pusha ; save VM block handle, block type
push ax, cx, dx, bx, bp, si, di
; save VM block handle, block type
mov cx, ds
call MemSegmentToHandle ; cx = handle
EC < ERROR_NC -1 >
push cx ; save block handle
mov ax, ACTIVE_TYPE_FILE_OPERATION
call DesktopMarkActive ; application will be active
call MemDerefStackDS ; flags preserved
popa ; retrieve VM block handle, block type
pop ax, cx, dx, bx, bp, si, di
; retrieve VM block handle, block type

LONG jnz realExit ; detaching already, do nothing

Expand Down
27 changes: 19 additions & 8 deletions Appl/GeoDraw/UI/uiGifImage.asm
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,12 @@ GIFSetBitmapType proc near

; set bitmap type based on number of colors in bitmap

mov cl, ss:[gifFileHeader].GIFFH_globalFlags
andnf cl, mask GIFGF_COLORRESOLUTION
shr cl, offset GIFGF_COLORRESOLUTION
inc cl
mov al, ss:[gifFileHeader].GIFFH_globalFlags
andnf al, mask GIFGF_COLORRESOLUTION
mov cl, offset GIFGF_COLORRESOLUTION
shr al, cl
inc al
mov cl, al
mov ax, 1
shl ax, cl ; ax = number of color entries
cmp ax, ss:[numColors]
Expand Down Expand Up @@ -754,7 +756,9 @@ GetNextLZWCode proc near

segmov es, ss
mov di, ss:[lzwDecodeVars].LZWDV_block_size
shr di, 3
shr di
shr di
shr di
mov ax, {word} ss:[lzwDecodeVars].LZWDV_byte_buff[di-2]
lea di, ss:[lzwDecodeVars].LZWDV_byte_buff[0]
stosw
Expand All @@ -771,7 +775,9 @@ GetNextLZWCode proc near
call GIFReadGIFFileData
jc done

shl ax, 3
shl ax
shl ax
shl ax
add ss:[lzwDecodeVars].LZWDV_nbits_left, ax
add ss:[lzwDecodeVars].LZWDV_block_size, ax
mov ax, ss:[lzwDecodeVars].LZWDV_nbits_left
Expand All @@ -780,7 +786,9 @@ getCode:
mov di, ss:[lzwDecodeVars].LZWDV_block_size
sub di, ax ; di <- LZW code bit position
mov cx, di ; cx <- LZW code bit position
shr di, 3 ; di <- LZW code byte position
shr di ; di <- LZW code byte position
shr di
shr di
and cx, 0x07 ; cx <- LZW code bit offset
mov ax, {word} ss:[lzwDecodeVars].LZWDV_byte_buff[di]
mov di, {word} ss:[lzwDecodeVars].LZWDV_byte_buff[di+2]
Expand Down Expand Up @@ -870,7 +878,10 @@ write8bit::
write4bit:
lodsb
mov ah, al
shl ah, 4
shl ah
shl ah
shl ah
shl ah
lodsb
and al, 0x0f
ornf al, ah
Expand Down
27 changes: 19 additions & 8 deletions Appl/GeoWrite/UI/uiGifImage.asm
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,12 @@ GIFSetBitmapType proc near

; set bitmap type based on number of colors in bitmap

mov cl, ss:[gifFileHeader].GIFFH_globalFlags
andnf cl, mask GIFGF_COLORRESOLUTION
shr cl, offset GIFGF_COLORRESOLUTION
inc cl
mov al, ss:[gifFileHeader].GIFFH_globalFlags
andnf al, mask GIFGF_COLORRESOLUTION
mov cl, offset GIFGF_COLORRESOLUTION
shr al, cl
inc al
mov cl, al
mov ax, 1
shl ax, cl ; ax = number of color entries
cmp ax, ss:[numColors]
Expand Down Expand Up @@ -754,7 +756,9 @@ GetNextLZWCode proc near

segmov es, ss
mov di, ss:[lzwDecodeVars].LZWDV_block_size
shr di, 3
shr di
shr di
shr di
mov ax, {word} ss:[lzwDecodeVars].LZWDV_byte_buff[di-2]
lea di, ss:[lzwDecodeVars].LZWDV_byte_buff[0]
stosw
Expand All @@ -771,7 +775,9 @@ GetNextLZWCode proc near
call GIFReadGIFFileData
jc done

shl ax, 3
shl ax
shl ax
shl ax
add ss:[lzwDecodeVars].LZWDV_nbits_left, ax
add ss:[lzwDecodeVars].LZWDV_block_size, ax
mov ax, ss:[lzwDecodeVars].LZWDV_nbits_left
Expand All @@ -780,7 +786,9 @@ getCode:
mov di, ss:[lzwDecodeVars].LZWDV_block_size
sub di, ax ; di <- LZW code bit position
mov cx, di ; cx <- LZW code bit position
shr di, 3 ; di <- LZW code byte position
shr di ; di <- LZW code byte position
shr di
shr di
and cx, 0x07 ; cx <- LZW code bit offset
mov ax, {word} ss:[lzwDecodeVars].LZWDV_byte_buff[di]
mov di, {word} ss:[lzwDecodeVars].LZWDV_byte_buff[di+2]
Expand Down Expand Up @@ -870,7 +878,10 @@ write8bit::
write4bit:
lodsb
mov ah, al
shl ah, 4
shl ah
shl ah
shl ah
shl ah
lodsb
and al, 0x0f
ornf al, ah
Expand Down
14 changes: 8 additions & 6 deletions Appl/Preferences/PrefMgr/prefmgrInitExit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ PrefMgrOpenApplication method dynamic PrefMgrClass,
;
test cx, mask AAF_DATA_FILE_PASSED
jz callSuper
pusha
;pusha
push ax, cx, dx, bx, bp, si, di
mov bx, handle PrefMgrPrimary
mov si, offset PrefMgrPrimary
mov ax, MSG_GEN_SET_NOT_USABLE
mov dl, VUM_DELAYED_VIA_APP_QUEUE
call ObjMessageNone
popa

;popa
pop ax, cx, dx, bx, bp, si, di
callSuper:
;
; Call our superclass to bring things on screen
Expand Down Expand Up @@ -193,8 +194,8 @@ REVISION HISTORY:
SwitchToModuleByName proc near
uses ds
.enter
pusha

;pusha
push ax, cx, dx, bx, bp, si, di
;
; Get the module name and convert it to a module #
;
Expand All @@ -213,7 +214,8 @@ SwitchToModuleByName proc near
clc

done:
popa
pop ax, cx, dx, bx, bp, si, di
;popa
.leave
ret
SwitchToModuleByName endp
Expand Down
3 changes: 2 additions & 1 deletion Driver/IFS/DOS/Common/dosLink.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,8 @@ if _MSLF
; No need to prepend a leading backslash as one will be returned
; by DOS7.
;
push '.' or (0 shl 8) ; ss:sp = "."
mov cx,'.' or (0 shl 8) ; ss:sp = "."
push cx
movdw dssi, sssp ; ds:si = "."
segmov es, ss
mov cx, (0x80 shl 8) or MGCPNF_LONG_PATH_NAME
Expand Down
6 changes: 4 additions & 2 deletions Driver/IFS/DOS/Common/dosPath.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1954,15 +1954,17 @@ if _MSLF
; to 8.3 format. Then we can just use the passed name as the native
; name.
;
pusha
;pusha
push ax, cx, dx, bx, bp, si, di
push es
mov si, dx ; ds:si = W32FD_fileName
segmov es, ds
mov di, offset dosNativeFFD.FFD_name ; es:di = FFD_name
clr cx ; null-terminated
SBCompareStrings
pop es
popa
pop ax, cx, dx, bx, bp, si, di
;popa
je haveDosName ; => conforms to 8.3
generateDosName:
else
Expand Down
6 changes: 4 additions & 2 deletions Driver/IFS/DOS/Common/dosVirtual.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4400,15 +4400,17 @@ ChooseDosLongOrShortName proc near
lds si, ds:[FGEAD_fd]
add si, offset W32FD_fileName

pusha
;pusha
push ax, cx, dx, bx, bp, si, di
push es
movdw esdi, dssi
clr al
mov cx, -1
repne scasb ; cx = -(length w/ null + 1)
cmp cx, -((FILE_LONGNAME_LENGTH + 1) + 1)
pop es
popa
pop ax, cx, dx, bx, bp, si, di
;popa
jae hasName ; => long name short enough, use it.

add si, W32FD_alternateFileName - W32FD_fileName
Expand Down
24 changes: 16 additions & 8 deletions Driver/Mouse/PS2/ps2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ REVISION HISTORY:
OnOffNotifyRegUnreg proc far
uses ds
.enter
pusha
;pusha
push ax, cx, dx, bx, bp, si, di

mov ax, GDDT_POWER_MANAGEMENT
call GeodeGetDefaultDriver ; ax = driver handle
Expand All @@ -568,7 +569,8 @@ OnOffNotifyRegUnreg proc far
call ds:[si].DIS_strategy ; CF set on error

afterRegister:
popa
pop ax, cx, dx, bx, bp, si, di
;popa
.leave
ret
OnOffNotifyRegUnreg endp
Expand Down Expand Up @@ -618,7 +620,8 @@ REVISION HISTORY:
MouseCheckDevAfterResume proc far
uses es
.enter
pusha
;pusha
push ax, cx, dx, bx, bp, si, di

CheckHack <PNC_POWER_TURNING_ON eq 1>
CheckHack <PNC_POWER_TURNED_OFF_AND_ON eq 2>
Expand Down Expand Up @@ -650,7 +653,8 @@ MouseCheckDevAfterResume proc far
; on the next resume or on shutdown.

done:
popa
pop ax, cx, dx, bx, bp, si, di
;popa
.leave
ret
MouseCheckDevAfterResume endp
Expand Down Expand Up @@ -685,8 +689,10 @@ MouseCheckDevAfterResumeStep2 proc far
mov ax, SGIT_UI_PROCESS
call SysGetInfo ;ax = ui handle
mov_tr bx, ax
push vseg MouseCheckDevAfterResumeStep3
push offset MouseCheckDevAfterResumeStep3
mov ax, vseg MouseCheckDevAfterResumeStep3
push ax
mov ax, offset MouseCheckDevAfterResumeStep3
push ax
mov bp, sp ; ss:bp = PCRP_address
mov ax, MSG_PROCESS_CALL_ROUTINE
mov di, mask MF_STACK or mask MF_FORCE_QUEUE
Expand Down Expand Up @@ -870,7 +876,8 @@ REVISION HISTORY:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DisplayMouseNotConnectedDialog proc far
pusha
;pusha
push ax, cx, dx, bx, bp, si, di

sub sp, size StandardDialogOptrParams
mov bp, sp
Expand All @@ -886,7 +893,8 @@ DisplayMouseNotConnectedDialog proc far
ss:[bp].SDOP_helpContext.segment
call UserStandardDialogOptr

popa
pop ax, cx, dx, bx, bp, si, di
;popa
ret
DisplayMouseNotConnectedDialog endp

Expand Down
3 changes: 2 additions & 1 deletion Driver/Printer/PrintCom/Graphics/graphicsCommon.asm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ haveBlock:
je haveBWidth

;assume 4 planes passed (even in 3CMY)
shl ax,2 ;now of all 4 colors.
shl ax ;now of all 4 colors.
shl ax
EC< cmp cl,BMF_4CMYK >
EC< je haveBWidth >
EC< cmp cl,BMF_3CMY >
Expand Down
Loading

0 comments on commit b589c65

Please sign in to comment.