Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lea VDP_Ctrl,a1
- lea -4(a1),a2 ; VDP_Data
- vram _Nametbl_UI,d7 ; d7 = VRAM offset
- move.b TabID,d0
- andi.w #7,d0
- add.w d0,d0 ; d0 = Active Tab * 2
- moveq #0,d1 ; d1 = Current Tab * 2
- moveq #0,d2 ; d2 = Row ID * 2
- @DoRow:
- move.l d7,(a1) ; setup VDP access
- move.w #_Font1PatBase|_pal2|_pr,(a2) ; Solid bar
- @DoTab:
- lea @ActiveTabData,a0
- cmp.w d0,d1 ; is it active tab?
- beq.s @Skip
- lea @InactiveTabData,a0
- @Skip adda.w @TabData_Offsets(pc,d2.w),a0 ; a0 = tab patterns data
- lea @LabelsList,a3
- adda.w (a3,d1.w),a3 ; a3 = label text
- jsr @RowRoutines(pc,d2.w)
- addq.w #2,d1 ; next tab
- cmpi.w #_NumTabs*2,d1 ; is current tab the last?
- bcs.s @DoTab ; if not branch
- moveq #0,d1
- addi.l #$80<<16,d7 ; next row
- addq.w #2,d2
- cmpi.w #4*2,d2 ; is current row the last?
- beq.s @Return ; if not, branch
- move.l #((_Font1PatBase|_pal2|_pr)<<16)|(_Font1PatBase|_pal2|_pr),(a2) ; 2 Solid bar tiles
- cmpi.w #3*2,d2 ; is next row last?
- bne.s @DoRow
- ; ----------------------------------------------------------
- ; Row 03 specific code
- move.l d7,(a1) ; setup VDP access
- move.w #_UIPatBase+1|_pal3|_pr|_fv,(a2) ; Pattern
- bra.s @DoTab
- @Return:
- move.l #((_UIPatBase+1|_pal3|_pr|_fv)<<16)|(_UIPatBase+1|_pal3|_pr|_fv),(a2) ; 2 patterns
- rts
- ; ----------------------------------------------------------
- @TabData_Offsets:
- dc.w @F0-@ActiveTabData ; $00
- dc.w @F1-@ActiveTabData ; $02
- dc.w @F1-@ActiveTabData ; $04
- dc.w @F2-@ActiveTabData ; $06
- ; ----------------------------------------------------------
- @RowRoutines:
- bra.s @Tab_Top ; $00
- bra.s @Tab_Text_Row1 ; $02
- bra.s @Tab_Text_Row2 ; $04
- bra.s @Tab_Bottom ; $06
- ; ----------------------------------------------------------
- @Tab_Top:
- move.w (a0)+,(a2) ; left corner
- moveq #0,d3
- move.b (a3),d3 ; d3 = tab len
- move.w (a0)+,d4 ; d4 = pattern
- @0 move.w d4,(a2) ; fill middle
- dbf d3,@0
- move.w (a0)+,(a2) ; right corner
- rts
- ; ----------------------------------------------------------
- @Tab_Bottom:
- move.w (a0)+,(a2) ; corner
- moveq #0,d3
- move.b (a3)+,d3 ; d3 = tab len
- move.w (a0)+,d4 ; d4 = fill pattern
- @3 move.w d4,(a2)
- dbf d3,@3
- move.w (a0)+,(a2) ; corner
- rts
- ; ----------------------------------------------------------
- @Tab_Text_Row1:
- moveq #0,d6 ; d6 = row index
- bra.s @Tab_Text
- @Tab_Text_Row2:
- moveq #1,d6
- @Tab_Text:
- move.w (a0)+,d3 ; left corner base
- add.w d6,d3
- move.w d3,(a2)
- moveq #0,d3
- move.b (a3)+,d3 ; d3 = tab len
- move.w (a0)+,d4 ; d4 = pattern base
- @2 moveq #0,d5
- move.b (a3)+,d5 ; load letter tile
- add.w d4,d5 ; add pattern base
- add.w d6,d5 ; add row index
- move.w d5,(a2) ; output tile
- dbf d3,@2
- move.w (a0),d3 ; corner
- add.w d6,d3
- move.w d3,(a2)
- rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement