Checkpoint on dynamic tile blitters

This commit is contained in:
Lucas Scharenbroich 2021-11-18 15:36:36 -06:00
parent 9a6eb45b20
commit ba76b0047c
7 changed files with 22 additions and 11 deletions

View File

@ -36,10 +36,13 @@ DOWN_ARROW equ $0A
jsl SetPalette
ldx #5 ; Mode 0 is full-screen, mode 5 is 256x160
ldx #320
ldy #144
jsl SetScreenMode
; Set up our level data
jsr BG0SetUp
jsr TileAnimInit
jsr SetLimits
jsr InitOverlay ; Initialize the status bar
@ -239,7 +242,11 @@ EvtLoop
ldy PlayerY
jsl UpdateSprite ; Move the sprite to this local position
; Update the timers
jsl DoTimers
; Let's see what it looks like!
lda vsync
beq :no_vsync
:vsyncloop jsl GetVerticalCounter ; 8-bit value
@ -281,7 +288,7 @@ Exit
bcs Fatal
Fatal brk $00
BG1DataFile strl '1/octane.c1'
BG1DataFile strl '1/sunset.c1'
; Color palette
; MyPalette dw $068F,$0EDA,$0000,$0E51,$0BF1,$00A0,$0EEE,$0456,$0FA4,$0F59,$0E30,$01CE,$02E3,$0870,$0F93,$0FD7

View File

@ -372,9 +372,9 @@ CopyMaskedDWord MAC
ora #$80
sta: $0003,x ; Set AND 00,x operand
lda #$35
sta: $0002,x ; Set AND 00,x operand
sta: $0002,x ; Set AND 00,x opcode
lda #$15
sta: $0004,x ; Set ORA 00,x operand
sta: $0004,x ; Set ORA 00,x opcode
rep #$30
lda #$0290 ; BCC *+4

View File

@ -8,7 +8,7 @@
use .\Defs.s
; Feature flags
NO_INTERRUPTS equ 1 ; turn off for crossrunner debugging
NO_INTERRUPTS equ 0 ; turn off for crossrunner debugging
NO_MUSIC equ 1 ; turn music + tool loading off
; External data provided by the main program segment

View File

@ -17,7 +17,7 @@ _TBDynamicTile_00
; LDA 00,x / PHA where the operand is fixed when the tile is rendered
; $B5 $00 $48
_TBDynamicData
txa
; txa
asl
asl
asl

View File

@ -8,9 +8,11 @@ _TBDynamicMaskTile_00
; A = dynamic tile id (must be <32)
_TBDynamicDataAndMask
sta _X_REG
txa
and #$007F ; clamp to < (32 * 4)
sta _T_PTR
stx _X_REG
CopyMaskedDWord $0003
CopyMaskedDWord $1003

View File

@ -308,11 +308,6 @@ function buildTile(options, buff, _mask, width, x, y) {
if (mask.some(h => h != 0)) {
tile.isSolid = false;
}
if (x === 120 && y === 8) {
console.warn(`isSolid: ${tile.isSolid}` );
console.warn(data.map(d => d.toString(16)), mask);
}
}
for (dy = 0; dy < 8; dy += 1) {

View File

@ -460,6 +460,7 @@ function convertTileID(tileId, tileset) {
}
const mask_bit = (!tileset[tileIndex - 1].isSolid || tileIndex === GLOBALS.emptyTile) && ((GLOBALS.tileLayers.length !== 1) || GLOBALS.forceMasked);
/*
if (tileIndex === 48) {
console.warn('isSolid: ', tileset[tileIndex - 1].isSolid);
console.warn('GLOBALS.emptyTile: ', GLOBALS.emptyTile);
@ -467,6 +468,7 @@ function convertTileID(tileId, tileset) {
console.warn('GLOBALS.forceMasked: ', GLOBALS.forceMasked);
console.warn('mask_bit: ', mask_bit);
}
*/
// Build up a partial set of control bits
let control_bits = (mask_bit ? GTE_MASK_BIT : 0) + (hflip ? GTE_HFLIP_BIT : 0) + (vflip ? GTE_VFLIP_BIT : 0);
@ -477,6 +479,11 @@ function convertTileID(tileId, tileset) {
const animation = tileset[tileIndex - 1].animation;
tileId = animation.dynTileId;
control_bits = GTE_DYN_BIT;
console.warn('Dyanmic animation tile found!');
console.warn('isSolid: ', tileset[tileIndex - 1].isSolid);
console.warn('dynTileId: ', animation.dynTileId);
console.warn('mask_bit: ', mask_bit);
}
return (tileId & 0x1FFFFFFF) + control_bits;