diff --git a/demos/shell/assets/tilesets/smb-256-128-1bpp.png b/demos/shell/assets/tilesets/smb-256-128-1bpp.png new file mode 100644 index 0000000..97feb8a Binary files /dev/null and b/demos/shell/assets/tilesets/smb-256-128-1bpp.png differ diff --git a/demos/shell/assets/tilesets/smb-256-128-4bpp.png b/demos/shell/assets/tilesets/smb-256-128-4bpp.png index 406e577..82de535 100644 Binary files a/demos/shell/assets/tilesets/smb-256-128-4bpp.png and b/demos/shell/assets/tilesets/smb-256-128-4bpp.png differ diff --git a/demos/sprites/App.Main.s b/demos/sprites/App.Main.s index de18de2..4da05e1 100644 --- a/demos/sprites/App.Main.s +++ b/demos/sprites/App.Main.s @@ -35,7 +35,7 @@ DOWN_ARROW equ $0A ldy #0 jsl SetPalette - ldx #0 ; Mode 0 is full-screen + ldx #5 ; Mode 0 is full-screen, mode 5 is 256x160 jsl SetScreenMode ; Set up our level data @@ -48,6 +48,51 @@ DOWN_ARROW equ $0A sta oldOneSecondCounter jsr UdtOverlay +; Allocate a buffer for loading files + jsl AllocBank ; Alloc 64KB for Load/Unpack + sta BankLoad ; Store "Bank Pointer" + +; Load in the 256 color background into BG1 buffer +DoLoadBG1 + lda BankLoad + ldx #BG1DataFile + jsr LoadFile + + ldx BankLoad + lda #0 + ldy BG1DataBank + jsl CopyPicToBG1 + +; Copy the palettes into place + + stz tmp0 +:ploop + lda tmp0 + tay + asl + asl + asl + asl + asl + clc + adc #$7E00 + tax + + lda BankLoad + jsl SetPalette + + inc tmp0 + lda tmp0 + cmp #16 + bcc :ploop + +; Bind the SCBs + + lda BankLoad + ora #$8000 ; set high bit to bind to BG1 Y-position + ldx #$7D00 + jsl SetSCBArray + ; Initialize the sprite's global position (this is tracked outside of the tile engine) lda #16 sta PlayerGlobalX @@ -70,7 +115,7 @@ DOWN_ARROW equ $0A brl Exit ; If we could not allocate a sprite, exit :sprite_ok - sta PlayerID +; sta PlayerID ; Draw the initial screen @@ -236,7 +281,12 @@ Exit bcs Fatal Fatal brk $00 -MyPalette dw $068F,$0EDA,$0000,$0E51,$0BF1,$00A0,$0EEE,$0456,$0FA4,$0F59,$0E30,$01CE,$02E3,$0870,$0F93,$0FD7 +BG1DataFile strl '1/octane.c1' + +; Color palette +; MyPalette dw $068F,$0EDA,$0000,$0E51,$0BF1,$00A0,$0EEE,$0456,$0FA4,$0F59,$0E30,$01CE,$02E3,$0870,$0F93,$0FD7 +; B&W Palette +MyPalette dw $0000,$0EDA,$0000,$0E51,$0BF1,$00A0,$0EEE,$0456,$0FA4,$0F59,$0E30,$01CE,$02E3,$0870,$0F93,$0FFF PlayerGlobalX ds 2 PlayerGlobalY ds 2 @@ -327,6 +377,10 @@ UpdateCameraPos bcc :y_ok lda MaxBG0Y :y_ok jsl SetBG0YPos + + lda StartY + lsr + jsl SetBG1YPos rts ; Convert the global coordinates to adjusted local coordinated (compensating for wrap-around) @@ -359,6 +413,7 @@ UpdatePlayerPos adc #16 tay jsr GetTileAt + and #$1FF cmp #EMPTY_TILE beq :no_ground_check @@ -466,11 +521,76 @@ MovePlayerToOrigin jsl SetBG0YPos rts +openRec dw 2 ; pCount + ds 2 ; refNum + adrl BG1DataFile ; pathname + +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 + +closeRec dw 1 ; pCount + ds 2 ; refNum + qtRec adrl $0000 da $00 vsync dw $0000 + +LoadFile + stx openRec+4 ; X=File, A=Bank (high word) assumed zero for low + stz readRec+4 + sta readRec+6 + +:openFile _OpenGS openRec + bcs :openReadErr + lda openRec+2 + sta eofRec+2 + sta readRec+2 + + _GetEOFGS eofRec + lda eofRec+4 + sta readRec+8 + lda eofRec+6 + sta readRec+10 + + _ReadGS readRec + bcs :openReadErr + +:closeFile _CloseGS closeRec + clc + lda eofRec+4 ; File Size + rts + +:openReadErr jsr :closeFile + nop + nop + + PushWord #0 + PushLong #msgLine1 + PushLong #msgLine2 + PushLong #msgLine3 + PushLong #msgLine4 + _TLTextMountVolume + pla + cmp #1 + bne :loadFileErr + brl :openFile +:loadFileErr sec + rts + +msgLine1 str 'Unable to load File' +msgLine2 str 'Press a key :' +msgLine3 str ' -> Return to Try Again' +msgLine4 str ' -> Esc to Quit' + PUT ../shell/Overlay.s PUT gen/App.TileMapBG0.s PUT gen/App.TileSetAnim.s diff --git a/demos/sprites/assets/_FileInformation.txt b/demos/sprites/assets/_FileInformation.txt new file mode 100644 index 0000000..1910ea9 --- /dev/null +++ b/demos/sprites/assets/_FileInformation.txt @@ -0,0 +1,4 @@ +mario1.c1=Type(C1),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000) +octane.c1=Type(C1),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000) +pix.forest.c1=Type(C1),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000) +sunset.c1=Type(C1),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000) diff --git a/demos/sprites/assets/mario1.c1 b/demos/sprites/assets/mario1.c1 new file mode 100644 index 0000000..85c79c7 --- /dev/null +++ b/demos/sprites/assets/mario1.c1 @@ -0,0 +1,5 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB$$$$$$$$)ˈT$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB$$$$$$+T$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$BBBBBCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB$$$$$?$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$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FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddeuddddddddddddddddddddddddddVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWVVVVVVVVVVVVVVVVVVVVVVVVeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeieeeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffYfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffifffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffYVffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffyfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffY3##:Vffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffy""""#vffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\""""""#;Vffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffy"""""""""vffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\3""""""""""#;vffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffy"""""""""""""ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffz3""""""""""""""#;ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffz""""""""""""""""";ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffz2""""""""""""""""""";ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff""""""""""""""""""""";ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2""""""""""""""""""""""";ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2""""""""""""""""""""""""";fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffg2""""""""""""""""""""""""""";ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2""""""""""""""""""""""""""""";ffffhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgwwwwwwwwwwwwwwwwwwwwwwwwwwwwhhhhhhhhhhhhhhhg2""""""""""""""""""""""""""""""";hhhv2""""""""""""""""""""""""""""""""":hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgxhhhhhhhhhhg""""""""""""""""""""""""""""""""""""+hdž2""""""""""""""""""""""""""""""""""""":hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgxhhhhhhhg""""""""""""""""""""""""""""""""""""""""+dž˻2"""""""""""""""""""""""""""""""""""""""""3hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgxhhhhg""""""""""""""""""""""""""""""""""""""""""""+Ɔ˻2"""""""""""""""""""""""""""""""""""""""""""""3hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhohhi""""""""""""""""""""""""""""""""""""""""""""""""+̆""""""""""""""""""""""""""""""""""""""""""""""""""3hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhy""""""""""""""""""""""""""""""""""""""""""""""""""""*VFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF]yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy{3Dddddddddddddd"""dddddddddd#$dddddddddddddddddddddddddddVFFFFFFFFFFFFFB""""FFFFFFFB"""&FFFFFFFFFFFFFFFFFFFFFFFFFFyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy{ddddddddddddddd""""ddddddd""""ddddddddddddddddddddddddddFFFFFFFFFFFFFFFB"""!&FFFFFB"""!6FFFFFFFFFFFFFFFFFFFFFFFFFyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy{dddddddddddddddd""""!ddddd""""!$dddddddddddddddddddddddddFFFFFFFFFFFFFFFFB""""&FFFFB""""!&FFFFFFFFFFFFFFFFFFFFFFFFFyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyydddddddddddddddddb""""ddddb""""$dddddddddddddddddddddddddFFFFFFFFFFFFFFFFFFB"""!&FFFFB"""!&FFFFFFFFFFFFFFFFFFFFFFFFFdddddddddddddddddddb"""$ddddb"""$dddddddddddddddddddddddddFFFFFFFFFFFFFFFFFFFFB"!FFFFFB""!FFFFFFFFFFFFFFFFFFFFFFFFFFdddddddddddddddddddddd"dddddb"ddddddddddddddddddddddddddFFFFFFFFFFFFFFFFFFFFFFF1FFFFFFF!&FFFFFFFFFFFFFFFFFFFFFFFFFFUddddddddddddddddddddddddd"$dddddddbdddddddddddddddddddddddddddFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF""FFFFFFFFFFFFFFFFFFFFFFFFFFFFTddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddVFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFTdddddddddddddddddddddddddddddddddddddddddddddddddd""$dddddddddddddddddddVFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF""""FFFFFFFFFFFFFFFFFFFTddddddddddddddddddddddddddddddddddddddddddddddddddb"""$ddddddddddddddddddVFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF""""FFFFFFFFFFFFFFFFFFTdddddddddddddddddddddddddddddddddddddddddddddddddddb""""ddddddddddddddddddVFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2"""!FFFFFFFFFFFFFFFFFFDddddddddddddddddddddddddddddddddddddddddddddddddddddd""""ddddddddddddddddddVFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"""!FFFFFFFFFB26FFFFFFDddddddddddddddddddddddddddddddddddddddddddddddddddddddd"""dddddddd""""ddddddVFFFFFFFFB2FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF""!&FFFFFFFB"""!&FFFFFDdddddddd""""$dddddddddddddddddddddddddddddddddddddddddddd"!$ddddddd""""!dddddFFFFFFFFB"""B""&FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB"FFFFFFFF""""!FFFFFddddddddd"$dddd""$ddddddddddddddddddddddddddddddddddddddddddd"ddddddddb""""$ddddFFFFFFFFFB"FFFFFFB"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBBFFFFFFFFFB"""!6FFFFdddddddddd"$ddddddd"$dddddddddddddddddddddddddddddddddddddddddddddddddddddd""""$ddddFFFFFFFFFFB"FFB2"FFFB&FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"""!FFFFFddddddddddd"$dc!$dd"dddddddddddddddddddddddddddddddddddddddddddddddddddddd"""dddddFFFFFFFFFFFB"FF!6FB&FFFFFFFFFFFB""FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB"!FFFFFdddddddddddd"$dbdd"ddddddddddb"""$ddddddddddddddddddddddddddddddddddddddc$dddddFFFFFFFFFFFFB"FF!6F2&FFFFFFFFF"""!FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1&FFFFFFddddddddddddd"$dbdc"ddddddddb"""!ddddddddddddddddddddddddddddddddddddddddc"$dddddddFFFFFFFFFFFFFB"FF!FF2&FFFFFFF""""!&FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF݇gggggggggggggg37gC""""""""""'gc3ggggggd3333""7ggggggggggggggggggggggggggggggggggggggggggggggggg݆vvvvvvvvvvvvvvs3vt2"""""""""""vv36vvvvvs3332""6vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv݇ggggggggggggggg37gC""""""""""""7gc3gggggC333"""7ggggggggggggggggggggggggggggggggggggggggggggggggg݆vvvvvvvvvvvvvvvs4vt2""""""""""""#vv3vvvvvs332"""vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvwgggggggggggggggg3GgC""""""""""""""7gC7gggg333"""#gggggggggggggggggggggggggggggggggggggggggggggggggg؆vvvvvvvvvvvvvvvvs4vs2""""""""""""""#vt3vvvvs32"""#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvwggggggggggggggggg3Gg2""""""""""""""""7gC7gggg""""#7gggggggggggggggggggggggggggggggggggggggggggggggggg؆vvvvvvvvvvvvvvvvvs4vs"""""""""""""""""#vt3vvvvs"""3vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvwgggggggggggggggggg3Gg2""""""""""""""""""7g37ggggg44ggggggggggggggggggggggggggggggggggggggggggggggggggggvvvvvvvvvvvvvvvvvvvs4vs"""""""""""""""""""3vs3vvvvvvvvvvvvvvvvvvvvvvvvvvtvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvwggggggggggggggggggg3Gg2"""""""""""""""""""#7g37gggggggggggggggggggggggg333Gggggggggggggggggggggggggggggggvvvvvvvvvvvvvvvvvvvvs4vs2""""""""""""""""""""4vs3vvvvvvvvvvvvvvvvvvs33vv33323vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvwgggggggggggggggggggg3Gg2"""""""""""""""""""""#Gg37gggggggggggggggg2%UU"33332"7gggggg3##7ggggggggggggggggvvvvvvvvvvvvvvvvvvvvvs4vs"""""""""""""""""""""""4vs3vvvvvvvvvvvvvvt1UUUUUQ3331UUURvvvvt2UUR!Fvvvvvvvvvvvvvvsgggggggggggggggggggggg3Gg2"""""""""""""""""""""""#gg37gggggggggggggBUUUUUUU#33%UUUU!Gggg2%UUU"ggggggggggggg33vvvvvvvvvvvvs33vvvvvvvs4vs"""""""""""""""""""""""""6vs3vvvvvvvvvvvvt%UUUUUUU#3"UUUUURvvr%UUUURQvvvvvvvvvvvvs34݈gggggggggggg33337gggggg3Gg2"""""""""""""""""""""""""#gg37gggggg3"##7BUUUUUUUU#2%UUUUUU#ggUUUUUU"7gggggggggg337gvvvvvvvvvvvvs3332#vvvvvs6vs"""""""""""""""""""""""""""6vs3vvvvvs%UUU"%UUUUUUUUR2UUUUUUU!vqUUUUUURR6vvvvvvvvvs34vv݈ggggggggggggg33332#ggggg3gg2"""""""""""""""""""""""""""#gg37gggd%UUUUUUUUUUUUUURUUUUUUUR7UUUUUUU"'ggggggggC37gggvvvvvvvvvvvvvt33332"Fvvvs6vs"""""""""""""""""""""""""""""Fvs3vvv2UUUUUUUUUUUUUUUQ%UUUUUUUR2UUUUUUURR6vvvvvvvs34vvt2݈ggggggggggggggc3333""7ggg3gg2"""""""""""""""""""""""""""""'gg37gC%UUUUUUUUUUUUUUUQUUUUUUUURUUUUUUUU!GggggggC37ggg3"vvvvvvvvvvvvvvvs3332""6vvs6vs"""""""""""""""""""""""""""""""vvs3t%UUUUUUUUUUUUUUUURUUUUUUUU%UUUUUUUR#vvvvvvs34vvt2""ggggggggggggggggD$$$"""Ggg$gg""""""""""""""""""""""""""""""""'gg$B55UUUUUUUUUUUUUUU35UUU\UU55UUUUUUU3D!&gd$GgggB"""vvvvvvvvvvvvvvvvvrBB""""vvrFvr"""""""""""""""""""""""""""""""""vvr#SUUUUUUUUUUUUUUUSSUUUU|UUSUUUUUUUS2332"BFvvvB""""ggggggggggggggggggD$""""$gg$gg""""""""""""""""""""""""""""""""""$B"%5UUUUUUUUUUUUUUUU5UUUluUUUUUUUUUU"55533"gggB"""""vvvvvvvvvvvvvvvvvvvrB""""$vrFvr"""""""""""""""""""""""""""""""""!#33SUUUUUUUUUUUUUUUUSUUUweUUUUUUUUS3UUUSS2!vvB""""""wggggggggggggggggggggg"""""Gd$gg""""""""""""""""""""""""""""""""""5555UUUUUUUUUUUUUUUUUUleUUUUUUUUU5UUUUU3"'B"""""""vvvvvvvvvtttvvvvvvvvvvt"""FvBFvr"""""""""""""""""""""""""""""""""!3SUUSUUWuUUUUUUUUUUUUUUWeUUUUUUUUUUUUUUUUS2"""""""""wgggggggggg$$$'gggggggggggGGgd$gg""""""""""""""""""""""""""""""""""5UUUUUU[UUUUUUUUUUUUUUU\eUUUUUUUUUUUUUUUUUU3!"""vvvvvvvvvvrBBB"vvvvvvvvvvvvvvBFvr""""""""""""""""""""""""""""""""""#UUUUUUWuUUUUUUUUUUUUUVuUUUUUUUUUUUUUUUUUUS22"222!"""wggggggggggg$$$""Gggggggggggggd$gg"""""""""""""""""""""""""""""""""""%5UUUUUuUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU3#####"""vvvvvvvvvvvvrBBBB"&vvvvvvvvvvvvBFvr"""""""""""""""""""""""""""""""""""#UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUSS333222!""wgggggggggggg$$$$""'gggggggggggd$gg""""""""""""""""""""""""""""""""""""5UUU[UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU5533#""vvvvvvvvvvvvvtBBBB""&vvvvvvvvvvvBFvr""""""""""""""""""""""""""""""""""""UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVUUUUUUSSSS22!"wgggggggggggggd$$$"""'ggggggggggd$gg""""""""""""""""""""""""""""""""""""35UUUU[UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU|UUUUUUU5553#"vvvvvvvvvvvvvvvtBBB"""FvvvvvvvvvvBFvr"""""""""""""""""""""""""""""""""""3SUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUWuUUUUUUSSSS22wgggggggggggggggd$$""""Ggggggggggd$gg"""""""""""""""""""""""""""""""""""!55UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU|UUUUUUU553##vvvvvvvvvvvvvvvvvtB"""""vvvvvvvvvvBFvr""""""""""""""""""""""""""""""""""!#SUUUUUUUUuUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU|UUUUUUSSS22!wggggggggggggggggggB""""'gggggggggd$gg"""""""""""""""""""""""""""""""""""!55UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUluUUUUUU553##!vvvvvvvvvvvvvvvvvvvvt"""$vvvvvvvvvvBFvr""""""""""""""""""""""""""""""""""""SUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU|UUUUUUUSSS22!gggggggggggggggggggggggDDggggggggggd$gg""""""""""""""""""""""""""""""""""""55UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUWeUUUUUUU553##!vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvBFvr""""""""""""""""""""""""""""""""""""SUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUWUUUUUUUUSS222!""""""""""""""33333333333333333333333333333333333333333333#3333333331TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEETTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE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S3333DD333DTTTS3333DC333DTTTS3333DT333DTTTT3333DTC33DTTTTC333DTC33DTTTTC3334TC33DTTTTC333DTC33DTTTTC3334TC334TTTTC3333TC333TT3334EED33333333333EED33333333334EED33333333334EED33333333333EED33333333333EEE333333333335EE333333333335EEC33333333335EE333333333335EEC33333333334EEC33333333334E34T33133334TC31333134TC31333134TC3133334TC3133133TC3133133TC3133133DC3133133DC3133133DC3133133DT3333133D3333133331313331313333131333131333131333333333333333333333333333333333333333333333133313331333133313331333133133133133133133333333333111ʹ1˹1˹˹1˹ʹ11ʹʹ˹˹˹ʺ˹ʻ˹˺ɹʺ˹ʹʹ˹˹ɹʹʹ˹˺˺˺˺˹˺ʹ˼˼ܼܼ} P`r ./gen/App.TileSet.s" + "build:map:masked": "node %npm_package_config_tiled2iigs% ./assets/tiled/world_1-1.json --force-masked --empty-tile 33 --no-gen-tiles --output-dir ./gen", + "build:tiles": "node %npm_package_config_png2iigs% ../shell/assets/tilesets/smb-256-128-4bpp.png --max-tiles 360 --as-tile-data --transparent-color FF00FF --background-color 6B8CFF > ./gen/App.TileSet.s", + "build:tiles:1bpp": "node %npm_package_config_png2iigs% ../shell/assets/tilesets/smb-256-128-1bpp.png --max-tiles 360 --as-tile-data --transparent-color FF00FF --palette 010102,00000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,FDFEFE > ./gen/App.TileSet.s" }, "repository": { "type": "git", diff --git a/src/GTE.s b/src/GTE.s index 3694e57..d911db8 100644 --- a/src/GTE.s +++ b/src/GTE.s @@ -34,6 +34,7 @@ ApplyBG1YPosAngle EXT CopyPicToField EXT CopyBinToField EXT +CopyPicToBG1 EXT CopyBinToBG1 EXT AddTimer EXT diff --git a/src/Graphics.s b/src/Graphics.s index fae2ddc..5fe5f94 100644 --- a/src/Graphics.s +++ b/src/Graphics.s @@ -62,7 +62,7 @@ SetPalette ENT plb ; pop 8-bit bank register tya jsr _SetPalette - plb ; pop the other half og the 16-bit push off + plb ; pop the other half of the 16-bit push off plb ; restore the original data bank rtl diff --git a/src/Render.s b/src/Render.s index c7485bd..9285331 100644 --- a/src/Render.s +++ b/src/Render.s @@ -98,9 +98,9 @@ _Render ; optimization that can be done here is that the lines can be rendered in any order ; since it is not shown on-screen yet. - ldx #0 ; Blit the full virtual buffer to the screen - ldy #8 - jsr _BltRange +; ldx #0 ; Blit the full virtual buffer to the screen +; ldy #8 +; jsr _BltRange ; Turn shadowing back on @@ -116,12 +116,16 @@ _Render lda ScreenAddr,x clc adc ScreenX0 - jsl Overlay +; jsl Overlay - ldx #8 ; Blit the full virtual buffer to the screen + ldx #0 ; Blit the full virtual buffer to the screen ldy ScreenHeight jsr _BltRange + ldx #0 + ldy ScreenHeight + jsr _BltSCB + lda StartY ; Restore the fields back to their original state ldx ScreenHeight jsr _RestoreBG0Opcodes diff --git a/src/blitter/BG1.s b/src/blitter/BG1.s index 649b633..7f251c8 100644 --- a/src/blitter/BG1.s +++ b/src/blitter/BG1.s @@ -5,7 +5,7 @@ _InitBG1 rts -; Copy a binary image data file into BG1. Assumes the file is the correct size. +; Copy a binary image data file into BG1. Assumes the file is the correct size (328 x 208) ; ; A=low word of picture address ; X=high word of pixture address @@ -17,22 +17,62 @@ CopyBinToBG1 ENT jsr _CopyBinToBG1 plb rtl + _CopyBinToBG1 +:src_width equ tmp6 +:src_height equ tmp7 + + clc + adc #8 ; Advance over the header + pha + + lda #164 + sta :src_width + lda #208 + sta :src_height + + pla + jmp _CopyToBG1 + + +; Copy a IIgs $C1 picture into BG1. Assumes the file is the correct size (320 x 200) +; +; A=low word of picture address +; X=high word of pixture address +; Y=high word of BG1 bank +CopyPicToBG1 ENT + phb + phk + plb + jsr _CopyPicToBG1 + plb + rtl + +_CopyPicToBG1 +:src_width equ tmp6 +:src_height equ tmp7 + + pha + lda #160 + sta :src_width + lda #200 + sta :src_height + pla + jmp _CopyToBG1 + +; Generic routine to copy image data into BG1 +_CopyToBG1 :srcptr equ tmp0 :line_cnt equ tmp2 :dstptr equ tmp3 :col_cnt equ tmp5 +:src_width equ tmp6 +:src_height equ tmp7 sta :srcptr stx :srcptr+2 sty :dstptr+2 ; Everything goes into this bank - ; Advance over the header - lda :srcptr - clc - adc #8 - sta :srcptr - stz :line_cnt :rloop lda :line_cnt ; get the pointer to the code field line @@ -50,20 +90,21 @@ _CopyBinToBG1 iny iny - cpy #164 + cpy :src_width bcc :cloop + ldy #254 lda [:srcptr] ; Duplicate the last byte in the extra space at the end of the line sta [:dstptr],y lda :srcptr clc - adc #164 ; Each line is 328 pixels + adc :src_width sta :srcptr inc :line_cnt lda :line_cnt - cmp #208 ; A total of 208 lines + cmp :src_height bcc :rloop rts diff --git a/src/blitter/SCB.s b/src/blitter/SCB.s index 967a965..f60f3c9 100644 --- a/src/blitter/SCB.s +++ b/src/blitter/SCB.s @@ -47,14 +47,14 @@ _BltSCB lda ScreenHeight ; Calculate the number of scan lines / entry point asl - asl + and #$FFFC ; Make sure it's a multiple of 4 eor #$FFFF inc clc adc #:scb_end sta :entry+1 - lda ScreenY1 ; Get the SCB address to but into the stack register + lda ScreenY1 ; Get the SCB address to put into the stack register dec clc adc #SHADOW_SCREEN_SCB @@ -83,7 +83,7 @@ _BltSCB rts -; Quick helper to set the pointer (X = low word, A = hgih work) +; Quick helper to set the pointer (X = low word, A = high work) SetSCBArray ENT jsr _SetSCBArray rtl diff --git a/src/blitter/Tables.s b/src/blitter/Tables.s index bff2038..ea0da8c 100644 --- a/src/blitter/Tables.s +++ b/src/blitter/Tables.s @@ -274,7 +274,7 @@ BRowTableHigh ds 26*2*2 BRowTableLow ds 26*2*2 ; A double-length table of addresses for the BG1 bank. The BG1 buffer is 208 rows of 256 bytes each and -; the first row starts $1800 bytes in to cenrer the buffer in the bank +; the first row starts $1800 bytes in to center the buffer in the bank ]step equ $1800 BG1YTable lup 208 dw ]step diff --git a/tools/tiled2iigs.js b/tools/tiled2iigs.js index 59d268e..d979099 100644 --- a/tools/tiled2iigs.js +++ b/tools/tiled2iigs.js @@ -49,10 +49,10 @@ async function readTileSet(workdir, tileset) { } console.log(`Converting PNG to IIgs bitmap format...`); - const buff = png2iigs.pngToIIgsBuff(GLOBALS.options, png); + const [buff, mask] = png2iigs.pngToIIgsBuff(GLOBALS.options, png); console.log(`Building tiles...`); - const tiles = png2iigs.buildTiles(GLOBALS.options, buff, png.width / 2, transparentIndex); + const tiles = png2iigs.buildTiles(GLOBALS.options, buff, mask, png.width / 2, transparentIndex); // Return the tiles return tiles; @@ -214,6 +214,7 @@ let GLOBALS = { * --output-dir : sets the output folder to write all assets into * --force-masked : sets the masked flag on the BG0 map data, event if a BG1 layer is not present. Useful if manually locaing a second background. * --empty-tile : designates a specific tile as the empty (background) tile + * --no-gen-tiles : do not try and create the tile set */ async function main(argv) { // Read in the JSON data @@ -221,7 +222,8 @@ async function main(argv) { const workdir = path.dirname(fullpath); const outdir = getArg(argv, '--output-dir', x => x, workdir); - const forceMasked = getArg(argv, '--output-dir', x => true, false); + const forceMasked = getArg(argv, '--force-masked', x => true, false); + const noGenTiles = getArg(argv, '--no-gen-tiles', x => true, false); const emptyTile = getArg(argv, '--empty-tile', x => parseInt(x, 10), -1); console.log(`Reading Tiled JSON file from ${fullpath}`); @@ -266,6 +268,7 @@ async function main(argv) { ...GLOBALS, outdir, forceMasked, + noGenTiles, emptyTile, tileSets, tileLayers @@ -280,10 +283,12 @@ async function main(argv) { console.log(`Importing tileset "${record.tileset.name}"`); const tiles = await readTileSet(workdir, record.tileset); - const outputFilename = path.resolve(path.join(outdir, record.tileset.name + '.s')); - console.log(`Writing tiles to ${outputFilename}`); - writeTiles(outputFilename, tiles); - console.log(`Writing complete`); + if (!GLOBALS.noGenTiles) { + const outputFilename = path.resolve(path.join(outdir, record.tileset.name + '.s')); + console.log(`Writing tiles to ${outputFilename}`); + writeTiles(outputFilename, tiles); + console.log(`Writing complete`); + } // Look for tiles with animation sequences. If found, this information need to be propagated // to the tilemap export to mark those tile IDs as Dynamic Tiles.