mirror of
https://github.com/elliotnunn/NetBoot.git
synced 2025-02-05 15:30:28 +00:00
Change input to include arbitrary 4-byte IDs
This commit is contained in:
parent
ba0880d773
commit
f9357a32fe
43
BootPicker.a
43
BootPicker.a
@ -1,4 +1,6 @@
|
|||||||
; Inputs: append 1 or more Pascal strings, followed by zero byte
|
; Input appended to this code:
|
||||||
|
; [4 arbitrary bytes] [byte-prefixed pstring] [padding to even byte] ... [4 bytes] [zero byte]
|
||||||
|
|
||||||
; Outputs: D0 = index of selected string, Ao = pointer to selected string
|
; Outputs: D0 = index of selected string, Ao = pointer to selected string
|
||||||
|
|
||||||
_BoundaryLabelAtStartOfBootPicker_
|
_BoundaryLabelAtStartOfBootPicker_
|
||||||
@ -53,7 +55,7 @@ _BoundaryLabelAtStartOfBootPicker_
|
|||||||
|
|
||||||
; First pass: calculate box width, putting shortest string width into D5
|
; First pass: calculate box width, putting shortest string width into D5
|
||||||
moveq.l #.kMinWid,D5
|
moveq.l #.kMinWid,D5
|
||||||
lea .TrailingList,A0 ; A0 = current pstring ptr
|
bsr .GetA0 ; A0 = current pstring ptr
|
||||||
.dswLoop
|
.dswLoop
|
||||||
tst.b (A0)
|
tst.b (A0)
|
||||||
beq.s .dswDone
|
beq.s .dswDone
|
||||||
@ -70,9 +72,7 @@ _BoundaryLabelAtStartOfBootPicker_
|
|||||||
.notlargest
|
.notlargest
|
||||||
move.l (SP)+,A0
|
move.l (SP)+,A0
|
||||||
|
|
||||||
moveq.l #1,D0 ; increment the pstring ptr
|
bsr .AdvanceA0
|
||||||
add.b (A0),D0
|
|
||||||
add.l D0,A0
|
|
||||||
bra.s .dswLoop
|
bra.s .dswLoop
|
||||||
.dswDone
|
.dswDone
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ _BoundaryLabelAtStartOfBootPicker_
|
|||||||
move.l #((.kPadY+.kBtnHt)<<16)|(.kPadX+4+4),D3; D3 = current button's botright
|
move.l #((.kPadY+.kBtnHt)<<16)|(.kPadX+4+4),D3; D3 = current button's botright
|
||||||
add.w D5,D3 ; ...including width of the text
|
add.w D5,D3 ; ...including width of the text
|
||||||
moveq.l #0,D6 ; D6 = button counter
|
moveq.l #0,D6 ; D6 = button counter
|
||||||
lea .TrailingList,A0 ; A0 = current pstring ptr
|
bsr .GetA0 ; A0 = current pstring ptr
|
||||||
.dsbLoop
|
.dsbLoop
|
||||||
tst.b (A0)
|
tst.b (A0)
|
||||||
beq.s .dsbDone
|
beq.s .dsbDone
|
||||||
@ -99,9 +99,7 @@ _BoundaryLabelAtStartOfBootPicker_
|
|||||||
add.l #(.kBtnHt+.kBtnGap)<<16,D2 ; the button's top edge
|
add.l #(.kBtnHt+.kBtnGap)<<16,D2 ; the button's top edge
|
||||||
add.l #(.kBtnHt+.kBtnGap)<<16,D3 ; the button's bottom edge
|
add.l #(.kBtnHt+.kBtnGap)<<16,D3 ; the button's bottom edge
|
||||||
addq.w #1,D6 ; the button counter
|
addq.w #1,D6 ; the button counter
|
||||||
moveq.l #1,D0 ; the pstring ptr
|
bsr .AdvanceA0
|
||||||
add.b (A0),D0
|
|
||||||
add.l D0,A0
|
|
||||||
bra.s .dsbLoop
|
bra.s .dsbLoop
|
||||||
|
|
||||||
.dsbDone ; done looping, push a header for this object...
|
.dsbDone ; done looping, push a header for this object...
|
||||||
@ -147,7 +145,7 @@ _BoundaryLabelAtStartOfBootPicker_
|
|||||||
|
|
||||||
; Fourth pass: create a string offset for each button
|
; Fourth pass: create a string offset for each button
|
||||||
moveq.l #0,D6 ; D6 = button counter
|
moveq.l #0,D6 ; D6 = button counter
|
||||||
lea .TrailingList,A0 ; A0 = current pstring ptr
|
bsr .GetA0 ; A0 = current pstring ptr
|
||||||
.dssLoop
|
.dssLoop
|
||||||
tst.b (A0)
|
tst.b (A0)
|
||||||
beq.s .dssDone
|
beq.s .dssDone
|
||||||
@ -164,16 +162,14 @@ _BoundaryLabelAtStartOfBootPicker_
|
|||||||
|
|
||||||
; increment...
|
; increment...
|
||||||
addq.w #1,D6 ; the button counter
|
addq.w #1,D6 ; the button counter
|
||||||
moveq.l #1,D0 ; the pstring ptr
|
bsr .AdvanceA0
|
||||||
add.b (A0),D0
|
|
||||||
add.l D0,A0
|
|
||||||
bra.s .dssLoop
|
bra.s .dssLoop
|
||||||
.dssDone
|
.dssDone
|
||||||
|
|
||||||
|
|
||||||
; Fifth pass: generate code for each button
|
; Fifth pass: generate code for each button
|
||||||
moveq.l #0,D6 ; D6 = button counter
|
moveq.l #0,D6 ; D6 = button counter
|
||||||
lea .TrailingList,A0 ; A0 = current pstring ptr
|
bsr .GetA0 ; A0 = current pstring ptr
|
||||||
.dspLoop
|
.dspLoop
|
||||||
tst.b (A0)
|
tst.b (A0)
|
||||||
beq.s .dspDone
|
beq.s .dspDone
|
||||||
@ -199,9 +195,7 @@ _BoundaryLabelAtStartOfBootPicker_
|
|||||||
|
|
||||||
; increment...
|
; increment...
|
||||||
addq.w #1,D6 ; the button counter
|
addq.w #1,D6 ; the button counter
|
||||||
moveq.l #1,D0 ; the pstring ptr
|
bsr .AdvanceA0
|
||||||
add.b (A0),D0
|
|
||||||
add.l D0,A0
|
|
||||||
bra.s .dspLoop
|
bra.s .dspLoop
|
||||||
|
|
||||||
.dspDone ; Must clear the instruction cache on 030/040
|
.dspDone ; Must clear the instruction cache on 030/040
|
||||||
@ -297,6 +291,21 @@ _BoundaryLabelAtStartOfBootPicker_
|
|||||||
jmp (A0)
|
jmp (A0)
|
||||||
|
|
||||||
|
|
||||||
|
.GetA0
|
||||||
|
lea .TrailingList+4,A0
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
.AdvanceA0
|
||||||
|
moveq.l #1,D0
|
||||||
|
add.b (A0),D0
|
||||||
|
add.l D0,A0
|
||||||
|
and.l #1,D0 ; align to 2-byte boundary
|
||||||
|
add.l D0,A0
|
||||||
|
lea 4(A0),A0 ; skip the 4-byte header
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
.MyDSAlertTabStart
|
.MyDSAlertTabStart
|
||||||
dc.w 1 ; NumEntries
|
dc.w 1 ; NumEntries
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user