1145
|
1 * F$LDAXY entry point
|
|
2 FLDAXY ldx R$X,u Get offset within block (S/B $0000-$1FFF)
|
|
3 ldy R$Y,u Get ptr to DAT block entry
|
|
4 bsr L0AC8 Go get byte
|
|
5 sta R$A,u Save in caller's A reg.
|
|
6 rts
|
|
7
|
|
8 * Entry: X=offset ($0000-$1fff) to get from block pointed to by Y (DAT entry
|
|
9 * format)
|
|
10 L0AC8 lda 1,y Get MMU block # to get data from
|
|
11 clrb Clear carry/setup for STB
|
|
12 pshs cc Preserve interrupt status/settings
|
|
13 orcc #IntMasks shut IRQ's off
|
|
14 sta >$FFA0 Map block into $0000-$1FFF
|
|
15 brn L0AC8
|
|
16 lda ,x Get byte
|
|
17 stb >$FFA0 Map block 0 into $0000-$1FFF
|
1239
|
18 fdb $21ED LBRN ???
|
1145
|
19 puls pc,cc Get interrupt status/(or turn on) & return
|
|
20
|
|
21 * Get 1st byte of LDDDXY - also used by many other routines
|
|
22 * Increments X on exit; adjusts X for within 8K block & Y (DAT img ptr)
|
|
23 LDAXY lda 1,y Get MMU block #
|
|
24 pshs b,cc
|
|
25 clrb
|
|
26 orcc #IntMasks Shut off interrupts
|
|
27 sta >$FFA0 Map in MMU block into slot 0
|
|
28 lda ,x+ Get byte
|
|
29 stb >$FFA0
|
|
30 * clr >$FFA0 Map in MMU block #0 into slot 0
|
|
31 * andcc #^IntMasks
|
|
32 puls b,cc
|
|
33 bra AdjBlk0
|
|
34
|
|
35 L0AEA leax >-DAT.BlSz,x Bump offset ptr to start of block again
|
|
36 leay 2,y Bump source MMU block up to next on in DAT Image
|
|
37 AdjBlk0 cmpx #DAT.BlSz Going to wrap out of our block?
|
|
38 bhs L0AEA Yes, go adjust
|
|
39 rts No, return
|
|
40
|
|
41 * F$LDDDXY entry point
|
|
42 FLDDDXY ldd R$D,u Get offset to offset within DAT Image
|
|
43 leau R$X,u Point U to Offset
|
|
44 pulu x,y Y=Offset within DAT Image, X=DAT Image ptr
|
|
45 bsr L0B02 Go get 2 bytes
|
|
46 std -(R$X+3),u Save into caller's X
|
|
47 clrb No error & return
|
|
48 rts
|
|
49 * Get 2 bytes for LDDDXY (also called by other routines)
|
|
50 * Should simply map in 2 blocks, and do a LDD (don't have to worry about wrap)
|
|
51 L0B02 pshs u,y,x Preserve regs
|
|
52 IFNE H6309
|
|
53 addr d,x Point X to X+D
|
|
54 ELSE
|
|
55 leax d,x
|
|
56 ENDC
|
|
57 bsr AdjBlk0 Wrap address around for 1 block
|
|
58 ldu <D.SysDAT Get sys DAT Image ptr
|
|
59 * lda 1,u Get MMU block #0
|
|
60 clra system block 0 =0 always
|
|
61 ldb 3,u Get MMU block #1
|
|
62 tfr d,u make U=blocks to re-map in once done
|
|
63 lda 1,y Get MMU block #0
|
|
64 ldb 3,y Get MMU block #1
|
|
65 pshs cc Preserve int. status
|
|
66 orcc #IntMasks shut off int.
|
|
67 std >$FFA0 Map in both blocks
|
|
68 ldd ,x Get 2 bytes
|
|
69 stu >$FFA0 Map original blocks in
|
|
70 * tfr y,w Restore W
|
|
71 puls pc,u,y,x,cc Restore regs & return
|