Changes (offsets given are for TOS1.4 UK, MD5 036c5ae4f885cbf62c9bed651c6c58a8):
At 0xfc06e, in the level 4 autovector (VBL handler), bypass the mono monitor check:
Code: Select all
/* In colour modes: */
btst #7,%d1 /* Check mono detect */
- bnes lvl4_vec_nochange /* No mono monitor --> skip */
+ bras lvl4_vec_nochange /* Always skip */
movew #2000,%d0 /* Delay loop */
lvl4_vec_delay:
dbf %d0,lvl4_vec_delay
moveb #2,%d0 /* Set resolution to mono */
bras lvl4_vec_chmode
addr_0702:
/* In mono: */
btst #7,%d1 /* Check mono detect */
- beqs lvl4_vec_nochange /* Monitor is present */
+ bras lvl4_vec_nochange /* Always skip */
moveb %a5@(defshiftmod),%d0 /* Get default shifter mode */
.short 0xb03c,0x0002 /* cmpb #2,%d0 */
blts lvl4_vec_chmode /* Default shifter mode compatible with colour monitor --> jump over */
At 0xfcb2b6, at the beginning of FindDevice(), redirect to a replacement implementation:
Code: Select all
_FindDevice:
- movew #4,%sp@-
- trap #14 /* Getrez() - get current video mode */
+ jmp _FindDevice2
addql #2,%sp
moveb %d0,%d2 /* Save the original resolution value */
.short 0xb43c,0x0002 /* cmpb #2,%d2 - current rez = mono? */
At 0xfd86ba, in desk_pref(), stop disabling the mode buttons:
Code: Select all
- movew #8,%a0@ /* HIGH res button .ob_state */
+ movew #0,%a0@ /* HIGH res button .ob_state */
bras addr_186be
addr_186a6:
moveal %d7,%a0
addal #346,%a0
- movew #8,%a0@ /* LOW res button .ob_state */
+ movew #0,%a0@ /* LOW res button .ob_state */
moveal %d7,%a0
addal #370,%a0
- movew #8,%a0@ /* MED res button .ob_state */
+ movew #0,%a0@ /* MED res button .ob_state */
addr_186be:
movew _gl_restype,%d4
subqw #2,%d4
At 0xfefc00, in place of a bunch of extraneous ffffs, insert the new FindDevice() implementation
Code: Select all
_FindDevice2:
movew #4,%sp@-
trap #14 /* Getrez() - get current video mode */
addql #2,%sp
moveb %d0,%d2 /* Save the original resolution value */
extw %d2
moveal INTIN,%a0
movew %a0@,%d0 /* Get the requested res from INTIN[0] */
cmpw #1,%d0
bnes fd3_not_1 /* Mode 1 (no change) not requested, continue here */
tstb %d2
beq fd3_low_pal /* Originally low, mode "1" now selected - go here */
cmpb #2,%d2
beq fd3_high_pal /* Originally high, mode "1" now selected - go here */
bra fd3_med_pal /* Originally medium, mode "1" now selected - go here */
fd3_not_1:
tstb %d2
beq fd3_orig_low /* Originally low */
cmpb #2,%d2
beq fd3_orig_high /* Originally high */
fd3_orig_med:
cmpw #4,%d0
beq fd3_goto_high /* 4 = Switch to high res */
cmpw #3,%d0
beq fd3_med_pal /* 3 = Stay in medium */
fd3_goto_low:
clrw %sp@-
moveq #-1,%d0
movel %d0,%sp@-
movel %d0,%sp@-
movew #5,%sp@-
trap #14 /* Setscreen(-1, -1, 0) - change to low res */
lea %sp@(12),%sp
/* Set up 16-colour palette */
fd3_low_pal:
pea paltab16
movew #6,%sp@-
trap #14 /* Setpalette(void *pallptr) */
addql #6,%sp
moveq #1,%d0 /* return 1 */
rts
fd3_orig_low:
cmpw #3,%d0
beqs fd3_goto_med /* 3 = Switch to medium */
cmpw #4,%d0
beqs fd3_goto_high /* 4 = Switch to high */
bra fd3_low_pal /* Stay in low */
fd3_goto_med:
movew #1,%sp@-
moveq #-1,%d0
movel %d0,%sp@-
movel %d0,%sp@-
movew #5,%sp@-
trap #14 /* Setscreen(-1, -1, 1) - change to medium res */
lea %sp@(12),%sp
/* Set up 4-colour palette */
fd3_med_pal:
pea paltab4
movew #6,%sp@-
trap #14 /* Setpalette(void *pallptr) */
addql #6,%sp
moveq #2,%d0 /* return 2 */
rts
fd3_orig_high:
cmpb #3,%d0
beq fd3_goto_med /* 3 = Switch to medium */
cmpb #4,%d0
beq fd3_high_pal /* 4 = Stay in high */
bra fd3_goto_low /* Switch to low */
fd3_goto_high:
movew #2,%sp@-
moveq #-1,%d0
movel %d0,%sp@-
movel %d0,%sp@-
movew #5,%sp@-
trap #14 /* Setscreen(-1, -1, 2) - change to high res */
lea %sp@(12),%sp
fd3_high_pal:
movew #1,palette
moveq #3,%d0 /* return 3 (high) */
rts