Article View: comp.sys.amiga.tech
Article #13762reboot a PAL machine into NTSC
From: finkel
Date: Sun, 18 Feb 1990 10:52
Date: Sun, 18 Feb 1990 10:52
142 lines
5716 bytes
5716 bytes
Hello everyone,
This is a program I wrote last night to reboot a PAL machine into
NTSC mode. You must have the new Agnus chip, and Kickstart 1.3 .
The program relies on static location of certain Kickstart 1.3
ROM instructions, so it MUST be modified for Kickstart 1.2 . Are there
any users of the new Agnus chip users with Kickstart 1.2??
The program has been tested on a PAL A500 with a super Agnus chip,
a fully populated A590, Kickstart 1.3 ROM, and a Rev 3 motherboard
hacked to contain the super Agnus chip.
The program should work as is on 2000's as well, but I didn't
test it. Again, it will *not* work with Kickstart 1.2 .
The program can be easily modified to reboot an NTSC machine in PAL
mode, but I remember reading that the american monitors can't work
in PAL mode, while the european monitors can work in both modes.
( This was verified by me ;-) ).
I could modify it to be more user-friendly ( find the appropriate
address in the Kickstart ROM at run time, etc. ), but I was too
lazy to do this ;-) ( actually, I had an exam the next morning so I
didn't have too much time improving it ).
Since our Usenet connection has been down for the last 3 weeks, any
comments should be mailed to me directly, and not posted.
Enjoy!
------------ cut ----------- cut ---------- cut -------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
# NTSCBoot.asm
# NTSCBoot.uue
# This archive created: Sun Feb 18 12:42:09 1990
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'NTSCBoot.asm'" '(2487 characters)'
if test -f 'NTSCBoot.asm'
then
echo shar: "will not over-write existing file 'NTSCBoot.asm'"
else
sed 's/^X//' << \SHAR_EOF > 'NTSCBoot.asm'
X;
X; NTSCBoot.asm
X;
X; Copyright (C) 1990 By Udi Finkelstein.
X; 17 feb 1990
X;
X; Reboot a SuperAgnus equipped PAL machine into NTSC mode.
X;
X; With thanks to Bart Whitebrook from CBM for his article on the new ECS
X; registers in the 3rd european DevCon notes!
X
X; get into supervisor state, since we can only execute RESET there.
X xref _LVOSuperState
X move.l 4,a6
X jsr _LVOSuperState(a6)
X
X; ************************************
X; Warning!!! a grand hack ahead!!!!!!!
X; Never do this stuff alone at home!!!
X; ************************************
X
X; Now we are in supervisor mode, and can issue a RESET command.
X; Unfortunately, after RESET there is no RAM in the system!
X; We can issue exacly *one* instruction ( 1 word length ) because
X; the instruction was fetched before RESET was executed. This
X; instruction can be a 'jmp (aX)', to somewhere on the ROM, where the
X; program can continue. After searching the Kickstart 1.3 ROM, I found
X; that at address $ff4120 you can find the code:
X
X; [ Notice - for Kickstart 1.3 ***ONLY***!!! Is there anybody out there
X; with a Kickstart 1.2/super Agnus combination? you have a problem! ;-) ]
X
X;00FF4120 2741 0038 move.l d1,$38(a3)
X;00FF4124 4281 clr.l d1
X;00FF4126 4ED6 jmp (a6)
X
X; We can use this code fragment to set the NTSC bit in the super agnus,
X; and then jump to the reset code. The PAL/NTSC bit is contained in
X; address $DFF1DC (BEAMCON0 !).
X;
X; 'move.l d1,$38(a3)' writes a longword, therefor $38(a3) must point to
X; $dff1da because it's a read only location, which we can't harm, and
X; $dff1dc contains the PAL/NTSC bit.
X; $38(a3) == $dff1da --> a3 == $ddf1a2
X; we must reset d1 ofcourse, or set d1 == #$00000020 to set PAL mode.
X;
X; ofcourse we have to set a6 to $00000002 to run the reset code later.
X;
X
XROMADR = ($ff4120-$fc0000)
X
X; ROMADR points to $ff4120 after the ROM appears in address $0000.
X
X lea.l $dff1a2,a3
X move.l #$0,d1
X move.l 2,a6
X cnop 0,4
X lea.l ROMADR,a5
X RESET ;reset the machine...
X jmp (a5) ;execute our code fragment.
X
X; Well, that's it. I tried writing a more portable code by trying to
X; set/reset the OVL bit in $BFE001 instead of 'jmp (aX)' after RESET,
X; but I wasn't able to get it working, so the only way I found to run
X; a code after RESET is to find a ROM fragment that happenes to match
X; my requirement. You don't have to tell me how bad it is. Hopefully,
X; the 1.4 preferences will have a PAL/NTSC software switch ( Will it?!!)
X
X END
SHAR_EOF
if test 2487 -ne "`wc -c < 'NTSCBoot.asm'`"
then
echo shar: "error transmitting 'NTSCBoot.asm'" '(should have been 2487 chara
fi
fi
echo shar: "extracting 'NTSCBoot.uue'" '(133 characters)'
if test -f 'NTSCBoot.uue'
then
echo shar: "will not over-write existing file 'NTSCBoot.uue'"
else
sed 's/^X//' << \SHAR_EOF > 'NTSCBoot.uue'
X
Xbegin 644 NTSCBoot
XM```#\P`````````!```````````````(```#Z0````@L>``$3J[_:D?Y`-_Q0
X7HG(`+'@``DOY``-!($YP3M5.<0```_((_
X``
Xend
Xsize 68
SHAR_EOF
if test 133 -ne "`wc -c < 'NTSCBoot.uue'`"
then
echo shar: "error transmitting 'NTSCBoot.uue'" '(should have been 133 charac
fi
fi
exit 0
# End of shell archive
Technical Details
Message-ID:
<9002181052.AA03247@virgo.tau.ac.il>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!TAURUS.BITNET!finkelShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!TAURUS.BITNET!finkel From: finkel@TAURUS.BITNET Newsgroups: comp.sys.amiga.tech Subject: reboot a PAL machine into NTSC Message-ID: <9002181052.AA03247@virgo.tau.ac.il> Date: 18 Feb 90 10:52:51 GMT Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: <finkel%math.tau.ac.il@CUNYVM.CUNY.EDU> Lines: 142