diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44dbfa2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules +emu +src/*_Output.txt +src/GTETestApp \ No newline at end of file diff --git a/assets/music/_FileInformation.txt b/assets/music/_FileInformation.txt new file mode 100644 index 0000000..e498366 --- /dev/null +++ b/assets/music/_FileInformation.txt @@ -0,0 +1,2 @@ +main.ntp=Type(D5),AuxType(0008),Access(E3) +CONRAD.NTP=Type(D5),AuxType(0008),VersionCreate(05),MinVersion(00),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000) diff --git a/assets/music/main-nfc.ntp b/assets/music/main-nfc.ntp new file mode 100644 index 0000000..e84806d Binary files /dev/null and b/assets/music/main-nfc.ntp differ diff --git a/assets/music/main.ntp b/assets/music/main.ntp new file mode 100644 index 0000000..40ec8cc Binary files /dev/null and b/assets/music/main.ntp differ diff --git a/assets/plant.png b/assets/plant.png new file mode 100644 index 0000000..301f3c9 Binary files /dev/null and b/assets/plant.png differ diff --git a/assets/rotopattern.png b/assets/rotopattern.png new file mode 100644 index 0000000..8cd9abd Binary files /dev/null and b/assets/rotopattern.png differ diff --git a/assets/woz-pixelated.png b/assets/woz-pixelated.png index 4186ff7..842d9b7 100644 Binary files a/assets/woz-pixelated.png and b/assets/woz-pixelated.png differ diff --git a/assets/woz2.png b/assets/woz2.png new file mode 100644 index 0000000..79c29f9 Binary files /dev/null and b/assets/woz2.png differ diff --git a/macros/Tool222.Macs.s b/macros/Tool222.Macs.s new file mode 100644 index 0000000..409eec0 --- /dev/null +++ b/macros/Tool222.Macs.s @@ -0,0 +1,102 @@ +* NinjaTrackerPlus Tool +* Ninjaforce, 2018 +* Brutal Deluxe, 2018 +* FTA, 1991 + +_NTPBootInit mac + Tool $01DE + <<< + +~NTPStartUp mac + PHW ]1 +_NTPStartUp mac + Tool $02DE + <<< + +_NTPShutDown mac + Tool $03DE + <<< + +~NTPVersion mac + phd ; WordResult +_NTPVersion mac + Tool $04DE + <<< + +_NTPReset mac + Tool $05DE + <<< + +~NTPStatus mac + phd ; WordResult +_NTPStatus mac + Tool $06DE + <<< + +~NTPLoadOneMusic mac + PHL ]1 +_NTPLoadOneMusic mac + Tool $09DE + <<< + +~NTPPlayMusic mac + PHW ]1 +_NTPPlayMusic mac + Tool $0ADE + <<< + +_NTPStopMusic mac + Tool $0BDE + <<< + +~NTPGetEOfMusic mac + phd ; WordResult +_NTPGetEOfMusic mac + Tool $0CDE + <<< + +~NTPAddToBatch mac + PHLW ]1;]2 +_NTPAddToBatch mac + Tool $0DDE + <<< + +~NTPSelectBatch mac + PHW ]1 +_NTPSelectBatch mac + Tool $0EDE + <<< + +~NTPKillBatch mac + PHW ]1 +_NTPKillBatch mac + Tool $0FDE + <<< + +~NTPGetPlayingMusic mac + phd ; WordResult +_NTPGetPlayingMusic mac + Tool $10DE + <<< + +~NTPPlayBatch mac + PHL ]1 +_NTPPlayBatch mac + Tool $11DE + <<< + +~NTPGetTrackVu mac + phd ;Long + phd ; Result +_NTPGetTrackVu mac + Tool $12DE + <<< + +_NTPPauseMusic mac + Tool $13DE + <<< + +_NTPContinueMusic mac + Tool $14DE + <<< + diff --git a/package.json b/package.json index 4d1e341..e5623b8 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,10 @@ "build:watch": "watch \"npm run build\" src", "build:assets-smw": "node ./tools/pngtoiigs.js ./assets/donut-plains-2-8-color.png ./emu/bg1a.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/donut-plains-2-8-color-shift.png ./emu/bg1b.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/donut-plains-1-6-color.png ./emu/fg1.bin", "build:assets-fatdog": "node ./tools/pngtoiigs.js ./assets/armada-7-color.png ./emu/bg1a.bin --start-index 8 && node ./tools/pngtoiigs.js ./assets/armada-7-color-shift.png ./emu/bg1b.bin --start-index 8 && node ./tools/pngtoiigs.js ./assets/armada-7-color-shuffle.png ./emu/fg1.bin --start-index 1", + "build:assets-plant": "node ./tools/pngtoiigs.js ./assets/plant.png ./emu/bg1a.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/donut-plains-1-6-color.png ./emu/fg1.bin", "build:assets-woz": "node ./tools/pngtoiigs.js ./assets/woz.png ./emu/bg1a.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/donut-plains-1-6-color.png ./emu/fg1.bin", - "build:assets-woz-fatbits": "node ./tools/pngtoiigs.js ./assets/woz-pixelated.png ./emu/bg1a.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/donut-plains-1-6-color.png ./emu/fg1.bin" + "build:assets-woz-fatbits": "node ./tools/pngtoiigs.js ./assets/woz-pixelated.png ./emu/bg1a.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/donut-plains-1-6-color.png ./emu/fg1.bin", + "build:assets-color-cycle": "node ./tools/pngtoiigs.js ./assets/rotopattern.png ./emu/bg1a.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/woz-shifted.png ./emu/bg1b.bin --start-index 6 && node ./tools/pngtoiigs.js ./assets/donut-plains-1-6-color.png ./emu/fg1.bin" }, "repository": { "type": "git", diff --git a/src/Actions.s b/src/Actions.s index e0b2ef1..2c97ae8 100644 --- a/src/Actions.s +++ b/src/Actions.s @@ -67,19 +67,19 @@ Demo ; Set a timer to fire every 16 ticks - lda #6 - sta Timers - sta Timers+2 - lda #UpdateBG1Rotation - sta Timers+4 +; lda #6 +; sta Timers +; sta Timers+2 +; lda #UpdateBG1Rotation +; sta Timers+4 ; Every 3 ticks (20 fps) cycle some colors -; lda #3 -; sta Timers+8 -; sta Timers+10 -; lda #DoColorCycle -; sta Timers+12 + lda #3 + sta Timers+8 + sta Timers+10 + lda #DoColorCycle + sta Timers+12 :loop PushLong #0 _GetTick @@ -92,10 +92,12 @@ Demo sec sbc lastTick stx lastTick - jsr _DoTimers +; jsr _DoTimers ; lda #1 ; jsr MoveLeft + jsr UpdateBG1Rotation +; jsr DoColorCycle jsr DoFrame inc frameCount @@ -133,14 +135,30 @@ Demo FPSStr str 'FPS' -; Move some colors around +; Move some colors around color (6 - 11) address 12 - 22 DoColorCycle - ldal $E19E00 - tax - ldal $E19E02 - stal $E19E00 - txa - stal $E19E02 + ldal $E19E0C + pha + ldal $E19E0E + pha + ldal $E19E10 + pha + ldal $E19E12 + pha + ldal $E19E14 + pha + ldal $E19E16 + stal $E19E0C + pla + stal $E19E16 + pla + stal $E19E14 + pla + stal $E19E12 + pla + stal $E19E10 + pla + stal $E19E0E rts ; Triggered timer to sway the background @@ -266,6 +284,17 @@ _DoTimers + + + + + + + + + + + diff --git a/src/App.Main.s b/src/App.Main.s index 885ac40..132eb6e 100644 --- a/src/App.Main.s +++ b/src/App.Main.s @@ -18,6 +18,7 @@ use Misc.Macs.s put ..\macros\App.Macs.s put ..\macros\EDS.GSOS.MACS.s + put ..\macros\Tool222.MACS.s put .\blitter\DirectPage.s mx %00 @@ -62,6 +63,24 @@ NO_INTERRUPTS equ 0 ; turn off for crossrunner _MTStartUp + pea $00DE + pea $0000 + _LoadOneTool + _Err + + lda UserId + pha + _NTPStartUp + + pea #^MusicFile + pea #MusicFile + _NTPLoadOneMusic + + pea $0001 ; loop + _NTPPlayMusic + +; Use Tool222 (NinjaTrackerPlus) for music playback + ; Install interrupt handlers. We use the VBL interrupt to keep animations ; moving at a consistent rate, regarless of the rendered frame rate. The ; one-second timer is generally just used for counters and as a handy @@ -110,6 +129,11 @@ NO_INTERRUPTS equ 0 ; turn off for crossrunner jsr AllocOneBank2 ; Alloc 64KB for Load/Unpack sta BankLoad ; Store "Bank Pointer" + ldx #0 + jsr SetScreenMode + jsr DoTiles + jsr DoLoadBG1 + jsr Demo EvtLoop jsr WaitForKey @@ -920,9 +944,16 @@ GrafInit dw $0000,$0778,$0AAA,$0CFF,$0368,$00AF,$0556 ; Woz -DefaultPalette dw $0EEF,$0342,$0C95,$0852,$0DB4,$00C0 +;DefaultPalette dw $0EEF,$0342,$0C95,$0852,$0DB4,$00C0 dw $0666,$0999,$0CCC,$0222,$09A0,$0680,$0470,$0051 +; Fatdog color cycling +;DefaultPalette dw $0EEF,$0342,$0C95,$0852,$0DB4,$00C0 + dw $0156,$0288,$03A8,$07B8,$0034,$0013,$0470,$0051 + +; Plant +DefaultPalette dw $0EEF,$0342,$0C95,$0852,$0DB4,$00C0 + dw $0222,$0333,$0444,$0888,$09A0,$0680,$0470,$0051 ; Return the current border color ($0 - $F) in the accumulator GetBorderColor lda #0000 sep #$20 @@ -1120,7 +1151,8 @@ msgLine2 str 'Press a key :' msgLine3 str ' -> Return to Try Again' msgLine4 str ' -> Esc to Quit' -; Data storage +; Data storage +MusicFile str '1/main.ntp' BG1DataFile strl '1/bg1a.bin' BG1AltDataFile strl '1/bg1b.bin' @@ -1165,3 +1197,18 @@ qtRec adrl $0000 put RotData.s + + + + + + + + + + + + + + + diff --git a/src/blitter/Template.s b/src/blitter/Template.s index 34dbffa..e1f44ae 100644 --- a/src/blitter/Template.s +++ b/src/blitter/Template.s @@ -373,6 +373,10 @@ BuildBank lda :nextBank sta [:target],y + ldy #$8000+CODE_EXIT ; Patch one line per bank to enable interrupts + lda #{$004C+{ENABLE_INT}*256} + sta [:target],y + plb rts @@ -487,7 +491,7 @@ full_return jml blt_return ; Full exit ; Re-enable interrupts and continue -- the even_exit JMP from the previous line will jump here every ; 8 or 16 lines in order to give the system some extra time to handle interrupts. -enable_int ldal stk_save ; restore the stack +enable_int ldal stk_save+1 ; restore the stack tcs sep #$20 ; 8-bit mode ldal STATE_REG ; Read Bank 0 / Write Bank 0 @@ -618,3 +622,7 @@ snippets lup 82 ]index equ ]index+1 --^ top + + + +