Files
TeslaRel410/sda4/DPL3/VRENDER/PXPL5SUP/PSTART.S
T
CydandClaude Fable 5 db7745fcd0 sda4: commit the Glaze developer hard-drive dump
Un-ignored: the dev drive is the ground truth the restoration and
emulator work constantly reference (DPL3/LIBDPL + VRENDER i860 renderer
source, BT/RP live+dev game trees, VGL_LABS pod boot, scene/audio
content). Kept in-repo for the pod-owner community.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 19:41:15 -05:00

140 lines
2.5 KiB
ArmAsm

//
//
// project: blaster
// subsystem: ttm100 860_rpc_kernel
//
// module: rpc_kernel
// file: pstart.s
//
// author: chrg
// date: 10:02:90
//
// copyright (c) division ltd. 1990
// sccs ident %w% %g%
//
//
// modified:
//
//
//
//
//
// function:- main entry point to rpc kernel. disables interrupts and
// then calls _vstart to go virtual etc.
//
//
//
//
.file "pstart.s"
.globl _start
.globl pstart
.globl _vstart
psr_im = 0x10
low_pg = 0x0fff
db_ate = 0x20
.text
// at this point, we are running on the bootloaders stack.
pstart:
_start:
// turn off all interrupts
ld.c psr,r16
andnot psr_im,r16,r16
st.c r16,psr
// ensure ate disabled and iti set
ld.c dirbase,r16
or db_ate,r0,r16
st.c r16,dirbase
// ensure fte clear
ld.c fsr,r16
or 0,r0,r16
st.c r16,fsr
// initialise fir
ld.c fir,r0
// setup boot stack
orh 0x8380, r0, r15
or 0x01, r0, r14
st.l r14, 0(r15)
mov 0xffffff00, r18
or 0x04, r0, r19
st.l r19, 0(r18)
// call _flush
// nop
mov 0xffffff00, r18
or 0xb, r0, r19
st.l r19, 24(r18)
// grab initstack and topmem from ccb
orh ha%_input_ccb, r0, r31
ld.l l%_input_ccb(r31), r29
orh 0xf040, r0, r16 // set stack to 0xf0400000
mov r16, sp
// grab the trap vector
orh 0xffff,r0,r20
or 0xff00,r20,r20 //hard vector
// orh h%alltraps,r0,r21
// or l%alltraps,r21,r21 //vector in .text
// subu r21,r20,r22 //rel addr
// shr 2,r22,r22
// adds -3,r22,r22 // adust for 2 NOPS, +1
// // change if remove NOPS!!!!
// andnoth 0xfc00,r22,r22
// orh 0x6800,r22,r22 // br alltraps
or h%alltraps, r0, r19
orh 0xec01, r19, r19
or l%alltraps, r0, r21
orh 0xe421, r21, r21
orh 0x4000, r0, r22
or 0x0800, r22, r22
orh 0xa000,r0,r23 // nop
st.l r23,0(r20) // chip bug NOP
st.l r23,4(r20) // chip bug NOP
st.l r19,8(r20) // br alltraps
st.l r21,12(r20) // delayed NOP
st.l r22,16(r20) // delayed NOP
st.l r23,20(r20) // delayed NOP
st.l r23,24(r20) // delayed NOP
st.l r23,28(r20) // delayed NOP
mov 0xfffff000, r18
or 0x32, r0, r19
st.l r19,0(r18)
br _vstart
nop
// *END* /