First cut at a non-trivial overlay. Pallettes and tile indexes still to be fixed

This commit is contained in:
Lucas Scharenbroich 2021-10-11 14:09:38 -05:00
parent 2966b1052b
commit 4338b64338
12 changed files with 11923 additions and 6297 deletions

View File

@ -44,15 +44,19 @@ NO_MUSIC equ 1 ; turn music + tool loadi
jsr MovePlayerToOrigin ; Put the player at the beginning of the map jsr MovePlayerToOrigin ; Put the player at the beginning of the map
jsr InitOverlay ; Initialize the status bar
lda #DIRTY_BIT_BG0_REFRESH ; Redraw all of the tiles on the next Render lda #DIRTY_BIT_BG0_REFRESH ; Redraw all of the tiles on the next Render
ora #DIRTY_BIT_BG1_REFRESH ora #DIRTY_BIT_BG1_REFRESH
tsb DirtyBits tsb DirtyBits
stz frameCount
lda #$FFFF lda #$FFFF
jsl Render jsl Render
EvtLoop EvtLoop
jsl DoTimers jsl DoTimers
jsl Render jsl Render
inc frameCount
jsl ReadControl jsl ReadControl
and #$007F ; Ignore the buttons for now and #$007F ; Ignore the buttons for now
@ -340,8 +344,7 @@ DoLoadPic
dw $0222,$0333,$0444,$0888,$09A0,$0680,$0470,$0051 dw $0222,$0333,$0444,$0888,$09A0,$0680,$0470,$0051
; SMB ; SMB
DefaultPalette dw $0E51,$0EDB,$0000,$068F,$0BF1,$00A0,$0EEE,$0777,$0FA4,$0F59,$0E05,$0F30 DefaultPalette dw $0000,$0777,$0F31,$0E51,$00A0,$02E3,$0BF1,$0FA4,$0FD7,$0EE6,$0F59,$068F,$01CE,$09B9,$0EDA,$0EEE
dw $0680,$0470,$0051
; Graphics helpers ; Graphics helpers
@ -460,8 +463,9 @@ qtRec adrl $0000
PUT App.Msg.s PUT App.Msg.s
PUT Actions.s PUT Actions.s
PUT font.s PUT font.s
PUT Overlay.s
PUT gen/App.TileMapBG0.s PUT gen/App.TileMapBG0.s
PUT gen/App.TileMapBG1.s PUT gen/App.TileMapBG1.s
PUT gen/App.TileSetAnim.s PUT gen/App.TileSetAnim.s
PUT Overlay.s

View File

@ -1,102 +1,253 @@
; Put a single-line overlay to display status information ; An overlay is a callback from the render to shadow in a range of lines. At a minimum, the overlay
Overlay ; code needs to LDA/STA or TSB slam the data, but an overlay is typically used to draw some graphic
:top equ 16 ; on top of the rendered playfield, such as a status bar or in-game message
ldy #$2222 ;
; This overlay implementation is for a status bar that is 8-lines height that will be used to display some
; status information. The interesting bit of this implementation is that it's split into two pieces,
; a left and right section in order to be able to use the same code for different screen widths, but
; still keep the content in the cornders while covering the full screen.
;
; There are two subroutines that need to be implemented -- one to update the overlay content and a
; second to actually render to the screen
lda #TopLabel ; Initialize the overlay be drawin gin static content that will not change over time
ldx #{160*:top+4}
jsr DrawString
ldx #{160*:top+12}
; lda LastTop
; jsr DrawWord
lda #BottomLabel CHAR_TILE_BASE equ 241 ; set this to the real tile id that starts an ASCII run starting at '0' through 'Z'
ldx #{160*:top+32}
jsr DrawString
ldx #{160*:top+40}
; lda LastBottom
; jsr DrawWord
lda #LeftLabel ; Define the sized of the left and right overlay buffers
ldx #{160*:top+60} R_CHAR_COUNT equ 9 ; "TICK:XXX"
jsr DrawString L_CHAR_COUNT equ 8 ; "FPS:XXX"
ldx #{160*:top+68}
; lda LastLeft
; jsr DrawWord
lda #RightLabel ; Allocate a single buffer for holding both the left and right overlay characters + masks
ldx #{160*:top+88} OVRLY_SPAN equ {L_CHAR_COUNT+R_CHAR_COUNT}*4
jsr DrawString CHAR_WIDTH equ 4
ldx #{160*:top+96}
; lda LastRight
; jsr DrawWord
ovrly_buff ds OVRLY_SPAN*8
ovrly_mask ds OVRLY_SPAN*8
lda #XLabel r_line equ ovrly_buff+{L_CHAR_COUNT*4}
ldx #{160*{:top+8}+4} l_line equ ovrly_buff
jsr DrawString r_mask equ ovrly_mask+{L_CHAR_COUNT*4}
ldx #{160*{:top+8}+12} l_mask equ ovrly_mask
lda StartX
jsr DrawWord
lda #XModLabel MASK_OFFSET equ {ovrly_mask-ovrly_buff}
ldx #{160*{:top+8}+32}
jsr DrawString
ldx #{160*{:top+8}+40}
lda StartXMod164
jsr DrawWord
lda #YLabel InitOverlay
ldx #{160*{:top+8}+60} lda #'F'-'0'
jsr DrawString ldy #l_line+{CHAR_WIDTH*0}
ldx #{160*{:top+8}+68} jsr _DrawChar
lda StartY lda #'P'-'0'
jsr DrawWord ldy #l_line+{CHAR_WIDTH*1}
jsr _DrawChar
lda #'S'-'0'
ldy #l_line+{CHAR_WIDTH*2}
jsr _DrawChar
lda #':'-'0'
ldy #l_line+{CHAR_WIDTH*3}
jsr _DrawChar
lda #YModLabel lda #'T'-'0'
ldx #{160*{:top+8}+88} ldy #r_line+{CHAR_WIDTH*0}
jsr DrawString jsr _DrawChar
ldx #{160*{:top+8}+96} lda #'I'-'0'
lda StartYMod208 ldy #r_line+{CHAR_WIDTH*1}
jsr DrawWord jsr _DrawChar
lda #'C'-'0'
ldy #r_line+{CHAR_WIDTH*2}
jsr _DrawChar
lda #'K'-'0'
ldy #r_line+{CHAR_WIDTH*3}
jsr _DrawChar
lda #':'-'0'
ldy #r_line+{CHAR_WIDTH*4}
jsr _DrawChar
rts
; Update the dynamic content of the overlay
_num2ascii
and #$000F
cmp #$000A
bcc :out
clc
adc #'A'-10
:out rts
lda #DirtyLabel UdtOverlay
ldx #{160*{:top+16}+4} lda frameCount ; reder the FPS value
jsr DrawString xba
ldx #{160*{:top+16}+12} jsr _num2ascii
lda DirtyBits ldy #l_line+{CHAR_WIDTH*4}
jsr DrawWord jsr _DrawChar
lda #STWLabel lda frameCount
ldx #{160*{:top+16}+32} lsr
jsr DrawString lsr
ldx #{160*{:top+16}+48} lsr
lda ScreenTileWidth lsr
jsr DrawWord jsr _num2ascii
ldy #l_line+{CHAR_WIDTH*5}
jsr _DrawChar
lda #STHLabel lda frameCount
ldx #{160*{:top+16}+68} jsr _num2ascii
jsr DrawString ldy #l_line+{CHAR_WIDTH*6}
ldx #{160*{:top+16}+84} jsr _DrawChar
lda ScreenTileHeight
jsr DrawWord lda OneSecondCounter ; reder the number of remaining seconds
xba
jsr _num2ascii
ldy #r_line+{CHAR_WIDTH*5}
jsr _DrawChar
lda OneSecondCounter
lsr
lsr
lsr
lsr
jsr _num2ascii
ldy #r_line+{CHAR_WIDTH*6}
jsr _DrawChar
lda OneSecondCounter
jsr _num2ascii
ldy #l_line+{CHAR_WIDTH*7}
jsr _DrawChar
rts rts
TopLabel str 'T:' ; Draw the overlay
BottomLabel str 'B:' ; A = address of the left edge of the screen
RightLabel str 'R:' Overlay ENT
LeftLabel str 'L:' phb ; Called via JSL
phk
plb
XLabel str 'X:' phd ; save the direct page register
YLabel str 'Y:'
XModLabel str 'X*'
YModLabel str 'Y*'
DirtyLabel str 'D:' sta l_addr ; save this value (will go into D-reg later)
STWLabel str 'STW:' clc
STHLabel str 'STH:' adc #L_CHAR_COUNT*CHAR_WIDTH ; advance past the left characters
sta m_addr ; this is the DP for the TSB slam
lda ScreenWidth
sec
sbc #R_CHAR_COUNT*CHAR_WIDTH ; calculate the left edge of the right side
clc
adc l_addr ; add to the left edge
dec
sta r_addr ; this is the DP for the right side
; Calculate the TSB slam entry point
lda ScreenWidth ; subtract the width of all the characters to figure
sec ; out what need to be shadowed in the middle
sbc #{R_CHAR_COUNT+L_CHAR_COUNT}*CHAR_WIDTH
eor #$FFFF
inc ; get the negative value
clc
adc #m_end
sta m_patch+1
sei
_R1W1
ldy #8 ; count the line we're on
ldx #0
ovrly_loop
lda r_addr
tcd ; set the direct page for the right side
jmp r_ovrly ; render that line
r_ovrly_rtn
lda m_addr
tcd ; set the direct page for the slam in the middle
lda #0 ; set to zero for TSB slam
m_patch jmp $0000 ; jump into the slam field
m_ovrly_rtn
lda l_addr ; set the direct page for the left side
tcd
jmp l_ovrly
l_ovrly_rtn
clc
tdc
adc #160 ; advance to the next screen line
sta l_addr
adc #{L_CHAR_COUNT*CHAR_WIDTH}
sta m_addr
lda r_addr
adc #160
sta r_addr
txa
adc #OVRLY_SPAN
tax
dey
bne ovrly_loop
_R0W0
cli
:exit
pld ; restore the direct page and bank and return
plb
rtl
l_addr ds 2
m_addr ds 2
r_addr ds 2
r_ovrly
]idx equ 0
lup 16
lda r_line+]idx,x
sta ]idx
]idx equ ]idx+2
--^
jmp r_ovrly_rtn ; In R1W1, so can't use the stack
l_ovrly
]idx equ 0
lup 20
lda l_line+]idx,x
sta ]idx
]idx equ ]idx+2
--^
jmp l_ovrly_rtn
; Single TSB slam
m_line
]idx equ $9E
lup 80 ; 80 words max for a full-width screen
tsb ]idx
]idx equ ]idx-2
--^
m_end
jmp m_ovrly_rtn
; Draw a character (tile) into a location of the overlay
;
; A = Tile ID
; Y = overlay address location
tiledata EXT
_DrawChar
jsl GetTileAddr
tax
]idx equ 0
lup 8
ldal tiledata+32+{]idx*4},x
sta: {]idx*OVRLY_SPAN}+MASK_OFFSET,y
ldal tiledata+{]idx*4},x
sta: {]idx*OVRLY_SPAN},y
ldal tiledata+32+{]idx*4}+2,x
sta: {]idx*OVRLY_SPAN}+MASK_OFFSET+2,y
ldal tiledata+{]idx*4}+2,x
sta: {]idx*OVRLY_SPAN}+2,y
]idx equ ]idx+1
--^
rts

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -96,11 +96,11 @@ App_TileMapBG0
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$100f,$0010,$0011,$1012,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$100f,$0010,$0011,$1012,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$0800,$0801,$0800,$0801,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$000b,$000c,$000d,$000e,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$000b,$000c,$000d,$000e,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1039,$103a,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1039,$103a,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$0802,$0803,$0802,$0803,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$100f,$0010,$0011,$1012,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$100f,$0010,$0011,$1012,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
@ -112,11 +112,11 @@ App_TileMapBG0
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1038,$0015,$003e,$0015,$0015,$003e,$0015,$103b,$1029,$1029,$1029,$0800,$0801,$0800,$0801,$0800,$0801,$0800,$0801,$0800,$0801,$1029,$1029,$102a,$102b,$102a,$102b,$102a,$102b,$1029,$1029,$1029,$1038,$0015,$003e,$1238,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$102a,$102b,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029 dw $1029,$1038,$0015,$003e,$0015,$0015,$003e,$0015,$103b,$1029,$1029,$1029,$0800,$0801,$0800,$0801,$0800,$0801,$0800,$0801,$0800,$0801,$1029,$1029,$102a,$102b,$102a,$102b,$102a,$102b,$1029,$1029,$1029,$1038,$0015,$003e,$1238,$1029,$1029,$1029,$0800,$0801,$0800,$0801,$0800,$0801,$1029,$1029,$102a,$102b,$1029,$1029,$1029,$1029,$0800,$0801,$1013,$0014,$0015,$1016,$1029,$1029,$0800,$0801
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$102a,$102b,$102a,$102b,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$102a,$102b,$102a,$102b,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1038,$0015,$0015,$0015,$0015,$0015,$0015,$0015,$0015,$103b,$1029,$1029,$0802,$0803,$0802,$0803,$0802,$0803,$0802,$0803,$0802,$0803,$1029,$102c,$002d,$002d,$002d,$002d,$002d,$002d,$102e,$1029,$1038,$0015,$0015,$0015,$0015,$1238,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$102c,$002d,$002d,$102e,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029 dw $1038,$0015,$0015,$0015,$0015,$0015,$0015,$0015,$0015,$103b,$1029,$1029,$0802,$0803,$0802,$0803,$0802,$0803,$0802,$0803,$0802,$0803,$1029,$102c,$002d,$002d,$002d,$002d,$002d,$002d,$102e,$1029,$1038,$0015,$0015,$0015,$0015,$1238,$1029,$1029,$0802,$0803,$0802,$0803,$0802,$0803,$1029,$102c,$002d,$002d,$102e,$1029,$1029,$1029,$0802,$0803,$1013,$0014,$0015,$1016,$1029,$1029,$0802,$0803
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$102c,$002d,$002d,$002d,$002d,$102e,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$102c,$002d,$002d,$002d,$002d,$102e,$1029,$1029,$1029,$1013,$0014,$0015,$1016,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029
dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029 dw $1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@
"build:assets-woz-fatbits": "node %npm_package_config_png2iigs% ./assets/woz-pixelated.png ./emu/bg1a.bin --start-index 6 && node %npm_package_config_png2iigs% ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node %npm_package_config_png2iigs% ./assets/donut-plains-1-6-color.png ./emu/fg1.bin", "build:assets-woz-fatbits": "node %npm_package_config_png2iigs% ./assets/woz-pixelated.png ./emu/bg1a.bin --start-index 6 && node %npm_package_config_png2iigs% ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node %npm_package_config_png2iigs% ./assets/donut-plains-1-6-color.png ./emu/fg1.bin",
"build:assets-color-cycle": "node %npm_package_config_png2iigs% ./assets/rotopattern.png ./emu/bg1a.bin --start-index 6 && node %npm_package_config_png2iigs% ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node %npm_package_config_png2iigs% ./assets/donut-plains-1-6-color.png ./emu/fg1.bin", "build:assets-color-cycle": "node %npm_package_config_png2iigs% ./assets/rotopattern.png ./emu/bg1a.bin --start-index 6 && node %npm_package_config_png2iigs% ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node %npm_package_config_png2iigs% ./assets/donut-plains-1-6-color.png ./emu/fg1.bin",
"build:map": "node %npm_package_config_tiled2iigs% ./assets/tiled/world_1-1.json --output-dir ./gen", "build:map": "node %npm_package_config_tiled2iigs% ./assets/tiled/world_1-1.json --output-dir ./gen",
"build:tiles": "node %npm_package_config_png2iigs% ./assets/tilesets/smb-16.png --max-tiles 224 --as-tile-data --transparent-color-index 3 > ./gen/App.TileSet.s" "build:tiles": "node %npm_package_config_png2iigs% ./assets/tilesets/smb-16.png --max-tiles 360 --as-tile-data --transparent-color-index 11 > ./gen/App.TileSet.s"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -14,6 +14,9 @@ NO_MUSIC equ 1 ; turn music + tool loading off
; External data provided by the main program segment ; External data provided by the main program segment
tiledata EXT tiledata EXT
; IF there are overlays, they are provided as an external
Overlay EXT
; Core engine functionality. The idea is that that source file can be PUT into ; Core engine functionality. The idea is that that source file can be PUT into
; a main source file and all of the functionality will be available. ; a main source file and all of the functionality will be available.
; ;

View File

@ -38,6 +38,7 @@ StopScript EXT
; Direct access to internals ; Direct access to internals
DoScriptSeq EXT DoScriptSeq EXT
GetTileAddr EXT
; Allocate a full 64K bank ; Allocate a full 64K bank
AllocBank EXT AllocBank EXT

View File

@ -88,9 +88,9 @@ _Render
jsr _ShadowOff jsr _ShadowOff
; ldx #0 ; Blit the full virtual buffer to the screen ldx #0 ; Blit the full virtual buffer to the screen
; ldy #8 ldy #8
; jsr _BltRange jsr _BltRange
jsr _ShadowOn jsr _ShadowOn
@ -102,9 +102,15 @@ _Render
; ldy #16 ; ldy #16
; jsr _BltRange ; jsr _BltRange
; jsr Overlay lda ScreenY0 ; pass the address of the first line of the overlay
asl
tax
lda ScreenAddr,x
clc
adc ScreenX0
jsl Overlay
ldx #0 ; Blit the full virtual buffer to the screen ldx #8 ; Blit the full virtual buffer to the screen
ldy ScreenHeight ldy ScreenHeight
jsr _BltRange jsr _BltRange

View File

@ -101,88 +101,3 @@ _PEISlam
:stk_save ds 2 :stk_save ds 2
:screen_width_1 ds 2 :screen_width_1 ds 2

View File

@ -665,6 +665,25 @@ epilogue_1 tsc
; bcs alt_exit ; 2/3 ; bcs alt_exit ; 2/3
; pha ; pha
; ... ; ...
;
; A theoretical exception handler that performed a full 3-level blend would be
;
; start lda 0,s
; and [00],y
; ora (00),y
; and $80,x
; ora $00,x
; and #MASK
; ora #DATA
; bcs alt_exit
; pha ; 4
; out brl next ; 4 Fast-path completes in 5 additional cycles
;
; alt_exit bvs r_edge ; 2/3
; clc ; 2
; brl l_jmp_rtn ; 3
; r_edge rep #$41
; brl r_jmp_rtn ; 3
ds \,$00 ; pad to the next page boundary ds \,$00 ; pad to the next page boundary

View File

@ -53,6 +53,9 @@ TILE_CTRL_MASK equ $1E00 ; Deliberatel
; A = tile descriptor ; A = tile descriptor
; ;
; The address is the TileID * 128 + (HFLIP * 64) ; The address is the TileID * 128 + (HFLIP * 64)
GetTileAddr ENT
jsr _GetTileAddr
rtl
_GetTileAddr _GetTileAddr
asl ; Multiply by 2 asl ; Multiply by 2
bit #2*TILE_HFLIP_BIT ; Check if the horizontal flip bit is set bit #2*TILE_HFLIP_BIT ; Check if the horizontal flip bit is set