Initial Tiled tile animation export support

* Tiled tile animations read from TSX files
* Hooks for initialization generated by the tiled export tool
* Animated tiles implements with dynamic tiles backed by 2KB of direct
  page space in Bank 00
* Animation resolution limited to 1/60th incremenents

TODO
* Fix crasher in the _DoScriptSequ timer callback
* Fix single-line of garbage on the top line of the dynamic tiles
This commit is contained in:
Lucas Scharenbroich 2021-10-06 07:10:09 -05:00
parent 7d7a54a731
commit 87ded17e20
23 changed files with 7023 additions and 885 deletions

View File

@ -1,229 +1,220 @@
MoveLeft
clc
adc StartX ; Increment the virtual X-position
jsl SetBG0XPos
adc StartX ; Increment the virtual X-position
jsl SetBG0XPos
lda StartX
lda StartX
lsr
jsl SetBG1XPos
jsl SetBG1XPos
jsl Render
jsl Render
rts
MoveRight
pha
lda StartX
lda StartX
sec
sbc 1,s
bpl *+5
lda #0
jsl SetBG0XPos
sbc 1,s
bpl *+5
lda #0
jsl SetBG0XPos
lda StartX
lda StartX
lsr
jsl SetBG1XPos
jsl SetBG1XPos
jsl Render
jsl Render
pla
rts
MoveUp
clc
adc StartY ; Increment the virtual Y-position
adc StartY ; Increment the virtual Y-position
pha
lda #240 ; virtual play field height
lda #240 ; virtual play field height
sec
sbc ScreenHeight
sbc ScreenHeight
tax
cmp 1,s
bcc *+4
lda 1,s
jsl SetBG0YPos
cmp 1,s
bcc *+4
lda 1,s
jsl SetBG0YPos
pla
; lda StartY
; lsr
; jsl SetBG1YPos
jsl Render
jsl Render
rts
MoveDown
pha
lda StartY
lda StartY
sec
sbc 1,s
bpl *+5
lda #0
jsl SetBG0YPos
sbc 1,s
bpl *+5
lda #0
jsl SetBG0YPos
; lda StartY
; lsr
; jsl SetBG1YPos
jsl Render
jsl Render
pla
rts
; Very simple, scroll as fast as possible
oldOneSecondCounter ds 2
frameCount ds 2
lastTick ds 2
oldOneSecondCounter ds 2
frameCount ds 2
Demo
ldal OneSecondCounter
sta oldOneSecondCounter
stz frameCount
ldal OneSecondCounter
sta oldOneSecondCounter
stz frameCount
; Every 3 ticks (20 fps) cycle some colors
lda #DoColorCycle
ldx #^DoColorCycle
ldy #3
jsl AddTimer
; lda #DoColorCycle
; ldx #^DoColorCycle
; ldy #3
; jsl AddTimer
:loop
PushLong #0
_GetTick
pla
plx
cmp lastTick ; Throttle to 60 fps
beq :loop
tax ; Calculate the increment
sec
sbc lastTick
stx lastTick
; jsr _DoTimers
jsl DoTimers
; lda #1
; jsr MoveLeft
jsr UpdateBG1Rotation
jsr UpdateBG1Rotation
; jsr DoColorCycle
jsl Render
jsl Render
inc frameCount
inc frameCount
ldal KBD_STROBE_REG
bit #$0080
beq :nokey
and #$007F
cmp #'s'
bne :nokey
ldal KBD_STROBE_REG
bit #$0080
beq :nokey
and #$007F
cmp #'s'
bne :nokey
rts
:nokey
ldal OneSecondCounter
cmp oldOneSecondCounter
beq :loop
ldal OneSecondCounter
cmp oldOneSecondCounter
beq :loop
sta oldOneSecondCounter
lda ScreenWidth
cmp #150
bcs :loop
sta oldOneSecondCounter
lda ScreenWidth
cmp #150
bcs :loop
lda #FPSStr
ldx #0 ; top-left corner
ldy #$7777
jsr DrawString
lda #FPSStr
ldx #0 ; top-left corner
ldy #$7777
jsr DrawString
lda frameCount
ldx #4*4
jsr DrawWord
lda frameCount
ldx #4*4
jsr DrawWord
stz frameCount
bra :loop
stz frameCount
bra :loop
FPSStr str 'FPS'
FPSStr str 'FPS'
; Move some colors around color (6 - 11) address 12 - 22
DoColorCycle
ldal $E19E0C
ldal $E19E0C
pha
ldal $E19E0E
ldal $E19E0E
pha
ldal $E19E10
ldal $E19E10
pha
ldal $E19E12
ldal $E19E12
pha
ldal $E19E14
ldal $E19E14
pha
ldal $E19E16
stal $E19E0C
ldal $E19E16
stal $E19E0C
pla
stal $E19E16
stal $E19E16
pla
stal $E19E14
stal $E19E14
pla
stal $E19E12
stal $E19E12
pla
stal $E19E10
stal $E19E10
pla
stal $E19E0E
stal $E19E0E
rts
; Triggered timer to sway the background
UpdateBG1Offset
lda BG1OffsetIndex
lda BG1OffsetIndex
inc
inc
cmp #32 ; 16 entries x 2 for indexing
bcc *+5
sbc #32
sta BG1OffsetIndex
cmp #32 ; 16 entries x 2 for indexing
bcc *+5
sbc #32
sta BG1OffsetIndex
rts
AngleUp
lda angle
lda angle
inc
cmp #64
bcc *+5
sbc #64
sta angle
jsr _ApplyAngle
jsl Render
cmp #64
bcc *+5
sbc #64
sta angle
jsr _ApplyAngle
jsl Render
rts
AngleDown
lda angle
lda angle
dec
bpl *+6
bpl *+6
clc
adc #64
sta angle
jsr _ApplyAngle
jsl Render
adc #64
sta angle
jsr _ApplyAngle
jsl Render
rts
angle dw 0
angle dw 0
UpdateBG1Rotation
jsr _ApplyAngle
jsr _ApplyAngle
; Increment the angle
lda angle
lda angle
inc
cmp #64
bcc *+5
lda #0
sta angle
cmp #64
bcc *+5
lda #0
sta angle
rts
x_angles EXT
y_angles EXT
_ApplyAngle
lda angle ; debug with angle = 0
lda angle ; debug with angle = 0
asl
tax
ldal x_angles,x ; load the address of addressed for this angle
ldal x_angles,x ; load the address of addressed for this angle
tay
phx
jsl ApplyBG1XPosAngle
jsl ApplyBG1XPosAngle
plx
ldal y_angles,x ; load the address of addresses for this angle
ldal y_angles,x ; load the address of addresses for this angle
tay
jsl ApplyBG1YPosAngle
jsl ApplyBG1YPosAngle
rts

View File

@ -8,17 +8,15 @@
use EDS.GSOS.MACS.s
use Tool222.Macs.s
use Util.Macs.s
use CORE.MACS.s
use ../../src/GTE.s
use ../../src/Defs.s
mx %00
; External references
tiledata ext
; Feature flags
NO_INTERRUPTS equ 1 ; turn off for crossrunner debugging
NO_MUSIC equ 1 ; turn music + tool loading off
NO_INTERRUPTS equ 0 ; turn off for crossrunner debugging
NO_MUSIC equ 1 ; turn music + tool loading off
; Typical init
phk
@ -26,60 +24,119 @@ NO_MUSIC equ 1 ; turn music + tool loading of
jsl EngineStartUp
lda #^MyPalette
ldx #MyPalette
ldy #0
jsl SetPalette
ldx #0
jsl SetScreenMode
; Set up our level data
; jsr BG0SetUp
jsr BG0SetUp
; jsr BG1SetUp
jsr TileAnimInit
; Allocate room to load data
jsl AllocBank ; Alloc 64KB for Load/Unpack
sta BankLoad ; Store "Bank Pointer"
jsl AllocBank ; Alloc 64KB for Load/Unpack
sta BankLoad ; Store "Bank Pointer"
; jsr MovePlayerToOrigin ; Put the player at the beginning of the map
jsr MovePlayerToOrigin ; Put the player at the beginning of the map
; lda #DIRTY_BIT_BG0_REFRESH ; Redraw all of the tiles on the next Render
; ora #DIRTY_BIT_BG1_REFRESH
; tsb DirtyBits
lda #DIRTY_BIT_BG0_REFRESH ; Redraw all of the tiles on the next Render
ora #DIRTY_BIT_BG1_REFRESH
tsb DirtyBits
; lda #$FFFF
lda #$FFFF
jsl Render
EvtLoop
jsl ReadControl
and #$007F ; Ignore the buttons for now
and #$007F ; Ignore the buttons for now
cmp #'q'
bne :1
brl Exit
:1 cmp #'l'
tcounter dw 0
tileIDs dw 168,170,172,174,168,170,172,174
dw 169,171,173,175,169,171,173,175
dw 208,210,212,214,208,210,212,214
dw 209,211,213,215,209,211,213,215
;tileIDs dw 1,1,1,1,1,1,1,5
; dw 2,2,2,2,2,2,2,6
; dw 3,3,3,3,3,3,3,7
; dw 4,4,4,4,4,4,4,8
:1
cmp #'r'
bne EvtLoop
jsl DoTimers
inc tcounter
lda tcounter
and #$0007
asl
tay
lda tileIDs,y
pha
lda tileIDs+16,y
pha
lda tileIDs+32,y
pha
ldx tileIDs+48,y
inx
ldy #3
jsl CopyTileToDyn
plx
inx
ldy #2
jsl CopyTileToDyn
plx
inx
ldy #1
jsl CopyTileToDyn
plx
inx
ldy #0
jsl CopyTileToDyn
jsl Render
brl EvtLoop
cmp #'l'
bne :1_1
jsr DoLoadFG
bra EvtLoop
brl EvtLoop
:1_1 cmp #'b'
bne :2
jsr DoLoadBG1
bra EvtLoop
brl EvtLoop
:2 cmp #'m'
bne :3
jsr DumpBanks
bra EvtLoop
brl EvtLoop
:3 cmp #'f' ; render a 'f'rame
:3 cmp #'f' ; render a 'f'rame
bne :4
jsl Render
bra EvtLoop
brl EvtLoop
:4 cmp #'h' ; Show the 'h'eads up display
:4 cmp #'h' ; Show the 'h'eads up display
bne :5
jsr DoHUP
bra EvtLoop
brl EvtLoop
:5 cmp #'1' ; User selects a new screen size
:5 cmp #'1' ; User selects a new screen size
bcc :6
cmp #'9'+1
bcs :6
@ -95,7 +152,7 @@ EvtLoop
jsr DoTiles
brl EvtLoop
:7 cmp #$15 ; left = $08, right = $15, up = $0B, down = $0A
:7 cmp #$15 ; left = $08, right = $15, up = $0B, down = $0A
bne :8
lda #1
jsr MoveRight
@ -146,18 +203,20 @@ Exit
bcs Fatal
Fatal brk $00
MyPalette dw $0E51,$0EDA,$0000,$068F,$0BF1,$00A0,$0EEE,$0777,$0FA4,$0F59,$0F31,$02E3,$09B9,$01CE,$0EE6
StartMusic
pea #^MusicFile
pea #MusicFile
_NTPLoadOneMusic
pea $0001 ; loop
pea $0001 ; loop
_NTPPlayMusic
rts
; Position the screen with the botom-left corner of the tilemap visible
MovePlayerToOrigin
lda #0 ; Set the player's position
lda #0 ; Set the player's position
jsl SetBG0XPos
lda #0
jsl SetBG1XPos
@ -199,8 +258,8 @@ DoHUP
ldx #{160-12*4}
ldy #$7777
jsr DrawString
lda OneSecondCounter ; Number of elapsed seconds
ldx #{160-4*4} ; Render the word 4 charaters from right edge
lda OneSecondCounter ; Number of elapsed seconds
ldx #{160-4*4} ; Render the word 4 charaters from right edge
jsr DrawWord
lda #TicksStr
@ -221,7 +280,7 @@ DoTiles
:column equ 3
:tile equ 5
pea $0000 ; Allocate local variable space
pea $0000 ; Allocate local variable space
pea $0000
pea $0000
@ -251,7 +310,7 @@ DoTiles
cmp #26
bcc :rowloop
pla ; restore the stack
pla ; restore the stack
pla
pla
rts
@ -284,7 +343,7 @@ DoLoadFG
ldx #FGName
jsr LoadFile
ldx BankLoad ; Copy it into the code field
ldx BankLoad ; Copy it into the code field
lda #0
jsl CopyBinToField
rts
@ -292,10 +351,10 @@ DoLoadFG
; Load a simple picture format onto the SHR screen
DoLoadPic
lda BankLoad
ldx #ImageName ; Load+Unpack Boot Picture
jsr LoadPicture ; X=Name, A=Bank to use for loading
ldx #ImageName ; Load+Unpack Boot Picture
jsr LoadPicture ; X=Name, A=Bank to use for loading
ldx BankLoad ; Copy it into the code field
ldx BankLoad ; Copy it into the code field
lda #0
jsl CopyPicToField
rts
@ -336,43 +395,43 @@ DefaultPalette dw $0E51,$0EDB,$0000,$068F,$0BF1,$00A0,$0EEE,$0777,$
; Graphics helpers
LoadPicture
jsr LoadFile ; X=Nom Image, A=Banc de chargement XX/00
jsr LoadFile ; X=Nom Image, A=Banc de chargement XX/00
bcc :loadOK
rts
:loadOK
jsr UnpackPicture ; A=Packed Size
jsr UnpackPicture ; A=Packed Size
rts
UnpackPicture sta UP_PackedSize ; Size of Packed Data
lda #$8000 ; Size of output Data Buffer
UnpackPicture sta UP_PackedSize ; Size of Packed Data
lda #$8000 ; Size of output Data Buffer
sta UP_UnPackedSize
lda BankLoad ; Banc de chargement / Decompression
sta UP_Packed+1 ; Packed Data
lda BankLoad ; Banc de chargement / Decompression
sta UP_Packed+1 ; Packed Data
clc
adc #$0080
stz UP_UnPacked ; On remet a zero car modifie par l'appel
stz UP_UnPacked ; On remet a zero car modifie par l'appel
stz UP_UnPacked+2
sta UP_UnPacked+1 ; Unpacked Data buffer
sta UP_UnPacked+1 ; Unpacked Data buffer
PushWord #0 ; Space for Result : Number of bytes unpacked
PushLong UP_Packed ; Pointer to buffer containing the packed data
PushWord UP_PackedSize ; Size of the Packed Data
PushLong #UP_UnPacked ; Pointer to Pointer to unpacked buffer
PushLong #UP_UnPackedSize ; Pointer to a Word containing size of unpacked data
PushWord #0 ; Space for Result : Number of bytes unpacked
PushLong UP_Packed ; Pointer to buffer containing the packed data
PushWord UP_PackedSize ; Size of the Packed Data
PushLong #UP_UnPacked ; Pointer to Pointer to unpacked buffer
PushLong #UP_UnPackedSize ; Pointer to a Word containing size of unpacked data
_UnPackBytes
pla ; Number of byte unpacked
pla ; Number of byte unpacked
rts
UP_Packed hex 00000000 ; Address of Packed Data
UP_PackedSize hex 0000 ; Size of Packed Data
UP_UnPacked hex 00000000 ; Address of Unpacked Data Buffer (modified)
UP_UnPackedSize hex 0000 ; Size of Unpacked Data Buffer (modified)
UP_Packed hex 00000000 ; Address of Packed Data
UP_PackedSize hex 0000 ; Size of Packed Data
UP_UnPacked hex 00000000 ; Address of Unpacked Data Buffer (modified)
UP_UnPackedSize hex 0000 ; Size of Unpacked Data Buffer (modified)
; Basic I/O function to load files
LoadFile
stx openRec+4 ; X=File, A=Bank (high word) assumed zero for low
stx openRec+4 ; X=File, A=Bank (high word) assumed zero for low
stz readRec+4
sta readRec+6
jsr ClearBankLoad
@ -394,7 +453,7 @@ LoadFile
:closeFile _CloseGS closeRec
clc
lda eofRec+4 ; File Size
lda eofRec+4 ; File Size
rts
:openReadErr jsr :closeFile
@ -427,22 +486,22 @@ BG1AltDataFile strl '1/bg1b.bin'
ImageName strl '1/test.pic'
FGName strl '1/fg1.bin'
openRec dw 2 ; pCount
ds 2 ; refNum
adrl FGName ; pathname
openRec dw 2 ; pCount
ds 2 ; refNum
adrl FGName ; pathname
eofRec dw 2 ; pCount
ds 2 ; refNum
ds 4 ; eof
eofRec dw 2 ; pCount
ds 2 ; refNum
ds 4 ; eof
readRec dw 4 ; pCount
ds 2 ; refNum
ds 4 ; dataBuffer
ds 4 ; requestCount
ds 4 ; transferCount
readRec dw 4 ; pCount
ds 2 ; refNum
ds 4 ; dataBuffer
ds 4 ; requestCount
ds 4 ; transferCount
closeRec dw 1 ; pCount
ds 2 ; refNum
closeRec dw 1 ; pCount
ds 2 ; refNum
qtRec adrl $0000
da $00
@ -454,6 +513,66 @@ qtRec adrl $0000
PUT gen/App.TileMapBG0.s
PUT gen/App.TileMapBG1.s
PUT gen/App.TileSetAnim.s

View File

@ -2,4 +2,36 @@
<tileset version="1.5" tiledversion="1.7.2" name="App.TileSet" tilewidth="8" tileheight="8" tilecount="1000" columns="40">
<transformations hflip="1" vflip="1" rotate="0" preferuntransformed="0"/>
<image source="../tilesets/smb-16.png" trans="6b8cff" width="320" height="200"/>
<tile id="168">
<animation>
<frame tileid="168" duration="256"/>
<frame tileid="170" duration="256"/>
<frame tileid="172" duration="256"/>
<frame tileid="174" duration="256"/>
</animation>
</tile>
<tile id="169">
<animation>
<frame tileid="169" duration="256"/>
<frame tileid="171" duration="256"/>
<frame tileid="173" duration="256"/>
<frame tileid="175" duration="256"/>
</animation>
</tile>
<tile id="208">
<animation>
<frame tileid="208" duration="256"/>
<frame tileid="210" duration="256"/>
<frame tileid="212" duration="256"/>
<frame tileid="214" duration="256"/>
</animation>
</tile>
<tile id="209">
<animation>
<frame tileid="209" duration="256"/>
<frame tileid="211" duration="256"/>
<frame tileid="213" duration="256"/>
<frame tileid="215" duration="256"/>
</animation>
</tile>
</tileset>

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<export target="world_1-1.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="Overworld.tsx"/>
<layer id="3" name="App.TileMapBG1" width="256" height="30" parallaxx="0.5" parallaxy="0.5">
<layer id="3" name="App.TileMapBG1" width="256" height="30" locked="1" parallaxx="0.5" parallaxy="0.5">
<data encoding="csv">
41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
@ -38,7 +38,7 @@
41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41
</data>
</layer>
<layer id="1" name="App.TileMapBG0" width="256" height="30" visible="0" locked="1">
<layer id="1" name="App.TileMapBG0" width="256" height="30">
<data encoding="csv">
41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
@ -64,8 +64,8 @@
41,41,41,41,57,58,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,15,16,17,18,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
41,41,41,56,21,62,59,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,11,12,13,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
41,41,56,21,21,21,21,59,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,57,2147483705,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,15,16,17,18,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
41,56,21,62,21,21,62,21,59,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,42,43,42,43,42,43,41,41,41,56,21,62,2147483704,41,41,41,41,41,41,41,41,41,41,41,42,43,41,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,41,42,43,42,43,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
56,21,21,21,21,21,21,21,21,59,41,41,41,41,41,41,41,41,41,41,41,41,41,44,45,45,45,45,45,45,46,41,56,21,21,21,21,2147483704,41,41,41,41,41,41,41,41,41,44,45,45,46,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,44,45,45,45,45,46,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
41,56,21,62,21,21,62,21,59,41,41,41,169,170,169,170,169,170,169,170,169,170,41,41,42,43,42,43,42,43,41,41,41,56,21,62,2147483704,41,41,41,41,41,41,41,41,41,41,41,42,43,41,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,41,42,43,42,43,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
56,21,21,21,21,21,21,21,21,59,41,41,209,210,209,210,209,210,209,210,209,210,41,44,45,45,45,45,45,45,46,41,56,21,21,21,21,2147483704,41,41,41,41,41,41,41,41,41,44,45,45,46,41,41,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,19,20,21,22,41,41,41,44,45,45,45,45,46,41,41,41,19,20,21,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,
1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,
3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,
1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -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,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$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,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$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,$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,$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 $1038,$0015,$0015,$0015,$0015,$0015,$0015,$0015,$0015,$103b,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$1029,$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,$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 $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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
TileAnimInit ENT
ldx #168
ldy #0
jsl CopyTileToDyn
ldx #169
ldy #1
jsl CopyTileToDyn
ldx #208
ldy #2
jsl CopyTileToDyn
ldx #209
ldy #3
jsl CopyTileToDyn
lda #TileAnim_168
ldx #^TileAnim_168
ldy #15
jsl StartScript
lda #TileAnim_169
ldx #^TileAnim_169
ldy #15
jsl StartScript
lda #TileAnim_208
ldx #^TileAnim_208
ldy #15
jsl StartScript
lda #TileAnim_209
ldx #^TileAnim_209
ldy #15
jsl StartScript
rts
TileAnim_168
dw $8006,168,0,0
dw $8006,170,0,0
dw $8006,172,0,0
dw $cd06,174,0,0
TileAnim_169
dw $8006,169,1,0
dw $8006,171,1,0
dw $8006,173,1,0
dw $cd06,175,1,0
TileAnim_208
dw $8006,208,2,0
dw $8006,210,2,0
dw $8006,212,2,0
dw $cd06,214,2,0
TileAnim_209
dw $8006,209,3,0
dw $8006,211,3,0
dw $8006,213,3,0
dw $cd06,215,3,0

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-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:tiles": "node %npm_package_config_png2iigs% ./assets/tilesets/smb-16.png --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 224 --as-tile-data --transparent-color-index 3 > ./gen/App.TileSet.s"
},
"repository": {
"type": "git",

View File

@ -119,6 +119,15 @@ min mac
lda ]1
mout <<<
; Macro to define script steps
ScriptStep MAC
IF #=]5
dw {]1+{{]5&#$000F}<<8}},]2,]3,]4
ELSE
dw ]1,]2,]3,]4
FIN
<<<
; Macros to use in the Masked Tile renderer
;
; ]1 : tiledata offset
@ -174,3 +183,14 @@ transparent
sta: ]3+1,y
next
eom

View File

@ -39,28 +39,12 @@ AnimatePath
; at a time . The slope of the lines are (X1 - X0) / Duration and (Y1 - Y0) / Duration.
;
; The tricky bit is that we *always* single-step in the "Y" direction (duration), so we
; actaully need to use two differenct algorithms.
; actually need to use two differenct algorithms.
;
; If |X1 - X0| <= Duration, use a standard line-drawing approach (Bresenham's, DDA, etc.)
; If |X1 - X0| <= Duration, use a standard Bresenham's
; If |X1 - X0| > Duration, use the Run-Length Slice algorithm (https://www.phatcode.net/res/224/files/html/ch36/36-02.html)
lda AnimX1
lda AnimY
:stepx lda
cmp AnimDuration ; Handle the two cases

View File

@ -109,3 +109,13 @@ DIRTY_BIT_BG1_X equ $0004
DIRTY_BIT_BG1_Y equ $0008
DIRTY_BIT_BG0_REFRESH equ $0010
DIRTY_BIT_BG1_REFRESH equ $0020
; Script definition
YIELD equ $8000
JUMP equ $4000
SET_PALETTE_ENTRY equ $0002
SWAP_PALETTE_ENTRY equ $0004
SET_DYN_TILE equ $0006
CALLBACK equ $0010

View File

@ -7,12 +7,18 @@ EngineShutDown EXT
SetScreenMode EXT
ReadControl EXT
; Low-Level Functions
SetPalette EXT
GetVBLTicks EXT
; Tilemap functions
SetBG0XPos EXT
SetBG0YPos EXT
SetBG1XPos EXT
SetBG1YPos EXT
CopyBG0Tile EXT
CopyBG1Tile EXT
CopyTileToDyn EXT
Render EXT
; Rotation
@ -40,3 +46,6 @@ ScreenAddr EXT
OneSecondCounter EXT
BlitBuff EXT

View File

@ -1,123 +1,153 @@
; Graphic screen initialization
InitGraphics
jsr ShadowOn
jsr GrafOn
lda #0
jsr ClearToColor
lda #0
jsr SetSCBs
ldx #DefaultPalette
lda #0
jsr SetPalette
jsr _ShadowOn
jsr _GrafOn
lda #0
jsr _ClearToColor
lda #0
jsr _SetSCBs
ldx #DefaultPalette
lda #0
jsr _SetPalette
jsr _InitBG0 ; Initialize the background layers
jsr _InitBG1
jsr _InitBG0 ; Initialize the background layers
jsr _InitBG1
lda #0
jsr _ClearBG1Buffer
lda #0
jsr _ClearBG1Buffer
rts
rts
DefaultPalette dw $0000,$007F,$0090,$0FF0
dw $000F,$0080,$0f70,$0FFF
dw $0fa9,$0ff0,$00e0,$04DF
dw $0d00,$078f,$0ccc,$0FFF
DefaultPalette dw $0000,$007F,$0090,$0FF0
dw $000F,$0080,$0f70,$0FFF
dw $0fa9,$0ff0,$00e0,$04DF
dw $0d00,$078f,$0ccc,$0FFF
; Return the current border color ($0 - $F) in the accumulator
GetBorderColor lda #0000
sep #$20
ldal BORDER_REG
and #$0F
rep #$20
rts
_GetBorderColor lda #0000
sep #$20
ldal BORDER_REG
and #$0F
rep #$20
rts
; Set the border color to the accumulator value.
SetBorderColor sep #$20 ; ACC = $X_Y, REG = $W_Z
eorl BORDER_REG ; ACC = $(X^Y)_(Y^Z)
and #$0F ; ACC = $0_(Y^Z)
eorl BORDER_REG ; ACC = $W_(Y^Z^Z) = $W_Y
stal BORDER_REG
rep #$20
rts
SetBorderColor ENT
jsr _SetBorderColor
rtl
_SetBorderColor sep #$20 ; ACC = $X_Y, REG = $W_Z
eorl BORDER_REG ; ACC = $(X^Y)_(Y^Z)
and #$0F ; ACC = $0_(Y^Z)
eorl BORDER_REG ; ACC = $W_(Y^Z^Z) = $W_Y
stal BORDER_REG
rep #$20
rts
; Clear to SHR screen to a specific color
ClearToColor ldx #$7D00 ;start at top of pixel data! ($2000-9D00)
:clearloop dex
dex
stal SHR_SCREEN,x ;screen location
bne :clearloop ;loop until we've worked our way down to 0
rts
_ClearToColor
ldx #$7D00 ;start at top of pixel data! ($2000-9D00)
:clearloop dex
dex
stal SHR_SCREEN,x ;screen location
bne :clearloop ;loop until we've worked our way down to 0
rts
; Set a palette values
; A = palette number, X = palette address
SetPalette
and #$000F ; palette values are 0 - 15 and each palette is 32 bytes
asl
asl
asl
asl
asl
txy
tax
; A = high word of palette data pointer, X = low word of palette data pointer, Y = palette number
SetPalette ENT
phb ; save old data bank
pha ; push 16-bit value
plb ; pop 8-bit bank register
tya
jsr _SetPalette
plb ; pop the other half og the 16-bit push off
plb ; restore the original data bank
rtl
]idx equ 0
lup 16
lda: $0000+]idx,y
stal SHR_PALETTES+]idx,x
]idx equ ]idx+2
--^
rts
; A = palette number, X = palette address
_SetPalette
and #$000F ; palette values are 0 - 15 and each palette is 32 bytes
asl
asl
asl
asl
asl
txy
tax
]idx equ 0
lup 16
lda: $0000+]idx,y
stal SHR_PALETTES+]idx,x
]idx equ ]idx+2
--^
rts
; Initialize the SCB
SetSCBs ldx #$0100 ;set all $100 scbs to A
:scbloop dex
dex
stal SHR_SCB,x
bne :scbloop
rts
_SetSCBs
ldx #$0100 ;set all $100 scbs to A
:scbloop dex
dex
stal SHR_SCB,x
bne :scbloop
rts