home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d03xx
/
d0396.lha
/
NewLook
/
NewLook.asm
< prev
next >
Wrap
Assembly Source File
|
1990-10-29
|
17KB
|
496 lines
; NewSysLook V1.0
; by Preben Nielsen.
; This is Public Domain.
; This program will change the images for:
; a: The screen/window UpFront and DownBack gadgets
; b: The window close and sizing gadgets
; When run, this program just replaces the old gadgets/images with
; the new, and doesn't use any extra memory. Running the program will
; give you back the old gadgets/images.
; The program works with KickStart1.2 and 1.3, but may not work with
; future versions without modifications, because it changes fields
; in the private part of intuitionbase.
; OPT O+
; OPT O1+ ;Tells when a branch could be optimised to short
; OPT i+ ;Tells when '#' is probably missing
incdir "INCLUDE:"
include "exec/exec_lib.i"
include "graphics/graphics_lib.i"
include "intuition/intuition.i"
include "intuition/intuitionbase.i"
include "intuition/intuition_lib.i"
include "libraries/dos.i"
include "libraries/dos_lib.i"
include "libraries/dosextens.i"
LoadBase MACRO
IFNC '\1','ExecBase'
movea.l \1(PC),A6
ENDC
IFC '\1','ExecBase'
movea.l 4.W,A6
ENDC
ENDM
CallLib MACRO
jsr _LVO\1(A6)
ENDM
Call MACRO
bsr \1
ENDM
Push MACRO
movem.l \1,-(SP)
ENDM
Pop MACRO
movem.l (SP)+,\1
ENDM
GADGET MACRO
dc.l \1
dc.w \2,\3,\4,\5,\6,\7,\8
ENDM
GADGET2 MACRO
dc.l \1,\2,\3,\4,\5
dc.w \6
dc.l \7
ENDM
IMAGE MACRO
dc.w \1,\2,\3,\4,\5
dc.l \6
dc.b \7,\8
dc.l \9
ENDM
Init LoadBase ExecBase
suba.l A1,A1
CallLib FindTask ;Find us
movea.l D0,A2
tst.l pr_CLI(A2)
bne.S CLIAndWBStartup
WBenchStartup lea pr_MsgPort(A2),A0
CallLib WaitPort ;Wait for a message
lea pr_MsgPort(A2),A0
CallLib GetMsg ;then get it
move.l D0,WBenchMsg ;Save it for later reply
CLIAndWBStartup lea IntName(PC),A1
CallLib OldOpenLibrary
move.l D0,IntBase
bne.S Main
Exit LoadBase ExecBase
move.l IntBase(PC),D0
beq.S ReplyWB
movea.l D0,A1
CallLib CloseLibrary
ReplyWB move.l WBenchMsg(PC),D0
beq.S AllDone
CallLib Forbid
movea.l D0,A1
CallLib ReplyMsg ;Reply WBenchMessage if we are started from WB
AllDone moveq #0,D0
rts
Main LoadBase ExecBase
CallLib Forbid
move.w #SYSGADGET+SIZING,D0
Call FindGadget
move.l D0,A0
move.l gg_GadgetRender(A0),A0
move.l ig_ImageData(A0),A0
lea SizingData(PC),A1
moveq #2*9-1,D0
CmpLoop cmp.b (A0)+,(A1)+ ;Has the new image already been installed
bne.S InstallNew
dbf D0,CmpLoop
InstallOld lea OWUpFrontGad(PC),A0 ;Gadget
Call InstallGadget
lea OWDownBackGad(PC),A0
Call InstallGadget
lea OSizingGad(PC),A0
Call InstallGadget
lea OCloseGad(PC),A0
Call InstallGadget
lea OWDragGad(PC),A0
Call InstallGadget
lea OSUpFrontGad(PC),A0
Call InstallGadget
lea OSDownBackGad(PC),A0
Call InstallGadget
lea OSDragGad(PC),A0
Call InstallGadget
bra.S RefreshWindows
InstallNew lea WUpFrontGad(PC),A0 ;Gadget
Call InstallGadget
lea WDownBackGad(PC),A0
Call InstallGadget
lea SizingGad(PC),A0
Call InstallGadget
lea CloseGad(PC),A0
Call InstallGadget
lea WDragGad(PC),A0
Call InstallGadget
lea SUpFrontGad(PC),A0
Call InstallGadget
lea SDownBackGad(PC),A0
Call InstallGadget
lea SDragGad(PC),A0
Call InstallGadget
RefreshWindows LoadBase IntBase
move.l ib_FirstScreen(A6),A4
RSLoop move.l A4,D0
beq.S EndRS
move.l sc_FirstWindow(A4),A5
RWLoop move.l A5,D0
beq.S EndRW
move.l D0,A0
CallLib RefreshWindowFrame
move.l wd_NextWindow(A5),A5
bra.S RWLoop
EndRW move.l sc_NextScreen(A4),A4
bra.S RSLoop
EndRS LoadBase ExecBase
CallLib Forbid
bra Exit
;D0 = Type of Gadget to find
FindGadget Push D1-D7/A0-A6
movea.l IntBase(PC),A0
lea $2C6(A0),A0
SearchLoop movea.l (A0)+,A1
cmp.w gg_GadgetType(A1),D0 ;GadgetType
bne.S SearchLoop
move.l A1,D0
Pop D1-D7/A0-A6
rts
;A0 = Gadget
InstallGadget Push D0-D7/A0-A6
move.l A0,A5
move.w gg_GadgetType(A0),D0
Call FindGadget
move.l D0,A4
move.l A5,A0
move.l A4,A1
move.l A4,A2
movea.l gg_GadgetRender(A5),A5
movea.l gg_GadgetRender(A4),A4 ;Image
moveq #gg_SIZEOF-1,D0
GadCopy move.b (A0)+,(A1)+
dbf D0,GadCopy
move.l A4,gg_GadgetRender(A2)
move.l A5,D0
beq.S DoneInstall
move.l A5,A0
move.l A4,A1
move.l A4,A2
move.w ig_Width(A5),D5
ext.l D5
divu #16,D5
move.l D5,D0
swap D0
tst.w D0
beq.S Mod16
addq.w #1,D5
Mod16 mulu ig_Height(A5),D5
mulu ig_Depth(A5),D5
mulu #2,D5
movea.l ig_ImageData(A5),A5
movea.l ig_ImageData(A4),A4
moveq #ig_SIZEOF-1,D0
ImageCopy move.b (A0)+,(A1)+
dbf D0,ImageCopy
move.l A4,ig_ImageData(A2)
move.l A5,A0
move.l A4,A1
subq.w #1,D5
CopyData move.b (A0)+,(A1)+
dbf D5,CopyData
DoneInstall Pop D0-D7/A0-A6
rts
WBenchMsg dc.l 0
IntBase dc.l 0
IntName dc.b 'intuition.library',0
EVEN
WUpFrontGad GADGET 0,-28,0,26,10,GRELRIGHT+GADGIMAGE,RELVERIFY,SYSGADGET+WUPFRONT
GADGET2 WUpFrontImage,0,0,0,0,0,0
WUpFrontImage IMAGE 0,0,29,10,2,WUpFrontData,%00000011,%00000000,0
WUpFrontData dc.l %00001111111111111111110000011111
dc.l %00011011111111111111111000011111
dc.l %00011000111111111111111000011111
dc.l %00011000001111111111111000011111
dc.l %00011000000011111111111000011111
dc.l %00011000000000111111111000011111
dc.l %00011000000000001111111000011111
dc.l %00011000000000000011111000011111
dc.l %00011000000000000000111000011111
dc.l %00001111111111111111110000011111
dc.l %00000000000000000000000000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000000000000000000000000000000
WDownBackGad GADGET 0,-52,0,24,10,GRELRIGHT+GADGIMAGE,RELVERIFY,SYSGADGET+WDOWNBACK
GADGET2 WDownBackImage,0,0,0,0,0,0
WDownBackImage IMAGE 0,0,24,10,2,WDownBackData,%00000011,%00000000,0
WDownBackData dc.l %00001111111111111111110000000000
dc.l %00011100000000000000011000000000
dc.l %00011111000000000000011000000000
dc.l %00011111110000000000011000000000
dc.l %00011111111100000000011000000000
dc.l %00011111111111000000011000000000
dc.l %00011111111111110000011000000000
dc.l %00011111111111111100011000000000
dc.l %00011111111111111111011000000000
dc.l %00001111111111111111110000000000
dc.l %00000000000000000000000000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000000000000000000000000000000
SizingGad GADGET 0,-15,-8,16,9,GRELRIGHT+GRELBOTTOM+GADGIMAGE,0,SYSGADGET+SIZING
GADGET2 SizingImage,0,0,0,0,0,0
SizingImage IMAGE 0,0,16,9,1,SizingData,%00000001,%00000000,0
SizingData dc.w %0000011111111111
dc.w %0001110011001111
dc.w %0111001100110011
dc.w %1100110011001111
dc.w %1111001100110011
dc.w %1100110011001111
dc.w %1111001100110011
dc.w %1100110011001111
dc.w %1111111111111111
CloseGad GADGET 0,4,0,24,10,GADGIMAGE,RELVERIFY,SYSGADGET+CLOSE
GADGET2 CloseImage,0,0,0,0,0,0
CloseImage IMAGE -4,0,28,10,2,CloseData,%00000011,%00000000,0
CloseData dc.l %11000011111111111111111100000000
dc.l %11000110000000000000001110000000
dc.l %11000110000000000000111110000000
dc.l %11000110000000000011111110000000
dc.l %11000110000000001111111110000000
dc.l %11000110000000111111111110000000
dc.l %11000110000011111111111110000000
dc.l %11000110001111111111111110000000
dc.l %11000110111111111111111110000000
dc.l %11000011111111111111111100000000
dc.l %00000000000000000000000000000000
dc.l %00000001111111111111111000000000
dc.l %00000001111111111111111000000000
dc.l %00000001111111111111111000000000
dc.l %00000001111111111111111000000000
dc.l %00000001111111111111111000000000
dc.l %00000001111111111111111000000000
dc.l %00000001111111111111111000000000
dc.l %00000001111111111111111000000000
dc.l %00000000000000000000000000000000
SUpFrontGad GADGET 0,-28,0,26,10,GRELRIGHT+GADGIMAGE,RELVERIFY,SYSGADGET+SCRGADGET+SUPFRONT
GADGET2 SUpFrontImage,0,0,0,0,0,0
SUpFrontImage IMAGE 0,0,29,10,2,SUpFrontData,%00000011,%00000000,0
SUpFrontData dc.l %00001111111111111111110000011111
dc.l %00011000000000000000111000011111
dc.l %00011000000000000011111000011111
dc.l %00011000000000001111111000011111
dc.l %00011000000000111111111000011111
dc.l %00011000000011111111111000011111
dc.l %00011000001111111111111000011111
dc.l %00011000111111111111111000011111
dc.l %00011011111111111111111000011111
dc.l %00001111111111111111110000011111
dc.l %00000000000000000000000000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000000000000000000000000000000
SDownBackGad GADGET 0,-52,0,24,10,GRELRIGHT+GADGIMAGE,RELVERIFY,SYSGADGET+SCRGADGET+SDOWNBACK
GADGET2 SDownBackImage,0,0,0,0,0,0
SDownBackImage IMAGE 0,0,24,10,2,SDownBackData,%00000011,%00000000,0
SDownBackData dc.l %00001111111111111111110000000000
dc.l %00011111111111111111011000000000
dc.l %00011111111111111100011000000000
dc.l %00011111111111110000011000000000
dc.l %00011111111111000000011000000000
dc.l %00011111111100000000011000000000
dc.l %00011111110000000000011000000000
dc.l %00011111000000000000011000000000
dc.l %00011100000000000000011000000000
dc.l %00001111111111111111110000000000
dc.l %00000000000000000000000000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000111111111111111100000000000
dc.l %00000000000000000000000000000000
WDragGad GADGET 0,0,0,0,10,GADGHNONE+GRELWIDTH,0,SYSGADGET+WDRAGGING
GADGET2 0,0,0,0,0,0,0
SDragGad GADGET 0,0,0,0,10,GADGHNONE+GRELWIDTH,0,SYSGADGET+SCRGADGET+SDRAGGING
GADGET2 0,0,0,0,0,0,0
OWUpFrontGad GADGET 0,-28,0,26,10,GRELRIGHT+GADGIMAGE,RELVERIFY,SYSGADGET+WUPFRONT
GADGET2 OWUpFrontImage,0,0,0,0,0,0
OWUpFrontImage IMAGE 0,0,29,10,2,OWUpFrontData,%00000011,%00000000,0
OWUpFrontData dc.l %00111111111111111111111100111100
dc.l %00110000000000000011111100111100
dc.l %00110000000000000000001100111100
dc.l %00110000001111111111001100111100
dc.l %00110000001111111111001100111100
dc.l %00110000001111111111001100111100
dc.l %00110000001111111111001100111100
dc.l %00111111001111111111001100111100
dc.l %00111111000000000000001100111100
dc.l %00111111111111111111111100111100
dc.l %00000000000000000000000000000000
dc.l %00001111111111111100000000000000
dc.l %00001111000000000000000000000000
dc.l %00001111000000000000000000000000
dc.l %00001111000000000000000000000000
dc.l %00001111000000000000000000000000
dc.l %00001111000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
OWDownBackGad GADGET 0,-52,0,24,10,GRELRIGHT+GADGIMAGE,RELVERIFY,SYSGADGET+WDOWNBACK
GADGET2 OWDownBackImage,0,0,0,0,0,0
OWDownBackImage IMAGE 0,0,24,10,2,OWDownBackData,%00000011,%00000000,0
OWDownBackData dc.l %00111111111111111111111100000000
dc.l %00110000000000000011111100000000
dc.l %00110011111111110011111100000000
dc.l %00110011000000000000001100000000
dc.l %00110011000000000000001100000000
dc.l %00110011000000000000001100000000
dc.l %00110000000000000000001100000000
dc.l %00111111000000000000001100000000
dc.l %00111111000000000000001100000000
dc.l %00111111111111111111111100000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000000000000000000000000000
OSizingGad GADGET 0,-15,-8,16,9,GRELRIGHT+GRELBOTTOM+GADGIMAGE,0,SYSGADGET+SIZING
GADGET2 OSizingImage,0,0,0,0,0,0
OSizingImage IMAGE 0,0,16,9,1,OSizingData,%00000001,%00000000,0
OSizingData dc.w %1111111111111111
dc.w %1100000011111111
dc.w %1100110011111111
dc.w %1100000000000011
dc.w %1111110011110011
dc.w %1111110011110011
dc.w %1111110011110011
dc.w %1111110000000011
dc.w %1111111111111111
OCloseGad GADGET 0,4,0,24,10,GADGIMAGE,RELVERIFY,SYSGADGET+CLOSE
GADGET2 OCloseImage,0,0,0,0,0,0
OCloseImage IMAGE -4,0,28,10,2,OCloseData,%00000011,%00000000,0
OCloseData dc.l %11110011111111111111111111000000
dc.l %11110011000000000000000011000000
dc.l %11110011001111111111110011000000
dc.l %11110011001111111111110011000000
dc.l %11110011001111000011110011000000
dc.l %11110011001111000011110011000000
dc.l %11110011001111111111110011000000
dc.l %11110011001111111111110011000000
dc.l %11110011000000000000000011000000
dc.l %11110011111111111111111111000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000111100000000000000
dc.l %00000000000000111100000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
OSUpFrontGad GADGET 0,-28,0,26,10,GRELRIGHT+GADGIMAGE,RELVERIFY,SYSGADGET+SCRGADGET+SUPFRONT
GADGET2 OSUpFrontImage,0,0,0,0,0,0
OSUpFrontImage IMAGE 0,0,29,10,2,OSUpFrontData,%00000011,%00000000,0
OSUpFrontData dc.l %00111111111111111111111100111100
dc.l %00110000000000000011111100111100
dc.l %00110000000000000000001100111100
dc.l %00110000001111111111001100111100
dc.l %00110000001111111111001100111100
dc.l %00110000001111111111001100111100
dc.l %00110000001111111111001100111100
dc.l %00111111001111111111001100111100
dc.l %00111111000000000000001100111100
dc.l %00111111111111111111111100111100
dc.l %00000000000000000000000000000000
dc.l %00001111111111111100000000000000
dc.l %00001111000000000000000000000000
dc.l %00001111000000000000000000000000
dc.l %00001111000000000000000000000000
dc.l %00001111000000000000000000000000
dc.l %00001111000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
OSDownBackGad GADGET 0,-52,0,24,10,GRELRIGHT+GADGIMAGE,RELVERIFY,SYSGADGET+SCRGADGET+SDOWNBACK
GADGET2 OSDownBackImage,0,0,0,0,0,0
OSDownBackImage IMAGE 0,0,24,10,2,OSDownBackData,%00000011,%00000000,0
OSDownBackData dc.l %00111111111111111111111100000000
dc.l %00110000000000000011111100000000
dc.l %00110011111111110011111100000000
dc.l %00110011000000000000001100000000
dc.l %00110011000000000000001100000000
dc.l %00110011000000000000001100000000
dc.l %00110000000000000000001100000000
dc.l %00111111000000000000001100000000
dc.l %00111111000000000000001100000000
dc.l %00111111111111111111111100000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000000000000000000000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000111111111111110000000000
dc.l %00000000000000000000000000000000
OWDragGad GADGET 0,0,0,0,10,GADGHNONE+GRELWIDTH,0,SYSGADGET+WDRAGGING
GADGET2 0,0,0,0,0,0,0
OSDragGad GADGET 0,0,0,0,10,GADGHNONE+GRELWIDTH,0,SYSGADGET+SCRGADGET+SDRAGGING
GADGET2 0,0,0,0,0,0,0
END