diff --git a/README.md b/README.md index f94de68..0cb24df 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,50 @@ -# Hamazing -Sourcecode of Hamazing and PLatOS demoframework +# Hamazing by Desire + +This is the source code of Hamazing and PLatOS demo framework. + +It's supposed to build on a Windows machine (sorry). +Some of the stuff was originally part of +[Axis' Planet Rocklobster framework](https://github.com/AxisOxy/Planet-Rocklobster) +and that may show in structure and some of the tools used. + +## Building + +Go into the `source/hamazing` directory and type `build.bat`. + +Each part can be run as a standalone executable for testing by entering +the part's source directory and running `assemble.bat`. + +Note that you need to supply Kickstart roms for WinUAE in the +`source/winuae/Roms` directory. AROS rom replacement _may_ work, but +your milage may vary. It doesn't run the trackmo for unknown reasons. + +## Third party stuff + +This software uses or provides binaries of + +- LightSpeedPlayer, LSPConvert - https://github.com/arnaud-carre/LSPlayer +- Raspberry Casket Pretracker Replayer - https://github.com/chrisly42/PretrackerRaspberryCasket +- KingCon +- DevIl - http://openil.sourceforge.net +- WinUAE - http://www.winuae.net +- VASM - http://sun.hasenbraten.de/vasm +- Shrinkler - https://github.com/askeksa/Shrinkler +- LZ4 - https://github.com/lz4/lz4 +- ZX0 - https://github.com/einar-saukas/ZX0 +- Salvador - https://github.com/emmanuel-marty/salvador +- Doynamite68k + +## Make your own demos! + +You can use the framework to make your own demos or intros. +There is documentation inside the source code. +Right now, I'm not quite motivated to write more than necessary. + +You can look at the effects to see how things are done. + +But only lamers will copy code verbatim. +Give credits where credits are due. + +And now go and have some fun. Use the Blitter, Luke! Make Amiga Great Again! + +Signing off, Chris 'platon42' Hodges \ No newline at end of file diff --git a/source/blend/aga.bat b/source/blend/aga.bat new file mode 100644 index 0000000..0bb0ae8 --- /dev/null +++ b/source/blend/aga.bat @@ -0,0 +1,30 @@ +del blend.exe +del "..\winuae\hd0\blend.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "blend.exe" "blend.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy blend.exe "..\winuae\hd0" +copy blend.exe "..\winuae\hd0\a" + +@echo /|set /p =blend.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/blend/assemble.bat b/source/blend/assemble.bat new file mode 100644 index 0000000..acd491f --- /dev/null +++ b/source/blend/assemble.bat @@ -0,0 +1,43 @@ +del blend.exe +del "..\winuae\hd0\blend.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +pushd .. + +tools\KingCon.exe @data/blend/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\juggler data/blend/juggle.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\LSPConvert.exe data\music\dsr_68k_tune_2_v11.mod -setpos -v +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +vc -O2 -notmpfile -nostdlib -o "blend.exe" "blend.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy blend.exe "..\winuae\hd0" +copy blend.exe "..\winuae\hd0\a" + +@echo /|set /p =blend.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_hrt_more_mem.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/blend/blend.asm b/source/blend/blend.asm new file mode 100644 index 0000000..7443b6f --- /dev/null +++ b/source/blend/blend.asm @@ -0,0 +1,5749 @@ +; TODOs: +; - Some sprite effect? (boxes around appearing things?) +; - Sprite overlays +; +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 1 +FW_MUSIC_PLAYER_CHOICE = 2 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker (CPU DMA wait), 5 = Pretracker Turbo (Copper wait) +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 0 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 308 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 0 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 0 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 1 +PART_MUSIC_START_POS = 11 + + ENDC + +BLENDIMG_WIDTH = 320 +BLENDIMG_HEIGHT = 180 +BLENDIMG_PLANES = 6 + +BLENDVIEW_WIDTH = 320 +BLENDVIEW_HEIGHT = 180 +BLENDVIEW_PLANES = 6 + +ENDLOGO_WIDTH = 320 +ENDLOGO_HEIGHT = 180 +ENDLOGO_PLANES = 6 + +PART_WIDTH = 32 +PART_HEIGHT = 30 + +BLOCKS_WIDTH = (BLENDVIEW_WIDTH/PART_WIDTH) +BLOCKS_HEIGHT = (BLENDVIEW_HEIGHT/PART_HEIGHT) + +NUM_BARS = (BLENDVIEW_WIDTH/16) + +MIN_CIRCLE_SIZE = 3 +MAX_CIRCLE_SIZE = 50 +CIRCLE_MASKS_SIZE = 10514 +CIRCLE_SPEEDCODE_SIZE = 62784 + +NUM_CIRCLE_POTS = 6 + +COP_PREAMBLE_INST = 16 ; bplptrs +COP_POST_INST = 16 ; wait +COP_INST_PER_INTRO_LINE = 28 +COP_INST_PER_BARS_LINE = 22 ; wait, 20 colors, nop +COP_INST_PER_HOLE_LINE = 11 ; wait, color 8, wait, color 1,2,3,4,5,6,7,8 +COP_INST_PER_LINE = 28 ; color 1,2,3,4,5,6,7 wait, 20*(line 8 color) +COP_LIST_SIZE = (COP_PREAMBLE_INST+COP_INST_PER_LINE*BLENDVIEW_HEIGHT+COP_POST_INST)*4 + +CHIPMEM_SIZE = COP_LIST_SIZE*2+3*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT*BLENDVIEW_PLANES+BLENDVIEW_HEIGHT*4*8+CIRCLE_MASKS_SIZE+4 +FASTMEM_SIZE = BLENDIMG_WIDTH*BLENDIMG_HEIGHT*2*3+CIRCLE_SPEEDCODE_SIZE + + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + + include "../framework/framework.i" + + +; Chip memory use: +; - CHIP DATA: 320 x 180 x 6 x 1 = 43200 (original images) +; +; - CHIP BSS : 320 x 180 x 6 x 1 = 43200 (loaded image) +; - CHIP BSS : 320 x 180 x 6 x 2 = 86400 (db buffers) +; - CHIP BSS : 320 x 180 x 1 x 2 = 14400 (empty and filled, used during circle precalc) +; - CHIP BSS : 32 x 30 x 5 x 5 = 3600 (block target p1-p4 & p5|p6) +; - CHIP BSS : 4 x 180 x x 8 = 5760 (line-fix array) +; - CHIP BSS : 48 = 10488 (circle masks) +; - CHIP BSS : 8 x 180 x 2 = 11520 (copperlists) +; +; - CHIP BSS : 20 x 180 x 2 x 2 = 14400 (truecolor 16, recycled from above) +; - CHIP BSS : 2 x 180 x 4 = 1440 (sine clip positions, db) +; - CHIP BSS : 4 x 181 x 4 = 2896 (smc buffers) +; +; Total: 207 KB +; +; Fast memory use: +; - FAST BSS : 320 x 180 x 2 = 230400 (True color buffer) +; - FAST BSS : 320 x 180 x 1 = 115200 (True color buffer) +; - FAST BSS : 4096 x 2 x 2 = 16384 (Shading tables, recycled) +; - FAST BSS : = 61632 (Circle speedcode) +; - FAST BSS : 2000 = 2000 (Blitterqueues) +; +; Mem Free: Chip: 89 of 498 KB (236/0 KB) | Fast: 106 of 445 KB (329/2 KB) +; Mem Free: Chip: 59 of 498 KB (266/0 KB) | Fast: 9 of 445 KB (426/2 KB) + + STRUCTURE CirclePot,0 + UWORD cp_Radius + WORD cp_CenterPosX + WORD cp_CenterPosY + + UWORD cp_LastRadius + ULONG cp_LastPosOffset + + UWORD cp_LastLastRadius + ULONG cp_LastLastPosOffset + + UWORD cp_LRIAreaY + + UWORD cp_TimeLeft + UWORD cp_RadPos + UWORD cp_Pair + + LABEL cp_RelPosXLong + UWORD cp_RelPosSinXSpeed + UWORD cp_RelPosSinYSpeed + LABEL cp_RelPosYLong + UWORD cp_RelPosSinXOffset + UWORD cp_RelPosSinYOffset + LABEL cp_RelPosXInc + UWORD cp_RelPosXRadius + LABEL cp_RelPosYInc + UWORD cp_RelPosYRadius + UWORD cp_RelPosXCenter + UWORD cp_RelPosYCenter + UWORD cp_GreetingTimeRev + + UWORD cp_LineFixTopYOffset + ULONG cp_PosOffset + LONG cp_PosTCOffset + LONG cp_InvertedOffset + WORD cp_FgRelPosX + WORD cp_FgRelPosY + ULONG cp_FgOffset + UWORD cp_CircleShift + LONG cp_FgTCOffset + + APTR cp_CircleInfo + APTR cp_BgImage + APTR cp_BgTCImage + APTR cp_FgImage + APTR cp_FgTCImage + APTR cp_CircleFixupRoutine + APTR cp_PaintRoutine + APTR cp_PotScriptPtr + APTR cp_FrameRoutine + LABEL cp_SIZEOF + + STRUCTURE CircleInfo,0 + UWORD ci_LRIAreaY + + UWORD ci_TopWidth + UWORD ci_TopHeight + UWORD ci_TopXOffset + + UWORD ci_LeftWidth + UWORD ci_LeftXOffset + + UWORD ci_RightWidth + UWORD ci_RightXOffset + + UWORD ci_InnerBltSize + UWORD ci_InnerXOffset + UWORD ci_InnerBltMod + + ; this is generated runtime + UWORD ci_InnerBgOffset + WORD ci_InnerFgOffset + + UWORD ci_TopBgOffset + WORD ci_TopFgOffset + + UWORD ci_TopBottomOffsetAdv + + UWORD ci_LeftBgOffset + WORD ci_LeftFgOffset + + UWORD ci_RightBgOffset + WORD ci_RightFgOffset + + UWORD ci_TopBottomMaskSize + UWORD ci_TopBottomBltSize + + UWORD ci_LeftBltSize + UWORD ci_RightBltSize + + APTR ci_TopMask + APTR ci_LeftMask + APTR ci_RightMask + + APTR ci_LeftDotSetCode + APTR ci_LeftDotClearCode + APTR ci_RightDotSetCode + APTR ci_RightDotClearCode + APTR ci_LeftTCCode + APTR ci_RightTCCode + LABEL ci_SIZEOF + + STRUCTURE BarData,0 + WORD bd_Delay + WORD bd_EndPosCount + WORD bd_BarPos + UWORD bd_BarPosFract + WORD bd_BarSpeed + UWORD bd_BarSpeedFract + UWORD bd_LastLastLastBottomPos + UWORD bd_LastLastBottomPos + UWORD bd_LastBottomPos + LABEL bd_SIZEOF + + STRUCTURE PartBlockInfo,0 + WORD pbi_Phase + UWORD pbi_YPos + APTR pbi_OriginalImage + APTR pbi_TrueColorImage + APTR pbi_LastTrueColorImage + ULONG pbi_ScreenOffset + APTR pbi_SourceImgPtr + UWORD pbi_Copper7Offset + UWORD pbi_CopperEdgeOffset + APTR pbi_TempBuffer + APTR pbi_PalChangeRoutine + APTR pbi_PalApplyRoutine + APTR pbi_PhaseSequence + APTR pbi_SequencePtr + STRUCT pbi_CurrentColors,(7+PART_HEIGHT)*2 + STRUCT pbi_TargetColors,(7+PART_HEIGHT)*2 + LABEL pbi_SIZEOF + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrPlanesPtr + APTR pd_LastPlanesPtr + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + APTR pd_CurrFixupBQPtr + UBYTE pd_DbToggle + ALIGNWORD + + UWORD pd_OldFrameCount + UWORD pd_FrameInc + UWORD pd_TCPicsDone + UWORD pd_PartCountDown + UWORD pd_SequenceBlocksLeft + UWORD pd_BeatRadAdd + UWORD pd_GreetingCount + + UWORD pd_CircleShift + UWORD pd_LineFixToggle + + UWORD pd_CopperChunkyOffset + UWORD pd_CurrGreetingsPalOffset + + APTR pd_CopperList1 + APTR pd_CopperList2 + APTR pd_DbBuffer1 + APTR pd_DbBuffer2 + APTR pd_ClipDotsBuffer + APTR pd_ClipFillBuffer + + APTR pd_StaticFixupBQ1 + APTR pd_StaticFixupBQ2 + APTR pd_OriginalImage1 + APTR pd_OriginalImage2 + APTR pd_OriginalImage3 + APTR pd_OriginalImage4 + APTR pd_OriginalImage5 + APTR pd_TrueColorImage1 + APTR pd_TrueColorImage2 + APTR pd_TrueColorImage3 + APTR pd_TrueColorImage4 + APTR pd_TrueColorImage5 + APTR pd_CurrGreetingsImage + APTR pd_CurrGreetingsTCImage + APTR pd_TrueColor16Image + APTR pd_TrueColor16Image2 + APTR pd_EndLogoBuffer + APTR pd_EndLogoP5P6Buffer + + APTR pd_LineFix1Array + APTR pd_LineFix2Array + APTR pd_LineFix3Array + APTR pd_LineFix4Array + APTR pd_LineFix5Array + APTR pd_LineFix6Array + APTR pd_LineFix7Array + APTR pd_LineFix8Array + + APTR pd_GreetingPosPtr + APTR pd_GreetingLinePtr + + APTR pd_ShadeTableXor + APTR pd_ShadeTableSub1 + APTR pd_CircleMasksBuffer + APTR pd_CircleSpeedcodeBuffer + + UWORD pd_AllowLoadLastImage + + STRUCT pd_PreparationTask,ft_SIZEOF + STRUCT pd_SpeedCodeTask,ft_SIZEOF + STRUCT pd_Parts,BLOCKS_HEIGHT*pbi_SIZEOF + STRUCT pd_Bars,NUM_BARS*bd_SIZEOF + + STRUCT pd_CirclePots,NUM_CIRCLE_POTS*cp_SIZEOF + STRUCT pd_MinMaxY,BLENDVIEW_HEIGHT*4 + STRUCT pd_CircleInfos,(MAX_CIRCLE_SIZE-MIN_CIRCLE_SIZE+1)*4 + + LABEL pd_EndLogoPalette ; 16*2 + STRUCT pd_StaticFixup1BQBuffer,256 + STRUCT pd_StaticFixup2BQBuffer,256 + STRUCT pd_BQBuffer,1500 + + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + move.l #part_music_data,fw_MusicData(a6) + move.l #part_music_smp,fw_MusicSamples(a6) + CALLFW StartMusic + ENDC + IFD PART_MUSIC_START_POS + moveq.l #PART_MUSIC_START_POS,d0 + CALLFW MusicSetPosition + move.w #3888,fw_MusicFrameCount(a6) + ENDC + ENDC + + bsr.s bln_init + + lea bln_copperlist,a0 + CALLFW SetCopper + + IF 1 + PUTMSG 10,<"%d: Waiting for first pic (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + +.wait + CALLFW VSyncWithTask + cmp.w #1,pd_TCPicsDone(a6) + blt.s .wait + + bsr bln_intro + + lea bln_prepare_circle_speedcode(pc),a0 + lea pd_SpeedCodeTask(a6),a1 + CALLFW AddTask + + PUTMSG 10,<"%d: Waiting for third pic (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + +.wait2 + CALLFW VSyncWithTask + cmp.w #3,pd_TCPicsDone(a6) + blt.s .wait2 + + bsr bln_bars + ELSE + lea bln_prepare_circle_speedcode(pc),a0 + lea pd_SpeedCodeTask(a6),a1 + CALLFW AddTask + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + moveq.l #14,d0 + CALLFW MusicSetPosition + move.w #5040,fw_MusicFrameCount(a6) + ENDC + ENDC + ENDC + + move.w #4,pd_AllowLoadLastImage(a6) + bsr bln_holes + bsr bln_greetings + bsr bln_endlogo + + lea pd_PreparationTask(a6),a1 + CALLFW RemTask + lea pd_SpeedCodeTask(a6),a1 + CALLFW RemTask + + CALLFW SetBaseCopper + + rts + +;-------------------------------------------------------------------- + +bln_init: + move.w #$000,color(a5) + bsr bln_init_vars + + bsr bln_init_shade_table + bsr bln_init_bars + + lea .backgroundtasks(pc),a0 + lea pd_PreparationTask(a6),a1 + move.b #5,LN_PRI(a1) + CALLFW AddTask + + rts + +.backgroundtasks + lea bln_leaves_tc_10,a0 + move.l pd_TrueColorImage1(a6),a1 + move.w #(BLENDVIEW_HEIGHT*(BLENDVIEW_WIDTH/32))-1,d7 +.xyloop + move.w (a0)+,(a1) + lea 32*2(a1),a1 + dbra d7,.xyloop + + addq.w #1,pd_TCPicsDone(a6) + + PUTMSG 10,<"%d: Loading image 2">,fw_FrameCounter(a6) + IFD FW_DEMO_PART + lea bln_blend_image_2_filename(pc),a0 + CALLFW FindFile + move.l pd_TrueColorImage2(a6),a0 + CALLFW LoadFileToBuffer + move.l pd_TrueColorImage2(a6),a0 + move.l pd_OriginalImage2(a6),a1 + CALLFW DecompressZX0 + ENDC + + move.l pd_OriginalImage2(a6),a0 + move.l pd_TrueColorImage2(a6),a1 + move.w #16*2+1*BLENDVIEW_HEIGHT*2,d0 + bsr bln_calc_true_color_image + + addq.w #1,pd_TCPicsDone(a6) + + IFD FW_DEMO_PART + cmp.w #3,pd_AllowLoadLastImage(a6) + bge.s .skipwait + CALLFW TrackloaderDiskMotorOff + ENDC + + PUTMSG 10,<"%d: Waiting to unlock image 3">,fw_FrameCounter(a6) +.wait + CALLFW Yield + cmp.w #3,pd_AllowLoadLastImage(a6) + blt.s .wait +.skipwait + + PUTMSG 10,<"%d: Loading image 3">,fw_FrameCounter(a6) + IFD FW_DEMO_PART + lea bln_blend_image_3_filename(pc),a0 + CALLFW FindFile + move.l pd_TrueColorImage3(a6),a0 + CALLFW LoadFileToBuffer + move.l pd_TrueColorImage3(a6),a0 + move.l pd_OriginalImage3(a6),a1 + CALLFW DecompressZX0 + ENDC + + move.l pd_OriginalImage3(a6),a0 + move.l pd_TrueColorImage3(a6),a1 + move.w #16*2+2*BLENDVIEW_HEIGHT*2,d0 + bsr bln_calc_true_color_image + addq.w #1,pd_TCPicsDone(a6) + + IFD FW_DEMO_PART + cmp.w #4,pd_AllowLoadLastImage(a6) + bge.s .skipwait4 + CALLFW TrackloaderDiskMotorOff + ENDC + + PUTMSG 10,<"%d: Waiting to unlock image 4">,fw_FrameCounter(a6) +.wait4 + CALLFW Yield + cmp.w #4,pd_AllowLoadLastImage(a6) + blt.s .wait4 +.skipwait4 + + PUTMSG 10,<"%d: Loading image 4">,fw_FrameCounter(a6) + IFD FW_DEMO_PART + lea bln_blend_image_4_filename(pc),a0 + CALLFW FindFile + move.l pd_TrueColorImage4(a6),a0 + CALLFW LoadFileToBuffer + move.l pd_TrueColorImage4(a6),a0 + move.l pd_OriginalImage4(a6),a1 + CALLFW DecompressZX0 + ENDC + + move.l pd_OriginalImage4(a6),a0 + move.l pd_TrueColorImage4(a6),a1 + move.w #16*2+3*BLENDVIEW_HEIGHT*2,d0 + bsr bln_calc_true_color_image + addq.w #1,pd_TCPicsDone(a6) + + IFD FW_DEMO_PART + cmp.w #5,pd_AllowLoadLastImage(a6) + bge.s .skipwait5 + CALLFW TrackloaderDiskMotorOff + ENDC + + PUTMSG 10,<"%d: Waiting to unlock image 5">,fw_FrameCounter(a6) +.wait5 + CALLFW Yield + cmp.w #5,pd_AllowLoadLastImage(a6) + blt.s .wait5 +.skipwait5 + + PUTMSG 10,<"%d: Loading image 5">,fw_FrameCounter(a6) + IFD FW_DEMO_PART + lea bln_blend_image_5_filename(pc),a0 + CALLFW FindFile + move.l pd_TrueColorImage5(a6),a0 + CALLFW LoadFileToBuffer + move.l pd_TrueColorImage5(a6),a0 + move.l pd_OriginalImage5(a6),a1 + CALLFW DecompressZX0 + ENDC + + move.l pd_OriginalImage5(a6),a0 + move.l pd_TrueColorImage5(a6),a1 + move.w #16*2+4*BLENDVIEW_HEIGHT*2,d0 + bsr bln_calc_true_color_image + addq.w #1,pd_TCPicsDone(a6) + + IFD FW_DEMO_PART + CALLFW TrackloaderDiskMotorOff + ENDC + + PUTMSG 10,<"%d: Prep task done!">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- + +bln_init_vars: + lea bln_greets_positions(pc),a0 + move.l a0,pd_GreetingPosPtr(a6) + lea bln_greets_lines(pc),a0 + move.l a0,pd_GreetingLinePtr(a6) + + IFD FW_DEMO_PART + lea bln_blend_image_1,a0 + move.l a0,pd_OriginalImage1(a6) + move.l a0,pd_OriginalImage3(a6) + move.l a0,pd_EndLogoBuffer(a6) + + move.l #(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT*BLENDVIEW_PLANES,d0 + CALLFW AllocChip + move.l a0,pd_OriginalImage2(a6) + move.l a0,pd_OriginalImage5(a6) + move.l a0,pd_EndLogoP5P6Buffer(a6) + ELSE + move.l #bln_blend_image_1,pd_OriginalImage1(a6) + move.l #bln_blend_image_2,pd_OriginalImage2(a6) + move.l #bln_blend_image_3,pd_OriginalImage3(a6) + move.l #bln_blend_image_4,pd_OriginalImage4(a6) + move.l #bln_blend_image_5,pd_OriginalImage5(a6) + move.l #bln_endlogo_image,pd_EndLogoBuffer(a6) + move.l #bln_blend_image_1,pd_EndLogoP5P6Buffer(a6) + ENDC + + move.l #(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT*BLENDVIEW_PLANES,d0 + CALLFW AllocChip + PUTMSG 10,<"ClipDotsBuffer %p">,a0 + IFD FW_DEMO_PART + move.l a0,pd_OriginalImage4(a6) + ENDC + move.l a0,pd_ClipDotsBuffer(a6) + move.l a0,pd_TrueColor16Image(a6) + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a0),a0 + PUTMSG 10,<"ClipFillBuffer %p">,a0 + move.l a0,pd_ClipFillBuffer(a6) + move.l a0,pd_TrueColor16Image2(a6) + + move.l #(COP_LIST_SIZE*2),d0 + CALLFW AllocChip + PUTMSG 10,<"Copperlist 1 %p">,a0 + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + lea COP_LIST_SIZE(a0),a0 + PUTMSG 10,<"Copperlist 2 %p">,a0 + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + move.l #2*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT*BLENDVIEW_PLANES,d0 + CALLFW AllocChip + PUTMSG 10,<"DbBuffer %p">,a0 + move.l a0,pd_DbBuffer1(a6) + move.l a0,pd_CurrPlanesPtr(a6) + add.l #(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT*BLENDVIEW_PLANES,a0 + move.l a0,pd_DbBuffer2(a6) + move.l a0,pd_LastPlanesPtr(a6) + + ;move.l #(PART_WIDTH/8)*PART_HEIGHT*(5)*BLOCKS_HEIGHT,d0 + move.l #BLENDVIEW_HEIGHT*4*8,d0 + CALLFW AllocChip + PUTMSG 10,<"BlockTempBuffer %p">,a0 + lea pd_LineFix1Array(a6),a2 + move.l a0,(a2)+ + lea BLENDVIEW_HEIGHT*4(a0),a1 + move.l a1,(a2)+ + REPT 6 + lea BLENDVIEW_HEIGHT*4(a1),a1 + move.l a1,(a2)+ + ENDR + + move.w #(PART_WIDTH/8)*PART_HEIGHT*5,d0 + lea pd_Parts(a6),a1 + moveq.l #BLOCKS_HEIGHT-1,d7 + moveq.l #0,d1 +.partloop + move.w #$8000,pbi_Phase(a1) + move.w d1,pbi_YPos(a1) + move.l a0,pbi_TempBuffer(a1) + addq.w #1,d1 + adda.w d0,a0 + lea pbi_SIZEOF(a1),a1 + dbra d7,.partloop + + move.l #BLENDIMG_WIDTH*BLENDIMG_HEIGHT*2,d0 + CALLFW AllocFast + PUTMSG 10,<"TrueColorImage 1/3 %p">,a0 + move.l a0,pd_TrueColorImage1(a6) + move.l a0,pd_TrueColorImage3(a6) + + move.l #BLENDIMG_WIDTH*BLENDIMG_HEIGHT*2,d0 + CALLFW AllocFast + PUTMSG 10,<"TrueColorImage 2/5 %p">,a0 + move.l a0,pd_TrueColorImage2(a6) + move.l a0,pd_TrueColorImage5(a6) + + move.l #BLENDIMG_WIDTH*BLENDIMG_HEIGHT*2,d0 + CALLFW AllocFast + PUTMSG 10,<"TrueColorImage 4 %p">,a0 + move.l a0,pd_TrueColorImage4(a6) + move.l a0,pd_ShadeTableXor(a6) + PUTMSG 10,<"ShadeTableXor %p">,a0 + lea 4096*2(a0),a0 + move.l a0,pd_ShadeTableSub1(a6) + PUTMSG 10,<"ShadeTableSub1 %p">,a0 + + move.l #CIRCLE_MASKS_SIZE,d0 + CALLFW AllocChip + PUTMSG 10,<"CircleMasksBuffer %p">,a0 + move.l a0,pd_CircleMasksBuffer(a6) + + move.l #CIRCLE_SPEEDCODE_SIZE,d0 + CALLFW AllocFast + PUTMSG 10,<"CircleSpeedcodeBuffer %p">,a0 + move.l a0,pd_CircleSpeedcodeBuffer(a6) + + lea pd_CirclePots(a6),a4 + lea bln_circle_scripts(pc),a0 +.scriptloop + move.w (a0)+,d0 + beq.s .donescripts + lea -2(a0,d0.w),a1 + move.l a1,cp_PotScriptPtr(a4) + lea cp_SIZEOF(a4),a4 + bra.s .scriptloop +.donescripts + + rts + +;-------------------------------------------------------------------- + +bln_init_shade_table: + move.l pd_ShadeTableXor(a6),a0 + move.l a0,a1 + moveq.l #0,d0 +.xorloop + moveq.l #$11,d3 + moveq.l #15,d1 + cmp.b d1,d0 + bhi.s .upperset + and.b d1,d3 +.upperset + and.b d0,d1 + bne.s .lowerset + subq.b #1,d3 +.lowerset + move.w d3,(a0)+ + addq.b #1,d0 + bne.s .xorloop + + moveq.l #15-1,d7 + move.l #$01000100,d3 +.xoroloop + move.l a1,a2 + move.w #128-1,d6 +.xor2loop + move.l (a2)+,d0 + add.l d3,d0 + move.l d0,(a0)+ + dbra d6,.xor2loop + dbra d7,.xoroloop + + move.l pd_ShadeTableXor(a6),a0 + move.l pd_ShadeTableSub1(a6),a1 + moveq.l #0,d0 + move.w #4096-1,d7 +.sub1loop + move.w d0,d1 + sub.w (a0)+,d1 + move.w d1,(a1)+ + addq.w #1,d0 + dbra d7,.sub1loop + + rts + +;-------------------------------------------------------------------- + +bln_init_bars: + lea pd_Bars(a6),a1 + lea bln_bar_patterns(pc),a0 + moveq.l #0,d0 + move.w #-BLENDVIEW_HEIGHT,d1 + moveq.l #(NUM_BARS/2)-1,d7 +.loop1 + move.b (a0)+,d2 + ext.w d2 + mulu #bd_SIZEOF,d2 + move.w d0,bd_Delay(a1,d2.w) + move.w d1,bd_BarPos(a1,d2.w) + move.w #1,bd_BarSpeed(a1,d2.w) + move.w #5,bd_EndPosCount(a1,d2.w) + add.w #10,d0 + subq.w #8,d1 + dbra d7,.loop1 + + moveq.l #(NUM_BARS/2)-1,d7 +.loop2 + move.b (a0)+,d2 + ext.w d2 + mulu #bd_SIZEOF,d2 + move.w d0,bd_Delay(a1,d2.w) + move.w d1,bd_BarPos(a1,d2.w) + move.w #1,bd_BarSpeed(a1,d2.w) + move.w #5,bd_EndPosCount(a1,d2.w) + add.w #19,d0 + addq.w #2,d1 + dbra d7,.loop2 + rts + +;-------------------------------------------------------------------- + +bln_clear_db_buffers: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_DbBuffer1(a6),bltdpt(a5) + move.w #((3*BLENDVIEW_WIDTH)>>4)|((BLENDVIEW_HEIGHT*4)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +bln_copy_image_to_buffer: + BLTHOGON + BLTWAIT + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #0,d0 + move.w d0,bltamod(a5) + move.l a0,bltapt(a5) + move.l pd_CurrPlanesPtr(a6),bltdpt(a5) + move.w #((3*BLENDVIEW_WIDTH)>>4)|((BLENDVIEW_HEIGHT*2)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +bln_clear_clip_buffers: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_ClipDotsBuffer(a6),bltdpt(a5) + move.w #((BLENDVIEW_WIDTH)>>4)|((BLENDVIEW_HEIGHT*2)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +bln_intro: + PUTMSG 10,<"%d: Intro (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + CALLFW SetBlitterQueueSingleFrame + + bsr bln_clear_db_buffers + bsr bln_flip_db_frame + bsr bln_create_intro_copperlist + bsr bln_flip_db_frame + bsr bln_create_intro_copperlist + bsr bln_update_copper_list_pointers + + lea bln_a_part_sequence(pc),a0 + bsr bln_load_part_sequences + + lea .script(pc),a0 + CALLFW InstallMusicScript + +.loop CALLFW VSyncWithTask + bsr bln_flip_db_frame + + CALLFW CheckMusicScript + + lea pd_BQBuffer(a6),a4 + + bsr bln_handle_parts + move.w d7,pd_SequenceBlocksLeft(a6) + bne.s .noallownext + PUTMSG 30,<"%d: Sequence done! (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #3,pd_AllowLoadLastImage(a6) +.noallownext + + TERMINATE_BLITTER_QUEUE + ;lea pd_BQBuffer(a6),a0 + ;sub.l a0,a4 + ;PUTMSG 10,<"Queue size %ld">,a4 + + BLTWAIT + lea pd_BQBuffer(a6),a0 + cmp.l a0,a4 + beq.s .skiptrigger + CALLFW TriggerCustomBlitterQueue +.skiptrigger + + CALLFW JoinBlitterQueue + + bsr bln_update_copper_list_pointers + + cmp.w #4656,fw_MusicFrameCount(a6) + blt .loop + + tst.w pd_SequenceBlocksLeft(a6) + bne.s .loop + + rts + +.script + dc.w 4272,.load_seq_b-* + dc.w 0 + +.load_seq_b + cmp.w #2,pd_TCPicsDone(a6) + bge.s .nowait + + PUTMSG 10,<"%d: Waiting for 2nd pic (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) +.wait + CALLFW VSyncWithTask + cmp.w #2,pd_TCPicsDone(a6) + blt.s .wait + +.nowait + PUTMSG 10,<"%d: Intro B sequence (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + + lea bln_b_part_sequence(pc),a0 + bsr bln_load_part_sequences + rts + +;-------------------------------------------------------------------- + +bln_bars: + PUTMSG 10,<"%d: Bars (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + + CALLFW SetBlitterQueueSingleFrame + + move.l pd_TrueColorImage3(a6),a0 + move.l pd_TrueColor16Image(a6),a1 + bsr bln_prepare_tc16_data + + move.l pd_TrueColorImage2(a6),a0 + move.l pd_TrueColor16Image2(a6),a1 + bsr bln_prepare_tc16_data + + REPT 2 + CALLFW VSyncWithTask + bsr bln_flip_db_frame + bsr bln_create_bars_copperlist + move.l pd_OriginalImage2(a6),a0 + move.l pd_TrueColor16Image2(a6),a1 + bsr bln_prepare_striped_image + bsr bln_update_copper_list_pointers + ENDR + +.loop CALLFW VSyncWithTask + bsr bln_flip_db_frame + + bsr bln_draw_and_move_bars + + bsr bln_update_copper_list_pointers + + cmp.w #5040+30*6,fw_MusicFrameCount(a6) + blt .loop + + rts + +;-------------------------------------------------------------------- + +bln_holes: + PUTMSG 10,<"%d: Holes (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + + CALLFW SetBlitterQueueSingleFrame + + move.l pd_OriginalImage4(a6),pd_CurrGreetingsImage(a6) + move.l pd_TrueColorImage4(a6),pd_CurrGreetingsTCImage(a6) + move.w #18+17,pd_GreetingCount(a6) + bsr bln_prepare_circle_masks + + lea pd_SpeedCodeTask(a6),a1 + CALLFW WaitUntilTaskFinished + + REPT 2 + CALLFW VSyncWithTask + bsr bln_flip_db_frame + bsr bln_create_hole_copperlist + move.l pd_OriginalImage3(a6),a0 + bsr bln_copy_image_to_buffer + + move.l pd_CurrFixupBQPtr(a6),a4 + bsr bln_do_blitter_to_copper_fixup + bsr bln_update_copper_list_pointers + ENDR + + lea .script(pc),a0 + CALLFW InstallMusicScript + +.wait + CALLFW VSyncWithTask + cmp.w #5040+32*6,fw_MusicFrameCount(a6) + blt.s .wait + + PUTMSG 10,<"%d: Starting holes (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + BLTWAIT + + move.w fw_FrameCounter(a6),pd_OldFrameCount(a6) +.loop CALLFW VSyncWithTask + bsr bln_flip_db_frame + + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l pd_CurrFixupBQPtr(a6),a0 + CALLFW TriggerCustomBlitterQueue + + CALLFW CheckMusicScript + + move.w fw_FrameCounter(a6),d0 + move.w d0,d1 + sub.w pd_OldFrameCount(a6),d1 + move.w d0,pd_OldFrameCount(a6) + move.w d1,pd_FrameInc(a6) + PUTMSG 20,<"%d: Inc %d">,d0,d1 + + bsr bln_do_all_circle_calc_updates + + CALLFW JoinBlitterQueue + + bsr bln_restore_necessary_circle_backgrounds + + bsr bln_draw_all_circle_pots + + BLTHOGON + BLTWAIT + BLTHOGOFF + + bsr bln_do_all_circle_ham_fixups + + bsr bln_update_copper_list_pointers_safe + + tst.w pd_GreetingCount(a6) + bne.s .loop + + move.w #$00d0,bln_ddfstop+2 + move.w #$0000,bln_fmode+2 + + rts + +.script + dc.w 4,.agaboost-* + dc.w 5808+48*6,.flash-* + dc.w 5808+52*6,.flash-* + dc.w 5808+56*6,.flash-* + dc.w 5808+60*6,.flash-* + dc.w 6192,.loadgreetings-* + dc.w 0 + +.agaboost + tst.w fw_AgaChipset(a6) + beq.s .noaga + move.w #$00a0,bln_ddfstop+2 + move.w #$0003,bln_fmode+2 +.noaga + +.flash + move.w #32,pd_BeatRadAdd(a6) + rts + +.loadgreetings + PUTMSG 10,<"%d: Allow Loading of Image 5 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #5,pd_AllowLoadLastImage(a6) + lea pd_CirclePots(a6),a4 + lea bln_circle_greetings_scripts(pc),a0 + moveq.l #0,d1 +.scriptloop + move.w (a0)+,d0 + beq.s .donescripts + lea -2(a0,d0.w),a1 + move.l a1,cp_PotScriptPtr(a4) + move.w d1,cp_TimeLeft(a4) + lea cp_SIZEOF(a4),a4 + bra.s .scriptloop +.donescripts + rts + +;-------------------------------------------------------------------- + +bln_greetings: + PUTMSG 10,<"%d: Greetings (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + + IFD FW_DEMO_PART + lea .loader(pc),a0 + lea pd_PreparationTask(a6),a1 + CALLFW AddTask + ENDC + move.l pd_CurrPlanesPtr(a6),pd_CurrGreetingsImage(a6) + move.w #7*2+2*BLENDVIEW_HEIGHT*2,pd_CurrGreetingsPalOffset(a6) + + lea .script(pc),a0 + CALLFW InstallMusicScript + +.loop CALLFW VSyncWithTask + bsr bln_flip_db_frame + + CALLFW CheckMusicScript + + bsr bln_create_greetings_copperlist + bsr bln_update_copper_list_pointers + + cmp.w #7344+60*6,fw_MusicFrameCount(a6) + blt.s .loop + + CALLFW VSyncWithTask + bsr bln_create_andyou_copperlist + bsr bln_update_copper_list_pointers + + rts + + IFD FW_DEMO_PART +.loader + lea .endlogofile(pc),a0 + CALLFW FindFile + move.l pd_TrueColorImage2(a6),a0 + CALLFW LoadFileToBuffer + move.l pd_TrueColorImage2(a6),a0 + move.l pd_EndLogoBuffer(a6),a1 + CALLFW DecompressZX0 + PUTMSG 10,<"%d: Endlogo loaded/decompressed (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + rts + +.endlogofile + dc.b "Endlogo.raw",0 + even + ENDC + +.script + dc.w 7344+48*6,.load_page_1-* + dc.w 7344+51*6,.load_page_2-* + dc.w 7344+54*6,.load_page_1-* + dc.w 7344+56*6,.load_page_2-* + dc.w 7728+8*6,.stopmusic-* + dc.w 0 + +.load_page_1 + move.l pd_OriginalImage4(a6),pd_CurrGreetingsImage(a6) + move.w #7*2+3*BLENDVIEW_HEIGHT*2,pd_CurrGreetingsPalOffset(a6) + rts + +.load_page_2 + move.l pd_OriginalImage5(a6),pd_CurrGreetingsImage(a6) + move.w #7*2+4*BLENDVIEW_HEIGHT*2,pd_CurrGreetingsPalOffset(a6) + rts + +.stopmusic + CALLFW StopMusic + rts + +;-------------------------------------------------------------------- + +bln_endlogo: + IFD FW_DEMO_PART + lea pd_PreparationTask(a6),a1 + CALLFW WaitUntilTaskFinished + ENDC + + bsr bln_prep_p5p6_mask + bsr bln_prep_endlogo_start + + lea pd_EndLogoPalette(a6),a1 + move.w #$fff,d0 + moveq.l #16-1,d7 +.palloop + move.w d0,(a1)+ + dbra d7,.palloop + + bsr bln_init_shade_table + +.loop2 CALLFW VSyncWithTask + + CALLFW CheckMusicScript + + cmp.w #7728,fw_MusicFrameCount(a6) + blt.s .loop2 + + bsr bln_create_endlogo_copperlist + bsr bln_update_copper_list_pointers + + move.w fw_FrameCounter(a6),d0 + add.w #200,d0 + move.w d0,pd_PartCountDown(a6) + +.loop3 CALLFW VSyncWithTask + bsr bln_flip_db_frame + + CALLFW CheckMusicScript + + bsr bln_fade_step_from_white + bsr bln_palette_fade_step_from_white + + bsr bln_create_endlogo_copperlist + bsr bln_update_copper_list_pointers + + move.w fw_FrameCounter(a6),d0 + cmp.w pd_PartCountDown(a6),d0 + blt.s .loop3 + + move.w #17,pd_PartCountDown(a6) + +.loop4 CALLFW VSyncWithTask + bsr bln_flip_db_frame + + CALLFW CheckMusicScript + + bsr bln_fade_step_to_black + bsr bln_palette_fade_step_to_black + + bsr bln_create_endlogo_copperlist + bsr bln_update_copper_list_pointers + + subq.w #1,pd_PartCountDown(a6) + bne.s .loop4 + + rts + +;-------------------------------------------------------------------- + +bln_flip_db_frame: + move.l pd_CurrPlanesPtr(a6),pd_LastPlanesPtr(a6) + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + eor.w #BLENDVIEW_HEIGHT*2,pd_LineFixToggle(a6) + not.b pd_DbToggle(a6) + beq.s .selb1 + move.l pd_DbBuffer2(a6),pd_CurrPlanesPtr(a6) + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + lea pd_StaticFixup2BQBuffer(a6),a0 + move.l a0,pd_CurrFixupBQPtr(a6) + rts +.selb1 + move.l pd_DbBuffer1(a6),pd_CurrPlanesPtr(a6) + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + lea pd_StaticFixup1BQBuffer(a6),a0 + move.l a0,pd_CurrFixupBQPtr(a6) + rts + +;-------------------------------------------------------------------- + +bln_update_copper_list_pointers_safe: +.wait + move.l vposr(a5),d0 + and.l #$1ff00,d0 + cmp.l #(10)<<8,d0 + blt.s .wait +bln_update_copper_list_pointers: + lea bln_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +bln_prepare_circle_speedcode: + PUTMSG 10,<"%d: Preparing circle smc">,fw_FrameCounterLong(a6) + lea bln_circleinfo,a4 + move.l pd_CircleSpeedcodeBuffer(a6),a2 + move.l a2,a3 + add.l #CIRCLE_SPEEDCODE_SIZE/2,a3 + moveq.l #3,d7 +.rloop + tst.w (a4) + beq.s .done + + PUSHM a1-a4 + move.w d7,d0 + lea pd_MinMaxY(a6),a0 + PUTMSG 40,<"MinMax %p">,a0 + bsr bln_calc_circle + POPM + + move.w d7,d3 + mulu #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d3 + neg.w d3 + sub.w #(BLENDVIEW_WIDTH/2)/8,d3 + + move.w d7,d0 + add.w d0,d0 + add.w d0,d0 + lea pd_MinMaxY(a6),a0 + lea (BLENDVIEW_HEIGHT/2)*4(a0),a0 + suba.w d0,a0 + + move.w #%0000000110101000,d5 ; bclr dx,$yyyy(a0) + ;move.w #%0000000101101000,d5 ; bchg dx,$yyyy(a0) + move.l a2,ci_LeftDotClearCode(a4) + move.l a3,ci_RightDotClearCode(a4) + PUTMSG 40,<"Bclr %p %p">,a2,a3 + bsr bln_create_bset_bclr_code + + move.w #%0000000111101000,d5 ; bset dx,$yyyy(a0) + ;move.w #%0000000101101000,d5 ; bchg dx,$yyyy(a0) + move.l a2,ci_LeftDotSetCode(a4) + move.l a3,ci_RightDotSetCode(a4) + PUTMSG 40,<"Bset %p %p">,a2,a3 + bsr bln_create_bset_bclr_code + + move.l a2,ci_LeftTCCode(a4) + move.l a3,ci_RightTCCode(a4) + PUTMSG 40,<"move.w %p %p">,a2,a3 + bsr bln_create_tc_code + + lea ci_SIZEOF(a4),a4 + addq.w #1,d7 + bra.s .rloop +.done + suba.l pd_CircleSpeedcodeBuffer(a6),a2 + add.l a2,a2 + PUTMSG 10,<"%d: Done %ld bytes">,fw_FrameCounterLong(a6),a2 + CALLFW FlushCaches + rts + +;-------------------------------------------------------------------- + +bln_create_tc_code: + PUSHM d3/d7 + move.w d7,d3 + move.l #BLENDVIEW_WIDTH*2,d6 + mulu d6,d3 + neg.l d3 + sub.l #(BLENDVIEW_WIDTH/2)*2,d3 + move.w #%0011000011101010,d5 ; move.w x(a2),(a0)+ + add.w d7,d7 +.scloop + move.w (a0)+,d0 + add.w d0,d0 + add.w d3,d0 + move.w d5,(a2)+ + move.w d0,(a2)+ + + move.w (a0)+,d0 + ;addq.w #1,d0 + add.w d0,d0 + add.w d3,d0 + move.w d5,(a3)+ + move.w d0,(a3)+ + + add.w d6,d3 + dbra d7,.scloop + move.w #'Nu',(a2)+ + move.w #'Nu',(a3)+ + + POPM + rts + +;-------------------------------------------------------------------- + +bln_create_bset_bclr_code: + PUSHM a0/d3/d7 + move.w #7<<9,d2 + move.w #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d6 + add.w d7,d7 +.scloop + move.w (a0)+,d0 + move.w d0,d1 + asr.w #3,d1 + add.w d3,d1 + add.w d0,d0 + move.b d0,-(sp) + move.w (sp)+,d0 + and.w d2,d0 + or.w d5,d0 + move.w d0,(a2)+ + move.w d1,(a2)+ + + move.w (a0)+,d0 + ;addq.w #1,d0 + move.w d0,d1 + asr.w #3,d1 + add.w d3,d1 + add.w d0,d0 + move.b d0,-(sp) + move.w (sp)+,d0 + and.w d2,d0 + or.w d5,d0 + move.w d0,(a3)+ + move.w d1,(a3)+ + + add.w d6,d3 + dbra d7,.scloop + move.w #'Nu',(a2)+ + move.w #'Nu',(a3)+ + + POPM + rts + +;-------------------------------------------------------------------- + +bln_draw_circle_color_1_2: + move.l ci_LeftDotClearCode(a1),a2 + move.l ci_LeftDotSetCode(a1),a3 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + move.l ci_RightDotClearCode(a1),a2 + move.l ci_RightDotSetCode(a1),a3 + lea -5*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jmp (a2) + +;-------------------------------------------------------------------- + +bln_draw_circle_color_3_4: + move.l ci_LeftDotClearCode(a1),a2 + move.l ci_LeftDotSetCode(a1),a3 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + move.l ci_RightDotClearCode(a1),a2 + move.l ci_RightDotSetCode(a1),a3 + lea -5*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jmp (a2) + +;-------------------------------------------------------------------- + +bln_draw_circle_color_5_6: + move.l ci_LeftDotClearCode(a1),a2 + move.l ci_LeftDotSetCode(a1),a3 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + move.l ci_RightDotClearCode(a1),a2 + move.l ci_RightDotSetCode(a1),a3 + lea -5*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jmp (a2) + +;-------------------------------------------------------------------- + +bln_draw_circle_color_7_8: + move.l ci_LeftDotClearCode(a1),a2 + move.l ci_LeftDotSetCode(a1),a3 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + move.l ci_RightDotClearCode(a1),a2 + move.l ci_RightDotSetCode(a1),a3 + lea -5*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a3) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jsr (a2) + lea 1*(BLENDVIEW_WIDTH/8)(a0),a0 + jmp (a2) + + +;-------------------------------------------------------------------- + +bln_prep_p5p6_mask: + move.l pd_EndLogoBuffer(a6),a0 + lea 4*(BLENDIMG_WIDTH/8)(a0),a0 + lea 1*(BLENDIMG_WIDTH/8)(a0),a1 + move.l pd_EndLogoP5P6Buffer(a6),a2 + moveq.l #-1,d0 + move.l #(((BLENDIMG_WIDTH*BLENDVIEW_PLANES-BLENDIMG_WIDTH)/8)<<16)|((BLENDIMG_WIDTH*BLENDVIEW_PLANES-BLENDIMG_WIDTH)/8),d1 + move.w #(BLENDIMG_WIDTH>>4)|(BLENDIMG_HEIGHT<<6),d3 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET ACD,BLT_A|BLT_C,0,0 + move.l d0,bltafwm(a5) + move.w d1,bltcmod(a5) + move.l d1,bltamod(a5) + move.l a0,bltapt(a5) + move.l a1,bltcpt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +bln_prep_endlogo_start: + move.l pd_EndLogoBuffer(a6),a0 + move.l pd_CurrPlanesPtr(a6),a1 + move.l pd_EndLogoP5P6Buffer(a6),a2 + moveq.l #-1,d0 + move.l #(((BLENDIMG_WIDTH*BLENDVIEW_PLANES-BLENDIMG_WIDTH)/8)<<16)|((BLENDIMG_WIDTH*BLENDVIEW_PLANES-BLENDIMG_WIDTH)/8),d1 + move.w #(BLENDIMG_WIDTH>>4)|(BLENDIMG_HEIGHT<<6),d3 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET ACD,BLT_A|BLT_C,0,0 + move.l d0,bltafwm(a5) + move.w d1,bltcmod(a5) + move.l d1,bltamod(a5) + move.l a2,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT 4 + lea 1*(BLENDIMG_WIDTH/8)(a0),a0 + lea 1*(BLENDIMG_WIDTH/8)(a1),a1 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a2,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + + rts + +;-------------------------------------------------------------------- + +bln_fade_step_to_black: + move.l pd_LastPlanesPtr(a6),a0 ; source p1 + move.l pd_CurrPlanesPtr(a6),a4 + lea 3*(BLENDIMG_WIDTH/8)(a4),a1 ; mask + move.l a1,d4 + lea 1*(BLENDIMG_WIDTH/8)(a0),a1 ; source p2 + lea 1*(BLENDIMG_WIDTH/8)(a1),a2 ; source p3 + lea 1*(BLENDIMG_WIDTH/8)(a2),a3 ; source p4 + + moveq.l #-1,d0 + move.l #(((BLENDIMG_WIDTH*BLENDIMG_PLANES-BLENDIMG_WIDTH)/8)<<16)|((BLENDIMG_WIDTH*BLENDIMG_PLANES-BLENDIMG_WIDTH)/8),d1 + move.w #(BLENDIMG_WIDTH>>4)|(BLENDIMG_HEIGHT<<6),d3 + + ; create mask -- all bits, that are not black + BLTHOGON + BLTWAIT + BLTCON_SET ABCD,(BLT_A|BLT_B|BLT_C),0,0 + move.l d0,bltafwm(a5) + move.l d1,bltcmod(a5) + move.l d1,bltamod(a5) + move.l a0,bltapt(a5) + move.l a1,bltbpt(a5) + move.l a2,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + BLTWAIT + BLTCON0_SET ABCD,(BLT_A|BLT_C)&BLT_B,0 + move.l d4,bltapt(a5) + move.l pd_EndLogoP5P6Buffer(a6),bltbpt(a5) + move.l a3,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + bra bln_fade_step_down + +;-------------------------------------------------------------------- + +bln_fade_step_from_white: + move.l pd_LastPlanesPtr(a6),a0 ; source p1 + move.l pd_EndLogoBuffer(a6),a1 + move.l pd_CurrPlanesPtr(a6),a4 + lea 3*(BLENDIMG_WIDTH/8)(a4),a2 ; mask + move.l a2,d4 ; target p4 as temp mask + + moveq.l #-1,d0 + move.l #(((BLENDIMG_WIDTH*BLENDIMG_PLANES-BLENDIMG_WIDTH)/8)<<16)|((BLENDIMG_WIDTH*BLENDIMG_PLANES-BLENDIMG_WIDTH)/8),d1 + move.w #(BLENDIMG_WIDTH>>4)|(BLENDIMG_HEIGHT<<6),d3 + + ; create mask -- all bits, that are NOT equal + BLTHOGON + BLTWAIT + BLTCON_SET ACD,(BLT_A^BLT_C),0,0 + move.l d0,bltafwm(a5) + move.l d1,bltcmod(a5) + move.l d1,bltamod(a5) + move.l a0,bltapt(a5) + move.l a1,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT 3 + lea (BLENDIMG_WIDTH/8)(a0),a0 ; source p2/p3/p4 + lea (BLENDIMG_WIDTH/8)(a1),a1 ; original p2/p3/p4 + + BLTWAIT + BLTCON0_SET ABCD,(BLT_A^BLT_C)|BLT_B,0 + move.l a0,bltapt(a5) + move.l d4,bltbpt(a5) + move.l a1,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + ;bra bln_fade_step_down + +;-------------------------------------------------------------------- + +bln_fade_step_down: + move.l pd_LastPlanesPtr(a6),a0 ; source p1 + move.l pd_CurrPlanesPtr(a6),a4 + lea (BLENDIMG_WIDTH/8)(a0),a1 ; source p2 + lea (BLENDIMG_WIDTH/8)(a1),a2 ; source p3 + lea (BLENDIMG_WIDTH/8)(a2),a3 ; source p4 + + ; plane 1: p1n = p1o ^ mask + BLTWAIT + BLTCON0_SET ACD,BLT_A^BLT_C,0 + move.l d4,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; update mask: mask = p1n & mask + BLTWAIT + BLTCON0_SET ACD,BLT_A&BLT_C,0 + move.l d4,bltapt(a5) + move.l a4,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; plane 2: p2n = p2o ^ mask + lea (BLENDIMG_WIDTH/8)(a4),a4 + BLTWAIT + BLTCON0_SET ACD,BLT_A^BLT_C,0 + move.l d4,bltapt(a5) + move.l a1,bltcpt(a5) + move.l a4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; update mask: mask = p2n & mask + BLTWAIT + BLTCON0_SET ACD,BLT_A&BLT_C,0 + move.l d4,bltapt(a5) + move.l a4,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; plane 3: p3n = p3o ^ mask + lea (BLENDIMG_WIDTH/8)(a4),a4 + BLTWAIT + BLTCON0_SET ACD,BLT_A^BLT_C,0 + move.l d4,bltapt(a5) + move.l a2,bltcpt(a5) + move.l a4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; plane 4: p4n = p4o ^ (p3n & mask) + BLTWAIT + BLTHOGOFF + BLTCON0_SET ABCD,BLT_C^(BLT_A&BLT_B),0 + move.l d4,bltapt(a5) + move.l a4,bltbpt(a5) + move.l a3,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +bln_prepare_circle_masks: + PUTMSG 10,<"%d: Preparing circle masks">,fw_FrameCounterLong(a6) + bsr bln_clear_clip_buffers + BLTWAIT + + lea bln_circleinfo,a4 + lea pd_CircleInfos(a6),a2 + move.l pd_CircleMasksBuffer(a6),a3 + moveq.l #3,d7 +.rloop + tst.w (a4) + beq.s .done + + move.l a4,(a2)+ + + PUSHM a2-a4/d7 + move.w d7,d0 + lea pd_MinMaxY(a6),a0 + bsr bln_calc_circle + POPM + + lea pd_MinMaxY(a6),a0 + move.l pd_ClipDotsBuffer(a6),a1 + move.w d7,d0 + bsr bln_plot_circle + + move.w d7,d0 + bsr bln_fill_circle + + ; inner top position + move.w ci_LRIAreaY(a4),d0 + mulu #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d0 + move.l d0,d2 + move.w d0,ci_LeftBgOffset(a4) + move.w d0,ci_RightBgOffset(a4) + + ; bg offset, relative to top/left + add.w ci_InnerXOffset(a4),d0 + move.w d0,ci_InnerBgOffset(a4) + + ; fg offset, relative to center (usually a negative offset) + moveq.l #(BLENDVIEW_HEIGHT/2),d0 + sub.w ci_LRIAreaY(a4),d0 + mulu #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d0 + neg.w d0 + move.w d0,ci_LeftFgOffset(a4) ; fix x offset later + move.w d0,ci_RightFgOffset(a4) + + moveq.l #(BLENDVIEW_WIDTH/2)/8,d1 + sub.w ci_InnerXOffset(a4),d1 + sub.w d1,d0 + move.w d0,ci_InnerFgOffset(a4) + + tst.w ci_TopWidth(a4) + beq.s .skiptop + + bsr bln_store_circle_top_mask +.skiptop + + tst.w ci_LeftWidth(a4) + beq.s .skipleft + + bsr bln_store_circle_left_mask +.skipleft + + tst.w ci_RightWidth(a4) + beq.s .skipright + + bsr bln_store_circle_right_mask +.skipright + + lea pd_MinMaxY(a6),a0 + move.l pd_ClipDotsBuffer(a6),a1 + move.w d7,d0 + bsr bln_plot_circle + + lea ci_SIZEOF(a4),a4 + addq.w #1,d7 + bra.s .rloop + +.done suba.l pd_CircleMasksBuffer(a6),a3 + PUTMSG 10,<"%d: Done %ld bytes">,fw_FrameCounterLong(a6),a3 + rts + +;-------------------------------------------------------------------- + +bln_store_circle_left_mask: + move.w ci_LeftXOffset(a4),d0 + add.w d0,ci_LeftBgOffset(a4) + moveq.l #(BLENDVIEW_WIDTH/2)/8,d1 + sub.w d0,d1 + sub.w d1,ci_LeftFgOffset(a4) + + move.l pd_ClipFillBuffer(a6),a1 + adda.w d0,a1 + move.w ci_LRIAreaY(a4),d0 + moveq.l #(BLENDVIEW_HEIGHT/2),d3 + sub.w d0,d3 ; height + add.w d3,d3 + add.w #1,d3 + mulu #BLENDVIEW_WIDTH/8,d0 + adda.w d0,a1 + + move.w ci_LeftWidth(a4),d0 + move.w d0,d2 + mulu d3,d2 + add.w d2,d2 ; size in bytes + + moveq.l #BLENDVIEW_WIDTH/16,d4 + sub.w d0,d4 + add.w d4,d4 ; source modulo + swap d4 + + lsl.w #6,d3 + add.w d0,d3 + + move.l a3,ci_LeftMask(a4) + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + move.l d4,bltamod(a5) + move.l a1,bltapt(a5) + move.l a3,bltdpt(a5) + move.w d3,bltsize(a5) + + move.w d3,ci_LeftBltSize(a4) + + adda.w d2,a3 + rts + +;-------------------------------------------------------------------- + +bln_store_circle_right_mask: + move.w ci_RightXOffset(a4),d0 + add.w d0,ci_RightBgOffset(a4) + moveq.l #(BLENDVIEW_WIDTH/2)/8,d1 + sub.w d0,d1 + sub.w d1,ci_RightFgOffset(a4) + + move.l pd_ClipFillBuffer(a6),a1 + adda.w d0,a1 + move.w ci_LRIAreaY(a4),d0 + moveq.l #(BLENDVIEW_HEIGHT/2),d3 + sub.w d0,d3 ; height + add.w d3,d3 + add.w #1,d3 + mulu #BLENDVIEW_WIDTH/8,d0 + adda.w d0,a1 + + move.w ci_RightWidth(a4),d0 + move.w d0,d2 + mulu d3,d2 + add.w d2,d2 ; size in bytes + + moveq.l #BLENDVIEW_WIDTH/16,d4 + sub.w d0,d4 + add.w d4,d4 ; source modulo + swap d4 + + lsl.w #6,d3 + add.w d0,d3 + + move.l a3,ci_RightMask(a4) + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + move.l d4,bltamod(a5) + move.l a1,bltapt(a5) + move.l a3,bltdpt(a5) + move.w d3,bltsize(a5) + + move.w d3,ci_RightBltSize(a4) + + adda.w d2,a3 + rts + +;-------------------------------------------------------------------- + +bln_store_circle_top_mask: + moveq.l #(BLENDVIEW_HEIGHT/2),d0 + sub.w d7,d0 + move.w d0,d1 + mulu #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d1 + move.w d1,d4 + move.w ci_TopXOffset(a4),d2 + add.w d2,d1 + move.w d1,ci_TopBgOffset(a4) + + moveq.l #(BLENDVIEW_HEIGHT/2)+1,d3 + add.w d7,d3 + sub.w ci_TopHeight(a4),d3 + mulu #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d3 + sub.w #5*(BLENDVIEW_WIDTH/8),d3 + sub.w d4,d3 + move.w d3,ci_TopBottomOffsetAdv(a4) + + move.w d7,d1 + mulu #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d1 + neg.w d1 + + moveq.l #(BLENDVIEW_WIDTH/2)/8,d3 + sub.w d2,d3 + sub.w d3,d1 + move.w d1,ci_TopFgOffset(a4) + + move.l pd_ClipFillBuffer(a6),a1 + adda.w d2,a1 + + mulu #BLENDVIEW_WIDTH/8,d0 + adda.l d0,a1 + + move.w ci_TopWidth(a4),d0 + move.w d0,d1 + mulu ci_TopHeight(a4),d1 + add.w d1,d1 + move.w d1,ci_TopBottomMaskSize(a4) + + moveq.l #BLENDVIEW_WIDTH/16,d4 + sub.w d0,d4 + add.w d4,d4 ; source modulo + swap d4 + + move.w ci_TopHeight(a4),d3 + lsl.w #6,d3 + add.w d0,d3 + move.w d3,ci_TopBottomBltSize(a4) + + move.l a3,ci_TopMask(a4) + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + move.l d4,bltamod(a5) + move.l a1,bltapt(a5) + move.l a3,bltdpt(a5) + move.w d3,bltsize(a5) + + adda.w d1,a3 + rts + +;-------------------------------------------------------------------- + +bln_fill_circle: + move.w d0,d3 + move.l pd_ClipDotsBuffer(a6),a1 + move.l pd_ClipFillBuffer(a6),a0 + lea (BLENDVIEW_HEIGHT/2)*(BLENDVIEW_WIDTH/8)-2(a1),a1 + lea (BLENDVIEW_HEIGHT/2)*(BLENDVIEW_WIDTH/8)-2(a0),a0 + moveq.l #BLENDVIEW_WIDTH/8,d4 + mulu d4,d0 + adda.l d0,a1 + adda.l d0,a0 + + move.w #(BLENDVIEW_WIDTH/2)+1+15,d1 + move.w #(BLENDVIEW_WIDTH/2),d2 + add.w d3,d1 ; right border + sub.w d3,d2 ; left border + lsr.w #4,d1 + add.w d1,d1 + adda.w d1,a1 + adda.w d1,a0 + + lsr.w #4,d2 + add.w d2,d2 + sub.w d1,d2 + neg.w d2 ; width + + sub.w d2,d4 ; modulo + + add.w d3,d3 + addq.w #1,d3 ; h = 2*r+1 + lsl.w #6,d3 + lsr.w #1,d2 + add.w d2,d3 ; bltsize + + BLTHOGON + BLTWAIT + + BLTCON_SET_X AD,BLT_A,0,0,BLTCON1F_EFE|BLTCON1F_DESC + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.w d4,bltamod(a5) + move.w d4,bltdmod(a5) + move.l a1,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + rts + +;-------------------------------------------------------------------- +; d0.w = r + +bln_calc_circle: + lea (BLENDVIEW_HEIGHT/2)*4(a0),a0 ; y (addr) + move.w d0,d1 ; dx = r + add.w d1,d1 + add.w d1,d1 + move.l a0,a2 ; y + dy (addr increases over time) + lea 4(a0),a3 ; y - dy (addr decreases over time) PRE-DECREMENT! + lea 4(a0,d1.w),a1 ; y + dx (addr decreases over time) PRE-DECREMENT! + sub.w d1,a0 ; y - dx (addr increases over time) + ;MinMax done $00c12ec8, $00c12f34, $00c12f38, $00c12ec4 + PUTMSG 30,<"MinMax buffer %p, %p, %p, %p">,a0,a1,a2,a3 + moveq.l #0,d1 ; dy + move.w d0,d2 + lsr.w #4,d2 ; t1 = r / 16 + move.w #(BLENDVIEW_WIDTH/2),d5 + sub.w d0,d2 +.loop add.w d0,d2 + + cmp.w d0,d1 + bgt.s .done + +.loop2 + PUTMSG 40,<"dx,dy %d,%d">,d0,d1 + move.w d5,d3 + sub.w d0,d3 ; x - dx + move.w d5,d4 + add.w d0,d4 ; x + dx + + PUTMSG 50,<"min[y + dy = y + %d] = x - dx = %d - %d = %d (%x)]">,d1,d5,d0,d3,d3 + PUTMSG 50,<"max[y + dy = y + %d] = x + dx = %d + %d = %d (%x)]">,d1,d5,d0,d4,d4 + PUTMSG 50,<"min[y - dy = y - %d] = x - dx = %d - %d = %d (%x)]">,d1,d5,d0,d3,d3 + PUTMSG 50,<"max[y - dy = y - %d] = x + dx = %d + %d = %d (%x)]">,d1,d5,d0,d4,d4 + move.w d4,-(a3) ; maxX[y - dy] = x + dx + move.w d3,-(a3) ; minX[y - dy] = x - dx + move.w d3,(a2)+ ; minX[y + dy] = x - dx + move.w d4,(a2)+ ; maxX[y + dy] = x + dx + + addq.w #1,d1 ; dy++ + add.w d1,d2 ; t1 += dy + sub.w d0,d2 ; t1 = t1 - dx + bmi.s .loop + + subq.w #1,d1 ; dy-- + move.w d5,d3 + sub.w d1,d3 ; x - dy + move.w d5,d4 + add.w d1,d4 ; x + dy + addq.w #1,d1 ; dy++ + + PUTMSG 50,<"min[y + dx = y + %d] = x - dy = %d - %d = %d (%x)]">,d0,d5,d1,d3,d3 + PUTMSG 50,<"max[y + dx = y + %d] = x + dy = %d + %d = %d (%x)]">,d0,d5,d1,d4,d4 + PUTMSG 50,<"min[y - dx = y - %d] = x - dy = %d - %d = %d (%x)]">,d0,d5,d1,d3,d3 + PUTMSG 50,<"max[y - dx = y - %d] = x + dy = %d + %d = %d (%x)]">,d0,d5,d1,d4,d4 + move.w d4,-(a1) ; maxX[y + dx] = x + dy + move.w d3,-(a1) ; minX[y + dx] = x - dy + move.w d3,(a0)+ ; minX[y - dx] = x - dy + move.w d4,(a0)+ ; maxX[y - dx] = x + dy + + subq.w #1,d0 ; dx-- + cmp.w d0,d1 + ble.s .loop2 + +.done PUTMSG 30,<"MinMax done %p, %p, %p, %p">,a0,a1,a2,a3 + rts + +;-------------------------------------------------------------------- + +bln_plot_circle: + lea (BLENDVIEW_HEIGHT/2)*4(a0),a0 + lea (BLENDVIEW_HEIGHT/2)*(BLENDVIEW_WIDTH/8)(a1),a1 + moveq.l #BLENDVIEW_WIDTH/8,d3 + move.w d0,d2 + mulu d3,d2 + sub.l d2,a1 + + add.w d0,d0 + move.w d0,d1 + add.w d1,d1 + sub.w d1,a0 +.yloop + REPT 2 + move.w (a0)+,d1 + move.w d1,d2 + lsr.w #3,d2 + not.w d1 + bchg d1,(a1,d2.w) + ENDR + add.w d3,a1 + dbra d0,.yloop + rts + +;-------------------------------------------------------------------- + +bln_update_circle_pot_info: + move.w cp_Pair(a4),d0 + lea .circle_fixup_table(pc,d0.w),a0 + move.l (a0)+,cp_CircleFixupRoutine(a4) + move.l (a0)+,d4 + + movem.w cp_Radius(a4),d1-d3 + ;move.w cp_CenterPosX(a4),d2 + ;move.w cp_CenterPosY(a4),d3 + move.w d1,d0 + cmp.w #MIN_CIRCLE_SIZE,d0 + blt.s .skip + add.w d1,d1 + add.w d1,d1 + lea pd_CircleInfos(a6),a1 + move.l -MIN_CIRCLE_SIZE*4(a1,d1.w),a1 + move.l a1,cp_CircleInfo(a4) + + move.w d3,d1 + sub.w d0,d1 + add.w d1,d1 + add.w d4,d1 + move.w d1,cp_LineFixTopYOffset(a4) + + move.w d3,d1 + mulu #BLENDVIEW_WIDTH,d1 + add.l d2,d1 + add.l d1,d1 + move.l d1,cp_PosTCOffset(a4) + + move.w d3,d1 + mulu #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d1 + move.w d2,d0 + asr.w #4,d0 + add.w d0,d0 + add.w d0,d1 + move.l d1,cp_PosOffset(a4) +.skip + rts + +.circle_fixup_table + dc.l bln_draw_circle_color_1_2,0*BLENDVIEW_HEIGHT*4*2 + dc.l bln_draw_circle_color_3_4,1*BLENDVIEW_HEIGHT*4*2 + dc.l bln_draw_circle_color_5_6,2*BLENDVIEW_HEIGHT*4*2 + dc.l bln_draw_circle_color_7_8,3*BLENDVIEW_HEIGHT*4*2 + +;-------------------------------------------------------------------- + +bln_restore_necessary_circle_backgrounds: + lea pd_CirclePots(a6),a4 + moveq.l #-1,d5 + moveq.l #NUM_CIRCLE_POTS-1,d7 +.loop + tst.l cp_InvertedOffset(a4) + bne.s .skip + + move.w cp_LastLastRadius(a4),d1 + cmp.w cp_Radius(a4),d1 + blt.s .skip + cmp.w #MIN_CIRCLE_SIZE,d1 + blt.s .skip + + add.w d1,d1 + add.w d1,d1 + lea pd_CircleInfos(a6),a1 + move.l -MIN_CIRCLE_SIZE*4(a1,d1.w),a1 + + move.l pd_CurrPlanesPtr(a6),a0 + move.l cp_BgImage(a4),a2 + move.l cp_LastLastPosOffset(a4),d0 + sub.l #(BLENDVIEW_HEIGHT/2)*(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES+(BLENDVIEW_WIDTH/2)/8,d0 + adda.l d0,a0 + adda.l d0,a2 + + move.w ci_RightBltSize(a1),d3 + beq.s .skipright + + PUSHM a0/a2 + move.w ci_RightBgOffset(a1),d0 + adda.w d0,a0 + adda.w d0,a2 + + move.w ci_RightWidth(a1),d1 + sub.w d1,d3 + add.w d3,d3 + move.w d3,d0 + add.w d3,d3 + add.w d0,d3 + add.w d1,d3 ; * BLENDVIEW_PLANES + + moveq.l #(BLENDVIEW_WIDTH/16),d0 + sub.w d1,d0 + add.w d0,d0 + + lea bltcon0(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0,(a3)+ + ;BLTCON_SET D,0,0,0,(a3)+ + move.l d5,(a3)+ ; bltafwm/bltalwm + move.w d0,bltamod(a5) + move.w d0,bltdmod(a5) + addq.l #8,a3 + move.l a2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + POPM + +.skipright + move.w ci_TopBottomBltSize(a1),d3 + beq.s .skiptopbottom + + PUSHM a0/a2 + move.w ci_TopBgOffset(a1),d0 + adda.w d0,a0 + adda.w d0,a2 + + move.w ci_TopWidth(a1),d1 + sub.w d1,d3 + add.w d3,d3 + move.w d3,d0 + add.w d3,d3 + add.w d0,d3 + add.w d1,d3 ; * BLENDVIEW_PLANES + + moveq.l #(BLENDVIEW_WIDTH/16),d0 + sub.w d1,d0 + add.w d0,d0 ; modulo + + lea bltcon0(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0,(a3)+ + ;BLTCON_SET D,0,0,0,(a3)+ + move.l d5,(a3)+ ; bltafwm/bltalwm + move.w d0,bltamod(a5) + move.w d0,bltdmod(a5) + addq.l #8,a3 + move.l a2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + + moveq.l #0,d0 + move.w ci_TopBottomOffsetAdv(a1),d0 + add.w #5*(BLENDVIEW_WIDTH/8),d0 + adda.l d0,a0 + adda.l d0,a2 + + lea bltapt(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + POPM + +.skiptopbottom + move.w ci_LeftBltSize(a1),d3 + beq.s .skipleft + + move.w ci_LeftBgOffset(a1),d0 + adda.w d0,a0 + adda.w d0,a2 + + move.w ci_LeftWidth(a1),d1 + sub.w d1,d3 + add.w d3,d3 + move.w d3,d0 + add.w d3,d3 + add.w d0,d3 + add.w d1,d3 ; * BLENDVIEW_PLANES + + moveq.l #(BLENDVIEW_WIDTH/16),d0 + sub.w d1,d0 + add.w d0,d0 + + lea bltcon0(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0,(a3)+ + ;BLTCON_SET D,0,0,0,(a3)+ + move.l d5,(a3)+ ; bltafwm/bltalwm + move.w d0,bltamod(a5) + move.w d0,bltdmod(a5) + addq.l #8,a3 + move.l a2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + +.skipleft + +.skip + lea cp_SIZEOF(a4),a4 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_draw_all_circle_pots: + lea pd_CirclePots(a6),a4 + moveq.l #NUM_CIRCLE_POTS-1,d7 +.loop + cmp.w #MIN_CIRCLE_SIZE,cp_Radius(a4) + blt.s .skip + + move.l cp_FgImage(a4),a2 + add.l cp_FgOffset(a4),a2 + move.l cp_PosOffset(a4),d0 + sub.l #(BLENDVIEW_HEIGHT/2)*(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES+(BLENDVIEW_WIDTH/2)/8,d0 + move.l pd_CurrPlanesPtr(a6),a0 + move.l cp_BgImage(a4),a3 + adda.l d0,a0 + adda.l d0,a3 + + move.w cp_CircleShift(a4),pd_CircleShift(a6) + move.l cp_CircleInfo(a4),a1 + + PUSHM d7 + pea .retadd(pc) + move.l cp_PaintRoutine(a4),-(sp) + rts +.retadd + POPM +.skip + lea cp_SIZEOF(a4),a4 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_do_all_circle_calc_updates: + move.w pd_BeatRadAdd(a6),d0 + sub.w pd_FrameInc(a6),d0 + bge.s .noclip + moveq.l #0,d0 +.noclip move.w d0,pd_BeatRadAdd(a6) + + lea pd_CirclePots(a6),a4 + moveq.l #NUM_CIRCLE_POTS-1,d7 +.loop + move.w cp_LastRadius(a4),cp_LastLastRadius(a4) + move.l cp_LastPosOffset(a4),cp_LastLastPosOffset(a4) + move.w cp_Radius(a4),cp_LastRadius(a4) + move.l cp_PosOffset(a4),cp_LastPosOffset(a4) + move.w pd_FrameInc(a6),d0 + sub.w d0,cp_TimeLeft(a4) + bcc.s .nonoewscriptrout + PUTMSG 10,<"Potscript %p">,cp_PotScriptPtr(a4) + move.l cp_PotScriptPtr(a4),d1 + beq.s .nonoewscriptrout + move.l d1,a0 + move.w (a0)+,d1 + beq.s .nonoewscriptrout + add.w d1,cp_TimeLeft(a4) + move.w (a0)+,d0 + lea -2(a0,d0.w),a1 + move.l a0,cp_PotScriptPtr(a4) + jsr (a1) +.nonoewscriptrout + move.l cp_FrameRoutine(a4),d0 + beq.s .noframeroutine + move.l d0,a0 + jsr (a0) +.noframeroutine + + cmp.w #MIN_CIRCLE_SIZE,cp_Radius(a4) + blt.s .skip + + move.w cp_FgRelPosX(a4),d0 + move.w d0,d1 + moveq.l #15,d2 + move.w d0,d3 + add.w d2,d3 + asr.w #4,d3 + add.w d3,d3 + neg.w d0 + and.w d0,d2 + ror.w #4,d2 + move.w d2,cp_CircleShift(a4) + + add.w d1,d1 + ext.l d1 + move.w cp_FgRelPosY(a4),d0 + move.w d0,d2 + muls #BLENDVIEW_WIDTH*2,d0 + add.l d0,d1 + move.l d1,cp_FgTCOffset(a4) + + muls #(BLENDVIEW_WIDTH/8)*BLENDVIEW_PLANES,d2 + ext.l d3 + add.l d3,d2 + move.l d2,cp_FgOffset(a4) + + move.l cp_CircleInfo(a4),a1 + move.w ci_LRIAreaY(a1),cp_LRIAreaY(a4) + lea cp_SIZEOF(a4),a4 + dbra d7,.loop + rts + +.skip + moveq.l #(BLENDVIEW_HEIGHT/2),d0 + sub.w cp_Radius(a4),d0 + move.w d0,cp_LRIAreaY(a4) + + lea cp_SIZEOF(a4),a4 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_do_all_circle_ham_fixups: + lea pd_CirclePots(a6),a4 + moveq.l #7,d0 + moveq.l #6,d1 + moveq.l #5,d2 + moveq.l #4,d3 + moveq.l #3,d4 + moveq.l #2,d5 + moveq.l #1,d6 + moveq.l #NUM_CIRCLE_POTS-1,d7 +.loop + cmp.w #MIN_CIRCLE_SIZE,cp_Radius(a4) + blt.s .skip + + move.l cp_CircleInfo(a4),a1 + move.l cp_CircleFixupRoutine(a4),a3 + move.l pd_CurrPlanesPtr(a6),a0 + add.l cp_PosOffset(a4),a0 + swap d7 + jsr (a3) + swap d7 + +.skip + lea cp_SIZEOF(a4),a4 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_do_blitter_to_copper_fixup: + move.w pd_LineFixToggle(a6),d0 + eor.w #BLENDVIEW_HEIGHT*2,d0 + move.l pd_LineFix1Array(a6),a0 + adda.w d0,a0 + + move.l pd_LastCopListPtr(a6),a1 + adda.w pd_CopperChunkyOffset(a6),a1 + + FIRST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_linecopy,(a4)+ + move.l a0,(a4)+ + move.l a1,(a4)+ + + REPT 7 + addq.l #4,a1 + lea BLENDVIEW_HEIGHT*4(a0),a0 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_linecopy_more,(a4)+ + move.l a0,(a4)+ + move.l a1,(a4)+ + ENDR + + clr.l (a3) + + rts + +.bq_linecopy + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #COP_INST_PER_HOLE_LINE*4-2,d0 + move.l d0,bltamod(a5) +.bq_linecopy_more + move.l (a0)+,bltapt(a5) + move.l (a0)+,bltdpt(a5) + move.w #(BLENDVIEW_HEIGHT<<6)|1,bltsize(a5) + rts + +;-------------------------------------------------------------------- + +bln_draw_stenciled_circle: + moveq.l #0,d7 + moveq.l #0,d5 + subq.w #1,d5 + move.w ci_RightBltSize(a1),d3 + beq.s .skipright + + PUSHM a0/a2-a4 + addq.w #1,d3 + + move.w ci_RightBgOffset(a1),d0 + lea -2(a0,d0.w),a0 ; target + lea -2(a3,d0.w),a3 ; source + adda.w ci_RightFgOffset(a1),a2 + subq.w #2,a2 + + ; mask in A, source in B, background in C + moveq.l #(BLENDVIEW_WIDTH/16)*BLENDVIEW_PLANES-1,d0 + sub.w ci_RightWidth(a1),d0 + add.w d0,d0 + + move.l ci_RightMask(a1),d2 + subq.l #2,d2 + moveq.l #(BLENDVIEW_WIDTH/8),d6 + + lea bltcon0(a5),a4 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET ABCD,((BLT_A&BLT_B)|(~BLT_A&BLT_C)),0,(a4)+ + move.w pd_CircleShift(a6),(a4)+ ; bltcon1 + move.l d5,(a4)+ ; bltafwm/bltalwm + move.w d0,bltcmod(a5) + move.w d0,bltbmod(a5) + move.w #-2,bltamod(a5) + move.w d0,bltdmod(a5) + move.l a3,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 5 + adda.l d6,a0 + adda.l d6,a2 + adda.l d6,a3 + + lea bltcpt(a5),a4 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a3,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + POPM + +.skipright + move.w ci_InnerBltSize(a1),d3 + beq.s .skipinner + + PUSHM a0/a2-a3 + + moveq.l #0,d0 + add.w ci_InnerBgOffset(a1),a0 + subq.w #2,a0 + move.w ci_InnerBltMod(a1),d0 + adda.w ci_InnerFgOffset(a1),a2 + subq.w #2,a2 + + lea bltcon0(a5),a3 + tst.w ci_LeftBltSize(a1) + beq.s .damnitnoleft + + move.l #BLTEN_AD|BLT_A,d4 + or.w pd_CircleShift(a6),d4 + swap d4 + + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l d4,(a3)+ ; bltcon0 + move.w d5,(a3)+ ; bltafwm + move.w d5,(a3)+ ; bltalwm + move.w d0,bltamod(a5) + move.w d0,bltdmod(a5) + addq.l #8,a3 + move.l a2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + bra.s .continner + +.damnitnoleft + BLTHOGON + BLTWAIT + BLTCON0_SET BCD,((BLT_A&BLT_B)|(~BLT_A&BLT_C)),0,(a3)+ + move.w pd_CircleShift(a6),(a3)+ ; bltcon1 + move.l d5,(a3)+ ; bltafwm/bltalwm + move.w d5,bltadat(a5) + move.w d0,bltcmod(a5) + move.w d0,bltbmod(a5) + move.w d0,bltdmod(a5) + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + addq.l #4,a3 ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + +.continner + POPM + + bsr bln_do_circle_tc_fixup + +.skipinner + move.w ci_TopBottomBltSize(a1),d3 + beq.s .skiptopbottom + + PUSHM a0/a2-a4 + addq.w #1,d3 + + move.w ci_TopBgOffset(a1),d0 + lea -2(a0,d0.w),a0 ; target + lea -2(a3,d0.w),a3 ; source + adda.w ci_TopFgOffset(a1),a2 + subq.w #2,a2 + + ; mask in A, source in B, background in C + moveq.l #(BLENDVIEW_WIDTH/16)*BLENDVIEW_PLANES-1,d0 + sub.w ci_TopWidth(a1),d0 + add.w d0,d0 ; modulo + + move.l ci_TopMask(a1),d2 + subq.l #2,d2 + moveq.l #(BLENDVIEW_WIDTH/8),d6 + + lea bltcon0(a5),a4 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET ABCD,((BLT_A&BLT_B)|(~BLT_A&BLT_C)),0,(a4)+ + move.w pd_CircleShift(a6),(a4)+ ; bltcon1 + move.l d5,(a4)+ ; bltafwm/bltalwm + move.w d0,bltcmod(a5) + move.w d0,bltbmod(a5) + move.w #-2,bltamod(a5) + move.w d0,bltdmod(a5) + move.l a3,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 5 + adda.l d6,a0 + adda.l d6,a2 + adda.l d6,a3 + lea bltcpt(a5),a4 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a3,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + moveq.l #0,d0 + move.w ci_TopBottomOffsetAdv(a1),d0 + adda.l d0,a0 + adda.l d0,a2 + adda.l d0,a3 + + moveq.l #0,d0 + move.w ci_TopWidth(a1),d1 + add.w d1,d1 + move.w ci_TopBottomMaskSize(a1),d0 + sub.w d1,d0 + add.l d0,d2 + neg.w d1 + add.w d1,d1 + subq.w #2,d1 + + lea bltcpt(a5),a4 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.w d1,bltamod(a5) + move.l a3,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 5 + adda.l d6,a0 + adda.l d6,a2 + adda.l d6,a3 + lea bltcpt(a5),a4 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a3,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + POPM + +.skiptopbottom + move.w ci_LeftBltSize(a1),d3 + beq.s .skipleft + + PUSHM a4 + addq.w #1,d3 + + move.w ci_LeftBgOffset(a1),d0 + lea -2(a0,d0.w),a0 ; target + lea -2(a3,d0.w),a3 ; source + adda.w ci_LeftFgOffset(a1),a2 + subq.w #2,a2 + + ; mask in A, source in B, background in C + moveq.l #(BLENDVIEW_WIDTH/16)*BLENDVIEW_PLANES-1,d0 + sub.w ci_LeftWidth(a1),d0 + add.w d0,d0 + + move.l ci_LeftMask(a1),d2 + subq.l #2,d2 + moveq.l #(BLENDVIEW_WIDTH/8),d6 + + lea bltcon0(a5),a4 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET ABCD,((BLT_A&BLT_B)|(~BLT_A&BLT_C)),0,(a4)+ + move.w pd_CircleShift(a6),(a4)+ ; bltcon1 + move.l d5,(a4)+ ; bltafwm/bltalwm + move.w d0,bltcmod(a5) + move.w d0,bltbmod(a5) + move.w #-2,bltamod(a5) + move.w d0,bltdmod(a5) + move.l a3,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 5 + adda.l d6,a0 + adda.l d6,a2 + adda.l d6,a3 + lea bltcpt(a5),a4 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a3,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + POPM + +.skipleft + tst.l d7 + beq.s bln_do_circle_tc_fixup + rts + +;-------------------------------------------------------------------- + +bln_do_circle_tc_fixup: + PUSHM a0/a2-a3 + move.w cp_LineFixTopYOffset(a4),d1 + add.w pd_LineFixToggle(a6),d1 + + move.l cp_FgTCImage(a4),a2 + adda.l cp_FgTCOffset(a4),a2 + + move.l pd_LineFix1Array(a6),a0 + adda.w d1,a0 + move.l ci_LeftTCCode(a1),a3 + jsr (a3) + + move.l cp_BgTCImage(a4),a2 + move.l cp_InvertedOffset(a4),d0 + beq.s .notinverted + add.l cp_FgTCOffset-cp_SIZEOF(a4),d0 + add.l d0,a2 + bra.s .invcont +.notinverted + add.l cp_PosTCOffset(a4),a2 +.invcont + move.l pd_LineFix2Array(a6),a0 + adda.w d1,a0 + move.l ci_RightTCCode(a1),a3 + jsr (a3) + POPM + moveq.l #1,d7 + rts + +;-------------------------------------------------------------------- + +bln_draw_stenciled_circle_invert: + moveq.l #0,d5 + subq.w #1,d5 + move.w ci_RightBltSize(a1),d3 + beq.s .skipright + + PUSHM a0/a2 + addq.w #1,d3 + + move.w ci_RightBgOffset(a1),d0 + lea -2(a0,d0.w),a0 ; target + adda.w ci_RightFgOffset(a1),a2 + subq.w #2,a2 + + ; mask in A, source in B, background in C + moveq.l #(BLENDVIEW_WIDTH/16)*BLENDVIEW_PLANES-1,d0 + sub.w ci_RightWidth(a1),d0 + add.w d0,d0 + + move.l ci_RightMask(a1),d2 + subq.l #2,d2 + moveq.l #(BLENDVIEW_WIDTH/8),d6 + + lea bltcon0(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET ABCD,((BLT_A&BLT_B)|(~BLT_A&BLT_C)),0,(a3)+ + move.w pd_CircleShift(a6),(a3)+ ; bltcon1 + move.l d5,(a3)+ ; bltafwm/bltalwm + move.w d0,bltcmod(a5) + move.w d0,bltbmod(a5) + move.w #-2,bltamod(a5) + move.w d0,bltdmod(a5) + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + move.l d2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + + REPT 5 + adda.l d6,a0 + adda.l d6,a2 + + lea bltcpt(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + move.l d2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + ENDR + POPM + +.skipright + move.w ci_TopBottomBltSize(a1),d3 + beq.s .skiptopbottom + + PUSHM a0/a2 + addq.w #1,d3 + + move.w ci_TopBgOffset(a1),d0 + lea -2(a0,d0.w),a0 ; target + adda.w ci_TopFgOffset(a1),a2 + subq.w #2,a2 + + ; mask in A, source in B, background in C + moveq.l #(BLENDVIEW_WIDTH/16)*BLENDVIEW_PLANES-1,d0 + sub.w ci_TopWidth(a1),d0 + add.w d0,d0 ; modulo + + move.l ci_TopMask(a1),d2 + subq.l #2,d2 + moveq.l #(BLENDVIEW_WIDTH/8),d6 + + lea bltcon0(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET ABCD,((BLT_A&BLT_B)|(~BLT_A&BLT_C)),0,(a3)+ + move.w pd_CircleShift(a6),(a3)+ ; bltcon1 + move.l d5,(a3)+ ; bltafwm/bltalwm + move.w d0,bltcmod(a5) + move.w d0,bltbmod(a5) + move.w #-2,bltamod(a5) + move.w d0,bltdmod(a5) + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + move.l d2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + + REPT 5 + adda.l d6,a0 + adda.l d6,a2 + lea bltcpt(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + move.l d2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + ENDR + + moveq.l #0,d0 + move.w ci_TopBottomOffsetAdv(a1),d0 + adda.l d0,a0 + adda.l d0,a2 + + moveq.l #0,d0 + move.w ci_TopWidth(a1),d1 + add.w d1,d1 + move.w ci_TopBottomMaskSize(a1),d0 + sub.w d1,d0 + add.l d0,d2 + neg.w d1 + add.w d1,d1 + subq.w #2,d1 + + lea bltcpt(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.w d1,bltamod(a5) + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + move.l d2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + + REPT 5 + adda.l d6,a0 + adda.l d6,a2 + lea bltcpt(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + move.l d2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + ENDR + + POPM + +.skiptopbottom + move.w ci_LeftBltSize(a1),d3 + beq.s .skipleft + + PUSHM a0/a2 + addq.w #1,d3 + + move.w ci_LeftBgOffset(a1),d0 + lea -2(a0,d0.w),a0 ; target + adda.w ci_LeftFgOffset(a1),a2 + subq.w #2,a2 + + ; mask in A, source in B, background in C + moveq.l #(BLENDVIEW_WIDTH/16)*BLENDVIEW_PLANES-1,d0 + sub.w ci_LeftWidth(a1),d0 + add.w d0,d0 + + move.l ci_LeftMask(a1),d2 + subq.l #2,d2 + moveq.l #(BLENDVIEW_WIDTH/8),d6 + + lea bltcon0(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET ABCD,((BLT_A&BLT_B)|(~BLT_A&BLT_C)),0,(a3)+ + move.w pd_CircleShift(a6),(a3)+ ; bltcon1 + move.l d5,(a3)+ ; bltafwm/bltalwm + move.w d0,bltcmod(a5) + move.w d0,bltbmod(a5) + move.w #-2,bltamod(a5) + move.w d0,bltdmod(a5) + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + move.l d2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + + REPT 5 + adda.l d6,a0 + adda.l d6,a2 + lea bltcpt(a5),a3 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + move.l d2,(a3)+ ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + ENDR + + POPM + +.skipleft + move.w ci_InnerBltSize(a1),d3 + beq.s .skipinner + + moveq.l #0,d0 + add.w ci_InnerBgOffset(a1),a0 + subq.w #2,a0 + move.w ci_InnerBltMod(a1),d0 + adda.w ci_InnerFgOffset(a1),a2 + subq.w #2,a2 + + lea bltcon0(a5),a3 + BLTHOGON + BLTWAIT + BLTCON0_SET BCD,((BLT_A&BLT_B)|(~BLT_A&BLT_C)),0,(a3)+ + move.w pd_CircleShift(a6),(a3)+ ; bltcon1 + move.l d5,(a3)+ ; bltafwm/bltalwm + move.w d5,bltadat(a5) + move.w d0,bltcmod(a5) + move.w d0,bltbmod(a5) + move.w d0,bltdmod(a5) + move.l a0,(a3)+ ; bltcpt + move.l a2,(a3)+ ; bltbpt + addq.l #4,a3 ; bltapt + move.l a0,(a3)+ ; bltdpt + move.w d3,(a3)+ ; bltsize + +.skipinner + bsr bln_do_circle_tc_fixup + rts + +;-------------------------------------------------------------------- + +bln_draw_and_move_bars: + lea pd_Bars(a6),a1 + move.l pd_CurrPlanesPtr(a6),a2 + move.l pd_OriginalImage3(a6),a3 + move.l pd_OriginalImage2(a6),a4 + move.l pd_CurrCopListPtr(a6),a0 + adda.w pd_CopperChunkyOffset(a6),a0 + move.l a0,d4 + move.l pd_TrueColor16Image(a6),a0 + move.l pd_TrueColor16Image2(a6),d2 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A&~BLT_C,0,0 + move.l #-1,bltafwm(a5) ; also fills bltalwm + move.w #$8000,bltcdat(a5) + + moveq.l #NUM_BARS-1,d7 + moveq.l #NUM_BARS,d5 +.loop + subq.w #1,bd_Delay(a1) + bpl .skip + move.w bd_BarPos(a1),d1 + bmi.s .noendpos + subq.w #1,bd_EndPosCount(a1) + bpl.s .noendpos + subq.w #1,d5 + bra .skip +.noendpos + move.w #BLENDVIEW_HEIGHT,d3 + add.w d1,d3 + ble .skipmove + + move.w bd_LastLastBottomPos(a1),bd_LastLastLastBottomPos(a1) + move.w bd_LastBottomPos(a1),bd_LastLastBottomPos(a1) + move.w d3,bd_LastBottomPos(a1) + move.l a0,-(sp) + lsl.w #6,d3 + addq.w #1,d3 + + neg.w d1 + move.w d1,d6 + mulu #(BLENDVIEW_WIDTH/8)*BLENDIMG_PLANES,d1 + lea (a3,d1.l),a0 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A&~BLT_C,0,0 + move.l #(((BLENDIMG_WIDTH*BLENDIMG_PLANES-16)/8)<<16)|((BLENDVIEW_WIDTH-16)/8),bltamod(a5) + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + + mulu #BLOCKS_WIDTH*4,d6 + + REPT 2 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 + lea (BLENDVIEW_WIDTH/8)(a0),a0 + + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 + lea (BLENDVIEW_WIDTH/8)(a0),a0 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET AD,BLT_A|BLT_C,0 + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT 2 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 + lea (BLENDVIEW_WIDTH/8)(a0),a0 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A&~BLT_C,0,0 + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + + suba.l #5*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT,a2 + + move.w bd_LastBottomPos(a1),d0 + move.w bd_LastLastLastBottomPos(a1),d1 + sub.w d0,d1 + ble.s .noclr + + move.w d3,-(sp) + move.w #BLENDVIEW_HEIGHT,d3 + sub.w d0,d3 + + lsl.w #6,d3 + addq.w #1,d3 + + move.l d2,a0 + move.w d0,d1 + mulu #(BLENDVIEW_WIDTH/16)*2,d1 + adda.w d1,a0 + move.w d0,d1 + mulu #COP_INST_PER_BARS_LINE*4,d1 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET AD,BLT_A,0 + move.l #(((BLENDVIEW_WIDTH/16)*2-2)<<16)|(COP_INST_PER_BARS_LINE*4-2),bltamod(a5) + move.l a0,bltapt(a5) + move.l d4,a0 + adda.w d1,a0 + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + move.w d0,d1 + mulu #(BLENDVIEW_WIDTH/8),d0 + mulu #(BLENDIMG_WIDTH/8)*BLENDIMG_PLANES,d1 + + lea (a2,d0.l),a0 + adda.l d1,a4 + + BLTHOGON + BLTWAIT + BLTHOGOFF + + BLTCON_SET AD,BLT_A&~BLT_C,0,0 + move.l #(((BLENDIMG_WIDTH*BLENDIMG_PLANES-16)/8)<<16)|((BLENDVIEW_WIDTH-16)/8),bltamod(a5) + move.l a4,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT 2 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a0),a0 + lea (BLENDVIEW_WIDTH/8)(a4),a4 + + BLTHOGON + BLTWAIT + BLTHOGOFF + + move.l a4,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a0),a0 + lea (BLENDVIEW_WIDTH/8)(a4),a4 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET AD,BLT_A|BLT_C,0 + move.l a4,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT 2 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a0),a0 + lea (BLENDVIEW_WIDTH/8)(a4),a4 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A&~BLT_C,0,0 + move.l a4,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + + lea -5*(BLENDVIEW_WIDTH/8)(a4),a4 + suba.l d1,a4 + suba.l #5*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT,a0 + + move.w (sp)+,d3 + +.noclr + move.l (sp),a0 + + adda.l d6,a0 + + move.l bd_BarSpeed(a1),d6 + add.l d6,bd_BarPos(a1) + bmi.s .down + move.l #$4000,bd_BarPos(a1) + neg.l d6 + asr.l #1,d6 + move.l d6,d1 + asr.l #2,d1 + sub.l d1,d6 +.down + add.l #2000,d6 + move.l d6,bd_BarSpeed(a1) + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET AD,BLT_A,0 + move.l #(((BLENDVIEW_WIDTH/16)*2-2)<<16)|(COP_INST_PER_BARS_LINE*4-2),bltamod(a5) + move.l a0,bltapt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + move.l (sp)+,a0 + + bra.s .skip + +.skipmove + move.l bd_BarSpeed(a1),d6 + add.l d6,bd_BarPos(a1) + add.l #2000,d6 + move.l d6,bd_BarSpeed(a1) + +.skip + addq.l #2,a2 + addq.l #2,a3 + addq.l #2,a4 + addq.l #2,a0 + addq.l #2,d2 + addq.l #4,d4 + lea bd_SIZEOF(a1),a1 + dbra d7,.loop + move.l d5,d0 + rts + +;-------------------------------------------------------------------- + +bln_prepare_tc16_data: + move.w #((BLENDIMG_WIDTH/16)*BLENDIMG_HEIGHT)-1,d7 + moveq.l #16*2,d0 +.loop move.w (a0),(a1)+ + adda.w d0,a0 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_prepare_striped_image: + move.l pd_CurrPlanesPtr(a6),a2 + move.w #(BLENDVIEW_WIDTH>>4)|(BLENDVIEW_HEIGHT<<6),d3 + moveq.l #(BLENDVIEW_WIDTH/16)-1,d7 + moveq.l #-1,d0 + BLTHOGON + BLTWAIT + BLTHOGOFF + + BLTCON0_SET AD,BLT_A&~BLT_C,0 + move.l d0,bltafwm(a5) + move.w #(BLENDVIEW_WIDTH*BLENDVIEW_PLANES-BLENDVIEW_WIDTH)/8,bltamod(a5) + move.w #(BLENDVIEW_WIDTH-BLENDVIEW_WIDTH)/8,bltdmod(a5) + move.w #$8000,bltcdat(a5) + + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT 2 + lea (BLENDVIEW_WIDTH/8)(a0),a0 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + + lea (BLENDVIEW_WIDTH/8)(a0),a0 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET AD,BLT_A|BLT_C,0 + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + + lea (BLENDVIEW_WIDTH/8)(a0),a0 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET AD,BLT_A&~BLT_C,0 + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + + lea (BLENDVIEW_WIDTH/8)(a0),a0 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l a0,bltapt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + + move.l pd_CurrCopListPtr(a6),a0 + adda.w pd_CopperChunkyOffset(a6),a0 + move.w #(16>>4)|(BLENDVIEW_HEIGHT<<6),d3 + moveq.l #(BLENDVIEW_WIDTH/16)-1,d7 +.xloop + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON0_SET AD,BLT_A,0 + move.l #(((BLENDVIEW_WIDTH/16)*2-2)<<16)|(COP_INST_PER_BARS_LINE*4-2),bltamod(a5) + + move.l a1,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + addq.l #2,a1 + addq.l #4,a0 + dbra d7,.xloop + rts + +;-------------------------------------------------------------------- + +bln_load_part_sequences: + move.l a0,a2 + move.w (a0)+,d5 + move.w (a0)+,d6 + move.l (a0)+,d4 + lea pd_Parts(a6),a1 + moveq.l #BLOCKS_HEIGHT-1,d7 +.loop + move.w (a0)+,pbi_Phase(a1) + move.w (a0)+,d0 + lea (a2,d0.w),a3 + moveq.l #0,d0 + move.b (a3)+,d0 + move.l a3,pbi_SequencePtr(a1) + + move.w pbi_YPos(a1),d1 + PUSHM a0-a2/d4-d7 + move.l d4,a3 + move.l (a6,d5.w),a0 + move.l (a6,d6.w),a2 + move.l a0,pbi_OriginalImage(a1) + move.l a2,pbi_TrueColorImage(a1) + jsr (a3) + POPM + addq.w #1,d1 + lea pbi_SIZEOF(a1),a1 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_handle_parts: + lea pd_Parts(a6),a1 + moveq.l #BLOCKS_HEIGHT-1,d7 +.loop + tst.w pbi_Phase(a1) + bmi.s .skip + add.l #$10000,d7 + PUSHM a1/d7 + move.l pbi_PalApplyRoutine(a1),a0 + jsr (a0) + move.l pbi_PalChangeRoutine(a1),a0 + jsr (a0) + move.w pbi_Phase(a1),d0 + move.l pbi_PhaseSequence(a1),a0 + move.l (a0,d0.w),a0 + addq.w #4,d0 + move.w d0,pbi_Phase(a1) + jsr (a0) + POPM + bra.s .skipover +.skip addq.w #1,pbi_Phase(a1) +.skipover + lea pbi_SIZEOF(a1),a1 + dbra d7,.loop + swap d7 + rts + +;-------------------------------------------------------------------- + +bln_load_next_seq_part_in: + move.l pbi_SequencePtr(a1),a0 + moveq.l #0,d0 + move.w d0,pbi_Phase(a1) + move.b (a0)+,d0 + bmi.s .kill + move.l a0,pbi_SequencePtr(a1) + move.l pbi_OriginalImage(a1),a0 + move.l pbi_TrueColorImage(a1),a2 + move.w pbi_YPos(a1),d1 + bra bln_load_new_block_fade_in +.kill move.w #$8000,pbi_Phase(a1) + rts + +;-------------------------------------------------------------------- + +bln_load_next_seq_part_out_in: + move.l pbi_SequencePtr(a1),a0 + moveq.l #0,d0 + move.w d0,pbi_Phase(a1) + move.b (a0)+,d0 + bmi.s .kill + move.l a0,pbi_SequencePtr(a1) + move.l pbi_OriginalImage(a1),a0 + move.l pbi_TrueColorImage(a1),a2 + move.w pbi_YPos(a1),d1 + bra bln_load_new_block_fade_out_and_in +.kill move.w #$8000,pbi_Phase(a1) + rts + +;-------------------------------------------------------------------- + +bln_load_new_block_fade_in: + move.l a2,pbi_LastTrueColorImage(a1) + add.w d0,d0 + add.w d0,d0 + ; calculate screen offset + move.w d1,d2 + mulu #(BLENDVIEW_WIDTH/8)*PART_HEIGHT,d2 + move.l d2,d3 + add.w d0,d2 + move.l d2,pbi_ScreenOffset(a1) + + add.w d3,d3 + move.l d3,d2 + add.w d3,d2 + add.w d3,d2 + add.w d0,d2 + adda.l d2,a0 + move.l a0,pbi_SourceImgPtr(a1) + + ; init colors for fade-in + lea pbi_TargetColors(a1),a3 + lea bln_images_palette(pc),a0 + moveq.l #0,d2 + moveq.l #7-1,d7 +.primcloop + move.w d2,pbi_CurrentColors-pbi_TargetColors(a3) + move.w (a0)+,(a3)+ + dbra d7,.primcloop + + moveq.l #0,d3 + move.w d0,d3 + lsl.w #4,d3 + move.w d1,d2 + mulu #BLENDIMG_WIDTH*PART_HEIGHT*2,d2 + add.l d3,d2 + adda.l d2,a2 ; x*2+y*320*2 + + moveq.l #0,d2 + moveq.l #PART_HEIGHT-1,d7 +.edgeloop + move.w d2,pbi_CurrentColors-pbi_TargetColors(a3) + move.w (a2),(a3)+ + lea BLENDIMG_WIDTH*2(a2),a2 + dbra d7,.edgeloop + + ; calculate copper edge offset + move.w pbi_Copper7Offset(a1),d2 + add.w d0,d2 + add.w d0,d2 ; x * 8 + add.w #(7+1)*4,d2 + move.w d2,pbi_CopperEdgeOffset(a1) + + move.l #bln_fade_in_sequence,pbi_PhaseSequence(a1) + move.l #bln_palette_step_up,pbi_PalChangeRoutine(a1) + lea bln_palette_apply(pc),a0 + cmp.w #5,d1 + bne.s .nofix + lea bln_palette_apply_fix5(pc),a0 +.nofix + move.l a0,pbi_PalApplyRoutine(a1) + rts + +;-------------------------------------------------------------------- + +bln_load_new_block_fade_out_and_in: + add.w d0,d0 + add.w d0,d0 + ; calculate screen offset + move.w d1,d2 + mulu #(BLENDVIEW_WIDTH/8)*PART_HEIGHT,d2 + move.l d2,d3 + add.w d0,d2 + move.l d2,pbi_ScreenOffset(a1) + + add.w d3,d3 + move.l d3,d2 + add.w d3,d2 + add.w d3,d2 + add.w d0,d2 + adda.l d2,a0 + move.l a0,pbi_SourceImgPtr(a1) + + moveq.l #0,d3 + move.w d0,d3 + lsl.w #4,d3 + move.w d1,d2 + mulu #BLENDIMG_WIDTH*PART_HEIGHT*2,d2 + add.l d3,d2 + adda.l d2,a2 ; x*2+y*320*2 + + ; init new colors for fade-in + lea pbi_TargetColors+7*2(a1),a3 + moveq.l #PART_HEIGHT-1,d7 +.edgeloop2 + move.w (a2),(a3)+ + lea BLENDIMG_WIDTH*2(a2),a2 + dbra d7,.edgeloop2 + + ; calculate copper edge offset + move.w pbi_Copper7Offset(a1),d2 + add.w d0,d2 + add.w d0,d2 ; x * 8 + add.w #(7+1)*4,d2 + move.w d2,pbi_CopperEdgeOffset(a1) + + ; init last colors for fade-out + cmp.w #5,d1 + bne.s .noreadoutfix + bsr bln_palette_readout_fix5 + bra.s .contreadoutfix +.noreadoutfix + bsr bln_palette_readout +.contreadoutfix + + move.l #bln_fade_out_in_sequence,pbi_PhaseSequence(a1) + move.l #bln_palette_step_down,pbi_PalChangeRoutine(a1) + lea bln_palette_apply(pc),a0 + cmp.w #5,d1 + bne.s .nofix + lea bln_palette_apply_fix5(pc),a0 +.nofix + move.l a0,pbi_PalApplyRoutine(a1) + rts + +;-------------------------------------------------------------------- + +bln_palette_step_up: + lea pbi_CurrentColors(a1),a0 + move.l pd_ShadeTableXor(a6),a2 + moveq.l #(7+PART_HEIGHT)-1,d7 +.looppal + move.w pbi_TargetColors-pbi_CurrentColors(a0),d0 + move.w (a0),d1 + eor.w d1,d0 + add.w d0,d0 + add.w (a2,d0.w),d1 + move.w d1,(a0)+ + dbra d7,.looppal + rts + +;-------------------------------------------------------------------- + +bln_palette_step_down: + lea pbi_CurrentColors(a1),a0 + move.l pd_ShadeTableSub1(a6),a2 + moveq.l #(7+PART_HEIGHT)-1,d7 +.looppal + move.w (a0),d0 + add.w d0,d0 + move.w (a2,d0.w),(a0)+ + dbra d7,.looppal + rts + +;-------------------------------------------------------------------- + +bln_palette_fade_step_to_black: + lea pd_EndLogoPalette(a6),a0 + move.l pd_ShadeTableSub1(a6),a2 + moveq.l #16-1,d7 +.loop move.w (a0),d0 + add.w d0,d0 + move.w (a2,d0.w),(a0)+ + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_palette_fade_step_from_white: + lea pd_EndLogoPalette(a6),a0 + lea bln_endlogo_palette(pc),a1 + move.l pd_ShadeTableXor(a6),a2 + moveq.l #16-1,d7 +.loop move.w (a0),d1 + move.w (a1)+,d0 + eor.w d1,d0 + add.w d0,d0 + sub.w (a2,d0.w),d1 + move.w d1,(a0)+ + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_palette_apply: + lea pbi_CurrentColors(a1),a0 + move.l pd_CurrCopListPtr(a6),a2 + adda.w pbi_Copper7Offset(a1),a2 + REPT 7 + move.w (a0)+,REPTN*4(a2) + ENDR + + move.l pd_CurrCopListPtr(a6),a2 + add.w pbi_CopperEdgeOffset(a1),a2 + moveq.l #PART_HEIGHT-1,d7 +.loop + move.w (a0)+,(a2) + lea (20+1)*4(a2),a2 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_palette_apply_fix5: + lea pbi_CurrentColors(a1),a0 + move.l pd_CurrCopListPtr(a6),a2 + adda.w pbi_Copper7Offset(a1),a2 + REPT 7 + move.w (a0)+,REPTN*4(a2) + ENDR + + move.l pd_CurrCopListPtr(a6),a2 + add.w pbi_CopperEdgeOffset(a1),a2 + moveq.l #(($100-$52)%PART_HEIGHT)-1,d7 +.loop + move.w (a0)+,(a2) + lea (20+1)*4(a2),a2 + dbra d7,.loop + + addq.w #4,a2 + + moveq.l #(PART_HEIGHT-(($100-$52)%PART_HEIGHT))-1,d7 +.loop2 + move.w (a0)+,(a2) + lea (20+1)*4(a2),a2 + dbra d7,.loop2 + rts + +;-------------------------------------------------------------------- + +bln_palette_readout: + lea pbi_CurrentColors+7*2(a1),a0 + move.l pd_CurrCopListPtr(a6),a2 + add.w pbi_CopperEdgeOffset(a1),a2 + moveq.l #PART_HEIGHT-1,d7 +.loop + move.w (a2),(a0)+ + lea (20+1)*4(a2),a2 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +bln_palette_readout_fix5: + lea pbi_CurrentColors+7*2(a1),a0 + move.l pd_CurrCopListPtr(a6),a2 + add.w pbi_CopperEdgeOffset(a1),a2 + moveq.l #(($100-$52)%PART_HEIGHT)-1,d7 +.loop + move.w (a2),(a0)+ + lea (20+1)*4(a2),a2 + dbra d7,.loop + + addq.w #4,a2 + + moveq.l #(PART_HEIGHT-(($100-$52)%PART_HEIGHT))-1,d7 +.loop2 + move.w (a2),(a0)+ + lea (20+1)*4(a2),a2 + dbra d7,.loop2 + rts + +;-------------------------------------------------------------------- + +bln_blit_intro_block_fade_in_0: + move.l pbi_SourceImgPtr(a1),a0 + move.l pd_CurrPlanesPtr(a6),a2 + add.l pbi_ScreenOffset(a1),a2 + move.l pbi_TempBuffer(a1),a1 + + ; copy plane 5 without first line to target screen + lea 4*(BLENDIMG_WIDTH/8)(a0),a0 ; p5 + lea 4*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p5 + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_p5_p6,(a4)+ + move.l a0,(a4)+ + move.l a2,(a4)+ + + ; copy plane 6 without first line to target screen + lea (BLENDIMG_WIDTH/8)(a0),a0 ; p6 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p6 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_p5_p6_more,(a4)+ + move.l a0,(a4)+ + move.l a2,(a4)+ + + ; create p5|p6 mask in block temp + lea 4*(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 5 (p5|p6) + move.l a1,d2 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_merge_p5_p6,(a4)+ + move.l a2,(a4)+ + lea -1*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p5 + move.l a2,(a4)+ + move.l a1,(a4)+ + + ; copy plane 1 without first line to block temp + lea -5*(BLENDIMG_WIDTH/8)(a0),a0 ; p1 + lea -4*(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 5 (p5|p6) + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_initial_copy,(a4)+ + move.l a0,(a4)+ + move.l a1,(a4)+ + + ; copy plane 2/3 without first line to block temp + REPT 2 + lea (PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 2-3 (p2-p3) + lea (BLENDIMG_WIDTH/8)(a0),a0 ; p2-p3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_more,(a4)+ + move.l a0,(a4)+ + move.l a1,(a4)+ + ENDR + + ; copy plane 4 (masked) and set first line (color 8) to block temp + lea (PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 4 (p4) + lea (BLENDIMG_WIDTH/8)(a0),a0 ; p4 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_special,(a4)+ + move.l a0,(a4)+ + move.l d2,(a4)+ + move.l a1,(a4)+ + + ; fill first line (color 8), clear rest to target screen + lea -1*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p4 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_fill_special,(a4)+ + move.l a2,(a4)+ + + ; copy p3 (masked with p5/p6 mask) to target screen + lea -(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 3 (p3) + lea -1*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_masked,(a4)+ + move.l d2,(a4)+ + move.l a1,(a4)+ + move.l a2,(a4)+ + + ; copy p2 (masked with p5/p6 mask) to target screen + lea -(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 2 (p2) + lea -1*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p2 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_masked_more,(a4)+ + move.l d2,(a4)+ + move.l a1,(a4)+ + move.l a2,(a4)+ + + lea -(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 1 (p1) + lea -1*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p1 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_copy_masked_more,(a4)+ + move.l d2,(a4)+ + move.l a1,(a4)+ + move.l a2,(a4)+ + + rts + +.bq_initial_copy + BLTCON0_SET AD,BLT_A,0 + move.l #$7fffffff,bltafwm(a5) + move.l #((BLENDVIEW_WIDTH*BLENDIMG_PLANES-PART_WIDTH)/8)<<16,bltamod(a5) +.bq_copy_more + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_copy_special + BLTCON0_SET BCD,BLT_A|(BLT_C&BLT_B),0 + move.l #$80000000,bltafwm(a5) + move.l #((BLENDVIEW_WIDTH*BLENDIMG_PLANES-PART_WIDTH)/8)<<16,bltcmod(a5) + move.w #$ffff,bltadat(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + addq.l #4,a1 ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_copy_p5_p6 + BLTCON_SET AD,BLT_A,0,0 + move.l #$7fffffff,bltafwm(a5) + move.l #(((BLENDVIEW_WIDTH*BLENDIMG_PLANES-PART_WIDTH)/8)<<16)|((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltamod(a5) +.bq_copy_p5_p6_more + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_merge_p5_p6 + BLTCON0_SET ACD,BLT_A|BLT_C,0 + moveq.l #((BLENDVIEW_WIDTH-PART_WIDTH)/8),d0 + move.w d0,bltcmod(a5) + swap d0 + move.l d0,bltamod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_fill_special + BLTCON0_SET D,BLT_A,0 + move.w #$ffff,bltadat(a5) + move.l (a0)+,bltdpt(a5) + move.w #((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltdmod(a5) + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),bltsize(a5) + rts + +.bq_copy_masked + BLTCON0_SET ACD,BLT_A&(~BLT_C),0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #0,d0 + move.w d0,bltcmod(a5) + move.w d0,bltamod(a5) +.bq_copy_masked_more + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +bln_blit_intro_block_fade_in_1: + move.l pd_LastPlanesPtr(a6),a0 + move.l pd_CurrPlanesPtr(a6),a2 + move.l pbi_ScreenOffset(a1),d0 + adda.l d0,a0 + adda.l d0,a2 + move.l pbi_TempBuffer(a1),a1 + + ; copy plane 5 without first line to target screen + lea 4*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p5 + lea 4*(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p5 + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_p5_p6,(a4)+ + move.l a0,(a4)+ + move.l a2,(a4)+ + + ; copy plane 6 without first line to target screen + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p6 + lea (BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT(a2),a2 ; p6 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_p5_p6_more,(a4)+ + move.l a0,(a4)+ + move.l a2,(a4)+ + + lea -2*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p4 + lea -2*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p4 + bra.s bln_blit_intro_block_fade_in_2b + +.bq_copy_p5_p6 + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((BLENDVIEW_WIDTH-PART_WIDTH)/8)<<16)|((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltamod(a5) +.bq_copy_p5_p6_more + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +bln_blit_intro_block_fade_in_2: + move.l pd_LastPlanesPtr(a6),a0 + move.l pd_CurrPlanesPtr(a6),a2 + move.l pbi_ScreenOffset(a1),d0 + adda.l d0,a0 + adda.l d0,a2 + move.l pbi_TempBuffer(a1),a1 + + lea 3*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p4 + lea 3*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p4 + +bln_blit_intro_block_fade_in_2b: + ; create tmp mask for p4 + lea 3*(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 4 (p4) + move.l a2,d2 + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_tmp_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l a1,(a4)+ ; a = target + move.l d2,(a4)+ ; d = mask + + ; merge tmp mask for p3 + lea -1*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p3 + lea -1*(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 3 (p3) + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_merge_tmp_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; b = old mask + move.l a1,(a4)+ ; a = target + move.l d2,(a4)+ ; d = mask + + ; merge tmp mask for p2/p1 + REPT 2 + lea -1*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p2/p1 + lea -1*(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 2/1 (p2/p1) + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_merge_tmp_mask_more,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; b = old mask + move.l a1,(a4)+ ; a = target + move.l d2,(a4)+ ; d = mask + ENDR + + ; p1n = last_p1 ^ tmp + lea -3*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_with_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; a = mask + move.l a2,(a4)+ ; d = new destination + + ; tmp = last_p1 & tmp + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_and_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; a = mask + move.l d2,(a4)+ ; d = new mask + + ; p2n = last_p2 ^ tmp + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p2 + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p2 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_with_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; a = mask + move.l a2,(a4)+ ; d = new destination + + ; tmp = last_p2 & tmp + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_and_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; a = mask + move.l d2,(a4)+ ; d = new mask + + ; p3n = last_p3 ^ tmp + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p3 + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_with_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; a = mask + move.l a2,(a4)+ ; d = new destination + + ; p4n = last_p4 ^ (tmp & last_p3) + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_final_xor,(a4)+ + move.l a0,(a4)+ ; c = last p3 + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p4 + move.l a0,(a4)+ ; b = last p4 + move.l d2,(a4)+ ; a = mask + move.l d2,(a4)+ ; d = new destination + + rts + +.bq_tmp_mask + BLTCON_SET ACD,BLT_A^BLT_C,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((BLENDVIEW_WIDTH-PART_WIDTH)/8)<<16)|((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltcmod(a5) + move.w #0,bltamod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_merge_tmp_mask + BLTCON0_SET ABCD,(BLT_A^BLT_C)|BLT_B,0 +.bq_merge_tmp_mask_more + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_xor_with_mask + BLTCON0_SET ACD,BLT_A^BLT_C,0 + move.w #((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltamod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_and_mask + BLTCON0_SET ACD,BLT_A&BLT_C,0 + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_final_xor + BLTCON0_SET ABCD,BLT_B^(BLT_A&BLT_C),0 + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +bln_blit_intro_block_final: + move.l pbi_SourceImgPtr(a1),a0 + move.l pd_CurrPlanesPtr(a6),a2 + add.l pbi_ScreenOffset(a1),a2 + + ; copy plane 4 (masked) and set first line (color 8) to block temp + lea 3*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p4 + lea 3*(BLENDIMG_WIDTH/8)(a0),a0 ; p4 + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_copy_special,(a4)+ + move.l a0,(a4)+ + move.l a2,(a4)+ + + TERM_ADD_TO_BLITTER_QUEUE a3 + rts + +.bq_copy_special + BLTCON_SET CD,BLT_A|BLT_C,0,0 + move.l #$80000000,bltafwm(a5) + move.w #((BLENDVIEW_WIDTH*BLENDIMG_PLANES-PART_WIDTH)/8),bltcmod(a5) + move.w #((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltdmod(a5) + move.w #$ffff,bltadat(a5) + move.l (a0)+,bltcpt(a5) + move.l (a0)+,bltdpt(a5) + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +bln_blit_intro_block_fade_out_0: + move.l pd_LastPlanesPtr(a6),a0 + add.l pbi_ScreenOffset(a1),a0 + move.l pd_CurrPlanesPtr(a6),a2 + add.l pbi_ScreenOffset(a1),a2 + move.l pbi_TempBuffer(a1),a1 + + ; create p5|p6 mask in block temp + lea 4*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p5 + lea 4*(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 5 (p5|p6) + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_merge_p5_p6,(a4)+ + move.l a0,(a4)+ + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p6 + move.l a0,(a4)+ + move.l a1,(a4)+ + + lea -2*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p4 + lea 3*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p4 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_remap_indexed,(a4)+ + move.l a0,(a4)+ + move.l a1,(a4)+ + move.l a2,(a4)+ + + rts + +.bq_merge_p5_p6 + BLTCON_SET ACD,BLT_A|BLT_C,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #((BLENDVIEW_WIDTH-PART_WIDTH)/8),d0 + move.w d0,bltcmod(a5) + swap d0 + move.l d0,bltamod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_remap_indexed + BLTCON0_SET BCD,(BLT_B&BLT_C)|BLT_A,0 + move.l #$80000000,bltafwm(a5) + move.w #$ffff,bltadat(a5) + move.w #0,bltbmod(a5) + move.w #((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltdmod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + addq.l #4,a1 ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +bln_blit_intro_block_fade_out_1_change_dir: + move.l #bln_palette_step_up,pbi_PalChangeRoutine(a1) + +bln_blit_intro_block_fade_out_1: + move.l pd_LastPlanesPtr(a6),a0 + move.l pd_CurrPlanesPtr(a6),a2 + move.l pbi_ScreenOffset(a1),d0 + adda.l d0,a0 + adda.l d0,a2 + move.l pbi_TempBuffer(a1),a1 + + lea 3*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p4 + lea 3*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p4 + + ; create tmp mask for p4 + move.l a2,d2 + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_tmp_mask,(a4)+ + move.l a0,(a4)+ ; c = last p4 + lea -1*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p3 + move.l a0,(a4)+ ; b = last p3 + lea -1*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p2 + move.l a0,(a4)+ ; a = last p2 + move.l d2,(a4)+ ; d = mask + + ; merge tmp mask for p3 + lea 4*(PART_WIDTH/8)*PART_HEIGHT(a1),a1 ; buffer 5 (p5|p6) + lea -1*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_merge_tmp_mask,(a4)+ + move.l a0,(a4)+ ; c = last p1 + move.l a1,(a4)+ ; b = p5|p6 + move.l d2,(a4)+ ; a = old mask + move.l d2,(a4)+ ; d = mask + + ; p1n = last_p1 ^ tmp + lea -3*(BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_with_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; a = mask + move.l a2,(a4)+ ; d = new destination + + ; tmp = p1n & tmp + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_and_mask,(a4)+ + move.l a2,(a4)+ ; c = p1n + move.l d2,(a4)+ ; a = mask + move.l d2,(a4)+ ; d = new mask + + ; p2n = last_p2 ^ tmp + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p2 + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p2 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_with_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; a = mask + move.l a2,(a4)+ ; d = new destination + + ; tmp = p2n & tmp + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_and_mask,(a4)+ + move.l a2,(a4)+ ; c = p2n + move.l d2,(a4)+ ; a = mask + move.l d2,(a4)+ ; d = new mask + + ; p3n = last_p3 ^ tmp + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p3 + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a2),a2 ; p3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_with_mask,(a4)+ + move.l a0,(a4)+ ; c = last + move.l d2,(a4)+ ; a = mask + move.l a2,(a4)+ ; d = new destination + + ; p4n = last_p4 ^ (tmp & p3n) + lea (BLENDIMG_WIDTH/8)*BLENDIMG_HEIGHT(a0),a0 ; p4 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_final_xor,(a4)+ + move.l a2,(a4)+ ; c = p3n + move.l a0,(a4)+ ; b = last p4 + move.l d2,(a4)+ ; a = mask + move.l d2,(a4)+ ; d = new destination + + rts + +.bq_tmp_mask + BLTCON_SET ABCD,BLT_A|BLT_B|BLT_C,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((BLENDVIEW_WIDTH-PART_WIDTH)/8)<<16)|((BLENDVIEW_WIDTH-PART_WIDTH)/8),d0 + move.l d0,bltcmod(a5) + move.l d0,bltamod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_merge_tmp_mask + BLTCON0_SET ABCD,(BLT_A|BLT_C)&BLT_B,0 + move.w #0,bltbmod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_xor_with_mask + BLTCON0_SET ACD,BLT_A^BLT_C,0 + move.w #((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltamod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_and_mask + BLTCON0_SET ACD,BLT_A&BLT_C,0 + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +.bq_final_xor + BLTCON0_SET ABCD,BLT_B^(BLT_A&BLT_C),0 + move.w #((BLENDVIEW_WIDTH-PART_WIDTH)/8),bltbmod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((PART_WIDTH>>4)|(PART_HEIGHT<<6)),(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +bln_calc_true_color_image: + PUTMSG 10,<"TC Image %p">,a1 + lea bln_images_palette-9*2(pc),a2 + lea (a2,d0.w),a3 + move.w #BLENDVIEW_HEIGHT,-(sp) +.lineloop + moveq.l #(BLENDIMG_WIDTH/16)-1,d7 + move.w (a3)+,d6 ; background color + move.w d6,8*2(a2) + swap d6 +.wordloop + move.w 5*(BLENDIMG_WIDTH/8)(a0),d5 + move.w 4*(BLENDIMG_WIDTH/8)(a0),d4 + move.w 3*(BLENDIMG_WIDTH/8)(a0),d3 + move.w 2*(BLENDIMG_WIDTH/8)(a0),d2 + move.w 1*(BLENDIMG_WIDTH/8)(a0),d1 + move.w (a0)+,d0 + swap d7 + move.w #15,d7 +.pixelloop + clr.w d6 + add.w d3,d3 + addx.w d6,d6 + add.w d2,d2 + addx.w d6,d6 + add.w d1,d1 + addx.w d6,d6 + add.w d0,d0 + addx.w d6,d6 + + add.w d5,d5 + bcs.s .greenOrRed + add.w d4,d4 + bcs.s .blue + + PUTMSG 50,<"Idx %d">,d6 + + add.w d6,d6 + move.w (a2,d6.w),d6 + move.w d6,(a1)+ + bra.s .contloop + +.greenOrRed + add.w d4,d4 + bcs.s .green +.red + PUTMSG 50,<"Red %d">,d6 + move.b d6,(a1) + swap d6 + move.b d6,1(a1) + move.w (a1)+,d6 + bra.s .contloop + +.green + PUTMSG 50,<"Green %d">,d6 + move.w d7,a4 + move.w d6,d7 + lsl.w #4,d7 + swap d6 + and.w #$f0f,d6 + or.w d7,d6 + move.w d6,(a1)+ + move.w a4,d7 + bra.s .contloop + +.blue + PUTMSG 50,<"Blue %d">,d6 + move.w d7,a4 + move.w d6,d7 + swap d6 + and.w #$ff0,d6 + or.w d7,d6 + move.w d6,(a1)+ + move.w a4,d7 +.contloop + swap d6 + dbra d7,.pixelloop + swap d7 + dbra d7,.wordloop +.nextline + lea 5*(BLENDIMG_WIDTH/8)(a0),a0 + subq.w #1,(sp) + bne .lineloop + addq.w #2,sp + rts + +;-------------------------------------------------------------------- + +bln_create_intro_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + COPIMOVE $6a00,bplcon0 + + lea bln_images_palette(pc),a1 + moveq.l #7-1,d7 + move.w #color+9*2,d0 +.palloop + move.w d0,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d0 + dbra d7,.palloop + + move.l pd_CurrPlanesPtr(a6),d0 + moveq.l #6-1,d7 + move.w #bplpt,d1 + move.l #(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT,d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.w #$51d5,d0 + move.w #BLENDVIEW_HEIGHT-1,d7 + move.w #$100,d2 + + move.l a0,d1 + sub.l a2,d1 + add.w #4+2+8,d1 + move.w d1,pd_CopperChunkyOffset(a6) + + lea pd_Parts(a6),a1 + move.w d0,(a0)+ + move.w d3,(a0)+ + moveq.l #0,d4 +.cprloop + subq.w #1,d4 + bpl.s .nocols + move.l a0,d1 + sub.l a2,d1 + addq.w #2,d1 + move.w d1,pbi_Copper7Offset(a1) + lea pbi_SIZEOF(a1),a1 + COPIMOVE $111,(color+1*2) + COPIMOVE $333,(color+2*2) + COPIMOVE $531,(color+3*2) + COPIMOVE $544,(color+4*2) + COPIMOVE $851,(color+5*2) + COPIMOVE $a61,(color+6*2) + COPIMOVE $c82,(color+7*2) + moveq.l #PART_HEIGHT-1,d4 +.nocols + add.w d2,d0 + bcc.s .no256 + COPIMOVE 0,$1fe +.no256 + move.w d0,d1 + move.b #$3b,d1 + move.w d1,(a0)+ + move.w d3,(a0)+ + + ;move.l a0,d1 + ;sub.l a2,d1 + ;addq.w #2,d1 + ;move.w d1,(a3)+ + REPT 10 + COPIMOVE $f0f,color+8*2 + COPIMOVE $0ff,color+8*2 + ENDR + + dbra d7,.cprloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +bln_create_bars_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + COPIMOVE $6a00,bplcon0 + + lea bln_images_palette(pc),a1 + moveq.l #7-1,d7 + move.w #color+9*2,d0 +.palloop + move.w d0,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d0 + dbra d7,.palloop + + move.l pd_CurrPlanesPtr(a6),d0 + moveq.l #6-1,d7 + move.w #bplpt,d1 + move.l #(BLENDVIEW_WIDTH/8)*BLENDVIEW_HEIGHT,d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.w #$51d5,d0 + move.w #BLENDVIEW_HEIGHT-1,d7 + move.w #$100,d2 + + move.w d0,(a0)+ + move.w d3,(a0)+ + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperChunkyOffset(a6) + + move.b #$3b,d0 +.cprloop + add.w d2,d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + + REPT 10 + COPIMOVE $f0f,color+8*2 + COPIMOVE $0ff,color+8*2 + ENDR + COPIMOVE 0,$1fe + + dbra d7,.cprloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +bln_create_hole_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + COPIMOVE $6a00,bplcon0 + + COPIMOVE (BLENDVIEW_WIDTH*BLENDVIEW_PLANES-BLENDVIEW_WIDTH)/8,bpl1mod + COPIMOVE (BLENDVIEW_WIDTH*BLENDVIEW_PLANES-BLENDVIEW_WIDTH)/8,bpl2mod + + moveq.l #7-1,d7 + move.w #color+1*2,d0 +.palloop2 + move.w d0,(a0)+ + move.w #$f0f,(a0)+ + addq.w #2,d0 + dbra d7,.palloop2 + + lea bln_images_palette(pc),a1 + moveq.l #7-1,d7 + move.w #color+9*2,d0 +.palloop + move.w d0,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d0 + dbra d7,.palloop + + lea 2*BLENDVIEW_HEIGHT*2(a1),a1 + + move.l pd_CurrPlanesPtr(a6),d0 + moveq.l #6-1,d7 + move.w #bplpt,d1 + moveq.l #(BLENDVIEW_WIDTH/8),d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.w #$51d5,d0 + move.w #BLENDVIEW_HEIGHT-1,d7 + move.w #$100,d2 + + move.l a0,d1 + sub.l a2,d1 + add.w #4+2+8,d1 + move.w d1,pd_CopperChunkyOffset(a6) +.cprloop + move.w d0,(a0)+ + move.w d3,(a0)+ + add.w d2,d0 + + COPRMOVE (a1)+,(color+8*2) + + move.w d0,d1 + move.b #$21,d1 + move.w d1,(a0)+ + move.w d3,(a0)+ + + COPIMOVE $fff,(color+1*2) + COPIMOVE $888,(color+2*2) + + COPIMOVE $ff0,(color+3*2) + COPIMOVE $0ff,(color+4*2) + + COPIMOVE $f0f,(color+5*2) + COPIMOVE $0f0,(color+6*2) + + COPIMOVE $f80,(color+7*2) + COPIMOVE $8f8,(color+8*2) + + dbra d7,.cprloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +bln_create_greetings_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + COPIMOVE $6a00,bplcon0 + + COPIMOVE (BLENDVIEW_WIDTH*BLENDVIEW_PLANES-BLENDVIEW_WIDTH)/8,bpl1mod + COPIMOVE (BLENDVIEW_WIDTH*BLENDVIEW_PLANES-BLENDVIEW_WIDTH)/8,bpl2mod + + move.l pd_CurrGreetingsImage(a6),d0 + moveq.l #6-1,d7 + move.w #bplpt,d1 + moveq.l #(BLENDVIEW_WIDTH/8),d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.w #$51d5,d0 + move.w #$100,d2 + lea bln_images_palette(pc),a1 + adda.w pd_CurrGreetingsPalOffset(a6),a1 + move.w #BLENDVIEW_HEIGHT-1,d7 +.cprloop + move.w d0,(a0)+ + move.w d3,(a0)+ + add.w d2,d0 + + COPRMOVE (a1)+,(color+8*2) + dbra d7,.cprloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +bln_create_andyou_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + + COPIMOVE $1200,bplcon0 + + COPIMOVE 0,bpl1mod + + COPIMOVE $7e81,diwstrt + COPIMOVE $dac1,diwstop + COPIMOVE $0068,ddfstrt ; bitplane start + COPIMOVE $00a0,ddfstop ; bitplane stop + + move.l #bln_andyou_image,d0 + move.w #bplpt+2,(a0)+ + move.w d0,(a0)+ + move.w #bplpt,(a0)+ + swap d0 + move.w d0,(a0)+ + + COPIMOVE $fff,color+1*2 + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +bln_create_endlogo_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + COPIMOVE $6a00,bplcon0 + + COPIMOVE (ENDLOGO_WIDTH*ENDLOGO_PLANES-ENDLOGO_WIDTH)/8,bpl1mod + COPIMOVE (ENDLOGO_WIDTH*ENDLOGO_PLANES-ENDLOGO_WIDTH)/8,bpl2mod + + move.l pd_CurrPlanesPtr(a6),d0 + move.w #bplpt,d1 + moveq.l #(ENDLOGO_WIDTH/8),d2 + moveq.l #4-1,d7 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + move.l pd_EndLogoBuffer(a6),d0 + add.l #4*(ENDLOGO_WIDTH/8),d0 + moveq.l #2-1,d7 +.bplloop2 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop2 + + moveq.l #-2,d3 + lea pd_EndLogoPalette(a6),a1 + moveq.l #16-1,d7 + move.w #color,d1 +.palloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.palloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +bln_big_circle_rad_forward_update: + bsr bln_update_circle_sin_movement + bsr bln_update_circle_sin_rel_pos + move.w cp_RadPos(a4),d0 + lea bln_circlerads(pc),a0 + moveq.l #0,d1 +.retry + add.w pd_FrameInc(a6),d0 + move.b (a0,d0.w),d1 + bne.s .nowrap + sub.w #6*16,d0 + move.b (a0,d0.w),d1 +.nowrap + move.w d0,cp_RadPos(a4) + cmp.w cp_Radius(a4),d1 + beq.s .noupdate + move.w d1,cp_Radius(a4) + bra.s bln_update_circle_pot_info +.noupdate + rts + +;-------------------------------------------------------------------- + +bln_big_circle_rad_backward_update: + bsr bln_update_circle_sin_movement + bsr bln_update_circle_sin_rel_pos + move.w cp_RadPos(a4),d0 + sub.w pd_FrameInc(a6),d0 + bmi.s .endit + move.w d0,cp_RadPos(a4) + lea bln_circlerads(pc),a0 + moveq.l #0,d1 + move.b (a0,d0.w),d1 + cmp.w cp_Radius(a4),d1 + beq.s .noupdate + move.w d1,cp_Radius(a4) + bra.s bln_update_circle_pot_info +.noupdate + rts +.endit + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.l d0,cp_PaintRoutine(a4) + move.l d0,cp_FrameRoutine(a4) +.nop + rts + +;-------------------------------------------------------------------- + +bln_smaller_circle_rad_forward_update: + bsr bln_update_circle_sin_movement + bsr bln_update_circle_sin_rel_pos + move.w cp_RadPos(a4),d0 + lea bln_circlerads_smaller(pc),a0 + moveq.l #0,d1 +.retry + add.w pd_FrameInc(a6),d0 + move.b (a0,d0.w),d1 + bne.s .nowrap + sub.w #4*16,d0 + move.b (a0,d0.w),d1 +.nowrap + move.w d0,cp_RadPos(a4) + cmp.w cp_Radius(a4),d1 + beq.s .noupdate + move.w d1,cp_Radius(a4) + bra.s bln_update_circle_pot_info +.noupdate + rts + +;-------------------------------------------------------------------- + +bln_smaller_circle_rad_backward_update: + bsr bln_update_circle_sin_movement + bsr bln_update_circle_sin_rel_pos + move.w cp_RadPos(a4),d0 + sub.w pd_FrameInc(a6),d0 + bmi.s .endit + move.w d0,cp_RadPos(a4) + lea bln_circlerads_smaller(pc),a0 + moveq.l #0,d1 + move.b (a0,d0.w),d1 + cmp.w cp_Radius(a4),d1 + beq.s .noupdate + move.w d1,cp_Radius(a4) + bra.s bln_update_circle_pot_info +.noupdate + rts +.endit + lea .nop(pc),a0 + move.l a0,cp_PaintRoutine(a4) + move.l a0,cp_FrameRoutine(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.l d0,cp_CircleInfo(a4) +.nop + rts + +;-------------------------------------------------------------------- + +bln_small_circle_rad_forward_update: + bsr bln_update_circle_sin_movement + bsr bln_update_circle_sin_rel_pos + move.w cp_RadPos(a4),d0 + lea bln_circlerads_greets(pc),a0 + moveq.l #0,d1 +.retry + add.w pd_FrameInc(a6),d0 + move.b (a0,d0.w),d1 + bne.s .nowrap + sub.w #4*16,d0 + move.b (a0,d0.w),d1 +.nowrap + move.w pd_BeatRadAdd(a6),d2 + lsr.w #2,d2 + add.w d2,d1 + move.w d0,cp_RadPos(a4) + cmp.w cp_Radius(a4),d1 + beq.s .noupdate + move.w d1,cp_Radius(a4) + bra.s bln_update_circle_pot_info +.noupdate + rts + +;-------------------------------------------------------------------- + +bln_small_circle_rad_backward_update: + bsr bln_update_circle_sin_movement + bsr bln_update_circle_sin_rel_pos + move.w cp_RadPos(a4),d0 + sub.w pd_FrameInc(a6),d0 + bmi.s .endit + move.w d0,cp_RadPos(a4) + lea bln_circlerads_greets(pc),a0 + moveq.l #0,d1 + move.b (a0,d0.w),d1 + cmp.w cp_Radius(a4),d1 + beq.s .noupdate + move.w d1,cp_Radius(a4) + bra.s bln_update_circle_pot_info +.noupdate + rts +.endit + lea .nop(pc),a0 + move.l a0,cp_PaintRoutine(a4) + move.l a0,cp_FrameRoutine(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.l d0,cp_CircleInfo(a4) +.nop + rts + +;-------------------------------------------------------------------- + +bln_update_circle_sin_movement: + move.w pd_FrameInc(a6),d1 + cmp.w #2,d1 + beq.s .fast2 + subq.w #1,d1 + beq.s .fast1 +.loop + move.l cp_RelPosSinXSpeed(a4),d0 +.floop + add.l d0,cp_RelPosSinXOffset(a4) + dbra d1,.floop + rts + +.fast1 + move.l cp_RelPosSinXSpeed(a4),d0 + add.l d0,cp_RelPosSinXOffset(a4) + rts + +.fast2 + move.l cp_RelPosSinXSpeed(a4),d0 + add.l d0,cp_RelPosSinXOffset(a4) + add.l d0,cp_RelPosSinXOffset(a4) + rts + +;-------------------------------------------------------------------- + +bln_update_circle_sin_rel_pos: + move.l fw_SinTable(a6),a0 + movem.w cp_RelPosSinXOffset(a4),d0-d5 + and.w #1023*2,d0 + and.w #1023*2,d1 + move.w (a0,d0.w),d0 + move.w (a0,d1.w),d1 + muls d2,d0 + muls d3,d1 + swap d0 + swap d1 + add.w d4,d0 + add.w d5,d1 + move.w d0,cp_FgRelPosX(a4) + move.w d1,cp_FgRelPosY(a4) + rts + +;-------------------------------------------------------------------- + +bln_greeting_line_update: + move.w pd_FrameInc(a6),d5 + sub.w d5,cp_GreetingTimeRev(a4) + bpl.s .dorad + move.w cp_Radius(a4),d4 + beq.s .noupdate + sub.w d5,d4 + cmp.w #MIN_CIRCLE_SIZE,d4 + blt.s .kill + bra.s .checkmove +.dorad + move.w cp_RadPos(a4),d0 + lea bln_circlerads_greets(pc),a0 + moveq.l #0,d4 + add.w d5,d0 + move.b (a0,d0.w),d4 + bne.s .nowrap + sub.w #4*16,d0 + move.b (a0,d0.w),d4 +.nowrap + move.w d0,cp_RadPos(a4) +.checkmove + cmp.w #9,d4 + blt.s .nomove + move.l cp_RelPosXLong(a4),d0 + move.l cp_RelPosYLong(a4),d1 + movem.w cp_RelPosXInc(a4),d2/d3 + add.l d2,d2 + add.l d2,d2 + add.l d3,d3 + add.l d3,d3 + subq.w #1,d5 +.frloop + add.l d2,d0 + add.l d3,d1 + dbra d5,.frloop + move.l d0,cp_RelPosXLong(a4) + move.l d1,cp_RelPosYLong(a4) + swap d0 + swap d1 + move.w d0,cp_FgRelPosX(a4) + move.w d1,cp_FgRelPosY(a4) +.nomove + cmp.w cp_Radius(a4),d4 + beq.s .noupdate + move.w d4,cp_Radius(a4) + bra.s bln_update_circle_pot_info +.noupdate + rts +.kill PUTMSG 10,<"%d: Greeting killed (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + subq.w #1,pd_GreetingCount(a6) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.l d0,cp_PaintRoutine(a4) + move.l d0,cp_FrameRoutine(a4) + rts + +;-------------------------------------------------------------------- + +bln_load_circle_nop: + rts + +bln_load_circle_eye_1: + PUTMSG 10,<"%d: Load circle eye 1 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #112,cp_CenterPosX(a4) + move.w #51,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w d0,cp_Pair(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + + move.w #13,cp_RelPosSinXSpeed(a4) + move.w #14,cp_RelPosSinYSpeed(a4) + + move.w #60*2,cp_RelPosXRadius(a4) + move.w #20*2,cp_RelPosYRadius(a4) + move.w #114,cp_RelPosXCenter(a4) + move.w #70,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage2(a6),cp_FgImage(a4) + move.l pd_TrueColorImage2(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_big_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + +bln_load_circle_pos_eye_1_sunset: + PUTMSG 10,<"%d: Load circle eye sunset 2 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #112,cp_CenterPosX(a4) + move.w #62,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w d0,cp_RadPos(a4) + move.w #1*8,cp_Pair(a4) + clr.w cp_RadPos(a4) + move.l #(112-112)*2+(62-51)*BLENDVIEW_WIDTH*2,cp_InvertedOffset(a4) + + move.w #-15,cp_RelPosSinXSpeed(a4) + move.w #12,cp_RelPosSinYSpeed(a4) + + move.w #20*2,cp_RelPosXRadius(a4) + move.w #30*2,cp_RelPosYRadius(a4) + move.w #107,cp_RelPosXCenter(a4) + move.w #43,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage2(a6),cp_BgImage(a4) + move.l pd_TrueColorImage2(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage3(a6),cp_FgImage(a4) + move.l pd_TrueColorImage3(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle_invert,cp_PaintRoutine(a4) + move.l #bln_smaller_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + +bln_load_circle_pos_eye_2: + PUTMSG 10,<"%d: Load circle eye 2 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #240,cp_CenterPosX(a4) + move.w #126,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w #2*8,cp_Pair(a4) + move.w d0,cp_Radius(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + + move.w #7,cp_RelPosSinXSpeed(a4) + move.w #9,cp_RelPosSinYSpeed(a4) + + move.w #40*2,cp_RelPosXRadius(a4) + move.w #60*2,cp_RelPosYRadius(a4) + move.w #104,cp_RelPosXCenter(a4) + move.w #83,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage2(a6),cp_FgImage(a4) + move.l pd_TrueColorImage2(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_big_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + +bln_load_circle_pos_eye_2_skin: + PUTMSG 10,<"%d: Load circle eye skin (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #240,cp_CenterPosX(a4) + move.w #117,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w d0,cp_RadPos(a4) + move.w #3*8,cp_Pair(a4) + clr.w cp_RadPos(a4) + move.l #(240-240)*2+(117-126)*BLENDVIEW_WIDTH*2,cp_InvertedOffset(a4) + + move.w #-15,cp_RelPosSinXSpeed(a4) + move.w #12,cp_RelPosSinYSpeed(a4) + + move.w #20*2,cp_RelPosXRadius(a4) + move.w #70*2,cp_RelPosYRadius(a4) + move.w #69,cp_RelPosXCenter(a4) + move.w #109,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage2(a6),cp_BgImage(a4) + move.l pd_TrueColorImage2(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage2(a6),cp_FgImage(a4) + move.l pd_TrueColorImage2(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle_invert,cp_PaintRoutine(a4) + move.l #bln_small_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + +bln_load_circle_cham_bg_1: + PUTMSG 10,<"%d: Load cham bg 1 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #272,cp_CenterPosX(a4) + move.w #34,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w #2*8,cp_Pair(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + + move.w #7,cp_RelPosSinXSpeed(a4) + move.w #9,cp_RelPosSinYSpeed(a4) + + move.w #40*2,cp_RelPosXRadius(a4) + move.w #40*2,cp_RelPosYRadius(a4) + move.w #190,cp_RelPosXCenter(a4) + move.w #85,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage2(a6),cp_FgImage(a4) + move.l pd_TrueColorImage2(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_smaller_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + +bln_load_circle_greets_bg_1: + PUTMSG 10,<"%d: Load greets bg 1 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #176,cp_CenterPosX(a4) + move.w #75,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w #2*8,cp_Pair(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + + move.w #-13,cp_RelPosSinXSpeed(a4) + move.w #14,cp_RelPosSinYSpeed(a4) + + move.w #11*2,cp_RelPosXRadius(a4) + move.w #14*2,cp_RelPosYRadius(a4) + move.w #27,cp_RelPosXCenter(a4) + move.w #106,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage4(a6),cp_FgImage(a4) + move.l pd_TrueColorImage4(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_small_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + + +bln_load_circle_greets_bg_2: + PUTMSG 10,<"%d: Load greets bg 2 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #128,cp_CenterPosX(a4) + move.w #149,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w #0*8,cp_Pair(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + + move.w #-15,cp_RelPosSinXSpeed(a4) + move.w #-17,cp_RelPosSinYSpeed(a4) + + move.w #17*2,cp_RelPosXRadius(a4) + move.w #17*2,cp_RelPosYRadius(a4) + move.w #111,cp_RelPosXCenter(a4) + move.w #149,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage4(a6),cp_FgImage(a4) + move.l pd_TrueColorImage4(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_small_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + +bln_load_circle_greets_bg_3: + PUTMSG 10,<"%d: Load greets bg 3 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #80,cp_CenterPosX(a4) + move.w #32,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w #3*8,cp_Pair(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + + move.w #-16,cp_RelPosSinXSpeed(a4) + move.w #18,cp_RelPosSinYSpeed(a4) + + move.w #13*2,cp_RelPosXRadius(a4) + move.w #13*2,cp_RelPosYRadius(a4) + move.w #162,cp_RelPosXCenter(a4) + move.w #25,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage4(a6),cp_FgImage(a4) + move.l pd_TrueColorImage4(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_small_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + +bln_load_circle_greets_bg_4: + PUTMSG 10,<"%d: Load greets bg 4 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #208,cp_CenterPosX(a4) + move.w #28,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w #1*8,cp_Pair(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + + move.w #19,cp_RelPosSinXSpeed(a4) + move.w #-15,cp_RelPosSinYSpeed(a4) + + move.w #10*2,cp_RelPosXRadius(a4) + move.w #10*2,cp_RelPosYRadius(a4) + move.w #295,cp_RelPosXCenter(a4) + move.w #93,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage4(a6),cp_FgImage(a4) + move.l pd_TrueColorImage4(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_small_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + +bln_load_circle_greets_bg_5: + PUTMSG 10,<"%d: Load greets bg 5 (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #48,cp_CenterPosX(a4) + move.w #118,cp_CenterPosY(a4) + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.w #1*8,cp_Pair(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + + move.w #-16,cp_RelPosSinXSpeed(a4) + move.w #-17,cp_RelPosSinYSpeed(a4) + + move.w #10*2,cp_RelPosXRadius(a4) + move.w #11*2,cp_RelPosYRadius(a4) + move.w #297,cp_RelPosXCenter(a4) + move.w #155,cp_RelPosYCenter(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_OriginalImage4(a6),cp_FgImage(a4) + move.l pd_TrueColorImage4(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_small_circle_rad_forward_update,cp_FrameRoutine(a4) + rts + + +; 23,106 (23) / 111,149 (30) / 162,25 (25) / 295,93 (24) / 297,155 (22) +;-------------------------------------------------------------------- + +bln_load_next_greeting: + move.l pd_GreetingPosPtr(a6),a0 + move.w (a0)+,d0 + beq.s .reallykill + move.w (a0)+,d1 + move.w (a0)+,d2 + PUTMSG 10,<"%d: Next greeting at %d,%d Pair: %d">,fw_FrameCounterLong(a6),d0,d1,d2 + move.w d0,cp_CenterPosX(a4) + move.w d1,cp_CenterPosY(a4) + move.w d2,cp_Pair(a4) + move.l a0,pd_GreetingPosPtr(a6) + + moveq.l #0,d0 + move.w #MAX_CIRCLE_SIZE,cp_Radius(a4) + move.w d0,cp_RadPos(a4) + move.l d0,cp_InvertedOffset(a4) + +.retry + move.l pd_GreetingLinePtr(a6),a0 + movem.w (a0)+,d0-d4 + PUTMSG 10,<"%d: Greeting from %d,%d to %d,%d, shift %d">,fw_FrameCounterLong(a6),d0,d1,d2,d3,d4 + + move.w d0,cp_FgRelPosX(a4) + beq.s .kill + move.w d1,cp_FgRelPosY(a4) + + move.l a0,pd_GreetingLinePtr(a6) + + swap d0 + swap d1 + move.l d0,cp_RelPosXLong(a4) + move.l d1,cp_RelPosYLong(a4) + + swap d2 + swap d3 + sub.l d0,d2 + sub.l d1,d3 + + moveq.l #0,d0 + bset d4,d0 + + addq.w #2,d4 + + asr.l d4,d2 + asr.l d4,d3 + move.w d2,cp_RelPosXInc(a4) + move.w d3,cp_RelPosYInc(a4) + + move.w d0,cp_GreetingTimeRev(a4) + add.w #15,d0 + move.w d0,cp_TimeLeft(a4) + + move.l pd_OriginalImage3(a6),cp_BgImage(a4) + move.l pd_TrueColorImage3(a6),cp_BgTCImage(a4) + move.l pd_CurrGreetingsImage(a6),cp_FgImage(a4) + move.l pd_CurrGreetingsTCImage(a6),cp_FgTCImage(a4) + move.l #bln_draw_stenciled_circle,cp_PaintRoutine(a4) + move.l #bln_greeting_line_update,cp_FrameRoutine(a4) + rts +.kill tst.w d1 + beq.s .reallykill + addq.l #2,pd_GreetingLinePtr(a6) + move.l pd_OriginalImage5(a6),pd_CurrGreetingsImage(a6) + move.l pd_TrueColorImage5(a6),pd_CurrGreetingsTCImage(a6) + bra.s .retry + +.reallykill + moveq.l #0,d0 + move.w d0,cp_Radius(a4) + move.l d0,cp_PaintRoutine(a4) + move.l d0,cp_FrameRoutine(a4) + rts + +;-------------------------------------------------------------------- + +bln_reverse_big_circle_to_backward: + PUTMSG 10,<"%d: Reversing big circle (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.l #bln_big_circle_rad_backward_update,cp_FrameRoutine(a4) + rts + +;-------------------------------------------------------------------- + +bln_reverse_smaller_circle_to_backward: + PUTMSG 10,<"%d: Reversing smaller circle (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.l #bln_smaller_circle_rad_backward_update,cp_FrameRoutine(a4) + rts + +;-------------------------------------------------------------------- + +bln_reverse_small_circle_to_backward: + PUTMSG 10,<"%d: Reversing smaller circle (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.l #bln_small_circle_rad_backward_update,cp_FrameRoutine(a4) + rts + +;******************************************************************** + +bln_blend_image_2_filename: + dc.b "cHAMeleon.raw",0 +bln_blend_image_3_filename: + dc.b "Sunset.raw",0 +bln_blend_image_4_filename: + dc.b "Greets1.raw",0 +bln_blend_image_5_filename: + dc.b "Greets2.raw",0 + even + +bln_bar_patterns: + ;dc.b 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 + ;dc.b 19,0,18,1,17,2,16,3,15,4,14,5,13,6,12,7,11,8,10,9 + dc.b 0,2,4,6,8,10,12,14,16,18,19,17,15,13,11,9,7,5,3,1 + ;dc.b 19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 + ;dc.b 9,10,8,11,7,12,6,13,5,14,4,15,3,16,2,17,1,18,0,19 + ;dc.b 0,1,2,3,4,5,6,7,8,9,19,18,17,16,15,14,13,12,11,10 + ;dc.b 10,11,12,13,14,15,16,17,18,19,9,8,7,6,5,4,3,2,1,0 + even + +bln_a_part_sequence: + dc.w pd_OriginalImage1,pd_TrueColorImage1 + dc.l bln_load_new_block_fade_in + dc.w -6,bln_a_part_rnd_seq_row_1-bln_a_part_sequence + dc.w -3,bln_a_part_rnd_seq_row_2-bln_a_part_sequence + dc.w -9,bln_a_part_rnd_seq_row_3-bln_a_part_sequence + dc.w 0,bln_a_part_rnd_seq_row_4-bln_a_part_sequence + dc.w -15,bln_a_part_rnd_seq_row_5-bln_a_part_sequence + dc.w -12,bln_a_part_rnd_seq_row_6-bln_a_part_sequence + +bln_b_part_sequence: + dc.w pd_OriginalImage2,pd_TrueColorImage2 + dc.l bln_load_new_block_fade_out_and_in + dc.w -12,bln_a_part_rnd_seq_row_1-bln_b_part_sequence + dc.w 0,bln_a_part_rnd_seq_row_2-bln_b_part_sequence + dc.w -24,bln_a_part_rnd_seq_row_3-bln_b_part_sequence + dc.w -18,bln_a_part_rnd_seq_row_4-bln_b_part_sequence + dc.w -30,bln_a_part_rnd_seq_row_5-bln_b_part_sequence + dc.w -6,bln_a_part_rnd_seq_row_6-bln_b_part_sequence + +bln_a_part_rnd_seq_row_1: + dc.b 4,7,0,1,8,9,3,2,6,5,-1 + even +bln_a_part_rnd_seq_row_2: + dc.b 5,0,4,3,9,8,7,2,6,1,-1 + even +bln_a_part_rnd_seq_row_3: + dc.b 9,1,7,8,3,0,4,6,2,5,-1 + even +bln_a_part_rnd_seq_row_4: + dc.b 1,2,8,3,9,4,5,7,0,6,-1 + even +bln_a_part_rnd_seq_row_5: + dc.b 6,1,2,0,9,3,4,7,5,8,-1 + even +bln_a_part_rnd_seq_row_6: + dc.b 8,6,3,1,7,0,5,4,9,2,-1 + even + +bln_fade_in_sequence: + dc.l bln_blit_intro_block_fade_in_0 + dc.l bln_blit_intro_block_fade_in_1 + REPT 15 + dc.l bln_blit_intro_block_fade_in_2 + ENDR + dc.l bln_blit_intro_block_final + dc.l bln_blit_intro_block_final + dc.l bln_load_next_seq_part_in + +bln_fade_out_in_sequence: + dc.l bln_blit_intro_block_fade_out_0 + REPT 13 + dc.l bln_blit_intro_block_fade_out_1 + ENDR + dc.l bln_blit_intro_block_fade_out_1_change_dir + dc.l bln_blit_intro_block_fade_in_0 + dc.l bln_blit_intro_block_fade_in_1 + REPT 15 + dc.l bln_blit_intro_block_fade_in_2 + ENDR + dc.l bln_blit_intro_block_final + dc.l bln_blit_intro_block_final + dc.l bln_load_next_seq_part_out_in + +;-------------------------------------------------------------------- + +bln_circle_scripts: + dc.w bln_circle1_script-* + dc.w bln_circle2_script-* + dc.w bln_circle3_script-* + dc.w bln_circle4_script-* + dc.w bln_circle5_script-* + dc.w bln_circle6_script-* + dc.w 0 + +bln_circle1_script: + dc.w 375,bln_load_circle_eye_1-* + dc.w 281,bln_reverse_big_circle_to_backward-* + ; 656 + dc.w 187,bln_load_circle_greets_bg_3-* + dc.w 0 + +bln_circle2_script: + dc.w 93,bln_load_circle_nop-* + dc.w 187,bln_load_circle_pos_eye_1_sunset-* + dc.w 281,bln_reverse_smaller_circle_to_backward-* + ; 561 + dc.w 187,bln_load_circle_greets_bg_4-* + dc.w 0 + +bln_circle3_script: + dc.w 187,bln_load_circle_nop-* + dc.w 328,bln_load_circle_pos_eye_2-* + dc.w 234,bln_reverse_big_circle_to_backward-* + ; 749 + dc.w 0 + +bln_circle4_script: + dc.w 281,bln_load_circle_nop-* + dc.w 93,bln_load_circle_pos_eye_2_skin-* + dc.w 187,bln_reverse_small_circle_to_backward-* + ; 561 + dc.w 187,bln_load_circle_greets_bg_5-* + dc.w 0 + +bln_circle5_script: + dc.w 375,bln_load_circle_nop-* + dc.w 184,bln_load_circle_cham_bg_1-* + dc.w 190,bln_reverse_smaller_circle_to_backward-* + ; 749 + dc.w 187,bln_load_circle_greets_bg_1-* + dc.w 0 + +bln_circle6_script: + dc.w 469,bln_load_circle_nop-* + ; 469 + dc.w 197,bln_load_circle_greets_bg_2-* + dc.w 0 + +;-------------------------------------------------------------------- + +bln_circle_greetings_scripts: + dc.w bln_circle_greet1_script-* + dc.w bln_circle_greet2_script-* + dc.w bln_circle_greet3_script-* + dc.w bln_circle_greet4_script-* + dc.w bln_circle_greet5_script-* + dc.w bln_circle_greet6_script-* + dc.w 0 + +bln_circle_greet1_script: + dc.w 47,bln_load_circle_nop-* + dc.w 187,bln_reverse_smaller_circle_to_backward-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 0 + +bln_circle_greet2_script: + dc.w 94,bln_load_circle_nop-* + dc.w 187,bln_reverse_smaller_circle_to_backward-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 0 + +bln_circle_greet3_script: + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 0 + +bln_circle_greet4_script: + dc.w 187,bln_reverse_smaller_circle_to_backward-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 0 + +bln_circle_greet5_script: + dc.w 141,bln_load_circle_nop-* + dc.w 187,bln_reverse_smaller_circle_to_backward-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 1,bln_load_next_greeting-* + dc.w 0 + +bln_circle_greet6_script: + dc.w 187,bln_load_circle_nop-* + dc.w 187,bln_reverse_smaller_circle_to_backward-* + dc.w 0 + + dc.w $000 ; is required for true color image decoding +bln_images_palette: + include "../data/blend/fiveimg_ham.pal.asm" + +bln_leaves_tc_10: + incbin "../data/blend/leavestc_10.raw" + +bln_endlogo_palette: + include "../data/blend/PLT_DSRLogo01c_ham.pal.asm" + + dc.l 0 +bln_circlerads: + include "circlerads.asm" + dc.l 0 +bln_circlerads_smaller: + include "circlerads2.asm" + dc.l 0 +bln_circlerads_greets: + include "circleradsgreets.asm" + dc.l 0 + +bln_greets_positions: + REPT 3 + dc.w 144,24,2*8 + dc.w 288,64,0*8 + dc.w 192,120,2*8 + dc.w 64,77,1*8 + dc.w 272,145,3*8 + dc.w 128,105,3*8 + dc.w 256,93,0*8 + + dc.w 128,149,0*8 + dc.w 176,73,2*8 + dc.w 80,35,3*8 + dc.w 208,24,1*8 + dc.w 48,118,1*8 + ENDR + dc.w 0 + +bln_greets_lines: + ; greetings page 1, 18 + dc.w 25,48,79,17,7 ; Plush + dc.w 17,53,218,168,8 ; Dead Hackers Society + dc.w 15,68,66,97,7 ; Istari + dc.w 22,140,85,102,7 ; Rebels + dc.w 20,157,92,117,7 ; Nuance + dc.w 102,27,163,60,7 ; Melon + dc.w 93,36,154,74,7 ; Insane + dc.w 72,46,158,95,7 ; Alcatraz + dc.w 67,61,229,155,8 ; Five Finger Punch + dc.w 143,143,173,160,6 ; TBL + dc.w 162,59,251,9,7 ; Logicoma + dc.w 168,74,240,32,7 ; Fnuque + dc.w 159,98,283,26,8 ; Focus Design + dc.w 168,113,304,32,8 ; Batman Group + dc.w 219,169,292,128,7 ; Loonies + dc.w 231,92,283,123,7 ; Noice + dc.w 221,106,266,134,6 ; Void + dc.w 263,73,311,46,6 ; SMFX + dc.w 0 + + ; greetings page 2, 17 + dc.w 13,158,90,112,7 ; Proxima + dc.w 26,48,191,144,8 ; Software Failure + dc.w 20,63,183,157,8 ; Attention Whore + dc.w 21,170,101,126,7 ; Offence + dc.w 31,15,177,100,8 ; Moods Plateau + dc.w 74,58,182,121,7 ; Planet Jazz + dc.w 82,28,182,85,7 ; Resistance + dc.w 105,128,177,171,7 ; Oxyron + dc.w 133,47,186,13,7 ; Abyss + dc.w 177,74,272,17,7 ; Nectarine + dc.w 183,86,283,30,7 ; Jumalauta + dc.w 182,121,289,61,7 ; Spaceballs + dc.w 182,156,284,98,7 ; Nah-Kolor + dc.w 187,102,307,31,7 ; Spreadpoint + dc.w 193,170,225,150,6 ; TEK + dc.w 219,119,297,72,7 ; Cocoon + dc.w 243,128,307,168,7 ; Lemon. + dc.w 0 + dc.w 0 + + IFND FW_DEMO_PART + dc.w 1 ; avoid hunk shortening that leaves dirty memory on kick 1.3 + ENDC + +;******************************************************************** + + section "bln_copper",data,chip + +bln_copperlist: + COP_MOVE dmacon,DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + COP_MOVE diwstrt,$5281 ; window start + COP_MOVE diwstop,$06c1 ; window stop + COP_MOVE ddfstrt,$0038 ; bitplane start +bln_ddfstop: + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon3,$0c00 +bln_fmode: + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + + COP_MOVE bplcon0,$0200 + COP_MOVE bplcon1,$0000 + COP_MOVE bplcon2,$0024 ; turn off all bitplanes, set scroll values to 0, sprites in front + ;COP_MOVE bpl1mod,(BLENDVIEW_WIDTH*BLENDVIEW_PLANES-BLENDVIEW_WIDTH)/8 + ;COP_MOVE bpl2mod,(BLENDVIEW_WIDTH*BLENDVIEW_PLANES-BLENDVIEW_WIDTH)/8 + COP_MOVE bpl1mod,0 + COP_MOVE bpl2mod,0 + +bln_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +; This is not supposed to be in chip, but we need to balance out chip and fast mem usage +bln_circleinfo: + include "circleinfo.asm" + dc.w 0 + +bln_andyou_image: + incbin "../data/blend/andyou_128x92x2.BPL" + +bln_blend_image_1: + incbin "../data/blend/fiveimg1_ham.raw" + + IFND FW_DEMO_PART + section "bln_cat",data,chip +bln_blend_image_2: + incbin "../data/blend/fiveimg2_ham.raw" +bln_blend_image_3: + incbin "../data/blend/fiveimg3_ham.raw" +bln_blend_image_4: + incbin "../data/blend/fiveimg4_ham.raw" +bln_blend_image_5: + incbin "../data/blend/fiveimg5_ham.raw" +bln_endlogo_image: + incbin "../data/blend/PLT_DSRLogo01c_ham.raw" + + IFD ENABLE_PART_MUSIC + section "part_music_samples",data,chip ; section for music playback +part_music_smp: + incbin "../data/music/dsr_68k_tune_2_v11.lsbank" + + section "part_music_data",data ; section for music playback +part_music_data: + incbin "../data/music/dsr_68k_tune_2_v11.lsmusic" + ENDC + ENDC + END \ No newline at end of file diff --git a/source/blend/circleinfo.asm b/source/blend/circleinfo.asm new file mode 100644 index 0000000..7da6f0a --- /dev/null +++ b/source/blend/circleinfo.asm @@ -0,0 +1,480 @@ + ; Radius 3 + dc.w 87 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 4 + dc.w 86 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 5 + dc.w 85 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 6 + dc.w 84 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 7 + dc.w 83 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 8 + dc.w 82 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 9 + dc.w 81 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 10 + dc.w 80 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 11 + dc.w 79 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 12 + dc.w 78 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 13 + dc.w 77 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 14 + dc.w 76 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 15 + dc.w 75 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 2,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 16 + dc.w 74 + dc.w 0,0,0 ; no top + dc.w 0,0 ; no left + dc.w 3,18 + dc.w 0,0,0 ; no inner + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 17 + dc.w 83 + dc.w 2,10,18 + dc.w 1,16 + dc.w 1,22 + dc.w $1683,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 18 + dc.w 81 + dc.w 2,9,18 + dc.w 1,16 + dc.w 1,22 + dc.w $1c83,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 19 + dc.w 79 + dc.w 2,8,18 + dc.w 1,16 + dc.w 1,22 + dc.w $2283,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 20 + dc.w 78 + dc.w 2,8,18 + dc.w 1,16 + dc.w 1,22 + dc.w $2583,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 21 + dc.w 76 + dc.w 2,7,18 + dc.w 1,16 + dc.w 1,22 + dc.w $2b83,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 22 + dc.w 75 + dc.w 2,7,18 + dc.w 1,16 + dc.w 1,22 + dc.w $2e83,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 23 + dc.w 73 + dc.w 2,6,18 + dc.w 1,16 + dc.w 1,22 + dc.w $3483,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 24 + dc.w 72 + dc.w 2,6,18 + dc.w 1,16 + dc.w 1,22 + dc.w $3783,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 25 + dc.w 71 + dc.w 2,6,18 + dc.w 1,16 + dc.w 1,22 + dc.w $3a83,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 26 + dc.w 69 + dc.w 2,5,18 + dc.w 1,16 + dc.w 1,22 + dc.w $4083,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 27 + dc.w 68 + dc.w 2,5,18 + dc.w 1,16 + dc.w 1,22 + dc.w $4383,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 28 + dc.w 67 + dc.w 2,5,18 + dc.w 1,16 + dc.w 1,22 + dc.w $4683,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 29 + dc.w 66 + dc.w 2,5,18 + dc.w 1,16 + dc.w 1,22 + dc.w $4983,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 30 + dc.w 64 + dc.w 2,4,18 + dc.w 1,16 + dc.w 1,22 + dc.w $4f83,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 31 + dc.w 63 + dc.w 2,4,18 + dc.w 1,16 + dc.w 1,22 + dc.w $5283,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 32 + dc.w 82 + dc.w 4,24,16 + dc.w 1,16 + dc.w 2,22 + dc.w $1983,$0012,$0022 + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 33 + dc.w 80 + dc.w 4,23,16 + dc.w 1,14 + dc.w 1,24 + dc.w $1f85,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 34 + dc.w 77 + dc.w 4,21,16 + dc.w 1,14 + dc.w 1,24 + dc.w $2885,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 35 + dc.w 75 + dc.w 4,20,16 + dc.w 1,14 + dc.w 1,24 + dc.w $2e85,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 36 + dc.w 73 + dc.w 4,19,16 + dc.w 1,14 + dc.w 1,24 + dc.w $3485,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 37 + dc.w 71 + dc.w 4,18,16 + dc.w 1,14 + dc.w 1,24 + dc.w $3a85,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 38 + dc.w 69 + dc.w 4,17,16 + dc.w 1,14 + dc.w 1,24 + dc.w $4085,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 39 + dc.w 67 + dc.w 4,16,16 + dc.w 1,14 + dc.w 1,24 + dc.w $4685,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 40 + dc.w 66 + dc.w 4,16,16 + dc.w 1,14 + dc.w 1,24 + dc.w $4985,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 41 + dc.w 64 + dc.w 4,15,16 + dc.w 1,14 + dc.w 1,24 + dc.w $4f85,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 42 + dc.w 63 + dc.w 4,15,16 + dc.w 1,14 + dc.w 1,24 + dc.w $5285,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 43 + dc.w 61 + dc.w 4,14,16 + dc.w 1,14 + dc.w 1,24 + dc.w $5885,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 44 + dc.w 60 + dc.w 4,14,16 + dc.w 1,14 + dc.w 1,24 + dc.w $5b85,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 45 + dc.w 58 + dc.w 4,13,16 + dc.w 1,14 + dc.w 1,24 + dc.w $6185,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 46 + dc.w 57 + dc.w 4,13,16 + dc.w 1,14 + dc.w 1,24 + dc.w $6485,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 47 + dc.w 55 + dc.w 4,12,16 + dc.w 1,14 + dc.w 1,24 + dc.w $6a85,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 48 + dc.w 54 + dc.w 4,12,16 + dc.w 1,14 + dc.w 2,24 + dc.w $6d85,$0010,$001e + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 49 + dc.w 77 + dc.w 6,36,14 + dc.w 1,12 + dc.w 1,26 + dc.w $2887,$000e,$001a + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + + ; Radius 50 + dc.w 74 + dc.w 6,34,14 + dc.w 1,12 + dc.w 1,26 + dc.w $3187,$000e,$001a + dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0 + dc.l 0,0,0 ; mask ptrs + dc.l 0,0,0,0,0,0 ; smc + diff --git a/source/blend/circlerads.asm b/source/blend/circlerads.asm new file mode 100644 index 0000000..e3f06ac --- /dev/null +++ b/source/blend/circlerads.asm @@ -0,0 +1,22 @@ + dc.b 3,3,3,4,6,7,9,10,12,14,15,16,17,18,19,20 + dc.b 21,22,22,22,22,22,22,22,22,22,22,22,22,21,21,20 + dc.b 20,19,18,17,17,16,15,14,13,13,12,11,11,10,9,8 + dc.b 8,8,7,6,6,6,6,5,6,6,6,6,6,6,6,6 + dc.b 7,8,8,8,9,10,10,10,11,12,12,12,13,14,14,14 + dc.b 15,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23 + dc.b 24,25,25,25,26,27,27,27,28,28,29,29,30,30,30,30 + dc.b 31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34 + dc.b 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34 + dc.b 34,34,34,34,34,34,34,34,35,35,35,35,35,35,35,35 + dc.b 36,36,36,36,37,37,37,37,38,38,38,38,39,39,40,40 + dc.b 41,41,41,42,43,43,43,44,45,45,45,46,47,47,48,48 + dc.b 48,48,49,49,49,49,49,50,50,50,50,50,50,50,50,50 + + dc.b 50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50 + dc.b 50,49,49,49,49,48,48,48,48,47,47,47,47,46,46,46 + dc.b 46,45,45,45,45,45,44,44,44,44,44,44,44,44,44,44 + dc.b 44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44 + dc.b 45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48 + dc.b 49,49,49,49,50,50,50,50,50,50,50,50,50,50,50,50 + + dc.l 0 \ No newline at end of file diff --git a/source/blend/circlerads2.asm b/source/blend/circlerads2.asm new file mode 100644 index 0000000..8b5e993 --- /dev/null +++ b/source/blend/circlerads2.asm @@ -0,0 +1,19 @@ + dc.b 3,3,3,3,3,4,6,7,8,9,10,11,12,13,14,15 + dc.b 15,16,17,17,18,18,19,19,20,20,20,20,20,20,20,20 + dc.b 19,19,19,19,19,18,18,17,17,17,16,16,16,15,15,15 + dc.b 15,15,15,15,15,15,15,14,14,14,14,14,14,14,14,14 + dc.b 15,15,15,15,15,16,16,16,16,17,17,17,17,17,17,18 + dc.b 18,18,18,18,18,18,18,18,18,18,18,18,18,17,17,17 + dc.b 17,17,16,16,15,14,15,15,15,14,13,12,13,13,13,13 + dc.b 13,12,13,13,13,13,13,13,14,15,15,15,15,15,16,17 + dc.b 17,17,18,18,19,20,20,21,21,22,23,24,24,24,25,25 + dc.b 26,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28 + dc.b 28,28,28,28,27,27,27,26,26,25,25,24,24,23,23,23 + dc.b 22,22,21,21,21,20,20,20,20,20,20,20,20,20,20,20 + + dc.b 20,20,20,20,20,20,21,21,21,22,22,23,23,24,24,25 + dc.b 25,25,26,26,27,27,27,28,28,28,28,28,28,28,28,28 + dc.b 28,28,28,28,28,28,28,28,27,27,27,26,26,25,25,24 + dc.b 24,24,23,23,22,22,21,21,21,21,20,20,20,20,20,20 + + dc.l 0 \ No newline at end of file diff --git a/source/blend/circleradsgreets.asm b/source/blend/circleradsgreets.asm new file mode 100644 index 0000000..e64006b --- /dev/null +++ b/source/blend/circleradsgreets.asm @@ -0,0 +1,9 @@ + dc.b 3,4,5,6,7,8,8,9,9,9,10,10,10,11,11,11 + dc.b 12,12,12,13,13,13,14,14,14,14,15,15,15,15,16,16 + + dc.b 18,18,18,18,17,17,17,16,16,16,15,15,15,14,14,14 + dc.b 14,14,14,13,13,13,13,13,13,13,13,12,12,12,12,12 + dc.b 12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15 + dc.b 15,15,16,16,16,16,16,17,17,17,17,17,18,18,18,18 + + dc.l 0 \ No newline at end of file diff --git a/source/blend/compile.bat b/source/blend/compile.bat new file mode 100644 index 0000000..bde7695 --- /dev/null +++ b/source/blend/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "blend.exe" "blend.asm" diff --git a/source/blend/debug.bat b/source/blend/debug.bat new file mode 100644 index 0000000..ed91f6a --- /dev/null +++ b/source/blend/debug.bat @@ -0,0 +1,21 @@ +del blend.exe +del "..\winuae\hd0\blend.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "blend.exe" "blend.asm" + +copy blend.exe "..\winuae\hd0" +copy blend.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =blend.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/blend/record.bat b/source/blend/record.bat new file mode 100644 index 0000000..6f62c69 --- /dev/null +++ b/source/blend/record.bat @@ -0,0 +1,30 @@ +del blend.exe +del "..\winuae\hd0\blend.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "blend.exe" "blend.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy blend.exe "..\winuae\hd0" +copy blend.exe "..\winuae\hd0\a.exe" + +@echo /|set /p =blend.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_rec.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/bulb/aga.bat b/source/bulb/aga.bat new file mode 100644 index 0000000..5203f71 --- /dev/null +++ b/source/bulb/aga.bat @@ -0,0 +1,30 @@ +del bulb.exe +del "..\winuae\hd0\bulb.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "bulb.exe" "bulb.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy bulb.exe "..\winuae\hd0" +copy bulb.exe "..\winuae\hd0\a" + +@echo /|set /p =bulb.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/bulb/assemble.bat b/source/bulb/assemble.bat new file mode 100644 index 0000000..f1ffce5 --- /dev/null +++ b/source/bulb/assemble.bat @@ -0,0 +1,40 @@ +del bulb.exe +del "..\winuae\hd0\bulb.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +pushd .. + +tools\KingCon.exe @data/bulb/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\ZCP data/bulb/lamp_48x32x16.BPL data/bulb/lamp_48x32x16.zcp 48 32 -c data/bulb/lamp_48x32x16.chk +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +vc -O2 -notmpfile -nostdlib -o "bulb.exe" "bulb.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy bulb.exe "..\winuae\hd0" +copy bulb.exe "..\winuae\hd0\a" + +@echo /|set /p =bulb.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/bulb/blitterline_bq.asm b/source/bulb/blitterline_bq.asm new file mode 100644 index 0000000..f796b11 --- /dev/null +++ b/source/bulb/blitterline_bq.asm @@ -0,0 +1,132 @@ +;---------------------------------------------------------------------------------- +; Draw regular blitter line +; +; The routine will exit with the blitter active +; +; in d0.w x0 +; d1.w y0 +; d2.w x1 +; d3.w y1 +; d4.w bytes per row in bitplane +; a0 bitplane +; a5 $dff000 +; a0/d0-d5 trashed + +blb_blitter_line_init_bq: + ADD_TO_BLITTER_QUEUE a4,a0 + clr.l (a4)+ + lea .bq_init(pc),a0 + move.l a0,(a4)+ + move.w d4,(a4)+ + rts +.bq_init + PUTMSG 50,<"Line Init"> + moveq.l #-1,d0 + move.w #BLTCON1F_LINE,bltcon1(a5) + move.w #$8000,bltadat(a5) + move.l d0,bltafwm(a5) + move.w d0,bltbdat(a5) + move.w (a0)+,bltcmod(a5) + BLTHOGON + moveq.l #0,d0 + rts + +;---------------------------------------------------------------------------------- +; Draw regular blitter line to blitter queue +; +; in d0.w x0 +; d1.w y0 +; d2.w x1 +; d3.w y1 +; d4.w bytes per row in bitplane +; a0 bitplane +; a4 blitterqueue struct + +blb_draw_blitter_line_bq: + cmp.w d1,d3 + bge.s .downward + exg d0,d2 + exg d1,d3 +.downward + + mulu d1,d4 + lea (a0,d4.w),a1 + + moveq.l #-16,d4 + and.w d0,d4 + lsr.w #3,d4 + adda.w d4,a1 + + moveq.l #15,d4 + and.w d0,d4 + ror.w #4,d4 + or.w d5,d4 + or.w #BLTCON0F_USEA|BLTCON0F_USEC|BLTCON0F_USED,d4 + swap d4 + + sub.w d0,d2 + bpl.s .positiveDX + neg.w d2 + addq.w #1,d4 +.positiveDX + sub.w d1,d3 + cmp.w d2,d3 + bls.s .absDyLessThanAbsDx + exg d2,d3 + addq.w #4,d4 +.absDyLessThanAbsDx + move.b .octants(pc,d4.w),d4 + + add.w d3,d3 ; 2 * dy + move.w d3,d5 + sub.w d2,d5 ; 2 * dy - dx + bpl.s .positiveGradient + or.w #BLTCON1F_SIGN,d4 +.positiveGradient + add.w d5,d5 ; 4 * dy - 2 * dx + add.w d2,d2 ; 2 * dx + add.w d2,d2 ; 4 * dx + add.w d3,d3 ; 4 * dy + + move.w d3,d0 + sub.w d2,d3 ; 4 * (dy - dx) + + addq.w #4,d2 ; extra word height + lsl.w #4,d2 + addq.w #2,d2 ; width == 2 + + moveq.l #0,d1 + move.l a4,a0 + + move.l d1,(a4)+ + move.l #.bq_routine,(a4)+ + move.l d4,(a4)+ ; bql_BltCon01 + move.l a1,(a4)+ ; bql_BltCPt + move.w d0,(a4)+ ; bql_BltBMod, 4 * dy + move.w d3,(a4)+ ; bql_BltAMod, 4 * (dy - dx) + move.w d5,(a4)+ ; bql_BltAPtLo, 4 * dy - 2 * dx + ;move.l #blitter_temp_output_word,(a4)+ ; bql_BltDPt + move.l a1,(a4)+ ; bql_BltDPt + move.w d2,(a4)+ ; bql_BltSize + CALLFW AddToBlitterQueue + rts + +.octants + dc.b BLTCON1F_LINE|BLTCON1F_SUD ; octant 7 + dc.b BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_AUL ; octant 4 + dc.b BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_SUL ; octant 0 + dc.b BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_SUL|BLTCON1F_AUL ; octant 3 + dc.b BLTCON1F_LINE|0 ; octant 6 + dc.b BLTCON1F_LINE|BLTCON1F_SUL ; octant 5 + dc.b BLTCON1F_LINE|BLTCON1F_AUL ; octant 1 + dc.b BLTCON1F_LINE|BLTCON1F_SUL|BLTCON1F_AUL ; octant 2 + even + +.bq_routine + PUTMSG 50,<"LineDraw %p">,a0 + move.l (a0)+,bltcon0(a5) + move.l (a0)+,bltcpt(a5) + move.l (a0)+,bltbmod(a5) + move.l (a0)+,bltapt+2(a5) + move.l (a0)+,bltdpt+2(a5) + rts diff --git a/source/bulb/bulb.asm b/source/bulb/bulb.asm new file mode 100644 index 0000000..ed4e47f --- /dev/null +++ b/source/bulb/bulb.asm @@ -0,0 +1,3620 @@ +; TODOs: +; - fix stray unfilled pixels in text panel gfx? +; - fix bugs in outro (top line, right hand side diagonal line problem) +; +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 0 +FW_MUSIC_PLAYER_CHOICE = 0 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker (CPU DMA wait), 5 = Pretracker Turbo (Copper wait) +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 0 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 308 ; max vpos that is considered to be worth switching to a background task, if any +FW_SCRIPTING_SUPPORT = 0 ; enable simple timed scripting functions +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 1 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 1 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 0 + + ENDC + +KNIGHTS_WIDTH = 320 +KNIGHTS_HEIGHT = 180 +KNIGHTS_BPLSIZE = (KNIGHTS_WIDTH*KNIGHTS_HEIGHT)/8 +KNIGHTS_SLICE_WIDTH = 32 + +KNIGHTS_MOD = (2*KNIGHTS_WIDTH)/8 +KNIGHTS_BUF_WIDTH = 8*KNIGHTS_WIDTH +KNIGHTS_BUF_MOD = (KNIGHTS_BUF_WIDTH/8) + +KNIGHTS_TMP_BUFFER_SIZE = 3*(KNIGHTS_SLICE_WIDTH/8)*KNIGHTS_HEIGHT + +NUM_LAMP_ROTATIONS = 41 + +LAMP_WIDTH = 48 +LAMP_HEIGHT = 32 +LAMP_PLANES = 4 + +TITLETEXT_WIDTH = 128 +TITLETEXT_HEIGHT = 80 +TITLETEXT_PLANES = 2 + +TITLETEXT_Y_POS = 88 +TITLETEXT_X_POS = 96 + +BQ_SIZE = 6000 + +NUM_BQ_AHEAD_BUFFERS = 12 + +SWING_FRAMES = 256 +PAINT_FRAMES = 258 + +ALL_SWING_FRAMES = SWING_FRAMES+48 +ALL_PAINT_FRAMES = PAINT_FRAMES+48 + +COP_PREAMBLE_INST = 16 ; bplptrs +COP_POST_INST = 16 ; wait +COP_INST_PER_LINE = 1+4+1 ; wait, 4 colors, aux +COP_LIST_SIZE = (COP_PREAMBLE_INST+COP_INST_PER_LINE*KNIGHTS_HEIGHT+COP_POST_INST)*4 + +CHIPMEM_SIZE = (KNIGHTS_BPLSIZE*16)+COP_LIST_SIZE*2+KNIGHTS_TMP_BUFFER_SIZE+NUM_BQ_AHEAD_BUFFERS*(KNIGHTS_HEIGHT*4*2)+NUM_LAMP_ROTATIONS*(LAMP_WIDTH/8)*(LAMP_HEIGHT+2)*LAMP_PLANES+(TITLETEXT_WIDTH/8)*(TITLETEXT_HEIGHT+1)*TITLETEXT_PLANES*2 +FASTMEM_SIZE = KNIGHTS_WIDTH*KNIGHTS_HEIGHT*2+NUM_BQ_AHEAD_BUFFERS*BQ_SIZE+(ALL_SWING_FRAMES+ALL_PAINT_FRAMES+PAINT_FRAMES)*4+4096*2 + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + + include "../framework/framework.i" + + +; Memory use: +; - CHIP DATA: 320 x 180 x 6 = 43200 (6 original, planar, scrambled as 4+2) +; - CHIP DATA: 128 x 65 x 2 x 2 = 4160 (text sprites) +; +; - CHIP BSS : 320 x 180 x 8 x 2 = 115200 (4x2 db / 2x2 db, 2 draw, 2 fill, interleaved) +; - CHIP BSS : 2 x 180 x 4 x 2 = 2880 (4 line colors, db) +; - CHIP BSS : 48 x 34 x 4 x 41 = 33456 (lamp rotations) +; +; Total: 202 KB +; +; Fast memory use: +; - FAST DATA: 48 x 32 x 8 = 1536 (lamp chunky) +; +; - FAST BSS : 320 x 180 x 2 = 115200 (True color buffer) +; - FAST BSS : 6000 x 8 = 48000 (Blitterqueues) +; +; Algorithm: +; - mark all blocks as darkest +; - restore left hand side color via blitter +; - for both line pairs lines: +; - draw blitter lines in single bitplane +; - fill stripes according to stripe information to separate bitplanes +; - clear blitter lines in single bitplane +; - redraw dirty stripes +; - mode: +; - plain: just copy (darkest only needs 2 planes copy + 1-2 planes black) +; - darkest/dark: copy directly with mask (may overlap dark/bright) +; - dark/bright: copy directly with mask +; - darkest/dark/bright: copy with mask from existing background +; - draw blitter line in lower four bitplanes with color pattern +; - stops at left hand side edge +; - call precalculated line color copying +; - if left hand side edge is reached, continues to overwrite left hand side color +; - draw blitter line in upper two bitplanes with zero to make index color +; - blit colors with shifting into copperlists +; +; Memory layout: +; a1-b1-a2-b2-a3-b3-a4-b4 = 8*320*180 = 57600 +; a5-b5-a6-b6-d1-f1-d2-f2 = 8*320*180 = 57600 +; p1-p2-p3-p4 = 4*320*180 = 28800 +; p5-p6 = 2*320*180 = 14400 +; +; Per frame: +; 4+2+4 lines, 9-12 fill blits, 130-200 paint blits + + STRUCTURE RayData,0 + UWORD rd_StartY12 + UWORD rd_StartX1 + UWORD rd_EndY1 + UWORD rd_EndX1 + UWORD rd_StartX2 + UWORD rd_EndY2 + UWORD rd_EndX2 + LABEL rd_SIZEOF + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrDbPlanesP1234Ptr + APTR pd_CurrDbPlanesP56Ptr + APTR pd_LastDbPlanesP1234Ptr + APTR pd_LastDbPlanesP56Ptr + APTR pd_CurrLineColorsPtr + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + APTR pd_CurrTextSpritesPtr + APTR pd_LastTextSpritesPtr + APTR pd_SpriteDataPtr + UBYTE pd_DbToggle + UBYTE pd_AsyncDbToggle + ALIGNWORD + + UWORD pd_PartCountDown + BOOL pd_LampIsOn + + UWORD pd_CopperLinesFixupOffset + UWORD pd_CopperLogoColorOffset + UWORD pd_SwingFrameNum + UWORD pd_PaintFrameNum + UWORD pd_LampFrameNum + UWORD pd_PullDownYPos + UWORD pd_NextQueueTriggerFrame + UWORD pd_CurrBlitSize + + UWORD pd_LampYOffset + BOOL pd_PrecalcDone + + APTR pd_CopperList1 + APTR pd_CopperList2 + APTR pd_DbBufferP1234 + APTR pd_DbBufferP56 + APTR pd_OriginalBufferP1234 + APTR pd_OriginalBufferP56 + APTR pd_MiddleMaskBuffer + APTR pd_RightMaskBuffer + APTR pd_BothLinesMaskBuffer + + APTR pd_LineColorsBuffer + APTR pd_LampSpriteBuffer + APTR pd_TextSpriteBuffer + + APTR pd_BqBuffer + APTR pd_BqDataReadPtr + APTR pd_BqDataWritePtr + APTR pd_BqDataEndPtr + UWORD pd_PrecalculatedFrames + + LABEL pd_LampChunkyBuffer + APTR pd_TrueColorImage + APTR pd_SwingDataPtr + APTR pd_TextPaintDataPtr + APTR pd_TextPanelsPtr + APTR pd_SourcePanelPtr + UWORD pd_SourcePanelNum + + APTR pd_FillBrightBuffer + APTR pd_FillDarkBuffer + APTR pd_DrawBrightBuffer + APTR pd_DrawDarkBuffer + + APTR pd_SwingScriptFramesPtrs + APTR pd_PaintScriptFramesPtrs + APTR pd_TextPaintScriptFramesPtrs + + APTR pd_ShadeTableXor + + STRUCT pd_LampSprites,8*4 + STRUCT pd_TextSprites,2*(TITLETEXT_WIDTH/16)*4 + + STRUCT pd_XSheer1,LAMP_HEIGHT + STRUCT pd_XSheer2,LAMP_HEIGHT + STRUCT pd_YSheer,LAMP_WIDTH + + STRUCT pd_LampPalette,15*cl_SIZEOF + STRUCT pd_KnightsPalette,16*2 + STRUCT pd_PreparationTask,ft_SIZEOF + + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + bsr.s blb_init + + move.w #DMAF_SETCLR|DMAF_SPRITE,dmacon(a5) ; enable sprite dma + + lea blb_copperlist,a0 + CALLFW SetCopper + + bsr blb_intro + bsr blb_main + bsr blb_brighten + bsr blb_outro + + CALLFW SetBaseCopper + + rts + +;-------------------------------------------------------------------- + +blb_init: + bsr blb_init_vars + bsr blb_init_lamp_sprite_pointers + + bsr blb_rearrange_buffers + bsr blb_clear_mask_buffers + + bsr blb_init_colors + + lea .backgroundtasks(pc),a0 + lea pd_PreparationTask(a6),a1 + CALLFW AddTask + rts + +.backgroundtasks + bsr blb_do_lamp_rotations + bsr blb_calc_true_color_image + bsr blb_calc_scene_pointers + st pd_PrecalcDone(a6) + bsr blb_init_shade_table + rts + +;-------------------------------------------------------------------- + +blb_init_vars: + tst.w fw_AgaChipset(a6) + beq.s .noaga + move.w #$00a0,blb_ddfstop+2 ; FIXME + move.w #$0003,blb_fmode+2 +.noaga + lea blb_text_panels(pc),a0 + move.l a0,pd_TextPanelsPtr(a6) + + move.l #(COP_LIST_SIZE*2),d0 + CALLFW AllocChip + + PUTMSG 10,<"Copperlist 1 %p">,a0 + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + lea COP_LIST_SIZE(a0),a0 + PUTMSG 10,<"Copperlist 2 %p">,a0 + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + move.l #(KNIGHTS_BPLSIZE*16),d0 + CALLFW AllocChip + PUTMSG 10,<"DbBufferP1234 %p">,a0 + move.l a0,pd_DbBufferP1234(a6) + move.l a0,pd_CurrDbPlanesP1234Ptr(a6) + lea 1*KNIGHTS_WIDTH/8(a0),a1 + move.l a1,pd_LastDbPlanesP1234Ptr(a6) + + adda.l #8*KNIGHTS_BPLSIZE,a0 + PUTMSG 10,<"DbBufferP56 %p">,a0 + move.l a0,pd_DbBufferP56(a6) + move.l a0,pd_CurrDbPlanesP56Ptr(a6) + lea 1*KNIGHTS_WIDTH/8(a0),a1 + move.l a1,pd_LastDbPlanesP56Ptr(a6) + + lea 4*KNIGHTS_WIDTH/8(a0),a0 + move.l a0,pd_DrawBrightBuffer(a6) + lea 1*KNIGHTS_WIDTH/8(a0),a0 + move.l a0,pd_FillBrightBuffer(a6) + lea 1*KNIGHTS_WIDTH/8(a0),a0 + move.l a0,pd_DrawDarkBuffer(a6) + lea 1*KNIGHTS_WIDTH/8(a0),a0 + move.l a0,pd_FillDarkBuffer(a6) + + lea blb_bulb_pic,a0 + move.l a0,pd_OriginalBufferP1234(a6) + PUTMSG 10,<"OriginalBufferP1234 %p">,a0 + lea 4*KNIGHTS_BPLSIZE(a0),a0 + PUTMSG 10,<"OriginalBufferP56 %p">,a0 + move.l a0,pd_OriginalBufferP56(a6) + + move.l #KNIGHTS_TMP_BUFFER_SIZE,d0 + CALLFW AllocChip + move.l a0,pd_MiddleMaskBuffer(a6) + lea (KNIGHTS_SLICE_WIDTH/8)*KNIGHTS_HEIGHT(a0),a0 + move.l a0,pd_RightMaskBuffer(a6) + lea (KNIGHTS_SLICE_WIDTH/8)*KNIGHTS_HEIGHT(a0),a0 + move.l a0,pd_BothLinesMaskBuffer(a6) + + move.l #NUM_LAMP_ROTATIONS*(LAMP_WIDTH/8)*(LAMP_HEIGHT+2)*LAMP_PLANES,d0 + CALLFW AllocChip + PUTMSG 10,<"LampSpriteBuffer %p">,a0 + move.l a0,pd_LampSpriteBuffer(a6) + + move.l #(TITLETEXT_WIDTH/8)*(TITLETEXT_HEIGHT+1)*TITLETEXT_PLANES*2,d0 + CALLFW AllocChip + PUTMSG 10,<"TextSpriteBuffer %p">,a0 + move.l a0,pd_TextSpriteBuffer(a6) + lea pd_TextSprites(a6),a1 + move.l a1,pd_CurrTextSpritesPtr(a6) + moveq.l #2*(TITLETEXT_WIDTH/16)-1,d7 +.tsprloop + move.l a0,(a1)+ + clr.l TITLETEXT_HEIGHT*2*TITLETEXT_PLANES(a0) + lea (TITLETEXT_HEIGHT+1)*2*TITLETEXT_PLANES(a0),a0 + dbra d7,.tsprloop + + move.l #NUM_BQ_AHEAD_BUFFERS*KNIGHTS_HEIGHT*4*2,d0 + CALLFW AllocChip + PUTMSG 10,<"LineColorsBuffer %p">,a0 + move.l a0,pd_LineColorsBuffer(a6) + move.l a0,pd_CurrLineColorsPtr(a6) + + move.l #(KNIGHTS_WIDTH*KNIGHTS_HEIGHT*2),d0 + CALLFW AllocFast + PUTMSG 10,<"TrueColorImage %p">,a0 + move.l a0,pd_TrueColorImage(a6) + + move.l #NUM_BQ_AHEAD_BUFFERS*BQ_SIZE,d0 + CALLFW AllocFast + PUTMSG 10,<"BqBuffers %p">,a0 + addq.l #4,a0 ; extra longwords for blitsize & lamp on + move.l a0,pd_BqDataReadPtr(a6) + move.l a0,pd_BqDataWritePtr(a6) + move.l a0,pd_BqBuffer(a6) + add.l #NUM_BQ_AHEAD_BUFFERS*BQ_SIZE,a0 + move.l a0,pd_BqDataEndPtr(a6) + + move.l #(ALL_SWING_FRAMES+ALL_PAINT_FRAMES+PAINT_FRAMES)*4,d0 + CALLFW AllocFast + PUTMSG 10,<"ScriptFramesPtrs %p">,a0 + move.l a0,pd_SwingScriptFramesPtrs(a6) + lea ALL_SWING_FRAMES*4(a0),a0 + move.l a0,pd_PaintScriptFramesPtrs(a6) + lea ALL_PAINT_FRAMES*4(a0),a0 + move.l a0,pd_TextPaintScriptFramesPtrs(a6) + + move.l #4096*2,d0 + CALLFW AllocFast + move.l a0,pd_ShadeTableXor(a6) + PUTMSG 10,<"ShadeTableXor %p">,a0 + + rts + +;-------------------------------------------------------------------- + +blb_init_lamp_sprite_pointers: + lea blb_coppersprites+2,a0 + lea fw_EmptySprite(a6),a1 + moveq.l #8-1,d7 +.sprloop + move.w (a1),(a0) + move.w 2(a1),4(a0) + addq.w #8,a0 + dbra d7,.sprloop + rts + +;-------------------------------------------------------------------- + +blb_init_colors: + lea color(a5),a1 + lea blb_bulb_palette_expanded(pc),a0 + moveq.l #(16/2)-1,d7 +.ploop + move.l (a0)+,(a1)+ + dbra d7,.ploop + + addq.w #2,a1 + lea blb_lamp_off_palette(pc),a0 + moveq.l #15-1,d7 +.palloop + move.w (a0)+,(a1)+ + dbra d7,.palloop + + moveq.l #15,d0 + lea blb_lamp_off_palette(pc),a0 + lea pd_LampPalette(a6),a1 + CALLFW InitPaletteLerp + + rts + +;-------------------------------------------------------------------- + +blb_init_shade_table: + move.l pd_ShadeTableXor(a6),a0 + PUTMSG 10,<"%d: Init Shade Table %p">,fw_FrameCounterLong(a6),a0 + move.l a0,a1 + moveq.l #0,d0 +.xorloop + moveq.l #$11,d3 + moveq.l #15,d1 + cmp.b d1,d0 + bhi.s .upperset + and.b d1,d3 +.upperset + and.b d0,d1 + bne.s .lowerset + subq.b #1,d3 +.lowerset + move.w d3,(a0)+ + addq.b #1,d0 + bne.s .xorloop + + moveq.l #15-1,d7 + move.l #$01000100,d3 +.xoroloop + move.l a1,a2 + move.w #128-1,d6 +.xor2loop + move.l (a2)+,d0 + add.l d3,d0 + move.l d0,(a0)+ + dbra d6,.xor2loop + dbra d7,.xoroloop + + rts + +;-------------------------------------------------------------------- + +blb_intro: + bsr blb_flip_db_frame + bsr blb_intro_fill_low_brightness + bsr blb_flip_db_frame + bsr blb_intro_fill_low_brightness + move.w #320,pd_LampFrameNum(a6) + move.w #-80,pd_LampYOffset(a6) + IFD FW_DEMO_PART + CALLFW StartMusic + ENDC +.loop + CALLFW VSyncWithTask + + bsr blb_flip_copper_frame + bsr blb_update_lamp_sprite + move.w pd_LampYOffset(a6),d0 + beq.s .skipdown + addq.w #1,d0 + move.w d0,pd_LampYOffset(a6) +.skipdown + + bsr blb_create_intro_copperlist + bsr blb_update_copper_list_pointers + + tst.w pd_LampYOffset(a6) + bne.s .loop + + tst.w pd_PrecalcDone(a6) + beq.s .loop + + move.b pd_AsyncDbToggle(a6),d0 + cmp.b pd_DbToggle(a6),d0 + bne.s .loop + + rts + +;-------------------------------------------------------------------- + +blb_main: + move.w #5*256+32,pd_PartCountDown(a6) + CALLFW SetBlitterQueueMultiFrame + + move.w #-1,pd_CurrBlitSize(a6) + PUTMSG 10,<"%d: Main!">,fw_FrameCounterLong(a6) + + lea .vblstuff(pc),a0 + move.l a0,fw_VBlankIRQ(a6) + + bsr blb_flip_db_frame + bsr blb_create_bulb_copperlist + bsr blb_patch_in_text_sprites_to_copperlist + bsr blb_update_copper_list_pointers + + CALLFW VSyncWithTask + + PUTMSG 10,<"%d: Main 2">,fw_FrameCounterLong(a6) + bsr blb_flip_db_frame + bsr blb_create_bulb_copperlist + bsr blb_patch_in_text_sprites_to_copperlist + bsr blb_update_copper_list_pointers + +.loop + bsr blb_flip_db_frame + + CALLFW JoinBlitterQueue + + bsr blb_swing_around + move.l pd_BqDataWritePtr(a6),a4 + + move.l -4(a1),-4(a4) + + move.w #KNIGHTS_BUF_WIDTH/8,d4 + bsr blb_blitter_line_init_bq + + bsr blb_draw_rays + + bsr blb_create_terminal_bq_node + bsr blb_add_branch_on_second_bq_node + + move.l pd_DrawDarkBuffer(a6),a3 + move.l pd_FillDarkBuffer(a6),a2 + bsr blb_fill_rays + + move.l pd_DrawBrightBuffer(a6),a3 + move.l pd_FillBrightBuffer(a6),a2 + bsr blb_fill_rays + + bsr blb_do_bresenham_rays_color_fixup + + cmp.w #17000,pd_CurrBlitSize(a6) + blt.s .donthog + PUTMSG 20,<"Hogging frame %d">,pd_CurrBlitSize-2(a6) + CALLFW JoinBlitterQueue +.donthog + + bsr blb_paint_around + bsr blb_paint_slices + + bsr blb_draw_fixup_rays + + bsr blb_paint_text_slices + + move.l pd_BqDataWritePtr(a6),a0 + bsr blb_add_execute_twice_bq_node + + bsr blb_create_nop_bq_node + ADD_TO_BLITTER_QUEUE a0,a2 + + sub.l pd_BqDataWritePtr(a6),a4 + PUTMSG 20,<"Queue size %ld">,a4 + + TERMINATE_BLITTER_QUEUE + +.waitforbqspaceloop + move.l pd_BqDataWritePtr(a6),a0 + move.l pd_CurrLineColorsPtr(a6),a2 + lea KNIGHTS_HEIGHT*4*2(a2),a2 + lea BQ_SIZE(a0),a1 + cmp.l pd_BqDataEndPtr(a6),a1 + bne.s .nowrapbqwrite + move.l pd_BqBuffer(a6),a1 + move.l pd_LineColorsBuffer(a6),a2 +.nowrapbqwrite + cmp.l pd_BqDataReadPtr(a6),a1 + bne.s .nowait + PUTMSG 40,<"%d: Waiting for space Read: %p Write: %p">,fw_FrameCounterLong(a6),pd_BqDataReadPtr(a6),pd_BqDataWritePtr(a6) + CALLFW JoinBlitterQueue + CALLFW VSyncWithTask + bra.s .waitforbqspaceloop +.nowait + move.l a1,pd_BqDataWritePtr(a6) + move.l a2,pd_CurrLineColorsPtr(a6) + PUTMSG 40,<"%d: Done a frame Read: %p Write: %p">,fw_FrameCounterLong(a6),pd_BqDataReadPtr(a6),pd_BqDataWritePtr(a6) + + subq.w #1,pd_PartCountDown(a6) + bne .loop + + rts + +.vblstuff + bsr blb_update_lamp_sprite + tst.b pd_LampFrameNum+1(a6) + bne.s .nonextpanel + move.l pd_TextPanelsPtr(a6),a0 + move.l (a0)+,pd_SourcePanelPtr(a6) + move.l a0,pd_TextPanelsPtr(a6) + move.w pd_SourcePanelNum(a6),d0 + bne.s .notfirst + move.w d0,pd_CurrBlitSize(a6) +.notfirst + addq.w #1,d0 + move.w d0,pd_SourcePanelNum(a6) + subq.w #4,d0 + beq.s .insidelogo + subq.w #2,d0 + bne.s .nonextpanel + move.w blb_lamp_palette+1*2(pc),d0 + bra.s .fixcolor +.insidelogo + move.w #$f88,d0 +.fixcolor + move.l pd_CurrCopListPtr(a6),a0 + add.w pd_CopperLogoColorOffset(a6),a0 + move.w d0,(a0) + move.w d0,COP_INST_PER_LINE*4(a0) + move.l pd_LastCopListPtr(a6),a0 + add.w pd_CopperLogoColorOffset(a6),a0 + move.w d0,(a0) + move.w d0,COP_INST_PER_LINE*4(a0) +.nonextpanel + + tst.w pd_CurrBlitSize(a6) + bne.s .nop + move.l pd_BqDataReadPtr(a6),a0 + cmp.l pd_BqDataWritePtr(a6),a0 + beq.s .nop + move.w fw_FrameCounter(a6),d0 + cmp.w pd_NextQueueTriggerFrame(a6),d0 + blt.s .nop + beq.s .nodrop + tst.w pd_NextQueueTriggerFrame(a6) + beq.s .nodrop + subq.w #1,pd_LampFrameNum(a6) + PUTMSG 10,<"%d: Framedrop %d vs %d!">,fw_FrameCounterLong(a6),pd_NextQueueTriggerFrame-2(a6),d0 +.nodrop + addq.w #2,d0 + move.w d0,pd_NextQueueTriggerFrame(a6) + PUTMSG 20,<"%d: Triggering queue %p">,fw_FrameCounterLong(a6),a0 + move.w -4(a0),pd_CurrBlitSize(a6) + BLTWAIT + CALLFW TriggerCustomBlitterQueue + rts +.nop + PUTMSG 20,<"%d: Ignoring">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- + +blb_brighten: + move.w #48,pd_PartCountDown(a6) + + moveq.l #15,d0 + move.w #64,d1 + lea blb_lamp_white_palette(pc),a0 + lea pd_LampPalette(a6),a1 + CALLFW FadePaletteTo + + PUTMSG 10,<"%d: Brighten!">,fw_FrameCounterLong(a6) + + move.w #SWING_FRAMES*4,pd_SwingFrameNum(a6) + move.w #PAINT_FRAMES*4,pd_PaintFrameNum(a6) +.loop + bsr blb_flip_db_frame + + CALLFW JoinBlitterQueue + + bsr blb_swing_around_brighten + move.l pd_BqDataWritePtr(a6),a4 + + move.l -4(a1),-4(a4) + + move.w #KNIGHTS_BUF_WIDTH/8,d4 + bsr blb_blitter_line_init_bq + + bsr blb_draw_rays + + bsr blb_create_terminal_bq_node + bsr blb_add_branch_on_second_bq_node + + move.l pd_DrawDarkBuffer(a6),a3 + move.l pd_FillDarkBuffer(a6),a2 + bsr blb_fill_rays + + move.l pd_DrawBrightBuffer(a6),a3 + move.l pd_FillBrightBuffer(a6),a2 + bsr blb_fill_rays + + bsr blb_do_bresenham_rays_color_fixup + + cmp.w #17000,pd_CurrBlitSize(a6) + blt.s .donthog + PUTMSG 20,<"Hogging frame %d">,pd_CurrBlitSize-2(a6) + CALLFW JoinBlitterQueue +.donthog + + bsr blb_paint_around_brighten + bsr blb_paint_slices + + bsr blb_draw_fixup_rays + + move.l pd_BqDataWritePtr(a6),a0 + bsr blb_add_execute_twice_bq_node + + bsr blb_create_nop_bq_node + ADD_TO_BLITTER_QUEUE a0,a2 + + sub.l pd_BqDataWritePtr(a6),a4 + PUTMSG 20,<"Queue size %ld">,a4 + + TERMINATE_BLITTER_QUEUE + +.waitforbqspaceloop + move.l pd_BqDataWritePtr(a6),a0 + move.l pd_CurrLineColorsPtr(a6),a2 + lea KNIGHTS_HEIGHT*4*2(a2),a2 + lea BQ_SIZE(a0),a1 + cmp.l pd_BqDataEndPtr(a6),a1 + bne.s .nowrapbqwrite + move.l pd_BqBuffer(a6),a1 + move.l pd_LineColorsBuffer(a6),a2 +.nowrapbqwrite + cmp.l pd_BqDataReadPtr(a6),a1 + bne.s .nowait + PUTMSG 40,<"%d: Waiting for space Read: %p Write: %p">,fw_FrameCounterLong(a6),pd_BqDataReadPtr(a6),pd_BqDataWritePtr(a6) + CALLFW JoinBlitterQueue + CALLFW VSyncWithTask + bra.s .waitforbqspaceloop +.nowait + move.l a1,pd_BqDataWritePtr(a6) + move.l a2,pd_CurrLineColorsPtr(a6) + PUTMSG 40,<"%d: Done a frame Read: %p Write: %p">,fw_FrameCounterLong(a6),pd_BqDataReadPtr(a6),pd_BqDataWritePtr(a6) + + subq.w #1,pd_PartCountDown(a6) + bne .loop + +.waitloop + + CALLFW JoinBlitterQueue + CALLFW VSyncWithTask + move.l pd_BqDataReadPtr(a6),a0 + cmp.l pd_BqDataWritePtr(a6),a0 + bne.s .waitloop + + clr.l fw_VBlankIRQ(a6) + + CALLFW JoinBlitterQueue + CALLFW VSyncWithTask + + rts + +;-------------------------------------------------------------------- + +blb_outro: + move.w #16,pd_PartCountDown(a6) + bsr blb_prep_p5p6_mask + + lea pd_KnightsPalette(a6),a1 + lea blb_bulb_palette_expanded(pc),a0 + moveq.l #(16/2)-1,d7 +.palloop + move.l (a0)+,(a1)+ + dbra d7,.palloop + + lea .vblstuff(pc),a0 + move.l a0,fw_VBlankIRQ(a6) +.loop + bsr blb_flip_db_frame + + bsr blb_fade_step_to_white + + bsr blb_palette_fade_step_to_white + + bsr blb_create_outro_copperlist + bsr blb_update_copper_list_pointers + + CALLFW VSyncWithTask + + subq.w #1,pd_PartCountDown(a6) + bne .loop + + rts + +.vblstuff + PUSHM d4 + bsr blb_update_lamp_sprite + + moveq.l #15,d0 + lea pd_LampPalette(a6),a1 + CALLFW DoFadePaletteStep + BLTHOGON + POPM + rts + +;-------------------------------------------------------------------- + +blb_flip_db_frame: + move.l pd_CurrDbPlanesP1234Ptr(a6),pd_LastDbPlanesP1234Ptr(a6) + move.l pd_CurrDbPlanesP56Ptr(a6),pd_LastDbPlanesP56Ptr(a6) + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + move.l pd_CurrTextSpritesPtr(a6),pd_LastTextSpritesPtr(a6) + + move.l pd_DbBufferP1234(a6),a0 + move.l pd_DbBufferP56(a6),a1 + not.b pd_DbToggle(a6) + beq.s .selb1 + lea (KNIGHTS_WIDTH/8)(a0),a0 + lea (KNIGHTS_WIDTH/8)(a1),a1 + move.l a0,pd_CurrDbPlanesP1234Ptr(a6) + move.l a1,pd_CurrDbPlanesP56Ptr(a6) + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + lea pd_TextSprites+(TITLETEXT_WIDTH/16)*4(a6),a0 + move.l a0,pd_CurrTextSpritesPtr(a6) + rts +.selb1 + move.l a0,pd_CurrDbPlanesP1234Ptr(a6) + move.l a1,pd_CurrDbPlanesP56Ptr(a6) + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + lea pd_TextSprites(a6),a0 + move.l a0,pd_CurrTextSpritesPtr(a6) + rts + +blb_flip_copper_frame: + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + not.b pd_AsyncDbToggle(a6) + beq.s .selb1 + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + rts +.selb1 + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + rts + +blb_flip_async_db_frame: + not.b pd_AsyncDbToggle(a6) + beq.s .selb1 + move.l pd_CopperList2(a6),a0 + move.w pd_CopperList2(a6),blb_extra_copperlist_ptr+2 + move.w a0,blb_extra_copperlist_ptr+6 + rts +.selb1 + move.l pd_CopperList1(a6),a0 + move.w pd_CopperList1(a6),blb_extra_copperlist_ptr+2 + move.w a0,blb_extra_copperlist_ptr+6 + rts + +;-------------------------------------------------------------------- + +blb_update_copper_list_pointers: + lea blb_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +blb_palette_fade_step_to_white: + lea pd_KnightsPalette(a6),a1 + move.l pd_ShadeTableXor(a6),a0 + move.w #$fff,d2 + moveq.l #16-1,d7 +.loop move.w (a1),d0 + move.w d0,d1 + eor.w d2,d1 + add.w d1,d1 + add.w (a0,d1.w),d0 + move.w d0,(a1)+ + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +blb_calc_scene_pointers: + lea blb_swing_data,a1 + move.l pd_SwingScriptFramesPtrs(a6),a0 + move.w #ALL_SWING_FRAMES-1,d7 +.swingloop + move.l a1,(a0)+ + addq.l #4,a1 + lea 2*rd_SIZEOF(a1),a1 + + bsr.s blb_silent_fill_rays + bsr.s blb_silent_fill_rays + dbra d7,.swingloop + + lea blb_paint_data,a1 + move.l pd_PaintScriptFramesPtrs(a6),a0 + move.w #ALL_PAINT_FRAMES-1,d7 +.paintloop + move.l a1,(a0)+ + bsr.s blb_silent_paint_slices + dbra d7,.paintloop + + lea blb_textpaint_data,a1 + move.l pd_TextPaintScriptFramesPtrs(a6),a0 + move.w #PAINT_FRAMES-1,d7 +.textpaintloop + move.l a1,(a0)+ +.loop tst.w (a1)+ + beq.s .finished + addq.w #6,a1 + bra.s .loop +.finished + dbra d7,.textpaintloop + + rts + +;-------------------------------------------------------------------- + +blb_silent_fill_rays: +blb_silent_paint_slices: +.loop + tst.b (a1)+ + beq.s .finished + addq.w #3,a1 + bra.s .loop +.finished + addq.w #1,a1 + rts + +;-------------------------------------------------------------------- + +blb_swing_around: + move.l pd_SwingScriptFramesPtrs(a6),a0 + move.w pd_SwingFrameNum(a6),d0 + move.l (a0,d0.w),a1 + addq.l #4,a1 + move.l a1,pd_SwingDataPtr(a6) + + addq.w #4,d0 + and.w #(SWING_FRAMES-1)*4,d0 + move.w d0,pd_SwingFrameNum(a6) + rts + +;-------------------------------------------------------------------- + +blb_swing_around_brighten: + move.l pd_SwingScriptFramesPtrs(a6),a0 + move.w pd_SwingFrameNum(a6),d0 + move.l (a0,d0.w),a1 + addq.l #4,a1 + move.l a1,pd_SwingDataPtr(a6) + + addq.w #4,d0 + move.w d0,pd_SwingFrameNum(a6) + rts + +;-------------------------------------------------------------------- + +blb_paint_around: + move.l pd_PaintScriptFramesPtrs(a6),a0 + move.l pd_TextPaintScriptFramesPtrs(a6),a1 + move.w pd_PaintFrameNum(a6),d0 + move.l (a1,d0.w),pd_TextPaintDataPtr(a6) + move.l (a0,d0.w),a1 + addq.w #4,d0 + cmp.w #PAINT_FRAMES*4,d0 + bne.s .noreset + moveq.l #2*4,d0 +.noreset + move.w d0,pd_PaintFrameNum(a6) + rts + +;-------------------------------------------------------------------- + +blb_paint_around_brighten: + move.l pd_PaintScriptFramesPtrs(a6),a0 + move.l pd_TextPaintScriptFramesPtrs(a6),a1 + move.w pd_PaintFrameNum(a6),d0 + move.l (a0,d0.w),a1 + addq.w #4,d0 + move.w d0,pd_PaintFrameNum(a6) + rts + +;-------------------------------------------------------------------- + +blb_update_lamp_sprite: + move.w pd_LampFrameNum(a6),d2 + lea blb_lamp_pos_table,a0 + adda.w d2,a0 + adda.w d2,a0 + moveq.l #0,d0 + moveq.l #0,d1 + move.b (a0)+,d0 + move.b (a0)+,d1 + + lea blb_lamp_angle_table,a0 + moveq.l #0,d3 + move.b (a0,d2.w),d3 + add.b #NUM_LAMP_ROTATIONS/2,d3 + addq.w #1,d2 + and.w #SWING_FRAMES*2-1,d2 + move.w d2,pd_LampFrameNum(a6) + + mulu #(LAMP_WIDTH/8)*(LAMP_HEIGHT+2)*LAMP_PLANES,d3 + move.l pd_LampSpriteBuffer(a6),a0 + adda.l d3,a0 + add.w #128-(LAMP_WIDTH/2),d0 + add.w #$52-(LAMP_HEIGHT/2),d1 + add.w pd_LampYOffset(a6),d1 + move.w d1,d2 + add.w #LAMP_HEIGHT,d2 + moveq.l #0,d3 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d3,d3 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d3,d3 ; ev8 + lsr.w #1,d0 ; sh8-sh1 in d0 + addx.w d3,d3 ; sh0 + or.w d2,d3 ; ev7-ev0, sv8, ev8, sh0 in d3 + or.w d1,d0 ; sv7-sv0, sh8-sh1 in d0 + tas d3 ; att TAS sets bit 7 + + lea blb_coppersprites+2,a1 + REPT 3 + move.l a0,d1 + swap d1 + move.w d1,(a1) + move.w a0,4(a1) + move.w d0,(a0)+ + move.w d3,(a0)+ + + lea (LAMP_HEIGHT+1)*LAMP_PLANES(a0),a0 + move.l a0,d1 + addq.w #8,a1 + swap d1 + move.w d1,(a1) + move.w a0,4(a1) + move.w d0,(a0)+ + move.w d3,(a0)+ + lea (LAMP_HEIGHT+1)*LAMP_PLANES(a0),a0 + addq.w #8,d0 + addq.w #8,a1 + ENDR + rts + +;-------------------------------------------------------------------- + +blb_add_execute_twice_bq_node: + ADD_TO_BLITTER_QUEUE a4,a2 + clr.l (a4)+ + move.l #.bq_rout,(a4)+ + clr.w (a4)+ ; initial state + move.l a0,(a4)+ + rts +.bq_rout + not.w (a0)+ + beq.s .secondtime + move.l (a0)+,fw_BlitterQueueReadPtr(a6) + moveq.l #0,d0 +.secondtime + rts + +blb_add_branch_on_second_bq_node: + ADD_TO_BLITTER_QUEUE a4,a2 + clr.l (a4)+ + move.l #.bq_rout,(a4)+ + move.w #-1,(a4)+ ; initial state + move.l a0,(a4)+ + rts +.bq_rout + not.w (a0)+ + beq.s .secondtime + move.l (a0)+,fw_BlitterQueueReadPtr(a6) + moveq.l #0,d0 +.secondtime + rts + +blb_create_nop_bq_node: + move.l a4,a0 + clr.l (a4)+ + move.l #.bq_nop,(a4)+ + rts +.bq_nop + moveq.l #0,d0 + rts + +blb_create_terminal_bq_node: + move.l a4,a0 + clr.l (a4)+ + move.l #.bq_nop,(a4)+ + rts +.bq_nop + PUTMSG 40,<"BQ terminated"> + PUSHM d1-d4 + move.l pd_BqDataReadPtr(a6),a0 + move.w -2(a0),d0 + beq.s .lampoff + + cmp.w #2,d0 + bne.s .noup + subq.w #1,pd_LampYOffset(a6) +.noup + tst.w pd_LampIsOn(a6) + bne.s .nochange + + move.w d0,pd_LampIsOn(a6) + moveq.l #15,d0 + lea blb_lamp_palette(pc),a0 + lea pd_LampPalette(a6),a1 + CALLFW InitPaletteLerp + bra.s .reloada0 + +.lampoff + tst.w pd_LampIsOn(a6) + beq.s .nochange + move.w d0,pd_LampIsOn(a6) + moveq.l #15,d0 + moveq.l #4,d1 + lea blb_lamp_off_palette(pc),a0 + lea pd_LampPalette(a6),a1 + CALLFW FadePaletteTo +.reloada0 + move.l pd_BqDataReadPtr(a6),a0 +.nochange + lea BQ_SIZE(a0),a1 + + cmp.l pd_BqDataEndPtr(a6),a1 + bne.s .nowrapbq + move.l pd_BqBuffer(a6),a1 +.nowrapbq + move.l a1,pd_BqDataReadPtr(a6) + + moveq.l #15,d0 + lea pd_LampPalette(a6),a1 + CALLFW DoFadePaletteStep + + bsr blb_flip_async_db_frame + + lea pd_LampPalette(a6),a1 + moveq.l #15-1,d0 + addq.w #2,a0 +.cploop move.w cl_Color(a1),(a0) + addq.w #4,a0 + lea cl_SIZEOF(a1),a1 + dbra d0,.cploop + + clr.w pd_CurrBlitSize(a6) + + POPM + rts + +;-------------------------------------------------------------------- + +blb_clear_mask_buffers: + BLTHOGON + BLTWAIT + + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_MiddleMaskBuffer(a6),bltdpt(a5) + move.w #(KNIGHTS_SLICE_WIDTH>>4)|((KNIGHTS_HEIGHT*3)<<6),bltsize(a5) + + BLTWAIT + move.l pd_TextSpriteBuffer(a6),bltdpt(a5) + move.w #((TITLETEXT_WIDTH)>>4)|(((TITLETEXT_HEIGHT+1)*TITLETEXT_PLANES*2)<<6),bltsize(a5) + + ;NUM_LAMP_ROTATIONS*(LAMP_WIDTH/8)*(LAMP_HEIGHT+2)*LAMP_PLANES + BLTWAIT + move.l pd_LampSpriteBuffer(a6),bltdpt(a5) + move.w #((NUM_LAMP_ROTATIONS*LAMP_WIDTH/2)>>4)|(((LAMP_HEIGHT+2)*LAMP_PLANES*2)<<6),bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +blb_rearrange_buffers: + moveq.l #-1,d2 + + ; make a backup of picture to rearrange planes + moveq.l #0,d0 + move.w #((KNIGHTS_WIDTH*2)>>4)|((KNIGHTS_HEIGHT*3)<<6),d3 + + BLTHOGON + BLTWAIT + + BLTCON_SET AD,BLT_A,0,0 + move.l d2,bltafwm(a5) ; also fills bltalwm + move.w d0,bltamod(a5) + move.w d0,bltdmod(a5) + + move.l #blb_bulb_pic,bltapt(a5) + move.l pd_DbBufferP1234(a6),bltdpt(a5) + move.w d3,bltsize(a5) + + move.l pd_DbBufferP1234(a6),a0 + move.l pd_OriginalBufferP1234(a6),a1 + move.w #(KNIGHTS_WIDTH*6-KNIGHTS_WIDTH)/8,d0 + move.w #(KNIGHTS_WIDTH*4-KNIGHTS_WIDTH)/8,d1 + move.w #((KNIGHTS_WIDTH)>>4)|((KNIGHTS_HEIGHT)<<6),d3 + + BLTWAIT + + ; plane 1 + BLTCON_SET AD,BLT_A,0,0 + move.w d0,bltamod(a5) + move.w d1,bltdmod(a5) + + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT 3 + lea KNIGHTS_WIDTH/8(a0),a0 + lea KNIGHTS_WIDTH/8(a1),a1 + + BLTWAIT + + ; plane 2/3/4 + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + + move.w #(KNIGHTS_WIDTH*6-KNIGHTS_WIDTH)/8,d0 + move.w #(KNIGHTS_WIDTH*2-KNIGHTS_WIDTH)/8,d1 + move.l pd_OriginalBufferP56(a6),a1 + lea KNIGHTS_WIDTH/8(a0),a0 + + BLTWAIT + + ; plane 5 + move.w d0,bltamod(a5) + move.w d1,bltdmod(a5) + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + lea KNIGHTS_WIDTH/8(a0),a0 + lea KNIGHTS_WIDTH/8(a1),a1 + + BLTWAIT + + ; plane 6 + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + ; clear all buffers + moveq.l #0,d0 + move.w #((KNIGHTS_WIDTH*2)>>4)|((KNIGHTS_HEIGHT*4)<<6),d3 + + BLTWAIT + BLTCON_SET D,BLT_C,0,0 + move.w d0,bltcdat(a5) + move.w d0,bltdmod(a5) + + move.l pd_DbBufferP1234(a6),bltdpt(a5) + move.w d3,bltsize(a5) + + move.l pd_OriginalBufferP56(a6),a0 + move.l pd_DbBufferP56(a6),a1 + + BLTWAIT + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + move.w #(KNIGHTS_WIDTH*2-KNIGHTS_WIDTH)/8,d0 + move.w #(KNIGHTS_BUF_WIDTH-KNIGHTS_WIDTH)/8,d1 + move.w #((KNIGHTS_WIDTH)>>4)|((KNIGHTS_HEIGHT)<<6),d3 + + BLTWAIT + + ; Original to DB 5 (1) + BLTCON_SET AD,BLT_A,0,0 + move.w d0,bltamod(a5) + move.w d1,bltdmod(a5) + + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + lea KNIGHTS_WIDTH/8(a1),a1 + + BLTWAIT + + ; Original to DB 5 (2) + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + lea KNIGHTS_WIDTH/8(a0),a0 + lea KNIGHTS_WIDTH/8(a1),a1 + + BLTWAIT + + ; Original to DB 6 (1) + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + lea KNIGHTS_WIDTH/8(a1),a1 + + BLTWAIT + BLTHOGOFF + + ; Original to DB 6 (2) + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +blb_prep_p5p6_mask: + move.l pd_LastDbPlanesP56Ptr(a6),a0 + lea KNIGHTS_MOD(a0),a1 + move.l pd_DbBufferP56(a6),a2 + lea 2*KNIGHTS_MOD(a2),a2 + moveq.l #-1,d0 + move.l #(((KNIGHTS_BUF_WIDTH-KNIGHTS_WIDTH)/8)<<16)|((KNIGHTS_BUF_WIDTH-KNIGHTS_WIDTH)/8),d1 + move.w #(KNIGHTS_WIDTH>>4)|(KNIGHTS_HEIGHT<<6),d3 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET ACD,BLT_A|BLT_C,0,0 + move.l d0,bltafwm(a5) + move.w d1,bltcmod(a5) + move.l d1,bltamod(a5) + move.l a0,bltapt(a5) + move.l a1,bltcpt(a5) + move.l a2,bltdpt(a5) + move.w d3,bltsize(a5) + rts + +;-------------------------------------------------------------------- + +blb_fade_step_to_white: + move.l pd_LastDbPlanesP1234Ptr(a6),a0 ; source p1 + move.l pd_CurrDbPlanesP1234Ptr(a6),a4 + move.l pd_DbBufferP56(a6),a1 + lea 2*KNIGHTS_MOD(a1),a1 ; p5|p6 mask + move.l a1,d5 + lea 3*KNIGHTS_MOD(a4),a1 + move.l a1,d4 ; target p4 as temp mask + lea KNIGHTS_MOD(a0),a1 ; source p2 + lea KNIGHTS_MOD(a1),a2 ; source p3 + lea KNIGHTS_MOD(a2),a3 ; source p4 + + moveq.l #-1,d0 + move.l #(((KNIGHTS_BUF_WIDTH-KNIGHTS_WIDTH)/8)<<16)|((KNIGHTS_BUF_WIDTH-KNIGHTS_WIDTH)/8),d1 + move.w #(KNIGHTS_WIDTH>>4)|(KNIGHTS_HEIGHT<<6),d3 + + ; create mask -- all bits, that are NOT all 1s + BLTHOGON + BLTWAIT + BLTCON_SET ABCD,~(BLT_A&BLT_B&BLT_C),0,0 + move.l d0,bltafwm(a5) + move.l d1,bltcmod(a5) + move.l d1,bltamod(a5) + move.l a0,bltapt(a5) + move.l a1,bltbpt(a5) + move.l a2,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + BLTWAIT + BLTCON0_SET ABCD,(~(~BLT_A&BLT_C))&BLT_B,0 + move.l d4,bltapt(a5) + move.l d5,bltbpt(a5) + move.l a3,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; plane 1: p1n = p1o ^ mask + BLTWAIT + BLTCON0_SET ACD,BLT_A^BLT_C,0 + move.l d4,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; update mask: mask = p1o & mask + BLTWAIT + BLTCON0_SET ACD,BLT_A&BLT_C,0 + move.l d4,bltapt(a5) + move.l a0,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; plane 2: p2n = p2o ^ mask + lea KNIGHTS_MOD(a4),a4 + BLTWAIT + BLTCON0_SET ACD,BLT_A^BLT_C,0 + move.l d4,bltapt(a5) + move.l a1,bltcpt(a5) + move.l a4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; update mask: mask = p2o & mask + BLTWAIT + BLTCON0_SET ACD,BLT_A&BLT_C,0 + move.l d4,bltapt(a5) + move.l a1,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; plane 3: p3n = p3o ^ mask + lea KNIGHTS_MOD(a4),a4 + BLTWAIT + BLTCON0_SET ACD,BLT_A^BLT_C,0 + move.l d4,bltapt(a5) + move.l a2,bltcpt(a5) + move.l a4,bltdpt(a5) + move.w d3,bltsize(a5) + + ; plane 4: p4n = p4o ^ (p3o & mask) + BLTWAIT + BLTHOGOFF + BLTCON0_SET ABCD,BLT_C^(BLT_A&BLT_B),0 + move.l d4,bltapt(a5) + move.l a2,bltbpt(a5) + move.l a3,bltcpt(a5) + move.l d4,bltdpt(a5) + move.w d3,bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +blb_intro_fill_low_brightness: + move.l pd_OriginalBufferP1234(a6),a0 + lea 3*(KNIGHTS_WIDTH/8)(a0),a0 + move.l pd_CurrDbPlanesP1234Ptr(a6),a1 + + move.w #(KNIGHTS_WIDTH*4-KNIGHTS_WIDTH)/8,d0 + move.w #(KNIGHTS_BUF_WIDTH-KNIGHTS_WIDTH)/8,d1 + move.w #((KNIGHTS_WIDTH)>>4)|((KNIGHTS_HEIGHT)<<6),d3 + + BLTHOGON + BLTWAIT + BLTHOGOFF + ; Plane 4 to DB 1 (1) + BLTCON_SET AD,BLT_A,0,0 + move.w d0,bltamod(a5) + move.w d1,bltdmod(a5) + + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + rts + +;-------------------------------------------------------------------- + +blb_create_intro_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + + moveq.l #-2,d3 + COPIMOVE $6a00,bplcon0 + + move.w pd_PullDownYPos(a6),d0 + addq.w #8,d0 + cmp.w #KNIGHTS_HEIGHT,d0 + ble.s .notrunc + move.w #KNIGHTS_HEIGHT,d0 +.notrunc + move.w d0,pd_PullDownYPos(a6) + move.w #KNIGHTS_HEIGHT,d4 + sub.w d0,d4 + moveq.l #$52,d5 + add.w d0,d5 + mulu #KNIGHTS_BUF_MOD,d4 + + move.l pd_CurrDbPlanesP1234Ptr(a6),d0 + add.l d4,d0 + moveq.l #4-1,d7 + move.w #bplpt,d1 + moveq.l #KNIGHTS_MOD,d2 +.bplloop1234 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop1234 + + move.l pd_CurrDbPlanesP56Ptr(a6),d0 + add.l d4,d0 + moveq.l #2-1,d7 +.bplloop56 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop56 + + lsl.w #8,d5 + bcc.s .no255 + move.w #$ffdf,(a0)+ + move.w d3,(a0)+ +.no255 + move.b #$07,d5 + + move.w d5,(a0)+ + move.w d3,(a0)+ + COPIMOVE $0200,bplcon0 + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +blb_create_outro_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + + lea pd_KnightsPalette(a6),a1 + moveq.l #16-1,d7 + move.w #color,d0 +.palloop + move.w d0,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d0 + dbra d7,.palloop + + addq.w #2,d0 + lea pd_LampPalette(a6),a1 + moveq.l #15-1,d7 +.cploop + move.w d0,(a0)+ + move.w cl_Color(a1),(a0)+ + addq.w #2,d0 + lea cl_SIZEOF(a1),a1 + dbra d7,.cploop + + moveq.l #-2,d3 + COPIMOVE $6a00,bplcon0 + + move.l pd_CurrDbPlanesP1234Ptr(a6),d0 + moveq.l #4-1,d7 + move.w #bplpt,d1 + moveq.l #KNIGHTS_MOD,d2 +.bplloop1234 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop1234 + + move.l pd_CurrDbPlanesP56Ptr(a6),d0 + moveq.l #2-1,d7 +.bplloop56 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop56 + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +blb_patch_in_text_sprites_to_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + adda.w pd_CopperLinesFixupOffset(a6),a0 + lea 36*COP_INST_PER_LINE*4+4*4-2(a0),a0 + moveq.l #COP_INST_PER_LINE*4-4,d0 + move.l pd_CurrTextSpritesPtr(a6),a1 + move.w #sprpt+0*4+0,d4 + + moveq.l #(TITLETEXT_WIDTH/16)-1,d7 +.ptloop + move.w d4,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d4 + adda.l d0,a0 + move.w d4,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d4 + adda.l d0,a0 + dbra d7,.ptloop + + REPT 8 + move.l #((spr+REPTN*sd_SIZEOF+sd_pos)<<16)|(($52+TITLETEXT_Y_POS)<<8)|((TITLETEXT_X_POS+128+REPTN*16)/2),(a0)+ + adda.l d0,a0 + move.l #((spr+REPTN*sd_SIZEOF+sd_ctl)<<16)|(($52+TITLETEXT_Y_POS+TITLETEXT_HEIGHT)<<8)|(1<<7),(a0)+ + adda.l d0,a0 + ENDR + + move.l a0,d1 + sub.l a2,d1 + addq.w #2,d1 + move.w d1,pd_CopperLogoColorOffset(a6) + + lea blb_lamp_palette(pc),a1 + COPRMOVE 1*2(a1),color+18*2 + adda.l d0,a0 + COPRMOVE 7*2(a1),color+24*2 + adda.l d0,a0 + COPIMOVE $0d00,color+19*2 + adda.l d0,a0 + COPIMOVE $0d00,color+28*2 + + move.l pd_CurrCopListPtr(a6),a0 + adda.w pd_CopperLinesFixupOffset(a6),a0 + lea 175*COP_INST_PER_LINE*4+4*4-2(a0),a0 + COPRMOVE 1*2(a1),color+18*2 + adda.l d0,a0 + COPRMOVE 7*2(a1),color+24*2 + adda.l d0,a0 + COPRMOVE 2*2(a1),color+19*2 + adda.l d0,a0 + COPRMOVE 11*2(a1),color+28*2 + rts + +;-------------------------------------------------------------------- + +blb_create_bulb_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + + lea pd_LampPalette(a6),a1 + move.w #color+17*2,d0 + moveq.l #15-1,d7 +.blloop + move.w d0,(a0)+ + move.w cl_Color(a1),(a0)+ + lea cl_SIZEOF(a1),a1 + addq.w #2,d0 + dbra d7,.blloop + + COPIMOVE $6a00,bplcon0 + move.l pd_CurrDbPlanesP1234Ptr(a6),d0 + moveq.l #4-1,d7 + move.w #bplpt,d1 + moveq.l #KNIGHTS_MOD,d2 +.bplloop1234 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop1234 + + move.l pd_CurrDbPlanesP56Ptr(a6),d0 + moveq.l #2-1,d7 +.bplloop56 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop56 + + move.l pd_TrueColorImage(a6),a1 + moveq.l #-2,d3 + move.w #$51d5,d0 + move.w #KNIGHTS_HEIGHT-1,d7 + move.w #$100,d2 + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset(a6) +.cprloop + move.w d0,(a0)+ + move.w d3,(a0)+ + move.w #(color+8*2),(a0)+ + addq.w #2,a0 + move.w #(color+10*2),(a0)+ + addq.w #2,a0 + move.w #(color+12*2),(a0)+ + addq.w #2,a0 + move.w #(color+14*2),(a0)+ + addq.w #2,a0 + move.l #$01fe0000,(a0)+ + + add.w d2,d0 + + dbra d7,.cprloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +blb_calc_true_color_image: + move.l pd_OriginalBufferP1234(a6),a0 + move.l pd_OriginalBufferP56(a6),a3 + move.l pd_TrueColorImage(a6),a1 + PUTMSG 10,<"TC Image %p">,a1 + lea blb_bulb_palette_expanded(pc),a2 + move.w #KNIGHTS_HEIGHT,-(sp) +.lineloop + moveq.l #(KNIGHTS_WIDTH/16)-1,d7 + move.w (a2),d6 ; background color + swap d6 +.wordloop + move.w 3*(KNIGHTS_WIDTH/8)(a0),d3 + move.w 2*(KNIGHTS_WIDTH/8)(a0),d2 + move.w 1*(KNIGHTS_WIDTH/8)(a0),d1 + move.w (a0)+,d0 + move.w 1*(KNIGHTS_WIDTH/8)(a3),d5 + move.w (a3)+,d4 + swap d7 + move.w #15,d7 +.pixelloop + clr.w d6 + add.w d3,d3 + addx.w d6,d6 + add.w d2,d2 + addx.w d6,d6 + add.w d1,d1 + addx.w d6,d6 + add.w d0,d0 + addx.w d6,d6 + + add.w d5,d5 + bcs.s .greenOrRed + add.w d4,d4 + bcs.s .blue + + PUTMSG 50,<"Idx %d">,d6 + + add.w d6,d6 + move.w (a2,d6.w),d6 + move.w d6,(a1)+ + bra.s .contloop + +.greenOrRed + add.w d4,d4 + bcs.s .green +.red + PUTMSG 50,<"Red %d">,d6 + move.b d6,(a1) + swap d6 + move.b d6,1(a1) + move.w (a1)+,d6 + bra.s .contloop + +.green + PUTMSG 50,<"Green %d">,d6 + move.w d7,a4 + move.w d6,d7 + lsl.w #4,d7 + swap d6 + and.w #$f0f,d6 + or.w d7,d6 + move.w d6,(a1)+ + move.w a4,d7 + bra.s .contloop + +.blue + PUTMSG 50,<"Blue %d">,d6 + move.w d7,a4 + move.w d6,d7 + swap d6 + and.w #$ff0,d6 + or.w d7,d6 + move.w d6,(a1)+ + move.w a4,d7 +.contloop + swap d6 + dbra d7,.pixelloop + swap d7 + dbra d7,.wordloop +.nextline + lea 3*(KNIGHTS_WIDTH/8)(a0),a0 + lea 1*(KNIGHTS_WIDTH/8)(a3),a3 + subq.w #1,(sp) + bne .lineloop + addq.w #2,sp + rts + +;-------------------------------------------------------------------- + +blb_draw_rays: + move.w #KNIGHTS_BUF_WIDTH/8,d4 + move.w #BLT_A&BLT_B^BLT_C,d5 + move.w rd_EndY1(a1),d3 + cmp.w #30,d3 + blt.s .skipray1 + move.l pd_DrawDarkBuffer(a6),a0 + move.w rd_StartY12(a1),d1 + move.w rd_StartX1(a1),d0 + move.w rd_EndX1(a1),d2 + PUSHM d1/d4/d5/a0/a1 + bsr blb_draw_blitter_line_bq + POPM + move.w rd_StartX2(a1),d0 + move.w rd_EndX2(a1),d2 + move.w rd_EndY2(a1),d3 + PUSHM d1/d4/d5/a0/a1 + bsr blb_draw_blitter_line_bq + POPM + +.skipray1 + lea rd_SIZEOF(a1),a1 + move.w rd_EndY1(a1),d3 + cmp.w #30,d3 + blt.s .skipray2 + move.l pd_DrawBrightBuffer(a6),a0 + move.w rd_StartY12(a1),d1 + + move.w rd_StartX1(a1),d0 + move.w rd_EndX1(a1),d2 + PUSHM d1/d4/d5/a0/a1 + bsr blb_draw_blitter_line_bq + POPM + move.w rd_StartX2(a1),d0 + move.w rd_EndX2(a1),d2 + move.w rd_EndY2(a1),d3 + PUSHM d1/d4/d5/a0/a1 + bsr blb_draw_blitter_line_bq + POPM +.skipray2 + lea rd_SIZEOF(a1),a1 + rts + +;-------------------------------------------------------------------- + +blb_draw_fixup_rays: + move.w #KNIGHTS_BUF_WIDTH/8,d4 + bsr blb_blitter_line_init_bq + + move.l pd_SwingDataPtr(a6),a1 + move.w #(BLT_A&BLT_B)|BLT_C,d5 + move.l pd_CurrDbPlanesP1234Ptr(a6),a0 + lea KNIGHTS_MOD*2(a0),a0 + + cmp.w #30,rd_EndY1(a1) + blt.s .skipray1 + move.w rd_StartY12(a1),d1 + move.w rd_StartX2(a1),d0 + move.w rd_EndX2(a1),d2 + move.w rd_EndY2(a1),d3 + + PUSHM d4/d5/a0/a1 + bsr blb_draw_blitter_line_bq + POPM + +.skipray1 + lea rd_SIZEOF(a1),a1 + + cmp.w #30,rd_EndY1(a1) + blt.s .skipray2 + move.w rd_StartY12(a1),d1 + move.w rd_StartX2(a1),d0 + move.w rd_EndX2(a1),d2 + move.w rd_EndY2(a1),d3 + bsr blb_draw_blitter_line_bq +.skipray2 + + rts + +;-------------------------------------------------------------------- + +blb_do_bresenham_rays_color_fixup: + move.l pd_SwingDataPtr(a6),a2 + + move.w rd_StartY12(a2),d1 + move.w rd_StartX1(a2),d0 + move.w rd_EndX1(a2),d2 + move.w rd_EndY1(a2),d3 + move.l pd_CurrLineColorsPtr(a6),a1 + bsr blb_bresenham_line_draw + + move.w rd_StartY12(a2),d1 + move.w rd_StartX2(a2),d0 + move.w rd_EndX2(a2),d2 + move.w rd_EndY2(a2),d3 + move.l pd_CurrLineColorsPtr(a6),a1 + lea 3*KNIGHTS_HEIGHT*2(a1),a1 + bsr blb_bresenham_line_draw + + lea rd_SIZEOF(a2),a2 + + move.w rd_StartY12(a2),d1 + move.w rd_StartX1(a2),d0 + move.w rd_EndX1(a2),d2 + move.w rd_EndY1(a2),d3 + move.l pd_CurrLineColorsPtr(a6),a1 + lea 1*KNIGHTS_HEIGHT*2(a1),a1 + bsr blb_bresenham_line_draw + + move.w rd_StartY12(a2),d1 + move.w rd_StartX2(a2),d0 + move.w rd_EndX2(a2),d2 + move.w rd_EndY2(a2),d3 + move.l pd_CurrLineColorsPtr(a6),a1 + lea 2*KNIGHTS_HEIGHT*2(a1),a1 + bsr blb_bresenham_line_draw + + PREP_ADD_TO_BLITTER_QUEUE a0 + + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_linecopy1,(a4)+ + move.l pd_CurrLineColorsPtr(a6),(a4)+ + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset(a6),a1 + move.l a1,(a4)+ + + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_linecopy2,(a4)+ + move.l pd_CurrLineColorsPtr(a6),a1 + lea 2*KNIGHTS_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset(a6),a1 + lea 12(a1),a1 + move.l a1,(a4)+ + + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_linecopy3,(a4)+ + move.l pd_CurrLineColorsPtr(a6),a1 + lea 3*KNIGHTS_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset(a6),a1 + addq.l #8,a1 + move.l a1,(a4)+ + + LAST_ADD_TO_BLITTER_QUEUE a4,a0 + clr.l (a4)+ + move.l #.bq_linecopy4,(a4)+ + move.l pd_CurrLineColorsPtr(a6),a1 + lea 1*KNIGHTS_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset(a6),a1 + addq.l #4,a1 + move.l a1,(a4)+ + + rts + +.bq_linecopy1 + BLTCON_SET AD,BLT_A&BLT_C,1,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #COP_INST_PER_LINE*4-2,d0 + move.l d0,bltamod(a5) + move.w #$777,bltcdat(a5) + move.l (a0)+,bltapt(a5) + move.l (a0)+,bltdpt(a5) + move.w #(KNIGHTS_HEIGHT<<6)|1,bltsize(a5) + rts + +.bq_linecopy2 + move.l (a0)+,bltapt(a5) + move.l (a0)+,bltdpt(a5) + move.w #(KNIGHTS_HEIGHT<<6)|1,bltsize(a5) + rts + +.bq_linecopy3 + BLTCON_SET AD,BLT_A&BLT_C,2,0 + move.w #$333,bltcdat(a5) + move.l (a0)+,bltapt(a5) + move.l (a0)+,bltdpt(a5) + move.w #(KNIGHTS_HEIGHT<<6)|1,bltsize(a5) + rts + +.bq_linecopy4 + BLTCON_SET AD,BLT_A,0,0 + move.l (a0)+,bltapt(a5) + move.l (a0)+,bltdpt(a5) + move.w #(KNIGHTS_HEIGHT<<6)|1,bltsize(a5) + rts + +;-------------------------------------------------------------------- + +blb_fill_rays: + tst.b (a1) + bne.s .cont + addq.l #2,a1 + rts +.cont + PREP_ADD_TO_BLITTER_QUEUE a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_fillinit,(a4)+ + + moveq.l #0,d0 + moveq.l #10,d5 + move.l #.bq_fill,d6 +.loop + moveq.l #0,d1 + move.b (a1)+,d1 + beq.s .finished + moveq.l #0,d3 + move.b (a1)+,d3 + move.w (a1)+,d0 ; offset + ;PUTMSG 10,<"Height %d, Offset %ld">,d3,d0 + move.l a3,d2 + move.l a2,d4 + add.l d0,d2 + add.l d0,d4 + lsl.w #6,d3 + addq.w #KNIGHTS_SLICE_WIDTH/16,d3 ; bltsize + + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d6,(a4)+ + move.w d1,(a4)+ ; bltcon1 + move.l d2,(a4)+ ; bltapt + move.l d4,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + bra.s .loop +.finished + TERM_ADD_TO_BLITTER_QUEUE a0 + addq.l #1,a1 + rts + +.bq_fillinit + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.w #(KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8,d0 + move.w d0,bltamod(a5) + move.w d0,bltdmod(a5) + BLTHOGOFF + moveq.l #0,d0 + rts +.bq_fill + move.w (a0)+,bltcon1(a5) + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +blb_paint_slices: + tst.b (a1) + bne.s .cont + addq.l #2,a1 + rts +.cont + ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_paintinit,(a4)+ + +.loop + moveq.l #0,d0 ; x pos + move.b (a1)+,d0 + beq.s .finished + + moveq.l #7,d1 + and.b d0,d1 ; control + and.w #$f8,d0 ; xpos * 4 + IF KNIGHTS_SLICE_WIDTH == 32 + lsr.w #1,d0 + ELSE + lsr.w #2,d0 + ENDC + + moveq.l #0,d3 + move.b (a1)+,d3 + moveq.l #0,d2 + move.w (a1)+,d2 + PUTMSG 40,<"%d: x=%d, yo=%lx, h=%d">,d1,d0,d2,d3 + lsl.w #6,d3 + addq.w #KNIGHTS_SLICE_WIDTH/16,d3 + + move.l pd_CurrDbPlanesP1234Ptr(a6),a2 + adda.l d2,a2 + adda.w d0,a2 + move.l pd_CurrDbPlanesP56Ptr(a6),a3 + adda.l d2,a3 + adda.w d0,a3 + + add.w d1,d1 + move.w .table(pc,d1.w),d1 + jmp .table(pc,d1.w) +.finished + addq.l #1,a1 + rts + +.table dc.w .nop-.table + dc.w .filldarkest-.table ; 1 + dc.w .filldark-.table ; 2 + dc.w .fillbright-.table ; 3 + + dc.w .nop-.table + dc.w .darkestlinedark-.table ; 5 + dc.w .darklinebright-.table ; 6 + dc.w .bothmixedlines-.table ; 7 + +.nop bra.s .loop + ; fill darkest +.filldarkest + move.l pd_OriginalBufferP1234(a6),a0 + lsr.w #1,d2 + lea 2*(KNIGHTS_WIDTH/8)(a0,d2.w),a0 + adda.w d0,a0 + move.l pd_OriginalBufferP56(a6),d4 + lsr.w #1,d2 + add.l d2,d4 + add.l d0,d4 + + moveq.l #KNIGHTS_WIDTH/8,d7 + move.l a0,d2 + PREP_ADD_TO_BLITTER_QUEUE a0 + + ; plane 1 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy1,(a4)+ + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + lea KNIGHTS_MOD(a2),a2 + + ; plane 2 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy1f,(a4)+ + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 5 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56,(a4)+ + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a3),a3 + add.l d7,d4 + + ; plane 6 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56f,(a4)+ + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; plane 3 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_clr1,(a4)+ + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 4 + LAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_clr1f,(a4)+ + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + bra .loop + +.darkestlinedark + move.l pd_DrawDarkBuffer(a6),d5 + add.l d2,d5 + add.l d0,d5 + move.l pd_FillDarkBuffer(a6),d6 + add.l d2,d6 + add.l d0,d6 + move.l pd_OriginalBufferP1234(a6),a0 + lsr.w #1,d2 + lea 1*(KNIGHTS_WIDTH/8)(a0,d2.w),a0 + adda.w d0,a0 + move.l pd_OriginalBufferP56(a6),d4 + lsr.w #1,d2 + add.l d2,d4 + add.l d0,d4 + + moveq.l #KNIGHTS_WIDTH/8,d7 + move.l a0,d2 + PREP_ADD_TO_BLITTER_QUEUE a0 + + ; plane 1 dark + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy2,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)&~BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is, but not where line (B) is + move.l d6,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + move.l #.bq_generic_abcd,d1 + + ; plane 2 darkest + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&~BLT_C)|BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is NOT and merge with existing (B) + move.l d6,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 2 dark + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)&~BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is, but not where line (B) is + move.l d6,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + + ; plane 3 darkest + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&~BLT_C)|BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is NOT and merge with existing (B) + move.l d6,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 3 dark + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)&~BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is, but not where line (B) is + move.l d6,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 4 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy3,(a4)+ + move.l d5,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; plane 5 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56b,(a4)+ + move.l d5,(a4)+ ; bltcpt + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a3),a3 + add.l d7,d4 + + ; plane 6 + ; copy (A) where line (B) is NOT + LAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56bf,(a4)+ + move.l d5,(a4)+ ; bltcpt + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + bra .loop + +.filldark + move.l pd_OriginalBufferP1234(a6),a0 + lsr.w #1,d2 + lea (KNIGHTS_WIDTH/8)(a0,d2.w),a0 + adda.w d0,a0 + move.l pd_OriginalBufferP56(a6),d4 + lsr.w #1,d2 + add.l d2,d4 + add.l d0,d4 + + moveq.l #KNIGHTS_WIDTH/8,d7 + + move.l a0,d2 + PREP_ADD_TO_BLITTER_QUEUE a0 + ; plane 1 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy1,(a4)+ + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + lea KNIGHTS_MOD(a2),a2 + + ; plane 2 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy1f,(a4)+ + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + lea KNIGHTS_MOD(a2),a2 + + ; plane 3 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy1f,(a4)+ + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 5 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56,(a4)+ + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a3),a3 + add.l d7,d4 + + ; plane 6 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56f,(a4)+ + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; plane 4 + LAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_clr1,(a4)+ + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + bra .loop + +.darklinebright + move.l pd_DrawBrightBuffer(a6),d5 + add.l d2,d5 + add.l d0,d5 + move.l pd_FillBrightBuffer(a6),d6 + add.l d2,d6 + add.l d0,d6 + move.l pd_OriginalBufferP1234(a6),a0 + lsr.w #1,d2 + adda.w d2,a0 + adda.w d0,a0 + move.l pd_OriginalBufferP56(a6),d4 + lsr.w #1,d2 + add.l d2,d4 + add.l d0,d4 + + moveq.l #KNIGHTS_WIDTH/8,d7 + move.l a0,d2 + PREP_ADD_TO_BLITTER_QUEUE a0 + + ; plane 1 bright + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy2,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)&~BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is, but not where line (B) is + move.l d6,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + move.l #.bq_generic_abcd,d1 + + ; plane 1 dark + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&~BLT_C)|BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is NOT and merge with existing (B) + move.l d6,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 2 bright + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)|BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is OR where line (B) is + move.l d6,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + + ; plane 2 dark + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&~BLT_C)|BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is NOT and merge with existing (B) + move.l d6,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 3 bright + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)&~BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is, but not where line (B) is + move.l d6,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + + ; plane 3 dark + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&~BLT_C)|BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is NOT and merge with existing (B) + move.l d6,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a2),a2 + + ; plane 4 bright + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)|BLT_B)&$ff)),(a4)+ ; copy (A) where mask (C) is OR where line (B) is + move.l d6,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l d7,d2 + + ; plane 5 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56b,(a4)+ + move.l d5,(a4)+ ; bltcpt + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a3),a3 + add.l d7,d4 + + ; plane 6 + ; copy (A) where line (B) is NOT + LAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56bf,(a4)+ + move.l d5,(a4)+ ; bltcpt + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + bra .loop + +.fillbright + move.l pd_OriginalBufferP1234(a6),a0 + lsr.w #1,d2 + adda.w d2,a0 + adda.w d0,a0 + move.l pd_OriginalBufferP56(a6),d4 + lsr.w #1,d2 + add.l d2,d4 + add.l d0,d4 + + move.w d3,d1 + lsl.w #2,d1 + subq.w #3*(KNIGHTS_SLICE_WIDTH/16),d1 + + moveq.l #KNIGHTS_WIDTH/8,d7 + move.l a0,d2 + PREP_ADD_TO_BLITTER_QUEUE a0 + + ; plane 1-4 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy7,(a4)+ + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d1,(a4)+ ; bltsize + + ; plane 5 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy7b,(a4)+ + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a3),a3 + add.l d7,d4 + + ; plane 6 + LAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56f,(a4)+ + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + bra .loop + +; middleMaskNoL = (fillDark & ~fillBright) & ~drawDark (has no lines) +; rightMaskNoL = fillBright & ~drawBright (has no lines) +; bothLines = (drawDark || darkBright) +; 1: (origDarkest &~fillDark) || (origDark & middleMaskNoL) || (origBright & rightMaskNoL) +; -> d = (origDarkest &~fillDark); d = d || (origDark & middleMaskNoL); d = d || (origBright & rightMaskNoL) +; 2: (origDarkest &~fillDark) || (origDark & middleMaskNoL) || (origBright & rightMaskNoL) || drawBright +; -> d = (origDarkest &~fillDark) || drawBright; d = d || (origDark & middleMaskNoL); d = d || (origBright & rightMaskNoL) +; 3: (origDark & middleMaskNoL) || (origBright & rightMaskNoL) +; -> d = (origDark & middleMaskNoL); d = d || (origBright & rightMaskNoL) +; 4: (origBright & rightMaskNoL) || bothLines +; -> d = (origBright & rightMaskNoL) || bothLines +; 5: (orig & ~bothLines) +; 6: (orig & ~bothLines) + +.bothmixedlines + move.l pd_DrawBrightBuffer(a6),d5 + add.l d2,d5 + add.l d0,d5 + move.l pd_FillBrightBuffer(a6),d6 + add.l d2,d6 + add.l d0,d6 + move.l pd_DrawDarkBuffer(a6),a0 + add.l d2,a0 + add.l d0,a0 + move.l a0,-(sp) + move.l pd_FillDarkBuffer(a6),d7 + add.l d2,d7 + add.l d0,d7 + move.l pd_OriginalBufferP1234(a6),a0 + lsr.w #1,d2 + adda.w d2,a0 + adda.w d0,a0 + move.l pd_OriginalBufferP56(a6),d4 + lsr.w #1,d2 + add.l d2,d4 + add.l d0,d4 + + move.l a0,d2 + + PREP_ADD_TO_BLITTER_QUEUE a0 + ; create MiddleMask: dark and NOT bright and not line + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_createmask1,(a4)+ + move.l d6,(a4)+ ; bltcpt + move.l (sp),(a4)+ ; bltbpt + move.l d7,(a4)+ ; bltapt + move.l pd_MiddleMaskBuffer(a6),(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; create RightMask: dark and NOT bright and not line + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_createmask2,(a4)+ + move.l d5,(a4)+ ; bltcpt + move.l d6,(a4)+ ; bltapt + move.l pd_RightMaskBuffer(a6),(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; create BothLines: dark and NOT bright and not line + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_createmask3,(a4)+ + move.l d5,(a4)+ ; bltcpt + move.l (sp)+,(a4)+ ; bltapt + move.l pd_BothLinesMaskBuffer(a6),(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l #2*KNIGHTS_WIDTH/8,d2 ; p3 + + ; plane 1 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy9,(a4)+ + move.l d7,(a4)+ ; bltcpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + sub.l #KNIGHTS_WIDTH/8,d2 ; p2 + + ; d = d || (origDark & middleMaskNoL) + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_mixit1,(a4)+ + move.l pd_MiddleMaskBuffer(a6),(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + sub.l #KNIGHTS_WIDTH/8,d2 ; p1 + + move.l #.bq_generic_abcd,d1 + + ; d = d || (origBright & rightMaskNoL) + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)|BLT_B)&$ff)),(a4)+ ; d = d || (origBright & rightMaskNoL) + move.l pd_RightMaskBuffer(a6),(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l #3*KNIGHTS_WIDTH/8,d2 ; p4 + lea KNIGHTS_MOD(a2),a2 + + ; plane 2 + ; d = (origDarkest &~fillDark) || drawBright + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_mixit2,(a4)+ + move.l d7,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + sub.l #KNIGHTS_WIDTH/8,d2 ; p3 + + ; d = d || (origDark & middleMaskNoL) + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_mixit1,(a4)+ + move.l pd_MiddleMaskBuffer(a6),(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + sub.l #KNIGHTS_WIDTH/8,d2 ; p2 + + ; d = d || (origBright & rightMaskNoL) + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)|BLT_B)&$ff)),(a4)+ ; d = d || (origBright & rightMaskNoL) + move.l pd_RightMaskBuffer(a6),(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l #2*KNIGHTS_WIDTH/8,d2 ; p4 + lea KNIGHTS_MOD(a2),a2 + + ; plane 3 + ; d = (origDark & middleMaskNoL) + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_mixit1b,(a4)+ + move.l pd_MiddleMaskBuffer(a6),(a4)+ ; bltcpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + sub.l #KNIGHTS_WIDTH/8,d2 ; p3 + + ; d = d || (origBright & rightMaskNoL) + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l d1,(a4)+ + move.w #(BLTEN_ABCD+(((BLT_A&BLT_C)|BLT_B)&$ff)),(a4)+ ; d = d || (origBright & rightMaskNoL) + move.l pd_RightMaskBuffer(a6),(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + add.l #KNIGHTS_WIDTH/8,d2 ; p4 + lea KNIGHTS_MOD(a2),a2 + + ; plane 4 + ; d = (origBright & rightMaskNoL) || bothLines + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_mixit3,(a4)+ + move.l pd_RightMaskBuffer(a6),(a4)+ ; bltcpt + move.l pd_BothLinesMaskBuffer(a6),(a4)+ ; bltbpt + move.l d2,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; plane 5 + ; copy (A) where both lines (B) are NOT + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56c,(a4)+ + move.l pd_BothLinesMaskBuffer(a6),(a4)+ ; bltcpt + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea KNIGHTS_MOD(a3),a3 + add.l #KNIGHTS_WIDTH/8,d4 + + ; plane 6 + ; copy (A) where both lines (B) are NOT + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_copy56bf,(a4)+ + move.l pd_BothLinesMaskBuffer(a6),(a4)+ ; bltcpt + move.l d4,(a4)+ ; bltapt + move.l a3,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + LAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_restorecmod,(a4)+ + + bra .loop + +.bq_paintinit + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.w #(KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8,d0 + lea bltcmod(a5),a1 + move.w d0,(a1)+ ; bltcmod + move.w d0,(a1)+ ; bltbmod + move.w d0,(a1)+ ; bltamod + move.w d0,(a1)+ ; bltdmod + BLTHOGOFF + moveq.l #0,d0 + move.w d0,(a1)+ ; bltcdat + rts + +.bq_copy1 + BLTCON0_SET AD,BLT_A,0 + move.w #(4*KNIGHTS_WIDTH-KNIGHTS_SLICE_WIDTH)/8,bltamod(a5) +.bq_copy1f + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy2 + move.w #(4*KNIGHTS_WIDTH-KNIGHTS_SLICE_WIDTH)/8,bltamod(a5) +.bq_generic_abcd + move.w (a0)+,bltcon0(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy3 + BLTCON0_SET AD,BLT_A,0 ; copy line (A) + move.w #(KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8,bltamod(a5) + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy56 + BLTCON0_SET AD,BLT_A,0 + move.w #(2*KNIGHTS_WIDTH-KNIGHTS_SLICE_WIDTH)/8,bltamod(a5) +.bq_copy56f + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy56c + move.w #(KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8,bltbmod(a5) +.bq_copy56b + BLTCON0_SET ACD,BLT_A&~BLT_C,0 ; copy (A) where line (B) is NOT + move.w #(2*KNIGHTS_WIDTH-KNIGHTS_SLICE_WIDTH)/8,bltamod(a5) +.bq_copy56bf + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_clr1 + BLTCON0_SET D,0,0 +.bq_clr1f + move.l (a0)+,bltdpt(a5) + move.w (a0)+,bltsize(a5) + rts + +.bq_copy7 + BLTCON0_SET AD,BLT_A,0 + move.l #(((KNIGHTS_WIDTH-KNIGHTS_SLICE_WIDTH)/8)<<16)|((2*KNIGHTS_WIDTH-KNIGHTS_SLICE_WIDTH)/8),bltamod(a5) + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy7b + move.l #(((2*KNIGHTS_WIDTH-KNIGHTS_SLICE_WIDTH)/8)<<16)|((KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8),bltamod(a5) + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_createmask1 + BLTCON0_SET ABCD,(BLT_A&~BLT_C)&~BLT_B,0 ; create MiddleMask: dark and NOT bright and not line + move.l #((KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8)<<16,bltamod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_createmask2 + BLTCON0_SET ACD,(BLT_A&~BLT_C),0 ; create RightMask: dark and NOT bright and not line + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_createmask3 + BLTCON0_SET ACD,(BLT_A|BLT_C),0 ; create BothLines: dark and NOT bright and not line + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy9 + BLTCON0_SET ACD,(BLT_A&~BLT_C),0 ; d = (origDarkest &~fillDark) + move.l #(((4*KNIGHTS_WIDTH-KNIGHTS_SLICE_WIDTH)/8)<<16)|((KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8),bltamod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_mixit1 + BLTCON0_SET ABCD,(BLT_A&BLT_C)|BLT_B,0 ; d = d || (origDark & middleMaskNoL) + move.w #0,bltcmod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_mixit1b + BLTCON0_SET ACD,(BLT_A&BLT_C),0 ; d = (origDark & middleMaskNoL) + move.w #0,bltcmod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_mixit2 + BLTCON0_SET ABCD,(BLT_A&~BLT_C)|BLT_B,0 ; d = (origDarkest &~fillDark) || drawBright + move.w #(KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8,bltcmod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_mixit3 + BLTCON0_SET ABCD,(BLT_A&BLT_C)|BLT_B,0 ; d = (origBright & rightMaskNoL) || bothLines + moveq.l #0,d0 + move.l d0,bltcmod(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_restorecmod + move.w #(KNIGHTS_BUF_WIDTH-KNIGHTS_SLICE_WIDTH)/8,bltcmod(a5) + moveq.l #0,d0 + rts + +;-------------------------------------------------------------------- + +blb_paint_text_slices: + move.l pd_TextPaintDataPtr(a6),a1 + tst.w (a1) + bne.s .cont + rts +.cont + PREP_ADD_TO_BLITTER_QUEUE a0 +.loop + move.w (a1)+,d3 + beq.s .finished + + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + ; sprite offset, source offset, mask offset + movem.w (a1)+,d0-d2 + move.l a1,d7 + move.l pd_CurrTextSpritesPtr(a6),a1 + move.l (a1),a1 + adda.w d0,a1 + move.l pd_SourcePanelPtr(a6),d4 + beq.s .emptysource + tst.w d2 + beq.s .plaincopy + + move.l d4,a2 + adda.w d1,a2 + move.l pd_FillBrightBuffer(a6),a3 + lea (KNIGHTS_BUF_WIDTH/8)*TITLETEXT_Y_POS(a3),a3 + adda.w d2,a3 + + ; plane 1 + move.l #.bq_mask,(a4)+ + move.l a3,(a4)+ ; bltcpt + move.l a1,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + addq.w #2,a1 + lea (TITLETEXT_WIDTH/8)(a2),a2 + + ; plane 2 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_mask_more,(a4)+ + move.l a3,(a4)+ ; bltcpt + move.l a1,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.l d7,a1 + bra.s .loop + +.plaincopy + tst.w d1 + beq.s .dbcopy + + move.l d4,a2 + adda.w d1,a2 + move.l #.bq_copy,(a4)+ + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.l d7,a1 + bra.s .loop + +.dbcopy + move.l pd_LastTextSpritesPtr(a6),a2 + move.l (a2),a2 + adda.w d0,a2 + + move.l #.bq_dbcopy,(a4)+ + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.l d7,a1 + bra .loop + +.emptysource + tst.w d2 + beq.s .clearall + + move.l pd_FillBrightBuffer(a6),a3 + lea (KNIGHTS_BUF_WIDTH/8)*TITLETEXT_Y_POS(a3),a3 + adda.w d2,a3 + + ; plane 1 + move.l #.bq_mask_clear,(a4)+ + move.l a3,(a4)+ ; bltcpt + move.l a1,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + addq.w #2,a1 + lea (TITLETEXT_WIDTH/8)(a2),a2 + + ; plane 2 + FAST_ADD_TO_BLITTER_QUEUE a4,a0 + addq.l #4,a4 + move.l #.bq_mask_clear_more,(a4)+ + move.l a3,(a4)+ ; bltcpt + move.l a1,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.l d7,a1 + bra .loop + +.clearall + tst.w d1 + beq.s .dbcopy + move.l #.bq_clear,(a4)+ + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.l d7,a1 + bra .loop + +.finished + ;clr.l (a0) + TERM_ADD_TO_BLITTER_QUEUE a0 + rts + +.bq_mask + BLTCON_SET ABCD,(BLT_A&BLT_C)|(BLT_B&~BLT_C),0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((KNIGHTS_BUF_WIDTH-16)/8)<<16)|(2),bltcmod(a5) + move.l #(((TITLETEXT_WIDTH*TITLETEXT_PLANES-16)/8)<<16)|(2),bltamod(a5) +.bq_mask_more + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_mask_clear + BLTCON_SET ACD,(BLT_A&~BLT_C),0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.w #((KNIGHTS_BUF_WIDTH-16)/8),bltcmod(a5) + move.l #((2)<<16)|(2),bltamod(a5) +.bq_mask_clear_more + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_clear + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l (a0)+,bltdpt(a5) + move.w (a0)+,bltsize(a5) + rts + +.bq_copy + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((TITLETEXT_WIDTH-16)/8)<<16)|0,bltamod(a5) + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_dbcopy + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #0,d0 + move.l d0,bltamod(a5) + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +; a0: linedraw buffer +; a1: line result buffer +; d0-d3: x1,y1 - x2,y2 +; d7 high word not trashed +blb_bresenham_line_draw: + adda.w d1,a1 + adda.w d1,a1 + + move.l pd_TrueColorImage(a6),a0 + move.w d1,d4 ; offset in true color image + mulu #KNIGHTS_WIDTH*2,d4 + add.w d0,d4 + add.w d0,d4 + adda.l d4,a0 + + sub.w d1,d3 + ;beq .done + + sub.w d0,d2 + beq .straightdown + bmi .leftwards + +.rightwards + move.w #KNIGHTS_WIDTH*2,d0 + +.rightwards_dy_greater_than_dx + move.w d3,d1 ; error term + move.w d3,d7 + add.w d2,d2 ; dx * 2 + add.w d3,d3 ; dy * 2 + +.lineloop1 + move.w (a0),(a1)+ + adda.w d0,a0 + sub.w d2,d1 + dbmi d7,.lineloop1 + add.w d3,d1 + addq.w #2,a0 + subq.w #1,d7 + bpl.s .lineloop1 +.done1 + rts + +.leftwards + move.w #KNIGHTS_WIDTH*2,d0 + + neg.w d2 + +.leftwards_dy_greater_than_dx + move.w d3,d1 ; error term + move.w d3,d7 + add.w d2,d2 ; dx * 2 + add.w d3,d3 ; dy * 2 + +.lineloop2 + move.w (a0),(a1)+ + adda.w d0,a0 + sub.w d2,d1 + dbmi d7,.lineloop2 + add.w d3,d1 + subq.w #2,a0 + subq.w #1,d7 + bpl.s .lineloop2 +.done2 + rts + +.straightdown + move.w #KNIGHTS_WIDTH*2,d0 +.lineloopstd + move.w (a0),(a1)+ + adda.w d0,a0 + dbra d7,.lineloopstd + rts + +;-------------------------------------------------------------------- + +blb_do_lamp_rotations: + move.l pd_LampSpriteBuffer(a6),a4 + move.w #NUM_LAMP_ROTATIONS-1,d7 + + moveq.l #-NUM_LAMP_ROTATIONS/2,d1 +.loop + PUTMSG 40,<"%d: Rotation %d to %p">,fw_FrameCounterLong(a6),d1,a4 + + PUSHM d1/d7 + bsr blb_calc_sheers + bsr blb_rotate_chunky + + PUTMSG 40,<"%d: C2P">,fw_FrameCounterLong(a6) + lea pd_LampSprites(a6),a3 + REPT 3 + move.l a4,a1 + move.l a1,(a3)+ + clr.l (a1)+ + clr.l 2*2*LAMP_HEIGHT(a1) + + lea 2*2*(LAMP_HEIGHT+2)(a4),a2 + move.l a2,(a3)+ + clr.l (a2)+ + clr.l 2*2*LAMP_HEIGHT(a2) + + move.l pd_LampChunkyBuffer(a6),a0 + lea REPTN*16(a0),a0 + bsr blb_c2p_line + + lea 2*2*2*(LAMP_HEIGHT+2)(a4),a4 + ENDR + + POPM + addq.w #1,d1 + dbra d7,.loop + + rts + +;-------------------------------------------------------------------- + +blb_calc_sheers: + moveq.l #0,d0 ; tan increment + moveq.l #0,d3 ; sin increment + lea blb_tan_table(pc),a1 + lea blb_sin_table(pc),a2 + add.w d1,d1 + bmi.s .negtan + move.w (a1,d1.w),d0 + move.w (a2,d1.w),d3 + neg.l d3 + bra.s .conttan +.negtan neg.w d1 + move.w (a1,d1.w),d0 + move.w (a2,d1.w),d3 + neg.l d0 +.conttan + lea pd_XSheer1(a6),a0 + moveq.l #LAMP_HEIGHT/2,d1 + moveq.l #LAMP_HEIGHT,d2 + moveq.l #0,d4 + bsr blb_calc_sheer + + lea pd_XSheer2(a6),a0 + moveq.l #LAMP_HEIGHT/2,d1 + moveq.l #LAMP_HEIGHT,d2 + move.l #$8000,d4 + bsr blb_calc_sheer + + lea pd_YSheer(a6),a0 + move.l d3,d0 + moveq.l #LAMP_WIDTH/2,d1 + moveq.l #LAMP_WIDTH,d2 + move.l #$8000,d4 + bsr blb_calc_sheer + rts + +;-------------------------------------------------------------------- + +blb_rotate_chunky: + PUSHM a4 + move.l pd_LampChunkyBuffer(a6),a0 + lea blb_lamp_chunky(pc),a1 + lea pd_XSheer1(a6),a2 + lea pd_YSheer(a6),a3 + lea pd_XSheer2(a6),a4 + moveq.l #LAMP_HEIGHT-1,d7 + moveq.l #0,d1 ; y + moveq.l #0,d2 ; x2/saxy +.yloop + move.b (a2,d1.w),d2 ; x2 = saxy + moveq.l #LAMP_WIDTH-1,d6 +.xloop + moveq.l #0,d0 + cmp.b #LAMP_WIDTH,d1 + bhs.s .skippix + move.w d1,d3 + add.b (a3,d2.w),d3 ; y3 = y + say[x2] + cmp.b #LAMP_HEIGHT,d3 + bhs.s .skippix + move.w d2,d4 + add.b (a4,d3.w),d4 ; x3 = x2 + sax[y3] + cmp.b #LAMP_WIDTH,d4 + bhs.s .skippix + lsl.w #4,d3 + add.w d3,d4 + add.w d3,d4 + add.w d3,d4 + move.b (a1,d4.w),d0 +.skippix + move.b d0,(a0)+ + addq.b #1,d2 ; x2 + dbra d6,.xloop + addq.b #1,d1 + dbra d7,.yloop + POPM + rts + +;-------------------------------------------------------------------- + +; a0 = sheer table +; d0.l = increment +; d1.w = center +; d2.w = height +; d4.l = startoffset +blb_calc_sheer: + PUTMSG 40,<"Calc Sheer %p, %lx, %d, %d">,a0,d0,d1,d2 + lea (a0,d1.w),a0 + lea 1(a0),a1 + move.w d1,d6 + move.w d2,d7 + sub.w d1,d7 + subq.w #1,d7 + + move.l d4,d1 + move.l d1,d2 + +.plusloop + swap d1 + move.b d1,(a0)+ + swap d1 + add.l d0,d1 + dbra d7,.plusloop + +.minusloop + swap d2 + move.b d2,-(a1) + swap d2 + sub.l d0,d2 + dbra d6,.minusloop + rts + +;-------------------------------------------------------------------- + +blb_c2p_line: + move.l #$55555555,d3 + move.l #$33333333,d4 + move.l #$00ff00ff,d5 + moveq.l #LAMP_HEIGHT-1,d7 +.loop + move.l (a0)+,d0 + lsl.l #4,d0 + or.l (a0)+,d0 + move.l (a0)+,d1 + lsl.l #4,d1 + or.l (a0)+,d1 + +; a3a2a1a0e3e2e1e0 b3b2b1b0f3f2f1f0 c3c2c1c0g3g2g1g0 d3d2d1d0h3h2h1h0 +; i3i2i1i0m3m2m1m0 j3j2j1j0n3n2n1n0 k3k2k1k0o3o2o1o0 l3l2l1l0p3p2p1p0 + + move.l d1,d2 + lsr.l #8,d2 + eor.l d0,d2 + and.l d5,d2 + eor.l d2,d0 + lsl.l #8,d2 + eor.l d2,d1 + +; a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0 +; b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0 + + move.l d1,d2 + lsr.l #1,d2 + eor.l d0,d2 + and.l d3,d2 + eor.l d2,d0 + add.l d2,d2 + eor.l d2,d1 + +; a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 +; a2b2a0b0e2f2f0f0 i2j2i0j0m2n2m0n0 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0 + + move.w d1,d2 + move.w d0,d1 + swap d1 + move.w d1,d0 + move.w d2,d1 + +; a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 a2b2a0b0e2f2f0f0 i2j2i0j0m2n2m0n0 +; c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0 + + move.l d1,d2 + lsr.l #2,d2 + eor.l d0,d2 + and.l d4,d2 + eor.l d2,d0 + lsl.l #2,d2 + eor.l d2,d1 + +; a3b3c3d3e3f3g3h3 i3j3k3l3m3n3o3p3 a2b2c2d2e2f2g2h2 i2j2k2l2m2n2o2p2 +; a1b1c1d1e1f1g1h1 i1j1k1l1m1n1o1p1 a0b0c0d0e0f0g0h0 i0j0k0l0m0n0o0p0 + + swap d1 + move.l d1,(a1)+ + swap d0 + move.l d0,(a2)+ + + lea LAMP_WIDTH-16(a0),a0 + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + + include "blitterline_bq.asm" + +;******************************************************************** + +blb_text_panels: + dc.l 0 + dc.l blb_text_1_data + dc.l 0 + dc.l blb_text_2_data + dc.l 0 + dc.l blb_text_3_data + dc.l blb_text_4_data + dc.l blb_text_5_data + dc.l 0 + dc.l 0 + dc.l 0 + +blb_lamp_palette: + incbin "../data/bulb/lamp_64x32x16.PAL" + +blb_lamp_off_palette: + incbin "../data/bulb/lamp_off_64x32x16.PAL" + +blb_lamp_white_palette: + REPT 15 + dc.w $fff + ENDR + +blb_bulb_palette_expanded: + dc.w $0000,$0111,$0332,$0322,$0665,$0764,$0542,$0654 + dc.w $0f0f,$0ddb,$0f0f,$0ec9,$0f0f,$0a85,$0f0f,$0cb8 + +blb_sin_table: + include "sintable.asm" + +blb_tan_table: + include "tantable.asm" + +blb_lamp_pos_table: + include "lamppostable.asm" + +blb_lamp_angle_table: + include "langletable.asm" + +blb_lamp_chunky: + incbin "../data/bulb/lamp_48x32x16.chk" + + section "blb_anim",data + +blb_swing_data: + include "swing2.asm" + +blb_paint_data: + include "paint2.asm" + +blb_textpaint_data: + include "textpaint.asm" + + IFND FW_DEMO_PART + dc.w 1 ; avoid hunk shortening that leaves dirty memory on kick 1.3 + ENDC + +;******************************************************************** + +;-------------------------------------------------------------------- + + section "blb_copper",data,chip + +blb_copperlist: + COP_MOVE dmacon,DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + COP_MOVE diwstrt,$5281 ; window start + COP_MOVE diwstop,$06c1 ; window stop + COP_MOVE ddfstrt,$0038 ; bitplane start +blb_ddfstop: + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon3,$0c00 +blb_fmode: + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + + COP_MOVE bplcon0,$0200 + COP_MOVE bplcon1,$0000 + COP_MOVE bplcon2,$0024 ; turn off all bitplanes, set scroll values to 0, sprites in front + COP_MOVE bpl1mod,(KNIGHTS_BUF_WIDTH-KNIGHTS_WIDTH)/8 + COP_MOVE bpl2mod,(KNIGHTS_BUF_WIDTH-KNIGHTS_WIDTH)/8 + +blb_coppersprites: + COP_MOVE sprpt,0 + COP_MOVE sprpt+2,0 + COP_MOVE sprpt+4,0 + COP_MOVE sprpt+6,0 + COP_MOVE sprpt+8,0 + COP_MOVE sprpt+10,0 + COP_MOVE sprpt+12,0 + COP_MOVE sprpt+14,0 + COP_MOVE sprpt+16,0 + COP_MOVE sprpt+18,0 + COP_MOVE sprpt+20,0 + COP_MOVE sprpt+22,0 + COP_MOVE sprpt+24,0 + COP_MOVE sprpt+26,0 + COP_MOVE sprpt+28,0 + COP_MOVE sprpt+30,0 + +blb_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +blb_bulb_pic: + incbin "../data/bulb/PLT_Lampscene_ham.raw" + +blb_text_1_data: + ;blk.b 2560,255 + incbin "../data/bulb/text1.BPL" + +blb_text_2_data: + ;blk.b 2560,255 + incbin "../data/bulb/text2.BPL" + +blb_text_3_data: + ;blk.b 2560,255 + incbin "../data/bulb/text3.BPL" + +blb_text_4_data: + ;blk.b 2560,255 + incbin "../data/bulb/text4.BPL" + +blb_text_5_data: + ;blk.b 2560,255 + incbin "../data/bulb/text5.BPL" + END \ No newline at end of file diff --git a/source/bulb/compile.bat b/source/bulb/compile.bat new file mode 100644 index 0000000..11c9a07 --- /dev/null +++ b/source/bulb/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "bulb.exe" "bulb.asm" diff --git a/source/bulb/debug.bat b/source/bulb/debug.bat new file mode 100644 index 0000000..e88b696 --- /dev/null +++ b/source/bulb/debug.bat @@ -0,0 +1,21 @@ +del bulb.exe +del "..\winuae\hd0\bulb.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "bulb.exe" "bulb.asm" + +copy bulb.exe "..\winuae\hd0" +copy bulb.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =bulb.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/bulb/lamppostable.asm b/source/bulb/lamppostable.asm new file mode 100644 index 0000000..2a8b303 --- /dev/null +++ b/source/bulb/lamppostable.asm @@ -0,0 +1,129 @@ + ; Lamp positions + dc.b $cd,$05,$cd,$05,$cd,$05,$cd,$05 + dc.b $cd,$05,$cd,$05,$cd,$05,$cd,$05 + dc.b $cd,$05,$cd,$05,$cd,$05,$cd,$05 + dc.b $cd,$05,$cd,$05,$cd,$05,$cd,$05 + dc.b $cc,$05,$cc,$05,$cc,$05,$cc,$05 + dc.b $cc,$05,$cc,$05,$cc,$05,$cc,$06 + dc.b $cb,$06,$cb,$06,$cb,$06,$cb,$06 + dc.b $cb,$06,$cb,$06,$ca,$06,$ca,$06 + dc.b $ca,$06,$ca,$06,$ca,$06,$c9,$07 + dc.b $c9,$07,$c9,$07,$c9,$07,$c9,$07 + dc.b $c8,$07,$c8,$07,$c8,$07,$c8,$07 + dc.b $c7,$08,$c7,$08,$c7,$08,$c6,$08 + dc.b $c6,$08,$c6,$08,$c6,$08,$c5,$09 + dc.b $c5,$09,$c5,$09,$c4,$09,$c4,$09 + dc.b $c4,$09,$c3,$09,$c3,$09,$c3,$0a + dc.b $c2,$0a,$c2,$0a,$c1,$0a,$c1,$0a + dc.b $c1,$0a,$c0,$0a,$c0,$0b,$bf,$0b + dc.b $bf,$0b,$bf,$0b,$be,$0b,$be,$0b + dc.b $bd,$0b,$bd,$0c,$bd,$0c,$bc,$0c + dc.b $bc,$0c,$bb,$0c,$bb,$0c,$ba,$0c + dc.b $ba,$0c,$b9,$0d,$b9,$0d,$b8,$0d + dc.b $b8,$0d,$b7,$0d,$b7,$0d,$b7,$0d + dc.b $b6,$0d,$b6,$0e,$b5,$0e,$b5,$0e + dc.b $b4,$0e,$b3,$0e,$b3,$0e,$b2,$0e + dc.b $b2,$0e,$b1,$0e,$b1,$0f,$b0,$0f + dc.b $b0,$0f,$af,$0f,$af,$0f,$ae,$0f + dc.b $ae,$0f,$ad,$0f,$ad,$0f,$ac,$0f + dc.b $ab,$0f,$ab,$0f,$aa,$0f,$aa,$10 + dc.b $a9,$10,$a9,$10,$a8,$10,$a7,$10 + dc.b $a7,$10,$a6,$10,$a6,$10,$a5,$10 + dc.b $a5,$10,$a4,$10,$a3,$10,$a3,$10 + dc.b $a2,$10,$a2,$10,$a1,$10,$a1,$10 + dc.b $a0,$10,$9f,$10,$9f,$10,$9e,$10 + dc.b $9e,$10,$9d,$10,$9d,$10,$9c,$10 + dc.b $9b,$10,$9b,$10,$9a,$10,$9a,$10 + dc.b $99,$10,$99,$10,$98,$10,$97,$10 + dc.b $97,$10,$96,$10,$96,$0f,$95,$0f + dc.b $95,$0f,$94,$0f,$93,$0f,$93,$0f + dc.b $92,$0f,$92,$0f,$91,$0f,$91,$0f + dc.b $90,$0f,$90,$0f,$8f,$0f,$8f,$0e + dc.b $8e,$0e,$8e,$0e,$8d,$0e,$8d,$0e + dc.b $8c,$0e,$8b,$0e,$8b,$0e,$8a,$0e + dc.b $8a,$0d,$89,$0d,$89,$0d,$89,$0d + dc.b $88,$0d,$88,$0d,$87,$0d,$87,$0d + dc.b $86,$0c,$86,$0c,$85,$0c,$85,$0c + dc.b $84,$0c,$84,$0c,$83,$0c,$83,$0c + dc.b $83,$0b,$82,$0b,$82,$0b,$81,$0b + dc.b $81,$0b,$81,$0b,$80,$0b,$80,$0a + dc.b $7f,$0a,$7f,$0a,$7f,$0a,$7e,$0a + dc.b $7e,$0a,$7d,$0a,$7d,$09,$7d,$09 + dc.b $7c,$09,$7c,$09,$7c,$09,$7b,$09 + dc.b $7b,$09,$7b,$09,$7a,$08,$7a,$08 + dc.b $7a,$08,$7a,$08,$79,$08,$79,$08 + dc.b $79,$08,$78,$07,$78,$07,$78,$07 + dc.b $78,$07,$77,$07,$77,$07,$77,$07 + dc.b $77,$07,$77,$07,$76,$06,$76,$06 + dc.b $76,$06,$76,$06,$76,$06,$75,$06 + dc.b $75,$06,$75,$06,$75,$06,$75,$06 + dc.b $75,$06,$74,$06,$74,$05,$74,$05 + dc.b $74,$05,$74,$05,$74,$05,$74,$05 + dc.b $74,$05,$73,$05,$73,$05,$73,$05 + dc.b $73,$05,$73,$05,$73,$05,$73,$05 + dc.b $73,$05,$73,$05,$73,$05,$73,$05 + dc.b $73,$05,$73,$05,$73,$05,$73,$05 + dc.b $73,$05,$73,$05,$73,$05,$73,$05 + dc.b $73,$05,$73,$05,$73,$05,$73,$05 + dc.b $73,$05,$73,$05,$73,$05,$73,$05 + dc.b $73,$05,$73,$05,$73,$05,$73,$05 + dc.b $74,$05,$74,$05,$74,$05,$74,$05 + dc.b $74,$05,$74,$05,$74,$05,$74,$06 + dc.b $75,$06,$75,$06,$75,$06,$75,$06 + dc.b $75,$06,$75,$06,$76,$06,$76,$06 + dc.b $76,$06,$76,$06,$76,$06,$77,$07 + dc.b $77,$07,$77,$07,$77,$07,$77,$07 + dc.b $78,$07,$78,$07,$78,$07,$78,$07 + dc.b $79,$08,$79,$08,$79,$08,$7a,$08 + dc.b $7a,$08,$7a,$08,$7a,$08,$7b,$09 + dc.b $7b,$09,$7b,$09,$7c,$09,$7c,$09 + dc.b $7c,$09,$7d,$09,$7d,$09,$7d,$0a + dc.b $7e,$0a,$7e,$0a,$7f,$0a,$7f,$0a + dc.b $7f,$0a,$80,$0a,$80,$0b,$81,$0b + dc.b $81,$0b,$81,$0b,$82,$0b,$82,$0b + dc.b $83,$0b,$83,$0c,$83,$0c,$84,$0c + dc.b $84,$0c,$85,$0c,$85,$0c,$86,$0c + dc.b $86,$0c,$87,$0d,$87,$0d,$88,$0d + dc.b $88,$0d,$89,$0d,$89,$0d,$89,$0d + dc.b $8a,$0d,$8a,$0e,$8b,$0e,$8b,$0e + dc.b $8c,$0e,$8d,$0e,$8d,$0e,$8e,$0e + dc.b $8e,$0e,$8f,$0e,$8f,$0f,$90,$0f + dc.b $90,$0f,$91,$0f,$91,$0f,$92,$0f + dc.b $92,$0f,$93,$0f,$93,$0f,$94,$0f + dc.b $95,$0f,$95,$0f,$96,$0f,$96,$10 + dc.b $97,$10,$97,$10,$98,$10,$99,$10 + dc.b $99,$10,$9a,$10,$9a,$10,$9b,$10 + dc.b $9b,$10,$9c,$10,$9d,$10,$9d,$10 + dc.b $9e,$10,$9e,$10,$9f,$10,$9f,$10 + dc.b $a0,$10,$a1,$10,$a1,$10,$a2,$10 + dc.b $a2,$10,$a3,$10,$a3,$10,$a4,$10 + dc.b $a5,$10,$a5,$10,$a6,$10,$a6,$10 + dc.b $a7,$10,$a7,$10,$a8,$10,$a9,$10 + dc.b $a9,$10,$aa,$10,$aa,$0f,$ab,$0f + dc.b $ab,$0f,$ac,$0f,$ad,$0f,$ad,$0f + dc.b $ae,$0f,$ae,$0f,$af,$0f,$af,$0f + dc.b $b0,$0f,$b0,$0f,$b1,$0f,$b1,$0e + dc.b $b2,$0e,$b2,$0e,$b3,$0e,$b3,$0e + dc.b $b4,$0e,$b5,$0e,$b5,$0e,$b6,$0e + dc.b $b6,$0d,$b7,$0d,$b7,$0d,$b7,$0d + dc.b $b8,$0d,$b8,$0d,$b9,$0d,$b9,$0d + dc.b $ba,$0c,$ba,$0c,$bb,$0c,$bb,$0c + dc.b $bc,$0c,$bc,$0c,$bd,$0c,$bd,$0c + dc.b $bd,$0b,$be,$0b,$be,$0b,$bf,$0b + dc.b $bf,$0b,$bf,$0b,$c0,$0b,$c0,$0a + dc.b $c1,$0a,$c1,$0a,$c1,$0a,$c2,$0a + dc.b $c2,$0a,$c3,$0a,$c3,$09,$c3,$09 + dc.b $c4,$09,$c4,$09,$c4,$09,$c5,$09 + dc.b $c5,$09,$c5,$09,$c6,$08,$c6,$08 + dc.b $c6,$08,$c6,$08,$c7,$08,$c7,$08 + dc.b $c7,$08,$c8,$07,$c8,$07,$c8,$07 + dc.b $c8,$07,$c9,$07,$c9,$07,$c9,$07 + dc.b $c9,$07,$c9,$07,$ca,$06,$ca,$06 + dc.b $ca,$06,$ca,$06,$ca,$06,$cb,$06 + dc.b $cb,$06,$cb,$06,$cb,$06,$cb,$06 + dc.b $cb,$06,$cc,$06,$cc,$05,$cc,$05 + dc.b $cc,$05,$cc,$05,$cc,$05,$cc,$05 + dc.b $cc,$05,$cd,$05,$cd,$05,$cd,$05 + dc.b $cd,$05,$cd,$05,$cd,$05,$cd,$05 + dc.b $cd,$05,$cd,$05,$cd,$05,$cd,$05 + dc.b $cd,$05,$cd,$05,$cd,$05,$cd,$05 diff --git a/source/bulb/langletable.asm b/source/bulb/langletable.asm new file mode 100644 index 0000000..b34f79e --- /dev/null +++ b/source/bulb/langletable.asm @@ -0,0 +1,65 @@ + ; Lamp angle table + dc.b $ec,$ec,$ec,$ec,$ec,$ec,$ec,$ec + dc.b $ec,$ec,$ec,$ec,$ec,$ec,$ec,$ec + dc.b $ec,$ec,$ec,$ed,$ed,$ed,$ed,$ed + dc.b $ed,$ed,$ed,$ed,$ed,$ed,$ed,$ed + dc.b $ee,$ee,$ee,$ee,$ee,$ee,$ee,$ee + dc.b $ee,$ee,$ef,$ef,$ef,$ef,$ef,$ef + dc.b $ef,$f0,$f0,$f0,$f0,$f0,$f0,$f0 + dc.b $f1,$f1,$f1,$f1,$f1,$f1,$f2,$f2 + dc.b $f2,$f2,$f2,$f2,$f3,$f3,$f3,$f3 + dc.b $f3,$f4,$f4,$f4,$f4,$f4,$f4,$f5 + dc.b $f5,$f5,$f5,$f6,$f6,$f6,$f6,$f6 + dc.b $f7,$f7,$f7,$f7,$f7,$f8,$f8,$f8 + dc.b $f8,$f9,$f9,$f9,$f9,$f9,$fa,$fa + dc.b $fa,$fa,$fb,$fb,$fb,$fb,$fc,$fc + dc.b $fc,$fc,$fd,$fd,$fd,$fd,$fe,$fe + dc.b $fe,$fe,$ff,$ff,$ff,$ff,$00,$00 + dc.b $00,$00,$00,$01,$01,$01,$01,$02 + dc.b $02,$02,$02,$03,$03,$03,$03,$04 + dc.b $04,$04,$04,$05,$05,$05,$05,$06 + dc.b $06,$06,$06,$07,$07,$07,$07,$07 + dc.b $08,$08,$08,$08,$09,$09,$09,$09 + dc.b $09,$0a,$0a,$0a,$0a,$0a,$0b,$0b + dc.b $0b,$0b,$0c,$0c,$0c,$0c,$0c,$0c + dc.b $0d,$0d,$0d,$0d,$0d,$0e,$0e,$0e + dc.b $0e,$0e,$0e,$0f,$0f,$0f,$0f,$0f + dc.b $0f,$10,$10,$10,$10,$10,$10,$10 + dc.b $11,$11,$11,$11,$11,$11,$11,$12 + dc.b $12,$12,$12,$12,$12,$12,$12,$12 + dc.b $12,$13,$13,$13,$13,$13,$13,$13 + dc.b $13,$13,$13,$13,$13,$13,$14,$14 + dc.b $14,$14,$14,$14,$14,$14,$14,$14 + dc.b $14,$14,$14,$14,$14,$14,$14,$14 + dc.b $14,$14,$14,$14,$14,$14,$14,$14 + dc.b $14,$14,$14,$14,$14,$14,$14,$14 + dc.b $14,$14,$14,$13,$13,$13,$13,$13 + dc.b $13,$13,$13,$13,$13,$13,$13,$13 + dc.b $12,$12,$12,$12,$12,$12,$12,$12 + dc.b $12,$12,$11,$11,$11,$11,$11,$11 + dc.b $11,$10,$10,$10,$10,$10,$10,$10 + dc.b $0f,$0f,$0f,$0f,$0f,$0f,$0e,$0e + dc.b $0e,$0e,$0e,$0e,$0d,$0d,$0d,$0d + dc.b $0d,$0c,$0c,$0c,$0c,$0c,$0c,$0b + dc.b $0b,$0b,$0b,$0a,$0a,$0a,$0a,$0a + dc.b $09,$09,$09,$09,$09,$08,$08,$08 + dc.b $08,$07,$07,$07,$07,$07,$06,$06 + dc.b $06,$06,$05,$05,$05,$05,$04,$04 + dc.b $04,$04,$03,$03,$03,$03,$02,$02 + dc.b $02,$02,$01,$01,$01,$01,$00,$00 + dc.b $00,$00,$00,$ff,$ff,$ff,$ff,$fe + dc.b $fe,$fe,$fe,$fd,$fd,$fd,$fd,$fc + dc.b $fc,$fc,$fc,$fb,$fb,$fb,$fb,$fa + dc.b $fa,$fa,$fa,$f9,$f9,$f9,$f9,$f9 + dc.b $f8,$f8,$f8,$f8,$f7,$f7,$f7,$f7 + dc.b $f7,$f6,$f6,$f6,$f6,$f6,$f5,$f5 + dc.b $f5,$f5,$f4,$f4,$f4,$f4,$f4,$f4 + dc.b $f3,$f3,$f3,$f3,$f3,$f2,$f2,$f2 + dc.b $f2,$f2,$f2,$f1,$f1,$f1,$f1,$f1 + dc.b $f1,$f0,$f0,$f0,$f0,$f0,$f0,$f0 + dc.b $ef,$ef,$ef,$ef,$ef,$ef,$ef,$ee + dc.b $ee,$ee,$ee,$ee,$ee,$ee,$ee,$ee + dc.b $ee,$ed,$ed,$ed,$ed,$ed,$ed,$ed + dc.b $ed,$ed,$ed,$ed,$ed,$ed,$ec,$ec + dc.b $ec,$ec,$ec,$ec,$ec,$ec,$ec,$ec + dc.b $ec,$ec,$ec,$ec,$ec,$ec,$ec,$ec diff --git a/source/bulb/paint2.asm b/source/bulb/paint2.asm new file mode 100644 index 0000000..a3bccd0 --- /dev/null +++ b/source/bulb/paint2.asm @@ -0,0 +1,4729 @@ +; 0 (26 passes, 1800 height, 205 blits) + dc.b (8<<3)|3,86,$75,$80,(9<<3)|3,50,$a2,$80,(7<<3)|3,29,$48,$80 + dc.b (0<<3)|1,180,$00,$00,(1<<3)|1,180,$00,$00,(2<<3)|1,180,$00,$00,(3<<3)|1,180,$00,$00,(4<<3)|1,180,$00,$00,(5<<3)|1,180,$00,$00 + dc.b (6<<3)|5,93,$6c,$c0 + dc.b (9<<3)|1,74,$00,$00 + dc.b (7<<3)|6,93,$6c,$c0 + dc.b (8<<3)|1,42,$00,$00 + dc.b (6<<3)|7,79,$0a,$00 + dc.b (9<<3)|5,20,$5c,$80,(8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$84,$80,(8<<3)|6,20,$5c,$80 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (7<<3)|1,10,$00,$00 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,16,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$75,$80 + dc.b (6<<3)|1,3,$00,$00,0 + even + +; 1 (26 passes, 1800 height, 205 blits) + dc.b (8<<3)|3,86,$75,$80,(9<<3)|3,50,$a2,$80,(7<<3)|3,29,$48,$80 + dc.b (0<<3)|1,180,$00,$00,(1<<3)|1,180,$00,$00,(2<<3)|1,180,$00,$00,(3<<3)|1,180,$00,$00,(4<<3)|1,180,$00,$00,(5<<3)|1,180,$00,$00 + dc.b (6<<3)|5,93,$6c,$c0 + dc.b (9<<3)|1,74,$00,$00 + dc.b (7<<3)|6,93,$6c,$c0 + dc.b (8<<3)|1,42,$00,$00 + dc.b (6<<3)|7,79,$0a,$00 + dc.b (9<<3)|5,20,$5c,$80,(8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$84,$80,(8<<3)|6,20,$5c,$80 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (7<<3)|1,10,$00,$00 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,16,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$75,$80 + dc.b (6<<3)|1,3,$00,$00,0 + even + +; 2 (14 passes, 426 height, 139 blits) + dc.b (6<<3)|5,92,$6e,$00 + dc.b (7<<3)|6,92,$6e,$00 + dc.b (6<<3)|7,80,$0a,$00 + dc.b (9<<3)|5,20,$5c,$80,(8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$84,$80,(8<<3)|6,20,$5c,$80 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (7<<3)|3,1,$6c,$c0 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,16,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$75,$80,0 + even + +; 3 (15 passes, 428 height, 145 blits) + dc.b (6<<3)|5,92,$6e,$00 + dc.b (7<<3)|6,92,$6e,$00 + dc.b (6<<3)|7,80,$0a,$00 + dc.b (9<<3)|5,20,$5d,$c0,(8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$85,$c0,(8<<3)|6,20,$5d,$c0 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (7<<3)|3,1,$6c,$c0 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,17,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$76,$c0 + dc.b (9<<3)|1,1,$5c,$80,0 + even + +; 4 (17 passes, 430 height, 157 blits) + dc.b (6<<3)|5,90,$70,$80 + dc.b (7<<3)|6,90,$70,$80 + dc.b (6<<3)|7,82,$0a,$00 + dc.b (9<<3)|5,21,$5d,$c0 + dc.b (9<<3)|6,25,$85,$c0 + dc.b (7<<3)|3,2,$6e,$00 + dc.b (8<<3)|5,16,$35,$c0 + dc.b (8<<3)|6,21,$5d,$c0 + dc.b (7<<3)|5,12,$0d,$c0 + dc.b (7<<3)|6,16,$35,$c0 + dc.b (7<<3)|7,20,$1c,$c0,(8<<3)|7,16,$49,$c0 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,11,$78,$00 + dc.b (7<<3)|1,1,$0c,$80,(8<<3)|1,1,$34,$80,(9<<3)|1,1,$5c,$80,0 + even + +; 5 (16 passes, 429 height, 151 blits) + dc.b (6<<3)|5,88,$73,$00 + dc.b (7<<3)|6,88,$73,$00 + dc.b (7<<3)|3,4,$6e,$00 + dc.b (6<<3)|7,84,$0a,$00 + dc.b (9<<3)|5,21,$5d,$c0 + dc.b (9<<3)|6,25,$85,$c0 + dc.b (8<<3)|5,16,$35,$c0 + dc.b (8<<3)|6,21,$5d,$c0 + dc.b (7<<3)|5,12,$0d,$c0 + dc.b (7<<3)|6,16,$35,$c0 + dc.b (7<<3)|7,20,$1c,$c0,(8<<3)|7,16,$49,$c0 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,11,$78,$00 + dc.b (7<<3)|1,1,$0c,$80,(8<<3)|1,1,$34,$80,0 + even + +; 6 (19 passes, 588 height, 170 blits) + dc.b (6<<3)|1,83,$79,$40 + dc.b (7<<3)|5,61,$94,$c0 + dc.b (8<<3)|6,88,$73,$00 + dc.b (6<<3)|5,45,$41,$00,(9<<3)|5,36,$73,$00,(8<<3)|5,31,$46,$00 + dc.b (7<<3)|6,41,$46,$00,(9<<3)|6,39,$b0,$40 + dc.b (6<<3)|7,44,$0a,$00 + dc.b (9<<3)|1,17,$5d,$c0 + dc.b (7<<3)|5,13,$19,$00 + dc.b (9<<3)|2,13,$a0,$00 + dc.b (8<<3)|1,13,$35,$c0 + dc.b (7<<3)|7,23,$29,$40 + dc.b (7<<3)|1,9,$0d,$c0 + dc.b (7<<3)|7,22,$79,$40 + dc.b (6<<3)|5,3,$06,$40 + dc.b (8<<3)|7,5,$6c,$c0 + dc.b (6<<3)|1,2,$03,$c0,0 + even + +; 7 (10 passes, 588 height, 68 blits) + dc.b (6<<3)|1,133,$3a,$c0 + dc.b (8<<3)|5,90,$70,$80,(7<<3)|5,80,$2e,$40 + dc.b (9<<3)|1,68,$5d,$c0,(7<<3)|1,63,$92,$40,(8<<3)|1,47,$35,$c0 + dc.b (6<<3)|5,39,$0a,$00,(9<<3)|5,37,$b2,$c0 + dc.b (7<<3)|1,26,$0d,$c0,(6<<3)|1,5,$03,$c0,0 + even + +; 8 (4 passes, 464 height, 24 blits) + dc.b (7<<3)|1,160,$19,$00,(8<<3)|1,124,$46,$00,(6<<3)|1,92,$06,$40,(9<<3)|1,88,$73,$00,0 + even + +; 9 (4 passes, 246 height, 24 blits) + dc.b (8<<3)|1,90,$70,$80,(7<<3)|1,80,$2e,$40,(6<<3)|1,39,$0a,$00,(9<<3)|1,37,$b2,$c0,0 + even + +; 10 (16 passes, 585 height, 145 blits) + dc.b (8<<3)|3,80,$7d,$00,(9<<3)|3,43,$ab,$40,(7<<3)|3,38,$4d,$80 + dc.b (6<<3)|5,80,$7d,$00 + dc.b (7<<3)|6,80,$7d,$00 + dc.b (6<<3)|7,92,$0a,$00 + dc.b (9<<3)|5,24,$5f,$00 + dc.b (9<<3)|6,29,$87,$00 + dc.b (8<<3)|5,18,$37,$00 + dc.b (8<<3)|6,24,$5f,$00 + dc.b (7<<3)|5,12,$0f,$00 + dc.b (7<<3)|6,18,$37,$00 + dc.b (7<<3)|7,20,$1e,$00 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (8<<3)|7,14,$4d,$80,(9<<3)|7,8,$7d,$00,0 + even + +; 11 (16 passes, 581 height, 145 blits) + dc.b (8<<3)|3,79,$7e,$40,(9<<3)|3,42,$ac,$80,(7<<3)|3,39,$4e,$c0 + dc.b (6<<3)|5,78,$7f,$80 + dc.b (7<<3)|6,78,$7f,$80 + dc.b (6<<3)|7,93,$0b,$40 + dc.b (9<<3)|5,24,$60,$40 + dc.b (9<<3)|6,29,$88,$40 + dc.b (8<<3)|5,18,$38,$40 + dc.b (8<<3)|6,24,$60,$40 + dc.b (7<<3)|5,12,$10,$40 + dc.b (7<<3)|6,18,$38,$40 + dc.b (7<<3)|7,20,$1f,$40 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,14,$4e,$c0,(9<<3)|7,8,$7e,$40,0 + even + +; 12 (18 passes, 428 height, 163 blits) + dc.b (6<<3)|5,75,$83,$40 + dc.b (7<<3)|6,75,$83,$40 + dc.b (7<<3)|3,5,$7d,$00 + dc.b (6<<3)|7,96,$0b,$40 + dc.b (9<<3)|5,24,$60,$40 + dc.b (9<<3)|6,30,$88,$40 + dc.b (8<<3)|5,18,$38,$40 + dc.b (8<<3)|6,24,$60,$40 + dc.b (7<<3)|5,12,$10,$40 + dc.b (7<<3)|6,18,$38,$40 + dc.b (7<<3)|7,20,$1f,$40 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,14,$4e,$c0,(9<<3)|7,8,$7e,$40 + dc.b (6<<3)|1,1,$03,$c0,(7<<3)|1,1,$0f,$00,(8<<3)|1,1,$37,$00,(9<<3)|1,1,$5f,$00,0 + even + +; 13 (17 passes, 428 height, 157 blits) + dc.b (6<<3)|5,71,$88,$40 + dc.b (7<<3)|3,7,$7f,$80 + dc.b (7<<3)|6,71,$88,$40 + dc.b (6<<3)|7,100,$0b,$40 + dc.b (9<<3)|5,25,$61,$80 + dc.b (9<<3)|6,31,$89,$80 + dc.b (8<<3)|5,19,$39,$80 + dc.b (8<<3)|6,25,$61,$80 + dc.b (7<<3)|5,13,$11,$80 + dc.b (7<<3)|6,19,$39,$80 + dc.b (7<<3)|7,19,$21,$c0 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,13,$51,$40,(9<<3)|7,7,$80,$c0 + dc.b (7<<3)|1,1,$10,$40,(8<<3)|1,1,$38,$40,(9<<3)|1,1,$60,$40,0 + even + +; 14 (17 passes, 427 height, 157 blits) + dc.b (6<<3)|5,69,$8a,$c0 + dc.b (7<<3)|3,6,$83,$40 + dc.b (7<<3)|6,69,$8a,$c0 + dc.b (6<<3)|7,102,$0b,$40 + dc.b (9<<3)|5,26,$61,$80 + dc.b (9<<3)|6,32,$89,$80 + dc.b (8<<3)|5,19,$39,$80 + dc.b (8<<3)|6,26,$61,$80 + dc.b (7<<3)|5,13,$11,$80 + dc.b (7<<3)|6,19,$39,$80 + dc.b (7<<3)|7,19,$21,$c0 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,13,$51,$40,(9<<3)|7,6,$82,$00 + dc.b (7<<3)|1,1,$10,$40,(8<<3)|1,1,$38,$40,(9<<3)|1,1,$60,$40,0 + even + +; 15 (14 passes, 424 height, 139 blits) + dc.b (6<<3)|5,66,$8e,$80 + dc.b (7<<3)|6,66,$8e,$80 + dc.b (7<<3)|3,5,$88,$40 + dc.b (6<<3)|7,105,$0b,$40 + dc.b (9<<3)|5,27,$61,$80 + dc.b (9<<3)|6,34,$89,$80 + dc.b (8<<3)|5,20,$39,$80 + dc.b (8<<3)|6,27,$61,$80,(7<<3)|6,20,$39,$80 + dc.b (7<<3)|5,13,$11,$80 + dc.b (7<<3)|7,19,$21,$c0 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,12,$52,$80,(9<<3)|7,5,$83,$40,0 + even + +; 16 (17 passes, 428 height, 157 blits) + dc.b (6<<3)|5,62,$93,$80 + dc.b (7<<3)|3,7,$8a,$c0 + dc.b (7<<3)|6,62,$93,$80 + dc.b (6<<3)|7,109,$0b,$40 + dc.b (9<<3)|5,28,$62,$c0 + dc.b (9<<3)|6,35,$8a,$c0 + dc.b (8<<3)|5,21,$3a,$c0 + dc.b (8<<3)|6,28,$62,$c0,(7<<3)|6,21,$3a,$c0 + dc.b (7<<3)|5,13,$12,$c0 + dc.b (7<<3)|7,19,$23,$00 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,11,$55,$00,(9<<3)|7,4,$85,$c0 + dc.b (7<<3)|1,1,$11,$80,(8<<3)|1,1,$39,$80,(9<<3)|1,1,$61,$80,0 + even + +; 17 (19 passes, 578 height, 170 blits) + dc.b (6<<3)|5,61,$51,$40 + dc.b (8<<3)|6,77,$80,$c0 + dc.b (6<<3)|1,54,$9d,$80 + dc.b (7<<3)|5,41,$ad,$c0 + dc.b (7<<3)|6,61,$51,$40 + dc.b (9<<3)|5,39,$80,$c0,(8<<3)|5,36,$51,$40 + dc.b (9<<3)|1,25,$61,$80 + dc.b (6<<3)|7,55,$0c,$80 + dc.b (7<<3)|5,17,$20,$80 + dc.b (9<<3)|2,18,$b1,$80 + dc.b (8<<3)|1,19,$39,$80 + dc.b (9<<3)|6,20,$c8,$00 + dc.b (7<<3)|1,12,$11,$80 + dc.b (7<<3)|7,22,$35,$c0,(7<<3)|7,13,$9d,$80 + dc.b (6<<3)|5,3,$08,$c0 + dc.b (6<<3)|1,3,$05,$00 + dc.b (8<<3)|7,2,$7e,$40,0 + even + +; 18 (10 passes, 575 height, 68 blits) + dc.b (6<<3)|1,118,$4d,$80 + dc.b (7<<3)|5,91,$3d,$40,(8<<3)|5,73,$85,$c0 + dc.b (9<<3)|1,85,$62,$c0 + dc.b (6<<3)|5,52,$0c,$80 + dc.b (8<<3)|1,60,$3a,$c0,(7<<3)|1,40,$af,$00,(7<<3)|1,34,$12,$c0 + dc.b (9<<3)|5,16,$cd,$00 + dc.b (6<<3)|1,6,$05,$00,0 + even + +; 19 (15 passes, 568 height, 131 blits) + dc.b (8<<3)|3,67,$8d,$40,(7<<3)|3,60,$5a,$00,(9<<3)|3,27,$bf,$40 + dc.b (6<<3)|5,48,$a5,$00 + dc.b (6<<3)|7,122,$0c,$80 + dc.b (9<<3)|5,32,$65,$40 + dc.b (7<<3)|6,48,$a5,$00,(9<<3)|6,40,$8d,$40 + dc.b (8<<3)|5,23,$3d,$40 + dc.b (8<<3)|6,32,$65,$40,(7<<3)|6,23,$3d,$40 + dc.b (7<<3)|5,14,$15,$40 + dc.b (7<<3)|7,18,$26,$c0 + dc.b (6<<3)|5,5,$06,$40 + dc.b (8<<3)|7,9,$5a,$00,0 + even + +; 20 (18 passes, 609 height, 163 blits) + dc.b (7<<3)|3,66,$5c,$80,(8<<3)|3,66,$8e,$80,(9<<3)|3,25,$c1,$c0 + dc.b (5<<3)|5,44,$06,$40,(6<<3)|5,40,$af,$00,(9<<3)|5,32,$66,$80 + dc.b (6<<3)|7,91,$3d,$40 + dc.b (9<<3)|6,41,$8e,$80,(7<<3)|6,40,$af,$00 + dc.b (8<<3)|5,24,$3e,$80 + dc.b (8<<3)|6,32,$66,$80,(6<<3)|6,31,$16,$80,(7<<3)|6,24,$3e,$80 + dc.b (7<<3)|5,15,$16,$80 + dc.b (7<<3)|7,17,$29,$40 + dc.b (6<<3)|5,5,$06,$40 + dc.b (6<<3)|7,8,$0c,$80,(8<<3)|7,8,$5c,$80,0 + even + +; 21 (21 passes, 516 height, 187 blits) + dc.b (7<<3)|3,11,$a5,$00 + dc.b (5<<3)|5,87,$07,$80 + dc.b (6<<3)|6,74,$17,$c0 + dc.b (6<<3)|5,37,$b2,$c0,(9<<3)|5,32,$67,$c0 + dc.b (9<<3)|6,41,$93,$80 + dc.b (8<<3)|5,25,$3f,$c0 + dc.b (7<<3)|6,37,$b2,$c0,(8<<3)|6,35,$67,$c0 + dc.b (6<<3)|7,50,$74,$40 + dc.b (7<<3)|6,25,$3f,$c0 + dc.b (7<<3)|5,15,$17,$c0 + dc.b (7<<3)|7,17,$2a,$80 + dc.b (6<<3)|5,5,$07,$80 + dc.b (9<<3)|2,3,$8f,$c0 + dc.b (6<<3)|7,8,$0d,$c0,(8<<3)|7,7,$5f,$00 + dc.b (7<<3)|1,2,$15,$40,(8<<3)|1,2,$3d,$40,(9<<3)|1,2,$65,$40,(6<<3)|1,1,$06,$40,0 + even + +; 22 (21 passes, 598 height, 177 blits) + dc.b (5<<3)|5,174,$07,$80 + dc.b (7<<3)|3,12,$af,$00 + dc.b (6<<3)|6,132,$19,$00 + dc.b (9<<3)|5,32,$69,$00 + dc.b (9<<3)|6,42,$94,$c0 + dc.b (6<<3)|2,28,$be,$00 + dc.b (8<<3)|5,26,$41,$00 + dc.b (8<<3)|6,35,$69,$00,(7<<3)|6,28,$be,$00,(7<<3)|6,26,$41,$00 + dc.b (7<<3)|5,16,$19,$00 + dc.b (7<<3)|7,16,$2d,$00 + dc.b (6<<3)|5,5,$07,$80 + dc.b (6<<3)|7,9,$0d,$c0 + dc.b (9<<3)|2,3,$91,$00 + dc.b (8<<3)|7,6,$61,$80 + dc.b (7<<3)|1,2,$16,$80,(8<<3)|1,2,$3e,$80,(9<<3)|1,2,$66,$80,(5<<3)|1,1,$06,$40,(6<<3)|1,1,$06,$40,0 + even + +; 23 (19 passes, 592 height, 165 blits) + dc.b (5<<3)|5,174,$07,$80 + dc.b (7<<3)|3,18,$b2,$c0 + dc.b (6<<3)|6,141,$19,$00 + dc.b (9<<3)|5,32,$69,$00 + dc.b (9<<3)|6,42,$97,$40 + dc.b (8<<3)|5,26,$41,$00 + dc.b (8<<3)|6,37,$69,$00 + dc.b (6<<3)|2,19,$c9,$40 + dc.b (7<<3)|6,26,$41,$00 + dc.b (7<<3)|5,16,$19,$00 + dc.b (7<<3)|6,19,$c9,$40 + dc.b (7<<3)|7,16,$2d,$00 + dc.b (6<<3)|5,5,$07,$80 + dc.b (6<<3)|7,9,$0d,$c0 + dc.b (9<<3)|2,3,$93,$80 + dc.b (8<<3)|7,6,$61,$80 + dc.b (7<<3)|1,1,$17,$c0,(8<<3)|1,1,$3f,$c0,(9<<3)|1,1,$67,$c0,0 + even + +; 24 (18 passes, 576 height, 159 blits) + dc.b (5<<3)|5,174,$07,$80 + dc.b (7<<3)|3,14,$be,$00 + dc.b (6<<3)|6,145,$1a,$40 + dc.b (9<<3)|5,32,$6a,$40 + dc.b (9<<3)|6,43,$9b,$00 + dc.b (8<<3)|5,28,$42,$40 + dc.b (8<<3)|6,39,$6a,$40,(7<<3)|6,28,$42,$40 + dc.b (7<<3)|5,17,$1a,$40 + dc.b (7<<3)|6,14,$cf,$80 + dc.b (7<<3)|7,15,$2f,$80 + dc.b (6<<3)|5,5,$07,$80 + dc.b (9<<3)|2,5,$94,$c0 + dc.b (6<<3)|7,10,$0d,$c0,(8<<3)|7,4,$65,$40 + dc.b (7<<3)|1,1,$19,$00,(8<<3)|1,1,$41,$00,(9<<3)|1,1,$69,$00,0 + even + +; 25 (20 passes, 584 height, 171 blits) + dc.b (5<<3)|5,173,$08,$c0 + dc.b (7<<3)|3,16,$c9,$40 + dc.b (6<<3)|6,155,$1b,$80 + dc.b (9<<3)|5,32,$6b,$80,(8<<3)|5,29,$43,$80 + dc.b (9<<3)|6,44,$9d,$80,(8<<3)|6,40,$6b,$80,(7<<3)|6,29,$43,$80 + dc.b (7<<3)|5,17,$1b,$80 + dc.b (7<<3)|7,15,$30,$c0 + dc.b (6<<3)|5,5,$08,$c0 + dc.b (9<<3)|2,5,$97,$40 + dc.b (6<<3)|7,10,$0f,$00 + dc.b (7<<3)|6,3,$dd,$40 + dc.b (7<<3)|1,2,$19,$00,(8<<3)|1,2,$41,$00,(9<<3)|1,2,$69,$00 + dc.b (8<<3)|7,3,$67,$c0 + dc.b (5<<3)|1,1,$07,$80,(6<<3)|1,1,$07,$80,0 + even + +; 26 (19 passes, 587 height, 161 blits) + dc.b (5<<3)|5,173,$08,$c0 + dc.b (7<<3)|3,14,$cf,$80 + dc.b (6<<3)|6,157,$1c,$c0 + dc.b (9<<3)|5,32,$6c,$c0,(8<<3)|5,30,$44,$c0 + dc.b (9<<3)|6,44,$a2,$80,(8<<3)|6,43,$6c,$c0,(7<<3)|6,30,$44,$c0 + dc.b (7<<3)|5,18,$1c,$c0 + dc.b (9<<3)|2,6,$9b,$00 + dc.b (6<<3)|5,5,$08,$c0 + dc.b (7<<3)|7,14,$33,$40,(6<<3)|7,11,$0f,$00 + dc.b (7<<3)|1,2,$1a,$40,(8<<3)|1,2,$42,$40,(9<<3)|1,2,$6a,$40,(5<<3)|1,1,$07,$80,(6<<3)|1,1,$07,$80 + dc.b (8<<3)|7,2,$6a,$40,0 + even + +; 27 (16 passes, 580 height, 135 blits) + dc.b (5<<3)|5,173,$08,$c0 + dc.b (6<<3)|6,156,$1e,$00 + dc.b (8<<3)|5,32,$46,$00,(9<<3)|5,32,$6e,$00 + dc.b (8<<3)|6,45,$6e,$00,(9<<3)|6,45,$a6,$40 + dc.b (7<<3)|3,3,$dd,$40 + dc.b (7<<3)|6,32,$46,$00 + dc.b (7<<3)|5,19,$1e,$00 + dc.b (9<<3)|2,7,$9d,$80 + dc.b (6<<3)|5,5,$08,$c0 + dc.b (7<<3)|7,13,$35,$c0,(6<<3)|7,12,$0f,$00 + dc.b (7<<3)|1,2,$1b,$80,(8<<3)|1,2,$43,$80,(9<<3)|1,2,$6b,$80,0 + even + +; 28 (16 passes, 575 height, 138 blits) + dc.b (5<<3)|5,173,$08,$c0 + dc.b (6<<3)|6,156,$1e,$00 + dc.b (8<<3)|5,32,$46,$00,(9<<3)|5,32,$6e,$00 + dc.b (8<<3)|6,46,$6f,$40,(9<<3)|6,45,$a8,$c0,(7<<3)|6,33,$46,$00 + dc.b (7<<3)|5,19,$1e,$00,(6<<3)|5,5,$08,$c0 + dc.b (9<<3)|2,5,$a2,$80 + dc.b (7<<3)|7,13,$35,$c0,(6<<3)|7,12,$0f,$00 + dc.b (8<<3)|2,1,$6e,$00 + dc.b (7<<3)|1,1,$1c,$c0,(8<<3)|1,1,$44,$c0,(9<<3)|1,1,$6c,$c0,0 + even + +; 29 (20 passes, 577 height, 172 blits) + dc.b (5<<3)|5,163,$15,$40 + dc.b (6<<3)|6,154,$20,$80 + dc.b (8<<3)|5,32,$48,$80,(9<<3)|5,32,$70,$80 + dc.b (8<<3)|6,46,$73,$00,(9<<3)|6,42,$ac,$80,(7<<3)|6,34,$48,$80 + dc.b (7<<3)|5,20,$20,$80,(5<<3)|5,5,$0a,$00,(6<<3)|5,5,$0a,$00 + dc.b (9<<3)|2,5,$a6,$40 + dc.b (6<<3)|7,13,$10,$40,(7<<3)|7,12,$39,$80 + dc.b (8<<3)|2,2,$70,$80 + dc.b (7<<3)|1,2,$1e,$00,(8<<3)|1,2,$46,$00,(9<<3)|1,2,$6e,$00 + dc.b (5<<3)|7,4,$10,$40 + dc.b (5<<3)|1,1,$08,$c0,(6<<3)|1,1,$08,$c0,0 + even + +; 30 (20 passes, 585 height, 172 blits) + dc.b (5<<3)|5,156,$1e,$00 + dc.b (6<<3)|6,153,$21,$c0 + dc.b (8<<3)|5,32,$49,$c0,(9<<3)|5,32,$71,$c0 + dc.b (8<<3)|6,47,$78,$00,(7<<3)|6,37,$49,$c0,(9<<3)|6,37,$b2,$c0 + dc.b (7<<3)|5,21,$21,$c0 + dc.b (9<<3)|2,8,$a8,$c0 + dc.b (5<<3)|5,5,$0a,$00,(6<<3)|5,5,$0a,$00 + dc.b (6<<3)|7,14,$10,$40 + dc.b (8<<3)|2,5,$71,$c0 + dc.b (5<<3)|7,11,$10,$40,(7<<3)|7,11,$3c,$00 + dc.b (7<<3)|1,3,$1e,$00,(8<<3)|1,3,$46,$00,(9<<3)|1,3,$6e,$00,(5<<3)|1,1,$08,$c0,(6<<3)|1,1,$08,$c0,0 + even + +; 31 (18 passes, 582 height, 160 blits) + dc.b (5<<3)|5,148,$28,$00 + dc.b (6<<3)|6,152,$23,$00 + dc.b (9<<3)|5,33,$74,$40,(8<<3)|5,32,$4c,$40 + dc.b (8<<3)|6,48,$7a,$80,(7<<3)|6,37,$4c,$40,(9<<3)|6,34,$b6,$80 + dc.b (7<<3)|5,22,$23,$00 + dc.b (9<<3)|2,8,$ac,$80 + dc.b (5<<3)|7,19,$10,$40,(6<<3)|7,15,$10,$40 + dc.b (5<<3)|5,5,$0a,$00,(6<<3)|5,5,$0a,$00 + dc.b (8<<3)|2,5,$74,$40 + dc.b (7<<3)|7,11,$3e,$80 + dc.b (8<<3)|1,3,$48,$80,(9<<3)|1,3,$70,$80,(7<<3)|1,2,$20,$80,0 + even + +; 32 (20 passes, 584 height, 172 blits) + dc.b (5<<3)|5,145,$2b,$c0 + dc.b (6<<3)|6,150,$25,$80 + dc.b (8<<3)|5,33,$4e,$c0,(9<<3)|5,33,$78,$00 + dc.b (8<<3)|6,49,$7e,$40,(7<<3)|6,38,$4e,$c0 + dc.b (7<<3)|5,22,$25,$80 + dc.b (9<<3)|6,30,$bb,$80 + dc.b (5<<3)|7,21,$11,$80 + dc.b (9<<3)|2,7,$b2,$c0 + dc.b (6<<3)|7,16,$11,$80 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (8<<3)|2,5,$78,$00 + dc.b (9<<3)|1,5,$71,$c0 + dc.b (7<<3)|7,11,$41,$00 + dc.b (8<<3)|1,4,$49,$c0,(7<<3)|1,3,$21,$c0,(5<<3)|1,1,$0a,$00,(6<<3)|1,1,$0a,$00,0 + even + +; 33 (20 passes, 586 height, 172 blits) + dc.b (5<<3)|5,135,$38,$40 + dc.b (6<<3)|6,149,$26,$c0 + dc.b (9<<3)|5,34,$7a,$80,(8<<3)|5,33,$51,$40 + dc.b (8<<3)|6,50,$82,$00,(7<<3)|6,39,$51,$40 + dc.b (7<<3)|5,23,$26,$c0 + dc.b (9<<3)|6,26,$c0,$80 + dc.b (5<<3)|7,31,$11,$80 + dc.b (9<<3)|2,8,$b6,$80 + dc.b (6<<3)|7,17,$11,$80 + dc.b (8<<3)|2,6,$7a,$80 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (9<<3)|1,5,$74,$40 + dc.b (7<<3)|7,11,$43,$80 + dc.b (8<<3)|1,4,$4c,$40,(7<<3)|1,3,$23,$00,(5<<3)|1,1,$0a,$00,(6<<3)|1,1,$0a,$00,0 + even + +; 34 (20 passes, 583 height, 173 blits) + dc.b (5<<3)|5,122,$48,$80 + dc.b (6<<3)|6,122,$48,$80 + dc.b (8<<3)|5,34,$53,$c0,(9<<3)|5,34,$7e,$40 + dc.b (8<<3)|6,51,$85,$c0,(7<<3)|6,40,$53,$c0 + dc.b (7<<3)|5,25,$28,$00 + dc.b (6<<3)|6,25,$28,$00 + dc.b (5<<3)|7,44,$11,$80 + dc.b (9<<3)|6,22,$c5,$80 + dc.b (6<<3)|3,1,$47,$40 + dc.b (9<<3)|2,8,$bb,$80 + dc.b (6<<3)|7,18,$11,$80 + dc.b (8<<3)|2,6,$7e,$40 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (9<<3)|1,5,$78,$00 + dc.b (7<<3)|7,10,$47,$40 + dc.b (8<<3)|1,4,$4e,$c0,(7<<3)|1,2,$25,$80,0 + even + +; 35 (20 passes, 589 height, 173 blits) + dc.b (5<<3)|5,109,$58,$c0 + dc.b (6<<3)|3,12,$49,$c0 + dc.b (6<<3)|6,109,$58,$c0 + dc.b (8<<3)|5,35,$56,$40,(9<<3)|5,35,$82,$00 + dc.b (8<<3)|6,52,$8c,$00,(7<<3)|6,43,$56,$40 + dc.b (7<<3)|5,25,$2a,$80 + dc.b (5<<3)|7,57,$11,$80 + dc.b (6<<3)|6,25,$2a,$80,(9<<3)|6,16,$cd,$00 + dc.b (9<<3)|2,10,$c0,$80,(8<<3)|2,8,$82,$00 + dc.b (6<<3)|7,20,$11,$80 + dc.b (9<<3)|1,6,$7a,$80 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (7<<3)|7,10,$49,$c0 + dc.b (8<<3)|1,4,$51,$40,(7<<3)|1,3,$26,$c0,0 + even + +; 36 (22 passes, 592 height, 185 blits) + dc.b (6<<3)|3,24,$4e,$c0 + dc.b (5<<3)|5,93,$6c,$c0 + dc.b (6<<3)|6,93,$6c,$c0 + dc.b (8<<3)|5,36,$5a,$00,(9<<3)|5,35,$87,$00 + dc.b (8<<3)|6,53,$91,$00,(7<<3)|6,44,$5a,$00 + dc.b (7<<3)|5,26,$2e,$40 + dc.b (5<<3)|7,72,$12,$c0 + dc.b (6<<3)|6,26,$2e,$40 + dc.b (9<<3)|2,11,$c5,$80 + dc.b (6<<3)|7,22,$12,$c0 + dc.b (8<<3)|2,8,$87,$00 + dc.b (9<<3)|6,11,$d3,$40 + dc.b (9<<3)|1,7,$7e,$40 + dc.b (5<<3)|5,5,$0c,$80,(6<<3)|5,5,$0c,$80 + dc.b (7<<3)|1,5,$28,$00,(8<<3)|1,5,$53,$c0 + dc.b (7<<3)|7,9,$4e,$c0 + dc.b (5<<3)|1,1,$0b,$40,(6<<3)|1,1,$0b,$40,0 + even + +; 37 (24 passes, 597 height, 199 blits) + dc.b (6<<3)|3,39,$58,$c0 + dc.b (5<<3)|5,57,$89,$80 + dc.b (6<<3)|6,70,$89,$80,(8<<3)|6,55,$94,$c0 + dc.b (8<<3)|5,36,$5d,$c0,(9<<3)|5,36,$8a,$c0 + dc.b (5<<3)|7,95,$12,$c0 + dc.b (7<<3)|6,44,$5d,$c0 + dc.b (7<<3)|5,27,$2f,$80 + dc.b (6<<3)|6,27,$2f,$80 + dc.b (4<<3)|5,13,$d0,$c0 + dc.b (5<<3)|2,13,$d0,$c0,(9<<3)|2,10,$cd,$00 + dc.b (6<<3)|7,23,$12,$c0 + dc.b (8<<3)|2,7,$8c,$00 + dc.b (9<<3)|1,7,$82,$00,(8<<3)|1,6,$56,$40 + dc.b (5<<3)|5,5,$0c,$80,(6<<3)|5,5,$0c,$80 + dc.b (9<<3)|6,6,$d9,$80 + dc.b (7<<3)|7,10,$51,$40 + dc.b (7<<3)|1,4,$2a,$80,(5<<3)|1,1,$0b,$40,(6<<3)|1,1,$0b,$40,0 + even + +; 38 (20 passes, 663 height, 166 blits) + dc.b (5<<3)|5,129,$33,$40 + dc.b (6<<3)|6,102,$50,$00 + dc.b (9<<3)|1,64,$87,$00 + dc.b (8<<3)|5,54,$93,$80,(7<<3)|5,43,$50,$00 + dc.b (7<<3)|6,62,$93,$80 + dc.b (8<<3)|1,46,$5a,$00,(7<<3)|1,27,$2e,$40 + dc.b (6<<3)|7,47,$15,$40 + dc.b (6<<3)|5,10,$d4,$80 + dc.b (5<<3)|7,26,$12,$c0 + dc.b (5<<3)|1,10,$d4,$80 + dc.b (9<<3)|5,8,$d7,$00 + dc.b (8<<3)|2,8,$d7,$00 + dc.b (6<<3)|5,5,$0f,$00 + dc.b (7<<3)|7,11,$85,$c0 + dc.b (6<<3)|2,4,$cf,$80 + dc.b (5<<3)|5,3,$0f,$00 + dc.b (5<<3)|1,2,$0c,$80,(6<<3)|1,2,$0c,$80,0 + even + +; 39 (11 passes, 669 height, 72 blits) + dc.b (6<<3)|5,144,$24,$40 + dc.b (5<<3)|1,144,$2d,$00,(8<<3)|1,105,$5d,$c0,(7<<3)|1,79,$2f,$80 + dc.b (7<<3)|5,63,$92,$40 + dc.b (9<<3)|1,69,$8a,$c0 + dc.b (5<<3)|5,20,$14,$00 + dc.b (6<<3)|1,19,$0c,$80,(4<<3)|1,13,$d0,$c0,(6<<3)|1,7,$d8,$40,(5<<3)|1,6,$0c,$80,0 + even + +; 40 (5 passes, 512 height, 30 blits) + dc.b (6<<3)|1,168,$0f,$00,(5<<3)|1,158,$0f,$00,(7<<3)|1,116,$50,$00,(8<<3)|1,62,$93,$80,(9<<3)|1,8,$d7,$00,0 + even + +; 41 (3 passes, 227 height, 18 blits) + dc.b (6<<3)|1,144,$24,$40,(7<<3)|1,63,$92,$40,(5<<3)|1,20,$14,$00,0 + even + +; 42 (0 passes, 0 height, 0 blits) + dc.b 0 + even + +; 43 (17 passes, 695 height, 148 blits) + dc.b (6<<3)|3,94,$6b,$80,(7<<3)|3,32,$b9,$00 + dc.b (4<<3)|5,95,$6a,$40 + dc.b (5<<3)|6,95,$6a,$40 + dc.b (8<<3)|5,41,$73,$00,(9<<3)|5,41,$a6,$40 + dc.b (7<<3)|6,56,$73,$00 + dc.b (7<<3)|5,35,$3f,$c0 + dc.b (5<<3)|7,68,$15,$40 + dc.b (6<<3)|6,35,$3f,$c0,(8<<3)|6,32,$b9,$00 + dc.b (8<<3)|2,15,$a6,$40 + dc.b (6<<3)|5,12,$0f,$00 + dc.b (6<<3)|7,27,$1e,$00 + dc.b (9<<3)|2,6,$d9,$80 + dc.b (5<<3)|5,5,$0f,$00 + dc.b (7<<3)|7,6,$6b,$80,0 + even + +; 44 (17 passes, 695 height, 148 blits) + dc.b (6<<3)|3,90,$70,$80,(7<<3)|3,26,$c0,$80 + dc.b (4<<3)|5,104,$5f,$00 + dc.b (5<<3)|6,104,$5f,$00 + dc.b (8<<3)|5,42,$76,$c0,(9<<3)|5,41,$ab,$40 + dc.b (7<<3)|6,59,$76,$c0 + dc.b (7<<3)|5,37,$42,$40 + dc.b (6<<3)|6,37,$42,$40 + dc.b (5<<3)|7,59,$15,$40 + dc.b (8<<3)|6,26,$c0,$80 + dc.b (8<<3)|2,17,$ab,$40 + dc.b (6<<3)|5,14,$0f,$00 + dc.b (6<<3)|7,27,$20,$80 + dc.b (5<<3)|5,5,$0f,$00 + dc.b (9<<3)|2,2,$de,$80 + dc.b (7<<3)|7,5,$70,$80,0 + even + +; 45 (18 passes, 597 height, 160 blits) + dc.b (4<<3)|5,111,$56,$40 + dc.b (5<<3)|6,111,$56,$40 + dc.b (8<<3)|5,42,$7a,$80 + dc.b (7<<3)|6,62,$7a,$80 + dc.b (9<<3)|5,40,$af,$00,(7<<3)|5,38,$46,$00 + dc.b (6<<3)|6,38,$46,$00 + dc.b (5<<3)|7,52,$15,$40 + dc.b (6<<3)|5,16,$10,$40 + dc.b (8<<3)|6,20,$c8,$00 + dc.b (8<<3)|2,12,$b9,$00 + dc.b (6<<3)|7,27,$24,$40 + dc.b (9<<3)|1,7,$a6,$40,(8<<3)|1,6,$73,$00 + dc.b (5<<3)|5,5,$0f,$00 + dc.b (7<<3)|1,5,$3f,$c0 + dc.b (7<<3)|7,4,$75,$80 + dc.b (6<<3)|1,1,$0f,$00,0 + even + +; 46 (18 passes, 610 height, 160 blits) + dc.b (4<<3)|5,119,$4c,$40 + dc.b (5<<3)|6,119,$4c,$40 + dc.b (8<<3)|5,44,$7f,$80 + dc.b (7<<3)|6,66,$7f,$80 + dc.b (7<<3)|5,42,$48,$80,(9<<3)|5,34,$b6,$80 + dc.b (6<<3)|6,42,$48,$80 + dc.b (6<<3)|5,16,$12,$c0 + dc.b (5<<3)|7,44,$15,$40 + dc.b (8<<3)|2,14,$c0,$80 + dc.b (6<<3)|7,27,$26,$c0 + dc.b (8<<3)|6,12,$d2,$00 + dc.b (9<<3)|1,9,$ab,$40,(8<<3)|1,7,$76,$c0 + dc.b (5<<3)|5,5,$0f,$00 + dc.b (7<<3)|1,5,$42,$40,(6<<3)|1,3,$0f,$00 + dc.b (7<<3)|7,2,$7d,$00,0 + even + +; 47 (19 passes, 612 height, 166 blits) + dc.b (4<<3)|5,125,$44,$c0 + dc.b (5<<3)|6,125,$44,$c0 + dc.b (8<<3)|5,45,$84,$80 + dc.b (7<<3)|6,66,$84,$80 + dc.b (7<<3)|5,41,$4d,$80,(9<<3)|5,29,$bc,$c0 + dc.b (6<<3)|6,41,$4d,$80 + dc.b (6<<3)|5,18,$15,$40 + dc.b (5<<3)|7,37,$16,$80 + dc.b (8<<3)|2,12,$c8,$00 + dc.b (9<<3)|1,11,$af,$00 + dc.b (6<<3)|7,27,$2b,$c0 + dc.b (8<<3)|1,8,$7a,$80 + dc.b (8<<3)|6,8,$d7,$00 + dc.b (7<<3)|1,6,$46,$00 + dc.b (5<<3)|5,5,$10,$40 + dc.b (6<<3)|1,4,$10,$40 + dc.b (7<<3)|7,3,$80,$c0 + dc.b (5<<3)|1,1,$0f,$00,0 + even + +; 48 (18 passes, 615 height, 156 blits) + dc.b (4<<3)|5,131,$3d,$40 + dc.b (5<<3)|6,131,$3d,$40,(7<<3)|6,70,$89,$80 + dc.b (8<<3)|5,46,$89,$80,(7<<3)|5,45,$50,$00 + dc.b (6<<3)|6,45,$50,$00 + dc.b (9<<3)|5,24,$c3,$00,(6<<3)|5,19,$17,$c0 + dc.b (8<<3)|2,12,$d2,$00 + dc.b (5<<3)|7,31,$16,$80,(6<<3)|7,26,$2f,$80 + dc.b (9<<3)|1,10,$b6,$80,(8<<3)|1,8,$7f,$80,(7<<3)|1,6,$48,$80 + dc.b (5<<3)|5,5,$10,$40 + dc.b (6<<3)|1,4,$12,$c0,(5<<3)|1,1,$0f,$00 + dc.b (7<<3)|7,1,$88,$40,0 + even + +; 49 (19 passes, 620 height, 156 blits) + dc.b (4<<3)|5,127,$35,$c0 + dc.b (5<<3)|6,137,$35,$c0 + dc.b (8<<3)|5,47,$8d,$40,(7<<3)|5,46,$53,$c0 + dc.b (7<<3)|6,66,$8e,$80,(6<<3)|6,47,$53,$c0 + dc.b (6<<3)|5,20,$19,$00,(9<<3)|5,20,$c8,$00,(3<<3)|5,10,$d4,$80 + dc.b (4<<3)|2,10,$d4,$80 + dc.b (6<<3)|7,27,$32,$00,(5<<3)|7,25,$16,$80 + dc.b (9<<3)|1,9,$bc,$c0 + dc.b (8<<3)|2,8,$d7,$00 + dc.b (8<<3)|1,7,$84,$80 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|1,5,$4d,$80,(6<<3)|1,3,$15,$40 + dc.b (7<<3)|2,1,$8d,$40,0 + even + +; 50 (18 passes, 625 height, 150 blits) + dc.b (4<<3)|5,121,$2f,$80 + dc.b (5<<3)|6,142,$2f,$80 + dc.b (8<<3)|5,48,$92,$40,(7<<3)|5,47,$57,$80 + dc.b (7<<3)|6,61,$94,$c0,(6<<3)|6,49,$57,$80 + dc.b (3<<3)|5,21,$c6,$c0,(6<<3)|5,21,$1b,$80 + dc.b (4<<3)|2,21,$c6,$c0 + dc.b (9<<3)|5,15,$ce,$40 + dc.b (6<<3)|7,27,$35,$c0 + dc.b (9<<3)|1,9,$c3,$00 + dc.b (5<<3)|7,20,$16,$80 + dc.b (8<<3)|1,7,$89,$80,(7<<3)|1,6,$50,$00 + dc.b (5<<3)|5,5,$10,$40 + dc.b (6<<3)|1,3,$17,$c0 + dc.b (7<<3)|2,2,$92,$40,0 + even + +; 51 (20 passes, 645 height, 163 blits) + dc.b (5<<3)|3,31,$ba,$40 + dc.b (4<<3)|5,113,$29,$40 + dc.b (5<<3)|6,116,$29,$40 + dc.b (7<<3)|5,49,$5b,$40,(8<<3)|5,49,$98,$80 + dc.b (7<<3)|6,54,$9d,$80,(6<<3)|6,53,$5b,$40 + dc.b (3<<3)|5,34,$b6,$80,(6<<3)|5,24,$1c,$c0 + dc.b (4<<3)|6,31,$ba,$40 + dc.b (9<<3)|1,11,$c8,$00 + dc.b (9<<3)|5,9,$d5,$c0 + dc.b (6<<3)|7,26,$3a,$c0 + dc.b (8<<3)|1,9,$8d,$40 + dc.b (5<<3)|7,15,$16,$80 + dc.b (7<<3)|1,6,$53,$c0 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|2,4,$98,$80,(4<<3)|2,3,$b6,$80 + dc.b (6<<3)|1,3,$19,$00,0 + even + +; 52 (20 passes, 656 height, 171 blits) + dc.b (5<<3)|3,52,$a0,$00 + dc.b (4<<3)|5,99,$24,$40 + dc.b (5<<3)|6,99,$24,$40 + dc.b (7<<3)|5,51,$5f,$00,(8<<3)|5,50,$9e,$c0,(3<<3)|5,43,$ab,$40 + dc.b (6<<3)|6,56,$5f,$00,(7<<3)|6,48,$a5,$00,(4<<3)|6,43,$ab,$40 + dc.b (6<<3)|5,25,$1f,$40 + dc.b (9<<3)|1,12,$ce,$40 + dc.b (6<<3)|7,26,$3e,$80 + dc.b (8<<3)|1,10,$92,$40,(7<<3)|1,6,$57,$80 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|2,5,$9e,$c0 + dc.b (5<<3)|7,11,$16,$80,(4<<3)|7,9,$a0,$00 + dc.b (9<<3)|5,3,$dd,$40 + dc.b (6<<3)|1,3,$1b,$80,0 + even + +; 53 (20 passes, 630 height, 169 blits) + dc.b (5<<3)|3,45,$82,$00 + dc.b (4<<3)|5,78,$20,$80,(7<<3)|5,52,$64,$00 + dc.b (5<<3)|6,76,$23,$00 + dc.b (3<<3)|5,48,$a5,$00,(8<<3)|5,48,$a5,$00 + dc.b (6<<3)|6,61,$64,$00,(4<<3)|6,48,$a5,$00 + dc.b (6<<3)|5,27,$23,$00 + dc.b (7<<3)|6,39,$b0,$40 + dc.b (4<<3)|7,28,$82,$00,(6<<3)|7,25,$44,$c0 + dc.b (8<<3)|1,10,$98,$80 + dc.b (7<<3)|2,9,$a5,$00 + dc.b (9<<3)|1,9,$d5,$c0,(7<<3)|1,7,$5b,$40 + dc.b (5<<3)|5,5,$11,$80 + dc.b (6<<3)|1,5,$1c,$c0 + dc.b (5<<3)|7,9,$17,$c0 + dc.b (5<<3)|1,1,$10,$40,0 + even + +; 54 (20 passes, 618 height, 169 blits) + dc.b (5<<3)|3,51,$60,$40 + dc.b (3<<3)|5,59,$97,$40,(4<<3)|5,58,$17,$c0,(7<<3)|5,52,$6a,$40,(8<<3)|5,43,$ab,$40 + dc.b (6<<3)|6,63,$6a,$40,(4<<3)|6,59,$97,$40 + dc.b (6<<3)|5,30,$28,$00 + dc.b (5<<3)|6,45,$28,$00,(7<<3)|6,32,$b9,$00 + dc.b (4<<3)|7,44,$60,$40 + dc.b (7<<3)|2,11,$ab,$40 + dc.b (8<<3)|1,10,$9e,$c0 + dc.b (6<<3)|7,23,$4d,$80 + dc.b (7<<3)|1,9,$5f,$00,(6<<3)|1,7,$1f,$40 + dc.b (5<<3)|5,5,$11,$80 + dc.b (5<<3)|7,13,$17,$c0 + dc.b (9<<3)|1,3,$dd,$40,(5<<3)|1,1,$10,$40,0 + even + +; 55 (18 passes, 598 height, 157 blits) + dc.b (5<<3)|3,37,$53,$c0 + dc.b (3<<3)|5,66,$8e,$80,(7<<3)|5,55,$6e,$00,(4<<3)|5,47,$14,$00 + dc.b (6<<3)|6,70,$6e,$00,(4<<3)|6,66,$8e,$80 + dc.b (8<<3)|5,37,$b2,$c0,(6<<3)|5,33,$2a,$80 + dc.b (5<<3)|6,33,$2a,$80 + dc.b (4<<3)|7,51,$4e,$c0 + dc.b (7<<3)|6,22,$c5,$80 + dc.b (7<<3)|2,15,$b2,$c0 + dc.b (8<<3)|1,11,$a5,$00 + dc.b (6<<3)|7,21,$53,$c0 + dc.b (7<<3)|1,8,$64,$00 + dc.b (5<<3)|7,15,$17,$c0 + dc.b (6<<3)|1,6,$23,$00 + dc.b (5<<3)|5,5,$11,$80,0 + even + +; 56 (18 passes, 574 height, 157 blits) + dc.b (3<<3)|5,73,$85,$c0,(7<<3)|5,56,$74,$40 + dc.b (5<<3)|3,6,$58,$c0 + dc.b (4<<3)|6,73,$85,$c0,(6<<3)|6,73,$74,$40 + dc.b (4<<3)|5,38,$11,$80,(6<<3)|5,35,$2d,$00,(8<<3)|5,31,$ba,$40 + dc.b (5<<3)|6,35,$2d,$00 + dc.b (4<<3)|7,55,$41,$00 + dc.b (7<<3)|2,17,$ba,$40 + dc.b (8<<3)|1,12,$ab,$40 + dc.b (7<<3)|6,14,$cf,$80 + dc.b (6<<3)|7,22,$58,$c0 + dc.b (7<<3)|1,8,$6a,$40 + dc.b (5<<3)|7,17,$17,$c0 + dc.b (5<<3)|5,5,$11,$80 + dc.b (6<<3)|1,4,$28,$00,0 + even + +; 57 (17 passes, 575 height, 154 blits) + dc.b (3<<3)|5,80,$7d,$00,(7<<3)|5,58,$79,$40 + dc.b (4<<3)|6,80,$7d,$00,(6<<3)|6,78,$79,$40 + dc.b (6<<3)|5,37,$30,$c0,(4<<3)|5,29,$11,$80,(8<<3)|5,25,$c1,$c0 + dc.b (5<<3)|6,37,$30,$c0 + dc.b (4<<3)|7,57,$35,$c0 + dc.b (7<<3)|2,17,$c5,$80 + dc.b (8<<3)|1,12,$b2,$c0,(7<<3)|1,9,$6e,$00 + dc.b (6<<3)|7,21,$5f,$00,(5<<3)|7,20,$17,$c0 + dc.b (5<<3)|5,5,$11,$80 + dc.b (6<<3)|1,5,$2a,$80 + dc.b (7<<3)|6,5,$da,$c0,0 + even + +; 58 (16 passes, 576 height, 144 blits) + dc.b (3<<3)|5,86,$75,$80,(7<<3)|5,59,$7e,$40 + dc.b (4<<3)|6,86,$75,$80,(6<<3)|6,79,$7e,$40 + dc.b (6<<3)|5,41,$33,$40 + dc.b (5<<3)|6,41,$33,$40 + dc.b (4<<3)|5,21,$11,$80 + dc.b (4<<3)|7,59,$2b,$c0 + dc.b (8<<3)|5,20,$c8,$00 + dc.b (7<<3)|2,14,$cf,$80 + dc.b (8<<3)|1,11,$ba,$40 + dc.b (5<<3)|7,22,$17,$c0 + dc.b (7<<3)|1,8,$74,$40 + dc.b (6<<3)|7,19,$66,$80 + dc.b (5<<3)|5,5,$11,$80 + dc.b (6<<3)|1,5,$2d,$00,0 + even + +; 59 (18 passes, 583 height, 158 blits) + dc.b (3<<3)|5,82,$6e,$00,(7<<3)|5,61,$84,$80 + dc.b (4<<3)|6,92,$6e,$00,(6<<3)|6,74,$84,$80 + dc.b (6<<3)|5,44,$37,$00 + dc.b (5<<3)|6,44,$37,$00 + dc.b (4<<3)|7,60,$23,$00 + dc.b (4<<3)|5,14,$11,$80,(8<<3)|5,13,$d0,$c0 + dc.b (8<<3)|1,12,$c1,$c0 + dc.b (2<<3)|5,10,$d4,$80 + dc.b (3<<3)|2,10,$d4,$80 + dc.b (5<<3)|7,25,$17,$c0 + dc.b (7<<3)|1,9,$79,$40 + dc.b (6<<3)|7,18,$6e,$00 + dc.b (5<<3)|5,5,$11,$80 + dc.b (7<<3)|2,5,$da,$c0 + dc.b (6<<3)|1,5,$30,$c0,0 + even + +; 60 (17 passes, 598 height, 152 blits) + dc.b (3<<3)|5,81,$66,$80 + dc.b (4<<3)|6,98,$66,$80 + dc.b (7<<3)|5,63,$8c,$00,(6<<3)|5,49,$3d,$40 + dc.b (6<<3)|6,68,$8c,$00,(5<<3)|6,49,$3d,$40 + dc.b (4<<3)|7,63,$17,$c0 + dc.b (2<<3)|5,17,$cb,$c0 + dc.b (3<<3)|2,17,$cb,$c0 + dc.b (8<<3)|1,15,$c8,$00 + dc.b (5<<3)|7,30,$17,$c0 + dc.b (7<<3)|1,11,$7e,$40,(6<<3)|1,8,$33,$40 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80,(8<<3)|5,5,$da,$c0 + dc.b (6<<3)|7,14,$7a,$80,0 + even + +; 61 (18 passes, 605 height, 157 blits) + dc.b (3<<3)|5,79,$60,$40 + dc.b (4<<3)|3,8,$d7,$00 + dc.b (7<<3)|5,63,$92,$40 + dc.b (4<<3)|6,95,$60,$40 + dc.b (6<<3)|5,53,$41,$00 + dc.b (6<<3)|6,63,$92,$40,(5<<3)|6,53,$41,$00 + dc.b (2<<3)|5,24,$c3,$00 + dc.b (4<<3)|7,58,$17,$c0 + dc.b (3<<3)|2,14,$c3,$00 + dc.b (5<<3)|7,33,$17,$c0 + dc.b (8<<3)|1,13,$d0,$c0,(7<<3)|1,11,$84,$80,(6<<3)|1,8,$37,$00 + dc.b (3<<3)|6,8,$d7,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (6<<3)|7,12,$83,$40,0 + even + +; 62 (18 passes, 611 height, 157 blits) + dc.b (4<<3)|3,22,$c5,$80 + dc.b (3<<3)|5,76,$5a,$00,(6<<3)|5,60,$44,$c0,(7<<3)|5,58,$98,$80 + dc.b (4<<3)|6,86,$5a,$00,(5<<3)|6,60,$44,$c0,(6<<3)|6,58,$98,$80 + dc.b (2<<3)|5,32,$b9,$00 + dc.b (4<<3)|7,53,$17,$c0 + dc.b (3<<3)|6,22,$c5,$80 + dc.b (5<<3)|7,36,$17,$c0 + dc.b (3<<3)|2,10,$b9,$00 + dc.b (7<<3)|1,10,$8c,$00,(6<<3)|1,6,$3d,$40 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (8<<3)|1,5,$da,$c0 + dc.b (6<<3)|7,7,$8f,$c0,0 + even + +; 63 (17 passes, 611 height, 151 blits) + dc.b (4<<3)|3,26,$b6,$80 + dc.b (3<<3)|5,72,$55,$00,(6<<3)|5,65,$49,$c0,(7<<3)|5,52,$a0,$00 + dc.b (4<<3)|6,78,$55,$00,(5<<3)|6,65,$49,$c0 + dc.b (2<<3)|5,40,$af,$00 + dc.b (6<<3)|6,52,$a0,$00,(3<<3)|6,34,$b6,$80 + dc.b (4<<3)|7,49,$17,$c0,(5<<3)|7,40,$17,$c0 + dc.b (7<<3)|1,11,$92,$40,(6<<3)|1,7,$41,$00 + dc.b (3<<3)|2,6,$af,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (6<<3)|7,4,$9b,$00,0 + even + +; 64 (18 passes, 607 height, 149 blits) + dc.b (4<<3)|3,22,$aa,$00 + dc.b (6<<3)|5,71,$4e,$c0,(3<<3)|5,70,$51,$40 + dc.b (4<<3)|6,71,$51,$40,(5<<3)|6,71,$4e,$c0 + dc.b (7<<3)|5,46,$a7,$80,(2<<3)|5,45,$a8,$c0 + dc.b (6<<3)|6,46,$a7,$80,(3<<3)|6,44,$aa,$00 + dc.b (4<<3)|7,45,$19,$00,(5<<3)|7,43,$19,$00 + dc.b (7<<3)|1,12,$98,$80,(6<<3)|1,8,$44,$c0 + dc.b (4<<3)|5,5,$12,$c0,(5<<3)|5,5,$12,$c0 + dc.b (3<<3)|2,1,$a8,$c0 + dc.b (4<<3)|1,1,$11,$80,(5<<3)|1,1,$11,$80,0 + even + +; 65 (17 passes, 612 height, 151 blits) + dc.b (4<<3)|3,25,$97,$40 + dc.b (6<<3)|5,74,$55,$00,(3<<3)|5,63,$48,$80,(2<<3)|5,53,$9e,$c0 + dc.b (5<<3)|6,78,$55,$00,(4<<3)|6,63,$48,$80 + dc.b (7<<3)|5,38,$b1,$80 + dc.b (3<<3)|6,53,$9e,$c0,(6<<3)|6,34,$b6,$80 + dc.b (5<<3)|7,49,$17,$c0,(4<<3)|7,39,$17,$c0 + dc.b (7<<3)|1,14,$a0,$00,(6<<3)|1,9,$49,$c0 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (6<<3)|2,4,$b1,$80 + dc.b (3<<3)|7,6,$97,$40,0 + even + +; 66 (17 passes, 612 height, 151 blits) + dc.b (4<<3)|3,23,$8d,$40 + dc.b (6<<3)|5,77,$5b,$40,(2<<3)|5,58,$98,$80,(3<<3)|5,58,$44,$c0 + dc.b (5<<3)|6,85,$5b,$40,(3<<3)|6,58,$98,$80,(4<<3)|6,58,$44,$c0 + dc.b (7<<3)|5,30,$bb,$80 + dc.b (5<<3)|7,54,$17,$c0 + dc.b (6<<3)|6,22,$c5,$80 + dc.b (7<<3)|1,16,$a7,$80 + dc.b (4<<3)|7,36,$17,$c0 + dc.b (6<<3)|1,10,$4e,$c0 + dc.b (6<<3)|2,8,$bb,$80 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (3<<3)|7,9,$8d,$40,0 + even + +; 67 (17 passes, 612 height, 151 blits) + dc.b (4<<3)|3,16,$83,$40 + dc.b (6<<3)|5,79,$60,$40 + dc.b (5<<3)|6,100,$60,$40 + dc.b (2<<3)|5,64,$91,$00,(3<<3)|5,53,$41,$00 + dc.b (3<<3)|6,64,$91,$00,(4<<3)|6,53,$41,$00 + dc.b (7<<3)|5,24,$c3,$00 + dc.b (5<<3)|7,58,$17,$c0 + dc.b (6<<3)|2,21,$c3,$00 + dc.b (7<<3)|1,14,$b1,$80 + dc.b (4<<3)|7,33,$17,$c0 + dc.b (6<<3)|1,9,$55,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (3<<3)|7,11,$83,$40 + dc.b (6<<3)|6,3,$dd,$40,0 + even + +; 68 (18 passes, 610 height, 155 blits) + dc.b (4<<3)|3,15,$7a,$80 + dc.b (6<<3)|5,81,$66,$80 + dc.b (5<<3)|6,98,$66,$80 + dc.b (2<<3)|5,62,$8a,$c0,(3<<3)|5,50,$3c,$00 + dc.b (3<<3)|6,69,$8a,$c0,(4<<3)|6,50,$3c,$00 + dc.b (5<<3)|7,63,$17,$c0 + dc.b (7<<3)|5,17,$cb,$c0 + dc.b (6<<3)|2,17,$cb,$c0 + dc.b (7<<3)|1,13,$bb,$80 + dc.b (4<<3)|7,29,$17,$c0 + dc.b (6<<3)|1,9,$5b,$40 + dc.b (1<<3)|5,7,$d8,$40 + dc.b (2<<3)|2,7,$d8,$40 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (3<<3)|7,13,$7a,$80,0 + even + +; 69 (18 passes, 606 height, 155 blits) + dc.b (4<<3)|3,17,$6e,$00 + dc.b (6<<3)|5,84,$6f,$40,(2<<3)|5,60,$83,$40 + dc.b (5<<3)|6,91,$6f,$40,(3<<3)|6,75,$83,$40 + dc.b (3<<3)|5,44,$37,$00 + dc.b (4<<3)|6,44,$37,$00 + dc.b (5<<3)|7,61,$23,$00 + dc.b (1<<3)|5,15,$ce,$40 + dc.b (7<<3)|1,17,$c3,$00 + dc.b (5<<3)|5,14,$11,$80 + dc.b (2<<3)|2,15,$ce,$40 + dc.b (6<<3)|1,12,$60,$40 + dc.b (4<<3)|7,25,$17,$c0 + dc.b (7<<3)|5,7,$d8,$40 + dc.b (3<<3)|7,17,$6e,$00 + dc.b (4<<3)|5,5,$11,$80 + dc.b (6<<3)|2,3,$dd,$40,0 + even + +; 70 (16 passes, 596 height, 141 blits) + dc.b (4<<3)|3,16,$66,$80 + dc.b (6<<3)|5,84,$78,$00,(2<<3)|5,59,$7e,$40 + dc.b (5<<3)|6,84,$78,$00,(3<<3)|6,79,$7e,$40 + dc.b (3<<3)|5,41,$33,$40 + dc.b (4<<3)|6,41,$33,$40 + dc.b (5<<3)|5,21,$11,$80 + dc.b (5<<3)|7,61,$2b,$c0 + dc.b (1<<3)|5,20,$c8,$00 + dc.b (7<<3)|1,17,$cb,$c0 + dc.b (2<<3)|2,13,$c8,$00 + dc.b (6<<3)|1,14,$66,$80 + dc.b (4<<3)|7,22,$17,$c0,(3<<3)|7,19,$66,$80 + dc.b (4<<3)|5,5,$11,$80,0 + even + +; 71 (18 passes, 580 height, 154 blits) + dc.b (4<<3)|3,12,$5f,$00 + dc.b (6<<3)|5,79,$7e,$40,(2<<3)|5,57,$78,$00 + dc.b (3<<3)|6,79,$78,$00,(5<<3)|6,79,$7e,$40 + dc.b (3<<3)|3,5,$da,$c0 + dc.b (3<<3)|5,37,$30,$c0,(5<<3)|5,29,$11,$80,(1<<3)|5,27,$bf,$40 + dc.b (4<<3)|6,37,$30,$c0 + dc.b (5<<3)|7,58,$35,$c0 + dc.b (2<<3)|2,12,$bf,$40 + dc.b (6<<3)|1,12,$6f,$40 + dc.b (3<<3)|7,20,$5f,$00,(4<<3)|7,20,$17,$c0 + dc.b (7<<3)|1,7,$d8,$40 + dc.b (4<<3)|5,5,$11,$80 + dc.b (2<<3)|6,5,$da,$c0,0 + even + +; 72 (14 passes, 654 height, 116 blits) + dc.b (5<<3)|5,133,$3a,$c0,(3<<3)|5,89,$52,$80 + dc.b (4<<3)|6,114,$52,$80 + dc.b (6<<3)|1,84,$78,$00,(2<<3)|1,55,$7e,$40,(5<<3)|1,33,$11,$80 + dc.b (2<<3)|5,24,$c3,$00 + dc.b (3<<3)|1,25,$33,$40,(1<<3)|1,20,$c8,$00 + dc.b (4<<3)|7,47,$17,$c0 + dc.b (3<<3)|6,24,$c3,$00 + dc.b (4<<3)|5,3,$14,$00 + dc.b (4<<3)|1,2,$11,$80 + dc.b (3<<3)|7,1,$c1,$c0,0 + even + +; 73 (8 passes, 663 height, 52 blits) + dc.b (4<<3)|5,161,$17,$c0 + dc.b (5<<3)|1,166,$11,$80,(3<<3)|1,103,$30,$c0,(2<<3)|1,84,$78,$00,(6<<3)|1,79,$7e,$40 + dc.b (3<<3)|5,38,$b1,$80 + dc.b (1<<3)|1,27,$bf,$40,(4<<3)|1,5,$11,$80,0 + even + +; 74 (4 passes, 435 height, 24 blits) + dc.b (4<<3)|1,164,$14,$00,(5<<3)|1,133,$3a,$c0,(3<<3)|1,114,$52,$80,(2<<3)|1,24,$c3,$00,0 + even + +; 75 (2 passes, 199 height, 12 blits) + dc.b (4<<3)|1,161,$17,$c0,(3<<3)|1,38,$b1,$80,0 + even + +; 76 (0 passes, 0 height, 0 blits) + dc.b 0 + even + +; 77 (17 passes, 676 height, 142 blits) + dc.b (3<<3)|3,55,$9c,$40,(4<<3)|3,31,$ba,$40 + dc.b (5<<3)|5,116,$29,$40 + dc.b (4<<3)|6,116,$29,$40 + dc.b (1<<3)|5,49,$98,$80,(2<<3)|5,49,$5b,$40 + dc.b (2<<3)|6,55,$9c,$40,(3<<3)|6,52,$5b,$40 + dc.b (6<<3)|5,31,$ba,$40,(3<<3)|5,24,$1c,$c0 + dc.b (5<<3)|6,31,$ba,$40 + dc.b (0<<3)|5,9,$d5,$c0 + dc.b (3<<3)|7,26,$3a,$c0 + dc.b (1<<3)|2,9,$d5,$c0 + dc.b (4<<3)|7,15,$16,$80 + dc.b (4<<3)|5,5,$10,$40 + dc.b (2<<3)|2,3,$98,$80,0 + even + +; 78 (16 passes, 676 height, 135 blits) + dc.b (3<<3)|3,61,$94,$c0 + dc.b (5<<3)|5,121,$2f,$80 + dc.b (4<<3)|6,142,$2f,$80 + dc.b (1<<3)|5,48,$92,$40,(2<<3)|5,47,$57,$80 + dc.b (2<<3)|6,61,$94,$c0,(3<<3)|6,49,$57,$80 + dc.b (3<<3)|5,21,$1b,$80,(6<<3)|5,21,$c6,$c0 + dc.b (5<<3)|2,21,$c6,$c0 + dc.b (0<<3)|5,15,$ce,$40 + dc.b (1<<3)|2,15,$ce,$40 + dc.b (3<<3)|7,27,$35,$c0,(4<<3)|7,20,$16,$80 + dc.b (4<<3)|5,5,$10,$40 + dc.b (2<<3)|2,2,$92,$40,0 + even + +; 79 (18 passes, 641 height, 147 blits) + dc.b (5<<3)|5,127,$35,$c0 + dc.b (4<<3)|6,137,$35,$c0 + dc.b (3<<3)|3,11,$8e,$80 + dc.b (1<<3)|5,47,$8d,$40,(2<<3)|5,46,$53,$c0 + dc.b (2<<3)|6,66,$8e,$80,(3<<3)|6,47,$53,$c0 + dc.b (0<<3)|5,20,$c8,$00,(3<<3)|5,20,$19,$00 + dc.b (6<<3)|1,21,$ba,$40 + dc.b (1<<3)|2,11,$c8,$00 + dc.b (6<<3)|5,10,$d4,$80 + dc.b (5<<3)|2,10,$d4,$80 + dc.b (3<<3)|7,27,$32,$00,(4<<3)|7,25,$16,$80 + dc.b (5<<3)|1,10,$29,$40 + dc.b (4<<3)|5,5,$10,$40 + dc.b (2<<3)|2,1,$8d,$40,0 + even + +; 80 (18 passes, 627 height, 154 blits) + dc.b (5<<3)|5,131,$3d,$40 + dc.b (3<<3)|3,11,$87,$00 + dc.b (4<<3)|6,131,$3d,$40 + dc.b (1<<3)|5,46,$89,$80 + dc.b (2<<3)|6,68,$89,$80 + dc.b (2<<3)|5,44,$50,$00 + dc.b (3<<3)|6,44,$50,$00 + dc.b (0<<3)|5,24,$c3,$00,(3<<3)|5,18,$17,$c0 + dc.b (6<<3)|1,21,$c6,$c0 + dc.b (2<<3)|3,2,$de,$80 + dc.b (4<<3)|7,31,$16,$80 + dc.b (5<<3)|1,11,$2f,$80 + dc.b (3<<3)|7,27,$2e,$40 + dc.b (1<<3)|2,9,$c3,$00 + dc.b (4<<3)|5,5,$10,$40 + dc.b (1<<3)|6,2,$de,$80 + dc.b (2<<3)|7,2,$87,$00,0 + even + +; 81 (18 passes, 620 height, 154 blits) + dc.b (5<<3)|5,125,$44,$c0 + dc.b (3<<3)|3,11,$80,$c0 + dc.b (4<<3)|6,125,$44,$c0 + dc.b (2<<3)|3,8,$d7,$00 + dc.b (1<<3)|5,45,$84,$80 + dc.b (2<<3)|6,66,$84,$80 + dc.b (2<<3)|5,41,$4d,$80,(0<<3)|5,29,$bc,$c0 + dc.b (3<<3)|6,41,$4d,$80 + dc.b (3<<3)|5,18,$15,$40 + dc.b (4<<3)|7,37,$16,$80 + dc.b (5<<3)|1,12,$35,$c0 + dc.b (3<<3)|7,27,$2b,$c0 + dc.b (6<<3)|1,10,$d4,$80 + dc.b (1<<3)|2,9,$bc,$c0 + dc.b (1<<3)|6,8,$d7,$00 + dc.b (4<<3)|5,5,$10,$40 + dc.b (2<<3)|7,3,$80,$c0,0 + even + +; 82 (17 passes, 614 height, 148 blits) + dc.b (5<<3)|5,119,$4c,$40 + dc.b (2<<3)|3,12,$cf,$80,(3<<3)|3,10,$7a,$80 + dc.b (4<<3)|6,119,$4c,$40 + dc.b (1<<3)|5,44,$7f,$80 + dc.b (2<<3)|6,64,$7f,$80 + dc.b (2<<3)|5,40,$48,$80,(0<<3)|5,34,$b6,$80 + dc.b (3<<3)|6,40,$48,$80 + dc.b (3<<3)|5,16,$12,$c0 + dc.b (4<<3)|7,44,$15,$40 + dc.b (5<<3)|1,12,$3d,$40 + dc.b (1<<3)|2,10,$b6,$80 + dc.b (1<<3)|6,14,$cf,$80 + dc.b (3<<3)|7,27,$26,$c0 + dc.b (4<<3)|5,5,$0f,$00 + dc.b (2<<3)|7,4,$7a,$80,0 + even + +; 83 (17 passes, 612 height, 148 blits) + dc.b (5<<3)|5,111,$56,$40 + dc.b (2<<3)|3,12,$c8,$00,(3<<3)|3,9,$75,$80 + dc.b (4<<3)|6,111,$56,$40 + dc.b (1<<3)|5,42,$7a,$80 + dc.b (2<<3)|6,62,$7a,$80 + dc.b (0<<3)|5,40,$af,$00,(2<<3)|5,38,$46,$00 + dc.b (3<<3)|6,38,$46,$00 + dc.b (4<<3)|7,52,$15,$40 + dc.b (3<<3)|5,16,$10,$40 + dc.b (1<<3)|6,20,$c8,$00 + dc.b (5<<3)|1,14,$44,$c0 + dc.b (1<<3)|2,11,$af,$00 + dc.b (3<<3)|7,27,$24,$40 + dc.b (4<<3)|5,5,$0f,$00 + dc.b (2<<3)|7,4,$75,$80,0 + even + +; 84 (18 passes, 607 height, 154 blits) + dc.b (2<<3)|3,13,$bf,$40 + dc.b (5<<3)|5,102,$61,$80 + dc.b (4<<3)|6,102,$61,$80 + dc.b (3<<3)|3,8,$70,$80 + dc.b (1<<3)|5,42,$76,$c0,(0<<3)|5,41,$ab,$40 + dc.b (2<<3)|6,58,$76,$c0 + dc.b (2<<3)|5,37,$42,$40 + dc.b (3<<3)|6,37,$42,$40 + dc.b (4<<3)|7,61,$15,$40 + dc.b (1<<3)|6,27,$bf,$40 + dc.b (5<<3)|1,17,$4c,$40 + dc.b (3<<3)|5,14,$0f,$00 + dc.b (3<<3)|7,27,$20,$80 + dc.b (1<<3)|2,9,$ab,$40 + dc.b (4<<3)|5,5,$0f,$00 + dc.b (0<<3)|2,2,$de,$80 + dc.b (2<<3)|7,5,$70,$80,0 + even + +; 85 (18 passes, 598 height, 154 blits) + dc.b (2<<3)|3,12,$b9,$00 + dc.b (5<<3)|5,95,$6a,$40 + dc.b (3<<3)|3,8,$6b,$80 + dc.b (4<<3)|6,95,$6a,$40 + dc.b (0<<3)|5,41,$a5,$00,(1<<3)|5,40,$73,$00 + dc.b (2<<3)|6,56,$73,$00 + dc.b (2<<3)|5,35,$3f,$c0 + dc.b (4<<3)|7,68,$15,$40 + dc.b (3<<3)|6,35,$3f,$c0,(1<<3)|6,32,$b9,$00 + dc.b (5<<3)|1,16,$56,$40 + dc.b (3<<3)|5,12,$0f,$00 + dc.b (3<<3)|7,27,$1e,$00 + dc.b (1<<3)|2,8,$a5,$00,(0<<3)|2,7,$d8,$40 + dc.b (4<<3)|5,5,$0f,$00 + dc.b (2<<3)|7,6,$6b,$80,0 + even + +; 86 (18 passes, 591 height, 154 blits) + dc.b (5<<3)|5,85,$76,$c0 + dc.b (2<<3)|3,10,$b2,$c0,(3<<3)|3,8,$66,$80 + dc.b (4<<3)|6,85,$76,$c0 + dc.b (0<<3)|5,40,$a0,$00,(1<<3)|5,40,$6e,$00 + dc.b (2<<3)|6,55,$6e,$00 + dc.b (2<<3)|5,34,$3c,$00 + dc.b (4<<3)|7,79,$14,$00 + dc.b (1<<3)|6,37,$b2,$c0,(3<<3)|6,34,$3c,$00 + dc.b (5<<3)|1,17,$61,$80 + dc.b (3<<3)|5,10,$0d,$c0 + dc.b (0<<3)|2,10,$d2,$00 + dc.b (3<<3)|7,27,$1a,$40 + dc.b (1<<3)|2,9,$a0,$00 + dc.b (4<<3)|5,5,$0d,$c0 + dc.b (2<<3)|7,6,$66,$80,0 + even + +; 87 (18 passes, 579 height, 154 blits) + dc.b (2<<3)|3,10,$ac,$80 + dc.b (5<<3)|5,72,$87,$00 + dc.b (3<<3)|3,7,$62,$c0 + dc.b (4<<3)|6,72,$87,$00 + dc.b (0<<3)|5,39,$9b,$00,(1<<3)|5,39,$6a,$40 + dc.b (2<<3)|6,53,$6a,$40 + dc.b (2<<3)|5,33,$39,$80 + dc.b (4<<3)|7,92,$14,$00 + dc.b (1<<3)|6,42,$ac,$80,(3<<3)|6,33,$39,$80 + dc.b (5<<3)|1,23,$6a,$40 + dc.b (0<<3)|2,10,$cb,$c0 + dc.b (3<<3)|7,27,$17,$c0 + dc.b (3<<3)|5,8,$0d,$c0 + dc.b (1<<3)|2,8,$9b,$00 + dc.b (4<<3)|5,5,$0d,$c0 + dc.b (2<<3)|7,6,$62,$c0,0 + even + +; 88 (18 passes, 563 height, 154 blits) + dc.b (2<<3)|3,10,$a6,$40 + dc.b (5<<3)|5,62,$93,$80 + dc.b (3<<3)|3,7,$5d,$c0 + dc.b (4<<3)|6,62,$93,$80 + dc.b (0<<3)|5,38,$97,$40,(1<<3)|5,38,$67,$c0 + dc.b (4<<3)|7,102,$14,$00 + dc.b (2<<3)|6,50,$67,$c0 + dc.b (2<<3)|5,31,$37,$00 + dc.b (1<<3)|6,47,$a6,$40,(3<<3)|6,31,$37,$00 + dc.b (5<<3)|1,23,$76,$c0 + dc.b (3<<3)|7,27,$15,$40 + dc.b (0<<3)|2,9,$c6,$c0,(1<<3)|2,7,$97,$40 + dc.b (3<<3)|5,6,$0d,$c0,(4<<3)|5,5,$0d,$c0 + dc.b (2<<3)|7,8,$5d,$c0,0 + even + +; 89 (20 passes, 553 height, 170 blits) + dc.b (2<<3)|3,9,$a1,$40,(3<<3)|3,7,$5a,$00 + dc.b (5<<3)|5,46,$a7,$80 + dc.b (4<<3)|7,118,$14,$00 + dc.b (1<<3)|5,38,$64,$00,(0<<3)|5,37,$93,$80 + dc.b (1<<3)|6,51,$a1,$40,(2<<3)|6,49,$64,$00 + dc.b (2<<3)|5,29,$35,$c0 + dc.b (4<<3)|6,37,$a7,$80 + dc.b (5<<3)|1,26,$87,$00 + dc.b (3<<3)|6,29,$35,$c0 + dc.b (3<<3)|7,27,$14,$00 + dc.b (4<<3)|2,9,$d5,$c0,(0<<3)|2,8,$c1,$c0 + dc.b (3<<3)|6,9,$d5,$c0 + dc.b (1<<3)|2,6,$93,$80 + dc.b (3<<3)|5,5,$0d,$c0,(4<<3)|5,5,$0d,$c0 + dc.b (2<<3)|7,8,$5a,$00,0 + even + +; 90 (22 passes, 575 height, 181 blits) + dc.b (2<<3)|3,10,$99,$c0,(3<<3)|3,7,$55,$00 + dc.b (4<<3)|7,127,$12,$c0 + dc.b (0<<3)|5,37,$8e,$80,(1<<3)|5,37,$60,$40 + dc.b (1<<3)|6,56,$99,$c0,(2<<3)|6,46,$60,$40 + dc.b (5<<3)|1,35,$93,$80 + dc.b (2<<3)|5,28,$32,$00,(5<<3)|5,27,$bf,$40 + dc.b (4<<3)|2,27,$bf,$40 + dc.b (3<<3)|6,38,$b1,$80,(3<<3)|6,28,$32,$00 + dc.b (4<<3)|5,11,$b1,$80 + dc.b (3<<3)|7,25,$12,$c0 + dc.b (1<<3)|3,1,$df,$c0 + dc.b (0<<3)|2,8,$bc,$c0,(1<<3)|2,7,$8e,$80 + dc.b (3<<3)|5,5,$0c,$80,(4<<3)|5,5,$0c,$80 + dc.b (2<<3)|7,9,$55,$00 + dc.b (0<<3)|6,1,$df,$c0,0 + even + +; 91 (22 passes, 584 height, 181 blits) + dc.b (2<<3)|3,10,$94,$c0 + dc.b (4<<3)|5,57,$89,$80 + dc.b (3<<3)|3,7,$51,$40,(1<<3)|3,6,$d9,$80 + dc.b (3<<3)|6,70,$89,$80,(1<<3)|6,55,$94,$c0 + dc.b (0<<3)|5,36,$8a,$c0,(1<<3)|5,36,$5d,$c0 + dc.b (4<<3)|7,95,$12,$c0 + dc.b (2<<3)|6,44,$5d,$c0 + dc.b (5<<3)|1,33,$a7,$80 + dc.b (2<<3)|5,27,$2f,$80 + dc.b (3<<3)|6,27,$2f,$80 + dc.b (5<<3)|5,13,$d0,$c0 + dc.b (3<<3)|7,23,$12,$c0 + dc.b (0<<3)|2,8,$b7,$c0,(1<<3)|2,7,$8a,$c0 + dc.b (3<<3)|5,5,$0c,$80,(4<<3)|5,5,$0c,$80 + dc.b (0<<3)|6,6,$d9,$80 + dc.b (4<<3)|2,4,$d0,$c0 + dc.b (2<<3)|7,10,$51,$40,0 + even + +; 92 (20 passes, 593 height, 167 blits) + dc.b (4<<3)|5,93,$6c,$c0 + dc.b (1<<3)|3,10,$d3,$40 + dc.b (3<<3)|6,93,$6c,$c0 + dc.b (2<<3)|3,7,$91,$00,(3<<3)|3,5,$4e,$c0 + dc.b (1<<3)|5,36,$5a,$00,(0<<3)|5,35,$87,$00 + dc.b (1<<3)|6,53,$91,$00,(2<<3)|6,44,$5a,$00 + dc.b (2<<3)|5,26,$2e,$40 + dc.b (4<<3)|7,72,$12,$c0 + dc.b (5<<3)|1,27,$bf,$40 + dc.b (3<<3)|6,26,$2e,$40 + dc.b (3<<3)|7,22,$12,$c0 + dc.b (0<<3)|2,8,$b2,$c0 + dc.b (0<<3)|6,11,$d3,$40 + dc.b (1<<3)|2,6,$87,$00 + dc.b (3<<3)|5,5,$0c,$80,(4<<3)|5,5,$0c,$80 + dc.b (2<<3)|7,9,$4e,$c0,0 + even + +; 93 (20 passes, 597 height, 167 blits) + dc.b (4<<3)|5,109,$58,$c0 + dc.b (1<<3)|3,10,$cd,$00 + dc.b (3<<3)|6,109,$58,$c0 + dc.b (2<<3)|3,7,$8c,$00,(3<<3)|3,6,$49,$c0 + dc.b (0<<3)|5,35,$82,$00,(1<<3)|5,35,$56,$40 + dc.b (1<<3)|6,52,$8c,$00,(2<<3)|6,43,$56,$40 + dc.b (2<<3)|5,25,$2a,$80 + dc.b (4<<3)|7,57,$11,$80 + dc.b (3<<3)|6,25,$2a,$80 + dc.b (5<<3)|1,13,$d0,$c0 + dc.b (0<<3)|6,16,$cd,$00 + dc.b (0<<3)|2,8,$ad,$c0 + dc.b (3<<3)|7,20,$11,$80 + dc.b (1<<3)|2,7,$82,$00 + dc.b (3<<3)|5,5,$0b,$40,(4<<3)|5,5,$0b,$40 + dc.b (2<<3)|7,10,$49,$c0,0 + even + +; 94 (19 passes, 592 height, 161 blits) + dc.b (4<<3)|5,122,$48,$80 + dc.b (1<<3)|3,11,$c5,$80 + dc.b (3<<3)|6,122,$48,$80 + dc.b (2<<3)|3,9,$85,$c0 + dc.b (0<<3)|5,34,$7e,$40,(1<<3)|5,34,$53,$c0 + dc.b (1<<3)|6,51,$85,$c0,(2<<3)|6,40,$53,$c0 + dc.b (2<<3)|5,25,$28,$00 + dc.b (3<<3)|6,25,$28,$00 + dc.b (4<<3)|7,44,$11,$80 + dc.b (0<<3)|6,22,$c5,$80 + dc.b (3<<3)|3,1,$47,$40 + dc.b (0<<3)|2,8,$a8,$c0 + dc.b (3<<3)|7,18,$11,$80 + dc.b (1<<3)|2,6,$7e,$40 + dc.b (3<<3)|5,5,$0b,$40,(4<<3)|5,5,$0b,$40 + dc.b (2<<3)|7,10,$47,$40,0 + even + +; 95 (17 passes, 589 height, 148 blits) + dc.b (4<<3)|5,135,$38,$40 + dc.b (3<<3)|6,149,$26,$c0 + dc.b (1<<3)|3,10,$c0,$80,(2<<3)|3,8,$82,$00 + dc.b (0<<3)|5,34,$7a,$80,(1<<3)|5,33,$51,$40 + dc.b (1<<3)|6,50,$82,$00,(2<<3)|6,39,$51,$40 + dc.b (2<<3)|5,23,$26,$c0 + dc.b (0<<3)|6,26,$c0,$80 + dc.b (4<<3)|7,31,$11,$80 + dc.b (0<<3)|2,7,$a5,$00 + dc.b (3<<3)|7,17,$11,$80 + dc.b (1<<3)|2,6,$7a,$80 + dc.b (3<<3)|5,5,$0b,$40,(4<<3)|5,5,$0b,$40 + dc.b (2<<3)|7,11,$43,$80,0 + even + +; 96 (17 passes, 583 height, 148 blits) + dc.b (4<<3)|5,145,$2b,$c0 + dc.b (3<<3)|6,150,$25,$80 + dc.b (1<<3)|3,8,$bb,$80,(2<<3)|3,6,$7e,$40 + dc.b (0<<3)|5,33,$78,$00,(1<<3)|5,33,$4e,$c0 + dc.b (1<<3)|6,49,$7e,$40,(2<<3)|6,38,$4e,$c0 + dc.b (2<<3)|5,22,$25,$80 + dc.b (0<<3)|6,30,$bb,$80 + dc.b (4<<3)|7,21,$11,$80 + dc.b (0<<3)|2,6,$a1,$40 + dc.b (3<<3)|7,16,$11,$80 + dc.b (3<<3)|5,5,$0b,$40,(4<<3)|5,5,$0b,$40 + dc.b (1<<3)|2,5,$78,$00 + dc.b (2<<3)|7,11,$41,$00,0 + even + +; 97 (17 passes, 586 height, 148 blits) + dc.b (4<<3)|5,148,$28,$00 + dc.b (3<<3)|6,152,$23,$00 + dc.b (1<<3)|3,8,$b6,$80,(2<<3)|3,6,$7a,$80 + dc.b (0<<3)|5,33,$74,$40,(1<<3)|5,32,$4c,$40 + dc.b (1<<3)|6,48,$7a,$80,(2<<3)|6,37,$4c,$40,(0<<3)|6,34,$b6,$80 + dc.b (2<<3)|5,22,$23,$00 + dc.b (4<<3)|7,19,$10,$40 + dc.b (0<<3)|2,6,$9d,$80 + dc.b (3<<3)|7,15,$10,$40 + dc.b (3<<3)|5,5,$0a,$00,(4<<3)|5,5,$0a,$00 + dc.b (1<<3)|2,5,$74,$40 + dc.b (2<<3)|7,11,$3e,$80,0 + even + +; 98 (17 passes, 584 height, 148 blits) + dc.b (4<<3)|5,156,$1e,$00 + dc.b (3<<3)|6,153,$21,$c0 + dc.b (1<<3)|3,7,$b2,$c0,(2<<3)|3,5,$78,$00 + dc.b (0<<3)|5,32,$71,$c0,(1<<3)|5,32,$49,$c0 + dc.b (1<<3)|6,47,$78,$00,(0<<3)|6,37,$b2,$c0,(2<<3)|6,37,$49,$c0 + dc.b (2<<3)|5,21,$21,$c0 + dc.b (0<<3)|2,6,$99,$c0 + dc.b (3<<3)|5,5,$0a,$00,(4<<3)|5,5,$0a,$00 + dc.b (3<<3)|7,14,$10,$40 + dc.b (1<<3)|2,5,$71,$c0 + dc.b (2<<3)|7,11,$3c,$00,(4<<3)|7,11,$10,$40,0 + even + +; 99 (17 passes, 582 height, 148 blits) + dc.b (4<<3)|5,163,$15,$40 + dc.b (3<<3)|6,154,$20,$80 + dc.b (1<<3)|3,8,$ac,$80,(2<<3)|3,6,$73,$00 + dc.b (0<<3)|5,32,$70,$80,(1<<3)|5,32,$48,$80 + dc.b (1<<3)|6,46,$73,$00,(0<<3)|6,42,$ac,$80,(2<<3)|6,34,$48,$80 + dc.b (2<<3)|5,20,$20,$80,(3<<3)|5,5,$0a,$00,(4<<3)|5,5,$0a,$00 + dc.b (3<<3)|7,13,$10,$40,(2<<3)|7,12,$39,$80 + dc.b (0<<3)|2,4,$98,$80,(1<<3)|2,2,$70,$80 + dc.b (4<<3)|7,4,$10,$40,0 + even + +; 100 (15 passes, 585 height, 126 blits) + dc.b (4<<3)|5,173,$08,$c0 + dc.b (3<<3)|6,156,$1e,$00 + dc.b (1<<3)|3,8,$a8,$c0,(2<<3)|3,7,$6f,$40 + dc.b (0<<3)|5,32,$6e,$00,(1<<3)|5,32,$46,$00 + dc.b (1<<3)|6,46,$6f,$40,(0<<3)|6,45,$a8,$c0,(2<<3)|6,33,$46,$00 + dc.b (2<<3)|5,19,$1e,$00,(3<<3)|5,5,$08,$c0 + dc.b (2<<3)|7,13,$35,$c0,(3<<3)|7,12,$0f,$00 + dc.b (0<<3)|2,3,$96,$00,(1<<3)|2,1,$6e,$00,0 + even + +; 101 (15 passes, 577 height, 123 blits) + dc.b (4<<3)|5,173,$08,$c0 + dc.b (3<<3)|6,156,$1e,$00 + dc.b (1<<3)|3,5,$a6,$40,(2<<3)|3,4,$6e,$00 + dc.b (0<<3)|5,32,$6e,$00,(1<<3)|5,32,$46,$00 + dc.b (0<<3)|6,45,$a6,$40,(1<<3)|6,45,$6e,$00,(2<<3)|6,32,$46,$00 + dc.b (2<<3)|5,19,$1e,$00 + dc.b (0<<3)|3,2,$de,$80 + dc.b (3<<3)|5,5,$08,$c0 + dc.b (2<<3)|7,13,$35,$c0,(3<<3)|7,12,$0f,$00 + dc.b (0<<3)|2,2,$96,$00,0 + even + +; 102 (16 passes, 575 height, 137 blits) + dc.b (4<<3)|5,173,$08,$c0 + dc.b (3<<3)|6,157,$1c,$c0 + dc.b (0<<3)|3,6,$d9,$80,(1<<3)|3,5,$a2,$80,(2<<3)|3,4,$6a,$40 + dc.b (0<<3)|5,32,$6c,$c0,(1<<3)|5,30,$44,$c0 + dc.b (0<<3)|6,44,$a2,$80,(1<<3)|6,43,$6c,$c0,(2<<3)|6,30,$44,$c0 + dc.b (2<<3)|5,18,$1c,$c0,(3<<3)|5,5,$08,$c0 + dc.b (2<<3)|7,14,$33,$40,(3<<3)|7,11,$0f,$00 + dc.b (0<<3)|2,1,$94,$c0 + dc.b (1<<3)|7,2,$6a,$40,0 + even + +; 103 (18 passes, 580 height, 153 blits) + dc.b (4<<3)|5,173,$08,$c0 + dc.b (3<<3)|6,155,$1b,$80 + dc.b (0<<3)|3,8,$d4,$80,(1<<3)|3,7,$9d,$80,(2<<3)|3,5,$67,$c0 + dc.b (0<<3)|5,32,$6b,$80,(1<<3)|5,29,$43,$80 + dc.b (0<<3)|6,44,$9d,$80,(1<<3)|6,40,$6b,$80,(2<<3)|6,29,$43,$80 + dc.b (2<<3)|5,17,$1b,$80 + dc.b (2<<3)|7,15,$30,$c0 + dc.b (3<<3)|5,5,$08,$c0 + dc.b (3<<3)|7,10,$0f,$00 + dc.b (3<<3)|2,3,$dd,$40 + dc.b (2<<3)|6,3,$dd,$40 + dc.b (0<<3)|2,2,$93,$80 + dc.b (1<<3)|7,3,$67,$c0,0 + even + +; 104 (18 passes, 582 height, 153 blits) + dc.b (4<<3)|5,174,$07,$80 + dc.b (3<<3)|6,150,$1a,$40 + dc.b (0<<3)|3,7,$d0,$c0,(1<<3)|3,6,$9b,$00,(2<<3)|3,4,$65,$40 + dc.b (0<<3)|5,32,$6a,$40 + dc.b (0<<3)|6,43,$9b,$00 + dc.b (1<<3)|5,28,$42,$40 + dc.b (1<<3)|6,39,$6a,$40,(2<<3)|6,28,$42,$40 + dc.b (2<<3)|5,17,$1a,$40 + dc.b (3<<3)|2,9,$d5,$c0 + dc.b (2<<3)|6,9,$d5,$c0 + dc.b (2<<3)|7,15,$2f,$80 + dc.b (3<<3)|5,5,$07,$80 + dc.b (3<<3)|7,10,$0d,$c0 + dc.b (0<<3)|2,2,$92,$40 + dc.b (1<<3)|7,4,$65,$40,0 + even + +; 105 (18 passes, 584 height, 153 blits) + dc.b (4<<3)|5,174,$07,$80 + dc.b (3<<3)|6,141,$19,$00 + dc.b (0<<3)|3,7,$cb,$c0,(1<<3)|3,5,$97,$40,(2<<3)|3,5,$61,$80 + dc.b (0<<3)|5,32,$69,$00 + dc.b (0<<3)|6,42,$97,$40 + dc.b (1<<3)|5,26,$41,$00 + dc.b (1<<3)|6,37,$69,$00,(2<<3)|6,26,$41,$00 + dc.b (2<<3)|5,16,$19,$00 + dc.b (3<<3)|2,16,$c9,$40 + dc.b (2<<3)|6,19,$c9,$40 + dc.b (2<<3)|7,16,$2d,$00 + dc.b (3<<3)|5,5,$07,$80 + dc.b (3<<3)|7,9,$0d,$c0,(1<<3)|7,6,$61,$80 + dc.b (0<<3)|2,2,$91,$00,0 + even + +; 106 (18 passes, 576 height, 153 blits) + dc.b (4<<3)|5,174,$07,$80 + dc.b (3<<3)|6,137,$19,$00 + dc.b (0<<3)|3,6,$c9,$40,(1<<3)|3,5,$94,$c0 + dc.b (0<<3)|5,32,$69,$00 + dc.b (0<<3)|6,42,$94,$c0 + dc.b (1<<3)|5,26,$41,$00 + dc.b (2<<3)|3,3,$61,$80 + dc.b (1<<3)|6,35,$69,$00,(2<<3)|6,26,$41,$00 + dc.b (2<<3)|5,16,$19,$00 + dc.b (2<<3)|6,23,$c4,$40 + dc.b (3<<3)|2,14,$c4,$40 + dc.b (2<<3)|7,16,$2d,$00 + dc.b (3<<3)|5,5,$07,$80 + dc.b (3<<3)|7,9,$0d,$c0,(1<<3)|7,6,$61,$80 + dc.b (0<<3)|2,1,$91,$00,0 + even + +; 107 (20 passes, 592 height, 175 blits) + dc.b (4<<3)|5,87,$07,$80 + dc.b (4<<3)|1,87,$74,$40 + dc.b (3<<3)|6,74,$17,$c0 + dc.b (3<<3)|5,37,$b2,$c0 + dc.b (0<<3)|3,4,$c6,$c0 + dc.b (0<<3)|5,32,$67,$c0 + dc.b (0<<3)|6,41,$93,$80 + dc.b (1<<3)|5,25,$3f,$c0 + dc.b (1<<3)|3,3,$93,$80 + dc.b (2<<3)|6,37,$b2,$c0,(1<<3)|6,35,$67,$c0 + dc.b (3<<3)|7,50,$74,$40 + dc.b (2<<3)|6,25,$3f,$c0 + dc.b (2<<3)|3,2,$5f,$00 + dc.b (2<<3)|5,15,$17,$c0 + dc.b (2<<3)|7,17,$2a,$80 + dc.b (3<<3)|5,5,$07,$80 + dc.b (3<<3)|7,8,$0d,$c0,(1<<3)|7,7,$5f,$00 + dc.b (0<<3)|2,1,$8f,$c0,0 + even + +; 108 (19 passes, 598 height, 169 blits) + dc.b (4<<3)|1,131,$3d,$40 + dc.b (0<<3)|3,6,$c1,$c0 + dc.b (4<<3)|5,44,$06,$40 + dc.b (1<<3)|3,5,$8e,$80 + dc.b (3<<3)|5,40,$af,$00 + dc.b (2<<3)|3,4,$5c,$80 + dc.b (0<<3)|5,32,$66,$80 + dc.b (3<<3)|7,91,$3d,$40 + dc.b (0<<3)|6,41,$8e,$80,(2<<3)|6,40,$af,$00 + dc.b (1<<3)|5,24,$3e,$80 + dc.b (1<<3)|6,32,$66,$80,(3<<3)|6,31,$16,$80,(2<<3)|6,24,$3e,$80 + dc.b (2<<3)|5,15,$16,$80 + dc.b (2<<3)|7,17,$29,$40 + dc.b (3<<3)|5,5,$06,$40 + dc.b (1<<3)|7,8,$5c,$80,(3<<3)|7,8,$0c,$80,0 + even + +; 109 (16 passes, 516 height, 137 blits) + dc.b (4<<3)|1,87,$07,$80 + dc.b (0<<3)|3,6,$bf,$40 + dc.b (3<<3)|5,48,$a5,$00 + dc.b (3<<3)|7,122,$0c,$80 + dc.b (1<<3)|3,5,$8d,$40,(2<<3)|3,4,$5a,$00 + dc.b (0<<3)|5,32,$65,$40 + dc.b (2<<3)|6,48,$a5,$00,(0<<3)|6,40,$8d,$40 + dc.b (1<<3)|5,23,$3d,$40 + dc.b (1<<3)|6,32,$65,$40,(2<<3)|6,23,$3d,$40 + dc.b (2<<3)|5,14,$15,$40 + dc.b (2<<3)|7,18,$26,$c0 + dc.b (3<<3)|5,5,$06,$40 + dc.b (1<<3)|7,9,$5a,$00,0 + even + +; 110 (17 passes, 467 height, 151 blits) + dc.b (3<<3)|5,52,$a0,$00 + dc.b (3<<3)|7,118,$0c,$80 + dc.b (4<<3)|1,44,$06,$40 + dc.b (2<<3)|6,52,$a0,$00 + dc.b (0<<3)|3,4,$bc,$c0 + dc.b (0<<3)|5,30,$65,$40 + dc.b (0<<3)|6,38,$8d,$40 + dc.b (1<<3)|3,3,$8a,$c0,(2<<3)|3,3,$58,$c0 + dc.b (1<<3)|5,22,$3d,$40 + dc.b (1<<3)|6,30,$65,$40,(2<<3)|6,22,$3d,$40 + dc.b (2<<3)|5,14,$15,$40 + dc.b (2<<3)|7,18,$26,$c0 + dc.b (3<<3)|5,5,$06,$40 + dc.b (1<<3)|7,10,$58,$c0,(0<<3)|7,2,$8a,$c0,0 + even + +; 111 (16 passes, 425 height, 145 blits) + dc.b (3<<3)|5,56,$9b,$00 + dc.b (0<<3)|3,5,$b9,$00 + dc.b (3<<3)|7,114,$0c,$80 + dc.b (2<<3)|6,56,$9b,$00 + dc.b (1<<3)|3,4,$88,$40 + dc.b (0<<3)|5,29,$64,$00 + dc.b (2<<3)|3,3,$56,$40 + dc.b (0<<3)|6,36,$8c,$00 + dc.b (1<<3)|5,21,$3c,$00 + dc.b (1<<3)|6,29,$64,$00 + dc.b (2<<3)|5,14,$14,$00 + dc.b (2<<3)|6,21,$3c,$00 + dc.b (2<<3)|7,18,$25,$80 + dc.b (3<<3)|5,5,$06,$40 + dc.b (1<<3)|7,11,$56,$40,(0<<3)|7,3,$88,$40,0 + even + +; 112 (16 passes, 430 height, 145 blits) + dc.b (3<<3)|5,62,$93,$80 + dc.b (2<<3)|6,62,$93,$80 + dc.b (0<<3)|3,5,$b6,$80 + dc.b (3<<3)|7,109,$0b,$40 + dc.b (1<<3)|3,4,$85,$c0 + dc.b (0<<3)|5,28,$62,$c0 + dc.b (2<<3)|3,3,$55,$00 + dc.b (0<<3)|6,35,$8a,$c0 + dc.b (1<<3)|5,21,$3a,$c0 + dc.b (1<<3)|6,28,$62,$c0,(2<<3)|6,21,$3a,$c0 + dc.b (2<<3)|5,13,$12,$c0 + dc.b (2<<3)|7,19,$23,$00 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,11,$55,$00,(0<<3)|7,4,$85,$c0,0 + even + +; 113 (16 passes, 429 height, 145 blits) + dc.b (3<<3)|5,66,$8e,$80 + dc.b (2<<3)|6,66,$8e,$80 + dc.b (3<<3)|7,105,$0b,$40 + dc.b (0<<3)|3,4,$b4,$00,(1<<3)|3,4,$83,$40 + dc.b (0<<3)|5,26,$62,$c0 + dc.b (2<<3)|3,3,$52,$80 + dc.b (0<<3)|6,33,$8a,$c0 + dc.b (1<<3)|5,20,$39,$80 + dc.b (1<<3)|6,26,$62,$c0,(2<<3)|6,20,$39,$80 + dc.b (2<<3)|5,13,$11,$80 + dc.b (2<<3)|7,19,$21,$c0 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,13,$52,$80,(0<<3)|7,6,$83,$40,0 + even + +; 114 (16 passes, 427 height, 145 blits) + dc.b (3<<3)|5,69,$8a,$c0 + dc.b (2<<3)|6,69,$8a,$c0 + dc.b (3<<3)|7,102,$0b,$40 + dc.b (0<<3)|3,4,$b1,$80 + dc.b (0<<3)|5,25,$62,$c0 + dc.b (1<<3)|3,3,$82,$00,(2<<3)|3,3,$51,$40 + dc.b (0<<3)|6,31,$8a,$c0 + dc.b (1<<3)|5,19,$39,$80 + dc.b (1<<3)|6,25,$62,$c0 + dc.b (2<<3)|5,13,$11,$80 + dc.b (2<<3)|6,19,$39,$80 + dc.b (2<<3)|7,19,$21,$c0 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,14,$51,$40,(0<<3)|7,7,$82,$00,0 + even + +; 115 (16 passes, 424 height, 145 blits) + dc.b (3<<3)|5,71,$88,$40 + dc.b (2<<3)|6,71,$88,$40 + dc.b (3<<3)|7,100,$0b,$40 + dc.b (0<<3)|5,25,$61,$80 + dc.b (0<<3)|3,3,$b0,$40 + dc.b (0<<3)|6,31,$89,$80 + dc.b (1<<3)|5,19,$39,$80 + dc.b (1<<3)|6,25,$61,$80 + dc.b (1<<3)|3,2,$80,$c0 + dc.b (2<<3)|5,13,$11,$80 + dc.b (2<<3)|6,19,$39,$80 + dc.b (2<<3)|3,1,$51,$40 + dc.b (2<<3)|7,19,$21,$c0 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,13,$51,$40,(0<<3)|7,7,$80,$c0,0 + even + +; 116 (16 passes, 426 height, 145 blits) + dc.b (3<<3)|5,75,$83,$40 + dc.b (2<<3)|6,75,$83,$40 + dc.b (3<<3)|7,96,$0b,$40 + dc.b (0<<3)|3,3,$ad,$c0,(1<<3)|3,3,$7e,$40 + dc.b (0<<3)|5,23,$61,$80 + dc.b (0<<3)|6,29,$89,$80 + dc.b (1<<3)|5,18,$38,$40 + dc.b (2<<3)|3,2,$4e,$c0 + dc.b (1<<3)|6,23,$61,$80 + dc.b (2<<3)|5,12,$10,$40 + dc.b (2<<3)|6,18,$38,$40 + dc.b (2<<3)|7,20,$1f,$40,(1<<3)|7,15,$4e,$c0 + dc.b (3<<3)|5,5,$05,$00 + dc.b (0<<3)|7,9,$7e,$40,0 + even + +; 117 (16 passes, 428 height, 145 blits) + dc.b (3<<3)|5,78,$7f,$80 + dc.b (2<<3)|6,78,$7f,$80 + dc.b (3<<3)|7,93,$0b,$40 + dc.b (0<<3)|3,3,$ac,$80 + dc.b (0<<3)|5,24,$60,$40 + dc.b (0<<3)|6,29,$88,$40 + dc.b (1<<3)|5,18,$38,$40 + dc.b (1<<3)|3,2,$7e,$40,(2<<3)|3,2,$4e,$c0 + dc.b (1<<3)|6,24,$60,$40 + dc.b (2<<3)|5,12,$10,$40 + dc.b (2<<3)|6,18,$38,$40 + dc.b (2<<3)|7,20,$1f,$40 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,14,$4e,$c0,(0<<3)|7,8,$7e,$40,0 + even + +; 118 (16 passes, 427 height, 145 blits) + dc.b (3<<3)|5,80,$7d,$00 + dc.b (2<<3)|6,80,$7d,$00 + dc.b (3<<3)|7,92,$0a,$00 + dc.b (0<<3)|5,23,$60,$40 + dc.b (0<<3)|6,28,$88,$40 + dc.b (1<<3)|5,18,$37,$00 + dc.b (0<<3)|3,2,$ab,$40 + dc.b (1<<3)|6,23,$60,$40 + dc.b (2<<3)|5,12,$0f,$00 + dc.b (2<<3)|6,18,$37,$00 + dc.b (1<<3)|3,1,$7d,$00,(2<<3)|3,1,$4d,$80 + dc.b (2<<3)|7,20,$1e,$00,(1<<3)|7,15,$4d,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,9,$7d,$00,0 + even + +; 119 (16 passes, 432 height, 145 blits) + dc.b (3<<3)|5,84,$78,$00 + dc.b (2<<3)|6,84,$78,$00 + dc.b (3<<3)|7,88,$0a,$00 + dc.b (0<<3)|3,3,$a8,$c0,(1<<3)|3,3,$7a,$80,(2<<3)|3,3,$4b,$00 + dc.b (0<<3)|5,22,$5f,$00 + dc.b (0<<3)|6,26,$88,$40 + dc.b (1<<3)|5,16,$37,$00 + dc.b (1<<3)|6,22,$5f,$00 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,16,$37,$00 + dc.b (2<<3)|7,21,$1c,$c0,(1<<3)|7,16,$4b,$00 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,11,$7a,$80,0 + even + +; 120 (16 passes, 432 height, 145 blits) + dc.b (3<<3)|5,86,$75,$80 + dc.b (2<<3)|6,86,$75,$80 + dc.b (0<<3)|3,4,$a6,$40,(1<<3)|3,4,$78,$00 + dc.b (3<<3)|7,86,$0a,$00 + dc.b (0<<3)|5,20,$5f,$00,(1<<3)|5,17,$35,$c0 + dc.b (0<<3)|6,25,$87,$00 + dc.b (2<<3)|3,2,$4b,$00 + dc.b (1<<3)|6,20,$5f,$00 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,17,$35,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$4b,$00 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,12,$78,$00,0 + even + +; 121 (15 passes, 426 height, 142 blits) + dc.b (3<<3)|5,86,$75,$80 + dc.b (2<<3)|6,86,$75,$80 + dc.b (3<<3)|7,86,$0a,$00 + dc.b (0<<3)|5,20,$5f,$00,(1<<3)|5,17,$35,$c0 + dc.b (0<<3)|6,25,$87,$00 + dc.b (0<<3)|3,2,$a6,$40,(1<<3)|3,2,$78,$00 + dc.b (1<<3)|6,20,$5f,$00 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,17,$35,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$4b,$00 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,12,$78,$00,0 + even + +; 122 (13 passes, 424 height, 136 blits) + dc.b (3<<3)|5,88,$73,$00 + dc.b (2<<3)|6,88,$73,$00 + dc.b (3<<3)|7,84,$0a,$00 + dc.b (0<<3)|5,20,$5f,$00,(1<<3)|5,17,$35,$c0 + dc.b (0<<3)|6,25,$87,$00,(1<<3)|6,20,$5f,$00 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,17,$35,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$4b,$00 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,12,$78,$00,0 + even + +; 123 (15 passes, 425 height, 142 blits) + dc.b (3<<3)|5,88,$73,$00 + dc.b (2<<3)|6,88,$73,$00 + dc.b (3<<3)|7,84,$0a,$00 + dc.b (0<<3)|5,21,$5d,$c0 + dc.b (0<<3)|6,25,$85,$c0 + dc.b (1<<3)|5,16,$35,$c0 + dc.b (1<<3)|6,21,$5d,$c0 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,16,$35,$c0 + dc.b (0<<3)|3,1,$a5,$00,(2<<3)|3,1,$49,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$49,$c0 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,11,$78,$00,0 + even + +; 124 (15 passes, 425 height, 142 blits) + dc.b (3<<3)|5,88,$73,$00 + dc.b (2<<3)|6,88,$73,$00 + dc.b (3<<3)|7,84,$0a,$00 + dc.b (0<<3)|5,21,$5d,$c0 + dc.b (0<<3)|6,25,$85,$c0 + dc.b (1<<3)|5,16,$35,$c0 + dc.b (1<<3)|6,21,$5d,$c0 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,16,$35,$c0 + dc.b (0<<3)|3,1,$a5,$00,(2<<3)|3,1,$49,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$49,$c0 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,11,$78,$00,0 + even + +; 125 (16 passes, 428 height, 145 blits) + dc.b (3<<3)|5,92,$6e,$00 + dc.b (2<<3)|6,92,$6e,$00 + dc.b (3<<3)|7,80,$0a,$00 + dc.b (0<<3)|5,20,$5d,$c0 + dc.b (0<<3)|6,23,$87,$00 + dc.b (1<<3)|5,15,$35,$c0 + dc.b (1<<3)|6,20,$5d,$c0 + dc.b (2<<3)|5,12,$0c,$80 + dc.b (2<<3)|6,15,$35,$c0 + dc.b (0<<3)|3,1,$a3,$c0,(1<<3)|3,1,$76,$c0,(2<<3)|3,1,$48,$80 + dc.b (2<<3)|7,21,$1b,$80,(1<<3)|7,17,$48,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,13,$76,$c0,0 + even + +; 126 (16 passes, 429 height, 145 blits) + dc.b (3<<3)|5,92,$6e,$00 + dc.b (2<<3)|6,92,$6e,$00 + dc.b (3<<3)|7,80,$0a,$00 + dc.b (0<<3)|5,19,$5d,$c0 + dc.b (0<<3)|3,2,$a2,$80,(1<<3)|3,2,$75,$80 + dc.b (1<<3)|5,16,$34,$80 + dc.b (0<<3)|6,23,$85,$c0,(1<<3)|6,19,$5d,$c0 + dc.b (2<<3)|5,12,$0c,$80 + dc.b (2<<3)|6,16,$34,$80 + dc.b (2<<3)|3,1,$48,$80 + dc.b (2<<3)|7,20,$1b,$80,(1<<3)|7,17,$48,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,13,$75,$80,0 + even + +; 127 (15 passes, 427 height, 142 blits) + dc.b (3<<3)|5,93,$6c,$c0 + dc.b (2<<3)|6,93,$6c,$c0 + dc.b (3<<3)|7,79,$0a,$00 + dc.b (0<<3)|5,19,$5d,$c0,(1<<3)|5,16,$34,$80 + dc.b (0<<3)|6,23,$85,$c0,(1<<3)|6,19,$5d,$c0 + dc.b (2<<3)|5,12,$0c,$80 + dc.b (2<<3)|6,16,$34,$80 + dc.b (0<<3)|3,1,$a2,$80,(1<<3)|3,1,$75,$80 + dc.b (2<<3)|7,20,$1b,$80,(1<<3)|7,17,$48,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,13,$75,$80,0 + even + +; 128 (13 passes, 425 height, 136 blits) + dc.b (3<<3)|5,93,$6c,$c0 + dc.b (2<<3)|6,93,$6c,$c0 + dc.b (3<<3)|7,79,$0a,$00 + dc.b (0<<3)|5,19,$5d,$c0,(1<<3)|5,16,$34,$80 + dc.b (0<<3)|6,23,$85,$c0,(1<<3)|6,19,$5d,$c0 + dc.b (2<<3)|5,12,$0c,$80 + dc.b (2<<3)|6,16,$34,$80 + dc.b (2<<3)|7,20,$1b,$80,(1<<3)|7,17,$48,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,13,$75,$80,0 + even + +; 129 (13 passes, 425 height, 136 blits) + dc.b (3<<3)|5,93,$6c,$c0 + dc.b (2<<3)|6,93,$6c,$c0 + dc.b (3<<3)|7,79,$0a,$00 + dc.b (0<<3)|5,19,$5d,$c0,(1<<3)|5,16,$34,$80 + dc.b (0<<3)|6,23,$85,$c0,(1<<3)|6,19,$5d,$c0 + dc.b (2<<3)|5,12,$0c,$80 + dc.b (2<<3)|6,16,$34,$80 + dc.b (2<<3)|7,20,$1b,$80,(1<<3)|7,17,$48,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,13,$75,$80,0 + even + +; 130 (14 passes, 425 height, 139 blits) + dc.b (3<<3)|5,92,$6e,$00 + dc.b (2<<3)|6,92,$6e,$00 + dc.b (3<<3)|7,80,$0a,$00 + dc.b (0<<3)|5,19,$5d,$c0,(1<<3)|5,16,$34,$80 + dc.b (0<<3)|6,23,$85,$c0,(1<<3)|6,19,$5d,$c0 + dc.b (2<<3)|5,12,$0c,$80 + dc.b (2<<3)|6,16,$34,$80 + dc.b (2<<3)|3,1,$6c,$c0 + dc.b (2<<3)|7,20,$1b,$80,(1<<3)|7,17,$48,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,13,$75,$80,0 + even + +; 131 (15 passes, 427 height, 145 blits) + dc.b (3<<3)|5,92,$6e,$00 + dc.b (2<<3)|6,92,$6e,$00 + dc.b (3<<3)|7,80,$0a,$00 + dc.b (0<<3)|5,20,$5d,$c0 + dc.b (0<<3)|6,23,$87,$00 + dc.b (1<<3)|5,15,$35,$c0 + dc.b (1<<3)|6,20,$5d,$c0 + dc.b (2<<3)|5,12,$0c,$80 + dc.b (2<<3)|6,15,$35,$c0 + dc.b (2<<3)|3,1,$6c,$c0 + dc.b (2<<3)|7,21,$1b,$80,(1<<3)|7,17,$48,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,13,$76,$c0 + dc.b (1<<3)|1,1,$34,$80,0 + even + +; 132 (16 passes, 429 height, 151 blits) + dc.b (3<<3)|5,88,$73,$00 + dc.b (2<<3)|6,88,$73,$00 + dc.b (2<<3)|3,4,$6e,$00 + dc.b (3<<3)|7,84,$0a,$00 + dc.b (0<<3)|5,21,$5d,$c0 + dc.b (0<<3)|6,25,$85,$c0 + dc.b (1<<3)|5,16,$35,$c0 + dc.b (1<<3)|6,21,$5d,$c0 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,16,$35,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$49,$c0 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,11,$78,$00 + dc.b (1<<3)|1,1,$34,$80,(2<<3)|1,1,$0c,$80,0 + even + +; 133 (15 passes, 428 height, 145 blits) + dc.b (3<<3)|5,88,$73,$00 + dc.b (2<<3)|6,88,$73,$00 + dc.b (2<<3)|3,4,$6e,$00 + dc.b (3<<3)|7,84,$0a,$00 + dc.b (0<<3)|5,21,$5d,$c0 + dc.b (0<<3)|6,25,$85,$c0 + dc.b (1<<3)|5,16,$35,$c0 + dc.b (1<<3)|6,21,$5d,$c0 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,16,$35,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$49,$c0 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,11,$78,$00 + dc.b (2<<3)|1,1,$0c,$80,0 + even + +; 134 (14 passes, 425 height, 142 blits) + dc.b (3<<3)|5,88,$73,$00 + dc.b (2<<3)|6,88,$73,$00 + dc.b (3<<3)|7,84,$0a,$00 + dc.b (0<<3)|5,20,$5f,$00,(1<<3)|5,17,$35,$c0 + dc.b (0<<3)|6,25,$87,$00,(1<<3)|6,20,$5f,$00 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,17,$35,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$4b,$00 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,12,$78,$00 + dc.b (0<<3)|1,1,$5d,$c0,0 + even + +; 135 (15 passes, 425 height, 145 blits) + dc.b (3<<3)|5,86,$75,$80 + dc.b (2<<3)|6,86,$75,$80 + dc.b (3<<3)|7,86,$0a,$00 + dc.b (0<<3)|5,20,$5f,$00,(1<<3)|5,17,$35,$c0 + dc.b (0<<3)|6,25,$87,$00 + dc.b (2<<3)|3,2,$73,$00 + dc.b (1<<3)|6,20,$5f,$00 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,17,$35,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$4b,$00 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,12,$78,$00 + dc.b (0<<3)|1,1,$5d,$c0,0 + even + +; 136 (14 passes, 424 height, 139 blits) + dc.b (3<<3)|5,86,$75,$80 + dc.b (2<<3)|6,86,$75,$80 + dc.b (3<<3)|7,86,$0a,$00 + dc.b (0<<3)|5,20,$5f,$00,(1<<3)|5,17,$35,$c0 + dc.b (0<<3)|6,25,$87,$00 + dc.b (2<<3)|3,2,$73,$00 + dc.b (1<<3)|6,20,$5f,$00 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,17,$35,$c0 + dc.b (2<<3)|7,20,$1c,$c0,(1<<3)|7,16,$4b,$00 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,12,$78,$00,0 + even + +; 137 (15 passes, 426 height, 145 blits) + dc.b (3<<3)|5,84,$78,$00 + dc.b (2<<3)|6,84,$78,$00 + dc.b (3<<3)|7,88,$0a,$00 + dc.b (0<<3)|5,22,$5f,$00 + dc.b (0<<3)|6,26,$88,$40 + dc.b (2<<3)|3,2,$75,$80 + dc.b (1<<3)|5,16,$37,$00 + dc.b (1<<3)|6,22,$5f,$00 + dc.b (2<<3)|5,12,$0d,$c0 + dc.b (2<<3)|6,16,$37,$00 + dc.b (2<<3)|7,21,$1c,$c0,(1<<3)|7,16,$4b,$00 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,11,$7a,$80 + dc.b (1<<3)|1,1,$35,$c0,0 + even + +; 138 (17 passes, 432 height, 157 blits) + dc.b (3<<3)|5,80,$7d,$00 + dc.b (2<<3)|6,80,$7d,$00 + dc.b (2<<3)|3,6,$75,$80 + dc.b (3<<3)|7,92,$0a,$00 + dc.b (0<<3)|5,23,$60,$40 + dc.b (0<<3)|6,28,$88,$40 + dc.b (1<<3)|5,18,$37,$00 + dc.b (1<<3)|6,23,$60,$40 + dc.b (2<<3)|5,12,$0f,$00 + dc.b (2<<3)|6,18,$37,$00 + dc.b (2<<3)|7,20,$1e,$00,(1<<3)|7,15,$4d,$80 + dc.b (3<<3)|5,5,$03,$c0 + dc.b (0<<3)|7,9,$7d,$00 + dc.b (0<<3)|1,1,$5f,$00,(1<<3)|1,1,$35,$c0,(2<<3)|1,1,$0d,$c0,0 + even + +; 139 (18 passes, 432 height, 163 blits) + dc.b (3<<3)|5,78,$7f,$80 + dc.b (2<<3)|6,78,$7f,$80 + dc.b (2<<3)|3,6,$78,$00 + dc.b (3<<3)|7,93,$0b,$40 + dc.b (0<<3)|5,24,$60,$40 + dc.b (0<<3)|6,29,$88,$40 + dc.b (1<<3)|5,18,$38,$40 + dc.b (1<<3)|6,24,$60,$40 + dc.b (2<<3)|5,12,$10,$40 + dc.b (2<<3)|6,18,$38,$40 + dc.b (2<<3)|7,20,$1f,$40 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,14,$4e,$c0,(0<<3)|7,8,$7e,$40 + dc.b (2<<3)|1,2,$0d,$c0,(0<<3)|1,1,$5f,$00,(1<<3)|1,1,$37,$00,(3<<3)|1,1,$03,$c0,0 + even + +; 140 (18 passes, 427 height, 163 blits) + dc.b (3<<3)|5,75,$83,$40 + dc.b (2<<3)|6,75,$83,$40 + dc.b (2<<3)|3,5,$7d,$00 + dc.b (3<<3)|7,96,$0b,$40 + dc.b (0<<3)|5,23,$61,$80 + dc.b (0<<3)|6,29,$89,$80 + dc.b (1<<3)|5,18,$38,$40 + dc.b (1<<3)|6,23,$61,$80 + dc.b (2<<3)|5,12,$10,$40 + dc.b (2<<3)|6,18,$38,$40 + dc.b (2<<3)|7,20,$1f,$40,(1<<3)|7,15,$4e,$c0 + dc.b (3<<3)|5,5,$05,$00 + dc.b (0<<3)|7,9,$7e,$40 + dc.b (0<<3)|1,1,$60,$40,(1<<3)|1,1,$37,$00,(2<<3)|1,1,$0f,$00,(3<<3)|1,1,$03,$c0,0 + even + +; 141 (17 passes, 428 height, 157 blits) + dc.b (3<<3)|5,71,$88,$40 + dc.b (2<<3)|3,7,$7f,$80 + dc.b (2<<3)|6,71,$88,$40 + dc.b (3<<3)|7,100,$0b,$40 + dc.b (0<<3)|5,25,$61,$80 + dc.b (0<<3)|6,31,$89,$80 + dc.b (1<<3)|5,19,$39,$80 + dc.b (1<<3)|6,25,$61,$80 + dc.b (2<<3)|5,13,$11,$80 + dc.b (2<<3)|6,19,$39,$80 + dc.b (2<<3)|7,19,$21,$c0 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,13,$51,$40,(0<<3)|7,7,$80,$c0 + dc.b (0<<3)|1,1,$60,$40,(1<<3)|1,1,$38,$40,(2<<3)|1,1,$10,$40,0 + even + +; 142 (17 passes, 426 height, 157 blits) + dc.b (3<<3)|5,69,$8a,$c0 + dc.b (2<<3)|3,6,$83,$40 + dc.b (2<<3)|6,69,$8a,$c0 + dc.b (3<<3)|7,102,$0b,$40 + dc.b (0<<3)|5,25,$62,$c0 + dc.b (0<<3)|6,31,$8a,$c0 + dc.b (1<<3)|5,19,$39,$80 + dc.b (1<<3)|6,25,$62,$c0 + dc.b (2<<3)|5,13,$11,$80 + dc.b (2<<3)|6,19,$39,$80 + dc.b (2<<3)|7,19,$21,$c0 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,14,$51,$40,(0<<3)|7,7,$82,$00 + dc.b (0<<3)|1,1,$61,$80,(1<<3)|1,1,$38,$40,(2<<3)|1,1,$10,$40,0 + even + +; 143 (15 passes, 424 height, 145 blits) + dc.b (3<<3)|5,66,$8e,$80 + dc.b (2<<3)|6,66,$8e,$80 + dc.b (2<<3)|3,5,$88,$40 + dc.b (3<<3)|7,105,$0b,$40 + dc.b (0<<3)|5,26,$62,$c0 + dc.b (0<<3)|6,33,$8a,$c0 + dc.b (1<<3)|5,20,$39,$80 + dc.b (1<<3)|6,26,$62,$c0,(2<<3)|6,20,$39,$80 + dc.b (2<<3)|5,13,$11,$80 + dc.b (2<<3)|7,19,$21,$c0 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,13,$52,$80,(0<<3)|7,6,$83,$40 + dc.b (0<<3)|1,1,$61,$80,0 + even + +; 144 (16 passes, 427 height, 151 blits) + dc.b (3<<3)|5,62,$93,$80 + dc.b (2<<3)|3,7,$8a,$c0 + dc.b (2<<3)|6,62,$93,$80 + dc.b (3<<3)|7,109,$0b,$40 + dc.b (0<<3)|5,28,$62,$c0 + dc.b (0<<3)|6,35,$8a,$c0 + dc.b (1<<3)|5,21,$3a,$c0 + dc.b (1<<3)|6,28,$62,$c0,(2<<3)|6,21,$3a,$c0 + dc.b (2<<3)|5,13,$12,$c0 + dc.b (2<<3)|7,19,$23,$00 + dc.b (3<<3)|5,5,$05,$00 + dc.b (1<<3)|7,11,$55,$00,(0<<3)|7,4,$85,$c0 + dc.b (1<<3)|1,1,$39,$80,(2<<3)|1,1,$11,$80,0 + even + +; 145 (18 passes, 429 height, 163 blits) + dc.b (2<<3)|3,10,$8e,$80 + dc.b (3<<3)|5,56,$9b,$00 + dc.b (3<<3)|7,114,$0c,$80 + dc.b (2<<3)|6,56,$9b,$00 + dc.b (0<<3)|5,29,$64,$00 + dc.b (0<<3)|6,36,$8c,$00 + dc.b (1<<3)|5,21,$3c,$00 + dc.b (1<<3)|6,29,$64,$00 + dc.b (2<<3)|5,14,$14,$00 + dc.b (2<<3)|6,21,$3c,$00 + dc.b (2<<3)|7,18,$25,$80 + dc.b (3<<3)|5,5,$06,$40 + dc.b (1<<3)|7,11,$56,$40 + dc.b (1<<3)|1,2,$39,$80,(2<<3)|1,2,$11,$80 + dc.b (0<<3)|7,3,$88,$40 + dc.b (0<<3)|1,1,$62,$c0,(3<<3)|1,1,$05,$00,0 + even + +; 146 (18 passes, 430 height, 163 blits) + dc.b (2<<3)|3,10,$93,$80 + dc.b (3<<3)|5,52,$a0,$00 + dc.b (3<<3)|7,118,$0c,$80 + dc.b (2<<3)|6,52,$a0,$00 + dc.b (0<<3)|5,30,$65,$40 + dc.b (0<<3)|6,38,$8d,$40 + dc.b (1<<3)|5,22,$3d,$40 + dc.b (1<<3)|6,30,$65,$40,(2<<3)|6,22,$3d,$40 + dc.b (2<<3)|5,14,$15,$40 + dc.b (2<<3)|7,18,$26,$c0 + dc.b (3<<3)|5,5,$06,$40 + dc.b (1<<3)|7,10,$58,$c0 + dc.b (0<<3)|1,2,$62,$c0,(1<<3)|1,2,$3a,$c0,(2<<3)|1,2,$12,$c0,(3<<3)|1,1,$05,$00 + dc.b (0<<3)|7,2,$8a,$c0,0 + even + +; 147 (16 passes, 425 height, 143 blits) + dc.b (2<<3)|3,8,$9b,$00 + dc.b (3<<3)|5,48,$a5,$00 + dc.b (3<<3)|7,122,$0c,$80 + dc.b (0<<3)|5,32,$65,$40 + dc.b (2<<3)|6,48,$a5,$00,(0<<3)|6,40,$8d,$40 + dc.b (1<<3)|5,23,$3d,$40 + dc.b (1<<3)|6,32,$65,$40,(2<<3)|6,23,$3d,$40 + dc.b (2<<3)|5,14,$15,$40 + dc.b (2<<3)|7,18,$26,$c0 + dc.b (3<<3)|5,5,$06,$40 + dc.b (1<<3)|7,9,$5a,$00 + dc.b (0<<3)|1,1,$64,$00,(1<<3)|1,1,$3c,$00,(2<<3)|1,1,$14,$00,0 + even + +; 148 (19 passes, 467 height, 175 blits) + dc.b (2<<3)|3,12,$a0,$00 + dc.b (4<<3)|5,44,$06,$40,(3<<3)|5,40,$af,$00,(0<<3)|5,32,$66,$80 + dc.b (3<<3)|7,91,$3d,$40 + dc.b (0<<3)|6,41,$8e,$80,(2<<3)|6,40,$af,$00 + dc.b (1<<3)|5,24,$3e,$80 + dc.b (1<<3)|6,32,$66,$80,(3<<3)|6,31,$16,$80,(2<<3)|6,24,$3e,$80 + dc.b (2<<3)|5,15,$16,$80 + dc.b (2<<3)|7,17,$29,$40 + dc.b (3<<3)|5,5,$06,$40 + dc.b (1<<3)|7,8,$5c,$80,(3<<3)|7,8,$0c,$80 + dc.b (0<<3)|1,1,$65,$40,(1<<3)|1,1,$3d,$40,(2<<3)|1,1,$15,$40,0 + even + +; 149 (21 passes, 516 height, 187 blits) + dc.b (2<<3)|3,11,$a5,$00 + dc.b (4<<3)|5,87,$07,$80 + dc.b (3<<3)|6,74,$17,$c0 + dc.b (3<<3)|5,37,$b2,$c0,(0<<3)|5,32,$67,$c0 + dc.b (0<<3)|6,41,$93,$80 + dc.b (1<<3)|5,25,$3f,$c0 + dc.b (2<<3)|6,37,$b2,$c0,(1<<3)|6,35,$67,$c0 + dc.b (3<<3)|7,50,$74,$40 + dc.b (2<<3)|6,25,$3f,$c0 + dc.b (2<<3)|5,15,$17,$c0 + dc.b (2<<3)|7,17,$2a,$80 + dc.b (3<<3)|5,5,$07,$80 + dc.b (0<<3)|2,3,$8f,$c0 + dc.b (3<<3)|7,8,$0d,$c0,(1<<3)|7,7,$5f,$00 + dc.b (0<<3)|1,2,$65,$40,(1<<3)|1,2,$3d,$40,(2<<3)|1,2,$15,$40,(3<<3)|1,1,$06,$40,0 + even + +; 150 (21 passes, 598 height, 177 blits) + dc.b (4<<3)|5,174,$07,$80 + dc.b (2<<3)|3,17,$af,$00 + dc.b (3<<3)|6,137,$19,$00 + dc.b (0<<3)|5,32,$69,$00 + dc.b (0<<3)|6,42,$94,$c0 + dc.b (1<<3)|5,26,$41,$00 + dc.b (1<<3)|6,35,$69,$00 + dc.b (3<<3)|2,23,$c4,$40 + dc.b (2<<3)|6,26,$41,$00 + dc.b (2<<3)|5,16,$19,$00 + dc.b (2<<3)|6,23,$c4,$40 + dc.b (2<<3)|7,16,$2d,$00 + dc.b (3<<3)|5,5,$07,$80 + dc.b (3<<3)|7,9,$0d,$c0 + dc.b (0<<3)|2,3,$91,$00 + dc.b (1<<3)|7,6,$61,$80 + dc.b (0<<3)|1,2,$66,$80,(1<<3)|1,2,$3e,$80,(2<<3)|1,2,$16,$80,(3<<3)|1,1,$06,$40,(4<<3)|1,1,$06,$40,0 + even + +; 151 (19 passes, 592 height, 165 blits) + dc.b (4<<3)|5,174,$07,$80 + dc.b (2<<3)|3,18,$b2,$c0 + dc.b (3<<3)|6,141,$19,$00 + dc.b (0<<3)|5,32,$69,$00 + dc.b (0<<3)|6,42,$97,$40 + dc.b (1<<3)|5,26,$41,$00 + dc.b (1<<3)|6,37,$69,$00 + dc.b (3<<3)|2,19,$c9,$40 + dc.b (2<<3)|6,26,$41,$00 + dc.b (2<<3)|5,16,$19,$00 + dc.b (2<<3)|6,19,$c9,$40 + dc.b (2<<3)|7,16,$2d,$00 + dc.b (3<<3)|5,5,$07,$80 + dc.b (3<<3)|7,9,$0d,$c0 + dc.b (0<<3)|2,3,$93,$80 + dc.b (1<<3)|7,6,$61,$80 + dc.b (0<<3)|1,1,$67,$c0,(1<<3)|1,1,$3f,$c0,(2<<3)|1,1,$17,$c0,0 + even + +; 152 (18 passes, 576 height, 159 blits) + dc.b (4<<3)|5,174,$07,$80 + dc.b (2<<3)|3,14,$c4,$40 + dc.b (3<<3)|6,150,$1a,$40 + dc.b (0<<3)|5,32,$6a,$40 + dc.b (0<<3)|6,43,$9b,$00 + dc.b (1<<3)|5,28,$42,$40 + dc.b (1<<3)|6,39,$6a,$40,(2<<3)|6,28,$42,$40 + dc.b (2<<3)|5,17,$1a,$40 + dc.b (2<<3)|6,9,$d5,$c0 + dc.b (2<<3)|7,15,$2f,$80 + dc.b (3<<3)|5,5,$07,$80 + dc.b (0<<3)|2,5,$94,$c0 + dc.b (3<<3)|7,10,$0d,$c0,(1<<3)|7,4,$65,$40 + dc.b (0<<3)|1,1,$69,$00,(1<<3)|1,1,$41,$00,(2<<3)|1,1,$19,$00,0 + even + +; 153 (20 passes, 584 height, 171 blits) + dc.b (4<<3)|5,173,$08,$c0 + dc.b (2<<3)|3,16,$c9,$40 + dc.b (3<<3)|6,155,$1b,$80 + dc.b (0<<3)|5,32,$6b,$80,(1<<3)|5,29,$43,$80 + dc.b (0<<3)|6,44,$9d,$80,(1<<3)|6,40,$6b,$80,(2<<3)|6,29,$43,$80 + dc.b (2<<3)|5,17,$1b,$80 + dc.b (2<<3)|7,15,$30,$c0 + dc.b (3<<3)|5,5,$08,$c0 + dc.b (0<<3)|2,5,$97,$40 + dc.b (3<<3)|7,10,$0f,$00 + dc.b (2<<3)|6,3,$dd,$40 + dc.b (0<<3)|1,2,$69,$00,(1<<3)|1,2,$41,$00,(2<<3)|1,2,$19,$00 + dc.b (1<<3)|7,3,$67,$c0 + dc.b (3<<3)|1,1,$07,$80,(4<<3)|1,1,$07,$80,0 + even + +; 154 (19 passes, 582 height, 161 blits) + dc.b (4<<3)|5,173,$08,$c0 + dc.b (3<<3)|6,157,$1c,$c0 + dc.b (2<<3)|3,9,$d5,$c0 + dc.b (0<<3)|5,32,$6c,$c0,(1<<3)|5,30,$44,$c0 + dc.b (0<<3)|6,44,$a2,$80,(1<<3)|6,43,$6c,$c0,(2<<3)|6,30,$44,$c0 + dc.b (2<<3)|5,18,$1c,$c0 + dc.b (0<<3)|2,6,$9b,$00 + dc.b (3<<3)|5,5,$08,$c0 + dc.b (2<<3)|7,14,$33,$40,(3<<3)|7,11,$0f,$00 + dc.b (0<<3)|1,2,$6a,$40,(1<<3)|1,2,$42,$40,(2<<3)|1,2,$1a,$40,(3<<3)|1,1,$07,$80,(4<<3)|1,1,$07,$80 + dc.b (1<<3)|7,2,$6a,$40,0 + even + +; 155 (16 passes, 580 height, 135 blits) + dc.b (4<<3)|5,173,$08,$c0 + dc.b (3<<3)|6,156,$1e,$00 + dc.b (0<<3)|5,32,$6e,$00,(1<<3)|5,32,$46,$00 + dc.b (0<<3)|6,45,$a6,$40,(1<<3)|6,45,$6e,$00 + dc.b (2<<3)|3,3,$dd,$40 + dc.b (2<<3)|6,32,$46,$00 + dc.b (2<<3)|5,19,$1e,$00 + dc.b (0<<3)|2,7,$9d,$80 + dc.b (3<<3)|5,5,$08,$c0 + dc.b (2<<3)|7,13,$35,$c0,(3<<3)|7,12,$0f,$00 + dc.b (0<<3)|1,2,$6b,$80,(1<<3)|1,2,$43,$80,(2<<3)|1,2,$1b,$80,0 + even + +; 156 (16 passes, 575 height, 138 blits) + dc.b (4<<3)|5,173,$08,$c0 + dc.b (3<<3)|6,156,$1e,$00 + dc.b (0<<3)|5,32,$6e,$00,(1<<3)|5,32,$46,$00 + dc.b (1<<3)|6,46,$6f,$40,(0<<3)|6,45,$a8,$c0,(2<<3)|6,33,$46,$00 + dc.b (2<<3)|5,19,$1e,$00,(3<<3)|5,5,$08,$c0 + dc.b (0<<3)|2,5,$a2,$80 + dc.b (2<<3)|7,13,$35,$c0,(3<<3)|7,12,$0f,$00 + dc.b (1<<3)|2,1,$6e,$00 + dc.b (0<<3)|1,1,$6c,$c0,(1<<3)|1,1,$44,$c0,(2<<3)|1,1,$1c,$c0,0 + even + +; 157 (20 passes, 577 height, 172 blits) + dc.b (4<<3)|5,163,$15,$40 + dc.b (3<<3)|6,154,$20,$80 + dc.b (0<<3)|5,32,$70,$80,(1<<3)|5,32,$48,$80 + dc.b (1<<3)|6,46,$73,$00,(0<<3)|6,42,$ac,$80,(2<<3)|6,34,$48,$80 + dc.b (2<<3)|5,20,$20,$80,(3<<3)|5,5,$0a,$00,(4<<3)|5,5,$0a,$00 + dc.b (0<<3)|2,5,$a6,$40 + dc.b (3<<3)|7,13,$10,$40,(2<<3)|7,12,$39,$80 + dc.b (1<<3)|2,2,$70,$80 + dc.b (0<<3)|1,2,$6e,$00,(1<<3)|1,2,$46,$00,(2<<3)|1,2,$1e,$00 + dc.b (4<<3)|7,4,$10,$40 + dc.b (3<<3)|1,1,$08,$c0,(4<<3)|1,1,$08,$c0,0 + even + +; 158 (20 passes, 585 height, 172 blits) + dc.b (4<<3)|5,156,$1e,$00 + dc.b (3<<3)|6,153,$21,$c0 + dc.b (0<<3)|5,32,$71,$c0,(1<<3)|5,32,$49,$c0 + dc.b (1<<3)|6,47,$78,$00,(0<<3)|6,37,$b2,$c0,(2<<3)|6,37,$49,$c0 + dc.b (2<<3)|5,21,$21,$c0 + dc.b (0<<3)|2,8,$a8,$c0 + dc.b (3<<3)|5,5,$0a,$00,(4<<3)|5,5,$0a,$00 + dc.b (3<<3)|7,14,$10,$40 + dc.b (1<<3)|2,5,$71,$c0 + dc.b (2<<3)|7,11,$3c,$00,(4<<3)|7,11,$10,$40 + dc.b (0<<3)|1,3,$6e,$00,(1<<3)|1,3,$46,$00,(2<<3)|1,3,$1e,$00,(3<<3)|1,1,$08,$c0,(4<<3)|1,1,$08,$c0,0 + even + +; 159 (18 passes, 582 height, 160 blits) + dc.b (4<<3)|5,148,$28,$00 + dc.b (3<<3)|6,152,$23,$00 + dc.b (0<<3)|5,33,$74,$40,(1<<3)|5,32,$4c,$40 + dc.b (1<<3)|6,48,$7a,$80,(2<<3)|6,37,$4c,$40,(0<<3)|6,34,$b6,$80 + dc.b (2<<3)|5,22,$23,$00 + dc.b (0<<3)|2,8,$ac,$80 + dc.b (4<<3)|7,19,$10,$40,(3<<3)|7,15,$10,$40 + dc.b (3<<3)|5,5,$0a,$00,(4<<3)|5,5,$0a,$00 + dc.b (1<<3)|2,5,$74,$40 + dc.b (2<<3)|7,11,$3e,$80 + dc.b (0<<3)|1,3,$70,$80,(1<<3)|1,3,$48,$80,(2<<3)|1,2,$20,$80,0 + even + +; 160 (20 passes, 584 height, 172 blits) + dc.b (4<<3)|5,145,$2b,$c0 + dc.b (3<<3)|6,150,$25,$80 + dc.b (0<<3)|5,33,$78,$00,(1<<3)|5,33,$4e,$c0 + dc.b (1<<3)|6,49,$7e,$40,(2<<3)|6,38,$4e,$c0 + dc.b (2<<3)|5,22,$25,$80 + dc.b (0<<3)|6,30,$bb,$80 + dc.b (4<<3)|7,21,$11,$80 + dc.b (0<<3)|2,7,$b2,$c0 + dc.b (3<<3)|7,16,$11,$80 + dc.b (3<<3)|5,5,$0b,$40,(4<<3)|5,5,$0b,$40 + dc.b (1<<3)|2,5,$78,$00 + dc.b (0<<3)|1,5,$71,$c0 + dc.b (2<<3)|7,11,$41,$00 + dc.b (1<<3)|1,4,$49,$c0,(2<<3)|1,3,$21,$c0,(3<<3)|1,1,$0a,$00,(4<<3)|1,1,$0a,$00,0 + even + +; 161 (20 passes, 586 height, 172 blits) + dc.b (4<<3)|5,135,$38,$40 + dc.b (3<<3)|6,149,$26,$c0 + dc.b (0<<3)|5,34,$7a,$80,(1<<3)|5,33,$51,$40 + dc.b (1<<3)|6,50,$82,$00,(2<<3)|6,39,$51,$40 + dc.b (2<<3)|5,23,$26,$c0 + dc.b (0<<3)|6,26,$c0,$80 + dc.b (4<<3)|7,31,$11,$80 + dc.b (0<<3)|2,8,$b6,$80 + dc.b (3<<3)|7,17,$11,$80 + dc.b (1<<3)|2,6,$7a,$80 + dc.b (3<<3)|5,5,$0b,$40,(4<<3)|5,5,$0b,$40 + dc.b (0<<3)|1,5,$74,$40 + dc.b (2<<3)|7,11,$43,$80 + dc.b (1<<3)|1,4,$4c,$40,(2<<3)|1,3,$23,$00,(3<<3)|1,1,$0a,$00,(4<<3)|1,1,$0a,$00,0 + even + +; 162 (20 passes, 583 height, 173 blits) + dc.b (4<<3)|5,122,$48,$80 + dc.b (3<<3)|6,122,$48,$80 + dc.b (0<<3)|5,34,$7e,$40,(1<<3)|5,34,$53,$c0 + dc.b (1<<3)|6,51,$85,$c0,(2<<3)|6,40,$53,$c0 + dc.b (2<<3)|5,25,$28,$00 + dc.b (3<<3)|6,25,$28,$00 + dc.b (4<<3)|7,44,$11,$80 + dc.b (0<<3)|6,22,$c5,$80 + dc.b (3<<3)|3,1,$47,$40 + dc.b (0<<3)|2,8,$bb,$80 + dc.b (3<<3)|7,18,$11,$80 + dc.b (1<<3)|2,6,$7e,$40 + dc.b (3<<3)|5,5,$0b,$40,(4<<3)|5,5,$0b,$40 + dc.b (0<<3)|1,5,$78,$00 + dc.b (2<<3)|7,10,$47,$40 + dc.b (1<<3)|1,4,$4e,$c0,(2<<3)|1,2,$25,$80,0 + even + +; 163 (20 passes, 589 height, 173 blits) + dc.b (4<<3)|5,109,$58,$c0 + dc.b (3<<3)|3,12,$49,$c0 + dc.b (3<<3)|6,109,$58,$c0 + dc.b (0<<3)|5,35,$82,$00,(1<<3)|5,35,$56,$40 + dc.b (1<<3)|6,52,$8c,$00,(2<<3)|6,43,$56,$40 + dc.b (2<<3)|5,25,$2a,$80 + dc.b (4<<3)|7,57,$11,$80 + dc.b (3<<3)|6,25,$2a,$80,(0<<3)|6,16,$cd,$00 + dc.b (0<<3)|2,10,$c0,$80,(1<<3)|2,8,$82,$00 + dc.b (3<<3)|7,20,$11,$80 + dc.b (0<<3)|1,6,$7a,$80 + dc.b (3<<3)|5,5,$0b,$40,(4<<3)|5,5,$0b,$40 + dc.b (2<<3)|7,10,$49,$c0 + dc.b (1<<3)|1,4,$51,$40,(2<<3)|1,3,$26,$c0,0 + even + +; 164 (22 passes, 592 height, 185 blits) + dc.b (3<<3)|3,24,$4e,$c0 + dc.b (4<<3)|5,93,$6c,$c0 + dc.b (3<<3)|6,93,$6c,$c0 + dc.b (1<<3)|5,36,$5a,$00,(0<<3)|5,35,$87,$00 + dc.b (1<<3)|6,53,$91,$00,(2<<3)|6,44,$5a,$00 + dc.b (2<<3)|5,26,$2e,$40 + dc.b (4<<3)|7,72,$12,$c0 + dc.b (3<<3)|6,26,$2e,$40 + dc.b (0<<3)|2,11,$c5,$80 + dc.b (3<<3)|7,22,$12,$c0 + dc.b (1<<3)|2,8,$87,$00 + dc.b (0<<3)|6,11,$d3,$40 + dc.b (0<<3)|1,7,$7e,$40 + dc.b (3<<3)|5,5,$0c,$80,(4<<3)|5,5,$0c,$80 + dc.b (1<<3)|1,5,$53,$c0,(2<<3)|1,5,$28,$00 + dc.b (2<<3)|7,9,$4e,$c0 + dc.b (3<<3)|1,1,$0b,$40,(4<<3)|1,1,$0b,$40,0 + even + +; 165 (24 passes, 597 height, 199 blits) + dc.b (3<<3)|3,39,$58,$c0 + dc.b (4<<3)|5,57,$89,$80 + dc.b (3<<3)|6,70,$89,$80,(1<<3)|6,55,$94,$c0 + dc.b (0<<3)|5,36,$8a,$c0,(1<<3)|5,36,$5d,$c0 + dc.b (4<<3)|7,95,$12,$c0 + dc.b (2<<3)|6,44,$5d,$c0 + dc.b (2<<3)|5,27,$2f,$80 + dc.b (3<<3)|6,27,$2f,$80 + dc.b (5<<3)|5,13,$d0,$c0 + dc.b (4<<3)|2,13,$d0,$c0,(0<<3)|2,10,$cd,$00 + dc.b (3<<3)|7,23,$12,$c0 + dc.b (1<<3)|2,7,$8c,$00 + dc.b (0<<3)|1,7,$82,$00,(1<<3)|1,6,$56,$40 + dc.b (3<<3)|5,5,$0c,$80,(4<<3)|5,5,$0c,$80 + dc.b (0<<3)|6,6,$d9,$80 + dc.b (2<<3)|7,10,$51,$40 + dc.b (2<<3)|1,4,$2a,$80,(3<<3)|1,1,$0b,$40,(4<<3)|1,1,$0b,$40,0 + even + +; 166 (22 passes, 593 height, 187 blits) + dc.b (3<<3)|3,55,$6c,$c0 + dc.b (4<<3)|7,127,$12,$c0 + dc.b (0<<3)|5,37,$8e,$80,(1<<3)|5,37,$60,$40 + dc.b (1<<3)|6,56,$99,$c0,(2<<3)|6,46,$60,$40 + dc.b (2<<3)|5,28,$32,$00,(5<<3)|5,27,$bf,$40 + dc.b (4<<3)|2,27,$bf,$40 + dc.b (3<<3)|6,38,$b1,$80,(3<<3)|6,28,$32,$00 + dc.b (4<<3)|5,11,$b1,$80 + dc.b (0<<3)|2,10,$d3,$40 + dc.b (3<<3)|7,25,$12,$c0 + dc.b (1<<3)|2,7,$91,$00 + dc.b (0<<3)|1,6,$87,$00 + dc.b (3<<3)|5,5,$0c,$80,(4<<3)|5,5,$0c,$80 + dc.b (1<<3)|1,5,$5a,$00 + dc.b (2<<3)|7,9,$55,$00 + dc.b (2<<3)|1,3,$2e,$40 + dc.b (0<<3)|6,1,$df,$c0,0 + even + +; 167 (22 passes, 584 height, 185 blits) + dc.b (3<<3)|3,61,$89,$80 + dc.b (5<<3)|5,46,$a7,$80 + dc.b (4<<3)|7,118,$14,$00 + dc.b (1<<3)|5,38,$64,$00,(0<<3)|5,37,$93,$80 + dc.b (1<<3)|6,51,$a1,$40,(2<<3)|6,49,$64,$00 + dc.b (2<<3)|5,29,$35,$c0 + dc.b (4<<3)|6,37,$a7,$80,(3<<3)|6,29,$35,$c0 + dc.b (1<<3)|2,10,$94,$c0 + dc.b (3<<3)|7,27,$14,$00 + dc.b (0<<3)|1,7,$8a,$c0 + dc.b (3<<3)|6,9,$d5,$c0 + dc.b (0<<3)|2,6,$d9,$80 + dc.b (3<<3)|5,5,$0d,$c0,(4<<3)|5,5,$0d,$c0 + dc.b (1<<3)|1,5,$5d,$c0,(2<<3)|1,5,$2f,$80 + dc.b (2<<3)|7,8,$5a,$00 + dc.b (3<<3)|1,1,$0c,$80,(4<<3)|1,1,$0c,$80,0 + even + +; 168 (21 passes, 575 height, 175 blits) + dc.b (3<<3)|3,38,$b1,$80 + dc.b (5<<3)|5,62,$93,$80 + dc.b (4<<3)|6,62,$93,$80 + dc.b (0<<3)|5,38,$97,$40,(1<<3)|5,38,$67,$c0 + dc.b (4<<3)|7,102,$14,$00 + dc.b (2<<3)|6,50,$67,$c0 + dc.b (2<<3)|5,31,$37,$00 + dc.b (1<<3)|6,47,$a6,$40,(3<<3)|6,31,$37,$00 + dc.b (1<<3)|2,10,$99,$c0 + dc.b (3<<3)|7,27,$15,$40 + dc.b (3<<3)|5,6,$0d,$c0 + dc.b (0<<3)|1,7,$8e,$80,(1<<3)|1,6,$60,$40 + dc.b (4<<3)|5,5,$0d,$c0 + dc.b (2<<3)|1,4,$32,$00 + dc.b (2<<3)|7,8,$5d,$c0 + dc.b (0<<3)|2,1,$df,$c0 + dc.b (3<<3)|1,1,$0c,$80,(4<<3)|1,1,$0c,$80,0 + even + +; 169 (18 passes, 553 height, 157 blits) + dc.b (3<<3)|3,9,$d5,$c0 + dc.b (5<<3)|5,72,$87,$00 + dc.b (4<<3)|6,72,$87,$00 + dc.b (0<<3)|5,39,$9b,$00,(1<<3)|5,39,$6a,$40 + dc.b (2<<3)|6,53,$6a,$40 + dc.b (2<<3)|5,33,$39,$80 + dc.b (4<<3)|7,92,$14,$00 + dc.b (1<<3)|6,42,$ac,$80,(3<<3)|6,33,$39,$80 + dc.b (3<<3)|7,27,$17,$c0 + dc.b (1<<3)|2,9,$a1,$40 + dc.b (3<<3)|5,8,$0d,$c0 + dc.b (0<<3)|1,6,$93,$80 + dc.b (4<<3)|5,5,$0d,$c0 + dc.b (1<<3)|1,5,$64,$00,(2<<3)|1,3,$35,$c0 + dc.b (2<<3)|7,6,$62,$c0,0 + even + +; 170 (17 passes, 563 height, 154 blits) + dc.b (5<<3)|5,85,$76,$c0 + dc.b (4<<3)|6,85,$76,$c0 + dc.b (0<<3)|5,40,$a0,$00,(1<<3)|5,40,$6e,$00 + dc.b (2<<3)|6,55,$6e,$00 + dc.b (2<<3)|5,34,$3c,$00 + dc.b (4<<3)|7,79,$14,$00 + dc.b (1<<3)|6,37,$b2,$c0,(3<<3)|6,34,$3c,$00 + dc.b (3<<3)|5,10,$0d,$c0 + dc.b (1<<3)|2,10,$a6,$40 + dc.b (3<<3)|7,27,$1a,$40 + dc.b (0<<3)|1,7,$97,$40 + dc.b (4<<3)|5,5,$0d,$c0 + dc.b (1<<3)|1,5,$67,$c0,(2<<3)|1,4,$37,$00 + dc.b (2<<3)|7,6,$66,$80,0 + even + +; 171 (19 passes, 579 height, 166 blits) + dc.b (5<<3)|5,95,$6a,$40 + dc.b (4<<3)|6,95,$6a,$40 + dc.b (0<<3)|5,41,$a5,$00,(1<<3)|5,40,$73,$00 + dc.b (2<<3)|6,56,$73,$00 + dc.b (2<<3)|5,35,$3f,$c0 + dc.b (4<<3)|7,68,$15,$40 + dc.b (3<<3)|6,35,$3f,$c0,(1<<3)|6,32,$b9,$00 + dc.b (3<<3)|5,12,$0f,$00 + dc.b (1<<3)|2,10,$ac,$80 + dc.b (3<<3)|7,27,$1e,$00 + dc.b (0<<3)|1,8,$9b,$00,(1<<3)|1,7,$6a,$40 + dc.b (4<<3)|5,5,$0f,$00 + dc.b (2<<3)|1,5,$39,$80 + dc.b (2<<3)|7,6,$6b,$80 + dc.b (3<<3)|1,1,$0d,$c0,(4<<3)|1,1,$0d,$c0,0 + even + +; 172 (19 passes, 591 height, 166 blits) + dc.b (5<<3)|5,102,$61,$80 + dc.b (4<<3)|6,102,$61,$80 + dc.b (1<<3)|5,42,$76,$c0,(0<<3)|5,41,$ab,$40 + dc.b (2<<3)|6,58,$76,$c0 + dc.b (2<<3)|5,37,$42,$40 + dc.b (3<<3)|6,37,$42,$40 + dc.b (4<<3)|7,61,$15,$40 + dc.b (1<<3)|6,27,$bf,$40 + dc.b (3<<3)|5,14,$0f,$00 + dc.b (1<<3)|2,10,$b2,$c0 + dc.b (3<<3)|7,27,$20,$80 + dc.b (0<<3)|1,9,$a0,$00,(1<<3)|1,7,$6e,$00 + dc.b (4<<3)|5,5,$0f,$00 + dc.b (2<<3)|1,5,$3c,$00 + dc.b (2<<3)|7,5,$70,$80 + dc.b (3<<3)|1,1,$0d,$c0,(4<<3)|1,1,$0d,$c0,0 + even + +; 173 (18 passes, 598 height, 160 blits) + dc.b (5<<3)|5,111,$56,$40 + dc.b (4<<3)|6,111,$56,$40 + dc.b (1<<3)|5,42,$7a,$80 + dc.b (2<<3)|6,62,$7a,$80 + dc.b (0<<3)|5,40,$af,$00,(2<<3)|5,38,$46,$00 + dc.b (3<<3)|6,38,$46,$00 + dc.b (4<<3)|7,52,$15,$40 + dc.b (3<<3)|5,16,$10,$40 + dc.b (1<<3)|6,20,$c8,$00 + dc.b (1<<3)|2,12,$b9,$00 + dc.b (3<<3)|7,27,$24,$40 + dc.b (0<<3)|1,8,$a5,$00,(1<<3)|1,6,$73,$00 + dc.b (4<<3)|5,5,$0f,$00 + dc.b (2<<3)|1,5,$3f,$c0 + dc.b (2<<3)|7,4,$75,$80 + dc.b (3<<3)|1,1,$0f,$00,0 + even + +; 174 (18 passes, 607 height, 160 blits) + dc.b (5<<3)|5,119,$4c,$40 + dc.b (4<<3)|6,119,$4c,$40 + dc.b (1<<3)|5,44,$7f,$80 + dc.b (2<<3)|6,64,$7f,$80 + dc.b (2<<3)|5,40,$48,$80,(0<<3)|5,34,$b6,$80 + dc.b (3<<3)|6,40,$48,$80 + dc.b (3<<3)|5,16,$12,$c0 + dc.b (4<<3)|7,44,$15,$40 + dc.b (1<<3)|2,13,$bf,$40 + dc.b (1<<3)|6,14,$cf,$80 + dc.b (3<<3)|7,27,$26,$c0 + dc.b (0<<3)|1,9,$ab,$40,(1<<3)|1,7,$76,$c0 + dc.b (4<<3)|5,5,$0f,$00 + dc.b (2<<3)|1,5,$42,$40,(3<<3)|1,3,$0f,$00 + dc.b (2<<3)|7,4,$7a,$80,0 + even + +; 175 (19 passes, 612 height, 166 blits) + dc.b (5<<3)|5,125,$44,$c0 + dc.b (4<<3)|6,125,$44,$c0 + dc.b (1<<3)|5,45,$84,$80 + dc.b (2<<3)|6,66,$84,$80 + dc.b (2<<3)|5,41,$4d,$80,(0<<3)|5,29,$bc,$c0 + dc.b (3<<3)|6,41,$4d,$80 + dc.b (3<<3)|5,18,$15,$40 + dc.b (4<<3)|7,37,$16,$80 + dc.b (1<<3)|2,12,$c8,$00 + dc.b (0<<3)|1,11,$af,$00 + dc.b (3<<3)|7,27,$2b,$c0 + dc.b (1<<3)|1,8,$7a,$80 + dc.b (1<<3)|6,8,$d7,$00 + dc.b (2<<3)|1,6,$46,$00 + dc.b (4<<3)|5,5,$10,$40 + dc.b (3<<3)|1,4,$10,$40 + dc.b (2<<3)|7,3,$80,$c0 + dc.b (4<<3)|1,1,$0f,$00,0 + even + +; 176 (19 passes, 614 height, 166 blits) + dc.b (5<<3)|5,131,$3d,$40 + dc.b (4<<3)|6,131,$3d,$40 + dc.b (1<<3)|5,46,$89,$80 + dc.b (2<<3)|6,68,$89,$80 + dc.b (2<<3)|5,44,$50,$00 + dc.b (3<<3)|6,44,$50,$00 + dc.b (0<<3)|5,24,$c3,$00,(3<<3)|5,18,$17,$c0 + dc.b (1<<3)|2,12,$cf,$80 + dc.b (4<<3)|7,31,$16,$80,(3<<3)|7,27,$2e,$40 + dc.b (0<<3)|1,10,$b6,$80,(1<<3)|1,8,$7f,$80,(2<<3)|1,6,$48,$80 + dc.b (4<<3)|5,5,$10,$40 + dc.b (3<<3)|1,4,$12,$c0 + dc.b (1<<3)|6,2,$de,$80 + dc.b (4<<3)|1,1,$0f,$00 + dc.b (2<<3)|7,2,$87,$00,0 + even + +; 177 (19 passes, 620 height, 156 blits) + dc.b (5<<3)|5,127,$35,$c0 + dc.b (4<<3)|6,137,$35,$c0 + dc.b (1<<3)|5,47,$8d,$40,(2<<3)|5,46,$53,$c0 + dc.b (2<<3)|6,66,$8e,$80,(3<<3)|6,47,$53,$c0 + dc.b (0<<3)|5,20,$c8,$00,(3<<3)|5,20,$19,$00,(6<<3)|5,10,$d4,$80 + dc.b (5<<3)|2,10,$d4,$80 + dc.b (3<<3)|7,27,$32,$00,(4<<3)|7,25,$16,$80 + dc.b (0<<3)|1,9,$bc,$c0 + dc.b (1<<3)|2,8,$d7,$00 + dc.b (1<<3)|1,7,$84,$80 + dc.b (4<<3)|5,5,$10,$40 + dc.b (2<<3)|1,5,$4d,$80,(3<<3)|1,3,$15,$40 + dc.b (2<<3)|2,1,$8d,$40,0 + even + +; 178 (19 passes, 627 height, 156 blits) + dc.b (5<<3)|5,121,$2f,$80 + dc.b (4<<3)|6,142,$2f,$80 + dc.b (1<<3)|5,48,$92,$40,(2<<3)|5,47,$57,$80 + dc.b (2<<3)|6,61,$94,$c0,(3<<3)|6,49,$57,$80 + dc.b (3<<3)|5,21,$1b,$80,(6<<3)|5,21,$c6,$c0 + dc.b (5<<3)|2,21,$c6,$c0 + dc.b (0<<3)|5,15,$ce,$40 + dc.b (3<<3)|7,27,$35,$c0 + dc.b (0<<3)|1,9,$c3,$00 + dc.b (4<<3)|7,20,$16,$80 + dc.b (1<<3)|1,7,$89,$80,(2<<3)|1,6,$50,$00 + dc.b (4<<3)|5,5,$10,$40 + dc.b (3<<3)|1,3,$17,$c0 + dc.b (1<<3)|2,2,$de,$80,(2<<3)|2,2,$92,$40,0 + even + +; 179 (19 passes, 641 height, 157 blits) + dc.b (4<<3)|3,31,$ba,$40 + dc.b (5<<3)|5,116,$29,$40 + dc.b (4<<3)|6,116,$29,$40 + dc.b (1<<3)|5,49,$98,$80,(2<<3)|5,49,$5b,$40 + dc.b (2<<3)|6,55,$9c,$40,(3<<3)|6,52,$5b,$40 + dc.b (6<<3)|5,31,$ba,$40,(3<<3)|5,24,$1c,$c0 + dc.b (5<<3)|6,31,$ba,$40 + dc.b (0<<3)|1,11,$c8,$00 + dc.b (0<<3)|5,9,$d5,$c0 + dc.b (3<<3)|7,26,$3a,$c0 + dc.b (1<<3)|1,9,$8d,$40 + dc.b (4<<3)|7,15,$16,$80 + dc.b (2<<3)|1,6,$53,$c0 + dc.b (4<<3)|5,5,$10,$40 + dc.b (2<<3)|2,3,$98,$80 + dc.b (3<<3)|1,3,$19,$00,0 + even + +; 180 (20 passes, 653 height, 171 blits) + dc.b (4<<3)|3,52,$a0,$00 + dc.b (5<<3)|5,99,$24,$40 + dc.b (4<<3)|6,99,$24,$40 + dc.b (2<<3)|5,51,$5f,$00,(1<<3)|5,50,$9e,$c0,(6<<3)|5,40,$af,$00 + dc.b (3<<3)|6,56,$5f,$00,(2<<3)|6,48,$a5,$00,(5<<3)|6,40,$af,$00 + dc.b (3<<3)|5,25,$1f,$40 + dc.b (0<<3)|1,12,$ce,$40 + dc.b (3<<3)|7,26,$3e,$80 + dc.b (1<<3)|1,10,$92,$40,(2<<3)|1,6,$57,$80 + dc.b (4<<3)|5,5,$10,$40 + dc.b (2<<3)|2,5,$9e,$c0 + dc.b (5<<3)|7,12,$a0,$00,(4<<3)|7,11,$16,$80 + dc.b (0<<3)|5,3,$dd,$40 + dc.b (3<<3)|1,3,$1b,$80,0 + even + +; 181 (20 passes, 628 height, 169 blits) + dc.b (4<<3)|3,45,$82,$00 + dc.b (5<<3)|5,78,$20,$80,(2<<3)|5,52,$64,$00 + dc.b (4<<3)|6,76,$23,$00 + dc.b (1<<3)|5,48,$a5,$00,(6<<3)|5,48,$a5,$00 + dc.b (3<<3)|6,59,$64,$00,(5<<3)|6,48,$a5,$00 + dc.b (3<<3)|5,27,$23,$00 + dc.b (2<<3)|6,41,$ad,$c0 + dc.b (5<<3)|7,28,$82,$00,(3<<3)|7,25,$44,$c0 + dc.b (1<<3)|1,10,$98,$80,(0<<3)|1,9,$d5,$c0 + dc.b (2<<3)|2,7,$a5,$00 + dc.b (2<<3)|1,7,$5b,$40 + dc.b (4<<3)|5,5,$11,$80 + dc.b (3<<3)|1,5,$1c,$c0 + dc.b (4<<3)|7,9,$17,$c0 + dc.b (4<<3)|1,1,$10,$40,0 + even + +; 182 (20 passes, 616 height, 169 blits) + dc.b (4<<3)|3,51,$60,$40 + dc.b (5<<3)|5,58,$17,$c0,(6<<3)|5,57,$99,$c0,(2<<3)|5,52,$6a,$40,(1<<3)|5,43,$ab,$40 + dc.b (3<<3)|6,63,$6a,$40,(5<<3)|6,57,$99,$c0 + dc.b (3<<3)|5,30,$28,$00 + dc.b (4<<3)|6,45,$28,$00,(2<<3)|6,32,$b9,$00 + dc.b (5<<3)|7,46,$60,$40 + dc.b (2<<3)|2,11,$ab,$40 + dc.b (1<<3)|1,10,$9e,$c0 + dc.b (3<<3)|7,23,$4d,$80 + dc.b (2<<3)|1,9,$5f,$00,(3<<3)|1,7,$1f,$40 + dc.b (4<<3)|5,5,$11,$80 + dc.b (4<<3)|7,13,$17,$c0 + dc.b (0<<3)|1,3,$dd,$40,(4<<3)|1,1,$10,$40,0 + even + +; 183 (18 passes, 594 height, 157 blits) + dc.b (4<<3)|3,38,$52,$80 + dc.b (6<<3)|5,64,$91,$00,(2<<3)|5,55,$6e,$00,(5<<3)|5,47,$14,$00 + dc.b (3<<3)|6,68,$6e,$00,(5<<3)|6,64,$91,$00 + dc.b (1<<3)|5,37,$b2,$c0,(3<<3)|5,32,$2a,$80 + dc.b (4<<3)|6,32,$2a,$80 + dc.b (5<<3)|7,53,$4e,$c0 + dc.b (2<<3)|6,24,$c3,$00 + dc.b (2<<3)|2,13,$b2,$c0 + dc.b (1<<3)|1,11,$a5,$00 + dc.b (3<<3)|7,22,$52,$80 + dc.b (2<<3)|1,8,$64,$00 + dc.b (4<<3)|7,15,$17,$c0 + dc.b (3<<3)|1,6,$23,$00 + dc.b (4<<3)|5,5,$11,$80,0 + even + +; 184 (14 passes, 670 height, 116 blits) + dc.b (5<<3)|5,133,$3a,$c0,(3<<3)|5,89,$52,$80 + dc.b (4<<3)|6,114,$52,$80 + dc.b (2<<3)|1,71,$6a,$40,(6<<3)|1,57,$99,$c0,(1<<3)|1,43,$ab,$40,(3<<3)|1,34,$28,$00 + dc.b (2<<3)|5,24,$c3,$00 + dc.b (5<<3)|1,28,$17,$c0 + dc.b (4<<3)|7,47,$17,$c0 + dc.b (3<<3)|6,24,$c3,$00 + dc.b (4<<3)|5,3,$14,$00 + dc.b (4<<3)|1,2,$11,$80 + dc.b (3<<3)|7,1,$c1,$c0,0 + even + +; 185 (7 passes, 669 height, 44 blits) + dc.b (4<<3)|5,161,$17,$c0 + dc.b (5<<3)|1,164,$14,$00,(3<<3)|1,146,$2a,$80,(2<<3)|1,92,$6e,$00,(6<<3)|1,64,$91,$00,(1<<3)|1,37,$b2,$c0,(4<<3)|1,5,$11,$80,0 + even + +; 186 (4 passes, 435 height, 24 blits) + dc.b (4<<3)|1,164,$14,$00,(5<<3)|1,133,$3a,$c0,(3<<3)|1,114,$52,$80,(2<<3)|1,24,$c3,$00,0 + even + +; 187 (16 passes, 656 height, 143 blits) + dc.b (4<<3)|3,92,$6e,$00 + dc.b (6<<3)|5,84,$6f,$40,(2<<3)|5,60,$83,$40 + dc.b (5<<3)|6,91,$6f,$40,(3<<3)|6,75,$83,$40 + dc.b (3<<3)|5,44,$37,$00 + dc.b (4<<3)|6,44,$37,$00 + dc.b (5<<3)|7,61,$23,$00 + dc.b (1<<3)|5,15,$ce,$40,(5<<3)|5,14,$11,$80 + dc.b (2<<3)|2,15,$ce,$40 + dc.b (4<<3)|7,25,$17,$c0 + dc.b (7<<3)|5,7,$d8,$40 + dc.b (6<<3)|2,7,$d8,$40 + dc.b (3<<3)|7,17,$6e,$00 + dc.b (4<<3)|5,5,$11,$80,0 + even + +; 188 (16 passes, 655 height, 143 blits) + dc.b (4<<3)|3,82,$7a,$80 + dc.b (6<<3)|5,81,$66,$80 + dc.b (5<<3)|6,98,$66,$80 + dc.b (2<<3)|5,62,$8a,$c0,(3<<3)|5,50,$3c,$00 + dc.b (3<<3)|6,69,$8a,$c0,(4<<3)|6,50,$3c,$00 + dc.b (5<<3)|7,63,$17,$c0 + dc.b (7<<3)|5,17,$cb,$c0 + dc.b (6<<3)|2,17,$cb,$c0 + dc.b (4<<3)|7,29,$17,$c0 + dc.b (1<<3)|5,7,$d8,$40 + dc.b (2<<3)|2,7,$d8,$40 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (3<<3)|7,13,$7a,$80,0 + even + +; 189 (18 passes, 606 height, 157 blits) + dc.b (6<<3)|5,79,$60,$40 + dc.b (5<<3)|6,100,$60,$40 + dc.b (2<<3)|5,64,$91,$00,(3<<3)|5,53,$41,$00 + dc.b (3<<3)|6,64,$91,$00,(4<<3)|6,53,$41,$00 + dc.b (5<<3)|3,3,$dd,$40 + dc.b (7<<3)|5,24,$c3,$00 + dc.b (5<<3)|7,58,$17,$c0 + dc.b (6<<3)|2,17,$c3,$00 + dc.b (1<<3)|1,15,$ce,$40 + dc.b (4<<3)|7,33,$17,$c0 + dc.b (2<<3)|1,11,$83,$40,(3<<3)|1,8,$37,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (3<<3)|7,11,$83,$40 + dc.b (6<<3)|6,3,$dd,$40,0 + even + +; 190 (18 passes, 610 height, 157 blits) + dc.b (5<<3)|3,22,$c5,$80 + dc.b (6<<3)|5,77,$5b,$40,(2<<3)|5,58,$98,$80,(3<<3)|5,58,$44,$c0 + dc.b (5<<3)|6,85,$5b,$40,(3<<3)|6,58,$98,$80,(4<<3)|6,58,$44,$c0 + dc.b (7<<3)|5,30,$bb,$80 + dc.b (5<<3)|7,54,$17,$c0 + dc.b (6<<3)|6,22,$c5,$80 + dc.b (4<<3)|7,36,$17,$c0 + dc.b (2<<3)|1,11,$8a,$c0 + dc.b (6<<3)|2,8,$bb,$80 + dc.b (1<<3)|1,7,$d8,$40,(3<<3)|1,7,$3c,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (3<<3)|7,9,$8d,$40,0 + even + +; 191 (17 passes, 612 height, 151 blits) + dc.b (5<<3)|3,31,$b6,$80 + dc.b (6<<3)|5,74,$55,$00,(3<<3)|5,63,$48,$80,(2<<3)|5,53,$9e,$c0 + dc.b (5<<3)|6,78,$55,$00,(4<<3)|6,63,$48,$80 + dc.b (7<<3)|5,38,$b1,$80 + dc.b (3<<3)|6,53,$9e,$c0,(6<<3)|6,34,$b6,$80 + dc.b (5<<3)|7,49,$17,$c0,(4<<3)|7,39,$17,$c0 + dc.b (2<<3)|1,11,$91,$00,(3<<3)|1,6,$41,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (6<<3)|2,4,$b1,$80 + dc.b (3<<3)|7,6,$97,$40,0 + even + +; 192 (18 passes, 612 height, 149 blits) + dc.b (5<<3)|3,24,$a7,$80 + dc.b (6<<3)|5,71,$4e,$c0,(3<<3)|5,70,$51,$40 + dc.b (4<<3)|6,71,$51,$40,(5<<3)|6,71,$4e,$c0 + dc.b (7<<3)|5,46,$a7,$80,(2<<3)|5,45,$a8,$c0 + dc.b (6<<3)|6,46,$a7,$80,(3<<3)|6,44,$aa,$00 + dc.b (4<<3)|7,45,$19,$00,(5<<3)|7,43,$19,$00 + dc.b (2<<3)|1,13,$98,$80,(3<<3)|1,10,$44,$c0 + dc.b (4<<3)|5,5,$12,$c0,(5<<3)|5,5,$12,$c0 + dc.b (3<<3)|2,1,$a8,$c0 + dc.b (4<<3)|1,1,$11,$80,(5<<3)|1,1,$11,$80,0 + even + +; 193 (17 passes, 612 height, 151 blits) + dc.b (5<<3)|3,22,$9b,$00 + dc.b (3<<3)|5,72,$55,$00,(6<<3)|5,65,$49,$c0,(7<<3)|5,52,$a0,$00 + dc.b (4<<3)|6,78,$55,$00,(5<<3)|6,65,$49,$c0 + dc.b (2<<3)|5,40,$af,$00 + dc.b (6<<3)|6,52,$a0,$00,(3<<3)|6,34,$b6,$80 + dc.b (4<<3)|7,49,$17,$c0,(5<<3)|7,40,$17,$c0 + dc.b (2<<3)|1,13,$9e,$c0,(3<<3)|1,10,$48,$80 + dc.b (3<<3)|2,6,$af,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (6<<3)|7,4,$9b,$00,0 + even + +; 194 (17 passes, 607 height, 151 blits) + dc.b (5<<3)|3,19,$8f,$c0 + dc.b (3<<3)|5,76,$5a,$00,(6<<3)|5,60,$44,$c0,(7<<3)|5,58,$98,$80 + dc.b (4<<3)|6,86,$5a,$00,(5<<3)|6,60,$44,$c0,(6<<3)|6,58,$98,$80 + dc.b (2<<3)|5,32,$b9,$00 + dc.b (4<<3)|7,53,$17,$c0 + dc.b (3<<3)|6,22,$c5,$80 + dc.b (5<<3)|7,36,$17,$c0 + dc.b (2<<3)|1,13,$a8,$c0 + dc.b (3<<3)|2,10,$b9,$00 + dc.b (3<<3)|1,7,$51,$40 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (6<<3)|7,7,$8f,$c0,0 + even + +; 195 (17 passes, 611 height, 151 blits) + dc.b (5<<3)|3,19,$83,$40 + dc.b (3<<3)|5,79,$60,$40,(7<<3)|5,63,$92,$40 + dc.b (4<<3)|6,95,$60,$40 + dc.b (6<<3)|5,53,$41,$00 + dc.b (6<<3)|6,63,$92,$40,(5<<3)|6,53,$41,$00 + dc.b (2<<3)|5,24,$c3,$00 + dc.b (4<<3)|7,58,$17,$c0 + dc.b (3<<3)|2,16,$c3,$00 + dc.b (2<<3)|1,16,$af,$00 + dc.b (5<<3)|7,33,$17,$c0 + dc.b (3<<3)|1,9,$55,$00 + dc.b (3<<3)|6,8,$d7,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80 + dc.b (6<<3)|7,12,$83,$40,0 + even + +; 196 (18 passes, 611 height, 155 blits) + dc.b (5<<3)|3,17,$7a,$80 + dc.b (3<<3)|5,81,$66,$80 + dc.b (4<<3)|6,98,$66,$80 + dc.b (7<<3)|5,63,$8c,$00,(6<<3)|5,49,$3d,$40 + dc.b (6<<3)|6,68,$8c,$00,(5<<3)|6,49,$3d,$40 + dc.b (4<<3)|7,63,$17,$c0 + dc.b (2<<3)|5,17,$cb,$c0 + dc.b (3<<3)|2,17,$cb,$c0 + dc.b (2<<3)|1,15,$b9,$00 + dc.b (5<<3)|7,30,$17,$c0 + dc.b (3<<3)|1,10,$5a,$00 + dc.b (4<<3)|5,5,$11,$80,(5<<3)|5,5,$11,$80,(8<<3)|5,5,$da,$c0 + dc.b (6<<3)|7,14,$7a,$80 + dc.b (7<<3)|2,5,$da,$c0,0 + even + +; 197 (18 passes, 605 height, 155 blits) + dc.b (5<<3)|3,17,$6e,$00 + dc.b (3<<3)|5,82,$6e,$00,(7<<3)|5,61,$84,$80 + dc.b (4<<3)|6,92,$6e,$00,(6<<3)|6,74,$84,$80 + dc.b (6<<3)|5,44,$37,$00 + dc.b (5<<3)|6,44,$37,$00 + dc.b (4<<3)|7,60,$23,$00 + dc.b (4<<3)|5,14,$11,$80,(8<<3)|5,13,$d0,$c0 + dc.b (7<<3)|2,13,$d0,$c0 + dc.b (2<<3)|1,14,$c3,$00 + dc.b (2<<3)|5,10,$d4,$80 + dc.b (3<<3)|1,11,$60,$40 + dc.b (5<<3)|7,25,$17,$c0 + dc.b (3<<3)|2,8,$d7,$00 + dc.b (6<<3)|7,18,$6e,$00 + dc.b (5<<3)|5,5,$11,$80,0 + even + +; 198 (16 passes, 598 height, 141 blits) + dc.b (5<<3)|3,16,$66,$80 + dc.b (3<<3)|5,86,$75,$80,(7<<3)|5,59,$7e,$40 + dc.b (4<<3)|6,86,$75,$80,(6<<3)|6,79,$7e,$40 + dc.b (6<<3)|5,41,$33,$40 + dc.b (5<<3)|6,41,$33,$40 + dc.b (4<<3)|5,21,$11,$80 + dc.b (4<<3)|7,59,$2b,$c0 + dc.b (8<<3)|5,20,$c8,$00 + dc.b (2<<3)|1,17,$cb,$c0 + dc.b (7<<3)|2,15,$c8,$00 + dc.b (3<<3)|1,12,$66,$80 + dc.b (5<<3)|7,22,$17,$c0,(6<<3)|7,19,$66,$80 + dc.b (5<<3)|5,5,$11,$80,0 + even + +; 199 (18 passes, 583 height, 154 blits) + dc.b (5<<3)|3,12,$5f,$00 + dc.b (3<<3)|5,80,$7d,$00,(7<<3)|5,58,$79,$40 + dc.b (4<<3)|6,80,$7d,$00,(6<<3)|6,78,$79,$40 + dc.b (6<<3)|3,5,$da,$c0 + dc.b (6<<3)|5,37,$30,$c0,(4<<3)|5,29,$11,$80,(8<<3)|5,25,$c1,$c0 + dc.b (5<<3)|6,37,$30,$c0 + dc.b (4<<3)|7,57,$35,$c0 + dc.b (7<<3)|2,12,$c1,$c0 + dc.b (3<<3)|1,12,$6e,$00,(2<<3)|1,10,$d4,$80 + dc.b (6<<3)|7,21,$5f,$00,(5<<3)|7,20,$17,$c0 + dc.b (5<<3)|5,5,$11,$80 + dc.b (7<<3)|6,5,$da,$c0,0 + even + +; 200 (17 passes, 576 height, 148 blits) + dc.b (6<<3)|3,14,$cf,$80,(5<<3)|3,11,$58,$c0 + dc.b (3<<3)|5,73,$85,$c0,(7<<3)|5,56,$74,$40 + dc.b (4<<3)|6,73,$85,$c0,(6<<3)|6,73,$74,$40 + dc.b (4<<3)|5,38,$11,$80,(6<<3)|5,35,$2d,$00,(8<<3)|5,31,$ba,$40 + dc.b (5<<3)|6,35,$2d,$00 + dc.b (4<<3)|7,55,$41,$00 + dc.b (3<<3)|1,13,$75,$80 + dc.b (7<<3)|2,11,$ba,$40 + dc.b (7<<3)|6,14,$cf,$80 + dc.b (6<<3)|7,22,$58,$c0,(5<<3)|7,17,$17,$c0 + dc.b (5<<3)|5,5,$11,$80,0 + even + +; 201 (18 passes, 575 height, 154 blits) + dc.b (6<<3)|3,17,$c5,$80,(5<<3)|3,9,$53,$c0 + dc.b (3<<3)|5,66,$8e,$80,(7<<3)|5,55,$6e,$00,(4<<3)|5,47,$14,$00 + dc.b (6<<3)|6,70,$6e,$00,(4<<3)|6,66,$8e,$80 + dc.b (8<<3)|5,37,$b2,$c0,(6<<3)|5,33,$2a,$80 + dc.b (5<<3)|6,33,$2a,$80 + dc.b (4<<3)|7,51,$4e,$c0 + dc.b (7<<3)|6,22,$c5,$80 + dc.b (3<<3)|1,14,$7d,$00 + dc.b (7<<3)|2,12,$b2,$c0 + dc.b (6<<3)|7,21,$53,$c0,(5<<3)|7,15,$17,$c0 + dc.b (5<<3)|5,5,$11,$80 + dc.b (4<<3)|1,2,$11,$80,0 + even + +; 202 (17 passes, 574 height, 151 blits) + dc.b (6<<3)|3,18,$b9,$00 + dc.b (3<<3)|5,59,$97,$40,(4<<3)|5,58,$17,$c0,(7<<3)|5,52,$6a,$40,(8<<3)|5,43,$ab,$40 + dc.b (6<<3)|6,63,$6a,$40,(4<<3)|6,59,$97,$40 + dc.b (6<<3)|5,30,$28,$00 + dc.b (5<<3)|6,45,$28,$00,(7<<3)|6,32,$b9,$00 + dc.b (4<<3)|7,44,$60,$40 + dc.b (3<<3)|1,14,$85,$c0 + dc.b (7<<3)|2,11,$ab,$40 + dc.b (6<<3)|7,23,$4d,$80 + dc.b (5<<3)|5,5,$11,$80 + dc.b (5<<3)|7,13,$17,$c0 + dc.b (4<<3)|1,5,$11,$80,0 + even + +; 203 (17 passes, 598 height, 151 blits) + dc.b (6<<3)|3,17,$b0,$40 + dc.b (4<<3)|5,78,$20,$80,(7<<3)|5,52,$64,$00 + dc.b (5<<3)|6,76,$23,$00 + dc.b (3<<3)|5,48,$a5,$00,(8<<3)|5,48,$a5,$00 + dc.b (6<<3)|6,61,$64,$00,(4<<3)|6,48,$a5,$00 + dc.b (6<<3)|5,27,$23,$00 + dc.b (7<<3)|6,39,$b0,$40 + dc.b (3<<3)|1,18,$8e,$80 + dc.b (4<<3)|7,28,$82,$00,(6<<3)|7,25,$44,$c0 + dc.b (4<<3)|1,10,$14,$00 + dc.b (7<<3)|2,9,$a5,$00 + dc.b (5<<3)|5,5,$11,$80 + dc.b (5<<3)|7,9,$17,$c0,0 + even + +; 204 (19 passes, 618 height, 165 blits) + dc.b (6<<3)|3,16,$a5,$00 + dc.b (4<<3)|5,99,$24,$40 + dc.b (5<<3)|6,99,$24,$40 + dc.b (7<<3)|5,51,$5f,$00,(8<<3)|5,50,$9e,$c0,(3<<3)|5,43,$ab,$40 + dc.b (6<<3)|6,56,$5f,$00,(7<<3)|6,48,$a5,$00,(4<<3)|6,43,$ab,$40 + dc.b (6<<3)|5,25,$1f,$40 + dc.b (3<<3)|1,16,$97,$40 + dc.b (6<<3)|7,26,$3e,$80 + dc.b (4<<3)|1,10,$17,$c0 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|2,5,$9e,$c0 + dc.b (5<<3)|7,11,$16,$80,(4<<3)|7,9,$a0,$00 + dc.b (9<<3)|5,3,$dd,$40 + dc.b (8<<3)|2,3,$dd,$40,0 + even + +; 205 (19 passes, 630 height, 157 blits) + dc.b (6<<3)|3,15,$9d,$80 + dc.b (4<<3)|5,113,$29,$40 + dc.b (5<<3)|6,116,$29,$40 + dc.b (7<<3)|5,49,$5b,$40,(8<<3)|5,49,$98,$80 + dc.b (7<<3)|6,54,$9d,$80,(6<<3)|6,53,$5b,$40 + dc.b (3<<3)|5,34,$b6,$80,(6<<3)|5,24,$1c,$c0 + dc.b (4<<3)|6,31,$ba,$40 + dc.b (3<<3)|1,14,$a5,$00 + dc.b (9<<3)|5,9,$d5,$c0 + dc.b (6<<3)|7,26,$3a,$c0 + dc.b (8<<3)|2,9,$d5,$c0 + dc.b (4<<3)|1,7,$20,$80 + dc.b (5<<3)|7,15,$16,$80 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|2,4,$98,$80,(4<<3)|2,3,$b6,$80,0 + even + +; 206 (18 passes, 656 height, 147 blits) + dc.b (4<<3)|5,121,$2f,$80 + dc.b (6<<3)|3,13,$94,$c0 + dc.b (5<<3)|6,142,$2f,$80 + dc.b (8<<3)|5,48,$92,$40,(7<<3)|5,47,$57,$80 + dc.b (7<<3)|6,61,$94,$c0,(6<<3)|6,49,$57,$80 + dc.b (3<<3)|5,21,$c6,$c0,(6<<3)|5,21,$1b,$80 + dc.b (4<<3)|2,21,$c6,$c0 + dc.b (3<<3)|1,22,$ab,$40 + dc.b (9<<3)|5,15,$ce,$40 + dc.b (8<<3)|2,12,$ce,$40 + dc.b (6<<3)|7,27,$35,$c0 + dc.b (4<<3)|1,9,$24,$40 + dc.b (5<<3)|7,20,$16,$80 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|2,2,$92,$40,0 + even + +; 207 (18 passes, 645 height, 147 blits) + dc.b (4<<3)|5,127,$35,$c0 + dc.b (6<<3)|3,12,$8e,$80 + dc.b (5<<3)|6,137,$35,$c0 + dc.b (8<<3)|5,47,$8d,$40,(7<<3)|5,46,$53,$c0 + dc.b (7<<3)|6,66,$8e,$80,(6<<3)|6,47,$53,$c0 + dc.b (3<<3)|1,24,$b6,$80 + dc.b (6<<3)|5,20,$19,$00,(9<<3)|5,20,$c8,$00 + dc.b (8<<3)|2,11,$c8,$00 + dc.b (3<<3)|5,10,$d4,$80 + dc.b (4<<3)|2,10,$d4,$80 + dc.b (6<<3)|7,27,$32,$00,(5<<3)|7,25,$16,$80 + dc.b (4<<3)|1,10,$29,$40 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|2,1,$8d,$40,0 + even + +; 208 (16 passes, 625 height, 141 blits) + dc.b (4<<3)|5,131,$3d,$40 + dc.b (5<<3)|6,131,$3d,$40 + dc.b (6<<3)|3,10,$88,$40 + dc.b (7<<3)|6,70,$89,$80 + dc.b (8<<3)|5,46,$89,$80,(7<<3)|5,45,$50,$00 + dc.b (6<<3)|6,45,$50,$00 + dc.b (9<<3)|5,24,$c3,$00,(6<<3)|5,19,$17,$c0 + dc.b (3<<3)|1,21,$c6,$c0 + dc.b (5<<3)|7,31,$16,$80 + dc.b (4<<3)|1,11,$2f,$80 + dc.b (6<<3)|7,26,$2f,$80 + dc.b (8<<3)|2,9,$c3,$00 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|7,1,$88,$40,0 + even + +; 209 (18 passes, 620 height, 154 blits) + dc.b (4<<3)|5,125,$44,$c0 + dc.b (6<<3)|3,11,$80,$c0 + dc.b (5<<3)|6,125,$44,$c0 + dc.b (7<<3)|3,8,$d7,$00 + dc.b (8<<3)|5,45,$84,$80 + dc.b (7<<3)|6,66,$84,$80 + dc.b (7<<3)|5,41,$4d,$80,(9<<3)|5,29,$bc,$c0 + dc.b (6<<3)|6,41,$4d,$80 + dc.b (6<<3)|5,18,$15,$40 + dc.b (5<<3)|7,37,$16,$80 + dc.b (4<<3)|1,12,$35,$c0 + dc.b (6<<3)|7,27,$2b,$c0 + dc.b (3<<3)|1,10,$d4,$80 + dc.b (8<<3)|2,9,$bc,$c0 + dc.b (8<<3)|6,8,$d7,$00 + dc.b (5<<3)|5,5,$10,$40 + dc.b (7<<3)|7,3,$80,$c0,0 + even + +; 210 (17 passes, 615 height, 148 blits) + dc.b (4<<3)|5,119,$4c,$40 + dc.b (7<<3)|3,12,$d2,$00 + dc.b (5<<3)|6,119,$4c,$40 + dc.b (6<<3)|3,9,$7d,$00 + dc.b (8<<3)|5,44,$7f,$80 + dc.b (7<<3)|6,66,$7f,$80 + dc.b (7<<3)|5,42,$48,$80,(9<<3)|5,34,$b6,$80 + dc.b (6<<3)|6,42,$48,$80 + dc.b (6<<3)|5,16,$12,$c0 + dc.b (5<<3)|7,44,$15,$40 + dc.b (4<<3)|1,12,$3d,$40 + dc.b (8<<3)|2,10,$b6,$80 + dc.b (6<<3)|7,27,$26,$c0 + dc.b (8<<3)|6,12,$d2,$00 + dc.b (5<<3)|5,5,$0f,$00 + dc.b (7<<3)|7,2,$7d,$00,0 + even + +; 211 (17 passes, 612 height, 148 blits) + dc.b (4<<3)|5,111,$56,$40 + dc.b (7<<3)|3,12,$c8,$00,(6<<3)|3,9,$75,$80 + dc.b (5<<3)|6,111,$56,$40 + dc.b (8<<3)|5,42,$7a,$80 + dc.b (7<<3)|6,62,$7a,$80 + dc.b (9<<3)|5,40,$af,$00,(7<<3)|5,38,$46,$00 + dc.b (6<<3)|6,38,$46,$00 + dc.b (5<<3)|7,52,$15,$40 + dc.b (6<<3)|5,16,$10,$40 + dc.b (8<<3)|6,20,$c8,$00 + dc.b (4<<3)|1,14,$44,$c0 + dc.b (8<<3)|2,11,$af,$00 + dc.b (6<<3)|7,27,$24,$40 + dc.b (5<<3)|5,5,$0f,$00 + dc.b (7<<3)|7,4,$75,$80,0 + even + +; 212 (18 passes, 610 height, 154 blits) + dc.b (7<<3)|3,14,$c0,$80 + dc.b (4<<3)|5,104,$5f,$00 + dc.b (6<<3)|3,10,$70,$80 + dc.b (5<<3)|6,104,$5f,$00 + dc.b (8<<3)|5,42,$76,$c0,(9<<3)|5,41,$ab,$40 + dc.b (7<<3)|6,59,$76,$c0 + dc.b (7<<3)|5,37,$42,$40 + dc.b (6<<3)|6,37,$42,$40 + dc.b (5<<3)|7,59,$15,$40 + dc.b (8<<3)|6,26,$c0,$80 + dc.b (6<<3)|5,14,$0f,$00 + dc.b (4<<3)|1,15,$4c,$40 + dc.b (6<<3)|7,27,$20,$80 + dc.b (8<<3)|2,9,$ab,$40 + dc.b (5<<3)|5,5,$0f,$00 + dc.b (9<<3)|2,2,$de,$80 + dc.b (7<<3)|7,5,$70,$80,0 + even + +; 213 (18 passes, 597 height, 154 blits) + dc.b (7<<3)|3,12,$b9,$00 + dc.b (4<<3)|5,95,$6a,$40 + dc.b (6<<3)|3,8,$6b,$80 + dc.b (5<<3)|6,95,$6a,$40 + dc.b (8<<3)|5,41,$73,$00,(9<<3)|5,41,$a6,$40 + dc.b (7<<3)|6,56,$73,$00 + dc.b (7<<3)|5,35,$3f,$c0 + dc.b (5<<3)|7,68,$15,$40 + dc.b (6<<3)|6,35,$3f,$c0,(8<<3)|6,32,$b9,$00 + dc.b (4<<3)|1,16,$56,$40 + dc.b (6<<3)|5,12,$0f,$00 + dc.b (6<<3)|7,27,$1e,$00 + dc.b (8<<3)|2,7,$a6,$40,(9<<3)|2,6,$d9,$80 + dc.b (5<<3)|5,5,$0f,$00 + dc.b (7<<3)|7,6,$6b,$80,0 + even + +; 214 (18 passes, 594 height, 154 blits) + dc.b (7<<3)|3,11,$b2,$c0 + dc.b (4<<3)|5,85,$76,$c0 + dc.b (6<<3)|3,8,$66,$80 + dc.b (5<<3)|6,85,$76,$c0 + dc.b (8<<3)|5,40,$6e,$00,(9<<3)|5,40,$a0,$00 + dc.b (7<<3)|6,55,$6e,$00 + dc.b (7<<3)|5,34,$3c,$00 + dc.b (5<<3)|7,79,$14,$00 + dc.b (8<<3)|6,37,$b2,$c0,(6<<3)|6,34,$3c,$00 + dc.b (4<<3)|1,19,$5f,$00 + dc.b (6<<3)|5,10,$0d,$c0 + dc.b (9<<3)|2,10,$d2,$00 + dc.b (6<<3)|7,27,$1a,$40 + dc.b (8<<3)|2,9,$a0,$00 + dc.b (5<<3)|5,5,$0d,$c0 + dc.b (7<<3)|7,6,$66,$80,0 + even + +; 215 (18 passes, 581 height, 154 blits) + dc.b (7<<3)|3,10,$ac,$80 + dc.b (4<<3)|5,76,$82,$00 + dc.b (6<<3)|3,7,$62,$c0 + dc.b (5<<3)|6,76,$82,$00 + dc.b (8<<3)|5,39,$6a,$40,(9<<3)|5,39,$9b,$00 + dc.b (7<<3)|6,53,$6a,$40 + dc.b (7<<3)|5,33,$39,$80 + dc.b (5<<3)|7,88,$14,$00 + dc.b (8<<3)|6,42,$ac,$80,(6<<3)|6,33,$39,$80 + dc.b (4<<3)|1,19,$6a,$40 + dc.b (9<<3)|2,11,$cb,$c0 + dc.b (6<<3)|7,27,$17,$c0 + dc.b (8<<3)|2,9,$9b,$00 + dc.b (6<<3)|5,8,$0d,$c0,(5<<3)|5,5,$0d,$c0 + dc.b (7<<3)|7,6,$62,$c0,0 + even + +; 216 (18 passes, 563 height, 154 blits) + dc.b (7<<3)|3,10,$a6,$40 + dc.b (4<<3)|5,62,$93,$80 + dc.b (6<<3)|3,7,$5d,$c0 + dc.b (5<<3)|6,62,$93,$80 + dc.b (8<<3)|5,38,$67,$c0,(9<<3)|5,38,$97,$40 + dc.b (5<<3)|7,102,$14,$00 + dc.b (7<<3)|6,50,$67,$c0 + dc.b (7<<3)|5,31,$37,$00 + dc.b (8<<3)|6,47,$a6,$40,(6<<3)|6,31,$37,$00 + dc.b (4<<3)|1,23,$76,$c0 + dc.b (6<<3)|7,27,$15,$40 + dc.b (9<<3)|2,9,$c6,$c0,(8<<3)|2,7,$97,$40 + dc.b (6<<3)|5,6,$0d,$c0,(5<<3)|5,5,$0d,$c0 + dc.b (7<<3)|7,8,$5d,$c0,0 + even + +; 217 (20 passes, 557 height, 170 blits) + dc.b (7<<3)|3,9,$a1,$40,(6<<3)|3,7,$5a,$00 + dc.b (4<<3)|5,46,$a7,$80 + dc.b (5<<3)|7,118,$14,$00 + dc.b (8<<3)|5,38,$64,$00,(9<<3)|5,37,$93,$80 + dc.b (8<<3)|6,51,$a1,$40,(7<<3)|6,49,$64,$00 + dc.b (7<<3)|5,29,$35,$c0 + dc.b (4<<3)|1,30,$82,$00 + dc.b (5<<3)|6,37,$a7,$80,(6<<3)|6,29,$35,$c0 + dc.b (6<<3)|7,27,$14,$00 + dc.b (5<<3)|2,9,$d5,$c0,(9<<3)|2,8,$c1,$c0 + dc.b (6<<3)|6,9,$d5,$c0 + dc.b (8<<3)|2,6,$93,$80 + dc.b (5<<3)|5,5,$0d,$c0,(6<<3)|5,5,$0d,$c0 + dc.b (7<<3)|7,8,$5a,$00,0 + even + +; 218 (22 passes, 575 height, 181 blits) + dc.b (7<<3)|3,10,$99,$c0,(6<<3)|3,7,$55,$00 + dc.b (5<<3)|7,127,$12,$c0 + dc.b (8<<3)|5,37,$60,$40,(9<<3)|5,37,$8e,$80 + dc.b (8<<3)|6,56,$99,$c0,(7<<3)|6,46,$60,$40 + dc.b (4<<3)|1,35,$93,$80 + dc.b (7<<3)|5,28,$32,$00,(4<<3)|5,27,$bf,$40 + dc.b (5<<3)|2,27,$bf,$40 + dc.b (6<<3)|6,38,$b1,$80,(6<<3)|6,28,$32,$00 + dc.b (5<<3)|5,11,$b1,$80 + dc.b (6<<3)|7,25,$12,$c0 + dc.b (8<<3)|3,1,$df,$c0 + dc.b (9<<3)|2,8,$bc,$c0,(8<<3)|2,7,$8e,$80 + dc.b (5<<3)|5,5,$0c,$80,(6<<3)|5,5,$0c,$80 + dc.b (7<<3)|7,9,$55,$00 + dc.b (9<<3)|6,1,$df,$c0,0 + even + +; 219 (22 passes, 584 height, 181 blits) + dc.b (7<<3)|3,10,$94,$c0 + dc.b (5<<3)|5,57,$89,$80 + dc.b (6<<3)|3,7,$51,$40,(8<<3)|3,6,$d9,$80 + dc.b (6<<3)|6,70,$89,$80,(8<<3)|6,55,$94,$c0 + dc.b (8<<3)|5,36,$5d,$c0,(9<<3)|5,36,$8a,$c0 + dc.b (5<<3)|7,95,$12,$c0 + dc.b (7<<3)|6,44,$5d,$c0 + dc.b (4<<3)|1,33,$a7,$80 + dc.b (7<<3)|5,27,$2f,$80 + dc.b (6<<3)|6,27,$2f,$80 + dc.b (4<<3)|5,13,$d0,$c0 + dc.b (6<<3)|7,23,$12,$c0 + dc.b (9<<3)|2,8,$b7,$c0,(8<<3)|2,7,$8a,$c0 + dc.b (5<<3)|5,5,$0c,$80,(6<<3)|5,5,$0c,$80 + dc.b (9<<3)|6,6,$d9,$80 + dc.b (5<<3)|2,4,$d0,$c0 + dc.b (7<<3)|7,10,$51,$40,0 + even + +; 220 (20 passes, 593 height, 167 blits) + dc.b (5<<3)|5,93,$6c,$c0 + dc.b (8<<3)|3,10,$d3,$40 + dc.b (6<<3)|6,93,$6c,$c0 + dc.b (7<<3)|3,7,$91,$00,(6<<3)|3,5,$4e,$c0 + dc.b (8<<3)|5,36,$5a,$00,(9<<3)|5,35,$87,$00 + dc.b (8<<3)|6,53,$91,$00,(7<<3)|6,44,$5a,$00 + dc.b (7<<3)|5,26,$2e,$40 + dc.b (5<<3)|7,72,$12,$c0 + dc.b (4<<3)|1,27,$bf,$40 + dc.b (6<<3)|6,26,$2e,$40 + dc.b (6<<3)|7,22,$12,$c0 + dc.b (9<<3)|2,8,$b2,$c0 + dc.b (9<<3)|6,11,$d3,$40 + dc.b (8<<3)|2,6,$87,$00 + dc.b (5<<3)|5,5,$0c,$80,(6<<3)|5,5,$0c,$80 + dc.b (7<<3)|7,9,$4e,$c0,0 + even + +; 221 (20 passes, 597 height, 167 blits) + dc.b (5<<3)|5,109,$58,$c0 + dc.b (8<<3)|3,10,$cd,$00 + dc.b (6<<3)|6,109,$58,$c0 + dc.b (7<<3)|3,7,$8c,$00,(6<<3)|3,6,$49,$c0 + dc.b (8<<3)|5,35,$56,$40,(9<<3)|5,35,$82,$00 + dc.b (8<<3)|6,52,$8c,$00,(7<<3)|6,43,$56,$40 + dc.b (7<<3)|5,25,$2a,$80 + dc.b (5<<3)|7,57,$11,$80 + dc.b (6<<3)|6,25,$2a,$80 + dc.b (4<<3)|1,13,$d0,$c0 + dc.b (9<<3)|6,16,$cd,$00 + dc.b (9<<3)|2,8,$ad,$c0 + dc.b (6<<3)|7,20,$11,$80 + dc.b (8<<3)|2,7,$82,$00 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (7<<3)|7,10,$49,$c0,0 + even + +; 222 (19 passes, 592 height, 161 blits) + dc.b (5<<3)|5,122,$48,$80 + dc.b (8<<3)|3,11,$c5,$80 + dc.b (6<<3)|6,122,$48,$80 + dc.b (7<<3)|3,9,$85,$c0 + dc.b (8<<3)|5,34,$53,$c0,(9<<3)|5,34,$7e,$40 + dc.b (8<<3)|6,51,$85,$c0,(7<<3)|6,40,$53,$c0 + dc.b (7<<3)|5,25,$28,$00 + dc.b (6<<3)|6,25,$28,$00 + dc.b (5<<3)|7,44,$11,$80 + dc.b (9<<3)|6,22,$c5,$80 + dc.b (6<<3)|3,1,$47,$40 + dc.b (9<<3)|2,8,$a8,$c0 + dc.b (6<<3)|7,18,$11,$80 + dc.b (8<<3)|2,6,$7e,$40 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (7<<3)|7,10,$47,$40,0 + even + +; 223 (17 passes, 589 height, 148 blits) + dc.b (5<<3)|5,135,$38,$40 + dc.b (6<<3)|6,149,$26,$c0 + dc.b (8<<3)|3,10,$c0,$80,(7<<3)|3,8,$82,$00 + dc.b (9<<3)|5,34,$7a,$80,(8<<3)|5,33,$51,$40 + dc.b (8<<3)|6,50,$82,$00,(7<<3)|6,39,$51,$40 + dc.b (7<<3)|5,23,$26,$c0 + dc.b (9<<3)|6,26,$c0,$80 + dc.b (5<<3)|7,31,$11,$80 + dc.b (9<<3)|2,7,$a5,$00 + dc.b (6<<3)|7,17,$11,$80 + dc.b (8<<3)|2,6,$7a,$80 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (7<<3)|7,11,$43,$80,0 + even + +; 224 (17 passes, 583 height, 148 blits) + dc.b (5<<3)|5,145,$2b,$c0 + dc.b (6<<3)|6,150,$25,$80 + dc.b (8<<3)|3,8,$bb,$80,(7<<3)|3,6,$7e,$40 + dc.b (8<<3)|5,33,$4e,$c0,(9<<3)|5,33,$78,$00 + dc.b (8<<3)|6,49,$7e,$40,(7<<3)|6,38,$4e,$c0 + dc.b (7<<3)|5,22,$25,$80 + dc.b (9<<3)|6,30,$bb,$80 + dc.b (5<<3)|7,21,$11,$80 + dc.b (9<<3)|2,6,$a1,$40 + dc.b (6<<3)|7,16,$11,$80 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (8<<3)|2,5,$78,$00 + dc.b (7<<3)|7,11,$41,$00,0 + even + +; 225 (17 passes, 586 height, 148 blits) + dc.b (5<<3)|5,148,$28,$00 + dc.b (6<<3)|6,152,$23,$00 + dc.b (8<<3)|3,8,$b6,$80,(7<<3)|3,6,$7a,$80 + dc.b (9<<3)|5,33,$74,$40,(8<<3)|5,32,$4c,$40 + dc.b (8<<3)|6,48,$7a,$80,(7<<3)|6,37,$4c,$40,(9<<3)|6,34,$b6,$80 + dc.b (7<<3)|5,22,$23,$00 + dc.b (5<<3)|7,19,$10,$40 + dc.b (9<<3)|2,6,$9d,$80 + dc.b (6<<3)|7,15,$10,$40 + dc.b (5<<3)|5,5,$0a,$00,(6<<3)|5,5,$0a,$00 + dc.b (8<<3)|2,5,$74,$40 + dc.b (7<<3)|7,11,$3e,$80,0 + even + +; 226 (17 passes, 584 height, 148 blits) + dc.b (5<<3)|5,156,$1e,$00 + dc.b (6<<3)|6,153,$21,$c0 + dc.b (8<<3)|3,7,$b2,$c0,(7<<3)|3,5,$78,$00 + dc.b (8<<3)|5,32,$49,$c0,(9<<3)|5,32,$71,$c0 + dc.b (8<<3)|6,47,$78,$00,(7<<3)|6,37,$49,$c0,(9<<3)|6,37,$b2,$c0 + dc.b (7<<3)|5,21,$21,$c0 + dc.b (9<<3)|2,6,$99,$c0 + dc.b (5<<3)|5,5,$0a,$00,(6<<3)|5,5,$0a,$00 + dc.b (6<<3)|7,14,$10,$40 + dc.b (8<<3)|2,5,$71,$c0 + dc.b (5<<3)|7,11,$10,$40,(7<<3)|7,11,$3c,$00,0 + even + +; 227 (17 passes, 582 height, 148 blits) + dc.b (5<<3)|5,163,$15,$40 + dc.b (6<<3)|6,154,$20,$80 + dc.b (8<<3)|3,8,$ac,$80,(7<<3)|3,6,$73,$00 + dc.b (8<<3)|5,32,$48,$80,(9<<3)|5,32,$70,$80 + dc.b (8<<3)|6,46,$73,$00,(9<<3)|6,42,$ac,$80,(7<<3)|6,34,$48,$80 + dc.b (7<<3)|5,20,$20,$80,(5<<3)|5,5,$0a,$00,(6<<3)|5,5,$0a,$00 + dc.b (6<<3)|7,13,$10,$40,(7<<3)|7,12,$39,$80 + dc.b (9<<3)|2,4,$98,$80,(8<<3)|2,2,$70,$80 + dc.b (5<<3)|7,4,$10,$40,0 + even + +; 228 (15 passes, 585 height, 126 blits) + dc.b (5<<3)|5,173,$08,$c0 + dc.b (6<<3)|6,156,$1e,$00 + dc.b (8<<3)|3,8,$a8,$c0,(7<<3)|3,7,$6f,$40 + dc.b (8<<3)|5,32,$46,$00,(9<<3)|5,32,$6e,$00 + dc.b (8<<3)|6,46,$6f,$40,(9<<3)|6,45,$a8,$c0,(7<<3)|6,33,$46,$00 + dc.b (7<<3)|5,19,$1e,$00,(6<<3)|5,5,$08,$c0 + dc.b (7<<3)|7,13,$35,$c0,(6<<3)|7,12,$0f,$00 + dc.b (9<<3)|2,3,$96,$00,(8<<3)|2,1,$6e,$00,0 + even + +; 229 (15 passes, 577 height, 123 blits) + dc.b (5<<3)|5,173,$08,$c0 + dc.b (6<<3)|6,156,$1e,$00 + dc.b (8<<3)|3,5,$a6,$40,(7<<3)|3,4,$6e,$00 + dc.b (8<<3)|5,32,$46,$00,(9<<3)|5,32,$6e,$00 + dc.b (8<<3)|6,45,$6e,$00,(9<<3)|6,45,$a6,$40,(7<<3)|6,32,$46,$00 + dc.b (7<<3)|5,19,$1e,$00 + dc.b (9<<3)|3,2,$de,$80 + dc.b (6<<3)|5,5,$08,$c0 + dc.b (7<<3)|7,13,$35,$c0,(6<<3)|7,12,$0f,$00 + dc.b (9<<3)|2,2,$96,$00,0 + even + +; 230 (16 passes, 575 height, 137 blits) + dc.b (5<<3)|5,173,$08,$c0 + dc.b (6<<3)|6,157,$1c,$c0 + dc.b (9<<3)|3,6,$d9,$80,(8<<3)|3,5,$a2,$80,(7<<3)|3,4,$6a,$40 + dc.b (9<<3)|5,32,$6c,$c0,(8<<3)|5,30,$44,$c0 + dc.b (9<<3)|6,44,$a2,$80,(8<<3)|6,43,$6c,$c0,(7<<3)|6,30,$44,$c0 + dc.b (7<<3)|5,18,$1c,$c0,(6<<3)|5,5,$08,$c0 + dc.b (7<<3)|7,14,$33,$40,(6<<3)|7,11,$0f,$00 + dc.b (9<<3)|2,1,$94,$c0 + dc.b (8<<3)|7,2,$6a,$40,0 + even + +; 231 (18 passes, 580 height, 153 blits) + dc.b (5<<3)|5,173,$08,$c0 + dc.b (6<<3)|6,155,$1b,$80 + dc.b (9<<3)|3,8,$d4,$80,(8<<3)|3,7,$9d,$80,(7<<3)|3,5,$67,$c0 + dc.b (9<<3)|5,32,$6b,$80,(8<<3)|5,29,$43,$80 + dc.b (9<<3)|6,44,$9d,$80,(8<<3)|6,40,$6b,$80,(7<<3)|6,29,$43,$80 + dc.b (7<<3)|5,17,$1b,$80 + dc.b (7<<3)|7,15,$30,$c0 + dc.b (6<<3)|5,5,$08,$c0 + dc.b (6<<3)|7,10,$0f,$00 + dc.b (6<<3)|2,3,$dd,$40 + dc.b (7<<3)|6,3,$dd,$40 + dc.b (9<<3)|2,2,$93,$80 + dc.b (8<<3)|7,3,$67,$c0,0 + even + +; 232 (18 passes, 587 height, 153 blits) + dc.b (5<<3)|5,174,$07,$80 + dc.b (6<<3)|6,145,$1a,$40 + dc.b (9<<3)|3,7,$d0,$c0,(8<<3)|3,6,$9b,$00,(7<<3)|3,4,$65,$40 + dc.b (9<<3)|5,32,$6a,$40 + dc.b (9<<3)|6,43,$9b,$00 + dc.b (8<<3)|5,28,$42,$40 + dc.b (8<<3)|6,39,$6a,$40,(7<<3)|6,28,$42,$40 + dc.b (7<<3)|5,17,$1a,$40 + dc.b (6<<3)|2,14,$cf,$80 + dc.b (7<<3)|6,14,$cf,$80 + dc.b (7<<3)|7,15,$2f,$80 + dc.b (6<<3)|5,5,$07,$80 + dc.b (6<<3)|7,10,$0d,$c0 + dc.b (9<<3)|2,2,$92,$40 + dc.b (8<<3)|7,4,$65,$40,0 + even + +; 233 (18 passes, 584 height, 153 blits) + dc.b (5<<3)|5,174,$07,$80 + dc.b (6<<3)|6,141,$19,$00 + dc.b (9<<3)|3,7,$cb,$c0,(7<<3)|3,5,$61,$80,(8<<3)|3,5,$97,$40 + dc.b (9<<3)|5,32,$69,$00 + dc.b (9<<3)|6,42,$97,$40 + dc.b (8<<3)|5,26,$41,$00 + dc.b (8<<3)|6,37,$69,$00,(7<<3)|6,26,$41,$00 + dc.b (7<<3)|5,16,$19,$00 + dc.b (6<<3)|2,16,$c9,$40 + dc.b (7<<3)|6,19,$c9,$40 + dc.b (7<<3)|7,16,$2d,$00 + dc.b (6<<3)|5,5,$07,$80 + dc.b (6<<3)|7,9,$0d,$c0,(8<<3)|7,6,$61,$80 + dc.b (9<<3)|2,2,$91,$00,0 + even + +; 234 (18 passes, 576 height, 153 blits) + dc.b (5<<3)|5,174,$07,$80 + dc.b (6<<3)|6,132,$19,$00 + dc.b (9<<3)|3,6,$c9,$40,(8<<3)|3,5,$94,$c0 + dc.b (9<<3)|5,32,$69,$00 + dc.b (9<<3)|6,42,$94,$c0 + dc.b (8<<3)|5,26,$41,$00 + dc.b (7<<3)|3,3,$61,$80 + dc.b (8<<3)|6,35,$69,$00,(7<<3)|6,28,$be,$00,(7<<3)|6,26,$41,$00 + dc.b (7<<3)|5,16,$19,$00 + dc.b (6<<3)|2,14,$be,$00 + dc.b (7<<3)|7,16,$2d,$00 + dc.b (6<<3)|5,5,$07,$80 + dc.b (6<<3)|7,9,$0d,$c0,(8<<3)|7,6,$61,$80 + dc.b (9<<3)|2,1,$91,$00,0 + even + +; 235 (20 passes, 592 height, 175 blits) + dc.b (5<<3)|5,87,$07,$80 + dc.b (5<<3)|1,87,$74,$40 + dc.b (6<<3)|6,74,$17,$c0 + dc.b (6<<3)|5,37,$b2,$c0 + dc.b (9<<3)|3,4,$c6,$c0 + dc.b (9<<3)|5,32,$67,$c0 + dc.b (9<<3)|6,41,$93,$80 + dc.b (8<<3)|5,25,$3f,$c0 + dc.b (8<<3)|3,3,$93,$80 + dc.b (7<<3)|6,37,$b2,$c0,(8<<3)|6,35,$67,$c0 + dc.b (6<<3)|7,50,$74,$40 + dc.b (7<<3)|6,25,$3f,$c0 + dc.b (7<<3)|3,2,$5f,$00 + dc.b (7<<3)|5,15,$17,$c0 + dc.b (7<<3)|7,17,$2a,$80 + dc.b (6<<3)|5,5,$07,$80 + dc.b (6<<3)|7,8,$0d,$c0,(8<<3)|7,7,$5f,$00 + dc.b (9<<3)|2,1,$8f,$c0,0 + even + +; 236 (19 passes, 598 height, 169 blits) + dc.b (5<<3)|1,131,$3d,$40 + dc.b (9<<3)|3,6,$c1,$c0 + dc.b (5<<3)|5,44,$06,$40 + dc.b (8<<3)|3,5,$8e,$80 + dc.b (6<<3)|5,40,$af,$00 + dc.b (7<<3)|3,4,$5c,$80 + dc.b (9<<3)|5,32,$66,$80 + dc.b (6<<3)|7,91,$3d,$40 + dc.b (9<<3)|6,41,$8e,$80,(7<<3)|6,40,$af,$00 + dc.b (8<<3)|5,24,$3e,$80 + dc.b (8<<3)|6,32,$66,$80,(6<<3)|6,31,$16,$80,(7<<3)|6,24,$3e,$80 + dc.b (7<<3)|5,15,$16,$80 + dc.b (7<<3)|7,17,$29,$40 + dc.b (6<<3)|5,5,$06,$40 + dc.b (6<<3)|7,8,$0c,$80,(8<<3)|7,8,$5c,$80,0 + even + +; 237 (16 passes, 516 height, 137 blits) + dc.b (5<<3)|1,87,$07,$80 + dc.b (9<<3)|3,6,$bf,$40 + dc.b (6<<3)|5,48,$a5,$00 + dc.b (6<<3)|7,122,$0c,$80 + dc.b (8<<3)|3,5,$8d,$40,(7<<3)|3,4,$5a,$00 + dc.b (9<<3)|5,32,$65,$40 + dc.b (7<<3)|6,48,$a5,$00,(9<<3)|6,40,$8d,$40 + dc.b (8<<3)|5,23,$3d,$40 + dc.b (8<<3)|6,32,$65,$40,(7<<3)|6,23,$3d,$40 + dc.b (7<<3)|5,14,$15,$40 + dc.b (7<<3)|7,18,$26,$c0 + dc.b (6<<3)|5,5,$06,$40 + dc.b (8<<3)|7,9,$5a,$00,0 + even + +; 238 (17 passes, 467 height, 151 blits) + dc.b (6<<3)|5,52,$a0,$00 + dc.b (6<<3)|7,118,$0c,$80 + dc.b (5<<3)|1,44,$06,$40 + dc.b (7<<3)|6,52,$a0,$00 + dc.b (9<<3)|3,4,$bc,$c0 + dc.b (9<<3)|5,30,$65,$40 + dc.b (9<<3)|6,38,$8d,$40 + dc.b (7<<3)|3,3,$58,$c0,(8<<3)|3,3,$8a,$c0 + dc.b (8<<3)|5,22,$3d,$40 + dc.b (8<<3)|6,30,$65,$40,(7<<3)|6,22,$3d,$40 + dc.b (7<<3)|5,14,$15,$40 + dc.b (7<<3)|7,18,$26,$c0 + dc.b (6<<3)|5,5,$06,$40 + dc.b (8<<3)|7,10,$58,$c0,(9<<3)|7,2,$8a,$c0,0 + even + +; 239 (16 passes, 425 height, 145 blits) + dc.b (6<<3)|5,56,$9b,$00 + dc.b (9<<3)|3,5,$b9,$00 + dc.b (6<<3)|7,114,$0c,$80 + dc.b (7<<3)|6,56,$9b,$00 + dc.b (8<<3)|3,4,$88,$40 + dc.b (9<<3)|5,29,$64,$00 + dc.b (7<<3)|3,3,$56,$40 + dc.b (9<<3)|6,36,$8c,$00 + dc.b (8<<3)|5,21,$3c,$00 + dc.b (8<<3)|6,29,$64,$00 + dc.b (7<<3)|5,14,$14,$00 + dc.b (7<<3)|6,21,$3c,$00 + dc.b (7<<3)|7,18,$25,$80 + dc.b (6<<3)|5,5,$06,$40 + dc.b (8<<3)|7,11,$56,$40,(9<<3)|7,3,$88,$40,0 + even + +; 240 (16 passes, 430 height, 145 blits) + dc.b (6<<3)|5,62,$93,$80 + dc.b (7<<3)|6,62,$93,$80 + dc.b (9<<3)|3,5,$b6,$80 + dc.b (6<<3)|7,109,$0b,$40 + dc.b (8<<3)|3,4,$85,$c0 + dc.b (9<<3)|5,28,$62,$c0 + dc.b (7<<3)|3,3,$55,$00 + dc.b (9<<3)|6,35,$8a,$c0 + dc.b (8<<3)|5,21,$3a,$c0 + dc.b (8<<3)|6,28,$62,$c0,(7<<3)|6,21,$3a,$c0 + dc.b (7<<3)|5,13,$12,$c0 + dc.b (7<<3)|7,19,$23,$00 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,11,$55,$00,(9<<3)|7,4,$85,$c0,0 + even + +; 241 (16 passes, 430 height, 145 blits) + dc.b (6<<3)|5,66,$8e,$80 + dc.b (7<<3)|6,66,$8e,$80 + dc.b (6<<3)|7,105,$0b,$40 + dc.b (8<<3)|3,4,$83,$40,(9<<3)|3,4,$b4,$00 + dc.b (9<<3)|5,27,$61,$80 + dc.b (7<<3)|3,3,$52,$80 + dc.b (9<<3)|6,34,$89,$80 + dc.b (8<<3)|5,20,$39,$80 + dc.b (8<<3)|6,27,$61,$80,(7<<3)|6,20,$39,$80 + dc.b (7<<3)|5,13,$11,$80 + dc.b (7<<3)|7,19,$21,$c0 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,12,$52,$80,(9<<3)|7,5,$83,$40,0 + even + +; 242 (16 passes, 428 height, 145 blits) + dc.b (6<<3)|5,69,$8a,$c0 + dc.b (7<<3)|6,69,$8a,$c0 + dc.b (6<<3)|7,102,$0b,$40 + dc.b (9<<3)|3,4,$b1,$80 + dc.b (9<<3)|5,26,$61,$80 + dc.b (7<<3)|3,3,$51,$40,(8<<3)|3,3,$82,$00 + dc.b (9<<3)|6,32,$89,$80 + dc.b (8<<3)|5,19,$39,$80 + dc.b (8<<3)|6,26,$61,$80 + dc.b (7<<3)|5,13,$11,$80 + dc.b (7<<3)|6,19,$39,$80 + dc.b (7<<3)|7,19,$21,$c0 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,13,$51,$40,(9<<3)|7,6,$82,$00,0 + even + +; 243 (16 passes, 424 height, 145 blits) + dc.b (6<<3)|5,71,$88,$40 + dc.b (7<<3)|6,71,$88,$40 + dc.b (6<<3)|7,100,$0b,$40 + dc.b (9<<3)|5,25,$61,$80 + dc.b (9<<3)|3,3,$b0,$40 + dc.b (9<<3)|6,31,$89,$80 + dc.b (8<<3)|5,19,$39,$80 + dc.b (8<<3)|6,25,$61,$80 + dc.b (8<<3)|3,2,$80,$c0 + dc.b (7<<3)|5,13,$11,$80 + dc.b (7<<3)|6,19,$39,$80 + dc.b (7<<3)|3,1,$51,$40 + dc.b (7<<3)|7,19,$21,$c0 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,13,$51,$40,(9<<3)|7,7,$80,$c0,0 + even + +; 244 (16 passes, 427 height, 145 blits) + dc.b (6<<3)|5,75,$83,$40 + dc.b (7<<3)|6,75,$83,$40 + dc.b (6<<3)|7,96,$0b,$40 + dc.b (8<<3)|3,3,$7e,$40,(9<<3)|3,3,$ad,$c0 + dc.b (9<<3)|5,24,$60,$40 + dc.b (9<<3)|6,30,$88,$40 + dc.b (8<<3)|5,18,$38,$40 + dc.b (7<<3)|3,2,$4e,$c0 + dc.b (8<<3)|6,24,$60,$40 + dc.b (7<<3)|5,12,$10,$40 + dc.b (7<<3)|6,18,$38,$40 + dc.b (7<<3)|7,20,$1f,$40 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,14,$4e,$c0,(9<<3)|7,8,$7e,$40,0 + even + +; 245 (16 passes, 428 height, 145 blits) + dc.b (6<<3)|5,78,$7f,$80 + dc.b (7<<3)|6,78,$7f,$80 + dc.b (6<<3)|7,93,$0b,$40 + dc.b (9<<3)|3,3,$ac,$80 + dc.b (9<<3)|5,24,$60,$40 + dc.b (9<<3)|6,29,$88,$40 + dc.b (8<<3)|5,18,$38,$40 + dc.b (7<<3)|3,2,$4e,$c0,(8<<3)|3,2,$7e,$40 + dc.b (8<<3)|6,24,$60,$40 + dc.b (7<<3)|5,12,$10,$40 + dc.b (7<<3)|6,18,$38,$40 + dc.b (7<<3)|7,20,$1f,$40 + dc.b (6<<3)|5,5,$05,$00 + dc.b (8<<3)|7,14,$4e,$c0,(9<<3)|7,8,$7e,$40,0 + even + +; 246 (16 passes, 428 height, 145 blits) + dc.b (6<<3)|5,80,$7d,$00 + dc.b (7<<3)|6,80,$7d,$00 + dc.b (6<<3)|7,92,$0a,$00 + dc.b (9<<3)|5,24,$5f,$00 + dc.b (9<<3)|6,29,$87,$00 + dc.b (8<<3)|5,18,$37,$00 + dc.b (9<<3)|3,2,$ab,$40 + dc.b (8<<3)|6,24,$5f,$00 + dc.b (7<<3)|5,12,$0f,$00 + dc.b (7<<3)|6,18,$37,$00 + dc.b (7<<3)|3,1,$4d,$80,(8<<3)|3,1,$7d,$00 + dc.b (7<<3)|7,20,$1e,$00 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (8<<3)|7,14,$4d,$80,(9<<3)|7,8,$7d,$00,0 + even + +; 247 (16 passes, 433 height, 145 blits) + dc.b (6<<3)|5,84,$78,$00 + dc.b (7<<3)|6,84,$78,$00 + dc.b (6<<3)|7,88,$0a,$00 + dc.b (7<<3)|3,3,$4b,$00,(8<<3)|3,3,$7a,$80,(9<<3)|3,3,$a8,$c0 + dc.b (9<<3)|5,22,$5f,$00 + dc.b (9<<3)|6,27,$87,$00 + dc.b (8<<3)|5,17,$35,$c0 + dc.b (8<<3)|6,22,$5f,$00 + dc.b (7<<3)|5,12,$0d,$c0 + dc.b (7<<3)|6,17,$35,$c0 + dc.b (7<<3)|7,20,$1c,$c0,(8<<3)|7,16,$4b,$00 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,10,$7a,$80,0 + even + +; 248 (16 passes, 433 height, 145 blits) + dc.b (6<<3)|5,86,$75,$80 + dc.b (7<<3)|6,86,$75,$80 + dc.b (8<<3)|3,4,$78,$00,(9<<3)|3,4,$a6,$40 + dc.b (6<<3)|7,86,$0a,$00 + dc.b (9<<3)|5,21,$5d,$c0 + dc.b (9<<3)|6,26,$85,$c0 + dc.b (8<<3)|5,17,$35,$c0 + dc.b (7<<3)|3,2,$4b,$00 + dc.b (8<<3)|6,21,$5d,$c0 + dc.b (7<<3)|5,12,$0d,$c0 + dc.b (7<<3)|6,17,$35,$c0 + dc.b (7<<3)|7,20,$1c,$c0,(8<<3)|7,15,$4b,$00 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,11,$78,$00,0 + even + +; 249 (15 passes, 427 height, 142 blits) + dc.b (6<<3)|5,86,$75,$80 + dc.b (7<<3)|6,86,$75,$80 + dc.b (6<<3)|7,86,$0a,$00 + dc.b (9<<3)|5,21,$5d,$c0 + dc.b (9<<3)|6,26,$85,$c0 + dc.b (8<<3)|5,17,$35,$c0 + dc.b (8<<3)|3,2,$78,$00,(9<<3)|3,2,$a6,$40 + dc.b (8<<3)|6,21,$5d,$c0 + dc.b (7<<3)|5,12,$0d,$c0 + dc.b (7<<3)|6,17,$35,$c0 + dc.b (7<<3)|7,20,$1c,$c0,(8<<3)|7,15,$4b,$00 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,11,$78,$00,0 + even + +; 250 (13 passes, 425 height, 136 blits) + dc.b (6<<3)|5,88,$73,$00 + dc.b (7<<3)|6,88,$73,$00 + dc.b (6<<3)|7,84,$0a,$00 + dc.b (9<<3)|5,21,$5d,$c0 + dc.b (9<<3)|6,26,$85,$c0 + dc.b (8<<3)|5,17,$35,$c0 + dc.b (8<<3)|6,21,$5d,$c0 + dc.b (7<<3)|5,12,$0d,$c0 + dc.b (7<<3)|6,17,$35,$c0 + dc.b (7<<3)|7,20,$1c,$c0,(8<<3)|7,15,$4b,$00 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,11,$78,$00,0 + even + +; 251 (15 passes, 425 height, 142 blits) + dc.b (6<<3)|5,88,$73,$00 + dc.b (7<<3)|6,88,$73,$00 + dc.b (6<<3)|7,84,$0a,$00 + dc.b (9<<3)|5,21,$5d,$c0 + dc.b (9<<3)|6,25,$85,$c0 + dc.b (8<<3)|5,16,$35,$c0 + dc.b (8<<3)|6,21,$5d,$c0 + dc.b (7<<3)|5,12,$0d,$c0 + dc.b (7<<3)|6,16,$35,$c0 + dc.b (7<<3)|3,1,$49,$c0,(9<<3)|3,1,$a5,$00 + dc.b (7<<3)|7,20,$1c,$c0,(8<<3)|7,16,$49,$c0 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,11,$78,$00,0 + even + +; 252 (15 passes, 427 height, 142 blits) + dc.b (6<<3)|5,90,$70,$80 + dc.b (7<<3)|6,90,$70,$80 + dc.b (6<<3)|7,82,$0a,$00 + dc.b (9<<3)|5,21,$5d,$c0 + dc.b (9<<3)|6,25,$85,$c0 + dc.b (8<<3)|5,16,$35,$c0 + dc.b (8<<3)|6,21,$5d,$c0 + dc.b (7<<3)|5,12,$0d,$c0 + dc.b (7<<3)|6,16,$35,$c0 + dc.b (7<<3)|3,1,$49,$c0,(9<<3)|3,1,$a5,$00 + dc.b (7<<3)|7,20,$1c,$c0,(8<<3)|7,16,$49,$c0 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,11,$78,$00,0 + even + +; 253 (16 passes, 429 height, 145 blits) + dc.b (6<<3)|5,92,$6e,$00 + dc.b (7<<3)|6,92,$6e,$00 + dc.b (6<<3)|7,80,$0a,$00 + dc.b (9<<3)|5,20,$5d,$c0,(8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$85,$c0,(8<<3)|6,20,$5d,$c0 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (7<<3)|3,1,$48,$80,(8<<3)|3,1,$76,$c0,(9<<3)|3,1,$a3,$c0 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,17,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$76,$c0,0 + even + +; 254 (16 passes, 430 height, 145 blits) + dc.b (6<<3)|5,92,$6e,$00 + dc.b (7<<3)|6,92,$6e,$00 + dc.b (6<<3)|7,80,$0a,$00 + dc.b (9<<3)|5,20,$5c,$80 + dc.b (8<<3)|3,2,$75,$80,(9<<3)|3,2,$a2,$80 + dc.b (8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$84,$80,(8<<3)|6,20,$5c,$80 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (7<<3)|3,1,$48,$80 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,16,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$75,$80,0 + even + +; 255 (15 passes, 428 height, 142 blits) + dc.b (6<<3)|5,93,$6c,$c0 + dc.b (7<<3)|6,93,$6c,$c0 + dc.b (6<<3)|7,79,$0a,$00 + dc.b (9<<3)|5,20,$5c,$80,(8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$84,$80,(8<<3)|6,20,$5c,$80 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (8<<3)|3,1,$75,$80,(9<<3)|3,1,$a2,$80 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,16,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$75,$80,0 + even + +; 256 (13 passes, 426 height, 136 blits) + dc.b (6<<3)|5,93,$6c,$c0 + dc.b (7<<3)|6,93,$6c,$c0 + dc.b (6<<3)|7,79,$0a,$00 + dc.b (9<<3)|5,20,$5c,$80,(8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$84,$80,(8<<3)|6,20,$5c,$80 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,16,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$75,$80,0 + even + +; 257 (13 passes, 426 height, 136 blits) + dc.b (6<<3)|5,93,$6c,$c0 + dc.b (7<<3)|6,93,$6c,$c0 + dc.b (6<<3)|7,79,$0a,$00 + dc.b (9<<3)|5,20,$5c,$80,(8<<3)|5,16,$34,$80 + dc.b (9<<3)|6,24,$84,$80,(8<<3)|6,20,$5c,$80 + dc.b (7<<3)|5,12,$0c,$80 + dc.b (7<<3)|6,16,$34,$80 + dc.b (7<<3)|7,20,$1b,$80,(8<<3)|7,16,$48,$80 + dc.b (6<<3)|5,5,$03,$c0 + dc.b (9<<3)|7,12,$75,$80,0 + even + +; 288 (20 passes, 584 height, 172 blits) + dc.b (5<<3)|5,145,$2b,$c0 + dc.b (6<<3)|6,150,$25,$80 + dc.b (8<<3)|5,33,$4e,$c0,(9<<3)|5,33,$78,$00 + dc.b (8<<3)|6,49,$7e,$40,(7<<3)|6,38,$4e,$c0 + dc.b (7<<3)|5,22,$25,$80 + dc.b (9<<3)|6,30,$bb,$80 + dc.b (5<<3)|7,21,$11,$80 + dc.b (9<<3)|2,7,$b2,$c0 + dc.b (6<<3)|7,16,$11,$80 + dc.b (5<<3)|5,5,$0b,$40,(6<<3)|5,5,$0b,$40 + dc.b (8<<3)|2,5,$78,$00 + dc.b (9<<3)|1,5,$71,$c0 + dc.b (7<<3)|7,11,$41,$00 + dc.b (8<<3)|1,4,$49,$c0,(7<<3)|1,3,$21,$c0,(5<<3)|1,1,$0a,$00,(6<<3)|1,1,$0a,$00,0 + even + +; 289 (20 passes, 572 height, 172 blits) + dc.b (5<<3)|5,132,$3c,$00 + dc.b (6<<3)|6,150,$25,$80 + dc.b (9<<3)|5,33,$76,$c0 + dc.b (8<<3)|6,49,$7e,$40 + dc.b (8<<3)|5,32,$4e,$c0 + dc.b (7<<3)|6,38,$4e,$c0 + dc.b (7<<3)|5,22,$25,$80 + dc.b (9<<3)|6,30,$bb,$80 + dc.b (5<<3)|7,35,$10,$40,(6<<3)|7,17,$10,$40 + dc.b (5<<3)|5,4,$0b,$40,(6<<3)|5,4,$0b,$40 + dc.b (7<<3)|7,11,$41,$00 + dc.b (9<<3)|2,4,$b6,$80,(8<<3)|2,3,$7a,$80 + dc.b (7<<3)|1,2,$23,$00,(8<<3)|1,2,$4c,$40,(9<<3)|1,2,$74,$40,(5<<3)|1,1,$0a,$00,(6<<3)|1,1,$0a,$00,0 + even + +; 290 (20 passes, 570 height, 175 blits) + dc.b (6<<3)|3,22,$42,$40 + dc.b (5<<3)|5,94,$5d,$c0 + dc.b (6<<3)|6,105,$5d,$c0,(8<<3)|6,49,$7e,$40 + dc.b (8<<3)|5,32,$4e,$c0,(9<<3)|5,32,$76,$c0 + dc.b (7<<3)|6,38,$4e,$c0 + dc.b (7<<3)|5,22,$26,$c0 + dc.b (5<<3)|7,63,$0f,$00 + dc.b (9<<3)|6,30,$bb,$80,(6<<3)|6,22,$26,$c0 + dc.b (4<<3)|5,11,$d3,$40 + dc.b (5<<3)|2,11,$d3,$40 + dc.b (6<<3)|7,19,$0f,$00,(7<<3)|7,10,$42,$40 + dc.b (5<<3)|5,3,$0b,$40,(6<<3)|5,3,$0b,$40 + dc.b (9<<3)|2,2,$9e,$c0,(8<<3)|2,1,$76,$c0 + dc.b (7<<3)|1,1,$25,$80,0 + even + +; 291 (23 passes, 609 height, 193 blits) + dc.b (6<<3)|3,61,$43,$80 + dc.b (4<<3)|5,50,$a2,$80 + dc.b (5<<3)|2,50,$a2,$80 + dc.b (6<<3)|6,65,$8f,$c0 + dc.b (5<<3)|7,103,$0f,$00 + dc.b (8<<3)|5,32,$50,$00,(9<<3)|5,32,$78,$00 + dc.b (8<<3)|6,48,$7f,$80,(7<<3)|6,38,$50,$00 + dc.b (7<<3)|5,22,$28,$00 + dc.b (9<<3)|6,30,$bb,$80 + dc.b (5<<3)|5,15,$8f,$c0 + dc.b (6<<3)|6,22,$28,$00 + dc.b (6<<3)|7,20,$0f,$00,(7<<3)|7,10,$43,$80 + dc.b (5<<3)|5,2,$0c,$80,(6<<3)|5,2,$0c,$80 + dc.b (7<<3)|1,2,$25,$80 + dc.b (8<<3)|2,1,$7e,$40 + dc.b (5<<3)|1,1,$0b,$40,(6<<3)|1,1,$0b,$40,(8<<3)|1,1,$4e,$c0,(9<<3)|1,1,$76,$c0,0 + even + +; 292 (21 passes, 611 height, 176 blits) + dc.b (6<<3)|3,105,$5d,$c0 + dc.b (4<<3)|5,75,$83,$40 + dc.b (5<<3)|6,75,$83,$40 + dc.b (8<<3)|5,32,$50,$00,(9<<3)|5,32,$78,$00 + dc.b (5<<3)|7,94,$0d,$c0 + dc.b (8<<3)|6,48,$7e,$40,(7<<3)|6,37,$50,$00 + dc.b (7<<3)|5,21,$28,$00 + dc.b (9<<3)|6,31,$ba,$40,(6<<3)|6,21,$28,$00 + dc.b (8<<3)|3,1,$ba,$40 + dc.b (6<<3)|7,21,$0d,$c0,(7<<3)|7,11,$42,$40 + dc.b (5<<3)|5,1,$0c,$80,(6<<3)|5,1,$0c,$80 + dc.b (5<<3)|1,1,$0b,$40,(6<<3)|1,1,$0b,$40,(7<<3)|1,1,$26,$c0,(8<<3)|1,1,$4e,$c0,(9<<3)|1,1,$76,$c0,0 + even + +; 293 (15 passes, 652 height, 133 blits) + dc.b (6<<3)|3,127,$42,$40 + dc.b (4<<3)|5,98,$66,$80 + dc.b (5<<3)|6,98,$66,$80 + dc.b (8<<3)|5,32,$50,$00,(9<<3)|5,32,$78,$00 + dc.b (8<<3)|6,48,$7e,$40 + dc.b (5<<3)|7,72,$0c,$80 + dc.b (7<<3)|6,37,$50,$00 + dc.b (7<<3)|5,21,$28,$00 + dc.b (9<<3)|6,31,$ba,$40,(6<<3)|6,21,$28,$00 + dc.b (7<<3)|3,1,$7e,$40,(8<<3)|3,1,$ba,$40 + dc.b (6<<3)|7,22,$0c,$80,(7<<3)|7,11,$42,$40,0 + even + +; 294 (17 passes, 549 height, 145 blits) + dc.b (4<<3)|5,114,$52,$80 + dc.b (5<<3)|6,114,$52,$80 + dc.b (8<<3)|5,32,$4e,$c0,(9<<3)|5,32,$76,$c0 + dc.b (8<<3)|6,47,$7b,$c0 + dc.b (8<<3)|3,3,$b6,$80 + dc.b (7<<3)|6,36,$4e,$c0,(9<<3)|6,34,$b6,$80 + dc.b (7<<3)|5,21,$26,$c0 + dc.b (5<<3)|7,57,$0b,$40 + dc.b (7<<3)|3,2,$7b,$c0 + dc.b (6<<3)|6,21,$26,$c0 + dc.b (6<<3)|3,1,$41,$00 + dc.b (6<<3)|7,22,$0b,$40,(7<<3)|7,11,$41,$00 + dc.b (8<<3)|2,1,$76,$c0,(9<<3)|2,1,$9e,$c0,0 + even + +; 295 (19 passes, 591 height, 159 blits) + dc.b (4<<3)|5,111,$3d,$40 + dc.b (5<<3)|6,131,$3d,$40 + dc.b (8<<3)|3,4,$b5,$40 + dc.b (8<<3)|5,32,$4d,$80,(9<<3)|5,32,$75,$80 + dc.b (8<<3)|6,47,$7a,$80 + dc.b (7<<3)|3,3,$7a,$80 + dc.b (7<<3)|6,36,$4d,$80,(9<<3)|6,35,$b5,$40 + dc.b (7<<3)|5,21,$25,$80,(3<<3)|5,20,$c8,$00 + dc.b (4<<3)|2,20,$c8,$00 + dc.b (6<<3)|3,2,$3f,$c0 + dc.b (6<<3)|6,21,$25,$80 + dc.b (5<<3)|7,40,$0b,$40,(6<<3)|7,21,$0b,$40,(7<<3)|7,11,$3f,$c0 + dc.b (8<<3)|2,2,$75,$80,(9<<3)|2,2,$9d,$80,0 + even + +; 296 (19 passes, 633 height, 159 blits) + dc.b (4<<3)|5,99,$2b,$c0 + dc.b (5<<3)|6,145,$2b,$c0 + dc.b (3<<3)|5,46,$a7,$80 + dc.b (4<<3)|2,46,$a7,$80 + dc.b (8<<3)|5,32,$4b,$00,(9<<3)|5,32,$73,$00 + dc.b (8<<3)|6,47,$79,$40,(7<<3)|6,37,$4b,$00,(9<<3)|6,36,$b4,$00 + dc.b (7<<3)|5,22,$23,$00 + dc.b (6<<3)|3,2,$3e,$80,(7<<3)|3,2,$79,$40,(8<<3)|3,2,$b4,$00 + dc.b (6<<3)|6,22,$23,$00 + dc.b (5<<3)|7,27,$0a,$00,(6<<3)|7,20,$0a,$00,(7<<3)|7,10,$3e,$80 + dc.b (8<<3)|2,3,$73,$00,(9<<3)|2,3,$9b,$00,0 + even + +; 297 (19 passes, 650 height, 159 blits) + dc.b (5<<3)|6,157,$1c,$c0 + dc.b (4<<3)|5,92,$1c,$c0,(3<<3)|5,65,$8f,$c0 + dc.b (4<<3)|2,45,$8f,$c0 + dc.b (8<<3)|5,32,$48,$80,(9<<3)|5,32,$70,$80 + dc.b (8<<3)|6,46,$78,$00,(7<<3)|6,38,$48,$80,(9<<3)|6,38,$b1,$80 + dc.b (8<<3)|3,3,$b1,$80 + dc.b (7<<3)|5,23,$20,$80 + dc.b (6<<3)|3,2,$3d,$40,(7<<3)|3,2,$78,$00 + dc.b (6<<3)|6,23,$20,$80 + dc.b (6<<3)|7,19,$08,$c0,(5<<3)|7,16,$08,$c0 + dc.b (8<<3)|2,4,$70,$80,(9<<3)|2,4,$98,$80 + dc.b (7<<3)|7,9,$3d,$40,0 + even + +; 298 (21 passes, 693 height, 172 blits) + dc.b (5<<3)|3,36,$b4,$00 + dc.b (5<<3)|6,131,$10,$40 + dc.b (4<<3)|5,84,$10,$40,(3<<3)|5,83,$79,$40 + dc.b (4<<3)|2,37,$79,$40 + dc.b (8<<3)|3,4,$af,$00 + dc.b (8<<3)|5,32,$46,$00,(9<<3)|5,32,$6e,$00 + dc.b (8<<3)|6,46,$75,$80,(9<<3)|6,40,$af,$00,(7<<3)|6,38,$46,$00 + dc.b (7<<3)|3,3,$75,$80 + dc.b (7<<3)|5,24,$1e,$00 + dc.b (4<<3)|6,36,$b4,$00 + dc.b (6<<3)|3,2,$3c,$00 + dc.b (6<<3)|6,24,$1e,$00 + dc.b (6<<3)|7,18,$07,$80 + dc.b (8<<3)|2,4,$6e,$00,(9<<3)|2,4,$96,$00 + dc.b (7<<3)|7,8,$3c,$00,(5<<3)|7,7,$07,$80,0 + even + +; 299 (22 passes, 749 height, 172 blits) + dc.b (5<<3)|3,79,$7e,$40 + dc.b (3<<3)|5,78,$65,$40,(4<<3)|5,75,$07,$80 + dc.b (5<<3)|6,95,$07,$80,(4<<3)|6,79,$7e,$40 + dc.b (7<<3)|3,4,$73,$00,(8<<3)|3,4,$ac,$80 + dc.b (8<<3)|5,32,$43,$80,(9<<3)|5,32,$6b,$80 + dc.b (8<<3)|6,46,$73,$00,(9<<3)|6,42,$ac,$80,(7<<3)|6,38,$43,$80 + dc.b (7<<3)|5,25,$1b,$80,(2<<3)|5,21,$c6,$c0 + dc.b (3<<3)|2,21,$c6,$c0,(4<<3)|2,20,$65,$40 + dc.b (6<<3)|6,25,$1b,$80 + dc.b (6<<3)|3,2,$3a,$c0 + dc.b (6<<3)|7,16,$07,$80 + dc.b (8<<3)|2,4,$6b,$80,(9<<3)|2,4,$93,$80 + dc.b (7<<3)|7,7,$3a,$c0,0 + even + +; 300 (22 passes, 760 height, 172 blits) + dc.b (5<<3)|3,75,$56,$40 + dc.b (4<<3)|6,111,$56,$40 + dc.b (3<<3)|5,71,$53,$c0,(4<<3)|5,62,$06,$40 + dc.b (5<<3)|6,64,$06,$40 + dc.b (2<<3)|5,42,$ac,$80 + dc.b (6<<3)|3,5,$35,$c0,(7<<3)|3,5,$6f,$40,(8<<3)|3,5,$a8,$c0 + dc.b (3<<3)|2,42,$ac,$80 + dc.b (8<<3)|5,32,$3e,$80,(9<<3)|5,32,$66,$80 + dc.b (8<<3)|6,46,$6f,$40,(9<<3)|6,45,$a8,$c0,(7<<3)|6,39,$3e,$80 + dc.b (7<<3)|5,25,$16,$80 + dc.b (6<<3)|6,25,$16,$80 + dc.b (8<<3)|2,6,$66,$80,(9<<3)|2,6,$8e,$80 + dc.b (6<<3)|7,13,$06,$40,(7<<3)|7,7,$35,$c0 + dc.b (4<<3)|2,2,$53,$c0,0 + even + +; 301 (23 passes, 734 height, 183 blits) + dc.b (5<<3)|3,51,$3e,$80 + dc.b (4<<3)|6,127,$42,$40 + dc.b (3<<3)|5,67,$42,$40,(2<<3)|5,60,$96,$00,(4<<3)|5,46,$05,$00 + dc.b (6<<3)|3,5,$34,$80,(7<<3)|3,5,$6c,$c0,(8<<3)|3,5,$a6,$40 + dc.b (3<<3)|2,39,$96,$00 + dc.b (8<<3)|5,33,$3a,$c0,(9<<3)|5,32,$64,$00 + dc.b (5<<3)|6,46,$05,$00,(8<<3)|6,46,$6c,$c0,(9<<3)|6,45,$a6,$40 + dc.b (7<<3)|5,27,$12,$c0 + dc.b (7<<3)|6,40,$3a,$c0,(6<<3)|6,27,$12,$c0 + dc.b (9<<3)|3,2,$de,$80 + dc.b (8<<3)|2,6,$64,$00,(9<<3)|2,6,$8c,$00 + dc.b (6<<3)|7,11,$05,$00,(7<<3)|7,5,$34,$80,(4<<3)|7,3,$3e,$80,0 + even + +; 302 (25 passes, 722 height, 197 blits) + dc.b (5<<3)|3,42,$21,$c0 + dc.b (4<<3)|6,138,$34,$80 + dc.b (2<<3)|5,63,$82,$00,(3<<3)|5,62,$34,$80 + dc.b (8<<3)|3,6,$a1,$40,(9<<3)|3,6,$d9,$80,(7<<3)|3,5,$69,$00 + dc.b (8<<3)|5,33,$37,$00 + dc.b (6<<3)|3,4,$30,$c0 + dc.b (9<<3)|5,32,$60,$40 + dc.b (3<<3)|2,34,$82,$00 + dc.b (8<<3)|6,45,$69,$00,(9<<3)|6,45,$a1,$40 + dc.b (7<<3)|5,27,$0f,$00 + dc.b (7<<3)|6,40,$37,$00 + dc.b (4<<3)|5,24,$03,$c0 + dc.b (6<<3)|6,27,$0f,$00,(5<<3)|6,24,$03,$c0 + dc.b (1<<3)|5,13,$d0,$c0 + dc.b (2<<3)|2,13,$d0,$c0 + dc.b (4<<3)|7,15,$21,$c0 + dc.b (8<<3)|2,5,$60,$40,(9<<3)|2,5,$88,$40 + dc.b (6<<3)|7,9,$03,$c0,(7<<3)|7,5,$30,$c0,0 + even + +; 303 (27 passes, 764 height, 210 blits) + dc.b (5<<3)|3,40,$0c,$80,(4<<3)|3,17,$cb,$c0 + dc.b (4<<3)|6,134,$24,$40 + dc.b (9<<3)|3,9,$d3,$40,(8<<3)|3,8,$9c,$40 + dc.b (2<<3)|5,59,$6c,$c0,(3<<3)|5,58,$24,$40 + dc.b (6<<3)|3,6,$2d,$00,(7<<3)|3,6,$65,$40 + dc.b (1<<3)|5,34,$b6,$80,(8<<3)|5,33,$32,$00,(9<<3)|5,32,$5b,$40 + dc.b (2<<3)|2,34,$b6,$80,(3<<3)|2,33,$6c,$c0 + dc.b (8<<3)|6,44,$65,$40,(9<<3)|6,44,$9c,$40 + dc.b (7<<3)|5,28,$0a,$00 + dc.b (7<<3)|6,41,$32,$00,(6<<3)|6,28,$0a,$00,(3<<3)|6,17,$cb,$c0 + dc.b (4<<3)|5,8,$02,$80 + dc.b (8<<3)|2,7,$5b,$40,(9<<3)|2,7,$83,$40 + dc.b (4<<3)|7,19,$0c,$80 + dc.b (5<<3)|6,8,$02,$80 + dc.b (6<<3)|7,6,$02,$80,(7<<3)|7,4,$2d,$00,0 + even + +; 304 (25 passes, 775 height, 192 blits) + dc.b (4<<3)|3,46,$a7,$80,(5<<3)|3,25,$02,$80 + dc.b (4<<3)|6,115,$17,$c0 + dc.b (9<<3)|3,7,$d0,$c0 + dc.b (2<<3)|5,55,$5c,$80,(3<<3)|5,55,$17,$c0,(1<<3)|5,51,$a1,$40 + dc.b (8<<3)|3,6,$99,$c0,(7<<3)|3,5,$62,$c0 + dc.b (2<<3)|2,38,$a1,$40 + dc.b (6<<3)|3,4,$2b,$c0 + dc.b (8<<3)|5,32,$2e,$40,(9<<3)|5,32,$56,$40 + dc.b (3<<3)|6,46,$a7,$80 + dc.b (7<<3)|5,30,$06,$40 + dc.b (8<<3)|6,44,$62,$c0,(9<<3)|6,44,$99,$c0 + dc.b (3<<3)|2,30,$5c,$80 + dc.b (7<<3)|6,42,$2e,$40,(6<<3)|6,30,$06,$40 + dc.b (8<<3)|2,8,$56,$40,(9<<3)|2,8,$7e,$40 + dc.b (4<<3)|7,17,$02,$80,(6<<3)|7,3,$02,$80,(7<<3)|7,2,$2b,$c0,0 + even + +; 305 (26 passes, 779 height, 192 blits) + dc.b (4<<3)|3,51,$8c,$00,(5<<3)|3,9,$01,$40 + dc.b (4<<3)|6,102,$0c,$80 + dc.b (9<<3)|3,8,$c9,$40,(7<<3)|3,7,$5c,$80,(8<<3)|3,7,$93,$80 + dc.b (1<<3)|5,52,$8e,$80,(2<<3)|5,52,$4d,$80,(3<<3)|5,52,$0c,$80 + dc.b (3<<3)|6,68,$8c,$00 + dc.b (6<<3)|3,5,$26,$c0 + dc.b (8<<3)|5,32,$28,$00,(9<<3)|5,32,$50,$00,(7<<3)|5,30,$01,$40 + dc.b (2<<3)|2,32,$8e,$80 + dc.b (8<<3)|6,44,$5c,$80,(9<<3)|6,43,$93,$80,(7<<3)|6,42,$28,$00 + dc.b (3<<3)|2,25,$4d,$80 + dc.b (6<<3)|6,30,$01,$40 + dc.b (0<<3)|5,14,$cf,$80 + dc.b (1<<3)|2,14,$cf,$80,(8<<3)|2,9,$50,$00,(9<<3)|2,9,$78,$00 + dc.b (4<<3)|7,9,$01,$40,(7<<3)|7,1,$26,$c0,0 + even + +; 306 (25 passes, 782 height, 178 blits) + dc.b (4<<3)|3,40,$75,$80,(9<<3)|3,8,$c6,$c0 + dc.b (4<<3)|6,93,$01,$40 + dc.b (6<<3)|3,7,$23,$00,(7<<3)|3,7,$5a,$00,(8<<3)|3,7,$91,$00 + dc.b (3<<3)|6,86,$75,$80 + dc.b (3<<3)|5,50,$01,$40,(1<<3)|5,49,$7d,$00,(2<<3)|5,49,$3f,$c0,(8<<3)|5,32,$23,$00,(9<<3)|5,32,$4b,$00,(0<<3)|5,31,$ba,$40 + dc.b (7<<3)|6,44,$23,$00,(8<<3)|6,44,$5a,$00 + dc.b (1<<3)|2,31,$ba,$40 + dc.b (9<<3)|6,43,$91,$00 + dc.b (7<<3)|5,28,$00,$00 + dc.b (2<<3)|2,29,$7d,$00,(3<<3)|2,23,$3f,$c0 + dc.b (6<<3)|6,28,$00,$00 + dc.b (5<<3)|3,2,$00,$00 + dc.b (8<<3)|2,9,$4b,$00,(9<<3)|2,9,$73,$00 + dc.b (4<<3)|7,1,$00,$00,0 + even + +; 307 (25 passes, 754 height, 170 blits) + dc.b (4<<3)|3,36,$5f,$00 + dc.b (3<<3)|6,104,$5f,$00,(4<<3)|6,76,$00,$00 + dc.b (1<<3)|5,49,$6f,$40 + dc.b (8<<3)|3,6,$8c,$00,(9<<3)|3,6,$c1,$c0 + dc.b (2<<3)|5,48,$33,$40,(0<<3)|5,42,$ac,$80,(3<<3)|5,41,$00,$00 + dc.b (7<<3)|3,5,$56,$40,(6<<3)|3,4,$21,$c0 + dc.b (8<<3)|5,32,$1e,$00,(9<<3)|5,32,$46,$00 + dc.b (8<<3)|6,43,$56,$40,(9<<3)|6,43,$8c,$00,(7<<3)|6,42,$21,$c0 + dc.b (1<<3)|2,28,$ac,$80 + dc.b (7<<3)|5,24,$00,$00 + dc.b (2<<3)|2,25,$6f,$40,(3<<3)|2,21,$33,$40 + dc.b (6<<3)|6,27,$00,$00 + dc.b (5<<3)|3,1,$00,$00 + dc.b (8<<3)|2,8,$46,$00,(9<<3)|2,8,$6e,$00,(7<<3)|2,3,$1e,$00,0 + even + +; 308 (27 passes, 760 height, 186 blits) + dc.b (4<<3)|3,35,$49,$c0,(3<<3)|3,21,$c6,$c0,(9<<3)|3,9,$bb,$80 + dc.b (3<<3)|6,100,$49,$c0 + dc.b (8<<3)|3,8,$87,$00,(7<<3)|3,6,$52,$80 + dc.b (0<<3)|5,48,$9e,$c0,(1<<3)|5,48,$62,$c0,(2<<3)|5,48,$26,$c0 + dc.b (4<<3)|6,59,$00,$00 + dc.b (6<<3)|3,4,$1e,$00 + dc.b (8<<3)|5,32,$19,$00,(9<<3)|5,32,$41,$00,(3<<3)|5,31,$00,$00 + dc.b (7<<3)|6,42,$1e,$00,(8<<3)|6,42,$52,$80,(9<<3)|6,42,$87,$00 + dc.b (1<<3)|2,22,$9e,$c0 + dc.b (7<<3)|5,20,$00,$00 + dc.b (2<<3)|2,21,$62,$c0,(3<<3)|2,20,$26,$c0 + dc.b (6<<3)|6,24,$00,$00,(2<<3)|6,21,$c6,$c0 + dc.b (8<<3)|2,8,$41,$00,(9<<3)|2,8,$69,$00,(0<<3)|2,5,$da,$c0,(7<<3)|2,4,$19,$00,0 + even + +; 309 (27 passes, 758 height, 186 blits) + dc.b (3<<3)|3,37,$b2,$c0,(4<<3)|3,27,$3d,$40 + dc.b (3<<3)|6,94,$3d,$40 + dc.b (9<<3)|3,7,$b9,$00,(6<<3)|3,6,$1a,$40,(7<<3)|3,6,$4e,$c0,(8<<3)|3,6,$84,$80 + dc.b (0<<3)|5,47,$92,$40,(1<<3)|5,47,$57,$80,(2<<3)|5,47,$1c,$c0 + dc.b (4<<3)|6,49,$00,$00 + dc.b (8<<3)|5,32,$12,$c0,(9<<3)|5,32,$3a,$c0 + dc.b (8<<3)|6,43,$4e,$c0,(7<<3)|6,42,$1a,$40,(9<<3)|6,42,$84,$80,(2<<3)|6,37,$b2,$c0 + dc.b (3<<3)|5,23,$00,$00 + dc.b (1<<3)|2,21,$92,$40,(2<<3)|2,19,$57,$80,(3<<3)|2,18,$1c,$c0 + dc.b (7<<3)|5,15,$00,$00 + dc.b (0<<3)|2,16,$cd,$00 + dc.b (6<<3)|6,21,$00,$00 + dc.b (8<<3)|2,9,$3a,$c0,(9<<3)|2,9,$62,$c0,(7<<3)|2,6,$12,$c0,0 + even + +; 310 (27 passes, 739 height, 186 blits) + dc.b (3<<3)|3,36,$99,$c0,(4<<3)|3,24,$2b,$c0,(9<<3)|3,8,$b1,$80 + dc.b (3<<3)|6,88,$2b,$c0 + dc.b (7<<3)|3,7,$49,$c0,(8<<3)|3,7,$7e,$40,(6<<3)|3,6,$16,$80 + dc.b (1<<3)|5,47,$4c,$40,(2<<3)|5,47,$11,$80,(0<<3)|5,46,$87,$00 + dc.b (2<<3)|6,57,$99,$c0 + dc.b (8<<3)|5,32,$0d,$c0,(9<<3)|5,32,$35,$c0 + dc.b (8<<3)|6,42,$49,$c0,(7<<3)|6,41,$16,$80,(9<<3)|6,41,$7e,$40,(4<<3)|6,35,$00,$00 + dc.b (0<<3)|2,21,$c0,$80,(1<<3)|2,19,$87,$00,(2<<3)|2,18,$4c,$40,(3<<3)|2,17,$11,$80 + dc.b (3<<3)|5,14,$00,$00 + dc.b (6<<3)|6,18,$00,$00 + dc.b (7<<3)|5,11,$00,$00 + dc.b (8<<3)|2,9,$35,$c0,(9<<3)|2,9,$5d,$c0,(7<<3)|2,7,$0d,$c0,0 + even + +; 311 (27 passes, 735 height, 186 blits) + dc.b (3<<3)|3,37,$84,$80,(4<<3)|3,26,$1c,$c0,(9<<3)|3,10,$ac,$80,(8<<3)|3,9,$79,$40,(7<<3)|3,7,$46,$00 + dc.b (3<<3)|6,83,$1c,$c0 + dc.b (6<<3)|3,6,$12,$c0 + dc.b (2<<3)|6,74,$84,$80 + dc.b (0<<3)|5,46,$76,$c0,(2<<3)|5,46,$05,$00,(1<<3)|5,45,$3e,$80,(8<<3)|5,32,$07,$80,(9<<3)|5,32,$2f,$80 + dc.b (7<<3)|6,41,$12,$c0,(8<<3)|6,41,$46,$00,(9<<3)|6,41,$79,$40 + dc.b (0<<3)|2,23,$b0,$40,(1<<3)|2,22,$76,$c0,(2<<3)|2,20,$3e,$80,(3<<3)|2,19,$05,$00 + dc.b (4<<3)|6,23,$00,$00,(6<<3)|6,15,$00,$00 + dc.b (7<<3)|2,9,$07,$80,(8<<3)|2,9,$2f,$80,(9<<3)|2,9,$57,$80 + dc.b (7<<3)|5,6,$00,$00,(3<<3)|5,4,$00,$00,0 + even + +; 312 (28 passes, 714 height, 191 blits) + dc.b (3<<3)|3,33,$70,$80,(4<<3)|3,23,$0f,$00,(2<<3)|3,12,$d2,$00,(9<<3)|3,8,$a7,$80,(8<<3)|3,7,$75,$80 + dc.b (2<<3)|6,78,$70,$80,(3<<3)|6,78,$0f,$00 + dc.b (7<<3)|3,6,$42,$40 + dc.b (1<<3)|5,46,$30,$c0,(0<<3)|5,45,$6a,$40 + dc.b (6<<3)|3,5,$10,$40 + dc.b (2<<3)|5,39,$00,$00,(8<<3)|5,32,$01,$40,(9<<3)|5,32,$29,$40 + dc.b (8<<3)|6,41,$42,$40,(7<<3)|6,40,$10,$40,(9<<3)|6,40,$75,$80 + dc.b (0<<3)|2,24,$a2,$80,(1<<3)|2,23,$6a,$40,(2<<3)|2,22,$30,$c0,(3<<3)|2,12,$00,$00,(7<<3)|2,10,$01,$40,(8<<3)|2,10,$29,$40,(9<<3)|2,10,$51,$40 + dc.b (6<<3)|6,13,$00,$00,(1<<3)|6,12,$d2,$00,(4<<3)|6,12,$00,$00 + dc.b (7<<3)|5,1,$00,$00,0 + even + +; 313 (27 passes, 685 height, 183 blits) + dc.b (3<<3)|3,28,$61,$80,(2<<3)|3,27,$bf,$40,(4<<3)|3,19,$05,$00,(9<<3)|3,9,$a1,$40,(8<<3)|3,8,$6f,$40,(7<<3)|3,7,$3d,$40 + dc.b (2<<3)|6,75,$61,$80 + dc.b (6<<3)|3,6,$0b,$40 + dc.b (3<<3)|6,74,$05,$00 + dc.b (1<<3)|5,45,$25,$80,(0<<3)|5,44,$5d,$c0,(9<<3)|5,32,$21,$c0,(2<<3)|5,30,$00,$00,(8<<3)|5,27,$00,$00 + dc.b (7<<3)|6,40,$0b,$40,(8<<3)|6,40,$3d,$40,(9<<3)|6,40,$6f,$40 + dc.b (0<<3)|2,22,$94,$c0,(1<<3)|2,20,$5d,$c0,(2<<3)|2,20,$25,$80 + dc.b (1<<3)|6,27,$bf,$40 + dc.b (8<<3)|2,11,$21,$c0,(9<<3)|2,11,$49,$c0 + dc.b (6<<3)|6,9,$00,$00 + dc.b (7<<3)|2,6,$00,$00,(3<<3)|2,4,$00,$00 + dc.b (4<<3)|6,4,$00,$00,0 + even + +; 314 (25 passes, 654 height, 167 blits) + dc.b (2<<3)|3,33,$a8,$c0,(3<<3)|3,25,$51,$40,(4<<3)|3,12,$00,$00,(8<<3)|3,9,$6a,$40,(9<<3)|3,9,$9c,$40,(6<<3)|3,7,$07,$80,(7<<3)|3,7,$39,$80 + dc.b (2<<3)|6,70,$51,$40 + dc.b (0<<3)|5,44,$50,$00,(1<<3)|5,44,$19,$00 + dc.b (3<<3)|6,65,$00,$00 + dc.b (9<<3)|5,32,$1b,$80 + dc.b (1<<3)|6,45,$a8,$c0,(7<<3)|6,40,$07,$80,(9<<3)|6,40,$6a,$40,(8<<3)|6,39,$39,$80 + dc.b (8<<3)|5,22,$00,$00 + dc.b (0<<3)|2,22,$87,$00 + dc.b (2<<3)|5,20,$00,$00 + dc.b (1<<3)|2,21,$50,$00,(2<<3)|2,19,$19,$00,(8<<3)|2,11,$1b,$80,(9<<3)|2,11,$43,$80 + dc.b (6<<3)|6,6,$00,$00 + dc.b (7<<3)|2,1,$00,$00,0 + even + +; 315 (24 passes, 618 height, 161 blits) + dc.b (2<<3)|3,31,$98,$80,(3<<3)|3,24,$43,$80,(9<<3)|3,8,$97,$40,(8<<3)|3,7,$66,$80,(7<<3)|3,6,$35,$c0 + dc.b (2<<3)|6,68,$43,$80 + dc.b (1<<3)|5,44,$0b,$40,(0<<3)|5,43,$42,$40 + dc.b (6<<3)|3,5,$05,$00 + dc.b (1<<3)|6,58,$98,$80,(3<<3)|6,54,$00,$00 + dc.b (4<<3)|3,4,$00,$00 + dc.b (9<<3)|5,32,$14,$00 + dc.b (7<<3)|6,39,$05,$00,(8<<3)|6,39,$35,$c0,(9<<3)|6,39,$66,$80 + dc.b (0<<3)|2,23,$78,$00,(1<<3)|2,22,$42,$40,(2<<3)|2,21,$0b,$40 + dc.b (8<<3)|5,16,$00,$00 + dc.b (8<<3)|2,11,$14,$00,(9<<3)|2,11,$3c,$00 + dc.b (2<<3)|5,9,$00,$00 + dc.b (6<<3)|6,4,$00,$00,0 + even + +; 316 (23 passes, 601 height, 153 blits) + dc.b (2<<3)|3,27,$87,$00,(3<<3)|3,21,$37,$00,(9<<3)|3,10,$8f,$c0,(7<<3)|3,9,$2e,$40,(8<<3)|3,9,$5f,$00,(1<<3)|3,8,$d7,$00,(6<<3)|3,6,$00,$00 + dc.b (0<<3)|5,43,$35,$c0,(1<<3)|5,43,$00,$00 + dc.b (1<<3)|6,64,$87,$00,(2<<3)|6,64,$37,$00 + dc.b (9<<3)|5,32,$0b,$40 + dc.b (3<<3)|6,44,$00,$00,(8<<3)|6,39,$2e,$40,(9<<3)|6,39,$5f,$00,(7<<3)|6,37,$00,$00 + dc.b (0<<3)|2,22,$6b,$80,(1<<3)|2,21,$35,$c0,(2<<3)|2,20,$00,$00,(8<<3)|2,13,$0b,$40,(9<<3)|2,13,$33,$40 + dc.b (8<<3)|5,9,$00,$00 + dc.b (0<<3)|6,8,$d7,$00,0 + even + +; 317 (23 passes, 578 height, 153 blits) + dc.b (2<<3)|3,26,$78,$00,(1<<3)|3,23,$c4,$40,(3<<3)|3,20,$2a,$80,(9<<3)|3,10,$8a,$c0,(8<<3)|3,9,$5b,$40,(7<<3)|3,8,$2b,$c0 + dc.b (0<<3)|5,42,$28,$00 + dc.b (2<<3)|6,62,$2a,$80,(1<<3)|6,61,$78,$00 + dc.b (6<<3)|3,4,$00,$00 + dc.b (1<<3)|5,32,$00,$00,(9<<3)|5,32,$03,$c0 + dc.b (8<<3)|6,38,$2b,$c0,(9<<3)|6,38,$5b,$40,(7<<3)|6,35,$00,$00,(3<<3)|6,34,$00,$00 + dc.b (0<<3)|2,22,$5c,$80,(1<<3)|2,21,$28,$00 + dc.b (0<<3)|6,23,$c4,$40 + dc.b (8<<3)|2,13,$03,$c0,(9<<3)|2,13,$2b,$c0,(2<<3)|2,9,$00,$00 + dc.b (8<<3)|5,3,$00,$00,0 + even + +; 318 (20 passes, 542 height, 136 blits) + dc.b (1<<3)|3,30,$b1,$80,(2<<3)|3,24,$69,$00,(3<<3)|3,19,$1f,$40,(9<<3)|3,10,$83,$40,(8<<3)|3,9,$53,$c0,(7<<3)|3,8,$24,$40 + dc.b (0<<3)|5,42,$1b,$80 + dc.b (2<<3)|6,59,$1f,$40,(1<<3)|6,58,$69,$00 + dc.b (9<<3)|5,28,$00,$00 + dc.b (0<<3)|6,38,$b1,$80,(8<<3)|6,38,$24,$40,(9<<3)|6,38,$53,$c0 + dc.b (1<<3)|5,22,$00,$00 + dc.b (0<<3)|2,22,$50,$00,(1<<3)|2,21,$1b,$80 + dc.b (7<<3)|6,29,$00,$00,(3<<3)|6,25,$00,$00 + dc.b (9<<3)|2,13,$23,$00,(8<<3)|2,9,$00,$00,0 + even + +; 319 (20 passes, 514 height, 136 blits) + dc.b (1<<3)|3,28,$a1,$40,(2<<3)|3,24,$5a,$00,(3<<3)|3,18,$14,$00,(9<<3)|3,11,$7d,$00,(8<<3)|3,10,$4e,$c0,(7<<3)|3,9,$20,$80 + dc.b (0<<3)|5,41,$0c,$80 + dc.b (1<<3)|6,57,$5a,$00,(2<<3)|6,56,$14,$00,(0<<3)|6,51,$a1,$40,(8<<3)|6,37,$20,$80,(9<<3)|6,37,$4e,$c0 + dc.b (0<<3)|2,23,$3f,$c0 + dc.b (9<<3)|5,21,$00,$00 + dc.b (1<<3)|2,22,$0c,$80 + dc.b (7<<3)|6,26,$00,$00 + dc.b (9<<3)|2,14,$1a,$40 + dc.b (3<<3)|6,16,$00,$00 + dc.b (1<<3)|5,10,$00,$00 + dc.b (8<<3)|2,3,$00,$00,0 + even + +; 320 (19 passes, 482 height, 125 blits) + dc.b (1<<3)|3,26,$91,$00,(2<<3)|3,22,$4d,$80,(3<<3)|3,17,$0a,$00,(9<<3)|3,11,$75,$80,(0<<3)|3,10,$d4,$80,(8<<3)|3,10,$47,$40,(7<<3)|3,8,$1a,$40 + dc.b (0<<3)|5,41,$00,$00 + dc.b (0<<3)|6,54,$91,$00,(1<<3)|6,54,$4d,$80,(2<<3)|6,54,$0a,$00,(9<<3)|6,37,$47,$40,(8<<3)|6,36,$1a,$40 + dc.b (0<<3)|2,23,$33,$40,(1<<3)|2,22,$00,$00,(9<<3)|2,15,$10,$40 + dc.b (7<<3)|6,21,$00,$00 + dc.b (9<<3)|5,13,$00,$00 + dc.b (3<<3)|6,8,$00,$00,0 + even + +; 321 (18 passes, 442 height, 115 blits) + dc.b (1<<3)|3,25,$82,$00,(0<<3)|3,24,$c3,$00,(2<<3)|3,20,$41,$00,(3<<3)|3,16,$00,$00,(9<<3)|3,11,$6f,$40,(8<<3)|3,10,$42,$40,(7<<3)|3,9,$15,$40 + dc.b (0<<3)|6,52,$82,$00,(1<<3)|6,52,$41,$00,(2<<3)|6,52,$00,$00 + dc.b (0<<3)|5,29,$00,$00 + dc.b (8<<3)|6,36,$15,$40,(9<<3)|6,36,$42,$40 + dc.b (0<<3)|2,22,$24,$40,(9<<3)|2,15,$07,$80 + dc.b (7<<3)|6,17,$00,$00 + dc.b (1<<3)|2,10,$00,$00 + dc.b (9<<3)|5,6,$00,$00,0 + even + +; 322 (16 passes, 386 height, 101 blits) + dc.b (0<<3)|3,28,$b1,$80,(1<<3)|3,24,$73,$00,(2<<3)|3,20,$34,$80,(9<<3)|3,9,$6a,$40,(3<<3)|3,8,$00,$00,(7<<3)|3,8,$10,$40,(8<<3)|3,8,$3d,$40 + dc.b (0<<3)|6,50,$73,$00,(1<<3)|6,50,$34,$80,(2<<3)|6,42,$00,$00,(8<<3)|6,36,$10,$40,(9<<3)|6,36,$3d,$40 + dc.b (0<<3)|2,23,$16,$80 + dc.b (0<<3)|5,18,$00,$00 + dc.b (9<<3)|2,13,$00,$00 + dc.b (7<<3)|6,13,$00,$00,0 + even + +; 323 (15 passes, 335 height, 98 blits) + dc.b (0<<3)|3,25,$a3,$c0,(1<<3)|3,21,$67,$c0,(2<<3)|3,17,$2b,$c0,(9<<3)|3,10,$62,$c0,(8<<3)|3,9,$37,$00,(7<<3)|3,8,$0b,$40 + dc.b (0<<3)|6,48,$67,$c0,(1<<3)|6,48,$2b,$c0,(2<<3)|6,35,$00,$00,(8<<3)|6,35,$0b,$40,(9<<3)|6,35,$37,$00 + dc.b (0<<3)|2,23,$07,$80 + dc.b (0<<3)|5,6,$00,$00 + dc.b (7<<3)|6,9,$00,$00 + dc.b (9<<3)|2,6,$00,$00,0 + even + +; 324 (13 passes, 303 height, 84 blits) + dc.b (0<<3)|3,25,$92,$40,(1<<3)|3,21,$58,$c0,(2<<3)|3,18,$1e,$00,(9<<3)|3,11,$5c,$80,(8<<3)|3,10,$30,$c0,(7<<3)|3,9,$05,$00 + dc.b (1<<3)|6,47,$1e,$00,(0<<3)|6,46,$58,$c0,(8<<3)|6,35,$05,$00,(9<<3)|6,35,$30,$c0 + dc.b (0<<3)|2,18,$00,$00 + dc.b (2<<3)|6,24,$00,$00,(7<<3)|6,4,$00,$00,0 + even + +; 325 (12 passes, 272 height, 74 blits) + dc.b (0<<3)|3,23,$87,$00,(1<<3)|3,20,$4e,$c0,(2<<3)|3,17,$16,$80,(8<<3)|3,10,$2a,$80,(9<<3)|3,10,$56,$40,(7<<3)|3,9,$00,$00 + dc.b (0<<3)|6,45,$4e,$c0,(1<<3)|6,45,$16,$80,(9<<3)|6,35,$2a,$80,(8<<3)|6,34,$00,$00,(2<<3)|6,18,$00,$00 + dc.b (0<<3)|2,6,$00,$00,0 + even + +; 326 (11 passes, 238 height, 68 blits) + dc.b (0<<3)|3,21,$78,$00,(1<<3)|3,18,$42,$40,(2<<3)|3,15,$0b,$40,(9<<3)|3,11,$4e,$c0,(8<<3)|3,10,$24,$40,(7<<3)|3,4,$00,$00 + dc.b (1<<3)|6,44,$0b,$40,(0<<3)|6,43,$42,$40,(9<<3)|6,34,$24,$40,(8<<3)|6,29,$00,$00,(2<<3)|6,9,$00,$00,0 + even + +; 327 (10 passes, 222 height, 65 blits) + dc.b (0<<3)|3,23,$6a,$40,(1<<3)|3,19,$37,$00,(2<<3)|3,16,$02,$80,(9<<3)|3,12,$47,$40,(8<<3)|3,10,$1e,$00 + dc.b (1<<3)|6,42,$02,$80,(0<<3)|6,41,$37,$00,(9<<3)|6,33,$1e,$00,(8<<3)|6,24,$00,$00,(2<<3)|6,2,$00,$00,0 + even + +; 328 (9 passes, 196 height, 55 blits) + dc.b (0<<3)|3,20,$5f,$00,(1<<3)|3,17,$2d,$00,(9<<3)|3,12,$3f,$c0,(8<<3)|3,11,$16,$80,(2<<3)|3,9,$00,$00 + dc.b (0<<3)|6,40,$2d,$00,(1<<3)|6,36,$00,$00,(9<<3)|6,33,$16,$80,(8<<3)|6,18,$00,$00,0 + even + +; 329 (9 passes, 170 height, 55 blits) + dc.b (0<<3)|3,18,$53,$c0,(1<<3)|3,16,$23,$00,(9<<3)|3,11,$39,$80,(8<<3)|3,10,$11,$80 + dc.b (0<<3)|6,39,$23,$00,(9<<3)|6,32,$11,$80,(1<<3)|6,28,$00,$00 + dc.b (2<<3)|3,2,$00,$00 + dc.b (8<<3)|6,14,$00,$00,0 + even + +; 330 (8 passes, 151 height, 52 blits) + dc.b (0<<3)|3,17,$49,$c0,(1<<3)|3,15,$1a,$40,(9<<3)|3,10,$33,$40,(8<<3)|3,9,$0b,$40 + dc.b (0<<3)|6,38,$1a,$40,(9<<3)|6,32,$0b,$40,(1<<3)|6,21,$00,$00,(8<<3)|6,9,$00,$00,0 + even + +; 331 (8 passes, 136 height, 52 blits) + dc.b (0<<3)|3,17,$3e,$80,(1<<3)|3,14,$11,$80,(8<<3)|3,9,$06,$40,(9<<3)|3,9,$2e,$40 + dc.b (0<<3)|6,36,$11,$80,(9<<3)|6,32,$06,$40,(1<<3)|6,14,$00,$00,(8<<3)|6,5,$00,$00,0 + even + +; 332 (7 passes, 123 height, 42 blits) + dc.b (0<<3)|3,17,$34,$80,(1<<3)|3,14,$08,$c0,(9<<3)|3,10,$26,$c0,(8<<3)|3,9,$00,$00 + dc.b (0<<3)|6,35,$08,$c0,(9<<3)|6,31,$00,$00,(1<<3)|6,7,$00,$00,0 + even + +; 333 (7 passes, 105 height, 42 blits) + dc.b (0<<3)|3,14,$2d,$00,(1<<3)|3,13,$01,$40,(9<<3)|3,11,$20,$80,(8<<3)|3,5,$00,$00 + dc.b (0<<3)|6,35,$01,$40,(9<<3)|6,26,$00,$00,(1<<3)|6,1,$00,$00,0 + even + +; 334 (3 passes, 80 height, 9 blits) + dc.b (0<<3)|3,42,$00,$00,(9<<3)|3,31,$00,$00,(1<<3)|3,7,$00,$00,0 + even + +; 335 (3 passes, 63 height, 9 blits) + dc.b (0<<3)|3,36,$00,$00,(9<<3)|3,26,$00,$00,(1<<3)|3,1,$00,$00,0 + even + diff --git a/source/bulb/record.bat b/source/bulb/record.bat new file mode 100644 index 0000000..ca15473 --- /dev/null +++ b/source/bulb/record.bat @@ -0,0 +1,30 @@ +del bulb.exe +del "..\winuae\hd0\bulb.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "bulb.exe" "bulb.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy bulb.exe "..\winuae\hd0" +copy bulb.exe "..\winuae\hd0\a.exe" + +@echo /|set /p =bulb.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_rec.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/bulb/sintable.asm b/source/bulb/sintable.asm new file mode 100644 index 0000000..d506854 --- /dev/null +++ b/source/bulb/sintable.asm @@ -0,0 +1,4 @@ + ; Sin table + dc.w $0000,$0648,$0c90,$12d5,$1918,$1f56,$2590,$2bc4 + dc.w $31f1,$3817,$3e34,$4447,$4a50,$504d,$563e,$5c22 + dc.w $61f8,$67be,$6d74,$731a,$78ad diff --git a/source/bulb/swing2.asm b/source/bulb/swing2.asm new file mode 100644 index 0000000..a4dff29 --- /dev/null +++ b/source/bulb/swing2.asm @@ -0,0 +1,2736 @@ +; 0 + dc.w 16073,1 + dc.w 3,197,179,209,217,105,319 + dc.w 8,202,179,249,212,129,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,170,$df,$da,$a,32,$33,$5e,$a,32,$5b,$62,$a,32,$83,$66,$a,7,$0b,$5a,0,0 + ; Brightfill (6 passes, 280 height) + dc.b $e,93,$df,$de,$e,65,$6b,$9a,$a,36,$47,$5e,$a,36,$74,$62,$a,36,$a1,$66,$a,14,$1a,$5a,0,0 + +; 1 + dc.w 16073,1 + dc.w 3,197,179,209,217,105,319 + dc.w 8,202,179,249,212,129,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,170,$df,$da,$a,32,$33,$5e,$a,32,$5b,$62,$a,32,$83,$66,$a,7,$0b,$5a,0,0 + ; Brightfill (6 passes, 280 height) + dc.b $e,93,$df,$de,$e,65,$6b,$9a,$a,36,$47,$5e,$a,36,$74,$62,$a,36,$a1,$66,$a,14,$1a,$5a,0,0 + +; 2 + dc.w 16072,1 + dc.w 3,197,179,209,217,105,319 + dc.w 8,202,179,248,212,129,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,170,$df,$da,$a,32,$33,$5e,$a,32,$5b,$62,$a,32,$83,$66,$a,7,$0b,$5a,0,0 + ; Brightfill (6 passes, 280 height) + dc.b $e,92,$df,$de,$e,66,$6c,$da,$a,36,$47,$5e,$a,36,$74,$62,$a,36,$a1,$66,$a,14,$1a,$5a,0,0 + +; 3 + dc.w 16133,1 + dc.w 3,197,179,209,217,106,319 + dc.w 8,202,179,248,212,130,319 + ; Darkfill (5 passes, 274 height) + dc.b $e,170,$df,$da,$a,33,$5c,$a2,$a,32,$33,$5e,$a,32,$84,$a6,$a,7,$0b,$5a,0,0 + ; Brightfill (6 passes, 281 height) + dc.b $e,92,$df,$de,$e,66,$6c,$da,$a,37,$75,$a2,$a,36,$47,$5e,$a,36,$a2,$a6,$a,14,$1a,$5a,0,0 + +; 4 + dc.w 16137,1 + dc.w 3,196,179,208,216,106,319 + dc.w 8,201,179,248,211,131,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,169,$df,$da,$a,32,$34,$9e,$a,32,$5c,$a2,$a,32,$84,$a6,$a,8,$0c,$9a,0,0 + ; Brightfill (6 passes, 281 height) + dc.b $e,90,$df,$de,$e,67,$6f,$5a,$a,37,$76,$e2,$a,36,$48,$9e,$a,36,$a3,$e6,$a,15,$1b,$9a,0,0 + +; 5 + dc.w 16125,1 + dc.w 3,196,179,208,216,106,319 + dc.w 8,201,179,247,211,131,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,169,$df,$da,$a,32,$34,$9e,$a,32,$5c,$a2,$a,32,$84,$a6,$a,8,$0c,$9a,0,0 + ; Brightfill (6 passes, 281 height) + dc.b $e,88,$df,$de,$e,69,$71,$da,$a,37,$76,$e2,$a,36,$48,$9e,$a,36,$a3,$e6,$a,15,$1b,$9a,0,0 + +; 6 + dc.w 17517,0 + dc.w 5,201,179,244,211,127,319 + dc.w 8,203,179,284,209,179,310 + ; Darkfill (6 passes, 283 height) + dc.b $e,83,$df,$de,$e,77,$78,$1a,$a,36,$44,$de,$a,36,$71,$e2,$a,36,$9e,$e6,$a,15,$17,$da,0,0 + ; Brightfill (7 passes, 262 height) + dc.b $a,54,$6b,$9e,$a,54,$af,$22,$e,39,$df,$e2,$a,39,$df,$e6,$e,32,$93,$9e,$a,25,$28,$1a,$e,19,$3f,$da,0,0 + +; 7 + dc.w 10308,0 + dc.w 8,206,179,284,206,179,310 + dc.w 8,206,10,212,206,10,202 + ; Darkfill (7 passes, 246 height) + dc.b $a,53,$6f,$5e,$a,53,$b1,$a2,$e,37,$df,$e2,$a,37,$df,$e6,$a,29,$2d,$1a,$e,27,$91,$1e,$e,10,$39,$9a,0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 8 + dc.w 4640,0 + dc.w 8,206,10,217,206,10,197 + dc.w 8,206,10,212,206,10,202 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 9 + dc.w 2460,0 + dc.w 8,206,10,217,206,10,197 + dc.w 8,206,10,212,206,10,202 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 10 + dc.w 18094,1 + dc.w 3,195,179,205,215,107,319 + dc.w 8,200,179,244,210,136,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,168,$df,$da,$a,32,$35,$de,$a,32,$5d,$e2,$a,32,$85,$e6,$a,9,$0d,$da,0,0 + ; Brightfill (6 passes, 285 height) + dc.b $e,80,$df,$de,$e,76,$7b,$da,$a,38,$4c,$5e,$a,38,$7b,$e2,$a,37,$aa,$26,$a,16,$1c,$da,0,0 + +; 11 + dc.w 18005,1 + dc.w 4,195,179,204,215,108,319 + dc.w 9,200,179,243,210,137,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,167,$df,$da,$a,32,$37,$1e,$a,32,$5f,$22,$a,32,$87,$26,$a,9,$0f,$1a,0,0 + ; Brightfill (6 passes, 284 height) + dc.b $e,78,$df,$de,$e,77,$7e,$5a,$a,38,$4d,$9e,$a,38,$7d,$22,$a,37,$ab,$66,$a,16,$1e,$1a,0,0 + +; 12 + dc.w 16182,1 + dc.w 4,195,179,203,215,108,319 + dc.w 9,200,179,242,210,138,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,167,$df,$da,$a,32,$37,$1e,$a,32,$5f,$22,$a,32,$87,$26,$a,9,$0f,$1a,0,0 + ; Brightfill (6 passes, 285 height) + dc.b $e,80,$82,$1a,$e,75,$df,$de,$a,38,$4d,$9e,$a,38,$7d,$22,$a,38,$ac,$a6,$a,16,$1e,$1a,0,0 + +; 13 + dc.w 16183,1 + dc.w 4,194,179,202,214,109,319 + dc.w 9,199,179,241,209,140,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,166,$df,$da,$a,32,$38,$5e,$a,32,$60,$62,$a,32,$88,$66,$a,10,$10,$5a,0,0 + ; Brightfill (6 passes, 285 height) + dc.b $e,82,$87,$1a,$e,71,$df,$de,$a,38,$50,$1e,$a,38,$7f,$a2,$a,38,$af,$26,$a,18,$20,$9a,0,0 + +; 14 + dc.w 16194,1 + dc.w 4,194,179,201,214,109,319 + dc.w 9,199,179,240,209,141,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,166,$df,$da,$a,32,$38,$5e,$a,32,$60,$62,$a,32,$88,$66,$a,10,$10,$5a,0,0 + ; Brightfill (6 passes, 286 height) + dc.b $e,84,$89,$9a,$e,69,$df,$de,$a,39,$80,$e2,$a,38,$50,$1e,$a,38,$b0,$66,$a,18,$20,$9a,0,0 + +; 15 + dc.w 16211,1 + dc.w 4,194,179,200,214,109,319 + dc.w 9,199,179,239,209,143,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,166,$df,$da,$a,32,$38,$5e,$a,32,$60,$62,$a,32,$88,$66,$a,10,$10,$5a,0,0 + ; Brightfill (6 passes, 288 height) + dc.b $e,87,$8d,$5a,$e,66,$df,$de,$a,39,$51,$5e,$a,39,$82,$22,$a,39,$b2,$e6,$a,18,$20,$9a,0,0 + +; 16 + dc.w 16275,1 + dc.w 4,193,179,198,213,110,319 + dc.w 9,198,179,238,208,145,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,165,$df,$da,$a,32,$39,$9e,$a,32,$61,$a2,$a,32,$89,$a6,$a,11,$11,$9a,0,0 + ; Brightfill (6 passes, 289 height) + dc.b $e,90,$92,$5a,$e,62,$df,$de,$a,40,$53,$de,$a,39,$84,$a2,$a,39,$b5,$66,$a,19,$21,$da,0,0 + +; 17 + dc.w 17224,0 + dc.w 7,198,179,235,208,141,319 + dc.w 10,200,179,273,206,179,298 + ; Darkfill (6 passes, 289 height) + dc.b $e,100,$9c,$5a,$e,54,$df,$de,$a,39,$50,$1e,$a,39,$b0,$66,$a,38,$7f,$a2,$a,19,$1f,$5a,0,0 + ; Brightfill (7 passes, 250 height) + dc.b $a,59,$c6,$e2,$a,58,$7d,$1e,$e,38,$ac,$9e,$a,33,$34,$9a,$e,22,$50,$1a,$e,20,$df,$e2,$a,20,$df,$e6,0,0 + +; 18 + dc.w 9926,0 + dc.w 10,202,179,272,202,179,296 + dc.w 10,202,12,208,202,12,198 + ; Darkfill (7 passes, 232 height) + dc.b $a,58,$84,$9e,$a,57,$cb,$e2,$a,39,$3c,$1a,$e,33,$ad,$de,$e,16,$df,$e2,$a,16,$df,$e6,$e,13,$4c,$5a,0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 19 + dc.w 18011,1 + dc.w 5,192,179,195,212,112,319 + dc.w 10,197,179,234,207,152,319 + ; Darkfill (5 passes, 271 height) + dc.b $e,163,$df,$da,$a,32,$3c,$1e,$a,32,$64,$22,$a,32,$8c,$26,$a,12,$14,$1a,0,0 + ; Brightfill (6 passes, 292 height) + dc.b $e,101,$a3,$da,$e,48,$df,$de,$a,41,$58,$de,$a,41,$8c,$22,$a,40,$be,$26,$a,21,$25,$9a,0,0 + +; 20 + dc.w 18736,1 + dc.w 5,191,179,193,211,113,319 + dc.w 10,196,179,232,206,154,319 + ; Darkfill (6 passes, 284 height) + dc.b $e,131,$df,$da,$e,44,$3c,$16,$a,32,$3d,$5e,$a,32,$65,$62,$a,32,$8d,$66,$a,13,$15,$5a,0,0 + ; Brightfill (6 passes, 292 height) + dc.b $e,107,$ad,$da,$a,41,$5b,$5e,$a,41,$c0,$a6,$e,40,$df,$de,$a,40,$8d,$62,$a,23,$28,$1a,0,0 + +; 21 + dc.w 17677,1 + dc.w 6,191,179,192,211,114,319 + dc.w 11,196,179,231,206,158,319 + ; Darkfill (6 passes, 283 height) + dc.b $e,87,$73,$16,$e,87,$df,$da,$a,32,$3e,$9e,$a,32,$66,$a2,$a,32,$8e,$a6,$a,13,$16,$9a,0,0 + ; Brightfill (6 passes, 294 height) + dc.b $e,109,$b1,$9a,$a,42,$5d,$de,$a,42,$92,$62,$a,41,$c5,$a6,$e,37,$df,$de,$a,23,$29,$5a,0,0 + +; 22 + dc.w 18698,1 + dc.w 6,190,179,189,210,115,319 + dc.w 11,195,179,229,205,160,319 + ; Darkfill (5 passes, 284 height) + dc.b $e,174,$df,$d6,$a,32,$3f,$de,$a,32,$67,$e2,$a,32,$8f,$e6,$a,14,$17,$da,0,0 + ; Brightfill (6 passes, 294 height) + dc.b $e,116,$bc,$da,$a,42,$60,$5e,$a,42,$c8,$26,$a,41,$93,$a2,$e,28,$df,$de,$a,25,$2b,$da,0,0 + +; 23 + dc.w 18693,1 + dc.w 6,190,179,188,210,115,319 + dc.w 11,195,179,227,205,162,319 + ; Darkfill (5 passes, 284 height) + dc.b $e,174,$df,$d6,$a,32,$3f,$de,$a,32,$67,$e2,$a,32,$8f,$e6,$a,14,$17,$da,0,0 + ; Brightfill (6 passes, 296 height) + dc.b $e,125,$c8,$1a,$a,43,$96,$22,$a,42,$60,$5e,$a,42,$ca,$a6,$a,25,$2b,$da,$e,19,$df,$de,0,0 + +; 24 + dc.w 18584,1 + dc.w 6,189,179,186,209,116,319 + dc.w 11,194,179,226,204,166,319 + ; Darkfill (5 passes, 285 height) + dc.b $e,174,$df,$d6,$a,32,$41,$1e,$a,32,$69,$22,$a,32,$91,$26,$a,15,$19,$1a,0,0 + ; Brightfill (6 passes, 298 height) + dc.b $e,128,$ce,$5a,$a,43,$64,$1e,$a,43,$99,$e2,$a,43,$cf,$a6,$a,27,$2e,$5a,$e,14,$df,$de,0,0 + +; 25 + dc.w 18679,1 + dc.w 7,189,179,184,209,117,319 + dc.w 12,194,179,224,204,169,319 + ; Darkfill (5 passes, 284 height) + dc.b $e,173,$df,$d6,$a,32,$42,$5e,$a,32,$6a,$62,$a,32,$92,$66,$a,15,$1a,$5a,0,0 + ; Brightfill (6 passes, 299 height) + dc.b $e,138,$dc,$1a,$a,44,$66,$9e,$a,44,$d3,$66,$a,43,$9c,$62,$a,27,$2f,$9a,$e,3,$df,$de,0,0 + +; 26 + dc.w 18779,1 + dc.w 7,188,179,182,208,118,319 + dc.w 12,193,179,221,203,173,319 + ; Darkfill (5 passes, 285 height) + dc.b $e,173,$df,$d6,$a,32,$43,$9e,$a,32,$6b,$a2,$a,32,$93,$a6,$a,16,$1b,$9a,0,0 + ; Brightfill (5 passes, 301 height) + dc.b $e,139,$df,$da,$a,45,$a1,$62,$a,44,$69,$1e,$a,44,$d8,$66,$a,29,$32,$1a,0,0 + +; 27 + dc.w 18764,1 + dc.w 7,187,179,180,207,119,319 + dc.w 12,192,179,220,202,177,319 + ; Darkfill (5 passes, 286 height) + dc.b $e,173,$df,$d6,$a,32,$44,$de,$a,32,$6c,$e2,$a,32,$94,$e6,$a,17,$1c,$da,0,0 + ; Brightfill (5 passes, 303 height) + dc.b $e,137,$df,$da,$a,45,$6c,$de,$a,45,$a5,$22,$a,45,$dd,$66,$a,31,$34,$9a,0,0 + +; 28 + dc.w 18759,1 + dc.w 7,187,179,179,207,119,319 + dc.w 12,192,179,218,202,179,319 + ; Darkfill (5 passes, 286 height) + dc.b $e,173,$df,$d6,$a,32,$44,$de,$a,32,$6c,$e2,$a,32,$94,$e6,$a,17,$1c,$da,0,0 + ; Brightfill (5 passes, 305 height) + dc.b $e,137,$df,$da,$a,46,$6e,$1e,$a,46,$a7,$a2,$a,45,$df,$e6,$a,31,$34,$9a,0,0 + +; 29 + dc.w 18768,1 + dc.w 8,186,179,176,206,121,319 + dc.w 13,191,179,216,201,179,316 + ; Darkfill (5 passes, 286 height) + dc.b $e,172,$df,$d6,$a,32,$47,$5e,$a,32,$6f,$62,$a,32,$97,$66,$a,18,$1f,$5a,0,0 + ; Brightfill (6 passes, 305 height) + dc.b $e,134,$df,$da,$a,46,$71,$de,$a,46,$ab,$62,$a,42,$df,$e6,$a,33,$38,$5a,$e,4,$14,$16,0,0 + +; 30 + dc.w 18981,1 + dc.w 8,185,179,174,205,122,319 + dc.w 13,190,179,213,200,179,312 + ; Darkfill (5 passes, 287 height) + dc.b $e,172,$df,$d6,$a,32,$48,$9e,$a,32,$70,$a2,$a,32,$98,$a6,$a,19,$20,$9a,0,0 + ; Brightfill (6 passes, 310 height) + dc.b $e,132,$df,$da,$a,48,$76,$de,$a,47,$b1,$a2,$a,37,$df,$e6,$a,35,$3a,$da,$e,11,$1c,$d6,0,0 + +; 31 + dc.w 19134,1 + dc.w 8,184,179,172,204,125,319 + dc.w 13,189,179,211,199,179,310 + ; Darkfill (5 passes, 290 height) + dc.b $e,172,$df,$d6,$a,33,$4b,$1e,$a,33,$9c,$66,$a,32,$73,$22,$a,20,$21,$da,0,0 + ; Brightfill (6 passes, 316 height) + dc.b $e,130,$df,$da,$a,48,$79,$5e,$a,48,$b5,$62,$a,37,$3d,$5a,$a,34,$df,$e6,$e,19,$26,$d6,0,0 + +; 32 + dc.w 19136,1 + dc.w 9,184,179,170,204,128,319 + dc.w 14,189,179,209,199,179,307 + ; Darkfill (5 passes, 291 height) + dc.b $e,171,$df,$d6,$a,33,$4d,$9e,$a,33,$76,$e2,$a,33,$a0,$26,$a,21,$24,$5a,0,0 + ; Brightfill (6 passes, 315 height) + dc.b $e,128,$df,$da,$a,49,$7d,$1e,$a,49,$ba,$62,$a,38,$3f,$da,$a,30,$df,$e6,$e,21,$2a,$96,0,0 + +; 33 + dc.w 19387,1 + dc.w 9,183,179,168,203,131,319 + dc.w 14,188,179,207,198,179,304 + ; Darkfill (5 passes, 294 height) + dc.b $e,171,$df,$d6,$a,34,$50,$1e,$a,34,$a3,$e6,$a,33,$79,$62,$a,22,$25,$9a,0,0 + ; Brightfill (6 passes, 323 height) + dc.b $e,126,$df,$da,$a,50,$80,$de,$a,50,$bf,$62,$a,40,$42,$5a,$e,31,$37,$16,$a,26,$df,$e6,0,0 + +; 34 + dc.w 19608,1 + dc.w 9,182,179,165,202,134,319 + dc.w 14,187,179,204,197,179,301 + ; Darkfill (5 passes, 297 height) + dc.b $e,171,$df,$d6,$a,35,$52,$9e,$a,34,$7d,$22,$a,34,$a7,$a6,$a,23,$26,$da,0,0 + ; Brightfill (6 passes, 332 height) + dc.b $e,122,$df,$da,$a,51,$c4,$62,$a,50,$84,$9e,$e,44,$47,$56,$a,43,$46,$1a,$a,22,$df,$e6,0,0 + +; 35 + dc.w 19721,1 + dc.w 9,181,179,163,201,138,319 + dc.w 14,186,179,202,196,179,297 + ; Darkfill (5 passes, 301 height) + dc.b $e,171,$df,$d6,$a,35,$55,$1e,$a,35,$80,$e2,$a,35,$ac,$a6,$a,25,$29,$5a,0,0 + ; Brightfill (6 passes, 332 height) + dc.b $e,109,$df,$da,$e,57,$57,$96,$a,53,$8a,$de,$a,52,$cb,$e2,$a,45,$48,$9a,$a,16,$df,$e6,0,0 + +; 36 + dc.w 19712,1 + dc.w 10,180,179,161,200,142,319 + dc.w 15,185,179,200,195,179,294 + ; Darkfill (5 passes, 303 height) + dc.b $e,170,$df,$d6,$a,36,$85,$e2,$a,35,$58,$de,$a,35,$b1,$a6,$a,27,$2d,$1a,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $e,93,$df,$da,$e,72,$6b,$96,$a,53,$8f,$de,$a,53,$d2,$22,$a,48,$4d,$9a,$a,11,$df,$e6,0,0 + +; 37 + dc.w 19800,1 + dc.w 10,179,179,158,199,146,319 + dc.w 15,184,179,197,194,179,291 + ; Darkfill (6 passes, 307 height) + dc.b $e,157,$cf,$96,$a,37,$5c,$9e,$a,36,$89,$a2,$a,36,$b6,$a6,$a,28,$2e,$5a,$e,13,$df,$d2,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $e,95,$88,$56,$e,70,$df,$da,$a,55,$d8,$62,$a,54,$93,$9e,$a,50,$50,$1a,$a,6,$df,$e6,0,0 + +; 38 + dc.w 18886,0 + dc.w 12,183,179,192,193,179,292 + dc.w 15,185,179,227,191,179,249 + ; Darkfill (6 passes, 336 height) + dc.b $e,158,$d3,$56,$a,54,$92,$5e,$a,54,$d5,$e2,$a,52,$4e,$da,$e,10,$df,$da,$a,8,$df,$e6,0,0 + ; Brightfill (5 passes, 248 height) + dc.b $a,90,$84,$9a,$a,73,$df,$de,$e,59,$ce,$5a,$e,24,$32,$16,$a,2,$14,$16,0,0 + +; 39 + dc.w 10776,0 + dc.w 16,187,179,225,187,179,246 + dc.w 16,187,17,193,187,17,183 + ; Darkfill (5 passes, 227 height) + dc.b $a,88,$91,$1a,$a,63,$df,$de,$e,56,$d7,$1a,$a,13,$23,$16,$e,7,$2b,$d6,0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 40 + dc.w 5120,0 + dc.w 16,186,18,197,186,18,177 + dc.w 16,186,18,192,186,18,182 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 41 + dc.w 2270,0 + dc.w 16,185,18,196,185,18,176 + dc.w 16,185,18,191,185,18,181 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 42 + dc.w 0,0 + dc.w 16,184,18,195,184,18,175 + dc.w 16,184,18,190,184,18,180 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 43 + dc.w 21154,1 + dc.w 12,173,179,142,193,173,319 + dc.w 17,178,179,181,188,179,272 + ; Darkfill (6 passes, 330 height) + dc.b $e,95,$df,$d2,$e,73,$69,$16,$a,41,$71,$de,$a,41,$a5,$22,$a,41,$d8,$66,$a,39,$3e,$9a,0,0 + ; Brightfill (5 passes, 319 height) + dc.b $e,156,$df,$d6,$a,62,$6a,$5a,$a,62,$b7,$de,$a,32,$df,$e2,$a,7,$1c,$d6,0,0 + +; 44 + dc.w 21182,1 + dc.w 12,172,179,139,192,177,319 + dc.w 17,177,179,179,187,179,268 + ; Darkfill (6 passes, 334 height) + dc.b $e,104,$df,$d2,$e,64,$5d,$d6,$a,42,$75,$9e,$a,42,$aa,$22,$a,41,$41,$1a,$a,41,$dd,$66,0,0 + ; Brightfill (5 passes, 317 height) + dc.b $e,154,$df,$d6,$a,64,$6f,$5a,$a,64,$bf,$5e,$a,26,$df,$e2,$a,9,$1f,$56,0,0 + +; 45 + dc.w 19927,1 + dc.w 12,171,179,137,191,179,317 + dc.w 17,176,179,174,186,179,265 + ; Darkfill (7 passes, 335 height) + dc.b $e,111,$df,$d2,$e,56,$55,$16,$a,43,$44,$da,$a,42,$79,$5e,$a,42,$ad,$e2,$a,40,$df,$e6,$a,1,$0f,$16,0,0 + ; Brightfill (5 passes, 314 height) + dc.b $e,151,$df,$d6,$a,66,$c6,$de,$a,65,$74,$5a,$a,20,$df,$e2,$a,12,$23,$16,0,0 + +; 46 + dc.w 20001,1 + dc.w 12,170,179,134,190,179,312 + dc.w 17,175,179,172,185,179,261 + ; Darkfill (7 passes, 333 height) + dc.b $e,119,$df,$d2,$e,46,$4b,$16,$a,44,$7e,$5e,$a,44,$b5,$62,$a,43,$47,$5a,$a,34,$df,$e6,$a,3,$11,$96,0,0 + ; Brightfill (5 passes, 312 height) + dc.b $e,149,$df,$d6,$a,69,$7b,$da,$a,68,$d0,$de,$a,14,$25,$96,$a,12,$df,$e2,0,0 + +; 47 + dc.w 19853,1 + dc.w 13,169,179,131,189,179,308 + dc.w 18,174,179,169,184,179,259 + ; Darkfill (7 passes, 330 height) + dc.b $e,125,$df,$d2,$a,45,$4c,$5a,$a,45,$bb,$a2,$a,44,$83,$5e,$e,38,$43,$96,$a,29,$df,$e6,$a,4,$14,$16,0,0 + ; Brightfill (5 passes, 307 height) + dc.b $e,145,$df,$d6,$a,69,$d5,$de,$a,68,$7f,$9a,$a,17,$2a,$96,$a,8,$df,$e2,0,0 + +; 48 + dc.w 19796,1 + dc.w 13,168,179,128,188,179,304 + dc.w 18,173,179,166,183,179,255 + ; Darkfill (7 passes, 328 height) + dc.b $e,131,$df,$d2,$a,46,$88,$5e,$a,46,$c1,$e2,$a,45,$4e,$da,$e,30,$3c,$16,$a,24,$df,$e6,$a,6,$16,$96,0,0 + ; Brightfill (4 passes, 304 height) + dc.b $e,142,$df,$d6,$a,71,$87,$1a,$a,71,$df,$de,$a,20,$2e,$56,0,0 + +; 49 + dc.w 19801,1 + dc.w 13,167,179,125,187,179,301 + dc.w 18,172,179,163,182,179,252 + ; Darkfill (8 passes, 327 height) + dc.b $e,127,$d3,$52,$a,47,$52,$9a,$a,47,$c6,$e2,$a,46,$8c,$1e,$e,23,$34,$96,$a,20,$df,$e6,$e,10,$df,$ce,$a,7,$17,$d6,0,0 + ; Brightfill (4 passes, 302 height) + dc.b $e,140,$df,$d6,$a,74,$8d,$5a,$a,66,$df,$de,$a,22,$30,$d6,0,0 + +; 50 + dc.w 19756,1 + dc.w 13,166,179,122,186,179,297 + dc.w 18,171,179,161,181,179,249 + ; Darkfill (8 passes, 325 height) + dc.b $e,121,$c5,$92,$a,48,$56,$5a,$a,48,$cd,$22,$a,47,$91,$1e,$e,21,$df,$ce,$e,16,$2e,$56,$a,15,$df,$e6,$a,9,$1a,$56,0,0 + ; Brightfill (4 passes, 299 height) + dc.b $e,137,$df,$d6,$a,76,$93,$9a,$a,61,$df,$de,$a,25,$34,$96,0,0 + +; 51 + dc.w 19898,1 + dc.w 13,165,179,118,185,179,293 + dc.w 18,170,179,157,180,179,245 + ; Darkfill (8 passes, 324 height) + dc.b $e,113,$b5,$52,$a,50,$5a,$1a,$a,49,$97,$5e,$a,49,$d4,$a2,$e,34,$df,$ce,$a,10,$1b,$96,$e,10,$28,$16,$a,9,$df,$e6,0,0 + ; Brightfill (5 passes, 295 height) + dc.b $e,102,$b9,$16,$a,79,$9c,$5a,$a,54,$df,$de,$e,31,$df,$d2,$a,29,$39,$96,0,0 + +; 52 + dc.w 19919,1 + dc.w 13,164,179,115,184,179,289 + dc.w 18,169,179,155,179,179,242 + ; Darkfill (8 passes, 322 height) + dc.b $e,108,$aa,$12,$a,51,$5d,$da,$a,51,$9d,$9e,$a,50,$dc,$22,$e,43,$df,$ce,$a,12,$1e,$16,$e,4,$23,$16,$a,3,$df,$e6,0,0 + ; Brightfill (5 passes, 292 height) + dc.b $a,82,$a3,$da,$e,78,$9e,$d6,$e,52,$df,$d2,$a,48,$df,$de,$a,32,$3d,$56,0,0 + +; 53 + dc.w 19409,1 + dc.w 14,163,179,113,183,179,285 + dc.w 19,168,179,152,178,179,238 + ; Darkfill (6 passes, 320 height) + dc.b $e,106,$a3,$d2,$a,52,$62,$da,$a,52,$a3,$de,$e,48,$df,$ce,$a,48,$df,$e2,$a,14,$21,$d6,0,0 + ; Brightfill (5 passes, 286 height) + dc.b $a,86,$af,$1a,$e,76,$df,$d2,$e,49,$80,$d6,$a,39,$df,$de,$a,36,$43,$96,0,0 + +; 54 + dc.w 19193,1 + dc.w 14,161,179,109,181,179,281 + dc.w 19,166,179,148,176,179,235 + ; Darkfill (6 passes, 327 height) + dc.b $e,102,$96,$12,$e,59,$df,$ce,$a,53,$69,$1a,$a,52,$aa,$1e,$a,43,$df,$e2,$a,18,$26,$d6,0,0 + ; Brightfill (5 passes, 279 height) + dc.b $e,103,$df,$d2,$a,86,$b7,$da,$a,43,$4c,$56,$a,32,$df,$de,$e,15,$5f,$16,0,0 + +; 55 + dc.w 18976,1 + dc.w 14,160,179,106,180,179,277 + dc.w 19,165,179,145,175,179,231 + ; Darkfill (6 passes, 330 height) + dc.b $e,98,$8d,$52,$e,66,$df,$ce,$a,55,$b1,$9e,$a,54,$6c,$da,$a,37,$df,$e2,$a,20,$29,$56,0,0 + ; Brightfill (4 passes, 278 height) + dc.b $e,117,$df,$d2,$a,91,$c4,$5a,$a,48,$52,$96,$a,22,$df,$de,0,0 + +; 56 + dc.w 18977,1 + dc.w 14,159,179,103,179,179,273 + dc.w 19,164,179,142,174,179,228 + ; Darkfill (6 passes, 332 height) + dc.b $e,93,$84,$92,$e,73,$df,$ce,$a,57,$73,$1a,$a,56,$b9,$1e,$a,31,$df,$e2,$a,22,$2b,$d6,0,0 + ; Brightfill (4 passes, 289 height) + dc.b $e,128,$df,$d2,$a,95,$ce,$5a,$a,52,$57,$96,$a,14,$df,$de,0,0 + +; 57 + dc.w 19197,1 + dc.w 14,158,179,99,178,179,269 + dc.w 19,163,179,139,173,179,225 + ; Darkfill (6 passes, 332 height) + dc.b $e,86,$7b,$d2,$e,80,$df,$ce,$a,58,$78,$1a,$a,58,$c0,$9e,$a,25,$2f,$96,$a,25,$df,$e2,0,0 + ; Brightfill (4 passes, 298 height) + dc.b $e,137,$df,$d2,$a,99,$d9,$9a,$a,57,$5d,$d6,$a,5,$df,$de,0,0 + +; 58 + dc.w 19406,1 + dc.w 14,157,179,96,177,179,266 + dc.w 19,162,179,136,172,179,222 + ; Darkfill (6 passes, 332 height) + dc.b $e,86,$df,$ce,$e,80,$74,$52,$a,60,$7d,$1a,$a,59,$c6,$de,$a,27,$32,$16,$a,20,$df,$e2,0,0 + ; Brightfill (3 passes, 306 height) + dc.b $e,145,$df,$d2,$a,98,$df,$da,$a,63,$65,$56,0,0 + +; 59 + dc.w 19650,1 + dc.w 14,156,179,92,176,179,262 + dc.w 19,161,179,133,171,179,219 + ; Darkfill (7 passes, 332 height) + dc.b $e,82,$d3,$4e,$e,74,$6c,$d2,$a,62,$83,$5a,$a,61,$cf,$9e,$a,30,$35,$d6,$a,13,$df,$e2,$e,10,$df,$ca,0,0 + ; Brightfill (3 passes, 313 height) + dc.b $e,152,$df,$d2,$a,92,$df,$da,$a,69,$6c,$d6,0,0 + +; 60 + dc.w 20024,1 + dc.w 14,154,179,89,174,179,258 + dc.w 19,159,179,129,169,179,215 + ; Darkfill (7 passes, 332 height) + dc.b $e,81,$ca,$8e,$e,68,$65,$52,$a,63,$8a,$da,$a,63,$d9,$9e,$a,35,$3c,$16,$e,17,$df,$ca,$a,5,$df,$e2,0,0 + ; Brightfill (3 passes, 322 height) + dc.b $e,161,$df,$d2,$a,82,$df,$da,$a,79,$79,$56,0,0 + +; 61 + dc.w 20119,1 + dc.w 14,153,179,86,173,179,254 + dc.w 19,158,179,126,168,179,212 + ; Darkfill (6 passes, 332 height) + dc.b $e,79,$c1,$ce,$a,65,$91,$1a,$e,63,$5f,$12,$a,63,$df,$de,$a,38,$3f,$d6,$e,24,$df,$ca,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $e,153,$d5,$d2,$a,86,$82,$16,$a,75,$df,$da,$e,8,$df,$ce,0,0 + +; 62 + dc.w 20224,1 + dc.w 14,152,179,82,172,179,251 + dc.w 19,157,179,123,167,179,208 + ; Darkfill (6 passes, 332 height) + dc.b $e,76,$b7,$ce,$a,67,$97,$5a,$e,58,$58,$d2,$a,58,$df,$de,$a,41,$43,$96,$e,32,$df,$ca,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $e,139,$c4,$52,$a,96,$8e,$96,$a,65,$df,$da,$e,22,$df,$ce,0,0 + +; 63 + dc.w 20237,1 + dc.w 14,151,179,78,171,179,247 + dc.w 19,156,179,120,166,179,205 + ; Darkfill (6 passes, 332 height) + dc.b $e,72,$ad,$ce,$a,69,$9e,$da,$e,54,$53,$d2,$a,52,$df,$de,$a,45,$48,$96,$e,40,$df,$ca,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $e,127,$b5,$52,$a,105,$99,$d6,$a,56,$df,$da,$e,34,$df,$ce,0,0 + +; 64 + dc.w 20111,1 + dc.w 15,150,179,75,170,179,244 + dc.w 20,155,179,117,165,179,202 + ; Darkfill (6 passes, 330 height) + dc.b $a,71,$a6,$5a,$e,70,$a7,$8e,$e,50,$50,$12,$a,48,$4d,$96,$a,46,$df,$de,$e,45,$df,$ca,0,0 + ; Brightfill (4 passes, 320 height) + dc.b $e,116,$a8,$d2,$a,114,$a6,$56,$a,46,$df,$da,$e,44,$df,$ce,0,0 + +; 65 + dc.w 20240,1 + dc.w 14,148,179,71,168,179,240 + dc.w 19,153,179,113,163,179,199 + ; Darkfill (6 passes, 332 height) + dc.b $a,74,$b0,$5a,$e,69,$9d,$8e,$a,54,$53,$d6,$e,53,$df,$ca,$e,44,$47,$52,$a,38,$df,$de,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $a,127,$b5,$56,$e,102,$96,$12,$e,59,$df,$ce,$a,34,$df,$da,0,0 + +; 66 + dc.w 20225,1 + dc.w 14,147,179,68,167,179,236 + dc.w 19,152,179,110,162,179,196 + ; Darkfill (6 passes, 332 height) + dc.b $a,77,$ba,$5a,$e,67,$97,$4e,$a,59,$5a,$16,$e,58,$df,$ca,$e,41,$43,$92,$a,30,$df,$de,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $a,139,$c4,$56,$e,94,$8c,$12,$e,67,$df,$ce,$a,22,$df,$da,0,0 + +; 67 + dc.w 20215,1 + dc.w 14,146,179,64,166,179,233 + dc.w 19,151,179,107,161,179,192 + ; Darkfill (6 passes, 332 height) + dc.b $a,79,$c1,$da,$e,64,$df,$ca,$e,64,$8f,$ce,$a,63,$5f,$16,$e,38,$3f,$d2,$a,24,$df,$de,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $a,158,$dc,$16,$e,86,$82,$12,$e,75,$df,$ce,$a,3,$df,$da,0,0 + +; 68 + dc.w 20187,1 + dc.w 14,145,179,60,165,179,230 + dc.w 19,150,179,104,160,179,190 + ; Darkfill (7 passes, 332 height) + dc.b $a,81,$ca,$9a,$a,68,$65,$56,$e,63,$89,$8e,$e,62,$d7,$0a,$e,34,$3a,$d2,$a,17,$df,$de,$e,7,$df,$c6,0,0 + ; Brightfill (3 passes, 322 height) + dc.b $a,161,$df,$d6,$e,82,$df,$ce,$e,79,$79,$52,0,0 + +; 69 + dc.w 19917,1 + dc.w 14,143,179,56,163,179,226 + dc.w 19,148,179,100,158,179,186 + ; Darkfill (7 passes, 332 height) + dc.b $a,84,$d7,$1a,$a,75,$6e,$16,$e,61,$82,$0e,$e,60,$cd,$0a,$e,30,$35,$d2,$e,15,$df,$c6,$a,7,$df,$de,0,0 + ; Brightfill (4 passes, 313 height) + dc.b $a,152,$df,$d6,$e,92,$df,$ce,$e,60,$6c,$d2,$a,9,$21,$d2,0,0 + +; 70 + dc.w 19631,1 + dc.w 14,142,179,53,162,179,222 + dc.w 19,147,179,97,157,179,183 + ; Darkfill (6 passes, 332 height) + dc.b $a,84,$df,$da,$a,82,$76,$d6,$e,60,$7d,$0e,$e,59,$c6,$ca,$e,27,$32,$12,$e,20,$df,$c6,0,0 + ; Brightfill (4 passes, 306 height) + dc.b $a,145,$df,$d6,$e,98,$df,$ce,$e,47,$65,$52,$a,16,$2a,$92,0,0 + +; 71 + dc.w 19276,1 + dc.w 14,141,179,49,161,179,219 + dc.w 19,146,179,94,156,179,180 + ; Darkfill (6 passes, 332 height) + dc.b $a,87,$7d,$16,$a,79,$df,$da,$e,57,$be,$0a,$e,57,$76,$ce,$e,27,$df,$c6,$e,25,$2f,$92,0,0 + ; Brightfill (5 passes, 298 height) + dc.b $a,137,$df,$d6,$e,99,$d9,$8e,$e,33,$5d,$d2,$a,24,$34,$92,$e,5,$df,$ca,0,0 + +; 72 + dc.w 16578,0 + dc.w 16,145,179,87,155,179,179 + dc.w 19,147,179,124,153,179,144 + ; Darkfill (5 passes, 297 height) + dc.b $a,133,$df,$d6,$e,90,$c1,$ce,$a,31,$39,$92,$e,24,$df,$ca,$e,19,$51,$52,0,0 + ; Brightfill (2 passes, 186 height) + dc.b $a,161,$df,$d2,$e,25,$df,$ce,0,0 + +; 73 + dc.w 10212,0 + dc.w 19,149,179,121,149,179,140 + dc.w 19,149,21,154,149,21,144 + ; Darkfill (2 passes, 199 height) + dc.b $a,161,$df,$d2,$e,38,$df,$ce,0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 74 + dc.w 4350,0 + dc.w 19,148,21,157,148,21,137 + dc.w 19,148,21,152,148,21,142 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 75 + dc.w 1990,0 + dc.w 19,146,21,156,146,21,136 + dc.w 19,146,21,151,146,21,141 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 76 + dc.w 0,0 + dc.w 18,145,20,155,145,20,135 + dc.w 18,145,20,150,145,20,140 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 77 + dc.w 20323,1 + dc.w 13,134,179,26,154,179,200 + dc.w 18,139,179,73,149,179,162 + ; Darkfill (7 passes, 324 height) + dc.b $a,116,$b9,$16,$e,50,$5a,$0e,$e,49,$d4,$86,$e,49,$97,$4a,$a,31,$df,$da,$a,20,$28,$12,$e,9,$df,$c2,0,0 + ; Brightfill (4 passes, 295 height) + dc.b $a,131,$b9,$12,$e,78,$9b,$0e,$e,55,$df,$ca,$a,31,$df,$d6,0,0 + +; 78 + dc.w 20403,1 + dc.w 13,133,179,22,153,179,197 + dc.w 18,138,179,70,148,179,158 + ; Darkfill (7 passes, 325 height) + dc.b $a,121,$c5,$96,$e,48,$cd,$06,$e,48,$56,$4e,$e,47,$91,$0a,$a,25,$2e,$52,$a,21,$df,$da,$e,15,$df,$c2,0,0 + ; Brightfill (3 passes, 299 height) + dc.b $a,162,$df,$d2,$e,76,$93,$8e,$e,61,$df,$ca,0,0 + +; 79 + dc.w 20036,1 + dc.w 13,132,179,18,152,179,194 + dc.w 18,137,179,67,147,179,156 + ; Darkfill (7 passes, 327 height) + dc.b $a,127,$d3,$56,$e,47,$c6,$c6,$e,47,$52,$8e,$e,46,$8c,$0a,$a,30,$34,$92,$e,20,$df,$c2,$a,10,$df,$da,0,0 + ; Brightfill (3 passes, 302 height) + dc.b $a,162,$df,$d2,$e,74,$8d,$4e,$e,66,$df,$ca,0,0 + +; 80 + dc.w 19959,1 + dc.w 13,131,179,15,151,179,191 + dc.w 18,136,179,63,146,179,153 + ; Darkfill (6 passes, 328 height) + dc.b $a,131,$df,$d6,$e,46,$c1,$c6,$e,46,$88,$4a,$e,45,$4e,$ce,$a,36,$3c,$12,$e,24,$df,$c2,0,0 + ; Brightfill (4 passes, 305 height) + dc.b $a,162,$df,$d2,$e,71,$85,$ce,$e,70,$dd,$4a,$e,2,$df,$c6,0,0 + +; 81 + dc.w 19968,1 + dc.w 13,130,179,11,150,179,188 + dc.w 18,135,179,60,145,179,150 + ; Darkfill (6 passes, 330 height) + dc.b $a,125,$df,$d6,$e,45,$bb,$86,$e,45,$4c,$4e,$e,44,$83,$4a,$a,42,$43,$92,$e,29,$df,$c2,0,0 + ; Brightfill (4 passes, 307 height) + dc.b $a,162,$df,$d2,$e,69,$d5,$ca,$e,68,$7f,$8e,$e,8,$df,$c6,0,0 + +; 82 + dc.w 20075,1 + dc.w 12,129,179,7,149,179,185 + dc.w 17,134,179,57,144,179,147 + ; Darkfill (6 passes, 333 height) + dc.b $a,119,$df,$d6,$a,49,$4b,$12,$e,44,$b5,$46,$e,44,$7e,$4a,$e,43,$47,$4e,$e,34,$df,$c2,0,0 + ; Brightfill (4 passes, 312 height) + dc.b $a,163,$df,$d2,$e,68,$ce,$4a,$e,67,$79,$4e,$e,14,$df,$c6,0,0 + +; 83 + dc.w 20118,1 + dc.w 12,128,179,2,148,179,182 + dc.w 17,133,179,54,143,179,145 + ; Darkfill (6 passes, 335 height) + dc.b $a,111,$df,$d6,$a,57,$55,$12,$e,43,$44,$ce,$e,42,$ad,$c6,$e,42,$79,$4a,$e,40,$df,$c2,0,0 + ; Brightfill (4 passes, 314 height) + dc.b $a,163,$df,$d2,$e,66,$c6,$ca,$e,65,$74,$4e,$e,20,$df,$c6,0,0 + +; 84 + dc.w 20098,1 + dc.w 12,127,177,0,147,179,179 + dc.w 17,132,179,50,142,179,140 + ; Darkfill (6 passes, 334 height) + dc.b $a,102,$df,$d6,$a,66,$60,$52,$e,42,$aa,$06,$e,42,$75,$8a,$e,41,$dd,$42,$e,41,$41,$0e,0,0 + ; Brightfill (4 passes, 317 height) + dc.b $a,163,$df,$d2,$e,64,$6f,$4e,$e,63,$be,$0a,$e,27,$df,$c6,0,0 + +; 85 + dc.w 19948,1 + dc.w 12,126,172,0,146,179,177 + dc.w 17,131,179,47,141,179,138 + ; Darkfill (6 passes, 329 height) + dc.b $a,95,$df,$d6,$a,73,$69,$12,$e,41,$d7,$02,$e,41,$71,$ca,$e,40,$a3,$c6,$e,39,$3e,$8e,0,0 + ; Brightfill (4 passes, 319 height) + dc.b $a,163,$df,$d2,$e,62,$b7,$ca,$e,62,$6a,$4e,$e,32,$df,$c6,0,0 + +; 86 + dc.w 19895,1 + dc.w 11,125,167,0,145,179,174 + dc.w 16,130,179,44,140,179,135 + ; Darkfill (6 passes, 326 height) + dc.b $a,85,$df,$d6,$a,84,$75,$92,$e,40,$d0,$c2,$e,40,$9e,$c6,$e,40,$6c,$ca,$e,37,$3a,$ce,0,0 + ; Brightfill (4 passes, 323 height) + dc.b $a,164,$df,$d2,$e,61,$b1,$8a,$e,61,$65,$4e,$e,37,$df,$c6,0,0 + +; 87 + dc.w 19695,1 + dc.w 11,124,162,0,144,179,171 + dc.w 16,129,179,41,139,179,133 + ; Darkfill (6 passes, 321 height) + dc.b $a,97,$85,$d2,$a,72,$df,$d6,$e,39,$ca,$82,$e,39,$99,$c6,$e,39,$69,$0a,$e,35,$38,$4e,0,0 + ; Brightfill (4 passes, 325 height) + dc.b $a,164,$df,$d2,$e,60,$61,$8e,$e,59,$ab,$4a,$e,42,$df,$c6,0,0 + +; 88 + dc.w 19477,1 + dc.w 11,123,158,0,143,179,169 + dc.w 16,128,179,38,138,179,130 + ; Darkfill (6 passes, 317 height) + dc.b $a,107,$92,$52,$a,62,$df,$d6,$e,39,$66,$8a,$e,38,$c5,$82,$e,38,$96,$06,$e,33,$35,$ce,0,0 + ; Brightfill (4 passes, 327 height) + dc.b $a,164,$df,$d2,$e,58,$a5,$0a,$e,58,$5c,$8e,$e,47,$df,$c6,0,0 + +; 89 + dc.w 19288,1 + dc.w 11,122,154,0,142,179,166 + dc.w 16,127,179,35,137,179,127 + ; Darkfill (6 passes, 313 height) + dc.b $a,123,$a6,$52,$a,46,$df,$d6,$e,38,$92,$46,$e,37,$c0,$82,$e,37,$62,$ca,$e,32,$34,$8e,0,0 + ; Brightfill (5 passes, 328 height) + dc.b $a,155,$d4,$92,$e,57,$a0,$0a,$e,56,$58,$ce,$e,51,$df,$c6,$a,9,$df,$ce,0,0 + +; 90 + dc.w 19523,1 + dc.w 10,121,150,0,141,179,163 + dc.w 15,126,179,31,136,179,125 + ; Darkfill (6 passes, 311 height) + dc.b $a,143,$be,$12,$e,37,$bb,$82,$e,37,$8d,$46,$e,37,$5f,$0a,$e,30,$30,$ce,$a,27,$df,$d6,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $a,127,$b0,$52,$e,56,$de,$86,$e,55,$98,$8a,$e,53,$53,$ce,$a,38,$df,$ce,$e,1,$df,$c2,0,0 + +; 91 + dc.w 19627,1 + dc.w 10,120,146,0,140,179,161 + dc.w 15,125,179,28,135,179,122 + ; Darkfill (6 passes, 307 height) + dc.b $a,157,$cf,$92,$e,37,$5c,$8a,$e,36,$b6,$82,$e,36,$89,$86,$e,28,$2e,$4e,$a,13,$df,$d6,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $a,95,$88,$52,$a,70,$df,$ce,$e,55,$d8,$46,$e,54,$93,$8a,$e,50,$50,$0e,$e,6,$df,$c2,0,0 + +; 92 + dc.w 19713,1 + dc.w 10,119,142,0,139,179,158 + dc.w 15,124,179,25,134,179,119 + ; Darkfill (5 passes, 303 height) + dc.b $a,170,$df,$d2,$e,36,$85,$c6,$e,35,$b1,$82,$e,35,$58,$ca,$e,27,$2d,$0e,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $a,93,$df,$ce,$a,72,$6b,$92,$e,53,$d2,$06,$e,53,$8f,$ca,$e,48,$4d,$8e,$e,11,$df,$c2,0,0 + +; 93 + dc.w 19820,1 + dc.w 9,118,138,0,138,179,156 + dc.w 14,123,179,22,133,179,117 + ; Darkfill (5 passes, 301 height) + dc.b $a,171,$df,$d2,$e,35,$ac,$82,$e,35,$80,$c6,$e,35,$55,$0a,$e,25,$29,$4e,0,0 + ; Brightfill (6 passes, 332 height) + dc.b $a,109,$df,$ce,$a,57,$57,$92,$e,53,$8a,$ca,$e,52,$cb,$c6,$e,45,$48,$8e,$e,16,$df,$c2,0,0 + +; 94 + dc.w 19738,1 + dc.w 9,117,134,0,137,179,154 + dc.w 14,122,179,18,132,179,115 + ; Darkfill (5 passes, 297 height) + dc.b $a,171,$df,$d2,$e,35,$52,$8a,$e,34,$a7,$82,$e,34,$7d,$06,$e,23,$26,$ce,0,0 + ; Brightfill (6 passes, 332 height) + dc.b $a,122,$df,$ce,$e,51,$c4,$46,$e,50,$84,$8a,$a,44,$47,$52,$e,43,$46,$0e,$e,22,$df,$c2,0,0 + +; 95 + dc.w 19452,1 + dc.w 9,116,131,0,136,179,151 + dc.w 14,121,179,15,131,179,112 + ; Darkfill (5 passes, 294 height) + dc.b $a,171,$df,$d2,$e,34,$a3,$c2,$e,34,$50,$0a,$e,33,$79,$46,$e,22,$25,$8e,0,0 + ; Brightfill (6 passes, 323 height) + dc.b $a,135,$df,$ce,$e,50,$bf,$46,$e,50,$80,$ca,$e,31,$37,$0e,$a,31,$37,$12,$e,26,$df,$c2,0,0 + +; 96 + dc.w 19153,1 + dc.w 9,115,128,0,135,179,149 + dc.w 14,120,179,12,130,179,110 + ; Darkfill (5 passes, 291 height) + dc.b $a,171,$df,$d2,$e,33,$a0,$02,$e,33,$76,$c6,$e,33,$4d,$8a,$e,21,$24,$4e,0,0 + ; Brightfill (6 passes, 315 height) + dc.b $a,145,$df,$ce,$e,49,$ba,$46,$e,49,$7d,$0a,$e,30,$df,$c2,$e,21,$2a,$8e,$a,21,$2a,$92,0,0 + +; 97 + dc.w 19200,1 + dc.w 8,115,125,0,135,179,147 + dc.w 13,120,179,9,130,179,108 + ; Darkfill (5 passes, 290 height) + dc.b $a,172,$df,$d2,$e,33,$9c,$42,$e,33,$4b,$0a,$e,32,$73,$06,$e,20,$21,$ce,0,0 + ; Brightfill (6 passes, 316 height) + dc.b $a,148,$df,$ce,$e,48,$b5,$46,$e,48,$79,$4a,$e,34,$df,$c2,$e,19,$26,$ce,$a,19,$26,$d2,0,0 + +; 98 + dc.w 18993,1 + dc.w 8,114,122,0,134,179,145 + dc.w 13,119,179,7,129,179,106 + ; Darkfill (5 passes, 287 height) + dc.b $a,172,$df,$d2,$e,32,$98,$82,$e,32,$70,$86,$e,32,$48,$8a,$e,19,$20,$8e,0,0 + ; Brightfill (6 passes, 310 height) + dc.b $a,156,$df,$ce,$e,48,$76,$ca,$e,47,$b1,$86,$e,37,$df,$c2,$e,11,$1c,$ce,$a,11,$1c,$d2,0,0 + +; 99 + dc.w 18845,1 + dc.w 8,113,121,0,133,179,143 + dc.w 13,118,179,3,128,179,104 + ; Darkfill (5 passes, 286 height) + dc.b $a,172,$df,$d2,$e,32,$97,$42,$e,32,$6f,$46,$e,32,$47,$4a,$e,18,$1f,$4e,0,0 + ; Brightfill (6 passes, 305 height) + dc.b $a,163,$df,$ce,$e,46,$ab,$46,$e,46,$71,$ca,$e,42,$df,$c2,$e,4,$14,$0e,$a,4,$14,$12,0,0 + +; 100 + dc.w 18887,1 + dc.w 7,112,119,0,132,179,140 + dc.w 12,117,179,0,127,179,101 + ; Darkfill (5 passes, 286 height) + dc.b $a,173,$df,$d2,$e,32,$94,$c2,$e,32,$6c,$c6,$e,32,$44,$ca,$e,17,$1c,$ce,0,0 + ; Brightfill (4 passes, 305 height) + dc.b $a,168,$df,$ce,$e,46,$a7,$86,$e,46,$6e,$0a,$e,45,$df,$c2,0,0 + +; 101 + dc.w 18745,1 + dc.w 7,112,119,0,132,179,139 + dc.w 12,117,177,0,127,179,99 + ; Darkfill (5 passes, 286 height) + dc.b $a,173,$df,$d2,$e,32,$94,$c2,$e,32,$6c,$c6,$e,32,$44,$ca,$e,17,$1c,$ce,0,0 + ; Brightfill (4 passes, 303 height) + dc.b $a,168,$df,$ce,$e,45,$dd,$42,$e,45,$a5,$06,$e,45,$6c,$ca,0,0 + +; 102 + dc.w 18656,1 + dc.w 7,111,118,0,131,179,137 + dc.w 12,116,173,0,126,179,98 + ; Darkfill (5 passes, 285 height) + dc.b $a,173,$df,$d2,$e,32,$93,$82,$e,32,$6b,$86,$e,32,$43,$8a,$e,16,$1b,$8e,0,0 + ; Brightfill (4 passes, 301 height) + dc.b $a,168,$df,$ce,$e,45,$a1,$46,$e,44,$d8,$42,$e,44,$69,$0a,0,0 + +; 103 + dc.w 18647,1 + dc.w 7,110,117,0,130,179,135 + dc.w 12,115,169,0,125,179,95 + ; Darkfill (5 passes, 284 height) + dc.b $a,173,$df,$d2,$e,32,$92,$42,$e,32,$6a,$46,$e,32,$42,$4a,$e,15,$1a,$4e,0,0 + ; Brightfill (5 passes, 299 height) + dc.b $a,165,$dc,$0e,$e,44,$d3,$42,$e,44,$66,$8a,$e,43,$9c,$46,$a,3,$df,$ca,0,0 + +; 104 + dc.w 18656,1 + dc.w 6,110,116,0,130,179,133 + dc.w 11,115,166,0,125,179,94 + ; Darkfill (5 passes, 285 height) + dc.b $a,174,$df,$d2,$e,32,$91,$02,$e,32,$69,$06,$e,32,$41,$0a,$e,15,$19,$0e,0,0 + ; Brightfill (5 passes, 298 height) + dc.b $a,160,$d4,$8e,$e,43,$cf,$82,$e,43,$99,$c6,$e,43,$64,$0a,$a,9,$df,$ca,0,0 + +; 105 + dc.w 18607,1 + dc.w 6,109,115,0,129,179,131 + dc.w 11,114,162,0,124,179,92 + ; Darkfill (5 passes, 284 height) + dc.b $a,174,$df,$d2,$e,32,$8f,$c2,$e,32,$67,$c6,$e,32,$3f,$ca,$e,14,$17,$ce,0,0 + ; Brightfill (5 passes, 296 height) + dc.b $a,150,$c8,$0e,$e,43,$96,$06,$e,42,$ca,$82,$e,42,$60,$4a,$a,19,$df,$ca,0,0 + +; 106 + dc.w 18466,1 + dc.w 6,109,115,0,129,179,130 + dc.w 11,114,160,0,124,179,91 + ; Darkfill (5 passes, 284 height) + dc.b $a,174,$df,$d2,$e,32,$8f,$c2,$e,32,$67,$c6,$e,32,$3f,$ca,$e,14,$17,$ce,0,0 + ; Brightfill (5 passes, 294 height) + dc.b $a,146,$c3,$0e,$e,42,$c8,$02,$e,42,$60,$4a,$e,41,$93,$86,$a,23,$df,$ca,0,0 + +; 107 + dc.w 18431,1 + dc.w 6,108,114,0,128,179,127 + dc.w 11,113,158,0,123,179,88 + ; Darkfill (6 passes, 283 height) + dc.b $a,87,$df,$ce,$a,87,$73,$12,$e,32,$8e,$82,$e,32,$66,$86,$e,32,$3e,$8a,$e,13,$16,$8e,0,0 + ; Brightfill (5 passes, 294 height) + dc.b $a,132,$b1,$8e,$e,42,$92,$46,$e,42,$5d,$ca,$e,41,$c5,$82,$a,37,$df,$ca,0,0 + +; 108 + dc.w 18342,1 + dc.w 5,108,113,0,128,179,126 + dc.w 10,113,154,0,123,179,87 + ; Darkfill (6 passes, 284 height) + dc.b $a,131,$df,$ce,$a,44,$3c,$12,$e,32,$8d,$42,$e,32,$65,$46,$e,32,$3d,$4a,$e,13,$15,$4e,0,0 + ; Brightfill (5 passes, 292 height) + dc.b $a,130,$ad,$ce,$e,41,$c0,$82,$e,41,$5b,$4a,$e,40,$8d,$46,$a,40,$df,$ca,0,0 + +; 109 + dc.w 17213,1 + dc.w 5,107,112,0,127,179,124 + dc.w 10,112,152,0,122,179,85 + ; Darkfill (4 passes, 271 height) + dc.b $a,175,$df,$ce,$e,32,$8c,$02,$e,32,$64,$06,$e,32,$3c,$0a,0,0 + ; Brightfill (5 passes, 292 height) + dc.b $a,122,$a3,$ce,$a,48,$df,$ca,$e,41,$8c,$06,$e,41,$58,$ca,$e,40,$be,$02,0,0 + +; 110 + dc.w 16664,1 + dc.w 5,107,112,0,127,179,123 + dc.w 10,112,150,0,122,179,84 + ; Darkfill (4 passes, 271 height) + dc.b $a,175,$df,$ce,$e,32,$8c,$02,$e,32,$64,$06,$e,32,$3c,$0a,0,0 + ; Brightfill (5 passes, 290 height) + dc.b $a,118,$9e,$ce,$a,52,$df,$ca,$e,40,$bb,$82,$e,40,$89,$86,$e,40,$57,$8a,0,0 + +; 111 + dc.w 16202,1 + dc.w 5,106,111,0,126,179,121 + dc.w 10,111,147,0,121,179,83 + ; Darkfill (4 passes, 271 height) + dc.b $a,175,$df,$ce,$e,32,$8a,$c2,$e,32,$62,$c6,$e,32,$3a,$ca,0,0 + ; Brightfill (5 passes, 288 height) + dc.b $a,114,$99,$ce,$a,56,$df,$ca,$e,40,$87,$06,$e,39,$b7,$c2,$e,39,$55,$0a,0,0 + +; 112 + dc.w 16305,1 + dc.w 4,106,110,0,126,179,121 + dc.w 9,111,145,0,121,179,81 + ; Darkfill (4 passes, 272 height) + dc.b $a,176,$df,$ce,$e,32,$89,$82,$e,32,$61,$86,$e,32,$39,$8a,0,0 + ; Brightfill (5 passes, 289 height) + dc.b $a,109,$92,$4e,$a,62,$df,$ca,$e,40,$53,$ca,$e,39,$b5,$42,$e,39,$84,$86,0,0 + +; 113 + dc.w 16285,1 + dc.w 4,105,110,0,125,179,119 + dc.w 9,110,143,0,120,179,80 + ; Darkfill (4 passes, 273 height) + dc.b $a,176,$df,$ce,$e,33,$61,$86,$e,32,$89,$82,$e,32,$38,$4a,0,0 + ; Brightfill (5 passes, 288 height) + dc.b $a,105,$8d,$4e,$a,66,$df,$ca,$e,39,$b2,$c2,$e,39,$82,$06,$e,39,$51,$4a,0,0 + +; 114 + dc.w 16214,1 + dc.w 4,105,110,0,125,179,118 + dc.w 9,110,141,0,120,179,79 + ; Darkfill (4 passes, 273 height) + dc.b $a,176,$df,$ce,$e,33,$61,$86,$e,32,$89,$82,$e,32,$38,$4a,0,0 + ; Brightfill (5 passes, 286 height) + dc.b $a,102,$89,$8e,$a,69,$df,$ca,$e,39,$80,$c6,$e,38,$b0,$42,$e,38,$50,$0a,0,0 + +; 115 + dc.w 16141,1 + dc.w 4,105,109,0,125,179,117 + dc.w 9,110,140,0,120,179,78 + ; Darkfill (4 passes, 272 height) + dc.b $a,176,$df,$ce,$e,32,$88,$42,$e,32,$60,$46,$e,32,$38,$4a,0,0 + ; Brightfill (5 passes, 285 height) + dc.b $a,100,$87,$0e,$a,71,$df,$ca,$e,38,$af,$02,$e,38,$7f,$86,$e,38,$50,$0a,0,0 + +; 116 + dc.w 16180,1 + dc.w 4,104,109,0,124,179,116 + dc.w 9,109,138,0,119,179,77 + ; Darkfill (4 passes, 273 height) + dc.b $a,176,$df,$ce,$e,33,$60,$46,$e,32,$88,$42,$e,32,$37,$0a,0,0 + ; Brightfill (5 passes, 285 height) + dc.b $a,96,$82,$0e,$a,75,$df,$ca,$e,38,$ac,$82,$e,38,$7d,$06,$e,38,$4d,$8a,0,0 + +; 117 + dc.w 16169,1 + dc.w 4,104,108,0,124,179,115 + dc.w 9,109,137,0,119,179,76 + ; Darkfill (4 passes, 272 height) + dc.b $a,176,$df,$ce,$e,32,$87,$02,$e,32,$5f,$06,$e,32,$37,$0a,0,0 + ; Brightfill (5 passes, 284 height) + dc.b $a,93,$7e,$4e,$a,78,$df,$ca,$e,38,$7d,$06,$e,38,$4d,$8a,$e,37,$ab,$42,0,0 + +; 118 + dc.w 16212,1 + dc.w 3,104,108,0,124,179,114 + dc.w 8,109,136,0,119,179,75 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5f,$06,$e,32,$87,$02,$e,32,$35,$ca,0,0 + ; Brightfill (5 passes, 285 height) + dc.b $a,92,$7b,$ce,$a,80,$df,$ca,$e,38,$7b,$c6,$e,38,$4c,$4a,$e,37,$aa,$02,0,0 + +; 119 + dc.w 16264,1 + dc.w 3,103,108,0,123,179,113 + dc.w 8,108,134,0,118,179,74 + ; Darkfill (4 passes, 275 height) + dc.b $a,177,$df,$ce,$e,33,$87,$02,$e,33,$35,$ca,$e,32,$5d,$c6,0,0 + ; Brightfill (5 passes, 284 height) + dc.b $a,88,$76,$ce,$a,84,$df,$ca,$e,38,$79,$46,$e,37,$a7,$82,$e,37,$49,$ca,0,0 + +; 120 + dc.w 16202,1 + dc.w 3,103,107,0,123,179,113 + dc.w 8,108,132,0,118,179,73 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5d,$c6,$e,32,$85,$c2,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 282 height) + dc.b $a,86,$df,$ca,$a,86,$74,$4e,$e,37,$a5,$02,$e,37,$49,$ca,$e,36,$76,$c6,0,0 + +; 121 + dc.w 16130,1 + dc.w 3,103,107,0,123,179,112 + dc.w 8,108,132,0,118,179,73 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5d,$c6,$e,32,$85,$c2,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 282 height) + dc.b $a,86,$df,$ca,$a,86,$74,$4e,$e,37,$a5,$02,$e,37,$49,$ca,$e,36,$76,$c6,0,0 + +; 122 + dc.w 16108,1 + dc.w 3,103,107,0,123,179,112 + dc.w 8,108,132,0,118,179,72 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5d,$c6,$e,32,$85,$c2,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 282 height) + dc.b $a,88,$df,$ca,$a,84,$71,$ce,$e,37,$a5,$02,$e,37,$49,$ca,$e,36,$76,$c6,0,0 + +; 123 + dc.w 16081,1 + dc.w 3,103,106,0,123,179,111 + dc.w 8,108,131,0,118,179,72 + ; Darkfill (4 passes, 273 height) + dc.b $a,177,$df,$ce,$e,32,$84,$82,$e,32,$5c,$86,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 281 height) + dc.b $a,88,$df,$ca,$a,84,$71,$ce,$e,37,$76,$c6,$e,36,$a3,$c2,$e,36,$48,$8a,0,0 + +; 124 + dc.w 16081,1 + dc.w 3,103,106,0,123,179,111 + dc.w 8,108,131,0,118,179,72 + ; Darkfill (4 passes, 273 height) + dc.b $a,177,$df,$ce,$e,32,$84,$82,$e,32,$5c,$86,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 281 height) + dc.b $a,88,$df,$ca,$a,84,$71,$ce,$e,37,$76,$c6,$e,36,$a3,$c2,$e,36,$48,$8a,0,0 + +; 125 + dc.w 16149,1 + dc.w 3,102,107,0,122,179,110 + dc.w 8,107,130,0,117,179,71 + ; Darkfill (4 passes, 275 height) + dc.b $a,177,$df,$ce,$e,33,$85,$c2,$e,33,$34,$8a,$e,32,$5c,$86,0,0 + ; Brightfill (5 passes, 281 height) + dc.b $a,92,$df,$ca,$a,80,$6c,$ce,$e,37,$75,$86,$e,36,$a2,$82,$e,36,$47,$4a,0,0 + +; 126 + dc.w 16122,1 + dc.w 3,102,106,0,122,179,110 + dc.w 8,107,129,0,117,179,71 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5c,$86,$e,32,$84,$82,$e,32,$33,$4a,0,0 + ; Brightfill (5 passes, 280 height) + dc.b $a,92,$df,$ca,$a,80,$6c,$ce,$e,36,$a1,$42,$e,36,$74,$46,$e,36,$47,$4a,0,0 + +; 127 + dc.w 16099,1 + dc.w 3,102,106,0,122,179,110 + dc.w 8,107,129,0,117,179,70 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5c,$86,$e,32,$84,$82,$e,32,$33,$4a,0,0 + ; Brightfill (5 passes, 280 height) + dc.b $a,93,$df,$ca,$a,79,$6b,$8e,$e,36,$a1,$42,$e,36,$74,$46,$e,36,$47,$4a,0,0 + +; 128 + dc.w 16075,1 + dc.w 3,102,106,0,122,179,110 + dc.w 8,107,129,0,117,179,70 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5c,$86,$e,32,$84,$82,$e,32,$33,$4a,0,0 + ; Brightfill (5 passes, 280 height) + dc.b $a,93,$df,$ca,$a,79,$6b,$8e,$e,36,$a1,$42,$e,36,$74,$46,$e,36,$47,$4a,0,0 + +; 129 + dc.w 16075,1 + dc.w 3,102,106,0,122,179,110 + dc.w 8,107,129,0,117,179,70 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5c,$86,$e,32,$84,$82,$e,32,$33,$4a,0,0 + ; Brightfill (5 passes, 280 height) + dc.b $a,93,$df,$ca,$a,79,$6b,$8e,$e,36,$a1,$42,$e,36,$74,$46,$e,36,$47,$4a,0,0 + +; 130 + dc.w 16074,1 + dc.w 3,102,106,0,122,179,110 + dc.w 8,107,129,0,117,179,71 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5c,$86,$e,32,$84,$82,$e,32,$33,$4a,0,0 + ; Brightfill (5 passes, 280 height) + dc.b $a,92,$df,$ca,$a,80,$6c,$ce,$e,36,$a1,$42,$e,36,$74,$46,$e,36,$47,$4a,0,0 + +; 131 + dc.w 16135,1 + dc.w 3,102,107,0,122,179,110 + dc.w 8,107,130,0,117,179,71 + ; Darkfill (4 passes, 275 height) + dc.b $a,177,$df,$ce,$e,33,$85,$c2,$e,33,$34,$8a,$e,32,$5c,$86,0,0 + ; Brightfill (5 passes, 281 height) + dc.b $a,92,$df,$ca,$a,80,$6c,$ce,$e,37,$75,$86,$e,36,$a2,$82,$e,36,$47,$4a,0,0 + +; 132 + dc.w 16125,1 + dc.w 3,103,106,0,123,179,111 + dc.w 8,108,131,0,118,179,72 + ; Darkfill (4 passes, 273 height) + dc.b $a,177,$df,$ce,$e,32,$84,$82,$e,32,$5c,$86,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 281 height) + dc.b $a,88,$df,$ca,$a,84,$71,$ce,$e,37,$76,$c6,$e,36,$a3,$c2,$e,36,$48,$8a,0,0 + +; 133 + dc.w 16115,1 + dc.w 3,103,106,0,123,179,111 + dc.w 8,108,131,0,118,179,72 + ; Darkfill (4 passes, 273 height) + dc.b $a,177,$df,$ce,$e,32,$84,$82,$e,32,$5c,$86,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 281 height) + dc.b $a,88,$df,$ca,$a,84,$71,$ce,$e,37,$76,$c6,$e,36,$a3,$c2,$e,36,$48,$8a,0,0 + +; 134 + dc.w 16118,1 + dc.w 3,103,107,0,123,179,112 + dc.w 8,108,132,0,118,179,72 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5d,$c6,$e,32,$85,$c2,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 282 height) + dc.b $a,88,$df,$ca,$a,84,$71,$ce,$e,37,$a5,$02,$e,37,$49,$ca,$e,36,$76,$c6,0,0 + +; 135 + dc.w 16116,1 + dc.w 3,103,107,0,123,179,112 + dc.w 8,108,132,0,118,179,73 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5d,$c6,$e,32,$85,$c2,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 282 height) + dc.b $a,86,$df,$ca,$a,86,$74,$4e,$e,37,$a5,$02,$e,37,$49,$ca,$e,36,$76,$c6,0,0 + +; 136 + dc.w 16106,1 + dc.w 3,103,107,0,123,179,113 + dc.w 8,108,132,0,118,179,73 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5d,$c6,$e,32,$85,$c2,$e,32,$34,$8a,0,0 + ; Brightfill (5 passes, 282 height) + dc.b $a,86,$df,$ca,$a,86,$74,$4e,$e,37,$a5,$02,$e,37,$49,$ca,$e,36,$76,$c6,0,0 + +; 137 + dc.w 16190,1 + dc.w 3,103,108,0,123,179,113 + dc.w 8,108,134,0,118,179,74 + ; Darkfill (4 passes, 275 height) + dc.b $a,177,$df,$ce,$e,33,$87,$02,$e,33,$35,$ca,$e,32,$5d,$c6,0,0 + ; Brightfill (5 passes, 284 height) + dc.b $a,88,$76,$ce,$a,84,$df,$ca,$e,38,$79,$46,$e,37,$a7,$82,$e,37,$49,$ca,0,0 + +; 138 + dc.w 16266,1 + dc.w 3,104,108,0,124,179,114 + dc.w 8,109,136,0,119,179,75 + ; Darkfill (4 passes, 274 height) + dc.b $a,177,$df,$ce,$e,33,$5f,$06,$e,32,$87,$02,$e,32,$35,$ca,0,0 + ; Brightfill (5 passes, 285 height) + dc.b $a,92,$7b,$ce,$a,80,$df,$ca,$e,38,$7b,$c6,$e,38,$4c,$4a,$e,37,$aa,$02,0,0 + +; 139 + dc.w 16207,1 + dc.w 4,104,108,0,124,179,115 + dc.w 9,109,137,0,119,179,76 + ; Darkfill (4 passes, 272 height) + dc.b $a,176,$df,$ce,$e,32,$87,$02,$e,32,$5f,$06,$e,32,$37,$0a,0,0 + ; Brightfill (5 passes, 284 height) + dc.b $a,93,$7e,$4e,$a,78,$df,$ca,$e,38,$7d,$06,$e,38,$4d,$8a,$e,37,$ab,$42,0,0 + +; 140 + dc.w 16184,1 + dc.w 4,104,109,0,124,179,116 + dc.w 9,109,138,0,119,179,77 + ; Darkfill (4 passes, 273 height) + dc.b $a,176,$df,$ce,$e,33,$60,$46,$e,32,$88,$42,$e,32,$37,$0a,0,0 + ; Brightfill (5 passes, 285 height) + dc.b $a,96,$82,$0e,$a,75,$df,$ca,$e,38,$ac,$82,$e,38,$7d,$06,$e,38,$4d,$8a,0,0 + +; 141 + dc.w 16183,1 + dc.w 4,105,109,0,125,179,117 + dc.w 9,110,140,0,120,179,78 + ; Darkfill (4 passes, 272 height) + dc.b $a,176,$df,$ce,$e,32,$88,$42,$e,32,$60,$46,$e,32,$38,$4a,0,0 + ; Brightfill (5 passes, 285 height) + dc.b $a,100,$87,$0e,$a,71,$df,$ca,$e,38,$af,$02,$e,38,$7f,$86,$e,38,$50,$0a,0,0 + +; 142 + dc.w 16196,1 + dc.w 4,105,110,0,125,179,118 + dc.w 9,110,141,0,120,179,79 + ; Darkfill (4 passes, 273 height) + dc.b $a,176,$df,$ce,$e,33,$61,$86,$e,32,$89,$82,$e,32,$38,$4a,0,0 + ; Brightfill (5 passes, 286 height) + dc.b $a,102,$89,$8e,$a,69,$df,$ca,$e,39,$80,$c6,$e,38,$b0,$42,$e,38,$50,$0a,0,0 + +; 143 + dc.w 16223,1 + dc.w 4,105,110,0,125,179,119 + dc.w 9,110,143,0,120,179,80 + ; Darkfill (4 passes, 273 height) + dc.b $a,176,$df,$ce,$e,33,$61,$86,$e,32,$89,$82,$e,32,$38,$4a,0,0 + ; Brightfill (5 passes, 288 height) + dc.b $a,105,$8d,$4e,$a,66,$df,$ca,$e,39,$b2,$c2,$e,39,$82,$06,$e,39,$51,$4a,0,0 + +; 144 + dc.w 16265,1 + dc.w 4,106,110,0,126,179,121 + dc.w 9,111,145,0,121,179,81 + ; Darkfill (4 passes, 272 height) + dc.b $a,176,$df,$ce,$e,32,$89,$82,$e,32,$61,$86,$e,32,$39,$8a,0,0 + ; Brightfill (5 passes, 289 height) + dc.b $a,109,$92,$4e,$a,62,$df,$ca,$e,40,$53,$ca,$e,39,$b5,$42,$e,39,$84,$86,0,0 + +; 145 + dc.w 16238,1 + dc.w 5,106,111,0,126,179,121 + dc.w 10,111,147,0,121,179,83 + ; Darkfill (4 passes, 271 height) + dc.b $a,175,$df,$ce,$e,32,$8a,$c2,$e,32,$62,$c6,$e,32,$3a,$ca,0,0 + ; Brightfill (5 passes, 288 height) + dc.b $a,114,$99,$ce,$a,56,$df,$ca,$e,40,$87,$06,$e,39,$b7,$c2,$e,39,$55,$0a,0,0 + +; 146 + dc.w 16294,1 + dc.w 5,107,112,0,127,179,123 + dc.w 10,112,150,0,122,179,84 + ; Darkfill (4 passes, 271 height) + dc.b $a,175,$df,$ce,$e,32,$8c,$02,$e,32,$64,$06,$e,32,$3c,$0a,0,0 + ; Brightfill (5 passes, 290 height) + dc.b $a,118,$9e,$ce,$a,52,$df,$ca,$e,40,$bb,$82,$e,40,$89,$86,$e,40,$57,$8a,0,0 + +; 147 + dc.w 16289,1 + dc.w 5,107,112,0,127,179,124 + dc.w 10,112,152,0,122,179,85 + ; Darkfill (4 passes, 271 height) + dc.b $a,175,$df,$ce,$e,32,$8c,$02,$e,32,$64,$06,$e,32,$3c,$0a,0,0 + ; Brightfill (5 passes, 292 height) + dc.b $a,122,$a3,$ce,$a,48,$df,$ca,$e,41,$8c,$06,$e,41,$58,$ca,$e,40,$be,$02,0,0 + +; 148 + dc.w 17026,1 + dc.w 5,108,113,0,128,179,126 + dc.w 10,113,154,0,123,179,87 + ; Darkfill (6 passes, 284 height) + dc.b $a,131,$df,$ce,$a,44,$3c,$12,$e,32,$8d,$42,$e,32,$65,$46,$e,32,$3d,$4a,$e,13,$15,$4e,0,0 + ; Brightfill (5 passes, 292 height) + dc.b $a,130,$ad,$ce,$e,41,$c0,$82,$e,41,$5b,$4a,$e,40,$8d,$46,$a,40,$df,$ca,0,0 + +; 149 + dc.w 17677,1 + dc.w 6,108,114,0,128,179,127 + dc.w 11,113,158,0,123,179,88 + ; Darkfill (6 passes, 283 height) + dc.b $a,87,$df,$ce,$a,87,$73,$12,$e,32,$8e,$82,$e,32,$66,$86,$e,32,$3e,$8a,$e,13,$16,$8e,0,0 + ; Brightfill (5 passes, 294 height) + dc.b $a,132,$b1,$8e,$e,42,$92,$46,$e,42,$5d,$ca,$e,41,$c5,$82,$a,37,$df,$ca,0,0 + +; 150 + dc.w 18703,1 + dc.w 6,109,115,0,129,179,130 + dc.w 11,114,160,0,124,179,91 + ; Darkfill (5 passes, 284 height) + dc.b $a,174,$df,$d2,$e,32,$8f,$c2,$e,32,$67,$c6,$e,32,$3f,$ca,$e,14,$17,$ce,0,0 + ; Brightfill (5 passes, 294 height) + dc.b $a,146,$c3,$0e,$e,42,$c8,$02,$e,42,$60,$4a,$e,41,$93,$86,$a,23,$df,$ca,0,0 + +; 151 + dc.w 18693,1 + dc.w 6,109,115,0,129,179,131 + dc.w 11,114,162,0,124,179,92 + ; Darkfill (5 passes, 284 height) + dc.b $a,174,$df,$d2,$e,32,$8f,$c2,$e,32,$67,$c6,$e,32,$3f,$ca,$e,14,$17,$ce,0,0 + ; Brightfill (5 passes, 296 height) + dc.b $a,150,$c8,$0e,$e,43,$96,$06,$e,42,$ca,$82,$e,42,$60,$4a,$a,19,$df,$ca,0,0 + +; 152 + dc.w 18584,1 + dc.w 6,110,116,0,130,179,133 + dc.w 11,115,166,0,125,179,94 + ; Darkfill (5 passes, 285 height) + dc.b $a,174,$df,$d2,$e,32,$91,$02,$e,32,$69,$06,$e,32,$41,$0a,$e,15,$19,$0e,0,0 + ; Brightfill (5 passes, 298 height) + dc.b $a,160,$d4,$8e,$e,43,$cf,$82,$e,43,$99,$c6,$e,43,$64,$0a,$a,9,$df,$ca,0,0 + +; 153 + dc.w 18679,1 + dc.w 7,110,117,0,130,179,135 + dc.w 12,115,169,0,125,179,95 + ; Darkfill (5 passes, 284 height) + dc.b $a,173,$df,$d2,$e,32,$92,$42,$e,32,$6a,$46,$e,32,$42,$4a,$e,15,$1a,$4e,0,0 + ; Brightfill (5 passes, 299 height) + dc.b $a,165,$dc,$0e,$e,44,$d3,$42,$e,44,$66,$8a,$e,43,$9c,$46,$a,3,$df,$ca,0,0 + +; 154 + dc.w 18719,1 + dc.w 7,111,118,0,131,179,137 + dc.w 12,116,173,0,126,179,98 + ; Darkfill (5 passes, 285 height) + dc.b $a,173,$df,$d2,$e,32,$93,$82,$e,32,$6b,$86,$e,32,$43,$8a,$e,16,$1b,$8e,0,0 + ; Brightfill (4 passes, 301 height) + dc.b $a,168,$df,$ce,$e,45,$a1,$46,$e,44,$d8,$42,$e,44,$69,$0a,0,0 + +; 155 + dc.w 18764,1 + dc.w 7,112,119,0,132,179,139 + dc.w 12,117,177,0,127,179,99 + ; Darkfill (5 passes, 286 height) + dc.b $a,173,$df,$d2,$e,32,$94,$c2,$e,32,$6c,$c6,$e,32,$44,$ca,$e,17,$1c,$ce,0,0 + ; Brightfill (4 passes, 303 height) + dc.b $a,168,$df,$ce,$e,45,$dd,$42,$e,45,$a5,$06,$e,45,$6c,$ca,0,0 + +; 156 + dc.w 18759,1 + dc.w 7,112,119,0,132,179,140 + dc.w 12,117,179,0,127,179,101 + ; Darkfill (5 passes, 286 height) + dc.b $a,173,$df,$d2,$e,32,$94,$c2,$e,32,$6c,$c6,$e,32,$44,$ca,$e,17,$1c,$ce,0,0 + ; Brightfill (4 passes, 305 height) + dc.b $a,168,$df,$ce,$e,46,$a7,$86,$e,46,$6e,$0a,$e,45,$df,$c2,0,0 + +; 157 + dc.w 18768,1 + dc.w 8,113,121,0,133,179,143 + dc.w 13,118,179,3,128,179,104 + ; Darkfill (5 passes, 286 height) + dc.b $a,172,$df,$d2,$e,32,$97,$42,$e,32,$6f,$46,$e,32,$47,$4a,$e,18,$1f,$4e,0,0 + ; Brightfill (6 passes, 305 height) + dc.b $a,163,$df,$ce,$e,46,$ab,$46,$e,46,$71,$ca,$e,42,$df,$c2,$e,4,$14,$0e,$a,4,$14,$12,0,0 + +; 158 + dc.w 18981,1 + dc.w 8,114,122,0,134,179,145 + dc.w 13,119,179,7,129,179,106 + ; Darkfill (5 passes, 287 height) + dc.b $a,172,$df,$d2,$e,32,$98,$82,$e,32,$70,$86,$e,32,$48,$8a,$e,19,$20,$8e,0,0 + ; Brightfill (6 passes, 310 height) + dc.b $a,156,$df,$ce,$e,48,$76,$ca,$e,47,$b1,$86,$e,37,$df,$c2,$e,11,$1c,$ce,$a,11,$1c,$d2,0,0 + +; 159 + dc.w 19134,1 + dc.w 8,115,125,0,135,179,147 + dc.w 13,120,179,9,130,179,108 + ; Darkfill (5 passes, 290 height) + dc.b $a,172,$df,$d2,$e,33,$9c,$42,$e,33,$4b,$0a,$e,32,$73,$06,$e,20,$21,$ce,0,0 + ; Brightfill (6 passes, 316 height) + dc.b $a,148,$df,$ce,$e,48,$b5,$46,$e,48,$79,$4a,$e,34,$df,$c2,$e,19,$26,$ce,$a,19,$26,$d2,0,0 + +; 160 + dc.w 19136,1 + dc.w 9,115,128,0,135,179,149 + dc.w 14,120,179,12,130,179,110 + ; Darkfill (5 passes, 291 height) + dc.b $a,171,$df,$d2,$e,33,$a0,$02,$e,33,$76,$c6,$e,33,$4d,$8a,$e,21,$24,$4e,0,0 + ; Brightfill (6 passes, 315 height) + dc.b $a,145,$df,$ce,$e,49,$ba,$46,$e,49,$7d,$0a,$e,30,$df,$c2,$e,21,$2a,$8e,$a,21,$2a,$92,0,0 + +; 161 + dc.w 19387,1 + dc.w 9,116,131,0,136,179,151 + dc.w 14,121,179,15,131,179,112 + ; Darkfill (5 passes, 294 height) + dc.b $a,171,$df,$d2,$e,34,$a3,$c2,$e,34,$50,$0a,$e,33,$79,$46,$e,22,$25,$8e,0,0 + ; Brightfill (6 passes, 323 height) + dc.b $a,135,$df,$ce,$e,50,$bf,$46,$e,50,$80,$ca,$e,31,$37,$0e,$a,31,$37,$12,$e,26,$df,$c2,0,0 + +; 162 + dc.w 19608,1 + dc.w 9,117,134,0,137,179,154 + dc.w 14,122,179,18,132,179,115 + ; Darkfill (5 passes, 297 height) + dc.b $a,171,$df,$d2,$e,35,$52,$8a,$e,34,$a7,$82,$e,34,$7d,$06,$e,23,$26,$ce,0,0 + ; Brightfill (6 passes, 332 height) + dc.b $a,122,$df,$ce,$e,51,$c4,$46,$e,50,$84,$8a,$a,44,$47,$52,$e,43,$46,$0e,$e,22,$df,$c2,0,0 + +; 163 + dc.w 19721,1 + dc.w 9,118,138,0,138,179,156 + dc.w 14,123,179,22,133,179,117 + ; Darkfill (5 passes, 301 height) + dc.b $a,171,$df,$d2,$e,35,$ac,$82,$e,35,$80,$c6,$e,35,$55,$0a,$e,25,$29,$4e,0,0 + ; Brightfill (6 passes, 332 height) + dc.b $a,109,$df,$ce,$a,57,$57,$92,$e,53,$8a,$ca,$e,52,$cb,$c6,$e,45,$48,$8e,$e,16,$df,$c2,0,0 + +; 164 + dc.w 19712,1 + dc.w 10,119,142,0,139,179,158 + dc.w 15,124,179,25,134,179,119 + ; Darkfill (5 passes, 303 height) + dc.b $a,170,$df,$d2,$e,36,$85,$c6,$e,35,$b1,$82,$e,35,$58,$ca,$e,27,$2d,$0e,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $a,93,$df,$ce,$a,72,$6b,$92,$e,53,$d2,$06,$e,53,$8f,$ca,$e,48,$4d,$8e,$e,11,$df,$c2,0,0 + +; 165 + dc.w 19800,1 + dc.w 10,120,146,0,140,179,161 + dc.w 15,125,179,28,135,179,122 + ; Darkfill (6 passes, 307 height) + dc.b $a,157,$cf,$92,$e,37,$5c,$8a,$e,36,$b6,$82,$e,36,$89,$86,$e,28,$2e,$4e,$a,13,$df,$d6,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $a,95,$88,$52,$a,70,$df,$ce,$e,55,$d8,$46,$e,54,$93,$8a,$e,50,$50,$0e,$e,6,$df,$c2,0,0 + +; 166 + dc.w 19779,1 + dc.w 10,121,150,0,141,179,163 + dc.w 15,126,179,31,136,179,125 + ; Darkfill (6 passes, 311 height) + dc.b $a,143,$be,$12,$e,37,$bb,$82,$e,37,$8d,$46,$e,37,$5f,$0a,$e,30,$30,$ce,$a,27,$df,$d6,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $a,127,$b0,$52,$e,56,$de,$86,$e,55,$98,$8a,$e,53,$53,$ce,$a,38,$df,$ce,$e,1,$df,$c2,0,0 + +; 167 + dc.w 19681,1 + dc.w 11,122,154,0,142,179,166 + dc.w 16,127,179,35,137,179,127 + ; Darkfill (6 passes, 313 height) + dc.b $a,123,$a6,$52,$a,46,$df,$d6,$e,38,$92,$46,$e,37,$c0,$82,$e,37,$62,$ca,$e,32,$34,$8e,0,0 + ; Brightfill (5 passes, 328 height) + dc.b $a,155,$d4,$92,$e,57,$a0,$0a,$e,56,$58,$ce,$e,51,$df,$c6,$a,9,$df,$ce,0,0 + +; 168 + dc.w 19634,1 + dc.w 11,123,158,0,143,179,169 + dc.w 16,128,179,38,138,179,130 + ; Darkfill (6 passes, 317 height) + dc.b $a,107,$92,$52,$a,62,$df,$d6,$e,39,$66,$8a,$e,38,$c5,$82,$e,38,$96,$06,$e,33,$35,$ce,0,0 + ; Brightfill (4 passes, 327 height) + dc.b $a,164,$df,$d2,$e,58,$a5,$0a,$e,58,$5c,$8e,$e,47,$df,$c6,0,0 + +; 169 + dc.w 19410,1 + dc.w 11,124,162,0,144,179,171 + dc.w 16,129,179,41,139,179,133 + ; Darkfill (6 passes, 321 height) + dc.b $a,97,$85,$d2,$a,72,$df,$d6,$e,39,$ca,$82,$e,39,$99,$c6,$e,39,$69,$0a,$e,35,$38,$4e,0,0 + ; Brightfill (4 passes, 325 height) + dc.b $a,164,$df,$d2,$e,60,$61,$8e,$e,59,$ab,$4a,$e,42,$df,$c6,0,0 + +; 170 + dc.w 19570,1 + dc.w 11,125,167,0,145,179,174 + dc.w 16,130,179,44,140,179,135 + ; Darkfill (6 passes, 326 height) + dc.b $a,85,$df,$d6,$a,84,$75,$92,$e,40,$d0,$c2,$e,40,$9e,$c6,$e,40,$6c,$ca,$e,37,$3a,$ce,0,0 + ; Brightfill (4 passes, 323 height) + dc.b $a,164,$df,$d2,$e,61,$b1,$8a,$e,61,$65,$4e,$e,37,$df,$c6,0,0 + +; 171 + dc.w 19713,1 + dc.w 12,126,172,0,146,179,177 + dc.w 17,131,179,47,141,179,138 + ; Darkfill (6 passes, 329 height) + dc.b $a,95,$df,$d6,$a,73,$69,$12,$e,41,$d7,$02,$e,41,$71,$ca,$e,40,$a3,$c6,$e,39,$3e,$8e,0,0 + ; Brightfill (4 passes, 319 height) + dc.b $a,163,$df,$d2,$e,62,$b7,$ca,$e,62,$6a,$4e,$e,32,$df,$c6,0,0 + +; 172 + dc.w 19895,1 + dc.w 12,127,177,0,147,179,179 + dc.w 17,132,179,50,142,179,140 + ; Darkfill (6 passes, 334 height) + dc.b $a,102,$df,$d6,$a,66,$60,$52,$e,42,$aa,$06,$e,42,$75,$8a,$e,41,$dd,$42,$e,41,$41,$0e,0,0 + ; Brightfill (4 passes, 317 height) + dc.b $a,163,$df,$d2,$e,64,$6f,$4e,$e,63,$be,$0a,$e,27,$df,$c6,0,0 + +; 173 + dc.w 19937,1 + dc.w 12,128,179,2,148,179,182 + dc.w 17,133,179,54,143,179,145 + ; Darkfill (6 passes, 335 height) + dc.b $a,111,$df,$d6,$a,57,$55,$12,$e,43,$44,$ce,$e,42,$ad,$c6,$e,42,$79,$4a,$e,40,$df,$c2,0,0 + ; Brightfill (4 passes, 314 height) + dc.b $a,163,$df,$d2,$e,66,$c6,$ca,$e,65,$74,$4e,$e,20,$df,$c6,0,0 + +; 174 + dc.w 19964,1 + dc.w 12,129,179,7,149,179,185 + dc.w 17,134,179,57,144,179,147 + ; Darkfill (6 passes, 333 height) + dc.b $a,119,$df,$d6,$a,49,$4b,$12,$e,44,$b5,$46,$e,44,$7e,$4a,$e,43,$47,$4e,$e,34,$df,$c2,0,0 + ; Brightfill (4 passes, 312 height) + dc.b $a,163,$df,$d2,$e,68,$ce,$4a,$e,67,$79,$4e,$e,14,$df,$c6,0,0 + +; 175 + dc.w 19853,1 + dc.w 13,130,179,11,150,179,188 + dc.w 18,135,179,60,145,179,150 + ; Darkfill (6 passes, 330 height) + dc.b $a,125,$df,$d6,$e,45,$bb,$86,$e,45,$4c,$4e,$e,44,$83,$4a,$a,42,$43,$92,$e,29,$df,$c2,0,0 + ; Brightfill (4 passes, 307 height) + dc.b $a,162,$df,$d2,$e,69,$d5,$ca,$e,68,$7f,$8e,$e,8,$df,$c6,0,0 + +; 176 + dc.w 19806,1 + dc.w 13,131,179,15,151,179,191 + dc.w 18,136,179,63,146,179,153 + ; Darkfill (6 passes, 328 height) + dc.b $a,131,$df,$d6,$e,46,$c1,$c6,$e,46,$88,$4a,$e,45,$4e,$ce,$a,36,$3c,$12,$e,24,$df,$c2,0,0 + ; Brightfill (4 passes, 305 height) + dc.b $a,162,$df,$d2,$e,71,$85,$ce,$e,70,$dd,$4a,$e,2,$df,$c6,0,0 + +; 177 + dc.w 19801,1 + dc.w 13,132,179,18,152,179,194 + dc.w 18,137,179,67,147,179,156 + ; Darkfill (7 passes, 327 height) + dc.b $a,127,$d3,$56,$e,47,$c6,$c6,$e,47,$52,$8e,$e,46,$8c,$0a,$a,30,$34,$92,$e,20,$df,$c2,$a,10,$df,$da,0,0 + ; Brightfill (3 passes, 302 height) + dc.b $a,162,$df,$d2,$e,74,$8d,$4e,$e,66,$df,$ca,0,0 + +; 178 + dc.w 19778,1 + dc.w 13,133,179,22,153,179,197 + dc.w 18,138,179,70,148,179,158 + ; Darkfill (7 passes, 325 height) + dc.b $a,121,$c5,$96,$e,48,$cd,$06,$e,48,$56,$4e,$e,47,$91,$0a,$a,25,$2e,$52,$a,21,$df,$da,$e,15,$df,$c2,0,0 + ; Brightfill (3 passes, 299 height) + dc.b $a,162,$df,$d2,$e,76,$93,$8e,$e,61,$df,$ca,0,0 + +; 179 + dc.w 19854,1 + dc.w 13,134,179,26,154,179,200 + dc.w 18,139,179,73,149,179,162 + ; Darkfill (7 passes, 324 height) + dc.b $a,116,$b9,$16,$e,50,$5a,$0e,$e,49,$d4,$86,$e,49,$97,$4a,$a,31,$df,$da,$a,20,$28,$12,$e,9,$df,$c2,0,0 + ; Brightfill (4 passes, 295 height) + dc.b $a,131,$b9,$12,$e,78,$9b,$0e,$e,55,$df,$ca,$a,31,$df,$d6,0,0 + +; 180 + dc.w 19880,1 + dc.w 13,135,179,30,155,179,203 + dc.w 18,140,179,77,150,179,164 + ; Darkfill (7 passes, 322 height) + dc.b $a,111,$ad,$d6,$e,51,$9d,$8a,$e,51,$5d,$ce,$e,50,$dc,$06,$a,40,$df,$da,$a,16,$23,$12,$e,3,$df,$c2,0,0 + ; Brightfill (4 passes, 292 height) + dc.b $a,110,$9e,$d2,$e,82,$a3,$ce,$a,52,$df,$d6,$e,48,$df,$ca,0,0 + +; 181 + dc.w 19387,1 + dc.w 14,136,179,34,156,179,206 + dc.w 19,141,179,80,151,179,167 + ; Darkfill (7 passes, 320 height) + dc.b $a,106,$a3,$d6,$e,52,$a3,$ca,$e,52,$62,$ce,$e,48,$df,$c6,$a,48,$df,$da,$a,12,$1f,$52,$e,2,$21,$d2,0,0 + ; Brightfill (4 passes, 286 height) + dc.b $a,85,$80,$d2,$e,84,$ac,$8e,$a,76,$df,$d6,$e,41,$df,$ca,0,0 + +; 182 + dc.w 19167,1 + dc.w 14,138,179,38,158,179,209 + dc.w 19,143,179,84,153,179,171 + ; Darkfill (7 passes, 327 height) + dc.b $a,104,$98,$96,$a,57,$df,$da,$e,53,$69,$0e,$e,52,$aa,$0a,$e,43,$df,$c6,$e,13,$26,$d2,$a,5,$16,$92,0,0 + ; Brightfill (4 passes, 279 height) + dc.b $a,103,$df,$d6,$e,86,$b7,$ce,$a,58,$5f,$12,$e,32,$df,$ca,0,0 + +; 183 + dc.w 18927,1 + dc.w 14,139,179,42,159,179,212 + dc.w 19,144,179,87,154,179,174 + ; Darkfill (7 passes, 330 height) + dc.b $a,100,$8f,$d6,$a,64,$df,$da,$e,55,$b1,$8a,$e,54,$6c,$ce,$e,37,$df,$c6,$e,18,$29,$52,$a,2,$12,$d2,0,0 + ; Brightfill (5 passes, 278 height) + dc.b $a,117,$df,$d6,$e,90,$c1,$ce,$a,44,$4d,$92,$e,24,$df,$ca,$e,3,$51,$52,0,0 + +; 184 + dc.w 16738,0 + dc.w 16,145,179,87,155,179,179 + dc.w 19,147,179,124,153,179,144 + ; Darkfill (5 passes, 297 height) + dc.b $a,133,$df,$d6,$e,90,$c1,$ce,$a,31,$39,$92,$e,24,$df,$ca,$e,19,$51,$52,0,0 + ; Brightfill (2 passes, 186 height) + dc.b $a,161,$df,$d2,$e,25,$df,$ce,0,0 + +; 185 + dc.w 9588,0 + dc.w 19,151,179,128,151,179,146 + dc.w 19,151,21,156,151,21,146 + ; Darkfill (1 passes, 161 height) + dc.b $a,161,$df,$d2,0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 186 + dc.w 4350,0 + dc.w 19,152,21,162,152,21,142 + dc.w 19,152,21,157,152,21,147 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 187 + dc.w 20571,1 + dc.w 14,143,179,56,163,179,226 + dc.w 19,148,179,100,158,179,186 + ; Darkfill (7 passes, 332 height) + dc.b $a,84,$d7,$1a,$a,75,$6e,$16,$e,61,$82,$0e,$e,60,$cd,$0a,$e,30,$35,$d2,$e,15,$df,$c6,$a,7,$df,$de,0,0 + ; Brightfill (4 passes, 313 height) + dc.b $a,152,$df,$d6,$e,92,$df,$ce,$e,60,$6c,$d2,$a,9,$21,$d2,0,0 + +; 188 + dc.w 20771,1 + dc.w 14,145,179,60,165,179,230 + dc.w 19,150,179,104,160,179,190 + ; Darkfill (7 passes, 332 height) + dc.b $a,81,$ca,$9a,$a,68,$65,$56,$e,63,$89,$8e,$e,62,$d7,$0a,$e,34,$3a,$d2,$a,17,$df,$de,$e,7,$df,$c6,0,0 + ; Brightfill (3 passes, 322 height) + dc.b $a,161,$df,$d6,$e,82,$df,$ce,$e,79,$79,$52,0,0 + +; 189 + dc.w 20125,1 + dc.w 14,146,179,64,166,179,233 + dc.w 19,151,179,107,161,179,192 + ; Darkfill (6 passes, 332 height) + dc.b $a,79,$c1,$da,$e,64,$df,$ca,$e,64,$8f,$ce,$a,63,$5f,$16,$e,38,$3f,$d2,$a,24,$df,$de,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $a,158,$dc,$16,$e,86,$82,$12,$e,75,$df,$ce,$a,3,$df,$da,0,0 + +; 190 + dc.w 20203,1 + dc.w 14,147,179,68,167,179,236 + dc.w 19,152,179,110,162,179,196 + ; Darkfill (6 passes, 332 height) + dc.b $a,77,$ba,$5a,$e,67,$97,$4e,$a,59,$5a,$16,$e,58,$df,$ca,$e,41,$43,$92,$a,30,$df,$de,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $a,139,$c4,$56,$e,94,$8c,$12,$e,67,$df,$ce,$a,22,$df,$da,0,0 + +; 191 + dc.w 20252,1 + dc.w 14,148,179,71,168,179,240 + dc.w 19,153,179,113,163,179,199 + ; Darkfill (6 passes, 332 height) + dc.b $a,74,$b0,$5a,$e,69,$9d,$8e,$a,54,$53,$d6,$e,53,$df,$ca,$e,44,$47,$52,$a,38,$df,$de,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $a,127,$b5,$56,$e,102,$96,$12,$e,59,$df,$ce,$a,34,$df,$da,0,0 + +; 192 + dc.w 20165,1 + dc.w 15,150,179,75,170,179,244 + dc.w 20,155,179,117,165,179,202 + ; Darkfill (6 passes, 330 height) + dc.b $a,71,$a6,$5a,$e,70,$a7,$8e,$e,50,$50,$12,$a,48,$4d,$96,$a,46,$df,$de,$e,45,$df,$ca,0,0 + ; Brightfill (4 passes, 320 height) + dc.b $e,116,$a8,$d2,$a,114,$a6,$56,$a,46,$df,$da,$e,44,$df,$ce,0,0 + +; 193 + dc.w 20239,1 + dc.w 14,151,179,78,171,179,247 + dc.w 19,156,179,120,166,179,205 + ; Darkfill (6 passes, 332 height) + dc.b $e,72,$ad,$ce,$a,69,$9e,$da,$e,54,$53,$d2,$a,52,$df,$de,$a,45,$48,$96,$e,40,$df,$ca,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $e,127,$b5,$52,$a,105,$99,$d6,$a,56,$df,$da,$e,34,$df,$ce,0,0 + +; 194 + dc.w 20178,1 + dc.w 14,152,179,82,172,179,251 + dc.w 19,157,179,123,167,179,208 + ; Darkfill (6 passes, 332 height) + dc.b $e,76,$b7,$ce,$a,67,$97,$5a,$e,58,$58,$d2,$a,58,$df,$de,$a,41,$43,$96,$e,32,$df,$ca,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $e,139,$c4,$52,$a,96,$8e,$96,$a,65,$df,$da,$e,22,$df,$ce,0,0 + +; 195 + dc.w 20203,1 + dc.w 14,153,179,86,173,179,254 + dc.w 19,158,179,126,168,179,212 + ; Darkfill (6 passes, 332 height) + dc.b $e,79,$c1,$ce,$a,65,$91,$1a,$e,63,$5f,$12,$a,63,$df,$de,$a,38,$3f,$d6,$e,24,$df,$ca,0,0 + ; Brightfill (4 passes, 322 height) + dc.b $e,153,$d5,$d2,$a,86,$82,$16,$a,75,$df,$da,$e,8,$df,$ce,0,0 + +; 196 + dc.w 20193,1 + dc.w 14,154,179,89,174,179,258 + dc.w 19,159,179,129,169,179,215 + ; Darkfill (7 passes, 332 height) + dc.b $e,81,$ca,$8e,$e,68,$65,$52,$a,63,$8a,$da,$a,63,$d9,$9e,$a,35,$3c,$16,$e,17,$df,$ca,$a,5,$df,$e2,0,0 + ; Brightfill (3 passes, 322 height) + dc.b $e,161,$df,$d2,$a,82,$df,$da,$a,79,$79,$56,0,0 + +; 197 + dc.w 19910,1 + dc.w 14,156,179,92,176,179,262 + dc.w 19,161,179,133,171,179,219 + ; Darkfill (7 passes, 332 height) + dc.b $e,82,$d3,$4e,$e,74,$6c,$d2,$a,62,$83,$5a,$a,61,$cf,$9e,$a,30,$35,$d6,$a,13,$df,$e2,$e,10,$df,$ca,0,0 + ; Brightfill (3 passes, 313 height) + dc.b $e,152,$df,$d2,$a,92,$df,$da,$a,69,$6c,$d6,0,0 + +; 198 + dc.w 19659,1 + dc.w 14,157,179,96,177,179,266 + dc.w 19,162,179,136,172,179,222 + ; Darkfill (6 passes, 332 height) + dc.b $e,86,$df,$ce,$e,80,$74,$52,$a,60,$7d,$1a,$a,59,$c6,$de,$a,27,$32,$16,$a,20,$df,$e2,0,0 + ; Brightfill (3 passes, 306 height) + dc.b $e,145,$df,$d2,$a,98,$df,$da,$a,63,$65,$56,0,0 + +; 199 + dc.w 19306,1 + dc.w 14,158,179,99,178,179,269 + dc.w 19,163,179,139,173,179,225 + ; Darkfill (6 passes, 332 height) + dc.b $e,86,$7b,$d2,$e,80,$df,$ce,$a,58,$78,$1a,$a,58,$c0,$9e,$a,25,$2f,$96,$a,25,$df,$e2,0,0 + ; Brightfill (4 passes, 298 height) + dc.b $e,137,$df,$d2,$a,99,$d9,$9a,$a,57,$5d,$d6,$a,5,$df,$de,0,0 + +; 200 + dc.w 19029,1 + dc.w 14,159,179,103,179,179,273 + dc.w 19,164,179,142,174,179,228 + ; Darkfill (6 passes, 332 height) + dc.b $e,93,$84,$92,$e,73,$df,$ce,$a,57,$73,$1a,$a,56,$b9,$1e,$a,31,$df,$e2,$a,22,$2b,$d6,0,0 + ; Brightfill (4 passes, 289 height) + dc.b $e,128,$df,$d2,$a,95,$ce,$5a,$a,52,$57,$96,$a,14,$df,$de,0,0 + +; 201 + dc.w 18721,1 + dc.w 14,160,179,106,180,179,277 + dc.w 19,165,179,145,175,179,231 + ; Darkfill (6 passes, 330 height) + dc.b $e,98,$8d,$52,$e,66,$df,$ce,$a,55,$b1,$9e,$a,54,$6c,$da,$a,37,$df,$e2,$a,20,$29,$56,0,0 + ; Brightfill (4 passes, 278 height) + dc.b $e,117,$df,$d2,$a,91,$c4,$5a,$a,48,$52,$96,$a,22,$df,$de,0,0 + +; 202 + dc.w 18687,1 + dc.w 14,161,179,109,181,179,281 + dc.w 19,166,179,148,176,179,235 + ; Darkfill (6 passes, 327 height) + dc.b $e,102,$96,$12,$e,59,$df,$ce,$a,53,$69,$1a,$a,52,$aa,$1e,$a,43,$df,$e2,$a,18,$26,$d6,0,0 + ; Brightfill (5 passes, 279 height) + dc.b $e,103,$df,$d2,$a,86,$b7,$da,$a,43,$4c,$56,$a,32,$df,$de,$e,15,$5f,$16,0,0 + +; 203 + dc.w 19033,1 + dc.w 14,163,179,113,183,179,285 + dc.w 19,168,179,152,178,179,238 + ; Darkfill (6 passes, 320 height) + dc.b $e,106,$a3,$d2,$a,52,$62,$da,$a,52,$a3,$de,$e,48,$df,$ce,$a,48,$df,$e2,$a,14,$21,$d6,0,0 + ; Brightfill (5 passes, 286 height) + dc.b $a,86,$af,$1a,$e,76,$df,$d2,$e,49,$80,$d6,$a,39,$df,$de,$a,36,$43,$96,0,0 + +; 204 + dc.w 19470,1 + dc.w 13,164,179,115,184,179,289 + dc.w 18,169,179,155,179,179,242 + ; Darkfill (8 passes, 322 height) + dc.b $e,108,$aa,$12,$a,51,$5d,$da,$a,51,$9d,$9e,$a,50,$dc,$22,$e,43,$df,$ce,$a,12,$1e,$16,$e,4,$23,$16,$a,3,$df,$e6,0,0 + ; Brightfill (5 passes, 292 height) + dc.b $a,82,$a3,$da,$e,78,$9e,$d6,$e,52,$df,$d2,$a,48,$df,$de,$a,32,$3d,$56,0,0 + +; 205 + dc.w 19725,1 + dc.w 13,165,179,118,185,179,293 + dc.w 18,170,179,157,180,179,245 + ; Darkfill (8 passes, 324 height) + dc.b $e,113,$b5,$52,$a,50,$5a,$1a,$a,49,$97,$5e,$a,49,$d4,$a2,$e,34,$df,$ce,$a,10,$1b,$96,$e,10,$28,$16,$a,9,$df,$e6,0,0 + ; Brightfill (5 passes, 295 height) + dc.b $e,102,$b9,$16,$a,79,$9c,$5a,$a,54,$df,$de,$e,31,$df,$d2,$a,29,$39,$96,0,0 + +; 206 + dc.w 20104,1 + dc.w 13,166,179,122,186,179,297 + dc.w 18,171,179,161,181,179,249 + ; Darkfill (8 passes, 325 height) + dc.b $e,121,$c5,$92,$a,48,$56,$5a,$a,48,$cd,$22,$a,47,$91,$1e,$e,21,$df,$ce,$e,16,$2e,$56,$a,15,$df,$e6,$a,9,$1a,$56,0,0 + ; Brightfill (4 passes, 299 height) + dc.b $e,137,$df,$d6,$a,76,$93,$9a,$a,61,$df,$de,$a,25,$34,$96,0,0 + +; 207 + dc.w 20078,1 + dc.w 13,167,179,125,187,179,301 + dc.w 18,172,179,163,182,179,252 + ; Darkfill (8 passes, 327 height) + dc.b $e,127,$d3,$52,$a,47,$52,$9a,$a,47,$c6,$e2,$a,46,$8c,$1e,$e,23,$34,$96,$a,20,$df,$e6,$e,10,$df,$ce,$a,7,$17,$d6,0,0 + ; Brightfill (4 passes, 302 height) + dc.b $e,140,$df,$d6,$a,74,$8d,$5a,$a,66,$df,$de,$a,22,$30,$d6,0,0 + +; 208 + dc.w 19913,1 + dc.w 13,168,179,128,188,179,304 + dc.w 18,173,179,166,183,179,255 + ; Darkfill (7 passes, 328 height) + dc.b $e,131,$df,$d2,$a,46,$88,$5e,$a,46,$c1,$e2,$a,45,$4e,$da,$e,30,$3c,$16,$a,24,$df,$e6,$a,6,$16,$96,0,0 + ; Brightfill (4 passes, 304 height) + dc.b $e,142,$df,$d6,$a,71,$87,$1a,$a,71,$df,$de,$a,20,$2e,$56,0,0 + +; 209 + dc.w 19968,1 + dc.w 13,169,179,131,189,179,308 + dc.w 18,174,179,169,184,179,259 + ; Darkfill (7 passes, 330 height) + dc.b $e,125,$df,$d2,$a,45,$4c,$5a,$a,45,$bb,$a2,$a,44,$83,$5e,$e,38,$43,$96,$a,29,$df,$e6,$a,4,$14,$16,0,0 + ; Brightfill (5 passes, 307 height) + dc.b $e,145,$df,$d6,$a,69,$d5,$de,$a,68,$7f,$9a,$a,17,$2a,$96,$a,8,$df,$e2,0,0 + +; 210 + dc.w 20089,1 + dc.w 12,170,179,134,190,179,312 + dc.w 17,175,179,172,185,179,261 + ; Darkfill (7 passes, 333 height) + dc.b $e,119,$df,$d2,$e,46,$4b,$16,$a,44,$7e,$5e,$a,44,$b5,$62,$a,43,$47,$5a,$a,34,$df,$e6,$a,3,$11,$96,0,0 + ; Brightfill (5 passes, 312 height) + dc.b $e,149,$df,$d6,$a,69,$7b,$da,$a,68,$d0,$de,$a,14,$25,$96,$a,12,$df,$e2,0,0 + +; 211 + dc.w 20118,1 + dc.w 12,171,179,137,191,179,317 + dc.w 17,176,179,174,186,179,265 + ; Darkfill (7 passes, 335 height) + dc.b $e,111,$df,$d2,$e,56,$55,$16,$a,43,$44,$da,$a,42,$79,$5e,$a,42,$ad,$e2,$a,40,$df,$e6,$a,1,$0f,$16,0,0 + ; Brightfill (5 passes, 314 height) + dc.b $e,151,$df,$d6,$a,66,$c6,$de,$a,65,$74,$5a,$a,20,$df,$e2,$a,12,$23,$16,0,0 + +; 212 + dc.w 20140,1 + dc.w 12,172,179,139,192,177,319 + dc.w 17,177,179,179,187,179,268 + ; Darkfill (6 passes, 334 height) + dc.b $e,104,$df,$d2,$e,64,$5d,$d6,$a,42,$75,$9e,$a,42,$aa,$22,$a,41,$41,$1a,$a,41,$dd,$66,0,0 + ; Brightfill (5 passes, 317 height) + dc.b $e,154,$df,$d6,$a,64,$6f,$5a,$a,64,$bf,$5e,$a,26,$df,$e2,$a,9,$1f,$56,0,0 + +; 213 + dc.w 19954,1 + dc.w 12,173,179,142,193,173,319 + dc.w 17,178,179,181,188,179,272 + ; Darkfill (6 passes, 330 height) + dc.b $e,95,$df,$d2,$e,73,$69,$16,$a,41,$71,$de,$a,41,$a5,$22,$a,41,$d8,$66,$a,39,$3e,$9a,0,0 + ; Brightfill (5 passes, 319 height) + dc.b $e,156,$df,$d6,$a,62,$6a,$5a,$a,62,$b7,$de,$a,32,$df,$e2,$a,7,$1c,$d6,0,0 + +; 214 + dc.w 19927,1 + dc.w 11,174,179,145,194,167,319 + dc.w 16,179,179,184,189,179,275 + ; Darkfill (6 passes, 326 height) + dc.b $e,85,$df,$d2,$e,84,$75,$96,$a,40,$6c,$de,$a,40,$9e,$e2,$a,40,$d0,$e6,$a,37,$3a,$da,0,0 + ; Brightfill (5 passes, 323 height) + dc.b $e,159,$df,$d6,$a,61,$65,$5a,$a,61,$b1,$9e,$a,37,$df,$e2,$a,5,$19,$16,0,0 + +; 215 + dc.w 19729,1 + dc.w 11,175,179,147,195,162,319 + dc.w 16,180,179,186,190,179,278 + ; Darkfill (6 passes, 321 height) + dc.b $e,93,$80,$d6,$e,76,$df,$d2,$a,39,$69,$1e,$a,39,$99,$e2,$a,39,$ca,$a6,$a,35,$38,$5a,0,0 + ; Brightfill (5 passes, 325 height) + dc.b $e,161,$df,$d6,$a,60,$61,$9a,$a,59,$ab,$5e,$a,42,$df,$e2,$a,3,$16,$96,0,0 + +; 216 + dc.w 19477,1 + dc.w 11,176,179,150,196,158,319 + dc.w 16,181,179,189,191,179,281 + ; Darkfill (6 passes, 317 height) + dc.b $e,107,$92,$56,$e,62,$df,$d2,$a,39,$66,$9e,$a,38,$96,$22,$a,38,$c5,$a6,$a,33,$35,$da,0,0 + ; Brightfill (5 passes, 327 height) + dc.b $e,163,$df,$d6,$a,58,$5c,$9a,$a,58,$a5,$1e,$a,47,$df,$e2,$a,1,$14,$16,0,0 + +; 217 + dc.w 19328,1 + dc.w 11,177,179,153,197,154,319 + dc.w 16,182,179,192,192,179,284 + ; Darkfill (6 passes, 313 height) + dc.b $e,123,$a6,$56,$e,46,$df,$d2,$a,38,$92,$62,$a,37,$62,$de,$a,37,$c0,$a6,$a,32,$34,$9a,0,0 + ; Brightfill (5 passes, 328 height) + dc.b $e,155,$d4,$96,$a,57,$a0,$1e,$a,56,$58,$da,$a,51,$df,$e2,$e,9,$df,$da,0,0 + +; 218 + dc.w 19523,1 + dc.w 10,178,179,156,198,150,319 + dc.w 15,183,179,194,193,179,288 + ; Darkfill (6 passes, 311 height) + dc.b $e,143,$be,$16,$a,37,$5f,$1e,$a,37,$8d,$62,$a,37,$bb,$a6,$a,30,$30,$da,$e,27,$df,$d2,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $e,127,$b0,$56,$a,56,$de,$a2,$a,55,$98,$9e,$a,53,$53,$da,$e,38,$df,$da,$a,1,$df,$e6,0,0 + +; 219 + dc.w 19627,1 + dc.w 10,179,179,158,199,146,319 + dc.w 15,184,179,197,194,179,291 + ; Darkfill (6 passes, 307 height) + dc.b $e,157,$cf,$96,$a,37,$5c,$9e,$a,36,$89,$a2,$a,36,$b6,$a6,$a,28,$2e,$5a,$e,13,$df,$d2,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $e,95,$88,$56,$e,70,$df,$da,$a,55,$d8,$62,$a,54,$93,$9e,$a,50,$50,$1a,$a,6,$df,$e6,0,0 + +; 220 + dc.w 19713,1 + dc.w 10,180,179,161,200,142,319 + dc.w 15,185,179,200,195,179,294 + ; Darkfill (5 passes, 303 height) + dc.b $e,170,$df,$d6,$a,36,$85,$e2,$a,35,$58,$de,$a,35,$b1,$a6,$a,27,$2d,$1a,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $e,93,$df,$da,$e,72,$6b,$96,$a,53,$8f,$de,$a,53,$d2,$22,$a,48,$4d,$9a,$a,11,$df,$e6,0,0 + +; 221 + dc.w 19820,1 + dc.w 9,181,179,163,201,138,319 + dc.w 14,186,179,202,196,179,297 + ; Darkfill (5 passes, 301 height) + dc.b $e,171,$df,$d6,$a,35,$55,$1e,$a,35,$80,$e2,$a,35,$ac,$a6,$a,25,$29,$5a,0,0 + ; Brightfill (6 passes, 332 height) + dc.b $e,109,$df,$da,$e,57,$57,$96,$a,53,$8a,$de,$a,52,$cb,$e2,$a,45,$48,$9a,$a,16,$df,$e6,0,0 + +; 222 + dc.w 19738,1 + dc.w 9,182,179,165,202,134,319 + dc.w 14,187,179,204,197,179,301 + ; Darkfill (5 passes, 297 height) + dc.b $e,171,$df,$d6,$a,35,$52,$9e,$a,34,$7d,$22,$a,34,$a7,$a6,$a,23,$26,$da,0,0 + ; Brightfill (6 passes, 332 height) + dc.b $e,122,$df,$da,$a,51,$c4,$62,$a,50,$84,$9e,$e,44,$47,$56,$a,43,$46,$1a,$a,22,$df,$e6,0,0 + +; 223 + dc.w 19452,1 + dc.w 9,183,179,168,203,131,319 + dc.w 14,188,179,207,198,179,304 + ; Darkfill (5 passes, 294 height) + dc.b $e,171,$df,$d6,$a,34,$50,$1e,$a,34,$a3,$e6,$a,33,$79,$62,$a,22,$25,$9a,0,0 + ; Brightfill (6 passes, 323 height) + dc.b $e,126,$df,$da,$a,50,$80,$de,$a,50,$bf,$62,$a,40,$42,$5a,$e,31,$37,$16,$a,26,$df,$e6,0,0 + +; 224 + dc.w 19153,1 + dc.w 9,184,179,170,204,128,319 + dc.w 14,189,179,209,199,179,307 + ; Darkfill (5 passes, 291 height) + dc.b $e,171,$df,$d6,$a,33,$4d,$9e,$a,33,$76,$e2,$a,33,$a0,$26,$a,21,$24,$5a,0,0 + ; Brightfill (6 passes, 315 height) + dc.b $e,128,$df,$da,$a,49,$7d,$1e,$a,49,$ba,$62,$a,38,$3f,$da,$a,30,$df,$e6,$e,21,$2a,$96,0,0 + +; 225 + dc.w 19200,1 + dc.w 8,184,179,172,204,125,319 + dc.w 13,189,179,211,199,179,310 + ; Darkfill (5 passes, 290 height) + dc.b $e,172,$df,$d6,$a,33,$4b,$1e,$a,33,$9c,$66,$a,32,$73,$22,$a,20,$21,$da,0,0 + ; Brightfill (6 passes, 316 height) + dc.b $e,130,$df,$da,$a,48,$79,$5e,$a,48,$b5,$62,$a,37,$3d,$5a,$a,34,$df,$e6,$e,19,$26,$d6,0,0 + +; 226 + dc.w 18993,1 + dc.w 8,185,179,174,205,122,319 + dc.w 13,190,179,213,200,179,312 + ; Darkfill (5 passes, 287 height) + dc.b $e,172,$df,$d6,$a,32,$48,$9e,$a,32,$70,$a2,$a,32,$98,$a6,$a,19,$20,$9a,0,0 + ; Brightfill (6 passes, 310 height) + dc.b $e,132,$df,$da,$a,48,$76,$de,$a,47,$b1,$a2,$a,37,$df,$e6,$a,35,$3a,$da,$e,11,$1c,$d6,0,0 + +; 227 + dc.w 18845,1 + dc.w 8,186,179,176,206,121,319 + dc.w 13,191,179,216,201,179,316 + ; Darkfill (5 passes, 286 height) + dc.b $e,172,$df,$d6,$a,32,$47,$5e,$a,32,$6f,$62,$a,32,$97,$66,$a,18,$1f,$5a,0,0 + ; Brightfill (6 passes, 305 height) + dc.b $e,134,$df,$da,$a,46,$71,$de,$a,46,$ab,$62,$a,42,$df,$e6,$a,33,$38,$5a,$e,4,$14,$16,0,0 + +; 228 + dc.w 18887,1 + dc.w 7,187,179,179,207,119,319 + dc.w 12,192,179,218,202,179,319 + ; Darkfill (5 passes, 286 height) + dc.b $e,173,$df,$d6,$a,32,$44,$de,$a,32,$6c,$e2,$a,32,$94,$e6,$a,17,$1c,$da,0,0 + ; Brightfill (5 passes, 305 height) + dc.b $e,137,$df,$da,$a,46,$6e,$1e,$a,46,$a7,$a2,$a,45,$df,$e6,$a,31,$34,$9a,0,0 + +; 229 + dc.w 18745,1 + dc.w 7,187,179,180,207,119,319 + dc.w 12,192,179,220,202,177,319 + ; Darkfill (5 passes, 286 height) + dc.b $e,173,$df,$d6,$a,32,$44,$de,$a,32,$6c,$e2,$a,32,$94,$e6,$a,17,$1c,$da,0,0 + ; Brightfill (5 passes, 303 height) + dc.b $e,137,$df,$da,$a,45,$6c,$de,$a,45,$a5,$22,$a,45,$dd,$66,$a,31,$34,$9a,0,0 + +; 230 + dc.w 18656,1 + dc.w 7,188,179,182,208,118,319 + dc.w 12,193,179,221,203,173,319 + ; Darkfill (5 passes, 285 height) + dc.b $e,173,$df,$d6,$a,32,$43,$9e,$a,32,$6b,$a2,$a,32,$93,$a6,$a,16,$1b,$9a,0,0 + ; Brightfill (5 passes, 301 height) + dc.b $e,139,$df,$da,$a,45,$a1,$62,$a,44,$69,$1e,$a,44,$d8,$66,$a,29,$32,$1a,0,0 + +; 231 + dc.w 18647,1 + dc.w 7,189,179,184,209,117,319 + dc.w 12,194,179,224,204,169,319 + ; Darkfill (5 passes, 284 height) + dc.b $e,173,$df,$d6,$a,32,$42,$5e,$a,32,$6a,$62,$a,32,$92,$66,$a,15,$1a,$5a,0,0 + ; Brightfill (6 passes, 299 height) + dc.b $e,138,$dc,$1a,$a,44,$66,$9e,$a,44,$d3,$66,$a,43,$9c,$62,$a,27,$2f,$9a,$e,3,$df,$de,0,0 + +; 232 + dc.w 18711,1 + dc.w 6,189,179,186,209,116,319 + dc.w 11,194,179,226,204,166,319 + ; Darkfill (5 passes, 285 height) + dc.b $e,174,$df,$d6,$a,32,$41,$1e,$a,32,$69,$22,$a,32,$91,$26,$a,15,$19,$1a,0,0 + ; Brightfill (6 passes, 298 height) + dc.b $e,128,$ce,$5a,$a,43,$64,$1e,$a,43,$99,$e2,$a,43,$cf,$a6,$a,27,$2e,$5a,$e,14,$df,$de,0,0 + +; 233 + dc.w 18607,1 + dc.w 6,190,179,188,210,115,319 + dc.w 11,195,179,227,205,162,319 + ; Darkfill (5 passes, 284 height) + dc.b $e,174,$df,$d6,$a,32,$3f,$de,$a,32,$67,$e2,$a,32,$8f,$e6,$a,14,$17,$da,0,0 + ; Brightfill (6 passes, 296 height) + dc.b $e,125,$c8,$1a,$a,43,$96,$22,$a,42,$60,$5e,$a,42,$ca,$a6,$a,25,$2b,$da,$e,19,$df,$de,0,0 + +; 234 + dc.w 18466,1 + dc.w 6,190,179,189,210,115,319 + dc.w 11,195,179,229,205,160,319 + ; Darkfill (5 passes, 284 height) + dc.b $e,174,$df,$d6,$a,32,$3f,$de,$a,32,$67,$e2,$a,32,$8f,$e6,$a,14,$17,$da,0,0 + ; Brightfill (6 passes, 294 height) + dc.b $e,116,$bc,$da,$a,42,$60,$5e,$a,42,$c8,$26,$a,41,$93,$a2,$e,28,$df,$de,$a,25,$2b,$da,0,0 + +; 235 + dc.w 18431,1 + dc.w 6,191,179,192,211,114,319 + dc.w 11,196,179,231,206,158,319 + ; Darkfill (6 passes, 283 height) + dc.b $e,87,$73,$16,$e,87,$df,$da,$a,32,$3e,$9e,$a,32,$66,$a2,$a,32,$8e,$a6,$a,13,$16,$9a,0,0 + ; Brightfill (6 passes, 294 height) + dc.b $e,109,$b1,$9a,$a,42,$5d,$de,$a,42,$92,$62,$a,41,$c5,$a6,$e,37,$df,$de,$a,23,$29,$5a,0,0 + +; 236 + dc.w 18342,1 + dc.w 5,191,179,193,211,113,319 + dc.w 10,196,179,232,206,154,319 + ; Darkfill (6 passes, 284 height) + dc.b $e,131,$df,$da,$e,44,$3c,$16,$a,32,$3d,$5e,$a,32,$65,$62,$a,32,$8d,$66,$a,13,$15,$5a,0,0 + ; Brightfill (6 passes, 292 height) + dc.b $e,107,$ad,$da,$a,41,$5b,$5e,$a,41,$c0,$a6,$e,40,$df,$de,$a,40,$8d,$62,$a,23,$28,$1a,0,0 + +; 237 + dc.w 17213,1 + dc.w 5,192,179,195,212,112,319 + dc.w 10,197,179,234,207,152,319 + ; Darkfill (5 passes, 271 height) + dc.b $e,163,$df,$da,$a,32,$3c,$1e,$a,32,$64,$22,$a,32,$8c,$26,$a,12,$14,$1a,0,0 + ; Brightfill (6 passes, 292 height) + dc.b $e,101,$a3,$da,$e,48,$df,$de,$a,41,$58,$de,$a,41,$8c,$22,$a,40,$be,$26,$a,21,$25,$9a,0,0 + +; 238 + dc.w 16664,1 + dc.w 5,192,179,196,212,112,319 + dc.w 10,197,179,235,207,150,319 + ; Darkfill (5 passes, 271 height) + dc.b $e,163,$df,$da,$a,32,$3c,$1e,$a,32,$64,$22,$a,32,$8c,$26,$a,12,$14,$1a,0,0 + ; Brightfill (6 passes, 290 height) + dc.b $e,97,$9e,$da,$e,52,$df,$de,$a,40,$57,$9e,$a,40,$89,$a2,$a,40,$bb,$a6,$a,21,$25,$9a,0,0 + +; 239 + dc.w 16202,1 + dc.w 5,193,179,198,213,111,319 + dc.w 10,198,179,236,208,147,319 + ; Darkfill (5 passes, 271 height) + dc.b $e,164,$df,$da,$a,32,$3a,$de,$a,32,$62,$e2,$a,32,$8a,$e6,$a,11,$12,$da,0,0 + ; Brightfill (6 passes, 288 height) + dc.b $e,94,$99,$da,$e,56,$df,$de,$a,40,$87,$22,$a,39,$55,$1e,$a,39,$b7,$e6,$a,20,$24,$5a,0,0 + +; 240 + dc.w 16305,1 + dc.w 4,193,179,198,213,110,319 + dc.w 9,198,179,238,208,145,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,165,$df,$da,$a,32,$39,$9e,$a,32,$61,$a2,$a,32,$89,$a6,$a,11,$11,$9a,0,0 + ; Brightfill (6 passes, 289 height) + dc.b $e,90,$92,$5a,$e,62,$df,$de,$a,40,$53,$de,$a,39,$84,$a2,$a,39,$b5,$66,$a,19,$21,$da,0,0 + +; 241 + dc.w 16283,1 + dc.w 4,194,179,200,214,109,319 + dc.w 9,199,179,239,209,143,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,166,$df,$da,$a,32,$38,$5e,$a,32,$60,$62,$a,32,$88,$66,$a,10,$10,$5a,0,0 + ; Brightfill (6 passes, 288 height) + dc.b $e,87,$8d,$5a,$e,66,$df,$de,$a,39,$51,$5e,$a,39,$82,$22,$a,39,$b2,$e6,$a,18,$20,$9a,0,0 + +; 242 + dc.w 16212,1 + dc.w 4,194,179,201,214,109,319 + dc.w 9,199,179,240,209,141,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,166,$df,$da,$a,32,$38,$5e,$a,32,$60,$62,$a,32,$88,$66,$a,10,$10,$5a,0,0 + ; Brightfill (6 passes, 286 height) + dc.b $e,84,$89,$9a,$e,69,$df,$de,$a,39,$80,$e2,$a,38,$50,$1e,$a,38,$b0,$66,$a,18,$20,$9a,0,0 + +; 243 + dc.w 16141,1 + dc.w 4,194,179,202,214,109,319 + dc.w 9,199,179,241,209,140,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,166,$df,$da,$a,32,$38,$5e,$a,32,$60,$62,$a,32,$88,$66,$a,10,$10,$5a,0,0 + ; Brightfill (6 passes, 285 height) + dc.b $e,82,$87,$1a,$e,71,$df,$de,$a,38,$50,$1e,$a,38,$7f,$a2,$a,38,$af,$26,$a,18,$20,$9a,0,0 + +; 244 + dc.w 16178,1 + dc.w 4,195,179,203,215,108,319 + dc.w 9,200,179,242,210,138,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,167,$df,$da,$a,32,$37,$1e,$a,32,$5f,$22,$a,32,$87,$26,$a,9,$0f,$1a,0,0 + ; Brightfill (6 passes, 285 height) + dc.b $e,80,$82,$1a,$e,75,$df,$de,$a,38,$4d,$9e,$a,38,$7d,$22,$a,38,$ac,$a6,$a,16,$1e,$1a,0,0 + +; 245 + dc.w 16169,1 + dc.w 4,195,179,204,215,108,319 + dc.w 9,200,179,243,210,137,319 + ; Darkfill (5 passes, 272 height) + dc.b $e,167,$df,$da,$a,32,$37,$1e,$a,32,$5f,$22,$a,32,$87,$26,$a,9,$0f,$1a,0,0 + ; Brightfill (6 passes, 284 height) + dc.b $e,78,$df,$de,$e,77,$7e,$5a,$a,38,$4d,$9e,$a,38,$7d,$22,$a,37,$ab,$66,$a,16,$1e,$1a,0,0 + +; 246 + dc.w 16210,1 + dc.w 3,195,179,205,215,107,319 + dc.w 8,200,179,244,210,136,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,168,$df,$da,$a,32,$35,$de,$a,32,$5d,$e2,$a,32,$85,$e6,$a,9,$0d,$da,0,0 + ; Brightfill (6 passes, 285 height) + dc.b $e,80,$df,$de,$e,76,$7b,$da,$a,38,$4c,$5e,$a,38,$7b,$e2,$a,37,$aa,$26,$a,16,$1c,$da,0,0 + +; 247 + dc.w 16262,1 + dc.w 3,196,179,206,216,107,319 + dc.w 8,201,179,245,211,134,319 + ; Darkfill (5 passes, 274 height) + dc.b $e,169,$df,$da,$a,33,$5d,$e2,$a,32,$34,$9e,$a,32,$85,$e6,$a,8,$0c,$9a,0,0 + ; Brightfill (6 passes, 284 height) + dc.b $e,84,$df,$de,$e,73,$76,$da,$a,38,$79,$62,$a,37,$49,$de,$a,37,$a7,$a6,$a,15,$1b,$9a,0,0 + +; 248 + dc.w 16200,1 + dc.w 3,196,179,206,216,106,319 + dc.w 8,201,179,246,211,132,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,169,$df,$da,$a,32,$34,$9e,$a,32,$5c,$a2,$a,32,$84,$a6,$a,8,$0c,$9a,0,0 + ; Brightfill (6 passes, 282 height) + dc.b $e,86,$df,$de,$e,71,$74,$5a,$a,37,$49,$de,$a,37,$a5,$26,$a,36,$76,$e2,$a,15,$1b,$9a,0,0 + +; 249 + dc.w 16128,1 + dc.w 3,196,179,207,216,106,319 + dc.w 8,201,179,246,211,132,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,169,$df,$da,$a,32,$34,$9e,$a,32,$5c,$a2,$a,32,$84,$a6,$a,8,$0c,$9a,0,0 + ; Brightfill (6 passes, 282 height) + dc.b $e,86,$df,$de,$e,71,$74,$5a,$a,37,$49,$de,$a,37,$a5,$26,$a,36,$76,$e2,$a,15,$1b,$9a,0,0 + +; 250 + dc.w 16106,1 + dc.w 3,196,179,207,216,106,319 + dc.w 8,201,179,247,211,132,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,169,$df,$da,$a,32,$34,$9e,$a,32,$5c,$a2,$a,32,$84,$a6,$a,8,$0c,$9a,0,0 + ; Brightfill (6 passes, 282 height) + dc.b $e,88,$df,$de,$e,69,$71,$da,$a,37,$49,$de,$a,37,$a5,$26,$a,36,$76,$e2,$a,15,$1b,$9a,0,0 + +; 251 + dc.w 16081,1 + dc.w 3,196,179,208,216,106,319 + dc.w 8,201,179,247,211,131,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,169,$df,$da,$a,32,$34,$9e,$a,32,$5c,$a2,$a,32,$84,$a6,$a,8,$0c,$9a,0,0 + ; Brightfill (6 passes, 281 height) + dc.b $e,88,$df,$de,$e,69,$71,$da,$a,37,$76,$e2,$a,36,$48,$9e,$a,36,$a3,$e6,$a,15,$1b,$9a,0,0 + +; 252 + dc.w 16107,1 + dc.w 3,196,179,208,216,106,319 + dc.w 8,201,179,248,211,131,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,169,$df,$da,$a,32,$34,$9e,$a,32,$5c,$a2,$a,32,$84,$a6,$a,8,$0c,$9a,0,0 + ; Brightfill (6 passes, 281 height) + dc.b $e,90,$df,$de,$e,67,$6f,$5a,$a,37,$76,$e2,$a,36,$48,$9e,$a,36,$a3,$e6,$a,15,$1b,$9a,0,0 + +; 253 + dc.w 16147,1 + dc.w 3,197,179,209,217,106,319 + dc.w 8,202,179,248,212,130,319 + ; Darkfill (5 passes, 274 height) + dc.b $e,170,$df,$da,$a,33,$5c,$a2,$a,32,$33,$5e,$a,32,$84,$a6,$a,7,$0b,$5a,0,0 + ; Brightfill (6 passes, 281 height) + dc.b $e,92,$df,$de,$e,66,$6c,$da,$a,37,$75,$a2,$a,36,$47,$5e,$a,36,$a2,$a6,$a,14,$1a,$5a,0,0 + +; 254 + dc.w 16120,1 + dc.w 3,197,179,209,217,105,319 + dc.w 8,202,179,248,212,129,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,170,$df,$da,$a,32,$33,$5e,$a,32,$5b,$62,$a,32,$83,$66,$a,7,$0b,$5a,0,0 + ; Brightfill (6 passes, 280 height) + dc.b $e,92,$df,$de,$e,66,$6c,$da,$a,36,$47,$5e,$a,36,$74,$62,$a,36,$a1,$66,$a,14,$1a,$5a,0,0 + +; 255 + dc.w 16097,1 + dc.w 3,197,179,209,217,105,319 + dc.w 8,202,179,249,212,129,319 + ; Darkfill (5 passes, 273 height) + dc.b $e,170,$df,$da,$a,32,$33,$5e,$a,32,$5b,$62,$a,32,$83,$66,$a,7,$0b,$5a,0,0 + ; Brightfill (6 passes, 280 height) + dc.b $e,93,$df,$de,$e,65,$6b,$9a,$a,36,$47,$5e,$a,36,$74,$62,$a,36,$a1,$66,$a,14,$1a,$5a,0,0 + +; 288 + dc.w 19136,2 + dc.w 9,184,179,170,204,128,319 + dc.w 14,189,179,209,199,179,307 + ; Darkfill (5 passes, 291 height) + dc.b $e,171,$df,$d6,$a,33,$4d,$9e,$a,33,$76,$e2,$a,33,$a0,$26,$a,21,$24,$5a,0,0 + ; Brightfill (6 passes, 315 height) + dc.b $e,128,$df,$da,$a,49,$7d,$1e,$a,49,$ba,$62,$a,38,$3f,$da,$a,30,$df,$e6,$e,21,$2a,$96,0,0 + +; 289 + dc.w 19338,1 + dc.w 9,183,179,164,203,127,319 + dc.w 13,188,179,205,198,179,307 + ; Darkfill (5 passes, 290 height) + dc.b $e,171,$df,$d6,$a,33,$4d,$9e,$a,33,$9e,$e6,$a,32,$75,$a2,$a,21,$24,$5a,0,0 + ; Brightfill (6 passes, 330 height) + dc.b $e,128,$df,$da,$a,49,$7d,$1e,$a,49,$ba,$62,$a,39,$3f,$da,$e,35,$3a,$d6,$a,30,$df,$e6,0,0 + +; 290 + dc.w 19420,2 + dc.w 9,182,179,158,202,126,319 + dc.w 12,187,179,199,197,179,307 + ; Darkfill (6 passes, 289 height) + dc.b $e,160,$d2,$16,$a,32,$4d,$9e,$a,32,$75,$a2,$a,32,$9d,$a6,$a,22,$25,$9a,$e,11,$df,$d2,0,0 + ; Brightfill (6 passes, 336 height) + dc.b $e,105,$df,$da,$e,63,$5c,$96,$a,49,$ba,$62,$a,48,$7d,$1e,$a,41,$41,$1a,$a,30,$df,$e6,0,0 + +; 291 + dc.w 19784,2 + dc.w 10,180,179,151,202,127,319 + dc.w 12,186,179,195,196,179,307 + ; Darkfill (6 passes, 288 height) + dc.b $e,120,$a1,$56,$e,50,$df,$d2,$a,32,$4e,$de,$a,32,$76,$e2,$a,32,$9e,$e6,$a,22,$26,$da,0,0 + ; Brightfill (6 passes, 336 height) + dc.b $e,103,$8e,$96,$e,65,$df,$da,$a,48,$7e,$5e,$a,48,$ba,$62,$a,42,$42,$5a,$a,30,$df,$e6,0,0 + +; 292 + dc.w 19916,2 + dc.w 10,178,179,145,202,127,319 + dc.w 11,184,179,189,196,179,308 + ; Darkfill (6 passes, 288 height) + dc.b $e,95,$82,$16,$e,75,$df,$d2,$a,32,$4e,$de,$a,32,$76,$e2,$a,32,$9e,$e6,$a,22,$26,$da,0,0 + ; Brightfill (5 passes, 338 height) + dc.b $e,169,$df,$d6,$a,48,$7d,$1e,$a,48,$b9,$22,$a,42,$41,$1a,$a,31,$df,$e6,0,0 + +; 293 + dc.w 20487,2 + dc.w 10,176,179,137,202,127,319 + dc.w 10,183,179,185,195,179,308 + ; Darkfill (6 passes, 288 height) + dc.b $e,98,$df,$d2,$e,72,$65,$56,$a,32,$4e,$de,$a,32,$76,$e2,$a,32,$9e,$e6,$a,22,$26,$da,0,0 + ; Brightfill (5 passes, 340 height) + dc.b $e,170,$df,$d6,$a,48,$7d,$1e,$a,48,$b9,$22,$a,43,$41,$1a,$a,31,$df,$e6,0,0 + +; 294 + dc.w 19328,2 + dc.w 9,174,179,130,202,126,319 + dc.w 9,181,179,178,195,179,310 + ; Darkfill (6 passes, 289 height) + dc.b $e,114,$df,$d2,$e,57,$51,$56,$a,32,$4d,$9e,$a,32,$75,$a2,$a,32,$9d,$a6,$a,22,$25,$9a,0,0 + ; Brightfill (5 passes, 342 height) + dc.b $e,171,$df,$d6,$a,47,$7a,$9e,$a,47,$b5,$62,$a,43,$3f,$da,$a,34,$df,$e6,0,0 + +; 295 + dc.w 19812,2 + dc.w 9,171,179,122,203,125,319 + dc.w 9,179,179,172,195,179,311 + ; Darkfill (7 passes, 288 height) + dc.b $e,111,$c6,$d2,$e,40,$3c,$16,$a,32,$4c,$5e,$a,32,$74,$62,$a,32,$9c,$66,$a,21,$24,$5a,$e,20,$df,$ce,0,0 + ; Brightfill (5 passes, 342 height) + dc.b $e,171,$df,$d6,$a,47,$79,$5e,$a,47,$b4,$22,$a,42,$3e,$9a,$a,35,$df,$e6,0,0 + +; 296 + dc.w 20351,2 + dc.w 8,168,179,113,204,123,319 + dc.w 8,177,179,167,195,179,312 + ; Darkfill (7 passes, 288 height) + dc.b $e,99,$a6,$52,$e,46,$df,$ce,$a,32,$49,$de,$a,32,$71,$e2,$a,32,$99,$e6,$e,27,$2a,$96,$a,20,$21,$da,0,0 + ; Brightfill (5 passes, 344 height) + dc.b $e,172,$df,$d6,$a,47,$78,$1e,$a,47,$b2,$e2,$a,42,$3d,$5a,$a,36,$df,$e6,0,0 + +; 297 + dc.w 20615,2 + dc.w 7,165,179,105,205,121,319 + dc.w 7,175,179,161,195,179,313 + ; Darkfill (7 passes, 288 height) + dc.b $e,92,$8e,$92,$e,65,$df,$ce,$a,32,$47,$5e,$a,32,$6f,$62,$a,32,$97,$66,$a,19,$1f,$5a,$e,16,$1b,$96,0,0 + ; Brightfill (5 passes, 346 height) + dc.b $e,173,$df,$d6,$a,47,$76,$de,$a,46,$b0,$62,$a,42,$3c,$1a,$a,38,$df,$e6,0,0 + +; 298 + dc.w 21198,2 + dc.w 6,162,179,96,206,119,319 + dc.w 6,173,179,156,195,179,315 + ; Darkfill (7 passes, 288 height) + dc.b $e,84,$78,$12,$e,83,$df,$ce,$a,32,$44,$de,$a,32,$6c,$e2,$a,32,$94,$e6,$a,18,$1c,$da,$e,7,$0f,$16,0,0 + ; Brightfill (6 passes, 348 height) + dc.b $e,138,$b2,$d6,$a,46,$74,$5e,$a,46,$ad,$e2,$a,42,$3a,$da,$a,40,$df,$e6,$e,36,$df,$d2,0,0 + +; 299 + dc.w 21844,2 + dc.w 6,158,179,87,208,117,319 + dc.w 6,171,179,150,195,179,317 + ; Darkfill (7 passes, 286 height) + dc.b $e,78,$c5,$8e,$e,75,$64,$12,$a,32,$42,$5e,$a,32,$6a,$62,$a,32,$92,$66,$e,21,$df,$ca,$a,16,$1a,$5a,0,0 + ; Brightfill (6 passes, 348 height) + dc.b $e,95,$7d,$16,$e,79,$df,$d2,$a,46,$ab,$62,$a,45,$71,$de,$a,42,$df,$e6,$a,41,$39,$9a,0,0 + +; 300 + dc.w 21988,2 + dc.w 5,155,179,77,211,113,319 + dc.w 5,169,179,143,197,179,319 + ; Darkfill (7 passes, 284 height) + dc.b $e,71,$ab,$4e,$e,62,$52,$92,$e,42,$df,$ca,$a,32,$3d,$5e,$a,32,$65,$62,$a,32,$8d,$66,$a,13,$15,$5a,0,0 + ; Brightfill (6 passes, 350 height) + dc.b $e,111,$df,$d2,$e,64,$55,$16,$a,46,$6e,$1e,$a,46,$a7,$a2,$a,45,$df,$e6,$a,38,$34,$9a,0,0 + +; 301 + dc.w 21682,2 + dc.w 4,151,179,67,213,111,319 + dc.w 4,167,179,138,197,177,319 + ; Darkfill (7 passes, 284 height) + dc.b $e,67,$94,$ce,$e,60,$df,$ca,$e,49,$41,$12,$a,33,$62,$e2,$a,32,$39,$9e,$a,32,$8a,$e6,$a,11,$11,$9a,0,0 + ; Brightfill (6 passes, 350 height) + dc.b $e,130,$df,$d2,$e,46,$3d,$56,$a,46,$a5,$22,$a,45,$6b,$9e,$a,45,$dd,$66,$a,38,$33,$5a,0,0 + +; 302 + dc.w 21458,2 + dc.w 3,147,179,57,215,108,319 + dc.w 3,164,179,131,198,173,319 + ; Darkfill (8 passes, 283 height) + dc.b $e,63,$cf,$8a,$e,62,$80,$ce,$e,39,$33,$52,$a,33,$5f,$22,$a,32,$35,$de,$a,32,$87,$26,$e,13,$df,$c6,$a,9,$0d,$da,0,0 + ; Brightfill (6 passes, 348 height) + dc.b $e,153,$df,$d2,$a,45,$67,$de,$a,45,$a0,$22,$a,45,$d8,$66,$a,36,$2f,$9a,$e,24,$20,$96,0,0 + +; 303 + dc.w 21834,2 + dc.w 2,142,179,45,218,104,319 + dc.w 2,161,179,124,199,168,319 + ; Darkfill (8 passes, 281 height) + dc.b $e,59,$b5,$4a,$e,58,$6b,$8e,$e,34,$df,$c6,$a,33,$5a,$22,$a,32,$30,$de,$a,32,$82,$26,$e,27,$23,$12,$a,6,$08,$da,0,0 + ; Brightfill (7 passes, 345 height) + dc.b $e,153,$ca,$92,$a,45,$64,$1e,$a,44,$9b,$22,$a,44,$d2,$26,$a,34,$2b,$da,$e,17,$df,$ce,$e,8,$0b,$56,0,0 + +; 304 + dc.w 21858,2 + dc.w 2,137,179,34,221,100,319 + dc.w 2,158,179,117,200,166,319 + ; Darkfill (8 passes, 277 height) + dc.b $e,55,$a0,$0a,$e,55,$5b,$4e,$e,51,$df,$c6,$a,32,$2d,$1e,$a,32,$55,$22,$a,32,$7d,$26,$e,17,$16,$92,$a,3,$05,$1a,0,0 + ; Brightfill (6 passes, 343 height) + dc.b $e,132,$a6,$52,$e,46,$df,$ce,$a,44,$61,$9e,$a,44,$98,$a2,$a,44,$cf,$a6,$a,33,$2a,$9a,0,0 + +; 305 + dc.w 21769,2 + dc.w 1,133,179,23,225,95,319 + dc.w 1,156,179,110,202,160,319 + ; Darkfill (8 passes, 274 height) + dc.b $e,52,$ce,$46,$e,52,$8d,$4a,$e,52,$4c,$4e,$a,32,$4e,$e2,$a,32,$76,$e6,$a,31,$26,$de,$e,14,$df,$c2,$e,9,$0b,$52,0,0 + ; Brightfill (6 passes, 339 height) + dc.b $e,111,$8a,$d2,$e,68,$df,$ce,$a,44,$92,$62,$a,43,$5b,$5e,$a,43,$c8,$26,$a,30,$25,$9a,0,0 + +; 306 + dc.w 21770,2 + dc.w 0,128,179,12,228,91,319 + dc.w 0,153,179,104,203,158,319 + ; Darkfill (8 passes, 272 height) + dc.b $e,50,$3e,$8e,$e,49,$b9,$06,$e,49,$7b,$ca,$a,32,$49,$e2,$a,32,$71,$e6,$e,31,$df,$c2,$a,28,$21,$de,$e,1,$00,$12,0,0 + ; Brightfill (6 passes, 339 height) + dc.b $e,94,$74,$52,$e,86,$df,$ce,$a,44,$58,$de,$a,44,$8f,$e2,$a,43,$c5,$a6,$a,28,$21,$da,0,0 + +; 307 + dc.w 21283,2 + dc.w 0,122,179,4,232,87,319 + dc.w 0,150,179,97,204,154,319 + ; Darkfill (7 passes, 268 height) + dc.b $e,49,$ab,$46,$e,48,$6e,$0a,$e,42,$df,$c2,$e,41,$32,$0e,$a,32,$44,$e2,$a,32,$6c,$e6,$a,24,$1c,$de,0,0 + ; Brightfill (6 passes, 335 height) + dc.b $e,104,$df,$ce,$e,76,$5d,$d2,$a,43,$8a,$e2,$a,43,$c0,$a6,$a,42,$55,$1e,$a,27,$20,$9a,0,0 + +; 308 + dc.w 21096,2 + dc.w 0,116,174,0,236,83,319 + dc.w 0,146,179,89,206,149,319 + ; Darkfill (7 passes, 259 height) + dc.b $e,48,$d9,$82,$e,48,$9d,$86,$e,48,$61,$8a,$a,32,$3f,$e2,$a,32,$67,$e6,$e,31,$25,$8e,$a,20,$17,$de,0,0 + ; Brightfill (7 passes, 330 height) + dc.b $e,100,$c5,$8e,$e,59,$48,$92,$a,42,$51,$5e,$a,42,$85,$e2,$a,42,$ba,$66,$a,24,$1c,$da,$e,21,$df,$ca,0,0 + +; 309 + dc.w 20758,2 + dc.w 0,111,163,0,241,78,319 + dc.w 0,144,179,83,208,147,319 + ; Darkfill (7 passes, 243 height) + dc.b $e,47,$cb,$c2,$e,47,$91,$06,$e,47,$56,$4a,$a,32,$39,$a2,$a,32,$61,$a6,$e,23,$1b,$8e,$a,15,$11,$9e,0,0 + ; Brightfill (7 passes, 328 height) + dc.b $e,94,$b1,$8e,$e,49,$3c,$12,$a,43,$83,$62,$a,42,$4d,$9e,$a,42,$b7,$e6,$e,37,$df,$ca,$a,21,$19,$1a,0,0 + +; 310 + dc.w 20160,2 + dc.w 0,105,153,0,245,74,319 + dc.w 0,140,179,75,210,141,319 + ; Darkfill (7 passes, 229 height) + dc.b $e,47,$85,$c6,$e,47,$4b,$0a,$e,46,$bf,$42,$a,32,$34,$a2,$a,32,$5c,$a6,$e,14,$10,$4e,$a,11,$0c,$9e,0,0 + ; Brightfill (7 passes, 322 height) + dc.b $e,88,$98,$8e,$e,57,$df,$ca,$a,42,$7d,$22,$a,41,$48,$9e,$a,41,$b0,$66,$e,35,$2a,$92,$a,18,$15,$5a,0,0 + +; 311 + dc.w 19717,2 + dc.w 0,98,140,0,250,69,319 + dc.w 0,136,179,67,212,137,319 + ; Darkfill (7 passes, 211 height) + dc.b $e,46,$af,$02,$e,46,$3d,$4a,$e,45,$75,$86,$a,32,$2e,$62,$a,32,$56,$66,$a,6,$06,$5e,$e,4,$03,$ce,0,0 + ; Brightfill (7 passes, 318 height) + dc.b $e,83,$83,$4e,$e,74,$df,$ca,$a,41,$44,$de,$a,41,$78,$22,$a,41,$ab,$66,$e,23,$1b,$92,$a,15,$11,$9a,0,0 + +; 312 + dc.w 19113,2 + dc.w 0,91,129,0,255,64,319 + dc.w 0,132,179,59,214,133,319 + ; Darkfill (6 passes, 195 height) + dc.b $e,46,$69,$06,$e,45,$a1,$42,$e,39,$2f,$8a,$a,32,$28,$22,$a,32,$50,$26,$a,1,$00,$1e,0,0 + ; Brightfill (8 passes, 314 height) + dc.b $e,78,$d0,$ca,$e,78,$6f,$4e,$a,41,$74,$62,$a,40,$41,$1e,$a,40,$a6,$66,$a,13,$0f,$1a,$e,12,$df,$c6,$e,12,$0d,$d2,0,0 + +; 313 + dc.w 18390,2 + dc.w 0,85,118,0,261,58,319 + dc.w 0,129,179,52,217,128,319 + ; Darkfill (5 passes, 178 height) + dc.b $e,45,$5c,$86,$e,44,$93,$82,$a,32,$48,$a6,$e,30,$24,$4a,$a,27,$20,$a2,0,0 + ; Brightfill (8 passes, 309 height) + dc.b $e,75,$be,$0a,$e,74,$60,$4e,$a,40,$3c,$1e,$a,40,$6e,$22,$a,40,$a0,$26,$e,27,$df,$c6,$a,9,$0a,$1a,$e,4,$03,$d2,0,0 + +; 314 + dc.w 17675,2 + dc.w 0,78,107,0,266,53,319 + dc.w 0,125,179,43,219,124,319 + ; Darkfill (5 passes, 162 height) + dc.b $e,44,$85,$c2,$e,44,$4e,$c6,$a,32,$42,$66,$a,22,$1a,$62,$e,20,$17,$ca,0,0 + ; Brightfill (7 passes, 305 height) + dc.b $e,70,$a7,$8a,$e,65,$50,$0e,$e,45,$df,$c6,$a,40,$38,$5e,$a,40,$9b,$26,$a,39,$69,$22,$a,6,$06,$5a,0,0 + +; 315 + dc.w 16856,2 + dc.w 0,70,95,0,272,47,319 + dc.w 0,121,179,36,221,120,319 + ; Darkfill (5 passes, 144 height) + dc.b $e,44,$41,$06,$e,43,$76,$c2,$a,32,$3a,$e6,$a,16,$12,$e2,$e,9,$0a,$0a,0,0 + ; Brightfill (7 passes, 301 height) + dc.b $e,68,$97,$4a,$e,58,$df,$c6,$e,54,$42,$4e,$a,39,$34,$9e,$a,39,$65,$62,$a,39,$96,$26,$a,4,$03,$da,0,0 + +; 316 + dc.w 16235,2 + dc.w 0,63,85,0,279,40,319 + dc.w 0,117,179,28,225,114,319 + ; Darkfill (4 passes, 127 height) + dc.b $e,43,$6a,$42,$e,43,$34,$86,$a,32,$32,$26,$a,9,$0a,$22,0,0 + ; Brightfill (7 passes, 295 height) + dc.b $e,64,$d5,$c6,$e,64,$85,$ca,$e,44,$35,$ce,$a,39,$5d,$e2,$a,39,$8e,$a6,$a,37,$2d,$1e,$e,8,$df,$c2,0,0 + +; 317 + dc.w 15586,2 + dc.w 0,55,73,0,285,34,319 + dc.w 0,113,179,20,227,110,319 + ; Darkfill (4 passes, 109 height) + dc.b $e,42,$5b,$42,$e,32,$26,$c6,$a,32,$2a,$a6,$a,3,$02,$a2,0,0 + ; Brightfill (7 passes, 291 height) + dc.b $e,62,$76,$ca,$e,61,$c3,$06,$a,38,$5a,$22,$a,38,$89,$a6,$a,35,$2a,$9e,$e,34,$29,$4e,$e,23,$df,$c2,0,0 + +; 318 + dc.w 14751,2 + dc.w 0,48,63,0,292,27,319 + dc.w 0,109,179,11,231,104,319 + ; Darkfill (3 passes, 92 height) + dc.b $e,42,$4e,$c2,$a,28,$21,$e6,$e,22,$1a,$46,0,0 + ; Brightfill (7 passes, 285 height) + dc.b $e,59,$67,$ca,$e,58,$b0,$46,$e,38,$df,$c2,$a,38,$52,$a2,$a,38,$82,$26,$a,29,$23,$1e,$e,25,$1e,$0e,0,0 + +; 319 + dc.w 13978,2 + dc.w 0,39,50,0,299,20,319 + dc.w 0,104,179,3,234,99,319 + ; Darkfill (3 passes, 72 height) + dc.b $e,41,$3e,$82,$a,21,$19,$26,$e,10,$0b,$46,0,0 + ; Brightfill (7 passes, 280 height) + dc.b $e,57,$a0,$06,$e,56,$58,$ca,$e,51,$df,$c2,$a,37,$4d,$a2,$a,37,$7b,$e6,$a,26,$1f,$5e,$e,16,$12,$ce,0,0 + +; 320 + dc.w 12924,2 + dc.w 0,31,40,0,307,12,319 + dc.w 0,100,169,0,238,93,319 + ; Darkfill (2 passes, 54 height) + dc.b $e,41,$32,$02,$a,13,$0f,$26,0,0 + ; Brightfill (7 passes, 264 height) + dc.b $e,54,$d3,$42,$e,54,$8f,$c6,$e,54,$4c,$4a,$a,37,$74,$66,$a,36,$46,$22,$a,21,$19,$1e,$e,8,$08,$ce,0,0 + +; 321 + dc.w 11697,2 + dc.w 0,22,28,0,314,5,319 + dc.w 0,95,155,0,241,88,319 + ; Darkfill (2 passes, 35 height) + dc.b $e,29,$23,$02,$a,6,$06,$66,0,0 + ; Brightfill (6 passes, 245 height) + dc.b $e,52,$c1,$c2,$e,52,$80,$c6,$e,52,$3f,$ca,$a,36,$41,$22,$a,36,$6e,$26,$a,17,$14,$1e,0,0 + +; 322 + dc.w 10332,2 + dc.w 0,13,17,0,321,-1,319 + dc.w 0,90,141,0,244,84,319 + ; Darkfill (1 passes, 18 height) + dc.b $e,18,$15,$42,0,0 + ; Brightfill (6 passes, 227 height) + dc.b $e,50,$b0,$42,$e,50,$71,$c6,$e,42,$33,$4a,$a,36,$3c,$22,$a,36,$69,$26,$a,13,$0f,$1e,0,0 + +; 323 + dc.w 9127,2 + dc.w 0,4,5,0,330,-10,319 + dc.w 0,86,130,0,248,78,319 + ; Darkfill (1 passes, 6 height) + dc.b $e,6,$06,$42,0,0 + ; Brightfill (6 passes, 210 height) + dc.b $e,48,$a2,$82,$e,48,$66,$86,$e,35,$2a,$8a,$a,35,$35,$e2,$a,35,$61,$a6,$a,9,$0a,$1e,0,0 + +; 324 + dc.w 8202,2 + dc.w 0,-5,-6,0,338,-18,319 + dc.w 0,80,116,0,252,73,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (6 passes, 191 height) + dc.b $e,47,$57,$86,$e,46,$91,$02,$a,35,$2f,$a2,$a,35,$5b,$66,$e,24,$1c,$ca,$a,4,$03,$de,0,0 + +; 325 + dc.w 7506,2 + dc.w 0,-14,-16,0,347,-27,319 + dc.w 0,76,107,0,256,68,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (5 passes, 177 height) + dc.b $e,45,$85,$c2,$e,45,$4d,$86,$a,35,$55,$26,$a,34,$29,$62,$e,18,$15,$4a,0,0 + +; 326 + dc.w 6672,2 + dc.w 0,-24,-28,0,355,-35,319 + dc.w 0,70,95,0,260,62,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (5 passes, 159 height) + dc.b $e,44,$41,$06,$e,43,$76,$c2,$a,34,$4d,$a6,$a,29,$23,$22,$e,9,$0a,$0a,0,0 + +; 327 + dc.w 6072,2 + dc.w 0,-34,-39,0,365,-45,319 + dc.w 0,65,84,0,265,56,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (5 passes, 142 height) + dc.b $e,42,$35,$c6,$e,41,$69,$02,$a,33,$46,$26,$a,24,$1c,$e2,$e,2,$01,$4a,0,0 + +; 328 + dc.w 5400,2 + dc.w 0,-44,-50,0,375,-56,319 + dc.w 0,60,75,0,270,50,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (4 passes, 127 height) + dc.b $e,40,$5d,$c2,$e,36,$2b,$c6,$a,33,$3e,$a6,$a,18,$15,$62,0,0 + +; 329 + dc.w 4752,2 + dc.w 0,-55,-63,0,384,-64,319 + dc.w 0,54,66,0,274,45,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (4 passes, 113 height) + dc.b $e,39,$52,$82,$a,32,$38,$66,$e,28,$21,$c6,$a,14,$10,$62,0,0 + +; 330 + dc.w 4212,2 + dc.w 0,-65,-73,0,394,-75,319 + dc.w 0,49,58,0,279,40,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (4 passes, 100 height) + dc.b $e,38,$48,$82,$a,32,$32,$26,$e,21,$19,$06,$a,9,$0a,$22,0,0 + +; 331 + dc.w 3720,2 + dc.w 0,-77,-86,0,404,-84,319 + dc.w 0,43,49,0,283,35,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (4 passes, 87 height) + dc.b $e,36,$3d,$42,$a,32,$2d,$26,$e,14,$10,$46,$a,5,$05,$22,0,0 + +; 332 + dc.w 3228,2 + dc.w 0,-88,-98,0,415,-95,319 + dc.w 0,37,41,0,289,29,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (3 passes, 73 height) + dc.b $e,35,$33,$42,$a,31,$25,$a6,$e,7,$07,$86,0,0 + +; 333 + dc.w 2748,2 + dc.w 0,-99,-110,0,426,-107,319 + dc.w 0,32,35,0,294,24,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (3 passes, 62 height) + dc.b $e,35,$2b,$c2,$a,26,$1f,$66,$e,1,$00,$06,0,0 + +; 334 + dc.w 960,2 + dc.w 0,-111,-122,0,436,-116,319 + dc.w 0,25,28,0,299,20,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + +; 335 + dc.w 756,2 + dc.w 0,-123,-135,0,448,-128,319 + dc.w 0,19,21,0,305,14,319 + ; Darkfill (0 passes, 0 height) + dc.b 0,0 + ; Brightfill (0 passes, 0 height) + dc.b 0,0 + diff --git a/source/bulb/tantable.asm b/source/bulb/tantable.asm new file mode 100644 index 0000000..f06cec5 --- /dev/null +++ b/source/bulb/tantable.asm @@ -0,0 +1,4 @@ + ; Tan table + dc.w $0000,$0324,$0649,$096e,$0c94,$0fba,$12e2,$160c + dc.w $1937,$1c64,$1f93,$22c5,$25f9,$2931,$2c6c,$2faa + dc.w $32ec,$3632,$397d,$3ccc,$4020 diff --git a/source/bulb/textpaint.asm b/source/bulb/textpaint.asm new file mode 100644 index 0000000..0c0a3d7 --- /dev/null +++ b/source/bulb/textpaint.asm @@ -0,0 +1,897 @@ +; 0 (0 passes, 0 height) + dc.w 0 + +; 1 (0 passes, 0 height) + dc.w 0 + +; 2 (0 passes, 0 height) + dc.w 0 + +; 3 (0 passes, 0 height) + dc.w 0 + +; 4 (1 passes, 2 height) + dc.w $0081,$08dc,$000e,$001a,0 + +; 5 (1 passes, 4 height) + dc.w $0101,$08dc,$000e,$001a,0 + +; 6 (1 passes, 4 height) + dc.w $0201,$08dc,$0000,$0000,0 + +; 7 (1 passes, 4 height) + dc.w $0201,$08dc,$0000,$0000,0 + +; 8 (0 passes, 0 height) + dc.w 0 + +; 9 (0 passes, 0 height) + dc.w 0 + +; 10 (1 passes, 12 height) + dc.w $0301,$08dc,$000e,$001a,0 + +; 11 (1 passes, 14 height) + dc.w $0381,$08dc,$000e,$001a,0 + +; 12 (1 passes, 17 height) + dc.w $0441,$08dc,$000e,$001a,0 + +; 13 (1 passes, 21 height) + dc.w $0541,$08dc,$000e,$001a,0 + +; 14 (1 passes, 23 height) + dc.w $05c1,$08dc,$000e,$001a,0 + +; 15 (1 passes, 26 height) + dc.w $0681,$08dc,$000e,$001a,0 + +; 16 (1 passes, 30 height) + dc.w $0781,$08dc,$000e,$001a,0 + +; 17 (1 passes, 30 height) + dc.w $0f01,$08dc,$0000,$0000,0 + +; 18 (1 passes, 30 height) + dc.w $0f01,$08dc,$0000,$0000,0 + +; 19 (1 passes, 44 height) + dc.w $0b01,$08dc,$000e,$001a,0 + +; 20 (1 passes, 52 height) + dc.w $0d01,$08dc,$000e,$001a,0 + +; 21 (1 passes, 55 height) + dc.w $0dc1,$08dc,$000e,$001a,0 + +; 22 (1 passes, 64 height) + dc.w $1001,$08dc,$000e,$001a,0 + +; 23 (1 passes, 73 height) + dc.w $1241,$08dc,$000e,$001a,0 + +; 24 (1 passes, 78 height) + dc.w $1381,$08dc,$000e,$001a,0 + +; 25 (1 passes, 80 height) + dc.w $1401,$08dc,$000e,$001a,0 + +; 26 (3 passes, 91 height) + dc.w $02c1,$0798,$000c,$0018 + dc.w $0581,$08dc,$000e,$0000 + dc.w $1141,$0908,$016e,$0dda,0 + +; 27 (3 passes, 97 height) + dc.w $0441,$0798,$000c,$0018 + dc.w $0881,$08dc,$000e,$0000 + dc.w $0fc1,$0920,$022e,$155a,0 + +; 28 (3 passes, 93 height) + dc.w $0681,$0908,$016e,$0000 + dc.w $0601,$0798,$000c,$0018,$0e01,$093c,$030e,$1e1a,0 + +; 29 (3 passes, 98 height) + dc.w $0901,$0920,$022e,$0000 + dc.w $08c1,$0798,$000c,$0018,$0b41,$0968,$046e,$2bda,0 + +; 30 (3 passes, 108 height) + dc.w $0e01,$093c,$030e,$0000 + dc.w $0701,$09ac,$068e,$411a,$0d01,$0798,$000c,$0018,0 + +; 31 (3 passes, 110 height) + dc.w $03c1,$09e0,$082e,$515a + dc.w $0f01,$0968,$046e,$0000 + dc.w $1041,$0798,$000c,$0018,0 + +; 32 (3 passes, 107 height) + dc.w $0041,$0a18,$09ee,$62da + dc.w $0d81,$09ac,$068e,$0000 + dc.w $13c1,$0798,$000c,$0018,0 + +; 33 (2 passes, 95 height) + dc.w $0781,$09e0,$082e,$0000 + dc.w $1401,$0798,$000c,$0018,0 + +; 34 (2 passes, 81 height) + dc.w $0081,$0a18,$09ee,$0000 + dc.w $1401,$0798,$000c,$0018,0 + +; 35 (1 passes, 80 height) + dc.w $1401,$0798,$000c,$0018,0 + +; 36 (1 passes, 80 height) + dc.w $1401,$0798,$000c,$0018,0 + +; 37 (3 passes, 102 height) + dc.w $0581,$0654,$000a,$0016 + dc.w $0b01,$0798,$000c,$0000 + dc.w $0e81,$07f0,$02cc,$1b98,0 + +; 38 (3 passes, 102 height) + dc.w $0b01,$0654,$0000,$0000,$0b01,$0798,$0000,$0000,$1d01,$07f0,$0000,$0000,0 + +; 39 (2 passes, 80 height) + dc.w $0b01,$0654,$0000,$0000,$1d01,$07f0,$0000,$0000,0 + +; 40 (0 passes, 0 height) + dc.w 0 + +; 41 (0 passes, 0 height) + dc.w 0 + +; 42 (0 passes, 0 height) + dc.w 0 + +; 43 (2 passes, 138 height) + dc.w $1d01,$07f0,$02cc,$0000 + dc.w $1401,$0654,$000a,$0016,0 + +; 44 (2 passes, 138 height) + dc.w $1d01,$07f0,$02cc,$0000 + dc.w $1401,$0654,$000a,$0016,0 + +; 45 (2 passes, 160 height) + dc.w $1401,$0510,$0008,$0014 + dc.w $2801,$0654,$000a,$0000,0 + +; 46 (2 passes, 160 height) + dc.w $1401,$0510,$0008,$0014 + dc.w $2801,$0654,$000a,$0000,0 + +; 47 (1 passes, 80 height) + dc.w $1401,$0510,$0008,$0014,0 + +; 48 (1 passes, 80 height) + dc.w $1401,$0510,$0008,$0014,0 + +; 49 (1 passes, 80 height) + dc.w $1401,$0510,$0008,$0014,0 + +; 50 (1 passes, 80 height) + dc.w $1401,$0510,$0008,$0014,0 + +; 51 (3 passes, 99 height) + dc.w $04c1,$04c0,$07a6,$4c52 + dc.w $0981,$0604,$07a8,$0000 + dc.w $0f41,$0510,$0008,$0014,0 + +; 52 (3 passes, 120 height) + dc.w $0a01,$046c,$0506,$3212,$0a01,$0510,$0008,$0014 + dc.w $1401,$05b0,$0508,$0000,0 + +; 53 (3 passes, 125 height) + dc.w $0401,$0510,$0008,$0014 + dc.w $1681,$0550,$0208,$0000 + dc.w $1001,$040c,$0206,$1412,0 + +; 54 (2 passes, 120 height) + dc.w $1401,$0510,$0008,$0000 + dc.w $1401,$03cc,$0006,$0012,0 + +; 55 (2 passes, 96 height) + dc.w $0801,$0510,$0008,$0000 + dc.w $1401,$03cc,$0006,$0012,0 + +; 56 (1 passes, 80 height) + dc.w $1401,$03cc,$0006,$0012,0 + +; 57 (3 passes, 99 height) + dc.w $04c1,$037c,$07a4,$4c50 + dc.w $0981,$04c0,$07a6,$0000 + dc.w $0f41,$03cc,$0006,$0012,0 + +; 58 (3 passes, 115 height) + dc.w $08c1,$033c,$05a4,$3850 + dc.w $1181,$0480,$05a6,$0000 + dc.w $0b41,$03cc,$0006,$0012,0 + +; 59 (3 passes, 110 height) + dc.w $0f01,$0448,$03e6,$0000 + dc.w $07c1,$03cc,$0006,$0012,$0c41,$0304,$03e4,$26d0,0 + +; 60 (3 passes, 111 height) + dc.w $0381,$03cc,$0006,$0012 + dc.w $0f81,$0404,$01c6,$0000 + dc.w $1081,$02c0,$01c4,$1190,0 + +; 61 (3 passes, 107 height) + dc.w $0101,$03cc,$0006,$0012 + dc.w $0d81,$03dc,$0086,$0000 + dc.w $1301,$0298,$0084,$0510,0 + +; 62 (4 passes, 104 height) + dc.w $0281,$025c,$08c2,$578e + dc.w $0501,$03a0,$08c4,$0000,$0701,$03cc,$0006,$0000 + dc.w $1181,$0288,$0004,$0010,0 + +; 63 (4 passes, 106 height) + dc.w $0201,$03cc,$0006,$0000 + dc.w $0581,$022c,$0742,$488e + dc.w $0b01,$0370,$0744,$0000 + dc.w $0e81,$0288,$0004,$0010,0 + +; 64 (3 passes, 102 height) + dc.w $0b01,$0348,$0604,$0000 + dc.w $0801,$0204,$0602,$3c0e,$0c01,$0288,$0004,$0010,0 + +; 65 (3 passes, 105 height) + dc.w $0c81,$030c,$0424,$0000 + dc.w $0841,$0288,$0004,$0010,$0bc1,$01c8,$0422,$294e,0 + +; 66 (3 passes, 103 height) + dc.w $0b81,$02ec,$0324,$0000 + dc.w $0641,$0288,$0004,$0010,$0dc1,$01a8,$0322,$1f4e,0 + +; 67 (5 passes, 101 height) + dc.w $0141,$012c,$0960,$5dcc + dc.w $0281,$0270,$0962,$0000,$0801,$02cc,$0224,$0000 + dc.w $0441,$0288,$0004,$0010,$0e81,$0188,$0222,$154e,0 + +; 68 (5 passes, 110 height) + dc.w $0281,$0288,$0004,$0010,$03c1,$0104,$0820,$514c + dc.w $0781,$0248,$0822,$0000,$0781,$02b0,$0144,$0000 + dc.w $0dc1,$016c,$0142,$0c8e,0 + +; 69 (4 passes, 119 height) + dc.w $0881,$0288,$0004,$0000,$0b01,$0218,$06a2,$0000 + dc.w $06c1,$00d4,$06a0,$424c,$0d41,$0144,$0002,$000e,0 + +; 70 (4 passes, 110 height) + dc.w $0501,$0288,$0004,$0000,$0a01,$01f8,$05a2,$0000 + dc.w $08c1,$00b4,$05a0,$384c,$0b41,$0144,$0002,$000e,0 + +; 71 (3 passes, 95 height) + dc.w $0781,$01dc,$04c2,$0000 + dc.w $0981,$0144,$0002,$000e,$0a81,$0098,$04c0,$2f8c,0 + +; 72 (3 passes, 87 height) + dc.w $0381,$01dc,$0000,$0000,$1301,$0144,$0000,$0000,$1501,$0098,$0000,$0000,0 + +; 73 (2 passes, 80 height) + dc.w $1301,$0144,$0000,$0000,$1501,$0098,$0000,$0000,0 + +; 74 (0 passes, 0 height) + dc.w 0 + +; 75 (0 passes, 0 height) + dc.w 0 + +; 76 (0 passes, 0 height) + dc.w 0 + +; 77 (3 passes, 118 height) + dc.w $0941,$0000,$0000,$000c + dc.w $1301,$0144,$0002,$0000,$1581,$0094,$04a0,$0000,0 + +; 78 (3 passes, 118 height) + dc.w $07c1,$0000,$0000,$000c + dc.w $1301,$0144,$0002,$0000,$1881,$007c,$03e0,$0000,0 + +; 79 (2 passes, 37 height) + dc.w $0581,$0068,$0340,$0000 + dc.w $0681,$0000,$0000,$000c,0 + +; 80 (2 passes, 31 height) + dc.w $0581,$0050,$0280,$0000 + dc.w $0501,$0000,$0000,$000c,0 + +; 81 (2 passes, 26 height) + dc.w $0581,$003c,$01e0,$0000 + dc.w $03c1,$0000,$0000,$000c,0 + +; 82 (2 passes, 20 height) + dc.w $0281,$0000,$0000,$000c + dc.w $0501,$0028,$0140,$0000,0 + +; 83 (2 passes, 15 height) + dc.w $0181,$0000,$0000,$000c + dc.w $0481,$0018,$00c0,$0000,0 + +; 84 (2 passes, 10 height) + dc.w $0081,$0000,$0000,$000c + dc.w $0401,$0008,$0040,$0000,0 + +; 85 (1 passes, 6 height) + dc.w $0301,$0000,$0000,$0000,0 + +; 86 (1 passes, 2 height) + dc.w $0101,$0000,$0000,$0000,0 + +; 87 (0 passes, 0 height) + dc.w 0 + +; 88 (0 passes, 0 height) + dc.w 0 + +; 89 (0 passes, 0 height) + dc.w 0 + +; 90 (0 passes, 0 height) + dc.w 0 + +; 91 (0 passes, 0 height) + dc.w 0 + +; 92 (0 passes, 0 height) + dc.w 0 + +; 93 (0 passes, 0 height) + dc.w 0 + +; 94 (0 passes, 0 height) + dc.w 0 + +; 95 (0 passes, 0 height) + dc.w 0 + +; 96 (0 passes, 0 height) + dc.w 0 + +; 97 (0 passes, 0 height) + dc.w 0 + +; 98 (0 passes, 0 height) + dc.w 0 + +; 99 (0 passes, 0 height) + dc.w 0 + +; 100 (0 passes, 0 height) + dc.w 0 + +; 101 (0 passes, 0 height) + dc.w 0 + +; 102 (0 passes, 0 height) + dc.w 0 + +; 103 (0 passes, 0 height) + dc.w 0 + +; 104 (0 passes, 0 height) + dc.w 0 + +; 105 (0 passes, 0 height) + dc.w 0 + +; 106 (0 passes, 0 height) + dc.w 0 + +; 107 (0 passes, 0 height) + dc.w 0 + +; 108 (0 passes, 0 height) + dc.w 0 + +; 109 (0 passes, 0 height) + dc.w 0 + +; 110 (0 passes, 0 height) + dc.w 0 + +; 111 (0 passes, 0 height) + dc.w 0 + +; 112 (0 passes, 0 height) + dc.w 0 + +; 113 (0 passes, 0 height) + dc.w 0 + +; 114 (0 passes, 0 height) + dc.w 0 + +; 115 (0 passes, 0 height) + dc.w 0 + +; 116 (0 passes, 0 height) + dc.w 0 + +; 117 (0 passes, 0 height) + dc.w 0 + +; 118 (0 passes, 0 height) + dc.w 0 + +; 119 (0 passes, 0 height) + dc.w 0 + +; 120 (0 passes, 0 height) + dc.w 0 + +; 121 (0 passes, 0 height) + dc.w 0 + +; 122 (0 passes, 0 height) + dc.w 0 + +; 123 (0 passes, 0 height) + dc.w 0 + +; 124 (0 passes, 0 height) + dc.w 0 + +; 125 (0 passes, 0 height) + dc.w 0 + +; 126 (0 passes, 0 height) + dc.w 0 + +; 127 (0 passes, 0 height) + dc.w 0 + +; 128 (0 passes, 0 height) + dc.w 0 + +; 129 (0 passes, 0 height) + dc.w 0 + +; 130 (0 passes, 0 height) + dc.w 0 + +; 131 (0 passes, 0 height) + dc.w 0 + +; 132 (1 passes, 4 height) + dc.w $0101,$0000,$0000,$000c,0 + +; 133 (1 passes, 4 height) + dc.w $0101,$0000,$0000,$000c,0 + +; 134 (1 passes, 4 height) + dc.w $0101,$0000,$0000,$000c,0 + +; 135 (1 passes, 6 height) + dc.w $0181,$0000,$0000,$000c,0 + +; 136 (1 passes, 6 height) + dc.w $0181,$0000,$0000,$000c,0 + +; 137 (1 passes, 8 height) + dc.w $0201,$0000,$0000,$000c,0 + +; 138 (1 passes, 12 height) + dc.w $0301,$0000,$0000,$000c,0 + +; 139 (1 passes, 14 height) + dc.w $0381,$0000,$0000,$000c,0 + +; 140 (1 passes, 17 height) + dc.w $0441,$0000,$0000,$000c,0 + +; 141 (1 passes, 21 height) + dc.w $0541,$0000,$0000,$000c,0 + +; 142 (1 passes, 23 height) + dc.w $05c1,$0000,$0000,$000c,0 + +; 143 (1 passes, 26 height) + dc.w $0681,$0000,$0000,$000c,0 + +; 144 (1 passes, 30 height) + dc.w $0781,$0000,$0000,$000c,0 + +; 145 (1 passes, 36 height) + dc.w $0901,$0000,$0000,$000c,0 + +; 146 (1 passes, 40 height) + dc.w $0a01,$0000,$0000,$000c,0 + +; 147 (1 passes, 44 height) + dc.w $0b01,$0000,$0000,$000c,0 + +; 148 (1 passes, 52 height) + dc.w $0d01,$0000,$0000,$000c,0 + +; 149 (1 passes, 55 height) + dc.w $0dc1,$0000,$0000,$000c,0 + +; 150 (1 passes, 69 height) + dc.w $1141,$0000,$0000,$000c,0 + +; 151 (1 passes, 73 height) + dc.w $1241,$0000,$0000,$000c,0 + +; 152 (1 passes, 80 height) + dc.w $1401,$0000,$0000,$000c,0 + +; 153 (1 passes, 80 height) + dc.w $1401,$0000,$0000,$000c,0 + +; 154 (3 passes, 91 height) + dc.w $0581,$0000,$0000,$0000 + dc.w $02c1,$0144,$0002,$000e,$1141,$002c,$0160,$0dcc,0 + +; 155 (3 passes, 97 height) + dc.w $0881,$0000,$0000,$0000 + dc.w $0441,$0144,$0002,$000e,$0fc1,$0044,$0220,$154c,0 + +; 156 (3 passes, 93 height) + dc.w $0681,$002c,$0160,$0000 + dc.w $0601,$0144,$0002,$000e,$0e01,$0060,$0300,$1e0c,0 + +; 157 (3 passes, 103 height) + dc.w $0b81,$0044,$0220,$0000 + dc.w $0a01,$00a0,$0500,$320c,$0a01,$0144,$0002,$000e,0 + +; 158 (3 passes, 108 height) + dc.w $0e01,$0060,$0300,$0000 + dc.w $0701,$00d0,$0680,$410c,$0d01,$0144,$0002,$000e,0 + +; 159 (3 passes, 105 height) + dc.w $03c1,$0104,$0820,$514c + dc.w $0c81,$00a0,$0500,$0000 + dc.w $1041,$0144,$0002,$000e,0 + +; 160 (3 passes, 107 height) + dc.w $0041,$013c,$09e0,$62cc + dc.w $0d81,$00d0,$0680,$0000 + dc.w $13c1,$0144,$0002,$000e,0 + +; 161 (2 passes, 95 height) + dc.w $0781,$0104,$0820,$0000 + dc.w $1401,$0144,$0002,$000e,0 + +; 162 (2 passes, 81 height) + dc.w $0081,$013c,$09e0,$0000 + dc.w $1401,$0144,$0002,$000e,0 + +; 163 (1 passes, 80 height) + dc.w $1401,$0144,$0002,$000e,0 + +; 164 (1 passes, 80 height) + dc.w $1401,$0144,$0002,$000e,0 + +; 165 (3 passes, 102 height) + dc.w $0b01,$0144,$0002,$0000 + dc.w $0581,$0288,$0004,$0010,$0e81,$019c,$02c2,$1b8e,0 + +; 166 (3 passes, 134 height) + dc.w $0681,$021c,$06c2,$438e + dc.w $1b01,$0144,$0002,$0000 + dc.w $0d81,$0288,$0004,$0010,0 + +; 167 (2 passes, 138 height) + dc.w $1d01,$019c,$02c2,$0000 + dc.w $1401,$0288,$0004,$0010,0 + +; 168 (2 passes, 106 height) + dc.w $0d01,$021c,$06c2,$0000 + dc.w $1401,$0288,$0004,$0010,0 + +; 169 (1 passes, 80 height) + dc.w $1401,$0288,$0004,$0010,0 + +; 170 (1 passes, 80 height) + dc.w $1401,$0288,$0004,$0010,0 + +; 171 (1 passes, 80 height) + dc.w $1401,$0288,$0004,$0010,0 + +; 172 (1 passes, 80 height) + dc.w $1401,$0288,$0004,$0010,0 + +; 173 (2 passes, 160 height) + dc.w $2801,$0288,$0004,$0000 + dc.w $1401,$03cc,$0006,$0012,0 + +; 174 (2 passes, 160 height) + dc.w $2801,$0288,$0004,$0000 + dc.w $1401,$03cc,$0006,$0012,0 + +; 175 (1 passes, 80 height) + dc.w $1401,$03cc,$0006,$0012,0 + +; 176 (1 passes, 80 height) + dc.w $1401,$03cc,$0006,$0012,0 + +; 177 (1 passes, 80 height) + dc.w $1401,$03cc,$0006,$0012,0 + +; 178 (1 passes, 80 height) + dc.w $1401,$03cc,$0006,$0012,0 + +; 179 (3 passes, 99 height) + dc.w $0981,$04c0,$07a6,$0000 + dc.w $04c1,$0604,$07a8,$4c54,$0f41,$03cc,$0006,$0012,0 + +; 180 (3 passes, 120 height) + dc.w $0a01,$03cc,$0006,$0012 + dc.w $1401,$046c,$0506,$0000 + dc.w $0a01,$05b0,$0508,$3214,0 + +; 181 (3 passes, 125 height) + dc.w $0401,$03cc,$0006,$0012 + dc.w $1681,$040c,$0206,$0000 + dc.w $1001,$0550,$0208,$1414,0 + +; 182 (2 passes, 120 height) + dc.w $1401,$03cc,$0006,$0000 + dc.w $1401,$0510,$0008,$0014,0 + +; 183 (2 passes, 96 height) + dc.w $0801,$03cc,$0006,$0000 + dc.w $1401,$0510,$0008,$0014,0 + +; 184 (1 passes, 80 height) + dc.w $2801,$0510,$0000,$0000,0 + +; 185 (1 passes, 80 height) + dc.w $2801,$0510,$0000,$0000,0 + +; 186 (0 passes, 0 height) + dc.w 0 + +; 187 (3 passes, 129 height) + dc.w $07c1,$0510,$0008,$0014 + dc.w $1881,$058c,$03e8,$0000 + dc.w $0c41,$06d0,$03ea,$26d6,0 + +; 188 (3 passes, 146 height) + dc.w $0381,$0510,$0008,$0014 + dc.w $2101,$0548,$01c8,$0000 + dc.w $1081,$068c,$01ca,$1196,0 + +; 189 (3 passes, 105 height) + dc.w $0181,$0510,$0008,$0014 + dc.w $0c81,$0528,$00c8,$0000 + dc.w $1281,$066c,$00ca,$0796,0 + +; 190 (4 passes, 104 height) + dc.w $0501,$076c,$08ca,$0000 + dc.w $0281,$08b0,$08cc,$5798 + dc.w $0701,$0510,$0008,$0000 + dc.w $1181,$0654,$000a,$0016,0 + +; 191 (4 passes, 108 height) + dc.w $0301,$0510,$0008,$0000,$0b01,$073c,$074a,$0000 + dc.w $0581,$0880,$074c,$4898,$0e81,$0654,$000a,$0016,0 + +; 192 (3 passes, 104 height) + dc.w $0c01,$070c,$05ca,$0000 + dc.w $0881,$0850,$05cc,$3998,$0b81,$0654,$000a,$0016,0 + +; 193 (3 passes, 102 height) + dc.w $0b01,$06e4,$048a,$0000 + dc.w $0901,$0654,$000a,$0016,$0b01,$0828,$048c,$2d18,0 + +; 194 (3 passes, 99 height) + dc.w $0981,$06c0,$036a,$0000 + dc.w $06c1,$0654,$000a,$0016,$0d41,$0804,$036c,$21d8,0 + +; 195 (5 passes, 104 height) + dc.w $0281,$08c4,$096c,$0000 + dc.w $0141,$0a08,$096e,$5dda,$0441,$0654,$000a,$0016 + dc.w $0981,$0698,$022a,$0000 + dc.w $0e81,$07dc,$022c,$1558,0 + +; 196 (5 passes, 112 height) + dc.w $0281,$0654,$000a,$0016 + dc.w $0781,$089c,$082c,$0000 + dc.w $03c1,$09e0,$082e,$515a + dc.w $0881,$067c,$014a,$0000 + dc.w $0dc1,$07c0,$014c,$0c98,0 + +; 197 (4 passes, 119 height) + dc.w $0881,$0654,$000a,$0000,$0b01,$086c,$06ac,$0000 + dc.w $06c1,$09b0,$06ae,$425a,$0d41,$0798,$000c,$0018,0 + +; 198 (4 passes, 110 height) + dc.w $0501,$0654,$000a,$0000,$0a01,$084c,$05ac,$0000 + dc.w $08c1,$0990,$05ae,$385a,$0b41,$0798,$000c,$0018,0 + +; 199 (3 passes, 95 height) + dc.w $0781,$0830,$04cc,$0000 + dc.w $0981,$0798,$000c,$0018,$0a81,$0974,$04ce,$2f9a,0 + +; 200 (4 passes, 94 height) + dc.w $0101,$0a14,$09ce,$0000,$0701,$0814,$03ec,$0000 + dc.w $07c1,$0798,$000c,$0018,$0bc1,$0958,$03ee,$26da,0 + +; 201 (4 passes, 94 height) + dc.w $0501,$09f4,$08ce,$0000,$0701,$07f8,$030c,$0000 + dc.w $0601,$0798,$000c,$0018,$0b81,$093c,$030e,$1e1a,0 + +; 202 (4 passes, 92 height) + dc.w $0701,$07dc,$022c,$0000 + dc.w $0441,$0798,$000c,$0018 + dc.w $0901,$09cc,$078e,$0000 + dc.w $0ac1,$0920,$022e,$155a,0 + +; 203 (4 passes, 84 height) + dc.w $0281,$0798,$000c,$0018 + dc.w $0701,$07c0,$014c,$0000,$0881,$09b0,$06ae,$0000 + dc.w $0ac1,$0904,$014e,$0c9a,0 + +; 204 (4 passes, 74 height) + dc.w $00c1,$0798,$000c,$0018 + dc.w $0701,$07a4,$006c,$0000,$0801,$098c,$058e,$0000 + dc.w $0a41,$08e8,$006e,$03da,0 + +; 205 (3 passes, 63 height) + dc.w $0501,$0798,$000c,$0000,$0781,$0974,$04ce,$0000 + dc.w $0981,$08dc,$000e,$001a,0 + +; 206 (3 passes, 47 height) + dc.w $0181,$0798,$000c,$0000,$0681,$0958,$03ee,$0000 + dc.w $07c1,$08dc,$000e,$001a,0 + +; 207 (2 passes, 38 height) + dc.w $0601,$0944,$034e,$0000 + dc.w $0681,$08dc,$000e,$001a,0 + +; 208 (2 passes, 31 height) + dc.w $0501,$0930,$02ae,$0000 + dc.w $0541,$08dc,$000e,$001a,0 + +; 209 (2 passes, 26 height) + dc.w $0581,$0918,$01ee,$0000 + dc.w $03c1,$08dc,$000e,$001a,0 + +; 210 (2 passes, 21 height) + dc.w $0481,$090c,$018e,$0000 + dc.w $0301,$08dc,$000e,$001a,0 + +; 211 (2 passes, 15 height) + dc.w $0181,$08dc,$000e,$001a + dc.w $0481,$08f4,$00ce,$0000,0 + +; 212 (2 passes, 12 height) + dc.w $0081,$08dc,$000e,$001a + dc.w $0501,$08e4,$004e,$0000,0 + +; 213 (1 passes, 6 height) + dc.w $0301,$08dc,$000e,$0000,0 + +; 214 (1 passes, 2 height) + dc.w $0101,$08dc,$000e,$0000,0 + +; 215 (0 passes, 0 height) + dc.w 0 + +; 216 (0 passes, 0 height) + dc.w 0 + +; 217 (0 passes, 0 height) + dc.w 0 + +; 218 (0 passes, 0 height) + dc.w 0 + +; 219 (0 passes, 0 height) + dc.w 0 + +; 220 (0 passes, 0 height) + dc.w 0 + +; 221 (0 passes, 0 height) + dc.w 0 + +; 222 (0 passes, 0 height) + dc.w 0 + +; 223 (0 passes, 0 height) + dc.w 0 + +; 224 (0 passes, 0 height) + dc.w 0 + +; 225 (0 passes, 0 height) + dc.w 0 + +; 226 (0 passes, 0 height) + dc.w 0 + +; 227 (0 passes, 0 height) + dc.w 0 + +; 228 (0 passes, 0 height) + dc.w 0 + +; 229 (0 passes, 0 height) + dc.w 0 + +; 230 (0 passes, 0 height) + dc.w 0 + +; 231 (0 passes, 0 height) + dc.w 0 + +; 232 (0 passes, 0 height) + dc.w 0 + +; 233 (0 passes, 0 height) + dc.w 0 + +; 234 (0 passes, 0 height) + dc.w 0 + +; 235 (0 passes, 0 height) + dc.w 0 + +; 236 (0 passes, 0 height) + dc.w 0 + +; 237 (0 passes, 0 height) + dc.w 0 + +; 238 (0 passes, 0 height) + dc.w 0 + +; 239 (0 passes, 0 height) + dc.w 0 + +; 240 (0 passes, 0 height) + dc.w 0 + +; 241 (0 passes, 0 height) + dc.w 0 + +; 242 (0 passes, 0 height) + dc.w 0 + +; 243 (0 passes, 0 height) + dc.w 0 + +; 244 (0 passes, 0 height) + dc.w 0 + +; 245 (0 passes, 0 height) + dc.w 0 + +; 246 (0 passes, 0 height) + dc.w 0 + +; 247 (0 passes, 0 height) + dc.w 0 + +; 248 (0 passes, 0 height) + dc.w 0 + +; 249 (0 passes, 0 height) + dc.w 0 + +; 250 (0 passes, 0 height) + dc.w 0 + +; 251 (0 passes, 0 height) + dc.w 0 + +; 252 (0 passes, 0 height) + dc.w 0 + +; 253 (0 passes, 0 height) + dc.w 0 + +; 254 (0 passes, 0 height) + dc.w 0 + +; 255 (0 passes, 0 height) + dc.w 0 + +; 256 (0 passes, 0 height) + dc.w 0 + +; 257 (0 passes, 0 height) + dc.w 0 + diff --git a/source/data/blend/PLT_DSRLogo01c_ham.pal.asm b/source/data/blend/PLT_DSRLogo01c_ham.pal.asm new file mode 100644 index 0000000..6f536ab --- /dev/null +++ b/source/data/blend/PLT_DSRLogo01c_ham.pal.asm @@ -0,0 +1,3 @@ + ; Palette for C:\Users\platon42\Documents\Projects\Amiga\hameager2\data\blend\PLT_DSRLogo01c_ham.ppm + dc.w $0000,$0111,$0012,$0212,$0122,$0313,$0223,$0225 + dc.w $0324,$0627,$0e42,$0f52,$0f73,$0f93,$0fb4,$0fc8 diff --git a/source/data/blend/PLT_DSRLogo01c_ham.raw b/source/data/blend/PLT_DSRLogo01c_ham.raw new file mode 100644 index 0000000..4826f86 Binary files /dev/null and b/source/data/blend/PLT_DSRLogo01c_ham.raw differ diff --git a/source/data/blend/PLT_andyou.png b/source/data/blend/PLT_andyou.png new file mode 100644 index 0000000..2aa14ff Binary files /dev/null and b/source/data/blend/PLT_andyou.png differ diff --git a/source/data/blend/assets.txt b/source/data/blend/assets.txt new file mode 100644 index 0000000..5fdec85 --- /dev/null +++ b/source/data/blend/assets.txt @@ -0,0 +1 @@ +data/blend/PLT_andyou.png data/blend/andyou_128x92x2 -X=0 -Y=0 -width=128 -height=96 -format=1 diff --git a/source/data/blend/fiveimg_ham.pal.asm b/source/data/blend/fiveimg_ham.pal.asm new file mode 100644 index 0000000..87f1849 --- /dev/null +++ b/source/data/blend/fiveimg_ham.pal.asm @@ -0,0 +1,131 @@ + ; Palette for /Users/chodges/Projects/Amiga/hameager2/data/blend/fiveimg_ham.ppm + dc.w $0000,$0222,$0444,$0999,$01be,$0ccc,$0fff + dc.w $0543,$0643,$0643,$0653,$0543,$0543,$0433 + dc.w $0322,$0322,$0322,$0433,$0543,$0644,$0654 + dc.w $0754,$0653,$0754,$0654,$0654,$0754,$0754 + dc.w $0754,$0654,$0754,$0654,$0754,$0754,$0754 + dc.w $0754,$0754,$0754,$0654,$0753,$0654,$0754 + dc.w $0654,$0754,$0754,$0754,$0654,$0754,$0654 + dc.w $0754,$0654,$0754,$0654,$0754,$0654,$0754 + dc.w $0654,$0754,$0654,$0754,$0653,$0754,$0654 + dc.w $0753,$0654,$0753,$0654,$0753,$0654,$0754 + dc.w $0653,$0654,$0654,$0754,$0653,$0754,$0654 + dc.w $0754,$0653,$0653,$0654,$0643,$0643,$0543 + dc.w $0433,$0432,$0332,$0332,$0433,$0432,$0533 + dc.w $0543,$0543,$0653,$0643,$0754,$0653,$0654 + dc.w $0643,$0543,$0533,$0433,$0333,$0323,$0333 + dc.w $0323,$0333,$0323,$0333,$0323,$0333,$0323 + dc.w $0222,$0322,$0332,$0333,$0432,$0533,$0543 + dc.w $0643,$0643,$0643,$0643,$0643,$0643,$0643 + dc.w $0643,$0643,$0643,$0643,$0643,$0643,$0643 + dc.w $0643,$0643,$0643,$0653,$0643,$0643,$0643 + dc.w $0653,$0643,$0653,$0643,$0653,$0643,$0753 + dc.w $0643,$0653,$0643,$0653,$0643,$0653,$0653 + dc.w $0643,$0643,$0643,$0643,$0543,$0543,$0532 + dc.w $0432,$0432,$0433,$0532,$0543,$0543,$0643 + dc.w $0653,$0643,$0653,$0653,$0753,$0653,$0643 + dc.w $0653,$0653,$0643,$0653,$0643,$0653,$0643 + dc.w $0653,$0643,$0653,$0643,$0643,$0764,$0764 + dc.w $0764,$0765,$0764,$0764,$0764,$0765,$0874 + dc.w $0765,$0764,$0765,$0864,$0775,$0864,$0764 + dc.w $0764,$0764,$0764,$0864,$0764,$0765,$0764 + dc.w $0764,$0864,$0764,$0764,$0864,$0764,$0874 + dc.w $0865,$0764,$0864,$0874,$0864,$0874,$0864 + dc.w $0874,$0864,$0864,$0865,$0764,$0874,$0864 + dc.w $0864,$0764,$0864,$0764,$0864,$0764,$0864 + dc.w $0764,$0864,$0764,$0764,$0864,$0764,$0864 + dc.w $0764,$0764,$0764,$0764,$0864,$0764,$0764 + dc.w $0764,$0864,$0764,$0764,$0764,$0864,$0764 + dc.w $0764,$0764,$0764,$0764,$0764,$0764,$0764 + dc.w $0764,$0765,$0764,$0764,$0764,$0764,$0764 + dc.w $0764,$0764,$0764,$0764,$0764,$0764,$0764 + dc.w $0765,$0775,$0765,$0765,$0764,$0764,$0764 + dc.w $0764,$0664,$0764,$0764,$0764,$0764,$0765 + dc.w $0764,$0765,$0764,$0765,$0764,$0764,$0764 + dc.w $0765,$0764,$0775,$0764,$0875,$0765,$0875 + dc.w $0875,$0875,$0875,$0875,$0975,$0975,$0985 + dc.w $0985,$0986,$0985,$0986,$0a86,$0a86,$0a86 + dc.w $0a86,$0a96,$0a86,$0a96,$0a86,$0a96,$0a86 + dc.w $0a96,$0a96,$0a96,$0b86,$0a96,$0a86,$0b96 + dc.w $0a96,$0b96,$0a86,$0b96,$0a96,$0b96,$0a86 + dc.w $0b96,$0a96,$0b96,$0b96,$0b96,$0b96,$0a96 + dc.w $0b96,$0b97,$0b96,$0b97,$0b96,$0ca7,$0ca7 + dc.w $0ca7,$0ca7,$0ca7,$0ca8,$0da8,$0ca8,$0da8 + dc.w $0db8,$0db8,$0db8,$0fb8,$0ea7,$0ea8,$0a76 + dc.w $0432,$0210,$0000,$0110,$0000,$0322,$0322 + dc.w $0100,$0000,$0111,$0755,$0766,$0866,$0867 + dc.w $0866,$0221,$0000,$0211,$0853,$0000,$0221 + dc.w $0642,$0000,$0100,$0010,$0433,$0866,$0877 + dc.w $0866,$0866,$0433,$0756,$0866,$0866,$0866 + dc.w $0755,$0222,$0210,$0101,$0110,$0100,$0100 + dc.w $0100,$0100,$0100,$0321,$0742,$0532,$0100 + dc.w $0311,$0321,$0431,$0953,$0e85,$0c75,$0433 + dc.w $0222,$0323,$0223,$0323,$0222,$0223,$0222 + dc.w $0333,$0323,$0222,$0223,$0333,$0333,$0323 + dc.w $0222,$0333,$0333,$0333,$0333,$0333,$0323 + dc.w $0434,$0444,$0434,$0333,$0333,$0433,$0655 + dc.w $0434,$0434,$0233,$0434,$0444,$0544,$0333 + dc.w $0545,$0555,$0323,$0544,$0444,$0434,$0333 + dc.w $0434,$0655,$0333,$0333,$0444,$0545,$0766 + dc.w $0755,$0544,$0444,$0444,$0444,$0333,$0223 + dc.w $0333,$0445,$0544,$0555,$0544,$0444,$0334 + dc.w $0333,$0334,$0444,$0445,$0766,$0656,$0223 + dc.w $0212,$0111,$0111,$0000,$0111,$0111,$0222 + dc.w $0111,$0111,$0000,$0100,$0000,$0111,$0112 + dc.w $0111,$0101,$0111,$0111,$0111,$0000,$0000 + dc.w $0111,$0212,$0111,$0000,$0222,$0444,$0655 + dc.w $0654,$0655,$0654,$0655,$0655,$0655,$0655 + dc.w $0654,$0654,$0332,$0544,$0544,$0544,$0655 + dc.w $0654,$0654,$0544,$0544,$0654,$0443,$0432 + dc.w $0431,$0234,$0234,$0233,$0244,$0233,$0244 + dc.w $0144,$0144,$0244,$0255,$0244,$0244,$0344 + dc.w $0233,$0234,$0233,$0122,$0122,$0233,$0244 + dc.w $0233,$0133,$0233,$0223,$0233,$0122,$0143 + dc.w $0254,$0144,$0154,$0066,$0067,$0055,$0243 + dc.w $0243,$0443,$0653,$0853,$0963,$0963,$0952 + dc.w $0a53,$0a52,$0853,$0554,$0354,$0266,$0498 + dc.w $0277,$0166,$0166,$0265,$0244,$0133,$0133 + dc.w $0233,$0243,$0243,$0344,$0254,$0354,$0144 + dc.w $0144,$0144,$0254,$0143,$0244,$0254,$0266 + dc.w $0266,$0233,$0122,$0354,$0687,$0697,$0687 + dc.w $0686,$0687,$0587,$0487,$0387,$0376,$0365 + dc.w $0344,$0344,$0333,$0222,$0233,$0344,$0233 + dc.w $0333,$0233,$0343,$0555,$0333,$0233,$0343 + dc.w $0455,$0444,$0322,$0333,$0333,$0232,$0554 + dc.w $0454,$0554,$0343,$0455,$0343,$0554,$0444 + dc.w $0111,$0222,$0322,$0221,$0100,$0322,$0633 + dc.w $0843,$0832,$0842,$0732,$0643,$0222,$0110 + dc.w $0532,$0853,$0853,$0653,$0764,$0764,$0532 + dc.w $0753,$0654,$0553,$0a98,$0997,$0a98,$0545 + dc.w $0843,$0f97,$0d52,$0d63,$0d63,$0d63,$0d63 + dc.w $0d63,$0d63,$0e63,$0d74,$0d64,$0d63,$0d63 + dc.w $0fa7,$0744,$0366,$05aa,$0388,$07ba,$0576 + dc.w $0653,$0b96,$0b75,$0b86,$0a65,$0b86,$0744 + dc.w $0422,$0422,$0221,$0100,$0111,$0111,$0211 + dc.w $0423,$0623,$0623,$0623,$0523,$0523,$0222 + dc.w $0122,$0222,$0222,$0222,$0222,$0123,$0222 + dc.w $0233,$0233,$0233,$0233,$0223,$0222,$0223 + dc.w $0222,$0233,$0222,$0233,$0223,$0233,$0223 + dc.w $0233,$0222,$0233,$0222,$0232,$0223,$0222 + dc.w $0223,$0222,$0233,$0222,$0222,$0222,$0222 + dc.w $0222,$0223,$0233,$0233,$0233,$0233,$0222 + dc.w $0233,$0233,$0233,$0222,$0223,$0233,$0233 + dc.w $0233,$0233,$0233,$0233,$0233,$0233,$0233 + dc.w $0233,$0233,$0233,$0233,$0233,$0233,$0233 + dc.w $0233,$0233,$0233,$0233,$0233,$0233,$0233 + dc.w $0232,$0233,$0223,$0122,$0111,$0222,$0222 + dc.w $0222,$0222,$0223,$0222,$0222,$0122,$0223 + dc.w $0222,$0223,$0122,$0222,$0222,$0223,$0122 + dc.w $0223,$0222,$0223,$0232,$0223,$0122,$0112 + dc.w $0122,$0122,$0122,$0222,$0222,$0112,$0122 + dc.w $0133,$0133,$0233,$0133,$0133,$0122,$0011 + dc.w $0122,$0222,$0122,$0111,$0011,$0122,$0222 + dc.w $0122,$0122,$0122,$0122,$0112,$0121,$0112 + dc.w $0121,$0112,$0122,$0111,$0111,$0111,$0122 + dc.w $0222,$0122,$0122,$0122,$0111,$0011,$0122 + dc.w $0022,$0012,$0144,$0144,$0145,$0144,$0155 + dc.w $0255,$0144,$0033,$0043,$0043,$0044,$0155 + dc.w $0166,$0256,$0266,$0166,$0055,$0033,$0133 + dc.w $0122,$0332,$0787,$0687,$0797,$0897,$09bb + dc.w $05aa,$06a9,$07a9,$0565,$0aa9,$0998,$09a8 + dc.w $0898,$0ab9,$0887,$0896 diff --git a/source/data/blend/fiveimg_ham.raw b/source/data/blend/fiveimg_ham.raw new file mode 100644 index 0000000..a6587d9 Binary files /dev/null and b/source/data/blend/fiveimg_ham.raw differ diff --git a/source/data/blend/juggle.txt b/source/data/blend/juggle.txt new file mode 100644 index 0000000..be6008a --- /dev/null +++ b/source/data/blend/juggle.txt @@ -0,0 +1,10 @@ +load data/blend/fiveimg_ham.raw +save data/blend/fiveimg1_ham.raw -l 43200 -n 0 +save data/blend/fiveimg2_ham.raw -l 43200 -n 1 +save data/blend/fiveimg3_ham.raw -l 43200 -n 2 +save data/blend/fiveimg4_ham.raw -l 43200 -n 3 +save data/blend/fiveimg5_ham.raw -l 43200 -n 4 +clear +load data/blend/leavestc.raw +reorganize 180 -w 10 -l 2 -um 62 +save data/blend/leavestc_10.raw \ No newline at end of file diff --git a/source/data/blend/leavestc.raw b/source/data/blend/leavestc.raw new file mode 100644 index 0000000..3d2dbf3 Binary files /dev/null and b/source/data/blend/leavestc.raw differ diff --git a/source/data/bulb/68k-inside-logo_128x80c.png b/source/data/bulb/68k-inside-logo_128x80c.png new file mode 100644 index 0000000..b4c788a Binary files /dev/null and b/source/data/bulb/68k-inside-logo_128x80c.png differ diff --git a/source/data/bulb/PLT_Lampscene_ham.pal.asm b/source/data/bulb/PLT_Lampscene_ham.pal.asm new file mode 100644 index 0000000..2764055 --- /dev/null +++ b/source/data/bulb/PLT_Lampscene_ham.pal.asm @@ -0,0 +1,3 @@ + ; Palette for /Users/chodges/Projects/Amiga/hameager2/data/bulb/PLT_Lampscene_ham.ppm + dc.w $0000,$0111,$0332,$0322,$0665,$0764,$0542,$0654 + dc.w $0ddb,$0ec9,$0a85,$0cb8 diff --git a/source/data/bulb/PLT_Lampscene_ham.raw b/source/data/bulb/PLT_Lampscene_ham.raw new file mode 100644 index 0000000..a7ff9b2 Binary files /dev/null and b/source/data/bulb/PLT_Lampscene_ham.raw differ diff --git a/source/data/bulb/PLT_lamp_01c.png b/source/data/bulb/PLT_lamp_01c.png new file mode 100644 index 0000000..b87538d Binary files /dev/null and b/source/data/bulb/PLT_lamp_01c.png differ diff --git a/source/data/bulb/PLT_lamp_02e.png b/source/data/bulb/PLT_lamp_02e.png new file mode 100644 index 0000000..4ae78db Binary files /dev/null and b/source/data/bulb/PLT_lamp_02e.png differ diff --git a/source/data/bulb/PLT_textsprites02.png b/source/data/bulb/PLT_textsprites02.png new file mode 100644 index 0000000..b2fa45a Binary files /dev/null and b/source/data/bulb/PLT_textsprites02.png differ diff --git a/source/data/bulb/assets.txt b/source/data/bulb/assets.txt new file mode 100644 index 0000000..bbd679b --- /dev/null +++ b/source/data/bulb/assets.txt @@ -0,0 +1,8 @@ +data/bulb/PLT_lamp_01c.png data/bulb/lamp_64x32x16 -rawpalette -X=0 -Y=0 -width=64 -height=32 -format=a +data/bulb/PLT_lamp_02e.png data/bulb/lamp_off_64x32x16 -rawpalette -X=32 -Y=0 -width=64 -height=32 -format=a +data/bulb/68k-inside-logo_128x80c.png data/bulb/text2 -X=0 -Y=0 -width=128 -height=80 -interleaved -format=2 +data/bulb/PLT_textsprites02.png data/bulb/text1 -X=0 -Y=0 -width=128 -height=80 -interleaved -format=2 +data/bulb/PLT_textsprites02.png data/bulb/text3 -X=128 -Y=0 -width=128 -height=80 -interleaved -format=2 +data/bulb/PLT_textsprites02.png data/bulb/text4 -X=256 -Y=0 -width=128 -height=80 -interleaved -format=2 +data/bulb/PLT_textsprites02.png data/bulb/text5 -X=384 -Y=0 -width=128 -height=80 -interleaved -format=2 +data/bulb/PLT_lamp_01c.png data/bulb/lamp_48x32x16 -X=8 -Y=0 -width=48 -height=32 -format=4 diff --git a/source/data/endpart/PJZ_font_8x16x4.png b/source/data/endpart/PJZ_font_8x16x4.png new file mode 100644 index 0000000..b7137ec Binary files /dev/null and b/source/data/endpart/PJZ_font_8x16x4.png differ diff --git a/source/data/endpart/assets.txt b/source/data/endpart/assets.txt new file mode 100644 index 0000000..e4cbaec --- /dev/null +++ b/source/data/endpart/assets.txt @@ -0,0 +1,2 @@ +data/endpart/PJZ_font_8x16x4.png data/endpart/PJZ_font_8x16x4 -format=2 -interleaved +data/endpart/screenshots_rightpal.png data/endpart/screenshots_320x1620 -format=2 -interleaved diff --git a/source/data/endpart/screenshots_rightpal.png b/source/data/endpart/screenshots_rightpal.png new file mode 100644 index 0000000..def949a Binary files /dev/null and b/source/data/endpart/screenshots_rightpal.png differ diff --git a/source/data/gotham/assets.txt b/source/data/gotham/assets.txt new file mode 100644 index 0000000..084c803 --- /dev/null +++ b/source/data/gotham/assets.txt @@ -0,0 +1,6 @@ +data/gotham/texts.png data/gotham/meanwhile320x18x4 -format=2 -Y=23 -height=18 +data/gotham/texts.png data/gotham/gothamcity320x23x4 -format=2 -Y=78 -height=23 +data/gotham/texts.png data/gotham/hameelinna320x23x4 -format=2 -Y=102 -height=23 +data/gotham/texts.png data/gotham/gotham320x23x4 -format=2 -Y=126 -height=23 +data/gotham/texts.png data/gotham/ham320x23x4 -format=2 -Y=150 -height=23 +data/gotham/texts.png data/gotham/hamtechnology320x13x4 -format=2 -Y=176 -height=13 diff --git a/source/data/gotham/hamtechnology.raw b/source/data/gotham/hamtechnology.raw new file mode 100644 index 0000000..abe66bf Binary files /dev/null and b/source/data/gotham/hamtechnology.raw differ diff --git a/source/data/gotham/texts.png b/source/data/gotham/texts.png new file mode 100644 index 0000000..383bd28 Binary files /dev/null and b/source/data/gotham/texts.png differ diff --git a/source/data/gouraud/PLT_bendit_sprite.png b/source/data/gouraud/PLT_bendit_sprite.png new file mode 100644 index 0000000..a782601 Binary files /dev/null and b/source/data/gouraud/PLT_bendit_sprite.png differ diff --git a/source/data/gouraud/assets.txt b/source/data/gouraud/assets.txt new file mode 100644 index 0000000..f398847 --- /dev/null +++ b/source/data/gouraud/assets.txt @@ -0,0 +1 @@ +data/gouraud/PLT_bendit_sprite.png data/gouraud/bendit128x128x4 -format=s -width=128 -height=128 \ No newline at end of file diff --git a/source/data/hexagon/PLT_winners_sprite02b.png b/source/data/hexagon/PLT_winners_sprite02b.png new file mode 100644 index 0000000..d133f4f Binary files /dev/null and b/source/data/hexagon/PLT_winners_sprite02b.png differ diff --git a/source/data/hexagon/assets.txt b/source/data/hexagon/assets.txt new file mode 100644 index 0000000..ffd3812 --- /dev/null +++ b/source/data/hexagon/assets.txt @@ -0,0 +1,2 @@ +data/hexagon/hexagon.png data/hexagon/hexagon_reg16x254 -rawpalette -ftpalette=dc.w -format=e -interleaved -width=16 -height=254 +data/hexagon/PLT_winners_sprite02b.png data/hexagon/winners128x128x4 -format=s -width=128 -height=128 diff --git a/source/data/hexagon/hexagon.png b/source/data/hexagon/hexagon.png new file mode 100644 index 0000000..6f76c2d Binary files /dev/null and b/source/data/hexagon/hexagon.png differ diff --git a/source/data/hexagon/kaleitc.raw b/source/data/hexagon/kaleitc.raw new file mode 100644 index 0000000..bdf2e04 Binary files /dev/null and b/source/data/hexagon/kaleitc.raw differ diff --git a/source/data/kaleidoscope/PLT_Fairyanim_01c.png b/source/data/kaleidoscope/PLT_Fairyanim_01c.png new file mode 100644 index 0000000..d942529 Binary files /dev/null and b/source/data/kaleidoscope/PLT_Fairyanim_01c.png differ diff --git a/source/data/kaleidoscope/assets.txt b/source/data/kaleidoscope/assets.txt new file mode 100644 index 0000000..c578d77 --- /dev/null +++ b/source/data/kaleidoscope/assets.txt @@ -0,0 +1,7 @@ +data/kaleidoscope/PLT_Fairyanim_01c.png data/kaleidoscope/fairy1_48x51x16 -format=4 -interleaved -X=0 -Y=5 -width=48 -height=51 -rawpalette +data/kaleidoscope/PLT_Fairyanim_01c.png data/kaleidoscope/fairy2_48x51x16 -format=4 -interleaved -X=64 -Y=5 -width=48 -height=51 +data/kaleidoscope/PLT_Fairyanim_01c.png data/kaleidoscope/fairy3_48x51x16 -format=4 -interleaved -X=128 -Y=5 -width=48 -height=51 +data/kaleidoscope/PLT_Fairyanim_01c.png data/kaleidoscope/puff1_32x15x16 -format=4 -interleaved -X=32 -Y=83 -width=32 -height=15 +data/kaleidoscope/PLT_Fairyanim_01c.png data/kaleidoscope/puff2_32x15x16 -format=4 -interleaved -X=96 -Y=83 -width=32 -height=15 +data/kaleidoscope/PLT_Fairyanim_01c.png data/kaleidoscope/puff3_32x15x16 -format=4 -interleaved -X=160 -Y=83 -width=32 -height=15 +data/kaleidoscope/PLT_Fairyanim_01c.png data/kaleidoscope/puff4_32x15x16 -format=4 -interleaved -X=224 -Y=83 -width=32 -height=15 diff --git a/source/data/kaleidoscope/plt_neuro2_ham.raw b/source/data/kaleidoscope/plt_neuro2_ham.raw new file mode 100644 index 0000000..5453dba Binary files /dev/null and b/source/data/kaleidoscope/plt_neuro2_ham.raw differ diff --git a/source/data/music/desire_68k_tune3_v2.mod b/source/data/music/desire_68k_tune3_v2.mod new file mode 100644 index 0000000..566ce4a Binary files /dev/null and b/source/data/music/desire_68k_tune3_v2.mod differ diff --git a/source/data/music/desire_demo_68k_v6.mod b/source/data/music/desire_demo_68k_v6.mod new file mode 100644 index 0000000..9a65d9c Binary files /dev/null and b/source/data/music/desire_demo_68k_v6.mod differ diff --git a/source/data/music/dsr_68k_tune_2_v11.mod b/source/data/music/dsr_68k_tune_2_v11.mod new file mode 100644 index 0000000..a80bc90 Binary files /dev/null and b/source/data/music/dsr_68k_tune_2_v11.mod differ diff --git a/source/data/stham/PLT_HAMph_path_2_test08b_ham.pal.asm b/source/data/stham/PLT_HAMph_path_2_test08b_ham.pal.asm new file mode 100644 index 0000000..ac09a32 --- /dev/null +++ b/source/data/stham/PLT_HAMph_path_2_test08b_ham.pal.asm @@ -0,0 +1,3 @@ + ; Palette for /Users/chodges/Projects/Amiga/hameager2/data/stham/PLT_HAMph_path_2_test08b_ham.ppm + dc.w $0000,$0101,$0011,$0212,$0311,$0123,$0410,$0413 + dc.w $0134,$0613,$0145,$0724,$0166,$0177,$0972,$0595 diff --git a/source/data/stham/PLT_HAMph_path_2_test08b_ham.raw b/source/data/stham/PLT_HAMph_path_2_test08b_ham.raw new file mode 100644 index 0000000..2fc8f79 Binary files /dev/null and b/source/data/stham/PLT_HAMph_path_2_test08b_ham.raw differ diff --git a/source/data/stham/assets.txt b/source/data/stham/assets.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/data/stham/curtainsine.bin b/source/data/stham/curtainsine.bin new file mode 100644 index 0000000..e09f819 Binary files /dev/null and b/source/data/stham/curtainsine.bin differ diff --git a/source/data/virgillbars/PLT_Lolcat_01c_WIP_64x128.png b/source/data/virgillbars/PLT_Lolcat_01c_WIP_64x128.png new file mode 100644 index 0000000..2ba669a Binary files /dev/null and b/source/data/virgillbars/PLT_Lolcat_01c_WIP_64x128.png differ diff --git a/source/data/virgillbars/PLT_addition_sprite.png b/source/data/virgillbars/PLT_addition_sprite.png new file mode 100644 index 0000000..41f208f Binary files /dev/null and b/source/data/virgillbars/PLT_addition_sprite.png differ diff --git a/source/data/virgillbars/PLT_breakthrough_sprite.png b/source/data/virgillbars/PLT_breakthrough_sprite.png new file mode 100644 index 0000000..1a26c04 Binary files /dev/null and b/source/data/virgillbars/PLT_breakthrough_sprite.png differ diff --git a/source/data/virgillbars/assets.txt b/source/data/virgillbars/assets.txt new file mode 100644 index 0000000..666b1d2 --- /dev/null +++ b/source/data/virgillbars/assets.txt @@ -0,0 +1,4 @@ +data/virgillbars/PLT_Lolcat_01c_WIP_64x128.png data/virgillbars/PLT_Lolcat64x128x16 -rawpalette -format=a -width=64 -height=128 +data/virgillbars/PLT_addition_sprite.png data/virgillbars/additionsprite96x112x4 -format=s -width=96 -height=112 +data/virgillbars/PLT_breakthrough_sprite.png data/virgillbars/lightbreak128x128x4 -format=s -width=128 -height=128 +data/virgillbars/PLT_breakthrough_sprite.png data/virgillbars/staybroken128x128x4 -format=s -X=144 -width=128 -height=128 \ No newline at end of file diff --git a/source/data/virgillbars/curtainsine.bin b/source/data/virgillbars/curtainsine.bin new file mode 100644 index 0000000..a55523c Binary files /dev/null and b/source/data/virgillbars/curtainsine.bin differ diff --git a/source/endpart/aga.bat b/source/endpart/aga.bat new file mode 100644 index 0000000..bc68979 --- /dev/null +++ b/source/endpart/aga.bat @@ -0,0 +1,30 @@ +del endpart.exe +del "..\winuae\hd0\endpart.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "endpart.exe" "endpart.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy endpart.exe "..\winuae\hd0" +copy endpart.exe "..\winuae\hd0\a" + +@echo /|set /p =endpart.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/endpart/assemble.bat b/source/endpart/assemble.bat new file mode 100644 index 0000000..f12702e --- /dev/null +++ b/source/endpart/assemble.bat @@ -0,0 +1,40 @@ +del endpart.exe +del "..\winuae\hd0\endpart.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +pushd .. + +tools\KingCon.exe @data/endpart/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\LSPConvert.exe data\music\desire_68k_tune3_v2.mod -setpos -v +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +vc -O2 -notmpfile -nostdlib -o "endpart.exe" "endpart.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy endpart.exe "..\winuae\hd0" +copy endpart.exe "..\winuae\hd0\a" + +@echo /|set /p =endpart.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/endpart/compile.bat b/source/endpart/compile.bat new file mode 100644 index 0000000..c32af1e --- /dev/null +++ b/source/endpart/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "endpart.exe" "endpart.asm" diff --git a/source/endpart/debug.bat b/source/endpart/debug.bat new file mode 100644 index 0000000..6aeddc6 --- /dev/null +++ b/source/endpart/debug.bat @@ -0,0 +1,21 @@ +del endpart.exe +del "..\winuae\hd0\endpart.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "endpart.exe" "endpart.asm" + +copy endpart.exe "..\winuae\hd0" +copy endpart.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =endpart.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/endpart/endpart.asm b/source/endpart/endpart.asm new file mode 100644 index 0000000..400b4ca --- /dev/null +++ b/source/endpart/endpart.asm @@ -0,0 +1,1077 @@ +; TODOs: +; - Add copper fade for top and bottom (use Frustro copperlist sorting) +; +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 1 +FW_MUSIC_PLAYER_CHOICE = 2 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker (CPU DMA wait), 5 = Pretracker Turbo (Copper wait) +FW_LMB_EXIT_SUPPORT = 0 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 0 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 308 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 0 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 0 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 1 + + ENDC + +ENDP_WIDTH = 320 +ENDP_HEIGHT = 180 +ENDP_PLANES = 6 + +SCREENSHOTS_WIDTH = 320 +SCREENSHOTS_HEIGHT = 1620+1*180 +SCREENSHOTS_PLANES = 2 + +SCT_WIDTH = 320 +SCT_HEIGHT = 224 +SCT_PLANES = 2 + +FONT_WIDTH = 8 +FONT_HEIGHT = 16 +FONT_PLANES = 2 + +COP_LIST_SIZE = (200)*4 + +PERM_MUSIC_SAMPLES = $dd52+4 + +CHIPMEM_SIZE = (COP_LIST_SIZE*2)+((SCREENSHOTS_WIDTH/8)*SCREENSHOTS_HEIGHT)*SCREENSHOTS_PLANES+((SCT_WIDTH/8)*(SCT_HEIGHT+1)*2) +FASTMEM_SIZE = 4 + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + + include "../framework/framework.i" + + +; Memory use: +; Playfields: +; - 320 x 180 x 24 = 172800 (6x2 db, 2 draw, 2 fill, 6 original, 2 spare) + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + UBYTE pd_DbToggle + ALIGNWORD + + BOOL pd_PartDone + + BOOL pd_LastLMB + + UWORD pd_TextYPos + UWORD pd_ClearTextYPos + UWORD pd_NextLineWait + APTR pd_TextLinePtr + UWORD pd_ScrollScreenYPos + UWORD pd_ScrollerPause + BOOL pd_HalfspeedScrolling + UWORD pd_TextWrapYPos + ULONG pd_ScreenshotsYOffset + UWORD pd_ScreenshotsScrollWaitCount + BOOL pd_ScreenshotsLoaded + ULONG pd_CopyLastScreenYPos + + APTR pd_ScreenshotsBuffer + APTR pd_ScreenshotsPackedFile + APTR pd_CopperList1 ; ds.b COP_LIST_SIZE + APTR pd_CopperList2 ; ds.b COP_LIST_SIZE + APTR pd_ScrollTextBuffer ; ds.b ((SCT_WIDTH/8)*SCT_HEIGHT)*2 + STRUCT pd_Palette,16*cl_SIZEOF + + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + bsr.s enp_init + + lea enp_copperlist,a0 + CALLFW SetCopper + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + move.l #part_music_data,fw_MusicData(a6) + move.l #part_music_smp,fw_MusicSamples(a6) + CALLFW StartMusic + ENDC + ELSE + CALLFW StartMusic + ENDC + + bsr enp_main + + CALLFW SetBaseCopper + + rts + +;-------------------------------------------------------------------- + +enp_init: + bsr enp_init_vars + bsr enp_clear_screen_buffers + + IFD FW_DEMO_PART + lea .loadscreenshots(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + ELSE + st pd_ScreenshotsLoaded(a6) + ENDC + rts + + IFD FW_DEMO_PART +.loadscreenshots + lea .screenshotfile(pc),a0 + CALLFW LoadFile + move.l a0,pd_ScreenshotsPackedFile(a6) + + move.l pd_ScreenshotsBuffer(a6),a1 + lea (SCREENSHOTS_WIDTH/8)*ENDP_HEIGHT*SCREENSHOTS_PLANES(a1),a1 + CALLFW DecompressZX0 + st pd_ScreenshotsLoaded(a6) + + CALLFW TrackloaderDiskMotorOff + rts + +.screenshotfile + dc.b "Screenshots.raw",0 + even + ENDC + +;-------------------------------------------------------------------- + +enp_init_vars: + tst.w fw_AgaChipset(a6) + beq.s .noaga + move.w #$00a0,enp_ddfstop+2 ; FIXME + move.w #$0003,enp_fmode+2 +.noaga + move.w #11,pd_ScrollScreenYPos(a6) + lea enp_scrolltext(pc),a0 + move.l a0,pd_TextLinePtr(a6) + + move.w #ENDP_HEIGHT+12,pd_TextYPos(a6) + move.w #ENDP_HEIGHT+12+16,pd_ClearTextYPos(a6) + move.w #SCT_HEIGHT,pd_TextWrapYPos(a6) + + move.l #(COP_LIST_SIZE*2),d0 + CALLFW AllocChip + PUTMSG 10,<"Copperlist 1 %p">,a0 + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + lea COP_LIST_SIZE(a0),a0 + PUTMSG 10,<"Copperlist 2 %p">,a0 + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + IFD FW_DEMO_PART + move.l #((SCREENSHOTS_WIDTH/8)*SCREENSHOTS_HEIGHT)*SCREENSHOTS_PLANES,d0 + CALLFW AllocChip + move.l a0,pd_ScreenshotsBuffer(a6) + ELSE + move.l #enp_screenshots,pd_ScreenshotsBuffer(a6) + ENDC + + move.l #((SCT_WIDTH/8)*(SCT_HEIGHT+1)*SCT_PLANES),d0 + CALLFW AllocChip + move.l a0,pd_ScrollTextBuffer(a6) + + rts + +;-------------------------------------------------------------------- + +enp_main: + moveq.l #16,d0 + moveq.l #0,d1 + lea pd_Palette(a6),a1 + CALLFW InitPaletteLerpSameColor + + moveq.l #16,d0 + move.w #32,d1 + lea enp_palette(pc),a0 + lea pd_Palette(a6),a1 + CALLFW FadePaletteTo + +.loop + CALLFW VSyncWithTask + + bsr enp_flip_db_frame + + CALLFW CheckMusicScript + + bsr enp_scroll_textscreen + + bsr enp_scroll_screenshots + + moveq.l #16,d0 + lea pd_Palette(a6),a1 + CALLFW DoFadePaletteStep + + move.l pd_CurrCopListPtr(a6),a0 + bsr enp_create_dp_copperlist + + bsr enp_update_copper_list_pointers + + tst.w pd_PartDone(a6) + bne.s .quit + btst #2,potgor(a5) + bne.s .loop + +.quit + rts + +;-------------------------------------------------------------------- + + +enp_flip_db_frame: + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + not.b pd_DbToggle(a6) + beq.s .selb1 + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + rts +.selb1 + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + rts + +;-------------------------------------------------------------------- + +enp_update_copper_list_pointers: + lea enp_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +enp_clear_screen_buffers: + move.l pd_ScrollTextBuffer(a6),a0 + moveq.l #0,d0 + BLTHOGON + BLTWAIT + BLTHOGOFF + + BLTCON_SET D,0,0,0 + move.w d0,bltdmod(a5) + + move.l a0,bltdpt(a5) + move.w #(SCT_WIDTH>>4)|((SCT_HEIGHT+1)*2<<6),bltsize(a5) + + move.l pd_ScreenshotsBuffer(a6),a0 + + BLTHOGON + BLTWAIT + + move.l a0,bltdpt(a5) + move.w #(SCREENSHOTS_WIDTH>>4)|((ENDP_HEIGHT*SCREENSHOTS_PLANES)<<6),bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +enp_scroll_screenshots: + tst.w pd_ScreenshotsLoaded(a6) + bne.s .cont +.skip rts +.cont + subq.w #1,pd_ScreenshotsScrollWaitCount(a6) + bpl.s .skip + move.w #2,pd_ScreenshotsScrollWaitCount(a6) + move.l pd_ScreenshotsYOffset(a6),d0 + move.l d0,d1 + moveq.l #(SCREENSHOTS_WIDTH/8)*SCREENSHOTS_PLANES,d2 + move.l #(SCREENSHOTS_WIDTH/8)*SCREENSHOTS_PLANES*(SCREENSHOTS_HEIGHT-ENDP_HEIGHT),d3 + add.l d2,d0 + cmp.l d3,d0 + bne.s .nowrap + moveq.l #0,d0 +.nowrap move.l d0,pd_ScreenshotsYOffset(a6) + move.l pd_CopyLastScreenYPos(a6),d0 + cmp.l #(SCREENSHOTS_WIDTH/8)*SCREENSHOTS_PLANES*ENDP_HEIGHT,d0 + beq.s .skip + tst.l d1 + beq.s .skip + move.l d1,pd_CopyLastScreenYPos(a6) + + move.l pd_ScreenshotsBuffer(a6),a0 + sub.l d2,d1 + adda.l d1,a0 + lea (a0,d3.l),a1 + + moveq.l #-1,d2 + moveq.l #0,d0 + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + move.l d2,bltafwm(a5) ; also fills bltalwm + move.l d0,bltamod(a5) + + move.l a1,bltapt(a5) + move.l a0,bltdpt(a5) + move.w #(SCREENSHOTS_WIDTH>>4)|((1*SCREENSHOTS_PLANES)<<6),bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +enp_scroll_textscreen: + btst #6,$bfe001 + beq.s .skip + sf pd_LastLMB(a6) + move.w pd_ScrollerPause(a6),d0 + subq.w #1,d0 + bmi.s .notpaused + move.w d0,pd_ScrollerPause(a6) + rts +.skip tst.w pd_LastLMB(a6) + bne.s .noclick + st pd_LastLMB(a6) +.noclick + rts + +.notpaused + tst.w pd_HalfspeedScrolling(a6) + beq.s .nohalfspeed + move.w #1,pd_ScrollerPause(a6) +.nohalfspeed + move.w pd_ScrollScreenYPos(a6),d0 + addq.w #1,d0 + cmp.w pd_TextWrapYPos(a6),d0 + bne.s .nowrap + moveq.l #0,d0 +.nowrap move.w d0,pd_ScrollScreenYPos(a6) + + move.l pd_ScrollTextBuffer(a6),a1 + move.w pd_ScrollScreenYPos(a6),d2 + subq.w #2,d2 + bpl.s .nogotobottom + add.w pd_TextWrapYPos(a6),d2 +.nogotobottom + lsl.w #4,d2 ;*16 + adda.w d2,a1 + lsl.w #2,d2 ;*64 + adda.w d2,a1 + + BLTHOGON + BLTWAIT + BLTHOGOFF + + moveq.l #0,d0 + BLTCON_SET D,0,0,0 + move.w d0,bltdmod(a5) + + move.l a1,bltdpt(a5) + move.w #(SCT_WIDTH>>4)|((1*SCT_PLANES)<<6),bltsize(a5) + ;rts + +enp_write_textline: + ;tst.w pd_ScrollerPause(a6) + ;bne.s .paused + subq.w #1,pd_NextLineWait(a6) + bmi.s .nextline +.paused + rts + +.halfspeed + eor.w #1,pd_HalfspeedScrolling(a6) + bra.s .retrychar + +.nextline + + PUTMSG 40,<"%d: NL">,fw_FrameCounterLong(a6) + move.l pd_TextLinePtr(a6),a0 +.retrychar + tst.b (a0) + bne.s .nowrap + st pd_PartDone(a6) + lea enp_scrolltext(pc),a0 +.nowrap bpl.s .startcounting + moveq.l #0,d0 + move.b (a0)+,d0 + cmp.b #$ff,d0 + beq.s .halfspeed + lsl.b #1,d0 + lsl.w #2,d0 + move.w d0,pd_ScrollerPause(a6) + bra.s .retrychar + +.startcounting + move.l a0,a1 + moveq.l #0,d0 + moveq.l #FONT_HEIGHT,d2 + +.countlinelength + tst.b (a1) + beq.s .done + move.b (a1)+,d1 + cmp.b #10,d1 + beq.s .done + cmp.b #5,d1 + beq.s .halfdone + addq.w #1,d0 + bra.s .countlinelength + +.halfdone + moveq.l #FONT_HEIGHT/2,d2 +.done move.l a1,pd_TextLinePtr(a6) + move.w d0,d7 + beq.s .skipline + + moveq.l #-1,d3 + BLTHOGON + BLTWAIT + BLTCON_SET A,0,0,0 + move.l #$ff000000,bltafwm(a5) ; also fills bltalwm + move.w d3,bltadat(a5) + move.l #(((SCT_WIDTH-16)/8-2)<<16)|(-2&$ffff),bltcmod(a5) + move.w #((SCT_WIDTH-16)/8-2),bltdmod(a5) + + move.w #SCT_WIDTH/2,d1 + lsl.w #2,d0 + sub.w d0,d1 + PUTMSG 30,<"XPos %d">,d1 + + move.l pd_ScrollTextBuffer(a6),a3 + move.w pd_TextYPos(a6),d3 + lsl.w #4,d3 ;*16 + adda.w d3,a3 + lsl.w #2,d3 ;*64 + adda.w d3,a3 + + subq.w #1,d7 +.letterloop + moveq.l #0,d0 + move.b (a0)+,d0 + move.w d1,d3 + lsr.w #4,d3 + add.w d3,d3 + lea (a3,d3.w),a1 + bsr enp_write_letter + addq.w #8,d1 + dbra d7,.letterloop +.skipline + move.w d2,d0 + add.w pd_TextYPos(a6),d2 + cmp.w #SCT_HEIGHT-FONT_HEIGHT,d2 + ble.s .noscrwrap + move.w d2,pd_TextWrapYPos(a6) + moveq.l #0,d2 +.noscrwrap + move.w d2,pd_TextYPos(a6) + subq.w #1,d0 + move.w d0,pd_NextLineWait(a6) + rts + +; d0=letter, d1=xpos +enp_write_letter: + sub.w #' ',d0 + lsl.w #6,d0 ; 2*FONT_HEIGHT*FONT_PLANES + lea enp_font_data,a2 + adda.w d0,a2 + + move.w #(2)|((FONT_HEIGHT*FONT_PLANES)<<6),d3 + + moveq.l #15,d5 + and.w d1,d5 + ror.w #4,d5 + + move.w #BLTEN_BCD|(((BLT_A&BLT_B)|(BLT_C&~BLT_A))&$ff),d4 + or.w d5,d4 + swap d4 + move.w d5,d4 + + BLTHOGON + BLTWAIT + BLTHOGOFF + move.l d4,bltcon0(a5) + + move.l a2,bltbpt(a5) + move.l a1,bltcpt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + rts + +;-------------------------------------------------------------------- + +enp_create_dp_copperlist: + COPIMOVE $4200,bplcon0 + move.l #$5107fffe,(a0)+ + moveq.l #-2,d3 + + move.w #bplpt,d1 + move.l pd_ScreenshotsBuffer(a6),d0 + add.l pd_ScreenshotsYOffset(a6),d0 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #6,d1 + + add.l #(SCREENSHOTS_WIDTH/8),d0 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #6,d1 + + move.w #bplpt+4,d1 + + move.w pd_ScrollScreenYPos(a6),d2 + lsl.w #4,d2 ; *16 + move.w d2,d0 + lsl.w #2,d2 ; *64 + add.w d2,d0 + ext.l d0 + add.l pd_ScrollTextBuffer(a6),d0 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #6,d1 + + add.l #(SCT_WIDTH/8),d0 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + + move.w pd_TextWrapYPos(a6),d0 + move.w d0,d1 + sub.w #ENDP_HEIGHT,d0 + sub.w pd_ScrollScreenYPos(a6),d0 + bpl.s .skipwrap + add.w #$51+ENDP_HEIGHT,d0 + lsl.w #8,d0 + bcc.s .no255 + move.l #$ffdffffe,(a0)+ +.no255 + addq.w #7,d0 + + move.w d0,(a0)+ + move.w d3,(a0)+ + move.w #bpl2mod,(a0)+ + mulu.w #(SCT_WIDTH/8)*2,d1 + neg.w d1 + add.w #(SCT_WIDTH/8),d1 + move.w d1,(a0)+ + add.w #$100,d0 + bcc.s .no255_2 + move.l #$ffdffffe,(a0)+ +.no255_2 + move.w d0,(a0)+ + move.w d3,(a0)+ + move.w #bpl2mod,(a0)+ + move.w #(SCT_WIDTH/8),(a0)+ +.skipwrap + + lea pd_Palette(a6),a1 + move.w #color,d0 + moveq.l #16-1,d7 +.palloop + move.w d0,(a0)+ + move.w cl_Color(a1),(a0)+ + lea cl_SIZEOF(a1),a1 + addq.w #2,d0 + dbra d7,.palloop + + move.l d3,(a0) ; COP_END + rts + +;******************************************************************** + +enp_scrolltext: + dc.b 10 + dc.b "This is the end of",10,5 + dc.b "---===*** HAMAZING ***===---",10 + dc.b "(post party version)",10 + dc.b "A one-disk trackmo",10,5 + dc.b "originally released at",10,5 + dc.b "68k Inside 2023",10,5 + dc.b "for OCS/ECS Amiga",10 + dc.b "7 MHz 68000",10 + dc.b "512 kb chip + 512 kb slow",10 + dc.b $80+25 + dc.b 10,10,10,10 + dc.b "* Graphics *",10,5 + dc.b "Optic",10 + dc.b 10,5 + dc.b "* Music *",10,5 + dc.b "mA2E",10 + dc.b 10,5 + dc.b "* Code *",10,5 + dc.b "Platon",10,5 + dc.b $80+25 + dc.b 10,10 + dc.b "* HAM tech announcer *",10 + dc.b "psenough",10 + dc.b 5 + dc.b "* Additional graphics / photos *",10 + dc.b "Platon",10 + dc.b 5 + dc.b "* Additional code *",10 + dc.b "Leonard / Oxygene (LightSpeedPlayer)",10 + dc.b "Einar Saukas (ZX0 technology)",10 + dc.b "Emmanuel Marty (orig. ZX0 decruncher)",10 + dc.b "a/b (sine table routine)",10 + dc.b 5,$80+15,10 + dc.b 10,10,10 + dc.b "'Hamazing' and 'Hamphrey' puns",10 + dc.b "courtesy of Grip / Istari",10 + dc.b 10,10,10 + dc.b 10,10,10 + dc.b "LMB pauses scroller",10 + dc.b "RMB restarts demo!",10,10,10 + dc.b 10,10,10 + dc.b 10,10,10 + dc.b 10,10,10 + dc.b 10,10,10 + dc.b $ff + dc.b "mA2E at the keyboard..." + dc.b 10,10,10 + dc.b "Thanks for watching the demo.",10 + dc.b "Hope you like it. Greetings to all my",10 + dc.b "friends in the demoscene, and also to my",10 + dc.b "wife that let me sit hours after hours",10 + dc.b "composing.",10,10 + dc.b "Also I would like to say thanks to the",10 + dc.b "whole Amiga community and their support",10 + dc.b "and inspiration.",10,10 + dc.b "Without you, I would have stopped making",10 + dc.b "music many many years ago.",10,10 + dc.b "Stay tuned for more intros and demos",10 + dc.b "from us.",10,10 + dc.b "Thats all from me. Enjoy the party.",10 + dc.b "Until next time, keep on creating",10 + dc.b "awesome stuff for the Amiga,",10 + dc.b "which we all love.",10,10 + dc.b "If you want to get in touch with me,",10 + dc.b "drop me an email at stian-g@online.no",10 + dc.b "or at Discord mA2E / dSr#1261." + dc.b 10,10,10 + dc.b "$%%&",10,10 + dc.b "Optic on the keys.",10,10 + dc.b "Seems time is eluding me as always. Been",10 + dc.b "meaning to do a whole bunch of personal",10 + dc.b "greets and messages, like the good old",10 + dc.b "days, for many a scroller now",10 + dc.b "$%%% %%% %%&",10,10 + dc.b "Alas, it's not happening this time",10 + dc.b "either... hugs and kisses to",10 + dc.b "Planet.Jazz, Focus Design, Talent,",10 + dc.b "Proxima, Desire, Nah, Resistance and so",10 + dc.b "on and so forth $",10,10 + dc.b "Thanks to Platon for bringing me onto",10 + dc.b "this project, it's been fun. Had a great",10 + dc.b "time producing true colour graphics with",10 + dc.b "the wacom, as opposed to purely pushing",10 + dc.b "pixels in DP. Most of the stuff here is",10 + dc.b "WIP, as I am suffering some true colour",10 + dc.b "ringrust. Hopefully there will be time",10 + dc.b "to fix up some stuff post-party.",10,10 + dc.b "Optic out.. Much love!" + dc.b 10,10,10 + dc.b "Platon at the keyboard..." + dc.b 10,10,10 + dc.b "This is the successor to",10,10 + dc.b "*** Ham Eager *** ",10,10 + dc.b "the demo that started the HAM madness",10 + dc.b "two years ago.",10,10 + dc.b "Unfortunately, it did not spark many",10 + dc.b "new HAM effects by other people :-(",10,10 + dc.b "This time we got some cool graphics",10 + dc.b "from a real graphic artist and some",10 + dc.b "really good music, too.",10 + dc.b 10 + dc.b "Some will be disappointed about the",10 + dc.b "reduced amount of coder colors...",10 + dc.b 10 + dc.b "# ... you cannot please them all #",10 + dc.b 10,10,10 + dc.b "Big big big thanks must go out to mA2E",10 + dc.b "and Optic for their great work and that",10 + dc.b "they are absolute reliable people.",10,10 + dc.b "However, they seem to work best under",10 + dc.b "pressure of the deadline...",10 + dc.b 10,10 + dc.b "Also thanks to Virgill for feedback and",10 + dc.b "testing some early effects.",10 + dc.b 10,10 + dc.b "### Personal greetings ###",10,10 + dc.b "4play, Accidental, Alex, Alis, Anders",10 + dc.b "Arrakis, Axis, Bartman, Bifat, Bonefish",10 + dc.b "Dan, Don Pu, Chellomere, Critikill",10 + dc.b "Daddy Freddy, Dascon, Dexter, DJ H0ffman",10 + dc.b "Evil, Facet, FloKi, Florist, Gasman",10 + dc.b "Greippi, Grip, Ham, Hedning, Heike",10 + dc.b "Jeenio, Jesko, Jonna, Johanna, Karla",10 + dc.b "Kirsten, Krill, Lee, Leonard, LFT, Losso",10 + dc.b "Leuat, MacMissAnn, Magic, Maze, Merry",10 + dc.b "Mirrorbird, Mop, Mystra, No9, Nosferatu",10 + dc.b "Nyingen, OhLi, Optic, Pellicus, Pestis",10 + dc.b "Peter, Phreedh, Pink, Pit, psenough",10 + dc.b "Prowler, RamonB5, Rakhee, Rapture, rez",10 + dc.b "Rog_VF, Ronan, Serpent, Shoe",10 + dc.b "Sir Garbagetruck, Slash, Soundy, spkr",10 + dc.b "Starchaser, STC, Stinsen, Sudoism",10 + dc.b "Superogue, TDK, Tezar, Tobi G.",10 + dc.b "Toni Wilen, Virgill, XXX, Yoruq, Zoi",10 + dc.b "Zoner",10,10,10 + dc.b "... and to my beloved wife and kid",10 + dc.b "who supported me while I spent many",10 + dc.b "days and nights in front of the Amiga.",10 + dc.b 10,10,10 + dc.b "We didn't manage to put all demogroups",10 + dc.b "onto the graphics, but please feel",10 + dc.b "our love nevertheless!" + dc.b 10,10,10,10,10,10,10,10,10,10,10 + dc.b "THE END",10,10 + dc.b "(or, if you're interested, some",10 + dc.b "tech tech coming up...)",10 + dc.b 10,10,$80+60 + dc.b 10,10,10,10,10,10,10,10,10,10,10,10 + dc.b "* Trackloader / Framework *",10,10 + dc.b "After Ham Eager, and several intros,",10 + dc.b "I rewrote much of the framework that",10 + dc.b "was originally based on Axis' work",10 + dc.b "from Planet Rocklobster #",10,10 + dc.b "Now both local variables of your part",10 + dc.b "and those of the firmware are accessed",10 + dc.b "through the same base register. Nice!",10,10 + dc.b "The multitasking has been rewritten",10 + dc.b "and now allows an arbitrary number of",10 + dc.b "tasks with priorities and optional",10 + dc.b "round robin.",10,10 + dc.b "The framework comes with several new",10 + dc.b "features such as blitter queues and",10 + dc.b "blitter tasks, LSP and Pretracker",10 + dc.b "playback, ZX0 decrunching, better",10 + dc.b "memory management and so on...",10,10 + dc.b "It's the things that you don't see, like",10 + dc.b "calculating true color data or speedcode",10 + dc.b "and loading more stuff from disk in the",10 + dc.b "background that make this demo fancy.",10,10 + dc.b "Once I have the time to document the",10 + dc.b "stuff, I will make it public.",10,10 + dc.b 10,10,"----",10,10,10 + dc.b "* Gotham (1200 LOC) *",10,10 + dc.b "As a nod to Batman Group's fantastic",10 + dc.b "Batman Rises demo, I wanted to have",10 + dc.b "an early loading screen, that slightly",10 + dc.b "resembles their work. Little did I know",10 + dc.b "that Losso had a similar idea with his",10 + dc.b "winning demo at Revision.",10,10 + dc.b "Anyway, the code uses the anti-aliased",10 + dc.b "blitter line drawing from Frustro.",10,10 + dc.b "The voice-over is from one of psenough's",10 + dc.b "recent YouTube hype videos where he",10 + dc.b "mentions Ham Eager and tries to explain",10 + dc.b "what's special about it.",10,10 + dc.b "Kudos for doing that! I just found it",10 + dc.b "very cute how he was talking about",10 + dc.b 10,"* The HAM Technology *",10,10 + dc.b "that I just had to make a little joke",10 + dc.b "out of it. I hope you don't mind :)",10 + dc.b 10,10,"----",10,10,10 + dc.b "* Bulb/Lamp/Sofa (3700 LOC) *",10,10 + dc.b "I started coding this effect about a",10 + dc.b "year ago, further exploring the",10 + dc.b "possibilities of the mode one could call",10 + dc.b "'extra-halfbright-HAM' (I recently saw",10 + dc.b "a demo from a couple of years ago that",10 + dc.b "uses a similar thing to blend in a HAM",10 + dc.b "picture).",10,10 + dc.b "The main problem was to reduce the",10 + dc.b "required number of blits to do the",10 + dc.b "compositing of the three shades to",10 + dc.b "a minimum.",10,10 + dc.b "Still it requires about 200 very unique",10 + dc.b "blits for one new image.",10 + dc.b "It was very hard to keep it running at",10 + dc.b "a rate of constant 25 Hz.",10,10 + dc.b "There is a lot of ahead-of-time blitter",10 + dc.b "queue calculation here and you might",10 + dc.b "notice how slow the disk keeps loading",10 + dc.b "during the effect because, well, not",10 + dc.b "much time left to do so.",10,10 + dc.b "The lamp and the text are sprites, the",10 + dc.b "rotations of the lamp are calculated",10 + dc.b "at the beginning of the effect while",10 + dc.b "the lamp is still off-screen.",10,10 + dc.b "It's funny how a basic effect takes",10 + dc.b "80 percent of your time and then",10 + dc.b "designing stuff around it takes",10 + dc.b "another 80 percent :)",10 + dc.b 10,10,"----",10,10,10 + dc.b "* STHam (1800 LOC) *",10,10 + dc.b "Originally planned to be showing a",10 + dc.b "sliced, temporal (spatial) dithered",10 + dc.b "HAM picture with a scroller on top,",10 + dc.b "the palette color switching had to",10 + dc.b "go due to copper timing issues.",10,10 + dc.b "What's left is a bent sprite scroller",10 + dc.b "(inspired by the C64 demo",10 + dc.b "The Shores of Reflection by Shape)",10 + dc.b "that uses two blits to do a shearing",10 + dc.b "operation -- this is a new approach",10 + dc.b "to me. Fun!",10,10 + dc.b "There was plenty of CPU time left to",10 + dc.b "make the scroller reappear, but",10 + dc.b "unfortunately, the motif didn't quite",10 + dc.b "allow this.",10,10 + dc.b "Okay, there is still this temporal",10 + dc.b "dithering for extra smooth gradients.",10 + dc.b "(Basically it's a 15 bits image.)",10,10 + dc.b "The intro transition is a new thing,",10 + dc.b "the sprite curtain is more or less",10 + dc.b "taken from Ham Eager.",10 + dc.b 10,10,"----",10,10,10 + dc.b "* Kaleidoscope (6400 LOC) *",10,10 + dc.b "Ever since I watched Rule 30 by",10 + dc.b "Andromeda, I thought: This kaleidoscope",10 + dc.b "effect looks cool! But it should be",10 + dc.b "possible to do it in HAM, right?",10,10 + dc.b "So here you are: Not only running in",10 + dc.b "constant 25 Hz in 320x180, but also",10 + dc.b "flipping the graphics to six different",10 + dc.b "gradients.",10,10 + dc.b "The kaleidoscope uses three textures of",10 + dc.b "256x256 pixels for three rotations each.",10,10 + dc.b "Optic has somehow managed that the",10 + dc.b "textures use over 4000 colors! Wow!",10,10 + dc.b "Calculating the necessary true color",10 + dc.b "representation takes a whopping 384 KB",10 + dc.b "of slow ram. I had forgotten to multiply",10 + dc.b "times two when I started designing the",10 + dc.b "effect 8-O",10,10 + dc.b "The intro/outro noise transition of the",10 + dc.b "effect uses repeating sprite overlays.",10,10 + dc.b "The party version was missing the fairy",10 + dc.b "dust and wand effect as",10 + dc.b "originally planned.",10,10 + dc.b "The part is now interactive",10 + dc.b "if you move your mouse.",10 + dc.b 10,10,"----",10,10,10 + dc.b "* Hexagon (900 LOC) *",10,10 + dc.b "After all free memory had been exhausted",10 + dc.b "I needed a transition effect to preload",10 + dc.b "the next part with the new music.",10,10 + dc.b "I had this copper chunky thing lying",10 + dc.b "around for a year or so -- so I thought",10 + dc.b "I could do my first Amiga Rotozoomer.",10,10 + dc.b "The kaleidoscope texture was still left",10 + dc.b "in memory, so why not invert it (for",10 + dc.b "free, 'cause Blitter!) and use that?",10,10 + dc.b "The twist about this effect is that it",10 + dc.b "uses extra-halfbright mode, but without",10 + dc.b "any display DMA active!",10,10 + dc.b "This means every second cycle is still",10 + dc.b "available for the CPU or blitter.",10,10 + dc.b "There are some things I want to explore",10 + dc.b "further about this new mode with its",10 + dc.b "own limitations, but it was time to get",10 + dc.b "it out to see the light of day.",10 + dc.b 10,10,"----",10,10,10 + dc.b "* Rubbercube (3000 LOC) *",10,10 + dc.b "This is again a filler effect that was",10 + dc.b "needed to get time music timing sync to",10 + dc.b "the break and the cat cue.",10,10 + dc.b "It is of course based on the G. Rowdy",10 + dc.b "gouraud cube, but this one is smaller",10 + dc.b "and uses 16 shades.",10,10 + dc.b "It is smaller to fit in 264 KB of chip",10 + dc.b "ram required to store 33 frames of",10 + dc.b "animation to make it a rubbercube.",10,10 + dc.b "The second palette is a nod to Variform",10 + dc.b "(again).",10 + dc.b 10,10,"----",10,10,10 + dc.b "* Virgillbars (3300 LOC) *",10,10 + dc.b "The name came from Virgill telling me",10 + dc.b "that he wanted to have a rotating bars",10 + dc.b "effect in my next demo, like the ones in",10 + dc.b "Interference by Sanity.",10,10 + dc.b "Also, Nosferatu wrote in his tech",10 + dc.b "write-up about his Fat Circuits intro",10 + dc.b "that he would leave the HAM stuff to me",10 + dc.b "and did EHB bars instead.",10,10 + dc.b '"Hold my beer."',10,10 + dc.b "The tricky thing is how to calculate",10 + dc.b "a line of optimal HAM pixels fast",10 + dc.b "enough and how to do the saturation and",10 + dc.b "math involved.",10,10 + dc.b "In Ramontic Getaway, I had a chunky",10 + dc.b "copper display but used the blitter to",10 + dc.b "perform 30 bit true color saturation",10 + dc.b "and 12 bit result calculation.",10 + dc.b "So I took it from there.",10,10 + dc.b "As for the HAM pixel calculation:",10 + dc.b "This is of course table-assisted but",10 + dc.b "does use a few clever tricks or so.",10 + dc.b "To be able to rotate the bars, the line",10 + dc.b "has to be pretty wide.",10,10 + dc.b "Next time: Full rotation",10,10 + dc.b "Also: HAM. You need to fix the left",10 + dc.b "border. If you see some shit there",10 + dc.b "running in WinUAE emulation, you need",10 + dc.b "to get the latest WinUAE 5.x.x version!",10,10 + dc.b "The overlays texts are taken from",10 + dc.b "'Addition of Light Divided'",10 + dc.b "by Tori Amos.",10 + dc.b 10,10,"----",10,10,10 + dc.b "* Blend (5800 LOC) *",10,10 + dc.b "In Shuffling around the Christmas Tree",10 + dc.b "I explored the possibilities of hacking",10 + dc.b "HAM pictures into pieces without",10 + dc.b "fringing. Taking some of the stuff I",10 + dc.b "learned from there and applying it to",10 + dc.b "some other shapes. The original main",10 + dc.b "effect (a wavy line) didn't make it",10 + dc.b "into the demo.",10,10 + dc.b "Still you get some fading 'between' HAM",10 + dc.b "images and transition effects that",10 + dc.b "should not be possible.",10,10 + dc.b "Does not use BresenHAM's circle drawing",10 + dc.b "but the recently published method by",10 + dc.b "C64 programmer Jesko, who invented a",10 + dc.b "slightly faster drawing method in 1986.",10,10 + dc.b "Main problem here is to keep five full",10 + dc.b "screen buffers in memory (210 KB) plus",10 + dc.b "the necessary true color data (337 KB)",10 + dc.b "plus the generated speedcode, data and",10 + dc.b "masks for the 47 circles.",10,10 + dc.b "It's funny how many effects in this demo",10 + dc.b "are actually quite memory-bound.",10,10 + dc.b "As the logo graphics only turned up",10 + dc.b "a day before the deadline, and I had",10 + dc.b "assumed the logo to be a non-HAM gfx,",10 + dc.b "the fading had to be removed at short",10 + dc.b "notice. Now it's back again.",10 + dc.b 10,10,"----",10,10,10 + dc.b "* Endpart (900 LOC) *",10,10 + dc.b "Originally planned to be completely",10 + dc.b "different, but the time just ran out.",10 + dc.b "As there was still space left on the",10 + dc.b "disk, the background images is just a",10 + dc.b "huge bitmap of 128 KB.",10 + dc.b 10,10,10,10 + dc.b 10,10,10,10 + dc.b "That's it. So many planned parts didn't",10 + dc.b "make it into this demo, but we are",10 + dc.b "still glad how it came out.",10,10,10 + dc.b "We hope you enjoyed it as much",10 + dc.b "as we did making it!",10 + dc.b 10,10,10,10 + dc.b 10,10,10,10 + dc.b 10,10,10,10 + dc.b "Wrapping back to start in...",10,10 + dc.b "3",10,10 + dc.b "2",10,10 + dc.b "1",10,10 + dc.b 0 + even + + ; bg playfield 0/2 (0,1,4,5), text playfield 1/3 (0,2,8,10) +enp_palette: + dc.w $345,$456,$fff,$fff,$567,$678,$fff,$fff + dc.w $acd,$bde,$000,$111,$cee,$def,$222,$333 + +;-------------------------------------------------------------------- + + section "enp_copper",data,chip + +enp_copperlist: + COP_MOVE dmacon,DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + COP_MOVE diwstrt,$5281 ; window start + COP_MOVE diwstop,$06c1 ; window stop + COP_MOVE ddfstrt,$0038 ; bitplane start +enp_ddfstop: + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon3,$0c00 +enp_fmode: + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + + COP_MOVE bplcon0,$0200 + COP_MOVE bplcon1,$0000 + COP_MOVE bplcon2,$0044 ; sprites in front, playfield 2 has priority + COP_MOVE bpl1mod,(SCREENSHOTS_WIDTH/8)*SCREENSHOTS_PLANES-(SCREENSHOTS_WIDTH/8) + COP_MOVE bpl2mod,(SCT_WIDTH/8)*SCT_PLANES-(SCT_WIDTH/8) + +enp_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +enp_font_data: + incbin "../data/endpart/PJZ_font_8x16x4.BPL" + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + section "part_music_samples",data,chip ; section for music playback +part_music_smp: + incbin "../data/music/desire_68k_tune3_v2.lsbank" + section "part_music_data",data ; section for music playback +part_music_data: + incbin "../data/music/desire_68k_tune3_v2.lsmusic" + ENDC + section "enp_screenshots",data,chip +enp_screenshots: + ds.b ((SCREENSHOTS_WIDTH/8)*ENDP_HEIGHT)*SCREENSHOTS_PLANES + incbin "../data/endpart/screenshots_320x1620.BPL" + ENDC + END \ No newline at end of file diff --git a/source/endpart/record.bat b/source/endpart/record.bat new file mode 100644 index 0000000..0f72542 --- /dev/null +++ b/source/endpart/record.bat @@ -0,0 +1,30 @@ +del endpart.exe +del "..\winuae\hd0\endpart.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "endpart.exe" "endpart.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy endpart.exe "..\winuae\hd0" +copy endpart.exe "..\winuae\hd0\a.exe" + +@echo /|set /p =endpart.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_rec.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/framework/assemble_bootblock.bat b/source/framework/assemble_bootblock.bat new file mode 100644 index 0000000..cdcf08f --- /dev/null +++ b/source/framework/assemble_bootblock.bat @@ -0,0 +1,10 @@ +del bootblock + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +..\tools\vasmm68k_mot -m68010 -Fbin -o bootblock -I"%~dp0/../includes" bootblock.asm + +pause diff --git a/source/framework/bootblock.asm b/source/framework/bootblock.asm new file mode 100644 index 0000000..168ac3c --- /dev/null +++ b/source/framework/bootblock.asm @@ -0,0 +1,83 @@ +; Bootblock by Chris 'platon42' Hodges. + + opt p+,o+ + +DEBUG_DETAIL set 0 + +FW_DIRECTORY_ENTRIES_OFFSET = 512 + + include "exec/execbase.i" + include "exec/io.i" + include "exec/memory.i" + include "exec/macros.i" + + include "hardware/adkbits.i" + include "hardware/cia.i" + include "hardware/custom.i" + include "hardware/dmabits.i" + include "hardware/intbits.i" + + include "lvo/lvo.i" + +_start: + dc.b 'D','O','S',0 ; disk type + dc.l 0 ; checksum 'PLAT' + dc.b 'ON42' ; root block 'ON42' + +_entrypoint: + ; Because this is a bootblock, we will have ExecBase in a6 here + ; a1 is IO-Request + PUSHM d2/a2-a3 ; keep registers safe, otherwise bootstrap will crash + move.l a1,a3 + lea _start+FW_DIRECTORY_ENTRIES_OFFSET+20(pc),a2 ; de_MemorySize + move.l (a2)+,d0 + PUTMSG 10,<"Alloc %ld bytes">,d0 + moveq.l #MEMF_ANY,d1 + CALL AllocMem + move.l d0,-(sp) + beq.s .error + + move.l (a2)+,IO_OFFSET(a3) ; de_DiskOffset + move.l (a2)+,d0 ; de_DiskLength + add.w #511,d0 + and.w #-512,d0 ; round to 512 block size + move.l d0,IO_LENGTH(a3) + + moveq.l #MEMF_CHIP,d1 + CALL AllocMem + move.l d0,-(sp) + bne.s .good +.error move.w #$f00,$dff180 + bra.s .error +.good + PUTMSG 10,<"Loading %ld from offset %ld to %p">,IO_LENGTH(a3),IO_OFFSET(a3),d0 + move.l d0,IO_DATA(a3) + + move.l a3,a1 + CALL DoIO + tst.l d0 + bne.s .error + + move.l (sp)+,a0 + move.l (sp),a1 + PUTMSG 10,<"Decrunching %p to %p">,a0,a1 + bsr.s zx0_decompress ; a3 not trashed + + PUTMSG 10,<"FreeMem %p">,a1 + move.l IO_DATA(a3),a1 + move.l IO_LENGTH(a3),d0 + CALL FreeMem + + cmp.w #37,LIB_VERSION(a6) + blo.s .lameos + CALL CacheClearU +.lameos + +.execute + move.l (sp)+,a0 ; execute this! + PUTMSG 10,<"Returning %p for execution">,a0 + POPM + moveq.l #0,d0 ; no error + rts + + include "unpackers/zx0.asm" diff --git a/source/framework/framework.asm b/source/framework/framework.asm new file mode 100644 index 0000000..402ed34 --- /dev/null +++ b/source/framework/framework.asm @@ -0,0 +1,108 @@ +; PLaTOS 2.0 (22-May-23) by Chris 'platon42' Hodges (unless stated). + + ; link all parts together depending on the settings + + include "../framework/framework.i" + + IF FW_STANDALONE_FILE_MODE + include "../framework/os_startupcode.asm" + ELSE + include "../framework/trackmo_startupcode.asm" + ENDC + + include "../framework/framework_misc.asm" + + IF FW_MULTITASKING_SUPPORT + include "../framework/framework_tasks.asm" + ENDC + + IF FW_BLITTERQUEUE_SUPPORT + include "../framework/framework_blitterqueue.asm" + ENDC + + IF FW_DYNAMIC_MEMORY_SUPPORT + include "../framework/framework_memory.asm" + ENDC + + IF FW_MUSIC_SUPPORT + include "../framework/framework_music.asm" + ENDC + + IF FW_MULTIPART_SUPPORT + include "../framework/framework_multipart.asm" + ENDC + + IF FW_SINETABLE_SUPPORT + include "../framework/framework_sinetable.asm" + ENDC + + IF FW_SCRIPTING_SUPPORT + include "../framework/framework_scripting.asm" + ENDC + + IF FW_PALETTE_LERP_SUPPORT + include "../framework/framework_palettelerp.asm" + ENDC + + IFEQ FW_STANDALONE_FILE_MODE + include "../framework/framework_trackloader.asm" + include "../framework/framework_dos.asm" + ELSE + IF FW_HD_TRACKMO_MODE + include "../framework/framework_hdloader.asm" + include "../framework/framework_dos.asm" + ENDC + ENDC + + IF FW_MUSIC_SUPPORT + IFNE FW_MUSIC_PLAYER_CHOICE==0 + include "../framework/musicplayers/player_none.asm" + ENDC + IFNE FW_MUSIC_PLAYER_CHOICE==1 + include "../framework/musicplayers/player_lsp_vbl.asm" + ENDC + IFNE FW_MUSIC_PLAYER_CHOICE==2 + include "../framework/musicplayers/player_lsp_cia.asm" + ENDC + IFNE FW_MUSIC_PLAYER_CHOICE==3 + fail "Sorry, P61 not ported to this framework (yet). Use LSP instead." + ENDC + IFNE (FW_MUSIC_PLAYER_CHOICE==4)|(FW_MUSIC_PLAYER_CHOICE==5) + ;include "../framework/musicplayers/player_pretracker_std.asm" + include "../framework/musicplayers/player_raspberry_casket.asm" + ENDC + ENDC + + IF FW_LZ4_SUPPORT +fw_DecompressLZ4: + include "../framework/unpackers/lz4_normal.asm" + ENDC + IF FW_ZX0_SUPPORT +fw_DecompressZX0: + ;include "../framework/unpackers/zx0.asm" + include "../framework/unpackers/zx0_faster.asm" + ENDC + IF FW_DOYNAX_SUPPORT +fw_DecompressDoynax: + include "../framework/unpackers/doynax.asm" + ENDC + + include "../framework/framework_chip_section.asm" + + IF FW_STANDALONE_FILE_MODE + ; framework structure is allocated from RAM and pointer is placed here + ; for IRQ routines to access it. +fw_BasePtr: + dc.l 0 + + ELSE + ; framework structure is stored here with a minimal LVO table. + ; Pointer to base is stored here for IRQ routines to access it. +fw_BasePtr: + dc.l 0 + + bra.w fw_InitPart ; make init part reachable from base framework + nop +fw_Base: + ds.b fw_SIZEOF + ENDC diff --git a/source/framework/framework.i b/source/framework/framework.i new file mode 100644 index 0000000..321806b --- /dev/null +++ b/source/framework/framework.i @@ -0,0 +1,306 @@ + IFND FRAMEWORK_I +FRAMEWORK_I SET 1 + + include "../includes/hardware/custom.i" + include "../includes/hardware/copper.i" + include "../includes/hardware/cia.i" + include "../includes/hardware/intbits.i" + include "../includes/hardware/dmabits.i" + include "../includes/hardware/adkbits.i" + include "../includes/hardware/blitbits.i" + include "../includes/exec/types.i" + include "../includes/exec/nodes.i" + include "../includes/exec/lists.i" + include "../includes/exec/macros.i" + include "../includes/exec/execbase.i" + include "../includes/dos/doshunks.i" + include "../includes/lvo/lvo.i" + include "../framework/framework_macros.i" + +FWGENLVOTABLE SET 0 + include "../framework/framework_lvos.i" + +; error color codes +ERROR_OUTOFMEMORY = $0f00 ; one of the memory stacks ran out of memory +ERROR_MEMORYWRONGPOP = $0f80 ; nothing to pop the current direction +ERROR_INVALID_PARAMS = $0ff0 ; one of the api functions was called with invalid parameters +ERROR_TOOMANYHUNKS = $00f0 ; the executable has too many hunks. see: MAX_HUNKS +ERROR_HUNKBROKEN = $000f ; one of the executables hunks is broken (e.g. header or compressed hunk). +ERROR_DISK = $00ff ; error loading via trackloader +ERROR_FILE_NOT_FOUND = $0088 ; expected file not found + +DEFB_MORE_HUNKS = 15 ; must be sign bit +DEFF_MORE_HUNKS = (1<0 -> LoadSeg, otherwise simple data file + ULONG de_MemorySize ; memory needed + ULONG de_DiskOffset ; offset on disk (or 0 if BSS) + ULONG de_DiskLength ; load size + LABEL de_SIZEOF ; 32 -> up to 16 files per block + ENDC + + IF FW_BLITTERQUEUE_SUPPORT + STRUCTURE BlitterQueueNode,0 + APTR bq_Next + APTR bq_Routine + LABEL bq_Data + LABEL bq_SIZEOF + ENDC + + IF FW_MULTITASKING_SUPPORT + STRUCTURE FrameworkTask,LN_SIZE + APTR ft_USP + IF FW_TOP_BOTTOM_MEM_SECTIONS + UWORD ft_MemDirection + ENDC + LABEL ft_StackStart + STRUCT ft_Stack,512-ft_StackStart + LABEL ft_StackEnd + LABEL ft_SIZEOF + ENDC + + IF FW_DYNAMIC_MEMORY_SUPPORT + STRUCTURE MemTopBottom,0 + APTR mtb_CurrLevelPtr ; Top (from $80000 down) or Bottom (from $400 up) pointer + APTR mtb_MinLevelPtr ; Min Top or Bottom pointer on free all + LABEL mtb_SIZEOF + + STRUCTURE ChipFastMemState,0 + STRUCT cf_ChipMemLevel,mtb_SIZEOF + STRUCT cf_FastMemLevel,mtb_SIZEOF + LABEL cf_SIZEOF + ENDC + + IF FW_PALETTE_LERP_SUPPORT + STRUCTURE Lerp,0 ; don't change order! + WORD le_Add + UWORD le_Current + LABEL le_SIZEOF + + STRUCTURE ColorLerp,0 ; don't change order! + UWORD cl_Color + WORD cl_Steps ; negative in first entry means fading done + STRUCT cl_Red,le_SIZEOF + STRUCT cl_Green,le_SIZEOF + STRUCT cl_Blue,le_SIZEOF + LABEL cl_SIZEOF + ENDC + + STRUCTURE FrameWork,0 + UWORD fw_FrameCounterLong + UWORD fw_FrameCounter + + APTR fw_PartFwBase + APTR fw_PrimaryFwBase + ULONG fw_PartDataSize + APTR fw_GlobalUserData ; you can use this for your custom trackloading global data area + + IF FW_DYNAMIC_MEMORY_SUPPORT + IF FW_TOP_BOTTOM_MEM_SECTIONS + UWORD fw_MainMemDirection + ENDC + STRUCT fw_MemBottomStack,cf_SIZEOF*FW_MAX_MEMORY_STATES + STRUCT fw_MemTopStack,cf_SIZEOF*FW_MAX_MEMORY_STATES + ULONG fw_MaxChipUsed + ULONG fw_MaxFastUsed + UWORD fw_CurrMemBottomLevel + UWORD fw_CurrMemTopLevel + ENDC + + APTR fw_ChipMemStack + APTR fw_ChipMemStackEnd + APTR fw_FastMemStack + APTR fw_FastMemStackEnd + + APTR fw_EmptySprite + APTR fw_BaseCopperlist + + APTR fw_VBR + APTR fw_DemoAbortStackPointer + BOOL fw_AgaChipset + IF FW_STANDALONE_FILE_MODE + APTR fw_OrigBaseMemAllocAddr + ULONG fw_OrigBaseMemAllocLength + APTR fw_OrigChipMemAllocAddr + ULONG fw_OrigChipMemAllocLength + APTR fw_OrigFastMemAllocAddr + ULONG fw_OrigFastMemAllocLength + APTR fw_WBMessage + APTR fw_OldGfxView + APTR fw_DosBase + APTR fw_GfxBase + STRUCT fw_OldControls,2*4 ; intena, intreq, dmacon, adkcon + APTR fw_OldSystemVBlankIRQ + APTR fw_OldCiaIRQ + APTR fw_CiaBResource + STRUCT fw_SysFriendlyInterrupt,IS_SIZE + ENDC + + STRUCT fw_EmptyRegs,4*16 + + IF (FW_STANDALONE_FILE_MODE==0)|FW_HD_TRACKMO_MODE + APTR fw_DirBuffer + APTR fw_TrackBuffer + IF FW_MULTITASKING_SUPPORT + APTR fw_TrackloaderTask + ENDC + ENDC + IFEQ FW_STANDALONE_FILE_MODE + ULONG fw_ExpectedFirstFileID + APTR fw_MfmTrackBuffer + UWORD fw_CurrentCylinder + UWORD fw_CurrentHead + UWORD fw_CurrentDrive + UWORD fw_LastMfmTrack + UWORD fw_LastTrack + UWORD fw_MfmDoPrefetch + BOOL fw_MfmReadingTriggered + BOOL fw_MfmReadingDone + BOOL fw_DriveMotorOn + ULONG fw_DriveSettleTime + ULONG fw_TrackChecksum + UWORD fw_TrackloaderIdle + IF FW_TRACKMO_LZ4_SUPPORT|FW_TRACKMO_LZ4_DLT8_SUPPORT + UWORD fw_TrackLz4State + UWORD fw_TrackLz4LiteralLength ; if we have literals >64 KB, we're f*cked anyway + UWORD fw_TrackLz4MatchLength ; duplicating >64 KB is also very improbable + ULONG fw_TrackLz4Offset + UBYTE fw_TrackLz4Delta8Value + ALIGNWORD + ENDC + ENDC + + APTR fw_DefaultIRQ + IF FW_VBL_IRQ_SUPPORT + APTR fw_VBlankIRQ + ENDC + IF FW_COPPER_IRQ_SUPPORT + APTR fw_CopperIRQ + ENDC + IF FW_MULTITASKING_SUPPORT + STRUCT fw_Tasks,MLH_SIZE + UWORD fw_MainCurrentFrame + APTR fw_BackgroundTask + APTR fw_MultitaskingIRQ + APTR fw_BlitterTaskIRQ + APTR fw_PrimaryUSP + APTR fw_BackgroundTaskUSP + ENDC + + IF FW_BLITTERQUEUE_SUPPORT + APTR fw_BlitterQueueIRQ + APTR fw_BlitterQueueWritePtr ; don't change order + APTR fw_BlitterQueueHeadPtr ; don't change order + APTR fw_BlitterQueueReadPtr ; don't change order + ENDC + + IF (FW_STANDALONE_FILE_MODE==0)|FW_HD_TRACKMO_MODE + STRUCT fw_HunkPointers,4*FW_MAX_DOS_HUNKS + STRUCT fw_PreloadHunkPointers,4*FW_MAX_DOS_HUNKS + STRUCT fw_PreloadRelocHunkPointers,4*FW_MAX_DOS_HUNKS + + APTR fw_LastLoadedPart + APTR fw_PrePartLaunchHook + APTR fw_PrepNextPartHook + ENDC + + IF FW_SINETABLE_SUPPORT + APTR fw_SinTable + APTR fw_CosTable + ENDC + + IF FW_SCRIPTING_SUPPORT + APTR fw_ScriptPointer + UWORD fw_ScriptFrameOffset + IF FW_MUSIC_SUPPORT + APTR fw_MusicScriptPointer + ENDC + ENDC + + IF FW_MUSIC_SUPPORT + BOOL fw_MusicEnabled + APTR fw_MusicData + APTR fw_MusicSamples + + UWORD fw_MusicFrameCount + UWORD fw_MusicPatternRow + BOOL fw_MusicPatternNewRow + + IF (FW_MUSIC_PLAYER_CHOICE==1)|(FW_MUSIC_PLAYER_CHOICE==2) + APTR fw_LspDmaConPatch ; patch address + APTR fw_LspCodeTableAddr ; code table addr + ; do not reorder! + UWORD fw_LspCurrentBpm ; current BPM + APTR fw_LspInstruments ; LSP instruments table addr + UWORD fw_LspEscCodeRewind + UWORD fw_LspEscCodeSetBpm + UWORD fw_LspEscCodeGetPos + ULONG fw_LspMusicLength ; music len in frame ticks + UWORD fw_LspSeqCount + APTR fw_LspSeqTable + UWORD fw_LspCurrentSeq + APTR fw_LspStreamBase ; start of stream info + APTR fw_LspByteStream ; byte stream + APTR fw_LspWordStream ; word stream + APTR fw_LspByteStreamLoop ; byte stream loop point + APTR fw_LspWordStreamLoop ; word stream loop point + ; END of fixed ordering + STRUCT fw_LspResetv,4*4 ; Loop loading data ptr + IF FW_MUSIC_PLAYER_CHOICE==2 + UWORD fw_LspLastCiaBpm + ULONG fw_LspCiaClock + ENDC + ENDC + + IF (FW_MUSIC_PLAYER_CHOICE==4)||(FW_MUSIC_PLAYER_CHOICE==5) + APTR fw_PretrackerMyPlayer + APTR fw_PretrackerMySong + ULONG fw_PretrackerProgress + APTR fw_PretrackerCopperlist + ENDC + ENDC + + IFD gbd_SIZEOF + STRUCT fw_GlobalBonusData,gbd_SIZEOF + ENDC + ALIGNLONG + LABEL fw_SIZEOF + + ENDC ; FRAMEWORK_I \ No newline at end of file diff --git a/source/framework/framework_blitterqueue.asm b/source/framework/framework_blitterqueue.asm new file mode 100644 index 0000000..78f56a7 --- /dev/null +++ b/source/framework/framework_blitterqueue.asm @@ -0,0 +1,382 @@ +;-------------------------------------------------------------------- +; Interrupt-driven Blitter Queue +; +; Blitter queues may not be an optimal solution but they add a tool +; to the various ways of intertwining CPU and blitter activity. +; +; As there may be a rather large penalty for interrupt context +; switches (less so if FW_A5_A6_UNTOUCHED is activated), +; this implementation tries to reduce the overhead to a minimum. +; +; There are four basic ways to use the Blitter Queue: +; +; 1) Create and process blits in the same frame: +; - [AddToBlitterQueue]* +; - TerminateBlitterQueue +; - TriggerBlitterQueue +; - Do more CPU based stuff +; - JoinBlitterQueue +; - VSyncWithTask +; +; 2) Create stuff for the next frame, no queue double buffering: +; - TriggerBlitterQueue +; - Do CPU based stuff +; - JoinBlitterQueue +; - [AddToBlitterQueue]* +; - TerminateBlitterQueue +; - VSyncWithTask +; +; 3) Create stuff for the next frame, double buffered queue: +; - TriggerBlitterQueue (the last one) +; - [AddToBlitterQueue]* (the current one) +; - TerminateBlitterQueue (the current one) +; - Do more CPU based stuff +; - JoinBlitterQueue +; - VSyncWithTask +; +; 4) Create and run stuff in parallel with the current frame: +; - [AppendToRunningBlitterQueue, do more CPU based stuff]* +; - TerminateBlitterQueue +; - JoinBlitterQueue +; - VSyncWithTask +; +; 5) Create and run stuff in parallel with the current frame (alternate): +; - [AddToBlitterQueue]* (makes sense if there is not much to prepare) +; - TriggerBlitterQueue +; - [AppendToRunningBlitterQueue, do more CPU based stuff]* +; - TerminateBlitterQueue +; - JoinBlitterQueue +; - VSyncWithTask +; +; Each blit is stored in a BlitterQueueNode with consists of a +; linking pointer (singly linked list) and the pointer to routine +; for setting up the next blit. +; Optional parameters should follow after this field and are +; available to the callee via a0. +; +; When called, a5/a6 are filled with standard values ($dff000 and +; framework base address). a0 points to bq_Data, +; a1 holds the address of the routine stored in bq_Routine. +; +; Your routine may trash a0/a1/d0, all other registers must be +; preserved! The Z flag at exit determines whether the blit should +; be executed synchronously (blitter hogging will be activated). +; This makes sense if the blit is very short and a context switch +; is not reasonable. Except for a blit of 1024x1024 pixels, +; setting bltsize as a last instruction before RTS will clear Z +; and make the routine asynchronous. If you want it synchroneously, +; the last instruction before RTS could be a moveq.l #0,d0. +; In this case you must ensure the blitter is NOT running when +; your routine exits (e.g. with a blitter wait). +; +; Usually your routine MUST start the blitter -- the only exception +; is when setting the Z condition code at the exit of the routine. +; This can be used e.g. for common setup (like for line drawing) +; to reduce the amount of work done in a series of blits. +; You can also issue a BLTWAIT as the last "instruction" of your +; routine to make it a synchronous blit (no context switch). +; +; If you are absolutely sure that no routine of your main code loop +; will modify a5 or a6 while the blitter queue is running, you may +; turn on the FW_A5_A6_UNTOUCHED switch, which will reduce the +; context switch time even further by not saving/loading/restoring +; these two registers during the interrupt. +; (Otherwise, disabling interrupts for the periods where you need to +; modify a5/a6 may be an option, if the routines don't take too long) +; +; Amiga effects are supposed to be one-frame :) Your blitter queue +; must start its last blit before the vertical blank. Otherwise, +; havoc will happen. +; If you plan to use blitter queues that span several frames, +; please be aware that you need to call SetBlitterQueueMultiFrame, +; which is slightly slower because it will check which interrupt +; occurred. Otherwise please call SetBlitterQueueSingleFrame once. +; +; Blitter queues may NOT be combined with Blitter tasks for obvious +; reasons, but having background tasks and calling VSyncWithTask +; is perfectly fine, IF you make sure that you have joined the queue +; with JoinBlitterQueue before calling VSyncWithTask. +; +; To start a new blit, it takes around 3/4 of a raster line in ideal +; conditions. Calculate with an overhead of one rasterline per blit. +; +; Advanced use: +; You can modify fw_BlitterQueueReadPtr(a6) within a routine for +; branching and looping etc. by changing the next queue node to be +; executed. If you want to terminate the queue, don't set it to +; zero directly, but point it to a node with bq_Next set to zero +; and an empty (not null!) routine. Note that this only works +; reliably for blitter queues that are not extended while running! + +;-------------------------------------------------------------------- +; Adds a node to blitter queue +; +; This call will not start (trigger) the queue! +; If the queue is already being processed, it should append the +; node for later execution -- however, due to race conditions +; it is better to use AppendToBlitterQueue, which will also +; again trigger the queue if it ran out of blits. +; +; Each BlitterQueueNode should be entered with an empty bq_Next +; field (bq_Next may be random if at least the LAST node has it +; set to zero and the queue is not yet running!) and +; a bq_Routine pointer to a routine to be called. +; +; Note: there is also a macro ADD_TO_BLITTER_QUEUE to inline the +; adding for even more speed, but in this case the queue +; must not be empty! +; +; In: a0 = BlitterQueueNode +; Trashes: a1 +; +fw_AddToBlitterQueue: + lea fw_BlitterQueueWritePtr(a6),a1 + tst.l (a1) + beq.s .first + move.l (a1),a1 + PUTMSG 50,<"Add BQ Next %p after %p">,a0,a1 + move.l a0,(a1) ; bq_Next + move.l a0,fw_BlitterQueueWritePtr(a6) + rts +.first PUTMSG 50,<"Add BQ Init %p First">,a0 + move.l a0,(a1)+ ; fw_BlitterQueueWritePtr + move.l a0,(a1)+ ; fw_BlitterQueueHeadPtr + rts + +;-------------------------------------------------------------------- +; Appends a blitter node to a previously triggered queue +; +; Given a running blitter queue, this call will attempt to add a node +; to it. +; If the queue has run out of stuff to do, it will retrigger the +; queue automatically. +; If the last blit was still running, it will resume interrupt driven +; blitting (in fact, this also works with running blits that were not +; started from a blitter queue!). +; +; This call is slightly more complex than AddToBlitterQueue, so +; choose wisely. + +; In: a0 = BlitterQueueNode +; Trashes: a0/a1/d0 +; +fw_AppendToRunningBlitterQueue: + PUTMSG 50,<"Append Head/Write/Read %p %p %p">,fw_BlitterQueueHeadPtr(a6),fw_BlitterQueueWritePtr(a6),fw_BlitterQueueReadPtr(a6) + pea .restints(pc) + DISABLE_INTS + tst.l fw_BlitterQueueHeadPtr(a6) + bne.s fw_AddToBlitterQueue + tst.l fw_BlitterQueueReadPtr(a6) + bne.s fw_AddToBlitterQueue + bsr.s fw_AddToBlitterQueue + btst #DMAB_BLTDONE-8,dmaconr(a5) + beq.s fw_TriggerBlitterQueue + PUTMSG 50,<"Install IRQ %p %p %p">,fw_BlitterQueueHeadPtr(a6),fw_BlitterQueueWritePtr(a6),fw_BlitterQueueReadPtr(a6) + move.w #INTF_BLIT,intreq(a5) ; clear pending blitter int + + move.l fw_VBR(a6),a1 + move.l fw_BlitterQueueIRQ(a6),$6c(a1) + move.w #INTF_SETCLR|INTF_BLIT,intena(a5) ; enable blitter int + lea fw_BlitterQueueHeadPtr(a6),a1 + move.l (a1)+,(a1) ; fw_BlitterQueueHeadPtr -> fw_BlitterQueueReadPtr + clr.l -(a1) ; fw_BlitterQueueHeadPtr + addq.w #4,sp + btst #DMAB_BLTDONE-8,dmaconr(a5) + bne.s .restints + move.w #INTF_SETCLR|INTF_BLIT,intreq(a5) ; set pending blitter int to avoid race condition +.restints + ENABLE_INTS + rts + +;-------------------------------------------------------------------- +; Terminates the blitter queue list +; +; Makes sure that the adding new nodes to will not contribute to a +; running blitter queue. Must be called before starting a new queue. +; +fw_TerminateBlitterQueue: + clr.l fw_BlitterQueueWritePtr(a6) + rts + +;-------------------------------------------------------------------- +; Setup the blitter queue for multiple frames +; +; Selects the slightly slower interrupt routine that allows spilling +; of interrupt driven blits across a VBL. +; +; Either this function or SetBlitterQueueSingleFrame must be called +; at least once! +; +; NOTE: Even if you have a multi-frame blitter queue set up, you may +; NOT use VSyncWithTask unless you made sure the queue has been +; processed by calling JoinBlitterQueue. You still can call VSync +; of course. +; +; Trashes: a0 +; +fw_SetBlitterQueueMultiFrame: + lea fw_blitter_queue_multiframe_irq(pc),a0 + move.l a0,fw_BlitterQueueIRQ(a6) + rts + +;-------------------------------------------------------------------- +; Setup the blitter queue for multiple frames +; +; Selects the slightly faster interrupt routine that does not care +; about a vertical blank interrupt and may crash or do fancy stuff +; if the blit before the last spills into the next frame. +; +; Either this function or SetBlitterQueueMultiFrame must be called +; at least once! +; +; Trashes: a0 +; +fw_SetBlitterQueueSingleFrame: + lea fw_blitter_queue_irq(pc),a0 + move.l a0,fw_BlitterQueueIRQ(a6) + rts + +;-------------------------------------------------------------------- +; Triggers execution of the blitter queue. +; +; Starts the current queue if it is not empty. +; Warning: You MUST make sure the blitter is NOT busy when calling +; this. It is up to you if you want to start the blitter with +; hogging or not (you can control this in your routines as well, +; of course!). Blitter hogging on makes only sense if you will have +; blits with IDLE frames! +; +; NOTE! You MUST join the blitter queue before waiting for the next +; vertical blank because a running interrupt driven blitter queue +; is not compatible with multitasking! +; +; Trashes: a0/a1/d0 +; +fw_TriggerBlitterQueue: + PUTMSG 50,<"Trigger Head/Write/Read %p %p %p">,fw_BlitterQueueHeadPtr(a6),fw_BlitterQueueWritePtr(a6),fw_BlitterQueueReadPtr(a6) + move.l fw_BlitterQueueHeadPtr(a6),d0 + bne.s .cont + PUTMSG 50,<"BQ empty"> + rts +.cont + clr.l fw_BlitterQueueHeadPtr(a6) + move.l d0,a0 +fw_TriggerCustomBlitterQueue: + PUTMSG 50,<"Exe BQ %p">,a0 + move.l (a0)+,fw_BlitterQueueReadPtr(a6) + beq.s .onlyone + + move.w #INTF_BLIT,intena(a5) ; disable blitter int + move.w #INTF_BLIT,intena(a5) ; disable blitter int + +.allsyncloop + move.w #INTF_BLIT,intreq(a5) ; clear pending blitter int + + move.l (a0)+,a1 + jsr (a1) + bne.s .activate + move.l fw_BlitterQueueReadPtr(a6),a0 + move.l (a0)+,fw_BlitterQueueReadPtr(a6) + bne.s .allsyncloop +.lastwasalsosync +.onlyone + cmp.l fw_BlitterQueueWritePtr(a6),d0 + bne.s .noconflict + PUTMSG 50,<"Trigger caught up"> + clr.l fw_BlitterQueueWritePtr(a6) +.noconflict + PUTMSG 50,<"BQ Trigger Last!"> + move.l (a0)+,a1 + jmp (a1) +.activate + PUTMSG 50,<"Activate!"> + move.l fw_VBR(a6),a0 + move.l fw_BlitterQueueIRQ(a6),$6c(a0) + move.w #INTF_SETCLR|INTF_BLIT,intena(a5) ; enable blitter int + rts + +;-------------------------------------------------------------------- +; Makes the blitter queue synchronous again -- no longer causes +; interrupts and will restore normal multitasking operation. +; +; The last blit might still be running when this function returns! +; +; Trashes: a0/a1/d0 +; +fw_JoinBlitterQueue: + PUTMSG 50,<"Join Head/Write/Read %p %p %p">,fw_BlitterQueueHeadPtr(a6),fw_BlitterQueueWritePtr(a6),fw_BlitterQueueReadPtr(a6) + move.w #INTF_INTEN|INTF_BLIT,intena(a5) ; disable main and blitter int + move.w #INTF_INTEN|INTF_BLIT,intena(a5) ; disable main and blitter int + tst.l fw_BlitterQueueReadPtr(a6) + beq.s .done + PUTMSG 50,<"Joining blitter queue"> + move.l fw_VBR(a6),a0 + move.l fw_DefaultIRQ(a6),$6c(a0) + ENABLE_INTS +.retry + move.l fw_BlitterQueueReadPtr(a6),a0 + PUTMSG 50,<"BQ Next %p">,a0 + move.l (a0)+,fw_BlitterQueueReadPtr(a6) + beq.s .last + pea .retry(pc) +.last + move.l (a0)+,a1 ; bq_Routine + BLTHOGON + BLTWAIT + BLTHOGOFF + jmp (a1) +.done + ENABLE_INTS + rts + +;-------------------------------------------------------------------- + +fw_blitter_queue_multiframe_irq: + btst #INTB_VERTB,$dff000+intreqr+1 + bne fw_vblank_standard_irq +fw_blitter_queue_irq: + PUTMSG 50,<"BQINT %lx">,$dff000+intenar + IF FW_COPPER_IRQ_SUPPORT + btst #INTB_COPER,$dff000+intreqr+1 + bne fw_copper_irq + ENDC + IF FW_A5_A6_UNTOUCHED + PUSHM d0/a0/a1 + ELSE + PUSHM d0/a0/a1/a5/a6 + lea $dff000,a5 + move.l fw_BasePtr(pc),a6 + ENDC +.retry + move.w #INTF_BLIT,intreq(a5) ; acknowledge the blitter irq. + move.l fw_BlitterQueueReadPtr(a6),a0 + PUTMSG 50,<"BQ Next Head/Write/Read %p %p %p">,fw_BlitterQueueHeadPtr(a6),fw_BlitterQueueWritePtr(a6),a0 + move.l (a0)+,fw_BlitterQueueReadPtr(a6) + beq.s .last + move.l (a0)+,a1 ; bq_Routine + jsr (a1) + beq.s .retry + ; this has some issues regarding starvation e.g. if you're spamming + ; lots of hogging zero-idle blits across VBL, e.g. music code will not execute in time. + ;btst #DMAB_BLTDONE-8,dmaconr(a5) + ;beq.s .retry +.finished + POPM NOBUMP + nop + rte +.last + PUTMSG 50,<"BQ Last!"> + move.w #INTF_BLIT,intena(a5) ; disable blitter int + lea -4(a0),a1 + cmp.l fw_BlitterQueueWritePtr(a6),a1 + bne.s .noconflict + PUTMSG 50,<"Caught up"> + clr.l fw_BlitterQueueWritePtr(a6) +.noconflict + move.l (a0)+,a1 ; bq_Routine + jsr (a1) + move.l fw_VBR(a6),a0 + move.l fw_DefaultIRQ(a6),$6c(a0) + POPM + nop + rte diff --git a/source/framework/framework_chip_section.asm b/source/framework/framework_chip_section.asm new file mode 100644 index 0000000..2049033 --- /dev/null +++ b/source/framework/framework_chip_section.asm @@ -0,0 +1,11 @@ +mfw_copperlist: + COP_MOVE diwstrt,$2c81 ; window start + COP_MOVE diwstop,$2cc1 ; window stop + COP_MOVE ddfstrt,$0038 ; bitplane start + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon0,$0200 ; turn off all bitplanes + COP_END +mfw_emptysprite: + dc.w 0,0 +mfw_copperlistend: diff --git a/source/framework/framework_dos.asm b/source/framework/framework_dos.asm new file mode 100644 index 0000000..21a6ce1 --- /dev/null +++ b/source/framework/framework_dos.asm @@ -0,0 +1,867 @@ +;-------------------------------------------------------------------- +; Load, decrunch and run the given part +; +; Searches for the given file name on disk, allocates enough memory +; to load the compressed hunks, decrunches them (maybe in-place) +; relocates the hunks, executes an optional pre-launch hook +; and finally calls the loaded part. +; +; A part may have been preloaded using PreloadPart in which case the +; loading from disk is skipped and only the allocation and decrunching +; happens. +; +; Restores the framework base to the default after execution and +; frees all memory allocated. +; +; In : a0 = filename +; Trashes: probably all registers +; +fw_ExecuteNextPart: + PUTMSG 10,<10,"%d: *** Preparing to execute next part %s ***">,fw_FrameCounterLong(a6),a0 + bsr.s fw_LoadNextPart + + PUSHM a0 + bsr fw_CheckPrePartLaunchHook + POPM + + IF FW_MUSIC_SUPPORT + PUTMSG 10,<"%d: *** Executing next part %p at music frame %d">,fw_FrameCounterLong(a6),a0,fw_MusicFrameCount-2(a6) + ELSE + PUTMSG 10,<"%d: *** Executing next part %p">,fw_FrameCounterLong(a6),a0 + ENDC + jsr (a0) + IF FW_MUSIC_SUPPORT + PUTMSG 10,<"%d: *** Part finished at music frame %d",10>,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + ELSE + PUTMSG 10,<"%d: *** Part finished",10>,fw_FrameCounterLong(a6) + ENDC + + bsr fw_RestoreFrameworkBase + bsr fw_DropCurrentMemoryAllocations + rts + +;-------------------------------------------------------------------- +; Load and decrunch given part +; +; Searches for the given file name on disk, allocates enough memory +; to load the compressed hunks, decrunches them (maybe in-place) +; and relocates the hunks. Part is not executed, stores the loading +; address of first (typically code) hunk in fw_LastLoadedPart(a6). +; Note that this also allocates BSS hunks if there any. +; +; This can be used for background loading the next part. +; See also PreloadPart for an alternative without decrunching. +; +; In : a0 = filename +; Out: a0 = loading address of first hunk +; Trashes: probably all registers +; +fw_LoadNextPart: + PUTMSG 10,<10,"%d: *** Loading next part %s ***">,fw_FrameCounterLong(a6),a0 + clr.l fw_LastLoadedPart(a6) + bsr fw_DropCurrentMemoryAllocations + bsr fw_FindFile + bsr fw_LoadAndDecrunchPart + move.l a0,fw_LastLoadedPart(a6) + rts + +;-------------------------------------------------------------------- +; Wait until next part has been loaded (and decrunched) +; +; Can be used if a background task is used to load the next part to +; to ensure the loading and decrunching has finished. +; + IF FW_MULTITASKING_SUPPORT +fw_WaitForPartLoaded: + tst.l fw_LastLoadedPart(a6) + bne.s .done + PUTMSG 10,<"%d: Part not yet fully loaded. Waiting.">,fw_FrameCounterLong(a6) +.loop bsr fw_Yield + tst.l fw_LastLoadedPart(a6) + beq.s .loop +.done rts + ENDC + +;-------------------------------------------------------------------- +; Check and execute the pre-part launch hook +; +; Internal function to execute a hook that is supposed to be called +; just before ExecuteNextPart starts the part after loading/decrunching. +; +; Hooks can be installed by writing fw_PrePartLaunchHook(a6). +; If this field is NULL, this function does nothing. +; fw_PrePartLaunchHook(a6) is cleared prior to executing the hook. +; +fw_CheckPrePartLaunchHook: + move.l fw_PrePartLaunchHook(a6),d0 + beq.s .skip + clr.l fw_PrePartLaunchHook(a6) + move.l d0,a0 + PUTMSG 10,<"Executing pre-part launch hook at %p">,a0 + jmp (a0) +.skip + rts + + +;-------------------------------------------------------------------- +; Poor-man's multi disk check +; +; Waits for a disk-change, then re-initializes the loader and reads +; the new directory. This is currently untested and might not work +; well with multiple drives. +; +; In : d0.l = First four bytes of first filename on expected disk. +; + IFEQ FW_HD_TRACKMO_MODE +fw_NextDisk: + move.l d0,fw_ExpectedFirstFileID(a6) + bsr fw_TrackloaderWaitForDiskChange + ;bra.b fw_InitDos + ENDC + +;-------------------------------------------------------------------- +; Initializes the trackloader and reads the disk directory +fw_InitDos: + IF FW_MULTITASKING_SUPPORT + move.l fw_TrackloaderTask(a6),a1 + move.b #-10,LN_PRI(a1) ; FIXME breaks things! Why? + IFNE DEBUG_DETAIL + lea .loadertask(pc),a0 + move.l a0,LN_NAME(a1) + ENDC + ENDC + + tst.l fw_DirBuffer(a6) + bne.s .hasmem + move.l #FW_NUM_DIRECTORY_BLOCKS*512,d0 + bsr fw_AllocFast + move.l a0,fw_DirBuffer(a6) + IFEQ FW_HD_TRACKMO_MODE + move.l #'Plat',fw_ExpectedFirstFileID(a6) ; Standard ID for launcher, change ID to detect a second disk + ENDC +.hasmem +.retry + IFEQ FW_HD_TRACKMO_MODE + bsr fw_TrackloaderDiskMotorOn + ENDC + move.l fw_DirBuffer(a6),a0 + PUTMSG 10,<"Directory at %p">,a0 + move.l #FW_DIRECTORY_ENTRIES_OFFSET,d0 ; second block + move.l #FW_NUM_DIRECTORY_BLOCKS*512,d1 + bsr fw_TrackloaderLoad + IFEQ FW_HD_TRACKMO_MODE + move.l fw_DirBuffer(a6),a0 + move.l fw_ExpectedFirstFileID(a6),d0 + cmp.l (a0),d0 + bne.s .otherdisk + rts +.otherdisk + PUTMSG 10,<"Wrong disk %lx">,(a0) + move.w fw_CurrentDrive(a6),d0 + addq.w #1,d0 + move.w d0,fw_CurrentDrive(a6) + cmp.w #4,d0 + bne.s .retry + move.w #ERROR_DISK,d0 + bra fw_Error + ELSE + rts + ENDC + + IFNE DEBUG_DETAIL +.loadertask + dc.b "Loadertask",0 + even + ENDC + +;-------------------------------------------------------------------- +; Locates the DirEntry of a file on disk +; +; The DirEntry contains the meta-data for a file on disk +; (see framework.i). +; +; In : a0 = filename +; Out: a1 = Dir entry structure +; +fw_FindFile: + PUTMSG 10,<"Searching for %s...">,a0 + move.l fw_DirBuffer(a6),a1 +.restartloop + moveq.l #0,d0 +.loop + move.b de_Name(a1,d0.w),d1 + cmp.b (a0,d0.w),d1 + bne.s .next + addq.w #1,d0 + tst.b d1 + beq .foundit + cmp.w #16,d0 + beq .foundit + bra.s .loop +.next + PUTMSG 40,<"%s did not match">,a1 +.nextline + tst.w de_Flags(a1) + bpl.s .nextentry + PUTMSG 40,<"NL"> + lea de_NextHunk(a1),a1 + bra.s .nextline +.nextentry + lea de_SIZEOF(a1),a1 + tst.b de_Name(a1) + beq.s .notfound + PUTMSG 40,<"Next Entry %s">,a1 + bra .restartloop +.notfound + PUTMSG 10,<"File %s not found">,a0 + move.w #ERROR_FILE_NOT_FOUND,d0 + bra fw_Error +.foundit + PUTMSG 10,<"Found %s at %p">,a1,a1 + rts + +;-------------------------------------------------------------------- +; Allocate and load a file (filename) from disk without decrunching +; +; Allocates sufficient memory and loads the possibly compressed file +; from the directory into this memory. File will be loaded to fast +; memory if crunched, otherwise memory allocation depends on the +; flags. Note that this call is not useful for DOS hunk files. +; +; In : a0 = filename +; Out: a0 = start of loaded file in a0 +; a1 = Dir entry structure of the file +; +fw_LoadFile: + bsr fw_FindFile + move.w #DEFM_PACKMODE,d0 + and.w de_Flags(a1),d0 + bne.s fw_LoadPlainFileEntryToFast + +;-------------------------------------------------------------------- +; Allocate and load a file via DirEntry from disk without decrunching +; +; Allocates sufficient memory and loads the possibly compressed file +; from the directory into this memory. File will be loaded to the +; type of memory specified in the DirEntry. +; Note that this call is not useful for DOS hunk files. +; +; In : a1 = Dir entry structure +; Out: a0 = start of loaded file in a0 +; a1 = Dir entry structure of the file +; +fw_LoadPlainFileEntry: + PUTMSG 10,<"%d: Loading plain file from offset %ld, size %ld">,fw_FrameCounterLong(a6),de_DiskOffset(a1),de_DiskLength(a1) + tst.b de_Flags+1(a1) + bpl.s fw_LoadPlainFileEntryToFast + move.l de_DiskLength(a1),d0 + move.l a1,-(sp) + bsr fw_AllocChip + bra.s fw_InternalLoadFileEntryToBuffer + +;-------------------------------------------------------------------- +; Allocate and load a file via DirEntry from disk to fast mem +; +; Allocates sufficient memory and loads the possibly compressed file +; from the directory into this memory. File will be loaded to +; fast memory, if available. +; +; In : a1 = DirEntry +; Out: a0 = start of loaded file in a0 +; a1 = DirEntry of the file +; +fw_LoadPlainFileEntryToFast: + IFEQ FW_HD_TRACKMO_MODE +fw_LoadReadOnlyPlainFileEntryToFast: + ENDC + move.l de_DiskLength(a1),d0 + move.l a1,-(sp) + bsr fw_AllocFast +fw_InternalLoadFileEntryToBuffer: + move.l (sp)+,a1 + + bsr fw_LoadFileToBuffer + + move.l de_DiskLength(a1),d0 + rts + IFNE FW_HD_TRACKMO_MODE +fw_LoadReadOnlyPlainFileEntryToFast: + move.l de_DiskLength(a1),d0 + move.l fw_TrackBuffer(a6),a0 + adda.l de_DiskOffset(a1),a0 +fw_TrackloaderDiskMotorOff: + rts + ENDC + +;-------------------------------------------------------------------- +; Load a file from disk and decrunch it +; +; Allocates sufficient memory and loads the possibly compressed file +; from the directory into this memory. File will be decompressed to +; chip or fast memory depending on its flags. +; Allocation may be slightly bigger if file is decrunchable in-place, +; but uses no additional memory for the compressed data in this case. +; +; Note that this call is not useful for DOS hunk files. +; +; In : a0: Filename +; Out: a0: Pointer to loaded buffer +; a1: Dir entry structure +; +fw_LoadAndDecrunchFile: + bsr fw_FindFile + move.w #DEFM_PACKMODE,d0 + and.w de_Flags(a1),d0 + beq fw_LoadPlainFileEntry + + PUTMSG 10,<"File %s is crunched">,a1 + IFEQ FW_HD_TRACKMO_MODE + IF FW_ZX0_SUPPORT + btst #DEFB_IN_PLACE,de_Flags(a1) + bne.s .inplacedecrunch + ENDC + ENDC + move.l a1,-(sp) ; dir entry + + move.l de_MemorySize(a1),d0 + tst.b de_Flags+1(a1) + bpl.s .usefast + bsr fw_AllocChip + bra.s .allocated +.usefast + bsr fw_AllocFast +.allocated + move.l a0,-(sp) ; target buffer + + IFEQ FW_HD_TRACKMO_MODE + bsr fw_PushMemoryState + move.l de_DiskLength(a1),d0 + bsr fw_AllocFast + + move.l 4(sp),a1 ; dir entry + + bsr fw_LoadFileToBuffer + + move.l (sp),a2 ; target buffer + bsr fw_DecrunchToBuffer + move.l de_MemorySize(a1),d0 + bsr fw_PopMemoryState + ELSE + move.l a0,a2 + move.l 4(sp),a1 + move.l fw_TrackBuffer(a6),a0 + adda.l de_DiskOffset(a1),a0 + bsr fw_DecrunchToBuffer + move.l de_MemorySize(a1),d0 + ENDC + move.l (sp)+,a0 ; target buffer + move.l (sp)+,a1 ; dir entry + rts + + IFEQ FW_HD_TRACKMO_MODE + IF FW_ZX0_SUPPORT +.inplacedecrunch + bsr.s fw_AllocInPlaceDecrunchBuffer + PUSHM a0 + bsr.s fw_LoadAndInPlaceDecrunchToBuffer + POPM + rts + ENDC + ENDC + +;-------------------------------------------------------------------- +; Allocate buffer big enough to hold decrunched data + safety distance +; +; In : a1 = dir entry (preserved) +; Out: a0 = buffer +; +fw_AllocInPlaceDecrunchBuffer: + PUSHM a1 + move.l de_MemorySize(a1),d0 + addq.l #1,d0 + and.w #-2,d0 + add.l #FW_IN_PLACE_DECR_SAFE_DIST,d0 + tst.b de_Flags+1(a1) + bpl.s .usefast2 + bsr fw_AllocChip + bra.s .allocated2 +.usefast2 + bsr fw_AllocFast +.allocated2 + POPM + rts + +;-------------------------------------------------------------------- +; Loads a crunched file to the end of a pre-allocated buffer and decrunches it in-place +; +; In : a0 = target buffer (memory size of decrunched + safety distance) +; a1 = dir entry (preserved) +; Out: a0 = end of decrunched buffer +; +fw_LoadAndInPlaceDecrunchToBuffer: + move.l a0,-(sp) + move.l de_DiskLength(a1),d0 + addq.l #1,d0 + and.w #-2,d0 + lea FW_IN_PLACE_DECR_SAFE_DIST(a0),a0 + move.l de_MemorySize(a1),d1 + addq.l #1,d1 + and.w #-2,d1 + adda.l d1,a0 + suba.l d0,a0 + + bsr fw_LoadFileToBuffer + + move.l (sp)+,a2 ; target buffer + ;bra.s fw_DecrunchToBuffer + +;-------------------------------------------------------------------- +; Decrunches the given file to the target buffer +; +; In : a0 = source buffer +; a1 = Dir entry structure +; a2 = target buffer +; Out: a0 = END of the buffer written +; a1 = Dir entry structure +; +fw_DecrunchToBuffer: + PUSHM a1/a2 + move.w #DEFM_PACKMODE,d0 + and.w de_Flags(a1),d0 + IF FW_DOYNAX_SUPPORT + cmp.w #DEFF_DOYNAX,d0 + bne.s .nodoynax + PUTMSG 10,<"%d: DoynaxDecrunch from %p (%ld) to %p (%ld)">,fw_FrameCounterLong(a6),a0,de_DiskLength(a1),a2,de_MemorySize(a1) + move.l a2,a1 + bsr doynaxdepack + bra .decdone +.nodoynax + ENDC + + IF FW_ZX0_SUPPORT + cmp.w #DEFF_ZX0,d0 + bne.s .nozx0 + PUTMSG 10,<"%d: ZX0Decrunch from %p (%ld) to %p (%ld)">,fw_FrameCounterLong(a6),a0,de_DiskLength(a1),a2,de_MemorySize(a1) + move.l a2,a1 + bsr zx0_decompress + bra.s .decdone +.nozx0 + ENDC + + IF FW_LZ4_SUPPORT + cmp.w #DEFF_LZ4,d0 + bne.s .nolz4 + move.l de_DiskLength(a1),d0 + PUTMSG 10,<"%d: LZ4Decrunch from %p (%ld) to %p (%ld)">,fw_FrameCounterLong(a6),a0,d0,a2,de_MemorySize(a1) + move.l a2,a1 + bsr lz4_depack + bra.s .decdone +.nolz4 + ENDC + + move.w #ERROR_INVALID_PARAMS,d0 + bra fw_Error + +.decdone + move.l a1,a0 + POPM + + move.w #DEFM_DELTAMODE,d0 + and.w de_Flags(a1),d0 + beq.s .nodelta + cmp.w #DEFF_DELTA8,d0 + beq.s .delta8 + move.w #ERROR_INVALID_PARAMS,d0 + bra fw_Error +.delta8 + PUSHM a2 + move.l de_MemorySize(a1),d0 + beq.s .d8done + PUTMSG 10,<"%d: Delta8 decoding %p %ld bytes">,fw_FrameCounterLong(a6),a2,d0 + moveq.l #0,d1 + subq.l #1,d0 +.d8loop + add.b (a2),d1 + move.b d1,(a2)+ + dbra d0,.d8loop + swap d0 + subq.w #1,d0 + bcs.s .d8done + swap d0 + bra.s .d8loop +.d8done + POPM +.nodelta + PUTMSG 10,<"%d: Decrunching done">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- +; Loads the file into the given buffer +; +; In : a0 = buffer (preserved) +; a1 = Dir entry structure (preserved) +; +fw_LoadFileToBuffer: + PUSHM a0-a3 + move.l de_DiskOffset(a1),d0 + move.l de_DiskLength(a1),d1 + PUTMSG 10,<"%d: Loading file %p to buffer %p (%ld)">,fw_FrameCounterLong(a6),a1,a0,d1 + bsr fw_TrackloaderLoad + POPM + rts + +;-------------------------------------------------------------------- +; Loads and uncompresses the (LZ4) file into the given buffer +; +; Loads and decrunches the given LZ4 or LZ4 delta compressed file while +; loading it from disk -- needs no extra memory. +; +; In : a0 = target buffer +; a1 = Dir entry structure +; Out: a1 = end of decrunching pointer +; +fw_TrackmoLoadAndDecrunchToBuffer: + PUTMSG 10,<"%d: Trackmo Loading and Decrunching %p">,fw_FrameCounterLong(a6),a1 + move.w #DEFM_PACKMODE,d0 + and.w de_Flags(a1),d0 + IF FW_TRACKMO_LZ4_SUPPORT|FW_TRACKMO_LZ4_DLT8_SUPPORT + cmp.w #DEFF_LZ4,d0 + bne.s .nolz4 + move.l de_DiskOffset(a1),d0 + move.l de_DiskLength(a1),d1 + move.w #DEFM_DELTAMODE,d2 + and.w de_Flags(a1),d2 + + IF FW_TRACKMO_LZ4_SUPPORT + cmp.w #DEFF_NODELTA,d2 + beq fw_TrackloaderLoadAndDecrunchLZ4 + ENDC + + IF FW_TRACKMO_LZ4_DLT8_SUPPORT + cmp.w #DEFF_DELTA8,d2 + beq fw_TrackloaderLoadAndDecrunchLZ4Delta8 + ENDC +.nolz4 + ENDC +.error + move.w #ERROR_INVALID_PARAMS,d0 + bra fw_Error + +;-------------------------------------------------------------------- +; Load and decrunch a part +; +; Reads, allocates, decrunches and relocates all hunks for the given +; directory entry. +; +; In : a1 = Dir entry structure +; Out: a0 = launch address of first hunk +; +fw_LoadAndDecrunchPart: + move.l d7,-(sp) + PUTMSG 10,<"%d: Loading and Decrunching %p">,fw_FrameCounterLong(a6),a1 + + tst.b de_NumHunks(a1) + bne.s .cont +.b0rked + move.w #ERROR_HUNKBROKEN,d0 + bra fw_Error + +.cont + move.l a1,a2 ; backup top of the dir entries + lea fw_HunkPointers(a6),a3 +.hunkallocloop + moveq.l #0,d7 + move.b de_HunkNum(a1),d7 + lsl.w #2,d7 + + PUTMSG 30,<"HunkSize %lx">,de_MemorySize(a1) + move.l de_MemorySize(a1),d0 + beq.s .skipthat + + btst #DEFB_IN_PLACE,de_Flags(a1) + beq.s .noinplace + add.l #FW_IN_PLACE_DECR_SAFE_DIST,d0 +.noinplace + ; allocate hunk + PUSHM a1-a3 + tst.b de_Flags+1(a1) + bpl.s .nochipmem + bsr fw_AllocChip + bra.s .gotmem +.nochipmem + bsr fw_AllocFast +.gotmem + POPM + move.l a0,(a3,d7.w) +.skipthat + tst.w de_Flags(a1) + bpl.s .hunksallocated + lea de_NextHunk(a1),a1 + bra.s .hunkallocloop + +.hunksallocated + move.l a2,a1 ; start over + +.hunkloadloop + moveq.l #0,d7 + move.b de_HunkNum(a1),d7 + PUTMSG 10,<"Hunk num %d">,d7 + lsl.w #2,d7 + moveq.l #DEFM_TYPE,d0 + and.w de_Flags(a1),d0 + cmp.w #DEFF_HUNK_CODE,d0 + beq.s .codedata + cmp.w #DEFF_HUNK_DATA,d0 + beq.s .codedata + cmp.w #DEFF_HUNK_BSS,d0 + beq .justclear + cmp.w #DEFF_HUNK_RELOC,d0 + beq .reloc + bra .b0rked +.codedata + move.w #DEFM_PACKMODE,d0 + and.w de_Flags(a1),d0 + beq .unpacked + move.l fw_PreloadHunkPointers-fw_HunkPointers(a3,d7.w),d1 + beq.s .loadpacked + PUSHM a2-a3 + move.l (a3,d7.w),a2 + move.l d1,a0 + clr.l fw_PreloadHunkPointers-fw_HunkPointers(a3,d7.w) + PUTMSG 10,<"Decrunching packed data from preload buffer %p to %p">,a0,a2 + bsr fw_DecrunchToBuffer + POPM + bra .clearmem +.loadpacked + IF FW_ZX0_SUPPORT + btst #DEFB_IN_PLACE,de_Flags(a1) + bne.s .inplacedecrunch + ENDC + IF FW_LZ4_SUPPORT + IF FW_TRACKMO_LZ4_SUPPORT + cmp.w #DEFF_LZ4,d0 + beq .trackloadlz4 + ELSE + cmp.w #DEFF_LZ4,d0 + beq.s .genericdecrunch + ENDC + ENDC + + IF FW_ZX0_SUPPORT + cmp.w #DEFF_ZX0,d0 + beq.s .genericdecrunch + ENDC + + IF FW_DOYNAX_SUPPORT + cmp.w #DEFF_DOYNAX,d0 + beq.s .genericdecrunch + ENDC + bra .b0rked + + IF FW_ZX0_SUPPORT|FW_DOYNAX_SUPPORT|(FW_LZ4_SUPPORT&!FW_TRACKMO_LZ4_SUPPORT) +.genericdecrunch + bsr fw_PushMemoryState + PUSHM a1-a3 + bsr fw_LoadPlainFileEntryToFast + POPM + PUSHM a1-a3 + move.l (a3,d7.w),a2 ; target buffer + bsr fw_DecrunchToBuffer + POPM + bsr fw_PopMemoryState + bra .clearmem + ENDC + + IF FW_ZX0_SUPPORT +.inplacedecrunch + PUTMSG 10,<"%d: In-place loading and decrunching %ld bytes to %p (%d)">,fw_FrameCounterLong(a6),de_DiskLength(a1),a0,d7 + PUSHM a1-a3 + move.l (a3,d7.w),a0 + bsr fw_LoadAndInPlaceDecrunchToBuffer + POPM + bra .clearmem + ENDC + + IF FW_TRACKMO_LZ4_SUPPORT +.trackloadlz4 + move.l (a3,d7.w),a0 + PUSHM a1-a3 + PUTMSG 10,<"%d: LZ4 loading and decrunching %ld bytes to %p (%d)">,fw_FrameCounterLong(a6),de_DiskLength(a1),a0,d7 + bsr fw_TrackmoLoadAndDecrunchToBuffer + move.l a1,a0 + POPM + bra .clearmem + ENDC + +.unpacked + move.l fw_PreloadHunkPointers-fw_HunkPointers(a3,d7.w),d0 + beq.s .loadunpacked + move.l d0,a0 + clr.l fw_PreloadHunkPointers-fw_HunkPointers(a3,d7.w) + PUTMSG 10,<"Copying unpacked data from preload buffer %p">,a0 + move.l de_DiskLength(a1),d0 + subq.l #1,d0 + bmi.s .clearunpacked + lsr.w #2,d0 + move.l (a3,d7.w),a2 +.upcopyloop + move.l (a0)+,(a2)+ + dbra d0,.upcopyloop + bra.s .clearunpacked + +.loadunpacked + move.l (a3,d7.w),a0 + bsr fw_LoadFileToBuffer +.clearunpacked + move.l de_MemorySize(a1),d0 + move.l de_DiskLength(a1),d1 + sub.l d1,d0 + move.l (a3,d7.w),a0 + adda.l d1,a0 + bra .clearit + +.justclear + move.l (a3,d7.w),a0 + move.l de_MemorySize(a1),d0 + bra .clearit + +.clearmem + move.l (a3,d7.w),d0 + add.l de_MemorySize(a1),d0 + PUTMSG 10,<"%d: End of buffer %p, expected %p, memory size %ld">,fw_FrameCounterLong(a6),a0,d0,de_MemorySize(a1) + sub.l a0,d0 ; bytes to clear + +.clearit + tst.l d0 + bmi fw_Error + lsr.l #2,d0 + beq.s .checknexthunk + PUTMSG 10,<"Clearing %d longs at end of buffer %p">,d0,a0 + subq.w #1,d0 + moveq.l #0,d1 +.clearloop + move.l d1,(a0)+ + dbra d0,.clearloop + +.checknexthunk + tst.b de_Flags(a1) + bpl .hunksloaded + lea de_NextHunk(a1),a1 + bra .hunkloadloop + +.reloc + move.l fw_PreloadRelocHunkPointers-fw_HunkPointers(a3,d7.w),d0 + beq.s .loadreloc + move.l d0,a0 + clr.l fw_PreloadRelocHunkPointers-fw_HunkPointers(a3,d7.w) + PUTMSG 10,<"Doing Reloc from preloaded data %p">,a0 + PUSHM a1 + bsr .doreloc + POPM + bra.s .checknexthunk +.loadreloc + bsr fw_PushMemoryState + + PUSHM a1-a3 + move.l a3,-(sp) + bsr fw_LoadReadOnlyPlainFileEntryToFast + move.l (sp)+,a3 + bsr .doreloc + POPM + bsr fw_PopMemoryState + bra .checknexthunk + +.hunksloaded + bsr fw_FlushCaches + + move.l (sp)+,d7 + move.l fw_HunkPointers(a6),a0 + rts + +.doreloc + move.l (a3,d7.w),a1 ; target-hunk + + PUTMSG 40,<"Relocating for target hunk %p (%d)">,a1,d7 + +.hunkrelloop + move.w (a0)+,d0 + beq.s .hunkrelocend + move.w (a0)+,d1 ; source-hunk + PUTMSG 50,<"%d offsets for hunk %d">,a0,d1 + subq.w #1,d0 + lsl.w #2,d1 + move.l (a3,d1.w),d2 ; source_hunk offset +.offsetsloop + moveq.l #0,d1 + move.w (a0)+,d1 ; offset + add.l d1,d1 + add.l d2,(a1,d1.l) ; patch offset into target-hunk + dbra d0,.offsetsloop + bra.s .hunkrelloop +.hunkrelocend + rts + +;-------------------------------------------------------------------- +; Loads the next part into memory without decrunching or executing it +; +; Preloads a part that will be almost instantly executed when calling +; ExecuteNextPart (because only the decrunching will be done). +; +; This function is usually called from a background task with memory +; allocation direction flipped. Note that the filename given here and +; later to ExecuteNextPart must match exactly, otherwise, bad things +; will happen. +; +; In : a0 = filename +; +fw_PreloadPart: + IFEQ FW_HD_TRACKMO_MODE + bsr fw_FindFile + move.l d7,-(sp) + PUTMSG 10,<"%d: Preparing loading and decrunching of %p">,fw_FrameCounterLong(a6),a1 + + tst.b de_NumHunks(a1) + bne.s .cont +.b0rked + move.w #ERROR_HUNKBROKEN,d0 + bra fw_Error + +.cont + lea fw_PreloadHunkPointers(a6),a2 + lea fw_PreloadRelocHunkPointers(a6),a3 +.hunkloadloop + moveq.l #0,d7 + move.b de_HunkNum(a1),d7 + PUTMSG 10,<"Hunk num %d">,d7 + lsl.w #2,d7 + moveq.l #DEFM_TYPE,d0 + and.w de_Flags(a1),d0 + cmp.w #DEFF_HUNK_CODE,d0 + beq.s .codedata + cmp.w #DEFF_HUNK_DATA,d0 + beq.s .codedata + cmp.w #DEFF_HUNK_BSS,d0 + beq.s .ignorehunk + cmp.w #DEFF_HUNK_RELOC,d0 + bne .b0rked + PUSHM a1-a3 + bsr fw_LoadPlainFileEntryToFast + POPM + move.l a0,(a3,d7.w) + bra.s .loaded +.codedata + PUSHM a1-a3 + bsr fw_LoadPlainFileEntryToFast + POPM + move.l a0,(a2,d7.w) +.loaded +.ignorehunk + tst.b de_Flags(a1) + bpl .hunksloaded + lea de_NextHunk(a1),a1 + bra .hunkloadloop + +.hunksloaded + move.l (sp)+,d7 + ENDC + rts diff --git a/source/framework/framework_hdloader.asm b/source/framework/framework_hdloader.asm new file mode 100644 index 0000000..731be48 --- /dev/null +++ b/source/framework/framework_hdloader.asm @@ -0,0 +1,77 @@ +;-------------------------------------------------------------------- +; Trackdisk loader replacement for harddisk/filedemo loading +; +; In : a0: buffer to load the data into +; d0: disk starting offset +; d1: length in bytes +; +fw_TrackloaderLoad: + PUTMSG 10,<"TrackloaderLoad to %p (%ld bytes)">,a0,d0 + move.l fw_TrackBuffer(a6),a1 + adda.l d0,a1 + addq.l #1,d1 + and.w #-2,d1 + btst #1,d1 + beq.s .nooddword + move.w (a1)+,(a0)+ + subq.l #2,d1 +.nooddword + subq.l #1,d1 + lsr.l #2,d1 +.cpyloop + move.l (a1)+,(a0)+ + dbra d1,.cpyloop + rts + +;-------------------------------------------------------------------- +; Load LZ4 compressed data from disk and decompress it while loading +; +; In : a0: buffer to load the data into +; d0: disk starting offset +; d1: compressed length in bytes +; + IF FW_TRACKMO_LZ4_SUPPORT +fw_TrackloaderLoadAndDecrunchLZ4: + PUTMSG 10,<"TrackloaderLoadAndDecrunchLZ4 to %p (%ld bytes)">,a0,d1 + move.l fw_TrackBuffer(a6),a1 + adda.l d0,a1 + exg a0,a1 + move.l d1,d0 + bra lz4_depack + ENDC + +;-------------------------------------------------------------------- +; Load LZ4 and delta compressed data from disk and decompress it while loading +; +; In : a0: buffer to load the data into +; d0: disk starting offset +; d1: compressed length in bytes +; + IF FW_TRACKMO_LZ4_DLT8_SUPPORT +fw_TrackloaderLoadAndDecrunchLZ4Delta8: + PUTMSG 10,<"TrackloaderLoadAndDecrunchLZ4Delta8 to %p (%ld bytes)">,a0,d1 + move.l fw_TrackBuffer(a6),a1 + adda.l d0,a1 + move.l d1,d0 + PUSHM a0 + exg a0,a1 + bsr lz4_depack + POPM + move.l a1,d0 + sub.l a0,d0 + PUTMSG 10,<"Delta8 decoding %p %ld bytes">,a2,d0 + moveq.l #0,d1 + subq.l #1,d0 + bmi.s .d8done +.d8loop + add.b (a0),d1 + move.b d1,(a0)+ + dbra d0,.d8loop + swap d0 + subq.w #1,d0 + bcs.s .d8done + swap d0 + bra.s .d8loop +.d8done + rts + ENDC diff --git a/source/framework/framework_lvos.i b/source/framework/framework_lvos.i new file mode 100644 index 0000000..b322712 --- /dev/null +++ b/source/framework/framework_lvos.i @@ -0,0 +1,93 @@ +FWLVOPOS SET 0 + + DEFFWFUNC InitPart + DEFFWFUNC RestoreFrameworkBase + DEFFWFUNC Error + DEFFWFUNC FlushCaches + DEFFWFUNC SetBaseCopper + DEFFWFUNC SetCopper + DEFFWFUNC VSync + DEFFWFUNC WaitForFrame + + IF FW_DYNAMIC_MEMORY_SUPPORT + DEFFWFUNC PushMemoryState + DEFFWFUNC PopMemoryState + DEFFWFUNC AllocChip + IF FW_64KB_PAGE_MEMORY_SUPPORT + DEFFWFUNC AllocChip64KB + ENDC + DEFFWFUNC AllocFast + DEFFWFUNC DropCurrentMemoryAllocations + IF FW_TOP_BOTTOM_MEM_SECTIONS + DEFFWFUNC FlipAllocationDirection + ENDC + ENDC + + IF (FW_STANDALONE_FILE_MODE==0)|FW_HD_TRACKMO_MODE + DEFFWFUNC FindFile + DEFFWFUNC LoadFile + DEFFWFUNC LoadAndDecrunchFile + DEFFWFUNC LoadFileToBuffer + DEFFWFUNC DecrunchToBuffer + DEFFWFUNC TrackmoLoadAndDecrunchToBuffer + DEFFWFUNC TrackloaderDiskMotorOff + ENDC + + IF FW_MUSIC_SUPPORT + DEFFWFUNC StartMusic + DEFFWFUNC StopMusic + ENDC + + IF FW_MULTITASKING_SUPPORT + DEFFWFUNC AddTask + DEFFWFUNC RemTask + DEFFWFUNC VSyncWithTask + DEFFWFUNC Yield + DEFFWFUNC WaitUntilTaskFinished + + IF FW_BLITTERTASK_MT_SUPPORT + DEFFWFUNC AddAndRunBlitterTask + DEFFWFUNC YieldToBlitterTask + DEFFWFUNC FinishBlitterTask + ENDC + ELSE + IFEQ FWGENLVOTABLE +_LVOFrameWorkVSyncWithTask = _LVOFrameWorkVSync + ENDC + ENDC + + IF FW_PALETTE_LERP_SUPPORT + DEFFWFUNC InitPaletteLerp + DEFFWFUNC InitPaletteLerpSameColor + DEFFWFUNC FadePaletteTo + DEFFWFUNC DoFadePaletteStep + ENDC + + IF FW_SCRIPTING_SUPPORT + DEFFWFUNC InstallScript + DEFFWFUNC CheckScript + IF FW_MUSIC_SUPPORT + DEFFWFUNC InstallMusicScript + DEFFWFUNC CheckMusicScript + ENDC + ENDC + + IF FW_BLITTERQUEUE_SUPPORT + DEFFWFUNC AddToBlitterQueue + DEFFWFUNC SetBlitterQueueMultiFrame + DEFFWFUNC SetBlitterQueueSingleFrame + DEFFWFUNC TriggerBlitterQueue + DEFFWFUNC TriggerCustomBlitterQueue + DEFFWFUNC JoinBlitterQueue + DEFFWFUNC TerminateBlitterQueue + ENDC + + IF FW_LZ4_SUPPORT + DEFFWFUNC DecompressLZ4 + ENDC + IF FW_ZX0_SUPPORT + DEFFWFUNC DecompressZX0 + ENDC + IF FW_DOYNAX_SUPPORT + DEFFWFUNC DecompressDoynax + ENDC diff --git a/source/framework/framework_macros.i b/source/framework/framework_macros.i new file mode 100644 index 0000000..06ca5ea --- /dev/null +++ b/source/framework/framework_macros.i @@ -0,0 +1,214 @@ + IFND FRAMEWORK_MACROS_I +FRAMEWORK_MACROS_I SET 1 + + IFD FW_DEMO_PART +CALLFW MACRO + jsr _LVOFrameWork\1(a6) + ENDM + ELSE +CALLFW MACRO + bsr fw_\1 + ENDM + ENDC + +DEFFWFUNC MACRO + IF FWGENLVOTABLE + dc.w fw_\1-* + ELSE +FWLVOPOS SET FWLVOPOS-6 + IFND _LVOFrameWork\1 +_LVOFrameWork\1 = FWLVOPOS + ENDC + ENDC + ENDM + +DISABLE_INTS MACRO + ; do this twice so to be sure that it has propagated to IPL and we really don't get an interrupt + move.w #INTF_INTEN,intena(a5) + move.w #INTF_INTEN,intena(a5) + ENDM + +ENABLE_INTS MACRO + move.w #INTF_SETCLR|INTF_INTEN,intena(a5) + ENDM + +;Blitter logic macros +;& (bitwise and) +;^ (bitwise exclusive-or) +;| (bitwise inclusive-or) +;~ (bitwise not) +; idle cycles for normal operation (not line or fill!) +BLTEN_A = $0800 ; 1 idle cycle +BLTEN_B = $0400 ; 2 idle cycles +BLTEN_C = $0200 ; 1 idle cycle +BLTEN_D = $0100 ; 1 idle cycle +BLTEN_AD = (BLTEN_A|BLTEN_D) ; NO idle cycle +BLTEN_BD = (BLTEN_B|BLTEN_D) ; 1 idle cycle +BLTEN_CD = (BLTEN_C|BLTEN_D) ; 1 idle cycle +BLTEN_ABD = (BLTEN_A|BLTEN_B|BLTEN_D) ; NO idle cycle +BLTEN_ACD = (BLTEN_A|BLTEN_C|BLTEN_D) ; NO idle cycle +BLTEN_BCD = (BLTEN_B|BLTEN_C|BLTEN_D) ; 1 idle cycle +BLTEN_ABCD = (BLTEN_A|BLTEN_B|BLTEN_C|BLTEN_D) ; NO idle cycle +BLTEN_AB = (BLTEN_A|BLTEN_B) ; 1 idle cycle +BLTEN_AC = (BLTEN_A|BLTEN_C) ; NO idle cycle +BLTEN_BC = (BLTEN_B|BLTEN_C) ; 1 idle cycle +BLTEN_ABC = (BLTEN_A|BLTEN_B|BLTEN_C) ; NO idle cycle + +BLT_A = %11110000 +BLT_B = %11001100 +BLT_C = %10101010 + +BLTHOGON MACRO + move.w #DMAF_SETCLR|DMAF_BLITHOG,dmacon(a5) + ENDM +BLTHOGOFF MACRO + move.w #DMAF_BLITHOG,dmacon(a5) + ENDM + +BLTWAIT MACRO +.bw\@ + btst #DMAB_BLTDONE-8,dmaconr(a5) + bne.s .bw\@ + ENDM + +;-------------------------------------------------------------------- + +; channels, minterm, shift a, shift b, (optional: target) +BLTCON_SET MACRO + ; write both bltcon0/bltcon1 + IFNC '\5','' + move.l #(((BLTEN_\1+((\2)&$ff))|(\3<<12))<<16)|(\4<<12),\5 + ELSE + move.l #(((BLTEN_\1+((\2)&$ff))|(\3<<12))<<16)|(\4<<12),bltcon0(a5) + ENDC + ENDM + +; channels, minterm, shift a, (optional: target) +BLTCON0_SET MACRO + ; write only bltcon0 + IFNC '\4','' + move.w #((BLTEN_\1+((\2)&$ff))|(\3<<12)),\4 + ELSE + move.w #((BLTEN_\1+((\2)&$ff))|(\3<<12)),bltcon0(a5) + ENDC + ENDM + +; channels, minterm, shift a, shift b, bltcon1 flags, (optional: target) +BLTCON_SET_X MACRO + ; write both bltcon0/bltcon1 + IFNC '\6','' + move.l #(((BLTEN_\1+((\2)&$ff))|(\3<<12))<<16)|(\4<<12)|(\5),\6 + ELSE + move.l #(((BLTEN_\1+((\2)&$ff))|(\3<<12))<<16)|(\4<<12)|(\5),bltcon0(a5) + ENDC + ENDM + +; issue blitter wait to copper list (in a0) +COPBLITWAIT MACRO + move.l #COP_WAITBLIT_DATA,(a0)+ + move.l #COP_WAITBLIT_DATA,(a0)+ ; avoid OCS hardware bug + ENDM + +; issue immediate write of register to copper list (in a0) +COPIMOVE MACRO + move.l #((\2)<<16)|((\1)&$ffff),(a0)+ + ENDM + +; issue register (or ea) write of register to copper list (in a0) +COPRMOVE MACRO + move.w #\2,(a0)+ + move.w \1,(a0)+ + ENDM + +; write 32 bit pointer to register pair to copper list (in a0) using temp data register +COPPTMOVE MACRO + move.l \1,\3 + swap \3 + move.w #\2,(a0)+ + move.w \3,(a0)+ + move.w #(\2)+2,(a0)+ + move.w \1,(a0)+ + ENDM + +; reuse temp register of COPPTMOVE to write the same pointer to more register pairs +COPPTMOVEMORE MACRO + move.w #\2,(a0)+ + move.w \3,(a0)+ + move.w #(\2)+2,(a0)+ + move.w \1,(a0)+ + ENDM + +; write 32 bit pointer in data register to register pair to copper list (in a0) +COPDPTMOVE MACRO + swap \1 + move.w #\2,(a0)+ + move.w \1,(a0)+ + swap \1 + move.w #(\2)+2,(a0)+ + move.w \1,(a0)+ + ENDM + + IF FW_BLITTERQUEUE_SUPPORT +; shortcut macro for AddToBlitterQueue (queue must NOT be empty!) +; first parameter: node +; second parameter: scratch address register +ADD_TO_BLITTER_QUEUE MACRO + move.l fw_BlitterQueueWritePtr(a6),\2 + move.l \1,(\2) + move.l \1,fw_BlitterQueueWritePtr(a6) + ENDM + +; the following macros are for a series of blits, +; shortcut macro for AddToBlitterQueue (queue must NOT be empty!) +; parameter: register that is used for storing the previous node pointer +PREP_ADD_TO_BLITTER_QUEUE MACRO + move.l fw_BlitterQueueWritePtr(a6),\1 + ENDM + +; shortcut macro for AddToBlitterQueue (queue MUST be empty!), replaces PREP_ADD_TO_BLITTER_QUEUE +; first parameter: node +; second parameter: register that is used for storing the previous node pointer +FIRST_ADD_TO_BLITTER_QUEUE MACRO + move.l \1,\2 + ENDM + +; shortcut macro for AddToBlitterQueue (queue must NOT be empty!) +; first parameter: node +; second parameter: register that is used for storing the previous node pointer +FAST_ADD_TO_BLITTER_QUEUE MACRO + move.l \1,(\2) + move.l \1,\2 + ENDM + +; shortcut macro for AddToBlitterQueue (queue MAY be empty!) +; first parameter: node +; second parameter: register that is used for storing the previous node pointer +SAFE_ADD_TO_BLITTER_QUEUE MACRO + tst.l fw_BlitterQueueWritePtr(a6) + beq.s .isfirst\@ + move.l fw_BlitterQueueWritePtr(a6),\2 + move.l \1,(\2) +.isfirst\@ + move.l \1,\2 + ENDM + +; shortcut macro for AddToBlitterQueue (queue must NOT be empty!) +; first parameter: node +; second parameter: register that is used for storing the previous node pointer +LAST_ADD_TO_BLITTER_QUEUE MACRO + move.l \1,(\2) + move.l \1,fw_BlitterQueueWritePtr(a6) + ENDM + +; shortcut macro for AddToBlitterQueue +; parameter: register that is used for storing the previous node pointer +TERM_ADD_TO_BLITTER_QUEUE MACRO + move.l \1,fw_BlitterQueueWritePtr(a6) + ENDM + +TERMINATE_BLITTER_QUEUE MACRO + clr.l fw_BlitterQueueWritePtr(a6) + ENDM + ENDC + + ENDC ; FRAMEWORK_MACROS_I \ No newline at end of file diff --git a/source/framework/framework_memory.asm b/source/framework/framework_memory.asm new file mode 100644 index 0000000..6ea32b4 --- /dev/null +++ b/source/framework/framework_memory.asm @@ -0,0 +1,534 @@ +;-------------------------------------------------------------------- +DEBUGMEM MACRO + IFGE DEBUG_DETAIL-10 + bsr fw_DebugMemoryManagement + ENDC + ENDM + +;-------------------------------------------------------------------- +; Initializes the memory stacks for chip- and fast-mem +; +fw_InitMemoryManagement: + move.l fw_ChipMemStack(a6),d0 + move.l fw_ChipMemStackEnd(a6),d1 + move.l fw_FastMemStack(a6),d2 + move.l fw_FastMemStackEnd(a6),d3 + PUTMSG 10,<"Chipmem %p - %p, Fastmem %p - %p">,d0,d1,d2,d3 + + lea fw_MemBottomStack(a6),a1 + move.l d0,cf_ChipMemLevel+mtb_CurrLevelPtr(a1) + move.l d0,cf_ChipMemLevel+mtb_MinLevelPtr(a1) + move.l d2,cf_FastMemLevel+mtb_CurrLevelPtr(a1) + move.l d2,cf_FastMemLevel+mtb_MinLevelPtr(a1) + ;clr.w fw_CurrMemBottomLevel(a6) + + lea fw_MemTopStack(a6),a1 + move.l d1,cf_ChipMemLevel+mtb_CurrLevelPtr(a1) + move.l d1,cf_ChipMemLevel+mtb_MinLevelPtr(a1) + move.l d3,cf_FastMemLevel+mtb_CurrLevelPtr(a1) + move.l d3,cf_FastMemLevel+mtb_MinLevelPtr(a1) + ;clr.w fw_CurrMemTopLevel(a6) + + DEBUGMEM + rts + +;-------------------------------------------------------------------- +; Frees all allocated memory +; +; Frees the memory of the current stack and current direction. +; Memory of other allocation direction is unchanged. +; +fw_DropCurrentMemoryAllocations: + PUTMSG 10,<"%d: DropCurrentMemoryAllocations">,fw_FrameCounterLong(a6) + IFGE DEBUG_DETAIL-20 + PUSHM a0/a1/d0 + ELSE + PUSHM a1 + ENDC + DEBUGMEM + IF FW_TOP_BOTTOM_MEM_SECTIONS + bsr fw_DetectAllocationDirection + bne.s .toptobottom + ENDC + PUTMSG 10,<"DOWN: Freeing all"> + lea fw_MemBottomStack(a6),a1 + adda.w fw_CurrMemBottomLevel(a6),a1 + + IFGE DEBUG_DETAIL-20 + move.l cf_ChipMemLevel+mtb_MinLevelPtr(a1),a0 + move.l cf_ChipMemLevel+mtb_CurrLevelPtr(a1),d0 + sub.l a0,d0 + bsr fw_FillWithGarbage + + move.l cf_FastMemLevel+mtb_MinLevelPtr(a1),a0 + move.l cf_FastMemLevel+mtb_CurrLevelPtr(a1),d0 + sub.l a0,d0 + bsr fw_FillWithGarbage + ENDC +.cont + move.l cf_ChipMemLevel+mtb_MinLevelPtr(a1),cf_ChipMemLevel+mtb_CurrLevelPtr(a1) + move.l cf_FastMemLevel+mtb_MinLevelPtr(a1),cf_FastMemLevel+mtb_CurrLevelPtr(a1) + + DEBUGMEM + POPM + rts + IF FW_TOP_BOTTOM_MEM_SECTIONS +.toptobottom + PUTMSG 10,<"UP: Freeing all"> + lea fw_MemTopStack(a6),a1 + adda.w fw_CurrMemTopLevel(a6),a1 + + IFGE DEBUG_DETAIL-20 + move.l cf_ChipMemLevel+mtb_CurrLevelPtr(a1),a0 + move.l cf_ChipMemLevel+mtb_MinLevelPtr(a1),d0 + sub.l a0,d0 + bsr fw_FillWithGarbage + + move.l cf_FastMemLevel+mtb_CurrLevelPtr(a1),a0 + move.l cf_FastMemLevel+mtb_MinLevelPtr(a1),d0 + sub.l a0,d0 + bsr fw_FillWithGarbage + ENDC + bra.s .cont + ENDC + +;-------------------------------------------------------------------- +; Pushes the current memory allocation state to the stack +; +; This only pushes the state for the current memory allocation +; direction onto the stack. All allocated memory upto this point +; will be kept safe and will no longer be freed automatically. +; +fw_PushMemoryState: + PUSHM a1/d0-d1 + + moveq.l #cf_SIZEOF,d0 + IF FW_TOP_BOTTOM_MEM_SECTIONS + bsr fw_DetectAllocationDirection + bne.s .toptobottom + ENDC + PUTMSG 10,<"UP: ++++++ Pushing mem state ++++++"> + + add.w fw_CurrMemBottomLevel(a6),d0 + move.w d0,fw_CurrMemBottomLevel(a6) + lea fw_MemBottomStack(a6,d0.w),a1 +.cont + move.l cf_ChipMemLevel+mtb_CurrLevelPtr-cf_SIZEOF(a1),d0 + move.l cf_FastMemLevel+mtb_CurrLevelPtr-cf_SIZEOF(a1),d1 + move.l d0,cf_ChipMemLevel+mtb_CurrLevelPtr(a1) + move.l d0,cf_ChipMemLevel+mtb_MinLevelPtr(a1) + move.l d1,cf_FastMemLevel+mtb_CurrLevelPtr(a1) + move.l d1,cf_FastMemLevel+mtb_MinLevelPtr(a1) + DEBUGMEM + POPM + rts + IF FW_TOP_BOTTOM_MEM_SECTIONS +.toptobottom + PUTMSG 10,<"DOWN: ++++++ Pushing mem state ++++++"> + add.w fw_CurrMemTopLevel(a6),d0 + move.w d0,fw_CurrMemTopLevel(a6) + lea fw_MemTopStack(a6,d0.w),a1 + bra.s .cont + ENDC + +;-------------------------------------------------------------------- +; Restore the last memory state from the memory stack for the current +; allocation direction. All memory from the previous allocation is +; freed. +; +; With debug enabled, freed memory is also overwritten with garbage. +; +; Out: All registers unchanged. +; +fw_PopMemoryState: + PUSHM a0/d0 + DEBUGMEM + + IF FW_TOP_BOTTOM_MEM_SECTIONS + bsr fw_DetectAllocationDirection + bne .toptobottom + ENDC + IFGE DEBUG_DETAIL-10 + PUTMSG 10,<"UP: ------ Popping mem state ------"> + bsr fw_DropCurrentMemoryAllocations + sub.w #cf_SIZEOF,fw_CurrMemBottomLevel(a6) + bmi.s .errorbottom + ELSE + sub.w #cf_SIZEOF,fw_CurrMemBottomLevel(a6) + ENDC +.cont + DEBUGMEM + POPM + rts + IFGE DEBUG_DETAIL-10 +.errorbottom + PUTMSG 10,<"!!! Could not pop bottom memory stack (TOP: %d vs %d)">,fw_CurrMemBottomLevel-2(a6),fw_CurrMemTopLevel-2(a6) + move.w #ERROR_MEMORYWRONGPOP,d0 + bra fw_Error +.errortop + PUTMSG 10,<"!!! Could not pop top memory stack (TOP: %d vs %d)">,fw_CurrMemBottomLevel-2(a6),fw_CurrMemTopLevel-2(a6) + move.w #ERROR_MEMORYWRONGPOP,d0 + bra fw_Error + ENDC + IF FW_TOP_BOTTOM_MEM_SECTIONS +.toptobottom + IFGE DEBUG_DETAIL-10 + PUTMSG 10,<"DOWN: ------ Popping mem state ------"> + bsr fw_DropCurrentMemoryAllocations + sub.w #cf_SIZEOF,fw_CurrMemTopLevel(a6) + bmi .errortop + ELSE + sub.w #cf_SIZEOF,fw_CurrMemTopLevel(a6) + ENDC + bra .cont + ENDC + +;-------------------------------------------------------------------- +; Allocates the given amount of fastmem in the current direction of +; memory allocation (bottom->top or top->bottom). +; +; If theres not enough fast-mem, it falls back and returns chip-mem +; instead. +; +; Contents of memory are not cleared! +; +; In : d0: Size in bytes +; Out: a0: Start of memory allocation +; d0: Rounded size of allocation +; d1/a1: Trashed. +; +fw_AllocFast: + PUTMSG 10,<"%d: AllocFast(%ld)">,fw_FrameCounterLong(a6),d0 + addq.l #3,d0 + and.w #-4,d0 + + lea fw_MemBottomStack(a6),a0 + adda.w fw_CurrMemBottomLevel(a6),a0 + lea fw_MemTopStack(a6),a1 + adda.w fw_CurrMemTopLevel(a6),a1 + + move.l cf_FastMemLevel+mtb_CurrLevelPtr(a1),d1 + sub.l cf_FastMemLevel+mtb_CurrLevelPtr(a0),d1 + cmp.l d0,d1 + blo.s fw_AllocChip + + moveq.l #cf_FastMemLevel,d1 + bsr fw_DoAllocation + PUTMSG 30,<"Fast allocated at %p">,a0 + IFGE DEBUG_DETAIL-12 + bsr.s fw_FillWithGarbage + ENDC + DEBUGMEM + rts + +;-------------------------------------------------------------------- +; Allocates the given amount of chipmem in the current direction of +; memory allocation (bottom->top or top->bottom). +; +; Contents of memory are not cleared! +; +; In : d0: Size in bytes +; Out: a0: Start of memory allocation +; d0: Rounded size of allocation +; d1/a1: Trashed. +; +fw_AllocChip: + PUTMSG 10,<"%d: AllocChip(%ld)">,fw_FrameCounterLong(a6),d0 + addq.l #7,d0 + and.w #-8,d0 + + lea fw_MemBottomStack(a6),a0 + adda.w fw_CurrMemBottomLevel(a6),a0 + lea fw_MemTopStack(a6),a1 + adda.w fw_CurrMemTopLevel(a6),a1 + + move.l cf_ChipMemLevel+mtb_CurrLevelPtr(a1),d1 + sub.l cf_ChipMemLevel+mtb_CurrLevelPtr(a0),d1 + cmp.l d0,d1 + blo.s .error + + moveq.l #cf_ChipMemLevel,d1 + bsr fw_DoAllocation + + PUTMSG 30,<"Chip allocated at %p">,a0 + IFGE DEBUG_DETAIL-12 + bsr fw_FillWithGarbage + ENDC + DEBUGMEM + rts +.error + PUTMSG 10,<"Out of memory: %ld smaller than %ld">,d1,d0 + DEBUGMEM + move.w #ERROR_OUTOFMEMORY,d0 + bra fw_Error + +;-------------------------------------------------------------------- +; Allocates the given amount of chipmem within a 64 KB page in the +; current direction of memory allocation. +; +; Memory area returned is guaranteed not to cross a 64 KB page +; boundary for the given size. Depending on the current memory +; situation and size requirements, may waste up to 64 KB of memory +; in the worst case. If you need multiple allocations these +; requirements, make sure to cluster them in a good way. +; +; Contents of memory are not cleared! +; +; In : d0: Size in bytes (less or equal to 64 KB!) +; Out: a0: Start of memory allocation +; d0: Rounded size of allocation +; d1/a1: Trashed. +; + IF FW_64KB_PAGE_MEMORY_SUPPORT +fw_AllocChip64KB: + PUTMSG 10,<"%d: AllocChip64KB(%ld)">,fw_FrameCounterLong(a6),d0 + addq.l #7,d0 + and.w #-8,d0 + + lea fw_MemBottomStack(a6),a0 + adda.w fw_CurrMemBottomLevel(a6),a0 + lea fw_MemTopStack(a6),a1 + adda.w fw_CurrMemTopLevel(a6),a1 + +.retry + move.l cf_ChipMemLevel+mtb_CurrLevelPtr(a1),d1 + sub.l cf_ChipMemLevel+mtb_CurrLevelPtr(a0),d1 + cmp.l d0,d1 + blo .error + + IF FW_TOP_BOTTOM_MEM_SECTIONS + bsr fw_DetectAllocationDirection + bne.s .toptobottom + ENDC + + move.l cf_ChipMemLevel+mtb_CurrLevelPtr(a0),d1 + add.l d0,d1 + subq.l #1,d1 + swap d1 + cmp.w cf_ChipMemLevel+mtb_CurrLevelPtr(a0),d1 + beq .doallocation + + addq.w #1,cf_ChipMemLevel+mtb_CurrLevelPtr(a0) + IFGE DEBUG_DETAIL-10 + moveq.l #0,d1 + move.w cf_ChipMemLevel+mtb_CurrLevelPtr+2(a0),d1 + neg.w d1 + PUTMSG 10,<"Skipping %ld bytes of memory DOWN (sorry)">,d1 + ENDC + clr.w cf_ChipMemLevel+mtb_CurrLevelPtr+2(a0) + bra.s .retry + + IF FW_TOP_BOTTOM_MEM_SECTIONS +.toptobottom + moveq.l #0,d1 + move.w cf_ChipMemLevel+mtb_CurrLevelPtr+2(a1),d1 + beq.s .doallocation + cmp.l d0,d1 + bge.s .doallocation + + PUTMSG 10,<"Skipping %d bytes of memory UP (sorry)">,cf_ChipMemLevel+mtb_CurrLevelPtr(a1) + clr.w cf_ChipMemLevel+mtb_CurrLevelPtr+2(a1) + bra .retry + ENDC + +.doallocation + moveq.l #cf_ChipMemLevel,d1 + bsr fw_DoAllocation + + PUTMSG 30,<"Chip within 64 KB page allocated at %p">,a0 + IFGE DEBUG_DETAIL-20 + bsr fw_FillWithGarbage + ENDC + DEBUGMEM + rts +.error + PUTMSG 10,<"Out of memory: %ld smaller than %ld">,d1,d0 + DEBUGMEM + move.w #ERROR_OUTOFMEMORY,d0 + bra fw_Error + ENDC + +;-------------------------------------------------------------------- +; Changes the direction of memory allocation (bottom to top vs top +; to bottom). Also works from subtasks (be a bit careful there). +; +; Out: All registers unchanged. +; + IF FW_TOP_BOTTOM_MEM_SECTIONS +fw_FlipAllocationDirection: + IF FW_MULTITASKING_SUPPORT + tst.l fw_BackgroundTask(a6) + beq.s .flipmain + PUSHM a0 + move.l fw_BackgroundTask(a6),a0 + eor.w #1,ft_MemDirection(a0) + PUTMSG 10,<"Flipping allocation direction of task %p (%s) to %d">,a0,LN_NAME(a0),ft_MemDirection-2(a0) + POPM + rts + ENDC +.flipmain + eor.w #1,fw_MainMemDirection(a6) + PUTMSG 10,<"Flipping main allocation direction to %d">,fw_MainMemDirection-2(a6) + rts + +;-------------------------------------------------------------------- + +fw_DetectAllocationDirection: + IF FW_MULTITASKING_SUPPORT + tst.l fw_BackgroundTask(a6) + beq.s .flipmain + PUSHM a0/d0 ; avoid optimizing the movem to move so that the CCs remain intact + move.l fw_BackgroundTask(a6),a0 + tst.w ft_MemDirection(a0) + POPM + rts + ENDC +.flipmain + tst.w fw_MainMemDirection(a6) + rts + ENDC + +;-------------------------------------------------------------------- + +fw_DoAllocation: + PUSHM a1/d0/d1 + IF FW_TOP_BOTTOM_MEM_SECTIONS + bsr fw_DetectAllocationDirection + bne.s .toptobottom + ENDC + ; allocate from bottom + lea fw_MemBottomStack(a6),a1 + adda.w fw_CurrMemBottomLevel(a6),a1 + move.l mtb_CurrLevelPtr(a1,d1.w),a0 + PUTMSG 10,<"UP: Allocating %ld bytes from bottom at %p">,d0,a0 + add.l a0,d0 + move.l d0,mtb_CurrLevelPtr(a1,d1.w) +.cont + POPM + rts + IF FW_TOP_BOTTOM_MEM_SECTIONS +.toptobottom + ; allocate from top + lea fw_MemTopStack(a6),a1 + adda.w fw_CurrMemTopLevel(a6),a1 + move.l mtb_CurrLevelPtr(a1,d1.w),a0 + sub.l d0,a0 + PUTMSG 10,<"DOWN: Allocating %ld bytes from top at %p">,d0,a0 + move.l a0,mtb_CurrLevelPtr(a1,d1.w) + bra.s .cont + ENDC + +;-------------------------------------------------------------------- + + IFGE DEBUG_DETAIL-12 +fw_FillWithGarbage: + PUTMSG 10,<"Filling with garbage %p (%ld)">,a0,d0 + PUSHM a0/d0/d1 + lsr.l #2,d0 + beq.s .skipfill + subq.w #1,d0 + move.l #$DEADBE00,d1 +.fillloop + move.l d1,(a0)+ + addq.l #1,d1 + dbra d0,.fillloop + swap d0 + subq.w #1,d0 + bcs.s .skipfill + swap d0 + bra.s .fillloop +.skipfill + POPM + rts + ENDC + +;-------------------------------------------------------------------- + + IFGE DEBUG_DETAIL-10 +fw_DebugMemoryManagement: + PUSHM d0-d7/a0/a1 + lea fw_MemBottomStack(a6),a0 + adda.w fw_CurrMemBottomLevel(a6),a0 + lea fw_MemTopStack(a6),a1 + adda.w fw_CurrMemTopLevel(a6),a1 + + move.l cf_ChipMemLevel+mtb_CurrLevelPtr(a1),d0 ; current free chip: chip top - bottom + sub.l cf_ChipMemLevel+mtb_CurrLevelPtr(a0),d0 + lsr.l #8,d0 + lsr.w #2,d0 + + move.l fw_MemTopStack+cf_ChipMemLevel+mtb_MinLevelPtr(a6),d1 ; max free chip within this frame + sub.l cf_ChipMemLevel+mtb_MinLevelPtr(a0),d1 + lsr.l #8,d1 + lsr.w #2,d1 + + move.l cf_ChipMemLevel+mtb_CurrLevelPtr(a0),d2 ; bottom chip allocated in stack + sub.l cf_ChipMemLevel+mtb_MinLevelPtr(a0),d2 + lsr.l #8,d2 + lsr.w #2,d2 + + move.l cf_ChipMemLevel+mtb_MinLevelPtr(a1),d3 ; top chip allocated in stack + sub.l cf_ChipMemLevel+mtb_CurrLevelPtr(a1),d3 + lsr.l #8,d3 + lsr.w #2,d3 + + move.l cf_FastMemLevel+mtb_CurrLevelPtr(a1),d4 ; current free fast: fast top - bottom + sub.l cf_FastMemLevel+mtb_CurrLevelPtr(a0),d4 + lsr.l #8,d4 + lsr.w #2,d4 + + move.l cf_FastMemLevel+mtb_MinLevelPtr(a1),d5 ; max free fast within this frame + sub.l fw_MemBottomStack+cf_FastMemLevel+mtb_MinLevelPtr(a6),d5 + lsr.l #8,d5 + lsr.w #2,d5 + + move.l cf_FastMemLevel+mtb_CurrLevelPtr(a0),d6 ; bottom fast allocated in stack + sub.l cf_FastMemLevel+mtb_MinLevelPtr(a0),d6 + lsr.l #8,d6 + lsr.w #2,d6 + + move.l cf_FastMemLevel+mtb_MinLevelPtr(a1),d7 ; top fast allocated in stack + sub.l cf_FastMemLevel+mtb_CurrLevelPtr(a1),d7 + lsr.l #8,d7 + lsr.w #2,d7 + + PUTMSG 10,<"Mem Free: Chip: %ld of %ld KB (%ld/%ld KB) | Fast: %ld of %ld KB (%ld/%ld KB)">,d0,d1,d2,d3,d4,d5,d6,d7 + + move.l cf_ChipMemLevel+mtb_CurrLevelPtr(a0),d0 ; bottom chip allocated total + sub.l fw_MemBottomStack+cf_ChipMemLevel+mtb_MinLevelPtr(a6),d0 + add.l fw_MemTopStack+cf_ChipMemLevel+mtb_MinLevelPtr(a6),d0 ; top chip allocated total + sub.l cf_ChipMemLevel+mtb_CurrLevelPtr(a1),d0 + lsr.l #8,d0 + lsr.w #2,d0 + cmp.l fw_MaxChipUsed(a6),d0 + blt.s .lesschip + move.l d0,fw_MaxChipUsed(a6) +.lesschip + + move.l fw_MemTopStack+cf_ChipMemLevel+mtb_MinLevelPtr(a6),d1 ; max free chip total + sub.l fw_MemBottomStack+cf_ChipMemLevel+mtb_MinLevelPtr(a6),d1 + lsr.l #8,d1 + lsr.w #2,d1 + + move.l cf_FastMemLevel+mtb_CurrLevelPtr(a0),d2 ; bottom fast allocated total + sub.l fw_MemBottomStack+cf_FastMemLevel+mtb_MinLevelPtr(a6),d2 + add.l fw_MemTopStack+cf_FastMemLevel+mtb_MinLevelPtr(a6),d2 ; top fast allocated total + sub.l cf_FastMemLevel+mtb_CurrLevelPtr(a1),d2 + lsr.l #8,d2 + lsr.w #2,d2 + cmp.l fw_MaxFastUsed(a6),d2 + blt.s .lessfast + move.l d2,fw_MaxFastUsed(a6) +.lessfast + + move.l fw_MemTopStack+cf_FastMemLevel+mtb_MinLevelPtr(a6),d3 ; max free fast total + sub.l fw_MemBottomStack+cf_FastMemLevel+mtb_MinLevelPtr(a6),d3 + lsr.l #8,d3 + lsr.w #2,d3 + + PUTMSG 10,<"Mem Used: Chip: %ld of %ld KB (max. %ld KB) | Fast: %ld of %ld KB (max. %ld KB)">,d0,d1,fw_MaxChipUsed(a6),d2,d3,fw_MaxFastUsed(a6) + + PUTMSG 20,<"Chip Bottom: %p, Chip Top %p, Fast Bottom: %p, Fast Top: %p">,cf_ChipMemLevel+mtb_CurrLevelPtr(a0),cf_ChipMemLevel+mtb_CurrLevelPtr(a1),cf_FastMemLevel+mtb_CurrLevelPtr(a0),cf_FastMemLevel+mtb_CurrLevelPtr(a1) + POPM + rts + ENDC diff --git a/source/framework/framework_misc.asm b/source/framework/framework_misc.asm new file mode 100644 index 0000000..6dfe7b9 --- /dev/null +++ b/source/framework/framework_misc.asm @@ -0,0 +1,205 @@ +;-------------------------------------------------------------------- +; Endlessly loops and indicate an error +; +; In : d0.w - errorcode +; Out: never returns +; +fw_Error: + ext.l d0 + PUTMSG 10,<"Error %x (%d)">,d0,d0 +.l0 move.w d0,color(a5) + bra.s .l0 + +;-------------------------------------------------------------------- +; Sets the base copperlist and irq (empty screen). +; +; Background colour is unchanged, sprites and display are disabled. +; +; Out: Trashes d0/a0 +; +fw_SetBaseCopper: + PUTMSG 10,<"%d: SetBaseCopper">,fw_FrameCounterLong(a6) + moveq.l #0,d0 + IF FW_VBL_IRQ_SUPPORT + move.l d0,fw_VBlankIRQ(a6) + ENDC + IF FW_COPPER_IRQ_SUPPORT + move.l d0,fw_CopperIRQ(a6) + ENDC + move.w #DMAF_SPRITE|DMAF_RASTER|DMAF_COPPER,dmacon(a5) ; Disable sprite- and copper DMA to avoid race conditions overwriting cop1lc + bsr.s .clrspr + move.w #$0200,bplcon0(a5) + + move.l fw_BaseCopperlist(a6),a0 + move.l a0,cop1lc(a5) + + move.l fw_VBR(a6),a0 + move.l fw_DefaultIRQ(a6),$6c(a0) + + move.w #INTF_BLIT,intena(a5) ; disable blitter interrupt + move.w #INTF_BLIT|INTF_COPER,intreq(a5) + IF FW_COPPER_IRQ_SUPPORT + move.w #INTF_SETCLR|INTF_INTEN|INTF_COPER|INTF_VERTB,intena(a5) ; enable vblank & copper interrupts + ELSE + move.w #INTF_SETCLR|INTF_INTEN|INTF_VERTB,intena(a5) ; enable vblank interrupt + ENDC + bsr.s fw_VSync + move.w #DMAF_SETCLR|DMAF_MASTER|DMAF_BLITTER|DMAF_RASTER|DMAF_COPPER,dmacon(a5) +.clrspr + moveq.l #0,d0 + move.w d0,spr+0*8+sd_ctl(a5) + move.w d0,spr+1*8+sd_ctl(a5) + move.w d0,spr+2*8+sd_ctl(a5) + move.w d0,spr+3*8+sd_ctl(a5) + move.w d0,spr+4*8+sd_ctl(a5) + move.w d0,spr+5*8+sd_ctl(a5) + move.w d0,spr+6*8+sd_ctl(a5) + move.w d0,spr+7*8+sd_ctl(a5) + rts + +;-------------------------------------------------------------------- +; Sets a new copperlist (and waits for VBL) +; +; In: a0 = the new copperlist +; +fw_SetCopper: + move.l a0,cop1lc(a5) + IF FW_MULTITASKING_SUPPORT + bra fw_VSyncWithTask + ELSE + ;bra.s fw_VSync + ; fall through + ENDC + +;-------------------------------------------------------------------- +; Waits for the next vertical blank. +; +; This version does not allow other tasks to run in the background! +; +; Note: Also checks left mouse button for exit if configured. +; +; In : - +; Out: d0 is trashed +; + IFEQ FW_MULTITASKING_SUPPORT +fw_VSyncWithTask: + ENDC +fw_VSync: + IF FW_LMB_EXIT_SUPPORT + btst #6,$bfe001 + beq .abortdemo + ENDC +.noabort + IF 1 + move.w fw_FrameCounter(a6),d0 + BLTHOGON +.loop cmp.w fw_FrameCounter(a6),d0 + beq.s .loop + ELSE + ;btst #DMAB_BLTDONE-8,dmaconr(a5) + ;beq.s .vs1 + BLTHOGON +.vs1 btst #0,vposr+1(a5) + beq.s .vs1 +.vs0 btst #0,vposr+1(a5) + bne.s .vs0 + ENDC + rts + + IF FW_LMB_EXIT_SUPPORT +.abortdemo + move.l fw_DemoAbortStackPointer(a6),d0 + beq.s .noabort + move.l d0,sp + rts + ENDC + +;-------------------------------------------------------------------- +; Waits until the global framecounter reaches the given frame +; +; In : d0.w - frame to wait for +; Out: May trash all registers! +; +fw_WaitForFrame: + PUTMSG 10,<"%d: Waiting for frame %d">,fw_FrameCounterLong(a6),d0 +.loop + cmp.w fw_FrameCounter(a6),d0 + bmi.s .endwait + PUSHM d0 + IF FW_MULTITASKING_SUPPORT + bra fw_VSyncWithTask + ELSE + bra fw_VSync + ENDC + POPM + bra.s .loop +.endwait + PUTMSG 10,<"%d: Waiting done">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- +; Flushes the cache on Kick 2.0 or higher to avoid problems with SMC. +; (also after loading code). +; +fw_FlushCaches: + PUSHM a6 + move.l 4.w,a6 + cmp.w #37,LIB_VERSION(a6) + blo.s .lameos + CALL CacheClearU +.lameos + POPM + rts + +;-------------------------------------------------------------------- + + IF FW_COPPER_IRQ_SUPPORT +fw_copper_irq: + PUSHM d0/a0/a5/a6 + lea $dff000,a5 + move.w #INTF_COPER,intreq(a5) ;acknowledge the copper-irq. + move.w #INTF_COPER,intreq(a5) ;acknowledge the copper-irq. + move.l fw_BasePtr(pc),a6 + move.l fw_CopperIRQ(a6),d0 + beq.s .nocop + move.l d0,a0 + jsr (a0) +.nocop POPM + nop + rte + ENDC + +;-------------------------------------------------------------------- + +fw_vblank_standard_irq: + IF FW_COPPER_IRQ_SUPPORT + btst #INTB_COPER,$dff000+intreqr+1 + bne.s fw_copper_irq + ENDC + IF FW_VBL_IRQ_SUPPORT|(FW_MUSIC_SUPPORT&FW_VBL_MUSIC_IRQ) + PUSHM d0-d3/a0-a3/a5/a6 + ELSE + PUSHM a5/a6 + ENDC + lea $dff000,a5 + move.w #INTF_VERTB,intreq(a5) ;acknowledge the VBL-irq. + move.w #INTF_VERTB,intreq(a5) ;acknowledge the VBL-irq. + + move.l fw_BasePtr(pc),a6 + addq.w #1,fw_FrameCounter(a6) + IF (FW_MUSIC_SUPPORT&FW_VBL_MUSIC_IRQ) + tst.w fw_MusicEnabled(a6) + beq.s .skipmus + bsr fw_MusicPlay +.skipmus + ENDC + IF FW_VBL_IRQ_SUPPORT + move.l fw_VBlankIRQ(a6),d0 + beq.s .novbl + move.l d0,a0 + jsr (a0) ; IRQ must maintain d4-d7/a4 +.novbl + ENDC + POPM + nop + rte \ No newline at end of file diff --git a/source/framework/framework_multipart.asm b/source/framework/framework_multipart.asm new file mode 100644 index 0000000..2aa5434 --- /dev/null +++ b/source/framework/framework_multipart.asm @@ -0,0 +1,211 @@ +;-------------------------------------------------------------------- +; Multipart support for trackmos +; +; In my former demo system I used a6 as a base pointer to the demo +; framework and a4 as a pointer to my demo part variables. That +; seemed a bit wasteful and so the new system uses one pointer for +; both framework AND part variables for the current part. This, +; however, means that the framework base needs to be relocated +; depending on the part because, of course, the size of the +; local variables may vary. +; +; You must start your local variable space with +; +; STRUCTURE PartData,fw_SIZEOF +; +; and end it with +; +; LABEL pd_SIZEOF +; +;-------------------------------------------------------------------- +; Allocate the part variables +; +; The first thing each demo part needs to do is to call InitPart. +; I repeat: Start your code with: +; IFD FW_DEMO_PART +; move.l #pd_SIZEOF,d0 +; CALLFW InitPart +; ENDC +; +; Otherwise, no part variables are available via a6 and no other +; framework calls can be made (the jumping table is not available). +; +; After this call, a6 will be pointing to the new framework base +; with all your variable space cleared. +; +; Make sure that you don't free the memory allocated here until +; the end of your part! The demo framework will call +; RestoreFrameworkBase automatically at exit of your part. +; +; Flushes the caches (if available), too. +; +; In : d0 = pd_SIZEOF (part data structure size including fw_SIZEOF) +; Out: a6 = new base pointer +; Trashes: everything except a5/a6 +; +fw_InitPart: + PUTMSG 10,<"%d: InitPart(%ld)">,fw_FrameCounterLong(a6),d0 + PUSHM d0 + bsr fw_RestoreFrameworkBase + POPM + + DISABLE_INTS + move.l fw_PartFwBase(a6),a0 + move.l d0,fw_PartDataSize(a6) + add.l #-FWLVOPOS,d0 + bsr fw_AllocFast + lea -FWLVOPOS(a0),a1 + PUTMSG 40,<"LVOs from %p to %p">,a1,a0 + move.l a6,a0 + move.l a6,a3 + move.l a1,a6 + move.w #(fw_SIZEOF/4)-1,d7 + PUTMSG 40,<"Copying %d LW from %p to %p">,d7,a0,a1 +.copynew + move.l (a0)+,(a1)+ + dbra d7,.copynew + + move.l a6,fw_PartFwBase(a6) + move.l fw_PartDataSize(a6),d7 + addq.w #3,d7 + lsr.w #2,d7 + beq.s .skipclr + subq.w #1,d7 + moveq.l #0,d0 +.clrnew + move.l d0,(a1)+ + dbra d7,.clrnew +.skipclr + move.l a6,a0 + lea fw_lvo_offsets(pc),a1 +.lvoloop + move.w (a1)+,d0 + beq.s .lvodone + lea -2(a1,d0.w),a2 + move.l a2,-(a0) + move.w #%0100111011111001,-(a0) ; $4ef9 jmp x.L + bra.s .lvoloop +.lvodone + + IF FW_MULTITASKING_SUPPORT + ; The task list header is now broken after copying! We need to fix it. + lea fw_Tasks(a6),a1 + bsr fw_RelocateList + bsr fw_FixA6BaseInTaskStacks + ENDC + + lea fw_BasePtr(pc),a0 + move.l a6,(a0) + bsr fw_FlushCaches + ENABLE_INTS + PUTMSG 20,<"%d: InitPart done %p">,fw_FrameCounterLong(a6),a6 + rts + +;-------------------------------------------------------------------- +; Restore global framework base +; +; Removes the custom framework variable space and makes the global +; one active again. +; +; Out: a6 = new base pointer +; Trashes: everything except a5/a6 +; +fw_RestoreFrameworkBase: + PUTMSG 10,<"%d: RestoreFrameworkBase(%p)">,fw_FrameCounterLong(a6),a6 + DISABLE_INTS + move.l fw_PartFwBase(a6),a0 + move.l fw_PrimaryFwBase(a6),a1 + PUTMSG 40,<"Part %p, Primary %p">,a0,a1 + cmp.l a1,a0 + beq.s .noold + move.l a0,a3 + PUTMSG 40,<"Restore from %p to %p">,a0,a1 + move.l a1,a6 + move.w #(fw_SIZEOF/4)-1,d7 +.copyold + move.l (a0)+,(a1)+ + dbra d7,.copyold + + IF FW_MULTITASKING_SUPPORT + bsr fw_FixA6BaseInTaskStacks + ENDC + + move.l a6,fw_PartFwBase(a6) + clr.l fw_PartDataSize(a6) + + IF FW_MULTITASKING_SUPPORT + ; The task list header is now broken after copying! We need to fix it. + lea fw_Tasks(a6),a1 + bsr.s fw_RelocateList + ENDC + + lea fw_BasePtr(pc),a0 + move.l a6,(a0) +.noold + ENABLE_INTS + rts + +;-------------------------------------------------------------------- +; Helper function to relocate a doubly-linked list +; +; When relocating the framework base structure, we need to fix the +; contents of lists, otherwise BadThings(TM) will happen. +; This function goes through the relocated list and fixes the linkage. +; +; In: a1 = ListHead +; Trashes: a0/a1 +; + IF FW_MULTITASKING_SUPPORT +fw_RelocateList: + move.l LH_HEAD(a1),a0 + subq.l #4,a0 + cmp.l LH_TAILPRED(a1),a0 + bne.s .nonewlist + PUTMSG 10,<"Fixup empty list %p">,a1 + move.l a1,LH_TAILPRED(a1) ; fix empty list + addq.l #4,a1 + move.l a1,-(a1) + bra.s .listfixed +.nonewlist + PUTMSG 10,<"Fixup existing list %p">,a1 + move.l a1,4+LN_PRED(a0) ; fixup LN_PRED of first node (points to LH_HEAD) + move.l LH_TAILPRED(a1),a0 ; get last node + addq.l #4,a1 ; now points to LH_TAIL + move.l a1,LN_SUCC(a0) ; fixup LN_SUCC of last node (pointing to LH_TAIL) +.listfixed + rts + ENDC + +;-------------------------------------------------------------------- +; Running tasks will have the old framework base stored in their +; register context. We need to fix these occurrences. Note that +; this is not completely fool-proof, but should work for 99% of the +; cases (there shouldn't be framework-relative things). +; +; In: a3 = old base +; a6 = new base +fw_FixA6BaseInTaskStacks: + lea fw_Tasks(a3),a1 +.loop + TSTNODE a1,a1 + beq.s .done + move.l ft_USP(a1),a0 + lea ft_StackEnd(a1),a2 +.findloop + cmp.l a0,a2 + beq.s .loop + cmp.l (a0),a3 + bne.s .notmatched + PUTMSG 10,<"Replacing base at %p">,a0 + move.l a6,(a0) +.notmatched + addq.l #2,a0 + bra.s .findloop +.done rts + + +fw_lvo_offsets: +FWGENLVOTABLE SET 1 + include "../framework/framework_lvos.i" + dc.w 0 +FWGENLVOTABLE SET 0 diff --git a/source/framework/framework_music.asm b/source/framework/framework_music.asm new file mode 100644 index 0000000..b0557f8 --- /dev/null +++ b/source/framework/framework_music.asm @@ -0,0 +1,23 @@ +;-------------------------------------------------------------------- +; Starts the music playback with the given module +; +; Data and samples should be provided in fw_MusicData(a6) and +; fw_MusicSamples(a6) respectively. +; +fw_StartMusic: + move.l fw_MusicData(a6),a0 + move.l fw_MusicSamples(a6),a1 + bsr fw_MusicInit + move.w #1,fw_MusicEnabled(a6) + rts + +;-------------------------------------------------------------------- +; Stops the music playback if music is active +; +fw_StopMusic: + tst.w fw_MusicEnabled(a6) + bne.s .cont + rts +.cont clr.w fw_MusicEnabled(a6) + bra fw_MusicStop + diff --git a/source/framework/framework_palettelerp.asm b/source/framework/framework_palettelerp.asm new file mode 100644 index 0000000..2f0a309 --- /dev/null +++ b/source/framework/framework_palettelerp.asm @@ -0,0 +1,193 @@ +;-------------------------------------------------------------------- +; Initializes linear interpolation for simple palette fading. +; +; In : a0 = source palette buffer (12 bit) +; a1 = lerp structures +; d0 = number of colors +; +fw_InitPaletteLerp: + PUTMSG 20,<"Init Lerp %p with %p">,a1,a0 + subq.w #1,d0 + bcc.s .cont + rts +.cont move.w #$800,d2 +.loop + moveq.l #0,d1 + move.w d1,cl_Steps(a1) + move.w (a0),cl_Color(a1) + move.w d1,cl_Red+le_Add(a1) + move.w d1,cl_Green+le_Add(a1) + move.w d1,cl_Blue+le_Add(a1) + + move.b (a0)+,d1 + ror.w #4,d1 + add.w d2,d1 + move.w d1,cl_Red+le_Current(a1) + moveq.l #-16,d1 + and.b (a0),d1 + addq.b #8,d1 + move.b d1,cl_Green+le_Current(a1) + clr.b cl_Green+1+le_Current(a1) + + moveq.l #15,d1 + and.b (a0)+,d1 + ror.w #4,d1 + add.w d2,d1 + move.w d1,cl_Blue+le_Current(a1) + lea cl_SIZEOF(a1),a1 + dbra d0,.loop + rts + +;-------------------------------------------------------------------- +; Initializes linear interpolation for simple palette fading to given color +; +; In : a1 = lerp structures +; d0 = number of colors +; d1 = color value +; +fw_InitPaletteLerpSameColor: + PUTMSG 20,<"Init Lerp %p with %x">,a1,d1 + subq.w #1,d0 + bcc.s .cont + rts +.cont move.w d1,cl_Color(a1) + moveq.l #0,d1 + move.w d1,cl_Steps(a1) + move.w d1,cl_Red+le_Add(a1) + move.w d1,cl_Green+le_Add(a1) + move.w d1,cl_Blue+le_Add(a1) + + move.b cl_Color(a1),d1 + ror.w #4,d1 + add.w #$800,d1 + move.w d1,cl_Red+le_Current(a1) + moveq.l #-16,d1 + and.b cl_Color+1(a1),d1 + addq.b #8,d1 + move.b d1,cl_Green+le_Current(a1) + clr.b cl_Green+1+le_Current(a1) + + moveq.l #15,d1 + and.b cl_Color+1(a1),d1 + ror.w #4,d1 + add.w #$800,d1 + move.w d1,cl_Blue+le_Current(a1) + dbra d0,.iloop + rts +.iloop movem.l (a1),d1-d4 +.loop lea cl_SIZEOF(a1),a1 + movem.l d1-d4,(a1) + dbra d0,.loop + rts + +;-------------------------------------------------------------------- +; Initialize fading to the given palette from current state +; +; In : a0 = target palette (12 bit) +; a1 = lerp structures +; d0 = number of colors +; d1 = number of steps (power of two) +; +fw_FadePaletteTo: + subq.w #1,d0 + bcc.s .cont + rts +.cont + move.w d1,d4 + moveq.l #-2,d2 +.stepsizeloop + addq.w #1,d2 + lsr.w #1,d1 + bne.s .stepsizeloop +.loop + move.w d4,cl_Steps(a1) + moveq.l #0,d1 + move.b (a0)+,d1 + ror.w #4,d1 + move.w cl_Red+le_Current(a1),d3 + lsr.w #1,d1 + add.w #$80,d1 + lsr.w #1,d3 + sub.w d3,d1 + asr.w d2,d1 + move.w d1,cl_Red+le_Add(a1) + + moveq.l #-16,d1 + and.b (a0),d1 + lsl.w #8,d1 + clr.b d1 + move.w cl_Green+le_Current(a1),d3 + lsr.w #1,d1 + add.w #$80,d1 + lsr.w #1,d3 + sub.w d3,d1 + asr.w d2,d1 + move.w d1,cl_Green+le_Add(a1) + + moveq.l #15,d1 + and.b (a0)+,d1 + ror.w #4,d1 + move.w cl_Blue+le_Current(a1),d3 + lsr.w #1,d1 + add.w #$80,d1 + lsr.w #1,d3 + sub.w d3,d1 + asr.w d2,d1 + move.w d1,cl_Blue+le_Add(a1) + + lea cl_SIZEOF(a1),a1 + dbra d0,.loop + rts + +;-------------------------------------------------------------------- +; Do one step in fading for the pre-initialized +; +; Will do nothing if end-point has been already reached. +; +; In : a1 = lerp structures +; d0 = number of colors +; +fw_DoFadePaletteStep: + subq.w #1,d0 + bcc.s .cont +.done rts + +.cont lea cl_Steps(a1),a0 + tst.w (a0) + bmi.s .done + moveq.l #0,d4 +.loop + addq.w #2,a1 + move.w (a1),d1 ; cl_Steps + beq.s .skip + moveq.l #1,d4 + subq.w #1,d1 + move.w d1,(a1)+ ; cl_Steps + move.w (a1)+,d1 ; cl_Red+le_Add + add.w (a1),d1 ; cl_Red+le_Current + move.w d1,(a1)+ ; cl_Red+le_Current + move.w (a1)+,d2 ; cl_Green+le_Add + add.w d2,(a1)+ ; cl_Green+le_Current + move.w (a1)+,d3 ; cl_Blue+le_Add + add.w (a1),d3 ; cl_Blue+le_Current + move.w d3,(a1)+ ; cl_Blue+le_Current + + lsr.w #4,d1 + moveq.l #15,d2 + rol.w #4,d3 + and.w d2,d3 + moveq.l #-16,d2 + and.b cl_Green+le_Current-(cl_Blue+le_Current+2)(a1),d2 + or.b d3,d2 + move.b d2,d1 + move.w d1,-cl_SIZEOF(a1) ; cl_Color + dbra d0,.loop + rts +.skip + lea cl_SIZEOF-2(a1),a1 + dbra d0,.loop + tst.w d4 + bne.s .noend + st (a0) +.noend + rts diff --git a/source/framework/framework_scripting.asm b/source/framework/framework_scripting.asm new file mode 100644 index 0000000..fa96779 --- /dev/null +++ b/source/framework/framework_scripting.asm @@ -0,0 +1,90 @@ +;-------------------------------------------------------------------- +; Install a script +; +; Routines of the script will be executed via CheckScript once the +; given relative frame numbers (from the point in time this routine +; is called) have been reached (or passed). +; +; A script is built in this way: +; dc.w ,-* +; dc.w ,-* +; +; The script is terminated with a zero word. +; +; In : a0 = script pointer +; +fw_InstallScript: + PUTMSG 10,<"%d: Script at %p installed">,fw_FrameCounterLong(a6),a0 + move.l a0,fw_ScriptPointer(a6) + move.w fw_FrameCounter(a6),fw_ScriptFrameOffset(a6) + rts + +;-------------------------------------------------------------------- +; Checks the script for execution +; +; Checkes if a script is installed and another cue is due to the +; current frame counter, executes it and advances the script pointer. +; +fw_CheckScript: + move.l fw_ScriptPointer(a6),d0 + bne.s .cont + rts +.cont move.l d0,a0 + move.w (a0)+,d0 + add.w fw_ScriptFrameOffset(a6),d0 + cmp.w fw_FrameCounter(a6),d0 + bgt.s .exit + move.w (a0)+,d0 + move.l a0,fw_ScriptPointer(a6) + pea -2(a0,d0.w) + PUTMSG 10,<"%d: Script hit %p">,fw_FrameCounterLong(a6),(sp) + tst.w (a0) + bne.s .exit + PUTMSG 10,<"Script terminated."> + clr.l fw_ScriptPointer(a6) +.exit rts + + IF FW_MUSIC_SUPPORT +;-------------------------------------------------------------------- +; Install a music-frame based script +; +; Routines of the script will be executed via CheckMusicScript once +; the given absolute music frame numbers have been reached (or passed). +; +; A script is built in this way: +; dc.w ,-* +; dc.w ,-* +; +; The script is terminated with a zero word. +; +; In : a0 = script pointer +; +fw_InstallMusicScript: + PUTMSG 10,<"%d: MusicScript at %p installed">,fw_FrameCounterLong(a6),a0 + move.l a0,fw_MusicScriptPointer(a6) + rts + +;-------------------------------------------------------------------- +; Checks the music script for execution +; +; Checkes if a music script is installed and another cue is due to the +; current frame counter, executes it and advances the script pointer. +; +fw_CheckMusicScript: + move.l fw_MusicScriptPointer(a6),d0 + bne.s .cont + rts +.cont move.l d0,a0 + move.w (a0)+,d0 + cmp.w fw_MusicFrameCount(a6),d0 + bgt.s .exit + move.w (a0)+,d0 + move.l a0,fw_MusicScriptPointer(a6) + pea -2(a0,d0.w) + PUTMSG 10,<"%d: MusicScript (%d) hit %p">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6),(sp) + tst.w (a0) + bne.s .exit + PUTMSG 10,<"MusicScript terminated."> + clr.l fw_MusicScriptPointer(a6) +.exit rts + ENDC diff --git a/source/framework/framework_sinetable.asm b/source/framework/framework_sinetable.asm new file mode 100644 index 0000000..267bbaa --- /dev/null +++ b/source/framework/framework_sinetable.asm @@ -0,0 +1,57 @@ +;-------------------------------------------------------------------- +; Initializes the built-in sine-table +; +; Code by a/b (EAB forum) +; +; Sine and cosine tables with 1024 entries and -16384 to +16384 range are +; accessible through the fw_SinTable(a6) and fw_CosTable(a6) base pointers. +; +fw_InitSineTable: + PUTMSG 10,<"%d: Script at %p installed">,fw_FrameCounterLong(a6),a0 + IF FW_DYNAMIC_MEMORY_SUPPORT + move.l #(1024+256)*2,d0 + bsr fw_AllocFast + move.l a0,fw_SinTable(a6) + lea 256*2(a0),a1 + move.l a1,fw_CosTable(a6) + ELSE + move.l fw_FastMemStack(a6),a0 + move.l a0,fw_SinTable(a6) + lea 256*2(a0),a1 + move.l a1,fw_CosTable(a6) + lea 1024*2(a1),a1 + move.l a1,fw_FastMemStack(a6) + ENDC + + PUTMSG 10,<"%d: Init Sine table %p">,fw_FrameCounterLong(a6),a0 + moveq.l #0,d0 ; amp=16384, length=1024 + move.w #511+2,a1 +.loop subq.l #2,a1 + move.l d0,d1 + + IF 1 +; extra accuracy begin + move.w d1,d2 + not.w d2 + mulu.w d1,d2 + divu.w #75781/2,d2 ; 16384/0.2162 + lsr.w #3,d2 ; can't do a 32-bit divu + sub.w d2,d1 +; extra accuracy end + ENDC + + asr.l #2,d1 + move.w d1,(a0)+ + neg.w d1 + move.w d1,1024-2(a0) + add.l a1,d0 + bne.s .loop + + move.l fw_SinTable(a6),a0 ; fill back of cos table + lea 1024*2(a0),a1 + moveq.l #(256/2)-1,d0 +.cloop move.l (a0)+,(a1)+ + dbra d0,.cloop + + PUTMSG 10,<"%d: Sine table done">,fw_FrameCounterLong(a6) + rts diff --git a/source/framework/framework_tasks.asm b/source/framework/framework_tasks.asm new file mode 100644 index 0000000..8bb6f63 --- /dev/null +++ b/source/framework/framework_tasks.asm @@ -0,0 +1,497 @@ +;-------------------------------------------------------------------- +; Initialize the multitasking environment. +; +fw_InitTasks: + lea fw_Tasks(a6),a1 + NEWLIST a1 + lea fw_backgroundtask_restore_irq(pc),a0 + move.l a0,fw_MultitaskingIRQ(a6) + IF FW_BLITTERTASK_MT_SUPPORT + lea fw_blitter_task_irq(pc),a0 + move.l a0,fw_BlitterTaskIRQ(a6) + ENDC + rts + +;-------------------------------------------------------------------- +; Adds a task to the list of background tasks. +; +; LN_NAME(a1) can be populated for debugging reasons +; LN_PRI(a1) from -128 (low) to +127 (high) describes the priority +; of the task. Unless a task yields, no lower priority task will be +; processed. +; Exception: For FW_ROUNDROBIN_MT_SUPPORT=1, if LN_PRI is negative, +; low prio tasks will be scheduled round robin, if the task did not yield. +; +; Note that every task will only be scheduled at most once every frame. +; May also be called from subtask. +; Note: All tasks must preserve a5/a6 until exit! +; +; In : a0: start address of routine +; a1: FrameworkTask structure (with length of ft_SIZEOF) +; All registers will be initial registers for subtask. +; Out: All registers are unchanged. +; +fw_AddTask: + PUTMSG 10,<"%d: AddTask(%p,%p,%s)">,fw_FrameCounterLong(a6),a0,a1,LN_NAME(a1) + tst.l ft_USP(a1) + bne fw_Error + IF FW_TOP_BOTTOM_MEM_SECTIONS + move.w fw_MainMemDirection(a6),ft_MemDirection(a1) + ENDC + move.l a2,-(sp) + lea ft_StackEnd(a1),a2 + exg a2,sp ; temporarily swap stack pointers + move.l a1,-(sp) ; keep node for cleanup + pea .cleanup(pc) ; routine to call after RTS from backgroundtask + move.l a0,-(sp) ; background task to jump to + clr.w -(sp) ; initial ccr + movem.l d0-d7/a0-a6,-(sp) ; initial register dump from caller + move.l sp,ft_USP(a1) + exg a2,sp + move.l (sp)+,(8+2)*4(a2) ; restore a2 to stack + move.l (8+2)*4(a2),a2 ; restore a2 to register + lea fw_Tasks(a6),a0 + DISABLE_INTS + bsr fw_EnqueueNode + ENABLE_INTS + rts + +.cleanup + ;move.l fw_BasePtr(pc),a6 + move.l (sp)+,a1 ; suppress M68kDeadWrite used by REMOVE + PUTMSG 10,<"%d: background task %p (%s) finished">,fw_FrameCounterLong(a6),a1,LN_NAME(a1) + +.waitforsafearea + move.l #$1ff00,d0 + and.l vposr(a5),d0 + cmp.l #307<<8,d0 ; we are too short before VBL, it's not safe to disable ints + bgt .waitforsafearea + + DISABLE_INTS + clr.l ft_USP(a1) ; mark task finished + REMOVE + lea fw_Tasks(a6),a1 + IFEMPTY a1,fw_KillTaskContext ; wait for doom + move.l LN_SUCC(a1),a0 ; hand over to next task + PUTMSG 40,<"Continuing to task %p (%s)">,a0,LN_NAME(a0) + move.l a0,fw_BackgroundTask(a6) + move.l ft_USP(a0),sp + ENABLE_INTS + movem.l (sp)+,d0-d7/a0-a6 + rtr + +;-------------------------------------------------------------------- + +fw_EnqueueNode: + move.b LN_PRI(a1),d1 + move.l (a0),d0 +.next + move.l d0,a0 + move.l (a0),d0 + beq.s .done + cmp.b LN_PRI(a0),d1 + ble.s .next +.done + move.l LN_PRED(a0),d0 + move.l a1,LN_PRED(a0) + move.l a0,(a1) + move.l d0,LN_PRED(a1) + move.l d0,a0 + move.l a1,(a0) + rts + +;-------------------------------------------------------------------- + +fw_KillTaskContext: + PUTMSG 50,<"KillTaskContext"> + move.l fw_VBR(a6),a0 + move.l fw_DefaultIRQ(a6),$6c(a0) + clr.l fw_BackgroundTask(a6) ; make sure we don't have a stray pointer + move.l fw_PrimaryUSP(a6),sp ; primary USP from before + clr.l fw_PrimaryUSP(a6) + move.w fw_MainCurrentFrame(a6),d0 + ENABLE_INTS +.loop cmp.w fw_FrameCounter(a6),d0 + beq.s .loop + rts + +;-------------------------------------------------------------------- +; Waits for next vertical blank and allows multitasking to happen. +; +; Note: Also checks left mouse button for exit if configured. +; +; In : - +; Out: All registers except for a5 and a6 may be trashed. +; +fw_VSyncWithTask: + move.l #$1ff00,d0 + and.l vposr(a5),d0 + cmp.l #FW_MAX_VPOS_FOR_BG_TASK<<8,d0 ; if we're too late, don't continue background task + bgt fw_VSync + + IF FW_LMB_EXIT_SUPPORT + btst #6,$bfe001 + beq .abortdemo +.noabort + ENDC + + lea fw_Tasks(a6),a1 + IFEMPTY a1,fw_VSync + SUCC a1,a1 ; take first task from list + ; context switch takes a few hundred cycles (with idle DMA) + + move.w fw_FrameCounter(a6),fw_MainCurrentFrame(a6) +.switch + PUTMSG 50,<"TaskSwitch %p">,a1 + move.l sp,fw_PrimaryUSP(a6) ; store old stackpointer (pointing to RTS address) + move.l fw_VBR(a6),a0 + move.l fw_MultitaskingIRQ(a6),$6c(a0) + PUTMSG 40,<"Switching to task %p (%s)">,a1,LN_NAME(a1) + move.l a1,fw_BackgroundTask(a6) + move.l ft_USP(a1),sp + movem.l (sp)+,d0-d7/a0-a6 ; restore context, 132 cycles (another >132 cycles in interrupt) + PUTMSG 50,<"RTR %p">,sp + rtr + + IF FW_LMB_EXIT_SUPPORT +.abortdemo + move.l fw_DemoAbortStackPointer(a6),d0 + beq.s .noabort + move.l d0,sp + rts + ENDC + +;-------------------------------------------------------------------- +; Allows the current task to switch CPU to the next task in queue. +; +; Usually may not be called from tasks, except if FW_YIELD_FROM_MAIN_TOO +; is set (then it will just call VSyncWithTask). +; +; Preserves all registers! +; +fw_Yield: + IF FW_YIELD_FROM_MAIN_TOO + tst.l fw_PrimaryUSP(a6) + bne.s .switch + ; So we're not in a background task (method should actually not be used this way) + PUTMSG 50,<"Simple yield %p">,a7 + PUSHM d0-d7/a0-a4 + bsr fw_VSyncWithTask + POPM + rts + ENDC + +.switch + PUSHM d0/a0 + move.l #$1ff00,d0 + and.l vposr(a5),d0 + cmp.l #307<<8,d0 ; it's too close to VBL, we cannot safely disable ints + ble .cont + POPM NOBUMP + rts +.cont + DISABLE_INTS + move.l fw_BackgroundTask(a6),a0 + TSTNODE a0,a0 + POPM + bne.s .doswitch + PUTMSG 50,<"No more tasks"> + subq.w #2,sp ; ccr can be anything + movem.l d0-d7/a0-a6,-(sp) + move.l fw_BackgroundTask(a6),a0 + move.l sp,ft_USP(a0) + + bra fw_KillTaskContext + +.doswitch + ; return address already on stack + subq.w #2,sp ; ccr can be anything + PUSHM d0-d7/a0-a6 + move.l fw_BackgroundTask(a6),a0 + move.l sp,ft_USP(a0) + SUCC a0,a0 + PUTMSG 40,<"Yield to task %p (%s)">,a0,LN_NAME(a0) + move.l a0,fw_BackgroundTask(a6) + move.l ft_USP(a0),sp + ENABLE_INTS + POPM + rtr + +;-------------------------------------------------------------------- +; Makes sure the given task is finished. +; +; May only be called from main. +; +; In: a1 = task structure +; +; May trash all registers except a1 +; +fw_WaitUntilTaskFinished: +.retry tst.l ft_USP(a1) + bne.s .wait + rts +.wait PUSHM a1 + bsr fw_VSyncWithTask + POPM + bra.s .retry + +;-------------------------------------------------------------------- +; Removes the task from list if it was still running +; +; May only be called from main. +; +; In: a1 = task structure +; Trashes: a0/a1 +fw_RemTask: + tst.l ft_USP(a1) + bne.s .remove + rts +.remove PUTMSG 10,<"%d: Removing still running task %p (%s)">, + clr.l ft_USP(a1) + REMOVE + rts + +;-------------------------------------------------------------------- + +fw_backgroundtask_restore_irq: + PUTMSG 50,<"MTINT %lx">,$dff000+intenar + IF FW_COPPER_IRQ_SUPPORT + btst #INTB_COPER,$dff000+intreqr+1 + bne fw_copper_irq + ENDC + move.l a6,-(sp) ; save a6, we need a spare register + move.l usp,a6 ; get USP + PUTMSG 50,<"USP %p">,a6 + move.l 4+2(sp),-(a6) ; store PC + move.w 4(sp),-(a6) ; store SR + move.l (sp)+,-(a6) ; store a6 in stack frame + movem.l d0-d7/a0-a5,-(a6) ; store the rest of the registers + move.l a6,a0 + + move.l fw_BasePtr(pc),a6 + move.l fw_BackgroundTask(a6),a1 + move.l a0,ft_USP(a1) ; save USP for background task + IF FW_ROUNDROBIN_MT_SUPPORT + tst.b LN_PRI(a1) + bpl.s .tasklocked + move.l a1,a2 + + ; REMOVE + move.l (a2)+,a0 + move.l (a2),a2 ; LN_PRED + move.l a0,(a2) + move.l a2,LN_PRED(a0) + + lea fw_Tasks+LN_PRED(a6),a0 + ; ADDTAIL + move.l LN_PRED(a0),d0 + move.l a1,LN_PRED(a0) + exg d0,a0 + movem.l d0/a0,(a1) + move.l a1,(a0) +.tasklocked + ENDC + + clr.l fw_BackgroundTask(a6) + + move.l fw_PrimaryUSP(a6),a0 ; primary USP from before + move.l (a0)+,2(sp) ; store return PC to exception frame (keep SR unchanged) + move.l a0,usp ; restore primary USP (now at position before calling the vblank wait) + clr.l fw_PrimaryUSP(a6) + + PUTMSG 50,<"Restoring USP %p">,a0 + move.l fw_VBR(a6),a0 + move.l fw_DefaultIRQ(a6),$6c(a0) + + lea $dff000,a5 + move.w #INTF_VERTB,intreq(a5) ; acknowledge the vbl-irq. + move.w #INTF_VERTB,intreq(a5) ; acknowledge the vbl-irq. + addq.w #1,fw_FrameCounter(a6) + + IF (FW_MUSIC_SUPPORT&FW_VBL_MUSIC_IRQ) + tst.w fw_MusicEnabled(a6) + beq.s .skipmus + bsr fw_MusicPlay +.skipmus + ENDC + + IF FW_VBL_IRQ_SUPPORT + move.l fw_VBlankIRQ(a6),d0 + beq.s .novbl1 + move.l d0,a0 + ; IRQ may destroy everything here (except a5/a6) + jsr (a0) +.novbl1 + ENDC + nop + rte + +;-------------------------------------------------------------------- +; Allows to run a specific task in parallel to the blitter. +; +; Make sure the blitter has been started and will not terminate within +; a few cycles (otherwise it might lose the interrupt). +; +; Due to the overhead, this routine is best used for +; - larger blits with idle cycles +; - larger blits with no idle cycles, but with blitter hogging off and +; slow CPU operations such as multiplications or division. +; +; Returns from this call, if either a blitter interrupt or VBL has +; occurred or the task finished execution. Thus you will still need to +; make sure that the blitter has finished before starting another blit. +; The task may be continued during another running blitter operation +; using YieldToBlitterTask. The task can be also finished ("joined") +; synchroneously using FinishBlitterTask. +; +; Compared to a blitter queue or normal background task, this allows more +; fine grained control over the operations to perform during specific blits. +; It also has little complexity overhead, works well when combining large +; (with bg task) and small (without separate task) blits. +; +; Although it might be possible to use this across VBL, it is not recommended. +; A VBL will interrupt the blitter task early even if the blitter is still +; running for some more time. +; +; Note: The task must preserve a5/a6 until exit! This task may not Yield! +; May only be called from the main task! +; +; Trashes all registers except for a5/a6 +; + IF FW_BLITTERTASK_MT_SUPPORT +fw_AddAndRunBlitterTask: + DISABLE_INTS + move.w #INTF_BLIT,intreq(a5) ; clear the blitter-irq. + move.l a1,fw_BackgroundTask(a6) + +.switch + move.l sp,fw_PrimaryUSP(a6) ; store old stackpointer (pointing to RTS address) + PUTMSG 50,<"Blitter TaskSwitch %p">,a1 + lea ft_StackEnd(a1),sp + clr.l -(sp) ; a little space for the task stackpointer + pea .cleanup(pc) ; routine to call after RTS from backgroundtask + move.l a0,-(sp) ; background task to jump to + + move.l fw_VBR(a6),a0 + move.l fw_BlitterTaskIRQ(a6),$6c(a0) + move.w #INTF_SETCLR|INTF_INTEN|INTF_BLIT,intena(a5) ; enable interrupts, including blitter int + rts + +.cleanup + move.w #INTF_INTEN|INTF_BLIT,intena(a5) ; disable interrupts, including blitter int + move.w #INTF_INTEN|INTF_BLIT,intena(a5) ; disable interrupts, including blitter int + ; FIXME do we have a race condition here? What happens if the blitter finishes right before this instruction? + ;move.l fw_BasePtr(pc),a6 + move.l fw_PrimaryUSP(a6),d0 + bne.s .irqcleanup + move.l (sp)+,sp ; we're coming from FinishBlitterTask + ENABLE_INTS + rts +.irqcleanup + PUTMSG 30,<"%d: blitter task finished">,fw_FrameCounterLong(a6) + move.l fw_VBR(a6),a0 + move.l fw_DefaultIRQ(a6),$6c(a0) + clr.l fw_BackgroundTask(a6) ; make sure we don't have a stray pointer + move.l d0,sp ; switch to primary task + clr.l fw_PrimaryUSP(a6) + move.w #INTF_BLIT,intena(a5) ; disable blitter int again + ENABLE_INTS + rts + +;-------------------------------------------------------------------- +; Allows the current task to switch CPU to the current blitter task. +; +; Returns from this call immediately if the task was already finished. +; May return later if either a blitter interrupt or VBL has +; occurred or the task finished execution. +; The task can be also finished synchroneously using FinishBlitterTask. +; +; May only be called from the main task! +; +; In: a0 = task +; Trashes all registers except for a5/a6 +; +fw_YieldToBlitterTask: + move.l fw_BackgroundTask(a6),d0 + beq.s .noswitch + DISABLE_INTS + move.w #INTF_BLIT,intreq(a5) ; clear the blitter-irq. + move.l sp,fw_PrimaryUSP(a6) ; store old stackpointer (pointing to RTS address) + move.l d0,a0 + move.l ft_USP(a0),sp + PUTMSG 40,<"Yielding to Blitter task %p (%s)">,a0,LN_NAME(a0) + move.l fw_VBR(a6),a0 + move.l fw_BlitterTaskIRQ(a6),$6c(a0) + movem.l (sp)+,d0-d7/a0-a6 + move.w #INTF_SETCLR|INTF_INTEN|INTF_BLIT,intena(a5) ; enable interrupts, including blitter int + rtr +.noswitch + PUTMSG 50,<"Blitter task not available"> + rts + +;-------------------------------------------------------------------- +; Finish Blitter parallel task outside of blitter action. +; +; Returns from this call, immediately if the task was already finished. +; Otherwise, runs the task until the end. +; +; May only be called from the main task! +; +; Trashes all registers except for a5/a6 +; +fw_FinishBlitterTask: + DISABLE_INTS + move.l fw_BackgroundTask(a6),d0 + bne.s .doswitch + PUTMSG 50,<"Blitter task not available"> + ENABLE_INTS + rts + +.doswitch + move.l d0,a0 + PUTMSG 50,<"Restoring Blitter Task %p">,a0 + clr.l fw_BackgroundTask(a6) + move.l sp,ft_StackEnd-4(a0) + move.l ft_USP(a0),sp + ENABLE_INTS + movem.l (sp)+,d0-d7/a0-a6 + rtr + +;-------------------------------------------------------------------- + +fw_blitter_task_irq: + PUTMSG 50,<"BLINT %lx">,$dff000+intenar + IF FW_COPPER_IRQ_SUPPORT + btst #INTB_COPER,$dff000+intreqr+1 + bne fw_copper_irq + ENDC + move.l a6,-(sp) ; save a6, we need a spare register + move.l usp,a6 ; get USP + PUTMSG 50,<"USP %p">,a6 + move.l 4+2(sp),-(a6) ; store PC + move.w 4(sp),-(a6) ; store SR + move.l (sp)+,-(a6) ; store a6 in stack frame + movem.l d0-d7/a0-a5,-(a6) ; store the rest of the registers + move.l a6,a0 + + move.l fw_BasePtr(pc),a6 + move.l fw_BackgroundTask(a6),a1 + move.l a0,ft_USP(a1) ; save USP for background task + + move.l fw_PrimaryUSP(a6),a0 ; primary USP from before + move.l (a0)+,2(sp) ; store return PC to exception frame (keep SR unchanged) + move.l a0,usp ; restore primary USP (now at position before calling the vblank wait) + clr.l fw_PrimaryUSP(a6) + + lea $dff000,a5 + move.w #INTF_BLIT,intreq(a5) ; acknowledge the blitter irq. + move.w #INTF_BLIT,intena(a5) ; disable the blitter irq + + PUTMSG 50,<"Restoring USP %p">,a0 + move.l fw_VBR(a6),a0 + move.l fw_DefaultIRQ(a6),$6c(a0) + + nop + rte + + ENDC diff --git a/source/framework/framework_trackloader.asm b/source/framework/framework_trackloader.asm new file mode 100644 index 0000000..840f305 --- /dev/null +++ b/source/framework/framework_trackloader.asm @@ -0,0 +1,902 @@ +;------------------------------------------------------ +; MFM trackloader based on Photon/Scoopex old snippets +; Changes by Michael "Axis" Hillebrandt. +; Completely reworked by Chris 'platon42' Hodges. +;------------------------------------------------------ + +MFMsync = $4489 +MFMBUFSIZE = 12800 + + IF FW_MULTITASKING_SUPPORT + IFEQ FW_YIELD_FROM_MAIN_TOO + fail "Trackloader will be called from main task, too" + ENDC +TRKLDRYIELD MACRO + bsr fw_Yield + ENDM + ELSE +TRKLDRYIELD MACRO + ENDM + ENDC + +; Initializes the loader, turns motor on and steps to track 0 +fw_InitTrackLoader: + move.l #MFMBUFSIZE,d0 + bsr fw_AllocChip + move.l a0,fw_MfmTrackBuffer(a6) + move.l #11*512,d0 + bsr fw_AllocFast + move.l a0,fw_TrackBuffer(a6) + + PUSHM a4 + PUTMSG 10,<"MfmTrack buffer at %p, decoded Track buffer at %p">,fw_MfmTrackBuffer(a6),fw_TrackBuffer(a6) + lea $bfd100,a4 + clr.w fw_CurrentHead(a6) + ;clr.w fw_CurrentDrive(a6) + IF FW_MULTITASKING_SUPPORT + move.w #1,fw_TrackloaderIdle(a6) + ENDC + moveq.l #-1,d0 + move.w d0,fw_LastMfmTrack(a6) + move.w d0,fw_LastTrack(a6) + clr.l fw_TrackChecksum(a6) + bsr fw_FindRightFloppyDriveUnit + POPM + rts + +; Turns on motor if not already on +fw_TrackloaderDiskMotorOn: + tst.w fw_DriveMotorOn(a6) + bne.s .skip + PUSHM a4 + lea $bfd100,a4 + bsr fw_MotorOn + POPM +.skip + rts + +; Turns the motor off (after reading has completed) +fw_TrackloaderDiskMotorOff: + PUSHM a4 + lea $bfd100,a4 + bsr fw_MotorOff + POPM + rts + +;-------------------------------------------------------------------- +; Load data from disk +; +; In : a0: buffer to load the data into +; d0: disk starting offset +; d1: length in bytes +; +fw_TrackloaderLoad: + PUSHM d4-d7/a4 + lea $bfd100,a4 + lea .plaincopy(pc),a2 + bsr fw_LoadMFM + POPM + rts + +.plaincopy + PUTMSG 10,<"Copying %d bytes (%ld left) from %p to %p">,d3,d7,a1,a3 + subq.w #1,d3 + lsr.w #1,d3 +.copyloop + move.w (a1)+,(a3)+ + dbra d3,.copyloop + rts + +;-------------------------------------------------------------------- +; Load LZ4 compressed data from disk and decompress it while loading +; +; In : a0: buffer to load the data into +; d0: disk starting offset +; d1: compressed length in bytes +; + IF FW_TRACKMO_LZ4_SUPPORT +fw_TrackloaderLoadAndDecrunchLZ4: + PUSHM d4-d7/a4 + lea $bfd100,a4 + lea .lz4decode(pc),a2 + clr.w fw_TrackLz4State(a6) + bsr fw_LoadMFM + POPM + rts + +.lz4decode + moveq.l #0,d5 + move.w fw_TrackLz4State(a6),d5 + PUTMSG 50,<"LZ4 State %d %ld bytes, %ld left from %p to %p">,d5,d3,d7,a1,a3 + lea .lz4states(pc),a0 + adda.w (a0,d5.w),a0 + jmp (a0) +.lz4states + dc.w .lzstart-.lz4states ; 0 + dc.w .lzlitsizeentry-.lz4states ; 2 + dc.w .lzlitcopy-.lz4states ; 4 + dc.w .lzreadoffsetlo-.lz4states ; 6 + dc.w .lzreadoffsethi-.lz4states ; 8 + dc.w .lzmatchlengthentry-.lz4states ; 10 + +.lzstart + moveq.l #0,d0 + move.b (a1)+,d0 + moveq.l #15,d1 + and.w d0,d1 + lsr.b #4,d0 + move.w d0,fw_TrackLz4LiteralLength(a6) + move.w d1,fw_TrackLz4MatchLength(a6) + + moveq.l #2,d5 ; next state (lit size) + + cmp.w #15,d0 + blt.s .lzlitsizefinished + +.lzlitsizeloop + subq.w #1,d3 + beq.s .lzstateterm ; buffer ends before literal size finalized +.lzlitsizeentry + moveq.l #0,d0 + move.b (a1)+,d0 + add.w d0,fw_TrackLz4LiteralLength(a6) + not.b d0 + beq.s .lzlitsizeloop + +.lzlitsizefinished + moveq.l #4,d5 ; next state (lit copy) + + subq.w #1,d3 + beq.s .lzstateterm ; buffer ends right after literal size finished + +.lzlitcopy + move.w fw_TrackLz4LiteralLength(a6),d0 + beq.s .lznoliterals ; literal size is 0, skip copying literals + cmp.w d3,d0 + ble.s .lzfulllitcopy + ; at least one byte is leftover +.lzlitcopyuntileob + move.w d3,d0 + sub.w d3,fw_TrackLz4LiteralLength(a6) ; deduct from literal size + subq.w #1,d3 +.lzlitcopyloopeob + move.b (a1)+,(a3)+ + dbra d3,.lzlitcopyloopeob + bra .lzstateterm + +.lzstateterm + PUTMSG 40,<"Terminated at %p (output %p)">,a1,a3 + move.w d5,fw_TrackLz4State(a6) + rts + +.lzfulllitcopy + sub.w d0,d3 + subq.w #1,d0 +.lzlitcopyloop + move.b (a1)+,(a3)+ + dbra d0,.lzlitcopyloop + +.lznoliterals + moveq.l #6,d5 ; next state (match offset hi) + tst.w d3 + beq.s .lzstateterm ; buffer ended right after lit copy +.lzreadoffsetlo + move.b (a1)+,fw_TrackLz4Offset+3(a6) + moveq.l #8,d5 ; next state (match offset lo) + subq.w #1,d3 + beq.s .lzstateterm ; buffer ended right after offset lo +.lzreadoffsethi + move.b (a1)+,fw_TrackLz4Offset+2(a6) + moveq.l #10,d5 ; next state (additional match length) + moveq.l #0,d0 + move.w fw_TrackLz4MatchLength(a6),d1 + cmp.w #15,d1 + blt.s .lzskipmatchlength + +.lzmatchlengthloop + subq.w #1,d3 + bne.s .lzmatchlengthenterloop + move.w d1,fw_TrackLz4MatchLength(a6) + bra.s .lzstateterm ; buffer ends before literal size finalized +.lzmatchlengthentry + move.w fw_TrackLz4MatchLength(a6),d1 + moveq.l #0,d0 +.lzmatchlengthenterloop + move.b (a1)+,d0 + add.w d0,d1 + not.b d0 + beq.s .lzmatchlengthloop + +.lzskipmatchlength + ; copy match + addq.w #3,d1 + move.l a3,a0 + suba.l fw_TrackLz4Offset(a6),a0 +.lzmatchcopy + move.b (a0)+,(a3)+ + dbra d1,.lzmatchcopy +.lzskipmatch + moveq.l #0,d5 ; reset state machine + subq.w #1,d3 + beq .lzstateterm ; buffer ends before next sequence + bra .lzstart ; start over + ENDC + +;-------------------------------------------------------------------- +; Load LZ4 and delta compressed data from disk and decompress it while loading +; +; In : a0: buffer to load the data into +; d0: disk starting offset +; d1: compressed length in bytes +; + IF FW_TRACKMO_LZ4_DLT8_SUPPORT +fw_TrackloaderLoadAndDecrunchLZ4Delta8: + PUSHM d4-d7/a4 + lea $bfd100,a4 + lea .lz4decode(pc),a2 + clr.w fw_TrackLz4State(a6) + clr.b fw_TrackLz4Delta8Value(a6) + bsr fw_LoadMFM + POPM + rts + +.lz4decode + moveq.l #0,d5 + move.w fw_TrackLz4State(a6),d5 + PUTMSG 50,<"LZ4 State %d %ld bytes, %ld left from %p to %p">,d5,d3,d7,a1,a3 + lea .lz4states(pc),a0 + adda.w (a0,d5.w),a0 + jmp (a0) +.lz4states + dc.w .lzstart-.lz4states ; 0 + dc.w .lzlitsizeentry-.lz4states ; 2 + dc.w .lzlitcopy-.lz4states ; 4 + dc.w .lzreadoffsetlo-.lz4states ; 6 + dc.w .lzreadoffsethi-.lz4states ; 8 + dc.w .lzmatchlengthentry-.lz4states ; 10 + +.lzstart + moveq.l #0,d0 + move.b (a1)+,d0 + moveq.l #15,d1 + and.w d0,d1 + lsr.b #4,d0 + move.w d0,fw_TrackLz4LiteralLength(a6) + move.w d1,fw_TrackLz4MatchLength(a6) + + moveq.l #2,d5 ; next state (lit size) + + cmp.w #15,d0 + blt.s .lzlitsizefinished + +.lzlitsizeloop + subq.w #1,d3 + beq.s .lzstateterm ; buffer ends before literal size finalized +.lzlitsizeentry + moveq.l #0,d0 + move.b (a1)+,d0 + add.w d0,fw_TrackLz4LiteralLength(a6) + not.b d0 + beq.s .lzlitsizeloop + +.lzlitsizefinished + moveq.l #4,d5 ; next state (lit copy) + + subq.w #1,d3 + beq.s .lzstateterm ; buffer ends right after literal size finished + +.lzlitcopy + move.w fw_TrackLz4LiteralLength(a6),d0 + beq.s .lznoliterals ; literal size is 0, skip copying literals + cmp.w d3,d0 + ble.s .lzfulllitcopy + ; at least one byte is leftover +.lzlitcopyuntileob + move.w d3,d0 + sub.w d3,fw_TrackLz4LiteralLength(a6) ; deduct from literal size + subq.w #1,d3 + move.b fw_TrackLz4Delta8Value(a6),d4 +.lzlitcopyloopeob + add.b (a1)+,d4 + move.b d4,(a3)+ + dbra d3,.lzlitcopyloopeob + move.b d4,fw_TrackLz4Delta8Value(a6) + bra .lzstateterm + +.lzstateterm + PUTMSG 40,<"Terminated at %p (output %p)">,a1,a3 + move.w d5,fw_TrackLz4State(a6) + rts + +.lzfulllitcopy + sub.w d0,d3 + subq.w #1,d0 + move.b fw_TrackLz4Delta8Value(a6),d4 +.lzlitcopyloop + add.b (a1)+,d4 + move.b d4,(a3)+ + dbra d0,.lzlitcopyloop + move.b d4,fw_TrackLz4Delta8Value(a6) + +.lznoliterals + moveq.l #6,d5 ; next state (match offset hi) + tst.w d3 + beq.s .lzstateterm ; buffer ended right after lit copy +.lzreadoffsetlo + move.b (a1)+,fw_TrackLz4Offset+3(a6) + moveq.l #8,d5 ; next state (match offset lo) + subq.w #1,d3 + beq.s .lzstateterm ; buffer ended right after offset lo +.lzreadoffsethi + move.b (a1)+,fw_TrackLz4Offset+2(a6) + moveq.l #10,d5 ; next state (additional match length) + moveq.l #0,d0 + move.w fw_TrackLz4MatchLength(a6),d1 + cmp.w #15,d1 + blt.s .lzskipmatchlength + +.lzmatchlengthloop + subq.w #1,d3 + bne.s .lzmatchlengthenterloop + move.w d1,fw_TrackLz4MatchLength(a6) + bra.s .lzstateterm ; buffer ends before literal size finalized +.lzmatchlengthentry + move.w fw_TrackLz4MatchLength(a6),d1 + moveq.l #0,d0 +.lzmatchlengthenterloop + move.b (a1)+,d0 + add.w d0,d1 + not.b d0 + beq.s .lzmatchlengthloop + +.lzskipmatchlength + ; copy match + addq.w #3,d1 + move.l a3,a0 + suba.l fw_TrackLz4Offset(a6),a0 + move.b fw_TrackLz4Delta8Value(a6),d4 +.lzmatchcopy + move.b (a0)+,d0 + sub.b -2(a0),d0 + add.b d0,d4 + move.b d4,(a3)+ + dbra d1,.lzmatchcopy + move.b d4,fw_TrackLz4Delta8Value(a6) +.lzskipmatch + moveq.l #0,d5 ; reset state machine + subq.w #1,d3 + beq .lzstateterm ; buffer ends before next sequence + bra .lzstart ; start over + ENDC + +;-------------------------------------------------------------------- +; Waits for a diskchange (disk is removed and inserted again) +; +fw_TrackloaderWaitForDiskChange: + PUSHM a4 + lea $bfd100,a4 +.ready TRKLDRYIELD + btst #CIAB_DSKRDY,$bfe001-$bfd100(a4) + bne.s .ready +.notready + TRKLDRYIELD + btst #CIAB_DSKRDY,$bfe001-$bfd100(a4) + beq.s .notready + + bsr fw_MotorOff + POPM + rts + +; Load sectors from disk +; a0 - buffer to load the data into (must be even) +; a2 - routine to be called for post processing buffer with a3 current buffer pos, a1, trackdisk buffer, d3 length +; d0.l - disk offset (must be even) +; d1.l - bytes to read (may be odd, but one extra byte will be written then) +; returns a1 end of buffer written +fw_LoadMFM: + PUTMSG 10,<"%d: LoadMFM of %ld bytes at offset %ld to %p">,fw_FrameCounterLong(a6),d1,d0,a0 + IF FW_MULTITASKING_SUPPORT +.retry + subq.w #1,fw_TrackloaderIdle(a6) + beq.s .notbusy + addq.w #1,fw_TrackloaderIdle(a6) + PUTMSG 10,<"Trackloader busy! %p">,sp +.wait + TRKLDRYIELD + tst.w fw_TrackloaderIdle(a6) + ble.s .wait + bra.s .retry +.notbusy + ENDC + + PUSHM d6-d7/a3 + divu #11*512,d0 + move.l d0,d6 ; starting track / offset + move.l d1,d7 ; length + move.l a0,a3 + + cmp.w fw_LastTrack(a6),d6 + beq .righttrack +.wrongtrack + cmp.w fw_LastMfmTrack(a6),d6 + beq.s .rightmfmtrackbutnotyetdecoded + tst.w fw_MfmReadingTriggered(a6) + beq.s .noreadinginprogress + PUTMSG 10,<"Wrong track reading in progress... please wait"> + bsr fw_WaitForTrackDmaDone + PUTMSG 10,<"DMA done"> +.noreadinginprogress + tst.w fw_DriveMotorOn(a6) + bne.s .noturnon + bsr fw_MotorOn +.noturnon + bsr fw_StepToRightCylinderAndSelectRightHead + bsr fw_TriggerReadTrack +.nexttrack + +.rightmfmtrackbutnotyetdecoded + bsr fw_WaitForTrackDmaDone + tst.w fw_DriveMotorOn(a6) + bne.s .noturnon2 + bsr fw_MotorOn +.noturnon2 + bsr fw_PreparePrefetchOfNextTrack + bsr fw_DecodeMfmTrack + + tst.w fw_MfmDoPrefetch(a6) + beq.s .noprefetch + PUTMSG 30,<"Prefetching next track"> + bsr fw_TriggerReadTrack +.noprefetch +.righttrack + move.l d6,d1 + swap d1 ; start offset inside track + move.l fw_TrackBuffer(a6),a1 ; start in track buffer + adda.w d1,a1 + move.w #11*512,d3 + sub.w d1,d3 + ext.l d3 + cmp.l d7,d3 + ble.s .notcompleteinbuffer + move.w d7,d3 +.notcompleteinbuffer + sub.l d3,d7 + + jsr (a2) + + tst.l d7 + beq.s .finished + + swap d6 + clr.w d6 ; next track always starts at offset 0 + swap d6 + bra .nexttrack +.finished + move.l a3,a1 + POPM + PUTMSG 10,<"%d: Data load finished">,fw_FrameCounterLong(a6) + IF FW_MULTITASKING_SUPPORT + addq.w #1,fw_TrackloaderIdle(a6) + ENDC + ;bsr.s MotorOff + rts + +; Prefetch the next track to be loaded (but not decoded) into MFM buffer +fw_PreparePrefetchOfNextTrack: + PUTMSG 20,<"%d: PreparePrefetchOfNextTrack %d+1 (%d:%d)">,fw_FrameCounterLong(a6),fw_LastMfmTrack-2(a6),fw_CurrentCylinder-2(a6),fw_CurrentHead-2(a6) + PUSHM d6 + clr.w fw_MfmDoPrefetch(a6) + tst.w fw_MfmReadingTriggered(a6) + bne.s .noprefetch + + move.w fw_CurrentCylinder(a6),d6 + add.w d6,d6 + add.w fw_CurrentHead(a6),d6 + cmp.w fw_LastMfmTrack(a6),d6 + bne.s .noprefetch + addq.w #1,d6 + cmp.w #80*2,d6 + bge.s .noprefetch + + lsr.w #1,d6 + bcs.s .head1pre + bsr fw_DriveStepHeadIn ; 1 cyl forward + bsr fw_SelectUpperHead + bra.s .prefetch +.head1pre + bsr fw_SelectLowerHead +.prefetch + st fw_MfmDoPrefetch(a6) + move.w #235,d0 ; 15 ms=235 scan lines! + bsr fw_SetDriveSettleTime +.noprefetch + POPM + rts + +; d6=track +fw_StepToRightCylinderAndSelectRightHead: + PUTMSG 50,<"Select track %d">,d6 + PUSHM a0/d0/d1/d6/d7 + move.w d6,d7 + lsr.w #1,d7 + + sub.w fw_CurrentCylinder(a6),d7 ;delta-step + beq.s .steppingdone + bmi.s .stepout + bsr.s fw_DriveStepHeadIn + subq.w #2,d7 + bmi.s .steppingdone +.stepinloop + bsr fw_DriveStepHeadInFast + dbra d7,.stepinloop + bra.s .steppingdone +.stepout + neg.w d7 ; = neg+sub#1 + bsr.s fw_DriveStepHeadOut + subq.w #2,d7 + bmi.b .steppingdone +.stepoutloop + bsr.s fw_DriveStepHeadOutFast + dbra d7,.stepoutloop +.steppingdone + lsr.w #1,d6 + bcs.s .head1 + bsr.s fw_SelectUpperHead + bra.s .done +.head1 + bsr fw_SelectLowerHead +.done + move.w #235,d0 ; 15 ms=235 scan lines! + bsr fw_SetDriveSettleTime + POPM + rts + +; step head 1 track in and wait for timeout +fw_DriveStepHeadIn: + bsr fw_LoaderCiaWait + bclr #CIAB_DSKDIREC,(a4) + addq.w #1,fw_CurrentCylinder(a6) + PUTMSG 30,<"Step in %d">,fw_CurrentCylinder-2(a6) +fw_DriveStepHead: + bclr #CIAB_DSKSTEP,(a4) + bset #CIAB_DSKSTEP,(a4) + move.w #282,d0 ;18 ms=282 scan lines! + bra.s fw_SetDriveSettleTime + +; step head 1 track in fast and wait for timeout (this can be used if the direction of the head didnt change) +fw_DriveStepHeadInFast: + addq.w #1,fw_CurrentCylinder(a6) + PUTMSG 30,<"Step in fast %d">,fw_CurrentCylinder-2(a6) +fw_DriveStepHeadFast: + bsr.s fw_LoaderCiaWait + bclr #CIAB_DSKSTEP,(a4) + bset #CIAB_DSKSTEP,(a4) + moveq.l #47,d0 ;3 ms=47 scan lines! + bra.s fw_SetDriveSettleTime + +; step head 1 track out and wait for timeout +fw_DriveStepHeadOut: + bsr.s fw_LoaderCiaWait + bset #CIAB_DSKDIREC,(a4) + subq.w #1,fw_CurrentCylinder(a6) + PUTMSG 30,<"Step out %d">,fw_CurrentCylinder-2(a6) + bra.s fw_DriveStepHead + +; step head 1 track out fast and wait for timeout (this can be used if the direction of the head didnt change) +fw_DriveStepHeadOutFast: + subq.w #1,fw_CurrentCylinder(a6) + PUTMSG 30,<"Step out fast %d">,fw_CurrentCylinder-2(a6) + bra.s fw_DriveStepHeadFast + +;switch to upper head and wait for timeout +fw_SelectUpperHead: + bsr.s fw_LoaderCiaWait + PUTMSG 30,<"Head0"> + bset #CIAB_DSKSIDE,(a4) ; Head 0 + clr.w fw_CurrentHead(a6) + moveq.l #2,d0 ;0,1 ms=2 scan lines! + bra.s fw_SetDriveSettleTime + +;switch to lower head and wait for timeout +fw_SelectLowerHead: + bsr.s fw_LoaderCiaWait + PUTMSG 30,<"Head1"> + bclr #CIAB_DSKSIDE,(a4) ; Head 1 + move.w #1,fw_CurrentHead(a6) + moveq.l #2,d0 ;0,1 ms=2 scan lines! + bra.s fw_SetDriveSettleTime + +; move the head to track 0 (step out until track 0 is reached) +fw_DriveStepToCylinder0: + bsr.s fw_LoaderCiaWait + btst #CIAB_DSKTRACK0,$bfe001-$bfd100(a4) ;Cyl 0 when low. + beq.s .zeroreached + bsr fw_DriveStepHeadOut +.stepto0loop + btst #CIAB_DSKTRACK0,$bfe001-$bfd100(a4) ;Cyl 0 when low. + beq.s .zeroreached + bsr fw_DriveStepHeadOutFast + bra.s .stepto0loop +.zeroreached + PUTMSG 30,<"Cylinder0"> + clr.w fw_CurrentCylinder(a6) + rts + +fw_SetDriveSettleTime: + moveq.l #0,d1 + move.b $bfda00-$bfd100(a4),d1 + swap d1 + move.b $bfd900-$bfd100(a4),-(sp) + move.w (sp)+,d1 + move.b $bfd800-$bfd100(a4),d1 + ext.l d0 + add.l d1,d0 + move.l d0,fw_DriveSettleTime(a6) + rts + +;wait the specified amount of rasterlines +;d0 - amount of scanlines +fw_LoaderCiaWait: + IF FW_MULTITASKING_SUPPORT + bra.s .skipyield +.yieldloop + cmp.w #-50,d1 + bgt.s .skipyield + TRKLDRYIELD +.skipyield + ELSE +.yieldloop + ENDC + moveq.l #0,d1 + move.b $bfda00-$bfd100(a4),d1 + swap d1 + move.b $bfd900-$bfd100(a4),-(sp) + move.w (sp)+,d1 + move.b $bfd800-$bfd100(a4),d1 + sub.l fw_DriveSettleTime(a6),d1 + blt.s .yieldloop + PUTMSG 40,<"%ld: YD">,d1 + rts + +fw_FindRightFloppyDriveUnit: + move.l 4.w,a0 + cmp.w #37,LIB_VERSION(a0) + bhs.s .checkdrives + PUTMSG 10,<"LameOS, no drives check"> + ; kick 1.3 can only boot from DF0 + bsr fw_MotorOn + bsr fw_DriveStepToCylinder0 + rts + +.checkdrives +.retry + move.w fw_CurrentDrive(a6),d0 + PUTMSG 30,<"Checking disk in drive %d">,d0 + addq.w #CIAB_DSKSEL0,d0 + or.b #CIAF_DSKSEL0|CIAF_DSKSEL1|CIAF_DSKSEL2|CIAF_DSKSEL3,(a4) + bclr d0,(a4) + bsr fw_DriveStepToCylinder0 + bsr fw_DriveStepHeadIn + bsr fw_DriveStepHeadOut + btst #CIAB_DSKCHANGE,$bfe001-$bfd100(a4) + bne.s .found + move.w fw_CurrentDrive(a6),d0 + addq.w #1,d0 + cmp.w #4,d0 + beq.s .error + move.w d0,fw_CurrentDrive(a6) + bra.s .retry +.found PUTMSG 10,<"Found valid floppy"> + bsr fw_MotorOn + rts +.error + PUTMSG 10,<"No valid floppy found"> + move.w #ERROR_DISK,d0 + bra fw_Error + +; turn the floppy motor on and wait until the motor is running +fw_MotorOn: + PUTMSG 10,<"%d: Motor on">,fw_FrameCounterLong(a6) + move.w fw_CurrentDrive(a6),d0 + addq.w #CIAB_DSKSEL0,d0 + or.b #CIAF_DSKSEL0|CIAF_DSKSEL1|CIAF_DSKSEL2|CIAF_DSKSEL3,(a4) + ;bset d0,(a4) + bclr #CIAB_DSKMOTOR,(a4) ; turns motor on + bclr d0,(a4) + move.w fw_FrameCounter(a6),d0 + add.w #25,d0 ; 500 ms delay max +.diskreadyloop + TRKLDRYIELD + cmp.w fw_FrameCounter(a6),d0 + beq.s .diskreadybroken + btst #CIAB_DSKRDY,$bfe001-$bfd100(a4) ; wait until motor running + bne.s .diskreadyloop +.diskreadybroken + st fw_DriveMotorOn(a6) + rts + +; turn the floppy motor off +fw_MotorOff: +.retry + tst.w fw_MfmReadingTriggered(a6) + beq.s .noreadinginprogress + PUTMSG 10,<"%d: Waiting for read to finish before turning off motor">,fw_FrameCounterLong(a6) + bsr fw_WaitForTrackDmaDone +.noreadinginprogress + IF FW_MULTITASKING_SUPPORT + tst.w fw_TrackloaderIdle(a6) + bgt.s .nowait + TRKLDRYIELD + bra.s .retry + ENDC +.nowait + PUTMSG 10,<"%d: Motor Off">,fw_FrameCounterLong(a6) + move.w fw_CurrentDrive(a6),d0 + addq.w #CIAB_DSKSEL0,d0 + bset d0,(a4) + bset #CIAB_DSKMOTOR,(a4) + bclr d0,(a4) + clr.w fw_DriveMotorOn(a6) + rts + +; trigger reading of one track +; trashes a1, d0 +fw_TriggerReadTrack: + tst.w fw_MfmReadingTriggered(a6) + bne fw_Error + move.w fw_CurrentCylinder(a6),d0 + add.w d0,d0 + add.w fw_CurrentHead(a6),d0 + cmp.w fw_LastMfmTrack(a6),d0 + bne.s .cont + PUTMSG 30,<"MfmTrack already read %d">,d0 + rts +.cont + PUTMSG 20,<"%d: Triggered reading of track %d">,fw_FrameCounterLong(a6),d0 + clr.w fw_MfmReadingDone(a6) + move.w d0,fw_LastMfmTrack(a6) + + bsr fw_LoaderCiaWait ; wait settle time + + move.l fw_MfmTrackBuffer(a6),a1 + + move.w #INTF_DSKBLK,intreq(a5) + move.w #MFMsync,MFMBUFSIZE-2(a1) ; make sure we get another sync match at the end of buffer + clr.w (a1)+ + move.l a1,dskpt(a5) + move.w #DMAF_SETCLR|DMAF_MASTER|DMAF_DISK,dmacon(a5) + move.w #MFMsync,dsksync(a5) + move.w #ADKF_SETCLR|ADKF_MFMPREC|ADKF_WORDSYNC|ADKF_FAST,adkcon(a5) + move.w #$4000,dsklen(a5) + move.w #$8000+(MFMBUFSIZE/2)-2,dsklen(a5) ; DskLen(12800)+DmaEn + move.w #$8000+(MFMBUFSIZE/2)-2,dsklen(a5) ; start reading MFMdata + st fw_MfmReadingTriggered(a6) + rts + +fw_WaitForTrackDmaDone: + tst.w fw_MfmReadingTriggered(a6) + bne.s .waitdma + rts +.waitdma +.rereadwaitdma + PUTMSG 40,<"%d: MFM Wait">,fw_FrameCounterLong(a6) + IF FW_MULTITASKING_SUPPORT + bra.s .firstskipyield + ENDC +.waitdmadone + TRKLDRYIELD +.firstskipyield + btst #INTB_DSKBLK,intreqr+1(a5) ; wait until data read + beq.s .waitdmadone + PUTMSG 20,<"%d: MFM Done">,fw_FrameCounterLong(a6) + st fw_MfmReadingDone(a6) + clr.w fw_MfmReadingTriggered(a6) + rts + +; Decode the loaded MFM track +fw_DecodeMfmTrack: + PUSHM a2-a3/d7 + +.rereadwaitdma + bsr fw_WaitForTrackDmaDone + PUTMSG 20,<"%d: Decoding Track %d">,fw_FrameCounterLong(a6),fw_LastMfmTrack-2(a6) + move.w #-1,fw_LastTrack(a6) ; mark last track buffer as invalid in case of error + move.l #$55555555,d3 ; and-const + + move.l fw_MfmTrackBuffer(a6),a1 + ; This routine is trickier than it appears. The trick is that we must NOT + ; assume a $4489 at the beginning of our buffer. This phenomenon occurs when + ; the DMA starts in the middle of the first sync word. The second sync word + ; is thrown away by the hardware. It sounds exotic, but it actually happens + ; quite often! + cmp.w #MFMsync,2(a1) + beq.s .nofixsyncbug + PUTMSG 10,<"Fixing missing sync"> + move.w #MFMsync,(a1) +.nofixsyncbug + + moveq.l #0,d7 + clr.l fw_TrackChecksum(a6) +.decode +.findsyncword + lea MFMBUFSIZE(a1),a2 +.syncloop + PUTMSG 70,<"LW %lx">,(a1) + cmp.w #MFMsync,(a1)+ ; search for a sync word + bne.s .syncloop + PUTMSG 60,<"Sync %lx at %p">,(a1),a1 + cmp.l a1,a2 ; check for end of buffer + beq .diskerror ; no more sync found + cmp.b (a1),d3 ; search for 0-nibble + bne.s .syncloop + + bsr .decodemfmword + + PUTMSG 60,<"SectorInfo %lx">,d0 + move.b d0,d1 + lsr.w #8,d0 ; sector number + cmp.w #11,d0 + bge .diskerror + btst d0,d7 + bne .diskerror + bset d0,d7 ; mark as decoded + add.w d0,d0 ; x512 + lsl.w #8,d0 + move.l fw_TrackBuffer(a6),a0 + adda.w d0,a0 + PUTMSG 60,<"Decoding %d to %p">,d0,a0 + + move.w d1,d4 + lea 40(a1),a1 ; found a sec, skip unnecessary data + bsr .decodemfmword + move.l d0,d2 ; checksum + + lea 512(a1),a2 ; first half of sector in a1 and second half in a2 + moveq.l #(512/4)-1,d5 +.decodeloop + move.l (a1)+,d0 ; decode fmtbyte/trk#,sec#,eow# + move.l (a2)+,d1 + and.l d3,d0 + and.l d3,d1 + eor.l d0,d2 ; EOR with checksum + eor.l d1,d2 ; EOR with checksum + add.l d0,d0 + or.l d1,d0 ; MFM decoded first longword + move.l d0,(a0)+ + dbra d5,.decodeloop ; chksum should now be 0 if correct + + or.l d2,fw_TrackChecksum(a6) ; or with track total chksum + cmp.b #1,d4 + bne.s .nogapskip + PUTMSG 60,<"Skipping much of gap after decoding"> + lea 300*2(a2),a2 ; gap of 300 words should be safe (340 is about normal) +.nogapskip + lea 6(a2),a1 + cmp.w #(1<<11)-1,d7 + bne .findsyncword ; decode until the bitmap is complete + PUTMSG 50,<"Track Checksum %lx">,fw_TrackChecksum(a6) + tst.l fw_TrackChecksum(a6) ; track total chksum OK? + bne .diskerror ; no, then retry + + move.w fw_LastMfmTrack(a6),fw_LastTrack(a6) + move.w fw_LastMfmTrack(a6),d0 + ext.l d0 + PUTMSG 10,<"%d: Decoded Track %d">,fw_FrameCounterLong(a6),d0 + POPM + rts + +.decodemfmword + move.l (a1)+,d0 ; decode fmtbyte/trk#,sec#,eow# + move.l (a1)+,d1 + and.l d3,d0 + and.l d3,d1 + add.l d0,d0 + or.l d1,d0 ; MFM decoded first longword + rts + +.diskerror + PUTMSG 10,<"Disk Error!"> + move.w #$800,color(a5) + move.w #-1,fw_LastMfmTrack(a6) + bsr fw_TriggerReadTrack + bra .rereadwaitdma \ No newline at end of file diff --git a/source/framework/musicplayers/lightspeedplayer.asm b/source/framework/musicplayers/lightspeedplayer.asm new file mode 100644 index 0000000..7258958 --- /dev/null +++ b/source/framework/musicplayers/lightspeedplayer.asm @@ -0,0 +1,256 @@ +;***************************************************************** +; +; Light Speed Player v1.11 +; Fastest Amiga MOD player ever :) +; Written By Arnaud Carré (aka Leonard / OXYGENE) +; Adapted to demo framework (and optimized) by platon42. +; +; https://github.com/arnaud-carre/LSPlayer +; twitter: @leonard_coder +; +; "small & fast" player version ( average time: 1 scanline ) +; Less than 512 bytes of code! +; You can also use generated "insane" player code for even more half scanline replayer (-insane option) +; +; LSP_MusicInit Initialize a LSP driver + relocate score&bank music data +; LSP_MusicPlayTick Play a LSP music (call it per frame) +; LSP_MusicGetPos Get mod seq pos (see -setpos option in LSPConvert) +; LSP_MusicSetPos Set mod seq pos (see -getpos option in LSPConvert) +; +;***************************************************************** + +;------------------------------------------------------------------ +; +; LSP_MusicPlayTick +; +; In: a5: should be $dff000 +; Scratched regs: d0-d2/a0-a4 +; Out:None +; +;------------------------------------------------------------------ +LSP_MusicPlayTick: + addq.w #1,fw_MusicFrameCount(a6) + lea fw_LspByteStream(a6),a3 + move.l (a3),a0 ; fw_LspByteStream, byte stream + move.l fw_LspCodeTableAddr(a6),a2 ; code table + +.process + moveq.l #0,d0 + move.b (a0)+,d0 + beq.s .cextended + add.w d0,d0 + move.w (a2,d0.w),d0 ; code + bne.s .cmdExec +.noInstBS + move.l a0,(a3) ; fw_LspByteStream, store byte stream if coming from early out + rts + +.cextended + add.w #$0100,d0 + move.b (a0)+,d0 + beq.s .cextended + add.w d0,d0 + move.w (a2,d0.w),d0 ; code + lea fw_LspEscCodeRewind(a6),a1 + cmp.w (a1)+,d0 ; fw_LspEscCodeRewind + beq.s .r_rewind + cmp.w (a1)+,d0 ; fw_LspEscCodeSetBpm + beq.s .r_chgBpm + cmp.w (a1)+,d0 ; fw_LspEscCodeGetPos + bne.s .cmdExec + +.r_setPos + move.b (a0)+,fw_LspCurrentSeq+1(a6) + bra.s .process + +.r_rewind + move.l fw_LspByteStreamLoop(a6),a0 + move.l fw_LspWordStreamLoop(a6),fw_LspWordStream(a6) + bra.s .process + +.r_chgBpm + move.b (a0)+,fw_LspCurrentBpm+1(a6) ; BPM + bra.s .process + +.cmdExec + add.b d0,d0 + bcc.s .noVd + move.b (a0)+,aud3+ac_vol+1(a5) +.noVd add.b d0,d0 + bcc.s .noVc + move.b (a0)+,aud2+ac_vol+1(a5) +.noVc add.b d0,d0 + bcc.s .noVb + move.b (a0)+,aud1+ac_vol+1(a5) +.noVb add.b d0,d0 + bcc.s .noVa + move.b (a0)+,aud0+ac_vol+1(a5) +.noVa + move.l a0,(a3)+ ; fw_LspByteStream, store byte stream ptr + move.l (a3),a0 ; fw_LspWordStream, word stream + + tst.b d0 + beq.s .noPa + + add.b d0,d0 + bcc.s .noPd + move.w (a0)+,aud3+ac_per(a5) +.noPd add.b d0,d0 + bcc.s .noPc + move.w (a0)+,aud2+ac_per(a5) +.noPc add.b d0,d0 + bcc.s .noPb + move.w (a0)+,aud1+ac_per(a5) +.noPb add.b d0,d0 + bcc.s .noPa + move.w (a0)+,aud0+ac_per(a5) +.noPa + tst.w d0 + beq.s .noInstWS + + moveq.l #0,d1 + move.l fw_LspInstruments(a6),a2 ; instrument table + lea fw_LspResetv+4*4(a6),a4 + + lea aud+3*ac_SIZEOF(a5),a1 + moveq.l #4-1,d2 +.vloop add.w d0,d0 + bcs.s .setIns + add.w d0,d0 + ; suppress M68kUnexpectedConditionalInstruction + move.l -(a4),a3 ; take loop data + bcc.s .skip + move.l (a3)+,ac_ptr(a1) ; and update pointer/len with it + move.w (a3)+,ac_len(a1) ; (usually triggered from previous frame) + bra.s .skip +.setIns + add.w (a0)+,a2 + add.w d0,d0 + bcc.s .noReset + bset d2,d1 + move.w d1,dmacon(a5) +.noReset + move.l (a2)+,ac_ptr(a1) + move.w (a2)+,ac_len(a1) + move.l a2,-(a4) ; set reset values for next iteration to contain loop data +.skip lea -ac_SIZEOF(a1),a1 + dbra d2,.vloop + + move.l fw_LspDmaConPatch(a6),a1 ; dmacon patch + move.b d1,(a1) ; dmacon + +.noInstWS + move.l a0,fw_LspWordStream(a6) ; store word stream + rts + +;------------------------------------------------------------------ +; +; LSP_MusicInit +; +; In: a0: LSP music data (any memory) +; a1: LSP sound bank (chip memory) +; +;------------------------------------------------------------------ +LSP_DataError: + illegal +LSP_MusicInit: + cmp.l #'LSP1',(a0)+ + bne.s LSP_DataError + move.l (a0)+,d0 ; unique id + cmp.l (a1),d0 ; check that sample bank is this one + bne.s LSP_DataError + + cmp.w #$010b,(a0)+ ; v1.11 minimal major & minor version of latest compatible + blt.s LSP_DataError + moveq.l #0,d1 + bset d1,(a0) ; test and mark this music score as "relocated" + bne.s .noRelocate + move.l a1,d1 +.noRelocate + addq.w #2,a0 ; skip relocation flag + lea fw_LspCurrentBpm(a6),a3 + move.w (a0)+,(a3)+ ; fw_LspCurrentBpm + move.l a0,(a3)+ ; fw_LspInstruments, LSP data has -12 offset on instrument tab (to win 2 cycles in fast player :)) + move.w (a0)+,(a3)+ ; fw_LspEscCodeRewind + move.l (a0)+,(a3)+ ; fw_LspEscCodeSetBpm/fw_LspEscCodeGetPos + move.l (a0)+,(a3)+ ; fw_LspMusicLength + + move.w (a0)+,d0 ; instrument count + add.w d0,d0 + subq.w #1,d0 +.relocLoop + add.l d1,(a0)+ + addq.l #2,a0 + dbra d0,.relocLoop + + move.w (a0)+,d0 ; codes table size + move.l a0,fw_LspCodeTableAddr(a6) ; code table + add.w d0,d0 + add.w d0,a0 + + ; read sequence timing infos (if any) + move.w (a0)+,d0 + move.w d0,(a3)+ ; fw_LspSeqCount + move.l a0,(a3)+ ; fw_LspSeqTable + clr.w (a3)+ ; fw_LspCurrentSeq + move.w d0,d1 + lsl.w #3,d1 ; 8 bytes per entry + adda.w d1,a0 + + movem.l (a0)+,d0/d1/d2 ; word stream size/byte stream loop point/word stream loop point + move.l a0,(a3)+ ; fw_LspStreamBase + lea (a0,d0.l),a1 ; byte stream + move.l a1,(a3)+ ; fw_LspByteStream + move.l a0,(a3)+ ; fw_LspWordStream + add.l d1,a1 + add.l d2,a0 + move.l a1,(a3)+ ; fw_LspByteStreamLoop + move.l a0,(a3)+ ; fw_LspWordStreamLoop + bset #1,$bfe001 ; disabling this fucking Low pass filter!! + rts + +;------------------------------------------------------------------ +; +; LSP_MusicSetPos +; +; In: d0: seq position (from 0 to last seq of the song) +; Out:None +; +; Force the replay pointer to a seq position. If music wasn't converted +; using -setpos option, this func does nothing +; +;------------------------------------------------------------------ +LSP_MusicSetPos: + lea fw_LspSeqCount(a6),a1 + cmp.w (a1)+,d0 ; fw_LspSeqCount + bge.s .noTimingInfo + move.l (a1)+,a0 ; fw_LspSeqTable + move.w d0,(a1)+ ; fw_LspCurrentSeq + lsl.w #3,d0 + lea 8(a0,d0.w),a0 + move.l (a1)+,d0 ; fw_LspStreamBase + move.l -(a0),d1 + add.l d0,d1 + move.l d1,(a1)+ ; fw_LspByteStream + move.l -(a0),d1 + add.l d0,d1 + move.l d1,(a1)+ ; fw_LspWordStream +.noTimingInfo + rts + + IF 0 +;------------------------------------------------------------------ +; +; LSP_MusicGetPos +; +; In: None +; Out: d0: seq position (from 0 to last seq of the song) +; +; Get the current seq position. If music wasn't converted with +; -getpos option, this func just returns 0 +; +;------------------------------------------------------------------ +LSP_MusicGetPos: + move.w fw_LspCurrentSeq(a6),d0 + rts + ENDC diff --git a/source/framework/musicplayers/lightspeedplayer_cia.asm b/source/framework/musicplayers/lightspeedplayer_cia.asm new file mode 100644 index 0000000..e0f66e0 --- /dev/null +++ b/source/framework/musicplayers/lightspeedplayer_cia.asm @@ -0,0 +1,135 @@ +;***************************************************************** +; +; Light Speed Player v1.11 +; Fastest Amiga MOD player ever :) +; Written By Arnaud Carré (aka Leonard / OXYGENE) +; Slightly modified by platon42 for demo framework. +; +; https://github.com/arnaud-carre/LSPlayer +; twitter: @leonard_coder +; +; "cia" player version ( or "less effort" ) +; +; Warnings: +; a) this file is provided for "easy of use". But if you're working +; on a cycle-optimizated demo effect, please call LightSpeedPlayer from your +; own existing interrupt and use copper to set DMACON 11 raster lines later +; +; b) this code doesn't restore any amiga OS stuff. +; ( are you a cycle-optimizer or what? :) ) +; +; --------How to use--------- +; +; bsr LSP_MusicDriver_CIA_Start : Init LSP player code and install CIA interrupt +; a0: LSP music data(any memory) +; a1: LSP sound bank(chip memory) +; a2: VBR (CPU Vector Base Register) ( use 0 if 68000 ) +; d0: 0=PAL, 1=NTSC +; +; bsr LSP_MusicDriver_CIA_Stop : Stop LSP music replay +; +;***************************************************************** + +LSP_MusicDriver_CIA_Stop: + move.b #$7f,$bfd000+ciaicr + move.w #INTF_EXTER,intena(a5) + move.w #INTF_EXTER,intreq(a5) + move.w #DMAF_AUDIO,dmacon(a5) + rts + +LSP_MusicDriver_CIA_Start: + move.w d0,-(sp) + lea .dmaCon+1(pc),a2 ; DMACON byte patch address + clr.b (a2) + move.l a2,fw_LspDmaConPatch(a6) + bsr LSP_MusicInit ; init the LSP player ( whatever fast or insane version ) + + move.w fw_LspCurrentBpm(a6),d0 + move.w d0,fw_LspLastCiaBpm(a6) + moveq #1,d1 + and.w (sp)+,d1 + +; d0: music BPM +; d1: PAL(0) or NTSC(1) +.LSP_IrqInstall + move.w #INTF_EXTER,intena(a5) ; disable CIA interrupt + lea .LSP_MainIrq(pc),a0 + move.l fw_VBR(a6),a2 + move.l a0,$78(a2) + + lea $bfd000,a0 + move.b #$7f,ciaicr(a0) + move.b #CIACRAF_LOAD,ciacra(a0) + move.b #CIACRBF_LOAD,ciacrb(a0) + lsl.w #2,d1 + move.l .palClocks(pc,d1.w),d1 ; PAL or NTSC clock + move.l d1,fw_LspCiaClock(a6) + divu.w d0,d1 + move.b d1,ciatalo(a0) + lsr.w #8,d1 + move.b d1,ciatahi(a0) + move.b #CIAICRF_SETCLR|CIAICRF_TA|CIAICRF_TB,ciaicr(a0) + move.b #CIACRAF_START|CIACRAF_LOAD,ciacra(a0) + + move.b #496&$ff,ciatblo(a0) ; set timer b to 496 ( to set DMACON ) + move.b #496>>8,ciatbhi(a0) + + move.w #INTF_EXTER,intreq(a5) ; clear any req CIA + move.w #INTF_SETCLR|INTF_EXTER,intena(a5) ; CIA interrupt enabled + rts + +.palClocks + dc.l 1773447,1789773 +.dmaCon + dc.w $8000 ; we won't put this into the framework variables to the avoid need for relocation + +.LSP_MainIrq + btst.b #CIAICRB_TA,$bfd000+ciaicr + beq.s .skipa + + PUSHM d0-d2/a0-a6 + + ; call player tick + lea $dff000,a5 + move.l fw_BasePtr(pc),a6 + bsr LSP_MusicPlayTick ; LSP main music driver tick + + ; check if BMP changed in the middle of the music + lea $bfd000,a4 + move.w fw_LspCurrentBpm(a6),d0 ; current music BPM + cmp.w fw_LspLastCiaBpm(a6),d0 + beq.s .noChg + move.w d0,fw_LspLastCiaBpm(a6) ; current BPM + move.l fw_LspCiaClock(a6),d1 + divu.w d0,d1 + move.b d1,ciatalo(a4) + lsr.w #8,d1 + move.b d1,ciatahi(a4) + +.noChg lea .LSP_DmaconIrq(pc),a0 + move.l fw_VBR(a6),a1 + move.l a0,$78(a1) + move.b #CIACRBF_START|CIACRBF_RUNMODE|CIACRBF_LOAD,ciacrb(a4) ; start timerB, one shot + + POPM +.skipa + move.w #INTF_EXTER,$dff000+intreq + move.w #INTF_EXTER,$dff000+intreq + nop + rte + +.LSP_DmaconIrq + btst.b #CIAICRB_TB,$bfd000+ciaicr + beq.s .skipb + PUSHM a0/a1 + move.w .dmaCon(pc),$dff000+dmacon + move.l fw_BasePtr(pc),a1 + lea .LSP_MainIrq(pc),a0 + move.l fw_VBR(a1),a1 + move.l a0,$78(a1) + POPM +.skipb + move.w #INTF_EXTER,$dff000+intreq + move.w #INTF_EXTER,$dff000+intreq + nop + rte \ No newline at end of file diff --git a/source/framework/musicplayers/player_lsp_cia.asm b/source/framework/musicplayers/player_lsp_cia.asm new file mode 100644 index 0000000..29a8b6f --- /dev/null +++ b/source/framework/musicplayers/player_lsp_cia.asm @@ -0,0 +1,36 @@ + IF FW_VBL_MUSIC_IRQ + fail "FW_VBL_MUSIC_IRQ must be disabled" + ENDC + +fw_MusicInit: + PUTMSG 10,<"Music-Init %p %p">,a0,a1 + PUSHM d4-d7/a3-a4 + move.l fw_VBR(a6),a2 + IF FW_STANDALONE_FILE_MODE + move.l $78(a2),fw_OldCiaIRQ(a6) + ENDC + moveq.l #0,d0 + bsr.s LSP_MusicDriver_CIA_Start + moveq.l #-1,d0 + move.w d0,fw_MusicFrameCount(a6) + POPM + PUTMSG 10,<"Music-Init done"> + rts + +fw_MusicStop: + bsr.s LSP_MusicDriver_CIA_Stop + IF FW_STANDALONE_FILE_MODE + move.l fw_VBR(a6),a2 + move.l fw_OldCiaIRQ(a6),$78(a2) + ENDC + rts + +;-------------------------------------------------------------------- +; sets the position if supported +; d0.w = new position +fw_MusicSetPosition: + bra LSP_MusicSetPos + + + include "../framework/musicplayers/lightspeedplayer_cia.asm" + include "../framework/musicplayers/lightspeedplayer.asm" \ No newline at end of file diff --git a/source/framework/musicplayers/player_lsp_vbl.asm b/source/framework/musicplayers/player_lsp_vbl.asm new file mode 100644 index 0000000..bd43cca --- /dev/null +++ b/source/framework/musicplayers/player_lsp_vbl.asm @@ -0,0 +1,30 @@ + IFEQ FW_VBL_MUSIC_IRQ + fail "FW_VBL_MUSIC_IRQ must be enabled" + ENDC + +fw_MusicInit: + PUTMSG 10,<"Music-Init %p %p">,a0,a1 + bsr.s LSP_MusicInit + moveq.l #-1,d0 + move.w d0,fw_MusicFrameCount(a6) + PUTMSG 10,<"Music-Init done"> + rts + +fw_MusicPlay: + PUSHM a4 + bsr.s LSP_MusicPlayTick + POPM + rts + +fw_MusicStop: + move.w #DMAF_AUDIO,dmacon(a5) + ; unsupported right now + rts + +;-------------------------------------------------------------------- +; sets the position if supported +; d0.w = new position +fw_MusicSetPosition: + bra LSP_MusicSetPos + + include "../framework/musicplayers/lightspeedplayer.asm" diff --git a/source/framework/musicplayers/player_none.asm b/source/framework/musicplayers/player_none.asm new file mode 100644 index 0000000..ba69bae --- /dev/null +++ b/source/framework/musicplayers/player_none.asm @@ -0,0 +1,5 @@ +fw_MusicInit: +fw_MusicStop: +fw_MusicPlay: +fw_MusicSetPosition: + rts diff --git a/source/framework/musicplayers/player_pretracker_std.asm b/source/framework/musicplayers/player_pretracker_std.asm new file mode 100644 index 0000000..c32d2ec --- /dev/null +++ b/source/framework/musicplayers/player_pretracker_std.asm @@ -0,0 +1,64 @@ + IFEQ FW_VBL_MUSIC_IRQ + fail "FW_VBL_MUSIC_IRQ must be enabled" + ENDC + IFEQ FW_DYNAMIC_MEMORY_SUPPORT + fail "FW_DYNAMIC_MEMORY_SUPPORT must be enabled" + ENDC + +fw_MusicAlloc: + ; actually $1C6E for player (V1.0), $984 for song + move.l #$1C6E+$984,d0 + bsr fw_AllocFast + move.l a0,fw_PretrackerMyPlayer(a6) + lea $1C6E(a0),a0 + move.l a0,fw_PretrackerMySong(a6) + rts + +fw_MusicInit: + PUTMSG 10,<"%d: Pretracker song init %p %p">,fw_FrameCounterLong(a6),a0,a1 + move.l a0,a2 + PUSHM d7/a1 + move.l fw_PretrackerMyPlayer(a6),a0 + move.l fw_PretrackerMySong(a6),a1 + PUTMSG 10,<"MyPlayer=%p MySong=%p Data=%p">,a0,a1,a2 + lea fw_PretrackerReplayer(pc),a3 + adda.w 2(a3),a3 + jsr (a3) ; songInit + POPM + + move.l a1,d1 + bne.s .noalloc + PUTMSG 10,<"Allocating %ld bytes samples memory for Pretracker">,d0 + bsr fw_AllocChip + move.l a0,fw_MusicSamples(a6) + move.l a0,a1 +.noalloc + + PUTMSG 10,<"%d: Pretracker player init">,fw_FrameCounterLong(a6) + move.l fw_PretrackerMyPlayer(a6),a0 + move.l fw_PretrackerMySong(a6),a2 + + lea fw_PretrackerReplayer(pc),a3 + adda.w 6(a3),a3 + jsr (a3) ; playerInit + + PUTMSG 10,<"%d: Pretracker init done">,fw_FrameCounterLong(a6) + rts + +fw_MusicPlay: + move.l fw_PretrackerMyPlayer(a6),a0 + lea fw_PretrackerReplayer(pc),a3 + adda.w 10(a3),a3 + jsr (a3) ; playerTick + rts + +fw_MusicStop: + move.w #DMAF_AUDIO,dmacon(a5) + ; unsupported right now + rts + +;-------------------------------------------------------------------- + +fw_PretrackerReplayer: + ;include "../framework/musicplayers/pretracker_replayer_resourced.asm" + incbin "../framework/musicplayers/pretracker_replayer_binary_blob.bin" diff --git a/source/framework/musicplayers/player_raspberry_casket.asm b/source/framework/musicplayers/player_raspberry_casket.asm new file mode 100644 index 0000000..7acf314 --- /dev/null +++ b/source/framework/musicplayers/player_raspberry_casket.asm @@ -0,0 +1,71 @@ + IFEQ FW_VBL_MUSIC_IRQ + fail "FW_VBL_MUSIC_IRQ must be enabled" + ENDC + IFEQ FW_DYNAMIC_MEMORY_SUPPORT + fail "FW_DYNAMIC_MEMORY_SUPPORT must be enabled" + ENDC + +fw_MusicAlloc: + move.l #pv_SIZEOF+sv_SIZEOF,d0 + bsr fw_AllocFast + move.l a0,fw_PretrackerMyPlayer(a6) + lea pv_SIZEOF(a0),a0 + move.l a0,fw_PretrackerMySong(a6) + rts + +fw_MusicInit: + PUTMSG 10,<"%d: Pretracker song init %p %p">,fw_FrameCounterLong(a6),a0,a1 + move.l a0,a2 + PUSHM d4-d7/a1/a4-a6 + ;move.l fw_PretrackerMyPlayer(a6),a0 ; unused + move.l fw_PretrackerMySong(a6),a1 + PUTMSG 10,<"MyPlayer=%p MySong=%p Data=%p">,a0,a1,a2 + bsr pre_SongInit + POPM + + move.l a1,d1 + bne.s .noalloc + PUTMSG 10,<"Allocating %ld bytes samples memory for Pretracker">,d0 + bsr fw_AllocChip + move.l a0,fw_MusicSamples(a6) + move.l a0,a1 +.noalloc + + PUTMSG 10,<"%d: Pretracker player init">,fw_FrameCounterLong(a6) + move.l fw_PretrackerMyPlayer(a6),a0 + move.l fw_PretrackerMySong(a6),a2 + lea fw_PretrackerProgress(a6),a3 + PUTMSG 10,<"Progress at %p">,a3 + clr.l (a3) + PUSHM d4-d7/a4-a6 + bsr pre_PlayerInit + POPM + + PUTMSG 10,<"%d: Pretracker init done">,fw_FrameCounterLong(a6) + rts + +fw_MusicPlay: + PUSHM d4-d7/a4-a6 + move.l fw_PretrackerMyPlayer(a6),a0 + move.l fw_PretrackerCopperlist(a6),a1 + bsr.s pre_PlayerTick + POPM + rts + +fw_MusicStop: + move.w #DMAF_AUDIO,dmacon(a5) + ; unsupported right now + rts + +;-------------------------------------------------------------------- +; sets the position if supported +; d0.w = new position +fw_MusicSetPosition: + move.w d0,fw_PretrackerMySong+sv_curr_pat_pos_w(a6) + rts + +;-------------------------------------------------------------------- +PRETRACKER_COPPER_OUTPUT = FW_MUSIC_PLAYER_CHOICE-4 +PRETRACKER_DONT_TRASH_REGS = 0 + + include "../framework/musicplayers/raspberry_casket.asm" diff --git a/source/framework/musicplayers/pretracker_replayer_binary_blob.bin b/source/framework/musicplayers/pretracker_replayer_binary_blob.bin new file mode 100644 index 0000000..0205580 Binary files /dev/null and b/source/framework/musicplayers/pretracker_replayer_binary_blob.bin differ diff --git a/source/framework/musicplayers/raspberry_casket.asm b/source/framework/musicplayers/raspberry_casket.asm new file mode 100755 index 0000000..2af2525 --- /dev/null +++ b/source/framework/musicplayers/raspberry_casket.asm @@ -0,0 +1,4195 @@ +;-------------------------------------------------------------------- +; Raspberry Casket Player V1.1 (28-Dec-2022) +; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +; Provided by Chris 'platon42' Hodges +; +; Latest: https://github.com/chrisly42/PretrackerRaspberryCasket +; +; Rewritten by platon42/Desire based on a resourced, binary identical +; version of the original Pretracker V1.0 replayer binary provided +; by hitchhikr (thanks!), originally written in C by Pink/Abyss. +; +; This version is the hard work of reverse engineering all the +; offsets, removing all the C compiler crud, removing dead and +; surplus code (maybe artefacts from earlier ideas that did nothing), +; optimizing the code where possible. This resulted in both reduced +; size of the replayer, faster sample calculation and speeding the +; tick routine up significantly. +; +; I also added a few optional features that come in handy, such as +; song-end detection and precalc progress support. +; +; It took me more than a month and it was not fun. +; +; Also: Open source. It's 2022, keeping the code closed is just not +; part of the demoscene spirit (anymore?), at least for a replayer. +; +; Also note that this is not the final state of the source code. +; I could go over many places still and try to rework them. +; But I wanted the code to be out in public. +; +; Verification +; ~~~~~~~~~~~~ +; The replayer has been verified on about 60 Pretracker tunes to +; create an identical internal state for each tick and identical +; samples (if certain optimizations switches are disabled). +; +; I might have introduced bugs though. If you find some problems, +; please let me know under chrisly@platon42.de. Thank you. +; +; Usage +; ~~~~~ +; The new replayer comes as a drop-in binary replacement if you wish. +; In this case you will get faster sample generation (about 12% +; faster on 68000) and about 45% less CPU time spent. However, you +; won't get stuff as song-end detection and precalc progress this way. +; This mode uses the old CPU DMA wait that takes away 8 raster lines. +; +; If you want to get rid of the unnecessary waiting, you can switch +; to a copper driven audio control. If you want to use the top portion +; of the copperlist for this, you probably need to double buffer it. +; Otherwise, you could also position the copperlist at the end of +; the display and use single buffering if you call the tick routine +; during the vertical blank. +; +; Please use the documented sizes for the MySong and MyPlayer data +; structures, which are the symbols sv_SIZEOF and pv_SIZEOF +; respectively (about 2K and 12K with volume table). +; +; The source needs two common include files to compile (custom.i and +; dmabits.i). You should leave assembler optimizations enabled. +; +; (0. If you're using copper list mode, call pre_PrepareCopperlist.) +; +; 1. Call pre_SongInit with +; - a pointer to MySong (mv_SIZEOF) in a1 and +; - the music data in a2. +; It will return the amount of sample memory needed in d0. +; +; 2. Then call pre_PlayerInit with +; - a pointer to MyPlayer (pv_SIZEOF) in a0 +; - a pointer to chip memory sample buffer in a1 +; - the pointer to MySong in a2 +; - a pointer to a longword for progress information or null in a3 +; This will create the samples, too. +; +; 3. After that, regularly call pre_PlayerTick with MyPlayer in a0 +; and optionally the copperlist in a1 if you're using that mode). +; +; Size +; ~~~~ +; The original C compiled code was... just bad. The new binary is +; about 1/3 of the original one. +; +; The code has been also optimized in a way that it compresses better. +; The original code compressed with Blueberry's Shrinkler goes from +; 18052 bytes down to 9023 bytes. +; +; Raspberry Casket, depending on the features compiled in, is about +; 6216 bytes and goes down to ~4348 bytes (in isolation). +; +; So this means that the optimization is not just "on the outside". +; +; Timing +; ~~~~~~ +; Sample generation is a bit faster (I guess around 10-15%), but most +; of the time is spent on muls operations, so this is the limiting +; factor. +; +; Raspberry Casket is about twice as fast as the old replayer for playback. +; +; Unfortunately, the replayer is still pretty slow and has high +; jitter compared to other standard music replayers. +; This means it may take up to 32 raster lines (13-18 on average) +; which is significant more than a standard Protracker replayer +; (the original one could take about 60 raster lines worst case and +; about 34 on average!). +; +; Watch out for Presto, the LightSpeedPlayer variant that should +; solve this problem. +; +; Changelog see https://github.com/chrisly42/PretrackerRaspberryCasket#Changelog +;-------------------------------------------------------------------- + +; Here come the various options for you to configure. +; +; To create an optimized drop-in replacement for the old V1.0 binary: +; PRETRACKER_SUPPORT_V1_5 = 0 +; PRETRACKER_PARANOIA_MODE = 0 +; PRETRACKER_DUBIOUS_PITCH_SHIFT_FOR_DELAYED_TRACK = 0 +; PRETRACKER_KEEP_JUMP_TABLE = 1 +; PRETRACKER_SONG_END_DETECTION = 0 +; PRETRACKER_PROGRESS_SUPPORT = 0 +; PRETRACKER_FASTER_CODE = 1 +; PRETRACKER_VOLUME_TABLE = 1 +; PRETRACKER_BUGFIX_CODE = 1 +; PRETRACKER_DONT_TRASH_REGS = 1 +; PRETRACKER_COPPER_OUTPUT = 0 + + +; This player was based on the V1.0 binary of the pretracker replayer +; and thus can only play files created with versions up to V1.0. +; Subsongs and sound effects are not supported. There is usually no +; use for this in an intro anyway. +; +; Enabling this switch will patch the song runtime to make it backward +; compatible with this replayer. Song data will be modified in memory. +; I would encourage you to still use V1.0 as the files saved with +; Pretracker V1.5 are unnecessarily bigger (about 458 bytes) and might +; lose some instrument names it seems. + IFND PRETRACKER_SUPPORT_V1_5 +PRETRACKER_SUPPORT_V1_5 = 0 + ENDC + +; The original binary had a lot of extra checks that I would consider +; paranoia. For example it handled songs without instruments, waves +; or patterns. +; It contains code that I think is unreachable and a relic of +; being used for the actual tracker itself (releasing notes after +; a delay, looping patterns instead of advancing song). +; Or for combinations of song stopping (F00) and note delay in the +; same step, which no sane musician would use. +; +; This switch gets rid of the code. If you find a song that doesn't +; work with this disabled, please let me know. + IFND PRETRACKER_PARANOIA_MODE +PRETRACKER_PARANOIA_MODE = 0 + ENDC + +; There is some pitch shifting applied during track delay by +; a maximum of one period -- depending on the delay value. +; I guess this might add some phasing to the sound (which would be +; only audible in a mono mix, I would think), but it comes with an +; extra multiplication per channel. +; If you really want that, enable this switch. + IFND PRETRACKER_DUBIOUS_PITCH_SHIFT_FOR_DELAYED_TRACK +PRETRACKER_DUBIOUS_PITCH_SHIFT_FOR_DELAYED_TRACK = 0 + ENDC + +; The binary comes with a jump table that has three official entry +; points. As you have the source, you could just bsr to the three +; functions (pre_SongInit, pre_PlayerInit, pre_PlayerTick) directly. +; If you want a drop-in (binary) replacement instead, enable this +; switch to get the jump table back. + IFND PRETRACKER_KEEP_JUMP_TABLE +PRETRACKER_KEEP_JUMP_TABLE = 0 + ENDC + +; The original Pretracker replayer does not come with a song-end +; detection. If you want to have that (e.g. for a music disk), enable +; this switch and check for pv_songend_detected_b (relative to the +; MyPlayer structure) which goes to true when song-end is reached. + IFND PRETRACKER_SONG_END_DETECTION +PRETRACKER_SONG_END_DETECTION = 0 + ENDC + +; Do you want to have information on the sample generation progress +; during the call to pre_PlayerInit? Then enable this and call w +; pre_PlayerInit with a pointer to a longword in a3. +; Please make sure yourself that the initial value is zero. +; It will be incremented by the number of samples (in bytes) +; for each waveform done. You can get the total number of samples +; from the (previously undocumented) return value of pre_SongInit. + IFND PRETRACKER_PROGRESS_SUPPORT +PRETRACKER_PROGRESS_SUPPORT = 0 + ENDC + +; Use slightly faster code and smaller for sample generation that +; might be off by 1 (rounding error) compared to the original code. + IFND PRETRACKER_FASTER_CODE +PRETRACKER_FASTER_CODE = 1 + ENDC + +; Use tables for volume calculation instead of multiplication. +; Is slightly faster on 68000 (about 11%), but probably has no +; benefit for 68020+ and needs about 3.5 KB more RAM (MyPlayer) +; and 40 bytes of code. + IFND PRETRACKER_VOLUME_TABLE +PRETRACKER_VOLUME_TABLE = 1 + ENDC + +; I found some obvious bugs in the code. This switch enables bugfixes, +; but the sound might not be exactly the same as in the tracker / +; original player (e.g. there is a bug in the volume envelope that +; will cause a pause in the decay curve that is not supposed to +; happen). + IFND PRETRACKER_BUGFIX_CODE +PRETRACKER_BUGFIX_CODE = 1 + ENDC + +; You want to take care of what registers may be trashed by these +; routines because you have your own ABI? Good! +; Setting this to 0 will remove the register saving/restoring on +; the stack. All registers then may be trashed. +; Otherwise, d2-d7/a2-a6 are preserved as with the AmigaOS standard. + IFND PRETRACKER_DONT_TRASH_REGS +PRETRACKER_DONT_TRASH_REGS = 1 + ENDC + +; Enable output to copperlist instead of audio registers and DMA wait. +; This gives your slightly more CPU time and less jitter (maybe 7 +; rasterlines). +; +; When enabled, provide a pointer to a copperlist in a1 on calling +; pre_PlayerTick. It will update the necessary fields in the +; copperlist. To initially generate a copperlist (or two), use the +; pre_PrepareCopperlist subroutine. It will write out 37 copper +; commands (WAITs and MOVEs) starting for a given rasterline (if +; you're below rasterline 255, make sure you have the necessary +; wait for this case yourself!). +; +; There are two major reasonable ways to use this: +; - Your intro does no fancy copper shenanigans: +; You can reserve the space of 37 longwords inside your normal +; copperlist. The position should be after rasterline ~35. +; - You do a lot of copper stuff during the frame: +; Create the pretracker copperlist to be at the very end of the +; frame (rasterline 300 is a good spot). Make sure your custom +; copper code has a static jump to the 37 copper instructions +; at its end and terminate the copperlist correctly (hint: +; move.l d1,(a0) after bsr pre_PrepareCopperlist will terminate +; the copperlist ($fffffffe). + IFND PRETRACKER_COPPER_OUTPUT +PRETRACKER_COPPER_OUTPUT = 0 ; 0 = standard CPU wait, 1 = Copperlist + ENDC + +; Pretracker song format description: +; +; $0000 4: PRT ($19 (V0.x), $1b (V1.0), $1e (V1.5)) +; $0004 4: File offset to position data (POSD) +; $0008 4: File offset to pattern data (PATT) +; $000C 4: File offset to instruments (INST) +; $0010 4: File offset to waves (WAVE) +; $0014 20: Songname +; $0028 20: Author +; $003C 1: Restart position for song (<=V1.0) +; $003D 1: Number of patterns (<=V1.0) +; $003E 1: Songlength in patterns (<=V1.0) +; $003F 1: Number of steps per pattern (<=V1.0) +; $0040 1: Number of instruments (<=V1.0), $40 for V1.5 +; $0041 1: Number of waves +; $0042 24: Wave generation ordering (>=V1.0) +; $005a 1: Number of subsongs (>=V1.5) +; [...] +; Position data (POSD): +; - Per subsong (>=V1.5) +; - 1: Restart pos +; - 1: #patterns +; - 1: #numsteps +; - 1: songlength +; - 4: relative pattern offset in pattern data +; - Positions x 4 x [Pattern number (byte), pitch shift (signed byte)] +; +; Pattern data (PATT): +; Each pattern line consists of three bytes: +; - 1 Bit : Bit 4 of Inst Number +; - 1 Bit : ARP instead of effect +; - 6 Bits: Pitch ($01 is C-0, $3d is NOTE OFF) +; +; - 4 Bits: Bit 0-3 of Inst Number +; - 4 Bits: Effect command +; - 8 Bits: Effect data +; - Patterns x steps x 3 bytes +; +; Unknown data after pattern data: (12 10 00 00 00 00) +; +; Instrument definitions (INST): +; - 32 (!) x Null terminated string (or 23 chars max) (for V1.5 this is 64 strings) +; - For each instrument: Instrument Info (ININ) +; - $00 1: Vibrato Delay +; - $01 1: Vibrato Depth +; - $02 1: Vibrato Speed (-1) +; - $03 1: ADSR Attack +; - $04 1: ADSR Decay +; - $05 1: ADSR Sustain +; - $06 1: ADSR Release +; - $07 1: Number of Inst Pattern steps +; +; - For each instrument: +; - 1 Byte: number of steps +; - 3 Bytes x number of steps: Inst Pattern (IPTT) +; +; Inst pattern data (IPTT): +; Each pattern line consists of three bytes: +; - 1 Bit : Next note stitched to this one +; - 1 Bit : Fixed Pitch Note +; - 6 Bits : Pitch ($01 is C-0) +; - 4 Bits : unused? +; - 12 Bits: Effect +; - Patterns x steps x 3 bytes +; +; Wave definitions (WAVE): +; - 24 (!) x Null terminated string (or 23 chars max) +; - Optional padding to even address, if necessary +; - For each wave: +; - 42 Bytes: Wave info structure (see definition below) + +; ---------------------------------------- +; Some constants for clarity + +MAX_VOLUME = $40 +MAX_SPEED = $2f +MAX_WAVES = 24 +MAX_INSTRUMENTS = 32 +MAX_TRACK_DELAY = 32 +NOTE_OFF_PITCH = $3d +NOTES_IN_OCTAVE = 12 +NUM_CHANNELS = 4 ; yes, you can reduce the number of channels if you want + +; ---------------------------------------- +; Pretracker file structures + +; Pattern data (PATT and IPTT) +pdb_pitch_ctrl = 0 +pdb_inst_effect = 1 ; for normal pattern data +pdb_effect_cmd = 1 ; for inst pattern +pdb_effect_data = 2 + +; Pattern pos data (POSD) +ppd_pat_num = 0 +ppd_pat_shift = 1 + +; Instrument Info (ININ) +ii_vibrato_delay = 0 +ii_vibrato_depth = 1 +ii_vibrato_speed = 2 +ii_adsr_attack = 3 +ii_adsr_decay = 4 +ii_adsr_sustain = 5 +ii_adsr_release = 6 +ii_pattern_steps = 7 +ii_SIZEOF = 8 + +; Wave Info (WAVE) +wi_loop_start_w = $00 +wi_loop_end_w = $02 +wi_subloop_len_w = $04 +wi_allow_9xx_b = $06 +wi_subloop_wait_b = $07 +wi_subloop_step_w = $08 +wi_chipram_w = $0a +wi_loop_offset_w = $0c +wi_chord_note1_b = $0e +wi_chord_note2_b = $0f +wi_chord_note3_b = $10 +wi_chord_shift_b = $11 +wi_osc_unknown_b = $12 ; always $00? (unused in code?) +wi_osc_phase_spd_b = $13 +wi_flags_b = $14 ; bit 0/1: osc type, bit 2: needs extra octaves, bit 3: boost, bit 4: pitch linear, bit 5: vol fast +wi_osc_phase_min_b = $15 +wi_osc_phase_max_b = $16 +wi_osc_basenote_b = $17 +wi_osc_gain_b = $18 +wi_sam_len_b = $19 ; in multiples of 128, zero-based (0 == 128) +wi_mix_wave_b = $1a +wi_vol_attack_b = $1b +wi_vol_delay_b = $1c +wi_vol_decay_b = $1d +wi_vol_sustain_b = $1e +wi_flt_type_b = $1f ; 1=lowpass, 2=highpass, 3=bandpass, 4=notch +wi_flt_resonance_b = $20 +wi_pitch_ramp_b = $21 +wi_flt_start_b = $22 +wi_flt_min_b = $23 +wi_flt_max_b = $24 +wi_flt_speed_b = $25 +wi_mod_params_l = $26 +wi_mod_wetness_b = $26 +wi_mod_length_b = $27 +wi_mod_predelay_b = $28 +wi_mod_density_b = $29 ; (1-7), unisono (bits 3/4) and post bit 5 +wi_SIZEOF = $2a + +; ---------------------------------------- +; Unpacked Instrument Info (addition to player for faster processing) + rsreset +uii_vibrato_delay rs.w 1 +uii_vibrato_depth rs.w 1 +uii_vibrato_speed rs.w 1 +uii_adsr_release rs.b 1 + rs.b 1 ; dummy +uii_adsr_attack rs.w 1 +uii_adsr_decay rs.w 1 +uii_adsr_sustain rs.w 1 +uii_pattern_steps rs.b 1 + rs.b 1 ; padding +uii_SIZEOF rs.b 0 + +; ---------------------------------------- +; MySong offsets + rsreset +sv_waveinfo_table rs.l MAX_WAVES ; 24 pointers to wave infos to avoid mulu +sv_inst_patterns_table rs.l MAX_INSTRUMENTS ; 32 pointers to pattern data + ; --- 127 byte displacement limit --- +sv_wavelength_table rs.l MAX_WAVES ; 24 longwords to sample lengths (standard octave) (NEW) +sv_wavetotal_table rs.l MAX_WAVES ; 24 longwords to sample lengths for all octaves (NEW) +sv_wavegen_order_table rs.b MAX_WAVES ; 24 bytes +sv_num_waves_b rs.b 1 +sv_num_steps_b rs.b 1 +sv_patterns_ptr rs.l 1 +sv_curr_pat_pos_w rs.w 1 ; only byte used FIXME why is this part of MySong? Should be in Player +sv_pat_pos_len_w rs.w 1 ; only byte used +sv_pat_restart_pos_w rs.w 1 ; only byte used +sv_pos_data_adr rs.l 1 +sv_waveinfo_ptr rs.l 1 ; base pointer of wave info +sv_pattern_table rs.l 256 +sv_inst_infos_table rs.b MAX_INSTRUMENTS*uii_SIZEOF +sv_SIZEOF rs.b 0 + +; ---------------------------------------- +; channel output data (part of pcd structure below) + rsreset +ocd_sam_ptr rs.l 1 ; 0 +ocd_length rs.w 1 ; 4 +ocd_loop_offset rs.w 1 ; 6 +ocd_period rs.w 1 ; 8 +ocd_volume rs.b 1 ; 10 +ocd_trigger rs.b 1 ; 11 needs to be after volume +ocd_unused rs.l 1 ; 12 unused, but makes the structure an even 16 bytes +ocd_SIZEOF rs.b 0 + +; channel structure (part of pv structure) + rsreset +; DO NOT CHANGE ORDER -- OPTIMIZED CLEARING +pcd_pat_portamento_dest_w rs.w 1 ; portamento destination pitch +pcd_pat_pitch_slide_w rs.w 1 + +pcd_pat_vol_ramp_speed_b rs.b 1 +pcd_pat_2nd_inst_num4_b rs.b 1 +pcd_pat_2nd_inst_delay_b rs.b 1 +pcd_wave_offset_b rs.b 1 + +pcd_inst_pitch_slide_w rs.w 1 +pcd_inst_sel_arp_note_w rs.w 1 + +pcd_inst_note_pitch_w rs.w 1 +pcd_inst_curr_port_pitch_w rs.w 1 + +pcd_inst_line_ticks_b rs.b 1 +pcd_inst_pitch_pinned_b rs.b 1 +pcd_inst_vol_slide_b rs.b 1 +pcd_inst_step_pos_b rs.b 1 + +pcd_inst_wave_num_w rs.w 1 ; current wave number (1 based) (lower byte used) + +pcd_track_delay_offset_b rs.b 1 ; $ff = no track delay +pcd_inst_speed_stop_b rs.b 1 ; speed byte, $ff stops processing +pcd_inst_pitch_w rs.w 1 + +pcd_inst_vol_w rs.w 1 +pcd_loaded_inst_vol_b rs.b 1 +pcd_pat_vol_b rs.b 1 ; Multiplied with volume of instrument. +; DO NOT CHANGE ORDER -- OPTIMIZED CLEARING END + +pcd_arp_notes_l rs.b 0 +pcd_arp_note_1_b rs.b 1 +pcd_arp_note_2_b rs.b 1 +pcd_arp_note_3_b rs.b 1 + rs.b 1 ; gets cleared + +pcd_last_trigger_pos_w rs.w 1 ; I think this makes sure that we don't retrigger the note on same pos + +pcd_pat_portamento_speed_b rs.b 1 +pcd_pat_adsr_rel_delay_b rs.b 1 ; counts down until adsr release. Seems unused? +pcd_note_off_delay_b rs.b 1 ; time before note is released ($ff = disabled) +pcd_inst_pattern_steps_b rs.b 1 ; number of steps in instrument pattern + +pcd_note_delay_b rs.b 1 ; $ff = no note delay +pcd_track_delay_steps_b rs.b 1 ; $00 = no track delay, $ff = stop track delay (this is for the next channel!) +pcd_track_delay_vol16_b rs.b 1 +pcd_track_init_delay_b rs.b 1 ; number of frames to ignore the delay + +pcd_inst_num4_w rs.w 1 ; current instrument number * 4 +;pcd_inst_new_step_w rs.w 1 ; seems to be unused +pcd_inst_subloop_wait_w rs.w 1 +pcd_inst_loop_offset_w rs.w 1 +pcd_inst_info_ptr rs.l 1 ; pointer to currently active instrument + +pcd_waveinfo_ptr rs.l 1 ; pointer to currently active waveinfo +pcd_channel_mask_b rs.b 1 +pcd_channel_num_b rs.b 1 +pcd_adsr_phase_w rs.w 1 ; 0=attack, 1=decay, 2=sustain, 3=release ! do not change order +pcd_adsr_volume_w rs.w 1 ; 0 for restart / $400 (word only) ! do not change order +pcd_adsr_phase_speed_b rs.b 1 +pcd_inst_ping_pong_dir_b rs.b 1 ; direction of ping-pong (-1 == $00 / +1 = $ff) +pcd_adsr_pos_w rs.w 1 ; pos in adsr curve +pcd_adsr_vol64_w rs.w 1 ; some adsr volume + +pcd_new_inst_num_b rs.b 1 ; load new instrument (number) ! do not change order + rs.b 1 ; gets cleared +pcd_vibrato_pos_w rs.w 1 ; +pcd_vibrato_delay_w rs.w 1 ; is a byte value ! do not change order +pcd_vibrato_depth_w rs.w 1 ; is a byte value ! do not change order +pcd_vibrato_speed_w rs.w 1 ; is a byte value ! do not change order +pcd_adsr_release_b rs.b 1 ; is a byte value ! do not change order + rs.b 1 ; padding will be overwritten! + +pcd_out_base rs.b ocd_SIZEOF +pcd_track_delay_buffer rs.b MAX_TRACK_DELAY*ocd_SIZEOF +pcd_SIZEOF rs.b 0 + +pcd_out_ptr_l = pcd_out_base+ocd_sam_ptr +pcd_out_len_w = pcd_out_base+ocd_length +pcd_out_lof_w = pcd_out_base+ocd_loop_offset +pcd_out_per_w = pcd_out_base+ocd_period +pcd_out_vol_b = pcd_out_base+ocd_volume +pcd_out_trg_b = pcd_out_base+ocd_trigger +pcd_out_unused_l = pcd_out_base+ocd_unused ; copied for track delay, but not used? + + rsreset +owb_saw_waves rs.b 128 +owb_sqr_waves rs.b 128 +owb_tri_waves rs.b 128 +owb_wave_length rs.b 1 +owb_SIZEOF rs.b 0 + +; ---------------------------------------- +; MyPlayer global variables (not bound to channel) + rsreset +; DO NOT CHANGE ORDER -- OPTIMIZED INIT +pv_pat_curr_row_b rs.b 1 ; current step +pv_next_pat_row_b rs.b 1 +pv_next_pat_pos_b rs.b 1 +pv_pat_speed_even_b rs.b 1 ; even shuffle speed + +pv_pat_speed_odd_b rs.b 1 ; odd shuffle speed +pv_pat_line_ticks_b rs.b 1 +pv_pat_stopped_b rs.b 1 ; 0 = stop, $ff = run +pv_songend_detected_b rs.b 1 +; DO NOT CHANGE ORDER -- OPTIMIZED INIT END + +pv_loop_pattern_b rs.b 1 ; repeat current pattern, do not advance + rs.b 1 ; padding + +pv_trigger_mask_w rs.w 1 + +pv_my_song rs.l 1 +pv_sample_buffer_ptr rs.l 1 ; pointer to start of sample buffer +pv_copperlist_ptr rs.l 1 +pv_wave_sample_table rs.l MAX_WAVES ; 24 pointers to sample starts +pv_period_table rs.w 16*NOTES_IN_OCTAVE*3 + ; --- 127 byte displacement limit --- +pv_channeldata rs.b NUM_CHANNELS*pcd_SIZEOF + + IFNE PRETRACKER_VOLUME_TABLE +pv_osc_buffers rs.b 0 ; reuse space of volume_table, which is bigger than NOTES_IN_OCTAVE*owb_SIZEOF +pv_volume_table rs.b (MAX_VOLUME+1)*MAX_VOLUME*2 + ELSE +pv_osc_buffers rs.b NOTES_IN_OCTAVE*owb_SIZEOF + ENDC + +pv_precalc_sample_size rs.l 1 +pv_precalc_progress_ptr rs.l 1 +pv_wg_wave_ord_num_w rs.w 1 + IFNE PRETRACKER_PARANOIA_MODE ; same wave for mixing cannot be selected in Pretracker +pv_wg_curr_wave_num_b rs.b 1 + rs.b 1 + ENDC +pv_wg_curr_sample_ptr rs.l 1 +pv_wg_curr_samend_ptr rs.l 1 +pv_wg_curr_sample_len_w rs.w 1 +pv_wg_chord_note_num_b rs.b 1 ; don't change order +pv_wg_unisono_run_b rs.b 1 ; don't change order +pv_wg_chord_flag_w rs.w 1 +pv_wg_chord_pitches rs.l 1 +pv_wg_osc_speed_l rs.l 1 +pv_wg_flt_taps rs.w 4 +pv_SIZEOF rs.b 0 + +;-------------------------------------------------------------------- + + include "../includes/hardware/custom.i" + include "../includes/hardware/dmabits.i" + +CLIPTO8BIT MACRO + cmpi.w #-$80,\1 + bge.s .nominclip\@ + moveq.l #-$80,\1 +.nominclip\@ + cmpi.w #$7F,\1 + ble.s .nomaxclip\@ + moveq.l #$7F,\1 +.nomaxclip\@ + ENDM + +CLIPORTRUNC8BIT MACRO + beq.s .unboosted\@ + asr.l #6,\1 + cmpi.w #-$80,\1 + bge.s .nominclip\@ + moveq.l #-$80,\1 +.nominclip\@ + cmpi.w #$7F,\1 + ble.s .nomaxclip\@ + moveq.l #$7F,\1 + bra.s .nomaxclip\@ +.unboosted\@ + asr.l #8,\1 +.nomaxclip\@ + ENDM + +CLIPTO8BITAFTERADD MACRO + bvc.s .noclip\@ + spl \1 + eor.b #$7f,\1 +.noclip\@ + ENDM + +;-------------------------------------------------------------------- +; Code starts here + + IFNE PRETRACKER_KEEP_JUMP_TABLE +pre_FuncTable + dc.l pre_SongInit-pre_FuncTable + dc.l pre_PlayerInit-pre_FuncTable + dc.l pre_PlayerTick-pre_FuncTable + ENDC + ;dc.b '$VER: Raspberry Casket 1.1',0 + ;even + + IFNE PRETRACKER_COPPER_OUTPUT +;******************************************************************** +;-------------------------------------------------------------------- +; pre_PrepareCopperlist - initialize copperlist for replaying +; +; a0.l = copperlist (37 longwords for 4 channels, 5+8*NUM_CHANNELS) +; d0.w = rasterline (<239 or >=256) +; out: a0 = copperlist ptr after init +;******************************************************************** +pre_PrepareCopperlist: + IFNE PRETRACKER_DONT_TRASH_REGS + movem.l d2-d3/d6/d7,-(sp) + ENDC + moveq.l #-2,d1 + lsl.w #8,d0 + move.b #$07,d0 + move.w d0,(a0)+ + move.w d1,(a0)+ + + move.l #(dmacon<<16)|DMAF_AUDIO,(a0)+ + + add.w #$500,d0 + move.w d0,(a0)+ + move.w d1,(a0)+ + + ; writing 5*4 = 20 words + move.w #aud0+ac_ptr,d2 + moveq.l #0,d3 + moveq.l #NUM_CHANNELS-1,d7 +.chloop moveq.l #5-1,d6 +.dloop move.w d2,(a0)+ + move.w d3,(a0)+ + addq.w #2,d2 + dbra d6,.dloop + addq.w #ac_SIZEOF-ac_dat,d2 + dbra d7,.chloop + + move.l #(dmacon<<16)|DMAF_SETCLR,(a0)+ + + add.w #$500,d0 + move.w d0,(a0)+ + move.w d1,(a0)+ + + ; writing 2*4 = 12 words + move.w #aud0+ac_ptr,d2 + moveq.l #NUM_CHANNELS-1,d7 +.chloop2 + moveq.l #3-1,d6 +.dloop2 move.w d2,(a0)+ + move.w d3,(a0)+ + addq.w #2,d2 + dbra d6,.dloop2 + add.w #ac_SIZEOF-ac_per,d2 + dbra d7,.chloop2 + IFNE PRETRACKER_DONT_TRASH_REGS + movem.l (sp)+,d2-d3/d6/d7 + ENDC + rts + + ENDC + +;******************************************************************** +;-------------------------------------------------------------------- +; SongInit - initialize data structure belonging to a song +; +; In: +; - a0: MyPlayer structure (unused) +; - a1: MySong structure (must be sv_SIZEOF bytes!) +; - a2: Pretracker song data +; Out: +; - d0: chipmemory (bytes) required for samples or 0 on error +;******************************************************************** +pre_SongInit: + IFNE PRETRACKER_DONT_TRASH_REGS + movem.l d2/d7/a2-a5,-(sp) + ENDC + moveq.l #0,d0 + move.l $0000(a2),d1 + move.b d1,d2 + clr.b d1 + cmpi.l #$50525400,d1 ; "PRE"-Text + bne .error + moveq.l #MAX_INSTRUMENTS-1,d7 ; notice there's one extra name (available in 1.5, but not usable)! + IFNE PRETRACKER_SUPPORT_V1_5 + cmpi.b #$1e,d2 + bgt .error + bne.s .nopatchv15 + move.l $005c(a2),d0 ; make song backward compatible + ror.w #8,d0 + move.l d0,$003c(a2) + addq.l #8,$0004(a2) ; skip over first pattern data + moveq.l #2*MAX_INSTRUMENTS-1,d7 ; v1.5 has 32 slots (the other ones used for sfx) +.nopatchv15 + ELSE + cmpi.b #$1b,d2 + bgt .error + ENDC + + move.l a1,a0 + move.w #sv_SIZEOF,d0 + bsr pre_MemClr + + move.b $003c(a2),sv_pat_restart_pos_w+1(a1) ; song restart pos + move.b $003e(a2),sv_pat_pos_len_w+1(a1) ; songlength in pattern positions + move.b $003f(a2),sv_num_steps_b(a1) ; number of steps! + move.b $0041(a2),sv_num_waves_b(a1) ; number of instruments + + move.l $0004(a2),d0 + add.l a2,d0 + move.l d0,sv_pos_data_adr(a1) ; address to position data (POSD) + + move.l $0008(a2),d0 + add.l a2,d0 + move.l d0,sv_patterns_ptr(a1) ; address to pattern data (PATT) + + move.l $000c(a2),d0 ; offset into instrument names + lea (a2,d0.l),a0 ; instrument names + +.instrnamesloop + moveq.l #23-1,d0 ; max 23 chars +.inststrloop + tst.b (a0)+ + dbeq d0,.inststrloop + dbra d7,.instrnamesloop + + moveq.l #0,d7 + move.b $0040(a2),d7 ; number of instruments + IFNE PRETRACKER_PARANOIA_MODE + beq.s .noinstsskip + ENDC + move.l d7,d0 + lsl.w #3,d0 + add.l a0,d0 ; skip 8 bytes of info per instrument (ININ) + lea sv_inst_patterns_table(a1),a3 + lea sv_inst_infos_table(a1),a4 + IFNE PRETRACKER_SUPPORT_V1_5 + cmp.w #MAX_INSTRUMENTS,d7 + ble.s .notruncto32 + moveq.l #MAX_INSTRUMENTS,d7 +.notruncto32 + ENDC + subq.w #1,d7 +.instinfoloop + move.l d0,(a3)+ + + moveq.l #0,d1 + move.b (a0)+,d1 ; ii_vibrato_delay + lea pre_vib_delay_table(pc),a5 + move.b (a5,d1.w),d1 + addq.w #1,d1 + move.w d1,uii_vibrato_delay(a4) + + moveq.l #0,d1 + move.b (a0)+,d1 ; ii_vibrato_depth + move.b pre_vib_depth_table-pre_vib_delay_table(a5,d1.w),uii_vibrato_depth+1(a4) + + move.b (a0)+,d1 ; ii_vibrato_speed + move.b pre_vib_speed_table-pre_vib_delay_table(a5,d1.w),d1 + muls uii_vibrato_depth(a4),d1 ; bake in this strange vibrato stuff + asr.w #4,d1 + move.w d1,uii_vibrato_speed(a4) + + moveq.l #0,d1 + move.b (a0)+,d1 ; ii_adsr_attack + add.w d1,d1 + move.w pre_fast_roll_off_16-pre_vib_delay_table(a5,d1.w),d1 + move.w d1,uii_adsr_attack(a4) + + moveq.l #0,d1 + move.b (a0)+,d1 ; ii_adsr_decay + move.b pre_ramp_up_16-pre_vib_delay_table(a5,d1.w),uii_adsr_decay+1(a4) + + move.b (a0)+,d1 ; ii_adsr_sustain + ; what is this? a patch? + cmp.b #15,d1 + bne.s .dont_patch_sustain + moveq.l #16,d1 +.dont_patch_sustain + lsl.w #6,d1 + move.w d1,uii_adsr_sustain(a4) + + moveq.l #0,d1 + move.b (a0)+,d1 ; ii_adsr_release + move.b pre_ramp_up_16-pre_vib_delay_table(a5,d1.w),uii_adsr_release(a4) + + move.b (a0)+,d1 ; ii_pattern_steps + move.b d1,uii_pattern_steps(a4) + add.l d1,d0 + add.l d1,d0 + add.l d1,d0 ; calc next start address + lea uii_SIZEOF(a4),a4 + dbra d7,.instinfoloop + +.noinstsskip + move.l $0010(a2),d0 ; offset into wave names + lea (a2,d0.l),a0 + moveq.l #MAX_WAVES-1,d7 +.wavenamesloop + moveq.l #23-1,d0 ; max 23 chars +.wavestrloop + tst.b (a0)+ + dbeq d0,.wavestrloop + dbra d7,.wavenamesloop + + move.l a0,d0 + lsr.w #1,d0 + bcc.s .addressiseven + addq.l #1,a0 ; make address even +.addressiseven + move.l a0,sv_waveinfo_ptr(a1) + + lea sv_wavegen_order_table(a1),a0 + cmpi.b #$19,d2 ; check if version is higher than 19 + bhi.s .haswaveorderinfo + + moveq.l #0,d0 ; fill 24 bytes with default order of waves? + moveq.l #MAX_WAVES-1,d7 +.fillcount + move.b d0,(a0)+ + addq.b #1,d0 + dbra d7,.fillcount + bra.s .contafterworkaround + +.haswaveorderinfo + moveq.l #(MAX_WAVES/4)-1,d7 + lea $0042(a2),a2 ; offset into wave ordering +.memcpyloop + move.l (a2)+,(a0)+ + dbra d7,.memcpyloop + +.contafterworkaround + moveq.l #2,d0 ; at least empty sample + moveq.l #0,d7 + move.b sv_num_waves_b(a1),d7 ; has instruments? + IFNE PRETRACKER_PARANOIA_MODE + beq.s .hasnoinstruments + ENDC + + move.l sv_waveinfo_ptr(a1),a3 + subq.w #1,d7 +.wavetableloop + moveq.l #0,d1 + move.b wi_sam_len_b(a3),d1 + addq.w #1,d1 + lsl.w #7,d1 + move.l d1,sv_wavelength_table-sv_waveinfo_table(a1) + btst #2,wi_flags_b(a3) + beq.s .onlythreeocts + mulu #15,d1 + lsr.l #3,d1 ; * 1.875 +.onlythreeocts + move.l d1,sv_wavetotal_table-sv_waveinfo_table(a1) + move.l a3,(a1)+ + add.l d1,d0 + lea wi_SIZEOF(a3),a3 + dbra d7,.wavetableloop + ; d0 will contain the size of the samples +.hasnoinstruments +.error +.exit + IFNE PRETRACKER_DONT_TRASH_REGS + movem.l (sp)+,d2/d7/a2-a5 + ENDC + rts + +;******************************************************************** +;-------------------------------------------------------------------- +; PlayerInit - initialize player and calculate samples +; +; In: +; - a0: MyPlayer (must have size of pv_SIZEOF, will be initialized) +; - a1: sample buffer +; - a2: MySong (must have been filled with SongInit before!) +; - a3: pointer to a longword for the progress of samples bytes generated (or null) +;******************************************************************** +pre_PlayerInit: + IFNE PRETRACKER_DONT_TRASH_REGS + movem.l d2-d7/a2-a6,-(sp) + ENDC + move.l a0,a4 + move.l a2,a6 + + move.w #pv_SIZEOF,d0 + bsr pre_MemClr ; keeps a1 unchanged! + +; ---------------------------------------- +; proposed register assignment: +; a0 = sample output / scratch +; a1 = scratch +; a3 = waveinfo +; a4 = MyPlayer +; a6 = MySong + + move.l a2,pv_my_song(a4) + IFNE PRETRACKER_PROGRESS_SUPPORT + move.l a3,pv_precalc_progress_ptr(a4) + ENDC + + move.l a1,pv_sample_buffer_ptr(a4) + IFNE PRETRACKER_PARANOIA_MODE + beq.s .hasnosamplebuffer ; PARANOIA + ENDC + + clr.w (a1)+ ; empty sample + moveq.l #0,d7 + move.b sv_num_waves_b(a6),d7 + IFNE PRETRACKER_PARANOIA_MODE + beq.s .hasnosamplebuffer ; PARANOIA + ENDC + + lea pv_wave_sample_table(a4),a0 + lea sv_wavetotal_table(a6),a3 + subq.w #1,d7 +.samplestartsloop + move.l a1,(a0)+ ; write sample start pointer + adda.l (a3)+,a1 + dbra d7,.samplestartsloop +.hasnosamplebuffer + +; ---------------------------------------- + + lea pre_period_table(pc),a0 + lea pv_period_table(a4),a1 + +.calcperiodtable + ; fill the missing entries in the period table by interpolating + moveq.l #3*NOTES_IN_OCTAVE-1,d7 +.periodtableloop + move.w (a0)+,d0 + move.w (a0),d1 + sub.w d0,d1 + swap d0 + clr.w d0 + swap d1 + clr.w d1 + asr.l #4,d1 + + moveq.l #16-1,d6 +.perfineipolloop + swap d0 + move.w d0,(a1)+ + swap d0 + add.l d1,d0 + dbra d6,.perfineipolloop + dbra d7,.periodtableloop + +; ---------------------------------------- + + moveq.l #0,d0 + move.b sv_num_steps_b(a6),d0 + move.w d0,d1 + add.w d0,d0 + add.w d1,d0 ; *3 bytes per pattern line + + move.l sv_patterns_ptr(a6),a3 + lea sv_pattern_table(a6),a0 + move.w #255-1,d7 ; FIXME we should use the number of patterns instead? +.pattableloop + move.l a3,(a0)+ + add.w d0,a3 + dbra d7,.pattableloop + +; ---------------------------------------- + + move.l #$00ffff06,pv_pat_curr_row_b(a4) ; pattern frame = 0, line = $ff, pattern pos = $ff, speed_even = 0 + move.l #$06060100,pv_pat_speed_odd_b(a4) ; and pv_pat_line_ticks_b, pv_pat_stopped_b, pv_songend_detected_b + + move.l sv_waveinfo_ptr(a6),a1 + lea pv_channeldata(a4),a0 + moveq.l #NUM_CHANNELS-1,d7 + moveq.l #0,d0 +.chaninitloop2 + move.b #MAX_VOLUME,pcd_pat_vol_b(a0) + st pcd_track_delay_offset_b(a0) + move.l a1,pcd_waveinfo_ptr(a0) + move.w #3,pcd_adsr_phase_w(a0) + + move.l pv_sample_buffer_ptr(a4),pcd_out_ptr_l(a0) + move.w #2,pcd_out_len_w(a0) + move.w #$7B,pcd_out_per_w(a0) + move.b d0,pcd_channel_num_b(a0) + bset d0,pcd_channel_mask_b(a0) + addq.b #1,d0 + lea pcd_SIZEOF(a0),a0 + dbra d7,.chaninitloop2 + +; ---------------------------------------- + + lea pre_log12_table(pc),a0 ; 128, 121, 114, 107, 102, 96, 90, 85, 80, 76, 72, 67 + lea pv_osc_buffers+owb_sqr_waves(a4),a1 + moveq.l #NOTES_IN_OCTAVE-1,d7 +.noteloop + moveq.l #0,d6 + move.l d6,a3 ; tabpos + move.b (a0)+,d6 ; period + move.b d6,owb_wave_length-owb_sqr_waves(a1) + + move.l #$ff00,d5 + divu d6,d5 ; frac increment + + move.w d6,d4 + lsr.w #1,d4 ; half-period + move.w d4,d3 + lsr.w #1,d3 ; quarter-period + + moveq.l #0,d0 ; acc + lea (a1,d6.w),a2 + lea owb_tri_waves-owb_sqr_waves(a2),a2 + suba.w d3,a2 +.notewaveloop + move.w d0,d2 + lsr.w #8,d2 + + moveq.l #$7f,d1 + sub.b d2,d1 + move.b d1,owb_saw_waves-owb_sqr_waves(a1,a3.w) + + add.b d2,d2 + cmp.w a3,d3 ; tabpos == negquarter + bne.s .nowrapback + suba.w d6,a2 ; go back to start of period +.nowrapback + cmp.w d0,a3 + ble.s .otherhalf + moveq.l #$7f,d1 + sub.b d2,d1 + move.b d1,(a2)+ + bra.s .clip80 + +.otherhalf + add.b #$80,d2 + move.b d2,(a2)+ + moveq.l #$7f,d2 + cmp.w a3,d4 + bne.s .noclip80 +.clip80 moveq.l #-$80,d2 +.noclip80 + move.b d2,owb_sqr_waves-owb_sqr_waves(a1,a3.w) + + add.w d5,d0 ; increment acc by frac + addq.w #1,a3 ; increment pos + + cmp.w a3,d6 + bne.s .notewaveloop + + lea owb_SIZEOF(a1),a1 + dbra d7,.noteloop + +; ---------------------------------------- + +.audioinit + bset #1,$BFE001 ; filter off + + IFNE PRETRACKER_PARANOIA_MODE + tst.b sv_num_waves_b(a6) + beq .earlyexit ; PARANOIA + ENDC + +; ---------------------------------------- +; proposed register assignment: +; a0 = sample output +; a1 = scratch +; a3 = songinfo +; a4 = MyPlayer +; a6 = MySong / waveinfo + +.wavegenloop + ;movea.l pv_my_song(a4),a6 + lea sv_wavegen_order_table(a6),a1 + move.w pv_wg_wave_ord_num_w(a4),d0 ; counter through all 24 waves + moveq.l #0,d1 + move.b (a1,d0.w),d1 ; apply wave order redirection + IFNE PRETRACKER_PARANOIA_MODE ; same wave for mixing cannot be selected in Pretracker + move.b d1,pv_wg_curr_wave_num_b(a4) + ENDC + lsl.w #2,d1 + move.l pv_wave_sample_table(a4,d1.w),a0 + move.l a0,pv_wg_curr_sample_ptr(a4) + + add.w #sv_wavelength_table,d1 + adda.w d1,a6 + move.l sv_wavelength_table-sv_wavelength_table(a6),d0 + move.w d0,pv_wg_curr_sample_len_w(a4) + IFNE PRETRACKER_PROGRESS_SUPPORT + move.l sv_wavetotal_table-sv_wavelength_table(a6),pv_precalc_sample_size(a4) + ENDC + move.l sv_waveinfo_table-sv_wavelength_table(a6),a3 + + ; clear sample data (a0 and d0 from above) + bsr pre_MemClr + move.l a0,pv_wg_curr_samend_ptr(a4) + + ; read out chord information + lea wi_chord_note1_b(a3),a1 + move.b (a1)+,d1 + move.b (a1)+,d2 + move.b (a1)+,d3 + + moveq.l #0,d4 + move.b d1,d4 + or.b d2,d4 + or.b d3,d4 + seq d4 + neg.b d4 + move.w d4,pv_wg_chord_flag_w(a4) ; has chord flag (0/1) + + move.b wi_osc_basenote_b(a3),d0 + add.b d0,d1 + add.b d0,d2 + add.b d0,d3 + lea pv_wg_chord_pitches(a4),a1 + move.b d0,(a1)+ + move.b d1,(a1)+ + move.b d2,(a1)+ + move.b d3,(a1)+ + + suba.l a5,a5 + clr.w pv_wg_chord_note_num_b(a4) ; and pv_wg_chord_note_num_b + +.wavegen_chordloop + lea pv_wg_chord_pitches(a4),a1 + moveq.l #0,d1 + move.b pv_wg_chord_note_num_b(a4),d1 ; chord note counter + move.b (a1,d1.w),d0 ; get chord note + ext.w d0 + + tst.w d1 + beq.s .base_note_is_never_skipped ; is base note? + cmp.b wi_osc_basenote_b(a3),d0 + beq .wave_gen_tone_done ; skip chord notes that are same as base note +.base_note_is_never_skipped + moveq.l #0,d1 + moveq.l #NOTES_IN_OCTAVE,d2 + move.w d0,d1 + move.w d0,a2 ; save base note, used later (much later, noise generator)! + add.w #NOTES_IN_OCTAVE*NOTES_IN_OCTAVE,d1 ; make sure we don't run into negative modulo + divu d2,d1 + swap d1 + move.w d1,d0 ; note within octave + swap d1 + sub.w d2,d1 ; restore octave + + mulu #owb_SIZEOF,d0 + lea (a4,d0.w),a1 + + lea pv_osc_buffers+owb_saw_waves(a1),a6 + moveq.l #3,d0 + and.b wi_flags_b(a3),d0 + beq.s .osc_selected + lea owb_tri_waves-owb_saw_waves(a6),a6 + subq.b #1,d0 + beq.s .osc_selected + lea owb_sqr_waves-owb_tri_waves(a6),a6 + subq.b #1,d0 + beq.s .osc_selected + suba.l a6,a6 ; noise selected +.osc_selected + + move.l #$8000,d6 + move.w d1,d0 ; check octave shift + bgt.s .shiftleft + beq.s .contshift +;.shiftright + move.w d0,d3 + neg.w d3 + asr.l d3,d6 + bra.s .contshift +.shiftleft + lsl.l d0,d6 +.contshift + +; ---------------------------------------- +; pitch ramp + move.b wi_pitch_ramp_b(a3),d3 + ext.w d3 + ext.l d3 + btst #4,wi_flags_b(a3) ; pitch linear flag + beq.s .pitch_not_linear + tst.b d3 + bgt.s .pitch_ramp_positive + + lsl.l d0,d3 + add.l d3,d3 + bra.s .pitch_ramp_cont + +.pitch_not_linear + tst.b d3 + ble.s .pitch_ramp_cont +.pitch_ramp_positive + muls d3,d3 +.pitch_ramp_cont + move.l d3,d2 + lsl.l #8,d2 + lsl.l #2,d2 + + moveq.l #0,d7 + move.b pv_osc_buffers+owb_wave_length(a1),d7 ; get period + moveq.l #15,d5 + lsl.l d5,d7 + + sub.w d0,d5 ; 15-octave + lsl.w #3,d5 + + moveq.l #0,d3 + move.b wi_osc_phase_min_b(a3),d3 + + mulu d5,d3 + lsl.l #6,d3 + + moveq.l #0,d0 + move.b wi_osc_phase_max_b(a3),d0 + mulu d5,d0 + lsl.l #6,d0 + move.l d0,a5 + + moveq.l #0,d5 + move.b wi_osc_phase_spd_b(a3),d5 + lsl.l #8,d5 + lsl.l #3,d5 + + cmp.l d3,d0 + bge.s .osc_with_positive_phase_speed + neg.l d5 + + movea.l d3,a5 + bra.s .osc_continue +.osc_with_positive_phase_speed + move.l d3,d0 + +.osc_continue + move.l d0,pv_wg_osc_speed_l(a4) + + ; d0 = d6 * chord_shift * chordnum + d6 * phase_min = d6 * (chord_shift * chordnum + phase_min) + + moveq.l #0,d4 + move.b wi_chord_shift_b(a3),d4 + move.w pv_wg_chord_flag_w(a4),d0 + add.b pv_wg_chord_note_num_b(a4),d0 + mulu d0,d4 + moveq.l #0,d0 + move.b wi_osc_phase_min_b(a3),d0 + add.w d0,d4 + move.l d6,d0 + lsr.l #4,d0 + lsl.l #4,d4 + mulu d4,d0 + + cmp.l d7,d0 + ble.s .lbC002516 +.lbC002510 + sub.l d7,d0 + cmp.l d7,d0 + bgt.s .lbC002510 +.lbC002516 + move.l a6,d4 + bne .no_noise + +; ---------------------------------------- +; d1 = octave +; d5 = osc phase speed +; a2 = base note +.gen_noise + IFNE PRETRACKER_PARANOIA_MODE + tst.w pv_wg_curr_sample_len_w(a4) + beq .wave_gen_tone_done + ENDC + + move.l #$8000,d5 + move.l d5,a5 + tst.w d1 + bge.s .gen_noise_positive_octave + +.gen_noise_negative_octave + moveq.l #NOTES_IN_OCTAVE,d1 + move.l a2,d3 + neg.l d3 + move.l d3,d0 + divu d1,d0 + IFNE PRETRACKER_PARANOIA_MODE + bvs.s .divisionoverflow + ENDC + addq.w #1,d0 + lsr.w d0,d5 + moveq.l #0,d0 + move.w d5,d0 + divu d1,d0 + moveq.l #0,d4 + move.w d0,d4 + IFNE PRETRACKER_PARANOIA_MODE + bra.s .returnfromoverflow +.divisionoverflow + move.l #$AAA,d4 ; some dummy value, I would expect +.returnfromoverflow + ENDC + moveq.l #0,d0 + move.w d3,d0 +.cheap_mod12 + sub.w d1,d0 + bpl.s .cheap_mod12 + neg.w d0 + mulu d4,d0 + add.l d0,d5 + +.gen_noise_positive_octave + moveq.l #0,d0 + move.b wi_osc_phase_min_b(a3),d0 + moveq.l #0,d1 + move.b wi_chord_shift_b(a3),d1 + add.w d1,d0 + addq.w #1,d0 + + movea.l d5,a1 + movea.l pv_wg_curr_sample_ptr(a4),a0 + moveq.l #0,d1 + moveq.l #0,d6 + moveq.l #0,d3 + move.b wi_osc_gain_b(a3),d3 + +.gen_noise_outerloop + move.w d0,d1 ; random noise generator + lsl.w #8,d1 + lsl.w #5,d1 + eor.w d1,d0 + + move.w d0,d1 + lsr.w #8,d1 + lsr.w #1,d1 + eor.w d1,d0 + + move.w d0,d1 + lsl.w #7,d1 + eor.w d1,d0 + + cmpa.l #$8000,a5 ; if symmetrical + beq.s .gen_noise_centered + ; what does this do? (a5 - $8000) (a5 +$7fff)&$8000 + move.l a5,d4 + addi.l #$FFFF8000,d4 + move.l a5,d1 + addi.l #$FFFF7FFF,d1 + andi.w #$8000,d1 + movea.l d4,a5 + suba.l d1,a5 +.gen_noise_centered + + move.b d0,d1 + ext.w d1 + move.w d3,d4 + muls d1,d4 + move.l d4,d1 + asr.l #7,d1 + CLIPTO8BIT d1 + add.b (a0),d1 + +.gen_noise_innerloop + move.b d1,(a0)+ + adda.l a1,a5 + tst.l d2 + beq.s .lbC002BAC + add.l d2,d6 + move.l d6,d4 + asr.l #8,d4 + asr.l #2,d4 + add.l d5,d4 + movea.l d4,a1 + + btst #4,wi_flags_b(a3) ; pitch linear flag + beq.s .noise_nonlinear_pitch + move.l d2,d4 + asr.l #7,d4 + sub.l d4,d2 +.noise_nonlinear_pitch + + cmpa.w #$1FF,a1 + bgt.s .lbC002BAC + moveq.l #0,d2 + move.l d2,a5 + ;suba.l a5,a5 + movea.w #$200,a1 +.lbC002BAC + cmpa.l pv_wg_curr_samend_ptr(a4),a0 + beq .wave_gen_tone_done + cmpa.w #$7FFF,a5 + ble.s .gen_noise_innerloop + bra .gen_noise_outerloop + +.no_noise + move.l d6,d1 + tst.b pv_wg_unisono_run_b(a4) + beq.s .is_not_in_unisono + + moveq.l #3<<3,d1 + and.b wi_mod_density_b(a3),d1 + lsr.b #3,d1 + moveq.l #9,d4 + sub.b d1,d4 + + move.l d6,d1 + asr.l d4,d1 + add.l d6,d1 +.is_not_in_unisono + + IFNE PRETRACKER_PARANOIA_MODE + tst.w pv_wg_curr_sample_len_w(a4) + beq .wave_gen_tone_done + ENDC + +; ---------------------------------------- +; chord gen +; in: d0/d1/d2/d3/d5/d7 +; in: a0 + move.l d3,a1 + movea.l pv_wg_curr_sample_ptr(a4),a0 + suba.l a2,a2 + +.chordtoneloop + move.l d0,d4 + sub.l a1,d4 + bpl.s .noclip_osc_phase + moveq.l #0,d4 +.noclip_osc_phase + asr.l #8,d4 + asr.l #7,d4 + move.b (a6,d4.w),d4 ; fetch precalced sample + ext.w d4 + + moveq.l #0,d3 + move.b wi_osc_gain_b(a3),d3 + muls d4,d3 + asr.w #7,d3 + + move.b (a0),d4 + ext.w d4 + add.w d3,d4 + CLIPTO8BIT d4 + move.b d4,(a0)+ + + add.l d1,d0 + cmp.l d7,d0 + blt.s .lbC0025A2 + sub.l d7,d0 + add.l d5,a1 + cmp.l a5,a1 + blt.s .lbC00259A + neg.l d5 + move.l a5,a1 +.lbC00259A + cmp.l pv_wg_osc_speed_l(a4),a1 + bgt.s .lbC0025A2 + neg.l d5 + move.l pv_wg_osc_speed_l(a4),a1 +.lbC0025A2 + tst.l d2 + beq.s .chordtone_done + adda.l d2,a2 + move.l a2,d1 + asr.l #8,d1 + asr.l #2,d1 + add.l d6,d1 + + btst #4,wi_flags_b(a3) ; pitch linear flag + beq.s .no_linear_pitch + move.l d2,d4 + asr.l #7,d4 + sub.l d4,d2 +.no_linear_pitch + cmp.l d7,d1 + bcs.s .chordtone_done + moveq.l #0,d2 + moveq.l #0,d1 +.chordtone_done + cmpa.l pv_wg_curr_samend_ptr(a4),a0 + bne.s .chordtoneloop + +.wave_gen_tone_done + addq.b #1,pv_wg_chord_note_num_b(a4) + cmp.b #4,pv_wg_chord_note_num_b(a4) + bne .wavegen_chordloop + + moveq.l #3<<3,d0 + and.b wi_mod_density_b(a3),d0 ; unisono + beq.s .chords_done + move.l a6,d1 + beq.s .chords_done + tst.b pv_wg_unisono_run_b(a4) + bne.s .chords_done + move.w #$0001,pv_wg_chord_note_num_b(a4) ; sets also pv_wg_unisono_run_b + bra .wavegen_chordloop + +.chords_done +; ---------------------------------------- +; filters +; proposed register assignment: +; a0 = sample output +; a1 = end of filter chunk +; a2 = filter func +; d7/a6 = filter start +; a4 = MyPlayer +; a5 = unused +; a3 = waveinfo +; d3/d4/d5/d6 = filter taps +; d0/d1/d7 = scratch + + moveq.l #0,d0 + move.b wi_flt_type_b(a3),d0 + beq .filter_done + + IFNE PRETRACKER_PARANOIA_MODE + tst.w pv_wg_curr_sample_len_w(a4) + beq .filter_done + ENDC + + add.w d0,d0 + lea .filterfunc_jmptable(pc),a2 + add.w -1*2(a2,d0.w),a2 + + moveq.l #0,d4 ; filter tap values + moveq.l #0,d5 ; filter tap values + movem.l d4-d5,pv_wg_flt_taps(a4) + + lea wi_flt_start_b(a3),a0 + moveq.l #0,d0 + move.b (a0)+,d0 ; wi_flt_start_b + lsl.w #8,d0 + + move.b (a0)+,d4 ; wi_flt_min_b + lsl.w #8,d4 ; flt_min*256 + + move.b (a0)+,d5 ; wi_flt_max_b + lsl.w #8,d5 ; flt_max*256 + + move.b (a0)+,d3 ; wi_flt_speed_b + ext.w d3 + ext.l d3 ; flt_speed*128 + lsl.l #7,d3 + + movea.l pv_wg_curr_sample_ptr(a4),a0 + +.entry_to_filter_loop + move.l d0,a6 + move.l d3,d1 ; flt_speed_b*128 + adda.l d1,a6 ; suppress M68kUnexpectedConditionalInstruction + bgt.s .filter_speed_pos + +.filter_speed_neg + move.l d4,d1 ; flt_min*256 + cmp.l d1,d0 + blt.s .lbC002790 + cmp.l d1,a6 + bgt.s .lbC002936 + move.l d1,a6 + cmp.l d5,d1 ; flt_max*256 + beq.s .filter_load_min + neg.l d3 ; flt_speed_b*128 + bra.s .filter_load_min + +.filterfunc_jmptable + dc.w .lowpassfilter-.filterfunc_jmptable + dc.w .highpassfilter-.filterfunc_jmptable + dc.w .bandpassfilter-.filterfunc_jmptable + dc.w .notchfilter-.filterfunc_jmptable + +.lbC002790 + tst.l d0 + blt.s .lbC002936 + move.l a6,d7 + bgt.s .lbC002936 + neg.l d3 ; flt_speed_b*128 + move.w #$FF,d2 + move.w d2,d1 + sub.l a6,a6 + bra.s .filter_cont + +.filter_speed_pos + cmp.l d5,d0 ; flt_max*256 + bgt.s .lbC002D2A + cmp.l d5,a6 ; flt_max*256 + blt.s .lbC002936 + move.l d4,d2 ; flt_min*256 + cmp.l d5,d2 ; flt_max*256 + beq.s .filter_load_max_no_flip + neg.l d3 ; flt_speed_b*128 + move.l d5,a6 ; flt_max*256 + bra.s .filter_load_max + +.lbC002D2A + cmpi.l #$FF00,d0 + bgt.s .lbC002936 + cmp.l #$FEFF,a6 + ble.s .lbC002936 + neg.l d3 ; flt_speed_b*128 + moveq.l #0,d2 + move.l #$FF00,a6 + bra.s .filter_cont + +.lbC002936 + move.w a6,d2 + lsr.w #8,d2 + not.b d2 + bra.s .filter_cont + +.filter_load_max_no_flip + movea.l d2,a6 +.filter_load_max + moveq.l #0,d2 + move.b wi_flt_max_b(a3),d2 + not.b d2 + bra.s .filter_cont + +.filter_load_min + moveq.l #0,d2 + move.b wi_flt_min_b(a3),d2 + not.b d2 + +.filter_cont + btst #0,wi_flt_type_b(a3) + bne.s .not_notch_or_highpass +.highpass_or_notch ; entered for 2 or 4 + not.b d2 +.not_notch_or_highpass ; entered for 1 or 3 + move.w d2,d0 + add.w d0,d0 + + moveq.l #0,d7 + move.b wi_flt_resonance_b(a3),d7 + beq.s .filter_no_resonance + move.w d2,d1 + ext.l d1 + lsl.l #8,d1 + + moveq.l #$B6/2,d0 + sub.w d7,d0 + add.w d0,d0 + + cmpi.w #$36,d0 + bge.s .filter_no_clip_resonance + moveq.l #$36,d0 +.filter_no_clip_resonance + divu d0,d1 + move.w d2,d0 + add.w d1,d0 +.filter_no_resonance + lea $40(a0),a1 ; end of sample chunk + + movem.l d3-d5,-(sp) + movem.w pv_wg_flt_taps(a4),d3-d6 + + ; d0/d2 relevant for inner loop +.filter_innerloop + move.b (a0),d1 + ext.w d1 + + move.w d4,d7 + sub.w d5,d7 + muls d0,d7 + asr.l #8,d7 + sub.w d4,d7 + + add.w d1,d7 + muls d2,d7 + asr.l #8,d7 + add.w d7,d4 + move.w d4,d7 + + sub.w d5,d7 + muls d2,d7 + asr.l #8,d7 + add.w d7,d5 + move.w d5,d7 + + sub.w d6,d7 + muls d2,d7 + asr.l #8,d7 + add.w d7,d6 + move.w d6,d7 + + sub.w d3,d7 + muls d2,d7 + asr.l #8,d7 + add.w d7,d3 + move.w d3,d7 + + jmp (a2) + +.highpassfilter + sub.w d1,d7 + bra.s .filterclipresult + +.bandpassfilter + sub.w d4,d7 + sub.w d5,d7 + sub.w d6,d7 + asr.w #1,d7 + bra.s .filterclipresult + +.notchfilter + sub.w d4,d7 + neg.w d7 + +.lowpassfilter +.filterclipresult + CLIPTO8BIT d7 +.filter_outputbyte + move.b d7,(a0)+ + cmpa.l a0,a1 + bne.s .filter_innerloop + +.filterloop_end_test + movem.w d3-d6,pv_wg_flt_taps(a4) + movem.l (sp)+,d3-d5 + + cmpa.l pv_wg_curr_samend_ptr(a4),a0 + bhs.s .filter_done + move.l a6,d0 + bra .entry_to_filter_loop + +.filter_done +; ---------------------------------------- +; Optional Pre-Modulator + btst #5,wi_mod_density_b(a3) ; post bit + bne.s .nopremodulator + bsr pre_Modulator +.nopremodulator + +; ---------------------------------------- +; start with volume envelope +; a0 = output sample buffer +; d0 = scratch (e.g. sample) +; d1 = increment for attack phase +; d3 = current volume for attack and decay phases +; d4 = remaining sample length - 1 +; a3 = wave info + +.vol_do_envelope + movea.l pv_wg_curr_sample_ptr(a4),a0 ; load buffer pointer + move.w pv_wg_curr_sample_len_w(a4),d4 ; load length + IFNE PRETRACKER_PARANOIA_MODE + beq .vol_envelope_finished ; paranoia + ENDC + subq.w #1,d4 ; we use length-1, <0 is end + + moveq.l #2,d1 ; turns into $20000 through swap + moveq.l #0,d0 + move.b wi_vol_attack_b(a3),d0 + bne.s .has_attack_volume + cmpi.b #$FF,wi_vol_sustain_b(a3) + beq .vol_envelope_finished + ; no attack but not full sustain -> go to delay + ;move.l #$100<<16,d3 + bra.s .vol_skip_attack + +.vol_avoid_overflow_with_1 + moveq.l #1,d1 + bra.s .cont_vol_envelope +.has_attack_volume + moveq.l #0,d3 + cmp.w #1,d0 + beq.s .cont_vol_envelope + cmp.w #2,d0 + beq.s .vol_avoid_overflow_with_1 + swap d1 ; turn into $20000 + divu d0,d1 + swap d1 + clr.w d1 + ; swap is done below +.cont_vol_envelope + swap d1 ; move to high word (should be max $20000 then) + btst #5,wi_flags_b(a3) ; vol fast flag + beq.s .vol_no_fast + lsl.l #4,d1 ; multiply speed by 16 +.vol_no_fast + add.l d1,d3 ; increase volume + cmpi.l #$FFFFFF,d3 + ble.s .vol_do_attack ; first step overshooting? +.vol_skip_attack + btst #3,wi_flags_b(a3) ; boost flag + bne.s .vol_delay_boosted + bra.s .vol_delay_normal + +.vol_do_attack + btst #3,wi_flags_b(a3) ; boost flag + bne.s .vol_attack_boosted + +; ---------------------------------------- +; attack phase with volume boosted +.vol_attack_normal +.vol_attack_normal_loop + move.b (a0),d0 + ext.w d0 + swap d3 + muls d3,d0 + swap d3 + asr.w #8,d0 + move.b d0,(a0)+ + + subq.w #1,d4 + bmi .vol_envelope_finished + add.l d1,d3 ; increase volume + cmpi.l #$FFFFFF,d3 + ble.s .vol_attack_normal_loop + +; ---------------------------------------- +; delay phase (normal) + +.vol_delay_normal ; moved this label two inst up, didn't make sense there + moveq.l #0,d0 + move.b wi_vol_delay_b(a3),d0 + lsl.w #4,d0 + + IFNE PRETRACKER_FASTER_CODE + ; skip the delay -- we don't change the volume for this section + addq.w #1,d0 + sub.w d0,d4 + bmi .vol_envelope_finished + lea 1(a0,d0.w),a0 + ELSE + lea 2(a0,d0.w),a1 + + move.w #$FF,d3 ; FIXME I don't think that this is quite right. Shouldn't the max volume NOT change the value? +.vol_delay_normal_loop + move.b (a0),d0 + IFNE 1 + ext.w d0 + muls d3,d0 + asr.w #8,d0 + ELSE + ; this should be the same as above (*(256-1)) + spl d3 + add.b d3,d0 + ENDC + move.b d0,(a0)+ + + cmpa.l a1,a0 + dbeq d4,.vol_delay_normal_loop + bne .vol_envelope_finished + ENDC + + bra.s .vol_delay_end_reached + +; ---------------------------------------- +; attack with volume boosted + +.vol_attack_boosted +.vol_attack_boosted_loop + move.b (a0),d0 + ext.w d0 + swap d3 + muls d3,d0 + swap d3 + asr.w #6,d0 + CLIPTO8BIT d0 + move.b d0,(a0)+ + + subq.w #1,d4 + bmi .vol_envelope_finished + add.l d1,d3 + cmpi.l #$FFFFFF,d3 + ble.s .vol_attack_boosted_loop + +; ---------------------------------------- +; delay with max volume boosted + +.vol_delay_boosted + moveq.l #0,d0 + move.b wi_vol_delay_b(a3),d0 + lsl.w #4,d0 + + lea 2(a0,d0.w),a1 + + IFNE PRETRACKER_FASTER_CODE +.vol_delay_boosted_loop + move.b (a0),d0 + add.b d0,d0 + CLIPTO8BITAFTERADD d0 + add.b d0,d0 + CLIPTO8BITAFTERADD d0 + ELSE + move.w #$FF,d3 ; FIXME I don't think that this is quite right. It should be $100 to boost by full volume +.vol_delay_boosted_loop + move.b (a0),d0 + ext.w d0 + muls d3,d0 + asr.w #6,d0 + CLIPTO8BIT d0 + ENDC + move.b d0,(a0)+ + + cmpa.l a1,a0 + dbeq d4,.vol_delay_boosted_loop + bne .vol_envelope_finished + +.vol_delay_end_reached + subq.w #1,d4 + +; ---------------------------------------- +; decay phase +; d0 = scratch +; d1 = current volume decrement +; d2 = table index boundary +; d3 = 16:16 decay pos +; d4 = sample length counter +; d5 = volume +; d6 = scratch +; d7 = decay increment +; a0 = sample pointer +; a1 = (current) roll off table pointer (points to upper bound) +; a2 = lower bound + +.vol_do_decay + moveq.l #0,d3 + move.b wi_vol_decay_b(a3),d3 + beq .vol_do_sustain + move.w d3,d7 + mulu d7,d7 + lsr.w #2,d7 + add.w d3,d7 ; d7 = (d3^2)/4+d3 (<= 16511) + + btst #5,wi_flags_b(a3) ; vol fast flag + beq.s .vol_decay_not_fast + moveq.l #0,d3 ; will cause a5=$400,a2=$200,d2=0, decay value has no effect on the ramp used +.vol_decay_not_fast + lsl.w #8,d3 + lsl.l #4,d3 + move.l d3,d2 + swap d2 + lea pre_roll_off_table(pc),a1 + add.w d2,d2 + adda.w d2,a1 + move.w (a1)+,a2 ; first index in table + lsr.w #1,d2 ; update next boundary + + moveq.l #0,d1 ; current volume decrement + moveq.l #0,d5 + not.w d5 ; set maximum volume +.vol_decay_normal_loop + add.l d7,d3 ; increment position in decay + swap d3 + + cmp.w #$8e,d3 ; pos in table where it makes no sense to do lerp anymore + bhi.s .vol_keep_voldec + cmp.w d2,d3 + bls.s .vol_do_lerp + +.vol_lerp_next_section + move.w (a1),a2 + IFNE PRETRACKER_BUGFIX_CODE + lea pre_roll_off_table+2(pc),a1 ; Take the right boundary value + ELSE + lea pre_roll_off_table(pc),a1 ; This will set a wrong boundary and thus plateau the slope decay speed + ENDC + add.w d3,a1 + add.w d3,a1 + + move.w d3,d2 ; update next boundary + +.vol_do_lerp ; ((lowerbound-upperbound)*(d3<<8))>>8 + upperbound + move.w a2,d1 + move.w (a1),d0 + sub.w d1,d0 ; delta between lower and upper bound (negative value) + beq.s .vol_skip_lerp + + swap d3 + move.w d3,d1 + lsr.w #8,d1 + muls d0,d1 + asr.l #8,d1 + add.w a2,d1 + swap d3 + +.vol_keep_voldec +.vol_skip_lerp + swap d3 + sub.w d1,d5 + bls.s .vol_do_sustain + + move.w d5,d6 + lsr.w #8,d6 + + cmp.b wi_vol_sustain_b(a3),d6 + bls.s .vol_do_sustain + + move.b (a0),d0 + ext.w d0 + muls d6,d0 + btst #3,wi_flags_b(a3) ; boost flag + CLIPORTRUNC8BIT d0 + move.b d0,(a0)+ + + dbra d4,.vol_decay_normal_loop + bra.s .vol_envelope_finished + +; ---------------------------------------- +; sustain phase +.vol_do_sustain + moveq.l #0,d3 + move.b wi_vol_sustain_b(a3),d3 + beq.s .vol_sustain_silence + + btst #3,wi_flags_b(a3) ; boost flag + beq.s .vol_sustain_normal +.vol_sustain_boosted +.vol_sustain_boosted_loop + move.b (a0),d0 + ext.w d0 + muls d3,d0 + asr.w #6,d0 + + CLIPTO8BIT d0 + move.b d0,(a0)+ + dbra d4,.vol_sustain_boosted_loop + bra.s .vol_envelope_finished + +.vol_sustain_silence + moveq.l #0,d0 +.vol_sustain_silence_loop + move.b d0,(a0)+ + dbra d4,.vol_sustain_silence_loop + bra.s .vol_envelope_finished + +.vol_sustain_normal + IFNE PRETRACKER_FASTER_CODE + cmp.b #$ff,d3 + beq.s .vol_envelope_finished + ENDC + +.vol_sustain_normal_loop + move.b (a0),d0 + ext.w d0 + muls d3,d0 + asr.w #8,d0 + move.b d0,(a0)+ + dbra d4,.vol_sustain_normal_loop + +.vol_envelope_finished + +; ---------------------------------------- +; Optional Post-Modulator + + btst #5,wi_mod_density_b(a3) ; post bit + beq.s .nopostmodulator + bsr pre_Modulator +.nopostmodulator + +; ---------------------------------------- +; wave mixing (removed some code here that was doing nothing as result +; because below higher octaves code would overwrite it anyway). + movea.l pv_my_song(a4),a6 + + moveq.l #0,d0 + move.b wi_mix_wave_b(a3),d0 + beq.s .mix_no_wave_mixing ; no mixing selected + subq.b #1,d0 + IFNE PRETRACKER_PARANOIA_MODE ; same wave for mixing cannot be selected in Pretracker + cmp.b pv_wg_curr_wave_num_b(a4),d0 + beq .mix_no_wave_mixing ; same wave number! + ENDC + + lsl.w #2,d0 + move.l pv_wave_sample_table(a4,d0.w),a1 + add.w #sv_wavelength_table,d0 + move.l (a6,d0.w),d3 + + move.w pv_wg_curr_sample_len_w(a4),d4 ; length of the sample to mix to + cmp.w d3,d4 + ble.s .mix_picked_shorter + move.w d3,d4 +.mix_picked_shorter + + move.l pv_wg_curr_sample_ptr(a4),a0 + + subq.w #1,d4 +.mix_mixloop + move.b (a0),d0 + add.b (a1)+,d0 + CLIPTO8BITAFTERADD d0 + move.b d0,(a0)+ + dbra d4,.mix_mixloop +.mix_no_wave_mixing + +; ---------------------------------------- +; create higher octaves (this has been massively shortened) + + btst #2,wi_flags_b(a3) + beq.s .oct_has_no_extra_octaves + + moveq.l #0,d4 + move.b wi_sam_len_b(a3),d4 ; length of the sample + IFNE PRETRACKER_PARANOIA_MODE + beq.s .oct_has_no_extra_octaves + ENDC + addq.w #1,d4 + lsl.w #7,d4 + + movea.l pv_wg_curr_sample_ptr(a4),a1 + lea (a1,d4.l),a0 ; needs to be .l due to 32678 max length + + mulu #7,d4 + lsr.l #3,d4 ; * 0.875 + subq.w #1,d4 +.oct_downsample_loop + move.b (a1),(a0)+ + addq.l #2,a1 + dbra d4,.oct_downsample_loop + +.oct_has_no_extra_octaves +; ---------------------------------------- + IFNE PRETRACKER_PROGRESS_SUPPORT + move.l pv_precalc_progress_ptr(a4),d0 + beq.s .no_progress_out + move.l d0,a0 + move.l pv_precalc_sample_size(a4),d0 + add.l d0,(a0) +.no_progress_out + ENDC + move.b sv_num_waves_b(a6),d0 + addq.b #1,pv_wg_wave_ord_num_w+1(a4) + cmp.b pv_wg_wave_ord_num_w+1(a4),d0 + bgt .wavegenloop + +; ---------------------------------------- + IFNE PRETRACKER_VOLUME_TABLE + lea pv_volume_table(a4),a0 + moveq.l #(MAX_VOLUME+1)-1,d7 + moveq.l #0,d0 +.vol_outerloop + moveq.l #MAX_VOLUME*2-1,d6 + moveq.l #0,d1 +.vol_innerloop + move.w d1,d2 + lsr.w #6,d2 + move.b d2,(a0)+ + add.w d0,d1 + dbra d6,.vol_innerloop + addq.w #1,d0 + dbra d7,.vol_outerloop + ENDC + +; ---------------------------------------- +.earlyexit + IFNE PRETRACKER_DONT_TRASH_REGS + movem.l (sp)+,d2-d7/a2-a6 + ENDC + rts + +;-------------------------------------------------------------------- +; a3: waveinfo +; +; d6: wetness (word) +; uses all data registers and a0-a2 (a3 unchanged) +pre_Modulator: + tst.b wi_mod_wetness_b(a3) + beq.s .earlyexit + moveq.l #7,d0 + and.b wi_mod_density_b(a3),d0 + bne.s .has_density +.earlyexit + rts +.has_density + move.l pv_wg_curr_sample_ptr(a4),a0 + move.w pv_wg_curr_sample_len_w(a4),d4 + IFNE PRETRACKER_PARANOIA_MODE + bne.s .not_zero + rts +.not_zero + ENDC + moveq.l #0,d6 + move.b wi_mod_wetness_b(a3),d6 + + moveq.l #0,d7 + + lea pre_modulator_ramp_8(pc),a1 + lea pre_ramp_up_down_32(pc),a2 +.loop moveq.l #0,d5 + move.b wi_mod_length_b(a3),d5 + mulu (a1)+,d5 ; result is a long value + + moveq.l #0,d1 + move.b wi_mod_predelay_b(a3),d1 + + btst #5,wi_mod_density_b(a3) ; post-modulator? + bne.s .factor1_256 + ; factor 1/4 and 64 + lsr.l #2,d5 + lsl.l #6,d1 + bra.s .cont + +.factor1_256 + lsl.w #8,d1 +.cont add.l d1,d5 ; sum up length and predelay + + moveq.l #0,d2 + moveq.l #0,d3 + +.innerloop + add.w d7,d3 + addq.w #8,d3 + moveq.l #0,d1 + move.w d3,d1 + lsr.w #8,d1 + lsr.w #3,d1 + add.w d1,d1 + move.w (a2,d1.w),d1 ; 4 bit value + add.l d5,d1 + lsr.l #6,d1 + + move.w d2,d0 + sub.w d1,d0 + bmi.s .isneg + + move.b (a0,d0.w),d1 + ext.w d1 + btst #0,d7 + beq.s .keep_dc + neg.w d1 +.keep_dc + + muls d6,d1 + asr.w #8,d1 + add.b (a0,d2.w),d1 + + CLIPTO8BITAFTERADD d1 + move.b d1,(a0,d2.w) +.isneg + addq.w #1,d2 + cmp.w d4,d2 + bcs.s .innerloop + +.restartloop + addq.w #1,d7 + moveq.l #7,d0 + and.b wi_mod_density_b(a3),d0 + cmp.w d0,d7 + bcs.s .loop + rts + +;-------------------------------------------------------------------- + +pre_MemClr + lsr.w #1,d0 + subq.w #1,d0 + bmi.s .skipmemclr + moveq.l #0,d1 +.fillmemloop + move.w d1,(a0)+ + dbra d0,.fillmemloop +.skipmemclr + rts + +;******************************************************************** +;-------------------------------------------------------------------- +; PlayerTick - Play one frame of music (called every VBL) +; +; In: +; - a0: MyPlayer +; - a1: copperlist (if enabled) +;******************************************************************** +pre_PlayerTick: + IFNE PRETRACKER_DONT_TRASH_REGS + movem.l d2-d7/a2-a6,-(sp) + ENDC + move.l a0,a4 + IFNE PRETRACKER_COPPER_OUTPUT + move.l a1,pv_copperlist_ptr(a4) + ENDC + movea.l pv_my_song(a4),a6 + tst.b pv_pat_stopped_b(a4) + beq .inst_pattern_processing ; don't process if music has been stopped + +; ---------------------------------------- +; processes the current pattern position +; registers used: +; d0: pitch shift (lower part) +; d1: scratch +; d2: effect cmd +; d3: pitch_ctrl +; d4: inst number +; d5: effect cmd +; d6: unused (flag later) +; d7: pitch +; a0: pattern data pointer +; a1: short-term scratch +; a2: unused +; a3: unused +; a4: pv +; a5: channel struct +; a6: mysong struct +.process_pattern + lea pv_channeldata(a4),a5 ; start with first channel +.pre_pat_chan_loop + IFNE PRETRACKER_PARANOIA_MODE + ; I think this is something leftover from the tracker itself. + ; Nothing sets pcd_pat_adsr_rel_delay_b from inside the player. + ; It is used as a counter to release a note (ADSR) after a given time. + ; It's not the same as the instrument ADSR release (see pcd_note_off_delay_b) + move.b pcd_pat_adsr_rel_delay_b(a5),d1 + ble.s .handle_2nd_instrument + subq.b #1,d1 + move.b d1,pcd_pat_adsr_rel_delay_b(a5) + bne.s .handle_2nd_instrument + + move.w pcd_adsr_volume_w(a5),d3 + lsr.w #6,d3 + move.w d3,pcd_adsr_vol64_w(a5) + moveq.l #16,d4 + move.w d4,pcd_adsr_pos_w(a5) + sub.w d3,d4 + lsr.w #1,d4 + add.b pcd_adsr_release_b(a5),d4 + move.b d4,pcd_adsr_phase_speed_b(a5) + move.w #3,pcd_adsr_phase_w(a5) + ENDC + +; ---------------------------------------- +.handle_2nd_instrument + moveq.l #0,d1 + move.b pcd_pat_2nd_inst_num4_b(a5),d1 + beq.s .handle_current_instrument + + move.b pcd_pat_2nd_inst_delay_b(a5),d3 + beq.s .trigger_2nd_instrument + subq.b #1,d3 + move.b d3,pcd_pat_2nd_inst_delay_b(a5) + bra.s .handle_current_instrument + +.trigger_2nd_instrument + move.b d1,pcd_new_inst_num_b(a5) + move.w d1,pcd_inst_num4_w(a5) + add.w d1,d1 + add.w d1,d1 + lea sv_inst_infos_table-uii_SIZEOF(a6),a1 + add.w d1,a1 + move.l a1,pcd_inst_info_ptr(a5) ; loads 2nd instrument + move.b uii_pattern_steps(a1),pcd_inst_pattern_steps_b(a5) + + moveq.l #0,d1 + move.l a5,a1 + move.l d1,(a1)+ ; pcd_pat_portamento_dest_w and pcd_pat_pitch_slide_w + move.l d1,(a1)+ ; pcd_pat_vol_ramp_speed_b, pcd_pat_2nd_inst_num4_b, pcd_pat_2nd_inst_delay_b, pcd_wave_offset_b + move.l d1,(a1)+ ; pcd_inst_pitch_slide_w and pcd_inst_sel_arp_note_w + move.w d1,(a1)+ ; pcd_inst_note_pitch_w + addq.w #2,a1 + + move.l d1,(a1)+ ; pcd_inst_line_ticks_b, pcd_inst_pitch_pinned_b, pcd_inst_vol_slide_b, pcd_inst_step_pos_b + + subq.b #1,d1 + move.w d1,(a1)+ ; pcd_inst_wave_num_w + + move.l #$ff010010,(a1)+ ; pcd_track_delay_offset_b, pcd_inst_speed_stop_b, pcd_inst_pitch_w + move.l #(MAX_VOLUME<<16)|(MAX_VOLUME<<8)|MAX_VOLUME,(a1)+ ; pcd_inst_vol_w / pcd_loaded_inst_vol_b / pcd_pat_vol_b + + bra.s .continue_with_inst + +; ---------------------------------------- +.handle_current_instrument + +; ---------------------------------------- +; handle portamento + move.w pcd_pat_portamento_dest_w(a5),d3 + beq.s .no_portamento_active + move.w pcd_inst_curr_port_pitch_w(a5),d2 + moveq.l #0,d1 + move.b pcd_pat_portamento_speed_b(a5),d1 + cmp.w d3,d2 + bge.s .do_portamento_down + add.w d1,d2 + cmp.w d3,d2 + bgt.s .portamento_note_reached + bra.s .update_portamento_value + +.do_portamento_down + sub.w d1,d2 + cmp.w d3,d2 + bge.s .update_portamento_value + +.portamento_note_reached + clr.w pcd_pat_portamento_dest_w(a5) + move.w d3,d2 +.update_portamento_value + move.w d2,pcd_inst_curr_port_pitch_w(a5) +.no_portamento_active + +; ---------------------------------------- +; handle volume ramping + move.b pcd_pat_vol_ramp_speed_b(a5),d1 + beq.s .no_vol_ramping_active + add.b pcd_pat_vol_b(a5),d1 + bpl.s .noclip_pat_vol_min + moveq.l #0,d1 +.noclip_pat_vol_min + cmpi.b #MAX_VOLUME,d1 + ble.s .noclip_pat_vol_max + moveq.l #MAX_VOLUME,d1 +.noclip_pat_vol_max + move.b d1,pcd_pat_vol_b(a5) +.no_vol_ramping_active + +; ---------------------------------------- +; enters with channel number in d0 + +.continue_with_inst + ; handle delayed note and note off first + moveq.l #0,d4 + move.b pcd_note_delay_b(a5),d4 + blt .pat_play_cont + beq.s .no_note_delay + subq.b #1,d4 + beq.s .note_delay_end_reached + + move.b d4,pcd_note_delay_b(a5) ; note still delayed + IFNE PRETRACKER_BUGFIX_CODE + bra .pat_play_cont ; I believe that with activated track delay, we must jump here + ELSE + bra .pat_channels_loop_test + ENDC + +.note_delay_end_reached + st pcd_note_delay_b(a5) ; release note delay +.no_note_delay + moveq.l #0,d5 + move.b pcd_channel_num_b(a5),d5 + move.w sv_curr_pat_pos_w(a6),d2 + add.w d2,d2 + add.w d2,d2 ; *4 + add.w d5,d2 + add.w d2,d2 ; 8*pos+2*chan + movea.l sv_pos_data_adr(a6),a1 + adda.w d2,a1 + ;move.l a1,d2 + ;cmpa.w #0,a1 + ;beq .pat_play_other ; this is probably never happening! + moveq.l #0,d2 + move.b pv_pat_curr_row_b(a4),d2 + cmp.b sv_num_steps_b(a6),d2 + bcc .pat_play_cont + + move.b ppd_pat_num(a1),d5 + beq .pat_play_cont + add.w d5,d5 + add.w d5,d5 + add.w #sv_pattern_table,d5 + move.l -4(a6,d5.w),a0 + IFNE PRETRACKER_PARANOIA_MODE + move.l a0,d5 ; move to data register due to cc's + beq .pat_play_cont + ENDC + + move.b ppd_pat_shift(a1),d0 ; pattern pitch shift (signed) + ext.w d0 + + add.w d2,a0 + add.w d2,d2 + add.w d2,a0 ; pattern data + + moveq.l #15,d2 + move.b pdb_inst_effect(a0),d4 ; instrument and command byte + and.w d4,d2 + lsr.w #4,d4 ; instrument nr bits 0-4 + + moveq.l #0,d5 + move.b pdb_effect_data(a0),d5 + + cmpi.b #$e,d2 + bne.s .pat_exy_cmd_cont + ; handle $exy commands + tst.b pcd_note_delay_b(a5) + bne.s .pat_exy_cmd_cont ; ignore if already running note delay + move.l d5,d3 + moveq.l #15,d1 + and.w d3,d1 + lsr.w #4,d3 + sub.w #$d,d3 + bne.s .pat_is_not_ed_cmd + ; note delay in x sub steps + IFNE PRETRACKER_PARANOIA_MODE ; who does this kind of stuff? + tst.b pv_pat_speed_even_b(a4) + beq.s .pat_exy_cmd_cont + ENDC + move.b d1,pcd_note_delay_b(a5) + IFNE PRETRACKER_BUGFIX_CODE + bra .pat_play_cont ; I believe that with activated track delay, we must jump here + ELSE + bra .pat_channels_loop_test + ENDC + +.pat_is_not_ed_cmd + addq.b #$d-$a,d3 + bne.s .pat_exy_cmd_cont + ; note off in x sub steps + move.b d1,pcd_note_off_delay_b(a5) + +.pat_exy_cmd_cont + st pcd_note_delay_b(a5) + +; ---------------------------------------- +; read out pattern editor data + + moveq.l #0,d6 ; clear arp flag + move.b pdb_pitch_ctrl(a0),d3 ; pitch and control byte + bpl.s .noselinst16plus + add.w #16,d4 ; add high bit of instrument number +.noselinst16plus + moveq.l #$3f,d7 + and.w d3,d7 ; pitch + add.w d4,d4 + add.w d4,d4 + beq.s .no_new_note ; if no instrument + tst.w d7 + bne.s .no_new_note ; if it has pitch + + ; only change of instrument, not pitch + move.b pcd_loaded_inst_vol_b(a5),pcd_pat_vol_b(a5) + + cmp.w pcd_inst_num4_w(a5),d4 + bne.s .no_new_note + ; attack! + move.l d6,pcd_adsr_phase_w(a5) ; and pcd_adsr_volume_w + ;clr.w pcd_adsr_volume_w(a5) + ;move.b #1,pcd_adsr_trigger_b(a5) ; never read + +.no_new_note + +; d2 = effect cmd, d3 = pitch_ctrl, d4 = inst number, d5 = effect data, d7 = pitch + + andi.b #$40,d3 ; ARP bit + bne.s .has_arp_note +.no_arp_note + tst.b d2 + bne.s .arp_processing_done + ; 0xx: play second instrument + tst.b d5 + beq.s .no_effect + moveq.l #15,d1 ; FIXME seems like it only supports the lower 15 instruments + and.b d5,d1 + add.w d1,d1 + add.w d1,d1 + + tst.b d7 + bne.s .play_2nd_inst_without_trigger + +.play_2nd_inst_with_no_pitch + addq.w #1,d0 ; pattern pitch shift + lsl.w #4,d0 + + tst.b d1 + beq.s .clear_note_arp + + moveq.l #0,d2 + move.w d4,d3 + move.w d1,d4 + bra.s .trigger_new_instrument + +.play_2nd_inst_without_trigger + move.w d4,d3 ; 1st instrument num + move.w d1,d4 ; 2nd instrument num + bra.s .arp_processing_done + +.clear_note_arp + clr.l pcd_arp_notes_l(a5) + move.b d7,d2 + move.b d4,d3 + bra .clear_portamento + +.has_arp_note + move.b d2,d3 + or.b d5,d3 + beq.s .all_arp_notes_zero ; if we go there, d3 MUST be 0 already + + move.b d2,pcd_arp_note_1_b(a5) + + move.b d5,d2 + lsr.b #4,d2 + move.b d2,pcd_arp_note_2_b(a5) + + moveq.l #15,d2 + and.b d5,d2 + move.b d2,pcd_arp_note_3_b(a5) + +.all_arp_notes_zero + moveq.l #1,d6 +.no_effect + moveq.l #0,d2 ; make sure we don't get a random command here + moveq.l #0,d3 + +; ---------------------------------------- +; d2 = effect cmd, d3 = alt inst number (or 0), d4 = inst number, d5 = effect cmd, d6 = ARP flag, d7 = pitch + +.arp_processing_done + cmpi.b #NOTE_OFF_PITCH,d7 + bne.s .has_no_note_off + +.release_note + ; release note + ; FIXME we have the identical code (different regs) three times (one is inactive) + move.w pcd_adsr_volume_w(a5),d4 + asr.w #6,d4 + move.w d4,pcd_adsr_vol64_w(a5) + moveq.l #16,d7 + move.w d7,pcd_adsr_pos_w(a5) + sub.w d4,d7 + lsr.w #1,d7 + add.b pcd_adsr_release_b(a5),d7 + move.b d7,pcd_adsr_phase_speed_b(a5) + move.w #3,pcd_adsr_phase_w(a5) + bra .start_patt_effect_handling + +.has_inst_number + add.w d7,d0 ; pattern pitch shift? + lsl.w #4,d0 + + cmpi.b #3,d2 ; is command portamento? + beq.s .pat_set_portamento + +.trigger_new_instrument + move.w d4,d1 + + move.b d1,pcd_new_inst_num_b(a5) + move.w d1,pcd_inst_num4_w(a5) + add.w d1,d1 + add.w d1,d1 + lea sv_inst_infos_table-uii_SIZEOF(a6),a1 + add.w d1,a1 + move.l a1,pcd_inst_info_ptr(a5) + move.b uii_pattern_steps(a1),pcd_inst_pattern_steps_b(a5) + + moveq.l #0,d1 + move.l a5,a1 + move.l d1,(a1)+ ; pcd_pat_portamento_dest_w and pcd_pat_pitch_slide_w + move.l d1,(a1)+ ; pcd_pat_vol_ramp_speed_b, pcd_pat_2nd_inst_num4_b, pcd_pat_2nd_inst_delay_b, pcd_wave_offset_b + move.l d1,(a1)+ ; pcd_inst_pitch_slide_w and pcd_inst_sel_arp_note_w + move.l d1,(a1)+ ; pcd_inst_note_pitch_w and pcd_inst_curr_port_pitch_w + + move.l d1,(a1)+ ; pcd_inst_line_ticks_b, pcd_inst_pitch_pinned_b, pcd_inst_vol_slide_b, pcd_inst_step_pos_b + + subq.b #1,d1 + move.w d1,(a1)+ ; pcd_inst_wave_num_w + + move.l #$ff010010,(a1)+ ; pcd_track_delay_offset_b, pcd_inst_speed_stop_b, pcd_inst_pitch_w + move.l #(MAX_VOLUME<<16)|(MAX_VOLUME<<8)|MAX_VOLUME,(a1)+ ; pcd_inst_vol_w / pcd_loaded_inst_vol_b / pcd_pat_vol_b + + bra.s .cont_after_inst_trigger + +.has_no_note_off + tst.b d7 + beq.s .start_patt_effect_handling + tst.b d4 + bne.s .has_inst_number + + add.w d7,d0 ; pattern pitch shift + lsl.w #4,d0 + +.cont_after_inst_trigger + tst.b d6 ; has ARP? + bne.s .lbC001852 + bra.s .lbC00193C + +.pat_set_portamento + tst.b d6 + bne.s .pat_new_portamento +.lbC00193C + clr.l pcd_arp_notes_l(a5) + moveq.l #0,d6 + +.lbC001852 + cmpi.b #3,d2 ; is command portamento? + beq.s .pat_new_portamento + +.clear_portamento + move.w #$10,pcd_inst_pitch_w(a5) + move.w d0,pcd_inst_curr_port_pitch_w(a5) + clr.w pcd_pat_portamento_dest_w(a5) + bra.s .start_patt_effect_handling + +.pat_new_portamento + add.w #$10,d0 ; pattern pitch shift + move.w d0,pcd_pat_portamento_dest_w(a5) + + move.w pcd_inst_pitch_w(a5),d1 + add.w d1,pcd_inst_curr_port_pitch_w(a5) + clr.w pcd_inst_pitch_w(a5) + tst.b d5 + beq.s .pat_keep_old_portamento + move.b d5,pcd_pat_portamento_speed_b(a5) +.pat_keep_old_portamento + +; ---------------------------------------- +.start_patt_effect_handling + ; FIXME can we move this code to avoid blocking the two registers d3/d5 + tst.b d3 + beq.s .has_no_second_inst + move.b d3,pcd_pat_2nd_inst_num4_b(a5) + move.b d5,d3 + lsr.b #4,d3 + move.b d3,pcd_pat_2nd_inst_delay_b(a5) + +.has_no_second_inst + clr.b pcd_pat_vol_ramp_speed_b(a5) + clr.w pcd_pat_pitch_slide_w(a5) + tst.b d6 + bne .pat_play_cont + add.w d2,d2 + move.w .pattern_command_jmptable(pc,d2.w),d2 + jmp .pattern_command_jmptable(pc,d2.w) + +.pattern_command_jmptable + dc.w .pat_play_nop-.pattern_command_jmptable + dc.w .pat_slide_up-.pattern_command_jmptable + dc.w .pat_slide_down-.pattern_command_jmptable + dc.w .pat_play_nop-.pattern_command_jmptable + dc.w .pat_set_vibrato-.pattern_command_jmptable + dc.w .pat_set_track_delay-.pattern_command_jmptable + dc.w .pat_play_nop-.pattern_command_jmptable + dc.w .pat_play_nop-.pattern_command_jmptable + dc.w .pat_play_nop-.pattern_command_jmptable + dc.w .pat_set_wave_offset-.pattern_command_jmptable + dc.w .pat_volume_ramp-.pattern_command_jmptable + dc.w .pat_pos_jump-.pattern_command_jmptable + dc.w .pat_set_volume-.pattern_command_jmptable + dc.w .pat_pat_break-.pattern_command_jmptable + dc.w .pat_play_nop-.pattern_command_jmptable + dc.w .pat_set_speed-.pattern_command_jmptable + +; d5 = command parameter data +; ---------------------------------------- +.pat_set_speed + lea pv_pat_speed_even_b(a4),a1 + cmpi.b #MAX_SPEED,d5 + bhs.s .pat_set_speed_shuffle + move.b d5,(a1)+ ; pv_pat_speed_even_b + move.b d5,(a1)+ ; pv_pat_speed_odd_b + move.b d5,(a1)+ ; pv_pat_line_ticks_b + sne (a1)+ ; pv_pat_stopped_b + IFNE PRETRACKER_SONG_END_DETECTION + seq (a1)+ ; pv_songend_detected_b + ENDC + bra .pat_play_cont +.pat_set_speed_shuffle + moveq.l #15,d2 + and.w d5,d2 ; odd speed + lsr.w #4,d5 ; even speed + move.b d5,(a1)+ ; pv_pat_speed_even_b + move.b d2,(a1)+ ; pv_pat_speed_odd_b + btst #0,pv_pat_curr_row_b(a4) + beq.s .pat_shuffle_on_even + move.b d2,d5 ; toggle speed to odd row +.pat_shuffle_on_even + move.b d5,(a1)+ ; pv_pat_line_ticks_b + bra .pat_play_cont + +; ---------------------------------------- +.pat_set_vibrato + clr.w pcd_vibrato_pos_w(a5) + move.w #1,pcd_vibrato_delay_w(a5) + moveq.l #15,d2 + and.w d5,d2 + + lea pre_vib_depth_table(pc),a1 + move.b (a1,d2.w),pcd_vibrato_depth_w+1(a5) + lsr.b #4,d5 + move.b pre_vib_speed_table-pre_vib_depth_table(a1,d5.w),d2 + muls pcd_vibrato_depth_w(a5),d2 + asr.w #4,d2 + move.w d2,pcd_vibrato_speed_w(a5) + bra.s .pat_play_cont + +; ---------------------------------------- +.pat_set_track_delay + cmp.b #NUM_CHANNELS-1,pcd_channel_num_b(a5) + beq.s .pat_play_cont ; we are at channel 3 -- track delay not available here + + lea pcd_SIZEOF+pcd_track_delay_buffer+ocd_volume(a5),a1 + moveq.l #MAX_TRACK_DELAY-1,d2 +.clr_track_delay_buffer_loop + clr.b (a1) ; ocd_volume + lea ocd_SIZEOF(a1),a1 + dbra d2,.clr_track_delay_buffer_loop + + tst.b d5 + bne.s .pat_track_delay_set + st pcd_track_delay_steps_b(a5) + bra.s .handle_track_delay + +; ---------------------------------------- +.pat_volume_ramp + tst.b d5 + beq.s .pat_play_cont + moveq.l #15,d3 + and.b d5,d3 + beq.s .pat_vol_ramp_up + ; NOTE: Changed behaviour: using d3 instead of d5 + ; if both lower and upper were specified, this + ; probably led to a drastic decrease of volume. + neg.b d3 + move.b d3,pcd_pat_vol_ramp_speed_b(a5) + bra.s .pat_play_cont +.pat_vol_ramp_up + lsr.b #4,d5 + move.b d5,pcd_pat_vol_ramp_speed_b(a5) + bra.s .pat_play_cont + +.pat_track_delay_set + moveq.l #15,d2 + and.b d5,d2 + add.b d2,d2 + move.b d2,pcd_track_delay_steps_b(a5) +; subq.b #1,d2 +; move.b d2,pcd_SIZEOF+pcd_track_init_delay_b(a5) + lsr.b #4,d5 + move.b d5,pcd_track_delay_vol16_b(a5) + bra.s .pat_play_cont + +; ---------------------------------------- +.pat_slide_down + neg.w d5 +.pat_slide_up + move.w d5,pcd_pat_pitch_slide_w(a5) + bra.s .pat_play_cont + +; ---------------------------------------- +.pat_set_wave_offset + move.b d5,pcd_wave_offset_b(a5) + bra.s .pat_play_cont + +; ---------------------------------------- +.pat_pos_jump + move.b d5,pv_next_pat_pos_b(a4) + bra.s .pat_play_cont + +; ---------------------------------------- +.pat_pat_break + move.b d5,pv_next_pat_row_b(a4) + bra.s .pat_play_cont + +; ---------------------------------------- +.pat_set_volume + cmpi.b #MAX_VOLUME,d5 + bls.s .pat_set_volume_nomax + moveq.l #MAX_VOLUME,d5 +.pat_set_volume_nomax + move.b d5,pcd_pat_vol_b(a5) + +; ---------------------------------------- + +.pat_play_nop +.pat_play_cont + move.b pcd_track_delay_steps_b(a5),d2 ; FIXME this is a mess + beq.s .pat_channels_loop_test + +.handle_track_delay + lea pcd_SIZEOF(a5),a5 + cmp.b #NUM_CHANNELS-2,pcd_channel_num_b-pcd_SIZEOF(a5) ; FIXME find out why we need this + bge.s .pat_channels_loop_end + +.pat_channels_loop_test + lea pcd_SIZEOF(a5),a5 + cmp.b #NUM_CHANNELS-1,pcd_channel_num_b-pcd_SIZEOF(a5) + bne .pre_pat_chan_loop +.pat_channels_loop_end + +; end of pattern loop + +; ---------------------------------------- +; Pattern advancing and pattern break and jump handling. Song looping and song-end detection. +.pattern_advancing + subq.b #1,pv_pat_line_ticks_b(a4) + bne .no_pattern_advance + + ; clear note delay info + moveq.l #0,d0 + REPT NUM_CHANNELS + move.b d0,pv_channeldata+pcd_note_delay_b+REPTN*pcd_SIZEOF(a4) + ENDR + + move.b sv_num_steps_b(a6),d1 ; number of steps in pattern + + move.b pv_pat_curr_row_b(a4),d0 + addq.b #1,d0 ; normal step increment + + move.w sv_curr_pat_pos_w(a6),d3 ; current song position + + move.b pv_next_pat_row_b(a4),d2 ; $ff means no pattern break + bmi.s .no_pattern_break + st pv_next_pat_row_b(a4) ; processed break, set to $ff + move.b d2,d0 + IFNE 0 ; PRETRACKER_BUGFIX_CODE ; currently disabled to keep old behaviour + moveq.l #0,d2 ; clear mask + ENDC + cmp.b d1,d0 + blo.s .has_legal_break_pos + move.b d1,d0 ; limit to last step + subq.b #1,d0 + bra.s .has_legal_break_pos + +.no_pattern_break + cmp.b d1,d0 + blo.s .pattern_end_not_reached + moveq.l #0,d0 + IFNE PRETRACKER_PARANOIA_MODE + move.b pv_loop_pattern_b(a4),d0 ; keep same pattern rolling? + bne.s .pattern_end_not_reached + ENDC +.has_legal_break_pos + addq.w #1,d3 ; pattern break will increment song pos -- if there is no new pattern position + +.pattern_end_not_reached + move.b pv_next_pat_pos_b(a4),d4 + bmi.s .no_new_position ; has a new pattern position + st pv_next_pat_pos_b(a4) + IFNE PRETRACKER_SONG_END_DETECTION + cmp.b d4,d3 + bgt.s .no_backjump + st pv_songend_detected_b(a4) ; detect jumping back +.no_backjump + ENDC + move.b d4,d3 ; load new position + IFNE 0 ; PRETRACKER_BUGFIX_CODE ; currently disabled to keep old behaviour + not.b d2 + and.b d2,d0 ; if we had NO pattern break, we will clear d0 + ELSE + moveq.l #0,d0 + ENDC +.no_new_position + + cmp.w sv_pat_pos_len_w(a6),d3 + blt.s .no_restart_song + move.w sv_pat_restart_pos_w(a6),d3 + IFNE PRETRACKER_SONG_END_DETECTION + st pv_songend_detected_b(a4) + ENDC +.no_restart_song + move.b d0,pv_pat_curr_row_b(a4) + move.w d3,sv_curr_pat_pos_w(a6) + + move.b pv_pat_speed_even_b(a4),d1 + lsr.b #1,d0 + bcc.s .set_speed_even + move.b pv_pat_speed_odd_b(a4),d1 +.set_speed_even + move.b d1,pv_pat_line_ticks_b(a4) +.no_pattern_advance + +; ---------------------------------------- +; processes the instrument pattern for each running instrument +; registers used: +; d0: pitch +; d1: volume +; d2: inst num +; d3: scratch +; a0: pattern data pointer +; a1: scratch +; a2: instrument info +; a3: wave info +; a4: pv +; a5: channel struct +; a6: mysong struct + +.inst_pattern_processing + lea pv_channeldata(a4),a5 + +.inst_chan_loop + move.l pcd_waveinfo_ptr(a5),a3 + + move.l pcd_inst_info_ptr(a5),a2 + move.l a2,d3 + beq .inst_no_inst_active + + ; calculate pitch -- funny that there is no min check (seems to happen later though) + move.w pcd_inst_pitch_slide_w(a5),d0 + add.w pcd_pat_pitch_slide_w(a5),d0 + beq.s .inst_no_pitch_slides_active + add.w pcd_inst_pitch_w(a5),d0 + cmp.w #(3*NOTES_IN_OCTAVE)<<4,d0 + ble.s .inst_noclip_pitch_max + move.w #(3*NOTES_IN_OCTAVE)<<4,d0 +.inst_noclip_pitch_max + move.w d0,pcd_inst_pitch_w(a5) +.inst_no_pitch_slides_active + + move.b pcd_inst_vol_slide_b(a5),d1 + beq.s .inst_no_vol_slide_active + add.b pcd_inst_vol_w+1(a5),d1 + bpl.s .inst_noclip_vol_zero + moveq.l #0,d1 +.inst_noclip_vol_zero + cmp.b #MAX_VOLUME,d1 + ble.s .inst_noclip_vol_max + moveq.l #MAX_VOLUME,d1 +.inst_noclip_vol_max + move.b d1,pcd_inst_vol_w+1(a5) + +.inst_no_vol_slide_active + move.b pcd_inst_line_ticks_b(a5),d2 + bne .inst_still_ticking + + moveq.l #0,d0 + move.w d0,pcd_inst_pitch_slide_w(a5) + move.b d0,pcd_inst_vol_slide_b(a5) + +; IFNE PRETRACKER_PARANOIA_MODE ; new step is never written +; move.w pcd_inst_new_step_w(a5),d1 +; blt.s .inst_no_new_step_pos +; cmpi.w #$20,d1 +; ble.s .inst_good_new_step_pos +; moveq.l #$20,d1 +;.inst_good_new_step_pos +; move.b d1,pcd_inst_step_pos_b(a5) +; move.w #$ffff,pcd_inst_new_step_w(a5) +;.inst_no_new_step_pos +; ENDC + move.b pcd_inst_step_pos_b(a5),d0 + cmp.b pcd_inst_pattern_steps_b(a5),d0 + bhs .inst_pat_loop_exit + + moveq.l #-1,d4 + moveq.l #0,d7 + moveq.l #0,d3 ; flag for stitching -- if set, must not trigger new note + ; enters with d4 = -1, meaning no first note pos yet + + move.w pcd_inst_num4_w(a5),d1 + movea.l sv_inst_patterns_table-4(a6,d1.w),a0 + + add.w d0,a0 + add.w d0,a0 + add.w d0,a0 + +.inst_pat_loop + IFNE PRETRACKER_PARANOIA_MODE + moveq.l #0,d2 ; default to not stitched + move.b (a0)+,d1 ; pdb_pitch_ctrl get pitch byte + move.b d1,d6 + bpl.s .inst_note_is_not_stitched ; means that note is stitched + + tst.w d4 + bpl.s .inst_no_update_first_note + move.w d0,d4 ; position of first note before stitching +.inst_no_update_first_note + moveq.l #1,d2 ; next note will be fetched immediately +.inst_note_is_not_stitched + ELSE + move.b (a0)+,d1 ; pdb_pitch_ctrl get pitch byte + move.b d1,d6 + smi d2 ; note stitched? + ;neg.b d2 + ENDC + + tst.b d3 + bne.s .skippitchloading + andi.w #$3F,d1 + beq.s .skippitchloading ; no new note + subq.w #1,d1 + lsl.w #4,d1 + move.w d1,pcd_inst_note_pitch_w(a5) + and.w #1<<6,d6 + sne pcd_inst_pitch_pinned_b(a5) + IFEQ PRETRACKER_FASTER_CODE + neg.b pcd_inst_pitch_pinned_b(a5) ; only to be state binary compatible + ENDC +.skippitchloading + moveq.l #15,d6 + and.b (a0)+,d6 ; pdb_effect_cmd command number + add.w d6,d6 + moveq.l #0,d5 + move.b (a0)+,d5 ; pdb_effect_data command parameter byte + move.w .inst_command_jmptable(pc,d6.w),d3 + jmp .inst_command_jmptable(pc,d3.w) + +.inst_command_jmptable + dc.w .inst_select_wave-.inst_command_jmptable + dc.w .inst_slide_up-.inst_command_jmptable + dc.w .inst_slide_down-.inst_command_jmptable + dc.w .inst_adsr-.inst_command_jmptable + dc.w .inst_select_wave-.inst_command_jmptable + dc.w .inst_nop-.inst_command_jmptable + dc.w .inst_nop-.inst_command_jmptable + dc.w .inst_nop-.inst_command_jmptable + dc.w .inst_nop-.inst_command_jmptable + dc.w .inst_nop-.inst_command_jmptable + dc.w .inst_vol_slide-.inst_command_jmptable + dc.w .inst_jump_to_step-.inst_command_jmptable + dc.w .inst_set_volume-.inst_command_jmptable + dc.w .inst_nop-.inst_command_jmptable + dc.w .inst_use_pat_arp-.inst_command_jmptable + dc.w .inst_set_speed-.inst_command_jmptable + +; d0 = current step / next step +; d5 = command parameter data / scratch +; d2 = note stitched flag +; d6 = scratch +; ---------------------------------------- +.inst_select_wave + subq.w #1,d5 + cmp.w #MAX_WAVES,d5 + bhs .inst_cmd_cont_next + add.w d5,d5 + add.w d5,d5 + cmp.w pcd_inst_wave_num_w(a5),d5 + beq .inst_cmd_cont_next + move.w d5,pcd_inst_wave_num_w(a5) + move.l sv_waveinfo_table(a6,d5.w),a3 + move.l a3,pcd_waveinfo_ptr(a5) + + move.b pcd_channel_mask_b(a5),d3 + move.b d3,pcd_out_trg_b(a5) + or.b d3,pv_trigger_mask_w+1(a4) + + move.l pv_wave_sample_table(a4,d5.w),a1 + tst.w d6 + bne.s .inst_select_wave_nosync + + moveq.l #0,d3 + move.w wi_loop_offset_w(a3),d6 ; is unlikely 32768 + move.w wi_subloop_len_w(a3),d5 + bne.s .inst_set_wave_has_subloop + + adda.w d6,a1 ; add loop offset + + move.w wi_chipram_w(a3),d5 + sub.w d6,d5 + ;cmp.w #1,d5 ; not necessary as increases in steps of 2 + bhi.s .inst_set_wave_has_min_length + moveq.l #2,d5 +.inst_set_wave_has_min_length + move.w d5,pcd_out_len_w(a5) + + moveq.l #-1,d3 +.inst_set_wave_has_subloop + move.w d3,pcd_out_lof_w(a5) + move.l a1,pcd_out_ptr_l(a5) + + st pcd_inst_ping_pong_dir_b(a5) + moveq.l #0,d5 + move.b wi_subloop_wait_b(a3),d5 + addq.w #1,d5 + move.w d5,pcd_inst_subloop_wait_w(a5) + + move.w d6,pcd_inst_loop_offset_w(a5) + bra .inst_cmd_cont_next + +; ---------------------------------------- +.inst_select_wave_nosync + move.w wi_chipram_w(a3),d5 + moveq.l #0,d3 + tst.w wi_subloop_len_w(a3) + bne.s .inst_set_wave_ns_has_subloop + + move.w wi_loop_offset_w(a3),d6 + adda.w d6,a1 + + sub.w d6,d5 + ;cmp.w #1,d5 ; not necessary as increases in steps of 2 + bhi.s .inst_set_wave_ns_has_min_length + moveq.l #2,d5 +.inst_set_wave_ns_has_min_length + move.w d5,pcd_out_len_w(a5) + + moveq.l #-1,d3 +.inst_set_wave_ns_has_subloop + move.w d3,pcd_out_lof_w(a5) + move.l a1,pcd_out_ptr_l(a5) + + move.w pcd_inst_loop_offset_w(a5),d6 + cmp.w d6,d5 + bhs.s .inst_set_wave_ns_keep_pp + st pcd_inst_ping_pong_dir_b(a5) +.inst_set_wave_ns_keep_pp + moveq.l #0,d5 + move.w d5,pcd_inst_subloop_wait_w(a5) + + sub.w wi_subloop_step_w(a3),d6 + move.w d6,pcd_inst_loop_offset_w(a5) + bra .inst_cmd_cont_next + +; ---------------------------------------- +.inst_slide_down + neg.w d5 +.inst_slide_up + move.w d5,pcd_inst_pitch_slide_w(a5) + bra .inst_cmd_cont_next + +; ---------------------------------------- +.inst_adsr + subq.w #1,d5 + beq.s .inst_adsr_release + subq.w #1,d5 + bne .inst_cmd_cont_next + ; d5.l is zero + move.w d5,pcd_adsr_phase_w(a5) + move.w d5,pcd_adsr_volume_w(a5) + bra .inst_cmd_cont_next + +.inst_adsr_release + move.w pcd_adsr_volume_w(a5),d5 + asr.w #6,d5 + move.w d5,pcd_adsr_vol64_w(a5) + moveq.l #16,d6 + move.w d6,pcd_adsr_pos_w(a5) + sub.w d5,d6 + lsr.w #1,d6 + add.b pcd_adsr_release_b(a5),d6 + move.b d6,pcd_adsr_phase_speed_b(a5) + move.w #3,pcd_adsr_phase_w(a5) + bra.s .inst_cmd_cont_next + +; ---------------------------------------- +.inst_vol_slide + moveq.l #15,d3 + and.w d5,d3 + beq.s .inst_vol_slide_up + ; NOTE: Changed behaviour: using d3 instead of d5 + ; if both lower and upper were specified, this + ; probably led to a drastic decrease of volume. + neg.w d3 + move.b d3,pcd_inst_vol_slide_b(a5) + bra.s .inst_cmd_cont_next + +.inst_vol_slide_up + lsr.b #4,d5 + move.b d5,pcd_inst_vol_slide_b(a5) + bra.s .inst_cmd_cont_next + +; ---------------------------------------- +.inst_jump_to_step + cmp.w d0,d5 + bge.s .inst_cmd_cont_next ; only backward jumps allowed (?) + IFNE PRETRACKER_PARANOIA_MODE + ; this stuff is PARANOIA + tst.b d4 + bmi.s .inst_jump_to_step_doit ; we did not have a stitched note before + cmp.b d3,d4 + ble .inst_cmd_cont_next ; we are jumping back to the stitched note, ignore +.inst_jump_to_step_doit + ENDC + move.w d5,d0 + tst.b d7 ; check if we had jumped before + bne.s .inst_we_were_stitched + IFNE PRETRACKER_PARANOIA_MODE + moveq.l #-1,d4 ; mark as no first stitch pos + ENDC + + move.w pcd_inst_num4_w(a5),d1 + movea.l sv_inst_patterns_table-4(a6,d1.w),a0 + + add.w d5,a0 + add.w d5,d5 + add.w d5,a0 + + bra.s .inst_fetch_next +.inst_we_were_stitched + move.b pcd_inst_speed_stop_b(a5),d2 + bra.s .inst_cont_from_nasty_double_jump + +; ---------------------------------------- +.inst_set_volume + cmp.w #MAX_VOLUME,d5 + ble.s .inst_set_volume_nomax + moveq.l #MAX_VOLUME,d5 +.inst_set_volume_nomax + move.w d5,pcd_inst_vol_w(a5) + bra.s .inst_cmd_cont_next + +; ---------------------------------------- +.inst_use_pat_arp + moveq.l #3,d3 + and.w d5,d3 + beq.s .inst_use_pat_arp_play_base + lsr.w #4,d5 + beq.s .inst_use_pat_arp_skip_empty + subq.w #1,d5 + bne.s .inst_cmd_cont_next ; illegal high nibble (only 0/1 allowed) + + ; pick arp note + move.b pcd_arp_notes_l-1(a5,d3.w),d3 + + ; play base note +.inst_use_pat_arp_set + lsl.w #4,d3 +.inst_use_pat_arp_play_base + move.w d3,pcd_inst_sel_arp_note_w(a5) + bra.s .inst_cmd_cont_next + +.inst_use_pat_arp_skip_empty + ; pick arp note, if it's 0, skip it + move.b pcd_arp_notes_l-1(a5,d3.w),d3 + bne.s .inst_use_pat_arp_set + + addq.w #1,d0 + bra.s .inst_fetch_next + +; ---------------------------------------- +.inst_set_speed + tst.w d5 + bne.s .inst_set_speed_nostop + st d5 +.inst_set_speed_nostop + move.b d5,pcd_inst_speed_stop_b(a5) + +; ---------------------------------------- +.inst_nop +.inst_cmd_cont_next + addq.w #1,d0 + tst.b d2 + beq.s .inst_pat_loop_exit2 + ; d2 != 0 in this case, hence d3 will be set +.inst_fetch_next + moveq.l #1,d7 ; mark that we are in at least next iteration + move.b d2,d3 ; mark stitching + cmp.b pcd_inst_pattern_steps_b(a5),d0 + blo .inst_pat_loop + +.inst_pat_loop_exit + st d2 +.inst_pat_loop_exit2 + add.b pcd_inst_speed_stop_b(a5),d2 +.inst_cont_from_nasty_double_jump + move.b d2,pcd_inst_line_ticks_b(a5) + move.b d0,pcd_inst_step_pos_b(a5) ; update inst step pos + +.inst_still_ticking + tst.b pcd_inst_wave_num_w+1(a5) + bpl.s .inst_wave_selected + +.inst_no_wave_selected + moveq.l #0,d3 + move.w d3,pcd_inst_wave_num_w(a5) ; FIXME why set to wave 0? just asking, because this is zero based + move.l sv_waveinfo_ptr(a6),a3 + move.l a3,pcd_waveinfo_ptr(a5) + + move.b pcd_channel_mask_b(a5),d0 + move.b d0,pcd_out_trg_b(a5) + or.b d0,pv_trigger_mask_w+1(a4) + + tst.w wi_subloop_len_w(a3) + bne.s .inst_nowave_has_subloop + + move.w wi_loop_offset_w(a3),d5 + move.l pv_wave_sample_table(a4),a1 + adda.w d5,a1 + move.l a1,pcd_out_ptr_l(a5) + + move.w wi_chipram_w(a3),d0 + move.w d0,d6 + subq.w #1,d6 + cmp.w d4,d6 + ble.s .lbC00118E + sub.w d5,d0 + bra.s .lbC000F48 +.lbC00118E + moveq.l #2,d0 +.lbC000F48 + move.w d0,pcd_out_len_w(a5) + subq.w #1,d3 + bra.s .inst_set_no_lof + +.inst_nowave_has_subloop + move.l pv_wave_sample_table(a4),pcd_out_ptr_l(a5) + + move.w wi_loop_offset_w(a3),d4 +.inst_set_no_lof + move.w d3,pcd_out_lof_w(a5) + moveq.l #0,d0 + move.b wi_subloop_wait_b(a3),d0 + addq.w #1,d0 + move.w d0,pcd_inst_subloop_wait_w(a5) + + move.w d4,pcd_inst_loop_offset_w(a5) + st pcd_inst_ping_pong_dir_b(a5) + +.inst_wave_selected + cmpi.b #$FF,d2 + beq.s .inst_pat_loop_exit3 + subq.b #1,d2 + move.b d2,pcd_inst_line_ticks_b(a5) + +.inst_no_inst_active +.inst_pat_loop_exit3 + +; ---------------------------------------- + +; expects d2 = inst num +; a5 = channel + move.w pcd_inst_vol_w(a5),d1 + tst.b pcd_new_inst_num_b(a5) + bne.s .load_instrument + +.dont_load_instrument + move.w pcd_adsr_volume_w(a5),d2 + move.w pcd_adsr_phase_w(a5),d4 + beq.s .adsr_attack + subq.w #1,d4 + move.w d4,d3 + beq.s .adsr_decay_and_release ; we destinguish via d3 == 0 -> decay + subq.w #1,d4 + beq .adsr_sustain + +.adsr_release + move.w pcd_adsr_pos_w(a5),d4 + add.w pcd_adsr_vol64_w(a5),d4 + move.w d4,pcd_adsr_pos_w(a5) + sub.w #16,d4 + blt.s .adsr_done + move.w d4,pcd_adsr_pos_w(a5) + + ; same code for both release and decay +.adsr_decay_and_release + moveq.l #0,d4 + move.b pcd_adsr_phase_speed_b(a5),d4 + cmpi.b #$8f,d4 + bhs.s .adsr_absurd_slow_release + move.b d4,d5 + addq.b #1,d5 + add.w d4,d4 + lea pre_roll_off_table(pc),a1 + move.w (a1,d4.w),d4 + bra.s .adsr_release_cont + +.adsr_absurd_slow_release + moveq.l #2,d4 ; FIXME I guess this should be 1, if I look at the roll-off table + moveq.l #-$71,d5 ; same as $8f, we only need the byte +.adsr_release_cont + move.b d5,pcd_adsr_phase_speed_b(a5) + + tst.w d3 + beq.s .adsr_is_actually_decay + + sub.w d4,d2 + bpl.s .adsr_done + moveq.l #0,d2 + bra.s .adsr_done + +.adsr_is_actually_decay + sub.w d4,d2 + + cmp.w uii_adsr_sustain(a2),d2 + bgt.s .adsr_done +.adsr_enter_sustain + move.w #2,pcd_adsr_phase_w(a5) + move.w uii_adsr_sustain(a2),d2 + bra.s .adsr_done + +.load_instrument + move.b d1,pcd_loaded_inst_vol_b(a5) + move.l uii_vibrato_delay(a2),pcd_vibrato_delay_w(a5) ; and uii_vibrato_depth + ;move.w uii_vibrato_delay(a2),pcd_vibrato_delay_w(a5) + ;move.w uii_vibrato_depth(a2),pcd_vibrato_depth_w(a5) + + move.l uii_vibrato_speed(a2),pcd_vibrato_speed_w(a5) ; and uii_adsr_release + ;move.w uii_vibrato_speed(a2),pcd_vibrato_speed_w(a5) + ;move.b uii_adsr_release(a2),pcd_adsr_release_b(a5) + + moveq.l #0,d2 + move.l d2,pcd_adsr_phase_w(a5) ; and pcd_adsr_volume_w + ;move.w d2,pcd_adsr_phase_w(a5) + ;move.w d2,pcd_adsr_volume_w(a5) + + move.l d2,pcd_new_inst_num_b(a5) ; and pcd_vibrato_pos_w + +.adsr_attack + add.w uii_adsr_attack(a2),d2 + cmpi.w #MAX_VOLUME<<4,d2 + blt.s .adsr_done + +.adsr_do_decay + move.w #MAX_VOLUME<<4,d2 + move.w #1,pcd_adsr_phase_w(a5) + move.b uii_adsr_decay+1(a2),pcd_adsr_phase_speed_b(a5) + +.adsr_sustain + +.adsr_done + move.w d2,pcd_adsr_volume_w(a5) + + ; handle note cut-off command (EAx command) + move.b pcd_note_off_delay_b(a5),d4 + beq.s .dont_release_note + subq.b #1,d4 + move.b d4,pcd_note_off_delay_b(a5) + bne.s .dont_release_note + ; cut off note + clr.w pcd_adsr_volume_w(a5) + move.w #3,pcd_adsr_phase_w(a5) + +.dont_release_note + +; ---------------------------------------- +; calculate final volume output = inst_vol * ADSR volume * pattern volume + + IFNE PRETRACKER_VOLUME_TABLE + lea pv_volume_table(a4),a1 + lsl.w #3,d2 + and.w #127<<7,d2 + or.b d1,d2 + move.b (a1,d2.w),d1 + lsl.w #7,d1 + or.b pcd_pat_vol_b(a5),d1 + move.b (a1,d1.w),pcd_out_vol_b(a5) + ELSE + lsr.w #4,d2 + mulu d2,d1 + lsr.w #6,d1 + + moveq.l #0,d2 + move.b pcd_pat_vol_b(a5),d2 + mulu d1,d2 + lsr.w #6,d2 + move.b d2,pcd_out_vol_b(a5) + ENDC + +; ---------------------------------------- +; wave loop pos advancing and pattern wave offset command handling + + move.w wi_subloop_len_w(a3),d3 + beq .wave_has_no_subloop + move.w d3,pcd_out_len_w(a5) ; FIXME can we move this to wave loading? + + move.w wi_subloop_step_w(a3),d2 + moveq.l #0,d1 + move.b pcd_wave_offset_b(a5),d1 + beq.s .wave_with_subloop_but_no_wave_offset + tst.b wi_allow_9xx_b(a3) + beq.s .wave_with_subloop_but_no_wave_offset + + ; update loop offset from pattern + lsl.w #7,d1 + + clr.b pcd_wave_offset_b(a5) + + ; keep current direction of ping-pong unchanged + move.b pcd_inst_ping_pong_dir_b(a5),d4 + bpl.s .wave_move_one_step_ahead + sub.w d2,d1 ; go in reverse direction one step? + bra.s .wave_submove_cont +.wave_move_one_step_ahead + add.w d2,d1 ; go in reverse direction one step? + bra.s .wave_submove_cont + +.wave_with_subloop_but_no_wave_offset + subq.w #1,pcd_inst_subloop_wait_w(a5) + bgt.s .wave_subloop_wait + + ; subloop moves! + move.b pcd_inst_ping_pong_dir_b(a5),d4 + move.w pcd_inst_loop_offset_w(a5),d1 +.wave_submove_cont + ; reset subloop wait + moveq.l #0,d5 + move.b wi_subloop_wait_b(a3),d5 ; FIXME why is this not increased by one here? + move.w d5,pcd_inst_subloop_wait_w(a5) + + tst.b d4 + bpl.s .wave_is_moving_backwards + add.w d2,d1 ; increment offset in forward direction one step + + move.w d1,d4 + add.w d3,d4 ; calculate next start of loop (curr start) + + move.w wi_loop_end_w(a3),d2 + cmp.w d1,d2 + bhs.s .is_not_past_loop_end ; are we starting playback past the end of the loop + move.w wi_chipram_w(a3),d2 ; use sample end +.is_not_past_loop_end + sub.w d4,d2 ; space left = (max(loop end, sample end) - curr start) + bhi.s .wave_new_loop_pos_fits ; max(loop end, sample end) > curr start? + + add.w d2,d1 ; place offset at last possible place (loop_end - loop size) + + clr.b pcd_inst_ping_pong_dir_b(a5) ; mark going backwards + bra.s .wave_loop_dir_changed + +.wave_is_moving_backwards + sub.w d2,d1 ; decrement offset in backward direction one step + + move.w wi_loop_start_w(a3),d4 + + move.w d4,d2 + sub.w d1,d2 ; calc how many bytes we are part front + bmi.s .wave_new_loop_pos_fits + +.wave_hit_front_of_loop + move.w d4,d1 + st pcd_inst_ping_pong_dir_b(a5) + +.wave_loop_dir_changed + tst.w d2 + bne.s .wave_new_loop_pos_fits ; perfect fit for last loop + + ; partial fit only + subq.w #1,pcd_inst_subloop_wait_w(a5) ; why, oh why? + +.wave_new_loop_pos_fits + move.w d1,d4 + move.w d4,pcd_inst_loop_offset_w(a5) + bra.s .done_lof_calc + +.wave_subloop_wait + move.w pcd_inst_loop_offset_w(a5),d4 +.done_lof_calc + move.w d4,pcd_out_lof_w(a5) + + move.w pcd_inst_wave_num_w(a5),d1 ; FIXME can we move this to wave loading? + move.l pv_wave_sample_table(a4,d1.w),pcd_out_ptr_l(a5) + bra.s .loop_handling_done + +.wave_has_no_subloop + move.b pcd_wave_offset_b(a5),d1 + beq.s .loop_handling_done + tst.b wi_allow_9xx_b(a3) + beq.s .loop_handling_done + + ; apply offset from pattern for sample without subloop + lsl.w #8,d1 ; clear upper byte + lsr.w #1,d1 + + clr.b pcd_wave_offset_b(a5) + + move.b pcd_channel_mask_b(a5),d2 ; trigger output + move.b d2,pcd_out_trg_b(a5) + or.b d2,pv_trigger_mask_w+1(a4) + + move.w wi_chipram_w(a3),d2 + sub.w d1,d2 + bgt.s .waveoffset_is_not_past_end + moveq.l #2,d2 + IFNE PRETRACKER_BUGFIX_CODE + ; FIXME actually we should set the start address to the empty sample + ; FIXME (or at least to the beginning of the sample?) to avoid an audible glitch + moveq.l #0,d1 + ENDC +.waveoffset_is_not_past_end + move.w d2,pcd_out_len_w(a5) + + move.w pcd_inst_wave_num_w(a5),d2 + add.l pv_wave_sample_table(a4,d2.w),d1 + move.l d1,pcd_out_ptr_l(a5) + + ;move.w #$FFFF,pcd_out_lof_w(a5) ; this is already set to -1, no need to set it again +.loop_handling_done + +; ---------------------------------------- +; pitch handling + move.w pcd_inst_pitch_w(a5),d0 + sub.w #$10,d0 + tst.b pcd_inst_pitch_pinned_b(a5) + bne.s .pitch_pinned +.pitch_not_pinned + add.w pcd_inst_sel_arp_note_w(a5),d0 + add.w pcd_inst_curr_port_pitch_w(a5),d0 + sub.w #$10,d0 +.pitch_pinned + add.w pcd_inst_note_pitch_w(a5),d0 + +; ---------------------------------------- +; vibrato processing + move.b pcd_vibrato_delay_w+1(a5),d1 + beq.s .vibrato_already_active + subq.b #1,d1 + move.b d1,pcd_vibrato_delay_w+1(a5) + bne.s .vibrato_still_delayed + +.vibrato_already_active + move.w pcd_vibrato_speed_w(a5),d2 + beq.s .vibrato_disabled ; no speed -- skip stuff + move.w pcd_vibrato_depth_w(a5),d4 + move.w d2,d1 + add.w pcd_vibrato_pos_w(a5),d1 + cmp.w d1,d4 + blt.s .vibrato_flipit + neg.w d4 + cmp.w d1,d4 + ble.s .vibrato_cont +.vibrato_flipit + neg.w d2 + move.w d2,pcd_vibrato_speed_w(a5) + move.w d4,d1 +.vibrato_cont + move.w d1,pcd_vibrato_pos_w(a5) + + asr.w #3,d1 + add.w d1,d0 +.vibrato_disabled +.vibrato_still_delayed + +; ---------------------------------------- +; select right sample corresponding to current pitch + + move.w pcd_out_len_w(a5),d3 + cmpi.w #$219,d0 + ble .noclippitchhigh + move.w #$231,d6 ; That's probably B-3+1, mapping to period $71 (although $7c is the last safe value) + btst #2,wi_flags_b(a3) + beq .noclippitchlow2 + + ; select high pitch version of the sample + moveq.l #0,d2 + move.w wi_chipram_w(a3),d2 + move.w d0,d5 + sub.w #$219,d5 + lsr.w #6,d5 + lea pre_octave_select_table(pc),a1 + moveq.l #0,d1 + move.b (a1,d5.w),d1 + move.w pcd_out_lof_w(a5),d7 + addq.w #1,d7 ; compare to $ffff + beq.s .has_no_loop_offset + subq.w #1,d7 + lsr.w d1,d7 + move.w d7,pcd_out_lof_w(a5) + lsr.w d1,d3 + move.w d3,pcd_out_len_w(a5) + bra.s .lbC0005C0 + +.has_no_loop_offset + tst.b pcd_out_trg_b(a5) + beq.s .no_retrigger_new + + move.w pcd_inst_wave_num_w(a5),d7 + movea.l pv_wave_sample_table(a4,d7.w),a3 + + move.l pcd_out_ptr_l(a5),d4 + sub.l a3,d4 + move.w d3,d6 + add.w d4,d6 + + move.w d2,d7 + sub.w d6,d7 + cmp.w d7,d3 + bcc.s .fix_sample_loop + moveq.l #2,d3 + bra.s .cont_after_one_shot + +.fix_sample_loop + add.w d6,d3 + sub.w d2,d3 + lsr.w d1,d3 + +.cont_after_one_shot + move.w d3,pcd_out_len_w(a5) + + lsr.w d1,d4 + add.l a3,d4 + move.l d4,pcd_out_ptr_l(a5) + +.lbC0005C0 + subq.b #1,d1 + bmi.s .is_normal_octave + ; find offset in sample buffer for the right octave + moveq.l #0,d4 +.movetoloopposloop + add.l d2,d4 + lsr.w #1,d2 + dbra d1,.movetoloopposloop + add.l d4,pcd_out_ptr_l(a5) + +.no_retrigger_new +.is_normal_octave + moveq.l #0,d1 + move.b pre_octave_note_offset_table-pre_octave_select_table(a1,d5.w),d1 + add.w d1,d1 + add.w d1,d1 + sub.w d1,d0 + cmpi.w #$231,d0 + ble.s .noclippitchhigh + move.w #$231,d0 +.noclippitchhigh + tst.w d0 + bge.s .noclippitchlow + moveq.l #0,d0 +.noclippitchlow + move.w d0,d6 +.noclippitchlow2 + tst.b pcd_out_trg_b(a5) + beq.s .wasnottriggered + moveq.l #0,d0 + move.w pcd_out_lof_w(a5),d0 + addq.w #1,d0 ; compare to $ffff + beq.s .hasnoloop2 + subq.w #1,d0 + add.l d0,pcd_out_ptr_l(a5) + clr.w pcd_out_lof_w(a5) +.wasnottriggered +.hasnoloop2 + cmp.w pcd_last_trigger_pos_w(a5),d3 + beq.s .hassamesampos + move.w d3,pcd_last_trigger_pos_w(a5) + move.b pcd_channel_mask_b(a5),d3 + move.b d3,pcd_out_trg_b(a5) + or.b d3,pv_trigger_mask_w+1(a4) +.hassamesampos + add.w d6,d6 + move.w pv_period_table(a4,d6.w),pcd_out_per_w(a5) + +; ---------------------------------------- +; track delay handling + + move.b pcd_track_delay_steps_b(a5),d3 + beq .incrementchannel ; no track delay + + cmp.b #NUM_CHANNELS-1,pcd_channel_num_b(a5) ; last channel processed? + beq .updatechannels ; no track delay for last channel + + moveq.l #MAX_TRACK_DELAY-1,d0 ; load from last buffer + + ; handle track delay + cmpi.b #$FF,d3 + beq.s .clear_track_delay + + ; advance and wrap offset + move.b pcd_SIZEOF+pcd_track_delay_offset_b(a5),d1 + addq.b #1,d1 + and.w d0,d1 + move.b d1,pcd_SIZEOF+pcd_track_delay_offset_b(a5) + + move.w d1,d2 + lea pcd_SIZEOF(a5),a3 + lsl.w #4,d2 + lea pcd_track_delay_buffer(a3,d2.w),a3 + lea pcd_out_base(a5),a1 + move.l (a1)+,(a3)+ ; ocd_sam_ptr + move.l (a1)+,(a3)+ ; ocd_length/ocd_loop_offset + move.l (a1)+,(a3)+ ; ocd_period/ocd_volume/ocd_trigger + ;move.l (a1)+,(a3)+ ; this is never used + + move.b -(a3),d2 + add.b d2,d2 ; increment channel + bne.s .copy_trigger_for_delayed_channel + tst.b pcd_SIZEOF+pcd_track_delay_steps_b(a5) + bne.s .dont_trigger_track_delay_first_note + move.b d2,(a3) ; trigger note (ocd_trigger) +.copy_trigger_for_delayed_channel + or.b d2,pv_trigger_mask_w+1(a4) +.dont_trigger_track_delay_first_note + + IFNE PRETRACKER_VOLUME_TABLE + lea pv_volume_table(a4),a1 + move.b pcd_track_delay_vol16_b(a5),-(sp) + move.w (sp)+,d4 + clr.b d4 + add.w d4,d4 + move.b -(a3),d4 ; ocd_volume + move.b (a1,d4.w),(a3)+ + ELSE + moveq.l #0,d4 + move.b -(a3),d4 ; ocd_volume + move.b pcd_track_delay_vol16_b(a5),d2 + ext.w d2 + mulu d4,d2 ; apply track delay volume + lsr.w #4,d2 + move.b d2,(a3)+ ; fix volume + ENDC + + move.b d3,pcd_SIZEOF+pcd_track_delay_steps_b(a5) + + sub.b d3,d1 + and.w d1,d0 + + IFNE PRETRACKER_DUBIOUS_PITCH_SHIFT_FOR_DELAYED_TRACK + moveq.l #7,d4 + and.w d4,d1 + lea pre_minus4plus4_table(pc),a1 + move.b (a1,d1.w),d1 + ext.w d1 + ENDC + bra.s .load_track_data_from_buffer + +.clear_track_delay + moveq.l #0,d1 + move.b d1,pcd_track_delay_steps_b(a5) + move.b d1,pcd_SIZEOF+pcd_pat_vol_b(a5) + move.b d1,pcd_SIZEOF+pcd_track_delay_steps_b(a5) + st pcd_SIZEOF+pcd_track_delay_offset_b(a5) + +.load_track_data_from_buffer + lea pcd_SIZEOF(a5),a5 ; skip the channel we applied track delay to + lsl.w #4,d0 + lea pcd_track_delay_buffer(a5,d0.w),a1 + lea pcd_out_base(a5),a3 + move.l (a1)+,(a3)+ ; ocd_sam_ptr + move.l (a1)+,(a3)+ ; ocd_length/ocd_loop_offset + move.l (a1)+,(a3)+ ; ocd_period/ocd_volume/ocd_trigger + ;move.l (a1)+,(a3)+ ; this is never used + + ;clr.b ocd_volume-ocd_unused(a1) ; does not seem to bother + + IFNE PRETRACKER_DUBIOUS_PITCH_SHIFT_FOR_DELAYED_TRACK + ; FIXME this seems odd! Why modulate the period by the distance? + move.w pcd_out_base+ocd_period(a5),d2 + move.w d1,d0 + muls d2,d0 + lsl.l #4,d0 + swap d0 + add.w d0,d2 + move.w d2,pcd_out_base+ocd_period(a5) + ENDC + +.incrementchannel + lea pcd_SIZEOF(a5),a5 + cmp.b #NUM_CHANNELS-1,pcd_channel_num_b-pcd_SIZEOF(a5) + bne .inst_chan_loop + +; ---------------------------------------- +.updatechannels + ; so this changed a lot from the original routine + move.w pv_trigger_mask_w(a4),d2 + + IFNE PRETRACKER_COPPER_OUTPUT + move.l pv_copperlist_ptr(a4),d0 + beq .skipcopperlist + move.l d0,a5 + move.b d2,1*4+3(a5) ; dmacon + move.b d2,(1+1+1+5*NUM_CHANNELS)*4+3(a5) ; dmacon after wait, dmacon, wait, 20 writes + + lea pv_channeldata+pcd_out_base(a4),a0 + move.l pv_sample_buffer_ptr(a4),d3 + moveq.l #0,d5 + move.w d5,pv_trigger_mask_w(a4) + moveq.l #-1,d1 + lea 3*4+2(a5),a1 + lea (1+1+1+5*NUM_CHANNELS+1+1)*4+2(a5),a2 ; wait, dmacon, wait, 20 writes, dmacon, wait + moveq.l #NUM_CHANNELS-1,d7 +.checkchan + moveq.l #0,d2 + move.w ocd_loop_offset(a0),d2 + cmp.w d1,d2 + bne.s .is_looping_sample + tst.b ocd_trigger(a0) + beq.s .one_shot_clear_loop + move.b d5,ocd_trigger(a0) + move.l ocd_sam_ptr(a0),d0 + move.l d3,d6 ; set loop start + move.w ocd_length(a0),d4 + lsr.w #1,d4 + move.w d4,2*4(a1) ; ac_len + moveq.l #1,d4 + bra.s .setptrvolper +.one_shot_clear_loop + move.l d3,d6 + move.l d3,d0 + moveq.l #1,d4 + move.w d4,2*4(a1) ; ac_len + bra.s .setptrvolper + +.is_looping_sample + move.l ocd_sam_ptr(a0),d0 + add.l d2,d0 + move.l d0,d6 + + move.w ocd_length(a0),d4 + lsr.w #1,d4 + move.w d4,2*4(a1) ; ac_len + tst.b ocd_trigger(a0) + beq.s .setptrvolper + move.b d5,ocd_trigger(a0) + sub.l d2,d6 +.setptrvolper + move.w d0,1*4(a1) ; ac_ptr (lo) + swap d0 + move.w d0,(a1) ; ac_ptr (hi) + move.w ocd_period(a0),3*4(a1) + move.b ocd_volume(a0),4*4+1(a1) + move.w d6,1*4(a2) ; ac_ptr (lo) + swap d6 + move.w d6,(a2) ; ac_ptr (hi) + move.w d4,2*4(a2) ; ac_len + + lea pcd_SIZEOF(a0),a0 + lea 5*4(a1),a1 + lea 3*4(a2),a2 + dbra d7,.checkchan + +.skipcopperlist + ELSE + lea $dff000,a5 + + ; turn channels off and remember raster position + move.w d2,dmacon(a5) ; turn dma channels off + move.w vhposr(a5),d5 ; I know this only works for the lower 256 rasterlines... + add.w #4<<8,d5 ; target rasterpos + + ; in the meanwhile we can update both channels that + ; - need triggering by setting the new start and length + ; - need updating of loop offset only + ; update volume and period in any case + lea pv_channeldata+pcd_out_base(a4),a0 + lea aud0(a5),a1 + move.l pv_sample_buffer_ptr(a4),d3 + moveq.l #0,d6 + move.w d6,pv_trigger_mask_w(a4) + moveq.l #-1,d1 + moveq.l #NUM_CHANNELS-1,d7 +.checkchan + tst.b ocd_trigger(a0) + beq.s .updateloop + move.b d6,ocd_trigger(a0) + ; set start and length of the new sample + move.w ocd_length(a0),d0 + lsr.w #1,d0 + move.w d0,ac_len(a1) + move.l ocd_sam_ptr(a0),ac_ptr(a1) + bra.s .setvolperchan +.updateloop + ; just update loop offset if looping + moveq.l #0,d0 + move.w ocd_loop_offset(a0),d0 + cmp.w d1,d0 + beq.s .setvolperchan + add.l ocd_sam_ptr(a0),d0 + move.l d0,ac_ptr(a1) +.setvolperchan + move.b ocd_volume(a0),ac_vol+1(a1) + move.w ocd_period(a0),ac_per(a1) + lea pcd_SIZEOF(a0),a0 + lea ac_SIZEOF(a1),a1 + dbra d7,.checkchan + + tst.w d2 + beq.s .skiprasterwait ; if no channel needed triggering, we are done! + + or.w #DMAF_SETCLR,d2 +.rasterwait1 + cmp.w vhposr(a5),d5 + bgt.s .rasterwait1 + + move.w d2,dmacon(a5) ; enable triggered channels + add.w #4<<8,d5 ; target rasterpos + +.rasterwait2 + cmp.w vhposr(a5),d5 + bgt.s .rasterwait2 + + lea pv_channeldata+pcd_out_base(a4),a0 + lea aud(a5),a1 +.chanloop + lsr.b #1,d2 + bcc.s .nosetloopchan + moveq.l #0,d0 + move.w ocd_loop_offset(a0),d0 + cmp.w d1,d0 + beq.s .setchan_no_loop2 + add.l ocd_sam_ptr(a0),d0 + bra.s .keepchanrunning2 +.setchan_no_loop2 + move.l d3,d0 + move.w #1,ac_len(a1) +.keepchanrunning2 + move.l d0,ac_ptr(a1) +.nosetloopchan + lea pcd_SIZEOF(a0),a0 + lea ac_SIZEOF(a1),a1 + tst.b d2 + bne.s .chanloop + +.skiprasterwait + ENDC + + IFNE PRETRACKER_DONT_TRASH_REGS + movem.l (sp)+,d2-d7/a2-a6 + ENDC + rts + +;-------------------------------------------------------------------- +; table data currently about 594 bytes + +; I assume this is a log table for freq distances within an octave +pre_log12_table: + dc.b $400000/$8000,$400000/$871D,$400000/$8F2F,$400000/$97B7,$400000/$9FC4,$400000/$A9DE + dc.b $400000/$B505,$400000/$BF49,$400000/$CB31,$400000/$D645,$400000/$E215,$400000/$F1A0 + +; linear then steep quadratic slope +pre_vib_speed_table: + dc.b 2,3,4,5,6,7,8,9,10,11,12,13,14,20,40,80 + +; linear (a bit wonky), then a bit quadratic, then steep +pre_vib_depth_table: + dc.b 0,8,9,10,11,12,13,14,18,20,28,40,50,70,160,255 + +; linear then almost quadratic +pre_vib_delay_table: + dc.b 0,4,8,10,12,14,16,18,20,24,32,40,56,96,150,255 + +pre_ramp_up_16: + dc.b 0,1,3,6,7,9,10,11,12,13,14,16,19,35,55,143 + +pre_fast_roll_off_16: + dc.w $400,$200,$80,$64,$50,$40,$30,$20,$10,14,12,10,8 + dc.w 4,2,1 + +pre_roll_off_table: + dc.w $400,$200,$180,$140,$100,$C0,$A0,$80,$78,$74,$6E + dc.w $69,$64,$5A,$46,$40,$38,$30,$28,$20,$1F,$1E,$1D + dc.w $1C,$1B,$1A,$19,$18,$17,$16,$15,$14,$13,$12,$11 + dc.w $10,15,14,13,13,12,12,11,11,10,10,9,9,8,8,8,8,7,7 + dc.w 7,7,6,6,6,6,5,5,5,5,4,4,4,4,4,4,4,4,4,4,3,4,4,3,4 + dc.w 4,3,4,3,4,3,4,3,4,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3 + dc.w 2,3,3,2,3,3,2,3,2,3,2,3,2,3,2,3,2,2,2,2,2,2,2,2,1 + dc.w 2,1,2,1,2,1,2,1,1,2,1,1,1,2,1 + +pre_octave_note_offset_table: + dc.b 1*NOTES_IN_OCTAVE*4,1*NOTES_IN_OCTAVE*4,1*NOTES_IN_OCTAVE*4 + dc.b 2*NOTES_IN_OCTAVE*4,2*NOTES_IN_OCTAVE*4,2*NOTES_IN_OCTAVE*4 + dc.b 3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4 + dc.b 3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4 + dc.b 3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4 + IFNE PRETRACKER_PARANOIA_MODE + dc.b 3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4 + dc.b 3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4 + dc.b 3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4,3*NOTES_IN_OCTAVE*4 + ELSE + dc.b 3*NOTES_IN_OCTAVE*4 + ENDC + even + + ; based on pitch $219 (537), covers up to pitch 0x819 (2073). + ; In practice, I was unable to get higher than $5ff +pre_octave_select_table: + dc.b 1,1,1 + dc.b 2,2,2 + dc.b 3,3,3 + dc.b 3,3,3 + dc.b 3,3,3 + dc.b 3,3,3 + IFNE PRETRACKER_PARANOIA_MODE + dc.b 3,3,3 + dc.b 3,3,3 + ELSE + dc.b 3 + ENDC + even + + IFNE PRETRACKER_DUBIOUS_PITCH_SHIFT_FOR_DELAYED_TRACK + ; -4,-3,-1,1,2,3,4,0 +pre_minus4plus4_table: + dc.b $FC,$FB,$FF,1,2,3,4,0 + ENDC + +pre_ramp_up_down_32: + dc.w 0*32,1*32,2*32,3*32,4*32,5*32,6*32,7*32,8*32,9*32,10*32,11*32,12*32,13*32,14*32,15*32 + dc.w 15*32,14*32,13*32,12*32,11*32,10*32,9*32,8*32,7*32,6*32,5*32,4*32,3*32,2*32,1*32,0*32 + +pre_modulator_ramp_8: + ;dc.w 77,293,539,1079,1337,1877,2431,3031 ; the 1079 value is strange (938 better?) + dc.w $4D,$125,$21B,$437,$539,$755,$96D,$BD7 + +pre_period_table: + dc.w $350,$320,$2F2,$2C8,$2A0,$279,$256,$236,$216,$1F8,$1DC,$1C0 + dc.w $1A8,$190,$179,$164,$151,$13E,$12C,$11B,$10B,$FC,$EE,$E0 + dc.w $D4,$C8,$BD,$B2,$A8,$9F,$96,$8D,$86,$7E,$78,$71 + dc.w $71 diff --git a/source/framework/os_startupcode.asm b/source/framework/os_startupcode.asm new file mode 100644 index 0000000..2e54b2b --- /dev/null +++ b/source/framework/os_startupcode.asm @@ -0,0 +1,461 @@ + include "exec/memory.i" + include "dos/dosextens.i" + include "workbench/startup.i" + include "graphics/gfxbase.i" + IF FW_DO_FANCY_WORKBENCH_STUFF + include "graphics/view.i" + ENDC + + include "uae/uaestuff.i" + + IFND CHIPMEM_SIZE +CHIPMEM_SIZE = 4 + ENDC + IFND FASTMEM_SIZE +FASTMEM_SIZE = 4 + ENDC + + bsr os_AppInit + + IF FW_LMB_EXIT_SUPPORT + lea -4(sp),a0 + move.l a0,fw_DemoAbortStackPointer(a6) + ENDC + + PUTMSG 10,<"%d: Entrypoint: %p">,fw_FrameCounterLong(a6),#entrypoint + bsr entrypoint + PUTMSG 10,<"%d: Part terminated">,fw_FrameCounterLong(a6) + + bra os_AppShutdown + +;-------------------------------------------------------------------- +; startup code +;-------------------------------------------------------------------- + +os_AppInit: + PUTMSG 10,<"AppInit %ld, %ld">,#CHIPMEM_SIZE,#FASTMEM_SIZE + IFGT DEBUG_DETAIL + UAEExitWarp + ENDC + + move.l 4.w,a6 + IFEQ FW_HD_TRACKMO_MODE + IFD pd_SIZEOF + move.l #pd_SIZEOF,d0 + PUTMSG 10,<"Allocating framework memory (%ld) WITH PART data: %ld bytes">,#fw_SIZEOF,d0 + ELSE + move.l #fw_SIZEOF,d0 + PUTMSG 10,<"Allocating framework memory: %ld bytes (NO part data!)">,d0 + ENDC + move.l d0,d2 + move.l #MEMF_PUBLIC|MEMF_CLEAR,d1 + CALL AllocMem + move.l d0,fw_BasePtr + bne.s .cont + moveq.l #ERROR_NO_FREE_STORE,d0 + addq.w #4,sp + rts +.cont move.l d0,a4 + move.l d0,fw_OrigBaseMemAllocAddr(a4) + move.l d2,fw_OrigBaseMemAllocLength(a4) + ELSE + move.l #fw_SIZEOF+6,d0 ; for InitData LVO + move.l d0,d2 + move.l #MEMF_PUBLIC|MEMF_CLEAR,d1 + CALL AllocMem + tst.l d0 + beq.s .error + move.l d0,a0 + move.w #%0100111011111001,(a0)+ + move.l #fw_InitPart,(a0)+ + move.l a0,fw_BasePtr + bra.s .cont +.error + moveq.l #ERROR_NO_FREE_STORE,d0 + addq.w #4,sp + rts +.cont move.l a0,a4 + move.l d0,fw_OrigBaseMemAllocAddr(a4) + move.l d2,fw_OrigBaseMemAllocLength(a4) + ENDC + move.l a4,fw_PartFwBase(a4) + move.l a4,fw_PrimaryFwBase(a4) + + suba.l a1,a1 + CALL FindTask + move.l d0,a2 + tst.l pr_CLI(a2) + bne.s .cli + lea pr_MsgPort(a2),a0 + CALL WaitPort + lea pr_MsgPort(a2),a0 + CALL GetMsg + move.l d0,fw_WBMessage(a4) +.cli + moveq.l #ERROR_NO_FREE_STORE,d7 + move.l #CHIPMEM_SIZE+(mfw_copperlistend-mfw_copperlist),d0 + + addq.l #7,d0 + and.w #-8,d0 + move.l d0,d2 + move.l d0,fw_OrigChipMemAllocLength(a4) + move.l #MEMF_CHIP|MEMF_PUBLIC|MEMF_CLEAR,d1 + CALL AllocMem + move.l d0,fw_OrigChipMemAllocAddr(a4) + beq os_AppAbort + move.l d0,fw_ChipMemStack(a4) + add.l d2,d0 + move.l d0,fw_ChipMemStackEnd(a4) + + IF FW_SINETABLE_SUPPORT + move.l #FASTMEM_SIZE+(1024+256)*2,d0 + ELSE + move.l #FASTMEM_SIZE,d0 + ENDC + move.l d0,d2 + move.l d0,fw_OrigFastMemAllocLength(a4) + move.l #MEMF_ANY|MEMF_PUBLIC|MEMF_CLEAR,d1 + CALL AllocMem + move.l d0,fw_OrigFastMemAllocAddr(a4) + beq os_AppAbort + move.l d0,fw_FastMemStack(a4) + add.l d2,d0 + move.l d0,fw_FastMemStackEnd(a4) + + IF DEBUG_DETAIL + move.l #MEMF_CHIP,d1 + CALL AvailMem + PUTMSG 10,<"Chip memory free: %ld bytes">,d0 + move.l #MEMF_CHIP|MEMF_LARGEST,d1 + CALL AvailMem + PUTMSG 10,<"Chip memory largest: %ld bytes">,d0 + move.l #MEMF_FAST,d1 + CALL AvailMem + PUTMSG 10,<"Fast memory free: %ld bytes">,d0 + ENDC + IF 0 + PUTMSG 10,<"OpenResource"> + move.w #ERROR_LOCK_COLLISION,d7 + lea .ciabname(pc),a1 + CALL OpenResource + move.l d0,fw_CiaBResource(a4) + beq os_AppAbort + move.l a6,a5 + move.l d0,a6 + + PUTMSG 10,<"AddICRVector"> + lea fw_SysFriendlyInterrupt(a4),a1 + lea .nopirq(pc),a0 + move.l a0,IS_CODE(a1) + moveq.l #CIAICRB_TB,d0 + CALL AddICRVector + tst.l d0 + beq.s .gottimer + move.l a5,a6 + bra os_AppAbort + + ; No turning back at this point! +.gottimer + PUTMSG 10,<"AbleICR"> + moveq.l #CIAICRF_TB,d0 + CALL AbleICR + ENDC + + lea $dff000,a5 + exg a4,a6 ; from now on, a6 is supposed to be our framework pointer, a5 is _custom + + IF FW_MULTITASKING_SUPPORT + bsr fw_InitTasks + ENDC + + IF FW_DYNAMIC_MEMORY_SUPPORT + bsr fw_InitMemoryManagement + + IF (FW_STANDALONE_FILE_MODE==0)|FW_HD_TRACKMO_MODE + IF FW_MULTITASKING_SUPPORT + move.l #ft_SIZEOF,d0 + bsr fw_AllocFast + move.l a0,fw_TrackloaderTask(a6) + ENDC + ENDC + + moveq.l #mfw_copperlistend-mfw_copperlist,d0 + bsr fw_AllocChip + move.l a0,a1 + move.l a0,fw_BaseCopperlist(a6) + ELSE + IF (FW_STANDALONE_FILE_MODE==0)|FW_HD_TRACKMO_MODE + IF FW_MULTITASKING_SUPPORT + move.l fw_FastMemStack(a6),a0 + move.l a0,fw_TrackloaderTask(a6) + lea ft_SIZEOF(a0),a0 + move.l a0,fw_FastMemStack(a6) + ENDC + ENDC + move.l fw_ChipMemStack(a6),a1 + lea mfw_copperlistend-mfw_copperlist(a1),a0 + move.l a0,fw_ChipMemStack(a6) + ENDC + + lea mfw_copperlist(pc),a0 + moveq.l #(mfw_copperlistend-mfw_copperlist)/4-1,d7 +.cpyloop + move.l (a0)+,(a1)+ + dbra d7,.cpyloop + + subq.l #4,a1 + move.l a1,fw_EmptySprite(a6) + + lea fw_vblank_standard_irq(pc),a0 + move.l a0,fw_DefaultIRQ(a6) + + IF FW_SINETABLE_SUPPORT + bsr fw_InitSineTable + ENDC + + IF FW_HD_TRACKMO_MODE + move.l #diskimage,fw_TrackBuffer(a6) + + bsr fw_InitDos + + IF FW_DYNAMIC_MEMORY_SUPPORT + IF FW_MUSIC_SUPPORT + IF (FW_MUSIC_PLAYER_CHOICE==4)||(FW_MUSIC_PLAYER_CHOICE==5) + bsr fw_MusicAlloc + ENDC + ENDC + bsr fw_PushMemoryState + ENDC + + ELSE ; FW_DYNAMIC_MEMORY_SUPPORT + + IF FW_MUSIC_SUPPORT + IF (FW_MUSIC_PLAYER_CHOICE==4)||(FW_MUSIC_PLAYER_CHOICE==5) + bsr fw_MusicAlloc + bsr fw_PushMemoryState + ENDC + ENDC + ENDC ; FW_DYNAMIC_MEMORY_SUPPORT + + move.w vposr(a5),d0 + btst #9,d0 + beq.s .noaga + move.w #-1,fw_AgaChipset(a6) +.noaga + + exg a4,a6 ; from now on, a4 is our framework pointer, a6 is exec + move.l a6,a5 + PUTMSG 10,<"LoadView"> + movea.l IVBLIT+IV_DATA(a5),a6 ; graphics.library + move.l a6,fw_GfxBase(a4) + move.l gb_ActiView(a6),fw_OldGfxView(a4) + + IF FW_DO_FANCY_WORKBENCH_STUFF + CALL OwnBlitter + move.l a5,a6 + + ;CALL Forbid + lea fw_SysFriendlyInterrupt(a4),a1 + lea os_SysFriendlyVbl(pc),a0 + move.l a0,IS_CODE(a1) + move.l a4,IS_DATA(a1) + moveq.l #INTB_VERTB,d0 + CALL AddIntServer + + PUSHM a4-a6 + lea $dff000,a5 + exg a4,a6 + bsr preentrypoint + POPM + + lea fw_SysFriendlyInterrupt(a4),a1 + moveq.l #INTB_VERTB,d0 + CALL RemIntServer + clr.l fw_VBlankIRQ(a4) + + ;CALL Permit + + move.l fw_GfxBase(a4),a6 + CALL DisownBlitter + suba.l a1,a1 + CALL LoadView + CALL WaitTOF + ELSE + suba.l a1,a1 + CALL LoadView + CALL WaitTOF + ENDC + + CALL OwnBlitter + move.l a5,a6 + + CALL Forbid + CALL Disable + + PUTMSG 10,<"OS off"> + + bsr os_GetVbr + + lea $dff000,a5 + exg a4,a6 ; from now on, a6 is supposed to be our framework pointer, a5 is _custom + move.l a0,fw_VBR(a6) + move.l $6c(a0),fw_OldSystemVBlankIRQ(a6) + + move.w #$7fff,d4 + move.w intenar(a5),d0 + move.w d4,intena(a5) + move.w d4,intena(a5) + or.w #INTF_SETCLR,d0 + move.w intreqr(a5),d1 + move.w d4,intreq(a5) + move.w d4,intreq(a5) + or.w #INTF_SETCLR,d1 + move.w dmaconr(a5),d2 + move.w #DMAF_MASTER|DMAF_ALL,dmacon(a5) + or.w #DMAF_SETCLR,d2 + move.w adkconr(a5),d3 + move.w d4,adkcon(a5) + or.w #ADKF_SETCLR,d3 + movem.w d0-d3,fw_OldControls(a6) + + bsr fw_SetBaseCopper + movem.l fw_EmptyRegs(a6),d0-d7/a0-a4 + rts + + IF 0 +.nopirq + move.w #$f00,$dff180 + rts + +.ciabname + dc.b 'ciab.resource',0 + even + ENDC + + IF FW_DO_FANCY_WORKBENCH_STUFF +os_SysFriendlyVbl: + addq.w #1,fw_FrameCounter(a1) + move.l fw_VBlankIRQ(a1),d0 + beq.s .skip + PUSHM a2-a4/d2-d7 + move.l a1,a6 + lea $dff000,a5 + move.l d0,a0 + jsr (a0) + POPM + move.l a5,a0 + moveq.l #0,d0 +.skip rts + ENDC + +os_GetVbr: + suba.l a0,a0 + move.w AttnFlags(a6),d0 + btst #AFB_68010,d0 + beq.s .novbr + lea .getvbr(pc),a5 + CALL Supervisor +.novbr rts + + machine mc68010 +.getvbr + movec.l vbr,a0 + rte + machine mc68000 + +;-------------------------------------------------------------------- + +os_AppAbort: + addq.l #4,sp + move.l 4.w,a6 + move.l fw_BasePtr(pc),a4 + bra os_CleanUp + +os_AppShutdown: + PUTMSG 10,<"AppShutdown"> + IF FW_MUSIC_SUPPORT + bsr fw_StopMusic + ENDC + BLTWAIT + bsr fw_SetBaseCopper + + move.w #$7fff,d0 + move.w d0,intena(a5) + move.w d0,intena(a5) + move.w d0,intreq(a5) + move.w d0,intreq(a5) + move.w #DMAF_MASTER|DMAF_ALL,dmacon(a5) + move.w d0,adkcon(a5) + + move.l fw_VBR(a6),a0 + move.l fw_OldSystemVBlankIRQ(a6),$6c(a0) + + movea.l fw_GfxBase(a6),a0 ; graphics.library + move.l $26(a0),cop1lc(a5) + move.l $26(a0),cop2lc(a5) + move.w d0,copjmp1(a5) + movem.w fw_OldControls(a6),d0-d3 + move.w d3,adkcon(a5) + move.w d2,dmacon(a5) + move.w d1,intreq(a5) + move.w d0,intena(a5) + + move.l a6,a4 + move.l 4.w,a6 + CALL Enable + CALL Permit + + move.l a6,a5 + movea.l fw_GfxBase(a4),a6 ; graphics.library + CALL DisownBlitter + move.l fw_OldGfxView(a4),a1 + CALL LoadView + + IF 0 + move.l fw_CiaBResource(a4),a6 + move.l fw_SysFriendlyInterrupt(a4),a1 + moveq.l #CIAICRB_TB,d0 + CALL RemICRVector + ENDC + + move.l a5,a6 + PUTMSG 10,<"OS on"> + IF FW_DO_FANCY_WORKBENCH_STUFF + PUSHM a4-a6 + exg a4,a6 + bsr postentrypoint + POPM + ENDC + moveq.l #0,d7 + +os_CleanUp: + move.l fw_OrigFastMemAllocAddr(a4),d0 + beq.s .nofreefast + move.l d0,a1 + move.l fw_OrigFastMemAllocLength(a4),d0 + CALL FreeMem + +.nofreefast + move.l fw_OrigChipMemAllocAddr(a4),d0 + beq.s .nofreechip + move.l d0,a1 + move.l fw_OrigChipMemAllocLength(a4),d0 + CALL FreeMem + +.nofreechip + move.l fw_WBMessage(a4),d2 + move.l fw_OrigBaseMemAllocAddr(a4),a1 + move.l fw_OrigBaseMemAllocLength(a4),d0 + CALL FreeMem + + tst.l d2 + beq.s .nowb + CALL Forbid + move.l d2,a1 + CALL ReplyMsg +.nowb + + PUTMSG 10,<"Done with code %d">,d7 + move.w d7,d0 + ext.l d0 + rts diff --git a/source/framework/trackmo_startupcode.asm b/source/framework/trackmo_startupcode.asm new file mode 100644 index 0000000..71a61cd --- /dev/null +++ b/source/framework/trackmo_startupcode.asm @@ -0,0 +1,182 @@ + include "exec/libraries.i" + include "exec/memory.i" + +;-------------------------------------------------------------------- +; startup code +;-------------------------------------------------------------------- + + IF FW_LMB_EXIT_SUPPORT + fail "FW_LMB_EXIT_SUPPORT cannot be provided" + ENDC + +trackmo_AppInit: + lea fw_Base(pc),a4 + lea fw_BasePtr(pc),a0 + move.l a4,(a0) + PUTMSG 10,<"*** FW Base %p, FW BasePtr %p">,a4,a0 + + move.l 4.w,a6 + IF FW_TD_FREE_MEM_HACK + ; try to free trackdisk buffers. These are attached to the task structure of the trackdisk.device tasks. + ; The trackdisk.device does not support expunge, so this is the best hack I can think of. + ; (This will only return a small non-continuous block of chip mem, about 17 KB for each drive). + CALL Forbid +.tdloop + lea .trackdiskname(pc),a1 + CALL FindTask + tst.l d0 + beq.s .notd + move.l d0,a1 + PUTMSG 10,<"Removing trackdisk.device task %p">,a1 + CALL RemTask + bra.s .tdloop +.notd CALL Permit + ENDC + + cmp.l MaxLocMem(a6),a6 + blt.s .nofast ; exec is NOT is fast memory -> not safe to claim whole chipmem + ; claim available fast mem + move.l #(MEMF_LARGEST|MEMF_FAST),d1 + CALL AvailMem + move.l d0,d2 + beq.s .nofast + move.l #(MEMF_LARGEST|MEMF_FAST|MEMF_CLEAR),d1 + CALL AllocMem + move.l d0,fw_FastMemStack(a4) + bne.s .goodmem +.memerr + move.w #$800,$dff180 + bra.s .memerr +.nofast + move.l #(MEMF_LARGEST|MEMF_CHIP),d1 + CALL AvailMem + move.l d0,d2 + beq.s .memerr + move.l #(MEMF_CHIP|MEMF_CLEAR),d1 + CALL AllocMem + addq.l #7,d0 + and.w #-8,d0 + move.l d0,fw_ChipMemStack(a4) + and.w #-8,d2 + add.l d2,d0 + move.l d0,fw_ChipMemStackEnd(a4) + + move.l #(MEMF_LARGEST|MEMF_ANY),d1 + CALL AvailMem + move.l d0,d2 + beq.s .memerr + move.l #MEMF_CLEAR,d1 + CALL AllocMem + move.l d0,fw_FastMemStack(a4) + add.l d2,d0 + move.l d0,fw_FastMemStackEnd(a4) + bra.s .altmem +.goodmem + add.l d2,d0 + move.l d0,fw_FastMemStackEnd(a4) + + ; since our stuff is probably all in fast mem right now, we can take over the complete chipmem + lea $400.w,a0 + move.l a0,fw_ChipMemStack(a4) + move.l MaxLocMem(a6),fw_ChipMemStackEnd(a4) +.altmem + + bsr trackmo_GetVbr + move.l a0,fw_VBR(a4) + ;move.l $6c(a0),fw_OldSystemVBlankIRQ(a4) + + lea $dff000,a5 + + move.w vposr(a5),d0 + btst #9,d0 + beq.s .noaga + move.w #-1,fw_AgaChipset(a4) +.noaga + + move.w #$7fff,d0 + move.w d0,intena(a5) + move.w d0,intena(a5) + move.w d0,intreq(a5) + move.w d0,intreq(a5) + move.w #DMAF_MASTER|DMAF_ALL,dmacon(a5) + move.w d0,adkcon(a5) + move.w #%0000111100000000,potgo(a5) + + move.l a4,fw_PartFwBase(a4) + move.l a4,fw_PrimaryFwBase(a4) + move.l a4,a6 ; from now on, a6 is supposed to be our framework pointer, a5 is _custom + + bsr fw_InitMemoryManagement + + IF FW_MULTITASKING_SUPPORT + bsr fw_InitTasks + move.l #ft_SIZEOF,d0 + bsr fw_AllocFast + move.l a0,fw_TrackloaderTask(a6) + ENDC + + moveq.l #mfw_copperlistend-mfw_copperlist,d0 + bsr fw_AllocChip + move.l a0,d0 + move.l d0,fw_BaseCopperlist(a6) + move.l d0,a1 + + lea mfw_copperlist(pc),a0 + moveq.l #(mfw_copperlistend-mfw_copperlist)/4-1,d7 +.cpyloop + move.l (a0)+,(a1)+ + dbra d7,.cpyloop + + subq.l #4,a1 + move.l a1,fw_EmptySprite(a6) + + lea fw_vblank_standard_irq(pc),a0 + move.l a0,fw_DefaultIRQ(a6) + + bsr fw_SetBaseCopper + + IF FW_SINETABLE_SUPPORT + bsr fw_InitSineTable + ENDC + + bsr fw_InitTrackLoader + bsr fw_InitDos + + IF FW_MUSIC_SUPPORT + IF (FW_MUSIC_PLAYER_CHOICE==4)||(FW_MUSIC_PLAYER_CHOICE==5) + bsr fw_MusicAlloc + ENDC + ENDC + + bsr fw_PushMemoryState + + movem.l fw_EmptyRegs(a6),d0-d7/a0-a4 + rts + + IF FW_TD_FREE_MEM_HACK +.trackdiskname + dc.b 'trackdisk.device',0 + even + +trackmo_GetVbr: + suba.l a0,a0 + move.w AttnFlags(a6),d0 + btst #AFB_68010,d0 + beq.s .novbr + lea .getvbr(pc),a5 + CALL Supervisor +.novbr rts + + machine mc68010 +.getvbr + movec.l vbr,a0 + rte + machine mc68000 + ENDC + +;-------------------------------------------------------------------- + +trackmo_AppShutdown: + bsr fw_SetBaseCopper + bsr fw_TrackloaderDiskMotorOff + rts diff --git a/source/framework/unpackers/doynax.asm b/source/framework/unpackers/doynax.asm new file mode 100644 index 0000000..f03b3d6 --- /dev/null +++ b/source/framework/unpackers/doynax.asm @@ -0,0 +1,190 @@ +;------------------------------------------------------------------------------- +;Lempel-Ziv decompressor by Johan "Doynax" Forslöf. Call doynamitedepack to decode the entire buffer in +;one go. +; +;This is a fork of the 68000 depacker by Michael Hillebrandt (Axis/Oxyron) +;for the 6502 Doynamite format, except with the encoding rearranged to take +;somewhat better advantage of the 68k architecture. +; +;The present version is 210 bytes long including the tables and should fit +;snugly in the 68020+ cache. +; +;Note that the scheme with a split input stream for odd literal bytes requires +;a significant safety buffer for forward in-place decompression (about 3% but +;dependent on the file to be processed) +; +;Parameters: +;a0 = Input buffer to be decompressed. Must be 16-bit aligned! +;a1 = Output buffer. Points to the end of the data at exit +; +;Register legend: +;d0 = 32-bit shift register terminated by a least-significant 1 bit. +;d1 = Run length. +;d2 = Match offset length in bits. +;d3 = Match offset bitmask. +;d4 = Constant offset length bit mask. +;a0 = Bit-stream pointer. +;a1 = Continuous output pointer. +;a2 = Unaligned literal pointer ahead of the bit-stream. Points to the end of +; the source buffer at exit. +;a3 = Mid-point where the literal buffer meets the bit-stream at EOF +;a4 = Match source pointer. +;------------------------------------------------------------------------------- + ;Ensure that the shift-register contains at least 16-bits of data by + ;checking whether the trailing word is zero, and if so filling up with + ;another word +DOY_REFILL macro + DOY_REFILL1 .full\@ + DOY_REFILL2 +.full\@ + endm + +DOY_REFILL1 macro + tst.w d0 + bne.s \1 + endm + +DOY_REFILL2 macro ;This swaps in the new bits ahead of the + move.w (a0)+,d0 ;old, but that's fine as long as the + swap.w d0 ;encoder is in on the scheme + endm + + ;Entry point. Wind up the decruncher +doynaxdepack: + PUSHM d4/a4 + movea.l (a0)+,a2 ;Unaligned literal buffer at the end of + adda.l a0,a2 ;the stream + move.l a2,a3 + move.l (a0)+,d0 ;Seed the shift register + moveq.l #@10,d4 + bra.s .literal +.return + POPM + rts + + ;******** Copy a literal sequence ******** + +.lcopy ;Copy two bytes at a time, with the + move.b (a0)+,(a1)+ ;deferral of the length LSB helping + move.b (a0)+,(a1)+ ;slightly in the unrolling + dbra d1,.lcopy + + lsl.l #2,d0 ;Copy odd bytes separately in order + bcc.s .match ;to keep the source aligned +.lsingle + move.b (a2)+,(a1)+ + + ;******** Process a match ******** + + ;Start by refilling the bit-buffer +.match + DOY_REFILL1 .mprefix + cmp.l a0,a3 ;Take the opportunity to test for the + bls.s .return ;end of the stream while refilling +.mrefill + DOY_REFILL2 + +.mprefix + ;Fetch the first three bits identifying the match length, and look up + ;the corresponding table entry + rol.l #3+3,d0 + moveq.l #@70,d1 + and.w d0,d1 + eor.w d1,d0 + movem.w doy_table(pc,d1.w),d2/d3/a4 + + ;Extract the offset bits and compute the relative source address from it + rol.l d2,d0 ;Reduced by 3 to account for 8x offset + and.w d0,d3 ;scaling + eor.w d3,d0 + suba.w d3,a4 + adda.l a1,a4 + + ;Decode the match length + DOY_REFILL + and.w d4,d1 ;Check the initial length bit from the + beq.s .mcopy ;type triple + + moveq.l #1,d1 ;This loops peeks at the next flag + tst.l d0 ;through the sign bit bit while keeping + bpl.s .mendlen2 ;the LSB in carry + lsl.l #2,d0 + bpl.s .mendlen1 +.mgetlen + addx.b d1,d1 + lsl.l #2,d0 + bmi.s .mgetlen +.mendlen1 + addx.b d1,d1 +.mendlen2 + + ;Copy the match data a word at a time. Note that the minimum length is + ;two bytes + lsl.l #2,d0 ;The trailing length payload bit is + bcc.s .mhalf ;stored out-of-order +.mcopy + move.b (a4)+,(a1)+ +.mhalf + move.b (a4)+,(a1)+ + dbra d1,.mcopy + + ;Fetch a bit flag to see whether what follows is a literal run or + ;another match + add.l d0,d0 + bcc.s .match + + ;******** Process a run of literal bytes ******** + + DOY_REFILL ;Replenish the shift-register +.literal + ;Extract delta-coded run length in the same swizzled format as the + ;matches above + moveq #0,d1 + add.l d0,d0 + bcc.s .lsingle ;Single out the one-byte case + bpl.s .lendlen +.lgetlen + addx.b d1,d1 + lsl.l #2,d0 + bmi.s .lgetlen +.lendlen + addx.b d1,d1 + + ;Branch off to the main copying loop unless the run length is 256 bytes + ;or greater, in which case the sixteen guaranteed bits in the buffer + ;may have run out. + ;In the latter case simply give up and stuff the payload bits back onto + ;the stream before fetching a literal 16-bit run length instead +.lcopy_near + dbvs d1,.lcopy + + add.l d0,d0 + eor.w d1,d0 + ror.l #7+1,d0 ;Note that the constant MSB acts as a + move.w (a0)+,d1 ;substitute for the unfetched stop bit + bra.s .lcopy_near + + ;******** Offset coding tables ******** + +DOY_OFFSET macro + dc.w (\1)-3 ;Bit count, reduced by three + dc.w (1<<(\1))-1 ;Bit mask + dc.w -(\2) ;Base offset + endm + +doy_table: + DOY_OFFSET 3,1 ;Short A + dc.w 0 + DOY_OFFSET 4,1 ;Long A + dc.w 0 ;(Empty hole) + DOY_OFFSET 6,1+8 ;Short B + dc.w 0 ;(Empty hole) + DOY_OFFSET 7,1+16 ;Long B + dc.w 0 ;(Empty hole) + DOY_OFFSET 8,1+8+64 ;Short C + dc.w 0 ;(Empty hole) + DOY_OFFSET 10,1+16+128 ;Long C + dc.w 0 ;(Empty hole) + DOY_OFFSET 10,1+8+64+256 ;Short D + dc.w 0 ;(Empty hole) + DOY_OFFSET 13,1+16+128+1024 ;Long D \ No newline at end of file diff --git a/source/framework/unpackers/lz4_normal.asm b/source/framework/unpackers/lz4_normal.asm new file mode 100644 index 0000000..db40bb3 --- /dev/null +++ b/source/framework/unpackers/lz4_normal.asm @@ -0,0 +1,104 @@ +;--------------------------------------------------------- +; +; LZ4 block 68k depacker +; Written by Arnaud Carré ( @leonard_coder ) +; https://github.com/arnaud-carre/lz4-68k +; +; LZ4 technology by Yann Collet ( https://lz4.github.io/lz4/ ) +; +;--------------------------------------------------------- + +; Normal version: 180 bytes ( 1.53 times faster than lz4_smallest.asm ) +; +; input: a0.l : packed buffer +; a1.l : output buffer +; d0.l : LZ4 packed block size (in bytes) +; +; output: a1.l pointing to end of output buffer +; + +lz4_depack: + lea (a0,d0.l),a2 ; packed buffer end + + moveq.l #0,d0 + moveq.l #0,d2 + moveq.l #0,d3 + moveq.l #15,d4 + bra.s .tokenLoop + +.lenOffset + move.b (a0)+,d1 ; read 16bits offset, little endian, unaligned + move.b (a0)+,-(sp) + move.w (sp)+,d3 + move.b d1,d3 + movea.l a1,a3 + sub.l d3,a3 + moveq.l #$f,d1 + and.w d0,d1 + cmp.b d4,d1 + bne.s .small + +.readLen0 + move.b (a0)+,d2 + add.l d2,d1 + not.b d2 + beq.s .readLen0 + + addq.l #4,d1 +.copy + move.b (a3)+,(a1)+ + subq.l #1,d1 + bne.s .copy + bra .tokenLoop + +.small + add.w d1,d1 + neg.w d1 + jmp .copys(pc,d1.w) + REPT 15 + move.b (a3)+,(a1)+ + ENDR +.copys + move.b (a3)+,(a1)+ + move.b (a3)+,(a1)+ + move.b (a3)+,(a1)+ + move.b (a3)+,(a1)+ + +.tokenLoop + move.b (a0)+,d0 + move.l d0,d1 + lsr.b #4,d1 + beq.s .lenOffset + cmp.b d4,d1 + beq.s .readLen1 + +.litcopys + add.w d1,d1 + neg.w d1 + jmp .copys2(pc,d1.w) + REPT 15 + move.b (a0)+,(a1)+ + ENDR +.copys2 + cmpa.l a0,a2 + bne .lenOffset + rts + +.readLen1 + move.b (a0)+,d2 + add.l d2,d1 + not.b d2 + beq.s .readLen1 + +.litcopy + move.b (a0)+,(a1)+ + subq.l #1,d1 + bne.s .litcopy + + ; end test is always done just after literals + cmpa.l a0,a2 + bne .lenOffset + +.over + rts + diff --git a/source/framework/unpackers/zx0.asm b/source/framework/unpackers/zx0.asm new file mode 100644 index 0000000..2645472 --- /dev/null +++ b/source/framework/unpackers/zx0.asm @@ -0,0 +1,77 @@ +; unzx0_68000.s - ZX0 decompressor for 68000 - 80 bytes +; Modified to not preserve registers! +; +; in: a0 = start of compressed data +; a1 = start of decompression buffer +; +; Copyright (C) 2021 Emmanuel Marty +; ZX0 compression (c) 2021 Einar Saukas, https://github.com/einar-saukas/ZX0 +; +; This software is provided 'as-is', without any express or implied +; warranty. In no event will the authors be held liable for any damages +; arising from the use of this software. +; +; Permission is granted to anyone to use this software for any purpose, +; including commercial applications, and to alter it and redistribute it +; freely, subject to the following restrictions: +; +; 1. The origin of this software must not be misrepresented; you must not +; claim that you wrote the original software. If you use this software +; in a product, an acknowledgment in the product documentation would be +; appreciated but is not required. +; 2. Altered source versions must be plainly marked as such, and must not be +; misrepresented as being the original software. +; 3. This notice may not be removed or altered from any source distribution. + +zx0_decompress: + ;movem.l a2/d2,-(sp) ; preserve registers + moveq #-128,d1 ; initialize empty bit queue + ; plus bit to roll into carry + moveq #-1,d2 ; initialize rep-offset to 1 + +.literals: bsr.s .get_elias ; read number of literals to copy + subq.l #1,d0 ; dbf will loop until d0 is -1, not 0 +.copy_lits: move.b (a0)+,(a1)+ ; copy literal byte + dbf d0,.copy_lits ; loop for all literal bytes + + add.b d1,d1 ; read 'match or rep-match' bit + bcs.s .get_offset ; if 1: read offset, if 0: rep-match + +.rep_match: bsr.s .get_elias ; read match length (starts at 1) +.do_copy: subq.l #1,d0 ; dbf will loop until d0 is -1, not 0 +.do_copy_offs: move.l a1,a2 ; calculate backreference address + add.l d2,a2 ; (dest + negative match offset) +.copy_match: move.b (a2)+,(a1)+ ; copy matched byte + dbf d0,.copy_match ; loop for all matched bytes + + add.b d1,d1 ; read 'literal or match' bit + bcc.s .literals ; if 0: go copy literals + +.get_offset: moveq #-2,d0 ; initialize value to $fe + bsr.s .elias_loop ; read high byte of match offset + addq.b #1,d0 ; obtain negative offset high byte + beq.s .done ; exit if EOD marker + move.w d0,d2 ; transfer negative high byte into d2 + lsl.w #8,d2 ; shift it to make room for low byte + + moveq #1,d0 ; initialize length value to 1 + move.b (a0)+,d2 ; read low byte of offset + 1 bit of len + asr.l #1,d2 ; shift len bit into carry/offset in place + bcs.s .do_copy_offs ; if len bit is set, no need for more + bsr.s .elias_bt ; read rest of elias-encoded match length + bra.s .do_copy_offs ; go copy match + +.get_elias: moveq #1,d0 ; initialize value to 1 +.elias_loop: add.b d1,d1 ; shift bit queue, high bit into carry + bne.s .got_bit ; queue not empty, bits remain + move.b (a0)+,d1 ; read 8 new bits + addx.b d1,d1 ; shift bit queue, high bit into carry + ; and shift 1 from carry into bit queue + +.got_bit: bcs.s .got_elias ; done if control bit is 1 +.elias_bt: add.b d1,d1 ; read data bit + addx.l d0,d0 ; shift data bit into value in d0 + bra.s .elias_loop ; keep reading + +.done: ;movem.l (sp)+,a2/d2 ; restore preserved registers +.got_elias: rts \ No newline at end of file diff --git a/source/framework/unpackers/zx0_faster.asm b/source/framework/unpackers/zx0_faster.asm new file mode 100644 index 0000000..0b36702 --- /dev/null +++ b/source/framework/unpackers/zx0_faster.asm @@ -0,0 +1,145 @@ +; unzx0_68000.s - ZX0 decompressor for 68000 +; +; platon42: Modified to not preserve registers and to not use long word operations with +; unlikely and unsupported block lengths > 64 KB. get_elias inlined for speed and other +; optimizations. +; +; in: a0 = start of compressed data +; a1 = start of decompression buffer +; +; out: a0 = end of compressed data +; a1 = end of decompression buffer +; +; trashes: d0-d2/a2 +; +; Copyright (C) 2021 Emmanuel Marty +; Copyright (C) 2023 Emmanuel Marty, Chris Hodges +; ZX0 compression (c) 2021 Einar Saukas, https://github.com/einar-saukas/ZX0 +; +; This software is provided 'as-is', without any express or implied +; warranty. In no event will the authors be held liable for any damages +; arising from the use of this software. +; +; Permission is granted to anyone to use this software for any purpose, +; including commercial applications, and to alter it and redistribute it +; freely, subject to the following restrictions: +; +; 1. The origin of this software must not be misrepresented; you must not +; claim that you wrote the original software. If you use this software +; in a product, an acknowledgment in the product documentation would be +; appreciated but is not required. +; 2. Altered source versions must be plainly marked as such, and must not be +; misrepresented as being the original software. +; 3. This notice may not be removed or altered from any source distribution. + +zx0_decompress: + moveq.l #-128,d1 ; initialize empty bit queue + ; plus bit to roll into carry + moveq.l #-1,d2 ; initialize rep-offset to 1 + bra.s .literals + +.do_copy_offs2 + move.b (a1,d2.l),(a1)+ + move.b (a1,d2.l),(a1)+ + + add.b d1,d1 ; read 'literal or match' bit + bcs.s .get_offset ; if 0: go copy literals + +.literals + ; read number of literals to copy + moveq.l #1,d0 ; initialize value to 1 +.elias_loop1 + add.b d1,d1 ; shift bit queue, high bit into carry + bne.s .got_bit1 ; queue not empty, bits remain + move.b (a0)+,d1 ; read 8 new bits + addx.b d1,d1 ; shift bit queue, high bit into carry + ; and shift 1 from carry into bit queue + +.got_bit1 + bcs.s .got_elias1 ; done if control bit is 1 + add.b d1,d1 ; read data bit + addx.w d0,d0 ; shift data bit into value in d0 + bra.s .elias_loop1 ; keep reading + +.got_elias1 + subq.w #1,d0 ; dbf will loop until d0 is -1, not 0 +.copy_lits + move.b (a0)+,(a1)+ ; copy literal byte + dbra d0,.copy_lits ; loop for all literal bytes + + add.b d1,d1 ; read 'match or rep-match' bit + bcs.s .get_offset ; if 1: read offset, if 0: rep-match + +.rep_match + ; read match length (starts at 1) + moveq.l #1,d0 ; initialize value to 1 +.elias_loop2 + add.b d1,d1 ; shift bit queue, high bit into carry + bne.s .got_bit2 ; queue not empty, bits remain + move.b (a0)+,d1 ; read 8 new bits + addx.b d1,d1 ; shift bit queue, high bit into carry + ; and shift 1 from carry into bit queue + +.got_bit2 + bcs.s .got_elias2 ; done if control bit is 1 + add.b d1,d1 ; read data bit + addx.w d0,d0 ; shift data bit into value in d0 + bra.s .elias_loop2 ; keep reading + +.got_elias2 + subq.w #1,d0 ; dbra will loop until d0 is -1, not 0 +.do_copy_offs + move.l a1,a2 ; calculate backreference address + add.l d2,a2 ; (dest + negative match offset) +.copy_match + move.b (a2)+,(a1)+ ; copy matched byte + dbra d0,.copy_match ; loop for all matched bytes + + add.b d1,d1 ; read 'literal or match' bit + bcc.s .literals ; if 0: go copy literals + +.get_offset + moveq.l #-2,d0 ; initialize value to $fe + + ; read high byte of match offset +.elias_loop3 + add.b d1,d1 ; shift bit queue, high bit into carry + bne.s .got_bit3 ; queue not empty, bits remain + move.b (a0)+,d1 ; read 8 new bits + addx.b d1,d1 ; shift bit queue, high bit into carry + ; and shift 1 from carry into bit queue + +.got_bit3 + bcs.s .got_elias3 ; done if control bit is 1 + add.b d1,d1 ; read data bit + addx.w d0,d0 ; shift data bit into value in d0 + bra.s .elias_loop3 ; keep reading + +.got_elias3 + addq.b #1,d0 ; obtain negative offset high byte + beq.s .done ; exit if EOD marker + move.b d0,-(sp) ; transfer negative high byte to stack + move.w (sp)+,d2 ; shift it to make room for low byte + + move.b (a0)+,d2 ; read low byte of offset + 1 bit of len + asr.l #1,d2 ; shift len bit into carry/offset in place + bcs.s .do_copy_offs2 ; if len bit is set, no need for more + moveq.l #1,d0 ; initialize length value to 1 + ; read rest of elias-encoded match length + add.b d1,d1 ; read data bit + addx.w d0,d0 ; shift data bit into value in d0 + +.elias_loop4 + add.b d1,d1 ; shift bit queue, high bit into carry + bne.s .got_bit4 ; queue not empty, bits remain + move.b (a0)+,d1 ; read 8 new bits + addx.b d1,d1 ; shift bit queue, high bit into carry + ; and shift 1 from carry into bit queue + +.got_bit4 + bcs.s .do_copy_offs ; done if control bit is 1 + add.b d1,d1 ; read data bit + addx.w d0,d0 ; shift data bit into value in d0 + bra.s .elias_loop4 ; keep reading +.done + rts diff --git a/source/gotham/aga.bat b/source/gotham/aga.bat new file mode 100644 index 0000000..632ca5f --- /dev/null +++ b/source/gotham/aga.bat @@ -0,0 +1,30 @@ +del gotham.exe +del "..\winuae\hd0\gotham.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "gotham.exe" "gotham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy gotham.exe "..\winuae\hd0" +copy gotham.exe "..\winuae\hd0\a" + +@echo /|set /p =gotham.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/gotham/assemble.bat b/source/gotham/assemble.bat new file mode 100644 index 0000000..c383cef --- /dev/null +++ b/source/gotham/assemble.bat @@ -0,0 +1,37 @@ +del gotham.exe +del "..\winuae\hd0\gotham.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +pushd .. + +tools\KingCon.exe @data/gotham/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +vc -O2 -notmpfile -nostdlib -o "gotham.exe" "gotham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy gotham.exe "..\winuae\hd0" +copy gotham.exe "..\winuae\hd0\a" + +@echo /|set /p =gotham.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/gotham/blitterline_bq.asm b/source/gotham/blitterline_bq.asm new file mode 100644 index 0000000..1c033df --- /dev/null +++ b/source/gotham/blitterline_bq.asm @@ -0,0 +1,160 @@ +;---------------------------------------------------------------------------------- +; Draw regular blitter line +; +; The routine will exit with the blitter active +; +; in d0.w x0 +; d1.w y0 +; d2.w x1 +; d3.w y1 +; d4.w bytes per row in bitplane +; a0 bitplane +; a5 $dff000 +; a0/d0-d5 trashed + +gth_blitter_line_init_bq: + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + lea .init(pc),a1 + move.l a1,(a4)+ + rts +.init + PUTMSG 50,<"Line Init"> + moveq.l #-1,d0 + move.w #BLTCON1F_LINE,bltcon1(a5) + move.w #$8000,bltadat(a5) + move.l d0,bltafwm(a5) + move.w pd_LinePattern(a6),bltbdat(a5) + move.w #(GOTHAM_WIDTH/8),bltcmod(a5) + BLTHOGON + moveq.l #0,d0 + rts + +;---------------------------------------------------------------------------------- +; Draw antialiased blitter line +; +; The routine will exit with the blitter active +; +; in d0.w x0 +; d1.w y0 +; d2.w x1 +; d3.w y1 +; a0 bitplane 1 +; a0/a1/d0-d5 trashed + +gth_draw_blitter_line_aa_bq: + cmp.w d1,d3 + beq.s .checkzero + bge.s .downward + exg d0,d2 + exg d1,d3 + bra.s .downward +.checkzero + cmp.w d0,d2 + bne.s .downward + rts +.downward + + move.w d1,d5 + ;add.w d5,d5 + ;lea pd_MulTable(a6),a1 + ;move.w (a1,d5.w),d5 + mulu #(GOTHAM_WIDTH/8),d5 + lea (a0,d5.w),a1 + + moveq.l #-16,d4 + and.w d0,d4 + lsr.w #3,d4 + adda.w d4,a1 + + moveq.l #15,d4 + and.w d0,d4 + ror.w #4,d4 + or.w #BLTCON0F_USEA|BLTCON0F_USEC|BLTCON0F_USED|(BLT_A&BLT_B|BLT_C),d4 + swap d4 + + sub.w d0,d2 + bpl.s .positiveDX + neg.w d2 + addq.w #1,d4 +.positiveDX + sub.w d1,d3 + cmp.w d2,d3 + bls.s .absDyLessThanAbsDx + exg d2,d3 + addq.w #4,d4 +.absDyLessThanAbsDx + move.b .octants(pc,d4.w),d4 + + add.w d3,d3 ; 2 * dy + move.w d3,d5 + sub.w d2,d5 ; 2 * dy - dx + bpl.s .positiveGradient + or.w #BLTCON1F_SIGN,d4 +.positiveGradient + add.w d5,d5 ; 4 * dy - 2 * dx + add.w d2,d2 ; 2 * dx + add.w d2,d2 ; 4 * dx + add.w d3,d3 ; 4 * dy + + move.w d3,d0 + sub.w d2,d3 ; 4 * (dy - dx) + + addq.w #4,d2 ; extra word height + lsl.w #4,d2 + addq.w #2,d2 ; width == 2 + + moveq.l #0,d1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + move.l d1,(a4)+ + move.l #.bq_routine1,(a4)+ + move.l d4,(a4)+ ; bql_BltCon01 + move.l a1,(a4)+ ; bql_BltCPt + move.w d0,(a4)+ ; bql_BltBMod, 4 * dy + move.w d3,(a4)+ ; bql_BltAMod, 4 * (dy - dx) + move.w d5,(a4)+ ; bql_BltAPtLo, 4 * dy - 2 * dx + move.l a1,(a4)+ ; bql_BltDPt + move.w d2,(a4)+ ; bql_BltSize + lea (GOTHAM_WIDTH/8)*GOTHAM_HEIGHT(a1),a1 + ;sub.w #1<<6,d2 + ;bmi.s .skip2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + move.l d1,(a4)+ + move.l #.bq_routine2,(a4)+ + or.w #1<,a0 + move.l (a0)+,bltcon0(a5) + move.l (a0)+,bltcpt(a5) + move.l (a0)+,bltbmod(a5) + move.l (a0)+,bltapt+2(a5) + move.l (a0)+,bltdpt+2(a5) + rts + +.bq_routine2 + PUTMSG 50,<"LineDraw AA %p">,a0 + move.l (a0)+,bltcon0(a5) + move.l (a0)+,bltcpt(a5) + move.l (a0)+,bltapt+2(a5) + move.l (a0)+,bltdpt+2(a5) + rts diff --git a/source/gotham/clipping.asm b/source/gotham/clipping.asm new file mode 100644 index 0000000..67f2236 --- /dev/null +++ b/source/gotham/clipping.asm @@ -0,0 +1,95 @@ +; QuickClip +; +; d0.w/d1.w = x1/y1 +; d2.w/d3.w = y2/y2 +; d4.w/d5.w = maxx/maxy + +CLIPACCEPTCHECK MACRO + tst.w \2 + blt.s .reject ; xe < 0 + cmp.w d4,\1 + bgt.s .reject ; xs > maxx + tst.w d3 + blt.s .reject ; ye < 0 + cmp.w d5,d1 + bgt.s .reject ; ys > maxy + ENDM + +DOCLIPLOW MACRO + tst.w \1 + bge.s .nocliplow\@ ; xs > 0 + ; if ((y0+=(xL-x0)*(y1-y0)/(x1-x0)) > yT) return + sub.w \2,\4 ; dy + beq.s .reject + move.w \3,d6 + sub.w \1,d6 ; dx + beq.s .reject + muls \4,\1 ; dy*xs + divs d6,\1 ; (dy*xs)/dx + bvs.s .reject + add.w \2,\4 ; restore ye + sub.w \1,\2 ; ys += (dy*xs)/dx + blt.s .reject + cmp.w \5,\2 + bhi.s .reject + moveq.l #0,\1 ; xs = 0 +.nocliplow\@ + ENDM + +DOCLIPHIGH MACRO + cmp.w \3,\5 + bge.s .nocliphigh\@ + ; y1 = y0 + (xR-x0)*(y1-y0)/(x1-x0); x1 = xR; + sub.w \1,\3 ; dx + move.w \4,d6 + sub.w \2,d6 ; dy + beq.s .reject + move.w \5,\4 ; overwrites ye + sub.w \1,\4 ; maxx-xs + beq.s .reject + muls d6,\4 ; dy*(maxx-xs) + divs \3,\4 ; dy*(maxx-xs)/dx + bvs.s .reject + add.w \2,\4 ; y1 = y0 + dy*(maxx-xs)/dx + cmp.w \6,\4 + bhi.s .reject + move.w \5,\3 ; xe = maxx +.nocliphigh\@ + ENDM + +DOCLIPCHECK MACRO + DOCLIPLOW d0,d1,d2,d3,d5 + DOCLIPLOW d1,d0,d3,d2,d4 + DOCLIPHIGH d0,d1,d2,d3,d4,d5 + DOCLIPHIGH d1,d0,d3,d2,d5,d4 + ENDM + +gth_clip_line: + cmp.w d1,d3 + bge.s .downward + exg d0,d2 + exg d1,d3 +.downward + cmp.w d0,d2 + bge.s .rightward + CLIPACCEPTCHECK d2,d0 + ; flip horizontally + sub.w d4,d0 + sub.w d4,d2 + neg.w d0 + neg.w d2 + DOCLIPCHECK + sub.w d4,d0 + sub.w d4,d2 + neg.w d0 + neg.w d2 + moveq.l #-1,d4 + rts +.reject + moveq.l #0,d4 + rts +.rightward + CLIPACCEPTCHECK d0,d2 + DOCLIPCHECK + moveq.l #-1,d4 + rts diff --git a/source/gotham/compile.bat b/source/gotham/compile.bat new file mode 100644 index 0000000..98b811c --- /dev/null +++ b/source/gotham/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "gotham.exe" "gotham.asm" diff --git a/source/gotham/debug.bat b/source/gotham/debug.bat new file mode 100644 index 0000000..c4b8b3a --- /dev/null +++ b/source/gotham/debug.bat @@ -0,0 +1,21 @@ +del gotham.exe +del "..\winuae\hd0\gotham.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "gotham.exe" "gotham.asm" + +copy gotham.exe "..\winuae\hd0" +copy gotham.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =gotham.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/gotham/gotham.asm b/source/gotham/gotham.asm new file mode 100644 index 0000000..3c8d934 --- /dev/null +++ b/source/gotham/gotham.asm @@ -0,0 +1,974 @@ +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 0 +FW_MUSIC_PLAYER_CHOICE = 0 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker (CPU DMA wait), 5 = Pretracker Turbo (Copper wait) +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 0 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 308 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 0 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 1 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 0 + + ENDC + +GOTHAM_WIDTH = 320 +GOTHAM_HEIGHT = 180 +GOTHAM_PLANES = 2 + +HAM_TECH_SAMPLE_SIZE = 24064 + +COP_LIST_SIZE = 100*4 +GOTHAM_BQ_SIZE = 2048 + +CHIPMEM_SIZE = COP_LIST_SIZE*2+2*(GOTHAM_WIDTH/8)*GOTHAM_HEIGHT*GOTHAM_PLANES +FASTMEM_SIZE = 2048*4+4*GOTHAM_BQ_SIZE + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + + include "../framework/framework.i" + + +; Memory use: +; Playfields: +; - 320 x 180 x 3 x 2 = 43200 + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrPlanesPtr + APTR pd_LastPlanesPtr + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + APTR pd_CurrBQPtr + APTR pd_LastBQPtr + APTR pd_LastLastBQPtr + UBYTE pd_DbToggle + ALIGNWORD + UWORD pd_BqToggle + + UWORD pd_PartCountDown + UWORD pd_HamRotation + UWORD pd_HamZoom + UWORD pd_LinePattern + BOOL pd_EnableHamZoom + + APTR pd_Blend1Ptr + APTR pd_Blend2Ptr + + APTR pd_CopperList1 + APTR pd_CopperList2 + APTR pd_DbBuffer1 + APTR pd_DbBuffer2 + APTR pd_BQBuffer1 + APTR pd_BQBuffer2 + APTR pd_BQBuffer3 + APTR pd_BQBuffer4 + + APTR pd_HamTechSample + + STRUCT pd_MeanwhilePalette,3*cl_SIZEOF + STRUCT pd_BlendPalette,15*cl_SIZEOF + STRUCT pd_HamTechPalette,15*cl_SIZEOF + + APTR pd_BigSinCosTable + + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + bsr.s gth_init_vars + + lea gth_copperlist,a0 + CALLFW SetCopper + + bsr gth_texts + bsr gth_init_sine_table + bsr gth_main + + CALLFW SetBaseCopper + + rts + +;-------------------------------------------------------------------- + +gth_init_vars: + IFD FW_DEMO_PART + move.l fw_GlobalUserData(a6),pd_HamTechSample(a6) + ELSE + move.l #gth_psenough_ham,pd_HamTechSample(a6) + ENDC + + move.l #(COP_LIST_SIZE*2),d0 + CALLFW AllocChip + + PUTMSG 10,<"Copperlist 1 %p">,a0 + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + lea COP_LIST_SIZE(a0),a0 + PUTMSG 10,<"Copperlist 2 %p">,a0 + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + move.l #2*(GOTHAM_WIDTH/8)*GOTHAM_HEIGHT*GOTHAM_PLANES,d0 + CALLFW AllocChip + PUTMSG 10,<"DbBuffer %p">,a0 + move.l a0,pd_DbBuffer1(a6) + move.l a0,pd_CurrPlanesPtr(a6) + lea (GOTHAM_WIDTH/8)*GOTHAM_HEIGHT*GOTHAM_PLANES(a0),a0 + move.l a0,pd_DbBuffer2(a6) + move.l a0,pd_LastPlanesPtr(a6) + + move.l #2048*4,d0 + CALLFW AllocFast + move.l a0,pd_BigSinCosTable(a6) + + move.l #4*GOTHAM_BQ_SIZE,d0 + CALLFW AllocFast + move.l a0,pd_BQBuffer1(a6) + move.l a0,pd_CurrBQPtr(a6) + clr.l (a0) + lea GOTHAM_BQ_SIZE(a0),a0 + move.l a0,pd_BQBuffer2(a6) + move.l a0,pd_LastBQPtr(a6) + clr.l (a0) + lea GOTHAM_BQ_SIZE(a0),a0 + move.l a0,pd_BQBuffer3(a6) + move.l a0,pd_LastLastBQPtr(a6) + clr.l (a0) + lea GOTHAM_BQ_SIZE(a0),a0 + move.l a0,pd_BQBuffer4(a6) + clr.l (a0) + + rts + +;-------------------------------------------------------------------- + +gth_init_sine_table: + move.l fw_SinTable(a6),a0 + move.l fw_CosTable(a6),a1 + move.w (a1),d2 + move.l pd_BigSinCosTable(a6),a2 + PUTMSG 10,<"BigSinCosTable %p">,a2 + move.w #1023-1,d7 +.bloop + move.w (a0)+,d0 + move.w (a1)+,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + add.w (a0),d0 + add.w (a1),d1 + asr.w #1,d0 + asr.w #1,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + dbra d7,.bloop + + move.w (a0)+,d0 + move.w (a1)+,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + add.w (a0),d0 + add.w d2,d1 + asr.w #1,d0 + asr.w #1,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + rts + +;-------------------------------------------------------------------- + +gth_texts: + move.w #500,pd_PartCountDown(a6) + + move.l #gth_gothamcity_text,pd_Blend1Ptr(a6) + move.l #gth_gotham_text,pd_Blend2Ptr(a6) + + moveq.l #3+15,d0 + moveq.l #0,d1 + lea pd_MeanwhilePalette(a6),a1 + CALLFW InitPaletteLerpSameColor + + moveq.l #3,d0 + moveq.l #32,d1 + lea gth_red_palette(pc),a0 + lea pd_MeanwhilePalette(a6),a1 + CALLFW FadePaletteTo + + lea .script(pc),a0 + CALLFW InstallScript + +.loop CALLFW VSyncWithTask + bsr gth_flip_db_frame + + CALLFW CheckScript + + moveq.l #3,d0 + lea pd_MeanwhilePalette(a6),a1 + CALLFW DoFadePaletteStep + + moveq.l #15,d0 + lea pd_BlendPalette(a6),a1 + CALLFW DoFadePaletteStep + + bsr gth_create_texts_copperlist + + bsr gth_update_copper_list_pointers + + subq.w #1,pd_PartCountDown(a6) + bne .loop + + rts + +.script + dc.w 30,.fade_in_blend1_slow-* + dc.w 160,.fade_in_blend2-* + dc.w 180,.fade_in_blend1-* + dc.w 195,.fade_in_blend2-* + dc.w 220,.fade_in_blend1-* + dc.w 228,.fade_in_blend2-* + dc.w 280,.gotham-* + dc.w 300,.fade_in_blend1-* + dc.w 310,.fade_in_blend2-* + dc.w 330,.fade_in_greenish_blend1-* + dc.w 340,.fade_in_blend2-* + dc.w 355,.fade_in_greenish_blend1-* + dc.w 410,.ham-* + dc.w 420,.fade_out_meanwhile-* + dc.w 425,.fade_in_blend1-* + dc.w 430,.fade_in_greenish_blend1-* + dc.w 435,.fade_in_blend1-* + dc.w 450,.fade_in_blend2-* + dc.w 0 + +.fade_in_blend1 + moveq.l #32,d1 + lea gth_red_blend1_palette(pc),a0 + bra.s .fade + +.fade_in_blend1_slow + moveq.l #64,d1 + lea gth_red_blend1_palette(pc),a0 + bra.s .fade + +.fade_in_greenish_blend1 + moveq.l #32,d1 + lea gth_greenish_blend1_palette(pc),a0 + bra.s .fade + +.fade_in_blend2 + moveq.l #32,d1 + lea gth_red_blend2_palette(pc),a0 +.fade + moveq.l #15,d0 + lea pd_BlendPalette(a6),a1 + CALLFW FadePaletteTo + rts + +.fade_out_meanwhile + moveq.l #3,d0 + moveq.l #32,d1 + lea gth_black_palette(pc),a0 + lea pd_MeanwhilePalette(a6),a1 + CALLFW FadePaletteTo + rts + +.gotham move.l #gth_hameelinna_text,pd_Blend1Ptr(a6) + rts + +.ham move.l #gth_ham_text,pd_Blend2Ptr(a6) + rts + +;-------------------------------------------------------------------- + +gth_main: + move.w #170,pd_PartCountDown(a6) + CALLFW SetBlitterQueueSingleFrame + bsr gth_clear_db_buffers + + move.w #$8000,pd_LinePattern(a6) + move.w #288,pd_HamZoom(a6) + + moveq.l #15,d0 + lea gth_invisible_line_palette(pc),a0 + lea pd_BlendPalette(a6),a1 + CALLFW InitPaletteLerp + + moveq.l #15,d0 + moveq.l #32,d1 + lea gth_white_line_palette(pc),a0 + lea pd_BlendPalette(a6),a1 + CALLFW FadePaletteTo + + moveq.l #15,d0 + lea gth_black_palette(pc),a0 + lea pd_HamTechPalette(a6),a1 + CALLFW InitPaletteLerp + + moveq.l #15,d0 + moveq.l #32,d1 + lea gth_ham_tech_palette(pc),a0 + lea pd_HamTechPalette(a6),a1 + CALLFW FadePaletteTo + + lea .script(pc),a0 + CALLFW InstallScript + + TERMINATE_BLITTER_QUEUE + +.loop CALLFW VSyncWithTask + bsr gth_flip_db_frame + bsr gth_flip_bq_buffer + + move.l pd_LastLastBQPtr(a6),a0 + tst.l (a0) + beq.s .skipempty + BLTWAIT + CALLFW TriggerCustomBlitterQueue +.skipempty + + CALLFW CheckScript + move.l pd_CurrBQPtr(a6),a4 + bsr gth_draw_ham + + TERMINATE_BLITTER_QUEUE + + ror.w pd_LinePattern(a6) + tst.w pd_EnableHamZoom(a6) + beq.s .nohamzoom + move.w pd_HamZoom(a6),d0 + move.w d0,d1 + lsr.w #5,d1 + add.w d1,d0 + move.w d0,pd_HamZoom(a6) +.nohamzoom + + CALLFW JoinBlitterQueue + + BLTWAIT + move.l pd_CurrBQPtr(a6),a0 + CALLFW TriggerCustomBlitterQueue + + bsr gth_fix_bq_for_clear + + moveq.l #15,d0 + lea pd_BlendPalette(a6),a1 + CALLFW DoFadePaletteStep + + moveq.l #15,d0 + lea pd_HamTechPalette(a6),a1 + CALLFW DoFadePaletteStep + + bsr gth_create_main_copperlist + + CALLFW JoinBlitterQueue + + bsr gth_update_copper_list_pointers + + subq.w #1,pd_PartCountDown(a6) + bne .loop + + rts + +.script + dc.w 1,.done1-* + dc.w 2,.done2-* + dc.w 10,.pattern2-* + dc.w 20,.pattern3-* + dc.w 25,.done1echo-* + dc.w 27,.done2echo-* + dc.w 30,.pattern4-* + dc.w 40,.pattern5-* + dc.w 42,.killaudioloops-* + dc.w 50,.pattern8-* + dc.w 60,.pattern12-* + dc.w 70,.pattern16-* + dc.w 138,.fadeout-* + dc.w 0 + +.done1 + move.w #HAM_TECH_SAMPLE_SIZE/2,aud0+ac_len(a5) + move.l pd_HamTechSample(a6),aud0+ac_ptr(a5) + move.w #64,aud0+ac_vol(a5) + move.w #350,aud0+ac_per(a5) + move.w #DMAF_SETCLR|DMAF_AUD0,dmacon(a5) + rts + +.done2 + move.w #HAM_TECH_SAMPLE_SIZE/2,aud1+ac_len(a5) + move.l pd_HamTechSample(a6),aud1+ac_ptr(a5) + move.w #64,aud1+ac_vol(a5) + move.w #349,aud1+ac_per(a5) + move.w #DMAF_SETCLR|DMAF_AUD1,dmacon(a5) + rts + +.done1echo + move.w #HAM_TECH_SAMPLE_SIZE/2,aud2+ac_len(a5) + move.l pd_HamTechSample(a6),aud2+ac_ptr(a5) + move.w #16,aud2+ac_vol(a5) + move.w #340,aud2+ac_per(a5) + move.w #DMAF_SETCLR|DMAF_AUD2,dmacon(a5) + rts + +.done2echo + move.w #HAM_TECH_SAMPLE_SIZE/2,aud3+ac_len(a5) + move.l pd_HamTechSample(a6),aud3+ac_ptr(a5) + move.w #16,aud3+ac_vol(a5) + move.w #341,aud3+ac_per(a5) + move.w #DMAF_SETCLR|DMAF_AUD3,dmacon(a5) + rts + +.pattern2 + move.w #$8080,pd_LinePattern(a6) + rts + +.pattern3 + move.w #$8420,pd_LinePattern(a6) + rts + +.pattern4 + move.w #$8888,pd_LinePattern(a6) + rts + +.pattern5 + move.w #$a264,pd_LinePattern(a6) + rts + +.pattern8 + move.w #$aaaa,pd_LinePattern(a6) + rts + +.pattern12 + move.w #$fafa,pd_LinePattern(a6) + rts + +.pattern16 + move.w #$ffff,pd_LinePattern(a6) + st pd_EnableHamZoom(a6) + moveq.l #15,d0 + moveq.l #32,d1 + lea gth_line_only_palette(pc),a0 + lea pd_BlendPalette(a6),a1 + CALLFW FadePaletteTo + rts + +.killaudioloops + move.l fw_EmptySprite(a6),a0 + moveq.l #1,d0 + move.l a0,aud0+ac_ptr(a5) + move.w d0,aud0+ac_len(a5) + move.l a0,aud1+ac_ptr(a5) + move.w d0,aud1+ac_len(a5) + move.l a0,aud2+ac_ptr(a5) + move.w d0,aud2+ac_len(a5) + move.l a0,aud3+ac_ptr(a5) + move.w d0,aud3+ac_len(a5) + rts + +.fadeout + ;move.w #DMAF_SETCLR|DMAF_AUD0|DMAF_AUD1|DMAF_AUD2|DMAF_AUD3,dmacon(a5) + + moveq.l #15,d0 + moveq.l #32,d1 + lea gth_black_palette(pc),a0 + lea pd_BlendPalette(a6),a1 + CALLFW FadePaletteTo + + moveq.l #15,d0 + moveq.l #32,d1 + lea gth_black_palette(pc),a0 + lea pd_HamTechPalette(a6),a1 + CALLFW FadePaletteTo + rts + +;-------------------------------------------------------------------- + +gth_flip_db_frame: + move.l pd_CurrPlanesPtr(a6),pd_LastPlanesPtr(a6) + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + not.b pd_DbToggle(a6) + beq.s .selb1 + move.l pd_DbBuffer2(a6),pd_CurrPlanesPtr(a6) + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + rts +.selb1 + move.l pd_DbBuffer1(a6),pd_CurrPlanesPtr(a6) + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + rts + +;-------------------------------------------------------------------- + +gth_flip_bq_buffer: + move.l pd_LastBQPtr(a6),pd_LastLastBQPtr(a6) + move.l pd_CurrBQPtr(a6),pd_LastBQPtr(a6) + move.w pd_BqToggle(a6),d0 + subq.w #4,d0 + and.w #3*4,d0 + move.w d0,pd_BqToggle(a6) + lea pd_BQBuffer1(a6),a0 + move.l (a0,d0.w),pd_CurrBQPtr(a6) + rts + +;-------------------------------------------------------------------- + +gth_update_copper_list_pointers: + lea gth_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +gth_clear_db_buffers: + BLTHOGON + BLTWAIT + + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_DbBuffer1(a6),bltdpt(a5) + move.w #((GOTHAM_WIDTH*2)>>4)|((GOTHAM_HEIGHT*GOTHAM_PLANES)<<6),bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +gth_draw_ham: + bsr gth_blitter_line_init_bq + + move.l pd_BigSinCosTable(a6),a0 + move.w pd_HamRotation(a6),d0 + tst.w pd_EnableHamZoom(a6) + beq.s .norotate + add.w #64,d0 + move.w d0,pd_HamRotation(a6) + and.w #2047*4,d0 + + move.b (a0,d0.w),d0 + ext.w d0 + lsl.w #4,d0 + and.w #2047*4,d0 + +.norotate + move.l (a0,d0.w),d6 + move.w d6,d7 ; cos + swap d6 ; sin + move.w pd_HamZoom(a6),d0 + muls d0,d6 + muls d0,d7 + swap d6 + swap d7 + + lea gth_ham_line_h(pc),a2 + bsr gth_draw_path + bsr gth_draw_path + bsr gth_draw_path + + +gth_draw_path: + move.w (a2)+,d2 + move.w (a2)+,d3 + PUTMSG 30,<"1: %d,%d">,d2,d3 + + move.w d2,d4 + move.w d3,d5 + muls d7,d2 + muls d6,d5 + sub.l d5,d2 + swap d2 + + muls d7,d3 + muls d6,d4 + add.l d4,d3 + swap d3 + add.w #GOTHAM_WIDTH/2,d2 + add.w #GOTHAM_HEIGHT/2+1,d3 + + move.w d2,d0 + move.w d3,d1 +.loop move.w (a2)+,d2 + beq.s .done2 + move.w (a2)+,d3 + + move.w d2,d4 + move.w d3,d5 + muls d7,d2 + muls d6,d5 + sub.l d5,d2 + swap d2 + + muls d7,d3 + muls d6,d4 + add.l d4,d3 + swap d3 + add.w #GOTHAM_WIDTH/2-1,d2 + add.w #GOTHAM_HEIGHT/2+1,d3 + + movem.w d2-d3/d6,-(sp) + PUTMSG 40,<"%d,%d to %d,%d">,d0,d1,d2,d3 + move.w #GOTHAM_WIDTH-1,d4 + move.w #GOTHAM_HEIGHT-2,d5 + bsr gth_clip_line + beq.s .skipline + PUTMSG 40,<"After Clip: %d,%d to %d,%d">,d0,d1,d2,d3 + + move.l pd_CurrPlanesPtr(a6),a0 + bsr gth_draw_blitter_line_aa_bq +.skipline + movem.w (sp)+,d0/d1/d6 + bra.s .loop +.done2 rts + +;-------------------------------------------------------------------- + +gth_fix_bq_for_clear: + moveq.l #0,d0 + move.l pd_LastBQPtr(a6),a0 + bra.s .entry + +.bqfixloop + move.b d0,9(a0) +.entry + move.l (a0),a0 + move.l a0,d1 + bne.s .bqfixloop + rts + +;-------------------------------------------------------------------- + +gth_create_texts_copperlist: + moveq.l #-2,d3 + move.l pd_CurrCopListPtr(a6),a0 + + moveq.l #15*2,d0 + and.w fw_FrameCounter(a6),d0 + lea gth_red_noise(pc),a2 + adda.w d0,a2 + lea pd_MeanwhilePalette(a6),a1 + move.w #color+1*2,d0 + moveq.l #3-1,d7 +.mwloop + move.w d0,(a0)+ + move.w cl_Color(a1),d1 + add.w (a2)+,d1 + move.w d1,(a0)+ + lea cl_SIZEOF(a1),a1 + addq.w #2,d0 + dbra d7,.mwloop + + lea gth_meanwhile_text,a1 + COPPTMOVE a1,bplpt+0*4,d0 + lea (320/8)*18(a1),a1 + COPPTMOVE a1,bplpt+1*4,d0 + + move.w #$5207+(33<<8),(a0)+ + move.w d3,(a0)+ + COPIMOVE $2200,bplcon0 + move.w #$5207+((33+18)<<8),(a0)+ + move.w d3,(a0)+ + COPIMOVE $0200,bplcon0 + + lea pd_BlendPalette(a6),a1 + moveq.l #15-1,d7 + move.w #color+1*2,d0 +.blloop + move.w d0,(a0)+ + move.w cl_Color(a1),(a0)+ + lea cl_SIZEOF(a1),a1 + addq.w #2,d0 + dbra d7,.blloop + + move.l pd_Blend1Ptr(a6),a1 + COPPTMOVE a1,bplpt+0*4,d0 + lea (320/8)*23(a1),a1 + COPPTMOVE a1,bplpt+1*4,d0 + move.l pd_Blend2Ptr(a6),a1 + COPPTMOVE a1,bplpt+2*4,d0 + lea (320/8)*23(a1),a1 + COPPTMOVE a1,bplpt+3*4,d0 + + move.w #$5207+(78<<8),(a0)+ + move.w d3,(a0)+ + COPIMOVE $4200,bplcon0 + move.w #$5207+((78+23)<<8),(a0)+ + move.w d3,(a0)+ + COPIMOVE $0200,bplcon0 + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +gth_create_main_copperlist: + moveq.l #-2,d3 + move.l pd_CurrCopListPtr(a6),a0 + + lea pd_BlendPalette(a6),a1 + moveq.l #15-1,d7 + move.w #color+1*2,d0 +.mwloop + move.w d0,(a0)+ + move.w cl_Color(a1),(a0)+ + lea cl_SIZEOF(a1),a1 + addq.w #2,d0 + dbra d7,.mwloop + + move.l pd_CurrPlanesPtr(a6),a1 + COPPTMOVE a1,bplpt+0*4,d0 + lea (GOTHAM_WIDTH/8)*GOTHAM_HEIGHT(a1),a1 + COPPTMOVE a1,bplpt+1*4,d0 + lea gth_ham_text,a1 + COPPTMOVE a1,bplpt+2*4,d0 + lea (320/8)*23(a1),a1 + COPPTMOVE a1,bplpt+3*4,d0 + + COPIMOVE $2200,bplcon0 + + move.w #$5207+(78<<8),(a0)+ + move.w d3,(a0)+ + COPIMOVE $4200,bplcon0 + move.w #$5207+((78+23)<<8),(a0)+ + move.w d3,(a0)+ + COPIMOVE $2200,bplcon0 + + lea pd_HamTechPalette(a6),a1 + moveq.l #15-1,d7 + move.w #color+1*2,d0 +.htloop + move.w d0,(a0)+ + move.w cl_Color(a1),(a0)+ + lea cl_SIZEOF(a1),a1 + addq.w #2,d0 + dbra d7,.htloop + + lea gth_ham_tech,a1 + COPPTMOVE a1,bplpt+2*4,d0 + lea (320/8)*13(a1),a1 + COPPTMOVE a1,bplpt+3*4,d0 + + move.w #$5207+((78+23+66)<<8),(a0)+ + move.w d3,(a0)+ + + COPIMOVE $4200,bplcon0 + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + + include "blitterline_bq.asm" + include "clipping.asm" + +;******************************************************************** + +gth_red_noise: + dc.w $000,$100,$100,$000,$200,$100,$000,$200 + dc.w $000,$000,$200,$200,$000,$200,$100,$100 + dc.w $000,$100,$100,$000 + +gth_red_palette: + dc.w $300,$700,$a00 + +gth_black_palette: + ds.w 15 + +gth_red_blend1_palette: + dc.w $400,$800,$c00,$000,$400,$800,$c00 + dc.w $000,$400,$800,$c00,$000,$400,$800,$c00 + +gth_red_blend2_palette: + dc.w $000,$000,$000,$400,$400,$400,$400 + dc.w $800,$800,$800,$800,$c00,$c00,$c00,$c00 + +gth_greenish_blend1_palette: + dc.w $243,$586,$8ca,$000,$243,$586,$8ca + dc.w $000,$243,$586,$8ca,$000,$243,$586,$8ca + +gth_invisible_line_palette: + dc.w $000,$000,$000 + dc.w $400,$000,$000,$000 + dc.w $800,$000,$000,$000 + dc.w $c00,$000,$000,$000 + +gth_white_line_palette: + dc.w $888,$888,$fff + dc.w $400,$855,$855,$daa + dc.w $800,$c55,$c55,$faa + dc.w $c00,$f55,$f55,$faa + +gth_line_only_palette: + dc.w $888,$888,$fff + dc.w $000,$888,$888,$fff + dc.w $000,$888,$888,$fff + dc.w $000,$888,$888,$fff + +gth_ham_tech_palette: + dc.w $888,$888,$fff + dc.w $444,$888,$888,$fff + dc.w $888,$888,$888,$fff + dc.w $ccc,$888,$888,$fff + +TDPOINT MACRO + dc.w ((\1)-(GOTHAM_WIDTH/2))<<8 + dc.w ((\2)-(103))<<8 + ENDM +gth_ham_line_h: + ; H + TDPOINT 63,74 + TDPOINT 78,74 + TDPOINT 78,96 + TDPOINT 100,96 + TDPOINT 100,74 + TDPOINT 116,74 + TDPOINT 116,132 + TDPOINT 100,132 + TDPOINT 100,110 + TDPOINT 78,110 + TDPOINT 78,132 + TDPOINT 63,132 + TDPOINT 63,74 + dc.w 0 + +gth_ham_line_a1: + ; A (outside) + TDPOINT 123,132 + TDPOINT 147,74 + TDPOINT 162,74 + TDPOINT 187,132 + TDPOINT 171,132 + TDPOINT 166,121 + TDPOINT 143,121 + TDPOINT 139,132 + TDPOINT 123,132 + dc.w 0 + +gth_ham_line_a2: + ; A (inside) + TDPOINT 147,110 + TDPOINT 155,92 + TDPOINT 162,110 + TDPOINT 147,110 + dc.w 0 + +gth_ham_line_m: + ; M + TDPOINT 194,74 + TDPOINT 210,74 + TDPOINT 225,97 + TDPOINT 239,74 + TDPOINT 256,74 + TDPOINT 256,132 + TDPOINT 241,132 + TDPOINT 241,98 + TDPOINT 225,121 + TDPOINT 209,98 + TDPOINT 209,132 + TDPOINT 194,132 + TDPOINT 194,74 + dc.w 0 + + IFND FW_DEMO_PART + dc.w 1 ; avoid hunk shortening that leaves dirty memory on kick 1.3 + ENDC + +;******************************************************************** + +;-------------------------------------------------------------------- + + section "gth_copper",data,chip + +gth_copperlist: + COP_MOVE dmacon,DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + COP_MOVE diwstrt,$5281 ; window start + COP_MOVE diwstop,$06c1 ; window stop + COP_MOVE ddfstrt,$0038 ; bitplane start + + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon3,$0c00 + + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + + COP_MOVE bplcon0,$0200 + COP_MOVE bplcon1,$0000 + COP_MOVE bplcon2,$0024 ; turn off all bitplanes, set scroll values to 0, sprites in front + COP_MOVE bpl1mod,0 + COP_MOVE bpl2mod,0 + + COP_MOVE color+0*2,$000 + +gth_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +gth_meanwhile_text: + incbin "../data/gotham/meanwhile320x18x4.BPL" + +gth_gothamcity_text: + incbin "../data/gotham/gothamcity320x23x4.BPL" + +gth_gotham_text: + incbin "../data/gotham/gotham320x23x4.BPL" + +gth_hameelinna_text: + incbin "../data/gotham/hameelinna320x23x4.BPL" + +gth_ham_text: + incbin "../data/gotham/ham320x23x4.BPL" + +gth_ham_tech: + incbin "../data/gotham/hamtechnology320x13x4.BPL" + +blitter_temp_output_word: + dc.w 0 + + IFND FW_DEMO_PART + section "gth_sample",data,chip +gth_psenough_ham: + incbin "../data/gotham/hamtechnology.raw" + + ENDC + END \ No newline at end of file diff --git a/source/gotham/record.bat b/source/gotham/record.bat new file mode 100644 index 0000000..96551e3 --- /dev/null +++ b/source/gotham/record.bat @@ -0,0 +1,30 @@ +del gotham.exe +del "..\winuae\hd0\gotham.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "gotham.exe" "gotham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy gotham.exe "..\winuae\hd0" +copy gotham.exe "..\winuae\hd0\a.exe" + +@echo /|set /p =gotham.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_rec.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/gouraud/aga.bat b/source/gouraud/aga.bat new file mode 100644 index 0000000..588af2a --- /dev/null +++ b/source/gouraud/aga.bat @@ -0,0 +1,30 @@ +del gouraud.exe +del "..\winuae\hd0\gouraud.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "gouraud.exe" "gouraud.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy gouraud.exe "..\winuae\hd0" +copy gouraud.exe "..\winuae\hd0\a" + +@echo /|set /p =gouraud.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/gouraud/assemble.bat b/source/gouraud/assemble.bat new file mode 100644 index 0000000..b080ec6 --- /dev/null +++ b/source/gouraud/assemble.bat @@ -0,0 +1,37 @@ +del gouraud.exe +del "..\winuae\hd0\gouraud.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +pushd .. + +tools\KingCon.exe @data/gouraud/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +vc -O2 -notmpfile -nostdlib -o "gouraud.exe" "gouraud.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy gouraud.exe "..\winuae\hd0" +copy gouraud.exe "..\winuae\hd0\a" + +@echo /|set /p =gouraud.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_hrt_more_mem.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/gouraud/compile.bat b/source/gouraud/compile.bat new file mode 100644 index 0000000..46b3e2c --- /dev/null +++ b/source/gouraud/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "gouraud.exe" "gouraud.asm" diff --git a/source/gouraud/debug.bat b/source/gouraud/debug.bat new file mode 100644 index 0000000..797bdda --- /dev/null +++ b/source/gouraud/debug.bat @@ -0,0 +1,21 @@ +del gouraud.exe +del "..\winuae\hd0\gouraud.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "gouraud.exe" "gouraud.asm" + +copy gouraud.exe "..\winuae\hd0" +copy gouraud.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =gouraud.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/gouraud/gouraud.asm b/source/gouraud/gouraud.asm new file mode 100755 index 0000000..4ee9b7b --- /dev/null +++ b/source/gouraud/gouraud.asm @@ -0,0 +1,3013 @@ +; TODOs: +; - Fix pixel errors at border +; +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 1 +FW_MUSIC_PLAYER_CHOICE = 2 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 0 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 300 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 0 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 0 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 0 +PART_MUSIC_START_POS = 0 + + ENDC + +GOURAUD_WIDTH = 128 +GOURAUD_PLANES = 4 + +BENDIT_WIDTH = 128 +BENDIT_HEIGHT = 128 + +CUBE_PRECALC_NUM = 16 + +NUM_RUBBER_FRAMES = 33 + +CUBE_WIDTH = 128 +CUBE_HEIGHT = 128 +CUBE_PLANES = 4 +CUBE_X_OFFSET = 0 +CUBE_Y_OFFSET = 0 +CUBE_Y_CLIP = 0 + +CUBE_MAX_SIZE = 6400 +GOURAUD_Z_DIST = 182 +CULLING_EXT = 128 +GOURAUD_Z_ADD = 8192+1000 ; 8192 is currently safe lower limit, 2*8192 is safe upper limit + +CUBE_BUF_WIDTH = 128 + +gouraudColShift = 10 +gouraudErrShift = 6 + +NUM_BQ_LINES = 64 + +COP_PREAMBLE_INST = 2 ; wait and bplcon0 +COP_POST_INST = 3 ; wait, 8x(sprctl + sprpos) +COP_INST_PER_LINE = 2 ; bplptl, cop2lc, cop2lc, wait, 40 colors, skip, copjmp +COP_LIST_SIZE = (500)*4 + +CHIPMEM_SIZE = ((CUBE_BUF_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES*3)+((CUBE_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES*NUM_RUBBER_FRAMES)+COP_LIST_SIZE*2 +FASTMEM_SIZE = CUBE_PRECALC_NUM*cd_SIZEOF + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + +; - CHIP BSS 2 x 128 x 128 x 4 = 16384 (DB) +; - CHIP BSS 3 x 128 x 128 x 4 = 24576 (3 line buffers for cube) +; - CHIP BSS 32 x 128 x 128 x 4 = 262144 (Rubber buffers) +; +; - FAST BSS 32 x 1424 = 45568 (Cube preprocessing) 12+3*3*2*2+8*3*2+8*2*2+12*(11*4+4+8*2) + + + include "../framework/framework.i" + + STRUCTURE BQLine,bq_SIZEOF + ULONG bql_BltCon01 + APTR bql_BltCPt + UWORD bql_BltBMod + UWORD bql_BltAMod + UWORD bql_BltAPtLo + APTR bql_BltDPt + UWORD bql_BltSize + LABEL bql_SIZEOF + + STRUCTURE BQFillCube,bq_SIZEOF + ULONG bqfc_BltCon01 + UWORD bqfc_BltAMod + UWORD bqfc_BltDMod + APTR bqfc_BltAPt + APTR bqfc_BltDPt + UWORD bqfc_BltSize + LABEL bqfc_SIZEOF + + STRUCTURE BQClear,bq_SIZEOF + ULONG bqc_BltCon01 + APTR bqc_BltDPt + UWORD bqc_BltDMod + UWORD bqc_BltCDat + UWORD bqc_BltSize + LABEL bqc_SIZEOF + + STRUCTURE CubeData,0 + ULONG cd_PlanesToDraw + UWORD cd_LinesToDraw + UWORD cd_InnerLines + STRUCT cd_CubeNormals,3*3*2*2 + STRUCT cd_Coords,8*3*2 + STRUCT cd_ProjCoords,8*2*2 + STRUCT cd_IntCubeLines,12*il_SIZEOF + LABEL cd_SIZEOF + + STRUCTURE IntCubeLine,0 + STRUCT il_Coords,22*4 ; must be first + UWORD il_NumCoords + UBYTE il_Flipped + UBYTE il_DzNeg + + UWORD il_FromCoord + UWORD il_ToCoord + UWORD il_FromX + UWORD il_FromY + UWORD il_ToX + UWORD il_ToY + UWORD il_FromZ + UWORD il_ToZ + LABEL il_SIZEOF + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrPlanesPtr + APTR pd_LastPlanesPtr + APTR pd_CurrTransPtr + APTR pd_LastTransPtr + APTR pd_CurrCubeLinePtr + APTR pd_LastCubeLinePtr + APTR pd_LastLastCubeLinePtr + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + UBYTE pd_CopListToggle + UBYTE pd_DbToggle + UBYTE pd_CubeBufToggle + ALIGNWORD + + UWORD pd_PartCountDown + + APTR pd_CopperList1 + APTR pd_CopperList2 + APTR pd_RubberBuffer + APTR pd_CubeLineBuffer1 ; ds.w (CUBE_BUF_WIDTH/16)*CUBE_HEIGHT*CUBE_PLANES + APTR pd_CubeLineBuffer2 ; ds.w (CUBE_BUF_WIDTH/16)*CUBE_HEIGHT*CUBE_PLANES + APTR pd_CubeLineBuffer3 ; ds.w (CUBE_BUF_WIDTH/16)*CUBE_HEIGHT*CUBE_PLANES + + UWORD pd_ScreenSinXOffset + UWORD pd_ScreenSinYOffset + WORD pd_ScreenX + WORD pd_ScreenY + + ULONG pd_IntroFrameOffset + ULONG pd_RubberFrameOffset + UWORD pd_NumRubberFrames + + UWORD pd_BenditYPos + BOOL pd_BenditKilled + + WORD pd_Ax ; order may not be changed! (movem) + WORD pd_Ay + WORD pd_Az + WORD pd_AxSpeed + WORD pd_AySpeed + WORD pd_AzSpeed + UWORD pd_CubeSize + WORD pd_CubeSizeDir + + BOOL pd_QuitAsyncTask + UWORD pd_CubeSinePos + UWORD pd_CubeCosPos + UWORD pd_CubeCullingValue + + APTR pd_CubeSceneRoutinePtr + APTR pd_CubeDataReadPtr + APTR pd_CubeDataWritePtr + UWORD pd_CalculatedCubeFrames + UWORD pd_PrecalculatedFrames + APTR pd_CubeScriptPointer + + APTR pd_CubeDataPtr + APTR pd_CubePrecalcBuffer ; ds.b cd_SIZEOF*CUBE_PRECALC_NUM + APTR pd_CubePrecalcBufferEnd + + STRUCT pd_BQLineInit,bq_SIZEOF + STRUCT pd_BQLines,NUM_BQ_LINES*bql_SIZEOF + STRUCT pd_BQFillCube,bqfc_SIZEOF + STRUCT pd_BQClearLineBuffer,bqc_SIZEOF + + STRUCT pd_RubberPalette,32*cl_SIZEOF + STRUCT pd_BenditSprites,8*4 + + STRUCT pd_CubeCalcTask,ft_SIZEOF + + STRUCT pd_LinesFromBuffer,NUM_BQ_LINES*2*2 + STRUCT pd_LinesToBuffer,NUM_BQ_LINES*2*2 + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + move.w #$000,color(a5) + bsr gou_init + + lea gou_async_calc_task(pc),a0 + lea pd_CubeCalcTask(a6),a1 + CALLFW AddTask + + lea gou_copperlist,a0 + CALLFW SetCopper + + bsr gou_clear_cube_line_buffer + + REPT 2 + bsr gou_flip_db_frame + bsr gou_clear_cube_line_buffer + ENDR + + bsr gou_clear_rubber_buffers + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + move.l #part_music_data,fw_MusicData(a6) + move.l #part_music_smp,fw_MusicSamples(a6) + CALLFW StartMusic + ENDC + ELSE + CALLFW StartMusic + ENDC + + bsr gou_intro + bsr gou_main + + CALLFW SetBaseCopper + + lea pd_CubeCalcTask(a6),a1 + CALLFW RemTask + rts + +;-------------------------------------------------------------------- + +gou_init: + bsr gou_init_vars + bsr gou_init_blitter_queue + + CALLFW SetBlitterQueueSingleFrame + + rts + +;-------------------------------------------------------------------- + +gou_init_vars: + move.l #gou_cube_advance_scene_standard_movement,pd_CubeSceneRoutinePtr(a6) + move.w #4*2,pd_AxSpeed(a6) + move.w #-5*2,pd_AySpeed(a6) + move.w #-7*2,pd_AzSpeed(a6) + move.w #CUBE_MAX_SIZE,pd_CubeSize(a6) + move.w #((CUBE_MAX_SIZE*CUBE_MAX_SIZE)>>8)/GOURAUD_Z_DIST+CULLING_EXT,pd_CubeCullingValue(a6) + + move.w #237*2,pd_Ax(a6) + move.w #32*2,pd_Ay(a6) + move.w #128*2,pd_Az(a6) + + move.w #300,pd_CubeCosPos(a6) + + move.l #CUBE_PRECALC_NUM*cd_SIZEOF,d0 + CALLFW AllocFast + move.l a0,pd_CubePrecalcBuffer(a6) + move.l a0,pd_CubeDataWritePtr(a6) + move.l a0,pd_CubeDataReadPtr(a6) + move.l a0,pd_CubeDataPtr(a6) + + add.l #CUBE_PRECALC_NUM*cd_SIZEOF,a0 + move.l a0,pd_CubePrecalcBufferEnd(a6) + + move.l #(COP_LIST_SIZE*2),d0 + CALLFW AllocChip + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + lea COP_LIST_SIZE(a0),a0 + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + move.l #(CUBE_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES*NUM_RUBBER_FRAMES,d0 + CALLFW AllocChip + move.l a0,pd_RubberBuffer(a6) + + move.l #((CUBE_BUF_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES)*3,d0 + CALLFW AllocChip + move.l a0,pd_CubeLineBuffer1(a6) + move.l a0,pd_CurrCubeLinePtr(a6) + + lea ((CUBE_BUF_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES)(a0),a0 + move.l a0,pd_CubeLineBuffer2(a6) + move.l a0,pd_LastCubeLinePtr(a6) + + lea ((CUBE_BUF_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES)(a0),a0 + move.l a0,pd_CubeLineBuffer3(a6) + move.l a0,pd_LastLastCubeLinePtr(a6) + + lea gou_gray_shuffle(pc),a2 + lea gou_gray_palette(pc),a0 + lea gou_sorted_palette(pc),a1 + moveq.l #16-1,d7 +.palloop + move.w (a2)+,d0 + move.w (a1)+,(a0,d0.w) + dbra d7,.palloop + + lea gou_gray_shuffle(pc),a2 + lea gou_gray_zebra_palette(pc),a0 + lea gou_zebra_palette(pc),a1 + moveq.l #16-1,d7 +.palloop2 + move.w (a2)+,d0 + move.w (a1)+,(a0,d0.w) + dbra d7,.palloop2 + + lea pd_BenditSprites(a6),a1 + lea gou_bendit_sprite,a3 + move.l a3,a2 + moveq.l #(BENDIT_WIDTH/16)-1,d7 +.sprloop + move.l a3,a0 + adda.w (a2)+,a0 + move.l d0,(a0) + move.l a0,(a1)+ + dbra d7,.sprloop + + move.w #BENDIT_HEIGHT,pd_BenditYPos(a6) + + rts + +;-------------------------------------------------------------------- + +gou_init_blitter_queue: + lea gou_bq_InitLineDraw(pc),a0 + move.l a0,pd_BQLineInit+bq_Routine(a6) + + lea gou_bq_LineDraw(pc),a0 + lea pd_BQLines(a6),a1 + moveq.l #NUM_BQ_LINES-1,d7 +.bqlloop + move.l a0,bq_Routine(a1) + move.l #blitter_temp_output_word,bql_BltDPt(a1) + lea bql_SIZEOF(a1),a1 + dbra d7,.bqlloop + + lea pd_BQFillCube(a6),a1 + lea gou_bq_FillCube(pc),a0 + move.l a0,bq_Routine(a1) + move.l #((BLTEN_AD|BLT_A)<<16)|BLTCON1F_EFE|BLTCON1F_DESC,bqfc_BltCon01(a1) + ;move.l #((BLTEN_AD|(~BLT_A&$ff))<<16)|BLTCON1F_EFE|BLTCON1F_DESC,bqfc_BltCon01(a1) + move.l #(((CUBE_BUF_WIDTH-CUBE_WIDTH)/8)<<16)|((GOURAUD_WIDTH-CUBE_WIDTH)/8),bqfc_BltAMod(a1) + move.w #((CUBE_WIDTH)>>4)|(((CUBE_HEIGHT-2*CUBE_Y_CLIP)*CUBE_PLANES)<<6),bqfc_BltSize(a1) + + lea pd_BQClearLineBuffer(a6),a1 + lea gou_bq_Clear(pc),a0 + move.l a0,bq_Routine(a1) + move.l #((BLTEN_D|BLT_C)<<16),bqc_BltCon01(a1) + move.w #(CUBE_BUF_WIDTH-CUBE_WIDTH)/8,bqc_BltDMod(a1) + clr.w bqc_BltCDat(a1) + move.w #((CUBE_WIDTH)>>4)|(((CUBE_HEIGHT-2*CUBE_Y_CLIP)*CUBE_PLANES)<<6),bqc_BltSize(a1) + + rts + +;-------------------------------------------------------------------- + +gou_intro: + move.w #1,pd_PartCountDown(a6) + + lea .script(pc),a0 + CALLFW InstallMusicScript + + PUTMSG 10,<"Main Frame Start %ld">,fw_FrameCounterLong(a6) + +.loop + BLTWAIT + CALLFW TriggerBlitterQueue + + bsr gou_flip_copperlists + bsr gou_flip_db_frame + bsr gou_flip_cube_buffer + + bsr gou_update_screen_pos + + move.l pd_CubeDataPtr(a6),a1 + bsr gou_interpolate_outer_cube_lines + + moveq.l #16,d0 + lea pd_RubberPalette(a6),a1 + CALLFW DoFadePaletteStep + + move.l pd_CurrCopListPtr(a6),a0 + move.l pd_IntroFrameOffset(a6),d4 + bsr gou_create_main_copperlist_nosprites + + CALLFW JoinBlitterQueue + + bsr gou_create_blitter_queue + CALLFW TerminateBlitterQueue + + bsr gou_update_copper_list_pointers + + CALLFW CheckMusicScript + + CALLFW VSyncWithTask + tst.w pd_PartCountDown(a6) + bne .loop + + add.l #$012302d3,pd_ScreenSinXOffset(a6) + rts + +.script + dc.w 0*6,.flash-* + dc.w 4*6,.flash-* + dc.w 8*6,.quitintro-* + dc.w 0 + +.flash + add.l #$015102d3,pd_ScreenSinXOffset(a6) + moveq.l #16,d0 + lea gou_gray_palette(pc),a0 + lea pd_RubberPalette(a6),a1 + CALLFW InitPaletteLerp + + moveq.l #16,d0 + moveq.l #16,d1 + lea gou_mauve_palette(pc),a0 + lea pd_RubberPalette(a6),a1 + CALLFW FadePaletteTo + + move.l pd_RubberFrameOffset(a6),pd_IntroFrameOffset(a6) + + rts + +.quitintro + clr.w pd_PartCountDown(a6) + rts + +;-------------------------------------------------------------------- + +gou_main: + move.w #1,pd_PartCountDown(a6) + + move.w #$fff,d0 + move.w d0,color+17*2(a5) + move.w d0,color+21*2(a5) + move.w d0,color+25*2(a5) + move.w d0,color+29*2(a5) + move.w #$888,d0 + move.w d0,color+18*2(a5) + move.w d0,color+22*2(a5) + move.w d0,color+26*2(a5) + move.w d0,color+30*2(a5) + moveq.l #0,d0 + move.w d0,color+19*2(a5) + move.w d0,color+23*2(a5) + move.w d0,color+27*2(a5) + move.w d0,color+31*2(a5) + + st pd_BenditKilled(a6) + + moveq.l #16,d0 + lea gou_gray_palette(pc),a0 + lea pd_RubberPalette(a6),a1 + CALLFW InitPaletteLerp + + lea .script(pc),a0 + CALLFW InstallMusicScript + +.loop + BLTWAIT + CALLFW TriggerBlitterQueue + + bsr gou_flip_copperlists + bsr gou_flip_db_frame + bsr gou_flip_cube_buffer + + bsr gou_update_screen_pos + + cmp.w #NUM_RUBBER_FRAMES,pd_NumRubberFrames(a6) + beq.s .norubadd + addq.w #1,pd_NumRubberFrames(a6) +.norubadd + + move.l pd_CubeDataPtr(a6),a1 + bsr gou_interpolate_outer_cube_lines + + bsr gou_update_bendit_sprites + + moveq.l #16,d0 + lea pd_RubberPalette(a6),a1 + CALLFW DoFadePaletteStep + + move.l pd_CurrCopListPtr(a6),a0 + move.l pd_RubberFrameOffset(a6),d4 + bsr gou_create_main_copperlist + + CALLFW JoinBlitterQueue + + bsr gou_create_blitter_queue + CALLFW TerminateBlitterQueue + + bsr gou_update_copper_list_pointers + + CALLFW CheckMusicScript + + CALLFW VSyncWithTask + tst pd_PartCountDown(a6) + bne .loop + + st pd_QuitAsyncTask(a6) + rts + +.script + dc.w 48+32*6,.benditon-* + dc.w 432,.benditoff-* + dc.w 432+32*6,.fadezebra-* + dc.w (8+3*64)*6-32-15,.startclearing-* + dc.w (8+3*64)*6-15,.quitmain-* + dc.w 0 + +.benditon + clr.w pd_BenditKilled(a6) + rts + +.benditoff + st pd_BenditKilled(a6) + rts + +.fadezebra + move.w #-9*2,pd_AxSpeed(a6) + move.w #-5*2,pd_AySpeed(a6) + move.w #6*2,pd_AzSpeed(a6) + + moveq.l #16,d0 + moveq.l #16,d1 + lea gou_gray_zebra_palette(pc),a0 + lea pd_RubberPalette(a6),a1 + CALLFW FadePaletteTo + rts + +.startclearing + move.l #((BLTEN_D)<<16)|BLTCON1F_DESC,pd_BQFillCube+bqfc_BltCon01(a6) + moveq.l #16,d0 + moveq.l #32,d1 + lea gou_black_palette(pc),a0 + lea pd_RubberPalette(a6),a1 + CALLFW FadePaletteTo + rts + +.quitmain + clr.w pd_PartCountDown(a6) + rts + +;-------------------------------------------------------------------- + +gou_update_screen_pos: + move.l fw_SinTable(a6),a0 + move.w pd_ScreenSinXOffset(a6),d0 + move.w pd_ScreenSinYOffset(a6),d1 + addq.w #8,d0 + add.w #11,d1 + move.w d0,pd_ScreenSinXOffset(a6) + move.w d1,pd_ScreenSinYOffset(a6) + and.w #1023*2,d0 + and.w #1023*2,d1 + move.w (a0,d0.w),d0 + move.w (a0,d1.w),d1 + muls #176*2,d0 + muls #52*2,d1 + swap d0 + swap d1 + move.w d0,pd_ScreenX(a6) + move.b d1,pd_ScreenY(a6) + rts + +;-------------------------------------------------------------------- + +gou_update_bendit_sprites: + lea pd_BenditSprites(a6),a2 + + moveq.l #0,d0 + moveq.l #0,d1 + tst.w pd_BenditKilled(a6) + bne.s .filldata + + move.w #128+160-(BENDIT_WIDTH/2),d4 + sub.w pd_ScreenX(a6),d4 + move.b pd_ScreenY(a6),d1 + ext.w d1 + + add.w #$6c,d1 + + move.w d1,d2 + add.w #BENDIT_HEIGHT,d2 + moveq.l #0,d0 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d0,d0 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d0,d0 ; ev8 + lsr.w #1,d4 ; sh8-sh1 in d4 + addx.w d0,d0 ; sh0 + or.w d2,d0 ; ev7-ev0, sv8, ev8, sh0 in d0 + move.b d4,d1 ; sv7-sv0, sh8-sh1 in d4 + ;tas d0 ; att TAS sets bit 7 +.filldata + REPT (BENDIT_WIDTH/16) + move.l (a2)+,a0 + move.w d1,(a0)+ + move.w d0,(a0)+ + addq.w #8,d1 + ENDR + rts + +;-------------------------------------------------------------------- + +gou_create_blitter_queue: + lea pd_BQClearLineBuffer(a6),a0 + move.l pd_LastCubeLinePtr(a6),a1 + lea CUBE_Y_CLIP*(CUBE_BUF_WIDTH/8)*CUBE_PLANES(a1),a1 + move.l a1,bqc_BltDPt(a0) + CALLFW AddToBlitterQueue + + clr.l pd_BQLineInit+bq_Next(a6) + move.l pd_CubeDataPtr(a6),a1 + bsr gou_draw_inner_lines + + lea pd_BQFillCube(a6),a0 + move.l pd_LastPlanesPtr(a6),a1 + add.l #((CUBE_X_OFFSET+CUBE_WIDTH-16)/8)+(CUBE_Y_OFFSET+CUBE_HEIGHT-CUBE_Y_CLIP-1)*(GOURAUD_WIDTH/8)*GOURAUD_PLANES+(GOURAUD_WIDTH/8)*(GOURAUD_PLANES-1),a1 + move.l a1,bqfc_BltDPt(a0) + + move.l pd_CurrCubeLinePtr(a6),a1 + lea (CUBE_WIDTH-16)/8+(CUBE_HEIGHT-CUBE_Y_CLIP-1)*(CUBE_BUF_WIDTH/8)*CUBE_PLANES+(CUBE_BUF_WIDTH/8)*(CUBE_PLANES-1)(a1),a1 + move.l a1,bqfc_BltAPt(a0) + CALLFW AddToBlitterQueue +.skip + rts + +;-------------------------------------------------------------------- + +gou_flip_copperlists: + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + not.b pd_CopListToggle(a6) + beq.s .selb1 + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + rts +.selb1 + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + rts + +gou_flip_db_frame: + move.l pd_CurrPlanesPtr(a6),pd_LastPlanesPtr(a6) + move.l pd_LastCubeLinePtr(a6),pd_LastLastCubeLinePtr(a6) + move.l pd_CurrCubeLinePtr(a6),pd_LastCubeLinePtr(a6) + move.l pd_RubberBuffer(a6),a0 + not.b pd_DbToggle(a6) + move.l pd_RubberFrameOffset(a6),d0 + add.l #(CUBE_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES,d0 + cmp.l #((CUBE_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES*NUM_RUBBER_FRAMES),d0 + bne.s .goodframe + moveq.l #0,d0 +.goodframe + move.l d0,pd_RubberFrameOffset(a6) + adda.l d0,a0 + move.l a0,pd_CurrPlanesPtr(a6) + + move.b pd_CubeBufToggle(a6),d0 + subq.b #1,d0 + bmi.s .cb2 + beq.s .cb1 +.cb3 + move.l pd_CubeLineBuffer3(a6),pd_CurrCubeLinePtr(a6) + move.b d0,pd_CubeBufToggle(a6) + rts +.cb2 + move.l pd_CubeLineBuffer2(a6),pd_CurrCubeLinePtr(a6) + move.b #2,pd_CubeBufToggle(a6) + rts +.cb1 + move.b d0,pd_CubeBufToggle(a6) + move.l pd_CubeLineBuffer1(a6),pd_CurrCubeLinePtr(a6) + rts + +;-------------------------------------------------------------------- + +gou_update_copper_list_pointers: + lea gou_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +gou_create_main_copperlist: + lea pd_BenditSprites(a6),a1 + move.w #sprpt,d1 + moveq.l #(BENDIT_WIDTH/16)*2-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + +gou_create_main_copperlist_nosprites: + lea pd_RubberPalette(a6),a1 + moveq.l #16-1,d7 + move.w #color,d1 +.palloop + move.w d1,(a0)+ + move.w cl_Color(a1),(a0)+ + lea cl_SIZEOF(a1),a1 + addq.w #2,d1 + dbra d7,.palloop + + COPIMOVE $4200,bplcon0 + + move.l pd_RubberBuffer(a6),a1 + + move.w pd_ScreenX(a6),d0 + moveq.l #16,d2 + moveq.l #15,d1 + sub.w d0,d2 + and.w d1,d2 ; lower 4 bit + move.w d2,d5 + lsl.w #4,d5 + or.w d5,d2 + COPRMOVE d2,bplcon1 + add.w d1,d0 + asr.w #4,d0 + lsl.w #3,d0 + neg.w d0 + + add.w #$68,d0 + COPRMOVE d0,ddfstrt + add.w #$a0-$68,d0 + COPRMOVE d0,ddfstop + + move.w #$6c81,d0 + move.w pd_ScreenY(a6),d1 + add.w d1,d0 + COPRMOVE d0,diwstrt + add.w #(CUBE_HEIGHT<<8)|($c1-$81),d0 + COPRMOVE d0,diwstop + + moveq.l #-2,d3 + moveq.l #CUBE_WIDTH/8,d2 + move.l #((CUBE_WIDTH/8)*CUBE_HEIGHT*CUBE_PLANES*NUM_RUBBER_FRAMES),d5 + move.l #(CUBE_WIDTH/8)*(CUBE_HEIGHT+4)*CUBE_PLANES,d6 + sub.w #((CUBE_HEIGHT)<<8)-($07-$c1),d0 + ;move.w #$6bd5,d0 + move.w pd_NumRubberFrames(a6),d7 +.cprloop + lea (a1,d4.l),a2 + COPPTMOVE a2,bplpt+0*4,d1 + adda.l d2,a2 + COPPTMOVE a2,bplpt+1*4,d1 + adda.l d2,a2 + COPPTMOVE a2,bplpt+2*4,d1 + adda.l d2,a2 + COPPTMOVE a2,bplpt+3*4,d1 + + add.l d6,d4 + cmp.l d5,d4 + blt.s .nowrap + sub.l d5,d4 +.nowrap + add.w #$400,d0 + bcc.s .no255 + move.l #$ffdffffe,(a0)+ +.no255 + move.w d0,(a0)+ + move.w d3,(a0)+ + dbra d7,.cprloop + + move.b #$38,d0 + move.w #$100,d2 + + move.l d3,(a0) + rts + +;-------------------------------------------------------------------- + +gou_clear_cube_line_buffer: + moveq.l #-1,d2 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_CurrCubeLinePtr(a6),bltdpt(a5) + move.w #((CUBE_BUF_WIDTH)>>4)|(((CUBE_HEIGHT)*CUBE_PLANES)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +gou_clear_rubber_buffers: + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_RubberBuffer(a6),bltdpt(a5) + move.w #(((CUBE_WIDTH*8)&1023)>>4)|(((CUBE_HEIGHT*CUBE_PLANES*2)&1023)<<6),bltsize(a5) + CALLFW VSyncWithTask + CALLFW VSyncWithTask + BLTWAIT + move.w #(((CUBE_WIDTH*8)&1023)>>4)|(((CUBE_HEIGHT*CUBE_PLANES*2)&1023)<<6),bltsize(a5) + CALLFW VSyncWithTask + CALLFW VSyncWithTask + rts + +;-------------------------------------------------------------------- + +gou_flip_cube_buffer: + move.l pd_CubeDataReadPtr(a6),a0 + move.l a0,pd_CubeDataPtr(a6) + + lea cd_SIZEOF(a0),a1 + cmp.l pd_CubePrecalcBufferEnd(a6),a1 + bne.s .nowrap + move.l pd_CubePrecalcBuffer(a6),a1 +.nowrap + move.l a1,pd_CubeDataReadPtr(a6) + + IF DEBUG_DETAIL + move.w pd_PrecalculatedFrames(a6),d0 + cmp.w #10,d0 + bgt.s .okay + PUTMSG 10,<"pd_PrecalculatedFrames=%d">,d0 +.okay + ENDC + subq.w #1,pd_PrecalculatedFrames(a6) + rts + +;-------------------------------------------------------------------- + +gou_async_calc_task: + PUTMSG 10,<"%d: async_calc_task">,fw_FrameCounterLong(a6) + move.l pd_CubeDataPtr(a6),a1 + moveq.l #CUBE_PRECALC_NUM-1,d7 +.cdloop + lea cd_IntCubeLines(a1),a0 + PUTMSG 20,<"IntCubeLines %p (%ld)">,a0,#il_SIZEOF + lea gou_cube_lines(pc),a2 + moveq.l #12-1,d6 +.icloop move.l (a2)+,il_FromCoord(a0) ; and il_ToCoord + lea il_SIZEOF(a0),a0 + dbra d6,.icloop + lea cd_SIZEOF(a1),a1 + dbra d7,.cdloop + +.loop +.fillup + move.w pd_CalculatedCubeFrames(a6),d0 + cmp.w #CUBE_PRECALC_NUM-1,pd_PrecalculatedFrames(a6) + bge.s .skipprecalc + addq.w #1,d0 + move.w d0,pd_CalculatedCubeFrames(a6) + move.l pd_CubeDataWritePtr(a6),a0 + lea cd_SIZEOF(a0),a1 + cmp.l pd_CubePrecalcBufferEnd(a6),a1 + bne.s .nowrap + move.l pd_CubePrecalcBuffer(a6),a1 +.nowrap + PUTMSG 40,<"Precalcing frame %p">,pd_CubeDataWritePtr(a6) + PUSHM a1 + move.l pd_CubeSceneRoutinePtr(a6),a0 + jsr (a0) + move.l pd_CubeDataWritePtr(a6),a1 + bsr gou_calculate_cube_stuff + bsr gou_interpolate_inner_cube_lines + POPM + + move.l a1,pd_CubeDataWritePtr(a6) + addq.w #1,pd_PrecalculatedFrames(a6) + bra .fillup +.skipprecalc +.bufferfull + + CALLFW Yield + + tst.w pd_QuitAsyncTask(a6) + beq .loop + + PUTMSG 10,<"Async-Task terminates..."> + rts + +;-------------------------------------------------------------------- + +MaxVerts = 8 +MaxPlanes = 6 +MaxLines = 12 + +PERSP2D MACRO ;final projection from world to screen coords + neg.w d2 ;world +z is forward,screen perspective is away + move.w d2,-(sp) + move.b (sp)+,d2 ; shift d2 8 bits down + ext.w d2 + add.w #GOURAUD_Z_DIST,d2 ; 78 and eye Z determines Field of View. + divs d2,d0 + divs d2,d1 + add.w #CUBE_WIDTH/2,d0 ;center horizontally on the screen + ;asr.w #1,d0 + add.w #CUBE_HEIGHT/2,d1 ;center vertically + ;asr.w #1,d1 + ENDM + +gou_calculate_cube_stuff: + PUTMSG 50,<"Out CD %p">,a1 + ; rotate 3D object + bsr gou_rotate_cube + + lea cd_CubeNormals-6+4(a1),a2 + lea gou_cube_plane_coords(pc),a3 ; calculate which planes use which coords + moveq.l #-1,d1 + lea cd_PlanesToDraw(a1),a0 + move.l d1,(a0) + move.w pd_CubeCullingValue(a6),d5 + moveq.l #0,d1 ; coords in use + moveq.l #0,d2 ; lines in use + moveq.l #0,d3 ; inner lines + moveq.l #MaxPlanes-1,d7 +.planeloop1 + addq.w #6,a2 + move.l (a3)+,d0 + cmp.w (a2),d5 + dbmi d7,.planeloop1 + bpl .doneculling + move.b d7,(a0)+ ; write down first plane number (5 and decreasing) + move.w d0,d1 ; coordinates used for first plane + swap d0 + move.w d0,d2 + subq.w #1,d7 + bmi .doneculling + +.planeloop2 + addq.w #6,a2 + move.l (a3)+,d0 + cmp.w (a2),d5 + dbmi d7,.planeloop2 + bpl .doneculling + move.b d7,(a0)+ ; write down second plane number (4 and decreasing) + or.w d0,d1 ; or coordinates used for second plane + swap d0 + move.w d0,d4 + and.w d2,d4 + or.w d4,d3 ; inner lines + or.w d0,d2 ; used lines + subq.w #1,d7 + bmi.s .doneculling + +.planeloop3 + addq.w #6,a2 + move.l (a3)+,d0 + cmp.w (a2),d5 + dbmi d7,.planeloop3 + bpl.s .doneculling + move.b d7,(a0)+ ; write down third plane number (3 and decreasing) + + or.w d0,d1 ; or coordinates used for third plane + swap d0 + move.w d0,d4 + and.w d2,d4 + or.w d4,d3 ; inner lines + or.w d0,d2 ; used lines + +.doneculling + move.w d2,cd_LinesToDraw(a1) + move.w d3,cd_InnerLines(a1) + move.w d1,d7 ; save coordinate mask for loop below + + ; do projection on required coordinates + lea cd_Coords(a1),a0 ; rotated vertices + lea cd_ProjCoords(a1),a2 ; projected coords + bra.s .vertexl +.skip + beq.s .done + addq.w #6,a0 + addq.w #4,a2 +.vertexl + lsr.w #1,d7 + bcc.s .skip + movem.w (a0)+,d0-d2 ; x0,y0,z0 + PERSP2D ; d0/d1 result, d2 trashed + PUTMSG 50,<"Proj %d,%d">,d0,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + bra.s .vertexl +.done rts + +;-------------------------------------------------------------------- + +SETGRAYCOL0 MACRO + ; 0 + ENDM + +SETGRAYCOL1 MACRO + ; 1 + bchg d7,(a4) + ENDM + +SETGRAYCOL2 MACRO + ; 3 + bchg d7,(a4) + bchg d7,1*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL3 MACRO + ; 7 + bchg d7,(a4) + bchg d7,1*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,2*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL4 MACRO + ; 15 + bchg d7,(a4) + bchg d7,1*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,2*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,3*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL5 MACRO + ; 11 + bchg d7,(a4) + bchg d7,1*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,3*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL6 MACRO + ; 9 + bchg d7,(a4) + bchg d7,3*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL7 MACRO + ; 8 + bchg d7,3*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL8 MACRO + ; 12 + bchg d7,2*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,3*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL9 MACRO + ; 13 + bchg d7,0*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,2*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,3*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL10 MACRO + ; 5 + bchg d7,0*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,2*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL11 MACRO + ; 4 + bchg d7,2*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL12 MACRO + ; 6 + bchg d7,1*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,2*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL13 MACRO + ; 14 + bchg d7,1*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,2*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,3*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL14 MACRO + ; 10 + bchg d7,1*(CUBE_BUF_WIDTH/8)(a4) + bchg d7,3*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +SETGRAYCOL15 MACRO + ; 2 + bchg d7,1*(CUBE_BUF_WIDTH/8)(a4) + ENDM + +LINEDRAWSELECT MACRO + add.w d1,d1 ; 2*dx + move.w d2,d0 ; dy will become loopcount + subq.w #1,d0 ; loopcount + bmi .linedone + ENDM + +LINEDRAW MACRO +.enter\1 + PUTMSG 50,<"dtdz=%lx, dcol=%lx, zerror=%lx">,d5,a3,d6 + move.l d5,a1 ; dtdz + move.w d2,d5 ; error = dy + add.w d2,d2 ; 2*dy + subq.w #1,d4 +.yloop\@ + PUTMSG 50,<"dtdz=%lx, dcol=%lx, zerror=%lx x=%d, y=%d">,a1,a3,d6,d3,d4 + lea (CUBE_BUF_WIDTH/8)*CUBE_PLANES(a4),a4 + addq.w #1,d4 ; !!!!! ypos++ + + sub.w d1,d5 ; error -= 2 * dx + bpl.s .nox\@ + sub.l a3,d6 ; zerror -= dcol (for y movement) +.morex\@ + IFGT \3 + addq.w #1,d3 ; !!!!! xpos++ + subq.w #1,d7 ; bitpos + bpl.s .noai\@ + moveq.l #7,d7 + addq.w #1,a4 + ELSE + subq.w #1,d3 ; !!!!! xpos-- + addq.w #1,d7 ; bitpos + bne.s .noai\@ + moveq.l #-8,d7 + subq.w #1,a4 + ENDC +.noai\@ + + sub.l a3,d6 ; zerror -= dcol (for x movement) + bpl.s .nozm\@ + add.w d2,d5 ; error += 2 * dy +.morez\1 +.morez\@ + PUTMSG 40,<"\1 ->> \2 LinePoint %d,%d %lx">,d3,d4,d6 + move.w d4,(a2)+ ; add line point ypos + move.w d3,(a2)+ ; add line point xpos + add.l a1,d6 ; zerror += dtdz + bmi.s .morez\2 + tst.w d5 + bra.s .nozm\2 +.nozm\@ add.w d2,d5 ; error += 2 * dy +.nozm\1 + bmi.s .morex\@ + bra.s .ldone\@ +.nox\@ + sub.l a3,d6 ; zerror -= dcol (for y movement) + bmi.s .morez\@ +.ldone\@ + SETGRAYCOL\4 + + dbra d0,.yloop\@ + bra .linedone + ENDM + +LINEDRAW_SC MACRO +.enter\1 + move.w d2,d5 ; error = dy + add.w d2,d2 ; 2*dy +.yloop\@ + lea (CUBE_BUF_WIDTH/8)*CUBE_PLANES(a4),a4 + sub.w d1,d5 ; error -= 2 * dx + bpl.s .ldone\@ +.morex\@ + IFGT \2 + subq.w #1,d7 ; bitpos + bpl.s .noai\@ + moveq.l #7,d7 + addq.w #1,a4 + ELSE + addq.w #1,d7 ; bitpos + bne.s .noai\@ + moveq.l #-8,d7 + subq.w #1,a4 + ENDC +.noai\@ + add.w d2,d5 ; error += 2 * dy + bmi.s .morex\@ +.ldone\@ + SETGRAYCOL\3 + + dbra d0,.yloop\@ + bra .linedone + ENDM + + +ZEROIPOL MACRO + subq.w #1,d1 ; loopcount +.xloop\@ + IFGT \1 + addq.w #1,d3 ; !!!!! xpos++ + ELSE + subq.w #1,d3 ; !!!!! xpos-- + ENDC + sub.l d0,d6 ; zerror -= dcol (for y movement) + dbmi d1,.xloop\@ + bpl .linedone +.morez\@ + PUTMSG 40,<"LinePoint %d,%d">,d3,d4 + move.w d4,(a2)+ ; add line point ypos + move.w d3,(a2)+ ; add line point xpos + add.l d5,d6 ; zerror += dtdz + dbmi d1,.xloop\@ + bmi.s .morez\@ + bra .linedone + ENDM + + +;-------------------------------------------------------------------- +; a1 = cubedata +gou_interpolate_outer_cube_lines: + PUTMSG 20,<"%d: ----- gou_interpolate_outer_cube_lines">,fw_FrameCounterLong(a6) + move.w cd_LinesToDraw(a1),d7 + sub.w cd_InnerLines(a1),d7 + bne.s .cont + rts +.cont + lea cd_IntCubeLines(a1),a0 + lea cd_ProjCoords(a1),a2 + lea cd_Coords(a1),a3 ; z coords + move.l pd_CurrCubeLinePtr(a6),a4 +.loop + PUTMSG 20,<"Line %x">,d7 + lsr.w #1,d7 + bcc .skipline + + PUSHM d7/a1-a4 + + PUTMSG 40,<"%p/%p/%p/%p From/To %d - %d">,a0,a1,a2,a3,il_FromCoord-2(a0),il_ToCoord-2(a0) + + move.w #GOURAUD_Z_ADD,d2 + move.w il_FromCoord(a0),d0 + move.l (a2,d0.w),il_FromX(a0) + lsr.w #1,d0 + add.w il_FromCoord(a0),d0 + move.w 2*2(a3,d0.w),d0 + add.w d2,d0 + move.w d0,il_FromZ(a0) + + move.w il_ToCoord(a0),d1 + move.l (a2,d1.w),il_ToX(a0) + lsr.w #1,d1 + add.w il_ToCoord(a0),d1 + move.w 2*2(a3,d1.w),d1 + add.w d2,d1 + move.w d1,il_ToZ(a0) + + move.w d0,d2 + eor.w d1,d2 + cmp.w #1<,d0,d1 + + lea il_Coords(a0),a2 + + move.w d0,d6 ; will become zpos + + sub.w d1,d0 ; deltaz + neg.w d0 + + move.w il_ToX(a0),d1 + move.w il_FromX(a0),d3 ; startx + sub.w d3,d1 ; deltax + move.w il_ToY(a0),d2 + move.w il_FromY(a0),d4 + sub.w d4,d2 ; deltay + smi il_Flipped(a0) + beq .zerody + bpl.s .noflipy + neg.w d0 ; flip deltaz + neg.w d1 ; flip deltax + neg.w d2 ; flip deltay + move.w il_ToX(a0),d3 ; swap startx + move.w il_ToY(a0),d4 ; swap starty + move.w il_ToZ(a0),d6 ; swap zpos +.noflipy + PUTMSG 40,<"X/Y/Z=%d,%d,%d, DX/DY/DZ = %d/%d/%d">,d3,d4,d6,d1,d2,d0 + move.w d6,d7 + lsr.w #8,d7 + lsr.w #16-(gouraudErrShift+8),d7 ; col + lsl.w #gouraudErrShift,d6 ; zpos + + tst.w d0 ; deltaz + smi il_DzNeg(a0) + bmi.s .noflipz + not.w d6 ; $ffff - zpos + neg.w d0 ; deltaz now negative +.noflipz + neg.w d0 ; abs(deltaz) + ext.l d0 + lsl.l #gouraudErrShift,d0 ; dcol + + PUTMSG 40,<"Col=%d, dcol=%ld, zpos=%x">,d7,d0,d6 + + moveq.l #0,d5 ; dtdz + move.w d1,d5 + bpl.s .noabsx + neg.w d5 ; abs(dx) +.noabsx + add.w d2,d5 ; abs(dx)+dy (dy always positive) + + mulu d5,d6 ; zerror = (dtdz>>16)*zpos + swap d5 ; now really dtdz + + lsl.w #2,d7 ; calculate color start routine + move.w d7,a1 + + move.l d0,a3 + move.w d4,d0 + lsl.w #6,d0 ; replaced mulu by shift + ;mulu #(CUBE_BUF_WIDTH/8)*CUBE_PLANES,d0 + adda.w d0,a4 ; start pos y + + moveq.l #7,d7 + and.w d3,d7 + move.w d3,d0 + lsr.w #3,d0 + adda.w d0,a4 + + tst.w d1 ; dx? + bmi .downleft + +.downright +; d0.w = loopcount.w +; d1.w = dx -> 2*dx.w +; d2.w = dy -> 2*dy.w +; d3.w = xpos -> xpos.w +; d4.w = ypos -> ypos.w +; d5.l = dtdz -> error.w +; d6.l = zerror.l +; d7.l = bitpos +; a1.l = dtdz.l +; a2.l = line output pointer +; a3.l = dcol.l +; a4.l = bitplane pointer + + eor.w #7,d7 + + tst.b il_DzNeg(a0) + bmi.s .downright_neg + + LINEDRAWSELECT + jmp .ruptab(pc,a1.w) +.ruptab + bra.w .enterrupm3 + bra.w .enterrupm2 + bra.w .enterrupm1 + bra.w .enterrup0 + bra.w .enterrup1 + bra.w .enterrup2 + bra.w .enterrup3 + bra.w .enterrup4 + bra.w .enterrup5 + bra.w .enterrup6 + bra.w .enterrup7 + bra.w .enterrup8 + bra.w .enterrup9 + bra.w .enterrup10 + bra.w .enterrup11 + bra.w .enterrup12 + bra.w .enterrup13 + bra.w .enterrup14 + bra.w .enterrup15 + bra.w .enterrup15 + bra.w .enterrup15 + bra.w .enterrup15 + bra.w .enterrup15 + bra.w .enterrup15 + +.downright_neg + LINEDRAWSELECT + jmp .rdowntab(pc,a1.w) +.rdowntab + bra.w .enterrdown0 + bra.w .enterrdown0 + bra.w .enterrdown0 + bra.w .enterrdown0 + bra.w .enterrdown1 + bra.w .enterrdown2 + bra.w .enterrdown3 + bra.w .enterrdown4 + bra.w .enterrdown5 + bra.w .enterrdown6 + bra.w .enterrdown7 + bra.w .enterrdown8 + bra.w .enterrdown9 + bra.w .enterrdown10 + bra.w .enterrdown11 + bra.w .enterrdown12 + bra.w .enterrdown13 + bra.w .enterrdown14 + bra.w .enterrdown15 + bra.w .enterrdown16 + bra.w .enterrdown17 + bra.w .enterrdown18 + bra.w .enterrdown19 + bra.w .enterrdown20 + +.downleft + neg.w d1 + not.w d7 + + tst.b il_DzNeg(a0) + bmi.s .downleft_neg + + LINEDRAWSELECT + jmp .luptab(pc,a1.w) +.luptab + bra.w .enterlupm3 + bra.w .enterlupm2 + bra.w .enterlupm1 + bra.w .enterlup0 + bra.w .enterlup1 + bra.w .enterlup2 + bra.w .enterlup3 + bra.w .enterlup4 + bra.w .enterlup5 + bra.w .enterlup6 + bra.w .enterlup7 + bra.w .enterlup8 + bra.w .enterlup9 + bra.w .enterlup10 + bra.w .enterlup11 + bra.w .enterlup12 + bra.w .enterlup13 + bra.w .enterlup14 + bra.w .enterlup15 + bra.w .enterlup15 + bra.w .enterlup15 + bra.w .enterlup15 + bra.w .enterlup15 + bra.w .enterlup15 + +.downleft_neg + LINEDRAWSELECT + jmp .ldowntab(pc,a1.w) +.ldowntab + bra.w .enterldown0 + bra.w .enterldown0 + bra.w .enterldown0 + bra.w .enterldown0 + bra.w .enterldown1 + bra.w .enterldown2 + bra.w .enterldown3 + bra.w .enterldown4 + bra.w .enterldown5 + bra.w .enterldown6 + bra.w .enterldown7 + bra.w .enterldown8 + bra.w .enterldown9 + bra.w .enterldown10 + bra.w .enterldown11 + bra.w .enterldown12 + bra.w .enterldown13 + bra.w .enterldown14 + bra.w .enterldown15 + bra.w .enterldown16 + bra.w .enterldown17 + bra.w .enterldown18 + bra.w .enterldown19 + bra.w .enterldown20 + +.zerodydx + PUTMSG 40,<"Zero DX/DY"> + moveq.l #0,d7 + moveq.l #0,d6 + move.b il_FromZ(a0),d7 + lsr.w #gouraudColShift-8,d7 + move.b il_ToZ(a0),d6 + lsr.w #gouraudColShift-8,d6 + sub.w d6,d7 + beq.s .linedone + bpl.s .noflipdz + neg.w d7 +.noflipdz + subq.w #1,d7 +.loopspotcols + move.w d4,(a2)+ ; add line point ypos + move.w d3,(a2)+ ; add line point xpos + dbra d7,.loopspotcols + bra.s .linedone +.zerody + PUTMSG 40,<"Zero DY"> + tst.w d1 + beq.s .zerodydx + lsl.w #gouraudErrShift,d6 ; zpos + tst.w d0 ; deltaz + smi il_DzNeg(a0) + bmi.s .noflipz2 + not.w d6 ; $ffff - zpos + neg.w d0 ; deltaz now negative +.noflipz2 + neg.w d0 ; abs(deltaz) + ext.l d0 + lsl.l #gouraudErrShift,d0 ; dcol + moveq.l #0,d5 ; dtdz + move.w d1,d5 + bmi.s .plainleft + +; d0.l = dcol.l +; d1.w = dx -> loopcount.w +; d3.w = xpos.w +; d3.w = ypos.w +; d5.l = dtdz.l +; d6.l = zerror.l + +.plainright + mulu d5,d6 ; zerror = (dtdz>>16)*zpos + swap d5 ; now really dtdz + ZEROIPOL 1 + +.plainleft + neg.w d5 ; abs(dx) + mulu d5,d6 ; zerror = (dtdz>>16)*zpos + swap d5 ; now really dtdz + + neg.w d1 + ZEROIPOL -1 + +.linedone + suba.l a0,a2 + move.w a2,d0 + lsr.w #2,d0 + move.w d0,il_NumCoords(a0) + + POPM + +.skipline + lea il_SIZEOF(a0),a0 + tst.w d7 + bne .loop + + rts + +.samecolorspecialcase + PUTMSG 40,<"Same color special case from %d to %d">,d0,d1 + + lea il_Coords(a0),a2 + + move.w il_ToX(a0),d1 + move.w il_FromX(a0),d3 ; startx + sub.w d3,d1 ; deltax + move.w il_ToY(a0),d2 + move.w il_FromY(a0),d4 + sub.w d4,d2 ; deltay + smi il_Flipped(a0) + beq.s .linedone + bpl.s .noflipy_sc + neg.w d1 ; flip deltax + neg.w d2 ; flip deltay + move.w il_ToX(a0),d3 ; swap startx + move.w il_ToY(a0),d4 ; swap starty +.noflipy_sc + PUTMSG 50,<"X/Y=%d,%d, DX/DY = %d/%d">,d3,d4,d1,d2 + move.w d0,d7 + ;rol.w #(gouraudErrShift+2),d7 + asr.w #8,d7 + asr.w #16-(gouraudErrShift+8),d7 ; col + + PUTMSG 50,<"Col=%d">,d7 + + lsl.w #2,d7 ; calculate color start routine + move.w d7,a1 + + lsl.w #6,d4 ; replaced mulu by shift + ;mulu #(CUBE_BUF_WIDTH/8)*CUBE_PLANES,d4 + adda.w d4,a4 ; start pos y + + moveq.l #7,d7 + and.w d3,d7 + move.w d3,d0 + lsr.w #3,d0 + adda.w d0,a4 + + tst.w d1 ; dx? + bmi .downleft_sc + +.downright_sc +; d0.w = loopcount.w +; d1.w = dx -> 2*dx.w +; d2.w = dy -> 2*dy.w +; d3.w = xpos -> xpos.w +; d4.w = ypos -> ypos.w +; d7.l = bitpos +; a4.l = bitplane pointer + + eor.w #7,d7 + + tst.b il_DzNeg(a0) + bmi.s .downright_neg_sc + + LINEDRAWSELECT + jmp .ruptab_sc(pc,a1.w) +.ruptab_sc + bra.w .enterrup_sc0 + bra.w .enterrup_sc0 + bra.w .enterrup_sc0 + bra.w .enterrup_sc0 + bra.w .enterrup_sc1 + bra.w .enterrup_sc2 + bra.w .enterrup_sc3 + bra.w .enterrup_sc4 + bra.w .enterrup_sc5 + bra.w .enterrup_sc6 + bra.w .enterrup_sc7 + bra.w .enterrup_sc8 + bra.w .enterrup_sc9 + bra.w .enterrup_sc10 + bra.w .enterrup_sc11 + bra.w .enterrup_sc12 + bra.w .enterrup_sc13 + bra.w .enterrup_sc14 + bra.w .enterrup_sc15 + bra.w .enterrup_sc15 + bra.w .enterrup_sc15 + bra.w .enterrup_sc15 + bra.w .enterrup_sc15 + bra.w .enterrup_sc15 + +.downright_neg_sc + LINEDRAWSELECT + jmp .rdowntab_sc(pc,a1.w) +.rdowntab_sc + bra.w .enterrdown_sc0 + bra.w .enterrdown_sc0 + bra.w .enterrdown_sc0 + bra.w .enterrdown_sc0 + bra.w .enterrdown_sc1 + bra.w .enterrdown_sc2 + bra.w .enterrdown_sc3 + bra.w .enterrdown_sc4 + bra.w .enterrdown_sc5 + bra.w .enterrdown_sc6 + bra.w .enterrdown_sc7 + bra.w .enterrdown_sc8 + bra.w .enterrdown_sc9 + bra.w .enterrdown_sc10 + bra.w .enterrdown_sc11 + bra.w .enterrdown_sc12 + bra.w .enterrdown_sc13 + bra.w .enterrdown_sc14 + bra.w .enterrdown_sc15 + bra.w .enterrdown_sc15 + bra.w .enterrdown_sc15 + bra.w .enterrdown_sc15 + bra.w .enterrdown_sc15 + bra.w .enterrdown_sc15 + +.downleft_sc + neg.w d1 + not.w d7 + + tst.b il_DzNeg(a0) + bmi.s .downleft_neg_sc + + LINEDRAWSELECT + jmp .luptab_sc(pc,a1.w) +.luptab_sc + bra.w .enterlup_sc0 + bra.w .enterlup_sc0 + bra.w .enterlup_sc0 + bra.w .enterlup_sc0 + bra.w .enterlup_sc1 + bra.w .enterlup_sc2 + bra.w .enterlup_sc3 + bra.w .enterlup_sc4 + bra.w .enterlup_sc5 + bra.w .enterlup_sc6 + bra.w .enterlup_sc7 + bra.w .enterlup_sc8 + bra.w .enterlup_sc9 + bra.w .enterlup_sc10 + bra.w .enterlup_sc11 + bra.w .enterlup_sc12 + bra.w .enterlup_sc13 + bra.w .enterlup_sc14 + bra.w .enterlup_sc15 + bra.w .enterlup_sc15 + bra.w .enterlup_sc15 + bra.w .enterlup_sc15 + bra.w .enterlup_sc15 + bra.w .enterlup_sc15 + +.downleft_neg_sc + LINEDRAWSELECT + jmp .ldowntab_sc(pc,a1.w) +.ldowntab_sc + bra.w .enterldown_sc0 + bra.w .enterldown_sc0 + bra.w .enterldown_sc0 + bra.w .enterldown_sc0 + bra.w .enterldown_sc1 + bra.w .enterldown_sc2 + bra.w .enterldown_sc3 + bra.w .enterldown_sc4 + bra.w .enterldown_sc5 + bra.w .enterldown_sc6 + bra.w .enterldown_sc7 + bra.w .enterldown_sc8 + bra.w .enterldown_sc9 + bra.w .enterldown_sc10 + bra.w .enterldown_sc11 + bra.w .enterldown_sc12 + bra.w .enterldown_sc13 + bra.w .enterldown_sc14 + bra.w .enterldown_sc15 + bra.w .enterldown_sc15 + bra.w .enterldown_sc15 + bra.w .enterldown_sc15 + bra.w .enterldown_sc15 + bra.w .enterldown_sc15 + + LINEDRAW rupm3,rupm2,1,0 + LINEDRAW rupm2,rupm1,1,0 + LINEDRAW rupm1,rup0,1,0 + LINEDRAW rup0,rup1,1,0 + LINEDRAW rup1,rup2,1,1 + LINEDRAW rup2,rup3,1,2 + LINEDRAW rup3,rup4,1,3 + LINEDRAW rup4,rup5,1,4 + LINEDRAW rup5,rup6,1,5 + LINEDRAW rup6,rup7,1,6 + LINEDRAW rup7,rup8,1,7 + LINEDRAW rup8,rup9,1,8 + LINEDRAW rup9,rup10,1,9 + LINEDRAW rup10,rup11,1,10 + LINEDRAW rup11,rup12,1,11 + LINEDRAW rup12,rup13,1,12 + LINEDRAW rup13,rup14,1,13 + LINEDRAW rup14,rup15,1,14 + LINEDRAW rup15,rup15,1,15 + + LINEDRAW lupm3,lupm2,-1,0 + LINEDRAW lupm2,lupm1,-1,0 + LINEDRAW lupm1,lup0,-1,0 + LINEDRAW lup0,lup1,-1,0 + LINEDRAW lup1,lup2,-1,1 + LINEDRAW lup2,lup3,-1,2 + LINEDRAW lup3,lup4,-1,3 + LINEDRAW lup4,lup5,-1,4 + LINEDRAW lup5,lup6,-1,5 + LINEDRAW lup6,lup7,-1,6 + LINEDRAW lup7,lup8,-1,7 + LINEDRAW lup8,lup9,-1,8 + LINEDRAW lup9,lup10,-1,9 + LINEDRAW lup10,lup11,-1,10 + LINEDRAW lup11,lup12,-1,11 + LINEDRAW lup12,lup13,-1,12 + LINEDRAW lup13,lup14,-1,13 + LINEDRAW lup14,lup15,-1,14 + LINEDRAW lup15,lup15,-1,15 + + LINEDRAW rdown0,rdown0,1,0 + LINEDRAW rdown1,rdown0,1,1 + LINEDRAW rdown2,rdown1,1,2 + LINEDRAW rdown3,rdown2,1,3 + LINEDRAW rdown4,rdown3,1,4 + LINEDRAW rdown5,rdown4,1,5 + LINEDRAW rdown6,rdown5,1,6 + LINEDRAW rdown7,rdown6,1,7 + LINEDRAW rdown8,rdown7,1,8 + LINEDRAW rdown9,rdown8,1,9 + LINEDRAW rdown10,rdown9,1,10 + LINEDRAW rdown11,rdown10,1,11 + LINEDRAW rdown12,rdown11,1,12 + LINEDRAW rdown13,rdown12,1,13 + LINEDRAW rdown14,rdown13,1,14 + LINEDRAW rdown15,rdown14,1,15 + LINEDRAW rdown16,rdown15,1,15 + LINEDRAW rdown17,rdown16,1,15 + LINEDRAW rdown18,rdown17,1,15 + LINEDRAW rdown19,rdown18,1,15 + LINEDRAW rdown20,rdown19,1,15 + + LINEDRAW ldown0,ldown0,-1,0 + LINEDRAW ldown1,ldown0,-1,1 + LINEDRAW ldown2,ldown1,-1,2 + LINEDRAW ldown3,ldown2,-1,3 + LINEDRAW ldown4,ldown3,-1,4 + LINEDRAW ldown5,ldown4,-1,5 + LINEDRAW ldown6,ldown5,-1,6 + LINEDRAW ldown7,ldown6,-1,7 + LINEDRAW ldown8,ldown7,-1,8 + LINEDRAW ldown9,ldown8,-1,9 + LINEDRAW ldown10,ldown9,-1,10 + LINEDRAW ldown11,ldown10,-1,11 + LINEDRAW ldown12,ldown11,-1,12 + LINEDRAW ldown13,ldown12,-1,13 + LINEDRAW ldown14,ldown13,-1,14 + LINEDRAW ldown15,ldown14,-1,15 + LINEDRAW ldown16,ldown15,-1,15 + LINEDRAW ldown17,ldown16,-1,15 + LINEDRAW ldown18,ldown17,-1,15 + LINEDRAW ldown19,ldown18,-1,15 + LINEDRAW ldown20,ldown19,-1,15 + + LINEDRAW_SC rup_sc0,1,0 + LINEDRAW_SC rup_sc1,1,1 + LINEDRAW_SC rup_sc2,1,2 + LINEDRAW_SC rup_sc3,1,3 + LINEDRAW_SC rup_sc4,1,4 + LINEDRAW_SC rup_sc5,1,5 + LINEDRAW_SC rup_sc6,1,6 + LINEDRAW_SC rup_sc7,1,7 + LINEDRAW_SC rup_sc8,1,8 + LINEDRAW_SC rup_sc9,1,9 + LINEDRAW_SC rup_sc10,1,10 + LINEDRAW_SC rup_sc11,1,11 + LINEDRAW_SC rup_sc12,1,12 + LINEDRAW_SC rup_sc13,1,13 + LINEDRAW_SC rup_sc14,1,14 + LINEDRAW_SC rup_sc15,1,15 + + LINEDRAW_SC lup_sc0,-1,0 + LINEDRAW_SC lup_sc1,-1,1 + LINEDRAW_SC lup_sc2,-1,2 + LINEDRAW_SC lup_sc3,-1,3 + LINEDRAW_SC lup_sc4,-1,4 + LINEDRAW_SC lup_sc5,-1,5 + LINEDRAW_SC lup_sc6,-1,6 + LINEDRAW_SC lup_sc7,-1,7 + LINEDRAW_SC lup_sc8,-1,8 + LINEDRAW_SC lup_sc9,-1,9 + LINEDRAW_SC lup_sc10,-1,10 + LINEDRAW_SC lup_sc11,-1,11 + LINEDRAW_SC lup_sc12,-1,12 + LINEDRAW_SC lup_sc13,-1,13 + LINEDRAW_SC lup_sc14,-1,14 + LINEDRAW_SC lup_sc15,-1,15 + + LINEDRAW_SC rdown_sc0,1,0 + LINEDRAW_SC rdown_sc1,1,1 + LINEDRAW_SC rdown_sc2,1,2 + LINEDRAW_SC rdown_sc3,1,3 + LINEDRAW_SC rdown_sc4,1,4 + LINEDRAW_SC rdown_sc5,1,5 + LINEDRAW_SC rdown_sc6,1,6 + LINEDRAW_SC rdown_sc7,1,7 + LINEDRAW_SC rdown_sc8,1,8 + LINEDRAW_SC rdown_sc9,1,9 + LINEDRAW_SC rdown_sc10,1,10 + LINEDRAW_SC rdown_sc11,1,11 + LINEDRAW_SC rdown_sc12,1,12 + LINEDRAW_SC rdown_sc13,1,13 + LINEDRAW_SC rdown_sc14,1,14 + LINEDRAW_SC rdown_sc15,1,15 + + LINEDRAW_SC ldown_sc0,-1,0 + LINEDRAW_SC ldown_sc1,-1,1 + LINEDRAW_SC ldown_sc2,-1,2 + LINEDRAW_SC ldown_sc3,-1,3 + LINEDRAW_SC ldown_sc4,-1,4 + LINEDRAW_SC ldown_sc5,-1,5 + LINEDRAW_SC ldown_sc6,-1,6 + LINEDRAW_SC ldown_sc7,-1,7 + LINEDRAW_SC ldown_sc8,-1,8 + LINEDRAW_SC ldown_sc9,-1,9 + LINEDRAW_SC ldown_sc10,-1,10 + LINEDRAW_SC ldown_sc11,-1,11 + LINEDRAW_SC ldown_sc12,-1,12 + LINEDRAW_SC ldown_sc13,-1,13 + LINEDRAW_SC ldown_sc14,-1,14 + LINEDRAW_SC ldown_sc15,-1,15 + + +;-------------------------------------------------------------------- + +LINEIPOL MACRO + move.w d2,d7 ; error (=dy) + add.w d1,d1 ; 2*dx + move.w d2,d0 + add.w d2,d2 ; 2*dy + subq.w #1,d0 ; loopcount (top word) + bmi .linedone +.yloop\@ + addq.w #1,d4 ; !!!!! ypos++ + + sub.w d1,d7 ; error -= 2 * dx + bpl.s .nox\@ + sub.l a3,d6 ; zerror -= dcol (for y movement) +.morex\@ + IFGT \1 + addq.w #1,d3 ; !!!!! xpos++ + ELSE + subq.w #1,d3 ; !!!!! xpos-- + ENDC + + add.w d2,d7 ; error += 2 * dy + sub.l a3,d6 ; zerror -= dcol (for x movement) + bpl.s .nozm\@ +.morez\@ + + PUTMSG 40,<"LinePoint %d,%d">,d3,d4 + move.w d4,(a2)+ ; add line point (ypos) + move.w d3,(a2)+ ; add line point (xpos) + add.l d5,d6 ; zerror += dtdz + bmi.s .morez\@ +.nozm\@ tst.w d7 + bmi.s .morex\@ + + dbra d0,.yloop\@ + bra .linedone +.nox\@ + sub.l a3,d6 ; zerror -= dcol (for y movement) + bpl.s .ldone\@ +.zmin\@ + PUTMSG 40,<"LinePoint %d,%d">,d3,d4 + move.w d4,(a2)+ ; add line point (ypos) + move.w d3,(a2)+ ; add line point (xpos) + add.l d5,d6 ; zerror += dtdz + bmi.s .zmin\@ +.ldone\@ + dbra d0,.yloop\@ + bra .linedone + ENDM + +;-------------------------------------------------------------------- +; a1 = cubedata +gou_interpolate_inner_cube_lines: + PUTMSG 20,<"%d: ----- gou_interpolate_inner_cube_lines">,fw_FrameCounterLong(a6) + move.w cd_InnerLines(a1),d7 + bne.s .cont + rts +.cont + lea cd_IntCubeLines(a1),a0 + lea cd_ProjCoords(a1),a2 + lea cd_Coords(a1),a3 ; z coords +.loop + PUTMSG 50,<"Line %x">,d7 + lsr.w #1,d7 + bcc .skipline + + PUSHM d7/a2-a3 + + PUTMSG 40,<"%p/%p/%p/%p From/To %d - %d">,a0,a1,a2,a3,il_FromCoord-2(a0),il_ToCoord-2(a0) + + move.w #GOURAUD_Z_ADD,d2 + move.w il_FromCoord(a0),d0 + move.l (a2,d0.w),il_FromX(a0) + lsr.w #1,d0 + add.w il_FromCoord(a0),d0 + move.w 2*2(a3,d0.w),d0 + add.w d2,d0 + move.w d0,il_FromZ(a0) + + move.w il_ToCoord(a0),d1 + move.l (a2,d1.w),il_ToX(a0) + lsr.w #1,d1 + add.w il_ToCoord(a0),d1 + move.w 2*2(a3,d1.w),d1 + add.w d2,d1 + move.w d1,il_ToZ(a0) + + PUTMSG 40,<"Z from %d to %d">,d0,d1 + + lea il_Coords(a0),a2 + move.l a2,a3 + + move.w d0,d6 ; will become zpos + + sub.w d1,d0 ; deltaz + neg.w d0 + + move.w il_ToX(a0),d1 + move.w il_FromX(a0),d3 ; startx + sub.w d3,d1 ; deltax + move.w il_ToY(a0),d2 + move.w il_FromY(a0),d4 + sub.w d4,d2 ; deltay + smi il_Flipped(a0) + bpl.s .noflipy + neg.w d0 ; flip deltaz + neg.w d1 ; flip deltax + neg.w d2 ; flip deltay + move.w il_ToX(a0),d3 ; swap startx + move.w il_ToY(a0),d4 ; swap starty + move.w il_ToZ(a0),d6 ; swap zpos +.noflipy + PUTMSG 40,<"X/Y/Z=%d,%d,%d, DX/DY/DZ = %d/%d/%d">,d3,d4,d6,d1,d2,d0 + lsl.w #gouraudErrShift,d6 ; zpos + + tst.w d0 ; deltaz + smi il_DzNeg(a0) + bmi.s .noflipz + not.w d6 ; $ffff - zpos + neg.w d0 ; deltaz now negative +.noflipz + neg.w d0 ; abs(deltaz) + ext.l d0 + lsl.l #gouraudErrShift,d0 ; dcol + + PUTMSG 40,<"dcol=%ld, zpos=%x">,d0,d6 + + moveq.l #0,d5 ; dtdz + move.w d1,d5 + bpl.s .noabsx + neg.w d5 ; abs(dx) +.noabsx add.w d2,d5 ; abs(dx)+dy (dy always positive) + mulu d5,d6 ; zerror = (dtdz>>16)*zpos + swap d5 ; now really dtdz + + tst.w d2 + beq .contzerody + + move.l d0,a3 + + tst.w d1 ; dx? + bmi .downleft + +.downright +; d0.w = loopcount.w +; d1.w = dx -> 2*dx.w +; d2.w = dy -> 2*dy.w +; d3.w = xpos -> xpos.w +; d4.w = ypos -> ypos.w +; d5.l = dtdz.l +; d6.l = zerror.l +; d7.l = error.w +; a3.l = dcol.l +; + LINEIPOL 1 + +.downleft + neg.w d1 + + LINEIPOL -1 + +.zerodydx + PUTMSG 40,<"Zero DX/DY (inner)"> + moveq.l #0,d7 + moveq.l #0,d6 + move.b il_FromZ(a0),d7 + lsr.w #gouraudColShift-8,d7 + move.b il_ToZ(a0),d6 + lsr.w #gouraudColShift-8,d6 + sub.w d6,d7 + beq.s .linedone + bpl.s .noflipdz + neg.w d7 +.noflipdz + subq.w #1,d7 +.loopspotcols + move.w d4,(a2)+ ; add line point ypos + move.w d3,(a2)+ ; add line point xpos + dbra d7,.loopspotcols + bra.s .linedone +.contzerody +; d0.l = dcol.l +; d1.w = dx -> loopcount.w +; d3.w = xpos.w +; d3.w = ypos.w +; d5.l = dtdz.l +; d6.l = zerror.l + + tst.w d1 ; dx? + beq.s .zerodydx + bmi .plainleft +.plainright + ZEROIPOL 1 +.plainleft + neg.w d1 + ZEROIPOL -1 + +.linedone + suba.l a0,a2 + move.w a2,d0 + lsr.w #2,d0 + move.w d0,il_NumCoords(a0) + + POPM + +.skipline + lea il_SIZEOF(a0),a0 + tst.w d7 + bne .loop + + rts + +;-------------------------------------------------------------------- + +COPYLINEDATA MACRO + move.w il_NumCoords(\1),d4 + beq.s .lcskip\@ + btst #\2,d5 + IF \3 + beq.s .lcrev\@ + ELSE + bne.s .lcrev\@ + ENDC + PUTMSG 50,<"\2 %d coords fwd">,d4 + subq.w #1,d4 +.lcloop\@ + move.l (\1)+,(\4)+ ; write left part 1 (in order) + dbra d4,.lcloop\@ + bra.s .lcskip\@ +.lcrev\@ + PUTMSG 50,<"\2 %d coords bkw">,d4 + adda.w d4,\1 + adda.w d4,\1 + adda.w d4,\1 + adda.w d4,\1 + subq.w #1,d4 +.lcrloop\@ + move.l -(\1),(\4)+ ; write left part 1 (in order) + dbra d4,.lcrloop\@ +.lcskip\@ + ENDM + +; a1 = cubedata +gou_draw_inner_lines: + moveq.l #0,d7 + move.b cd_PlanesToDraw(a1),d7 + bpl.s .cont +.done + rts +.cont + PUTMSG 40,<"Plane Number: %d">,d7 + PUSHM a1 + lea pd_BQLineInit(a6),a0 + CALLFW AddToBlitterQueue + POPM + lea pd_BQLines(a6),a4 + bsr.s .doit + moveq.l #0,d7 + move.b cd_PlanesToDraw+1(a1),d7 + bmi.s .done + bsr.s .doit + moveq.l #0,d7 + move.b cd_PlanesToDraw+2(a1),d7 + bmi.s .done +.doit + PUSHM a1/a4 + lsl.w #3,d7 + + move.l a1,a4 + lea gou_cube_planes_to_lines(pc),a0 + movem.w (a0,d7.w),a0-a3 + + adda.l a4,a0 + adda.l a4,a1 + adda.l a4,a2 + adda.l a4,a3 + + PUTMSG 40,<"%p Lines %lx,%lx,%lx,%lx">,a1,il_FromCoord(a0),il_FromCoord(a1),il_FromCoord(a2),il_FromCoord(a3) + + move.l il_FromCoord(a0),d4 ; and il_ToCoord (0) + move.l il_FromCoord(a1),d5 ; and il_ToCoord (1) + cmp.w d4,d5 ; to_0 == to_1 ? + beq.s .l1l_l2r_l3r_l4l ; l1 linear, l2 reversed + swap d4 + cmp.w d4,d5 ; from_0 == to_1 ? + beq .l1r_l2r_l3l_l4l ; l1 reversed, l2 reversed + +.l1l_l2l_l3l_l4r + move.w il_FromZ(a0),d4 + sub.w il_FromZ(a2),d4 + move.w d4,d6 + bpl.s .nofl0 + neg.w d6 +.nofl0 + move.w il_FromZ(a1),d5 + sub.w il_ToZ(a3),d5 + move.w d5,d7 + bpl.s .nofr0 + neg.w d7 +.nofr0 cmp.w d7,d6 + blt.s .l1l_l2l_l3l_l4r_dz13 ; abs(dz02) < abs(dz13) + ; dz02 dominant + move.b il_FromZ(a2),d6 ; startZ = coord 2 + moveq.l #0+0+0+8+0+0,d7 + tst.w d4 + bpl .contl + moveq.l #0+0+0+8+0+32,d7 + move.b il_FromZ(a0),d6 ; startZ = coord 0 + bra .contl + +.l1l_l2l_l3l_l4r_dz13 + ; dz13 dominant + move.b il_FromZ(a1),d6 ; startZ = coord 1 + moveq.l #0+0+0+8+16+0,d7 + tst.w d5 + bmi .contl + move.b il_ToZ(a3),d6 ; startZ = reversed coord 3 + moveq.l #0+0+0+8+16+32,d7 + bra .contl + +.l1l_l2r_l3r_l4l + move.w il_FromZ(a0),d4 + sub.w il_ToZ(a2),d4 + move.w d4,d6 + bpl.s .nofl1 + neg.w d6 +.nofl1 + move.w il_ToZ(a1),d5 + sub.w il_FromZ(a3),d5 + move.w d5,d7 + bpl.s .nofr1 + neg.w d7 +.nofr1 cmp.w d7,d6 + blt.s .l1l_l2r_l3r_l4l_dz13 ; abs(dz02) < abs(dz13) + ; dz02 dominant + move.b il_ToZ(a2),d6 ; startZ = reversed coord 2 + moveq.l #0+2+4+0+0+0,d7 + tst.w d4 + bpl.s .contl + moveq.l #0+2+4+0+0+32,d7 + move.b il_FromZ(a0),d6 ; startZ = coord 0 + bra.s .contl + +.l1l_l2r_l3r_l4l_dz13 + ; dz13 dominant + move.b il_ToZ(a1),d6 ; startZ = reversed coord 1 + moveq.l #0+2+4+0+16+0,d7 + tst.w d5 + bmi.s .contl + move.b il_FromZ(a3),d6 ; startZ = coord 3 + moveq.l #0+2+4+0+16+32,d7 + bra.s .contl + +.l1r_l2r_l3l_l4l + move.w il_ToZ(a0),d4 + sub.w il_FromZ(a2),d4 + move.w d4,d6 + bpl.s .nofl2 + neg.w d6 +.nofl2 + move.w il_ToZ(a1),d5 + sub.w il_FromZ(a3),d5 + move.w d5,d7 + bpl.s .nofr2 + neg.w d7 +.nofr2 cmp.w d7,d6 + blt.s .l1r_l2r_l3l_l4l_dz13 ; abs(dz02) < abs(dz13) + ; dz02 dominant + move.b il_FromZ(a2),d6 ; startZ = coord 2 + moveq.l #1+2+0+0+0+0,d7 + tst.w d4 + bpl.s .contl + move.b il_ToZ(a0),d6 ; startZ = reversed coord 0 + moveq.l #1+2+0+0+0+32,d7 + bra.s .contl + +.l1r_l2r_l3l_l4l_dz13 + ; dz13 dominant + move.b il_ToZ(a1),d6 ; startZ = reversed coord 1 + moveq.l #1+2+0+0+16+0,d7 + tst.w d5 + bmi.s .contl + move.b il_FromZ(a3),d6 ; startZ = coord 3 + moveq.l #1+2+0+0+16+32,d7 + +.contl + moveq.l #0,d5 + sub.b il_Flipped(a3),d5 + add.b d5,d5 + sub.b il_Flipped(a2),d5 + add.b d5,d5 + sub.b il_Flipped(a1),d5 + add.b d5,d5 + sub.b il_Flipped(a0),d5 + PUTMSG 50,<"copymode=%x/%x">,d5,d7 + eor.w d7,d5 + + and.w #16+32,d7 + jmp .jmptab(pc,d7.w) +.jmptab + bra .dz02dom_pl + ds.b (.jmptab+16)-* + bra.s .dz13dom_pl + ds.b (.jmptab+32)-* + bra .dz02dom_mi + ds.b (.jmptab+48)-* + bra .dz13dom_mi + +.dz13dom_pl + PUTMSG 40,<"DZ13 PL"> + lea pd_LinesFromBuffer(a6),a4 + COPYLINEDATA a0,0,1,a4 + COPYLINEDATA a3,3,1,a4 + clr.w (a4)+ + PUTMSG 50,<"Right"> + lea pd_LinesToBuffer(a6),a4 + COPYLINEDATA a1,1,0,a4 + COPYLINEDATA a2,2,0,a4 + clr.w (a4)+ + bra .drawnow + +.dz02dom_pl + PUTMSG 40,<"DZ02 PL"> + lea pd_LinesFromBuffer(a6),a4 + COPYLINEDATA a1,1,1,a4 + COPYLINEDATA a0,0,1,a4 + clr.w (a4)+ + PUTMSG 50,<"Right"> + lea pd_LinesToBuffer(a6),a4 + COPYLINEDATA a2,2,0,a4 + COPYLINEDATA a3,3,0,a4 + clr.w (a4)+ + bra .drawnow + +.dz13dom_mi + PUTMSG 40,<"DZ13 MI"> + lea pd_LinesFromBuffer(a6),a4 + COPYLINEDATA a3,3,0,a4 + COPYLINEDATA a0,0,0,a4 + clr.w (a4)+ + PUTMSG 50,<"Right"> + lea pd_LinesToBuffer(a6),a4 + COPYLINEDATA a2,2,1,a4 + COPYLINEDATA a1,1,1,a4 + clr.w (a4)+ + bra .drawnow + +.dz02dom_mi + PUTMSG 40,<"DZ02 MI"> + lea pd_LinesFromBuffer(a6),a4 + COPYLINEDATA a0,0,0,a4 + COPYLINEDATA a1,1,0,a4 + clr.w (a4)+ + PUTMSG 50,<"Right"> + lea pd_LinesToBuffer(a6),a4 + COPYLINEDATA a3,3,1,a4 + COPYLINEDATA a2,2,1,a4 + clr.w (a4)+ + ;bra .drawnow + +.drawnow + POPM + lea pd_LinesFromBuffer(a6),a0 + lea pd_LinesToBuffer(a6),a2 + ext.w d6 + asr.w #gouraudColShift-8,d6 + add.w d6,d6 +.drawloop + move.w (a0)+,d1 + beq.s .end + move.w (a0)+,d0 + move.w (a2)+,d3 + beq.s .end + move.w (a2)+,d2 + PUTMSG 40,<"%d: line %d,%d to %d,%d">,d6,d0,d1,d2,d3 + + move.w .graycodebits(pc,d6.w),d4 + bmi.s .skipdraw + PUSHM a0/a1 + move.l pd_CurrCubeLinePtr(a6),a0 + adda.w d4,a0 + bsr gou_draw_singledot_line_bq + POPM +.skipdraw + addq.w #2,d6 + bra.s .drawloop +.end + ;clr.l -bql_SIZEOF+bq_Next(a4) + rts + + ; val grayCode3Bits = arrayOf(0, 1, 0, 2, 0, 1, 0, 2) -> 1,0,2,0,1,0 + ; val grayCode3Index = arrayOf(0, 1, 3, 2, 6, 7, 5, 4) + + ; val grayCode4Bits = arrayOf(0, 1, 2, 3, 2, 1, 0, 2, 0, 3, 0, 1, 3, 2, 3, 1) -> 1,2,3,2,1,0 ,2,0,3,0,1,3,2,3 + ; val grayCode4Index = arrayOf(0, 1, 3, 7, 15, 11, 9, 8, 12, 13, 5, 4, 6, 14, 10, 2) + +.graycodebits + dc.w -1,-1,-1,0*(CUBE_BUF_WIDTH/8) + dc.w 1*(CUBE_BUF_WIDTH/8),2*(CUBE_BUF_WIDTH/8),3*(CUBE_BUF_WIDTH/8),2*(CUBE_BUF_WIDTH/8),1*(CUBE_BUF_WIDTH/8),0*(CUBE_BUF_WIDTH/8) + dc.w 2*(CUBE_BUF_WIDTH/8),0*(CUBE_BUF_WIDTH/8),3*(CUBE_BUF_WIDTH/8),0*(CUBE_BUF_WIDTH/8),1*(CUBE_BUF_WIDTH/8),3*(CUBE_BUF_WIDTH/8) + dc.w 2*(CUBE_BUF_WIDTH/8),3*(CUBE_BUF_WIDTH/8) + dc.w -1,-1,-1,-1,-1 + dc.w -1,-1,-1,-1 + dc.w -1,-1,-1,-1,-1 + dc.w -1,-1,-1,-1 + +;---------------------------------------------------------------------------------- +; Draw regular blitter line to blitter queue +; +; in d0.w x0 +; d1.w y0 +; d2.w x1 +; d3.w y1 +; a0 bitplane +; a4 blitterqueue struct + +gou_draw_singledot_line_bq: + cmp.w d1,d3 + bgt.s .downward + bne.s .cont + rts +.cont exg d0,d2 + exg d1,d3 +.downward + move.w d1,d5 + lsl.w #6,d5 ; replaced mulu by shift (CUBE_BUF_WIDTH) + ;mulu d4,d5 + adda.w d5,a0 + + moveq.l #-16,d4 + and.w d0,d4 + lsr.w #3,d4 + add.w d4,a0 + + moveq.l #15,d4 + and.w d0,d4 + ror.w #4,d4 + or.w #BLTCON0F_USEA|BLTCON0F_USEC|BLTCON0F_USED|(BLT_A&BLT_B^BLT_C),d4 + swap d4 + + sub.w d0,d2 + bpl.s .positiveDX + neg.w d2 + addq.w #1,d4 +.positiveDX + sub.w d1,d3 + cmp.w d2,d3 + bls.s .absDyLessThanAbsDx + exg d2,d3 + addq.w #4,d4 +.absDyLessThanAbsDx + move.b .octants(pc,d4.w),d4 + + add.w d3,d3 ; 2 * dy + move.w d3,d5 + sub.w d2,d5 ; 2 * dy - dx + bpl.s .positiveGradient + or.w #BLTCON1F_SIGN,d4 +.positiveGradient + add.w d5,d5 ; 4 * dy - 2 * dx + ;cmp.w #20,d2 + ;sgt bql_LongLine(a4) + add.w d2,d2 ; 2 * dx + add.w d2,d2 ; 4 * dx + add.w d3,d3 ; 4 * dy + + move.w d3,d0 + sub.w d2,d3 ; 4 * (dy - dx) + + addq.w #4,d2 ; extra word height + lsl.w #4,d2 + addq.w #2,d2 ; width == 2 + + move.l d4,bql_BltCon01(a4) + movem.w d0/d3/d5,bql_BltBMod(a4) ; 4 * dy + ;move.w d3,bql_BltAMod(a4) ; 4 * (dy - dx) + ;move.w d5,bql_BltAPtLo(a4) ; 4 * dy - 2 * dx + move.l a0,bql_BltCPt(a4) + move.w d2,bql_BltSize(a4) + move.l a4,a0 + CALLFW AddToBlitterQueue + lea bql_SIZEOF(a4),a4 + rts + +.octants + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUD ; octant 7 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_AUL ; octant 4 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_SUL ; octant 0 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_SUL|BLTCON1F_AUL ; octant 3 + dc.b BLTCON1F_SING|BLTCON1F_LINE|0 ; octant 6 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUL ; octant 5 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_AUL ; octant 1 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUL|BLTCON1F_AUL ; octant 2 + +;-------------------------------------------------------------------- + +gou_bq_InitLineDraw: + PUTMSG 40,<"InitLineDraw"> + moveq.l #-1,d0 + move.w #BLTCON1F_LINE,bltcon1(a5) + move.w #$8000,bltadat(a5) + move.l d0,bltafwm(a5) + move.w d0,bltbdat(a5) + move.w #(CUBE_BUF_WIDTH/8)*CUBE_PLANES,bltcmod(a5) + BLTHOGON + moveq.l #0,d0 + rts + +gou_bq_LineDraw: + PUTMSG 40,<"LineDraw %p">,a0 + move.l (a0)+,bltcon0(a5) + move.l (a0)+,bltcpt(a5) + move.l (a0)+,bltbmod(a5) + move.l (a0)+,bltapt+2(a5) + move.l (a0)+,bltdpt+2(a5) + rts + +gou_bq_FillCube: + PUTMSG 40,<"FillCube"> + moveq.l #-1,d0 + lea bltcon0(a5),a1 + move.l (a0)+,(a1)+ ; bltcon0 + move.l d0,(a1)+ ; bltafwm + move.l (a0)+,bltamod(a5) + addq.l #8,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1) ; bltsize + rts + +gou_bq_Clear: + PUTMSG 40,<"Clear"> + move.l (a0)+,bltcon0(a5) + move.l (a0)+,bltdpt(a5) + move.w (a0)+,bltdmod(a5) + move.w (a0)+,bltcdat(a5) + move.w (a0)+,bltsize(a5) + rts + +gou_bq_InPlaceModify: + PUTMSG 40,<"InPlaceModify"> + BLTHOGON + moveq.l #-1,d0 + lea bltcon0(a5),a1 + move.l (a0)+,(a1)+ ; bltcon0 + move.l d0,(a1)+ ; bltafwm + move.l (a0)+,d0 + addq.l #8,a1 ; skip bltcpt/bltbpt + move.l d0,(a1)+ ; bltapt + move.l d0,(a1)+ ; bltdpt(a5) + move.w (a0)+,d0 + move.w d0,bltamod(a5) + move.w d0,bltdmod(a5) + move.w (a0)+,bltcdat(a5) + move.w (a0)+,(a1) + BLTWAIT + rts + +gou_bq_ADCopy: + PUTMSG 40,<"ADCopy"> + BLTHOGON + lea bltcon0(a5),a1 + move.l (a0)+,(a1)+ ; bltcon0 + move.l (a0)+,(a1)+ ; bltafwm + move.l (a0)+,bltamod(a5) + addq.l #8,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1) ; bltsize + BLTWAIT + rts + + +;-------------------------------------------------------------------- +;-------------------------------------------------------------------- + +SinScale MACRO + muls (a5,\1.w),\2 + add.l \2,\2 + add.l \2,\2 + swap \2 + ENDM + +CosScale MACRO + muls (a0,\1.w),\2 + add.l \2,\2 + add.l \2,\2 + swap \2 + ENDM + +SinScaleK MACRO + move.w (a5,\1.w),\3 + muls \3,\2 + add.l \2,\2 + add.l \2,\2 + swap \2 + ENDM + +CosScaleK MACRO + move.w (a0,\1.w),\3 + muls \3,\2 + add.l \2,\2 + add.l \2,\2 + swap \2 + ENDM + +ScalePrev MACRO + muls \1,\2 + add.l \2,\2 + add.l \2,\2 + swap \2 + ENDM + +gou_rotate_cube: ; a1 = CubeData + DISABLE_INTS + PUSHM a1/a5 + lea cd_CubeNormals+3*3*2(a1),a1 + move.w pd_CubeSize(a6),d7 + + move.l fw_SinTable(a6),a5 + move.l fw_CosTable(a6),a0 ; suppress M68kDeadWrite + movem.w pd_Ax(a6),a2-a4 ;ax,ay,az + + ; --- original formula --- + ; x1 = x0*cos(az) - y0*sin(az) + ; y1 = x0*sin(az) + y0*cos(az) + ; z1 = z1 + + ; x2 = x1 + ; y2 = y1*cos(ax) - z1*sin(ax) + ; z2 = y1*sin(ax) + z1*cos(ax) + + ; x3 = z2*sin(ay) + x2*cos(ay) + ; y3 = y2 + ; z3 = z2*cos(ay) - x2*sin(ay) + ; ---- + + ; x1 = sx*cos(az) - sy*sin(az) + ; y1 = sx*sin(az) + sy*cos(az) + + ; z2 = y1*sin(ax) + sz*cos(ax) + ; y3 = y1*cos(ax) - sz*sin(ax) + + ; x3 = z2*sin(ay) + x1*cos(ay) + ; z3 = z2*cos(ay) - x1*sin(ay) + + ; for z-normal vector (0, 0, 1) + + ; z2 = s*cos(ax) + ; y3 = -s*sin(ax) + + ; x3 = z2*sin(ay) + ; z3 = z2*cos(ay) + + move.w d7,d3 + move.w d7,d2 + SinScale a2,d2 ;d2 = -y = s*sin(ax) + neg.w d2 + + CosScale a2,d3 ;d3 = z2 = s*cos(ax) + move.w d3,d1 + SinScale a3,d1 ;d1 = x = z2*sin(ay) = s*cos(ax) * sin(ay) + CosScale a3,d3 ;d3 = z = z2*cos(ay) = s*cos(ax) * cos(ay) + + movem.w d1-d3,-(a1) ;x/y/z + + ; for y-normal vector (0, 1, 0) + ; x1 = s*sin(az) ; also used in x-normal + ; y1 = s*cos(az) ; also used in x-normal + + ; z2 = y1*sin(ax) + ; y3 = y1*cos(ax) = s*cos(az)*cos(ax) + + ; x3 = z2*sin(ay) - x1*cos(ay) = y1*sin(ax)*sin(ay) - x1*cos(ay) = s*cos(az)*sin(ax)*sin(ay) - s*sin(az)*cos(ay) + ; z3 = z2*cos(ay) + x1*sin(ay) = y1*sin(ax)*cos(ay) + x1*sin(ay) = s*cos(az)*sin(ax)*cos(ay) + s*sin(az)*sin(ay) + + move.w d7,d6 + SinScale a4,d7 ;d7 = x1 = s*sin(az) + CosScale a4,d6 ;d6 = y1 = s*cos(az) + + move.w d6,d3 + move.w d3,d2 + CosScaleK a2,d2,d5 ;d2 = y = y1*cos(ax) = s*cos(az) * cos(ax) + swap d5 ;keep cos(ax) in upper word for later + SinScaleK a2,d3,d0 ;d3 = z2 = y1*sin(ax) = s*cos(az) * sin(ax) + swap d0 ;keep sin(ax) in upper word for later + + move.w d3,d1 + SinScaleK a3,d1,d5 ;d1 = z2*sin(ay) (keep sin(ay) in d5) + move.w d7,d4 + ScalePrev d5,d4 ;d4 = x1*sin(ay) + + CosScaleK a3,d3,d0 ;d3 = z2*cos(ay) (keep cos(ay) in d0) + add.w d4,d3 ;d3 = z = z2*cos(ay) + x1*sin(ay) = s*cos(az)*sin(ax)*cos(ay) + s*sin(az)*sin(ay) + + move.w d7,d4 + ScalePrev d0,d4 ;d4 = x1*cos(ay) + sub.w d4,d1 ;d1 = x = z2*sin(ay) - x1*cos(ay) = s*cos(az)*sin(ax)*sin(ay) - s*sin(az)*cos(ay) + + movem.w d1-d3,-(a1) ;x/y/z + + ; for x-normal vector (1, 0, 0) + ; x1 = s*cos(az) + ; y1 = s*sin(az) + + ; z2 = y1*sin(ax) + ; y3 = y1*cos(ax) = s*sin(az)*cos(ax) + + ; x3 = z2*sin(ay) + x1*cos(ay) = y1*sin(ax)*sin(ay) + x1*cos(ay) = s*sin(az)*sin(ax)*sin(ay) + s*cos(az)*cos(ay) + ; z3 = z2*cos(ay) - x1*sin(ay) = y1*sin(ax)*cos(ay) - x1*sin(ay) = s*sin(az)*sin(ax)*cos(ay) - s*cos(az)*sin(ay) + + swap d5 ; d5 = cos(ax) + move.w d7,d2 + ScalePrev d5,d2 ; d2 = y = s*sin(az) * cos(ax) + + swap d0 ; d0 = sin(ax) + ScalePrev d0,d7 ; d7 = z2 = s*sin(az) * sin(ax) + + swap d5 ; d5 = sin(ay) + move.w d7,d1 + ScalePrev d5,d1 ; d1 = z2*sin(ay) = s*sin(az) * sin(ax) * sin(ay) + + swap d0 ; d0 = cos(ay) + move.w d6,d4 + ScalePrev d0,d4 ; d4 = x1*cos(ay) = s*cos(az)*cos(ay) + add.w d4,d1 ; d1 = x = z2*sin(ay) + x1*cos(ay) = s*sin(az)*sin(ax)*sin(ay) + s*cos(az)*cos(ay) + + ScalePrev d5,d6 ; d6 = x1*sin(ay) = s*cos(az)*sin(ay) + + move.w d7,d3 + ScalePrev d0,d3 ; d3 = z2*cos(ay) = s*sin(az) * sin(ax) * cos(ay) + sub.w d6,d3 ; d3 = z = z2*cos(ay) - x1*sin(ay) = s*sin(az)*sin(ax)*cos(ay) - s*cos(az)*sin(ay) + + movem.w d1-d3,-(a1) ;x/y/z + + move.w d1,d0 + add.w d0,d0 + move.w d2,a2 + add.w d2,a2 + move.w d3,d7 + add.w d7,d7 + + movem.w 3*2(a1),d4-d6 + + add.w d4,d1 + add.w d5,d2 + add.w d6,d3 + + lea 12(a1),a3 + + add.w (a3)+,d1 + add.w (a3)+,d2 + add.w (a3)+,d3 + move.l a1,a3 + POPM + ENABLE_INTS + + movem.w d1-d3,cd_Coords+6*3*2(a1) + + neg.w d1 + neg.w d2 + neg.w d3 + movem.w d1-d3,cd_Coords+0*3*2(a1) ; 0*3*2(a1) + + add.w d0,d1 + add.w a2,d2 + add.w d7,d3 + movem.w d1-d3,cd_Coords+1*3*2(a1) + + neg.w d1 + neg.w d2 + neg.w d3 + movem.w d1-d3,cd_Coords+7*3*2(a1) + + sub.w d4,d1 + sub.w d4,d1 + sub.w d5,d2 + sub.w d5,d2 + sub.w d6,d3 + sub.w d6,d3 + movem.w d1-d3,cd_Coords+3*3*2(a1) + + neg.w d1 + neg.w d2 + neg.w d3 + movem.w d1-d3,cd_Coords+5*3*2(a1) + + sub.w d0,d1 + sub.w a2,d2 + sub.w d7,d3 + movem.w d1-d3,cd_Coords+4*3*2(a1) + + neg.w d1 + neg.w d2 + neg.w d3 + movem.w d1-d3,cd_Coords+2*3*2(a1) + + ; create flipped normals + movem.w (a3)+,d0-d7/a0 + neg.w d0 + neg.w d1 + neg.w d2 + neg.w d3 + neg.w d4 + neg.w d5 + neg.w d6 + neg.w d7 + exg d0,a0 + neg.w d0 + exg d0,a0 + movem.w d0-d7/a0,(a3) + rts + +;-------------------------------------------------------------------- + +gou_cube_advance_scene_standard_movement: + move.w #1023*2,d6 + movem.w pd_Ax(a6),d0-d5 + add.w d3,d0 + add.w d4,d1 + add.w d5,d2 + and.w d6,d0 + and.w d6,d1 + and.w d6,d2 + movem.w d0-d2,pd_Ax(a6) + rts + +;******************************************************************** + +gou_gray_palette: + ds.w 16 + +gou_gray_zebra_palette: + ds.w 16 + +; https://gradient-blaster-grahambates.vercel.app/?points=000@0,379@5,dc6@9,fff@16&steps=256&blendMode=oklab&ditherMode=off&target=amigaOcs +gou_sorted_palette: + dc.w $413,$002,$023,$035,$257,$379,$589,$8a8 + dc.w $bb8,$dc6,$dd7,$ed9,$eea,$eec,$ffd,$fff + +gou_zebra_palette: + dc.w $134,$112,$011,$145,$022,$379,$123,$49a + dc.w $133,$4bb,$244,$6dc,$354,$aed,$455,$dfe + +gou_gray_shuffle: + dc.w 0*2,1*2,3*2,7*2,15*2,11*2,9*2,8*2,12*2,13*2,5*2,4*2,6*2,14*2,10*2,2*2 + +gou_mauve_palette: + REPT 16 + dc.w $413 + ENDR + +gou_black_palette: + ds.w 16 + +PLANELINEMASK MACRO + dc.w ((1<<\1)|(1<<\2)|(1<<\3)|(1<<\4)) + ENDM + +PLANECOORDMASK MACRO + dc.w (1<<\1)|(1<<\2)|(1<<\3)|(1<<\4) + ENDM + +PROJPLANE MACRO + dc.w (\1)*4,(\2)*4,(\3)*4,(\4)*4 + ENDM + +ROTATEDPLANE MACRO + dc.w (\1)*6,(\2)*6,(\3)*6,(\4)*6 + ENDM + +PLANELINES MACRO + dc.w cd_IntCubeLines+(\1)*il_SIZEOF + dc.w cd_IntCubeLines+(\2)*il_SIZEOF + dc.w cd_IntCubeLines+(\3)*il_SIZEOF + dc.w cd_IntCubeLines+(\4)*il_SIZEOF + ENDM + +gou_cube_plane_coords: + PLANELINEMASK 5,10,1,9 + PLANECOORDMASK 5,6,2,1 + + PLANELINEMASK 4,5,6,7 + PLANECOORDMASK 4,5,6,7 + + PLANELINEMASK 6,11,2,10 + PLANECOORDMASK 6,7,3,2 + + PLANELINEMASK 7,8,3,11 + PLANECOORDMASK 7,4,0,3 + + PLANELINEMASK 0,1,2,3 + PLANECOORDMASK 0,1,2,3 + + PLANELINEMASK 4,9,0,8 + PLANECOORDMASK 4,5,1,0 + +; +; 0_____________1 +; /| /| +; /_|__________/ | +; |3 | |2 | +; | | | | +; | | | | +; | 4|_________|__|5 +; | / | / +;7|/___________|/6 +; +; lines: +; 0: 0 <-> 1 +; 1: 1 <-> 2 +; 2: 2 <-> 3 +; 3: 3 <-> 0 +; 4: 4 <-> 5 +; 5: 5 <-> 6 +; 6: 6 <-> 7 +; 7: 7 <-> 4 +; 8: 0 <-> 4 +; 9: 1 <-> 5 +; 10: 2 <-> 6 +; 11: 3 <-> 7 +gou_proj_cube_planes: + ; attention, inverse order as plane number is counted backwards + PROJPLANE 4,5,1,0 + PROJPLANE 0,1,2,3 + PROJPLANE 7,4,0,3 + PROJPLANE 6,7,3,2 + PROJPLANE 4,5,6,7 + PROJPLANE 5,6,2,1 + +gou_rotated_cube_planes: + ; attention, inverse order as plane number is counted backwards + ROTATEDPLANE 4,5,1,0 + ROTATEDPLANE 0,1,2,3 + ROTATEDPLANE 7,4,0,3 + ROTATEDPLANE 6,7,3,2 + ROTATEDPLANE 4,5,6,7 + ROTATEDPLANE 5,6,2,1 + +gou_cube_planes_to_lines: + ; attention, inverse order as plane number is counted backwards + PLANELINES 4,9,0,8 + PLANELINES 0,1,2,3 + PLANELINES 7,8,3,11 + PLANELINES 6,11,2,10 + PLANELINES 4,5,6,7 + PLANELINES 5,10,1,9 + +gou_cube_lines: + dc.w 0*4,1*4 ; 0 -> 01 + dc.w 1*4,2*4 ; 1 -> 12 + dc.w 2*4,3*4 ; 2 -> 23 + dc.w 0*4,3*4 ; 3 -> 30 + + dc.w 4*4,5*4 ; 4 -> 45 + dc.w 5*4,6*4 ; 5 -> 56 + dc.w 6*4,7*4 ; 6 -> 67 + dc.w 4*4,7*4 ; 7 -> 74 + + dc.w 0*4,4*4 ; 4 -> 04 + dc.w 1*4,5*4 ; 5 -> 15 + dc.w 2*4,6*4 ; 6 -> 26 + dc.w 3*4,7*4 ; 7 -> 37 + +;-------------------------------------------------------------------- + + section "gou_copper",data,chip + +gou_copperlist: + COP_MOVE dmacon,DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + + COP_MOVE bplcon3,$0c00 + + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + COP_MOVE bplcon0,$0200 + COP_MOVE bplcon2,$0024 + COP_MOVE bpl1mod,(CUBE_WIDTH/8)*(CUBE_PLANES-1) + COP_MOVE bpl2mod,(CUBE_WIDTH/8)*(CUBE_PLANES-1) + +gou_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +gou_bendit_sprite: + incbin "../data/gouraud/bendit128x128x4.SPR" + +blitter_temp_output_word: + dc.w 0 + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + section "part_music_samples",data,chip ; section for music playback +part_music_smp: + incbin "../data/music/dsr_68k_tune_2_v11.lsbank" + + section "part_music_data",data ; section for music playback +part_music_data: + incbin "../data/music/dsr_68k_tune_2_v11.lsmusic" + ENDC + ENDC + END \ No newline at end of file diff --git a/source/gouraud/record.bat b/source/gouraud/record.bat new file mode 100644 index 0000000..c648d75 --- /dev/null +++ b/source/gouraud/record.bat @@ -0,0 +1,30 @@ +del gouraud.exe +del "..\winuae\hd0\gouraud.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "gouraud.exe" "gouraud.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy gouraud.exe "..\winuae\hd0" +copy gouraud.exe "..\winuae\hd0\a.exe" + +@echo /|set /p =gouraud.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_rec.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/hamazing/build.bat b/source/hamazing/build.bat new file mode 100644 index 0000000..e601cb4 --- /dev/null +++ b/source/hamazing/build.bat @@ -0,0 +1,118 @@ +rem ############ PREPARE BUILD ############ +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +pushd .. + +tools\KingCon.exe @data/blend/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\juggler data/blend/juggle.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\KingCon.exe @data/bulb/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\ZCP data/bulb/lamp_48x32x16.BPL data/bulb/lamp_48x32x16.zcp 48 32 -c data/bulb/lamp_48x32x16.chk +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\KingCon.exe @data/endpart/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\KingCon.exe @data/gotham/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\KingCon.exe @data/gouraud/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\KingCon.exe @data/hexagon/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\KingCon.exe @data/kaleidoscope/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\KingCon.exe @data/stham/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\KingCon.exe @data/virgillbars/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\LSPConvert.exe data\music\desire_demo_68k_v6.mod -v +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\LSPConvert.exe data\music\dsr_68k_tune_2_v11.mod -nosampleoptim -v +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\LSPConvert.exe data\music\desire_68k_tune3_v2.mod -nosampleoptim -v +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +rem copy demo config for vasm +copy "..\tools\demo.cfg" vc.cfg + +mkdir build + +rem ############ ASSEMBLE PARTS ############ +..\tools\vc -O2 -notmpfile -nostdlib -o "build\bulb.exe" "..\bulb\bulb.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\hexagon.exe" "..\hexagon\hexagon.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\kaleidoscope.exe" "..\kaleidoscope\kaleidoscope.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\virgillbars.exe" "..\virgillbars\virgillbars.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\blend.exe" "..\blend\blend.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\stham.exe" "..\stham\stham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\gotham.exe" "..\gotham\gotham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\endpart.exe" "..\endpart\endpart.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\gouraud.exe" "..\gouraud\gouraud.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy "..\data\music\desire_demo_68k_v6.lsbank" build +copy "..\data\music\desire_demo_68k_v6.lsmusic" build +copy "..\data\music\dsr_68k_tune_2_v11.lsbank" build +copy "..\data\music\dsr_68k_tune_2_v11.lsmusic" build +copy "..\data\music\desire_68k_tune3_v2.lsbank" build +copy "..\data\music\desire_68k_tune3_v2.lsmusic" build +copy "..\data\gotham\hamtechnology.raw" build +copy "..\data\stham\PLT_HAMph_path_2_test08b_ham.raw" build +copy "..\data\blend\fiveimg2_ham.raw" build +copy "..\data\blend\fiveimg3_ham.raw" build +copy "..\data\blend\fiveimg4_ham.raw" build +copy "..\data\blend\fiveimg5_ham.raw" build +copy "..\data\blend\PLT_DSRLogo01c_ham.raw" build +copy "..\data\endpart\screenshots_320x1620.BPL" build + +rem ############ ASSEMBLE FRAMEWORK AND BOOTBLOCK ############ +copy "..\tools\vc.cfg" %~dp0 + +..\tools\vasmm68k_mot -m68010 -Fbin -phxass -o "build\trackmo_launcher" -I"%~dp0\..\includes" "trackmo_launcher.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vasmm68k_mot -m68000 -Fbin -phxass -o "build\bootblock" -I"%~dp0\..\includes" "..\framework\bootblock.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +rem ############ BUILD DISK ############ +..\tools\platosadf -ndb 3 -f build/demo.adf build/bootblock layout.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +rem ############ START DEMO ############ +"..\winuae\winuae" -config="configs\a500_slow.uae" -log -s use_gui=no -s floppy0=%~dp0\build\demo.adf + +rem ############ CLEANUP BUILD ############ +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/hamazing/global_bonus.i b/source/hamazing/global_bonus.i new file mode 100644 index 0000000..507d6d7 --- /dev/null +++ b/source/hamazing/global_bonus.i @@ -0,0 +1,8 @@ + + include "exec/types.i" + + STRUCTURE GlobalBonusData,0 + APTR gbd_PsPackedBuffer + APTR gbd_SamplePackedBuffer + APTR gbd_LSPPackedBuffer + LABEL gbd_SIZEOF diff --git a/source/hamazing/hd_launcher.asm b/source/hamazing/hd_launcher.asm new file mode 100644 index 0000000..793e4a6 --- /dev/null +++ b/source/hamazing/hd_launcher.asm @@ -0,0 +1,18 @@ + opt p+,o+ + include "hdtrackmo_settings.i" + +NEWAGE_DEBUG = 1 ; enable for UAE warp exit on start with debug detail enabled + +CHIPMEM_SIZE = 469*1024 ; maximum chip memory use for whole demo +FASTMEM_SIZE = 458*1024 ; maximum fast memory use for whole demo + + include "../framework/framework.i" + include "../framework/framework.asm" + +entrypoint: + include "trackmo_script.asm" + + section "diskimage",data + +diskimage: + incbin "build/hddemo.adf" \ No newline at end of file diff --git a/source/hamazing/hdbuild.bat b/source/hamazing/hdbuild.bat new file mode 100644 index 0000000..074996f --- /dev/null +++ b/source/hamazing/hdbuild.bat @@ -0,0 +1,79 @@ +rem ############ PREPARE BUILD ############ +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +rem copy demo config for vasm +copy "..\tools\hddemo.cfg" vc.cfg + +mkdir build + +rem ############ ASSEMBLE PARTS ############ +..\tools\vc -O2 -notmpfile -nostdlib -o "build\bulb.exe" "..\bulb\bulb.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\hexagon.exe" "..\hexagon\hexagon.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\kaleidoscope.exe" "..\kaleidoscope\kaleidoscope.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\virgillbars.exe" "..\virgillbars\virgillbars.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\blend.exe" "..\blend\blend.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\stham.exe" "..\stham\stham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\gotham.exe" "..\gotham\gotham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\endpart.exe" "..\endpart\endpart.asm" +@if %ERRORLEVEL% NEQ 0 goto failed +..\tools\vc -O2 -notmpfile -nostdlib -o "build\gouraud.exe" "..\gouraud\gouraud.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy "..\data\music\desire_demo_68k_v6.lsbank" build +copy "..\data\music\desire_demo_68k_v6.lsmusic" build +copy "..\data\music\dsr_68k_tune_2_v11.lsbank" build +copy "..\data\music\dsr_68k_tune_2_v11.lsmusic" build +copy "..\data\music\desire_68k_tune3_v2.lsbank" build +copy "..\data\music\desire_68k_tune3_v2.lsmusic" build +copy "..\data\gotham\hamtechnology.raw" build +copy "..\data\stham\PLT_HAMph_path_2_test08b_ham.raw" build +copy "..\data\blend\fiveimg2_ham.raw" build +copy "..\data\blend\fiveimg3_ham.raw" build +copy "..\data\blend\fiveimg4_ham.raw" build +copy "..\data\blend\fiveimg5_ham.raw" build +copy "..\data\blend\PLT_DSRLogo01c_ham.raw" build +copy "..\data\endpart\screenshots_320x1620.BPL" build + +rem ############ ASSEMBLE BOOTBLOCK ############ +copy "..\tools\vc.cfg" %~dp0 + +..\tools\vasmm68k_mot -m68000 -Fbin -phxass -o "build\bootblock" -I"%~dp0\..\includes" "..\framework\bootblock.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +rem ############ BUILD TRUNCATED DISK ############ +..\tools\platosadf -ndb 3 -f -t build/hddemo.adf build/bootblock hdlayout.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +rem ############ ASSEMBLE HD LAUNCHER ############ + +..\tools\vc -O2 -notmpfile -nostdlib -o "build\hd_launcher.exe" "hd_launcher.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy build\hd_launcher.exe "..\winuae\hd0" + +@echo /|set /p =hd_launcher.exe>"..\winuae\hd0\s\startup-sequence" + +rem ############ START DEMO ############ +"..\winuae\winuae64" -config="configs\a500_hd.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +rem ############ CLEANUP BUILD ############ +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/hamazing/hdlayout.txt b/source/hamazing/hdlayout.txt new file mode 100644 index 0000000..e8a2722 --- /dev/null +++ b/source/hamazing/hdlayout.txt @@ -0,0 +1,23 @@ +build/gotham.exe -n Gotham -dos -zx0 +build/hamtechnology.raw -n HamTech.smp -zx0 -d8 +build/desire_demo_68k_v6.lsmusic -n 1st.lsmus -zx0 +build/desire_demo_68k_v6.lsbank -n 1st.lsbnk -cm -zx0 -d8 +build/bulb.exe -n Bulb -dos -zx0 +build/stham.exe -n STHam -dos -zx0 +build/PLT_HAMph_path_2_test08b_ham.raw -n HAMphrey.raw -zx0 +build/kaleidoscope.exe -n Kaleidoscope -dos -zx0 +build/hexagon.exe -n Hexagon -dos -zx0 +build/dsr_68k_tune_2_v11.lsmusic -n 2nd.lsmus -zx0 +build/dsr_68k_tune_2_v11.lsbank -n 2nd.lsbnk -cm -zx0 -d8 +build/gouraud.exe -n Rubbercube -dos -zx0 +build/virgillbars.exe -n VirgillBars -dos -zx0 +build/blend.exe -n Blend -dos -zx0 +build/fiveimg2_ham.raw -n cHAMeleon.raw -zx0 +build/fiveimg3_ham.raw -n Sunset.raw -zx0 +build/fiveimg4_ham.raw -n Greets1.raw -zx0 +build/fiveimg5_ham.raw -n Greets2.raw -zx0 +build/PLT_DSRLogo01c_ham.raw -n Endlogo.raw -zx0 +build/desire_68k_tune3_v2.lsmusic -n End.lsmus -zx0 +build/desire_68k_tune3_v2.lsbank -n End.lsbnk -cm -zx0 -d8 +build/endpart.exe -n Endpart -dos -zx0 +build/screenshots_320x1620.BPL -n Screenshots.raw -cm -zx0 \ No newline at end of file diff --git a/source/hamazing/hdtrackmo_settings.i b/source/hamazing/hdtrackmo_settings.i new file mode 100644 index 0000000..5637902 --- /dev/null +++ b/source/hamazing/hdtrackmo_settings.i @@ -0,0 +1,44 @@ +; Framework settings + +DEBUG_DETAIL SET 0 + +FW_STANDALONE_FILE_MODE = 1 ; DO NOT CHANGE (required for hdtrackmo mode) +FW_HD_TRACKMO_MODE = 1 ; DO NOT CHANGE (required for hdtrackmo mode) + +FW_MUSIC_SUPPORT = 1 +FW_MUSIC_PLAYER_CHOICE = 2 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of demo with LMB +FW_MULTIPART_SUPPORT = 1 ; DO NOT CHANGE (required for hdtrackmo mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 5 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 1 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 1 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 300 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; +FW_VBL_IRQ_SUPPORT = 1 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 0 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 1 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +; hdtrackmo options +FW_TRACKMO_LZ4_SUPPORT = 0 ; enable decrunching while loading for LZ4 +FW_TRACKMO_LZ4_DLT8_SUPPORT = 0 ; enable decrunching while loading for LZ4 with delta +FW_NUM_DIRECTORY_BLOCKS = 3 ; number of directory blocks used for this trackmo +FW_MAX_DOS_HUNKS = 8 ; maximum amount of hunks (increase this when a part produces the ERROR_TOOMANYHUNKS) +FW_IN_PLACE_DECR_SAFE_DIST = 128 ; number of extra bytes to allocate for in-place decompression + + include "global_bonus.i" \ No newline at end of file diff --git a/source/hamazing/layout.txt b/source/hamazing/layout.txt new file mode 100644 index 0000000..48b388d --- /dev/null +++ b/source/hamazing/layout.txt @@ -0,0 +1,24 @@ +build/trackmo_launcher -n PlatOS -zx0 +build/gotham.exe -n Gotham -dos -zx0 +build/hamtechnology.raw -n HamTech.smp -cm -zx0 -d8 +build/desire_demo_68k_v6.lsmusic -n 1st.lsmus -zx0 +build/desire_demo_68k_v6.lsbank -n 1st.lsbnk -cm -zx0 -d8 +build/bulb.exe -n Bulb -dos -zx0 +build/stham.exe -n STHam -dos -zx0 +build/PLT_HAMph_path_2_test08b_ham.raw -n HAMphrey.raw -cm -zx0 +build/kaleidoscope.exe -n Kaleidoscope -dos -zx0 +build/hexagon.exe -n Hexagon -dos -zx0 +build/dsr_68k_tune_2_v11.lsmusic -n 2nd.lsmus -zx0 +build/dsr_68k_tune_2_v11.lsbank -n 2nd.lsbnk -cm -zx0 -d8 +build/gouraud.exe -n Rubbercube -dos -zx0 +build/virgillbars.exe -n VirgillBars -dos -zx0 +build/blend.exe -n Blend -dos -zx0 +build/fiveimg2_ham.raw -n cHAMeleon.raw -cm -zx0 +build/fiveimg3_ham.raw -n Sunset.raw -cm -zx0 +build/fiveimg4_ham.raw -n Greets1.raw -cm -zx0 +build/fiveimg5_ham.raw -n Greets2.raw -cm -zx0 +build/PLT_DSRLogo01c_ham.raw -n Endlogo.raw -cm -zx0 +build/desire_68k_tune3_v2.lsmusic -n End.lsmus -zx0 +build/desire_68k_tune3_v2.lsbank -n End.lsbnk -cm -zx0 -d8 +build/endpart.exe -n Endpart -dos -zx0 +build/screenshots_320x1620.BPL -n Screenshots.raw -cm -zx0 \ No newline at end of file diff --git a/source/hamazing/release.bat b/source/hamazing/release.bat new file mode 100644 index 0000000..ce0e612 --- /dev/null +++ b/source/hamazing/release.bat @@ -0,0 +1,26 @@ +rem ############ PREPARE BUILD ############ +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +mkdir build + +rem ############ BUILD DISK ############ +..\tools\platosadf -ndb 2 build/demo.adf build/bootblock ../hamazing/layout.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +rem ############ START DEMO ############ +"..\winuae\winuae64" -config="configs\a500_slow.uae" -log -s use_gui=no -s floppy0=%~dp0\build\demo.adf + +rem ############ CLEANUP BUILD ############ +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/hamazing/start.bat b/source/hamazing/start.bat new file mode 100644 index 0000000..08d87be --- /dev/null +++ b/source/hamazing/start.bat @@ -0,0 +1,2 @@ +REM start the last build trackmo in winuae +"..\winuae\winuae" -config="configs\a500_slow.uae" -log -s use_gui=no -s floppy0=%~dp0\build\demo.adf diff --git a/source/hamazing/start_aga.bat b/source/hamazing/start_aga.bat new file mode 100644 index 0000000..8ec2760 --- /dev/null +++ b/source/hamazing/start_aga.bat @@ -0,0 +1,2 @@ +REM start the last build trackmo in winuae +"..\winuae\winuae" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s floppy0=%~dp0\build\demo.adf diff --git a/source/hamazing/trackmo_launcher.asm b/source/hamazing/trackmo_launcher.asm new file mode 100644 index 0000000..a0b4c93 --- /dev/null +++ b/source/hamazing/trackmo_launcher.asm @@ -0,0 +1,14 @@ + opt p+,o+ + include "trackmo_settings.i" + + include "../framework/framework.i" + + bsr trackmo_AppInit + + include "trackmo_script.asm" + + bsr trackmo_AppShutdown + +.loop bra.s .loop + + include "../framework/framework.asm" diff --git a/source/hamazing/trackmo_script.asm b/source/hamazing/trackmo_script.asm new file mode 100644 index 0000000..c24383a --- /dev/null +++ b/source/hamazing/trackmo_script.asm @@ -0,0 +1,439 @@ +; Storyboard: +; Partname | Runtime | Pt | Chip Hunk + Dynamic = Total | Fast Hunk + Dynamic = Total | Disk Space | LOC +; Gotham | 0:13.5 | -- | 9 KB 28 KB 37 KB | 3 KB 16 KB 19 KB | 4+17 KB | 1200 +; ----------------------------------------------------------------------------------------------------------- +; Music | 2:35 | 19 | 156 KB | 15 KB | 91 KB | +; Bulb | 0:59 | 0 | 54 KB 177 KB 231 KB | 58 KB 194 KB 252 KB | 59 KB | 3700 +; STHam | 0:28 | 7 | 87 KB 93 KB 180 KB | 9 KB 0 KB 9 KB | 70 KB | 1800 +; Kaleidoscope | 0:54 |10.5| 148 KB 143 KB 291 KB | 19 KB 394 KB 413 KB | 150 KB | 6400 +; Hexagon | 0:13 |17.5| 4 KB <64 KB <68 KB | 5 KB 18 KB 23 KB | 4 KB | 900 +; ----------------------------------------------------------------------------------------------------------- +; Music 2 | 2:35 | 21 | 172 KB | 22 KB | 123 KB | +; Rubbercube | 0:24 | 0 | 0 KB 291 KB 291 KB | 11 KB 44 KB 55 KB | 5 KB | 3000 +; Virgillbars | 0:52 | 4 | 15 KB 204 KB 208 KB | 11 KB 244 KB 255 KB | 14 KB | 3300 +; Blend | 1:15 | 11 | 43 KB 192 KB 234 KB | 25 KB 401 KB 426 KB | 50+xx KB | 5800 +; ----------------------------------------------------------------------------------------------------------- +; Music 3 | 1:45 | 14 | 45 KB | 12 KB | 24 KB | +; Endpart | | 0 | 5 KB 159 KB 164 KB | 2 KB 2 KB 4 KB | 3 KB | 900 +; + +trackmo: + PUTMSG 10,<"%d: Trackmo start!">,fw_FrameCounterLong(a6) +.restart + btst #6,$bfe001 + bne.s .part1 + lea .secondmusicandgouraudloadinghook(pc),a0 + move.l a0,fw_PrePartLaunchHook(a6) + + lea .gotham(pc),a0 + CALLFW ExecuteNextPart + + bra .part2 + +.part1 + lea .gotham(pc),a0 + lea .musicandbulbloadinghook(pc),a1 + bsr .executenextwithhook + + lea .bulb(pc),a0 + lea .sthamloadinghook(pc),a1 + bsr .executenextwithhook + + lea .stham(pc),a0 + lea .kaleidoscopeloadinghook(pc),a1 + bsr .executenextwithhook + + move.l #256*256*2,d0 + CALLFW AllocFast + move.l a0,fw_GlobalUserData(a6) + PUTMSG 10,<"Kaleidoscope pattern %p">,a0 + + ; this memory should not go away! + CALLFW PushMemoryState + + lea .kaleidoscope(pc),a0 + lea .hexagonpreploadinghook(pc),a1 + bsr .executenextwithhook + + lea .hexagon(pc),a0 + lea .secondmusicloadinghook(pc),a1 + bsr .executenextwithhook + + CALLFW StopMusic + + ; High/Top memory + CALLFW FlipAllocationDirection + CALLFW PopMemoryState + CALLFW DropCurrentMemoryAllocations + + lea .second_music_data(pc),a0 + CALLFW FindFile + move.l de_MemorySize(a1),d0 + ; allocate LSP space + CALLFW AllocFast + move.l a0,fw_MusicData(a6) + + ; check how much ram we need for samples + lea .second_music_samples(pc),a0 + CALLFW FindFile + move.l de_MemorySize(a1),d0 + + ; allocate sample space + CALLFW AllocChip + move.l a0,fw_MusicSamples(a6) + + ; this memory should not go away! + CALLFW PushMemoryState + + lea .decrunch2ndmusic(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + + lea .gouraud(pc),a0 + CALLFW PreloadPart + + ; Bottom/Low memory again + CALLFW FlipAllocationDirection + + move.l fw_TrackloaderTask(a6),a1 + CALLFW WaitUntilTaskFinished + + ; Free music packed + CALLFW PopMemoryState + ; Free kaleidoscope memory + CALLFW PopMemoryState + CALLFW DropCurrentMemoryAllocations + +.part2 + lea .gouraud(pc),a0 + lea .virgillbarsloadinghook(pc),a1 + bsr .executenextwithhook + + lea .virgillbars(pc),a0 + lea .blendloadinghook(pc),a1 + bsr .executenextwithhook + + lea .blend(pc),a0 + lea .unloadpreloaded(pc),a1 + bsr .executenextwithhook + + CALLFW FlipAllocationDirection + CALLFW PopMemoryState + CALLFW DropCurrentMemoryAllocations + CALLFW FlipAllocationDirection + CALLFW DropCurrentMemoryAllocations + +.endpartpart + lea .end_music_data(pc),a0 + CALLFW LoadAndDecrunchFile + move.l a0,fw_MusicData(a6) + + lea .end_music_samples(pc),a0 + CALLFW LoadAndDecrunchFile + move.l a0,fw_MusicSamples(a6) + + CALLFW PushMemoryState + + lea .endpart(pc),a0 + CALLFW ExecuteNextPart + + CALLFW StopMusic + + CALLFW PopMemoryState + CALLFW DropCurrentMemoryAllocations + + clr.w fw_FrameCounter(a6) + bra .restart + +.executenextwithhook + move.l a1,fw_PrePartLaunchHook(a6) + CALLFW ExecuteNextPart + rts + +;-------------------------------------------------------------------- + +.musicandbulbloadinghook + lea .psenough(pc),a0 + CALLFW FindFile + move.l de_DiskLength(a1),d0 + PUSHM a1 + CALLFW AllocFast + POPM + move.l a0,fw_GlobalBonusData+gbd_PsPackedBuffer(a6) + move.l de_MemorySize(a1),d0 + CALLFW AllocChip + move.l a0,fw_GlobalUserData(a6) + + lea .loadmusicandbulb(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +.sthamloadinghook + bsr.s .unloadpreloaded + + lea .loadstham(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +.kaleidoscopeloadinghook + lea .loadkaleidoscope(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +.hexagonpreploadinghook + bsr.s .unloadpreloaded + + lea .loadhexagon(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +.secondmusicloadinghook + bsr.s .unloadpreloaded + + lea .loadsecondmusic(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +.unloadpreloaded + CALLFW FlipAllocationDirection + CALLFW DropCurrentMemoryAllocations + CALLFW FlipAllocationDirection + rts + +.virgillbarsloadinghook + bsr.s .unloadpreloaded + + lea .loadvirgillbars(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +.blendloadinghook + bsr.s .unloadpreloaded + + lea .loadblend(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +.endpartloadinghook + bsr.s .unloadpreloaded + + lea .loadendpart(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +.secondmusicandgouraudloadinghook + lea .psenough(pc),a0 + CALLFW FindFile + move.l de_DiskLength(a1),d0 + PUSHM a1 + CALLFW AllocFast + POPM + move.l a0,fw_GlobalBonusData+gbd_PsPackedBuffer(a6) + move.l de_MemorySize(a1),d0 + CALLFW AllocChip + move.l a0,fw_GlobalUserData(a6) + + lea .loadmusicandgouraud(pc),a0 + move.l fw_TrackloaderTask(a6),a1 + CALLFW AddTask + rts + +;-------------------------------------------------------------------- + +.loadmusicandbulb + lea .psenough(pc),a0 + CALLFW FindFile + PUSHM a1 + move.l fw_GlobalBonusData+gbd_PsPackedBuffer(a6),a0 + CALLFW LoadFileToBuffer + POPM + move.l fw_GlobalBonusData+gbd_PsPackedBuffer(a6),a0 + move.l fw_GlobalUserData(a6),a2 + CALLFW DecrunchToBuffer + + CALLFW FlipAllocationDirection + + lea .first_music_data(pc),a0 + CALLFW LoadAndDecrunchFile + move.l a0,fw_MusicData(a6) + + lea .first_music_samples(pc),a0 + CALLFW LoadAndDecrunchFile + move.l a0,fw_MusicSamples(a6) + + ; this memory should not go away! + CALLFW PushMemoryState + + lea .bulb(pc),a0 + CALLFW PreloadPart + + CALLFW TrackloaderDiskMotorOff + rts + +.loadstham + CALLFW FlipAllocationDirection + + lea .stham(pc),a0 + CALLFW PreloadPart + + lea .hamphrey(pc),a0 + CALLFW LoadFile + move.l a0,fw_GlobalUserData(a6) + + CALLFW TrackloaderDiskMotorOff + rts + +.loadkaleidoscope + CALLFW Yield + tst.l fw_GlobalUserData(a6) + bne.s .loadkaleidoscope + + CALLFW FlipAllocationDirection + CALLFW DropCurrentMemoryAllocations + + lea .kaleidoscope(pc),a0 + CALLFW PreloadPart + + CALLFW TrackloaderDiskMotorOff + rts + +.loadhexagon + CALLFW FlipAllocationDirection + + lea .hexagon(pc),a0 + CALLFW PreloadPart + + CALLFW TrackloaderDiskMotorOff + rts + +.loadsecondmusic + lea .second_music_data(pc),a0 + CALLFW LoadFile + move.l a0,fw_GlobalBonusData+gbd_LSPPackedBuffer(a6) + + lea .second_music_samples(pc),a0 + CALLFW LoadFile + move.l a0,fw_GlobalBonusData+gbd_SamplePackedBuffer(a6) + + CALLFW PushMemoryState + + CALLFW TrackloaderDiskMotorOff + rts + +.decrunch2ndmusic + lea .second_music_data(pc),a0 + CALLFW FindFile + move.l fw_GlobalBonusData+gbd_LSPPackedBuffer(a6),a0 + move.l fw_MusicData(a6),a2 + CALLFW DecrunchToBuffer + + lea .second_music_samples(pc),a0 + CALLFW FindFile + move.l fw_GlobalBonusData+gbd_SamplePackedBuffer(a6),a0 + move.l fw_MusicSamples(a6),a2 + CALLFW DecrunchToBuffer + rts + +.loadvirgillbars + CALLFW FlipAllocationDirection + + lea .virgillbars(pc),a0 + CALLFW PreloadPart + + CALLFW TrackloaderDiskMotorOff + rts + +.loadendpart + CALLFW Yield + tst.l fw_GlobalUserData(a6) + beq.s .loadendpart + + CALLFW FlipAllocationDirection + + lea .endpart(pc),a0 + CALLFW PreloadPart + + CALLFW TrackloaderDiskMotorOff + rts + +.loadmusicandgouraud + lea .psenough(pc),a0 + CALLFW FindFile + PUSHM a1 + move.l fw_GlobalBonusData+gbd_PsPackedBuffer(a6),a0 + CALLFW LoadFileToBuffer + POPM + move.l fw_GlobalBonusData+gbd_PsPackedBuffer(a6),a0 + move.l fw_GlobalUserData(a6),a2 + CALLFW DecrunchToBuffer + + CALLFW FlipAllocationDirection + + lea .second_music_data(pc),a0 + CALLFW LoadAndDecrunchFile + move.l a0,fw_MusicData(a6) + + lea .second_music_samples(pc),a0 + CALLFW LoadAndDecrunchFile + move.l a0,fw_MusicSamples(a6) + + ; this memory should not go away! + CALLFW PushMemoryState + + lea .gouraud(pc),a0 + CALLFW PreloadPart + + CALLFW TrackloaderDiskMotorOff + rts + +.loadblend + CALLFW FlipAllocationDirection + + lea .blend(pc),a0 + CALLFW PreloadPart + + CALLFW TrackloaderDiskMotorOff + rts + +.gotham dc.b "Gotham",0 +.bulb dc.b "Bulb",0 +.kaleidoscope + dc.b "Kaleidoscope",0 +.hexagon + dc.b "Hexagon",0 +.gouraud + dc.b "Rubbercube",0 +.virgillbars + dc.b "VirgillBars",0 +.blend + dc.b "Blend",0 +.stham + dc.b "STHam",0 +.endpart + dc.b "Endpart",0 +.psenough + dc.b "HamTech.smp",0 +.hamphrey + dc.b "HAMphrey.raw",0 +.first_music_data + dc.b "1st.lsmus",0 +.first_music_samples + dc.b "1st.lsbnk",0 +.second_music_data + dc.b "2nd.lsmus",0 +.second_music_samples + dc.b "2nd.lsbnk",0 +.end_music_data + dc.b "End.lsmus",0 +.end_music_samples + dc.b "End.lsbnk",0 + even +.end \ No newline at end of file diff --git a/source/hamazing/trackmo_settings.i b/source/hamazing/trackmo_settings.i new file mode 100644 index 0000000..24a2de8 --- /dev/null +++ b/source/hamazing/trackmo_settings.i @@ -0,0 +1,43 @@ +; Framework settings + +DEBUG_DETAIL SET 0 + +FW_STANDALONE_FILE_MODE = 0 ; DO NOT CHANGE (required for trackmo mode) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (required for trackmo mode) + +FW_MUSIC_SUPPORT = 1 +FW_MUSIC_PLAYER_CHOICE = 2 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker +FW_LMB_EXIT_SUPPORT = 0 ; DO NOT CHANGE, allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 1 ; DO NOT CHANGE (required for trackmo mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; DO NOT CHANGE (required for trackmo mode) +FW_MAX_MEMORY_STATES = 5 ; the amount of memory states (at least 2) +FW_TOP_BOTTOM_MEM_SECTIONS = 1 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 1 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 300 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 1 ; DO NOT CHANGE (required for background loading) +FW_VBL_IRQ_SUPPORT = 1 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 0 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 1 ; compile in ZX0 decruncher + +; trackmo options +FW_TD_FREE_MEM_HACK = 1 ; attempt to free the trackdisk buffers +FW_TRACKMO_LZ4_SUPPORT = 0 ; enable decrunching while loading for LZ4 +FW_TRACKMO_LZ4_DLT8_SUPPORT = 0 ; enable decrunching while loading for LZ4 with delta +FW_NUM_DIRECTORY_BLOCKS = 3 ; number of directory blocks used for this trackmo +FW_MAX_DOS_HUNKS = 4 ; maximum amount of hunks (increase this when a part produces the ERROR_TOOMANYHUNKS) +FW_IN_PLACE_DECR_SAFE_DIST = 128 ; number of extra bytes to allocate for in-place decompression + + include "global_bonus.i" \ No newline at end of file diff --git a/source/hexagon/aga.bat b/source/hexagon/aga.bat new file mode 100644 index 0000000..637939d --- /dev/null +++ b/source/hexagon/aga.bat @@ -0,0 +1,30 @@ +del hexagon.exe +del "..\winuae\hd0\hexagon.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "hexagon.exe" "hexagon.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy hexagon.exe "..\winuae\hd0" +copy hexagon.exe "..\winuae\hd0\a" + +@echo /|set /p =hexagon.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/hexagon/assemble.bat b/source/hexagon/assemble.bat new file mode 100644 index 0000000..010cb53 --- /dev/null +++ b/source/hexagon/assemble.bat @@ -0,0 +1,40 @@ +del hexagon.exe +del "..\winuae\hd0\hexagon.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +pushd .. + +tools\KingCon.exe @data/hexagon/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\LSPConvert.exe data\music\desire_demo_68k_v6.mod -setpos -v +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "hexagon.exe" "hexagon.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy hexagon.exe "..\winuae\hd0" +copy hexagon.exe "..\winuae\hd0\a" + +@echo /|set /p =hexagon.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/hexagon/compile.bat b/source/hexagon/compile.bat new file mode 100644 index 0000000..88591c6 --- /dev/null +++ b/source/hexagon/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "hexagon.exe" "hexagon.asm" diff --git a/source/hexagon/debug.bat b/source/hexagon/debug.bat new file mode 100644 index 0000000..933fd76 --- /dev/null +++ b/source/hexagon/debug.bat @@ -0,0 +1,21 @@ +del hexagon.exe +del "..\winuae\hd0\hexagon.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "hexagon.exe" "hexagon.asm" + +copy hexagon.exe "..\winuae\hd0" +copy hexagon.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =hexagon.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/hexagon/hexagon.asm b/source/hexagon/hexagon.asm new file mode 100644 index 0000000..a771df2 --- /dev/null +++ b/source/hexagon/hexagon.asm @@ -0,0 +1,908 @@ +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 1 +FW_MUSIC_PLAYER_CHOICE = 2 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker (CPU DMA wait), 5 = Pretracker Turbo (Copper wait) +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 1 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 308 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 0 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 0 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 1 +PART_MUSIC_START_POS = 17 + + ENDC + +HEXAGON_WIDTH = 320 +HEXAGON_HEIGHT = 254 + +COP_LIST_SIZE = 4000*4 + +HEXCHUNKY_WIDTH = 22 +HEXCHUNKY_HEIGHT = 25 + +WINNER_WIDTH = 128 +WINNER_HEIGHT = 128 + +CHIPMEM_SIZE = 100000 +FASTMEM_SIZE = 2*4096*2 + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + + include "../framework/framework.i" + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrPlanesPtr + APTR pd_LastPlanesPtr + APTR pd_CurrChunkyPtr + APTR pd_LastChunkyPtr + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + UBYTE pd_CopListToggle + UBYTE pd_DbToggle + ALIGNWORD + + APTR pd_CopperList1 + APTR pd_CopperList2 + UWORD pd_ChunkyCopperListOffset + + UWORD pd_Angle + UWORD pd_WinnerKilled + UWORD pd_WinnerXPos + UWORD pd_WinnerYPos + UWORD pd_WinnerXDir + + ULONG pd_StartLineuu00VVvv + UWORD pd_StartLineUU + ULONG pd_EvenToOddLineuu00VVvvInc + UWORD pd_EvenToOddLineUUInc + ULONG pd_OddToEvenLineuu00VVvvInc + UWORD pd_OddToEvenLineUUInc + + APTR pd_TexturePtr + APTR pd_ChunkyBuffer1 + APTR pd_ChunkyBuffer2 + APTR pd_ShadeTableXor + APTR pd_ShadeTableAdd1 + + STRUCT pd_PreparationTask,ft_SIZEOF + STRUCT pd_HexPalette,16*cl_SIZEOF + STRUCT pd_WinnerSprites,8*4 + + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + bsr hex_init + + lea hex_copperlist,a0 + CALLFW SetCopper + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + move.l #part_music_data,fw_MusicData(a6) + move.l #part_music_smp,fw_MusicSamples(a6) + CALLFW StartMusic + IFD PART_MUSIC_START_POS + moveq.l #PART_MUSIC_START_POS,d0 + CALLFW MusicSetPosition + move.w #6336,fw_MusicFrameCount(a6) + ENDC + ENDC + ENDC + + bsr hex_main + + CALLFW StopMusic + + lea pd_PreparationTask(a6),a1 + CALLFW RemTask + + CALLFW SetBaseCopper + + rts + +;-------------------------------------------------------------------- + +hex_init: + bsr hex_init_vars + bsr hex_fill_chunky_buffers + + lea .backgroundtasks(pc),a0 + lea pd_PreparationTask(a6),a1 + CALLFW AddTask + + rts + +.backgroundtasks + bsr hex_init_shade_table + rts + +;-------------------------------------------------------------------- + +hex_init_vars: + IFD FW_DEMO_PART + move.l fw_GlobalUserData(a6),pd_TexturePtr(a6) + ELSE + move.l #hex_kaleidoscope_texture,pd_TexturePtr(a6) + ENDC + move.l #COP_LIST_SIZE,d0 + CALLFW AllocChip64KB + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + + move.l #COP_LIST_SIZE,d0 + CALLFW AllocChip64KB + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + move.l #HEXCHUNKY_WIDTH*HEXCHUNKY_HEIGHT*2*2,d0 + CALLFW AllocChip + PUTMSG 10,<"ChunkyBuffer1 %p">,a0 + move.l a0,pd_ChunkyBuffer1(a6) + move.l a0,pd_CurrChunkyPtr(a6) + lea HEXCHUNKY_WIDTH*HEXCHUNKY_HEIGHT*2(a0),a0 + move.l a0,pd_ChunkyBuffer2(a6) + move.l a0,pd_LastChunkyPtr(a6) + + move.l #2*4096*2,d0 + CALLFW AllocFast + move.l a0,pd_ShadeTableXor(a6) + PUTMSG 10,<"ShadeTableXor %p">,a0 + lea 4096*2(a0),a0 + move.l a0,pd_ShadeTableAdd1(a6) + PUTMSG 10,<"ShadeTableAdd1 %p">,a0 + + + lea pd_WinnerSprites(a6),a1 + lea hex_winners_sprites,a3 + move.l a3,a2 + moveq.l #(WINNER_WIDTH/16)-1,d7 +.sprloop + move.l a3,a0 + adda.w (a2)+,a0 + move.l d0,(a0) + move.l a0,(a1)+ + dbra d7,.sprloop + + move.w #HEXAGON_WIDTH,pd_WinnerXPos(a6) + move.w #0,pd_WinnerYPos(a6) + rts + +;-------------------------------------------------------------------- + +hex_init_shade_table: + move.l pd_ShadeTableXor(a6),a0 + move.l a0,a1 + moveq.l #0,d0 +.xorloop + moveq.l #$11,d3 + moveq.l #15,d1 + cmp.b d1,d0 + bhi.s .upperset + and.b d1,d3 +.upperset + and.b d0,d1 + bne.s .lowerset + subq.b #1,d3 +.lowerset + move.w d3,(a0)+ + addq.b #1,d0 + bne.s .xorloop + + moveq.l #15-1,d7 + move.l #$01000100,d3 +.xoroloop + move.l a1,a2 + move.w #128-1,d6 +.xor2loop + move.l (a2)+,d0 + add.l d3,d0 + move.l d0,(a0)+ + dbra d6,.xor2loop + dbra d7,.xoroloop + + move.l pd_ShadeTableAdd1(a6),a1 + moveq.l #0,d0 + move.w #4096-1,d7 +.sub1loop + move.w d0,d1 + add.w -(a0),d1 + move.w d1,(a1)+ + addq.w #1,d0 + dbra d7,.sub1loop + + rts + +;-------------------------------------------------------------------- + +hex_main: + PUTMSG 10,<"%d: Main part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + + move.w #2,copcon(a5) ; enable copper danger (copper controlled blitter) + + REPT 2 + bsr hex_flip_copperlists + + move.l pd_CurrCopListPtr(a6),a0 + bsr hex_hexagonchunky_create_copperlist + ; offset is not known in first run! + move.l pd_CurrCopListPtr(a6),a0 + bsr hex_hexagonchunky_create_copper_blittercopy + ENDR + + move.w #$fff,d0 + move.w d0,color+17*2(a5) + move.w d0,color+21*2(a5) + move.w d0,color+25*2(a5) + move.w d0,color+29*2(a5) + moveq.l #0,d0 + move.w d0,color+19*2(a5) + move.w d0,color+23*2(a5) + move.w d0,color+27*2(a5) + move.w d0,color+31*2(a5) + + moveq.l #16,d0 + move.w #$346,d1 + lea pd_HexPalette(a6),a1 + CALLFW InitPaletteLerpSameColor + + moveq.l #16,d0 + moveq.l #64,d1 + lea hex_hexgrid_palette(pc),a0 + lea pd_HexPalette(a6),a1 + CALLFW FadePaletteTo + + lea .script(pc),a0 + CALLFW InstallScript + + lea .musicscript(pc),a0 + CALLFW InstallMusicScript + + PUTMSG 10,<"Chunky %p">,a0 +.loop + bsr hex_flip_copperlists + + moveq.l #16,d0 + lea pd_HexPalette(a6),a1 + CALLFW DoFadePaletteStep + + lea pd_HexPalette(a6),a1 + REPT 16 + move.w pd_HexPalette+REPTN*cl_SIZEOF+cl_Color(a6),color+REPTN*4(a5) + ENDR + + CALLFW CheckScript + CALLFW CheckMusicScript + + bsr hex_update_winner_sprites + + bsr hex_do_rotozoomer + + bsr hex_update_copper_list_pointers + + CALLFW VSyncWithTask + + move.w fw_LspMusicLength+2(a6),d0 + subq.w #2,d0 + cmp.w fw_MusicFrameCount(a6),d0 + bge.s .loop + + rts + +.script + dc.w 120,.move_winner_left-* + dc.w 120+WINNER_WIDTH,.stop_winner-* + dc.w 400,.move_winner_right-* + dc.w 400+WINNER_WIDTH/2,.stop_and_kill_winner-* + dc.w 0 + +.musicscript + dc.w 6720,.flash-* + dc.w 6720+16*6,.startdarken-* + dc.w 6720+32*6,.fadeout-* + dc.w 0 + +.move_winner_left + move.w #-1,pd_WinnerXDir(a6) + rts +.stop_and_kill_winner + st pd_WinnerKilled(a6) +.stop_winner + clr.w pd_WinnerXDir(a6) + rts +.move_winner_right + move.w #2,pd_WinnerXDir(a6) + rts + +.flash + PUTMSG 10,<"Flash!"> + moveq.l #16,d0 + move.w #$fff,d1 + lea pd_HexPalette(a6),a1 + CALLFW InitPaletteLerpSameColor + + moveq.l #16,d0 + moveq.l #32,d1 + lea hex_hexgrid_palette(pc),a0 + lea pd_HexPalette(a6),a1 + CALLFW FadePaletteTo + rts + +.startdarken + PUTMSG 10,<"Start darken"> + lea pd_PreparationTask(a6),a1 + move.b #-20,LN_PRI(a1) + lea .brightentextureloop(pc),a0 + CALLFW AddTask + rts + +.fadeout + moveq.l #16,d0 + moveq.l #64,d1 + lea hex_hexgrid_black_palette(pc),a0 + lea pd_HexPalette(a6),a1 + CALLFW FadePaletteTo + rts + +.brightentextureloop + move.w fw_MusicFrameCount(a6),d6 + add.w #15,d6 + moveq.l #16-1,d7 +.brloop + PUSHM d6/d7 + bsr hex_brighten_tc_data + POPM +.retry + cmp.w fw_MusicFrameCount(a6),d6 + blt.s .contbr + PUTMSG 10,<"Yielding"> + CALLFW Yield + bra.s .retry +.contbr + add.w #15,d6 + dbra d7,.brloop + + rts + +;-------------------------------------------------------------------- + +hex_flip_copperlists: + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + move.l pd_CurrChunkyPtr(a6),pd_LastChunkyPtr(a6) + not.b pd_CopListToggle(a6) + beq.s .selb1 + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + move.l pd_ChunkyBuffer2(a6),pd_CurrChunkyPtr(a6) + rts +.selb1 + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + move.l pd_ChunkyBuffer1(a6),pd_CurrChunkyPtr(a6) + rts + +;-------------------------------------------------------------------- + +hex_update_copper_list_pointers: + lea hex_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +hex_update_winner_sprites: + lea pd_WinnerSprites(a6),a2 + + moveq.l #0,d0 + moveq.l #0,d4 + tst.w pd_WinnerKilled(a6) + bne.s .filldata + + move.w pd_WinnerXPos(a6),d4 + add.w pd_WinnerXDir(a6),d4 + move.w d4,pd_WinnerXPos(a6) + move.w pd_WinnerYPos(a6),d1 + + add.w #128,d4 + add.w #$52,d1 + + move.w d1,d2 + add.w #WINNER_HEIGHT,d2 + moveq.l #0,d0 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d0,d0 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d0,d0 ; ev8 + lsr.w #1,d4 ; sh8-sh1 in d4 + addx.w d0,d0 ; sh0 + or.w d2,d0 ; ev7-ev0, sv8, ev8, sh0 in d0 + or.w d1,d4 ; sv7-sv0, sh8-sh1 in d4 + ;tas d0 ; att TAS sets bit 7 +.filldata + REPT (WINNER_WIDTH/16) + move.l (a2)+,a0 + move.w d4,(a0)+ + move.w d0,(a0)+ + addq.w #8,d4 + ENDR + rts + +;-------------------------------------------------------------------- + +hex_fill_chunky_buffers: + BLTHOGON + BLTWAIT + + BLTCON_SET D,BLT_C,0,0 + move.w #0,bltdmod(a5) + move.w #$346^$fff,bltcdat(a5) + move.l pd_ChunkyBuffer1(a6),bltdpt(a5) + move.w #(HEXCHUNKY_WIDTH*2)|((HEXCHUNKY_HEIGHT)<<6),bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +hex_brighten_tc_data: + move.l pd_TexturePtr(a6),a0 + move.l a0,a2 + add.l #256*256*2,a2 + move.l pd_ShadeTableAdd1(a6),a1 +.loop movem.w (a0),d0-d7 + add.w d0,d0 + add.w d1,d1 + add.w d2,d2 + add.w d3,d3 + add.w d4,d4 + add.w d5,d5 + add.w d6,d6 + add.w d7,d7 + move.w (a1,d0.w),(a0)+ + move.w (a1,d1.w),(a0)+ + move.w (a1,d2.w),(a0)+ + move.w (a1,d3.w),(a0)+ + move.w (a1,d4.w),(a0)+ + move.w (a1,d5.w),(a0)+ + move.w (a1,d6.w),(a0)+ + move.w (a1,d7.w),(a0)+ + cmp.l a0,a2 + bne.s .loop + rts + +;-------------------------------------------------------------------- + +hex_do_rotozoomer: + add.w #$074,pd_StartLineuu00VVvv+2(a6) + addq.b #1,pd_StartLineUU(a6) + add.b #44,pd_StartLineuu00VVvv(a6) + + move.l fw_SinTable(a6),a0 + move.l fw_CosTable(a6),a1 + move.w pd_Angle(a6),d0 + addq.w #4,d0 + move.w d0,pd_Angle(a6) + and.w #1023*2,d0 + move.w d0,d1 + lsr.w #1,d1 + and.w #1023*2,d1 + move.w (a0,d1.w),d3 ; zoom + lsr.w #2,d3 + add.w #64,d3 + + move.w (a1,d0.w),d4 ; acos (U) + move.w (a0,d0.w),d5 ; asin (V) + ; scale + muls d3,d4 + muls d3,d5 + swap d4 ; UUuu + swap d5 ; VVvv + PUTMSG 40,<"UUuu = %x, VVvv = %x">,d4,d5 + + ; even to odd increment + move.w d4,d0 + asr.w #1,d0 + add.w d5,d0 + neg.w d0 ; -asin - (acos / 2) + move.b d0,pd_EvenToOddLineuu00VVvvInc(a6) + move.w d0,pd_EvenToOddLineUUInc(a6) + move.w d5,d0 + asr.w #1,d0 + neg.w d0 + add.w d4,d0 ; acos - (asin / 2) + move.w d0,pd_EvenToOddLineuu00VVvvInc+2(a6) + + ; odd to even increment + move.w d5,d0 + neg.w d0 + add.w d4,d0 ; -asin + acos + move.b d0,pd_OddToEvenLineuu00VVvvInc(a6) + move.w d0,pd_OddToEvenLineUUInc(a6) + + move.w d5,d0 + add.w d4,d0 + move.w d0,pd_OddToEvenLineuu00VVvvInc+2(a6) + + swap d5 + move.b d4,-(sp) + move.w (sp)+,d5 + clr.b d5 + swap d5 ; uu__VVvv + move.w d4,-(sp) + move.b (sp)+,d4 ; xxxxxxUU + + move.l pd_StartLineuu00VVvv(a6),d2 ; startuu00VVvv + move.b pd_StartLineUU(a6),d3 ; start______UU + + move.l pd_CurrChunkyPtr(a6),a0 + move.l pd_TexturePtr(a6),a1 + + moveq.l #(HEXCHUNKY_HEIGHT/2)-1,d7 +.yloop + move.w d7,-(sp) + + ; even line + move.l d2,d0 ; uu__VVvv + move.w d3,d1 ; ______UU + + moveq.l #HEXCHUNKY_WIDTH-1,d7 +.xloop1 + moveq.l #0,d6 + move.w d0,d6 + move.b d1,d6 + add.l d6,d6 + move.w (a1,d6.l),(a0)+ + add.l d5,d0 + addx.b d4,d1 + dbra d7,.xloop1 + + move.b pd_OddToEvenLineUUInc(a6),d6 + add.l pd_OddToEvenLineuu00VVvvInc(a6),d2 + addx.b d6,d3 + + ; odd line + move.l d2,d0 ; uu__VVvv + move.w d3,d1 ; ______UU + + moveq.l #HEXCHUNKY_WIDTH-1,d7 +.xloop2 + moveq.l #0,d6 + move.w d0,d6 + move.b d1,d6 + add.l d6,d6 + move.w (a1,d6.l),(a0)+ + add.l d5,d0 + addx.b d4,d1 + dbra d7,.xloop2 + + move.b pd_EvenToOddLineUUInc(a6),d6 + add.l pd_EvenToOddLineuu00VVvvInc(a6),d2 + addx.b d6,d3 + + move.w (sp)+,d7 + dbra d7,.yloop + + ; even line + move.l d2,d0 ; uu__VVvv + move.w d3,d1 ; ______UU + + moveq.l #HEXCHUNKY_WIDTH-1,d7 +.xloop3 + moveq.l #0,d6 + move.w d0,d6 + move.b d1,d6 + add.l d6,d6 + move.w (a1,d6.l),(a0)+ + add.l d5,d0 + addx.b d4,d1 + dbra d7,.xloop3 + + rts + +;-------------------------------------------------------------------- + +SKIPLINESNOOVR MACRO + lsl.w #8,d1 + add.w d1,d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + ENDM + +; 256*9 + 43*2 instructions (plus a about 40 other insts) around 2500, plus 43*25 (plus two empty ones) insts = 1118 + +hex_hexagonchunky_create_copper_blittercopy: + COPIMOVE DMAF_RASTER,dmacon ; disable display DMA + COPBLITWAIT + COPIMOVE BLTEN_AD|((BLT_A^BLT_C)&$ff),bltcon0 + COPIMOVE 0,bltcon1 + COPIMOVE $ffff,bltafwm + COPIMOVE $ffff,bltalwm + COPIMOVE $fff,bltcdat + COPIMOVE 0,bltamod + COPIMOVE 6,bltdmod + + move.l pd_LastChunkyPtr(a6),a1 + COPPTMOVE a1,bltapt,d0 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_ChunkyCopperListOffset(a6),a1 + COPPTMOVE a1,bltdpt,d0 + COPIMOVE (1|(HEXCHUNKY_WIDTH*HEXCHUNKY_HEIGHT)<<6),bltsize + rts + +;-------------------------------------------------------------------- + +hex_hexagonchunky_create_copperlist: + bsr hex_hexagonchunky_create_copper_blittercopy + moveq.l #-2,d3 + + lea pd_WinnerSprites(a6),a1 + move.w #sprpt,d1 + moveq.l #(WINNER_WIDTH/16)*2-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + COPIMOVE $6200,bplcon0 + + move.w #$00df,d0 + moveq.l #$2c,d1 + SKIPLINESNOOVR + + lea hex_hexgrid_data(pc),a2 + + lea 4+8+4+2(a0),a1 + move.l a1,d1 + swap d1 + COPRMOVE d1,cop1lc + + lea 2500*4(a0),a4 + + move.l a4,a1 + suba.l pd_CurrCopListPtr(a6),a1 + lea 6+HEXCHUNKY_WIDTH*2*4(a1),a1 ; first line is ignored + move.w a1,pd_ChunkyCopperListOffset(a6) + + move.l a4,a3 + + move.l #(bpldat<<16),d2 + move.l #((color+16*2)<<16)|$253,d1 + ;move.l #((color)<<16)|$253,d1 + moveq.l #(25+2)-2,d6 +.chloop + moveq.l #((HEXAGON_WIDTH+16)/16)-1,d7 +.xloop + move.l d2,(a3)+ + move.l d1,(a3)+ + add.w #$423,d1 + dbra d7,.xloop + move.l #copjmp1<<16,(a3)+ + move.l #$1fe<<16,(a3)+ + dbra d6,.chloop + + move.l a4,a3 + COPRMOVE a3,cop2lc+2 + + moveq.l #2-1,d7 +.iloop + move.w (a2)+,d2 ; unused + move.w #bpldat+1*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+2*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+3*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+4*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+5*2,(a0)+ + move.w (a2)+,(a0)+ + + lea 8+4(a0),a1 + COPRMOVE a1,cop1lc+2 + + move.b #$2f,d0 + add.w #$100,d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + move.l #copjmp2<<16,(a0)+ + + dbra d7,.iloop + + moveq.l #12-1,d6 +.drloop + lea 44*4(a4),a4 + lea 8(a4),a3 + COPRMOVE a3,cop2lc+2 + + moveq.l #10-1,d7 +.y1loop + move.w (a2)+,d2 ; unused + move.w #bpldat+1*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+2*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+3*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+4*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+5*2,(a0)+ + move.w (a2)+,(a0)+ + + lea 8+4(a0),a1 + COPRMOVE a1,cop1lc+2 + + move.b #$33,d0 + add.w #$100,d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + move.l #copjmp2<<16,(a0)+ + + dbra d7,.y1loop + + lea 44*4(a4),a4 + move.l a4,a3 + COPRMOVE a3,cop2lc+2 + moveq.l #10-1,d7 +.y2loop + move.w (a2)+,d2 ; unused + move.w #bpldat+1*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+2*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+3*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+4*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+5*2,(a0)+ + move.w (a2)+,(a0)+ + + lea 8+4(a0),a1 + COPRMOVE a1,cop1lc+2 + + move.b #$2f,d0 + add.w #$100,d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + move.l #copjmp2<<16,(a0)+ + + dbra d7,.y2loop + + ;lea -20*2*6(a2),a2 + dbra d6,.drloop + + lea 44*4(a4),a4 + lea 8(a4),a3 + COPRMOVE a3,cop2lc+2 + + moveq.l #12-1,d7 +.y3loop + move.w (a2)+,d2 ; unused + move.w #bpldat+1*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+2*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+3*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+4*2,(a0)+ + move.w (a2)+,(a0)+ + move.w #bpldat+5*2,(a0)+ + move.w (a2)+,(a0)+ + + lea 8+4(a0),a1 + COPRMOVE a1,cop1lc+2 + + move.b #$33,d0 + add.w #$100,d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + move.l #copjmp2<<16,(a0)+ + + dbra d7,.y3loop + + lea hex_copperlist,a1 + COPPTMOVE a1,cop1lc,d1 + + move.l d3,(a0) + rts + +;-------------------------------------------------------------------- + +hex_hexgrid_palette: + dc.w $000,$ccc,$aaa,$888 + dc.w $666,$9ac,$57a,$357 + dc.w $0f0,$eee,$eee,$cc8 + dc.w $884,$aa6,$a40,$620 + +hex_hexgrid_black_palette: + REPT 16 + dc.w $000 + ENDR + +hex_hexgrid_data: + incbin "../data/hexagon/hexagon_reg16x254.EHB" + + section "hex_copper",data,chip + +hex_copperlist: + COP_MOVE dmacon,DMAF_RASTER|DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + COP_MOVE diwstrt,$2c81 ; window start + COP_MOVE diwstop,$2cc1 ; window stop + COP_MOVE ddfstrt,$0038 ; bitplane start + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon3,$0c00 + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + COP_MOVE bplcon0,$0200 + +hex_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +hex_winners_sprites: + incbin "../data/hexagon/winners128x128x4.SPR" + + IFND FW_DEMO_PART + section "hex_kaleidoscope_texture",data +hex_kaleidoscope_texture: + incbin "../data/hexagon/kaleitc.raw" + + IFD ENABLE_PART_MUSIC + section "part_music_samples",data,chip ; section for music playback +part_music_smp: + incbin "../data/music/desire_demo_68k_v6.lsbank" + + section "part_music_data",data ; section for music playback +part_music_data: + incbin "../data/music/desire_demo_68k_v6.lsmusic" + ENDC + ENDC + + END \ No newline at end of file diff --git a/source/includes/devices/timer.i b/source/includes/devices/timer.i new file mode 100644 index 0000000..c79bda1 --- /dev/null +++ b/source/includes/devices/timer.i @@ -0,0 +1,56 @@ + IFND DEVICES_TIMER_I +DEVICES_TIMER_I SET 1 +** +** $Filename: devices/timer.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.10 $ +** $Date: 91/03/05 $ +** +** Timer device name and useful definitions. +** +** (C) Copyright 1985-1991 Commodore-Amiga Inc. +** All Rights Reserved +** + + + IFND EXEC_TYPES_I + INCLUDE "exec/types.i" + ENDC + + IFND EXEC_IO_I + INCLUDE "exec/io.i" + ENDC + +* unit defintions +UNIT_MICROHZ EQU 0 +UNIT_VBLANK EQU 1 +UNIT_ECLOCK EQU 2 +UNIT_WAITUNTIL EQU 3 +UNIT_WAITECLOCK EQU 4 + +TIMERNAME MACRO + DC.B 'timer.device',0 + DS.W 0 + ENDM + + STRUCTURE TIMEVAL,0 + ULONG TV_SECS + ULONG TV_MICRO + LABEL TV_SIZE + + STRUCTURE ECLOCKVAL,0 + ULONG EV_HI + ULONG EV_LO + LABEL EV_SIZE + + STRUCTURE TIMEREQUEST,IO_SIZE + STRUCT IOTV_TIME,TV_SIZE + LABEL IOTV_SIZE + +* IO_COMMAND to use for adding a timer + DEVINIT + DEVCMD TR_ADDREQUEST + DEVCMD TR_GETSYSTIME + DEVCMD TR_SETSYSTIME + + ENDC ; DEVICES_TIMER_I diff --git a/source/includes/dos/dos.i b/source/includes/dos/dos.i new file mode 100644 index 0000000..5311784 --- /dev/null +++ b/source/includes/dos/dos.i @@ -0,0 +1,234 @@ + IFND DOS_DOS_I +DOS_DOS_I SET 1 +** $Filename: dos/dos.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.24 $ +** $Date: 91/05/16 $ +** +** Standard asm header for AmigaDOS +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_TYPES_I + INCLUDE "exec/types.i" + ENDC + +DOSNAME MACRO + DC.B 'dos.library',0 + ENDM + +* Predefined Amiga DOS global constants + +DOSTRUE EQU -1 +DOSFALSE EQU 0 + +* Mode parameter to Open() +MODE_OLDFILE EQU 1005 * Open existing file read/write +* * positioned at beginning of file. +MODE_NEWFILE EQU 1006 * Open freshly created file (delete +* * old file) read/write +MODE_READWRITE EQU 1004 * Open old file w/shared lock, +* * creates file if doesn't exist. + +* Relative position to Seek() +OFFSET_BEGINNING EQU -1 * relative to Beginning Of File +OFFSET_CURRENT EQU 0 * relative to Current file position +OFFSET_END EQU 1 * relative to End Of File + +OFFSET_BEGINING EQU OFFSET_BEGINNING * Ancient compatibility + +BITSPERBYTE EQU 8 +BYTESPERLONG EQU 4 +BITSPERLONG EQU 32 +MAXINT EQU $7FFFFFFF +MININT EQU $80000000 + +* Passed as type to Lock() +SHARED_LOCK EQU -2 ; File is readable by others +ACCESS_READ EQU -2 ; Synonym +EXCLUSIVE_LOCK EQU -1 ; No other access allowed +ACCESS_WRITE EQU -1 ; Synonym + + + STRUCTURE DateStamp,0 + LONG ds_Days ; Number of days since Jan. 1, 1978 + LONG ds_Minute ; Number of minutes past midnight + LONG ds_Tick ; Number of ticks past minute + LABEL ds_SIZEOF ; DateStamp + +TICKS_PER_SECOND EQU 50 ; Number of ticks in one second + +* Returned by Examine() and ExInfo() + STRUCTURE FileInfoBlock,0 + LONG fib_DiskKey + LONG fib_DirEntryType ; Type of Directory. If < 0, then a plain file. + ; If > 0 a directory + STRUCT fib_FileName,108 ; Null terminated. Max 30 chars used for now + LONG fib_Protection ; bit mask of protection, rwxd are 3-0. + LONG fib_EntryType + LONG fib_Size ; Number of bytes in file + LONG fib_NumBlocks ; Number of blocks in file + STRUCT fib_DateStamp,ds_SIZEOF ; Date file last changed. + STRUCT fib_Comment,80 ; Null terminated. Comment associated with file + STRUCT fib_Reserved,36 + LABEL fib_SIZEOF ; FileInfoBlock + +* FIB stands for FileInfoBlock +* FIBB are bit definitions, FIBF are field definitions + BITDEF FIB,SCRIPT,6 ; program is an execute script + BITDEF FIB,PURE,5 ; program is reentrant and reexecutable + BITDEF FIB,ARCHIVE,4 ; cleared whenever file is changed + BITDEF FIB,READ,3 ; ignored by the system + BITDEF FIB,WRITE,2 ; ignored by the system + BITDEF FIB,EXECUTE,1 ; ignored by the system + BITDEF FIB,DELETE,0 ; prevent file from being deleted + +* Standard maximum length for an error string from fault. However, most +* error strings should be kept under 60 characters if possible. Don't +* forget space for the header you pass in. +FAULT_MAX EQU 82 + +* All BCPL data must be long word aligned. BCPL pointers are the long word +* address (i.e byte address divided by 4 (>>2)) + +* Macro to indicate BCPL pointers +BPTR MACRO * Long word pointer + LONG \1 + ENDM +BSTR MACRO * Long word pointer to BCPL string. + LONG \1 + ENDM + +* #define BADDR( bptr ) (bptr << 2) * Convert BPTR to byte addressed pointer + +* BCPL strings have a length in the first byte and then the characters. +* For example: s[0]=3 s[1]=S s[2]=Y s[3]=S + +* returned by Info() + STRUCTURE InfoData,0 + LONG id_NumSoftErrors * number of soft errors on disk + LONG id_UnitNumber * Which unit disk is (was) mounted on + LONG id_DiskState * See defines below + LONG id_NumBlocks * Number of blocks on disk + LONG id_NumBlocksUsed * Number of block in use + LONG id_BytesPerBlock + LONG id_DiskType * Disk Type code + BPTR id_VolumeNode * BCPL pointer to volume node + LONG id_InUse * Flag, zero if not in use + LABEL id_SIZEOF * InfoData + +* ID stands for InfoData +* Disk states +ID_WRITE_PROTECTED EQU 80 * Disk is write protected +ID_VALIDATING EQU 81 * Disk is currently being validated +ID_VALIDATED EQU 82 * Disk is consistent and writeable + +* Disk types +* ID_INTER_* use international case comparison routines for hashing +ID_NO_DISK_PRESENT EQU -1 +ID_UNREADABLE_DISK EQU ('B'<<24)!('A'<<16)!('D'<<8) +ID_NOT_REALLY_DOS EQU ('N'<<24)!('D'<<16)!('O'<<8)!('S') +ID_DOS_DISK EQU ('D'<<24)!('O'<<16)!('S'<<8) +ID_FFS_DISK EQU ('D'<<24)!('O'<<16)!('S'<<8)!(1) +ID_INTER_DOS_DISK EQU ('D'<<24)!('O'<<16)!('S'<<8)!(2) +ID_INTER_FFS_DISK EQU ('D'<<24)!('O'<<16)!('S'<<8)!(3) +ID_KICKSTART_DISK EQU ('K'<<24)!('I'<<16)!('C'<<8)!('K') +ID_MSDOS_DISK EQU ('M'<<24)!('S'<<16)!('D'<<8) + +* Errors from IoErr(), etc. +ERROR_NO_FREE_STORE EQU 103 +ERROR_TASK_TABLE_FULL EQU 105 +ERROR_BAD_TEMPLATE EQU 114 +ERROR_BAD_NUMBER EQU 115 +ERROR_REQUIRED_ARG_MISSING EQU 116 +ERROR_KEY_NEEDS_ARG EQU 117 +ERROR_TOO_MANY_ARGS EQU 118 +ERROR_UNMATCHED_QUOTES EQU 119 +ERROR_LINE_TOO_LONG EQU 120 +ERROR_FILE_NOT_OBJECT EQU 121 +ERROR_INVALID_RESIDENT_LIBRARY EQU 122 +ERROR_NO_DEFAULT_DIR EQU 201 +ERROR_OBJECT_IN_USE EQU 202 +ERROR_OBJECT_EXISTS EQU 203 +ERROR_DIR_NOT_FOUND EQU 204 +ERROR_OBJECT_NOT_FOUND EQU 205 +ERROR_BAD_STREAM_NAME EQU 206 +ERROR_OBJECT_TOO_LARGE EQU 207 +ERROR_ACTION_NOT_KNOWN EQU 209 +ERROR_INVALID_COMPONENT_NAME EQU 210 +ERROR_INVALID_LOCK EQU 211 +ERROR_OBJECT_WRONG_TYPE EQU 212 +ERROR_DISK_NOT_VALIDATED EQU 213 +ERROR_DISK_WRITE_PROTECTED EQU 214 +ERROR_RENAME_ACROSS_DEVICES EQU 215 +ERROR_DIRECTORY_NOT_EMPTY EQU 216 +ERROR_TOO_MANY_LEVELS EQU 217 +ERROR_DEVICE_NOT_MOUNTED EQU 218 +ERROR_SEEK_ERROR EQU 219 +ERROR_COMMENT_TOO_BIG EQU 220 +ERROR_DISK_FULL EQU 221 +ERROR_DELETE_PROTECTED EQU 222 +ERROR_WRITE_PROTECTED EQU 223 +ERROR_READ_PROTECTED EQU 224 +ERROR_NOT_A_DOS_DISK EQU 225 +ERROR_NO_DISK EQU 226 +ERROR_NO_MORE_ENTRIES EQU 232 +* added for 1.4 +ERROR_IS_SOFT_LINK EQU 233 +ERROR_OBJECT_LINKED EQU 234 +ERROR_BAD_HUNK EQU 235 +ERROR_NOT_IMPLEMENTED EQU 236 +ERROR_RECORD_NOT_LOCKED EQU 240 +ERROR_LOCK_COLLISION EQU 241 +ERROR_LOCK_TIMEOUT EQU 242 +ERROR_UNLOCK_ERROR EQU 243 + +* error codes 303-305 are defined in dosasl.i + +* These are the return codes used by convention by AmigaDOS commands +* See FAILAT and IF for relvance to EXECUTE files +RETURN_OK EQU 0 * No problems, success +RETURN_WARN EQU 5 * A warning only +RETURN_ERROR EQU 10 * Something wrong +RETURN_FAIL EQU 20 * Complete or severe failure + +* Bit numbers that signal you that a user has issued a break +* for example: if (SetSignal(0,0) & SIGBREAKF_CTRL_C) cleanup_and_exit(); + BITDEF SIGBREAK,CTRL_C,12 + BITDEF SIGBREAK,CTRL_D,13 + BITDEF SIGBREAK,CTRL_E,14 + BITDEF SIGBREAK,CTRL_F,15 + +* Values returned by SameLock() +LOCK_DIFFERENT EQU -1 +LOCK_SAME EQU 0 +LOCK_SAME_VOLUME EQU 1 ; locks are on same volume +LOCK_SAME_HANDLER EQU LOCK_SAME_VOLUME +* LOCK_SAME_HANDLER was a misleading name, def kept for src compatibility + +* types for ChangeMode() +CHANGE_LOCK EQU 0 +CHANGE_FH EQU 1 + +* Values for MakeLink() +LINK_HARD EQU 0 +LINK_SOFT EQU 1 ; softlinks are not fully supported yet + +* values returned by ReadItem +ITEM_EQUAL EQU -2 ; "=" Symbol +ITEM_ERROR EQU -1 ; error +ITEM_NOTHING EQU 0 ; *N, ;, endstreamch +ITEM_UNQUOTED EQU 1 ; unquoted item +ITEM_QUOTED EQU 2 ; quoted item + +* types for AllocDosObject/FreeDosObject +DOS_FILEHANDLE EQU 0 ; few people should use this +DOS_EXALLCONTROL EQU 1 ; Must be used to allocate this! +DOS_FIB EQU 2 ; useful +DOS_STDPKT EQU 3 ; for doing packet-level I/O +DOS_CLI EQU 4 ; for shell-writers, etc +DOS_RDARGS EQU 5 ; for ReadArgs if you pass it in + + ENDC ; DOS_DOS_I diff --git a/source/includes/dos/dosextens.i b/source/includes/dos/dosextens.i new file mode 100644 index 0000000..f36c167 --- /dev/null +++ b/source/includes/dos/dosextens.i @@ -0,0 +1,461 @@ + IFND DOS_DOSEXTENS_I +DOS_DOSEXTENS_I SET 1 +** +** $Filename: dos/dosextens.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.37 $ +** $Date: 91/11/08 $ +** +** DOS structures not needed for the casual AmigaDOS user +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_TYPES_I + INCLUDE "exec/types.i" + ENDC + IFND EXEC_TASKS_I + INCLUDE "exec/tasks.i" + ENDC + IFND EXEC_PORTS_I + INCLUDE "exec/ports.i" + ENDC + IFND EXEC_LIBRARIES_I + INCLUDE "exec/libraries.i" + ENDC + IFND EXEC_SEMAPHORES_I + INCLUDE "exec/semaphores.i" + ENDC + IFND DEVICES_TIMER_I + INCLUDE "devices/timer.i" + ENDC + + IFND DOS_DOS_I + INCLUDE "dos/dos.i" + ENDC + + +* All DOS processes have this STRUCTure +* Create and DeviceProc returns pointer to the MsgPort in this STRUCTure +* Process_addr = DeviceProc(..) - TC_SIZE + + STRUCTURE Process,0 + STRUCT pr_Task,TC_SIZE + STRUCT pr_MsgPort,MP_SIZE * This is BPTR address from DOS functions + WORD pr_Pad * Remaining variables on 4 byte boundaries + BPTR pr_SegList * Array of seg lists used by this process + LONG pr_StackSize * Size of process stack in bytes + APTR pr_GlobVec * Global vector for this process (BCPL) + LONG pr_TaskNum * CLI task number of zero if not a CLI + BPTR pr_StackBase * Ptr to high memory end of process stack + LONG pr_Result2 * Value of secondary result from last call + BPTR pr_CurrentDir * Lock associated with current directory + BPTR pr_CIS * Current CLI Input Stream + BPTR pr_COS * Current CLI Output Stream + APTR pr_ConsoleTask * Console handler process for current window + APTR pr_FileSystemTask * File handler process for current drive + BPTR pr_CLI * pointer to CommandLineInterface + APTR pr_ReturnAddr * pointer to previous stack frame + APTR pr_PktWait * Function to be called when awaiting msg + APTR pr_WindowPtr * Window pointer for errors + +* following definitions are new with 2.0 + BPTR pr_HomeDir * Home directory of executing program + LONG pr_Flags * flags telling dos about process + APTR pr_ExitCode * code to call on exit of program or NULL + LONG pr_ExitData * Passed as an argument to pr_ExitCode + APTR pr_Arguments * Arguments passed to the process at start + STRUCT pr_LocalVars,MLH_SIZE * Local environment variables + APTR pr_ShellPrivate * for the use of the current shell + BPTR pr_CES * Error stream - if NULL, use pr_COS + LABEL pr_SIZEOF * Process + +* +* Flags for pr_Flags +* + BITDEF PR,FREESEGLIST,0 + BITDEF PR,FREECURRDIR,1 + BITDEF PR,FREECLI,2 + BITDEF PR,CLOSEINPUT,3 + BITDEF PR,CLOSEOUTPUT,4 + BITDEF PR,FREEARGS,5 + +* The long word address (BPTR) of this STRUCTure is returned by +* Open() and other routines that return a file. You need only worry +* about this STRUCT to do async io's via PutMsg() instead of +* standard file system calls + + STRUCTURE FileHandle,0 + APTR fh_Link * pointer to EXEC message + APTR fh_Interactive * Boolean; TRUE if interactive handle + APTR fh_Type * Port to do PutMsg() to + LONG fh_Buf + LONG fh_Pos + LONG fh_End + LONG fh_Funcs +fh_Func1 EQU fh_Funcs + LONG fh_Func2 + LONG fh_Func3 + LONG fh_Args +fh_Arg1 EQU fh_Args + LONG fh_Arg2 + LABEL fh_SIZEOF * FileHandle + +* This is the extension to EXEC Messages used by DOS + STRUCTURE DosPacket,0 + APTR dp_Link * pointer to EXEC message + APTR dp_Port * pointer to Reply port for the packet +* * Must be filled in each send. + LONG dp_Type * See ACTION_... below and +* * 'R' means Read, 'W' means Write to the file system + LONG dp_Res1 * For file system calls this is the result +* * that would have been returned by the +* * function, e.g. Write ('W') returns actual +* * length written + LONG dp_Res2 * For file system calls this is what would +* * have been returned by IoErr() + LONG dp_Arg1 +* Device packets common equivalents +dp_Action EQU dp_Type +dp_Status EQU dp_Res1 +dp_Status2 EQU dp_Res2 +dp_BufAddr EQU dp_Arg1 + LONG dp_Arg2 + LONG dp_Arg3 + LONG dp_Arg4 + LONG dp_Arg5 + LONG dp_Arg6 + LONG dp_Arg7 + LABEL dp_SIZEOF * DosPacket + +* A Packet does not require the Message to before it in memory, but +* for convenience it is useful to associate the two. +* Also see the function init_std_pkt for initializing this STRUCTure + + STRUCTURE StandardPacket,0 + STRUCT sp_Msg,MN_SIZE + STRUCT sp_Pkt,dp_SIZEOF + LABEL sp_SIZEOF * StandardPacket + + +* Packet types +ACTION_NIL EQU 0 +ACTION_STARTUP EQU 0 +ACTION_GET_BLOCK EQU 2 ;OBSOLETE +ACTION_SET_MAP EQU 4 +ACTION_DIE EQU 5 +ACTION_EVENT EQU 6 +ACTION_CURRENT_VOLUME EQU 7 +ACTION_LOCATE_OBJECT EQU 8 +ACTION_RENAME_DISK EQU 9 +ACTION_WRITE EQU 'W' +ACTION_READ EQU 'R' +ACTION_FREE_LOCK EQU 15 +ACTION_DELETE_OBJECT EQU 16 +ACTION_RENAME_OBJECT EQU 17 +ACTION_MORE_CACHE EQU 18 +ACTION_COPY_DIR EQU 19 +ACTION_WAIT_CHAR EQU 20 +ACTION_SET_PROTECT EQU 21 +ACTION_CREATE_DIR EQU 22 +ACTION_EXAMINE_OBJECT EQU 23 +ACTION_EXAMINE_NEXT EQU 24 +ACTION_DISK_INFO EQU 25 +ACTION_INFO EQU 26 +ACTION_FLUSH EQU 27 +ACTION_SET_COMMENT EQU 28 +ACTION_PARENT EQU 29 +ACTION_TIMER EQU 30 +ACTION_INHIBIT EQU 31 +ACTION_DISK_TYPE EQU 32 +ACTION_DISK_CHANGE EQU 33 +ACTION_SET_DATE EQU 34 + +ACTION_SCREEN_MODE EQU 994 + +ACTION_READ_RETURN EQU 1001 +ACTION_WRITE_RETURN EQU 1002 +ACTION_SEEK EQU 1008 +ACTION_FINDUPDATE EQU 1004 +ACTION_FINDINPUT EQU 1005 +ACTION_FINDOUTPUT EQU 1006 +ACTION_END EQU 1007 +ACTION_SET_FILE_SIZE EQU 1022 ; fast file system only +ACTION_WRITE_PROTECT EQU 1023 ; fast file system only + +* new 2.0 packets +ACTION_SAME_LOCK EQU 40 +ACTION_CHANGE_SIGNAL EQU 995 +ACTION_FORMAT EQU 1020 +ACTION_MAKE_LINK EQU 1021 +* +* +ACTION_READ_LINK EQU 1024 +ACTION_FH_FROM_LOCK EQU 1026 +ACTION_IS_FILESYSTEM EQU 1027 +ACTION_CHANGE_MODE EQU 1028 +* +ACTION_COPY_DIR_FH EQU 1030 +ACTION_PARENT_FH EQU 1031 +ACTION_EXAMINE_ALL EQU 1033 +ACTION_EXAMINE_FH EQU 1034 + +ACTION_LOCK_RECORD EQU 2008 +ACTION_FREE_RECORD EQU 2009 + +ACTION_ADD_NOTIFY EQU 4097 +ACTION_REMOVE_NOTIFY EQU 4098 + +* Tell a file system to serialize the current volume. This is typically +* done by changing the creation date of the disk. This packet does not take +* any arguments. NOTE: be prepared to handle failure of this packet for +* V37 ROM filesystems. + +ACTION_SERIALIZE_DISK EQU 4200 + +* A structure for holding error messages - stored as array with error == 0 +* for the last entry. + + STRUCTURE ErrorString,0 + APTR estr_Nums + APTR estr_Strings + LABEL ErrorString_SIZEOF + +* DOS library node structure. +* This is the data at positive offsets from the library node. +* Negative offsets from the node is the jump table to DOS functions +* node = (STRUCT DosLibrary *) OpenLibrary( "dos.library" .. ) + + STRUCTURE DosLibrary,0 + STRUCT dl_lib,LIB_SIZE + APTR dl_Root * Pointer to RootNode, described below + APTR dl_GV * Pointer to BCPL global vector + LONG dl_A2 * BCPL standard register values + LONG dl_A5 + LONG dl_A6 + APTR dl_Errors * PRIVATE pointer to array of error msgs + APTR dl_TimeReq * PRIVATE pointer to timer request + APTR dl_UtilityBase * PRIVATE pointer to utility library base + APTR dl_IntuitionBase * PRIVATE pointer to intuition library base + LABEL dl_SIZEOF * DosLibrary + +* + + STRUCTURE RootNode,0 + BPTR rn_TaskArray * [0] is max number of CLI's +* * [1] is APTR to process id of CLI 1 +* * [n] is APTR to process id of CLI n + BPTR rn_ConsoleSegment * SegList for the CLI + STRUCT rn_Time,ds_SIZEOF * Current time + LONG rn_RestartSeg * SegList for the disk validator process + BPTR rn_Info * Pointer to the Info structure + BPTR rn_FileHandlerSegment * code for file handler + STRUCT rn_CliList,MLH_SIZE * new list of all CLI processes +* * the first cpl_Array is also rn_TaskArray + APTR rn_BootProc * private! ptr to msgport of boot fs + BPTR rn_ShellSegment * seglist for Shell (for NewShell) + LONG rn_Flags * dos flags + LABEL rn_SIZEOF * RootNode + + BITDEF RN,WILDSTAR,24 + BITDEF RN,PRIVATE1,1 + +* ONLY to be allocated by DOS! + STRUCTURE CliProcList,0 + STRUCT cpl_Node,MLN_SIZE + LONG cpl_First * number of first entry in array + APTR cpl_Array * pointer to array of process msgport pointers +* * [0] is max number of CLI's in this entry (n) +* * [1] is APTR to process id of CLI cpl_First +* * [n] is APTR to process id of CLI cpl_First+n-1 + LABEL cpl_SIZEOF + + STRUCTURE DosInfo,0 + BPTR di_McName * PRIVATE: system resident module list +di_ResList EQU di_McName + BPTR di_DevInfo * Device List + BPTR di_Devices * Currently zero + BPTR di_Handlers * Currently zero + APTR di_NetHand * Network handler processid currently zero + STRUCT di_DevLock,SS_SIZE * do NOT access directly! + STRUCT di_EntryLock,SS_SIZE * do NOT access directly! + STRUCT di_DeleteLock,SS_SIZE * do NOT access directly! + LABEL di_SIZEOF * DosInfo + +* structure for the Dos resident list. Do NOT allocate these, use +* AddSegment(), and heed the warnings in the autodocs! + + STRUCTURE Segment,0 + BPTR seg_Next + LONG seg_UC + BPTR seg_Seg + STRUCT seg_Name,4 ; Actually the first 4 chars of BSTR name + LABEL seg_SIZEOF + +CMD_SYSTEM EQU -1 +CMD_INTERNAL EQU -2 +CMD_DISABLED EQU -999 + + +* DOS Processes started from the CLI via RUN or NEWCLI have this additional +* set to data associated with them + + STRUCTURE CommandLineInterface,0 + LONG cli_Result2 * Value of IoErr from last command + BSTR cli_SetName * Name of current directory + BPTR cli_CommandDir * Head of the path locklist + LONG cli_ReturnCode * Return code from last command + BSTR cli_CommandName * Name of current command + LONG cli_FailLevel * Fail level (set by FAILAT) + BSTR cli_Prompt * Current prompt (set by PROMPT) + BPTR cli_StandardInput * Default (terminal) CLI input + BPTR cli_CurrentInput * Current CLI input + BSTR cli_CommandFile * Name of EXECUTE command file + LONG cli_Interactive * Boolean True if prompts required + LONG cli_Background * Boolean True if CLI created by RUN + BPTR cli_CurrentOutput * Current CLI output + LONG cli_DefaultStack * Stack size to be obtained in long words + BPTR cli_StandardOutput * Default (terminal) CLI output + BPTR cli_Module * SegList of currently loaded command + LABEL cli_SIZEOF * CommandLineInterface + +* This structure can take on different values depending on whether it is +* a device, an assigned directory, or a volume. Below is the structure +* reflecting volumes only. Following that is the structure representing +* only devices. Following that is the unioned structure representing all +* the values + +* structure representing a volume + + STRUCTURE DevList,0 + BPTR dl_Next ; bptr to next device list + LONG dl_Type ; see DLT below + APTR dl_Task ; ptr to handler task + BPTR dl_Lock ; not for volumes + STRUCT dl_VolumeDate,ds_SIZEOF ; creation date + BPTR dl_LockList ; outstanding locks + LONG dl_DiskType ; 'DOS', etc + LONG dl_unused + BSTR dl_Name ; bptr to bcpl name + LABEL DevList_SIZEOF + +* device structure (same as the DeviceNode structure in filehandler.i + + STRUCTURE DevInfo,0 + BPTR dvi_Next + LONG dvi_Type + APTR dvi_Task + BPTR dvi_Lock + BSTR dvi_Handler + LONG dvi_Stacksize + LONG dvi_Priority + LONG dvi_Startup + BPTR dvi_SegList + BPTR dvi_GlobVec + BSTR dvi_Name + LABEL dvi_SIZEOF + +* combined structure for devices, assigned directories, volumes + + STRUCTURE DosList,0 + BPTR dol_Next ; bptr to next device on lis + LONG dol_Type ; see DLT below + APTR dol_Task ; ptr to handler task + BPTR dol_Lock + + STRUCT dol_VolumeDate,0 ; creation date (UNION) + STRUCT dol_AssignName,0 ; name for assign path (UNION) + BSTR dol_Handler ; file name to load if seglist is null + STRUCT dol_List,0 ; List of directories assigned (UNION) + LONG dol_StackSize ; stacksize to use when starting process + LONG dol_Priority ; task priority when starting process + + STRUCT dol_LockList,0 ; outstanding locks (UNION) + ULONG dol_Startup ; startup msg: FileSysStartupMsg + ; for disks + + STRUCT dol_DiskType,0 ; 'DOS', etc (UNION) + BPTR dol_SegList ; already loaded code for new task + + BPTR dol_GlobVec ; BCPL global vector + + BSTR dol_Name ; bptr to bcpl name + LABEL DosList_SIZEOF + + + +* definitions for dl_Type +DLT_DEVICE EQU 0 +DLT_DIRECTORY EQU 1 ; assign +DLT_VOLUME EQU 2 +DLT_LATE EQU 3 ; late-binding assign +DLT_NONBINDING EQU 4 ; non-binding assign (AssignPath) +DLT_PRIVATE EQU -1 ; for internal use only + +* structure return by GetDeviceProc() + STRUCTURE DevProc,0 + APTR dvp_Port ; struct MsgPort * + BPTR dvp_Lock + ULONG dvp_Flags + APTR dvp_DevNode ; struct DosList * - DON'T TOUCH OR USE! + LABEL dvp_SIZEOF + +* definitions for dvp_Flags + BITDEF DVP,UNLOCK,0 + BITDEF DVP,ASSIGN,1 + +* Flags to be passed to LockDosList(), etc + BITDEF LD,DEVICES,2 + BITDEF LD,VOLUMES,3 + BITDEF LD,ASSIGNS,4 + BITDEF LD,ENTRY,5 + BITDEF LD,DELETE,6 + +* You MUST specify one of LDF_READ or LDF_WRITE + BITDEF LD,READ,0 + BITDEF LD,WRITE,1 + +* actually all but LDF_ENTRY (which is used for internal locking) +LDF_ALL EQU (LDF_DEVICES!LDF_VOLUMES!LDF_ASSIGNS) + +* a lock structure, as returned by Lock() or DupLock() + STRUCTURE FileLock,0 + BPTR fl_Link ; bcpl pointer to next lock + LONG fl_Key ; disk block number + LONG fl_Access ; exclusive or shared + APTR fl_Task ; handler task's port + BPTR fl_Volume ; bptr to DLT_VOLUME DosList entry + LABEL fl_SIZEOF + +* error report types for ErrorReport() +REPORT_STREAM EQU 0 ; a stream +REPORT_TASK EQU 1 ; a process - unused +REPORT_LOCK EQU 2 ; a lock +REPORT_VOLUME EQU 3 ; a volume node +REPORT_INSERT EQU 4 ; please insert volume + +* Special error codes for ErrorReport() +ABORT_DISK_ERROR EQU 296 ; Read/write error +ABORT_BUSY EQU 288 ; You MUST replace... + +* types for initial packets to shells from run/newcli/execute/system. +* For shell-writers only +RUN_EXECUTE EQU -1 +RUN_SYSTEM EQU -2 +RUN_SYSTEM_ASYNCH EQU -3 + +* Types for fib_DirEntryType. NOTE that both USERDIR and ROOT are +* directories, and that directory/file checks should use <0 and >=0. +* This is not necessarily exhaustive! Some handlers may use other +* values as needed, though <0 and >=0 should remain as supported as +* possible. +ST_ROOT EQU 1 +ST_USERDIR EQU 2 +ST_SOFTLINK EQU 3 ; looks like dir, but may point to a file! +ST_LINKDIR EQU 4 ; hard link to dir +ST_FILE EQU -3 ; must be negative for FIB! +ST_LINKFILE EQU -4 ; hard link to file +ST_PIPEFILE EQU -5 ; for pipes that support ExamineFH + + ENDC ; DOS_DOSEXTENS_I diff --git a/source/includes/dos/doshunks.i b/source/includes/dos/doshunks.i new file mode 100644 index 0000000..2af1949 --- /dev/null +++ b/source/includes/dos/doshunks.i @@ -0,0 +1,55 @@ + IFND DOS_DOSHUNKS_I +DOS_DOSHUNKS_I SET 1 +** +** $Filename: dos/doshunks.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.6 $ +** $Date: 91/02/10 $ +** +** Hunk definitions for object and load modules. +** +** (C) Copyright 1989-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + +* hunk types + +HUNK_UNIT EQU 999 +HUNK_NAME EQU 1000 +HUNK_CODE EQU 1001 +HUNK_DATA EQU 1002 +HUNK_BSS EQU 1003 +HUNK_RELOC32 EQU 1004 +HUNK_RELOC16 EQU 1005 +HUNK_RELOC8 EQU 1006 +HUNK_EXT EQU 1007 +HUNK_SYMBOL EQU 1008 +HUNK_DEBUG EQU 1009 +HUNK_END EQU 1010 +HUNK_HEADER EQU 1011 + +HUNK_OVERLAY EQU 1013 +HUNK_BREAK EQU 1014 + +HUNK_DREL32 EQU 1015 +HUNK_DREL16 EQU 1016 +HUNK_DREL8 EQU 1017 + +HUNK_LIB EQU 1018 +HUNK_INDEX EQU 1019 + +* hunk_ext sub-types + +EXT_SYMB EQU 0 ; symbol table +EXT_DEF EQU 1 ; relocatable definition +EXT_ABS EQU 2 ; Absolute definition +EXT_RES EQU 3 ; no longer supported +EXT_REF32 EQU 129 ; 32 bit reference to symbol +EXT_COMMON EQU 130 ; 32 bit reference to COMMON block +EXT_REF16 EQU 131 ; 16 bit reference to symbol +EXT_REF8 EQU 132 ; 8 bit reference to symbol +EXT_DEXT32 EQU 133 ; 32 bit data releative reference +EXT_DEXT16 EQU 134 ; 16 bit data releative reference +EXT_DEXT8 EQU 135 ; 8 bit data releative reference + + ENDC ; DOS_DOSHUNKS_I diff --git a/source/includes/exec/ables.i b/source/includes/exec/ables.i new file mode 100644 index 0000000..8cf7d16 --- /dev/null +++ b/source/includes/exec/ables.i @@ -0,0 +1,130 @@ + IFND EXEC_ABLES_I +EXEC_ABLES_I SET 1 +** +** $Filename: exec/ables.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.6 $ +** $Date: 90/05/10 $ +** +** Task switch and interrupt control macros +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_TYPES_I + INCLUDE "exec/types.i" + ENDC ; EXEC_TYPES_I + + IFND EXEC_EXECBASE_I + INCLUDE "exec/execbase.i" + ENDC ; EXEC_EXECBASE_I + + +*------------------------------------------------------------------------- +* +* Interrupt Exclusion Macros. Disable all tasks and interrupts. +* +*------------------------------------------------------------------------- + +INT_ABLES MACRO ; externals used by DISABLE and ENABLE + XREF _intena + ENDM + +;Disable interrupts. Avoid use of DISABLE if at all possible. +;Please realize the danger of this macro! Don't disable for long periods! +DISABLE MACRO ; [scratchReg],[NOFETCH] or have ExecBase in A6. + IFC '\1','' ;Case 1: Assume A6=ExecBase + MOVE.W #$04000,_intena ;(NOT IF_SETCLR)+IF_INTEN + ADDQ.B #1,IDNestCnt(A6) + MEXIT + ENDC + IFC '\2','NOFETCH' ;Case 2: Assume \1=ExecBase + MOVE.W #$04000,_intena + ADDQ.B #1,IDNestCnt(\1) + MEXIT + ENDC + IFNC '\1','' ;Case 3: Use \1 as scratch + MOVE.L 4,\1 ;Get ExecBase + MOVE.W #$04000,_intena + ADDQ.B #1,IDNestCnt(\1) + MEXIT + ENDC + ENDM + +;Enable interrupts. Please realize the danger of this macro! +ENABLE MACRO ; [scratchReg],[NOFETCH] or have ExecBase in A6. + IFC '\1','' ;Case 1: Assume A6=ExecBase + SUBQ.B #1,IDNestCnt(A6) + BGE.S ENABLE\@ + MOVE.W #$0C000,_intena ;IF_SETCLR+IF_INTEN +ENABLE\@: + MEXIT + ENDC + IFC '\2','NOFETCH' ;Case 2: Assume \1=ExecBase + SUBQ.B #1,IDNestCnt(\1) + BGE.S ENABLE\@ + MOVE.W #$0C000,_intena +ENABLE\@: + MEXIT + ENDC + IFNC '\1','' ;Case 3: Use \1 as scratch + MOVE.L 4,\1 ;Get ExecBase + SUBQ.B #1,IDNestCnt(\1) + BGE.S ENABLE\@ + MOVE.W #$0C000,_intena +ENABLE\@: + MEXIT + ENDC + ENDM + + +*------------------------------------------------------------------------- +* +* Tasking Exclusion Macros. Forbid all other tasks (but not interrupts) +* +*------------------------------------------------------------------------- + +TASK_ABLES MACRO ; externals used by FORBID and PERMIT + XREF _LVOPermit + ENDM + +;Prevent task switching (disables reschedule) +FORBID MACRO ; [scratchReg],[NOFETCH] or ExecBase in A6! + IFC '\1','' ;Case 1: Assume A6=ExecBase + ADDQ.B #1,TDNestCnt(A6) + MEXIT + ENDC + IFC '\2','NOFETCH' ;Case 2: Assume \1=ExecBase + ADDQ.B #1,TDNestCnt(\1) + MEXIT + ENDC + IFNC '\1','' ;Case 3: Use \1 as scratch + MOVE.L 4,\1 ;Get ExecBase + ADDQ.B #1,TDNestCnt(\1) + MEXIT + ENDC + ENDM + +;Enable task switching +PERMIT MACRO ; [saveFlag],[NOFETCH] or ExecBase in A6! + IFC '\1','' ;Case 1: Assume A6=ExecBase + JSR _LVOPermit(A6) + MEXIT + ENDC + IFC '\2','NOFETCH' ;Case 2: Assume \1=ExecBase + EXG.L A6,\1 ;put execbase in A6 + JSR _LVOPermit(A6) ;no registers touched. A6=ExecBase + EXG.L A6,\1 + MEXIT + ENDC + IFNC '\1','' ;Case 2: save/restore A6 + MOVE.L A6,-(SP) + MOVE.L 4,A6 + JSR _LVOPermit(A6) + MOVE.L (SP)+,A6 + MEXIT + ENDC + ENDM + + ENDC ; EXEC_ABLES_I diff --git a/source/includes/exec/alerts.i b/source/includes/exec/alerts.i new file mode 100644 index 0000000..1a663a3 --- /dev/null +++ b/source/includes/exec/alerts.i @@ -0,0 +1,294 @@ + IFND EXEC_ALERTS_I +EXEC_ALERTS_I SET 1 +** +** $Filename: exec/alerts.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.17 $ +** $Date: 91/01/12 $ +** +** Alert numbers, as displayed by system crashes. +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + +********************************************************************** +* +* Format of the alert error number: +* +* +---------------+----------------+--------------------------------+ +* |D| SubSysId | General Error | SubSystem Specific Error | +* +---------------+----------------+--------------------------------+ +* 1 7 bits 8 bits 16 bits +* +* D: DeadEnd alert +* SubSysId: indicates ROM subsystem number. +* General Error: roughly indicates what the error was +* Specific Error: indicates more detail +*********************************************************************** + +* +* Use this macro for causing an alert. It is very sensitive to memory +* corruption.... like stepping on location 4! After the alert, it +* will return. +* +* A0/A1 and D0/D1 are destroyed +* +* +ALERT MACRO (alertNumber, [paramArray]) + movem.l d7/a5/a6,-(sp) + move.l #\1,d7 + IFNC '\2','' + lea.l \2,a5 + ENDC + move.l 4,a6 + jsr _LVOAlert(a6) + movem.l (sp)+,d7/a5/a6 + ENDM +* +* Use this macro for dead end alerts that never return +* +DEADALERT MACRO (alertNumber, [paramArray]) + move.l #\1,d7 + IFNC '\2','' + lea.l \2,a5 + ENDC + move.l 4,a6 + jsr _LVOAlert(a6) ; never returns + ENDM + + +********************************************************************** +* +* General Alerts +* +* For example: timer.device cannot open math.library: +* +* ALERT (AN_TimerDev!AG_OpenLib!AO_MathLib) ;0x05038015 +* +********************************************************************** + +;------ alert types +AT_DeadEnd equ $80000000 +AT_Recovery equ $00000000 + +;------ general purpose alert codes +AG_NoMemory equ $00010000 +AG_MakeLib equ $00020000 +AG_OpenLib equ $00030000 +AG_OpenDev equ $00040000 +AG_OpenRes equ $00050000 +AG_IOError equ $00060000 +AG_NoSignal equ $00070000 +AG_BadParm equ $00080000 +AG_CloseLib equ $00090000 ;Usually too many closes +AG_CloseDev equ $000A0000 ;or a mismatched close +AG_ProcCreate equ $000B0000 ;Process creation failed + +;------ alert objects: +AO_ExecLib equ $00008001 +AO_GraphicsLib equ $00008002 +AO_LayersLib equ $00008003 +AO_Intuition equ $00008004 +AO_MathLib equ $00008005 +AO_DOSLib equ $00008007 +AO_RAMLib equ $00008008 +AO_IconLib equ $00008009 +AO_ExpansionLib equ $0000800A +AO_DiskfontLib equ $0000800B +AO_UtilityLib equ $0000800C + +AO_AudioDev equ $00008010 +AO_ConsoleDev equ $00008011 +AO_GamePortDev equ $00008012 +AO_KeyboardDev equ $00008013 +AO_TrackDiskDev equ $00008014 +AO_TimerDev equ $00008015 + +AO_CIARsrc equ $00008020 +AO_DiskRsrc equ $00008021 +AO_MiscRsrc equ $00008022 + +AO_BootStrap equ $00008030 +AO_Workbench equ $00008031 +AO_DiskCopy equ $00008032 +AO_GadTools equ $00008033 +AO_Unknown equ $00008035 + +********************************************************************** +* +* Specific Alerts: +* +* For example: exec.library -- corrupted memory list +* +* ALERT AN_MemCorrupt ;8100 0005 +* +********************************************************************** + +;------ exec.library +AN_ExecLib equ $01000000 +AN_ExcptVect equ $01000001 ; 68000 exception vector checksum (obs.) +AN_BaseChkSum equ $01000002 ; Execbase checksum bad (obs.) +AN_LibChkSum equ $01000003 ; Library checksum failure + +AN_MemCorrupt equ $81000005 ; Corrupt memory list detected in FreeMem +AN_IntrMem equ $81000006 ; No memory for interrupt servers +AN_InitAPtr equ $01000007 ; InitStruct() of an APTR source (obs.) +AN_SemCorrupt equ $01000008 ; A semaphore is in an illegal state + ; at RemSempahore() +AN_FreeTwice equ $01000009 ; Freeing memory that is already free +AN_BogusExcpt equ $8100000A ; Illegal 68k exception taken (obs.) +AN_IOUsedTwice equ $0100000B ; Attempt to reuse active IORequest +AN_MemoryInsane equ $0100000C ; Sanity check on memory list failed + ; during AvailMem(MEMF_LARGEST) +AN_IOAfterClose equ $0100000D ; IO attempted on closed IORequest +AN_StackProbe equ $0100000E ; Stack appears to extend out of range +AN_BadFreeAddr equ $0100000F ; Memory header not located. [ Usually an + ; invalid address passed to FreeMem() ] + +;------ graphics.library +AN_GraphicsLib equ $02000000 +AN_GfxNoMem equ $82010000 ; graphics out of memory +AN_GfxNoMemMspc equ $82010001 ; MonitorSpec alloc, no memory +AN_LongFrame equ $82010006 ; long frame, no memory +AN_ShortFrame equ $82010007 ; short frame, no memory +AN_TextTmpRas equ $02010009 ; text, no memory for TmpRas +AN_BltBitMap equ $8201000A ; BltBitMap, no memory +AN_RegionMemory equ $8201000B ; regions, memory not available +AN_MakeVPort equ $82010030 ; MakeVPort, no memory +AN_GfxNewError equ $0200000C +AN_GfxFreeError equ $0200000D + +AN_GfxNoLCM equ $82011234 ; emergency memory not available + +AN_ObsoleteFont equ $02000401 ; unsupported font description used + +;------ layers.library +AN_LayersLib equ $03000000 +AN_LayersNoMem equ $83010000 ; layers out of memory + +;------ intuition.library +AN_Intuition equ $04000000 +AN_GadgetType equ $84000001 ; unknown gadget type +AN_BadGadget equ $04000001 ; Recovery form of AN_GadgetType +AN_CreatePort equ $84010002 ; create port, no memory +AN_ItemAlloc equ $04010003 ; item plane alloc, no memory +AN_SubAlloc equ $04010004 ; sub alloc, no memory +AN_PlaneAlloc equ $84010005 ; plane alloc, no memory +AN_ItemBoxTop equ $84000006 ; item box top < RelZero +AN_OpenScreen equ $84010007 ; open screen, no memory +AN_OpenScrnRast equ $84010008 ; open screen, raster alloc, no memory +AN_SysScrnType equ $84000009 ; open sys screen, unknown type +AN_AddSWGadget equ $8401000A ; add SW gadgets, no memory +AN_OpenWindow equ $8401000B ; open window, no memory +AN_BadState equ $8400000C ; Bad State Return entering Intuition +AN_BadMessage equ $8400000D ; Bad Message received by IDCMP +AN_WeirdEcho equ $8400000E ; Weird echo causing incomprehension +AN_NoConsole equ $8400000F ; couldn't open the Console Device + +;------ math.library +AN_MathLib equ $05000000 + +;------ dos.library +AN_DOSLib equ $07000000 +AN_StartMem equ $07010001 ; no memory at startup +AN_EndTask equ $07000002 ; EndTask didn't +AN_QPktFail equ $07000003 ; Qpkt failure +AN_AsyncPkt equ $07000004 ; Unexpected packet received +AN_FreeVec equ $07000005 ; Freevec failed +AN_DiskBlkSeq equ $07000006 ; Disk block sequence error +AN_BitMap equ $07000007 ; Bitmap corrupt +AN_KeyFree equ $07000008 ; Key already free +AN_BadChkSum equ $07000009 ; Invalid checksum +AN_DiskError equ $0700000A ; Disk Error +AN_KeyRange equ $0700000B ; Key out of range +AN_BadOverlay equ $0700000C ; Bad overlay +AN_BadInitFunc equ $0700000D ; Invalid init packet for cli/shell +AN_FileReclosed equ $0700000E ; A filehandle was closed more than once + +;------ ramlib.library +AN_RAMLib equ $08000000 +AN_BadSegList equ $08000001 ; overlays are illegal for library segments + +;------ icon.library +AN_IconLib equ $09000000 + +;------ expansion.library +AN_ExpansionLib equ $0A000000 +AN_BadExpansionFree equ $0A000001 ;Freeed free region + +;------ diskfont.library +AN_DiskfontLib equ $0B000000 + +;------ audio.device +AN_AudioDev equ $10000000 + +;------ console.device +AN_ConsoleDev equ $11000000 +AN_NoWindow equ $11000001 ; Console can't open initial window + +;------ gameport.device +AN_GamePortDev equ $12000000 + +;------ keyboard.device +AN_KeyboardDev equ $13000000 + +;------ trackdisk.device +AN_TrackDiskDev equ $14000000 +AN_TDCalibSeek equ $14000001 ; calibrate: seek error +AN_TDDelay equ $14000002 ; delay: error on timer wait + +;------ timer.device +AN_TimerDev equ $15000000 +AN_TMBadReq equ $15000001 ; bad request +AN_TMBadSupply equ $15000002 ; power supply -- no 50/60hz ticks + +;------ cia.resource +AN_CIARsrc equ $20000000 + +;------ disk.resource +AN_DiskRsrc equ $21000000 +AN_DRHasDisk equ $21000001 ; get unit: already has disk +AN_DRIntNoAct equ $21000002 ; interrupt: no active unit + +;------ misc.resource +AN_MiscRsrc equ $22000000 + +;------ bootstrap +AN_BootStrap equ $30000000 +AN_BootError equ $30000001 ; boot code returned an error + +;------ workbench +AN_Workbench equ $31000000 +AN_NoFonts equ $B1000001 +AN_WBBadStartupMsg1 equ $31000001 +AN_WBBadStartupMsg2 equ $31000002 +AN_WBBadIOMsg equ $31000003 + +AN_WBInitPotionAllocDrawer equ $B1010004 +AN_WBCreateWBMenusCreateMenus1 equ $B1010005 +AN_WBCreateWBMenusCreateMenus2 equ $B1010006 +AN_WBLayoutWBMenusLayoutMenus equ $B1010007 +AN_WBAddToolMenuItem equ $B1010008 +AN_WBReLayoutToolMenu equ $B1010009 +AN_WBinitTimer equ $B101000A +AN_WBInitLayerDemon equ $B101000B +AN_WBinitWbGels equ $B101000C +AN_WBInitScreenAndWindows1 equ $B101000D +AN_WBInitScreenAndWindows2 equ $B101000E +AN_WBInitScreenAndWindows3 equ $B101000F +AN_WBMAlloc equ $B1010010 + +;------ DiskCopy +AN_DiskCopy equ $32000000 + +;------ toolkit for Intuition +AN_GadTools equ $33000000 + +;------ System utility library +AN_UtilityLib equ $34000000 + +;------ For use by any application that needs it +AN_Unknown equ $35000000 + + ENDC ;EXEC_ALERTS_I diff --git a/source/includes/exec/execbase.i b/source/includes/exec/execbase.i new file mode 100644 index 0000000..e6814ed --- /dev/null +++ b/source/includes/exec/execbase.i @@ -0,0 +1,219 @@ + IFND EXEC_EXECBASE_I +EXEC_EXECBASE_I SET 1 +** +** $VER: execbase.i 39.3 (31.07.92) +** Includes Release 39.108 +** +** Definition of the exec.library base structure. +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_TYPES_I + INCLUDE "exec/types.i" + ENDC ; EXEC_TYPES_I + + IFND EXEC_LISTS_I + INCLUDE "exec/lists.i" + ENDC ; EXEC_LISTS_I + + IFND EXEC_INTERRUPTS_I + INCLUDE "exec/interrupts.i" + ENDC ; EXEC_INTERRUPTS_I + + IFND EXEC_LIBRARIES_I + INCLUDE "exec/libraries.i" + ENDC ; EXEC_LIBRARIES_I + + + +** Definition of the Exec library base structure (pointed to by location 4). +** Most fields are not to be viewed or modified by user programs. Use +** extreme caution. +** + STRUCTURE ExecBase,LIB_SIZE ; Standard library node + +******* Static System Variables ********************************************* + + UWORD SoftVer ; kickstart release number (obs.) + WORD LowMemChkSum ; checksum of 68000 trap vectors + ULONG ChkBase ; system base pointer complement + APTR ColdCapture ; coldstart soft capture vector + APTR CoolCapture ; coolstart soft capture vector + APTR WarmCapture ; warmstart soft capture vector + APTR SysStkUpper ; system stack base (upper bound) + APTR SysStkLower ; top of system stack (lower bound) + ULONG MaxLocMem ; top of chip memory + APTR DebugEntry ; global debugger entry point + APTR DebugData ; global debugger data segment + APTR AlertData ; alert data segment + APTR MaxExtMem ; top of extended mem, or null if none + + WORD ChkSum ; for all of the above (minus 2) + + +******* Interrupt Related ******************************************** + + LABEL IntVects + STRUCT IVTBE,IV_SIZE + STRUCT IVDSKBLK,IV_SIZE + STRUCT IVSOFTINT,IV_SIZE + STRUCT IVPORTS,IV_SIZE + STRUCT IVCOPER,IV_SIZE + STRUCT IVVERTB,IV_SIZE + STRUCT IVBLIT,IV_SIZE + STRUCT IVAUD0,IV_SIZE + STRUCT IVAUD1,IV_SIZE + STRUCT IVAUD2,IV_SIZE + STRUCT IVAUD3,IV_SIZE + STRUCT IVRBF,IV_SIZE + STRUCT IVDSKSYNC,IV_SIZE + STRUCT IVEXTER,IV_SIZE + STRUCT IVINTEN,IV_SIZE + STRUCT IVNMI,IV_SIZE + + +******* Dynamic System Variables ************************************* + + APTR ThisTask ; pointer to current task (readable) + + ULONG IdleCount ; idle counter + ULONG DispCount ; dispatch counter + UWORD Quantum ; time slice quantum + UWORD Elapsed ; current quantum ticks + UWORD SysFlags ; misc internal system flags + BYTE IDNestCnt ; interrupt disable nesting count + BYTE TDNestCnt ; task disable nesting count + + UWORD AttnFlags ; special attention flags (readable) + + UWORD AttnResched ; rescheduling attention + APTR ResModules ; pointer to resident module array + APTR TaskTrapCode ; default task trap routine + APTR TaskExceptCode ; default task exception code + APTR TaskExitCode ; default task exit code + ULONG TaskSigAlloc ; preallocated signal mask + UWORD TaskTrapAlloc ; preallocated trap mask + + +******* System List Headers (private!) ******************************** + + STRUCT MemList,LH_SIZE + STRUCT ResourceList,LH_SIZE + STRUCT DeviceList,LH_SIZE + STRUCT IntrList,LH_SIZE + STRUCT LibList,LH_SIZE + STRUCT PortList,LH_SIZE + STRUCT TaskReady,LH_SIZE + STRUCT TaskWait,LH_SIZE + + STRUCT SoftInts,SH_SIZE*5 + + +******* Other Globals ****************************************************** + + STRUCT LastAlert,4*4 + + ;------ these next two variables are provided to allow + ;------ system developers to have a rough idea of the + ;------ period of two externally controlled signals -- + ;------ the time between vertical blank interrupts and the + ;------ external line rate (which is counted by CIA A's + ;------ "time of day" clock). In general these values + ;------ will be 50 or 60, and may or may not track each + ;------ other. These values replace the obsolete AFB_PAL + ;------ and AFB_50HZ flags. + UBYTE VBlankFrequency ;(readable) + UBYTE PowerSupplyFrequency ;(readable) + + STRUCT SemaphoreList,LH_SIZE + + ;------ these next two are to be able to kickstart into user ram. + ;------ KickMemPtr holds a singly linked list of MemLists which + ;------ will be removed from the memory list via AllocAbs. If + ;------ all the AllocAbs's succeeded, then the KickTagPtr will + ;------ be added to the rom tag list. + APTR KickMemPtr ; ptr to queue of mem lists + APTR KickTagPtr ; ptr to rom tag queue + APTR KickCheckSum ; checksum for mem and tags + + +******* V36 Exec additions start here *************************************** + + UWORD ex_Pad0 ; Private internal use + ULONG ex_LaunchPoint ; Private to Launch/Switch + APTR ex_RamLibPrivate + ;* The next ULONG contains the system "E" clock frequency, + ;* expressed in Hertz. The E clock is used as a timebase for + ;* the Amiga's 8520 I/O chips. (E is connected to "02"). + ;* Typical values are 715909 for NTSC, or 709379 for PAL. + ;* + ULONG ex_EClockFrequency ;(readable) + ULONG ex_CacheControl ;Private to the CacheControl call + ULONG ex_TaskID ;Next available task ID + + STRUCT ex_Reserved1,5*4 + + APTR ex_MMULock ;Private + + STRUCT ex_Reserved2,3*4 + +******* V39 Exec additions start here *************************************** + + ;* The following list and data element are used for + ;* V39 exec's low memory handler. + STRUCT ex_MemHandlers,MLH_SIZE ;* List of handlers + APTR ex_MemHandler ;* Handler pointer (PRIVATE!) + + LABEL SYSBASESIZE + + +******* Bit defines for AttnFlags (see above) ******************************* + +* Processors and Co-processors: + BITDEF AF,68010,0 ; also set for 68020 + BITDEF AF,68020,1 ; also set for 68030 + BITDEF AF,68030,2 ; also set for 68040 + BITDEF AF,68040,3 + BITDEF AF,68881,4 ; also set for 68882 + BITDEF AF,68882,5 + BITDEF AF,FPU40,6 ; Set if 68040 FPU +; +; The AFB_FPU40 bit is set when a working 68040 FPU +; is in the system. If this bit is set and both the +; AFB_68881 and AFB_68882 bits are not set, then the 68040 +; math emulation code has not been loaded and only 68040 +; FPU instructions are available. This bit is valid *ONLY* +; if the AFB_68040 bit is set. +; +; BITDEF AF,RESERVED8,8 +; BITDEF AF,RESERVED9,9 + BITDEF AF,PRIVATE,15 ; Just what it says + + +******* Selected bit definitions for Cache manipulation calls ************** + + BITDEF CACR,EnableI,0 ;Enable instruction cache + BITDEF CACR,FreezeI,1 ;Freeze instruction cache + BITDEF CACR,ClearI,3 ;Clear instruction cache + BITDEF CACR,IBE,4 ;Instruction burst enable + BITDEF CACR,EnableD,8 ;68030 Enable data cache + BITDEF CACR,FreezeD,9 ;68030 Freeze data cache + BITDEF CACR,ClearD,11 ;68030 Clear data cache + BITDEF CACR,DBE,12 ;68030 Data burst enable + BITDEF CACR,WriteAllocate,13 ;68030 Write-Allocate mode (must + ;always be set) + BITDEF CACR,EnableE,30 ;Master enable for external caches + ;External caches should track the + ;state of the internal caches + ;such that they do not cache anything + ;that the internal cache turned off + ;for. + BITDEF CACR,CopyBack,31 ;Master enable for copyback caches + + + BITDEF DMA,Continue,1 ;Continuation flag for CachePreDMA + BITDEF DMA,NoModify,2 ;Set if DMA does not update memory + + ENDC ; EXEC_EXECBASE_I diff --git a/source/includes/exec/interrupts.i b/source/includes/exec/interrupts.i new file mode 100644 index 0000000..3322f5b --- /dev/null +++ b/source/includes/exec/interrupts.i @@ -0,0 +1,70 @@ + IFND EXEC_INTERRUPTS_I +EXEC_INTERRUPTS_I SET 1 +** +** $VER: interrupts.i 39.0 (15.10.91) +** Includes Release 39.108 +** +** Callback structures used by hardware & software interrupts +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_NODES_I + INCLUDE "exec/nodes.i" + ENDC ; EXEC_NODES_I + + IFND EXEC_LISTS_I + INCLUDE "exec/lists.i" + ENDC ; EXEC_LISTS_I + + +*---------------------------------------------------------------- +* +* Interrupt Structure +* +*---------------------------------------------------------------- + + STRUCTURE IS,LN_SIZE + APTR IS_DATA + APTR IS_CODE + LABEL IS_SIZE + + +*--------------------------------------------------------------------- +* +* Exec Internal Interrupt Vectors +* +*--------------------------------------------------------------------- + + STRUCTURE IV,0 + APTR IV_DATA + APTR IV_CODE + APTR IV_NODE + LABEL IV_SIZE + + +*------ System Flag bits (in SysBase.SysFlags ) + + BITDEF S,SAR,15 ; scheduling attention required (TOP BIT) + BITDEF S,TQE,14 ; time quantum expended -- time to resched + BITDEF S,SINT,13 + + +*--------------------------------------------------------------------- +* +* Software Interrupt List Headers +* +*--------------------------------------------------------------------- + + STRUCTURE SH,LH_SIZE + UWORD SH_PAD + LABEL SH_SIZE + +SIH_PRIMASK EQU $0F0 +SIH_QUEUES EQU 5 + +** this is a fake INT definition, used only for AddIntServer and the like + BITDEF INT,NMI,15 + + ENDC ; EXEC_INTERRUPTS_I diff --git a/source/includes/exec/io.i b/source/includes/exec/io.i new file mode 100644 index 0000000..106d9a9 --- /dev/null +++ b/source/includes/exec/io.i @@ -0,0 +1,123 @@ + IFND EXEC_IO_I +EXEC_IO_I SET 1 +** +** $Filename: exec/io.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.4 $ +** $Date: 90/05/10 $ +** +** Message structures used for device communication +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_PORTS_I + INCLUDE "exec/ports.i" + ENDC ; EXEC_PORTS_I + + IFND EXEC_LIBRARIES_I + INCLUDE "exec/libraries.i" + ENDC ; EXEC_LIBRARIES_I + + +;---------------------------------------------------------------- +; +; IO Request Structures +; +;---------------------------------------------------------------- + +;------ Required portion of IO request: + + STRUCTURE IO,MN_SIZE + APTR IO_DEVICE ; device node pointer + APTR IO_UNIT ; unit (driver private) + UWORD IO_COMMAND ; device command + UBYTE IO_FLAGS ; special flags + BYTE IO_ERROR ; error or warning code + LABEL IO_SIZE + + +;------ Standard IO request extension: + + ULONG IO_ACTUAL ; actual # of bytes transfered + ULONG IO_LENGTH ; requested # of bytes transfered + APTR IO_DATA ; pointer to data area + ULONG IO_OFFSET ; offset for seeking devices + LABEL IOSTD_SIZE + + +;------ IO_FLAGS bit definitions: + + BITDEF IO,QUICK,0 ; complete IO quickly + + +;---------------------------------------------------------------- +; +; Standard Device Library Functions +; +;---------------------------------------------------------------- + + LIBINIT + + LIBDEF DEV_BEGINIO ; process IO request + LIBDEF DEV_ABORTIO ; abort IO request + + +;---------------------------------------------------------------- +; +; IO Function Macros +; +;---------------------------------------------------------------- + +BEGINIO MACRO + LINKLIB DEV_BEGINIO,IO_DEVICE(A1) + ENDM + +ABORTIO MACRO + LINKLIB DEV_ABORTIO,IO_DEVICE(A1) + ENDM + + +;---------------------------------------------------------------- +; +; Standard Device Command Definitions +; +;---------------------------------------------------------------- + +;------ Command definition macro: +DEVINIT MACRO ; [baseOffset] + IFC '\1','' +CMD_COUNT SET CMD_NONSTD + ENDC + IFNC '\1','' +CMD_COUNT SET \1 + ENDC + ENDM + +DEVCMD MACRO ; cmdname +\1 EQU CMD_COUNT +CMD_COUNT SET CMD_COUNT+1 + ENDM + + +;------ Standard device commands: + + DEVINIT 0 + + DEVCMD CMD_INVALID ; invalid command + DEVCMD CMD_RESET ; reset as if just inited + DEVCMD CMD_READ ; standard read + DEVCMD CMD_WRITE ; standard write + DEVCMD CMD_UPDATE ; write out all buffers + DEVCMD CMD_CLEAR ; clear all buffers + DEVCMD CMD_STOP ; hold current and queued + DEVCMD CMD_START ; restart after stop + DEVCMD CMD_FLUSH ; abort entire queue + + +;------ First non-standard device command value: + + DEVCMD CMD_NONSTD + + ENDC ; EXEC_IO_I diff --git a/source/includes/exec/libraries.i b/source/includes/exec/libraries.i new file mode 100644 index 0000000..21b518f --- /dev/null +++ b/source/includes/exec/libraries.i @@ -0,0 +1,128 @@ + IFND EXEC_LIBRARIES_I +EXEC_LIBRARIES_I SET 1 +** +** $VER: libraries.i 39.2 (10.04.92) +** Includes Release 39.108 +** +** Definitions for use when creating or using Exec libraries +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_NODES_I + INCLUDE "exec/nodes.i" + ENDC ; EXEC_NODES_I + + +*------ Special Constants --------------------------------------- +LIB_VECTSIZE EQU 6 ;Each library entry takes 6 bytes +LIB_RESERVED EQU 4 ;Exec reserves the first 4 vectors +LIB_BASE EQU -LIB_VECTSIZE +LIB_USERDEF EQU LIB_BASE-(LIB_RESERVED*LIB_VECTSIZE) ;First user func +LIB_NONSTD EQU LIB_USERDEF + + +*---------------------------------------------------------------- +* +* Library Definition Macros (for creating libraries) +* +*---------------------------------------------------------------- + +*------ LIBINIT initializes the base offset for using the "LIBDEF" macro: +LIBINIT MACRO ; [baseOffset] + IFC '\1','' +COUNT_LIB SET LIB_USERDEF + ENDC + IFNC '\1','' +COUNT_LIB SET \1 + ENDC + ENDM + +*------ LIBDEF is used to define each library function entry: +LIBDEF MACRO ;libraryFunctionSymbol +\1 EQU COUNT_LIB +COUNT_LIB SET COUNT_LIB-LIB_VECTSIZE + ENDM + +*------ FUNCDEF is used to parse library offset tables. Many applications +*------ need a special version of FUNCDEF - you provide your own macro +*------ to match your needs. Here is an example: +* +* FUNCDEF MACRO +* _LVO\1 EQU FUNC_CNT +* FUNC_CNT SET FUNC_CNT-6 * Standard offset-6 bytes each +* FUNC_CNT EQU LIB_USERDEF * Skip 4 standard vectors +* ENDM + +*---------------------------------------------------------------- +* +* Standard Library Functions +* +*---------------------------------------------------------------- + + LIBINIT LIB_BASE + + LIBDEF LIB_OPEN + LIBDEF LIB_CLOSE + LIBDEF LIB_EXPUNGE ; must exist in all libraries + LIBDEF LIB_EXTFUNC ; for future expansion - must return zero. + + +*---------------------------------------------------------------- +* +* Library Base Structure Definition +* Also used for Devices and some Resources +* +*---------------------------------------------------------------- + + STRUCTURE LIB,LN_SIZE + UBYTE LIB_FLAGS ; see below + UBYTE LIB_pad ; must be zero + UWORD LIB_NEGSIZE ; number of bytes before LIB + UWORD LIB_POSSIZE ; number of bytes after LIB + UWORD LIB_VERSION ; major + UWORD LIB_REVISION ; minor + APTR LIB_IDSTRING ; ASCII identification + ULONG LIB_SUM ; the system-calculated checksum + UWORD LIB_OPENCNT ; number of current opens + LABEL LIB_SIZE ;Warning: Size is not a longword multiple! + +*------ LIB_FLAGS bit definitions (all others are system reserved) + BITDEF LIB,SUMMING,0 ; system is currently checksumming + BITDEF LIB,CHANGED,1 ; something has changed the library since last sum + BITDEF LIB,SUMUSED,2 ; indicates if the library allows checksumming + BITDEF LIB,DELEXP,3 ; delayed expunge flag (for use by library) + BITDEF LIB,EXP0CNT,4 ; special system expunge flag. + + +*--------------------------------------------------------------------------- +* +* Function Invocation Macros (for calling existing, opened, libraries) +* Also see exec/macros.i +* +*--------------------------------------------------------------------------- + +*------ CALLLIB for calling functions where A6 is already correct: + +CALLLIB MACRO ; functionOffset + IFGT NARG-1 + FAIL !!! CALLLIB MACRO - too many arguments !!! + ENDC + JSR \1(A6) + ENDM + + +*------ LINKLIB for calling functions where A6 is incorrect: + +LINKLIB MACRO ; functionOffset,libraryBase + IFGT NARG-2 + FAIL !!! LINKLIB MACRO - too many arguments !!! + ENDC + MOVE.L A6,-(SP) + MOVE.L \2,A6 + JSR \1(A6) + MOVE.L (SP)+,A6 + ENDM + + ENDC ; EXEC_LIBRARIES_I diff --git a/source/includes/exec/lists.i b/source/includes/exec/lists.i new file mode 100644 index 0000000..4a8ad5d --- /dev/null +++ b/source/includes/exec/lists.i @@ -0,0 +1,172 @@ + IFND EXEC_LISTS_I +EXEC_LISTS_I SET 1 +** +** $VER: lists.i 39.1 (28.05.92) +** Includes Release 39.108 +** +** Definitions and macros for use with Exec lists. Most of the +** macros require ownership or locking of the list before use. +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_NODES_I + INCLUDE "exec/nodes.i" + ENDC ; EXEC_NODES_I + + +*--------------------------------------------------------------------- + +* +* Full featured list header +* + STRUCTURE LH,0 + APTR LH_HEAD + APTR LH_TAIL + APTR LH_TAILPRED + UBYTE LH_TYPE + UBYTE LH_pad + LABEL LH_SIZE ;word aligned + +* +* Minimal List Header - no type checking (best for most applications) +* + STRUCTURE MLH,0 + APTR MLH_HEAD + APTR MLH_TAIL + APTR MLH_TAILPRED + LABEL MLH_SIZE ;longword aligned + +*--------------------------------------------------------------------- + +;Prepare a list header for use +NEWLIST MACRO ; list + MOVE.L \1,LH_TAILPRED(\1) + ADDQ.L #4,\1 ;Get address of LH_TAIL + CLR.L (\1) ;Clear LH_TAIL + MOVE.L \1,-(\1) ;Address of LH_TAIL to LH_HEAD + ENDM + +;Test if list is empty (list address in register) +;This operation is safe at any time - no list arbitration needed. +TSTLIST MACRO ; [list] + IFGT NARG-1 + FAIL !!! TSTLIST - Too many arguments !!! + ENDC + IFC '\1','' + CMP.L LH_TAIL+LN_PRED(A0),A0 + ENDC + IFNC '\1','' + CMP.L LH_TAIL+LN_PRED(\1),\1 + ENDC + ENDM + +;Test if list is empty (from effective address of list) +;list arbitration required. +TSTLST2 MACRO ;EA of list,=node + MOVE.L \1,\2 + TST.L (\2) + ENDM + +;Get next in list +SUCC MACRO ; node,=succ + MOVE.L (\1),\2 + ENDM + +;Get previous in list +PRED MACRO ; node,=pred + MOVE.L LN_PRED(\1),\2 + ENDM + +;If empty, branch +IFEMPTY MACRO ; list,label + CMP.L LH_TAIL+LN_PRED(\1),\1 + BEQ \2 + ENDM + +;If not empty, branch +IFNOTEMPTY MACRO ; list,label + CMP.L LH_TAIL+LN_PRED(\1),\1 + BNE \2 + ENDM + +;Get next node, test if at end +TSTNODE MACRO ; node,=next + MOVE.L (\1),\2 + TST.L (\2) + ENDM + +;Get next, go to exit label if at end +NEXTNODE MACRO ; next=next,=current,exit_label ([.s],DX,AX,DISP16) + MOVE.L \1,\2 + MOVE.L (\2),\1 + IFC '\0','' ;Check extension + BEQ \3 + ENDC + IFNC '\0','' + BEQ.S \3 + ENDC + ENDM + +;Add to head of list +ADDHEAD MACRO ; A0-list(destroyed) A1-node D0-(destroyed) + MOVE.L (A0),D0 + MOVE.L A1,(A0) + MOVEM.L D0/A0,(A1) + MOVE.L D0,A0 + MOVE.L A1,LN_PRED(A0) + ENDM + +;Add to tail of list +ADDTAIL MACRO ; A0-list(destroyed) A1-node D0-(destroyed) + ADDQ.L #LH_TAIL,A0 + MOVE.L LN_PRED(A0),D0 + MOVE.L A1,LN_PRED(A0) + EXG D0,A0 + MOVEM.L D0/A0,(A1) + MOVE.L A1,(A0) + ENDM + +;Remove node from whatever list it is in +REMOVE MACRO ; A0-(destroyed) A1-node(destroyed) + MOVE.L (A1)+,A0 + MOVE.L (A1),A1 ; LN_PRED + MOVE.L A0,(A1) + MOVE.L A1,LN_PRED(A0) + ENDM + +;Remove node from head of list +REMHEAD MACRO ; A0-list A1-(destroyed) D0=node + MOVE.L (A0),A1 + MOVE.L (A1),D0 + BEQ.S REMHEAD\@ + MOVE.L D0,(A0) + EXG.L D0,A1 + MOVE.L A0,LN_PRED(A1) +REMHEAD\@ + ENDM + +;Remove head quickly +; Useful when a scratch register is available, and +; list is known to contain at least one node. +REMHEADQ MACRO ; list,=node,scratchReg-(destroyed) + MOVE.L (\1),\2 + MOVE.L (\2),\3 + MOVE.L \3,(\1) + MOVE.L \1,LN_PRED(\3) + ENDM + +;Remove node from tail of list +REMTAIL MACRO ; A0-list A1-(destroyed) D0=node + MOVE.L LH_TAIL+LN_PRED(A0),A1 + MOVE.L LN_PRED(A1),D0 + BEQ.S REMTAIL\@ + MOVE.L D0,LH_TAIL+LN_PRED(A0) + EXG.L D0,A1 + MOVE.L A0,(A1) + ADDQ.L #4,(A1) +REMTAIL\@ + ENDM + + ENDC ; EXEC_LISTS_I diff --git a/source/includes/exec/macros.i b/source/includes/exec/macros.i new file mode 100644 index 0000000..83e25d5 --- /dev/null +++ b/source/includes/exec/macros.i @@ -0,0 +1,256 @@ + IFND EXEC_MACROS_I +EXEC_MACROS_I SET 1 +** +** $Filename: exec/macros.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.8 $ +** $Date: 90/11/01 $ +** +** Handy macros for assembly language programmers. +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 0 ;Detail level of debugging. Zero for none. + ENDC + + +CALL MACRO + jsr _LVO\1(a6) + ENDM + +JSRLIB MACRO ;FunctionName + XREF _LVO\1 + jsr _LVO\1(a6) + ENDM + +JMPLIB MACRO ;FunctionName + XREF _LVO\1 + jmp _LVO\1(a6) + ENDM + +BSRSELF MACRO + XREF \1 + bsr \1 + ENDM + +BRASELF MACRO + XREF \1 + bra \1 + ENDM + +BLINK MACRO + IFNE DEBUG_DETAIL + bchg.b #1,$bfe001 ;Toggle the power LED + ENDC + ENDM + +WAITCLICK MACRO +.waitmc\@ + btst #6,$bfe001 + bne.s .waitmc\@ +.waitmr\@ + btst #6,$bfe001 + beq.s .waitmr\@ + ENDM + +WAITIFCLICK MACRO +.waitmr\@ + btst #6,$bfe001 + beq.s .waitmr\@ + ENDM + +TRIGGER MACRO ; Trigger a hardware state analyzer + IFGE DEBUG_DETAIL-\1 + move.w #$5555,$2fe + ENDC + ENDM + +CLEAR MACRO + moveq.l #0,\1 + ENDM + +CLEARA MACRO + suba.l \1,\1 ;Quick way to put zero in an address register + ENDM + +************************************************************************* + IFND PRINTF +PRINTF MACRO ; level,,... + IFGE DEBUG_DETAIL-\1 + XREF kprint_macro +PUSHCOUNT SET 0 + + IFNC '\9','' + move.l \9,-(sp) +PUSHCOUNT SET PUSHCOUNT+4 + ENDC + + IFNC '\8','' + move.l \8,-(sp) +PUSHCOUNT SET PUSHCOUNT+4 + ENDC + + IFNC '\7','' + move.l \7,-(sp) +PUSHCOUNT SET PUSHCOUNT+4 + ENDC + + IFNC '\6','' + move.l \6,-(sp) +PUSHCOUNT SET PUSHCOUNT+4 + ENDC + + IFNC '\5','' + move.l \5,-(sp) +PUSHCOUNT SET PUSHCOUNT+4 + ENDC + + IFNC '\4','' + move.l \4,-(sp) +PUSHCOUNT SET PUSHCOUNT+4 + ENDC + + IFNC '\3','' + move.l \3,-(sp) +PUSHCOUNT SET PUSHCOUNT+4 + ENDC + + movem.l a0/a1,-(sp) + lea.l PSS\@(pc),A0 + lea.l 4*2(SP),A1 + BSR kprint_macro + movem.l (sp)+,a0/a1 + bra.s PSE\@ + +PSS\@ dc.b \2 + IFEQ (\1&1) ;If even, add CR/LF par... + dc.b 13,10 + ENDC + dc.b 0 + ds.w 0 +PSE\@ + lea.l PUSHCOUNT(sp),sp + ENDC ;IFGE DEBUG_DETAIL-\1 + ENDM ;PRINTF MACRO + ENDC ;IFND PRINTF + +PUTMSG MACRO + IFGE DEBUG_DETAIL-\1 + + IFNC '\3','' + move.l \3,$BFFF00 + ENDC + + IFNC '\4','' + move.l \4,$BFFF00 + ENDC + + IFNC '\5','' + move.l \5,$BFFF00 + ENDC + + IFNC '\6','' + move.l \6,$BFFF00 + ENDC + + IFNC '\7','' + move.l \7,$BFFF00 + ENDC + + IFNC '\8','' + move.l \8,$BFFF00 + ENDC + + IFNC '\9','' + move.l \9,$BFFF00 + ENDC + + IFNC '\a','' + move.l \a,$BFFF00 + ENDC + + IFNC '\b','' + move.l \b,$BFFF00 + ENDC + + IFNC '\c','' + move.l \c,$BFFF00 + ENDC + + pea .PSS\@(pc) + move.l (sp)+,$BFFF04 + bra.s .PSE\@ + +.PSS\@ + dc.b \2 + IFEQ (\1&1) ;If even, add CR/LF par... + dc.b 10 + ENDC + dc.b 0 + even + +.PSE\@ + ENDC ;IFGE DEBUG_DETAIL-\1 + ENDM ;PRINTF MACRO + + IFNE 0 +;---------------------------------------------------------------------------- +;Push a set of registers onto the stack - undo with POPM. This prevents +;the need to update or synchronize two MOVEM instructions. These macros +;assume an optimizing assembler that will convert single register MOVEM +;to MOVE. Because the REG assignment can't be reset, these macros do +;not nest. +; +; PUSHM d2/a2/a5 +; ...code... +; POPM +; RTS +; +PUSHM MACRO + IFGT NARG-1 + FAIL !!!! TOO MANY ARGUMENTS TO PUSHM !!!! + ENDC +PUSHM_\@ REG \1 + movem.l PUSHM_\@!,-(sp) + ENDM + +; +;Undo most recent PUSHM. 'POPM NOBUMP' allows multiple exit points. +; +POPM MACRO + movem.l (sp)+,PUSHM_\@@ + ENDM + ELSE +PMC SET 0 +PMV SET 0 +PUSHM MACRO + IFGT NARG-1 + FAIL + ENDC + IFNE PMV + FAIL + ENDC +PMV SET 1 +PMC SET PMC+1 +PM_\ REG \1 + movem.l PM_\,-(sp) + ENDM + +POPM MACRO + IFEQ PMV + FAIL + ENDC + movem.l (sp)+,PM_\ + IFNC '\1','NOBUMP' +PMC SET PMC+1 +PMV SET 0 + ENDC + ENDM + ENDC +;---------------------------------------------------------------------------- + + + ENDC ; EXEC_MACROS_I diff --git a/source/includes/exec/memory.i b/source/includes/exec/memory.i new file mode 100644 index 0000000..c6ddf63 --- /dev/null +++ b/source/includes/exec/memory.i @@ -0,0 +1,97 @@ + IFND EXEC_MEMORY_I +EXEC_MEMORY_I SET 1 +** +** $Filename: exec/memory.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.11 $ +** $Date: 91/03/15 $ +** +** Definitions and structures used by the memory allocation system +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_NODES_I + INCLUDE "exec/nodes.i" + ENDC ; EXEC_NODES_I + + +*--------------------------------------------------------------------- +* +* Memory List Structures +* +*--------------------------------------------------------------------- +* +* A memory list appears in two forms: One is a requirements list +* the other is a list of already allocated memory. The format is +* the same, with the reqirements/address field occupying the same +* position. +* +* The format is a linked list of ML structures each of which has +* an array of ME entries. +* +*--------------------------------------------------------------------- + + STRUCTURE ML,LN_SIZE + UWORD ML_NUMENTRIES ; The number of ME structures that follow + LABEL ML_ME ; where the ME structures begin + LABEL ML_SIZE ;Note: does NOT include any "ME" structures. + + + STRUCTURE ME,0 + LABEL ME_REQS ; the AllocMem requirements + APTR ME_ADDR ; the address of this block (an alias + ; for the same location as ME_REQS) + ULONG ME_LENGTH ; the length of this region + LABEL ME_SIZE + + +*------ memory options: +*------ see the AllocMem() documentation for details------* + +MEMF_ANY EQU 0 ;Any type of memory will do + BITDEF MEM,PUBLIC,0 + BITDEF MEM,CHIP,1 + BITDEF MEM,FAST,2 + BITDEF MEM,LOCAL,8 ;Memory that does not go away at RESET + BITDEF MEM,24BITDMA,9 ;DMAable memory within 24 bits of address + + BITDEF MEM,CLEAR,16 ;AllocMem: NULL out area before return + BITDEF MEM,LARGEST,17 ;AvailMem: return the largest chunk size + BITDEF MEM,REVERSE,18 ;AllocMem: allocate from the top down + BITDEF MEM,TOTAL,19 ;AvailMem: return total size of memory + + +*----- Current alignment rules for memory blocks (may increase) ----- +MEM_BLOCKSIZE EQU 8 +MEM_BLOCKMASK EQU (MEM_BLOCKSIZE-1) + + +*--------------------------------------------------------------------- +* +* Memory Region Header +* +*--------------------------------------------------------------------- + + STRUCTURE MH,LN_SIZE ; (LN_TYPE will be set to NT_MEMORY) + UWORD MH_ATTRIBUTES ; characteristics of this region + APTR MH_FIRST ; first free region + APTR MH_LOWER ; lower memory bound + APTR MH_UPPER ; upper memory bound+1 + ULONG MH_FREE ; number of free bytes + LABEL MH_SIZE + + +*--------------------------------------------------------------------- +* +* Memory Chunk +* +*--------------------------------------------------------------------- + + STRUCTURE MC,0 + APTR MC_NEXT ; ptr to next chunk + ULONG MC_BYTES ; chunk byte size + APTR MC_SIZE + + ENDC ; EXEC_MEMORY_I diff --git a/source/includes/exec/nodes.i b/source/includes/exec/nodes.i new file mode 100644 index 0000000..e110c59 --- /dev/null +++ b/source/includes/exec/nodes.i @@ -0,0 +1,67 @@ + IFND EXEC_NODES_I +EXEC_NODES_I SET 1 +** +** $VER: nodes.i 39.0 (15.10.91) +** Includes Release 39.108 +** +** Nodes & Node type identifiers. +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_TYPES_I + INCLUDE "exec/types.i" + ENDC ; EXEC_TYPES_I + + +* +* List Node Structure. Each member in a list starts with a Node +* + STRUCTURE LN,0 ; List Node + APTR LN_SUCC ; Pointer to next (successor) + APTR LN_PRED ; Pointer to previous (predecessor) + UBYTE LN_TYPE + BYTE LN_PRI ; Priority, for sorting + APTR LN_NAME ; ID string, null terminated + LABEL LN_SIZE ; Note: word aligned + +; minimal node -- no type checking possible + STRUCTURE MLN,0 ; Minimal List Node + APTR MLN_SUCC + APTR MLN_PRED + LABEL MLN_SIZE + + +** +** Note: Newly initialized IORequests, and software interrupt structures +** used with Cause(), should have type NT_UNKNOWN. The OS will assign a type +** when they are first used. +** +;------ Node Types for LN_TYPE + +NT_UNKNOWN EQU 0 +NT_TASK EQU 1 ; Exec task +NT_INTERRUPT EQU 2 +NT_DEVICE EQU 3 +NT_MSGPORT EQU 4 +NT_MESSAGE EQU 5 ; Indicates message currently pending +NT_FREEMSG EQU 6 +NT_REPLYMSG EQU 7 ; Message has been replied +NT_RESOURCE EQU 8 +NT_LIBRARY EQU 9 +NT_MEMORY EQU 10 +NT_SOFTINT EQU 11 ; Internal flag used by SoftInts +NT_FONT EQU 12 +NT_PROCESS EQU 13 ; AmigaDOS Process +NT_SEMAPHORE EQU 14 +NT_SIGNALSEM EQU 15 ; signal semaphores +NT_BOOTNODE EQU 16 +NT_KICKMEM EQU 17 +NT_GRAPHICS EQU 18 +NT_DEATHMESSAGE EQU 19 + +NT_USER EQU 254 ; User node types work down from here +NT_EXTENDED EQU 255 + + ENDC ;EXEC_NODES_I diff --git a/source/includes/exec/ports.i b/source/includes/exec/ports.i new file mode 100644 index 0000000..86e877f --- /dev/null +++ b/source/includes/exec/ports.i @@ -0,0 +1,61 @@ + IFND EXEC_PORTS_I +EXEC_PORTS_I SET 1 +** +** $Filename: exec/ports.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.5 $ +** $Date: 90/05/10 $ +** +** Message ports and Messages. +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_NODES_I + INCLUDE "exec/nodes.i" + ENDC ; EXEC_NODES_I + + IFND EXEC_LISTS_I + INCLUDE "exec/lists.i" + ENDC ; EXEC_LISTS_I + + +*---------------------------------------------------------------- +* +* Message Port Structure +* +*---------------------------------------------------------------- + + STRUCTURE MP,LN_SIZE + UBYTE MP_FLAGS + UBYTE MP_SIGBIT ; signal bit number + APTR MP_SIGTASK ; object to be signalled + STRUCT MP_MSGLIST,LH_SIZE ; message linked list + LABEL MP_SIZE + + +*------ unions: +MP_SOFTINT EQU MP_SIGTASK + + +*------ MP_FLAGS: Port arrival actions (PutMsg) +PF_ACTION EQU 3 ; Mask +PA_SIGNAL EQU 0 ; Signal task in MP_SIGTASK +PA_SOFTINT EQU 1 ; Signal SoftInt in MP_SOFTINT/MP_SIGTASK +PA_IGNORE EQU 2 ; Ignore arrival + + +*---------------------------------------------------------------- +* +* Message Structure +* +*---------------------------------------------------------------- + + STRUCTURE MN,LN_SIZE + APTR MN_REPLYPORT ; message reply port + UWORD MN_LENGTH ; total message length in bytes + ; (include MN_SIZE in the length) + LABEL MN_SIZE + + ENDC ; EXEC_PORTS_I diff --git a/source/includes/exec/semaphores.i b/source/includes/exec/semaphores.i new file mode 100644 index 0000000..0d7f0e0 --- /dev/null +++ b/source/includes/exec/semaphores.i @@ -0,0 +1,65 @@ + IFND EXEC_SEMAPHORES_I +EXEC_SEMAPHORES_I SET 1 +** +** $Filename: exec/semaphores.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.6 $ +** $Date: 90/05/10 $ +** +** Definitions for locking functions. +** +** (C) Copyright 1986-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_NODES_I + INCLUDE "exec/nodes.i" + ENDC ; EXEC_NODES_I + + IFND EXEC_LISTS_I + INCLUDE "exec/lists.i" + ENDC ; EXEC_LISTS_I + + IFND EXEC_PORTS_I + INCLUDE "exec/ports.i" + ENDC ; EXEC_PORTS_I + + +*---------------------------------------------------------------- +* +* Signal Semaphore Structure +* +*---------------------------------------------------------------- + +** Private structure used by ObtainSemaphore() + STRUCTURE SSR,MLN_SIZE + APTR SSR_WAITER + LABEL SSR_SIZE + +** Signal Semaphore data structure + STRUCTURE SS,LN_SIZE + WORD SS_NESTCOUNT + STRUCT SS_WAITQUEUE,MLH_SIZE + STRUCT SS_MULTIPLELINK,SSR_SIZE + APTR SS_OWNER + WORD SS_QUEUECOUNT + LABEL SS_SIZE + + +*---------------------------------------------------------------- +* +* Semaphore Structure (Procure/Vacate type) +* +*---------------------------------------------------------------- + + + STRUCTURE SM,MP_SIZE + WORD SM_BIDS ; number of bids for lock + LABEL SM_SIZE + +*------ unions: + +SM_LOCKMSG EQU MP_SIGTASK + + + ENDC ; EXEC_SEMAPHORES_I diff --git a/source/includes/exec/tasks.i b/source/includes/exec/tasks.i new file mode 100644 index 0000000..7b59bbf --- /dev/null +++ b/source/includes/exec/tasks.i @@ -0,0 +1,130 @@ + IFND EXEC_TASKS_I +EXEC_TASKS_I SET 1 +** +** $Filename: exec/tasks.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.8 $ +** $Date: 90/10/22 $ +** +** Task Control Block, Signals, and Task flags. +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_NODES_I + INCLUDE "exec/nodes.i" + ENDC ; EXEC_NODES_I + + IFND EXEC_LISTS_I + INCLUDE "exec/lists.i" + ENDC ; EXEC_LISTS_I + + IFND EXEC_PORTS_I + INCLUDE "exec/ports.i" + ENDC ; EXEC_PORTS_I + + +*---------------------------------------------------------------- +* +* Task Control Structure +* +* Please use Exec functions to modify task structure fields, +* where available. +* +*---------------------------------------------------------------- + + STRUCTURE TC_Struct,LN_SIZE ; was "TC" + UBYTE TC_FLAGS + UBYTE TC_STATE + BYTE TC_IDNESTCNT ; intr disabled nesting + BYTE TC_TDNESTCNT ; task disabled nesting + ULONG TC_SIGALLOC ; sigs allocated + ULONG TC_SIGWAIT ; sigs we are waiting for + ULONG TC_SIGRECVD ; sigs we have received + ULONG TC_SIGEXCEPT ; sigs we take as exceptions + ;* Pointer to an extended task structure. This structure is allocated + ;* by V36 Exec if the proper flags in tc_ETaskFlags are set. This + ;* field was formerly defined as: + ;* UWORD TC_TRAPALLOC ; traps allocated + ;* UWORD TC_TRAPABLE ; traps enabled + ;* Please see the Exec AllocTrap() and FreeTrap() calls. + ;* + APTR tc_ETask ; pointer to extended task structure + APTR TC_EXCEPTDATA ; data for except proc + APTR TC_EXCEPTCODE ; exception procedure + APTR TC_TRAPDATA ; data for proc trap proc + APTR TC_TRAPCODE ; proc trap procedure + APTR TC_SPREG ; stack pointer + APTR TC_SPLOWER ; stack lower bound + APTR TC_SPUPPER ; stack upper bound + 2 + FPTR TC_SWITCH ; task losing CPU (function pointer) + FPTR TC_LAUNCH ; task getting CPU (function pointer) + STRUCT TC_MEMENTRY,LH_SIZE ; Allocated memory list. Freed by RemTask() + APTR TC_Userdata ; For use by the task; no restrictions! + LABEL TC_SIZE + + +;Don't even _think_ about allocating one of these yourself. + STRUCTURE ETask,MN_SIZE + APTR et_Parent ;Pointer to task (TC) + ULONG et_UniqueID ;ID unique to this task + STRUCT et_Children,MLH_SIZE ;List of children + UWORD et_TRAPALLOC + UWORD et_TRAPABLE + ULONG et_Result1 ;First result + APTR et_Result2 ;Result data pointer (AllocVec) + STRUCT et_TaskMsgPort,MP_SIZE + LABEL ETask_SIZEOF ;_never_ depend on this size! + + +CHILD_NOTNEW EQU 1 ;function not called from a new style task +CHILD_NOTFOUND EQU 2 ;child not found +CHILD_EXITED EQU 3 ;child has exited +CHILD_ACTIVE EQU 4 ;child has exited + + +;Stack swap structure as passed to StackSwap() +; + STRUCTURE StackSwapStruct,0 + APTR stk_Lower ;Lowest byte of stack + ULONG stk_Upper ;Upper end of stack (size + Lowest) + APTR stk_Pointer ;Stack pointer at switch point + LABEL StackSwapStruct_SIZEOF + + +;------ TC_FLAGS Bits: + + BITDEF T,PROCTIME,0 + BITDEF T,ETASK,3 + BITDEF T,STACKCHK,4 + BITDEF T,EXCEPT,5 + BITDEF T,SWITCH,6 ;Enable TC_SWITCH point + BITDEF T,LAUNCH,7 ;Enable TC_LAUNCH point + + +;------ Task States: + +TS_INVALID EQU 0 +TS_ADDED EQU TS_INVALID+1 +TS_RUN EQU TS_ADDED+1 +TS_READY EQU TS_RUN+1 +TS_WAIT EQU TS_READY+1 +TS_EXCEPT EQU TS_WAIT+1 +TS_REMOVED EQU TS_EXCEPT+1 + + +;------ System Task Signals: + + BITDEF SIG,ABORT,0 + BITDEF SIG,CHILD,1 + BITDEF SIG,BLIT,4 ; Note: same as SINGLE + BITDEF SIG,SINGLE,4 ; "single-threaded". Note: same as BLIT + BITDEF SIG,INTUITION,5 + BITDEF SIG,DOS,8 + + +SYS_SIGALLOC EQU $0FFFF ; pre-allocated signals +SYS_TRAPALLOC EQU $08000 ; pre-allocated traps + + ENDC ; EXEC_TASKS_I diff --git a/source/includes/exec/types.i b/source/includes/exec/types.i new file mode 100644 index 0000000..9231291 --- /dev/null +++ b/source/includes/exec/types.i @@ -0,0 +1,168 @@ + IFND EXEC_TYPES_I +EXEC_TYPES_I SET 1 +** +** $VER: types.i 39.0 (15.10.91) +** Includes Release 39.108 +** +** Data storage macros. Must be included before any other Amiga include. +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + + +INCLUDE_VERSION EQU 36 ;Version of the include files in use. (Do not + ;use this label for OpenLibrary() calls!) + + +EXTERN_LIB MACRO + XREF _LVO\1 + ENDM + +** +** Structure Building Macros +** +STRUCTURE MACRO ; structure name, initial offset +\1 EQU 0 +SOFFSET SET \2 + ENDM + +FPTR MACRO ; function pointer (32 bits - all bits valid) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+4 + ENDM + +BOOL MACRO ; boolean (16 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+2 + ENDM + +BYTE MACRO ; byte (8 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+1 + ENDM + +UBYTE MACRO ; unsigned byte (8 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+1 + ENDM + +WORD MACRO ; word (16 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+2 + ENDM + +UWORD MACRO ; unsigned word (16 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+2 + ENDM + +SHORT MACRO ; obsolete - use WORD +\1 EQU SOFFSET +SOFFSET SET SOFFSET+2 + ENDM + +USHORT MACRO ; obsolete - use UWORD +\1 EQU SOFFSET +SOFFSET SET SOFFSET+2 + ENDM + +LONG MACRO ; long (32 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+4 + ENDM + +ULONG MACRO ; unsigned long (32 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+4 + ENDM + +FLOAT MACRO ; C float (32 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+4 + ENDM + +DOUBLE MACRO ; C double (64 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+8 + ENDM + +APTR MACRO ; untyped pointer (32 bits - all bits valid) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+4 + ENDM + +CPTR MACRO ; obsolete +\1 EQU SOFFSET +SOFFSET SET SOFFSET+4 + ENDM + +RPTR MACRO ; unsigned relative pointer (16 bits) +\1 EQU SOFFSET +SOFFSET SET SOFFSET+2 + ENDM + +LABEL MACRO ; Define a label without bumping the offset +\1 EQU SOFFSET + ENDM + +STRUCT MACRO ; Define a sub-structure +\1 EQU SOFFSET +SOFFSET SET SOFFSET+\2 + ENDM + +ALIGNWORD MACRO ; Align structure offset to nearest word +SOFFSET SET (SOFFSET+1)&$fffffffe + ENDM + +ALIGNLONG MACRO ; Align structure offset to nearest longword +SOFFSET SET (SOFFSET+3)&$fffffffc + ENDM + +** +** Enumerated variables. Use ENUM to set a base number, and EITEM to assign +** incrementing values. ENUM can be used to set a new base at any time. +** +ENUM MACRO ;[new base] + IFC '\1','' +EOFFSET SET 0 ; Default to zero + ENDC + IFNC '\1','' +EOFFSET SET \1 + ENDC + ENDM + +EITEM MACRO ;label +\1 EQU EOFFSET +EOFFSET SET EOFFSET+1 + ENDM + +** +** Bit Definition Macro +** +** Given: +** BITDEF MEM,CLEAR,16 +** +** Yields: +** MEMB_CLEAR EQU 16 ; Bit number +** MEMF_CLEAR EQU 1<<16 ; Bit mask +** + +BITDEF MACRO ; prefix,&name,&bitnum + BITDEF0 \1,\2,B_,\3 +\@BITDEF SET 1<<\3 + BITDEF0 \1,\2,F_,\@BITDEF + ENDM + +BITDEF0 MACRO ; prefix,&name,&type,&value +\1\3\2 EQU \4 + ENDM + +** +** LIBRARY_VERSION is now obsolete. Please use LIBRARY_MINIMUM or code +** the specific minimum library version you require. +** LIBRARY_VERSION EQU 36 +** +LIBRARY_MINIMUM EQU 33 ;Lowest version supported by Commodore-Amiga + + ENDC ; EXEC_TYPES_I diff --git a/source/includes/graphics/gfx.i b/source/includes/graphics/gfx.i new file mode 100644 index 0000000..919a310 --- /dev/null +++ b/source/includes/graphics/gfx.i @@ -0,0 +1,52 @@ + IFND GRAPHICS_GFX_I +GRAPHICS_GFX_I SET 1 +** +** $Filename: graphics/gfx.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 37.0 $ +** $Date: 91/01/07 $ +** +** +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_TYPES_I + include 'exec/types.i' + ENDC + +BITSET equ $8000 +BITCLR equ 0 +AGNUS equ 1 +DENISE equ 1 + + STRUCTURE BitMap,0 + WORD bm_BytesPerRow + WORD bm_Rows + BYTE bm_Flags + BYTE bm_Depth + WORD bm_Pad + STRUCT bm_Planes,8*4 + LABEL bm_SIZEOF + + STRUCTURE Rectangle,0 + WORD ra_MinX + WORD ra_MinY + WORD ra_MaxX + WORD ra_MaxY + LABEL ra_SIZEOF + + STRUCTURE Rect32,0 + LONG r32_MinX + LONG r32_MinY + LONG r32_MaxX + LONG r32_MaxY + LABEL r32_SIZEOF + + STRUCTURE tPoint,0 + WORD tpt_x + WORD tpt_y + LABEL tpt_SIZEOF + + ENDC ; GRAPHICS_GFX_I diff --git a/source/includes/graphics/gfxbase.i b/source/includes/graphics/gfxbase.i new file mode 100644 index 0000000..5e08c88 --- /dev/null +++ b/source/includes/graphics/gfxbase.i @@ -0,0 +1,136 @@ + IFND GRAPHICS_GFXBASE_I +GRAPHICS_GFXBASE_I SET 1 +** +** $Filename: graphics/gfxbase.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 37.3 $ +** $Date: 91/04/15 $ +** +** graphics base definitions +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_LISTS_I + include 'exec/lists.i' + ENDC + IFND EXEC_LIBRARIES_I + include 'exec/libraries.i' + ENDC + IFND EXEC_INTERRUPTS_I + include 'exec/interrupts.i' + ENDC + + STRUCTURE GfxBase,LIB_SIZE + APTR gb_ActiView ; struct *View + APTR gb_copinit ; struct *copinit; ptr to copper start up list + APTR gb_cia ; for 6526 resource use + APTR gb_blitter ; for blitter resource use + APTR gb_LOFlist ; current copper list being run + APTR gb_SHFlist ; current copper list being run + APTR gb_blthd ; struct *bltnode + APTR gb_blttl ; + APTR gb_bsblthd ; + APTR gb_bsblttl ; + STRUCT gb_vbsrv,IS_SIZE + STRUCT gb_timsrv,IS_SIZE + STRUCT gb_bltsrv,IS_SIZE + STRUCT gb_TextFonts,LH_SIZE + APTR gb_DefaultFont + UWORD gb_Modes ; copy of bltcon0 + BYTE gb_VBlank + BYTE gb_Debug + UWORD gb_BeamSync + WORD gb_system_bplcon0 + BYTE gb_SpriteReserved + BYTE gb_bytereserved + + WORD gb_Flags + WORD gb_BlitLock + WORD gb_BlitNest + STRUCT gb_BlitWaitQ,LH_SIZE + APTR gb_BlitOwner + STRUCT gb_TOF_WaitQ,LH_SIZE + + WORD gb_DisplayFlags + APTR gb_SimpleSprites + WORD gb_MaxDisplayRow + WORD gb_MaxDisplayColumn + WORD gb_NormalDisplayRows + WORD gb_NormalDisplayColumns + WORD gb_NormalDPMX + WORD gb_NormalDPMY + + APTR gb_LastChanceMemory + APTR gb_LCMptr + + WORD gb_MicrosPerLine ; usecs per line times 256 + WORD gb_MinDisplayColumn + + UBYTE gb_ChipRevBits0 ; agnus/denise new features + STRUCT gb_crb_reserved,5 + + STRUCT gb_monitor_id,2 ; normally null + STRUCT gb_hedley,4*8 + STRUCT gb_hedley_sprites,4*8 + STRUCT gb_hedley_sprites1,4*8 + WORD gb_hedley_count + WORD gb_hedley_flags + WORD gb_hedley_tmp + APTR gb_hash_table + UWORD gb_current_tot_rows + UWORD gb_current_tot_cclks + UBYTE gb_hedley_hint + UBYTE gb_hedley_hint2 + STRUCT gb_nreserved,4*4 + APTR gb_a2024_sync_raster + WORD gb_control_delta_pal + WORD gb_control_delta_ntsc + APTR gb_current_monitor + STRUCT gb_MonitorList,LH_SIZE + APTR gb_default_monitor + APTR gb_MonitorListSemaphore + APTR gb_DisplayInfoDataBase + WORD lapad; ; alignment + APTR gb_ActiViewCprSemaphore + APTR gb_UtilityBase + APTR gb_ExecBase + LABEL gb_SIZE + +* bits for dalestuff, which may go away when blitter becomes a resource +OWNBLITTERn equ 0 * blitter owned bit +QBOWNERn equ 1 * blitter owned by blit queuer + +* flag bits for ChipRevBits + BITDEF GFX,BIG_BLITS,0 + BITDEF GFX,HR_AGNUS,0 + BITDEF GFX,HR_DENISE,1 + + +QBOWNER equ 1< 2 us/bit (mfm), 2 -> 4 us/bit (gcr) +ADKB_USE3PN EQU 7 ; use aud chan 3 to modulate period of ?? +ADKB_USE2P3 EQU 6 ; use aud chan 2 to modulate period of 3 +ADKB_USE1P2 EQU 5 ; use aud chan 1 to modulate period of 2 +ADKB_USE0P1 EQU 4 ; use aud chan 0 to modulate period of 1 +ADKB_USE3VN EQU 3 ; use aud chan 3 to modulate volume of ?? +ADKB_USE2V3 EQU 2 ; use aud chan 2 to modulate volume of 3 +ADKB_USE1V2 EQU 1 ; use aud chan 1 to modulate volume of 2 +ADKB_USE0V1 EQU 0 ; use aud chan 0 to modulate volume of 1 + +ADKF_SETCLR EQU (1<<15) +ADKF_PRECOMP1 EQU (1<<14) +ADKF_PRECOMP0 EQU (1<<13) +ADKF_MFMPREC EQU (1<<12) +ADKF_UARTBRK EQU (1<<11) +ADKF_WORDSYNC EQU (1<<10) +ADKF_MSBSYNC EQU (1<<9) +ADKF_FAST EQU (1<<8) +ADKF_USE3PN EQU (1<<7) +ADKF_USE2P3 EQU (1<<6) +ADKF_USE1P2 EQU (1<<5) +ADKF_USE0P1 EQU (1<<4) +ADKF_USE3VN EQU (1<<3) +ADKF_USE2V3 EQU (1<<2) +ADKF_USE1V2 EQU (1<<1) +ADKF_USE0V1 EQU (1<<0) + +ADKF_PRE000NS EQU 0 ; 000 ns of precomp +ADKF_PRE140NS EQU (ADKF_PRECOMP0) ; 140 ns of precomp +ADKF_PRE280NS EQU (ADKF_PRECOMP1) ; 280 ns of precomp +ADKF_PRE560NS EQU (ADKF_PRECOMP0!ADKF_PRECOMP1) ; 560 ns of precomp + + ENDC ; HARDWARE_ADKBITS_I diff --git a/source/includes/hardware/blitbits.i b/source/includes/hardware/blitbits.i new file mode 100644 index 0000000..18e5a39 --- /dev/null +++ b/source/includes/hardware/blitbits.i @@ -0,0 +1,83 @@ + + IFND ADDITIONALINCLUDES_HARDWARE_BLITBITS_I +ADDITIONALINCLUDES_HARDWARE_BLITBITS_I SET 1 + +BLTCON0B_ASH3 = 15 +BLTCON0B_ASH2 = 14 +BLTCON0B_ASH1 = 13 +BLTCON0B_ASH0 = 12 +BLTCON0B_USEA = 11 +BLTCON0B_USEB = 10 +BLTCON0B_USEC = 9 +BLTCON0B_USED = 8 +BLTCON0B_LF7 = 7 +BLTCON0B_LF6 = 6 +BLTCON0B_LF5 = 5 +BLTCON0B_LF4 = 4 +BLTCON0B_LF3 = 3 +BLTCON0B_LF2 = 2 +BLTCON0B_LF1 = 1 +BLTCON0B_LF0 = 0 + +BLTCON0F_ASH3 = 1<bright) +CIAB_OVERLAY EQU (0) * memory overlay bit + +* ciaa port B (0xbfe101) -- parallel port + +* ciab port A (0xbfd000) -- serial and printer control +CIAB_COMDTR EQU (7) * serial Data Terminal Ready* +CIAB_COMRTS EQU (6) * serial Request to Send* +CIAB_COMCD EQU (5) * serial Carrier Detect* +CIAB_COMCTS EQU (4) * serial Clear to Send* +CIAB_COMDSR EQU (3) * serial Data Set Ready* +CIAB_PRTRSEL EQU (2) * printer SELECT +CIAB_PRTRPOUT EQU (1) * printer paper out +CIAB_PRTRBUSY EQU (0) * printer busy + +* ciab port B (0xbfd100) -- disk control +CIAB_DSKMOTOR EQU (7) * disk motorr* +CIAB_DSKSEL3 EQU (6) * disk select unit 3* +CIAB_DSKSEL2 EQU (5) * disk select unit 2* +CIAB_DSKSEL1 EQU (4) * disk select unit 1* +CIAB_DSKSEL0 EQU (3) * disk select unit 0* +CIAB_DSKSIDE EQU (2) * disk side select* +CIAB_DSKDIREC EQU (1) * disk direction of seek* +CIAB_DSKSTEP EQU (0) * disk step heads* + +* ciaa port A (0xbfe001) +CIAF_GAMEPORT1 EQU (1<<7) +CIAF_GAMEPORT0 EQU (1<<6) +CIAF_DSKRDY EQU (1<<5) +CIAF_DSKTRACK0 EQU (1<<4) +CIAF_DSKPROT EQU (1<<3) +CIAF_DSKCHANGE EQU (1<<2) +CIAF_LED EQU (1<<1) +CIAF_OVERLAY EQU (1<<0) + +* ciaa port B (0xbfe101) -- parallel port + +* ciab port A (0xbfd000) -- serial and printer control +CIAF_COMDTR EQU (1<<7) +CIAF_COMRTS EQU (1<<6) +CIAF_COMCD EQU (1<<5) +CIAF_COMCTS EQU (1<<4) +CIAF_COMDSR EQU (1<<3) +CIAF_PRTRSEL EQU (1<<2) +CIAF_PRTRPOUT EQU (1<<1) +CIAF_PRTRBUSY EQU (1<<0) + +* ciab port B (0xbfd100) -- disk control +CIAF_DSKMOTOR EQU (1<<7) +CIAF_DSKSEL3 EQU (1<<6) +CIAF_DSKSEL2 EQU (1<<5) +CIAF_DSKSEL1 EQU (1<<4) +CIAF_DSKSEL0 EQU (1<<3) +CIAF_DSKSIDE EQU (1<<2) +CIAF_DSKDIREC EQU (1<<1) +CIAF_DSKSTEP EQU (1<<0) + + ENDC ; HARDWARE_CIA_I diff --git a/source/includes/hardware/copper.i b/source/includes/hardware/copper.i new file mode 100644 index 0000000..e2d98e2 --- /dev/null +++ b/source/includes/hardware/copper.i @@ -0,0 +1,24 @@ + +COP_END_DATA = $fffffffe ; Wait for end-of-display +COP_WAITBLIT_DATA = $00010000 ; Wait for blitter to be idle + + +COP_MOVE: macro + dc.w (\1)&$1fe,\2 + endm + +COP_WAITLINE: macro + dc.w ((\1)<<8)+4+1,$fffe + endm + +COP_WAITRAST: macro + dc.w ((\1)<<8)+((\2)&$fe)+1,$fffe + endm + +COP_WAITBLIT: macro + dc.l COP_WAITBLIT_DATA + endm + +COP_END: macro + dc.l COP_END_DATA + endm diff --git a/source/includes/hardware/custom.i b/source/includes/hardware/custom.i new file mode 100644 index 0000000..b4caeeb --- /dev/null +++ b/source/includes/hardware/custom.i @@ -0,0 +1,154 @@ + IFND HARDWARE_CUSTOM_I +HARDWARE_CUSTOM_I SET 1 +** +** $VER: custom.i 39.1 (18.09.92) +** Includes Release 39.108 +** +** Offsets of Amiga custom chip registers +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + +* +* do this to get base of custom registers: +* XREF _custom; +* + +bltddat EQU $000 +dmaconr EQU $002 +vposr EQU $004 +vhposr EQU $006 +dskdatr EQU $008 +joy0dat EQU $00A +joy1dat EQU $00C +clxdat EQU $00E + +adkconr EQU $010 +pot0dat EQU $012 +pot1dat EQU $014 +potinp EQU $016 +potgor EQU potinp +serdatr EQU $018 +dskbytr EQU $01A +intenar EQU $01C +intreqr EQU $01E + +dskpt EQU $020 +dsklen EQU $024 +dskdat EQU $026 +refptr EQU $028 +vposw EQU $02A +vhposw EQU $02C +copcon EQU $02E +serdat EQU $030 +serper EQU $032 +potgo EQU $034 +joytest EQU $036 +strequ EQU $038 +strvbl EQU $03A +strhor EQU $03C +strlong EQU $03E + +bltcon0 EQU $040 +bltcon1 EQU $042 +bltafwm EQU $044 +bltalwm EQU $046 +bltcpt EQU $048 +bltbpt EQU $04C +bltapt EQU $050 +bltdpt EQU $054 +bltsize EQU $058 +bltcon0l EQU $05B ; note: byte access only +bltsizv EQU $05C +bltsizh EQU $05E + +bltcmod EQU $060 +bltbmod EQU $062 +bltamod EQU $064 +bltdmod EQU $066 + +bltcdat EQU $070 +bltbdat EQU $072 +bltadat EQU $074 + +deniseid EQU $07C +dsksync EQU $07E + +cop1lc EQU $080 +cop2lc EQU $084 +copjmp1 EQU $088 +copjmp2 EQU $08A +copins EQU $08C +diwstrt EQU $08E +diwstop EQU $090 +ddfstrt EQU $092 +ddfstop EQU $094 +dmacon EQU $096 +clxcon EQU $098 +intena EQU $09A +intreq EQU $09C +adkcon EQU $09E + +aud EQU $0A0 +aud0 EQU $0A0 +aud1 EQU $0B0 +aud2 EQU $0C0 +aud3 EQU $0D0 + +* AudChannel +ac_ptr EQU $00 ; ptr to start of waveform data +ac_len EQU $04 ; length of waveform in words +ac_per EQU $06 ; sample period +ac_vol EQU $08 ; volume +ac_dat EQU $0A ; sample pair +ac_SIZEOF EQU $10 + +bplpt EQU $0E0 + +bplcon0 EQU $100 +bplcon1 EQU $102 +bplcon2 EQU $104 +bplcon3 EQU $106 +bpl1mod EQU $108 +bpl2mod EQU $10A +bplcon4 EQU $10C +clxcon2 EQU $10E + +bpldat EQU $110 + +sprpt EQU $120 + +spr EQU $140 + +* SpriteDef +sd_pos EQU $00 +sd_ctl EQU $02 +sd_dataa EQU $04 +sd_dataB EQU $06 +sd_SIZEOF EQU $08 + +color EQU $180 + +htotal EQU $1c0 +hsstop EQU $1c2 +hbstrt EQU $1c4 +hbstop EQU $1c6 +vtotal EQU $1c8 +vsstop EQU $1ca +vbstrt EQU $1cc +vbstop EQU $1ce +sprhstrt EQU $1d0 +sprhstop EQU $1d2 +bplhstrt EQU $1d4 +bplhstop EQU $1d6 +hhposw EQU $1d8 +hhposr EQU $1da +beamcon0 EQU $1dc +hsstrt EQU $1de +vsstrt EQU $1e0 +hcenter EQU $1e2 +diwhigh EQU $1e4 +fmode EQU $1fc + + ENDC !HARDWARE_CUSTOM_I diff --git a/source/includes/hardware/dmabits.i b/source/includes/hardware/dmabits.i new file mode 100644 index 0000000..eff7224 --- /dev/null +++ b/source/includes/hardware/dmabits.i @@ -0,0 +1,49 @@ + IFND HARDWARE_DMABITS_I +HARDWARE_DMABITS_I SET 1 +** +** $VER: dmabits.i 39.1 (18.09.92) +** Includes Release 39.108 +** +** include file for defining dma control stuff +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + +* write definitions for dmaconw +DMAF_SETCLR EQU $8000 +DMAF_AUDIO EQU $000F * 4 bit mask +DMAF_AUD0 EQU $0001 +DMAF_AUD1 EQU $0002 +DMAF_AUD2 EQU $0004 +DMAF_AUD3 EQU $0008 +DMAF_DISK EQU $0010 +DMAF_SPRITE EQU $0020 +DMAF_BLITTER EQU $0040 +DMAF_COPPER EQU $0080 +DMAF_RASTER EQU $0100 +DMAF_MASTER EQU $0200 +DMAF_BLITHOG EQU $0400 +DMAF_ALL EQU $01FF * all dma channels + +* read definitions for dmaconr +* bits 0-8 correspnd to dmaconw definitions +DMAF_BLTDONE EQU $4000 +DMAF_BLTNZERO EQU $2000 + +DMAB_SETCLR EQU 15 +DMAB_AUD0 EQU 0 +DMAB_AUD1 EQU 1 +DMAB_AUD2 EQU 2 +DMAB_AUD3 EQU 3 +DMAB_DISK EQU 4 +DMAB_SPRITE EQU 5 +DMAB_BLITTER EQU 6 +DMAB_COPPER EQU 7 +DMAB_RASTER EQU 8 +DMAB_MASTER EQU 9 +DMAB_BLITHOG EQU 10 +DMAB_BLTDONE EQU 14 +DMAB_BLTNZERO EQU 13 + + ENDC ; HARDWARE_DMABITS_I diff --git a/source/includes/hardware/intbits.i b/source/includes/hardware/intbits.i new file mode 100644 index 0000000..de6cb19 --- /dev/null +++ b/source/includes/hardware/intbits.i @@ -0,0 +1,51 @@ + IFND HARDWARE_INTBITS_I +HARDWARE_INTBITS_I SET 1 +** +** $VER: intbits.i 39.1 (18.09.92) +** Includes Release 39.108 +** +** bits in the interrupt enable (and interrupt request) register +** +** (C) Copyright 1985-1992 Commodore-Amiga, Inc. +** All Rights Reserved +** + +INTB_SETCLR EQU (15) ;Set/Clear control bit. Determines if bits + ;written with a 1 get set or cleared. Bits + ;written with a zero are allways unchanged. +INTB_INTEN EQU (14) ;Master interrupt (enable only ) +INTB_EXTER EQU (13) ;External interrupt +INTB_DSKSYNC EQU (12) ;Disk re-SYNChronized +INTB_RBF EQU (11) ;serial port Receive Buffer Full +INTB_AUD3 EQU (10) ;Audio channel 3 block finished +INTB_AUD2 EQU (9) ;Audio channel 2 block finished +INTB_AUD1 EQU (8) ;Audio channel 1 block finished +INTB_AUD0 EQU (7) ;Audio channel 0 block finished +INTB_BLIT EQU (6) ;Blitter finished +INTB_VERTB EQU (5) ;start of Vertical Blank +INTB_COPER EQU (4) ;Coprocessor +INTB_PORTS EQU (3) ;I/O Ports and timers +INTB_SOFTINT EQU (2) ;software interrupt request +INTB_DSKBLK EQU (1) ;Disk Block done +INTB_TBE EQU (0) ;serial port Transmit Buffer Empty + + + +INTF_SETCLR EQU (1<<15) +INTF_INTEN EQU (1<<14) +INTF_EXTER EQU (1<<13) +INTF_DSKSYNC EQU (1<<12) +INTF_RBF EQU (1<<11) +INTF_AUD3 EQU (1<<10) +INTF_AUD2 EQU (1<<9) +INTF_AUD1 EQU (1<<8) +INTF_AUD0 EQU (1<<7) +INTF_BLIT EQU (1<<6) +INTF_VERTB EQU (1<<5) +INTF_COPER EQU (1<<4) +INTF_PORTS EQU (1<<3) +INTF_SOFTINT EQU (1<<2) +INTF_DSKBLK EQU (1<<1) +INTF_TBE EQU (1<<0) + + ENDC ; HARDWARE_INTBITS_I diff --git a/source/includes/lvo/lvo.i b/source/includes/lvo/lvo.i new file mode 100644 index 0000000..dbc1600 --- /dev/null +++ b/source/includes/lvo/lvo.i @@ -0,0 +1,517 @@ +_LVOInitCLPool = -30 +_LVOAllocCList = -36 +_LVOFreeCList = -42 +_LVOFlushCList = -48 +_LVOSizeCList = -54 +_LVOPutCLChar = -60 +_LVOGetCLChar = -66 +_LVOUnGetCLChar = -72 +_LVOUnPutCLChar = -78 +_LVOPutCLWord = -84 +_LVOGetCLWord = -90 +_LVOUnGetCLWord = -96 +_LVOUnPutCLWord = -102 +_LVOPutCLBuf = -108 +_LVOGetCLBuf = -114 +_LVOMarkCList = -120 +_LVOIncrCLMark = -126 +_LVOPeekCLMark = -132 +_LVOSplitCList = -138 +_LVOCopyCList = -144 +_LVOSubCList = -150 +_LVOConcatCList = -156 + +_LVOCDInputHandler = -42 +_LVORawKeyConvert = -48 + +_LVOaTailPath = -30 +_LVOTailPath = -36 +_LVOabcopy = -42 +_LVObcopy = -48 +_LVOabzero = -54 +_LVObzero = -60 +_LVOaindex = -66 +_LVOindex = -72 +_LVOarindex = -78 +_LVOrindex = -84 +_LVOascopy = -90 +_LVOscopy = -96 +_LVOasfree = -102 +_LVOsfree = -108 +_LVOastrcat = -114 +_LVOstrcat = -120 +_LVOastrcmp = -126 +_LVOstrcmp = -132 +_LVOastrcpy = -138 +_LVOstrcpy = -144 +_LVOastrlen = -150 +_LVOstrlen = -156 +_LVOastrncat = -162 +_LVOstrncat = -168 +_LVOastrncmp = -174 +_LVOstrncmp = -180 +_LVOastrncpy = -186 +_LVOstrncpy = -192 +_LVOasuffix = -198 +_LVOsuffix = -204 + +_LVOOpenDiskFont = -30 +_LVOAvailFonts = -36 + +_LVOOpen = -30 +_LVOClose = -36 +_LVORead = -42 +_LVOWrite = -48 +_LVOInput = -54 +_LVOOutput = -60 +_LVOSeek = -66 +_LVODeleteFile = -72 +_LVORename = -78 +_LVOLock = -84 +_LVOUnLock = -90 +_LVODupLock = -96 +_LVOExamine = -102 +_LVOExNext = -108 +_LVOInfo = -114 +_LVOCreateDir = -120 +_LVOCurrentDir = -126 +_LVOIoErr = -132 +_LVOCreateProc = -138 +_LVOExit = -144 +_LVOLoadSeg = -150 +_LVOUnLoadSeg = -156 +_LVOGetPacket = -162 +_LVOQueuePacket = -168 +_LVODeviceProc = -174 +_LVOSetComment = -180 +_LVOSetProtection = -186 +_LVODateStamp = -192 +_LVODelay = -198 +_LVOWaitForChar = -204 +_LVOParentDir = -210 +_LVOIsInteractive = -216 +_LVOExecute = -222 + +_LVOSupervisor = -30 +_LVOExitIntr = -36 +_LVOSchedule = -42 +_LVOReschedule = -48 +_LVOSwitch = -54 +_LVODispatch = -60 +_LVOException = -66 +_LVOInitCode = -72 +_LVOInitStruct = -78 +_LVOMakeLibrary = -84 +_LVOMakeFunctions = -90 +_LVOFindResident = -96 +_LVOInitResident = -102 +_LVOAlert = -108 +_LVODebug = -114 +_LVODisable = -120 +_LVOEnable = -126 +_LVOForbid = -132 +_LVOPermit = -138 +_LVOSetSR = -144 +_LVOSuperState = -150 +_LVOUserState = -156 +_LVOSetIntVector = -162 +_LVOAddIntServer = -168 +_LVORemIntServer = -174 +_LVOCause = -180 +_LVOAllocate = -186 +_LVODeallocate = -192 +_LVOAllocMem = -198 +_LVOAllocVec = -684 +_LVOAllocAbs = -204 +_LVOFreeVec = -690 +_LVOFreeMem = -210 +_LVOAvailMem = -216 +_LVOAllocEntry = -222 +_LVOFreeEntry = -228 +_LVOInsert = -234 +_LVOAddHead = -240 +_LVOAddTail = -246 +_LVORemove = -252 +_LVORemHead = -258 +_LVORemTail = -264 +_LVOEnqueue = -270 +_LVOFindName = -276 +_LVOAddTask = -282 +_LVORemTask = -288 +_LVOFindTask = -294 +_LVOSetTaskPri = -300 +_LVOSetSignal = -306 +_LVOSetExcept = -312 +_LVOWait = -318 +_LVOSignal = -324 +_LVOAllocSignal = -330 +_LVOFreeSignal = -336 +_LVOAllocTrap = -342 +_LVOFreeTrap = -348 +_LVOAddPort = -354 +_LVORemPort = -360 +_LVOPutMsg = -366 +_LVOGetMsg = -372 +_LVOReplyMsg = -378 +_LVOWaitPort = -384 +_LVOFindPort = -390 +_LVOAddLibrary = -396 +_LVORemLibrary = -402 +_LVOOldOpenLibrary = -408 +_LVOCloseLibrary = -414 +_LVOSetFunction = -420 +_LVOSumLibrary = -426 +_LVOAddDevice = -432 +_LVORemDevice = -438 +_LVOOpenDevice = -444 +_LVOCloseDevice = -450 +_LVODoIO = -456 +_LVOSendIO = -462 +_LVOCheckIO = -468 +_LVOWaitIO = -474 +_LVOAbortIO = -480 +_LVOAddResource = -486 +_LVORemResource = -492 +_LVOOpenResource = -498 +_LVORawIOInit = -504 +_LVORawMayGetChar = -510 +_LVORawPutChar = -516 +_LVORawDoFmt = -522 +_LVOGetCC = -528 +_LVOTypeOfMem = -534 +_LVOProcure = -540 +_LVOVacate = -546 +_LVOOpenLibrary = -552 +_LVOInitSemaphore = -558 +_LVOObtainSemaphore = -564 +_LVOReleaseSemaphore = -570 +_LVOAttemptSemaphore = -576 +_LVOObtainSemaphoreList = -582 +_LVOReleaseSemaphoreList = -588 +_LVOFindSemaphore = -594 +_LVOAddSemaphore = -600 +_LVORemSemaphore = -606 +_LVOSumKickData = -612 +_LVOAddMemList = -618 +_LVOCopyMem = -624 +_LVOCopyMemQuick = -630 + +_LVOAddConfigDev = -30 +_LVOexpansionUnused = -36 +_LVOAllocBoardMem = -42 +_LVOAllocConfigDev = -48 +_LVOAllocExpansionMem = -54 +_LVOConfigBoard = -60 +_LVOConfigChain = -66 +_LVOFindConfigDev = -72 +_LVOFreeBoardMem = -78 +_LVOFreeConfigDev = -84 +_LVOFreeExpansionMem = -90 +_LVOReadExpansionByte = -96 +_LVOReadExpansionRom = -102 +_LVORemConfigDev = -108 +_LVOWriteExpansionByte = -114 +_LVOObtainConfigBinding = -120 +_LVOReleaseConfigBinding = -126 +_LVOSetCurrentBinding = -132 +_LVOGetCurrentBinding = -138 +_LVOMakeDosNode = -144 +_LVOAddDosNode = -150 + +_LVOBltBitMap = -30 +_LVOBltTemplate = -36 +_LVOClearEOL = -42 +_LVOClearScreen = -48 +_LVOTextLength = -54 +_LVOText = -60 +_LVOSetFont = -66 +_LVOOpenFont = -72 +_LVOCloseFont = -78 +_LVOAskSoftStyle = -84 +_LVOSetSoftStyle = -90 +_LVOAddBob = -96 +_LVOAddVSprite = -102 +_LVODoCollision = -108 +_LVODrawGList = -114 +_LVOInitGels = -120 +_LVOInitMasks = -126 +_LVORemIBob = -132 +_LVORemVSprite = -138 +_LVOSetCollision = -144 +_LVOSortGList = -150 +_LVOAddAnimOb = -156 +_LVOAnimate = -162 +_LVOGetGBuffers = -168 +_LVOInitGMasks = -174 +_LVODrawEllipse = -180 +_LVOAreaEllipse = -186 +_LVOLoadRGB4 = -192 +_LVOInitRastPort = -198 +_LVOInitVPort = -204 +_LVOMrgCop = -210 +_LVOMakeVPort = -216 +_LVOLoadView = -222 +_LVOWaitBlit = -228 +_LVOSetRast = -234 +_LVOMove = -240 +_LVODraw = -246 +_LVOAreaMove = -252 +_LVOAreaDraw = -258 +_LVOAreaEnd = -264 +_LVOWaitTOF = -270 +_LVOQBlit = -276 +_LVOInitArea = -282 +_LVOSetRGB4 = -288 +_LVOQBSBlit = -294 +_LVOBltClear = -300 +_LVORectFill = -306 +_LVOBltPattern = -312 +_LVOReadPixel = -318 +_LVOWritePixel = -324 +_LVOFlood = -330 +_LVOPolyDraw = -336 +_LVOSetAPen = -342 +_LVOSetBPen = -348 +_LVOSetDrMd = -354 +_LVOInitView = -360 +_LVOCBump = -366 +_LVOCMove = -372 +_LVOCWait = -378 +_LVOVBeamPos = -384 +_LVOInitBitMap = -390 +_LVOScrollRaster = -396 +_LVOWaitBOVP = -402 +_LVOGetSprite = -408 +_LVOFreeSprite = -414 +_LVOChangeSprite = -420 +_LVOMoveSprite = -426 +_LVOLockLayerROM = -432 +_LVOUnLockLayerROM = -438 +_LVOSyncSBitMap = -444 +_LVOCopySBitMap = -450 +_LVOOwnBlitter = -456 +_LVODisownBlitter = -462 +_LVOInitTmpRas = -468 +_LVOAskFont = -474 +_LVOAddFont = -480 +_LVORemFont = -486 +_LVOAllocRaster = -492 +_LVOFreeRaster = -498 +_LVOAndRectRegion = -504 +_LVOOrRectRegion = -510 +_LVONewRegion = -516 +_LVOClearRectRegion = -522 +_LVOClearRegion = -528 +_LVODisposeRegion = -534 +_LVOFreeVPortCopLists = -540 +_LVOFreeCopList = -546 +_LVOClipBlit = -552 +_LVOXorRectRegion = -558 +_LVOFreeCprList = -564 +_LVOGetColorMap = -570 +_LVOFreeColorMap = -576 +_LVOGetRGB4 = -582 +_LVOScrollVPort = -588 +_LVOUCopperListInit = -594 +_LVOFreeGBuffers = -600 +_LVOBltBitMapRastPort = -606 +_LVOOrRegionRegion = -612 +_LVOXorRegionRegion = -618 +_LVOAndRegionRegion = -624 +_LVOSetRGB4CM = -630 +_LVOBltMaskBitMapRastPort = -636 +_LVOGraphicsReserved1 = -642 +_LVOGraphicsReserved2 = -648 +_LVOAttempLockLayerROM = -654 + +_LVOGetWBObject = -30 +_LVOPutWBObject = -36 +_LVOGetIcon = -42 +_LVOPutIcon = -48 +_LVOFreeFreeList = -54 +_LVOFreeWBObject = -60 +_LVOAllocWBObject = -66 +_LVOAddFreeList = -72 +_LVOGetDiskObject = -78 +_LVOPutDiskObject = -84 +_LVOFreeDiskObject = -90 +_LVOFindToolType = -96 +_LVOMatchToolValue = -102 +_LVOBumpRevision = -108 + +_LVOOpenIntuition = -30 +_LVOIntuition = -36 +_LVOAddGadget = -42 +_LVOClearDMRequest = -48 +_LVOClearMenuStrip = -54 +_LVOClearPointer = -60 +_LVOCloseScreen = -66 +_LVOCloseWindow = -72 +_LVOCloseWorkBench = -78 +_LVOCurrentTime = -84 +_LVODisplayAlert = -90 +_LVODisplayBeep = -96 +_LVODoubleClick = -102 +_LVODrawBorder = -108 +_LVODrawImage = -114 +_LVOEndRequest = -120 +_LVOGetDefPrefs = -126 +_LVOGetPrefs = -132 +_LVOInitRequester = -138 +_LVOItemAddress = -144 +_LVOModifyIDCMP = -150 +_LVOModifyProp = -156 +_LVOMoveScreen = -162 +_LVOMoveWindow = -168 +_LVOOffGadget = -174 +_LVOOffMenu = -180 +_LVOOnGadget = -186 +_LVOOnMenu = -192 +_LVOOpenScreen = -198 +_LVOOpenWindow = -204 +_LVOOpenWorkBench = -210 +_LVOPrintIText = -216 +_LVORefreshGadgets = -222 +_LVORemoveGadget = -228 +_LVOReportMouse = -234 +_LVORequest = -240 +_LVOScreenToBack = -246 +_LVOScreenToFront = -252 +_LVOSetDMRequest = -258 +_LVOSetMenuStrip = -264 +_LVOSetPointer = -270 +_LVOSetWindowTitles = -276 +_LVOShowTitle = -282 +_LVOSizeWindow = -288 +_LVOViewAddress = -294 +_LVOViewPortAddress = -300 +_LVOWindowToBack = -306 +_LVOWindowToFront = -312 +_LVOWindowLimits = -318 +_LVOSetPrefs = -324 +_LVOIntuiTextLength = -330 +_LVOWBenchToBack = -336 +_LVOWBenchToFront = -342 +_LVOAutoRequest = -348 +_LVOBeginRefresh = -354 +_LVOBuildSysRequest = -360 +_LVOEndRefresh = -366 +_LVOFreeSysRequest = -372 +_LVOMakeScreen = -378 +_LVORemakeDisplay = -384 +_LVORethinkDisplay = -390 +_LVOAllocRemember = -396 +_LVOAlohaWorkbench = -402 +_LVOFreeRemember = -408 +_LVOLockIBase = -414 +_LVOUnlockIBase = -420 +_LVOGetScreenData = -426 +_LVORefreshGList = -432 +_LVOAddGList = -438 +_LVORemoveGList = -444 +_LVOActivateWindow = -450 +_LVORefreshWindowFrame = -456 +_LVOActivateGadget = -462 +_LVONewModifyProp = -468 + +_LVOInitLayers = -30 +_LVOCreateUpfrontLayer = -36 +_LVOCreateBehindLayer = -42 +_LVOUpfrontLayer = -48 +_LVOBehindLayer = -54 +_LVOMoveLayer = -60 +_LVOSizeLayer = -66 +_LVOScrollLayer = -72 +_LVOBeginUpdate = -78 +_LVOEndUpdate = -84 +_LVODeleteLayer = -90 +_LVOLockLayer = -96 +_LVOUnlockLayer = -102 +_LVOLockLayers = -108 +_LVOUnlockLayers = -114 +_LVOLockLayerInfo = -120 +_LVOSwapBitsRastPortClipRect = -126 +_LVOWhichLayer = -132 +_LVOUnlockLayerInfo = -138 +_LVONewLayerInfo = -144 +_LVODisposeLayerInfo = -150 +_LVOFattenLayerInfo = -156 +_LVOThinLayerInfo = -162 +_LVOMoveLayerInFrontOf = -168 +_LVOInstallClipRegion = -174 + +_LVOSPFix = -30 +_LVOSPFlt = -36 +_LVOSPCmp = -42 +_LVOSPTst = -48 +_LVOSPAbs = -54 +_LVOSPNeg = -60 +_LVOSPAdd = -66 +_LVOSPSub = -72 +_LVOSPMul = -78 +_LVOSPDiv = -84 +_LVOSPFloor = -90 +_LVOSPCeil = -96 + +_LVOIEEEDPFix = -30 +_LVOIEEEDPFlt = -36 +_LVOIEEEDPCmp = -42 +_LVOIEEEDPTst = -48 +_LVOIEEEDPAbs = -54 +_LVOIEEEDPNeg = -60 +_LVOIEEEDPAdd = -66 +_LVOIEEEDPSub = -72 +_LVOIEEEDPMul = -78 +_LVOIEEEDPDiv = -84 +_LVOIEEEDPFloor = -90 +_LVOIEEEDPCeil = -96 + +_LVOIEEESPFix = -30 +_LVOIEEESPFlt = -36 +_LVOIEEESPCmp = -42 +_LVOIEEESPTst = -48 +_LVOIEEESPAbs = -54 +_LVOIEEESPNeg = -60 +_LVOIEEESPAdd = -66 +_LVOIEEESPSub = -72 +_LVOIEEESPMul = -78 +_LVOIEEESPDiv = -84 + +_LVOSPAtan = -30 +_LVOSPSin = -36 +_LVOSPCos = -42 +_LVOSPTan = -48 +_LVOSPSincos = -54 +_LVOSPSinh = -60 +_LVOSPCosh = -66 +_LVOSPTanh = -72 +_LVOSPExp = -78 +_LVOSPLog = -84 +_LVOSPPow = -90 +_LVOSPSqrt = -96 +_LVOSPTieee = -102 +_LVOSPFieee = -108 +_LVOSPAsin = -114 +_LVOSPAcos = -120 +_LVOSPLog10 = -126 + +_LVOAllocPotBits = -6 +_LVOFreePotBits = -12 +_LVOWritePotgo = -18 + +_LVOAddTime = -42 +_LVOSubTime = -48 +_LVOCmpTime = -54 + +_LVOTranslate = -30 +_LVOLoadRGB32 = -882 +_LVOSetRGB32 = -852 +_LVOColdReboot = -726 +_LVOOpenScreenTaglist = -612 + +_LVOCacheClearU = -$27c + +_LVOAddICRVector EQU -6 +_LVORemICRVector EQU -12 +_LVOAbleICR EQU -18 +_LVOSetICR EQU -24 diff --git a/source/includes/resources/disk.i b/source/includes/resources/disk.i new file mode 100644 index 0000000..5816453 --- /dev/null +++ b/source/includes/resources/disk.i @@ -0,0 +1,121 @@ + IFND RESOURCES_DISK_I +RESOURCES_DISK_I SET 1 +** +** $VER: disk.i 27.10 (21.11.90) +** Includes Release 40.16 +** +** disk.i -- external declarations for the disk resource +** +** (C) Copyright 1985-1995 ESCOM AG +** All Rights Reserved +** + + IFND EXEC_TYPES_I + INCLUDE "exec/types.i" + ENDC !EXEC_TYPES_I + + IFND EXEC_LISTS_I + INCLUDE "exec/lists.i" + ENDC !EXEC_LISTS_I + + IFND EXEC_PORTS_I + INCLUDE "exec/ports.i" + ENDC !EXEC_PORTS_I + + IFND EXEC_INTERRUPTS_I + INCLUDE "exec/interrupts.i" + ENDC !EXEC_INTERRUPTS_I + + IFND EXEC_LIBRARIES_I + INCLUDE "exec/libraries.i" + ENDC !EXEC_LIBRARIES_I + + +********************************************************************* +* +* Resource structures +* +********************************************************************* + + STRUCTURE DISCRESOURCEUNIT,MN_SIZE + STRUCT DRU_DISCBLOCK,IS_SIZE + STRUCT DRU_DISCSYNC,IS_SIZE + STRUCT DRU_INDEX,IS_SIZE + LABEL DRU_SIZE + + + + STRUCTURE DISCRESOURCE,LIB_SIZE + APTR DR_CURRENT ; pointer to current unit structure + UBYTE DR_FLAGS + UBYTE DR_pad + APTR DR_SYSLIB + APTR DR_CIARESOURCE + STRUCT DR_UNITID,4*4 + STRUCT DR_WAITING,LH_SIZE + STRUCT DR_DISCBLOCK,IS_SIZE + STRUCT DR_DISCSYNC,IS_SIZE + STRUCT DR_INDEX,IS_SIZE + APTR DR_CURRTASK ; pointer to owning task for GiveUnit + LABEL DR_SIZE + + BITDEF DR,ALLOC0,0 ; unit zero is allocated + BITDEF DR,ALLOC1,1 ; unit one is allocated + BITDEF DR,ALLOC2,2 ; unit two is allocated + BITDEF DR,ALLOC3,3 ; unit three is allocated + BITDEF DR,ACTIVE,7 ; is the disc currently busy? + + +********************************************************************* +* +* Hardware Magic +* +********************************************************************* + + +DSKDMAOFF EQU $4000 ; idle command for dsklen register + + +********************************************************************* +* +* Resource specific commands +* +********************************************************************* + +*-- DR_NAME is a generic macro to get the name of the resource. This +*-- way if the name is ever changed you will pick up the change +*-- automatically. +*-- +*-- Normal usage would be: +*-- +*-- internalName: DISKNAME +*-- + +DISKNAME: MACRO + DC.B 'disk.resource',0 + DS.W 0 + ENDM + + LIBINIT LIB_BASE + LIBDEF DR_ALLOCUNIT + LIBDEF DR_FREEUNIT + LIBDEF DR_GETUNIT + LIBDEF DR_GIVEUNIT + LIBDEF DR_GETUNITID + LIBDEF DR_READUNITID + +DR_LASTCOMM EQU DR_READUNITID + + +********************************************************************* +* +* drive types +* +********************************************************************* + +DRT_AMIGA EQU $00000000 +DRT_37422D2S EQU $55555555 +DRT_EMPTY EQU $FFFFFFFF +DRT_150RPM EQU $AAAAAAAA + + ENDC ; RESOURCES_DISK_I diff --git a/source/includes/uae/uaestuff.i b/source/includes/uae/uaestuff.i new file mode 100644 index 0000000..e997bd6 --- /dev/null +++ b/source/includes/uae/uaestuff.i @@ -0,0 +1,73 @@ +MEMPF_READ = $0001 +MEMPF_WRITE = $0002 +MEMPF_DMAREAD = $0004 +MEMPF_DMAWRITE = $0008 +MEMPF_ALL = MEMPF_READ | MEMPF_WRITE | MEMPF_DMAREAD | MEMPF_DMAWRITE + + IF NEWAGE_DEBUG + +UAEExitWarp MACRO + pea 1.w + pea .ob\@(pc) + clr.l -(sp) + pea .wm\@(pc) + pea -1.w + pea 82.w + jsr $f0ff60 + lea .bc\@(pc),a0 + move.l a0,8(sp) + jsr $f0ff60 + lea 6*4(sp),sp + bra.s .s\@ +.ob\@ dc.l 0 +.wm\@ dc.b "warp false",0 +.bc\@ dc.b "cycle_exact true",0 + cnop 0,2 +.s\@ + ENDM + +UAEExit MACRO + move.l #13,-(sp) + jmp $f0ff60 + ENDM + +; UAEMemProtect address,size,bits + +UAEMemProtect MACRO + move.l #\3,-(sp) + move.l #\2,-(sp) + pea \1 + jsr $f0ff54 + lea.l 12(sp),sp + ENDM + +WinUAEBreakpoint MACRO ;to stop here in WinUAE, enter "w 4 4 4 w" in the debugger window (shift+f12) to place the breakpoint, and enter "w 4" to remove it + move.l 4.w,4.w + ENDM + +; The UAE debugger doesn‘t know about any symbols your program might have defined, +; so setting a breakpoint to some address is no big help. +; The trick is to use the fi (find instruction) command to break at a specific opcode. +; You cannot use any common opcode, of course, otherwise the debugger will constantly +; stop in all kinds of processes. Use an opcode which doesn‘t appear anywhere else and +; which, preferably, has no effect. Something like EXG A7,A7 ($cf4f). + +; Insert this opcode into your code at the position you want to start debugging. +; Then enter fi cf4f into the debugger. Start your program and begin tracing your program flow. +; t executes a single instruction, z executes code over subroutines, m does memory dumps. + + ELSE + +UAEExitWarp MACRO + ENDM + +UAEMemProtect MACRO + ENDM + +UAEExit MACRO + ENDM + +WinUAEBreakpoint MACRO + ENDM + + ENDC diff --git a/source/includes/workbench/startup.i b/source/includes/workbench/startup.i new file mode 100644 index 0000000..a535661 --- /dev/null +++ b/source/includes/workbench/startup.i @@ -0,0 +1,42 @@ + IFND WORKBENCH_STARTUP_I +WORKBENCH_STARTUP_I EQU 1 +** +** $Filename: workbench/startup.i $ +** $Release: 2.04 Includes, V37.4 $ +** $Revision: 36.4 $ +** $Date: 90/12/02 $ +** +** workbench startup definitions +** +** (C) Copyright 1985-1991 Commodore-Amiga, Inc. +** All Rights Reserved +** + + IFND EXEC_TYPES_I + INCLUDE "exec/types.i" + ENDC + + IFND EXEC_PORTS_I + INCLUDE "exec/ports.i" + ENDC + + ;IFND LIBRARIES_DOS_I + ;INCLUDE "libraries/dos.i" + ;ENDC + + STRUCTURE WBStartup,0 + STRUCT sm_Message,MN_SIZE ; a standard message structure + APTR sm_Process ; the process descriptor for you + BPTR sm_Segment ; a descriptor for your code + LONG sm_NumArgs ; the number of elements in ArgList + APTR sm_ToolWindow ; description of window + APTR sm_ArgList ; the arguments themselves + LABEL sm_SIZEOF + + STRUCTURE WBArg,0 + BPTR wa_Lock ; a lock descriptor + APTR wa_Name ; a string relative to that lock + LABEL wa_SIZEOF + + ENDC ; WORKBENCH_STARTUP_I + diff --git a/source/kaleidoscope/aga.bat b/source/kaleidoscope/aga.bat new file mode 100644 index 0000000..8f92350 --- /dev/null +++ b/source/kaleidoscope/aga.bat @@ -0,0 +1,30 @@ +del kaleidoscope.exe +del "..\winuae\hd0\kaleidoscope.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "kaleidoscope.exe" "kaleidoscope.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy kaleidoscope.exe "..\winuae\hd0" +copy kaleidoscope.exe "..\winuae\hd0\a" + +@echo /|set /p =kaleidoscope.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/kaleidoscope/assemble.bat b/source/kaleidoscope/assemble.bat new file mode 100644 index 0000000..9e4018c --- /dev/null +++ b/source/kaleidoscope/assemble.bat @@ -0,0 +1,40 @@ +del kaleidoscope.exe +del "..\winuae\hd0\kaleidoscope.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +pushd .. + +tools\KingCon.exe @data/kaleidoscope/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\LSPConvert.exe data\music\desire_demo_68k_v6.mod -setpos -v +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +vc -O2 -notmpfile -nostdlib -o "kaleidoscope.exe" "kaleidoscope.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy kaleidoscope.exe "..\winuae\hd0" +copy kaleidoscope.exe "..\winuae\hd0\a" + +@echo /|set /p =kaleidoscope.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_hrt_more_mem.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/kaleidoscope/blitterline_sync.asm b/source/kaleidoscope/blitterline_sync.asm new file mode 100644 index 0000000..2d7e17c --- /dev/null +++ b/source/kaleidoscope/blitterline_sync.asm @@ -0,0 +1,194 @@ +;---------------------------------------------------------------------------------- +; Draw regular blitter line +; +; The routine will exit with the blitter active +; +; in d0.w x0 +; d1.w y0 +; d2.w x1 +; d3.w y1 +; d4.w bytes per row in bitplane +; a0 bitplane +; a5 $dff000 +; a0/d0-d5 trashed + +kds_blitter_line_init: + moveq.l #-1,d0 + + BLTHOGON + BLTWAIT + move.w #BLTCON1F_LINE,bltcon1(a5) + + move.w #$8000,bltadat(a5) + move.l d0,bltafwm(a5) + move.w d4,bltcmod(a5) + move.w d0,bltbdat(a5) + rts + +kds_draw_blitter_singledot_line: + IF 1 + cmp.w d1,d3 + bge.s .downward + exg d0,d2 + exg d1,d3 +.downward + ENDC + + move.w d1,d5 + mulu d4,d5 + add.l d5,a0 + + moveq.l #-16,d4 + and.w d0,d4 + lsr.w #3,d4 + add.w d4,a0 + + moveq.l #15,d4 + and.w d0,d4 + ror.w #4,d4 + or.w #BLTCON0F_USEA|BLTCON0F_USEC|BLTCON0F_USED|(BLT_A&BLT_B^BLT_C),d4 + swap d4 + + sub.w d0,d2 + bpl.s .positiveDX + neg.w d2 + addq.w #1,d4 +.positiveDX + sub.w d1,d3 + IF 0 + bpl.s .positiveDY + neg.w d3 + addq.w #2,d4 +.positiveDY + ENDC + cmp.w d2,d3 + bls.s .absDyLessThanAbsDx + exg d2,d3 + addq.w #4,d4 +.absDyLessThanAbsDx + move.b .octants(pc,d4.w),d4 + + add.w d3,d3 ; 2 * dy + move.w d3,d5 + sub.w d2,d5 ; 2 * dy - dx + bpl.s .positiveGradient + or.w #BLTCON1F_SIGN,d4 +.positiveGradient + add.w d5,d5 ; 4 * dy - 2 * dx + add.w d2,d2 ; 2 * dx + add.w d2,d2 ; 4 * dx + add.w d3,d3 ; 4 * dy + + move.w d3,d0 + sub.w d2,d3 ; 4 * (dy - dx) + addq.w #4,d2 ; extra word height + lsl.w #4,d2 + addq.w #2,d2 ; width == 2 + + BLTWAIT + + move.l d4,bltcon0(a5) + move.w d3,bltamod(a5) ; 4 * (dy - dx) + move.w d0,bltbmod(a5) ; 4 * dy + move.w d5,bltapt+2(a5) ; 4 * dy - 2 * dx + + move.l a0,bltcpt(a5) + ;move.l #blitter_temp_output_word,bltdpt(a5) + move.l a0,bltdpt(a5) + move.w d2,bltsize(a5) + + rts + +.octants + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUD ; octant 7 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_AUL ; octant 4 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_SUL ; octant 0 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_SUL|BLTCON1F_AUL ; octant 3 + dc.b BLTCON1F_SING|BLTCON1F_LINE|0 ; octant 6 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUL ; octant 5 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_AUL ; octant 1 + dc.b BLTCON1F_SING|BLTCON1F_LINE|BLTCON1F_SUL|BLTCON1F_AUL ; octant 2 + +kds_draw_blitter_normal_line: + IF 1 + cmp.w d1,d3 + bge.s .downward + exg d0,d2 + exg d1,d3 +.downward + ENDC + + move.w d1,d5 + mulu d4,d5 + add.l d5,a0 + + moveq.l #-16,d4 + and.w d0,d4 + lsr.w #3,d4 + add.w d4,a0 + + moveq.l #15,d4 + and.w d0,d4 + ror.w #4,d4 + or.w #BLTCON0F_USEA|BLTCON0F_USEC|BLTCON0F_USED|(BLT_A&BLT_B|BLT_C),d4 + swap d4 + + sub.w d0,d2 + bpl.s .positiveDX + neg.w d2 + addq.w #1,d4 +.positiveDX + sub.w d1,d3 + IF 0 + bpl.s .positiveDY + neg.w d3 + addq.w #2,d4 +.positiveDY + ENDC + cmp.w d2,d3 + bls.s .absDyLessThanAbsDx + exg d2,d3 + addq.w #4,d4 +.absDyLessThanAbsDx + move.b .octants(pc,d4.w),d4 + + add.w d3,d3 ; 2 * dy + move.w d3,d5 + sub.w d2,d5 ; 2 * dy - dx + bpl.s .positiveGradient + or.w #BLTCON1F_SIGN,d4 +.positiveGradient + add.w d5,d5 ; 4 * dy - 2 * dx + add.w d2,d2 ; 2 * dx + add.w d2,d2 ; 4 * dx + add.w d3,d3 ; 4 * dy + + move.w d3,d0 + sub.w d2,d3 ; 4 * (dy - dx) + addq.w #4,d2 ; extra word height + lsl.w #4,d2 + addq.w #2,d2 ; width == 2 + + BLTWAIT + + move.l d4,bltcon0(a5) + move.w d3,bltamod(a5) ; 4 * (dy - dx) + move.w d0,bltbmod(a5) ; 4 * dy + move.w d5,bltapt+2(a5) ; 4 * dy - 2 * dx + + move.l a0,bltcpt(a5) + ;move.l #blitter_temp_output_word,bltdpt(a5) + move.l a0,bltdpt(a5) + move.w d2,bltsize(a5) + + rts + +.octants + dc.b BLTCON1F_LINE|BLTCON1F_SUD ; octant 7 + dc.b BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_AUL ; octant 4 + dc.b BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_SUL ; octant 0 + dc.b BLTCON1F_LINE|BLTCON1F_SUD|BLTCON1F_SUL|BLTCON1F_AUL ; octant 3 + dc.b BLTCON1F_LINE|0 ; octant 6 + dc.b BLTCON1F_LINE|BLTCON1F_SUL ; octant 5 + dc.b BLTCON1F_LINE|BLTCON1F_AUL ; octant 1 + dc.b BLTCON1F_LINE|BLTCON1F_SUL|BLTCON1F_AUL ; octant 2 diff --git a/source/kaleidoscope/compile.bat b/source/kaleidoscope/compile.bat new file mode 100644 index 0000000..6e7e73f --- /dev/null +++ b/source/kaleidoscope/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "kaleidoscope.exe" "kaleidoscope.asm" diff --git a/source/kaleidoscope/debug.bat b/source/kaleidoscope/debug.bat new file mode 100644 index 0000000..6888e29 --- /dev/null +++ b/source/kaleidoscope/debug.bat @@ -0,0 +1,21 @@ +del kaleidoscope.exe +del "..\winuae\hd0\kaleidoscope.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "kaleidoscope.exe" "kaleidoscope.asm" + +copy kaleidoscope.exe "..\winuae\hd0" +copy kaleidoscope.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =kaleidoscope.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/kaleidoscope/kaleidoscope.asm b/source/kaleidoscope/kaleidoscope.asm new file mode 100644 index 0000000..4d8d3fb --- /dev/null +++ b/source/kaleidoscope/kaleidoscope.asm @@ -0,0 +1,6347 @@ +; TODOs: +; - Fix bug with center line coloring being wrong +; - Fix one-pixel offset in pattern (when negative?) +; - Fix visual bugs (16 pixel wide stripe) when going back to fadeout mode +; +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 1 +FW_MUSIC_PLAYER_CHOICE = 2 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker (CPU DMA wait), 5 = Pretracker Turbo (Copper wait) +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 0 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 308 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 1 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 1 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 0 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 1 +PART_MUSIC_START_POS = 10 + + ENDC + +STENCIL_WIDTH = 64 +STENCIL_HEIGHT = 53 ; actually ((sqrt(3)/2))*64 = 55.425 +LCOLBUF_HEIGHT = 64 +LCOL_NUM = 10 + +KALEIDO_WIDTH = 320 +KALEIDO_HEIGHT = STENCIL_HEIGHT +KALEIDO_VHEIGHT = 180 +KALEIDO_PLANES = 6 +KALEIDO_BUF_WIDTH = 2*KALEIDO_WIDTH + +INTRO_SPRITE_WIDTH = 2*STENCIL_WIDTH +INTRO_SPRITE_SHEIGHT = 2*STENCIL_HEIGHT-1 +INTRO_SPRITE_HEIGHT = KALEIDO_VHEIGHT + +LAST_SLICE_HEIGHT = KALEIDO_VHEIGHT-(STENCIL_HEIGHT*3-3) + +KDSPAT_WIDTH = 256 +KDSPAT_HEIGHT = 256 +KDSPAT_THEIGHT = 3*KDSPAT_HEIGHT + +NOISE_WIDTH = 128 +NOISE_HEIGHT = 1024+KALEIDO_VHEIGHT + +SPLINE_TABLE_SIZE = 128 + +NUM_BACK_DUST = 80 +NUM_FRONT_DUST = 80 + +FAIRY_WIDTH = 64 +FAIRY_HEIGHT = 64 +FAIRY_PLANES = 4 + +BODY_WIDTH = 48 +BODY_HEIGHT = 51 +BODY_PLANES = 4 +BODY_XOFFSET = 0 +BODY_YOFFSET = 5 +NUM_BODY_FRAMES = 3 + +PUFF_WIDTH = 32 +PUFF_HEIGHT = 15 +PUFF_PLANES = 4 +PUFF_XOFFSET = 32 +PUFF_YOFFSET = 19 +NUM_PUFF_FRAMES = 4 + +COP_PREAMBLE_INST = 100 ; bplptrs +COP_POST_INST = 16 ; wait +COP_INST_PER_LINE = 1+10 ; wait, 10 colors +COP_INST_PER_INTRO_LINE = 1+3 ; wait, 3 colors +COP_INST_PER_PMAIN_LINE = 1+7+1+20 ; wait, 7 colors, 20 sprite pos +COP_LIST_SIZE = (COP_PREAMBLE_INST+COP_INST_PER_PMAIN_LINE*KALEIDO_VHEIGHT+COP_POST_INST)*4 + +STENCILS_BUFFER_SIZE = ((STENCIL_WIDTH/8)*STENCIL_HEIGHT*KALEIDO_PLANES)*2+((STENCIL_WIDTH/8)*STENCIL_HEIGHT)*2 +SPRITES_BUFFER_SIZE = (INTRO_SPRITE_WIDTH/16)*((INTRO_SPRITE_HEIGHT+2)*2*2) + +CHIPMEM_SIZE = COP_LIST_SIZE*2+(KALEIDO_BUF_WIDTH/8)*KALEIDO_HEIGHT*KALEIDO_PLANES*2+STENCILS_BUFFER_SIZE+SPRITES_BUFFER_SIZE*2+4*LCOL_NUM*LCOLBUF_HEIGHT*2*2+NOISE_WIDTH/8*NOISE_HEIGHT+(BODY_WIDTH/8)*BODY_HEIGHT*BODY_PLANES*NUM_BODY_FRAMES+(PUFF_WIDTH/8)*PUFF_HEIGHT*PUFF_PLANES*NUM_PUFF_FRAMES+(FAIRY_WIDTH/8)*FAIRY_HEIGHT*FAIRY_PLANES +FASTMEM_SIZE = 2048*4+KDSPAT_WIDTH*KDSPAT_THEIGHT*2 + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + + include "../framework/framework.i" + +; Chip memory use: +; - CHIP DATA: 256 x 256 x 6 x 3 = 147456 (Pattern/Texture) +; +; - CHIP BSS : 320 x 53 x 6 x 2 = 25440 (6x2 db) +; - CHIP BSS : 320 x 53 x 6 x 2 = 25440 (working space) +; - CHIP BSS : 2 x 180 x10 x 2 = 7200 (10 line colors, db) +; - CHIP BSS : 10 x 180 x 2 = 15840 (copperlists) +; +; Total: 207 KB +; +; Fast memory use: +; - FAST BSS : 256 x 256 x 3 = 393216 (True color buffer) +; - FAST BSS : 2000 = 2000 (Blitterqueues) +; +; 0) 1) 2) 3) 4) 5) +; Index = 000 -> 00 (I) -> 00 (I) -> 00 (I) -> 00 (I) -> 00 (I) +; Blue = 101 -> 10 (R) -> 01 (B) -> 11 (G) -> 10 (R) -> 11 (G) +; Red = 110 -> 01 (B) -> 11 (G) -> 10 (R) -> 11 (G) -> 01 (B) +; Green = 111 -> 11 (G) -> 10 (R) -> 01 (B) -> 01 (B) -> 10 (R) +; +; 0) RGB p5 := o5 ; p6 := o6 +; 1) BGR p5 := o6 ; p6 := o5 -> Red <-> Blue +; 2) GRB p5 := o5 ^ o6 ; p6 := o6 -> Red <-> Green +; 3) RBG p5 := o5 ; p6 := o5 ^ o6 -> Green <-> Blue +; 4) GBR p5 := o5 ^ o6 ; p6 := o5 -> Red := Green, Green := Blue, Blue := Red +; 5) BRG p5 := o6 ; p6 := o5 ^ o6 -> Red := Blue , Green := Red , Blue := Green + +; start out with 0000/0000, then 1010/1010, then 1010/4040, then 1010/4343, then 1012/4343, then 1012/4345 +; original: 1 0 1 0 +; combos : GRB (2) xor|p6, BRG (5) p6|xor +; changes p5 for 24 after first mirror +; changes p6 for 43 after second mirror and p5 to o5 or o6 (for 4345) + +; masks needed: 13, 4, 134, 3 +; buffers needed: p5_xor, p6_xor, p5_org2, p6_xor2, p5_org3 (partial) +; + + STRUCTURE FairyDust,0 + WORD fd_Time + ULONG fd_PosY + ULONG fd_PosX + ULONG fd_SpeedY + ULONG fd_SpeedX + LABEL fd_SIZEOF + + STRUCTURE HexagonPattern,0 + APTR hp_CopListRoutine ; to be called for every copperlist to update copperlist mirror pointers + APTR hp_DrawRoutine + APTR hp_FixupRoutine + APTR hp_Col2Routine + APTR hp_Col3Routine + APTR hp_Col4Routine + APTR hp_Pos1Routine + APTR hp_Pos2Routine + STRUCT hp_ColOffs,4*LCOL_NUM*2 ; four mirrors, first hexagon, second hexagon (plus border), third hexagon + LABEL hp_SIZEOF + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrPlanesPtr + APTR pd_LastPlanesPtr + APTR pd_CurrP5Xor6PlanePtr + APTR pd_CurrP6Xor5PlanePtr + APTR pd_CurrP5BonusPlanePtr + APTR pd_CurrP5BottomPlanePtr + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + APTR pd_CurrTCLineColorsPtr + APTR pd_LastTCLineColorsPtr + APTR pd_CurrSpriteStencilPtr + APTR pd_CurrFairySprite + UBYTE pd_DbToggle + ALIGNWORD + + UWORD pd_PartCountDown + UWORD pd_TransitionHeight + + APTR pd_CopperList1 + APTR pd_CopperList2 + APTR pd_DbBuffer + + UWORD pd_CopperLinesFixupOffset1 + UWORD pd_CopperLinesFixupOffset2 + UWORD pd_CopperLinesFixupOffset3 + UWORD pd_CopperLinesFixupOffset4 + UWORD pd_CopperMirror1P5PtrOffset + UWORD pd_CopperMirror2P56PtrOffset + UWORD pd_CopperMirror3P5PtrOffset + + APTR pd_OriginalPattern + APTR pd_StencilBuffer1 + APTR pd_StencilBuffer2 + APTR pd_StencilSprBuffer1 + APTR pd_StencilSprBuffer2 + APTR pd_TrueColorImage1 + APTR pd_TrueColorImage2 + APTR pd_TrueColorImage3 + APTR pd_TCLineColors1 + APTR pd_TCLineColors2 + APTR pd_HexagonTopMaskPtr + APTR pd_HexagonBottomMaskPtr + APTR pd_Hexagon2MaskPtr + APTR pd_BonusGridPtr + APTR pd_P5Xor6Plane1Ptr + APTR pd_P5Xor6Plane2Ptr + APTR pd_P6Xor5Plane1Ptr + APTR pd_P6Xor5Plane2Ptr + APTR pd_P5BonusPlane1Ptr + APTR pd_P5BonusPlane2Ptr + APTR pd_P5BottomPlane1Ptr + APTR pd_P5BottomPlane2Ptr + + UWORD pd_FairySpriteFrame + UWORD pd_PuffSpriteFrame + UWORD pd_SplinePos + UWORD pd_FairyPosX + UWORD pd_FairyPosY + + UWORD pd_NextFrontDustOffset + UWORD pd_NextBackDustOffset + + ULONG pd_NoiseValueA + ULONG pd_NoiseValueB + + APTR pd_NoiseBuffer + UWORD pd_NoiseOffset + BOOL pd_EnableMirror1 + BOOL pd_EnableMirror2 + BOOL pd_EnableMirror3 + + APTR pd_BigSinCosTable + + WORD pd_CopperlistUpdate + UWORD pd_PosBaseCounter + WORD pd_Distance1 + UWORD pd_Angle1 + WORD pd_Distance2 + + BOOL pd_InteractiveMode + UBYTE pd_OldMouseY + UBYTE pd_OldMouseX + BYTE pd_DeltaMouseY + BYTE pd_DeltaMouseX + + ULONG pd_StencilOffset1 + ULONG pd_StencilOffset2 + ULONG pd_StencilOffset3 + ULONG pd_StencilOffset6 + ULONG pd_StencilOffset7 + ULONG pd_StencilOffset8 + ULONG pd_StencilTCOffset1 + ULONG pd_StencilTCOffset2 + ULONG pd_StencilTCOffset3 + ULONG pd_StencilTCOffset6 + ULONG pd_StencilTCOffset7 + ULONG pd_StencilTCOffset8 + UWORD pd_StencilShift1 + UWORD pd_StencilShift2 + UWORD pd_StencilShift3 + UWORD pd_StencilShift6 + UWORD pd_StencilShift7 + UWORD pd_StencilShift8 + + APTR pd_FairyAnim1 + APTR pd_FairyAnim2 + APTR pd_FairyAnim3 + APTR pd_FairyAnim4 + APTR pd_FairyMask1 + APTR pd_FairyMask2 + APTR pd_FairyMask3 + APTR pd_FairyMask4 + APTR pd_PuffAnim1 + APTR pd_PuffAnim2 + APTR pd_PuffAnim3 + APTR pd_PuffAnim4 + APTR pd_PuffMask1 + APTR pd_PuffMask2 + APTR pd_PuffMask3 + APTR pd_PuffMask4 + + APTR pd_SpriteCompoBuffer + + STRUCT pd_PreparationTask,ft_SIZEOF + STRUCT pd_IntroPalette,8*cl_SIZEOF + STRUCT pd_PatternInfo,hp_SIZEOF + STRUCT pd_CompSprites1,8*4 + STRUCT pd_CompSprites2,8*4 + STRUCT pd_SpriteStencil1Ptrs,8*4 + STRUCT pd_SpriteStencil2Ptrs,8*4 + STRUCT pd_BQBuffer,2500 + STRUCT pd_SMCLine1,(STENCIL_HEIGHT+2)*4 + STRUCT pd_SMCLine2,(STENCIL_HEIGHT+2)*4 + STRUCT pd_SMCLine3,(STENCIL_HEIGHT+2)*4 + STRUCT pd_SMCLineUp1,(STENCIL_HEIGHT+2)*4 + STRUCT pd_SMCLineUp2,(STENCIL_HEIGHT+2)*4 + STRUCT pd_SMCLineUp3,(STENCIL_HEIGHT+2)*4 + + STRUCT pd_BackDust,NUM_BACK_DUST*fd_SIZEOF + STRUCT pd_FrontDust,NUM_FRONT_DUST*fd_SIZEOF + + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + bsr.s kds_init + + lea kds_copperlist,a0 + CALLFW SetCopper + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + move.l #part_music_data,fw_MusicData(a6) + move.l #part_music_smp,fw_MusicSamples(a6) + CALLFW StartMusic + IFD PART_MUSIC_START_POS + moveq.l #PART_MUSIC_START_POS,d0 + CALLFW MusicSetPosition + move.w #3840,fw_MusicFrameCount(a6) + ENDC + ENDC + ENDC + + IF 1 + bsr kds_intro + bsr kds_transition + bsr kds_dissolve + ELSE + lea pd_PreparationTask(a6),a1 + CALLFW WaitUntilTaskFinished + ENDC + + move.w #$1fe,kds_extra_copperlist_ptr+8 + CALLFW VSyncWithTask + + bsr kds_pre_main + bsr kds_main + bsr kds_post_main + + CALLFW SetBaseCopper + rts + +;-------------------------------------------------------------------- + +kds_init: + bsr kds_init_vars + bsr kds_init_colors + bsr kds_clear_sprites + bsr kds_init_sine_table + bsr kds_generate_stencils + bsr kds_generate_spr_stencils + bsr kds_generate_hexagonmasks + + lea .backgroundtasks(pc),a0 + lea pd_PreparationTask(a6),a1 + CALLFW AddTask + rts + +.backgroundtasks + bsr kds_generate_smc_lines + move.l pd_OriginalPattern(a6),a0 + move.l pd_TrueColorImage1(a6),a1 + bsr kds_calc_true_color_image + move.l pd_TrueColorImage2(a6),a1 + bsr kds_calc_true_color_image + move.l pd_TrueColorImage3(a6),a1 + bsr kds_calc_true_color_image + bsr kds_fill_noise_buffer + rts + +;-------------------------------------------------------------------- + +kds_init_vars: + lea kds_kaleidoscope_pattern,a0 + move.l a0,pd_OriginalPattern(a6) + + move.l #kds_fairy_body1,pd_FairyAnim1(a6) + move.l #kds_fairy_body2,pd_FairyAnim2(a6) + move.l #kds_fairy_body3,pd_FairyAnim3(a6) + move.l #kds_fairy_body2,pd_FairyAnim4(a6) + move.l #kds_puff_sprite1,pd_PuffAnim1(a6) + move.l #kds_puff_sprite2,pd_PuffAnim2(a6) + move.l #kds_puff_sprite3,pd_PuffAnim3(a6) + move.l #kds_puff_sprite4,pd_PuffAnim4(a6) + + IFD FW_DEMO_PART + move.l #(KDSPAT_WIDTH*KDSPAT_HEIGHT*2*2),d0 + CALLFW AllocFast + PUTMSG 10,<"TrueColorImage %p">,a0 + move.l fw_GlobalUserData(a6),pd_TrueColorImage1(a6) + move.l a0,pd_TrueColorImage2(a6) + add.l #(KDSPAT_WIDTH*KDSPAT_HEIGHT)*2,a0 + move.l a0,pd_TrueColorImage3(a6) + ELSE + move.l #(KDSPAT_WIDTH*KDSPAT_THEIGHT*2),d0 + CALLFW AllocFast + PUTMSG 10,<"TrueColorImage %p">,a0 + move.l a0,pd_TrueColorImage1(a6) + add.l #(KDSPAT_WIDTH*KDSPAT_HEIGHT)*2,a0 + move.l a0,pd_TrueColorImage2(a6) + add.l #(KDSPAT_WIDTH*KDSPAT_HEIGHT)*2,a0 + move.l a0,pd_TrueColorImage3(a6) + ENDC + + move.l #(COP_LIST_SIZE*2),d0 + CALLFW AllocChip + + PUTMSG 10,<"Copperlist 1 %p">,a0 + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + lea COP_LIST_SIZE(a0),a0 + PUTMSG 10,<"Copperlist 2 %p">,a0 + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + move.l #(KALEIDO_BUF_WIDTH/8)*KALEIDO_HEIGHT*KALEIDO_PLANES,d0 + CALLFW AllocChip + PUTMSG 10,<"DbBuffer %p">,a0 + move.l a0,pd_DbBuffer(a6) + move.l a0,pd_CurrPlanesPtr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a1 + move.l a1,pd_LastPlanesPtr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a1 + + move.l #(KALEIDO_BUF_WIDTH/8)*KALEIDO_HEIGHT*KALEIDO_PLANES,d0 + CALLFW AllocChip + PUTMSG 10,<"P5Xor6Plane1Ptr %p">,a0 + move.l a0,pd_P5Xor6Plane1Ptr(a6) + move.l a0,pd_CurrP5Xor6PlanePtr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + move.l a0,pd_P5Xor6Plane2Ptr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + + move.l a0,pd_P6Xor5Plane1Ptr(a6) + move.l a0,pd_CurrP6Xor5PlanePtr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + move.l a0,pd_P6Xor5Plane2Ptr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + + move.l a0,pd_P5BonusPlane1Ptr(a6) + move.l a0,pd_CurrP5BonusPlanePtr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + move.l a0,pd_P5BonusPlane2Ptr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + + move.l a0,pd_P5BottomPlane1Ptr(a6) + move.l a0,pd_CurrP5BottomPlanePtr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + move.l a0,pd_P5BottomPlane2Ptr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + + move.l a0,pd_Hexagon2MaskPtr(a6) + lea (STENCIL_WIDTH/2)/8(a0),a1 + move.l a1,pd_HexagonTopMaskPtr(a6) + lea 1*KALEIDO_WIDTH/8(a0),a0 + move.l a0,pd_HexagonBottomMaskPtr(a6) + lea (3*STENCIL_WIDTH)/8(a0),a1 + move.l a1,pd_BonusGridPtr(a6) + + move.l #((STENCIL_WIDTH/8)*STENCIL_HEIGHT*KALEIDO_PLANES)*2,d0 + CALLFW AllocChip + PUTMSG 10,<"Stencil %p">,a0 + move.l a0,pd_StencilBuffer1(a6) + lea ((STENCIL_WIDTH/8)*STENCIL_HEIGHT*KALEIDO_PLANES)(a0),a0 + move.l a0,pd_StencilBuffer2(a6) + + move.l #((STENCIL_WIDTH/8)*STENCIL_HEIGHT)*2,d0 + CALLFW AllocChip + PUTMSG 10,<"Stencil Spr %p">,a0 + move.l a0,pd_StencilSprBuffer1(a6) + lea ((STENCIL_WIDTH/8)*STENCIL_HEIGHT)(a0),a0 + move.l a0,pd_StencilSprBuffer2(a6) + + move.l #4*LCOL_NUM*LCOLBUF_HEIGHT*2*2,d0 + CALLFW AllocChip + PUTMSG 10,<"TCLineColors %p">,a0 + move.l a0,pd_TCLineColors1(a6) + move.l a0,pd_CurrTCLineColorsPtr(a6) + lea 4*LCOL_NUM*LCOLBUF_HEIGHT*2(a0),a0 + move.l a0,pd_TCLineColors2(a6) + move.l a0,pd_LastTCLineColorsPtr(a6) + + move.l #SPRITES_BUFFER_SIZE*2,d0 + CALLFW AllocChip + PUTMSG 10,<"SpriteStencilPtrs %p">,a0 + move.l a0,d0 + lea pd_SpriteStencil1Ptrs(a6),a1 + move.l a1,pd_CurrSpriteStencilPtr(a6) + REPT (INTRO_SPRITE_WIDTH/16) + move.l a0,(a1)+ + lea ((INTRO_SPRITE_HEIGHT+2)*2*2)(a0),a0 + ENDR + REPT (INTRO_SPRITE_WIDTH/16) + move.l a0,(a1)+ + lea ((INTRO_SPRITE_HEIGHT+2)*2*2)(a0),a0 + ENDR + + move.l d0,a0 + lea pd_CompSprites1(a6),a1 + REPT (FAIRY_WIDTH/16)*2 + move.l a0,(a1)+ + lea ((FAIRY_HEIGHT+2)*2*2)(a0),a0 + ENDR + REPT (FAIRY_WIDTH/16)*2 + move.l a0,(a1)+ + lea ((FAIRY_HEIGHT+2)*2*2)(a0),a0 + ENDR + + move.l #(NOISE_WIDTH/8)*NOISE_HEIGHT,d0 + CALLFW AllocChip + PUTMSG 10,<"NoiseBuffer %p">,a0 + move.l a0,pd_NoiseBuffer(a6) + + move.l #2048*4,d0 + CALLFW AllocFast + move.l a0,pd_BigSinCosTable(a6) + + move.l #(BODY_WIDTH/8)*BODY_HEIGHT*BODY_PLANES*NUM_BODY_FRAMES,d0 + CALLFW AllocChip + PUTMSG 10,<"FairyMasks %p">,a0 + move.l a0,pd_FairyMask1(a6) + lea (BODY_WIDTH/8)*BODY_HEIGHT*BODY_PLANES(a0),a0 + move.l a0,pd_FairyMask2(a6) + move.l a0,pd_FairyMask4(a6) + lea (BODY_WIDTH/8)*BODY_HEIGHT*BODY_PLANES(a0),a0 + move.l a0,pd_FairyMask3(a6) + + move.l #(PUFF_WIDTH/8)*PUFF_HEIGHT*PUFF_PLANES*NUM_PUFF_FRAMES,d0 + CALLFW AllocChip + PUTMSG 10,<"PuffMasks %p">,a0 + move.l a0,pd_PuffMask1(a6) + lea (PUFF_WIDTH/8)*PUFF_HEIGHT*PUFF_PLANES(a0),a0 + move.l a0,pd_PuffMask2(a6) + lea (PUFF_WIDTH/8)*PUFF_HEIGHT*PUFF_PLANES(a0),a0 + move.l a0,pd_PuffMask3(a6) + lea (PUFF_WIDTH/8)*PUFF_HEIGHT*PUFF_PLANES(a0),a0 + move.l a0,pd_PuffMask4(a6) + + move.l #(FAIRY_WIDTH/8)*FAIRY_HEIGHT*FAIRY_PLANES,d0 + CALLFW AllocChip + PUTMSG 10,<"SpriteCompoBuffer %p">,a0 + move.l a0,pd_SpriteCompoBuffer(a6) + + lea kds_setting_1(pc),a0 + bsr kds_load_setting + + move.l #$3eb2427c,pd_NoiseValueA(a6) + move.l #$a7f9d461,pd_NoiseValueB(a6) + + move.l fw_SinTable(a6),a2 + move.l fw_CosTable(a6),a3 + moveq.l #0,d2 + move.w #256,d3 + move.w #-420+96,d4 + lea pd_FrontDust(a6),a1 + moveq.l #NUM_FRONT_DUST-1,d7 +.dloop move.w (a2,d2.w),d0 + move.w (a3,d2.w),d1 + add.w #123*2,d2 + and.w #1023*2,d2 + muls d3,d0 + muls d3,d1 + + asr.l #7,d0 + asr.l #7,d1 + move.l d0,fd_SpeedY(a1) + move.l d1,fd_SpeedX(a1) + addq.w #8,d3 + + move.w d4,fd_Time(a1) + addq.w #2,d4 + lea fd_SIZEOF(a1),a1 + dbra d7,.dloop + + rts + +;-------------------------------------------------------------------- + +kds_init_sine_table: + move.l fw_SinTable(a6),a0 + move.l fw_CosTable(a6),a1 + move.w (a1),d2 + move.l pd_BigSinCosTable(a6),a2 + PUTMSG 10,<"BigSinCosTable %p">,a2 + move.w #1023-1,d7 +.bloop + move.w (a0)+,d0 + move.w (a1)+,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + add.w (a0),d0 + add.w (a1),d1 + asr.w #1,d0 + asr.w #1,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + dbra d7,.bloop + + move.w (a0)+,d0 + move.w (a1)+,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + add.w (a0),d0 + add.w d2,d1 + asr.w #1,d0 + asr.w #1,d1 + move.w d0,(a2)+ + move.w d1,(a2)+ + rts + +;-------------------------------------------------------------------- + +kds_init_colors: + lea kds_fairy_sprite_palette(pc),a0 + lea color+16*2(a5),a1 + moveq.l #16-1,d7 +.sprpalloop + move.w (a0)+,(a1)+ + dbra d7,.sprpalloop + rts + +;-------------------------------------------------------------------- + +kds_fill_noise_buffer: + move.l pd_NoiseBuffer(a6),a0 + move.l pd_NoiseValueA(a6),d0 + move.l pd_NoiseValueB(a6),d1 + move.w #((NOISE_WIDTH/16)*NOISE_HEIGHT)-1,d7 + moveq.l #0,d4 +.rloop + moveq.l #16-1,d6 +.wloop + move.l d1,d2 + swap d2 + add.l d0,d1 + add.l d2,d0 + add.w d3,d3 + lsr.w #1,d2 + cmp.w d4,d2 + bhi.s .noadd1 + addq.w #1,d3 +.noadd1 dbra d6,.wloop + move.w d3,(a0)+ + addq.w #4,d4 + dbra d7,.rloop + move.l d0,pd_NoiseValueA(a6) + move.l d1,pd_NoiseValueB(a6) + + rts + +;-------------------------------------------------------------------- + +kds_intro: + PUTMSG 10,<"%d: Intro part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #420,pd_PartCountDown(a6) + CALLFW SetBlitterQueueSingleFrame + + bsr kds_prepare_intro_buffers + bsr kds_prepare_sprite_masks + + moveq.l #8,d0 + move.w #$fff,d1 + lea pd_IntroPalette(a6),a1 + CALLFW InitPaletteLerpSameColor + + moveq.l #8,d0 + moveq.l #32,d1 + lea kds_intro_palette(pc),a0 + lea pd_IntroPalette(a6),a1 + CALLFW FadePaletteTo + + bsr kds_flip_db_frame + bsr kds_create_intro_copperlist + + bsr kds_flip_db_frame + bsr kds_create_intro_copperlist + +.waitloop + CALLFW VSyncWithTask + cmp.w #4032,fw_MusicFrameCount(a6) + blt.s .waitloop + + PUTMSG 10,<"%d: Intro part launching (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + +.loop + bsr kds_flip_db_frame + + lea pd_BQBuffer(a6),a4 + bsr kds_draw_stencils_intro + + bsr kds_clear_compobuffer + + bsr kds_draw_dust + + bsr kds_draw_fairy_body + + bsr kds_draw_wand_heat + + bsr kds_convert_compobuffer_to_sprites + bsr kds_calc_stencil_positions1_slow + + moveq.l #8,d0 + lea pd_IntroPalette(a6),a1 + CALLFW DoFadePaletteStep + + bsr kds_calc_spline_pos + bsr kds_update_fairy_sprite + bsr kds_update_sprites_and_cols_in_copperlist + + CALLFW JoinBlitterQueue + + bsr kds_update_copper_list_pointers + + CALLFW VSyncWithTask + + subq.w #1,pd_PartCountDown(a6) + bne.s .loop + + rts + +;-------------------------------------------------------------------- + +kds_transition: + PUTMSG 10,<"%d: Transition part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + move.w #260,pd_PartCountDown(a6) + CALLFW SetBlitterQueueSingleFrame + + move.w pd_FairyPosX(a6),d3 + move.w pd_FairyPosY(a6),d4 + add.w #45,d3 + add.w #27,d4 + move.l pd_NoiseValueA(a6),d0 + move.l pd_NoiseValueB(a6),d1 + lea pd_FrontDust(a6),a1 + moveq.l #32,d5 + moveq.l #NUM_FRONT_DUST-1,d7 +.dloop + move.w d3,fd_PosX(a1) + move.w d4,fd_PosY(a1) + + move.l d1,d2 + swap d2 + add.l d0,d1 + add.l d2,d0 + moveq.l #15,d2 + and.w d0,d2 + add.w d5,d2 + move.w d2,fd_Time(a1) + + lea fd_SIZEOF(a1),a1 + dbra d7,.dloop + + move.l d0,pd_NoiseValueA(a6) + move.l d1,pd_NoiseValueB(a6) + +.loop + bsr kds_flip_db_frame + + lea pd_BQBuffer(a6),a4 + bsr kds_draw_stencils_intro + bsr kds_draw_stencils_transition + bsr kds_clear_compobuffer + + bsr kds_draw_dust + bsr kds_draw_fairy_body + bsr kds_draw_wand_blast + + bsr kds_draw_puff + bsr kds_convert_compobuffer_to_sprites + + bsr kds_calc_spline_pos + bsr kds_update_fairy_sprite + bsr kds_create_transition_copperlist + + bsr kds_calc_stencil_fixup_lines_transition + + bsr kds_calc_stencil_positions1_slow + + move.w pd_TransitionHeight(a6),d0 + cmp.w #STENCIL_HEIGHT*2-1,d0 + bge.s .skipth + addq.w #1,d0 + move.w d0,pd_TransitionHeight(a6) +.skipth + + CALLFW JoinBlitterQueue + + bsr kds_update_copper_list_pointers + + CALLFW VSyncWithTask + + subq.w #1,pd_PartCountDown(a6) + bne.s .loop + + rts + +;-------------------------------------------------------------------- + +kds_dissolve: + PUTMSG 10,<"%d: Dissolve part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + + CALLFW SetBlitterQueueSingleFrame + + bsr kds_clear_noise_sprite_buffer + move.w kds_intro_palette(pc),d0 + move.w d0,color+17*2(a5) + move.w d0,color+21*2(a5) + move.w d0,color+25*2(a5) + move.w d0,color+29*2(a5) + +.loop + bsr kds_flip_db_frame + move.l pd_CurrSpriteStencilPtr(a6),pd_CurrFairySprite(a6) + + TERMINATE_BLITTER_QUEUE + lea pd_BQBuffer(a6),a4 + bsr kds_draw_stencils_intro + bsr kds_draw_stencils_transition + bsr kds_calc_stencil_fixup_lines_transition + + bsr kds_calc_stencil_positions1_slow + + add.w #110,pd_NoiseOffset(a6) + moveq.l #INTRO_SPRITE_SHEIGHT,d0 + bsr kds_convert_noise_to_sprites + bsr kds_update_stencil_sprite + + ;BLTHOGON + ;BLTWAIT + ;lea pd_BQBuffer(a6),a0 + ;CALLFW TriggerCustomBlitterQueue + + CALLFW JoinBlitterQueue + + bsr kds_update_sprites_in_copperlist + bsr kds_update_copper_list_pointers + + CALLFW VSyncWithTask + + cmp.w #((NOISE_WIDTH/8)*(1024)),pd_NoiseOffset(a6) + blt.s .loop + + rts + +;-------------------------------------------------------------------- + +kds_pre_main: + PUTMSG 10,<"%d: Pre Main part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + CALLFW SetBlitterQueueMultiFrame + + move.w joy0dat(a5),pd_OldMouseY(a6) + + move.w #(NOISE_WIDTH/8)*(NOISE_HEIGHT-KALEIDO_VHEIGHT),pd_NoiseOffset(a6) + + bsr kds_prepare_buffers + + bsr .prepare + bsr .prepare + + bsr kds_calc_stencil_positions1_std + bsr kds_calc_stencil_positions2_std + +.loop + bsr kds_flip_db_frame + move.l pd_CurrSpriteStencilPtr(a6),pd_CurrFairySprite(a6) + + lea pd_BQBuffer(a6),a4 + + bsr kds_draw_stencils_col0000 + bsr kds_draw_stencils_copy_edges + bsr kds_calc_stencil_fixup_lines_pre_main + bsr kds_calc_stencil_positions1_std + bsr kds_calc_stencil_positions2_std + + sub.w #210,pd_NoiseOffset(a6) + bmi.s .exit + move.w #INTRO_SPRITE_HEIGHT,d0 + bsr kds_convert_noise_to_sprites + bsr kds_update_stencil_pre_main_sprite + + CALLFW JoinBlitterQueue + + bsr kds_update_sprites_in_copperlist + bsr kds_update_copper_list_pointers + + CALLFW VSyncWithTask + bra.s .loop + +.exit + bsr kds_kill_stencil_sprite + + CALLFW JoinBlitterQueue + + bsr kds_update_sprites_in_copperlist + bsr kds_update_copper_list_pointers + + CALLFW VSyncWithTask + + bsr.s .restore + +.restore + bsr kds_flip_db_frame + bsr kds_create_kaleidoscope_copperlist + + move.w #DMAF_SPRITE,dmacon(a5) + moveq.l #0,d0 + move.w d0,spr+0*8+sd_dataa(a5) + move.w d0,spr+1*8+sd_dataa(a5) + move.w d0,spr+2*8+sd_dataa(a5) + move.w d0,spr+3*8+sd_dataa(a5) + move.w d0,spr+4*8+sd_dataa(a5) + move.w d0,spr+5*8+sd_dataa(a5) + move.w d0,spr+6*8+sd_dataa(a5) + move.w d0,spr+7*8+sd_dataa(a5) + + lea pd_BQBuffer(a6),a4 + + bsr kds_draw_stencils_col0000 + bsr kds_draw_stencils_copy_edges + bsr kds_calc_stencil_fixup_lines_generic + bsr kds_calc_stencil_positions1_std + bsr kds_calc_stencil_positions2_std + + CALLFW JoinBlitterQueue + + bsr kds_update_copper_list_pointers + + CALLFW VSyncWithTask + rts + +.prepare + bsr kds_flip_db_frame + move.l pd_CurrSpriteStencilPtr(a6),pd_CurrFairySprite(a6) + + TERMINATE_BLITTER_QUEUE + lea pd_BQBuffer(a6),a4 + bsr kds_create_pre_main_copperlist + move.w #INTRO_SPRITE_HEIGHT,d0 + bsr kds_convert_noise_to_sprites + bsr kds_update_stencil_pre_main_sprite + + BLTHOGON + BLTWAIT + BLTHOGOFF + CALLFW TriggerBlitterQueue + + CALLFW JoinBlitterQueue + + bsr kds_update_copper_list_pointers + CALLFW VSyncWithTask + + rts + +;-------------------------------------------------------------------- + +kds_post_main: + PUTMSG 10,<"%d: Post Main part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + bsr .prepare + bsr .prepare + + PUTMSG 10,<"%d: Prep done">,fw_FrameCounterLong(a6) +.loop + bsr kds_flip_db_frame + move.l pd_CurrSpriteStencilPtr(a6),pd_CurrFairySprite(a6) + + lea pd_BQBuffer(a6),a4 + + bsr kds_draw_stencils_col0000 + bsr kds_draw_stencils_copy_edges + bsr kds_calc_stencil_fixup_lines_pre_main + bsr kds_calc_stencil_positions1_std + bsr kds_calc_stencil_positions2_std + + add.w #164,pd_NoiseOffset(a6) + cmp.w #(NOISE_WIDTH/8)*(NOISE_HEIGHT-KALEIDO_VHEIGHT),pd_NoiseOffset(a6) + bge.s .exit + move.w #INTRO_SPRITE_HEIGHT,d0 + bsr kds_convert_noise_to_sprites + bsr kds_update_stencil_pre_main_sprite + + CALLFW JoinBlitterQueue + + bsr kds_update_sprites_in_copperlist + bsr kds_update_copper_list_pointers + + CALLFW VSyncWithTask + bra.s .loop + +.exit + CALLFW JoinBlitterQueue + + clr.l fw_VBlankIRQ(a6) + + bsr kds_update_sprites_in_copperlist + bsr kds_update_copper_list_pointers + CALLFW VSyncWithTask + + PUTMSG 10,<"%d: Post Main finished (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + + rts + +.prepare + bsr kds_flip_db_frame + move.l pd_CurrSpriteStencilPtr(a6),pd_CurrFairySprite(a6) + + TERMINATE_BLITTER_QUEUE + lea pd_BQBuffer(a6),a4 + bsr kds_create_pre_main_copperlist + + bsr kds_draw_stencils_col0000 + bsr kds_draw_stencils_copy_edges + bsr kds_calc_stencil_fixup_lines_pre_main + bsr kds_calc_stencil_positions1_std + bsr kds_calc_stencil_positions2_std + bsr kds_clear_bonus_stuff_for_col2 + + CALLFW JoinBlitterQueue + + bsr kds_update_copper_list_pointers + CALLFW VSyncWithTask + + rts + +;-------------------------------------------------------------------- + +kds_main: + PUTMSG 10,<"%d: Main part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + CALLFW SetBlitterQueueMultiFrame + + IF 0 + bsr kds_prepare_buffers + + bsr kds_flip_db_frame + bsr kds_create_kaleidoscope_copperlist + bsr kds_flip_db_frame + bsr kds_create_kaleidoscope_copperlist + + move.l pd_PatternInfo+hp_Pos1Routine(a6),a0 + jsr (a0) + move.l pd_PatternInfo+hp_Pos2Routine(a6),a0 + jsr (a0) + ENDC + + lea .script(pc),a0 + CALLFW InstallMusicScript + + lea .vblstuff(pc),a0 + move.l a0,fw_VBlankIRQ(a6) +.loop + bsr kds_flip_db_frame + + CALLFW CheckMusicScript + + lea pd_BQBuffer(a6),a4 + + move.l pd_PatternInfo+hp_DrawRoutine(a6),a0 + jsr (a0) + + move.l pd_PatternInfo+hp_FixupRoutine(a6),a0 + jsr (a0) + + move.l pd_PatternInfo+hp_Pos1Routine(a6),a0 + jsr (a0) + move.l pd_PatternInfo+hp_Pos2Routine(a6),a0 + jsr (a0) + subq.w #1,pd_CopperlistUpdate(a6) + bmi.s .nocoplistupdate + move.l pd_PatternInfo+hp_CopListRoutine(a6),a0 + jsr (a0) +.nocoplistupdate + ;lea pd_BQBuffer(a6),a0 + ;sub.l a0,a4 + ;PUTMSG 10,<"Queue size %ld">,a4 + + CALLFW JoinBlitterQueue + + bsr kds_update_copper_list_pointers + + CALLFW VSyncWithTask + + cmp.w #6336,fw_MusicFrameCount(a6) + blt.s .loop + + bsr .flash + rts + +.vblstuff + PUSHM d4 + moveq.l #1,d0 + lea pd_IntroPalette(a6),a1 + CALLFW DoFadePaletteStep + move.w pd_IntroPalette+cl_Color(a6),color(a5) + POPM + rts + +.script + dc.w 4800+192+24+0*48,.load_setting2-* + dc.w 4800+192+24+1*48,.load_setting3-* + dc.w 4800+192+24+2*48,.load_setting4-* + dc.w 4800+192+24+3*48,.load_setting5-* + dc.w 4800+192+24+4*48,.load_setting6-* + + dc.w 5184+28*6,.jump-* + dc.w 5184+29*6,.jump-* + dc.w 5184+30*6,.jump-* + dc.w 5184+31*6,.jump-* + + dc.w 5568+28*6,.jump-* + dc.w 5568+29*6,.jump-* + dc.w 5568+30*6,.jump-* + dc.w 5568+31*6,.jump-* + + dc.w 5952+28*6,.jump-* + dc.w 5952+29*6,.jump-* + dc.w 5952+30*6,.jump-* + dc.w 5952+31*6,.jump-* + + dc.w 5952+192+24+0*48,.load_setting4-* + dc.w 5952+192+24+1*48,.load_setting3-* + dc.w 5952+192+24+2*48,.load_setting2-* + dc.w 5952+192+24+3*48,.load_setting1-* + dc.w 0 + +.jump add.w #58,pd_Angle1(a6) + add.w #550,pd_PosBaseCounter(a6) + rts + +.flash + moveq.l #1,d0 + move.w #$fff,d1 + lea pd_IntroPalette(a6),a1 + CALLFW InitPaletteLerpSameColor + + moveq.l #1,d0 + moveq.l #16,d1 + lea kds_intro_palette(pc),a0 + lea pd_IntroPalette(a6),a1 + CALLFW FadePaletteTo + rts + +.load_setting1 + bsr .flash + lea kds_setting_1(pc),a0 + bra kds_load_setting + +.load_setting2 + bsr .flash + lea kds_setting_2(pc),a0 + bra kds_load_setting + +.load_setting3 + bsr .flash + lea kds_setting_3(pc),a0 + bra kds_load_setting + +.load_setting4 + bsr .flash + lea kds_setting_4(pc),a0 + bra kds_load_setting + +.load_setting5 + bsr .flash + lea kds_setting_5(pc),a0 + bra kds_load_setting + +.load_setting6 + bsr .flash + lea kds_setting_6(pc),a0 + bra kds_load_setting + + +;-------------------------------------------------------------------- + +kds_flip_db_frame: + move.l pd_CurrPlanesPtr(a6),pd_LastPlanesPtr(a6) + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + move.l pd_CurrTCLineColorsPtr(a6),pd_LastTCLineColorsPtr(a6) + + move.l pd_DbBuffer(a6),a0 + not.b pd_DbToggle(a6) + beq.s .selb1 + lea (KALEIDO_WIDTH/8)(a0),a0 + move.l a0,pd_CurrPlanesPtr(a6) + move.l pd_P5Xor6Plane2Ptr(a6),pd_CurrP5Xor6PlanePtr(a6) + move.l pd_P6Xor5Plane2Ptr(a6),pd_CurrP6Xor5PlanePtr(a6) + move.l pd_P5BonusPlane2Ptr(a6),pd_CurrP5BonusPlanePtr(a6) + move.l pd_P5BottomPlane2Ptr(a6),pd_CurrP5BottomPlanePtr(a6) + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + move.l pd_TCLineColors2(a6),pd_CurrTCLineColorsPtr(a6) + lea pd_SpriteStencil2Ptrs(a6),a0 + move.l a0,pd_CurrSpriteStencilPtr(a6) + lea pd_CompSprites2(a6),a0 + move.l a0,pd_CurrFairySprite(a6) + rts +.selb1 + move.l a0,pd_CurrPlanesPtr(a6) + move.l pd_P5Xor6Plane1Ptr(a6),pd_CurrP5Xor6PlanePtr(a6) + move.l pd_P6Xor5Plane1Ptr(a6),pd_CurrP6Xor5PlanePtr(a6) + move.l pd_P5BonusPlane1Ptr(a6),pd_CurrP5BonusPlanePtr(a6) + move.l pd_P5BottomPlane1Ptr(a6),pd_CurrP5BottomPlanePtr(a6) + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + move.l pd_TCLineColors1(a6),pd_CurrTCLineColorsPtr(a6) + lea pd_SpriteStencil1Ptrs(a6),a0 + move.l a0,pd_CurrSpriteStencilPtr(a6) + lea pd_CompSprites1(a6),a0 + move.l a0,pd_CurrFairySprite(a6) + rts + +;-------------------------------------------------------------------- + +kds_update_copper_list_pointers: + lea kds_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +kds_load_setting: + lea pd_PatternInfo(a6),a1 + moveq.l #(hp_SIZEOF/4)-1,d7 +.scloop move.l (a0)+,(a1)+ + dbra d7,.scloop + move.w #2,pd_CopperlistUpdate(a6) + + rts + +;-------------------------------------------------------------------- + +kds_generate_smc_lines: + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2)-1,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + lea pd_SMCLine1(a6),a0 + move.w #KDSPAT_WIDTH*2,d4 + PUSHM d0-d3 + bsr kds_bresenham_smc_line_draw + POPM + lea pd_SMCLineUp1(a6),a0 + neg.w d4 + bsr kds_bresenham_smc_line_draw + + moveq.l #STENCIL_WIDTH-1,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2),d2 + moveq.l #STENCIL_HEIGHT-1,d3 + lea pd_SMCLine2(a6),a0 + neg.w d4 + PUSHM d0-d3 + bsr kds_bresenham_smc_line_draw + POPM + lea pd_SMCLineUp2(a6),a0 + neg.w d4 + bsr kds_bresenham_smc_line_draw + + moveq.l #(STENCIL_WIDTH/2),d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2),d2 + moveq.l #STENCIL_HEIGHT-1,d3 + lea pd_SMCLine3(a6),a0 + neg.w d4 + PUSHM d0-d3 + bsr kds_bresenham_smc_line_draw + POPM + lea pd_SMCLineUp3(a6),a0 + neg.w d4 + bsr kds_bresenham_smc_line_draw + + CALLFW FlushCaches + rts + +;-------------------------------------------------------------------- + +kds_clear_sprites: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_SpriteStencil1Ptrs(a6),bltdpt(a5) + move.w #((INTRO_SPRITE_WIDTH)>>4)|(((INTRO_SPRITE_HEIGHT+2)*2*2)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +kds_generate_stencils: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_StencilBuffer1(a6),bltdpt(a5) + move.w #((STENCIL_WIDTH)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES*2)<<6),bltsize(a5) + + moveq.l #(STENCIL_WIDTH/8)*KALEIDO_PLANES,d4 + bsr kds_blitter_line_init + + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2)-1,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_StencilBuffer1(a6),a0 + bsr kds_draw_blitter_singledot_line + + moveq.l #(STENCIL_WIDTH/8)*KALEIDO_PLANES,d4 + moveq.l #STENCIL_WIDTH-2,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2)-1,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_StencilBuffer1(a6),a0 + bsr kds_draw_blitter_singledot_line + + moveq.l #(STENCIL_WIDTH/8)*KALEIDO_PLANES,d4 + moveq.l #(STENCIL_WIDTH/2)-1,d0 + moveq.l #0,d1 + moveq.l #0,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_StencilBuffer2(a6),a0 + bsr kds_draw_blitter_singledot_line + + moveq.l #(STENCIL_WIDTH/8)*KALEIDO_PLANES,d4 + moveq.l #(STENCIL_WIDTH/2)-1,d0 + moveq.l #0,d1 + moveq.l #STENCIL_WIDTH-2,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_StencilBuffer2(a6),a0 + bsr kds_draw_blitter_singledot_line + + move.l pd_StencilBuffer1(a6),a0 + lea (STENCIL_WIDTH/8)*(STENCIL_HEIGHT*2-1)*KALEIDO_PLANES+(STENCIL_WIDTH/8)-2(a0),a0 + moveq.l #(STENCIL_WIDTH/8)*(KALEIDO_PLANES-1),d0 + moveq.l #-1,d2 + move.w #((STENCIL_WIDTH)>>4)|((STENCIL_HEIGHT*2)<<6),d3 + BLTWAIT + BLTCON_SET_X AD,BLT_A,0,0,BLTCON1F_EFE|BLTCON1F_DESC + move.l d2,bltafwm(a5) ; also fills bltalwm + move.w d0,bltamod(a5) + move.w d0,bltdmod(a5) + move.l a0,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + move.l pd_StencilBuffer1(a6),a0 + lea (STENCIL_WIDTH/8)(a0),a1 + BLTWAIT + BLTCON_SET AD,BLT_A,0,0 + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT KALEIDO_PLANES-2 + lea (STENCIL_WIDTH/8)(a1),a1 + BLTWAIT + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + rts + +;-------------------------------------------------------------------- + +kds_generate_spr_stencils: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_StencilSprBuffer1(a6),bltdpt(a5) + move.w #((STENCIL_WIDTH)>>4)|((STENCIL_HEIGHT*2)<<6),bltsize(a5) + + moveq.l #(STENCIL_WIDTH/8),d4 + bsr kds_blitter_line_init + + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2)-1,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_StencilSprBuffer1(a6),a0 + bsr kds_draw_blitter_singledot_line + + moveq.l #(STENCIL_WIDTH/8),d4 + moveq.l #STENCIL_WIDTH-2,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2)-1,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_StencilSprBuffer1(a6),a0 + bsr kds_draw_blitter_singledot_line + + moveq.l #(STENCIL_WIDTH/8),d4 + moveq.l #(STENCIL_WIDTH/2)-1,d0 + moveq.l #0,d1 + moveq.l #0,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_StencilSprBuffer2(a6),a0 + bsr kds_draw_blitter_singledot_line + + moveq.l #(STENCIL_WIDTH/8),d4 + moveq.l #(STENCIL_WIDTH/2)-1,d0 + moveq.l #0,d1 + moveq.l #STENCIL_WIDTH-2,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_StencilSprBuffer2(a6),a0 + bsr kds_draw_blitter_singledot_line + + move.l pd_StencilSprBuffer1(a6),a0 + lea (STENCIL_WIDTH/8)*(STENCIL_HEIGHT*2-1)+(STENCIL_WIDTH/8)-2(a0),a0 + moveq.l #0,d0 + moveq.l #-1,d2 + move.w #((STENCIL_WIDTH)>>4)|((STENCIL_HEIGHT*2)<<6),d3 + BLTWAIT + BLTCON_SET_X AD,BLT_A,0,0,BLTCON1F_IFE|BLTCON1F_DESC + move.l d2,bltafwm(a5) ; also fills bltalwm + move.l d0,bltamod(a5) ; and bltdmod + move.l a0,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + BLTWAIT + move.l pd_StencilSprBuffer1(a6),a0 + bset d0,(STENCIL_WIDTH/8)*(STENCIL_HEIGHT-1)+((STENCIL_WIDTH/2)/8)-1(a0) + rts + +;-------------------------------------------------------------------- + +kds_generate_hexagonmasks: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_P5Xor6Plane1Ptr(a6),bltdpt(a5) + move.w #((KALEIDO_BUF_WIDTH)>>4)|((KALEIDO_HEIGHT*KALEIDO_PLANES)<<6),bltsize(a5) + + moveq.l #-1,d2 + move.w #((KALEIDO_BUF_WIDTH*KALEIDO_PLANES-STENCIL_WIDTH)/8),d0 + move.w #((STENCIL_WIDTH*KALEIDO_PLANES-STENCIL_WIDTH)/8),d1 + move.w #((STENCIL_WIDTH)>>4)|((STENCIL_HEIGHT)<<6),d3 + + move.l pd_StencilBuffer1(a6),a1 + move.l pd_StencilBuffer2(a6),a2 + move.l pd_HexagonTopMaskPtr(a6),a0 + BLTWAIT + BLTCON_SET ACD,BLT_A|BLT_C,0,0 + move.l d2,bltafwm(a5) ; also fills bltalwm + move.w d1,bltamod(a5) + move.w d0,bltcmod(a5) + move.w d0,bltdmod(a5) + move.l a2,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + addq.l #(STENCIL_WIDTH/2)/8,a0 + + BLTWAIT + move.l a1,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + addq.l #(STENCIL_WIDTH/2)/8,a0 + + BLTWAIT + move.l a2,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + ; bottom + move.l pd_HexagonBottomMaskPtr(a6),a0 + + BLTWAIT + move.l a1,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + addq.l #(STENCIL_WIDTH/2)/8,a0 + + BLTWAIT + move.l a2,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + addq.l #(STENCIL_WIDTH/2)/8,a0 + + BLTWAIT + BLTHOGOFF + move.l a1,bltapt(a5) + move.l a0,bltcpt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +kds_clear_compobuffer: + ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_clear,(a4)+ + + rts +.bq_clear + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_SpriteCompoBuffer(a6),bltdpt(a5) + move.w #(FAIRY_WIDTH>>4)|((FAIRY_HEIGHT*FAIRY_PLANES)<<6),bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +kds_draw_fairy_body: + move.w pd_FairySpriteFrame(a6),d0 + addq.w #1*4,d0 + and.w #3*(1*4),d0 + move.w d0,pd_FairySpriteFrame(a6) + lea pd_FairyAnim1(a6),a0 + move.l (a0,d0.w),a1 + move.l pd_FairyMask1-pd_FairyAnim1(a0,d0.w),a2 + + move.l pd_SpriteCompoBuffer(a6),a0 + lea (BODY_XOFFSET/8)+BODY_YOFFSET*(FAIRY_WIDTH/8)*FAIRY_PLANES(a0),a0 + ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_copy_body,(a4)+ + move.l a1,(a4)+ + move.l a2,(a4)+ + move.l a0,(a4)+ + rts + +.bq_copy_body + BLTCON_SET ABCD,(BLT_A&BLT_B)|(~BLT_A&BLT_C),0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #(FAIRY_WIDTH-BODY_WIDTH)/8,d0 + move.w d0,bltcmod(a5) + move.w d0,bltdmod(a5) + moveq.l #0,d0 + move.l d0,bltbmod(a5) ; and bltamod + move.l (a0)+,bltbpt(a5) + move.l (a0)+,bltapt(a5) + move.l (a0)+,d0 + move.l d0,bltcpt(a5) + move.l d0,bltdpt(a5) + move.w #(BODY_WIDTH>>4)|((BODY_HEIGHT*BODY_PLANES)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +kds_draw_puff: + move.w pd_PuffSpriteFrame(a6),d0 + addq.w #1,d0 + move.w d0,pd_PuffSpriteFrame(a6) + cmp.w #NUM_PUFF_FRAMES*4,d0 + blt.s .cont + rts +.cont + and.w #(NUM_PUFF_FRAMES-1)*4,d0 + PUTMSG 10,<"Puff %d">,d0 + lea pd_PuffAnim1(a6),a0 + move.l (a0,d0.w),a1 + move.l pd_PuffMask1-pd_PuffAnim1(a0,d0.w),a2 + + move.l pd_SpriteCompoBuffer(a6),a0 + lea (PUFF_XOFFSET/8)+PUFF_YOFFSET*(FAIRY_WIDTH/8)*FAIRY_PLANES(a0),a0 + ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_copy_body,(a4)+ + move.l a1,(a4)+ + move.l a2,(a4)+ + move.l a0,(a4)+ + rts + +.bq_copy_body + BLTCON_SET ABCD,(BLT_A&BLT_B)|(~BLT_A&BLT_C),0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #(FAIRY_WIDTH-PUFF_WIDTH)/8,d0 + move.w d0,bltcmod(a5) + move.w d0,bltdmod(a5) + moveq.l #0,d0 + move.l d0,bltbmod(a5) ; and bltamod + move.l (a0)+,bltbpt(a5) + move.l (a0)+,bltapt(a5) + move.l (a0)+,d0 + move.l d0,bltcpt(a5) + move.l d0,bltdpt(a5) + move.w #(PUFF_WIDTH>>4)|((PUFF_HEIGHT*PUFF_PLANES)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +kds_draw_dust: + lea pd_BackDust(a6),a0 + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_draw,(a4)+ + move.l a0,(a4)+ + move.w #NUM_BACK_DUST,(a4)+ + rts + +.bq_draw + PUSHM a2/d1-d7 + move.l (a0)+,a1 + move.w (a0)+,d7 + move.l pd_SpriteCompoBuffer(a6),a0 + move.w pd_FairyPosY(a6),d4 + move.w pd_FairyPosX(a6),d5 + move.w #FAIRY_WIDTH,d6 ; or height + lea kds_dust_twinkle(pc),a2 + subq.w #1,d7 +.loop + subq.w #1,fd_Time(a1) + bmi.s .skip + movem.l fd_PosY(a1),d0-d3 + add.l #3000,d2 + add.l d2,d0 + add.l d3,d1 + movem.l d0-d2,fd_PosY(a1) + swap d0 + swap d1 + sub.w d4,d0 + sub.w d5,d1 + PUTMSG 40,<"Pos %d,%d">,d1,d0 + cmp.w d6,d1 + bhs.s .skip + cmp.w d6,d0 + bhs.s .skip + move.w d1,d2 + move.b d0,-(sp) + move.w (sp)+,d0 + move.b d1,d0 + lsr.w #3,d0 + not.w d2 + move.w fd_Time(a1),d3 + move.b (a2,d3.w),d3 + move.w .table-2(pc,d3.w),d3 + jmp .table(pc,d3.w) +.skip + lea fd_SIZEOF(a1),a1 + dbra d7,.loop + POPM + moveq.l #0,d0 + rts +.table + dc.w .set1-.table + dc.w .set2-.table + dc.w .set3-.table + dc.w .set4-.table + dc.w .set5-.table + dc.w .set6-.table +.set1 + bset d2,(a0,d0.w) + bra.s .skip + +.set2 + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set3 + bset d2,(a0,d0.w) + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set4 + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set5 + bset d2,(a0,d0.w) + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set6 + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +;-------------------------------------------------------------------- + +kds_draw_wand_heat: + lea pd_FrontDust(a6),a0 + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_draw,(a4)+ + move.l a0,(a4)+ + move.w #NUM_FRONT_DUST,(a4)+ + rts + +.bq_draw + PUSHM a2/d1-d7 + move.l (a0)+,a1 + move.w (a0)+,d7 + move.l pd_SpriteCompoBuffer(a6),a0 + moveq.l #45,d5 + moveq.l #27,d4 + move.w #FAIRY_WIDTH,d6 ; or height + lea kds_dust_burst(pc),a2 + subq.w #1,d7 +.loop + addq.w #1,fd_Time(a1) + bmi.s .skip + move.w fd_SpeedX(a1),d1 + move.w fd_SpeedY(a1),d0 + neg.w d1 + neg.w d0 + move.w d1,fd_SpeedX(a1) + move.w d0,fd_SpeedY(a1) + add.w d4,d0 + add.w d5,d1 + PUTMSG 30,<"Pos %d,%d %d">,d1,d0,fd_Time-2(a1) + move.w d1,d2 + move.b d0,-(sp) + move.w (sp)+,d0 + move.b d1,d0 + lsr.w #3,d0 + not.w d2 + move.w fd_Time(a1),d3 + lsr.w #2,d3 + move.b (a2,d3.w),d3 + move.w .table-2(pc,d3.w),d3 + jmp .table(pc,d3.w) +.skip + lea fd_SIZEOF(a1),a1 + dbra d7,.loop + POPM + moveq.l #0,d0 + rts + +.table + dc.w .set1-.table + dc.w .set2-.table + dc.w .set3-.table + dc.w .set4-.table + dc.w .set5-.table + dc.w .set6-.table + dc.w .set7-.table + +.set1 ; 1 + bset d2,(a0,d0.w) + bclr d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set2 ; 2 + bclr d2,(a0,d0.w) + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set3 ; 8 + bclr d2,(a0,d0.w) + bclr d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set4 ; 11 + bset d2,(a0,d0.w) + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set5 ; 12 + bclr d2,(a0,d0.w) + bclr d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set6 ; 13 + bset d2,(a0,d0.w) + bclr d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set7 ; 14 + bclr d2,(a0,d0.w) + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +;-------------------------------------------------------------------- + +kds_draw_wand_blast: + lea pd_FrontDust(a6),a0 + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_draw,(a4)+ + move.l a0,(a4)+ + move.w #NUM_FRONT_DUST,(a4)+ + rts + +.bq_draw + PUSHM a2/d1-d7 + move.l (a0)+,a1 + move.w (a0)+,d7 + move.l pd_SpriteCompoBuffer(a6),a0 + move.w pd_FairyPosY(a6),d4 + move.w pd_FairyPosX(a6),d5 + move.w #FAIRY_WIDTH,d6 ; or height + lea kds_dust_burst(pc),a2 + subq.w #1,d7 +.loop + subq.w #1,fd_Time(a1) + bmi.s .skip + movem.l fd_PosY(a1),d0-d3 + add.l d2,d0 + add.l d3,d1 + movem.l d0-d1,fd_PosY(a1) + swap d0 + swap d1 + sub.w d4,d0 + sub.w d5,d1 + PUTMSG 30,<"Pos %d,%d">,d1,d0 + cmp.w d6,d1 + bhs.s .skip + cmp.w d6,d0 + bhs.s .skip + move.w d1,d2 + move.b d0,-(sp) + move.w (sp)+,d0 + move.b d1,d0 + lsr.w #3,d0 + not.w d2 + move.w fd_Time(a1),d3 + move.b (a2,d3.w),d3 + move.w .table-2(pc,d3.w),d3 + jmp .table(pc,d3.w) +.skip + lea fd_SIZEOF(a1),a1 + dbra d7,.loop + POPM + moveq.l #0,d0 + rts + +.table + dc.w .set1-.table + dc.w .set2-.table + dc.w .set3-.table + dc.w .set4-.table + dc.w .set5-.table + dc.w .set6-.table + dc.w .set7-.table + +.set1 ; 1 + bset d2,(a0,d0.w) + bclr d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set2 ; 2 + bclr d2,(a0,d0.w) + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set3 ; 8 + bclr d2,(a0,d0.w) + bclr d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set4 ; 11 + bset d2,(a0,d0.w) + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bclr d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set5 ; 12 + bclr d2,(a0,d0.w) + bclr d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set6 ; 13 + bset d2,(a0,d0.w) + bclr d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +.set7 ; 14 + bclr d2,(a0,d0.w) + bset d2,1*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,2*(FAIRY_WIDTH/8)(a0,d0.w) + bset d2,3*(FAIRY_WIDTH/8)(a0,d0.w) + bra.s .skip + +;-------------------------------------------------------------------- + +kds_convert_compobuffer_to_sprites: + PREP_ADD_TO_BLITTER_QUEUE a3 + move.w #(16>>4)|(FAIRY_HEIGHT<<6),d3 + move.l #.bq_generic_ad_with_all,d4 + move.l #.bq_generic_ad,d5 + move.l pd_SpriteCompoBuffer(a6),a2 + move.l pd_CurrFairySprite(a6),a0 + + moveq.l #(FAIRY_WIDTH/16)-1,d7 +.sprloop + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d4,(a4)+ + move.l (a0)+,d0 + addq.l #4,d0 + move.l a2,(a4)+ + move.l d0,(a4)+ + move.w d3,(a4)+ + + move.l d5,d4 + + lea (FAIRY_WIDTH/8)(a2),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d4,(a4)+ + addq.l #2,d0 + move.l a1,(a4)+ + move.l d0,(a4)+ + move.w d3,(a4)+ + + lea (FAIRY_WIDTH/8)(a1),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d4,(a4)+ + move.l (a0)+,d0 + addq.l #4,d0 + move.l a1,(a4)+ + move.l d0,(a4)+ + move.w d3,(a4)+ + + lea (FAIRY_WIDTH/8)(a1),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d4,(a4)+ + addq.l #2,d0 + move.l a1,(a4)+ + move.l d0,(a4)+ + move.w d3,(a4)+ + + addq.w #2,a2 + + dbra d7,.sprloop + + clr.l (a3) + TERM_ADD_TO_BLITTER_QUEUE a3 + rts + +.bq_generic_ad_with_all + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((FAIRY_WIDTH*FAIRY_PLANES-16)/8)<<16)|2,bltamod(a5) +.bq_generic_ad + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_prepare_buffers: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_DbBuffer(a6),bltdpt(a5) + move.w #((KALEIDO_BUF_WIDTH)>>4)|((KALEIDO_HEIGHT*KALEIDO_PLANES)<<6),bltsize(a5) + + move.w #(KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES,d4 + bsr kds_blitter_line_init + + ; line 1 -> 1: bp 1 + ; line 2 -> 3: bp 1 & 2 + ; line 3 -> 5: bp 1 & 3 + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2)-1,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_DbBuffer(a6),a0 + PUSHM a0/d0-d4 + lea 1*(STENCIL_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea 2*(STENCIL_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea 3*(STENCIL_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea 2*(STENCIL_WIDTH/8)+(KALEIDO_BUF_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea 3*(STENCIL_WIDTH/8)+2*(KALEIDO_BUF_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + move.l pd_BonusGridPtr(a6),a0 + lea (STENCIL_WIDTH/2)/8(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + + ; line 1 -> 2: bp 2 + ; line 2 -> 4: bp 3 + ; line 3 -> 6: bp 2 & 3 + moveq.l #STENCIL_WIDTH-1,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2),d2 + moveq.l #STENCIL_HEIGHT-1,d3 + PUSHM a0/d0-d4 + lea 1*(STENCIL_WIDTH/8)+(KALEIDO_BUF_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea 2*(STENCIL_WIDTH/8)+2*(KALEIDO_BUF_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea 3*(STENCIL_WIDTH/8)+(KALEIDO_BUF_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea 3*(STENCIL_WIDTH/8)+2*(KALEIDO_BUF_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + move.l pd_BonusGridPtr(a6),a0 + lea -(STENCIL_WIDTH/2)/8(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + move.l pd_BonusGridPtr(a6),a0 + lea (STENCIL_WIDTH/2)/8(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + + moveq.l #-1,d2 + move.w #((16)>>4)|((KALEIDO_HEIGHT)<<6),d3 + BLTHOGON + BLTWAIT + BLTCON_SET AD,BLT_A|BLT_C,0,0 + move.l d2,bltafwm(a5) ; also fills bltalwm + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-16)/8,bltamod(a5) + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-16)/8,bltdmod(a5) + move.w #$8000,bltcdat(a5) + move.l a0,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + lea (KALEIDO_BUF_WIDTH/8)(a0),a1 + BLTHOGON + BLTWAIT + move.l a1,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + lea 2*(KALEIDO_BUF_WIDTH/8)(a0),a1 + BLTHOGON + BLTWAIT + move.l a1,bltapt(a5) + move.l a1,bltdpt(a5) + move.w d3,bltsize(a5) + + lea (KALEIDO_WIDTH/8)(a0),a1 + BLTHOGON + BLTWAIT + BLTCON_SET AD,BLT_A,0,0 + move.w #(KALEIDO_WIDTH/8),bltamod(a5) + move.w #(KALEIDO_WIDTH/8),bltdmod(a5) + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w #((KALEIDO_WIDTH)>>4)|((KALEIDO_HEIGHT*KALEIDO_PLANES)<<6),bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +kds_prepare_sprite_masks: + move.l pd_FairyAnim1(a6),a0 + move.l pd_FairyMask1(a6),a1 + moveq.l #BODY_WIDTH,d0 + moveq.l #BODY_HEIGHT,d1 + bsr .makemask + + move.l pd_FairyAnim2(a6),a0 + move.l pd_FairyMask2(a6),a1 + moveq.l #BODY_WIDTH,d0 + moveq.l #BODY_HEIGHT,d1 + bsr .makemask + + move.l pd_FairyAnim3(a6),a0 + move.l pd_FairyMask3(a6),a1 + moveq.l #BODY_WIDTH,d0 + moveq.l #BODY_HEIGHT,d1 + bsr .makemask + + move.l pd_PuffAnim1(a6),a0 + move.l pd_PuffMask1(a6),a1 + moveq.l #PUFF_WIDTH,d0 + moveq.l #PUFF_HEIGHT,d1 + bsr .makemask + + move.l pd_PuffAnim2(a6),a0 + move.l pd_PuffMask2(a6),a1 + moveq.l #PUFF_WIDTH,d0 + moveq.l #PUFF_HEIGHT,d1 + bsr .makemask + + move.l pd_PuffAnim3(a6),a0 + move.l pd_PuffMask3(a6),a1 + moveq.l #PUFF_WIDTH,d0 + moveq.l #PUFF_HEIGHT,d1 + bsr .makemask + + move.l pd_PuffAnim4(a6),a0 + move.l pd_PuffMask4(a6),a1 + moveq.l #PUFF_WIDTH,d0 + moveq.l #PUFF_HEIGHT,d1 + +.makemask + lsr.w #3,d0 + move.w d0,d3 + lea (a0,d0.w),a2 + lea (a2,d0.w),a3 + lea (a3,d0.w),a4 + lsr.w #1,d0 + lsl.w #6,d1 + add.w d0,d1 + + move.w d3,d2 + add.w d3,d3 + add.w d2,d3 ; for four bitplanes, so modulo is three times + + add.w d0,d0 + + moveq.l #-1,d2 + BLTHOGON + BLTWAIT + BLTCON_SET ABCD,BLT_A|BLT_B|BLT_C,0,0 + move.l d2,bltafwm(a5) + move.w d3,bltamod(a5) + move.w d3,bltbmod(a5) + move.w d3,bltcmod(a5) + move.w d3,bltdmod(a5) + move.l a0,bltapt(a5) + move.l a2,bltbpt(a5) + move.l a3,bltcpt(a5) + move.l a1,bltdpt(a5) + move.w d1,bltsize(a5) + + BLTWAIT + BLTCON0_SET ACD,BLT_A|BLT_C,0 + move.l a4,bltapt(a5) + move.l a1,bltcpt(a5) + move.l a1,bltdpt(a5) + move.w d1,bltsize(a5) + + lea (a1,d0.w),a0 + BLTWAIT + BLTCON0_SET AD,BLT_A,0 + move.l a1,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d1,bltsize(a5) + + REPT 2 + lea (a0,d0.w),a0 + BLTWAIT + BLTCON0_SET AD,BLT_A,0 + move.l a1,bltapt(a5) + move.l a0,bltdpt(a5) + move.w d1,bltsize(a5) + ENDR + + rts + +;-------------------------------------------------------------------- + +kds_prepare_intro_buffers: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_DbBuffer(a6),bltdpt(a5) + move.w #((KALEIDO_BUF_WIDTH)>>4)|((KALEIDO_HEIGHT*KALEIDO_PLANES)<<6),bltsize(a5) + + move.w #(KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES,d4 + bsr kds_blitter_line_init + + ; line 1 -> 1: bp 1 + ; line 2 -> 3: bp 1 & 2 + ; line 3 -> 5: bp 1 & 3 + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2)-1,d2 + moveq.l #STENCIL_HEIGHT-1,d3 + move.l pd_DbBuffer(a6),a0 + PUSHM a0/d0-d4 + lea (128+(STENCIL_WIDTH/2))/8+(KALEIDO_BUF_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + + ; line 1 -> 2: bp 2 + ; line 2 -> 4: bp 3 + ; line 3 -> 6: bp 2 & 3 + moveq.l #STENCIL_WIDTH-1,d0 + moveq.l #0,d1 + moveq.l #(STENCIL_WIDTH/2),d2 + moveq.l #STENCIL_HEIGHT-1,d3 + PUSHM a0/d0-d4 + lea ((128-(STENCIL_WIDTH/2))/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea ((128+(STENCIL_WIDTH/2))/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + PUSHM a0/d0-d4 + lea ((128+(STENCIL_WIDTH/2))/8)+1*(KALEIDO_BUF_WIDTH/8)(a0),a0 + bsr kds_draw_blitter_normal_line + POPM + + lea (KALEIDO_WIDTH/8)(a0),a1 + BLTHOGON + BLTWAIT + BLTCON_SET AD,BLT_A,0,0 + move.w #(KALEIDO_WIDTH/8),bltamod(a5) + move.w #(KALEIDO_WIDTH/8),bltdmod(a5) + move.l a0,bltapt(a5) + move.l a1,bltdpt(a5) + move.w #((KALEIDO_WIDTH)>>4)|((KALEIDO_HEIGHT*KALEIDO_PLANES)<<6),bltsize(a5) + + rts + +;-------------------------------------------------------------------- + +CALC_STENCIL_POS MACRO + move.w 2(a2,d7.w),d0 + muls d6,d0 + swap d0 + move.w (a2,d7.w),d1 + muls d6,d1 + swap d1 + + PUTMSG 30,<"\1 %d,%d">,d0,d1 + add.w #(KDSPAT_WIDTH/2)+(\2),d0 + ble.s .clipxleft\@ + cmp.w #KDSPAT_WIDTH-STENCIL_WIDTH-1,d0 + ble.s .noclipx\@ + move.w #KDSPAT_WIDTH-STENCIL_WIDTH-1,d0 + bra.s .noclipx\@ +.clipxleft\@ + moveq.l #1,d0 +.noclipx\@ + ext.l d0 + + add.w #(KDSPAT_HEIGHT/2)+(\3),d1 + ble.s .clipytop\@ + cmp.w #KDSPAT_HEIGHT-STENCIL_HEIGHT-1,d1 + ble.s .noclipy\@ + move.w #KDSPAT_HEIGHT-STENCIL_HEIGHT-1,d1 + bra.s .noclipy\@ +.clipytop\@ + moveq.l #1,d1 +.noclipy\@ + ext.l d1 + lsl.l #8,d1 ; * KDSPAT_WIDTH + move.l d1,d2 + add.l d2,d2 ; *2 + add.l d1,d2 ; *3 + add.l d2,d2 ; *6 + move.b d0,d1 + add.l d0,d2 + add.l d1,d1 + move.l d1,pd_StencilTCOffset\1(a6) + + subq.w #1,d2 + asr.l #4,d2 + add.l d2,d2 + IFNE \4 + add.l #(\4)*KDSPAT_WIDTH*KALEIDO_PLANES/8,d2 + ENDC + move.l d2,pd_StencilOffset\1(a6) + + moveq.l #15,d2 + neg.w d0 + and.w d0,d2 + ror.w #4,d2 + move.w d2,pd_StencilShift\1(a6) + ENDM + +kds_calc_stencil_positions1_std: + move.l pd_BigSinCosTable(a6),a2 + bsr kds_calc_mouse + tst.w pd_InteractiveMode(a6) + beq.s .automode + move.w pd_Distance1(a6),d6 + move.b pd_DeltaMouseY(a6),d1 + ext.w d1 + asr.w #2,d1 + add.w d1,d6 + bpl.s .nolimit0 + moveq.l #0,d6 +.nolimit0 + cmp.w #1200/4,d6 + bls.s .nolimit + move.w #1200/4,d6 +.nolimit + move.w d6,pd_Distance1(a6) + move.b pd_DeltaMouseX(a6),d0 + ext.w d0 + move.w pd_Angle1(a6),d7 + add.w d0,d7 + and.w #2047*4,d7 + move.w d7,pd_Angle1(a6) + clr.w pd_DeltaMouseY(a6) + PUTMSG 30,<"%d (%d), %d (%d)">,d6,d1,d7,d0 + bra.s .mancont +.automode + move.w pd_PosBaseCounter(a6),d6 + add.w #18,d6 + move.w d6,pd_PosBaseCounter(a6) + and.w #2047*4,d6 + move.w (a2,d6.w),d6 + muls #1080,d6 + swap d6 + move.w d6,pd_Distance1(a6) + move.w pd_Angle1(a6),d7 + add.w #15*4,d7 + and.w #2047*4,d7 + move.w d7,pd_Angle1(a6) +.mancont + ; first angle, from bottom/mid to top/left corner + CALC_STENCIL_POS 1,-(STENCIL_WIDTH/2),-STENCIL_HEIGHT,1*KDSPAT_HEIGHT + + ; second angle, from bottom/left to top/left corner + move.w #(((-120)*2048+180)/360)*4,d7 + sub.w pd_Angle1(a6),d7 + and.w #2047*4,d7 + CALC_STENCIL_POS 6,0,-STENCIL_HEIGHT,2*KDSPAT_HEIGHT + + ; third angle, from bottom/right to top/left corner + move.w #(((120)*2048+180)/360)*4,d7 + sub.w pd_Angle1(a6),d7 + and.w #2047*4,d7 + CALC_STENCIL_POS 8,-STENCIL_WIDTH,-STENCIL_HEIGHT,0*KDSPAT_HEIGHT + rts + +kds_calc_stencil_positions1_slow: + move.l pd_BigSinCosTable(a6),a2 + move.w pd_PosBaseCounter(a6),d6 + add.w #9,d6 + move.w d6,pd_PosBaseCounter(a6) + and.w #2047*4,d6 + move.w (a2,d6.w),d6 + muls #1080,d6 + swap d6 + move.w d6,pd_Distance1(a6) + ;and.w #$ff,d6 + move.w pd_Angle1(a6),d7 + ;move.w #2*256*4,d7 + sub.w #6*4,d7 + and.w #2047*4,d7 + move.w d7,pd_Angle1(a6) + + ; first angle, from bottom/mid to top/left corner + CALC_STENCIL_POS 1,-(STENCIL_WIDTH/2),-STENCIL_HEIGHT,1*KDSPAT_HEIGHT + + ; second angle, from bottom/left to top/left corner + move.w #(((-120)*2048+180)/360)*4,d7 + sub.w pd_Angle1(a6),d7 + and.w #2047*4,d7 + CALC_STENCIL_POS 6,0,-STENCIL_HEIGHT,2*KDSPAT_HEIGHT + + ; third angle, from bottom/right to top/left corner + move.w #(((120)*2048+180)/360)*4,d7 + sub.w pd_Angle1(a6),d7 + and.w #2047*4,d7 + CALC_STENCIL_POS 8,-STENCIL_WIDTH,-STENCIL_HEIGHT,0*KDSPAT_HEIGHT + rts + +kds_calc_stencil_positions2_std: + move.w pd_Distance1(a6),d6 + move.w pd_Angle1(a6),d7 + + ; first angle, from top/mid to top/left corner + CALC_STENCIL_POS 7,-(STENCIL_WIDTH/2),0,1*KDSPAT_HEIGHT + + ; second angle, from top/right to top/left corner + move.w #(((120)*2048+180)/360)*4,d7 + sub.w pd_Angle1(a6),d7 + and.w #2047*4,d7 + CALC_STENCIL_POS 2,-STENCIL_WIDTH,0,0*KDSPAT_HEIGHT + + ; third angle, from top/left to top/left corner + move.w #(((-120)*2048+180)/360)*4,d7 + sub.w pd_Angle1(a6),d7 + and.w #2047*4,d7 + CALC_STENCIL_POS 3,0,0,2*KDSPAT_HEIGHT + + rts + +;-------------------------------------------------------------------- + +kds_calc_mouse: + move.w joy0dat(a5),d1 + move.w pd_OldMouseY(a6),d0 + move.w d1,pd_OldMouseY(a6) + sub.w d0,d1 + add.w d1,pd_DeltaMouseY(a6) + cmp.b #32,d1 + blt.s .skip + st pd_InteractiveMode(a6) +.skip + rts + +;-------------------------------------------------------------------- + +kds_calc_stencil_fixup_lines_transition: + move.w pd_TransitionHeight(a6),d5 + bne.s .cont + rts +.cont + PREP_ADD_TO_BLITTER_QUEUE a3 + move.l #.bq_ad_copy,d6 + + move.l pd_CurrTCLineColorsPtr(a6),a2 + + ; first hexagon, first line, color 6 + lea 0*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage1(a6),a0 + add.l pd_StencilTCOffset8(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; first hexagon, second line, color 1 + lea 1*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset1(a6),a0 + jsr pd_SMCLine1(a6) + + ; first hexagon, third line, color 2 + lea 2*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage3(a6),a0 + add.l pd_StencilTCOffset6(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; now copy colors to copperlist for each mirror + move.w d5,d3 + cmp.w #STENCIL_HEIGHT,d3 + blt.s .nomax1 + moveq.l #STENCIL_HEIGHT,d3 +.nomax1 lsl.w #6,d3 + addq.w #1,d3 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset1(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+0*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_all,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT 2 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+0*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + move.w d5,d3 + sub.w #STENCIL_HEIGHT,d3 + ble.s .skip + + ; --------------------- + ; mirror 1 + lsl.w #6,d3 + addq.w #1,d3 + + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset2(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+1*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_backwards,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT 2 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+1*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + +.skip + clr.l (a3) + TERM_ADD_TO_BLITTER_QUEUE a3 + rts + +.bq_ad_copy_all + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; bltafwm + move.l #(0<<16)|((COP_INST_PER_INTRO_LINE*4)-2),bltamod(a5) ; and bltdmod +.bq_ad_copy + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_ad_copy_backwards + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; bltafwm + move.l #(-4<<16)|((4*4)-2),bltamod(a5) ; and bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_calc_stencil_fixup_lines_pre_main: + PREP_ADD_TO_BLITTER_QUEUE a3 + move.l #.bq_ad_copy,d6 + + move.w #(1|(STENCIL_HEIGHT<<6)),d3 + move.l pd_CurrTCLineColorsPtr(a6),a2 + + ; first hexagon, first line, color 6 + lea 0*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage1(a6),a0 + add.l pd_StencilTCOffset8(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; first hexagon, second line, color 1 + lea 1*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset1(a6),a0 + jsr pd_SMCLine1(a6) + + ; first hexagon, third line, color 2 + lea 2*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage3(a6),a0 + add.l pd_StencilTCOffset6(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; second hexagon, first line, color 3 + lea 3*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage1(a6),a0 + add.l pd_StencilTCOffset2(a6),a0 + jsr pd_SMCLineUp1(a6) + + ; second hexagon, second line, color 4 + lea 4*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset7(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLineUp2(a6) + + ; second hexagon, border line, color 7 + lea 5*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset7(a6),a0 + jsr pd_SMCLineUp3(a6) + + ; second hexagon, third line, color 5 + lea 6*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_TrueColorImage3(a6),a0 + add.l pd_StencilTCOffset3(a6),a0 + jsr pd_SMCLineUp1(a6) + + ; now copy colors to copperlist for each mirror + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset1(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+0*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_all,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-4 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+0*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; --------------------- + ; mirror 1 + move.w #(1|((STENCIL_HEIGHT-1)<<6)),d3 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset2(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+1*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_backwards,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-4 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+1*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; mirror 2 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset3(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+2*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_all,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-4 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+2*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; mirror 3 + move.w #(1|((LAST_SLICE_HEIGHT)<<6)),d3 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset4(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+3*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_backwards,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-4 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+3*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + clr.l (a3) + TERM_ADD_TO_BLITTER_QUEUE a3 + + rts + +.bq_ad_copy_all + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; bltafwm + move.l #(0<<16)|((COP_INST_PER_PMAIN_LINE*4)-2),bltamod(a5) ; and bltdmod +.bq_ad_copy + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_ad_copy_backwards + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; bltafwm + move.l #(-4<<16)|((COP_INST_PER_PMAIN_LINE*4)-2),bltamod(a5) ; and bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_calc_stencil_fixup_lines_generic: + PREP_ADD_TO_BLITTER_QUEUE a3 + move.l #.bq_ad_copy,d6 + + move.w #(1|(STENCIL_HEIGHT<<6)),d3 + move.l pd_CurrTCLineColorsPtr(a6),a2 + + ; first hexagon, first line, color 6 + lea 0*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage1(a6),a0 + add.l pd_StencilTCOffset8(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; first hexagon, second line, color 1 + lea 1*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset1(a6),a0 + jsr pd_SMCLine1(a6) + + ; first hexagon, third line, color 2 + lea 2*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage3(a6),a0 + add.l pd_StencilTCOffset6(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; second hexagon, first line, color 3 + lea 3*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col3Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage1(a6),a0 + add.l pd_StencilTCOffset2(a6),a0 + jsr pd_SMCLineUp1(a6) + + ; second hexagon, second line, color 4 + lea 4*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col3Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset7(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLineUp2(a6) + + ; second hexagon, border line, color 7 + lea 5*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col3Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset7(a6),a0 + jsr pd_SMCLineUp3(a6) + + ; second hexagon, third line, color 5 + lea 6*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col3Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage3(a6),a0 + add.l pd_StencilTCOffset3(a6),a0 + jsr pd_SMCLineUp1(a6) + + ; now copy colors to copperlist for each mirror + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset1(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+0*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_all,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-4 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+0*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; --------------------- + ; mirror 1 + move.w #(1|((STENCIL_HEIGHT-1)<<6)),d3 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset2(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+1*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_backwards,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-4 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+1*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; mirror 2 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset3(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+2*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_all,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-4 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+2*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; mirror 3 + move.w #(1|((LAST_SLICE_HEIGHT)<<6)),d3 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset4(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+3*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_backwards,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-4 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+3*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + clr.l (a3) + TERM_ADD_TO_BLITTER_QUEUE a3 + rts + +.bq_ad_copy_all + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; bltafwm + move.l #(0<<16)|((COP_INST_PER_LINE*4)-2),bltamod(a5) ; and bltdmod +.bq_ad_copy + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_ad_copy_backwards + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; bltafwm + move.l #(-4<<16)|((COP_INST_PER_LINE*4)-2),bltamod(a5) ; and bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_calc_stencil_fixup_lines_bonus: + PREP_ADD_TO_BLITTER_QUEUE a3 + move.l #.bq_ad_copy,d6 + + move.w #(1|(STENCIL_HEIGHT<<6)),d3 + move.l pd_CurrTCLineColorsPtr(a6),a2 + + ; first hexagon, first line, color 6 + lea 0*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage1(a6),a0 + add.l pd_StencilTCOffset8(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; first hexagon, second line, color 1 + lea 1*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset1(a6),a0 + jsr pd_SMCLine1(a6) + + ; first hexagon, third line, color 2 + lea 2*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage3(a6),a0 + add.l pd_StencilTCOffset6(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; second hexagon, first line, color 3 + lea 3*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col3Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage1(a6),a0 + add.l pd_StencilTCOffset2(a6),a0 + jsr pd_SMCLineUp1(a6) + + ; second hexagon, second line, color 4 + lea 4*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col3Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset7(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLineUp2(a6) + + ; second hexagon, border line, color 7 + lea 5*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col3Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset7(a6),a0 + jsr pd_SMCLineUp3(a6) + + ; second hexagon, third line, color 5 + lea 6*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col3Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage3(a6),a0 + add.l pd_StencilTCOffset3(a6),a0 + jsr pd_SMCLineUp1(a6) + + IF 0 + ; third hexagon, first line, color 6 + lea 7*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage1(a6),a0 + add.l pd_StencilTCOffset8(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + + ; third hexagon, second line, color 9 + lea 8*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage2(a6),a0 + add.l pd_StencilTCOffset1(a6),a0 + jsr pd_SMCLine1(a6) + + ; third hexagon, third line, color 10 + lea 9*4*LCOLBUF_HEIGHT*2(a2),a1 + move.l pd_PatternInfo+hp_Col2Routine(a6),a0 + jsr (a0) + move.l pd_TrueColorImage3(a6),a0 + add.l pd_StencilTCOffset6(a6),a0 + lea -(STENCIL_WIDTH/2)*2(a0),a0 + jsr pd_SMCLine2(a6) + ENDC + + ; now copy colors to copperlist for each mirror + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset1(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+0*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_all,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-1 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+0*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; --------------------- + ; mirror 1 + move.w #(1|((STENCIL_HEIGHT-1)<<6)),d3 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset2(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+1*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_backwards,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-1 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+1*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; mirror 2 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset3(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+2*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_all,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-1 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+2*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + ; mirror 3 + move.w #(1|((LAST_SLICE_HEIGHT)<<6)),d3 + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperLinesFixupOffset4(a6),a1 + + move.l a1,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(0+3*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_backwards,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + + REPT LCOL_NUM-1 + addq.l #4,d4 + move.l a2,a1 + add.w pd_PatternInfo+hp_ColOffs+(REPTN+1+3*LCOL_NUM)*2(a6),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l d6,(a4)+ + move.l a1,(a4)+ + move.l d4,(a4)+ + move.w d3,(a4)+ + ENDR + + clr.l (a3) + TERM_ADD_TO_BLITTER_QUEUE a3 + + rts + +.bq_ad_copy_all + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; bltafwm + move.l #(0<<16)|((COP_INST_PER_LINE*4)-2),bltamod(a5) ; and bltdmod +.bq_ad_copy + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_ad_copy_backwards + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; bltafwm + move.l #(-4<<16)|((COP_INST_PER_LINE*4)-2),bltamod(a5) ; and bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_swap_rgb_to_bgr: + ; R>>8|0G0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_rgb_to_00r_or_0g0,(a4)+ + move.l a1,(a4)+ + move.l a1,(a4)+ + lea 3*LCOLBUF_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.w d3,(a4)+ + + ; B<<8|0GR + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_0gr_merge_with_b00,(a4)+ + lea STENCIL_HEIGHT*2-2(a1),a1 + move.l a1,(a4)+ + lea -3*LCOLBUF_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.l a1,(a4)+ + move.w d3,(a4)+ + lea -STENCIL_HEIGHT*2+2(a1),a1 + rts + +.bq_acd_rgb_to_00r_or_0g0 + move.l #((BLTEN_ACD+((BLT_A|(BLT_B&BLT_C))))<<16)|(8<<28),bltcon0(a5) + move.l #$0f000f00,bltafwm(a5) ; bltafwm + moveq.l #0,d0 + move.l d0,bltamod(a5) ; and bltdmod + move.w d0,bltcmod(a5) + move.w #$0f0,bltbdat(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_acd_0gr_merge_with_b00 + move.l #((BLTEN_ACD+(((BLT_A|BLT_C)))&$ff)<<16)|(8<<28)|BLTCON1F_DESC,bltcon0(a5) + lea bltafwm(a5),a1 + move.l #$000f000f,(a1)+ ; bltafwm + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_swap_rgb_to_bgr_and_gbr: + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_gbr,(a4)+ + lea STENCIL_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + subq.w #2,a1 + move.l a1,(a4)+ + lea 1*LCOLBUF_HEIGHT*2+2(a1),a1 + move.l a1,(a4)+ + add.w #1<<6,d3 + move.w d3,(a4)+ + sub.w #1<<6,d3 + + lea -(1*LCOLBUF_HEIGHT*2+STENCIL_HEIGHT*2)(a1),a1 + + bra kds_swap_rgb_to_bgr + +.bq_acd_gbr + lea bltcon0(a5),a1 + move.l #((BLTEN_ABD+((BLT_A|(BLT_B&BLT_C))))<<16)|(8<<28)|(4<<12)|BLTCON1F_DESC,(a1)+ + move.l #$0f000f00,(a1)+ ; bltafwm/bltafwm + moveq.l #0,d0 + move.l d0,bltamod(a5) ; and bltdmod + move.w d0,bltbmod(a5) + move.w #$ff0,bltcdat(a5) + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_swap_rgb_to_rbg: + ; G>>4|R00 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_rgb_to_00g_or_r00,(a4)+ + move.l a1,(a4)+ + move.l a1,(a4)+ + lea 3*LCOLBUF_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.w d3,(a4)+ + + ; B<<4|R0G + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_r0g_merge_with_0b0,(a4)+ + lea STENCIL_HEIGHT*2-2(a1),a1 + move.l a1,(a4)+ + lea -3*LCOLBUF_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + lea 1*LCOLBUF_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.w d3,(a4)+ + lea -(1*LCOLBUF_HEIGHT*2+STENCIL_HEIGHT*2)+2(a1),a1 + + rts + +.bq_acd_rgb_to_00g_or_r00 + lea bltcon0(a5),a1 + move.l #((BLTEN_ACD+((BLT_A|(BLT_B&BLT_C))))<<16)|(4<<28),(a1)+ + move.l #$00f000f0,(a1)+ ; bltafwm/bltafwm + moveq.l #0,d0 + move.l d0,bltamod(a5) ; and bltdmod + move.w d0,bltcmod(a5) + move.w #$f00,bltbdat(a5) + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_acd_r0g_merge_with_0b0 + lea bltcon0(a5),a1 + move.l #((BLTEN_ACD+(((BLT_A|BLT_C)))&$ff)<<16)|(4<<28)|BLTCON1F_DESC,(a1)+ + move.l #$000f000f,(a1)+ ; bltafwm/bltafwm + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_swap_rgb_to_rbg_and_grb: + bsr kds_swap_rgb_to_rbg + bra kds_swap_rgb_to_grb + +;-------------------------------------------------------------------- + +kds_swap_rgb_to_rbg_and_grb_and_brg: + bsr kds_swap_rgb_to_rbg + bsr kds_swap_rgb_to_grb + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_rgb_to_brg,(a4)+ + move.l a1,(a4)+ + addq.w #2,a1 + move.l a1,(a4)+ + lea 3*LCOLBUF_HEIGHT*2-2(a1),a1 + move.l a1,(a4)+ + move.w d3,(a4)+ + + lea -(3*LCOLBUF_HEIGHT*2)(a1),a1 + + rts + +.bq_acd_rgb_to_brg + ; (r<<8)|(bg>>4) -> (b<<8)|(rg>>4) + move.l #((BLTEN_ABD+((BLT_A|(BLT_B&BLT_C))))<<16)|(8<<28)|(4<<12),bltcon0(a5) + move.l #$000f000f,bltafwm(a5) ; bltafwm + moveq.l #0,d0 + move.l d0,bltamod(a5) ; and bltdmod + move.w d0,bltbmod(a5) + move.w #$0ff,bltcdat(a5) + lea bltbpt(a5),a1 + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_swap_rgb_to_grb: + ; R>>4|00B + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_rgb_to_0r0_or_00b,(a4)+ + move.l a1,(a4)+ + move.l a1,(a4)+ + lea 3*LCOLBUF_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.w d3,(a4)+ + + ; G<<4|0RB + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_0rb_merge_with_g00,(a4)+ + lea STENCIL_HEIGHT*2-2(a1),a1 + move.l a1,(a4)+ + lea -3*LCOLBUF_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + lea 2*LCOLBUF_HEIGHT*2(a1),a1 + move.l a1,(a4)+ + move.w d3,(a4)+ + lea -(2*LCOLBUF_HEIGHT*2+STENCIL_HEIGHT*2)+2(a1),a1 + + rts + +.bq_acd_rgb_to_0r0_or_00b + lea bltcon0(a5),a1 + move.l #((BLTEN_ACD+((BLT_A|(BLT_B&BLT_C))))<<16)|(4<<28),(a1)+ + move.l #$0f000f00,(a1)+ ; bltafwm/bltafwm + moveq.l #0,d0 + move.l d0,bltamod(a5) ; and bltdmod + move.w d0,bltcmod(a5) + move.w #$00f,bltbdat(a5) + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_acd_0rb_merge_with_g00 + lea bltcon0(a5),a1 + move.l #((BLTEN_ACD+(((BLT_A|BLT_C)))&$ff)<<16)|(4<<28)|BLTCON1F_DESC,(a1)+ + move.l #$00f000f0,(a1)+ ; bltafwm/bltafwm + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- +; blit order: merge: 1 2 3 6 7 5b 8a, copy 3 to 0, copy 1 to 4 +; \0/5\1/6\2/7\3/8\4/ +; / \ / \ / \ / \ / \ +; +kds_draw_stencils_col1010: + move.w #((STENCIL_WIDTH+16)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES)<<6),d3 + move.w #(KDSPAT_WIDTH-STENCIL_WIDTH-16)/8,d6 + move.w #(KALEIDO_BUF_WIDTH-STENCIL_WIDTH-16)/8,d7 + + ; first row + move.l pd_OriginalPattern(a6),a0 + move.l pd_CurrPlanesPtr(a6),a1 + move.l pd_StencilBuffer1(a6),a2 + subq.w #2,a1 + subq.w #2,a2 + + addq.w #STENCIL_WIDTH/8,a1 + + FIRST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_all,(a4)+ + move.w #BLTEN_ABCD+(((BLT_B&BLT_A)|(BLT_C&~BLT_A))&$ff),(a4)+ + move.l #$0000ffff,(a4)+ ; bltafwm + move.w d7,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w #-2,(a4)+ ; bltamod + move.w d7,(a4)+ ; bltdmod + + move.w pd_StencilShift1(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset1(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; second row + move.l pd_CurrPlanesPtr(a6),a1 + move.l pd_StencilBuffer2(a6),a2 + lea (STENCIL_WIDTH+STENCIL_WIDTH/2)/8-2(a1),a1 + subq.w #2,a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift6(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset6(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #(((STENCIL_WIDTH/2)+16)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES)<<6),d3 + move.w #(KDSPAT_WIDTH-((STENCIL_WIDTH/2)+16))/8,d6 + move.w #(KALEIDO_BUF_WIDTH-((STENCIL_WIDTH/2)+16))/8,d7 + + move.l pd_CurrPlanesPtr(a6),a1 + move.l pd_StencilBuffer2(a6),a2 + lea (STENCIL_WIDTH)/8-2(a1),a1 + lea (STENCIL_WIDTH/2)/8-2(a2),a2 + + PUSHM a0/a1 + BLTHOGON + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + POPM + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_mods,(a4)+ + move.w d7,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w #((STENCIL_WIDTH/2)-16)/8,(a4)+ ; bltamod + move.w d7,(a4)+ ; bltdmod + move.w pd_StencilShift8(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset8(a6),d5 + addq.l #(STENCIL_WIDTH/2)/8,d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + subq.w #(STENCIL_WIDTH/2)/8,a0 + lea (2*STENCIL_WIDTH+STENCIL_WIDTH/2)/8(a1),a1 + lea -(STENCIL_WIDTH/2)/8(a2),a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + subq.l #(STENCIL_WIDTH/2)/8,d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; mirrored and swapped p5/p6 + addq.w #(STENCIL_WIDTH/2)/8,a0 + move.w #((STENCIL_WIDTH+16)>>4)|((STENCIL_HEIGHT)<<6),d3 + move.w #(-KDSPAT_WIDTH*KALEIDO_PLANES-((STENCIL_WIDTH)+16))/8,d6 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-((STENCIL_WIDTH)+16))/8,d7 + + move.l pd_StencilBuffer1(a6),a2 + move.l pd_CurrPlanesPtr(a6),a1 + lea 2*(STENCIL_WIDTH/8)-2(a1),a1 + subq.w #2,a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_mods,(a4)+ + move.w d7,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w #((STENCIL_WIDTH*KALEIDO_PLANES)-(STENCIL_WIDTH+16))/8,(a4)+ ; bltamod + move.w d7,(a4)+ ; bltdmod + move.w pd_StencilShift2(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset2(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 3 + lea (KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + lea 2*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea -(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; next one + move.l pd_CurrPlanesPtr(a6),a1 + lea 3*(STENCIL_WIDTH/8)-2(a1),a1 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift3(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset3(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 3 + lea (KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + lea 2*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea -(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; next one + move.l pd_StencilBuffer2(a6),a2 + move.l pd_CurrPlanesPtr(a6),a1 + subq.w #2,a2 + lea (STENCIL_WIDTH*2+STENCIL_WIDTH/2)/8-2(a1),a1 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift7(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset7(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 3 + lea (KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + lea 2*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea -(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_generic_abcd_with_all + BLTHOGOFF + move.w (a0)+,bltcon0(a5) + move.l (a0)+,bltafwm(a5) +.bq_generic_abcd_with_mods + move.l (a0)+,bltcmod(a5) ; bltcmod/bltbmod + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod +.bq_generic_abcd_with_bltcon1 + move.w (a0)+,bltcon1(a5) +.bq_generic_abcd + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- +;-------------------------------------------------------------------- +; blit order: merge: 1 2 3 6 7 5b 8a, copy 3 to 0, copy 1 to 4 +; \0/5\1/6\2/7\3/8\4/ +; / \ / \ / \ / \ / \ +; +kds_draw_stencils_col0000: + move.w #((STENCIL_WIDTH+16)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES)<<6),d3 + move.w #(KDSPAT_WIDTH-STENCIL_WIDTH-16)/8,d6 + move.w #(KALEIDO_BUF_WIDTH-STENCIL_WIDTH-16)/8,d7 + + ; first row + move.l pd_OriginalPattern(a6),a0 + move.l pd_CurrPlanesPtr(a6),a1 + move.l pd_StencilBuffer1(a6),a2 + subq.w #2,a1 + subq.w #2,a2 + + addq.w #STENCIL_WIDTH/8,a1 + + FIRST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_all,(a4)+ + move.w #BLTEN_ABCD+(((BLT_B&BLT_A)|(BLT_C&~BLT_A))&$ff),(a4)+ + move.l #$0000ffff,(a4)+ ; bltafwm + move.w d7,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w #-2,(a4)+ ; bltamod + move.w d7,(a4)+ ; bltdmod + + move.w pd_StencilShift1(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset1(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; second row + move.l pd_CurrPlanesPtr(a6),a1 + move.l pd_StencilBuffer2(a6),a2 + lea (STENCIL_WIDTH+STENCIL_WIDTH/2)/8-2(a1),a1 + subq.w #2,a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift6(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset6(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #(((STENCIL_WIDTH/2)+16)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES)<<6),d3 + move.w #(KDSPAT_WIDTH-((STENCIL_WIDTH/2)+16))/8,d6 + move.w #(KALEIDO_BUF_WIDTH-((STENCIL_WIDTH/2)+16))/8,d7 + + move.l pd_CurrPlanesPtr(a6),a1 + move.l pd_StencilBuffer2(a6),a2 + lea (STENCIL_WIDTH)/8-2(a1),a1 + lea (STENCIL_WIDTH/2)/8-2(a2),a2 + + PUSHM a0/a1 + BLTHOGON + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + POPM + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_mods,(a4)+ + move.w d7,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w #((STENCIL_WIDTH/2)-16)/8,(a4)+ ; bltamod + move.w d7,(a4)+ ; bltdmod + move.w pd_StencilShift8(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset8(a6),d5 + addq.l #(STENCIL_WIDTH/2)/8,d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + subq.w #(STENCIL_WIDTH/2)/8,a0 + lea (2*STENCIL_WIDTH+STENCIL_WIDTH/2)/8(a1),a1 + lea -(STENCIL_WIDTH/2)/8(a2),a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + subq.l #(STENCIL_WIDTH/2)/8,d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; mirrored and unswapped p5/p6 + addq.w #(STENCIL_WIDTH/2)/8,a0 + move.w #((STENCIL_WIDTH+16)>>4)|((STENCIL_HEIGHT)<<6),d3 + move.w #(-KDSPAT_WIDTH*KALEIDO_PLANES-((STENCIL_WIDTH)+16))/8,d6 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-((STENCIL_WIDTH)+16))/8,d7 + + move.l pd_StencilBuffer1(a6),a2 + move.l pd_CurrPlanesPtr(a6),a1 + lea 2*(STENCIL_WIDTH/8)-2(a1),a1 + subq.w #2,a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_mods,(a4)+ + move.w d7,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w #((STENCIL_WIDTH*KALEIDO_PLANES)-(STENCIL_WIDTH+16))/8,(a4)+ ; bltamod + move.w d7,(a4)+ ; bltdmod + move.w pd_StencilShift2(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset2(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 3 + lea (KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; next one + move.l pd_CurrPlanesPtr(a6),a1 + lea 3*(STENCIL_WIDTH/8)-2(a1),a1 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift3(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset3(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 3 + lea (KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; next one + move.l pd_StencilBuffer2(a6),a2 + move.l pd_CurrPlanesPtr(a6),a1 + subq.w #2,a2 + lea (STENCIL_WIDTH*2+STENCIL_WIDTH/2)/8-2(a1),a1 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift7(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset7(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 3 + lea (KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l #KDSPAT_WIDTH/8,d5 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_generic_abcd_with_all + BLTHOGOFF + move.w (a0)+,bltcon0(a5) + move.l (a0)+,bltafwm(a5) +.bq_generic_abcd_with_mods + move.l (a0)+,bltcmod(a5) ; bltcmod/bltbmod + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod +.bq_generic_abcd_with_bltcon1 + move.w (a0)+,bltcon1(a5) +.bq_generic_abcd + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_stencils_intro: + move.w #((STENCIL_WIDTH+16)>>4)|((STENCIL_HEIGHT)<<6),d3 + move.w #(KDSPAT_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH+16))/8,d6 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH+16))/8,d7 + moveq.l #(KDSPAT_WIDTH/8),d4 + + move.l pd_OriginalPattern(a6),a0 + lea 2*(KDSPAT_WIDTH/8)(a0),a0 + move.l pd_CurrPlanesPtr(a6),a1 + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + + ; second row + move.l pd_StencilSprBuffer2(a6),a2 + + ; copy left part of triangle as background + FIRST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_mask_only,(a4)+ + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + + ; copy right part of triangle as background + lea (STENCIL_WIDTH+STENCIL_WIDTH/2)/8(a1),a1 + addq.l #(STENCIL_WIDTH/2)/8,a2 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_mask_only_more,(a4)+ + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + + ; fill center part + subq.l #(STENCIL_WIDTH)/8,a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_fill,(a4)+ + move.l a1,(a4)+ ; bltdpt + + PUSHM a0/a1 + BLTHOGON + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + POPM + + ; second row + lea 1*(KALEIDO_BUF_WIDTH/8)+(STENCIL_WIDTH/2)/8-2(a1),a1 + subq.l #(STENCIL_WIDTH/2)/8+2,a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_all,(a4)+ + move.w #BLTEN_ABD+((BLT_B&BLT_A)),(a4)+ + move.l #$0000ffff,(a4)+ ; bltafwm + move.w d7,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w #-2,(a4)+ ; bltamod + move.w d7,(a4)+ ; bltdmod + + move.w pd_StencilShift6(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset6(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l d4,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea -1*(KALEIDO_BUF_WIDTH/8)-(STENCIL_WIDTH)/8(a1),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift8(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset8(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l d4,d5 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; first row + move.l pd_StencilSprBuffer1(a6),a2 + subq.w #2,a2 + lea -1*(KALEIDO_BUF_WIDTH/8)+(STENCIL_WIDTH/2)/8(a1),a1 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + + move.l #.bq_generic_abcd_with_bltcon01,(a4)+ + move.w #BLTEN_ABCD+(((BLT_B&BLT_A)|(BLT_C&~BLT_A))&$ff),(a4)+ + move.w pd_StencilShift1(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset1(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a1 + add.l d4,d5 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_generic_abcd,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_mask_only + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((STENCIL_WIDTH-STENCIL_WIDTH/2)/8)<<16)|((KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH/2))/8),bltamod(a5) +.bq_mask_only_more + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #((STENCIL_WIDTH/2)>>4)|((STENCIL_HEIGHT)<<6),(a1)+ ; bltsize + rts + +.bq_fill + BLTCON0_SET D,255,0 + move.w #((KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH))/8),bltdmod(a5) + move.l (a0)+,bltdpt(a5) + move.w #((STENCIL_WIDTH)>>4)|((STENCIL_HEIGHT)<<6),bltsize(a5) + rts + +.bq_generic_abcd_with_all + move.w (a0)+,bltcon0(a5) + move.l (a0)+,bltafwm(a5) + move.l (a0)+,bltcmod(a5) ; bltcmod/bltbmod + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod +.bq_generic_abcd_with_bltcon1 + move.w (a0)+,bltcon1(a5) +.bq_generic_abcd + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_generic_abcd_with_bltcon01 + move.l (a0)+,bltcon0(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_stencils_transition: + move.w #((STENCIL_WIDTH+16)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES)<<6),d3 + move.w #(KDSPAT_WIDTH-STENCIL_WIDTH-16)/8,d6 + move.w #(KALEIDO_BUF_WIDTH-STENCIL_WIDTH-16)/8,d7 + + ; first row + move.l pd_OriginalPattern(a6),a0 + move.l pd_CurrPlanesPtr(a6),a1 + move.l pd_StencilBuffer1(a6),a2 + lea (128/8)-2(a1),a1 + subq.w #2,a2 + + addq.w #(STENCIL_WIDTH/2)/8,a1 + + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_all,(a4)+ + move.w #BLTEN_ABCD+(((BLT_B&BLT_A)|(BLT_C&~BLT_A))&$ff),(a4)+ + move.l #$0000ffff,(a4)+ ; bltafwm + move.w d7,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w #-2,(a4)+ ; bltamod + move.w d7,(a4)+ ; bltdmod + + move.w pd_StencilShift1(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset1(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ; second row + move.l pd_StencilBuffer2(a6),a2 + lea (STENCIL_WIDTH/2)/8(a1),a1 + subq.w #2,a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift6(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset6(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea -(STENCIL_WIDTH)/8(a1),a1 + + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_generic_abcd_with_bltcon1,(a4)+ + move.w pd_StencilShift8(a6),(a4)+ ; bltcon1 + move.l a1,(a4)+ ; bltcpt + move.l a0,d5 + add.l pd_StencilOffset8(a6),d5 + move.l d5,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_generic_abcd_with_all + BLTHOGOFF + move.w (a0)+,bltcon0(a5) + move.l (a0)+,bltafwm(a5) + move.l (a0)+,bltcmod(a5) ; bltcmod/bltbmod + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod +.bq_generic_abcd_with_bltcon1 + move.w (a0)+,bltcon1(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_clear_noise_sprite_buffer: + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_SpriteStencil1Ptrs(a6),bltdpt(a5) + move.w #(INTRO_SPRITE_WIDTH>>4)|(((INTRO_SPRITE_HEIGHT+2)*2*2)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +kds_convert_noise_to_sprites: + move.w d0,d3 + lsl.w #6,d3 + addq.w #1,d3 + move.l pd_NoiseBuffer(a6),a2 + adda.w pd_NoiseOffset(a6),a2 + + move.l #.bq_generic_ad_with_all,d4 + move.l #.bq_generic_ad,d5 + move.l pd_CurrSpriteStencilPtr(a6),a3 + moveq.l #8-1,d7 +.sprloop + move.l a4,a0 + clr.l (a4)+ + move.l d4,(a4)+ + move.l (a3)+,d0 + addq.w #4,d0 + move.l a2,(a4)+ + move.l d0,(a4)+ + move.w d3,(a4)+ + addq.w #2,a2 + CALLFW AddToBlitterQueue + + move.l d5,d4 + dbra d7,.sprloop + + rts + +.bq_generic_ad_with_all + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((NOISE_WIDTH-16)/8)<<16)|2,bltamod(a5) +.bq_generic_ad + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_stencils_copy_edges: + ; copy stuff over + move.l pd_CurrPlanesPtr(a6),a1 + lea 3*STENCIL_WIDTH/8(a1),a0 + move.w #((16)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH-16)/8,d6 + + PREP_ADD_TO_BLITTER_QUEUE a3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_copy_without_left,(a4)+ + move.w d6,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w d6,(a4)+ ; bltamod + move.w d6,(a4)+ ; bltdmod + move.l a1,(a4)+ ; bltcpt + move.l a0,(a4)+ ; bltbpt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + addq.w #2,a1 + addq.w #2,a0 + + move.w #((STENCIL_WIDTH-16)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH-(STENCIL_WIDTH-16))/8,d6 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_ad_copy_with_all,(a4)+ + move.w d6,(a4)+ ; bltamod + move.w d6,(a4)+ ; bltdmod + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea (STENCIL_WIDTH/8)-2(a1),a1 + lea (STENCIL_WIDTH/8)-2(a0),a0 + + move.w #((STENCIL_WIDTH)>>4)|((STENCIL_HEIGHT*KALEIDO_PLANES)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH-(STENCIL_WIDTH))/8,d6 + + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_ad_copy_with_mods,(a4)+ + move.w d6,(a4)+ ; bltamod + move.w d6,(a4)+ ; bltdmod + move.l a1,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_acd_copy_without_left + move.l #(BLTEN_ACD+(((BLT_A&BLT_B)|(BLT_C&~BLT_B))&$ff))<<16,bltcon0(a5) + move.l (a0)+,bltcmod(a5) ; and bltbmod + move.l (a0)+,bltamod(a5) ; and bltdmod + moveq.l #-1,d0 + lea bltafwm(a5),a1 + move.l d0,(a1)+ ; bltafwm/bltalwm + move.w #$7fff,bltbdat(a5) + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_ad_copy_with_all + move.w #(BLTEN_AD+BLT_A),bltcon0(a5) +.bq_ad_copy_with_mods + move.l (a0)+,bltamod(a5) ; and bltdmod +.bq_ad_copy + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_bonus_stuff_for_col2: + ; copy stuff over + move.l pd_CurrPlanesPtr(a6),a1 + lea 4*(KALEIDO_BUF_WIDTH/8)+(3*STENCIL_WIDTH+(STENCIL_WIDTH/2))/8(a1),a1 + lea 1*(KALEIDO_BUF_WIDTH/8)(a1),a2 + + move.w #((STENCIL_WIDTH+(STENCIL_WIDTH/2))>>4)|((STENCIL_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH+(STENCIL_WIDTH/2)))/8,d6 + + PREP_ADD_TO_BLITTER_QUEUE a3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_abcd_xor,(a4)+ + move.w d6,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w d6,(a4)+ ; bltamod + move.w d6,(a4)+ ; bltdmod + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l pd_HexagonTopMaskPtr(a6),(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.l pd_CurrPlanesPtr(a6),a1 + lea 3*(KALEIDO_BUF_WIDTH/8)+(3*STENCIL_WIDTH+(STENCIL_WIDTH/2))/8(a1),a1 + move.l pd_BonusGridPtr(a6),a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_merge,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #((STENCIL_WIDTH/2)>>4)|((STENCIL_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH/2))/8,d6 + + move.l pd_CurrPlanesPtr(a6),a1 + lea 3*(KALEIDO_BUF_WIDTH/8)+(STENCIL_WIDTH/2)/8(a1),a1 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_acd_clear,(a4)+ + move.w d6,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltamod + move.w d6,(a4)+ ; bltdmod + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_abcd_xor + lea bltcon0(a5),a1 + move.l #(BLTEN_ABCD+((BLT_A&(BLT_B^BLT_C)|(BLT_C&~BLT_A))&$ff))<<16,(a1)+ + move.l (a0)+,bltcmod(a5) ; and bltbmod + move.l (a0)+,bltamod(a5) ; and bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_acd_merge + move.l #(BLTEN_ACD+((BLT_A|BLT_C)&$ff))<<16,bltcon0(a5) + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_acd_clear + move.l #(BLTEN_ACD+((~BLT_A&BLT_C)&$ff))<<16,bltcon0(a5) + move.w (a0)+,bltcmod(a5) + move.l (a0)+,bltamod(a5) ; and bltdmod + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + addq.l #4,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_bonus_stuff_for_col5: + ; copy stuff over + move.l pd_CurrP5BonusPlanePtr(a6),a1 + lea (STENCIL_WIDTH/2)/8(a1),a1 + + move.l pd_CurrPlanesPtr(a6),a2 + lea 5*(KALEIDO_BUF_WIDTH/8)+(STENCIL_WIDTH/2)/8(a2),a2 + move.w #((2*STENCIL_WIDTH)>>4)|((STENCIL_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(2*STENCIL_WIDTH))/8,d6 + + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_abcd_xor,(a4)+ + move.w d6,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w d6,(a4)+ ; bltamod + move.w d6,(a4)+ ; bltdmod + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l pd_HexagonTopMaskPtr(a6),(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.l pd_CurrPlanesPtr(a6),a2 + lea 5*(KALEIDO_BUF_WIDTH/8)(a2),a2 ; plane 6 + move.l pd_CurrP5BottomPlanePtr(a6),a1 + move.l pd_HexagonTopMaskPtr(a6),a0 + lea (KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES*(KALEIDO_HEIGHT-LAST_SLICE_HEIGHT)+(STENCIL_WIDTH/2)/8(a1),a1 + lea (KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES*(KALEIDO_HEIGHT-LAST_SLICE_HEIGHT)+(STENCIL_WIDTH/2)/8(a2),a2 + lea (KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES*(KALEIDO_HEIGHT-LAST_SLICE_HEIGHT)(a0),a0 + + move.w #(2*STENCIL_WIDTH>>4)|((LAST_SLICE_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-2*STENCIL_WIDTH)/8,d6 + + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_abcd_xor,(a4)+ + move.w d6,(a4)+ ; bltcmod + move.w d6,(a4)+ ; bltbmod + move.w d6,(a4)+ ; bltamod + move.w d6,(a4)+ ; bltdmod + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_abcd_xor + lea bltcon0(a5),a1 + move.l #(BLTEN_ABCD+(((BLT_A&BLT_B)|(BLT_C&~BLT_A))&$ff))<<16,(a1)+ + move.l (a0)+,bltcmod(a5) ; and bltbmod + move.l (a0)+,bltamod(a5) ; and bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_clear_bonus_stuff_for_col2: + ; clear extra line stuff in bitplane 4 from col2/5 + move.w #((STENCIL_WIDTH+(STENCIL_WIDTH/2))>>4)|((STENCIL_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH+(STENCIL_WIDTH/2)))/8,d6 + + move.l pd_CurrPlanesPtr(a6),a1 + lea 3*(KALEIDO_BUF_WIDTH/8)+(3*STENCIL_WIDTH+(STENCIL_WIDTH/2))/8(a1),a1 + + PREP_ADD_TO_BLITTER_QUEUE a3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_d_clear,(a4)+ + move.w d6,(a4)+ ; bltdmod + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #((STENCIL_WIDTH/2)>>4)|((STENCIL_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH/2))/8,d6 + + move.l pd_CurrPlanesPtr(a6),a1 + lea 3*(KALEIDO_BUF_WIDTH/8)+(STENCIL_WIDTH/2)/8(a1),a1 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_d_clear,(a4)+ + move.w d6,(a4)+ ; bltdmod + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_d_clear + BLTCON_SET D,0,0,0 + move.w (a0)+,bltdmod(a5) + move.l (a0)+,bltdpt(a5) + move.w (a0)+,bltsize(a5) + rts + +;-------------------------------------------------------------------- + +kds_draw_p5_flip13: + move.l pd_CurrPlanesPtr(a6),a1 + lea 4*(KALEIDO_BUF_WIDTH/8)+(2*STENCIL_WIDTH)/8(a1),a1 ; plane 5 + lea (KALEIDO_BUF_WIDTH/8)(a1),a2 ; plane 6 + move.l pd_CurrP5Xor6PlanePtr(a6),a0 + lea (2*STENCIL_WIDTH/8)(a0),a0 + + move.w #((2*STENCIL_WIDTH)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-2*STENCIL_WIDTH)/8,d0 + + PREP_ADD_TO_BLITTER_QUEUE a3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_abcd_with_all,(a4)+ + move.w d0,(a4)+ ; bltcmod + move.w d0,(a4)+ ; bltbmod + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l pd_HexagonBottomMaskPtr(a6),(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #((STENCIL_WIDTH)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-STENCIL_WIDTH)/8,d0 + lea (2*STENCIL_WIDTH)/8(a1),a1 + lea (2*STENCIL_WIDTH)/8(a0),a0 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_with_all,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #((2*STENCIL_WIDTH)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-2*STENCIL_WIDTH)/8,d0 + lea -(STENCIL_WIDTH)/8(a0),a0 + lea -(3*STENCIL_WIDTH)/8(a0),a1 + + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_without_left,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + rts + +.bq_xor_abcd_with_all + lea bltcon0(a5),a1 + move.l #(BLTEN_ABCD+((BLT_C^(BLT_B&BLT_A))&$ff))<<16,(a1)+ + move.l (a0)+,bltcmod(a5) ; bltcmod/bltbmod + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy_ad_with_all + BLTCON0_SET AD,BLT_A,0 + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy_ad_without_left + BLTCON0_SET AD,BLT_A,0 + move.w #$7fff,bltafwm(a5) + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_p5_flip134: + move.l pd_CurrPlanesPtr(a6),a1 + lea 4*(KALEIDO_BUF_WIDTH/8)(a1),a1 ; plane 5 + lea (KALEIDO_BUF_WIDTH/8)(a1),a2 ; plane 6 + + move.w #((KALEIDO_WIDTH)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,d0 + + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_abcd_with_all,(a4)+ + move.w d0,(a4)+ ; bltcmod + move.w d0,(a4)+ ; bltbmod + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l pd_Hexagon2MaskPtr(a6),(a4)+ ; bltapt + move.l pd_CurrP5Xor6PlanePtr(a6),(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_xor_abcd_with_all + lea bltcon0(a5),a1 + move.l #(BLTEN_ABCD+(((BLT_A&BLT_C)|(~BLT_A&(BLT_C^BLT_B)))&$ff))<<16,(a1)+ + move.l (a0)+,bltcmod(a5) ; bltcmod/bltbmod + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_p5_flip4_to_bonus: + move.l pd_CurrP5Xor6PlanePtr(a6),a1 + move.l pd_CurrP5BonusPlanePtr(a6),a2 + + move.w #((KALEIDO_WIDTH-(STENCIL_WIDTH+STENCIL_WIDTH/2))>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(KALEIDO_WIDTH-(STENCIL_WIDTH+STENCIL_WIDTH/2)))/8,d0 + + PREP_ADD_TO_BLITTER_QUEUE a3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_with_all,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #((STENCIL_WIDTH+STENCIL_WIDTH/2)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH+STENCIL_WIDTH/2))/8,d0 + lea (STENCIL_WIDTH/2)/8(a1),a1 + lea (KALEIDO_WIDTH-(STENCIL_WIDTH+STENCIL_WIDTH/2))/8(a2),a2 + + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_with_all,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + rts + +.bq_copy_ad_with_all + lea bltcon0(a5),a1 + move.l #(BLTEN_AD+BLT_A)<<16,(a1)+ + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + addq.l #8,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_p5_flip4_to_bottom: + move.l pd_CurrPlanesPtr(a6),a1 + lea 4*(KALEIDO_BUF_WIDTH/8)(a1),a1 ; plane 5 + move.l pd_CurrP5BottomPlanePtr(a6),a2 + lea (KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES*(KALEIDO_HEIGHT-LAST_SLICE_HEIGHT)(a1),a1 + lea (KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES*(KALEIDO_HEIGHT-LAST_SLICE_HEIGHT)(a2),a2 + + move.w #(KALEIDO_WIDTH>>4)|((LAST_SLICE_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,d0 + + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_with_all,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_copy_ad_with_all + lea bltcon0(a5),a1 + move.l #(BLTEN_AD+BLT_A)<<16,(a1)+ + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + addq.l #8,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_p5_flip5_to_bottom: + move.l pd_CurrPlanesPtr(a6),a1 + lea 4*(KALEIDO_BUF_WIDTH/8)(a1),a1 ; plane 5 + move.l pd_CurrP5BottomPlanePtr(a6),a2 + lea (KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES*(KALEIDO_HEIGHT-LAST_SLICE_HEIGHT)(a1),a1 + lea (KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES*(KALEIDO_HEIGHT-LAST_SLICE_HEIGHT)(a2),a2 + + move.w #(KALEIDO_WIDTH>>4)|((LAST_SLICE_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,d0 + + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_with_all,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltapt + move.l a2,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_copy_ad_with_all + lea bltcon0(a5),a1 + move.l #(BLTEN_AD+BLT_A)<<16,(a1)+ + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + addq.l #8,a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_p6_flip24: + move.l pd_CurrPlanesPtr(a6),a1 + lea 4*(KALEIDO_BUF_WIDTH/8)+(STENCIL_WIDTH/2)/8(a1),a1 ; plane 5 + lea (KALEIDO_BUF_WIDTH/8)(a1),a2 ; plane 6 + move.l pd_CurrP6Xor5PlanePtr(a6),a0 + lea (STENCIL_WIDTH/2)/8(a0),a0 + + move.w #((2*STENCIL_WIDTH)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-2*STENCIL_WIDTH)/8,d0 + + PREP_ADD_TO_BLITTER_QUEUE a3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_xor_abcd_with_all,(a4)+ + move.w d0,(a4)+ ; bltcmod + move.w d0,(a4)+ ; bltbmod + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l pd_HexagonTopMaskPtr(a6),(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #((STENCIL_WIDTH)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-STENCIL_WIDTH)/8,d0 + lea (2*STENCIL_WIDTH)/8(a2),a2 + lea (2*STENCIL_WIDTH)/8(a0),a0 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_with_all,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #((STENCIL_WIDTH+STENCIL_WIDTH/2)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-(STENCIL_WIDTH+STENCIL_WIDTH/2))/8,d0 + lea (1*STENCIL_WIDTH)/8(a0),a0 + lea -(3*STENCIL_WIDTH)/8(a0),a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_with_mods,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.w #((STENCIL_WIDTH)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-STENCIL_WIDTH)/8,d0 + lea -(3*STENCIL_WIDTH+STENCIL_WIDTH/2)/8(a0),a0 + lea (3*STENCIL_WIDTH)/8(a0),a2 + + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_ad_without_left,(a4)+ + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + rts + +.bq_xor_abcd_with_all + lea bltcon0(a5),a1 + move.l #(BLTEN_ABCD+((BLT_B^(BLT_C&BLT_A))&$ff))<<16,(a1)+ ; bltcon0/1 + move.l (a0)+,bltcmod(a5) ; bltcmod/bltbmod + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy_ad_with_all + BLTCON0_SET AD,BLT_A,0 +.bq_copy_ad_with_mods + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy_ad_without_left + BLTCON0_SET AD,BLT_A,0 + move.w #$7fff,bltafwm(a5) + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_draw_p6_flip2: + move.l pd_CurrPlanesPtr(a6),a1 + lea 4*(KALEIDO_BUF_WIDTH/8)(a1),a1 ; plane 5 + lea (KALEIDO_BUF_WIDTH/8)(a1),a2 ; plane 6 + + move.w #((KALEIDO_WIDTH)>>4)|((KALEIDO_HEIGHT)<<6),d3 + move.w #(KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,d0 + + ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_generic_abcd_with_all,(a4)+ + move.l #(BLTEN_ABCD+((BLT_B^(BLT_C&BLT_A))&$ff))<<16,(a4)+ + move.w d0,(a4)+ ; bltcmod + move.w d0,(a4)+ ; bltbmod + move.w d0,(a4)+ ; bltamod + move.w d0,(a4)+ ; bltdmod + + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l pd_HexagonTopMaskPtr(a6),(a4)+ ; bltapt + move.l pd_CurrP6Xor5PlanePtr(a6),(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + rts + +.bq_generic_abcd_with_all + lea bltcon0(a5),a1 + move.l (a0)+,(a1)+ ; bltcon0/1 + move.l (a0)+,bltcmod(a5) ; bltcmod/bltbmod + move.l (a0)+,bltamod(a5) ; bltamod/bltdmod + moveq.l #-1,d0 + move.l d0,(a1)+ ; bltafwm/bltalwm + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +kds_calc_spline_pos: + move.w pd_SplinePos(a6),d0 + addq.w #2,d0 + move.w d0,pd_SplinePos(a6) + move.w #(SPLINE_TABLE_SIZE-1)*2,d1 + and.w d0,d1 + lea kds_bernstein0(pc),a0 + adda.w d1,a0 + + lsr.w #6,d0 + and.w #-4,d0 + move.w d0,d1 + add.w d1,d1 + add.w d0,d1 ; *12 + lea kds_fairy_points(pc),a1 + movem.w (a1,d1.w),d0-d7 + PUTMSG 20,<"%d,%d %d,%d %d,%d %d,%d">,d0,d1,d2,d3,d4,d5,d6,d7 + mulu (a0),d0 + mulu (a0),d1 + mulu kds_bernstein1-kds_bernstein0(a0),d2 + mulu kds_bernstein1-kds_bernstein0(a0),d3 + add.l d2,d0 + add.l d3,d1 + move.w kds_bernstein2-kds_bernstein0(a0),d2 + mulu d2,d4 + mulu d2,d5 + add.l d4,d0 + add.l d5,d1 + move.w kds_bernstein3-kds_bernstein0(a0),d2 + mulu d2,d6 + mulu d2,d7 + add.l d6,d0 + add.l d7,d1 + move.l #$8000,d2 + add.l d2,d0 + add.l d2,d1 + swap d0 + swap d1 + PUTMSG 20,<"XY %d,%d">,d0,d1 + sub.w #KALEIDO_WIDTH/2,d0 + sub.w #KALEIDO_VHEIGHT/2,d1 + move.w d0,d3 + move.w d1,d4 + move.w d0,pd_FairyPosX(a6) + move.w d1,pd_FairyPosY(a6) + + bsr.s .plant + move.w pd_FairyPosX(a6),d3 + move.w pd_FairyPosY(a6),d4 + +.plant + lea pd_BackDust(a6),a1 + move.w pd_NextBackDustOffset(a6),d2 + add.w #fd_SIZEOF,d2 + cmp.w #fd_SIZEOF*NUM_BACK_DUST,d2 + bne.s .cont + moveq.l #0,d2 +.cont move.w d2,pd_NextBackDustOffset(a6) + adda.w d2,a1 + + move.l pd_NoiseValueA(a6),d0 + move.l pd_NoiseValueB(a6),d1 + lea kds_dust_pos(pc),a0 + moveq.l #15,d2 + and.w d0,d2 + add.w d2,d2 + PUTMSG 20,<"Dustpos %d">,d2 + add.w (a0,d2.w),d3 + add.w 2*16(a0,d2.w),d4 + moveq.l #31,d2 + and.w d1,d2 + add.w #32,d2 + move.w d2,fd_Time(a1) + move.w d3,fd_PosX(a1) + move.w d4,fd_PosY(a1) + + move.l d1,d2 + swap d2 + add.l d0,d1 + add.l d2,d0 + move.l d0,pd_NoiseValueA(a6) + move.l d1,pd_NoiseValueB(a6) + + swap d0 + swap d1 + asr.w #1,d0 + asr.w #2,d1 + ext.l d0 + ext.l d1 + move.l d0,fd_SpeedX(a1) + move.l d1,fd_SpeedY(a1) + + rts + +;-------------------------------------------------------------------- + +kds_update_fairy_sprite: + move.w pd_FairyPosX(a6),d4 + move.w pd_FairyPosY(a6),d1 + + IF 0 + move.w pd_FairySpriteFrame(a6),d0 + add.w #8*4,d0 + and.w #3*(8*4),d0 + move.w d0,pd_FairySpriteFrame(a6) + + lea pd_FairySprites1(a6),a2 + adda.w d0,a2 + move.l a2,pd_CurrFairySprite(a6) + ENDC + + move.l pd_CurrFairySprite(a6),a2 + add.w #128-(FAIRY_WIDTH/2),d4 + add.w #$52-(FAIRY_HEIGHT/2),d1 + ;add.w #$52,d1 + + move.w d1,d2 + add.w #FAIRY_HEIGHT,d2 + moveq.l #0,d0 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d0,d0 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d0,d0 ; ev8 + lsr.w #1,d4 ; sh8-sh1 in d4 + addx.w d0,d0 ; sh0 + or.w d2,d0 ; ev7-ev0, sv8, ev8, sh0 in d0 + or.w d1,d4 ; sv7-sv0, sh8-sh1 in d4 + tas d0 ; att TAS sets bit 7 +.filldata + REPT (FAIRY_WIDTH/16) + move.l (a2)+,a0 + move.l (a2)+,a1 + move.w d4,(a0)+ + move.w d0,(a0)+ + move.w d4,(a1)+ + move.w d0,(a1)+ + addq.w #8,d4 + ENDR + rts + +;-------------------------------------------------------------------- + +kds_update_stencil_sprite: + move.l pd_CurrSpriteStencilPtr(a6),a2 + move.w #128+96,d0 + move.w #$52+37,d1 + move.w d1,d2 + add.w #INTRO_SPRITE_SHEIGHT,d2 + moveq.l #0,d3 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d3,d3 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d3,d3 ; ev8 + lsr.w #1,d0 ; sh8-sh1 in d0 + addx.w d3,d3 ; sh0 + or.w d2,d3 ; ev7-ev0, sv8, ev8, sh0 in d3 + or.w d1,d0 ; sv7-sv0, sh8-sh1 in d0 + ;tas d3 ; att TAS sets bit 7 +.filldata + REPT 8 + move.l (a2)+,a0 + move.w d0,(a0)+ + move.w d3,(a0)+ + addq.w #8,d0 + ENDR + rts + +;-------------------------------------------------------------------- + +kds_update_stencil_pre_main_sprite: + move.l pd_CurrSpriteStencilPtr(a6),a2 + move.w #128,d0 + move.w #$52,d1 + move.w d1,d2 + add.w #INTRO_SPRITE_HEIGHT,d2 + moveq.l #0,d3 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d3,d3 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d3,d3 ; ev8 + lsr.w #1,d0 ; sh8-sh1 in d0 + addx.w d3,d3 ; sh0 + or.w d2,d3 ; ev7-ev0, sv8, ev8, sh0 in d3 + or.w d1,d0 ; sv7-sv0, sh8-sh1 in d0 + ;tas d3 ; att TAS sets bit 7 +.filldata + REPT 8 + move.l (a2)+,a0 + move.w d0,(a0)+ + move.w d3,(a0)+ + addq.w #8,d0 + ENDR + rts + +;-------------------------------------------------------------------- + +kds_kill_stencil_sprite: + move.l pd_CurrSpriteStencilPtr(a6),a2 + moveq.l #0,d0 + REPT 8 + move.l (a2)+,a0 + move.l d0,(a0) + ENDR + rts + +;-------------------------------------------------------------------- + +kds_update_sprites_and_cols_in_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l pd_CurrFairySprite(a6),a1 + move.w #sprpt,d1 + moveq.l #(FAIRY_WIDTH/16)*4-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + lea pd_IntroPalette(a6),a1 + REPT 8 + move.w REPTN*cl_SIZEOF+cl_Color(a1),REPTN*4+2(a0) + ENDR + rts + +;-------------------------------------------------------------------- + +kds_update_sprites_in_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l pd_CurrFairySprite(a6),a1 + move.w #sprpt,d1 + moveq.l #(INTRO_SPRITE_WIDTH/16)*2-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + rts + +;-------------------------------------------------------------------- + +kds_create_intro_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + + move.l pd_CurrFairySprite(a6),a1 + move.w #sprpt,d1 + moveq.l #(FAIRY_WIDTH/16)*4-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + lea pd_IntroPalette(a6),a1 + moveq.l #8-1,d7 + move.w #color,d0 +.blloop + move.w d0,(a0)+ + move.w cl_Color(a1),(a0)+ + lea cl_SIZEOF(a1),a1 + addq.w #2,d0 + dbra d7,.blloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + + ; screen width : 128 -> offset +96 + ; screen height: 53*2-1 = 105 -> offset +37 + COPIMOVE $3200,bplcon0 + COPIMOVE $0081+((($52+37)&$ff)<<8),diwstrt + COPIMOVE $00c1+((($06-38)&$ff)<<8),diwstop + COPIMOVE $0038+(96/2),ddfstrt + COPIMOVE $00d0-(96/2),ddfstop + + move.l pd_CurrPlanesPtr(a6),d0 + add.l #1*(KALEIDO_BUF_WIDTH/8),d0 ; select p2/p3/p4 + moveq.l #KALEIDO_BUF_WIDTH/8,d2 + move.w #bplpt,d1 + moveq.l #3-1,d7 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl1mod + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl2mod + + move.w #$0037+((($51)&$ff)<<8),d0 + move.w #$100,d2 + moveq.l #37+STENCIL_HEIGHT,d7 + bsr .dolines + + move.w #$07+((($51+37+STENCIL_HEIGHT)&$ff)<<8),(a0)+ + move.w d3,(a0)+ + + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl2mod + + moveq.l #STENCIL_HEIGHT,d7 + bsr .dolines + + move.l d3,(a0)+ + rts +.dolines +.cprloop + move.w d0,(a0)+ + move.w d3,(a0)+ + COPIMOVE $0000,bpldat+2*2 + COPIMOVE $0000,bpldat+1*2 + COPIMOVE $0000,bpldat + + add.w d2,d0 + dbra d7,.cprloop + rts + +;-------------------------------------------------------------------- + +kds_create_transition_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + + move.l pd_CurrFairySprite(a6),a1 + move.w #sprpt,d1 + moveq.l #(FAIRY_WIDTH/16)*4-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + + ; screen width : 128 -> offset +96 + ; screen height: 53*2-1 = 105 -> offset +37 + COPIMOVE $0081+((($52+37)&$ff)<<8),diwstrt + COPIMOVE $00c1+((($06-38)&$ff)<<8),diwstop + COPIMOVE $0038+(96/2),ddfstrt + COPIMOVE $00d0-(96/2),ddfstop + + move.w pd_TransitionHeight(a6),d4 + beq.s .noham + move.l pd_CurrPlanesPtr(a6),d0 + addq.l #(128/8)/2,d0 + addq.l #(128/8)/2,d0 + move.w #$6a00,d3 + moveq.l #KALEIDO_PLANES-1,d7 + bra.s .didham +.noham + bsr .dopal + move.w #$4200,d3 + moveq.l #4-1,d7 + move.l pd_CurrPlanesPtr(a6),d0 +.didham + COPRMOVE d3,bplcon0 + moveq.l #KALEIDO_BUF_WIDTH/8,d2 + move.w #bplpt,d1 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.w #$00d5+((($51+37)&$ff)<<8),d0 + move.w #$100,d2 + + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl1mod + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset1(a6) + + move.w d4,d7 + beq.s .skip1 + cmp.w #STENCIL_HEIGHT,d7 + blt.s .nomax1 + moveq.l #STENCIL_HEIGHT,d7 +.nomax1 subq.w #1,d7 + bsr .dolines + + cmp.w #STENCIL_HEIGHT,d4 + bgt.s .skip1b + blt.s .normalskip + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128-128)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128-128)/8,bpl2mod + bra.s .matchskip +.normalskip + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128-128)/8,bpl1mod + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128-128)/8,bpl2mod +.matchskip + move.w d0,d1 + move.b #$c1,d1 + move.w d1,(a0)+ + move.w d3,(a0)+ + + COPIMOVE $4200,bplcon0 + + cmp.w #STENCIL_HEIGHT,d4 + bne.s .normalskip2 + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl2mod + bra.s .matchskip2 +.normalskip2 + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl1mod + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl2mod +.matchskip2 + bsr .dopal + + cmp.w #STENCIL_HEIGHT,d4 + beq.s .modsset +.skip1 + move.w #$07+((($51+37+STENCIL_HEIGHT)&$ff)<<8),(a0)+ + move.w d3,(a0)+ +.skip1b + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl2mod +.modsset + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset2(a6) + + move.w d4,d7 + sub.w #STENCIL_HEIGHT,d7 + ble.s .skip2 + subq.w #1,d7 + bsr .dolines + + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128-128)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128-128)/8,bpl2mod + move.w d0,d1 + move.b #$c1,d1 + move.w d1,(a0)+ + move.w d3,(a0)+ + + COPIMOVE $4200,bplcon0 + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-128)/8,bpl2mod + + bsr.s .dopal +.skip2 + + move.l d3,(a0)+ + rts + +.dolines +.cprloop + move.w d0,(a0)+ + move.w d3,(a0)+ + COPIMOVE $400,(color+1*2) + COPIMOVE $080,(color+2*2) + COPIMOVE $00c,(color+3*2) + + add.w d2,d0 + dbra d7,.cprloop + rts + +.dopal + lea kds_intro_palette(pc),a1 + moveq.l #8-1,d7 + move.w #color,d0 +.blloop + move.w d0,(a0)+ + move.w (a1)+,(a0)+ + addq.w #4,d0 + dbra d7,.blloop + rts + +;-------------------------------------------------------------------- + +kds_create_pre_main_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + move.l pd_CurrFairySprite(a6),a1 + move.w #sprpt,d1 + moveq.l #(FAIRY_WIDTH/16)*4-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + + move.l #$1fe0000,d4 + + COPIMOVE $6a00,bplcon0 + move.l pd_CurrPlanesPtr(a6),d0 + moveq.l #KALEIDO_PLANES-1,d7 + move.w #bplpt,d1 + moveq.l #KALEIDO_BUF_WIDTH/8,d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.w #$51d5,d0 + move.w #$100,d2 + + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl1mod + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset1(a6) + + moveq.l #STENCIL_HEIGHT-1,d7 + bsr .dolines + + ;COPIMOVE $0200,bplcon0 + ;move.l d3,(a0)+ + + move.l a0,d1 + sub.l a2,d1 + move.w d1,pd_CopperMirror1P5PtrOffset(a6) + + move.l d4,(a0)+ + move.l d4,(a0)+ + + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset2(a6) + + moveq.l #STENCIL_HEIGHT-1-1,d7 + bsr .dolines + + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl1mod + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset3(a6) + + moveq.l #STENCIL_HEIGHT-1-1,d7 + bsr .dolines + + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset4(a6) + + moveq.l #(LAST_SLICE_HEIGHT)-1,d7 + bsr .dolines + + move.l d3,(a0)+ + rts + +.dolines +.cprloop + move.w d0,(a0)+ + move.w d3,(a0)+ + add.w d2,d0 + COPIMOVE $346,(color+6*2) + COPIMOVE $346,(color+1*2) + COPIMOVE $346,(color+2*2) + COPIMOVE $346,(color+3*2) + COPIMOVE $346,(color+4*2) + COPIMOVE $346,(color+7*2) + COPIMOVE $346,(color+5*2) + + move.w d0,d1 + move.b #$1b,d1 + move.w d1,(a0)+ + move.w d3,(a0)+ + COPIMOVE $5240,spr+sd_pos+0*sd_SIZEOF + COPIMOVE $5248,spr+sd_pos+1*sd_SIZEOF + COPIMOVE $5250,spr+sd_pos+2*sd_SIZEOF + COPIMOVE $5258,spr+sd_pos+3*sd_SIZEOF + COPIMOVE $5260,spr+sd_pos+4*sd_SIZEOF + COPIMOVE $5268,spr+sd_pos+5*sd_SIZEOF + COPIMOVE $5270,spr+sd_pos+6*sd_SIZEOF + COPIMOVE $5278,spr+sd_pos+7*sd_SIZEOF + + COPIMOVE $5280,spr+sd_pos+0*sd_SIZEOF + COPIMOVE $5288,spr+sd_pos+1*sd_SIZEOF + COPIMOVE $5290,spr+sd_pos+2*sd_SIZEOF + COPIMOVE $5298,spr+sd_pos+3*sd_SIZEOF + COPIMOVE $52a0,spr+sd_pos+4*sd_SIZEOF + COPIMOVE $52a8,spr+sd_pos+5*sd_SIZEOF + COPIMOVE $52b0,spr+sd_pos+6*sd_SIZEOF + COPIMOVE $52b8,spr+sd_pos+7*sd_SIZEOF + + COPIMOVE $52c0,spr+sd_pos+0*sd_SIZEOF + COPIMOVE $52c8,spr+sd_pos+1*sd_SIZEOF + COPIMOVE $52d0,spr+sd_pos+2*sd_SIZEOF + COPIMOVE $52d8,spr+sd_pos+3*sd_SIZEOF + + dbra d7,.cprloop + rts + +;-------------------------------------------------------------------- + +kds_create_kaleidoscope_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + move.l #$1fe0000,d4 + + COPIMOVE DMAF_SPRITE,dmacon ; disable sprite dma + + COPIMOVE $6a00,bplcon0 + move.l pd_CurrPlanesPtr(a6),d0 + moveq.l #KALEIDO_PLANES-1,d7 + move.w #bplpt,d1 + moveq.l #KALEIDO_BUF_WIDTH/8,d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.w #$51d5,d0 + move.w #$100,d2 + + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl1mod + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset1(a6) + + moveq.l #STENCIL_HEIGHT-1,d7 + bsr .dolines + + move.l a0,d1 + sub.l a2,d1 + move.w d1,pd_CopperMirror1P5PtrOffset(a6) + + move.l d4,(a0)+ + move.l d4,(a0)+ + + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset2(a6) + + moveq.l #STENCIL_HEIGHT-1-1,d7 + bsr .dolines + + move.l a0,d1 + sub.l a2,d1 + move.w d1,pd_CopperMirror2P56PtrOffset(a6) + + move.l d4,(a0)+ + move.l d4,(a0)+ + move.l d4,(a0)+ + move.l d4,(a0)+ + + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl1mod + COPIMOVE (KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset3(a6) + + moveq.l #STENCIL_HEIGHT-1-1,d7 + bsr .dolines + + move.l a0,d1 + sub.l a2,d1 + move.w d1,pd_CopperMirror3P5PtrOffset(a6) + + move.l d4,(a0)+ + move.l d4,(a0)+ + + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl1mod + COPIMOVE (-1*KALEIDO_BUF_WIDTH*KALEIDO_PLANES-KALEIDO_WIDTH)/8,bpl2mod + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperLinesFixupOffset4(a6) + + moveq.l #(LAST_SLICE_HEIGHT)-1,d7 + bsr .dolines + + move.l d3,(a0)+ + rts +.dolines +.cprloop + move.w d0,(a0)+ + move.w d3,(a0)+ + COPIMOVE $346,(color+6*2) + COPIMOVE $346,(color+1*2) + COPIMOVE $346,(color+2*2) + COPIMOVE $346,(color+3*2) + COPIMOVE $346,(color+4*2) + COPIMOVE $346,(color+7*2) + COPIMOVE $346,(color+5*2) + + COPIMOVE $346,(color+14*2) + COPIMOVE $346,(color+9*2) + COPIMOVE $346,(color+10*2) + + add.w d2,d0 + dbra d7,.cprloop + rts + +;-------------------------------------------------------------------- + +kds_calc_true_color_image: + PUTMSG 10,<"TC Image %p">,a1 + move.w #KDSPAT_HEIGHT,-(sp) +.lineloop + moveq.l #(KDSPAT_WIDTH/16)-1,d7 + move.w (a2),d6 ; background color + swap d6 +.wordloop + move.w 5*(KDSPAT_WIDTH/8)(a0),d5 + move.w 4*(KDSPAT_WIDTH/8)(a0),d4 + move.w 3*(KDSPAT_WIDTH/8)(a0),d3 + move.w 2*(KDSPAT_WIDTH/8)(a0),d2 + move.w 1*(KDSPAT_WIDTH/8)(a0),d1 + move.w (a0)+,d0 + swap d7 + move.w #15,d7 +.pixelloop + clr.w d6 + add.w d3,d3 + addx.w d6,d6 + add.w d2,d2 + addx.w d6,d6 + add.w d1,d1 + addx.w d6,d6 + add.w d0,d0 + addx.w d6,d6 + + add.w d5,d5 + bcc.s .blue +.greenOrRed + add.w d4,d4 + bcs.s .green +.red + PUTMSG 50,<"Red %d">,d6 + move.b d6,(a1) + swap d6 + move.b d6,1(a1) + move.w (a1)+,d6 + bra.s .contloop + +.green + PUTMSG 50,<"Green %d">,d6 + move.w d7,a4 + move.w d6,d7 + lsl.w #4,d7 + swap d6 + and.w #$f0f,d6 + or.w d7,d6 + move.w d6,(a1)+ + move.w a4,d7 + bra.s .contloop + +.blue add.w d4,d4 + PUTMSG 50,<"Blue %d">,d6 + move.w d7,a4 + move.w d6,d7 + swap d6 + and.w #$ff0,d6 + or.w d7,d6 + move.w d6,(a1)+ + move.w a4,d7 +.contloop + swap d6 + dbra d7,.pixelloop + swap d7 + dbra d7,.wordloop +.nextline + lea 5*(KDSPAT_WIDTH/8)(a0),a0 + subq.w #1,(sp) + bne .lineloop + addq.w #2,sp + rts + +;-------------------------------------------------------------------- + +;-------------------------------------------------------------------- + +;-------------------------------------------------------------------- +; a0: SMC buffer +; d0-d3: x1,y1 - x2,y2 +; d4: lineinc +; d7 high word not trashed +kds_bresenham_smc_line_draw: + PUTMSG 10,<"SMC Buffer %p">,a0 + moveq.l #2,d5 + sub.w d1,d3 + sub.w d0,d2 + bpl.s .rightwards + moveq.l #-2,d5 + neg.w d2 +.rightwards + add.w d0,d0 + + move.w d3,d1 ; error term + move.w d3,d7 + add.w d2,d2 ; dx * 2 + add.w d3,d3 ; dy * 2 + +.lineloop + move.w #$32e8,(a0)+ ; move.w x(a0),(a1)+ + move.w d0,(a0)+ + add.w d4,d0 + sub.w d2,d1 + dble d7,.lineloop + add.w d3,d1 + add.w d5,d0 + subq.w #1,d7 + bpl.s .lineloop +.done1 + move.w #$4e75,(a0)+ ; rts + rts + +kds_setting1_coplist: +kds_setting2_coplist: + move.l pd_CurrCopListPtr(a6),a2 + + move.l a2,a0 + move.w #$1fe,d0 + adda.w pd_CopperMirror1P5PtrOffset(a6),a0 + move.w d0,(a0) + move.w d0,4(a0) + + move.l a2,a0 + adda.w pd_CopperMirror2P56PtrOffset(a6),a0 + move.w d0,(a0) + move.w d0,4(a0) + move.w d0,8(a0) + move.w d0,12(a0) + + adda.w pd_CopperMirror3P5PtrOffset(a6),a2 + move.w d0,(a2) + move.w d0,4(a2) + rts + +kds_setting3_coplist: + move.l pd_CurrCopListPtr(a6),a2 + + move.l a2,a0 + adda.w pd_CopperMirror1P5PtrOffset(a6),a0 + move.l pd_CurrP5Xor6PlanePtr(a6),a1 + lea (STENCIL_HEIGHT-1)*(KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES(a1),a1 + move.l a1,d0 + swap d0 + move.w #bplpt+4*4,(a0)+ + move.w d0,(a0)+ + move.w #bplpt+4*4+2,(a0)+ + move.w a1,(a0)+ + + move.w #$1fe,d0 + move.l a2,a0 + adda.w pd_CopperMirror2P56PtrOffset(a6),a0 + move.w d0,(a0) + move.w d0,4(a0) + move.w d0,8(a0) + move.w d0,12(a0) + + adda.w pd_CopperMirror3P5PtrOffset(a6),a2 + move.l pd_CurrPlanesPtr(a6),a1 + lea (STENCIL_HEIGHT-1)*(KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES+4*(KALEIDO_BUF_WIDTH/8)(a1),a1 + move.l a1,d0 + swap d0 + move.w #bplpt+4*4,(a2)+ + move.w d0,(a2)+ + move.w #bplpt+4*4+2,(a2)+ + move.w a1,(a2)+ + rts + +kds_setting4_coplist: + move.l pd_CurrCopListPtr(a6),a2 + + move.l a2,a0 + adda.w pd_CopperMirror1P5PtrOffset(a6),a0 + move.l pd_CurrP5Xor6PlanePtr(a6),a1 + lea (STENCIL_HEIGHT-1)*(KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES(a1),a1 + move.l a1,d0 + swap d0 + move.w #bplpt+4*4,(a0)+ + move.w d0,(a0)+ + move.w #bplpt+4*4+2,(a0)+ + move.w a1,(a0)+ + + move.l a2,a0 + adda.w pd_CopperMirror2P56PtrOffset(a6),a0 + move.w #bplpt+5*4,(a0)+ + move.w pd_CurrP6Xor5PlanePtr(a6),(a0)+ + move.w #bplpt+5*4+2,(a0)+ + move.w pd_CurrP6Xor5PlanePtr+2(a6),(a0)+ + + move.w #$1fe,d0 + move.w d0,(a0) + move.w d0,4(a0) + + adda.w pd_CopperMirror3P5PtrOffset(a6),a2 + move.l pd_CurrPlanesPtr(a6),a1 + lea (STENCIL_HEIGHT-1)*(KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES+4*(KALEIDO_BUF_WIDTH/8)(a1),a1 + move.l a1,d0 + swap d0 + move.w #bplpt+4*4,(a2)+ + move.w d0,(a2)+ + move.w #bplpt+4*4+2,(a2)+ + move.w a1,(a2)+ + rts + +kds_setting5_coplist: +kds_setting6_coplist: + move.l pd_CurrCopListPtr(a6),a2 + + move.l a2,a0 + adda.w pd_CopperMirror1P5PtrOffset(a6),a0 + move.l pd_CurrP5Xor6PlanePtr(a6),a1 + lea (STENCIL_HEIGHT-1)*(KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES(a1),a1 + move.l a1,d0 + swap d0 + move.w #bplpt+4*4,(a0)+ + move.w d0,(a0)+ + move.w #bplpt+4*4+2,(a0)+ + move.w a1,(a0)+ + + move.l a2,a0 + adda.w pd_CopperMirror2P56PtrOffset(a6),a0 + move.w #bplpt+4*4,(a0)+ + move.w pd_CurrP5BonusPlanePtr(a6),(a0)+ + move.w #bplpt+4*4+2,(a0)+ + move.w pd_CurrP5BonusPlanePtr+2(a6),(a0)+ + move.w #bplpt+5*4,(a0)+ + move.w pd_CurrP6Xor5PlanePtr(a6),(a0)+ + move.w #bplpt+5*4+2,(a0)+ + move.w pd_CurrP6Xor5PlanePtr+2(a6),(a0)+ + + adda.w pd_CopperMirror3P5PtrOffset(a6),a2 + move.l pd_CurrP5BottomPlanePtr(a6),a1 + lea (STENCIL_HEIGHT-1)*(KALEIDO_BUF_WIDTH/8)*KALEIDO_PLANES(a1),a1 + move.l a1,d0 + swap d0 + move.w #bplpt+4*4,(a2)+ + move.w d0,(a2)+ + move.w #bplpt+4*4+2,(a2)+ + move.w a1,(a2)+ + rts + +kds_setting1_draw: + bsr kds_draw_stencils_col0000 + bra kds_draw_stencils_copy_edges + +kds_setting2_draw: + bsr kds_draw_stencils_col1010 + bra kds_draw_stencils_copy_edges + +kds_setting3_draw: + bsr kds_draw_stencils_col1010 + bsr kds_draw_stencils_copy_edges + bra kds_draw_p5_flip13 + +kds_setting4_draw: + bsr kds_draw_stencils_col1010 + bsr kds_draw_stencils_copy_edges + bsr kds_draw_p5_flip13 + bra kds_draw_p6_flip24 + +kds_setting5_draw: + pea kds_draw_bonus_stuff_for_col2(pc) + pea kds_draw_p6_flip24(pc) + pea kds_draw_p5_flip4_to_bottom(pc) + pea kds_draw_p5_flip4_to_bonus(pc) + pea kds_draw_p5_flip134(pc) + pea kds_draw_stencils_copy_edges(pc) + + bra kds_draw_stencils_col1010 + +kds_setting6_draw: + pea kds_draw_bonus_stuff_for_col5(pc) + pea kds_draw_bonus_stuff_for_col2(pc) + pea kds_draw_p6_flip24(pc) + pea kds_draw_p5_flip5_to_bottom(pc) + pea kds_draw_p5_flip4_to_bonus(pc) + pea kds_draw_p5_flip134(pc) + pea kds_draw_stencils_copy_edges(pc) + + bra kds_draw_stencils_col1010 + +kds_setting_nop: + rts + +;-------------------------------------------------------------------- + + include "blitterline_sync.asm" + +;******************************************************************** + +LCOLDEF MACRO + IF \1==0 + dc.w (\2)*LCOLBUF_HEIGHT*2 + dc.w (\3)*LCOLBUF_HEIGHT*2 + dc.w (\4)*LCOLBUF_HEIGHT*2 + dc.w (\5)*LCOLBUF_HEIGHT*2 + dc.w (\6)*LCOLBUF_HEIGHT*2 + dc.w (\7)*LCOLBUF_HEIGHT*2 + dc.w (\8)*LCOLBUF_HEIGHT*2 + dc.w (\2)*LCOLBUF_HEIGHT*2 + dc.w (\3)*LCOLBUF_HEIGHT*2 + dc.w (\4)*LCOLBUF_HEIGHT*2 + ENDC + IF \1==1 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\2)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\3)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\4)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\5)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\6)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\7)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\8)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\2)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\3)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\4)*LCOLBUF_HEIGHT*2 + ENDC + IF \1==2 + dc.w 2+(\2)*LCOLBUF_HEIGHT*2 + dc.w 2+(\3)*LCOLBUF_HEIGHT*2 + dc.w 2+(\4)*LCOLBUF_HEIGHT*2 + dc.w 2+(\5)*LCOLBUF_HEIGHT*2 + dc.w 2+(\6)*LCOLBUF_HEIGHT*2 + dc.w 2+(\7)*LCOLBUF_HEIGHT*2 + dc.w 2+(\8)*LCOLBUF_HEIGHT*2 + dc.w 2+(\2)*LCOLBUF_HEIGHT*2 + dc.w 2+(\3)*LCOLBUF_HEIGHT*2 + dc.w 2+(\4)*LCOLBUF_HEIGHT*2 + ENDC + ENDM + +LCOLDEX MACRO + IF \1==0 + dc.w (\2)*LCOLBUF_HEIGHT*2 + dc.w (\3)*LCOLBUF_HEIGHT*2 + dc.w (\4)*LCOLBUF_HEIGHT*2 + dc.w (\5)*LCOLBUF_HEIGHT*2 + dc.w (\6)*LCOLBUF_HEIGHT*2 + dc.w (\7)*LCOLBUF_HEIGHT*2 + dc.w (\8)*LCOLBUF_HEIGHT*2 + dc.w (\9)*LCOLBUF_HEIGHT*2 + dc.w (\a)*LCOLBUF_HEIGHT*2 + dc.w (\b)*LCOLBUF_HEIGHT*2 + ENDC + IF \1==1 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\2)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\3)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\4)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\5)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\6)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\7)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\8)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\9)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\a)*LCOLBUF_HEIGHT*2 + dc.w \1*((STENCIL_HEIGHT-1)*2-2)+(\b)*LCOLBUF_HEIGHT*2 + ENDC + IF \1==2 + dc.w 2+(\2)*LCOLBUF_HEIGHT*2 + dc.w 2+(\3)*LCOLBUF_HEIGHT*2 + dc.w 2+(\4)*LCOLBUF_HEIGHT*2 + dc.w 2+(\5)*LCOLBUF_HEIGHT*2 + dc.w 2+(\6)*LCOLBUF_HEIGHT*2 + dc.w 2+(\7)*LCOLBUF_HEIGHT*2 + dc.w 2+(\8)*LCOLBUF_HEIGHT*2 + dc.w 2+(\9)*LCOLBUF_HEIGHT*2 + dc.w 2+(\a)*LCOLBUF_HEIGHT*2 + dc.w 2+(\b)*LCOLBUF_HEIGHT*2 + ENDC + + ENDM + +kds_setting_1: + dc.l kds_setting1_coplist + dc.l kds_setting1_draw + dc.l kds_calc_stencil_fixup_lines_bonus + dc.l kds_setting_nop,kds_setting_nop,kds_setting_nop + dc.l kds_calc_stencil_positions1_std,kds_calc_stencil_positions2_std + LCOLDEF 0,0,4,8,12,16,20,24 + LCOLDEF 1,0,4,8,12,16,20,24 + LCOLDEF 2,0,4,8,12,16,20,24 + LCOLDEF 1,0,4,8,12,16,20,24 + +kds_setting_2: + dc.l kds_setting2_coplist + dc.l kds_setting2_draw + dc.l kds_calc_stencil_fixup_lines_bonus + dc.l kds_setting_nop,kds_swap_rgb_to_bgr,kds_setting_nop + dc.l kds_calc_stencil_positions1_std,kds_calc_stencil_positions2_std + LCOLDEF 0,0,4,8,12,16,20,24 + LCOLDEF 1,0,4,8,12,16,20,24 + LCOLDEF 2,0,4,8,12,16,20,24 + LCOLDEF 1,0,4,8,12,16,20,24 + +kds_setting_3: + dc.l kds_setting3_coplist + dc.l kds_setting3_draw + dc.l kds_calc_stencil_fixup_lines_bonus + dc.l kds_setting_nop,kds_swap_rgb_to_bgr_and_gbr,kds_setting_nop + dc.l kds_calc_stencil_positions1_std,kds_calc_stencil_positions2_std + LCOLDEF 0,0,4,8,12,16,20,24 + LCOLDEF 1,0,4,8,13,17,21,25 + LCOLDEF 2,0,4,8,13,17,21,25 + LCOLDEF 1,0,4,8,12,16,20,24 + +kds_setting_4: + dc.l kds_setting4_coplist + dc.l kds_setting4_draw + dc.l kds_calc_stencil_fixup_lines_bonus + dc.l kds_swap_rgb_to_rbg,kds_swap_rgb_to_bgr_and_gbr,kds_setting_nop + dc.l kds_calc_stencil_positions1_std,kds_calc_stencil_positions2_std + LCOLDEF 0,0,4,8,12,16,20,24 + LCOLDEF 1,0,4,8,13,17,21,25 + LCOLDEF 2,1,5,9,13,17,21,25 + LCOLDEF 1,1,5,9,12,16,20,24 + +kds_setting_5: + dc.l kds_setting5_coplist + dc.l kds_setting5_draw + dc.l kds_calc_stencil_fixup_lines_bonus + dc.l kds_swap_rgb_to_rbg_and_grb,kds_swap_rgb_to_bgr_and_gbr,kds_setting_nop + dc.l kds_calc_stencil_positions1_std,kds_calc_stencil_positions2_std + LCOLDEX 0,0,4,8,12,16,20,24,2,6,10 + LCOLDEX 1,0,4,8,13,17,21,25,2,6,10 + LCOLDEX 2,1,5,9,13,17,21,25,1,5,9 + LCOLDEX 1,1,5,9,12,16,20,24,1,5,9 + +kds_setting_6: + dc.l kds_setting6_coplist + dc.l kds_setting6_draw + dc.l kds_calc_stencil_fixup_lines_bonus + dc.l kds_swap_rgb_to_rbg_and_grb_and_brg,kds_swap_rgb_to_bgr_and_gbr,kds_setting_nop + dc.l kds_calc_stencil_positions1_std,kds_calc_stencil_positions2_std + LCOLDEX 0,0,4,8,12,16,20,24,2,6,10 + LCOLDEX 1,0,4,8,13,17,21,25,2,6,10 + LCOLDEX 2,3,7,11,13,17,21,25,1,5,9 + LCOLDEX 1,3,7,11,12,16,20,24,1,5,9 + +;******************************************************************** + +kds_intro_palette: + dc.w $346,$458,$89b,$89b,$bbe,$bbe,$9ac,$9ac + +kds_bright_transition_palette: + dc.w $68c,$68c,$9f4,$9f4,$fff,$fff,$ffc,$ffc + +kds_fairy_sprite_palette: + incbin "../data/kaleidoscope/fairy1_48x51x16.PAL" + + ; Points +kds_fairy_points: + dc.w 129,239,183,208,225,103,203,117,181,131,317,140,308,161,299,182 + dc.w 283,141,280,169,277,197,257,189,294,205,331,221,361,137,445,172 + dc.w 529,207,635,136,577,184 + + ; 16 X and 16 Y coords +kds_dust_pos: + dc.w 31,22,18,20,21,22,23,25,25,23,22,30,30,29,26,26 + dc.w 6,8,7,12,15,18,22,24,29,33,38,35,39,44,51,54 + +kds_dust_twinkle: + dc.b 6*2,6*2,5*2,6*2,6*2,6*2,6*2,5*2,6*2,6*2,5*2 ;,4*2,6*2,6*2,5*2,4*2 + dc.b 6*2,5*2,5*2,6*2,5*2,5*2,4*2,5*2,5*2,6*2,5*2 ;,4*2,4*2,5*2,5*2,5*2 + dc.b 5*2,4*2,4*2,5*2,5*2,4*2,3*2,5*2,4*2,3*2,5*2 ;,4*2,3*2,4*2,3*2,3*2 + dc.b 5*2,4*2,3*2,4*2,4*2,3*2,4*2,3*2,2*2,5*2,4*2 ;,3*2,3*2,4*2,4*2,3*2 + dc.b 2*2,4*2,3*2,3*2,2*2,4*2,4*2,3*2,4*2,3*2,2*2 ;,4*2,3*2,2*2,1*2,1*2 + dc.b 1*2,3*2,2*2,2*2,1*2,3*2,2*2,1*2,2*2,3*2,2*2 ;,1*2,2*2,3*2,2*2,1*2 + +kds_dust_burst: + dc.b 7*2,7*2,7*2,7*2,7*2,7*2,6*2,7*2 + dc.b 6*2,6*2,7*2,6*2,6*2,6*2,5*2,6*2 + dc.b 5*2,5*2,6*2,5*2,5*2,5*2,4*2,5*2 + dc.b 4*2,4*2,5*2,4*2,4*2,4*2,3*2,4*2 + dc.b 3*2,3*2,4*2,3*2,3*2,3*2,2*2,3*2 + dc.b 2*2,2*2,3*2,2*2,2*2,2*2,1*2,2*2 + dc.b 1*2,1*2,2*2,1*2,1*2,1*2,1*2,1*2 + dc.b 1*2,1*2,2*2,1*2,1*2,1*2,1*2,1*2 + dc.b 1*2,1*2,2*2,1*2,1*2,1*2,1*2,1*2 + +kds_bernstein0: + ; Bernstein 0 + dc.w $ffff,$fa0c,$f430,$ee6b,$e8be,$e328,$dda9,$d841,$d2f0,$cdb5,$c891,$c382,$be8a,$b9a7,$b4da,$b023 + dc.w $ab80,$a6f2,$a27a,$9e16,$99c6,$958b,$9163,$8d50,$8950,$8564,$818b,$7dc5,$7a12,$7672,$72e4,$6f69 + dc.w $6c00,$68a9,$6564,$6230,$5f0e,$5bfd,$58fd,$560e,$5330,$5062,$4da5,$4af7,$485a,$45cc,$434e,$40e0 + dc.w $3e80,$3c2f,$39ee,$37bb,$3596,$3380,$3177,$2f7d,$2d90,$2bb1,$29df,$281a,$2662,$24b7,$2318,$2186 + dc.w $2000,$1e86,$1d18,$1bb5,$1a5e,$1912,$17d1,$169b,$1570,$144f,$1339,$122c,$112a,$1031,$0f42,$0e5d + dc.w $0d80,$0cac,$0be2,$0b20,$0a66,$09b5,$090b,$086a,$07d0,$073e,$06b3,$062f,$05b2,$053c,$04cc,$0463 + dc.w $0400,$03a3,$034c,$02fa,$02ae,$0267,$0225,$01e8,$01b0,$017c,$014d,$0121,$00fa,$00d6,$00b6,$009a + dc.w $0080,$0069,$0056,$0045,$0036,$002a,$001f,$0017,$0010,$000b,$0007,$0004,$0002,$0001,$0000,$0000 + +kds_bernstein1: + ; Bernstein 1 + dc.w $0000,$05e8,$0ba1,$112b,$1686,$1bb4,$20b4,$2588,$2a30,$2eac,$32fe,$3725,$3b22,$3ef6,$42a1,$4624 + dc.w $4980,$4cb5,$4fc3,$52ab,$556e,$580c,$5a86,$5cdd,$5f10,$6121,$6310,$64dd,$668a,$6816,$6983,$6ad1 + dc.w $6c00,$6d11,$6e05,$6edc,$6f96,$7035,$70b8,$7121,$7170,$71a5,$71c2,$71c6,$71b2,$7187,$7145,$70ed + dc.w $7080,$6ffe,$6f67,$6ebc,$6dfe,$6d2d,$6c4a,$6b56,$6a50,$693a,$6814,$66de,$659a,$6447,$62e7,$617a + dc.w $6000,$5e7a,$5ce9,$5b4d,$59a6,$57f6,$563c,$547a,$52b0,$50de,$4f06,$4d27,$4b42,$4958,$4769,$4576 + dc.w $4380,$4187,$3f8b,$3d8d,$3b8e,$398e,$378e,$358f,$3390,$3193,$2f98,$2d9f,$2baa,$29b8,$27cb,$25e3 + dc.w $2400,$2223,$204d,$1e7e,$1cb6,$1af7,$1940,$1793,$15f0,$1457,$12ca,$1148,$0fd2,$0e69,$0d0d,$0bbf + dc.w $0a80,$0950,$082f,$071e,$061e,$052f,$0452,$0388,$02d0,$022c,$019c,$0120,$00ba,$0069,$002f,$000c + +kds_bernstein2: + ; Bernstein 2 + dc.w $0000,$000c,$002f,$0069,$00ba,$0120,$019c,$022c,$02d0,$0388,$0452,$052f,$061e,$071e,$082f,$0950 + dc.w $0a80,$0bbf,$0d0d,$0e69,$0fd2,$1148,$12ca,$1457,$15f0,$1793,$1940,$1af7,$1cb6,$1e7e,$204d,$2223 + dc.w $2400,$25e3,$27cb,$29b8,$2baa,$2d9f,$2f98,$3193,$3390,$358f,$378e,$398e,$3b8e,$3d8d,$3f8b,$4187 + dc.w $4380,$4576,$4769,$4958,$4b42,$4d27,$4f06,$50de,$52b0,$547a,$563c,$57f6,$59a6,$5b4d,$5ce9,$5e7a + dc.w $6000,$617a,$62e7,$6447,$659a,$66de,$6814,$693a,$6a50,$6b56,$6c4a,$6d2d,$6dfe,$6ebc,$6f67,$6ffe + dc.w $7080,$70ed,$7145,$7187,$71b2,$71c6,$71c2,$71a5,$7170,$7121,$70b8,$7035,$6f96,$6edc,$6e05,$6d11 + dc.w $6c00,$6ad1,$6983,$6816,$668a,$64dd,$6310,$6121,$5f10,$5cdd,$5a86,$580c,$556e,$52ab,$4fc3,$4cb5 + dc.w $4980,$4624,$42a1,$3ef6,$3b22,$3725,$32fe,$2eac,$2a30,$2588,$20b4,$1bb4,$1686,$112b,$0ba1,$05e8 + +kds_bernstein3: + ; Bernstein 3 + dc.w $0000,$0000,$0000,$0001,$0002,$0004,$0007,$000b,$0010,$0017,$001f,$002a,$0036,$0045,$0056,$0069 + dc.w $0080,$009a,$00b6,$00d6,$00fa,$0121,$014d,$017c,$01b0,$01e8,$0225,$0267,$02ae,$02fa,$034c,$03a3 + dc.w $0400,$0463,$04cc,$053c,$05b2,$062f,$06b3,$073e,$07d0,$086a,$090b,$09b5,$0a66,$0b20,$0be2,$0cac + dc.w $0d80,$0e5d,$0f42,$1031,$112a,$122c,$1339,$144f,$1570,$169b,$17d1,$1912,$1a5e,$1bb5,$1d18,$1e86 + dc.w $2000,$2186,$2318,$24b7,$2662,$281a,$29df,$2bb1,$2d90,$2f7d,$3177,$3380,$3596,$37bb,$39ee,$3c2f + dc.w $3e80,$40e0,$434e,$45cc,$485a,$4af7,$4da5,$5062,$5330,$560e,$58fd,$5bfd,$5f0e,$6230,$6564,$68a9 + dc.w $6c00,$6f69,$72e4,$7672,$7a12,$7dc5,$818b,$8564,$8950,$8d50,$9163,$958b,$99c6,$9e16,$a27a,$a6f2 + dc.w $ab80,$b023,$b4da,$b9a7,$be8a,$c382,$c891,$cdb5,$d2f0,$d841,$dda9,$e328,$e8be,$ee6b,$f430,$fa0c + +;-------------------------------------------------------------------- + + section "kds_copper",data,chip + +kds_copperlist: + COP_MOVE dmacon,DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + COP_MOVE diwstrt,$5281 ; window start + COP_MOVE diwstop,$06c1 ; window stop + COP_MOVE ddfstrt,$0038 ; bitplane start + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon3,$0c00 + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + + COP_MOVE bplcon0,$0200 + COP_MOVE bplcon1,$0000 + COP_MOVE bplcon2,$0024 ; turn off all bitplanes, set scroll values to 0, sprites in front + +kds_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +kds_fairy_body1: + incbin "../data/kaleidoscope/fairy1_48x51x16.BPL" +kds_fairy_body2: + incbin "../data/kaleidoscope/fairy2_48x51x16.BPL" +kds_fairy_body3: + incbin "../data/kaleidoscope/fairy3_48x51x16.BPL" +kds_puff_sprite1: + incbin "../data/kaleidoscope/puff1_32x15x16.BPL" +kds_puff_sprite2: + incbin "../data/kaleidoscope/puff2_32x15x16.BPL" +kds_puff_sprite3: + incbin "../data/kaleidoscope/puff3_32x15x16.BPL" +kds_puff_sprite4: + incbin "../data/kaleidoscope/puff4_32x15x16.BPL" + +kds_kaleidoscope_pattern: + incbin "../data/kaleidoscope/plt_neuro2_ham.raw" + +blitter_temp_output_word: + dc.w 0 + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + section "part_music_samples",data,chip ; section for music playback +part_music_smp: + incbin "../data/music/desire_demo_68k_v6.lsbank" + + section "part_music_data",data ; section for music playback +part_music_data: + incbin "../data/music/desire_demo_68k_v6.lsmusic" + ENDC + ENDC + + END \ No newline at end of file diff --git a/source/kaleidoscope/record.bat b/source/kaleidoscope/record.bat new file mode 100644 index 0000000..56a0e00 --- /dev/null +++ b/source/kaleidoscope/record.bat @@ -0,0 +1,30 @@ +del kaleidoscope.exe +del "..\winuae\hd0\kaleidoscope.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "kaleidoscope.exe" "kaleidoscope.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy kaleidoscope.exe "..\winuae\hd0" +copy kaleidoscope.exe "..\winuae\hd0\a.exe" + +@echo /|set /p =kaleidoscope.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_rec.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/stham/aga.bat b/source/stham/aga.bat new file mode 100644 index 0000000..e280b88 --- /dev/null +++ b/source/stham/aga.bat @@ -0,0 +1,30 @@ +del stham.exe +del "..\winuae\hd0\stham.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "stham.exe" "stham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy stham.exe "..\winuae\hd0" +copy stham.exe "..\winuae\hd0\a" + +@echo /|set /p =stham.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/stham/assemble.bat b/source/stham/assemble.bat new file mode 100644 index 0000000..92ed515 --- /dev/null +++ b/source/stham/assemble.bat @@ -0,0 +1,37 @@ +del stham.exe +del "..\winuae\hd0\stham.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +pushd .. + +tools\KingCon.exe @data/stham/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +vc -O2 -notmpfile -nostdlib -o "stham.exe" "stham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy stham.exe "..\winuae\hd0" +copy stham.exe "..\winuae\hd0\a" + +@echo /|set /p =stham.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/stham/compile.bat b/source/stham/compile.bat new file mode 100644 index 0000000..72b43ae --- /dev/null +++ b/source/stham/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "stham.exe" "stham.asm" diff --git a/source/stham/debug.bat b/source/stham/debug.bat new file mode 100644 index 0000000..2d9eadf --- /dev/null +++ b/source/stham/debug.bat @@ -0,0 +1,21 @@ +del stham.exe +del "..\winuae\hd0\stham.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "stham.exe" "stham.asm" + +copy stham.exe "..\winuae\hd0" +copy stham.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =stham.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/stham/record.bat b/source/stham/record.bat new file mode 100644 index 0000000..a8e93f8 --- /dev/null +++ b/source/stham/record.bat @@ -0,0 +1,30 @@ +del stham.exe +del "..\winuae\hd0\stham.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "stham.exe" "stham.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy stham.exe "..\winuae\hd0" +copy stham.exe "..\winuae\hd0\a.exe" + +@echo /|set /p =stham.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_rec.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/stham/stham.asm b/source/stham/stham.asm new file mode 100644 index 0000000..2f579f7 --- /dev/null +++ b/source/stham/stham.asm @@ -0,0 +1,1727 @@ +; TODOs: +; - Table effect for returning scroller... +; +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 0 +FW_MUSIC_PLAYER_CHOICE = 0 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker (CPU DMA wait), 5 = Pretracker Turbo (Copper wait) +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 0 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 308 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 0 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 0 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 0 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 1 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 0 + + ENDC + +STHAM_WIDTH = 320 +STHAM_HEIGHT = 180 +STHAM_PLANES = 6 + +BENTFONT_WIDTH = 32 +BENTFONT_HEIGHT = 32 + +BENTSCROLLER_WIDTH = 128 +BENTSCROLLER_HEIGHT = 180+2 + +BENTSPRITE_WIDTH = 128 +BENTSPRITE_HEIGHT = 180 + +NUM_BARS = 10 +BAR_HEIGHT = 18 + +CURTAIN_WIDTH = 21 ; in words + +COP_PREAMBLE_INST = 200 ; bplptrs +COP_POST_INST = 16 ; wait +COP_INST_PER_LINE = 1+8+8+1 ; wait, 8 sprxctl, 8 sprxpos, 1 color +COP_CURTAIN_INST_PER_LINE = 8+1+CURTAIN_WIDTH ; 8 init pos, wait, 21 sprite pos +COP_LIST_SIZE = (COP_PREAMBLE_INST+COP_CURTAIN_INST_PER_LINE*STHAM_HEIGHT+COP_POST_INST)*4 + +SPRITES_BUFFER_SIZE = (BENTSPRITE_WIDTH/16)*((BENTSPRITE_HEIGHT+2)*2*2) + +CHIPMEM_SIZE = COP_LIST_SIZE*2+(BENTSCROLLER_WIDTH/8)*BENTSCROLLER_HEIGHT*3+SPRITES_BUFFER_SIZE*2+(CURTAIN_WIDTH*(CURTAIN_WIDTH+2)*16+2)*4 +FASTMEM_SIZE = 4 + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + + include "../framework/framework.i" + + +; Memory use: +; Playfields: +; - 320 x 180 x 24 = 172800 (6x2 db, 2 draw, 2 fill, 6 original, 2 spare) +; +; Scroller mapping: +; - Scroller texture (W*H): 16 Bit offsets +; - Table mapping texture: tx/ty, screen x/y, mask (pixel width) +; +; move.w (a0)+,d0 +; move.w (a0)+,d1 +; move.w (a1,d0.w),d0 +; and.w (a0)+,d0 +; or.w d0,(a2,d1.w) +; + + STRUCTURE BarData,0 + WORD bd_Delay + LONG bd_YPos + WORD bd_YSpeed + LABEL bd_SIZEOF + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrPlanesPtr + APTR pd_LastPlanesPtr + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + APTR pd_CurrScrollerPtr + APTR pd_LastScrollerPtr + APTR pd_CurrBentSpritesPtr + UBYTE pd_DbToggle + ALIGNWORD + + UWORD pd_PartCountDown + + UWORD pd_CopperChunkyOffset + + APTR pd_CopperList1 + APTR pd_CopperList2 + + UWORD pd_LetterOffset + UWORD pd_LetterCountDown + APTR pd_ScrollTextPtr + UWORD pd_LetterOrOffset + UWORD pd_LetterOrCountDown + + UWORD pd_CurtainOffset1 + UWORD pd_CurtainOffset2 + LONG pd_CurtainPos + + APTR pd_CurtainDataPtr + + APTR pd_HamphreyBuffer + APTR pd_BentScrollerBuffer1 + APTR pd_BentScrollerBuffer2 + APTR pd_BentScrollerTemp + STRUCT pd_DummyBarTop,bd_SIZEOF + STRUCT pd_Bars,NUM_BARS*bd_SIZEOF + STRUCT pd_DummyBarBottom,bd_SIZEOF + STRUCT pd_BentSprites1Ptrs,8*4 + STRUCT pd_BentSprites2Ptrs,8*4 + STRUCT pd_PreparationTask,ft_SIZEOF + + STRUCT pd_BQBuffer,1000 + + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + bsr.s sth_init + + lea sth_copperlist,a0 + CALLFW SetCopper + + lea sth_hamphrey_palette+2(pc),a1 + moveq.l #15-1,d7 + lea color+2(a5),a0 +.blloop + move.w (a1)+,(a0)+ + dbra d7,.blloop + + lea .preptask(pc),a0 + lea pd_PreparationTask(a6),a1 + CALLFW AddTask + + bsr sth_intro + bsr sth_main + bsr sth_curtain + + CALLFW SetBaseCopper + + rts + +.preptask + IFD FW_DEMO_PART + move.l fw_GlobalUserData(a6),a0 + move.l pd_HamphreyBuffer(a6),a1 + PUTMSG 10,<"%d: Decrunching from %p to %p">,fw_FrameCounterLong(a6),a0,a1 + CALLFW DecompressZX0 + PUTMSG 10,<"%d: Image decrunched until %p">,fw_FrameCounterLong(a6),a1 + clr.l fw_GlobalUserData(a6) + ENDC + bsr sth_create_curtain + rts + +;-------------------------------------------------------------------- + +sth_init: + bsr sth_init_vars + bsr sth_clear_sprites + bsr sth_clear_bent_buffer + + rts + +;-------------------------------------------------------------------- + +sth_init_vars: + move.l #sth_scrolltext,pd_ScrollTextPtr(a6) + move.w #-1,pd_LetterOrCountDown(a6) + + IFND FW_DEMO_PART + move.l #sth_hamphrey_pic,pd_HamphreyBuffer(a6) + ELSE + move.l #(STHAM_WIDTH/8)*STHAM_HEIGHT*STHAM_PLANES*2,d0 + CALLFW AllocChip + move.l a0,pd_HamphreyBuffer(a6) + ENDC + move.l #(COP_LIST_SIZE*2),d0 + CALLFW AllocChip + PUTMSG 10,<"Copperlist 1 %p">,a0 + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + lea COP_LIST_SIZE(a0),a0 + PUTMSG 10,<"Copperlist 2 %p">,a0 + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + move.l #(BENTSCROLLER_WIDTH/8)*BENTSCROLLER_HEIGHT*3,d0 + CALLFW AllocChip + PUTMSG 10,<"BentScrollerBuffer 1 %p">,a0 + move.l a0,pd_BentScrollerBuffer1(a6) + move.l a0,pd_CurrScrollerPtr(a6) + lea (BENTSCROLLER_WIDTH/8)*BENTSCROLLER_HEIGHT(a0),a0 + PUTMSG 10,<"BentScrollerBuffer 2 %p">,a0 + move.l a0,pd_BentScrollerBuffer2(a6) + move.l a0,pd_LastScrollerPtr(a6) + lea (BENTSCROLLER_WIDTH/8)*BENTSCROLLER_HEIGHT(a0),a0 + PUTMSG 10,<"BentScrollerTemp %p">,a0 + move.l a0,pd_BentScrollerTemp(a6) + + move.l #SPRITES_BUFFER_SIZE*2,d0 + CALLFW AllocChip + PUTMSG 10,<"BentSprites1Ptrs 1 %p">,a0 + lea pd_BentSprites1Ptrs(a6),a1 + move.l a1,pd_CurrBentSpritesPtr(a6) + + REPT (BENTSPRITE_WIDTH/16) + move.l a0,(a1)+ + lea ((BENTSPRITE_HEIGHT+2)*2*2)(a0),a0 + ENDR + PUTMSG 10,<"BentSprites1Ptrs 2 %p">,a0 + REPT (BENTSPRITE_WIDTH/16) + move.l a0,(a1)+ + lea ((BENTSPRITE_HEIGHT+2)*2*2)(a0),a0 + ENDR + + ; curtain (<31KB) + move.l #(CURTAIN_WIDTH*(CURTAIN_WIDTH+2)*16+2)*4,d0 + CALLFW AllocChip + move.l a0,pd_CurtainDataPtr(a6) + + lea pd_DummyBarTop(a6),a1 + move.w #-(NUM_BARS+1)*BAR_HEIGHT-256,d0 + move.w d0,bd_YPos(a1) + move.w #(NUM_BARS-1)*10,d1 + moveq.l #10,d2 + moveq.l #NUM_BARS-1,d7 +.barloop + addq.l #bd_SIZEOF,a1 + add.w #BAR_HEIGHT,d0 + move.w d1,bd_Delay(a1) + move.w d0,bd_YPos(a1) + move.w #100,bd_YSpeed(a1) + sub.w d2,d1 + addq.w #5,d2 + dbra d7,.barloop + move.w #STHAM_HEIGHT,bd_YPos+bd_SIZEOF(a1) + rts + +;-------------------------------------------------------------------- + +sth_intro: + IFD FW_DEMO_PART + PUTMSG 10,<"%d: Intro part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + ELSE + PUTMSG 10,<"%d: Intro part started">,fw_FrameCounterLong(a6) + move.w #400,pd_PartCountDown(a6) + ENDC + +.loop CALLFW VSyncWithTask + bsr sth_flip_db_frame + + bsr sth_drop_bars + bsr sth_create_intro_copperlist + + bsr sth_update_copper_list_pointers + + IFD FW_DEMO_PART + cmp.w #3072,fw_MusicFrameCount(a6) + blt.s .loop + ELSE + subq.w #1,pd_PartCountDown(a6) + bne .loop + ENDC + + rts + +;-------------------------------------------------------------------- + +sth_main: + IFD FW_DEMO_PART + PUTMSG 10,<"%d: Main part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + ELSE + PUTMSG 10,<"%d: Main part started">,fw_FrameCounterLong(a6) + ENDC + move.w #800,pd_PartCountDown(a6) + CALLFW SetBlitterQueueSingleFrame + + move.w #$000,color(a5) + REPT 2 + CALLFW VSyncWithTask + bsr sth_flip_db_frame + bsr sth_create_sham_copperlist + bsr sth_update_copper_list_pointers + ENDR + +.loop CALLFW VSyncWithTask + bsr sth_flip_db_frame + + lea pd_BQBuffer(a6),a4 + + move.l pd_BentScrollerTemp(a6),a0 + move.l pd_LastScrollerPtr(a6),a2 + bsr sth_scroll_buffer + + move.l pd_CurrScrollerPtr(a6),a0 + move.l pd_BentScrollerTemp(a6),a2 + bsr sth_scroll_buffer + + bsr sth_convert_scroller_to_sprites + + bsr sth_push_in_letter + + TERMINATE_BLITTER_QUEUE + + BLTHOGON + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + CALLFW JoinBlitterQueue + + bsr sth_update_copper_list_pointers + + subq.w #1,pd_PartCountDown(a6) + bne .loop + + rts + +;-------------------------------------------------------------------- + +sth_curtain: + IFD FW_DEMO_PART + PUTMSG 10,<"%d: Curtain part started (%d music frames)">,fw_FrameCounterLong(a6),fw_MusicFrameCount-2(a6) + ELSE + PUTMSG 10,<"%d: Curtain part started">,fw_FrameCounterLong(a6) + ENDC + move.w #186,pd_PartCountDown(a6) + CALLFW SetBlitterQueueSingleFrame + + move.l #482*CURTAIN_WIDTH*4,pd_CurtainPos(a6) + + REPT 1 + CALLFW VSyncWithTask + bsr sth_flip_db_frame + bsr sth_create_simple_copperlist + bsr sth_update_copper_list_pointers + ENDR + + REPT 2 + CALLFW VSyncWithTask + bsr sth_flip_db_frame + bsr sth_create_curtain_copperlist + move.l a0,pd_CurrCopListPtr(a6) + bsr sth_create_simple_copperlist + bsr sth_update_copper_list_pointers + ENDR + + move.w #$000,color(a5) + move.w #$000,color+17*2(a5) + move.w #$311,color+21*2(a5) + move.w #$621,color+22*2(a5) + move.w #$a64,color+23*2(a5) + move.w #$da7,color+25*2(a5) + move.w #$cca,color+26*2(a5) + move.w #$bed,color+27*2(a5) + move.w #$3df,color+29*2(a5) + move.w #$6ef,color+30*2(a5) + move.w #$aff,color+31*2(a5) + +.loop CALLFW VSyncWithTask + bsr sth_flip_db_frame + + bsr sth_draw_curtain + + bsr sth_update_copper_list_pointers + + subq.w #1,pd_PartCountDown(a6) + bne .loop + + rts + +;-------------------------------------------------------------------- + +sth_flip_db_frame: + move.l pd_CurrPlanesPtr(a6),pd_LastPlanesPtr(a6) + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + move.l pd_CurrScrollerPtr(a6),pd_LastScrollerPtr(a6) + move.l pd_HamphreyBuffer(a6),a0 + not.b pd_DbToggle(a6) + beq.s .selb1 + lea (STHAM_WIDTH/8)*STHAM_PLANES(a0),a0 + move.l a0,pd_CurrPlanesPtr(a6) + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + move.l pd_BentScrollerBuffer2(a6),pd_CurrScrollerPtr(a6) + lea pd_BentSprites2Ptrs(a6),a0 + move.l a0,pd_CurrBentSpritesPtr(a6) + rts +.selb1 + move.l a0,pd_CurrPlanesPtr(a6) + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + move.l pd_BentScrollerBuffer1(a6),pd_CurrScrollerPtr(a6) + lea pd_BentSprites1Ptrs(a6),a0 + move.l a0,pd_CurrBentSpritesPtr(a6) + rts + +;-------------------------------------------------------------------- + +sth_update_copper_list_pointers: + lea sth_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +sth_clear_sprites: + lea pd_BentSprites1Ptrs(a6),a0 + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l (a0),bltdpt(a5) + move.w #((BENTSPRITE_WIDTH)>>4)|(((BENTSPRITE_HEIGHT+2)*2*2)<<6),bltsize(a5) + + move.l #(($52<<8)|0)<<16|(((($52+BENTSPRITE_HEIGHT)&$ff)<<8)|1),d0 + BLTWAIT + moveq.l #8-1,d7 +.loop move.l (a0)+,a1 + move.l d0,(a1) + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +sth_clear_bent_buffer: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_BentScrollerBuffer1(a6),bltdpt(a5) + move.w #((BENTSCROLLER_WIDTH)>>4)|((BENTSCROLLER_HEIGHT*3)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +sth_push_in_letter: + subq.w #2,pd_LetterCountDown(a6) + bpl.s .nonew + move.w pd_LetterOffset(a6),pd_LetterOrOffset(a6) + move.w #44-28,pd_LetterOrCountDown(a6) + move.w #28,pd_LetterCountDown(a6) + move.l pd_ScrollTextPtr(a6),a0 + move.b (a0)+,d0 + bne.s .nowrap + move.l pd_ScrollTextPtr(a6),a0 + move.b (a0)+,d0 +.nowrap + move.l a0,pd_ScrollTextPtr(a6) + sub.b #'A',d0 + ext.w d0 + lsl.w #2+4,d0 + move.w d0,d1 + add.w d0,d0 + add.w d1,d0 + move.w d0,pd_LetterOffset(a6) +.nonew + move.l pd_LastScrollerPtr(a6),a1 + lea (BENTSPRITE_HEIGHT)*(BENTSCROLLER_WIDTH/8)(a1),a1 + + lea sth_font_data(pc),a0 + move.w pd_LetterOffset(a6),d0 + bmi.s .clear + adda.w d0,a0 + addq.w #8,d0 + move.w d0,pd_LetterOffset(a6) + + move.l #$88888888,d6 + REPT 2 + movem.l (a0)+,d0 + + REPT 4 + move.l d0,d4 + and.l d6,d4 + move.l d4,d5 + lsr.l #1,d5 + or.l d5,d4 + move.l d4,d5 + lsr.l #2,d5 + or.l d5,d4 + move.l d4,(a1)+ + rol.l #1,d0 + ENDR + ENDR + +.second + subq.w #2,pd_LetterOrCountDown(a6) + bmi.s .skip + move.w pd_LetterOrOffset(a6),d0 + bmi.s .skip + move.l pd_LastScrollerPtr(a6),a1 + lea (BENTSPRITE_HEIGHT)*(BENTSCROLLER_WIDTH/8)(a1),a1 + + lea sth_font_data(pc),a0 + adda.w d0,a0 + addq.w #8,d0 + move.w d0,pd_LetterOrOffset(a6) + + REPT 2 + movem.l (a0)+,d0 + + REPT 4 + move.l d0,d4 + and.l d6,d4 + move.l d4,d5 + lsr.l #1,d5 + or.l d5,d4 + move.l d4,d5 + lsr.l #2,d5 + or.l d5,d4 + or.l d4,(a1)+ + rol.l #1,d0 + ENDR + ENDR + +.skip + rts +.clear + moveq.l #0,d0 + REPT 8 + move.l d0,(a1)+ + ENDR + move.l #$88888888,d6 + bra.s .second + +;-------------------------------------------------------------------- + +sth_scroll_buffer: + lea 1*(BENTSCROLLER_WIDTH/8)(a2),a2 + + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.w #4,a4 + move.l #.bq_simple_shift_up,(a4)+ + move.l #(((BENTSCROLLER_WIDTH-32)/8)<<16)|((BENTSCROLLER_WIDTH-32)/8),(a4)+ + move.l a2,(a4)+ + move.l a0,(a4)+ + move.w #(32>>4)|(30<<6),(a4)+ + + lea (90-1)*(BENTSCROLLER_WIDTH/8)+(48/8)-2(a0),a0 + lea (90-1)*(BENTSCROLLER_WIDTH/8)+(48/8)-2(a2),a2 + lea sth_scroller_shift_1_bitmap+(90-30-1)*(BENTSCROLLER_WIDTH/8)+(48/8)-2,a1 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.w #4,a4 + move.l #.bq_shift_1,(a4)+ + move.l #(((BENTSCROLLER_WIDTH-48)/8)<<16)|((BENTSCROLLER_WIDTH-48)/8),d0 + move.l d0,(a4)+ + move.l d0,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w #(48>>4)|((90-30)<<6),(a4)+ + + lea ((144-1)-(90-1))*(BENTSCROLLER_WIDTH/8)+(80/8)-(48/8)(a0),a0 + lea ((144-1)-(90-1))*(BENTSCROLLER_WIDTH/8)+(80/8)-(48/8)(a2),a2 + lea sth_scroller_shift_1_bitmap+(144-30-1)*(BENTSCROLLER_WIDTH/8)+(80/8)-2,a1 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.w #4,a4 + move.l #.bq_shift_1,(a4)+ + move.l #(((BENTSCROLLER_WIDTH-80)/8)<<16)|((BENTSCROLLER_WIDTH-80)/8),d0 + move.l d0,(a4)+ + move.l d0,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w #(80>>4)|((144-90)<<6),(a4)+ + + lea (BENTSPRITE_HEIGHT-144+2)*(BENTSCROLLER_WIDTH/8)-(80/8)(a0),a0 + lea (BENTSPRITE_HEIGHT-144+2)*(BENTSCROLLER_WIDTH/8)-(80/8)(a2),a2 + lea sth_scroller_shift_1_bitmap+(BENTSPRITE_HEIGHT-30-1+2)*(BENTSCROLLER_WIDTH/8)-2,a1 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.w #4,a4 + move.l #.bq_shift_1,(a4)+ + moveq.l #0,d0 + move.l d0,(a4)+ + move.l d0,(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l a2,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w #(BENTSCROLLER_WIDTH>>4)|((BENTSPRITE_HEIGHT-144-1+2)<<6),(a4)+ + + lea -2*(BENTSCROLLER_WIDTH/8)(a0),a0 + lea -2*(BENTSCROLLER_WIDTH/8)(a2),a2 + lea sth_scroller_shift_2_bitmap+(BENTSPRITE_HEIGHT-157-1)*(80/8)-2,a1 + + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.w #4,a4 + move.l #.bq_shift_2,(a4)+ + move.l #0|((BENTSCROLLER_WIDTH-80)/8),(a4)+ + move.l #(((BENTSCROLLER_WIDTH-80)/8)<<16)|((BENTSCROLLER_WIDTH-80)/8),(a4)+ + move.l a1,(a4)+ ; bltcpt + move.l a0,(a4)+ ; bltbpt + move.l a2,(a4)+ ; bltapt + move.l a0,(a4)+ ; bltdpt + move.w #(80>>4)|((BENTSPRITE_HEIGHT-157-1)<<6),(a4)+ + + rts + +.bq_simple_shift_up + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l (a0)+,bltamod(a5) ; and bltdmod + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_shift_1 + BLTCON_SET_X ABCD,(BLT_A&BLT_C)|(BLT_B&~BLT_C),1,0,BLTCON1F_DESC + ;BLTCON_SET_X CD,BLT_C,1,0,BLTCON1F_DESC + move.l (a0)+,bltcmod(a5) ; and bltbmod + move.l (a0)+,bltamod(a5) ; and bltdmod + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_shift_2 + BLTCON_SET_X ABCD,(BLT_A&BLT_C)|(BLT_B&~BLT_C),2,0,BLTCON1F_DESC + ;BLTCON_SET_X CD,BLT_C,2,0,BLTCON1F_DESC + move.l (a0)+,bltcmod(a5) ; and bltbmod + move.l (a0)+,bltamod(a5) ; and bltdmod + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +sth_convert_scroller_to_sprites: + PREP_ADD_TO_BLITTER_QUEUE a3 + move.w #(16>>4)|(BENTSPRITE_HEIGHT<<6),d3 + move.l #.bq_generic_ad_with_all,d4 + move.l #.bq_generic_ad,d5 + move.l pd_CurrScrollerPtr(a6),a2 + move.l pd_CurrBentSpritesPtr(a6),a0 + moveq.l #(BENTSPRITE_WIDTH/16)-1,d7 +.sprloop + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l d4,(a4)+ + move.l (a0)+,d0 + addq.l #4,d0 + move.l a2,(a4)+ + move.l d0,(a4)+ + move.w d3,(a4)+ + addq.w #2,a2 + + move.l d5,d4 + + dbra d7,.sprloop + + TERM_ADD_TO_BLITTER_QUEUE a3 + rts + +.bq_generic_ad_with_all + BLTHOGOFF + move.l #(BLTEN_AD+BLT_A)<<16,bltcon0(a5) + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(((BENTSCROLLER_WIDTH-16)/8)<<16)|2,bltamod(a5) +.bq_generic_ad + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +sth_drop_bars: + lea pd_Bars(a6),a1 + moveq.l #NUM_BARS-1,d7 +.gravloop + subq.w #1,bd_Delay(a1) + bpl.s .skip + move.l bd_YPos(a1),d0 + move.w bd_YSpeed(a1),d1 + add.w #52,d1 + move.w d1,bd_YSpeed(a1) + ext.l d1 + lsl.l #6,d1 + add.l d1,d0 + move.l d0,bd_YPos(a1) +.skip + lea bd_SIZEOF(a1),a1 + dbra d7,.gravloop + + moveq.l #NUM_BARS-1,d7 + moveq.l #BAR_HEIGHT,d2 +.collloop + lea -bd_SIZEOF(a1),a1 + tst.w bd_Delay(a1) + bpl.s .skip2 + + move.w bd_YPos(a1),d0 + move.w bd_YSpeed(a1),d3 + asr.w #1,d3 + move.w d0,d1 + sub.w d2,d1 + cmp.w bd_YPos-bd_SIZEOF(a1),d1 + bge.s .notopcoll + move.w bd_YPos-bd_SIZEOF(a1),d0 + add.w d2,d0 + move.w d0,bd_YPos(a1) + move.w d3,d1 + neg.w d1 + move.w d1,bd_YSpeed(a1) + ;asr.w #1,d1 + ;neg.w d1 + add.w d3,bd_YSpeed-bd_SIZEOF(a1) +.notopcoll + move.w d0,d1 + add.w d2,d1 + cmp.w bd_YPos+bd_SIZEOF(a1),d1 + blt.s .nobottomcoll + move.w bd_YPos+bd_SIZEOF(a1),d0 + sub.w d2,d0 + move.w d0,bd_YPos(a1) + move.w d3,d1 + neg.w d1 + move.w d1,bd_YSpeed(a1) + ;asr.w #1,d1 + ;neg.w d1 + add.w d3,bd_YSpeed+bd_SIZEOF(a1) +.nobottomcoll +.skip2 + dbra d7,.collloop + + rts + +;-------------------------------------------------------------------- + +sth_create_curtain: + move.l pd_CurtainDataPtr(a6),a0 + PUTMSG 10,<"%d: Curtain %p">,fw_FrameCounterLong(a6),a0 + + move.l #(spr+0*sd_SIZEOF+sd_pos)<<16,d4 + move.l #$1fe<<16,d3 + move.w #(CURTAIN_WIDTH+2)*16,d7 +.lineloop + moveq.l #15,d0 + and.w d7,d0 + lsr.w #1,d0 + eor.w #7,d0 + move.w #($50<<8)|(64),d4 + sub.w d0,d4 + + moveq.l #CURTAIN_WIDTH,d5 + moveq.l #1,d1 + and.w d7,d1 + lsl.w #3,d1 + move.w d7,d6 + lsr.w #4,d6 + subq.w #1,d6 + bmi.s .tilem1 + subq.w #1,d6 + bmi.s .tilem2 + subq.w #1,d6 + bmi.s .tilem3 +.blackloop + subq.w #1,d5 + move.l d4,(a0)+ + addq.w #8,d4 + dbra d6,.blackloop + +.tilem3 + subq.w #1,d5 + bmi.s .skipwhite + move.w d1,d2 + add.w #spr+2*sd_SIZEOF+sd_pos,d2 + move.w d2,(a0)+ + move.w d4,(a0)+ + addq.w #8,d4 + +.tilem2 + subq.w #1,d5 + bmi.s .skipwhite + move.w d1,d2 + add.w #spr+4*sd_SIZEOF+sd_pos,d2 + move.w d2,(a0)+ + move.w d4,(a0)+ + addq.w #8,d4 + +.tilem1 + subq.w #1,d5 + bmi.s .skipwhite + move.w d1,d2 + add.w #spr+6*sd_SIZEOF+sd_pos,d2 + move.w d2,(a0)+ + move.w d4,(a0)+ + +.skipspecial + subq.w #1,d5 + bmi.s .skipwhite +.whiteloop + move.l d3,(a0)+ + dbra d5,.whiteloop +.skipwhite + dbra d7,.lineloop + + moveq.l #CURTAIN_WIDTH-1,d7 +.emptylineloop + move.l d3,(a0)+ + dbra d7,.emptylineloop + + PUTMSG 10,<"%d: Curtain done">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- + +sth_draw_curtain: + move.l pd_CurrCopListPtr(a6),a1 + adda.w pd_CopperChunkyOffset(a6),a1 + + BLTHOGON + BLTWAIT + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) ; also fills bltalwm + moveq.l #0,d0 + move.l d0,bltamod(a5) + + lea sth_curtainsines(pc),a2 + lea sth_curtainsines+256(pc),a3 + lea sth_curtainsines+512(pc),a4 + move.w #(CURTAIN_WIDTH*2)|((1)<<6),d3 + + move.l pd_CurtainDataPtr(a6),a0 + move.w pd_CurtainOffset1(a6),d2 + addq.w #2,d2 + move.w d2,pd_CurtainOffset1(a6) + move.w pd_CurtainOffset2(a6),d5 + subq.w #3,d5 + move.w d5,pd_CurtainOffset2(a6) + move.w d5,d0 + add.w d2,d0 + add.w d2,d0 + lsr.w #2,d0 + add.w d2,d2 + add.w d5,d5 + + and.w #254,d2 + and.w #254,d5 + and.w #254,d0 + + move.l pd_CurtainPos(a6),d4 + sub.l #3*(CURTAIN_WIDTH*4),d4 + move.l d4,pd_CurtainPos(a6) + move.l #(CURTAIN_WIDTH*4)*(((CURTAIN_WIDTH+2)*16)+1),d6 + move.w #STHAM_HEIGHT-1,d7 + moveq.l #0,d1 +.lineloop + suba.w d1,a0 + addq.b #3*2,d2 + move.w (a3,d2.w),d1 + + subq.b #2*2,d0 + add.w (a3,d0.w),d1 + + subq.b #4*2,d5 + add.w (a4,d5.w),d1 + + ext.l d1 + add.l d4,d1 + bpl.s .nocutoff + moveq.l #0,d1 + bra.s .nooverfl2 +.nocutoff + cmp.l d6,d1 + blt.s .nooverfl + move.w d6,d1 +.nooverfl + adda.w d1,a0 +.nooverfl2 + BLTWAIT + movem.l a0/a1,bltapt(a5) ; bltapt = a0, bltdpt = a1 + move.w d3,bltsize(a5) + lea COP_CURTAIN_INST_PER_LINE*4(a1),a1 + dbra d7,.lineloop + rts + +;-------------------------------------------------------------------- + +sth_create_sham_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + + move.l pd_CurrBentSpritesPtr(a6),a1 + move.w #sprpt,d1 + moveq.l #(BENTSPRITE_WIDTH/16)*2-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + + move.l pd_CurrPlanesPtr(a6),d0 + moveq.l #6-1,d7 + move.w #bplpt,d1 + moveq.l #(STHAM_WIDTH)/8,d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + COPIMOVE $6a00,bplcon0 + + moveq.l #-2,d3 + move.w #$51b5,d0 + move.w #$100,d2 + + lea sth_sprite_xpos(pc),a1 + move.w #$5200,d1 + move.w #BENTSPRITE_HEIGHT-1,d7 + lea sth_scroller_gradient(pc),a2 + moveq.l #-1,d5 + moveq.l #-1,d6 +.cprloop + move.w #((($52+BENTSPRITE_HEIGHT)&$ff)<<7)|1,d4 + move.b (a1)+,d1 + cmp.b d5,d1 + beq.s .skippos + move.b d1,d5 + + move.w d0,(a0)+ + move.w d3,(a0)+ + + lsr.b #1,d1 + roxl.w d4 + add.b #$40,d1 + + REPT 8 + COPRMOVE d4,spr+sd_ctl+REPTN*sd_SIZEOF + ENDR + REPT 8 + COPRMOVE d1,spr+sd_pos+REPTN*sd_SIZEOF + addq.b #8,d1 + ENDR + bra.s .addcol + +.skippos + move.w d0,d1 + move.b #$d5,d1 + move.w d1,(a0)+ + move.w d3,(a0)+ +.addcol + cmp.w (a2),d6 + beq.s .nocol + move.w (a2),d6 + COPRMOVE d6,color+17*2 + cmp.w #BENTSPRITE_HEIGHT-1-31,d7 + bgt.s .nocol + sub.w #$011,d6 + COPRMOVE d6,color+21*2 + cmp.w #BENTSPRITE_HEIGHT-1-124,d7 + bgt.s .nocol + sub.w #$011,d6 + COPRMOVE d6,color+25*2 + cmp.w #BENTSPRITE_HEIGHT-1-160,d7 + bgt.s .nocol + sub.w #$011,d6 + COPRMOVE d6,color+29*2 +.nocol + add.w d2,d0 + addq.w #2,a2 + + dbra d7,.cprloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +sth_create_intro_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + + moveq.l #0,d5 + move.l pd_CurrPlanesPtr(a6),d0 + lea pd_Bars(a6),a1 + moveq.l #BAR_HEIGHT,d6 + moveq.l #NUM_BARS-1,d7 +.findtopbar + move.w bd_YPos(a1),d4 + PUTMSG 40,<"%d: YPos %d">,d7,d4 + add.w d6,d4 + bgt.s .foundtopbar + add.l #BAR_HEIGHT*(2*(STHAM_WIDTH)/8)*STHAM_PLANES,d0 + addq.l #bd_SIZEOF,a1 + dbra d7,.findtopbar + moveq.l #1,d5 ; no bar visible + moveq.l #0,d6 ; zero height for first bar + bra.s .noaddsplit +.foundtopbar + sub.w d6,d4 + bpl.s .noaddsplit + add.w d4,d6 + move.w d4,d2 + neg.w d2 + PUTMSG 30,<"Adding %d">,d2 + muls #(2*(STHAM_WIDTH)/8)*STHAM_PLANES,d2 + add.l d2,d0 + moveq.l #0,d4 +.noaddsplit + + PUTMSG 20,<"Top Y %d, Height %d">,d4,d6 + moveq.l #6-1,d7 + move.w #bplpt,d1 + moveq.l #(STHAM_WIDTH)/8,d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.w #$5207,d0 + move.w #$100,d2 + moveq.l #0,d7 + + tst.w d5 + bne.s .allempty + lea sth_midbar_gradient(pc),a2 + tst.w d4 + beq.s .startbar + + COPIMOVE $0000,color + COPIMOVE $0200,bplcon0 + add.w d4,d7 + + move.w bd_YPos(a1),d1 + sub.w bd_YPos-bd_SIZEOF(a1),d1 + sub.w #BAR_HEIGHT,d1 + move.w d1,d6 + move.w d4,-(sp) + sub.w d4,d1 + + move.w d6,d4 + add.w d4,d4 + moveq.l #0,d5 + subq.w #1,d1 + bmi.s .skipspecial +.firstloop + sub.w d2,d6 + bpl.s .cont2 +.again2 + addq.w #2,d5 + add.w d4,d6 + bmi.s .again2 +.cont2 + dbra d1,.firstloop +.skipspecial + move.w (sp)+,d1 + subq.w #1,d1 + beq.s .oneline + subq.w #1,d1 + bra.s .whiteloop + +.startbar + COPIMOVE $0000,color + COPIMOVE $6a00,bplcon0 + +.barloop + PUTMSG 30,<"Barloop at %d">,d7 + add.w d6,d7 + move.w d6,d1 + lsl.w #8,d1 + add.w d1,d0 + bcc.s .no255 + move.w #$ffdf,(a0)+ + move.w d3,(a0)+ +.no255 + move.w d0,(a0)+ + move.w d3,(a0)+ + + addq.l #bd_SIZEOF,a1 + move.w bd_YPos(a1),d1 + sub.w d7,d1 + beq.s .nextbar + + COPIMOVE $0200,bplcon0 + cmp.w #STHAM_HEIGHT,bd_YPos(a1) + bge.s .lastbar +.startfirstwhite + PUTMSG 40,<"White dist %d">,d1 + add.w d1,d7 + move.w d1,d6 + move.w d1,d4 + add.w d4,d4 + moveq.l #0,d5 + subq.w #1,d1 + beq.s .oneline + subq.w #1,d1 +.whiteloop + add.w d2,d0 + bcc.s .no255b + move.w #$ffdf,(a0)+ + move.w d3,(a0)+ +.no255b + move.b #$3f,d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + ;sub.w #128*2,d6 + sub.w d2,d6 + bpl.s .cont +.again + addq.w #2,d5 + add.w d4,d6 + bmi.s .again +.cont + COPRMOVE (a2,d5.w),color + move.b #$3f+(STHAM_WIDTH/2),d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + COPIMOVE $0000,color + dbra d1,.whiteloop + move.b #$07,d0 + +.oneline + add.w d2,d0 + bcc.s .no255e + move.w #$ffdf,(a0)+ + move.w d3,(a0)+ +.no255e + move.w d0,(a0)+ + move.w d3,(a0)+ + ;COPIMOVE $0000,color + +.nextbar + cmp.w #STHAM_HEIGHT,bd_YPos(a1) + bge.s .done + COPIMOVE $6a00,bplcon0 + moveq.l #BAR_HEIGHT,d6 + bra.s .barloop +.done + move.l d3,(a0)+ + rts +.lastbar + lea sth_bar_gradient(pc),a2 + move.w d1,d7 + subq.w #1,d7 + moveq.l #0,d5 + bra.s .allloop +.allempty + lea sth_bar_gradient(pc),a2 + COPIMOVE $0200,bplcon0 + move.w d4,d5 + neg.w d5 + add.w d5,d5 + move.w #STHAM_HEIGHT-1,d7 +.allloop + COPRMOVE (a2,d5.w),color + add.w d2,d0 + bcc.s .no255c + move.w #$ffdf,(a0)+ + move.w d3,(a0)+ +.no255c + move.w d0,(a0)+ + move.w d3,(a0)+ + addq.w #2,d5 + dbra d7,.allloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +sth_create_simple_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + COPIMOVE DMAF_SPRITE,dmacon ; disable sprite dma + + move.l pd_CurrPlanesPtr(a6),d0 + moveq.l #6-1,d7 + move.w #bplpt,d1 + moveq.l #(STHAM_WIDTH)/8,d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + COPIMOVE $6a00,bplcon0 + + moveq.l #-2,d3 + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +sth_create_curtain_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + + COPIMOVE DMAF_SPRITE,dmacon ; disable sprite dma + + COPIMOVE ($6<<8)|(0<<2)|(1<<1),spr+0*sd_SIZEOF+sd_ctl + COPIMOVE ($6<<8)|(0<<2)|(1<<1),spr+1*sd_SIZEOF+sd_ctl + COPIMOVE ($6<<8)|(0<<2)|(1<<1),spr+2*sd_SIZEOF+sd_ctl + COPIMOVE ($6<<8)|(0<<2)|(1<<1),spr+3*sd_SIZEOF+sd_ctl + COPIMOVE ($6<<8)|(0<<2)|(1<<1),spr+4*sd_SIZEOF+sd_ctl + COPIMOVE ($6<<8)|(0<<2)|(1<<1),spr+5*sd_SIZEOF+sd_ctl + COPIMOVE ($6<<8)|(0<<2)|(1<<1),spr+6*sd_SIZEOF+sd_ctl + COPIMOVE ($6<<8)|(0<<2)|(1<<1),spr+7*sd_SIZEOF+sd_ctl + + COPIMOVE %0000000000000000,spr+0*sd_SIZEOF+sd_dataB + COPIMOVE %0000000000000000,spr+1*sd_SIZEOF+sd_dataB + COPIMOVE %0010110111111111,spr+2*sd_SIZEOF+sd_dataB + COPIMOVE %0001011011111111,spr+3*sd_SIZEOF+sd_dataB + COPIMOVE %0010110111111111,spr+4*sd_SIZEOF+sd_dataB + COPIMOVE %0001011011111111,spr+5*sd_SIZEOF+sd_dataB + COPIMOVE %1110110100000000,spr+6*sd_SIZEOF+sd_dataB + COPIMOVE %1111011010000000,spr+7*sd_SIZEOF+sd_dataB + + COPIMOVE %1111111111111111,spr+0*sd_SIZEOF+sd_dataa + COPIMOVE %1111111111111111,spr+1*sd_SIZEOF+sd_dataa + COPIMOVE %1101001001011011,spr+2*sd_SIZEOF+sd_dataa + COPIMOVE %1110100100101101,spr+3*sd_SIZEOF+sd_dataa + COPIMOVE %1101001001011011,spr+4*sd_SIZEOF+sd_dataa + COPIMOVE %1110100100101101,spr+5*sd_SIZEOF+sd_dataa + COPIMOVE %1100100000100010,spr+6*sd_SIZEOF+sd_dataa + COPIMOVE %1110010000010001,spr+7*sd_SIZEOF+sd_dataa + + move.l pd_CurrPlanesPtr(a6),d0 + moveq.l #6-1,d7 + move.w #bplpt,d1 + moveq.l #(STHAM_WIDTH)/8,d2 +.bplloop + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + swap d0 + move.w d0,(a0)+ + addq.w #2,d1 + + add.l d2,d0 + dbra d7,.bplloop + + COPIMOVE $6a00,bplcon0 + + moveq.l #-2,d3 + move.w #$5237,d0 + move.w #$100,d2 + + move.w #$51d7,(a0)+ + move.w d3,(a0)+ + + move.l a0,d1 + sub.l a2,d1 + add.w #8*4+4,d1 + move.w d1,pd_CopperChunkyOffset(a6) + + move.w #BENTSPRITE_HEIGHT-1,d7 +.cprloop + + COPIMOVE ($50<<8)|(64-32),spr+0*sd_SIZEOF+sd_pos + COPIMOVE ($50<<8)|(64-32),spr+1*sd_SIZEOF+sd_pos + COPIMOVE ($50<<8)|(64-32),spr+2*sd_SIZEOF+sd_pos + COPIMOVE ($50<<8)|(64-32),spr+3*sd_SIZEOF+sd_pos + COPIMOVE ($50<<8)|(64-32),spr+4*sd_SIZEOF+sd_pos + COPIMOVE ($50<<8)|(64-32),spr+5*sd_SIZEOF+sd_pos + COPIMOVE ($50<<8)|(64-32),spr+6*sd_SIZEOF+sd_pos + COPIMOVE ($50<<8)|(64-32),spr+7*sd_SIZEOF+sd_pos + + move.w d0,(a0)+ + move.w d3,(a0)+ + add.w d2,d0 + + move.l #$1fe<<16,d1 + REPT CURTAIN_WIDTH + move.l d1,(a0)+ + ENDR + + dbra d7,.cprloop + + move.l d3,(a0)+ + rts + +;******************************************************************** + +sth_scrolltext: + ;dc.b "HAMPHREY B IS REALLY LOOKING HAMAZING TODAY" + dc.b "HAMAZING IT EVEN IMPRESSES HAMPHREY BOGART" + dc.b " " + dc.b 0 + even + +sth_curtainsines: + incbin "../data/stham/curtainsine.bin" + +sth_hamphrey_palette: + include "../data/stham/PLT_HAMph_path_2_test08b_ham.pal.asm" + +; https://gradient-blaster-grahambates.vercel.app/?points=cff@0,09a@171&steps=256&blendMode=oklab&ditherMode=errorDiffusion&target=amigaOcs&ditherAmount=55 +sth_scroller_gradient: + dc.w $cff,$dff,$cff,$cff,$cff,$cff,$cff,$cff + dc.w $cff,$cfe,$cff,$cff,$cfe,$cff,$bee,$cff + dc.w $cee,$bff,$bef,$cff,$aef,$bff,$aef,$bff + dc.w $aff,$bee,$aef,$bee,$bef,$aee,$aef,$bee + dc.w $aee,$aee,$aee,$aee,$aee,$aee,$aee,$ade + dc.w $aee,$aee,$aee,$aee,$ade,$9ee,$ade,$aee + dc.w $9de,$aee,$9dd,$ade,$9dd,$ade,$9dd,$aee + dc.w $9dd,$9dd,$9dd,$9de,$9dd,$9dd,$9dd,$9dd + dc.w $9dd,$9dd,$9dd,$9dd,$9cd,$9dd,$9cd,$9dd + dc.w $8dd,$8cd,$8dd,$7cd,$8dd,$8cd,$7dd,$8cd + dc.w $7cd,$8cd,$7cd,$7cd,$8cd,$7cd,$7cc,$7cd + dc.w $7cd,$7cd,$7cd,$7cc,$7cd,$7cc,$7cc,$7cd + dc.w $7cc,$7cc,$7bc,$6cc,$7bc,$7cc,$7bc,$7cc + dc.w $6bc,$7bc,$6cc,$7cc,$6bc,$7bc,$6bc,$6bb + dc.w $6bc,$6bc,$7bc,$7bc,$6bb,$6bc,$6bb,$6bc + dc.w $6bb,$6bc,$6ab,$6bb,$6bb,$5ab,$5bc,$5bb + dc.w $5ab,$5bb,$4ac,$4bb,$4ac,$4bb,$4ab,$4ab + dc.w $4ac,$4bb,$4ab,$4ab,$4ab,$4ab,$3ab,$4ab + dc.w $4ab,$4ab,$3ab,$4ab,$4ab,$3ab,$4ab,$3ab + dc.w $39a,$3ab,$3aa,$3ab,$3aa,$39b,$3aa,$39b + dc.w $39b,$3aa,$39a,$3ab,$29a,$39a,$29a,$39a + dc.w $39a,$29a,$29a,$09a,$09a,$09a,$09a,$09a + dc.w $09a,$09a,$09a,$09a,$09a + +; https://gradient-blaster-grahambates.vercel.app/?points=000@0,719@64,fff@255&steps=256&blendMode=oklab&ditherMode=shuffle&target=amigaOcs&shuffleCount=2 +sth_bar_gradient: + dc.w $000,$000,$000,$000,$000,$000,$000,$000 + dc.w $000,$000,$101,$000,$101,$001,$101,$001 + dc.w $102,$101,$102,$101,$102,$101,$203,$102 + dc.w $203,$202,$203,$202,$203,$304,$203,$304 + dc.w $204,$304,$204,$405,$304,$405,$304,$405 + dc.w $304,$405,$405,$406,$405,$516,$406,$516 + dc.w $406,$517,$506,$517,$507,$517,$507,$608 + dc.w $618,$608,$618,$608,$709,$608,$719,$709 + dc.w $709,$719,$719,$729,$719,$729,$719,$82a + dc.w $719,$82a,$729,$82a,$729,$83a,$73a,$83a + dc.w $83a,$83a,$83a,$83a,$83a,$83a,$83a,$84a + dc.w $83a,$84a,$83a,$84a,$83a,$84a,$84a,$84a + dc.w $84a,$95a,$84a,$95a,$84b,$95a,$84b,$95b + dc.w $95a,$95b,$95a,$95b,$95a,$95b,$95b,$96b + dc.w $95b,$96b,$95b,$96b,$95b,$96b,$96b,$a6b + dc.w $96b,$a6b,$96b,$a6b,$96b,$a6b,$a6b,$a7c + dc.w $a6b,$a7c,$a7b,$a7c,$a7b,$a7c,$a7b,$a7c + dc.w $a7c,$a7c,$a7c,$b8c,$a7c,$b8c,$a7c,$b8c + dc.w $a7c,$a8c,$b8c,$b8c,$b8c,$b8c,$b8c,$b8c + dc.w $b8c,$b8c,$b8c,$b9d,$b8c,$b9d,$b8c,$b9d + dc.w $b8c,$b9d,$b9d,$b9d,$b9c,$b9d,$c9d,$cad + dc.w $c9d,$cad,$c9d,$cad,$c9d,$cad,$cad,$cad + dc.w $cad,$cad,$cad,$cad,$cad,$cad,$cad,$dbd + dc.w $cad,$dbd,$cad,$dbe,$cad,$dbe,$dbd,$dbe + dc.w $dbd,$dbe,$dbe,$dce,$dbe,$dce,$dbe,$dce + dc.w $dbe,$dce,$dce,$dce,$dce,$dce,$dce,$dce + dc.w $dce,$dce,$ece,$dce,$ede,$ece,$ede,$dce + dc.w $ede,$dce,$ede,$ede,$edf,$ede,$edf,$ede + dc.w $edf,$ede,$edf,$eef,$edf,$eef,$edf,$eef + dc.w $edf,$eef,$fef,$eef,$fef,$fef,$fef,$fef + dc.w $fff,$fef,$fff,$fef,$fff,$fef,$fff,$fff + dc.w $fff,$fff,$fff,$fff,$fff,$fff,$fff,$fff + + blk.w 180,$fff + +sth_midbar_gradient: +; https://gradient-blaster-grahambates.vercel.app/?points=000@0,578@35,fff@43,984@52,000@128&steps=256&blendMode=oklab&ditherMode=blueNoise&target=amigaOcs&ditherAmount=82 + dc.w $000,$000,$000,$000,$000,$000,$010,$001 + dc.w $011,$011,$011,$112,$111,$122,$122,$223 + dc.w $222,$233,$233,$234,$243,$234,$334,$245 + dc.w $344,$345,$355,$455,$356,$466,$457,$567 + dc.w $467,$568,$567,$578,$789,$79a,$8aa,$acc + dc.w $bcc,$cde,$efe,$fff,$efe,$edd,$ddb,$dcb + dc.w $cb9,$cb8,$a96,$a95,$984,$984,$984,$983 + dc.w $874,$884,$873,$883,$873,$773,$863,$774 + dc.w $763,$773,$663,$763,$763,$662,$662,$653 + dc.w $652,$663,$553,$653,$652,$652,$542,$652 + dc.w $542,$542,$541,$542,$541,$442,$432,$442 + dc.w $431,$431,$431,$431,$321,$331,$331,$331 + dc.w $221,$321,$320,$221,$321,$220,$220,$221 + dc.w $211,$111,$210,$211,$110,$110,$110,$110 + dc.w $100,$111,$100,$100,$010,$000,$000,$100 + dc.w $000,$000,$000,$000,$000,$000,$000,$000 + +sth_sprite_xpos: + ; XPos + dc.b 77,74,70,68,64,62,60,58,56,53,52,50,49,48,46,45 + dc.b 44,43,42,41,39,39,38,37,36,35,34,33,33,32,32,31 + dc.b 30,30,29,29,28,27,27,26,26,25,25,24,24,23,23,22 + dc.b 22,22,21,21,21,20,20,20,19,19,19,19,18,18,18,18 + dc.b 18,17,17,17,17,17,17,16,16,16,16,16,16,16,16,16 + dc.b 16,16,16,16,15,16,16,16,16,16,16,16,16,16,16,16 + dc.b 17,17,17,17,17,17,18,18,18,19,19,19,19,20,20,21 + dc.b 21,22,22,23,23,24,24,25,25,26,27,27,28,29,29,30 + dc.b 31,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46 + dc.b 48,49,50,52,54,55,56,57,60,62,63,65,67,68,71,73 + dc.b 75,77,80,82,84,86,88,90,93,96,99,101,104,107,110,113 + dc.b 116,119,122,125,128 + +sth_sprite_widths: + ; Width (49 at 90, 81 at 144) + dc.b 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 ; 0 + dc.b 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,33 ; 16 + dc.b 33,33,33,33,34,34,34,34,34,35,35,35,35,35,36,36 ; 32 + dc.b 36,36,37,37,37,37,38,38,38,38,38,39,39,39,40,40 ; 48 + dc.b 40,40,41,41,41,42,42,42,42,43,43,43,44,44,44,45 ; 64 + dc.b 45,45,46,46,46,47,47,47,48,48,48,49,49,50,50,50 ; 80 + dc.b 51,51,52,52,52,53,53,54,54,55,55,56,56,57,57,58 ; 96 + dc.b 58,59,59,60,60,61,61,62,62,63,64,64,65,66,66,67 ; 112 + dc.b 68,68,69,69,70,71,72,72,73,74,75,76,76,77,78,79 ; 128 + dc.b 80,81,82,83,84,85,86,87,88,89,90,91,92,93,95,96 ; 144 + dc.b 97,98,100,101,102,104,105,106,107,109,111,112,114,116,117,119 + dc.b 121,123,125,126,128 + +sth_sprite_y_offsets: + dc.w 0 ; 16 + dc.w 0 ; 32 + dc.w 31 ; 48 + dc.w 90 ; 64 + dc.w 124 ; 80 + dc.w 144 ; 96 + dc.w 160 ; 112 + dc.w 172 ; 128 + +sth_font_data: + ; Font + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11202022 + dc.l $33226266,$7766e6ee,$776eeeee,$776eeeee,$776eeeee,$776eeeee,$574eeeee,$556eaaaa,$466e2a2a,$6666222a,$6666224c,$6666204c,$6666444c,$6664444c,$6644444c,$4444444c + dc.l $4444444c,$44444488,$44444888,$44448888,$44088888,$44088888,$00088888,$00088888,$00088800,$00088000,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$33666666,$77666666 + dc.l $776644ee,$7744ccee,$754cccee,$754cccee,$754c8cee,$75088cee,$31088cee,$31088cee,$31088eee,$3108aeee,$332aaeee,$322aaeee,$222aaeee,$222aeeee,$222aeecc,$626eeecc + dc.l $666ecccc,$464cccc8,$444ccc88,$444ccc88,$444ccc88,$444c8888,$444c8888,$44008888,$00000808,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00202220,$32222222,$32222266,$33226666,$33666666,$33666666 + dc.l $77666666,$77466666,$554446ee,$554446aa,$55440aaa,$55008aaa,$55008aaa,$51008aaa,$11088aaa,$00088aaa,$00088a88,$00088888,$00088888,$00088888,$40088888,$40088888 + dc.l $44488888,$444c8888,$444c8888,$44488888,$44008888,$44000888,$40000008,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$33666666,$77666666 + dc.l $776646ee,$7744ceee,$554cceee,$554cceaa,$554c8aaa,$55088aaa,$11088aaa,$11088aaa,$11088aaa,$1108aaaa,$1008aaaa,$100aaaaa,$002aaaaa,$222aaaaa,$222aaaec,$622aeecc + dc.l $666eeecc,$666ecccc,$666ccccc,$664ccccc,$444ccccc,$4444cc88,$44440888,$00000008,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$33666666,$77666666 + dc.l $776646ee,$7744ceee,$754cceee,$754cceee,$754c8eee,$75088eee,$31088eee,$31088eee,$31088eee,$31088eee,$31088eee,$31088eee,$00088eee,$00088e88,$00088888,$00088888 + dc.l $00088888,$00088888,$00088888,$00088888,$00088888,$00088888,$00088888,$00088888,$00088888,$00088800,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$33666666,$77666666 + dc.l $776646ee,$7744ceee,$754cceee,$754cceee,$754c8eee,$75088eee,$31088eee,$31088e66,$31080666,$31000666,$31000666,$11000666,$11000622,$11000222,$11000222,$11000222 + dc.l $00000222,$00000200,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00202220,$32222222,$32222266,$33226666,$33666666,$33666666 + dc.l $77666666,$7746666e,$554446ee,$554446aa,$55440aaa,$55008aaa,$55008aaa,$51008aaa,$11008aaa,$11088aaa,$000888cc,$0008cccc,$0008cccc,$0008cccc,$0008cccc,$0008cccc + dc.l $0008cccc,$404ccccc,$444ccccc,$444ccccc,$44cccccc,$44cccc88,$44cc8888,$44888888,$00888888,$00888800,$00880000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$22666666,$66666644 + dc.l $666644cc,$6644cccc,$664ccccc,$664ccccc,$664ccccc,$6608cccc,$2208cccc,$2208cc44,$22084444,$33004444,$33004466,$33006666,$33226666,$33226666,$33226666,$33226666 + dc.l $22666666,$66666644,$666644cc,$6644cccc,$444ccccc,$444ccc88,$444c8888,$44088888,$00088888,$00088800,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11000022,$11000022,$11000022,$11000022,$11000022,$11000022 + dc.l $11000022,$110000a2,$1100aaa2,$112aaaa2,$332aaaa2,$332aaae6,$332aeee6,$336eeee6,$776eeee6,$776eccee,$774cccee,$554cccee,$554cccaa,$554c88aa,$550888aa,$110888aa + dc.l $000888a2,$00088880,$00088880,$00088880,$00088880,$00088880,$00088880,$00088880,$00088880,$00088800,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00400000,$44400000 + dc.l $44400008,$44400088,$44400888,$44408888,$44408888,$44008888,$44088888,$40088888,$00188888,$11188888,$111888aa,$1118aaaa,$113aaaaa,$333aaaaa,$333aaaee,$332aeeee + dc.l $626eeeee,$666eeecc,$666ecccc,$664ccccc,$444ccccc,$444ccc88,$44448888,$44000888,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$22666666,$66666644 + dc.l $666644cc,$6644cccc,$644ccccc,$666ccccc,$666eeccc,$666eeeec,$766eeeee,$376eee66,$332e6666,$33226666,$33266666,$33666666,$15466666,$55444666,$5544440a,$45444488 + dc.l $44440888,$44448888,$44088888,$44088888,$00088888,$00088888,$00088800,$00088800,$00080000,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$22666666,$66666644 + dc.l $666644cc,$6644cccc,$444ccccc,$444ccc88,$444c8888,$44088888,$40088888,$40088888,$40088888,$40088888,$40088888,$40088888,$40088888,$40088888,$40088888,$40088888 + dc.l $40088888,$40088888,$40088888,$40088888,$40088888,$40088888,$40088888,$40088888,$40088888,$00088888,$00088800,$00080000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$33666666,$77666666 + dc.l $764466ee,$4466eeee,$446eee88,$666eaa88,$662a888c,$222888cc,$3208cc44,$31286666,$33666666,$37666666,$37666666,$37666666,$15446626,$15222222,$33222222,$33222266 + dc.l $22226666,$22666644,$66664444,$664444cc,$4444cccc,$444ccc88,$444c8888,$44088888,$00088888,$00088800,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$32666666,$66666666 + dc.l $666666ee,$6666eeec,$666eeecc,$666eeecc,$666ea8cc,$662a8ccc,$222acccc,$2228cc44,$220c4444,$22444444,$31444444,$15444466,$55446666,$55666662,$7766662a,$776666ee + dc.l $666666ee,$66666ecc,$6666cccc,$6644cccc,$444ccccc,$444ccc88,$444c8888,$44088888,$00088888,$00088800,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00202220,$32222222,$32222266,$33226666,$33666666,$37666666 + dc.l $77666666,$7746666e,$554446ee,$554446aa,$55440aaa,$55008aaa,$55008aaa,$51008aaa,$11088aaa,$1108aaaa,$1008aaaa,$100aaaaa,$002aaaaa,$222aaaaa,$222aaaec,$622aeecc + dc.l $666eeecc,$666ecccc,$666ccccc,$664ccccc,$4444cccc,$44444c88,$44440008,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$33666666,$77666666 + dc.l $776644ee,$7744ccee,$55ccccee,$55ccccee,$55ccccee,$5588ccee,$1188ccee,$1188cc66,$11884466,$11004466,$11004666,$11006666,$30226666,$32226666,$22226666,$22226666 + dc.l $22226644,$22226644,$22220444,$22000444,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00202220,$32222222,$32222266,$33226666,$33666666,$37666666 + dc.l $77666666,$774666ee,$554446ee,$55444eaa,$55448aaa,$55008aaa,$55008aaa,$51088aaa,$11088aaa,$1108aaaa,$1008aaaa,$100aaaaa,$002aaaaa,$222aaaaa,$222aaaec,$622aeecc + dc.l $666eeecc,$666ecccc,$666ccccc,$6644cccc,$4444cccc,$4444cc88,$444c8888,$04888888,$00888880,$08888800,$00088800,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$33666666,$77666666 + dc.l $776644ee,$7744ccee,$554cccee,$554cccee,$554cccee,$5508ccee,$1108ccee,$1108cc66,$11084666,$11006666,$31266666,$32666666,$22666666,$26666666,$66666644,$6666664c + dc.l $666644cc,$66440ccc,$44448888,$44488888,$44088888,$40088888,$00088888,$00088880,$00088800,$00088000,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$10002222,$10222222,$13222222,$33222222,$33622222,$77622226 + dc.l $7762222e,$776202ee,$776008ee,$774088ee,$774088ee,$770088ee,$730888ee,$330888ee,$330888ee,$220888ee,$220888cc,$220888cc,$220888cc,$220888cc,$22088ccc,$2008cccc + dc.l $604ccccc,$644ccccc,$444ccccc,$444ccccc,$444ccc88,$444ccc88,$44448888,$44000888,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11000222,$11000222,$11000222,$11000222,$11000222,$11000222,$11000222 + dc.l $11000222,$11000222,$11002222,$11222222,$33222222,$33222266,$33226666,$33666666,$77666666,$776666ee,$7744eeee,$554ceeee,$554ceeaa,$554caaaa,$5508aaaa,$1108aaaa + dc.l $0008aa22,$00082200,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$33226666,$22666666,$26666644 + dc.l $66664444,$6644444c,$444444cc,$44444488,$44440888,$44008888,$44008888,$40008888,$00088888,$11088888,$110888aa,$1108aaaa,$112aaaaa,$332aaaaa,$332aaaee,$732aeeee + dc.l $666eeeee,$666eeecc,$666ecccc,$664ccccc,$444ccccc,$4444cc88,$44440888,$04000008,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000002,$11000022,$11000222,$11002222,$11022222,$11222222,$32222222,$22222222 + dc.l $22222244,$22222244,$22224444,$22244444,$22444444,$04444444,$44444444,$44444488,$54444088,$5564aaaa,$7762eaee,$776eeeee,$776eeeee,$776eeeee,$776eeeee,$776eeeee + dc.l $664ecece,$040c8888,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11002222,$11222222,$33222222,$33222266,$22226666,$22666644,$66664444 + dc.l $664444cc,$4444cccc,$444ccc88,$444c8888,$642a8888,$626acccc,$666ecccc,$666ecccc,$666ecccc,$664ccccc,$3108cccc,$114c4466,$11446622,$55666622,$776622aa,$776222ee + dc.l $6622eeee,$626eeecc,$666ecccc,$664ccccc,$444ccccc,$444ccc88,$444c8888,$44088888,$00088888,$00088800,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$01000000,$11000000,$11000002,$11000022,$11000222,$11002222,$11022222,$10222222 + dc.l $02222222,$22222220,$22222204,$666eeccc,$666ecccc,$666ccccc,$664ccccc,$766cecec,$776eeeee,$776eeeee,$33266666,$33666666,$33666666,$77666666,$47464606,$44444488 + dc.l $44440088,$44448888,$44008888,$44088888,$00088888,$00088888,$00088800,$00088800,$00080000,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$01000000,$11000000,$11000002,$11000022,$11000222,$11002222,$11022222,$10222222,$02222222 + dc.l $22222220,$22222204,$22222044,$22220444,$22204444,$22044444,$20444444,$04444444,$74646464,$776666ee,$7766eeee,$776eeeee,$776eeeee,$776eeeee,$776eeeee,$070e8e8e + dc.l $00088800,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000 + dc.l $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$11000000,$11000022,$11000022,$11000022,$11000022,$11000022,$11000022,$510000aa + dc.l $554088aa,$554cc8aa,$554cccea,$754cccee,$776cccee,$776eecee,$776eeeee,$776eeeee,$376eeeee,$332eeeee,$332aaeee,$332aaaae,$132aaaaa,$110aaaaa,$00088aaa,$00088888 + dc.l $00088888,$00088888,$00088888,$00088888,$00088888,$00088888,$00088888,$00088888,$00088888,$00088800,$00080000,$00000000,$00000000,$00000000,$00000000,$00000000 + +;******************************************************************** + +;-------------------------------------------------------------------- + + section "sth_copper",data,chip + +sth_copperlist: + COP_MOVE dmacon,DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + COP_MOVE diwstrt,$5281 ; window start + COP_MOVE diwstop,$06c1 ; window stop + COP_MOVE ddfstrt,$0038 ; bitplane start +sth_ddfstop: + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon3,$0c00 +sth_fmode: + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + + COP_MOVE bplcon0,$0200 + COP_MOVE bplcon1,$0000 + COP_MOVE bplcon2,$0024 ; turn off all bitplanes, set scroll values to 0, sprites in front + COP_MOVE bpl1mod,((STHAM_WIDTH*2)*STHAM_PLANES-STHAM_WIDTH)/8 + COP_MOVE bpl2mod,((STHAM_WIDTH*2)*STHAM_PLANES-STHAM_WIDTH)/8 + +sth_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +; Bitmap 1 (y offset = 30) +sth_scroller_shift_1_bitmap: + dc.w $0,$7fff,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$7f,$803f,$8000,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $380,$3fc3,$c000,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$403,$c1fc,$e000,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$80c,$1e3f,$3000,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$30,$e1c7,$d800,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $1043,$e39,$e400,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$84,$31ce,$7a00,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$108,$c633,$9d00,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $11,$18cc,$ee80,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $2222,$2333,$3300,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$4,$44cc,$ddc0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $40,$8933,$66e0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$409,$124c,$9b30,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $90,$2493,$64d8,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$2,$4924,$9b6c,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $4,$9249,$25b6,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $120,$492,$da4b,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$1,$2125,$25b5,$8000,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$808,$484a,$4a5a,$4000,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $42,$1290,$94a5,$a000,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$8425,$295a,$d000,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $210,$210a,$52a5,$2800,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $4,$850,$a54a,$d400,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $81,$285,$a95,$2a00,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$5028,$542a,$d500,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $20,$502,$a155,$2a80,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $a,$54,$aa8,$5540,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$a801,$5502,$aaa0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$2aa,$55,$5550,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$aaaa,$aaa8,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$5555,$5555,$5555,$5555,$0,$0,$0,$0 + dc.w $0,$0,$2aaa,$aaaa,$8000,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $0,$aa,$8005,$5555,$4000,$0,$0,$0,$0,$2a00,$1550,$aaa,$a000,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$2,$8005,$402a,$a055,$5000,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$8,$50,$a81,$550a,$a800,$0,$0,$0 + dc.w $0,$500,$a054,$aa5,$5400,$0,$0,$0,$20,$100a,$502,$a150,$aa00,$0,$0,$0 + dc.w $0,$0,$0,$0,$0,$0,$0,$0,$0,$4020,$5028,$542a,$5500,$0,$0,$0 + dc.w $81,$81,$285,$a85,$a80,$0,$0,$0,$0,$204,$850,$a152,$a540,$0,$0,$0 + dc.w $4,$810,$a102,$1428,$52a0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0 + dc.w $200,$2042,$428,$4285,$2850,$0,$0,$0,$0,$108,$1085,$852,$9528,$0,$0,$0 + dc.w $10,$8000,$4210,$a528,$4294,$0,$0,$0,$0,$421,$842,$1085,$294a,$0,$0,$0 + dc.w $0,$84,$2108,$4212,$94a5,$0,$0,$0,$2,$1000,$8421,$948,$4252,$8000,$0,$0 + dc.w $40,$210,$1084,$2421,$2909,$4000,$0,$0,$0,$4002,$210,$9094,$84a4,$a000,$0,$0 + dc.w $0,$40,$4042,$4242,$5252,$5000,$0,$0,$808,$808,$809,$909,$909,$800,$0,$0 + dc.w $0,$101,$120,$2424,$24a4,$a400,$0,$0,$1,$20,$2404,$8090,$9212,$5200,$0,$0 + dc.w $0,$2004,$90,$1242,$4849,$2900,$0,$0,$100,$400,$9002,$4809,$2124,$8480,$0,$0 + dc.w $0,$90,$248,$124,$492,$5240,$0,$0,$20,$2,$4001,$2480,$9249,$920,$0,$0 + dc.w $4,$0,$924,$12,$4924,$2490,$0,$0,$0,$9249,$2492,$9249,$2492,$4920,$0,$0 + dc.w $0,$0,$0,$4924,$9249,$2492,$0,$0,$0,$0,$0,$2492,$4924,$9249,$0,$0 + dc.w $0,$24,$9249,$0,$12,$4924,$8000,$0,$2,$4900,$124,$9248,$9249,$2449,$0,$0 + dc.w $10,$0,$4800,$924,$124,$9204,$9000,$0,$0,$12,$12,$4002,$4802,$4922,$4800,$0 + dc.w $80,$480,$2481,$2489,$2449,$2249,$1000,$0,$0,$2001,$48,$240,$1204,$9024,$8900,$0 + dc.w $0,$8,$200,$9004,$8120,$4912,$4480,$0,$401,$40,$1004,$120,$4812,$481,$2040,$0 + dc.w $0,$200,$8120,$4891,$2448,$9224,$4900,$0,$8,$1024,$812,$2448,$9122,$4891,$2240,$0 + dc.w $0,$0,$4081,$204,$810,$2448,$9122,$0,$0,$8102,$408,$9122,$4448,$9122,$4448,$0 + dc.w $40,$10,$2244,$891,$1224,$4488,$9122,$0,$0,$801,$20,$4408,$102,$2044,$891,$1000 + dc.w $4,$80,$1102,$2044,$4889,$1112,$2244,$4000,$0,$4008,$8011,$1222,$2444,$4488,$8911,$1000 + dc.w $0,$400,$888,$8111,$1122,$2222,$2444,$4400,$0,$44,$4440,$888,$8888,$9111,$1111,$1100 + dc.w $0,$0,$4,$4444,$0,$888,$8888,$8888,$0,$0,$0,$0,$4444,$4444,$4444,$4444 + + REPT 16 + dc.l 0 + ENDR + +sth_scroller_shift_2_bitmap: + ; Bitmap 2 (y offset = 157, x = 48, width = 80) + dc.w $0,$0,$9248,$0,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $1,$2480,$92,$4000,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $10,$90,$490,$2400,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $2,$81,$2048,$9220,$0 + dc.w $0,$204,$102,$488,$0 + dc.w $0,$0,$0,$0,$0 + dc.w $0,$81,$204,$891,$0 + dc.w $0,$2000,$811,$2204,$4000 + dc.w $0,$0,$0,$0,$0 + dc.w $0,$8010,$220,$4408,$8800 + dc.w $0,$0,$8801,$1022,$2200 + dc.w $0,$200,$44,$4088,$8880 + dc.w $0,$11,$0,$222,$2220 + dc.w $0,$0,$0,$0,$0 + dc.w $0,$0,$0,$0,$0 + + IFND FW_DEMO_PART +sth_hamphrey_pic: + incbin "../data/stham/PLT_HAMph_path_2_test08b_ham.raw" + ENDC + + END \ No newline at end of file diff --git a/source/tools/CommandLine.dll b/source/tools/CommandLine.dll new file mode 100644 index 0000000..d5497ef Binary files /dev/null and b/source/tools/CommandLine.dll differ diff --git a/source/tools/CopyToAdf.exe b/source/tools/CopyToAdf.exe new file mode 100644 index 0000000..993b538 Binary files /dev/null and b/source/tools/CopyToAdf.exe differ diff --git a/source/tools/DevIL.dll b/source/tools/DevIL.dll new file mode 100644 index 0000000..b7a4c09 Binary files /dev/null and b/source/tools/DevIL.dll differ diff --git a/source/tools/FreeImage.dll b/source/tools/FreeImage.dll new file mode 100644 index 0000000..2155170 Binary files /dev/null and b/source/tools/FreeImage.dll differ diff --git a/source/tools/KingCon.exe b/source/tools/KingCon.exe new file mode 100644 index 0000000..9e33c36 Binary files /dev/null and b/source/tools/KingCon.exe differ diff --git a/source/tools/LSPConvert.exe b/source/tools/LSPConvert.exe new file mode 100644 index 0000000..42b52db Binary files /dev/null and b/source/tools/LSPConvert.exe differ diff --git a/source/tools/Shrinkler.exe b/source/tools/Shrinkler.exe new file mode 100644 index 0000000..db44288 Binary files /dev/null and b/source/tools/Shrinkler.exe differ diff --git a/source/tools/ZCP.exe b/source/tools/ZCP.exe new file mode 100644 index 0000000..9d6613a Binary files /dev/null and b/source/tools/ZCP.exe differ diff --git a/source/tools/adftrack.exe b/source/tools/adftrack.exe new file mode 100644 index 0000000..3b51371 Binary files /dev/null and b/source/tools/adftrack.exe differ diff --git a/source/tools/demo.cfg b/source/tools/demo.cfg new file mode 100644 index 0000000..4b3a697 --- /dev/null +++ b/source/tools/demo.cfg @@ -0,0 +1,15 @@ +-as=vasmm68k_mot -x -maxerrors=50 -m68000 -Fhunk -align -phxass %s -DFW_DEMO_PART=1 -o %s -I"%%VBCC%%/../includes" -quiet +-asv=vasmm68k_mot -x -maxerrors=50 -m68000 -Fhunk -align -phxass %s -DFW_DEMO_PART=1 -o %s -I"%%VBCC%%/../includes" +-cc=vbccm68k -warn=-1 -maxerrors=50 -dontwarn=168 -dontwarn=81 -c99 %s -o= %s %s -O=%ld -quiet +-ccv=vbccm68k -warn=-1 -maxerrors=50 -dontwarn=168 -dontwarn=81 -c99 %s -o= %s %s -O=%ld +-l2=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/m68k-amigaos/lib" %s %s -o %s +-l2v=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/m68k-amigaos/lib" %s %s -o %s -t +-ld=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/m68k-amigaos/lib" "%%VBCC%%/targets/m68k-amigaos/lib/startup.o" %s %s -lvc -o %s +-ldv=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/m68k-amigaos/lib" "%%VBCC%%/targets/m68k-amigaos/lib/startup.o" %s %s -lvc -o %s -t +-ldnodb=-S -s -x +-ul=-l%s +-cf=-F%s +-ml=500 + + +-speed \ No newline at end of file diff --git a/source/tools/gfxconv.exe b/source/tools/gfxconv.exe new file mode 100644 index 0000000..cd81108 Binary files /dev/null and b/source/tools/gfxconv.exe differ diff --git a/source/tools/hddemo.cfg b/source/tools/hddemo.cfg new file mode 100644 index 0000000..b11a5bb --- /dev/null +++ b/source/tools/hddemo.cfg @@ -0,0 +1,15 @@ +-as=vasmm68k_mot -x -maxerrors=50 -m68000 -Fhunk -align -phxass %s -DFW_DEMO_PART=1 -DFW_HD_DEMO_PART=1 -o %s -I"%%VBCC%%/../includes" -quiet +-asv=vasmm68k_mot -x -maxerrors=50 -m68000 -Fhunk -align -phxass %s -DFW_DEMO_PART=1 -DFW_HD_DEMO_PART=1 -o %s -I"%%VBCC%%/../includes" +-cc=vbccm68k -warn=-1 -maxerrors=50 -dontwarn=168 -dontwarn=81 -c99 %s -o= %s %s -O=%ld -quiet +-ccv=vbccm68k -warn=-1 -maxerrors=50 -dontwarn=168 -dontwarn=81 -c99 %s -o= %s %s -O=%ld +-l2=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/m68k-amigaos/lib" %s %s -o %s +-l2v=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/m68k-amigaos/lib" %s %s -o %s -t +-ld=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/m68k-amigaos/lib" "%%VBCC%%/targets/m68k-amigaos/lib/startup.o" %s %s -lvc -o %s +-ldv=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -L"%%VBCC%%/targets/m68k-amigaos/lib" "%%VBCC%%/targets/m68k-amigaos/lib/startup.o" %s %s -lvc -o %s -t +-ldnodb=-S -s -x +-ul=-l%s +-cf=-F%s +-ml=500 + + +-speed \ No newline at end of file diff --git a/source/tools/juggler.exe b/source/tools/juggler.exe new file mode 100644 index 0000000..52a0542 Binary files /dev/null and b/source/tools/juggler.exe differ diff --git a/source/tools/lz.exe b/source/tools/lz.exe new file mode 100644 index 0000000..4f7eba5 Binary files /dev/null and b/source/tools/lz.exe differ diff --git a/source/tools/lz4.exe b/source/tools/lz4.exe new file mode 100644 index 0000000..0733f9d Binary files /dev/null and b/source/tools/lz4.exe differ diff --git a/source/tools/platosadf.exe b/source/tools/platosadf.exe new file mode 100644 index 0000000..c905404 Binary files /dev/null and b/source/tools/platosadf.exe differ diff --git a/source/tools/salvador.exe b/source/tools/salvador.exe new file mode 100644 index 0000000..d77f8bf Binary files /dev/null and b/source/tools/salvador.exe differ diff --git a/source/tools/vasmm68k_mot.exe b/source/tools/vasmm68k_mot.exe new file mode 100644 index 0000000..4a4b8c8 Binary files /dev/null and b/source/tools/vasmm68k_mot.exe differ diff --git a/source/tools/vbccm68k.exe b/source/tools/vbccm68k.exe new file mode 100644 index 0000000..7d6bae0 Binary files /dev/null and b/source/tools/vbccm68k.exe differ diff --git a/source/tools/vc.cfg b/source/tools/vc.cfg new file mode 100644 index 0000000..7449a33 --- /dev/null +++ b/source/tools/vc.cfg @@ -0,0 +1,15 @@ +-as=vasmm68k_mot -x -maxerrors=50 -m68000 -showopt -Fhunk -kick1hunks -align -phxass %s -o %s -I"%%VBCC%%/../includes" -quiet +-asv=vasmm68k_mot -x -maxerrors=50 -m68000 -showopt -Fhunk -kick1hunks -align -phxass %s -o %s -I"%%VBCC%%/../includes" +-cc=vbccm68k -warn=-1 -maxerrors=50 -dontwarn=168 -dontwarn=81 -c99 %s -o= %s %s -O=%ld -quiet +-ccv=vbccm68k -warn=-1 -maxerrors=50 -dontwarn=168 -dontwarn=81 -c99 %s -o= %s %s -O=%ld +-l2=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -mrel -L"%%VBCC%%/targets/m68k-amigaos/lib" %s %s -o %s +-l2v=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -mrel -L"%%VBCC%%/targets/m68k-amigaos/lib" %s %s -o %s -t +-ld=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -mrel -L"%%VBCC%%/targets/m68k-amigaos/lib" "%%VBCC%%/targets/m68k-amigaos/lib/startup.o" %s %s -lvc -o %s +-ldv=vlink -bamigahunk -Bstatic -Cvbcc -nostdlib -mrel -L"%%VBCC%%/targets/m68k-amigaos/lib" "%%VBCC%%/targets/m68k-amigaos/lib/startup.o" %s %s -lvc -o %s -t +-ldnodb=-S -s -x +-ul=-l%s +-cf=-F%s +-ml=500 + + +-speed \ No newline at end of file diff --git a/source/tools/vc.exe b/source/tools/vc.exe new file mode 100644 index 0000000..2ea659e Binary files /dev/null and b/source/tools/vc.exe differ diff --git a/source/tools/vlink.exe b/source/tools/vlink.exe new file mode 100644 index 0000000..f6b2205 Binary files /dev/null and b/source/tools/vlink.exe differ diff --git a/source/tools/vobjdump.exe b/source/tools/vobjdump.exe new file mode 100644 index 0000000..bfa622d Binary files /dev/null and b/source/tools/vobjdump.exe differ diff --git a/source/tools/vprof.exe b/source/tools/vprof.exe new file mode 100644 index 0000000..5034752 Binary files /dev/null and b/source/tools/vprof.exe differ diff --git a/source/tools/zx0.exe b/source/tools/zx0.exe new file mode 100644 index 0000000..18f388f Binary files /dev/null and b/source/tools/zx0.exe differ diff --git a/source/virgillbars/aga.bat b/source/virgillbars/aga.bat new file mode 100644 index 0000000..57240c0 --- /dev/null +++ b/source/virgillbars/aga.bat @@ -0,0 +1,30 @@ +del virgillbars.exe +del "..\winuae\hd0\virgillbars.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "virgillbars.exe" "virgillbars.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy virgillbars.exe "..\winuae\hd0" +copy virgillbars.exe "..\winuae\hd0\a" + +@echo /|set /p =virgillbars.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a1200_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/virgillbars/assemble.bat b/source/virgillbars/assemble.bat new file mode 100644 index 0000000..b0abad2 --- /dev/null +++ b/source/virgillbars/assemble.bat @@ -0,0 +1,40 @@ +del virgillbars.exe +del "..\winuae\hd0\virgillbars.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +pushd .. + +tools\KingCon.exe @data/virgillbars/assets.txt +@if %ERRORLEVEL% NEQ 0 goto failed + +tools\LSPConvert.exe data\music\dsr_68k_tune_2_v11.mod -setpos -v +@if %ERRORLEVEL% NEQ 0 goto failed + +popd + +vc -O2 -notmpfile -nostdlib -o "virgillbars.exe" "virgillbars.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy virgillbars.exe "..\winuae\hd0" +copy virgillbars.exe "..\winuae\hd0\a" + +@echo /|set /p =virgillbars.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae" -config="configs\a500_hrt.uae" -log -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/virgillbars/compile.bat b/source/virgillbars/compile.bat new file mode 100644 index 0000000..f228e0e --- /dev/null +++ b/source/virgillbars/compile.bat @@ -0,0 +1,9 @@ + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "virgillbars.exe" "virgillbars.asm" diff --git a/source/virgillbars/debug.bat b/source/virgillbars/debug.bat new file mode 100644 index 0000000..9d4e4b9 --- /dev/null +++ b/source/virgillbars/debug.bat @@ -0,0 +1,21 @@ +del virgillbars.exe +del "..\winuae\hd0\virgillbars.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -g -hunkdebug -O2 -notmpfile -nostdlib -o "virgillbars.exe" "virgillbars.asm" + +copy virgillbars.exe "..\winuae\hd0" +copy virgillbars.exe "..\winuae\hd0\a" + +copy "..\winuae\hd0\s\debug-sequence" "..\winuae\hd0\s\startup-sequence" +@echo /|set /p =virgillbars.exe >>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_debug.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg diff --git a/source/virgillbars/record.bat b/source/virgillbars/record.bat new file mode 100644 index 0000000..3d53e0f --- /dev/null +++ b/source/virgillbars/record.bat @@ -0,0 +1,30 @@ +del virgillbars.exe +del "..\winuae\hd0\virgillbars.exe" + +@if X%VBCC%==X%~dp0 goto AlreadySet +@set VBCC=%~dp0 +@set PATH=%VBCC%\..\tools;%PATH% +:AlreadySet + +copy "..\tools\vc.cfg" %~dp0 + +vc -O2 -notmpfile -nostdlib -o "virgillbars.exe" "virgillbars.asm" +@if %ERRORLEVEL% NEQ 0 goto failed + +copy virgillbars.exe "..\winuae\hd0" +copy virgillbars.exe "..\winuae\hd0\a.exe" + +@echo /|set /p =virgillbars.exe>"..\winuae\hd0\s\startup-sequence" + +"..\winuae\winuae64" -config="configs\a500_rec.uae" -s use_gui=no -s filesystem2=rw,hd0:test:%~dp0\..\winuae\hd0,0 + +del vc.cfg +@goto ok + +rem ############ ERROR HANDLER ############ +:failed + @echo error in directory "%CD%" + @echo !!!!!!!!! oh no !!!!!!!!!!!! + @pause + del vc.cfg +:ok diff --git a/source/virgillbars/virgillbars.asm b/source/virgillbars/virgillbars.asm new file mode 100644 index 0000000..2a5b65c --- /dev/null +++ b/source/virgillbars/virgillbars.asm @@ -0,0 +1,3307 @@ +; TODOs: +; - Limit bar pos left and right depending on size +; +; Framework settings + + IFD FW_DEMO_PART + IFD FW_HD_DEMO_PART + include "../hamazing/hdtrackmo_settings.i" + ELSE + include "../hamazing/trackmo_settings.i" + ENDC + ELSE +FW_STANDALONE_FILE_MODE = 1 ; enable standalone (part testing) +FW_HD_TRACKMO_MODE = 0 ; DO NOT CHANGE (not supported for standalone mode) + +FW_MUSIC_SUPPORT = 1 +FW_MUSIC_PLAYER_CHOICE = 2 ; 0 = None, 1 = LSP, 2 = LSP_CIA, 3 = P61A, 4 = Pretracker (CPU DMA wait), 5 = Pretracker Turbo (Copper wait) +FW_LMB_EXIT_SUPPORT = 1 ; allows abortion of intro with LMB +FW_MULTIPART_SUPPORT = 0 ; DO NOT CHANGE (not supported for standalone mode) +FW_DYNAMIC_MEMORY_SUPPORT = 1 ; enable dynamic memory allocation. Otherwise, use fw_ChipMemStack/End etc fields. +FW_MAX_MEMORY_STATES = 4 ; the amount of memory states +FW_TOP_BOTTOM_MEM_SECTIONS = 0 ; allow allocations from both sides of the memory +FW_64KB_PAGE_MEMORY_SUPPORT = 0 ; allow allocation of chip memory that doesn't cross the 64 KB page boundary +FW_MULTITASKING_SUPPORT = 1 ; enable multitasking +FW_ROUNDROBIN_MT_SUPPORT = 0 ; enable fair scheduling among tasks with same priority +FW_BLITTERTASK_MT_SUPPORT = 0 ; enable single parallel task during large blits +FW_MAX_VPOS_FOR_BG_TASK = 308 ; max vpos that is considered to be worth switching to a background task, if any +FW_SINETABLE_SUPPORT = 1 ; enable creation of 1024 entries sin/cos table +FW_SCRIPTING_SUPPORT = 1 ; enable simple timed scripting functions +FW_PALETTE_LERP_SUPPORT = 0 ; enable basic palette fading functions +FW_YIELD_FROM_MAIN_TOO = 0 ; adds additional code that copes with Yield being called from main code instead of task +FW_VBL_IRQ_SUPPORT = 0 ; enable custom VBL IRQ routine +FW_COPPER_IRQ_SUPPORT = 0 ; enable copper IRQ routine support +FW_AUDIO_IRQ_SUPPORT = 0 ; enable audio IRQ support (unimplemented) +FW_VBL_MUSIC_IRQ = 0 ; enable calling of VBL based music ticking (disable, if using CIA timing!) +FW_BLITTERQUEUE_SUPPORT = 1 ; enable blitter queue support +FW_A5_A6_UNTOUCHED = 1 ; speed up blitter queue if registers a5/a6 are never changed in main code + +FW_LZ4_SUPPORT = 0 ; compile in LZ4 decruncher +FW_DOYNAX_SUPPORT = 0 ; compile in doynax decruncher +FW_ZX0_SUPPORT = 0 ; compile in ZX0 decruncher + +FW_DO_FANCY_WORKBENCH_STUFF = 0 ; enable pre- and post-hook (os startup only) + +ENABLE_PART_MUSIC = 1 +PART_MUSIC_START_POS = 4 + ENDC + +VGBARS_WIDTH = 320 +VGBARS_HEIGHT = 180 +VGBARS_PLANES = 6 + +CAT_WIDTH = 64 +CAT_HEIGHT = 128 + +AOLD_WIDTH = 96 +AOLD_HEIGHT = 112 + +LIGHTBREAK_WIDTH = 128 +LIGHTBREAK_HEIGHT = 128 + +STAYBROKEN_WIDTH = 128 +STAYBROKEN_HEIGHT = 128 + +MODSHIFT_SIZE = (VGBARS_HEIGHT*(2+2)) +BARLINE_WIDTH = 1024 + +NUM_HISTORY_BUFS = 128 + +ROT_ANGLES = 124 + +COP_PREAMBLE_INST = 128 ; bplptrs, sprite pointers +COP_POST_INST = 16 ; wait +COP_INST_PER_LINE = 1+3+1+2 ; wait, bplcon1, bpl1mod, bpl2mod, wait, line 0 color, line 0 color +COP_WOBBLE_INST_PER_LINE = 2+2 ; 2 waits, bpl1mod, bpl2mod +COP_LIST_SIZE = (COP_PREAMBLE_INST+COP_INST_PER_LINE*VGBARS_HEIGHT+COP_POST_INST)*4 +INTRO_COP_LIST_SIZE = 100*4 + +NUM_CHUNKY_PIXELS = 512 + +NUM_AHEAD_FRAMES = 18 +AHEAD_CHIP_BUF_SIZE = 3*NUM_CHUNKY_PIXELS*2+(NUM_CHUNKY_PIXELS*2+920)+VGBARS_HEIGHT*2+NUM_CHUNKY_PIXELS+(BARLINE_WIDTH/8)*VGBARS_PLANES + +NUM_BARS = 7 +BAR_WIDTH = 32 + +CHIPMEM_SIZE = 2*COP_LIST_SIZE+2*INTRO_COP_LIST_SIZE+(BARLINE_WIDTH/8)*VGBARS_PLANES*2+NUM_CHUNKY_PIXELS*2*17+2*ROT_ANGLES*MODSHIFT_SIZE +FASTMEM_SIZE = 2*4096+65536+NUM_CHUNKY_PIXELS*2+2*ROT_ANGLES*VGBARS_HEIGHT*2+(NUM_BARS*(2*BAR_WIDTH)*BAR_WIDTH*3*2) + + IFND DEBUG_DETAIL +DEBUG_DETAIL SET 10 + ENDC + +NEWAGE_DEBUG = 1 + + include "../framework/framework.i" + +; Process: +; +; 1. CPU: Draw interpolated bars with adds +; In : pd_CurrChunkyPtr +; Out: pd_CurrChunkyPtr +; +; 2. Blitter: Saturate and convert with blitter +; In : pd_CurrChunkyPtr +; Out: pd_CurrChunkyResultPtr +; +; 3. CPU: Take rotation offsets and calc left edge color +; In : pd_CurrChunkyResultPtr +; Out: pd_ChunkyLeftEdgeRGBPtr +; +; 4. Blitter: Copy precalculated bplcon1/mods and edge color to copperlist +; In : pd_ChunkyLeftEdgeRGBPtr +; Out: pd_CurrCopListPtr +; Out: pd_FirstLineOffset +; +; 4b. CPU: Update first line pos +; In : pd_FirstLineOffset +; Out: pd_CurrCopListPtr +; +; 5. CPU: Convert to HAM pixels (and draw to p5/p6) +; In : pd_CurrChunkyResultPtr +; Out: pd_ChunkyHamPtr +; Out: pd_CurrPlanesPtr (p5/p6) +; +; 6. CPU: C2P of HAM pixels +; In : pd_ChunkyHamPtr +; Out: pd_CurrPlanesPtr (p1-p4) +; +; 7. Blitter: Fill chunky data with dither pattern +; In : - +; Out: pd_CurrChunkyPtr +; +; Pipelined: +; 2. T-1: Blitter: Saturate and convert with blitter (idle cycles) +; 7. T-1: Blitter: Fill chunky data with dither pattern (idle cycles) +; -- +; 4. T-2: Blitter: Copy precalculated bplcon1/mods and edge color to copperlist +; -- +; 1. T+0: CPU: Draw interpolated bars with adds +; 3. T+1: CPU: Take rotation offsets and calc left edge color +; 5. T-3: CPU: Convert to HAM pixels (and draw to p5/p6) +; 6. T-3: CPU: C2P of HAM pixels +; +; Precalculate bar widths 32 to 63 +; Between angle 171-214: 2x ham width +; Between angle 215-235: 4x ham width +; Between angle 236-245: 8x ham width +; Between angle 246-250: 16x ham width + + STRUCTURE BarData,0 + UWORD bd_Phase + UWORD bd_NomWidth + UWORD bd_PhaseSpeed + UWORD bd_Dist + UWORD bd_CurrXPos + UWORD bd_CurrWidth + UWORD bd_BarNum + UWORD bd_ColRed + UWORD bd_ColGreen + UWORD bd_ColBlue + WORD bd_FadePos + ULONG bd_IncRed + ULONG bd_IncGreen + ULONG bd_IncBlue + LABEL bd_SIZEOF + + STRUCTURE PartData,fw_SIZEOF + APTR pd_CurrPlanesPtr + APTR pd_CurrChunkyPtr + APTR pd_LastChunkyPtr + APTR pd_CurrChunkyResultPtr + APTR pd_LastChunkyResultPtr + APTR pd_CurrCopListPtr + APTR pd_LastCopListPtr + UBYTE pd_DbToggle + UBYTE pd_CopperToggle + ALIGNWORD + + UWORD pd_PartCountDown + UWORD pd_SudokuDitherPos + + UWORD pd_CopperSkewOffset + UWORD pd_CopperBplOffset + + UWORD pd_OverlayXPos + UWORD pd_OverlayYPos + UWORD pd_OverlayXDir + UWORD pd_OverlayYDir + BOOL pd_OverlayKilled + UWORD pd_Angle + UWORD pd_LastAngle + UWORD pd_AnglePhase + UWORD pd_AngleWidth + BOOL pd_DecAngleWidth + + WORD pd_FirstLineOffset + UWORD pd_HistoryNum + UWORD pd_HistorySub + UWORD pd_Wobble1Pos + UWORD pd_Wobble2Pos + BOOL pd_FadeOutWobble + + UWORD pd_NextBeatFrame + UWORD pd_BeatZoom + UWORD pd_BeatSize + + APTR pd_CopperList1 + APTR pd_CopperList2 + APTR pd_IntroCopperList1 + APTR pd_IntroCopperList2 + APTR pd_DbBuffer + APTR pd_HistoryBuffer + + APTR pd_ChunkyArray1Ptr + APTR pd_ChunkyArray2Ptr + APTR pd_ChunkySatPtr + APTR pd_ChunkySatRPtr + APTR pd_ChunkySatGPtr + APTR pd_ChunkySatBPtr + APTR pd_ChunkyResultRPtr + APTR pd_ChunkyResultGPtr + APTR pd_ChunkyResultBPtr + APTR pd_ChunkyResultRGB1Ptr + APTR pd_ChunkyResultRGB2Ptr + APTR pd_ChunkyLeftEdgeRGBPtr + APTR pd_ChunkyHamPtr + + APTR pd_OneColorChangeTable ; ds.b 4096 + APTR pd_RedBlueTable ; ds.b 4096 + APTR pd_DiffTable ; ds.b 65536 + + APTR pd_XPosBufferPtr + APTR pd_PreCalcedBarsPtr + APTR pd_WobbleDataPtr + APTR pd_ModShiftDataPtr + + STRUCT pd_BQBuffer,1000 + + STRUCT pd_OverlaySprites,8*4 + STRUCT pd_BarData,NUM_BARS*bd_SIZEOF + STRUCT pd_PreparationTask,ft_SIZEOF + STRUCT pd_CotTable,ROT_ANGLES*2 + STRUCT pd_Mod40TableNeg,VGBARS_HEIGHT*2 + STRUCT pd_Mod40TablePos,VGBARS_HEIGHT*2 + + LABEL pd_SIZEOF + + IFND FW_DEMO_PART + include "../framework/framework.asm" + ENDC + +entrypoint: + IFD FW_DEMO_PART + move.l #pd_SIZEOF,d0 + CALLFW InitPart + ENDC + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + move.l #part_music_data,fw_MusicData(a6) + move.l #part_music_smp,fw_MusicSamples(a6) + CALLFW StartMusic + ENDC + IFD PART_MUSIC_START_POS + moveq.l #PART_MUSIC_START_POS,d0 + CALLFW MusicSetPosition + move.w #1200,fw_MusicFrameCount(a6) + ENDC + ENDC + + bsr.s vgb_init + + lea vgb_copperlist,a0 + CALLFW SetCopper + + bsr vgb_intro + bsr vgb_main + bsr vgb_wobble + + CALLFW SetBaseCopper + rts + +;-------------------------------------------------------------------- + +vgb_init: + bsr vgb_init_vars + + bsr vgb_clear_chunky_buffers + + bsr vgb_init_one_color_change_table + bsr vgb_init_red_blue_table + + ; needs to be done now, because copperlist will not be updated afterwards + bsr vgb_load_aold_sprites + + bsr vgb_flip_db_frame + bsr vgb_flip_copper_frame + bsr vgb_create_main_copperlist + bsr vgb_fill_line_with_default + + bsr vgb_flip_db_frame + bsr vgb_flip_copper_frame + bsr vgb_create_main_copperlist + bsr vgb_fill_line_with_default + + lea .backgroundtasks(pc),a0 + lea pd_PreparationTask(a6),a1 + CALLFW AddTask + + rts + +.backgroundtasks + bsr vgb_init_diff_table + bsr vgb_init_cot_table + bsr vgb_precalc_bars + bsr vgb_init_modshift_table + bsr vgb_init_mod40_table + rts + +;-------------------------------------------------------------------- + +vgb_init_vars: + move.l #(INTRO_COP_LIST_SIZE*2),d0 + CALLFW AllocChip + PUTMSG 10,<"Intro Copperlist 1 %p">,a0 + move.l a0,pd_IntroCopperList1(a6) + lea INTRO_COP_LIST_SIZE(a0),a0 + PUTMSG 10,<"Intro Copperlist 2 %p">,a0 + move.l a0,pd_IntroCopperList2(a6) + + move.l #(COP_LIST_SIZE*2),d0 + CALLFW AllocChip + PUTMSG 10,<"Copperlist 1 %p">,a0 + move.l a0,pd_CopperList1(a6) + move.l a0,pd_CurrCopListPtr(a6) + lea COP_LIST_SIZE(a0),a0 + PUTMSG 10,<"Copperlist 2 %p">,a0 + move.l a0,pd_CopperList2(a6) + move.l a0,pd_LastCopListPtr(a6) + + move.l #(2*BARLINE_WIDTH/8)*VGBARS_PLANES,d0 + CALLFW AllocChip + PUTMSG 10,<"DbBuffer %p">,a0 + move.l a0,pd_DbBuffer(a6) + move.l a0,pd_CurrPlanesPtr(a6) + + move.l #(NUM_BARS*(2*BAR_WIDTH)*BAR_WIDTH*3*2),d0 + CALLFW AllocFast + move.l a0,pd_PreCalcedBarsPtr(a6) + PUTMSG 10,<"pd_PreCalcedBarsPtr %p">,a0 + + move.l #2*ROT_ANGLES*VGBARS_HEIGHT*2,d0 + CALLFW AllocFast + move.l a0,pd_XPosBufferPtr(a6) + PUTMSG 10,<"pd_XPosBufferPtr %p">,a0 + + move.l #2*ROT_ANGLES*MODSHIFT_SIZE,d0 + CALLFW AllocChip + move.l a0,pd_ModShiftDataPtr(a6) + PUTMSG 10,<"pd_ModShiftDataPtr %p">,a0 + move.l a0,pd_HistoryBuffer(a6) + lea (VGBARS_WIDTH/8)*VGBARS_PLANES*NUM_HISTORY_BUFS(a0),a0 + move.l a0,pd_WobbleDataPtr(a6) + + move.l #NUM_CHUNKY_PIXELS*2*17,d0 + CALLFW AllocChip + move.l a0,pd_ChunkyArray1Ptr(a6) + move.w #NUM_CHUNKY_PIXELS*2,d2 + move.l a0,pd_CurrChunkyPtr(a6) + PUTMSG 10,<"Chunky Array Ptr %p">,a0 + adda.w d2,a0 + adda.w d2,a0 + adda.w d2,a0 + move.l a0,pd_ChunkyArray2Ptr(a6) + move.l a0,pd_LastChunkyPtr(a6) + adda.w d2,a0 + adda.w d2,a0 + adda.w d2,a0 + move.l a0,pd_ChunkySatPtr(a6) + move.l a0,pd_ChunkySatRPtr(a6) + PUTMSG 10,<"Chunky Sat Ptr %p">,a0 + adda.w d2,a0 + move.l a0,pd_ChunkySatGPtr(a6) + adda.w d2,a0 + move.l a0,pd_ChunkySatBPtr(a6) + adda.w d2,a0 + move.l a0,pd_ChunkyResultRPtr(a6) + PUTMSG 10,<"Chunky R Ptr %p">,a0 + adda.w d2,a0 + move.l a0,pd_ChunkyResultGPtr(a6) + PUTMSG 10,<"Chunky G Ptr %p">,a0 + adda.w d2,a0 + move.l a0,pd_ChunkyResultBPtr(a6) + PUTMSG 10,<"Chunky B Ptr %p">,a0 + adda.w d2,a0 + lea NUM_CHUNKY_PIXELS(a0),a1 + move.l a1,pd_ChunkyResultRGB1Ptr(a6) + move.l a1,pd_CurrChunkyResultPtr(a6) + PUTMSG 10,<"Chunky RGB Ptr 1 %p">,a0 + adda.w d2,a0 + adda.w d2,a0 + lea NUM_CHUNKY_PIXELS(a0),a1 + move.l a1,pd_ChunkyResultRGB2Ptr(a6) + move.l a1,pd_LastChunkyResultPtr(a6) + PUTMSG 10,<"Chunky RGB Ptr 2 %p">,a0 + adda.w d2,a0 + adda.w d2,a0 + move.l a0,pd_ChunkyLeftEdgeRGBPtr(a6) + PUTMSG 10,<"Chunky Left Edge RGB Ptr %p">,a0 + + move.l #2*4096+65536,d0 + CALLFW AllocFast + move.w #4096,d0 + move.l a0,pd_OneColorChangeTable(a6) + adda.w d0,a0 + move.l a0,pd_RedBlueTable(a6) + adda.w d0,a0 + move.l a0,pd_DiffTable(a6) + + move.l #NUM_CHUNKY_PIXELS*2,d0 + CALLFW AllocFast + move.l a0,pd_ChunkyHamPtr(a6) + PUTMSG 10,<"Chunky Ham Ptr %p">,a0 + + lea pd_BarData(a6),a1 + lea vgb_bars_colors(pc),a0 + lea vgb_bars_dists(pc),a2 + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #0,d2 + moveq.l #39,d3 + moveq.l #NUM_BARS-1,d7 +.bloop + move.w d0,(a1)+ ; bd_Phase + add.w #333,d0 + move.w #BAR_WIDTH*256,(a1)+ ; bd_NomWidth + move.w d3,(a1)+ ; bd_PhaseSpeed + addq.w #7,d3 + move.w (a2)+,(a1)+ ; bd_Dist + clr.l (a1)+ ; bd_CurrXPos/bd_CurrWidth + move.w d2,(a1)+ ; bd_BarNum + move.w (a0)+,(a1)+ ; bd_ColRed + move.w (a0)+,(a1)+ ; bd_ColGreen + move.w (a0)+,(a1)+ ; bd_ColBlue + move.w d1,(a1)+ ; bd_FadePos + lea 3*4(a1),a1 ; bd_IncRed/bd_IncGreen/bd_IncBlue + sub.w #5461,d1 + addq.w #1,d2 + dbra d7,.bloop + + rts + +;-------------------------------------------------------------------- + +vgb_init_cot_table: + move.l fw_CosTable(a6),a1 + lea pd_CotTable(a6),a0 + PUTMSG 10,<"%d: CotTable %p">,fw_FrameCounterLong(a6),a0 + moveq.l #(ROT_ANGLES-1)-1,d7 + moveq.l #0,d0 + moveq.l #0,d5 + subq.w #1,d5 +.loop move.l #256<<14,d1 + divu (a1),d1 + move.w d1,(a0)+ + addq.l #2*2,a1 + dbra d7,.loop + PUTMSG 10,<"%d: CotTable done">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- + +vgb_init_modshift_table: + PUTMSG 10,<"%d: Calc modshift table">,fw_FrameCounterLong(a6) + move.l pd_ModShiftDataPtr(a6),a1 + move.l pd_XPosBufferPtr(a6),a0 + moveq.l #ROT_ANGLES-1,d7 + moveq.l #0,d0 +.loop1 PUSHM d0/d7/a0/a1 + bsr vgb_calc_skew + POPM + + PUSHM d0/d7/a0/a1 + bsr vgb_calc_modshift + POPM + lea MODSHIFT_SIZE(a1),a1 + lea (VGBARS_HEIGHT*2)(a0),a0 + addq.w #2,d0 + dbra d7,.loop1 + + moveq.l #(ROT_ANGLES-1)-1,d7 + moveq.l #-2,d0 +.loop2 PUSHM d0/d7/a0/a1 + bsr vgb_calc_skew + POPM + + PUSHM d0/d7/a0/a1 + bsr vgb_calc_modshift + POPM + lea MODSHIFT_SIZE(a1),a1 + lea (VGBARS_HEIGHT*2)(a0),a0 + subq.w #2,d0 + dbra d7,.loop2 + PUTMSG 10,<"%d: Calc modshift table done">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- + +vgb_init_one_color_change_table: + move.l pd_OneColorChangeTable(a6),a0 + PUTMSG 10,<"%d: pd_OneColorChangeTable %p">,fw_FrameCounterLong(a6),a0 + moveq.l #1,d0 + move.w #$f00,d4 + move.w #$0f0,d5 + clr.b (a0)+ ; all colors the same + move.w #4095-1,d7 +.loop + move.w d0,d1 + and.w d4,d1 ; d1 = red (and $f00) + moveq.l #$f,d3 + and.w d0,d3 ; d3 = blue + + move.w d0,d2 + and.w d5,d2 ; d2 = green (and $0f0) + bne.s .gdiff ; at least green diffs + ; green does not differ + tst.w d1 + bne.s .rdiff ; at least red diffs + move.b #1*2,(a0)+ ; blue only diff + bra.s .good +.rdiff tst.w d3 + bne.s .rbdiffnotg ; red and blue diff, not green + move.b #4*2,(a0)+ ; red only diffs + bra.s .good +.gdiff + tst.w d1 + bne.s .grdiff ; at least green and red diff + ; red does not differ + tst.w d3 + bne.s .gbdiffnotr ; green and blue diff, red same + move.b #2*2,(a0)+ ; green only diff + bra.s .good +.rbdiffnotg + move.b #(1+4)*2,(a0)+ ; only red and blue diff + bra.s .good +.gbdiffnotr + move.b #(1+2)*2,(a0)+ ; only green and blue diff + bra.s .good +.grdiff tst.w d3 + bne.s .rgbdiff ; all colors diff + ; blue does not differ +.rgdiffnotb + move.b #(2+4)*2,(a0)+ ; only green and red diff + bra.s .good +.rgbdiff + move.b #(1+2+4)*2,(a0)+ ; all colors diff +.good + addq.w #1,d0 + dbra d7,.loop + PUTMSG 10,<"%d: pd_OneColorChangeTable done">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- + +vgb_init_red_blue_table: + move.l pd_RedBlueTable(a6),a0 + PUTMSG 10,<"%d: pd_RedBlueTable %p">,fw_FrameCounterLong(a6),a0 + moveq.l #0,d0 + move.w #4096-1,d7 +.loop + moveq.l #15,d2 + and.w d0,d2 + move.w d0,d1 + lsr.w #4,d1 + and.w #$f0,d1 + or.w d1,d2 + move.b d2,(a0)+ + addq.w #1,d0 + dbra d7,.loop + PUTMSG 10,<"%d: pd_RedBlueTable done">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- + +vgb_init_diff_table: + move.l pd_DiffTable(a6),a0 + PUTMSG 10,<"%d: pd_DiffTable %p">,fw_FrameCounterLong(a6),a0 + add.l #$10000,a0 + move.w #256-1,d7 +.oloop + moveq.l #$f,d0 + and.w d7,d0 ; low of upper + move.w d7,d1 + lsr.w #4,d1 ; high of upper + move.w #256-1,d6 +.loop + moveq.l #$f,d3 + and.w d6,d3 ; low of lower + move.w d6,d4 + lsr.w #4,d4 ; high of lower + + sub.w d0,d3 ; calc lower dist + bpl.s .noflip1 + neg.w d3 +.noflip1 + sub.w d1,d4 ; calc upper dist + bpl.s .noflip2 + neg.w d4 +.noflip2 + cmp.w d4,d3 + bgt.s .takelow + neg.w d4 + move.b d4,-(a0) + dbra d6,.loop + dbra d7,.oloop + PUTMSG 10,<"%d: pd_DiffTable done">,fw_FrameCounterLong(a6) + rts +.takelow + move.b d3,-(a0) + dbra d6,.loop + dbra d7,.oloop + rts + +;-------------------------------------------------------------------- + +vgb_init_mod40_table: + lea pd_Mod40TablePos(a6),a0 + PUTMSG 10,<"%d: pd_Mod40TablePos %p">,fw_FrameCounterLong(a6),a0 + move.l a0,a1 + move.w #(VGBARS_WIDTH/8)*VGBARS_PLANES,d2 + moveq.l #0,d0 + moveq.l #0,d1 + move.w #VGBARS_HEIGHT-1,d7 +.loop + move.w d0,(a0)+ + add.w d2,d0 + sub.w d2,d1 + move.w d1,-(a1) + dbra d7,.loop + PUTMSG 10,<"%d: pd_Mod40TablePos done">,fw_FrameCounterLong(a6) + rts + +;-------------------------------------------------------------------- + +vgb_intro: + move.w #250,pd_PartCountDown(a6) + CALLFW SetBlitterQueueSingleFrame + + bsr vgb_load_cat_sprites + + CALLFW VSyncWithTask + + lea .script(pc),a0 + CALLFW InstallMusicScript + + move.w fw_MusicFrameCount(a6),d0 + moveq.l #4*6,d2 + move.w d2,pd_BeatSize(a6) + move.w d0,d1 + divu d2,d0 + swap d0 + sub.w d0,d1 + add.w d2,d1 + move.w d1,pd_NextBeatFrame(a6) + + move.w #0,pd_Angle(a6) + move.w #0,pd_LastAngle(a6) +.loop +; ----------- Frame 1 + bsr vgb_flip_db_frame + bsr vgb_flip_intro_copper_frame + + bsr vgb_check_beat + CALLFW CheckMusicScript + bsr vgb_update_cat_sprite + + move.l pd_ChunkyHamPtr(a6),a0 + lea 96(a0),a0 + move.l pd_LastChunkyResultPtr(a6),a1 + lea 96*2(a1),a1 + move.w #4*(BARLINE_WIDTH/8)+96/8+((BARLINE_WIDTH-NUM_CHUNKY_PIXELS)/2)/8,d0 + moveq.l #(VGBARS_WIDTH/16)-1,d7 + bsr vgb_calc_ham_pixels + + move.l pd_ChunkyHamPtr(a6),a0 + lea 96(a0),a0 + move.l pd_CurrPlanesPtr(a6),a1 + lea ((BARLINE_WIDTH-NUM_CHUNKY_PIXELS)/2+96)/8(a1),a1 + lea (BARLINE_WIDTH/8)(a1),a2 + lea (BARLINE_WIDTH/8)(a2),a3 + lea (BARLINE_WIDTH/8)(a3),a4 + moveq.l #(VGBARS_WIDTH/16)-1,d7 + bsr vgb_c2p_line + + bsr vgb_create_intro_copperlist + bsr vgb_update_copper_list_pointers + + CALLFW VSyncWithTask + +; ----------- Frame 2 + + bsr vgb_flip_intro_copper_frame + + bsr vgb_check_beat + CALLFW CheckMusicScript + bsr vgb_update_cat_sprite + + lea pd_BQBuffer(a6),a4 + bsr vgb_blitter_saturate_and_merge_320 + TERMINATE_BLITTER_QUEUE + + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + bsr vgb_calc_intro_bar_pos + bsr vgb_calc_realtime_bar_data + bsr vgb_draw_realtime_bars ; draws bars with current angle + bsr vgb_fade_in_bars + + CALLFW JoinBlitterQueue ; now the saturate is ready for left edge fixing + + bsr vgb_create_intro_copperlist + bsr vgb_update_copper_list_pointers + + CALLFW VSyncWithTask + + subq.w #1,pd_PartCountDown(a6) + bne .loop + + rts + +.script + dc.w 1200+36*6,.move_cat_up-* + dc.w 1200+47*6,.changebeatto3syncope-* + dc.w 1200+53*6,.changebeatto2syncope-* + dc.w 1200+55*6,.changebeatto8syncope-* + dc.w 1200+36*6+1+((CAT_HEIGHT)*128)/125,.stop_cat-* + dc.w 1200+60*6,.changebeattonormal-* + dc.w 1584,.move_cat_down-* + dc.w 1584+1+((CAT_HEIGHT/2)*128)/125,.stop_and_kill_cat-* + dc.w 0 + +.changebeatto3syncope + move.w #3*6,pd_BeatSize(a6) + rts + +.changebeatto2syncope + move.w #2*6,pd_BeatSize(a6) + rts + +.changebeatto8syncope + move.w #8*6,pd_BeatSize(a6) + rts + +.changebeattonormal + move.w #4*6,pd_BeatSize(a6) + rts + +.move_cat_up + clr.w pd_OverlayKilled(a6) + move.w #-1,pd_OverlayYDir(a6) + rts + +.stop_and_kill_cat + st pd_OverlayKilled(a6) + +.stop_cat + clr.w pd_OverlayYDir(a6) + rts + +.move_cat_down + move.w #2,pd_OverlayYDir(a6) + rts + +;-------------------------------------------------------------------- + +vgb_main: + CALLFW SetBlitterQueueSingleFrame + + bsr vgb_load_aold_sprites + + lea .script(pc),a0 + CALLFW InstallMusicScript + +.loop +; ----------- Frame 1 + bsr vgb_flip_db_frame + bsr vgb_flip_copper_frame + + bsr vgb_check_beat + CALLFW CheckMusicScript + + bsr vgb_update_aold_sprite + + move.l pd_ChunkyHamPtr(a6),a0 + move.l pd_LastChunkyResultPtr(a6),a1 + move.w #4*(BARLINE_WIDTH/8)+((BARLINE_WIDTH-NUM_CHUNKY_PIXELS)/2)/8,d0 + moveq.l #(NUM_CHUNKY_PIXELS/16)-1,d7 + bsr vgb_calc_ham_pixels + + move.l pd_ChunkyHamPtr(a6),a0 + move.l pd_CurrPlanesPtr(a6),a1 + lea ((BARLINE_WIDTH-NUM_CHUNKY_PIXELS)/2)/8(a1),a1 + lea (BARLINE_WIDTH/8)(a1),a2 + lea (BARLINE_WIDTH/8)(a2),a3 + lea (BARLINE_WIDTH/8)(a3),a4 + moveq.l #(NUM_CHUNKY_PIXELS/16)-1,d7 + bsr vgb_c2p_line + + bsr vgb_calc_new_angle + bsr vgb_fix_left_edge + + lea pd_BQBuffer(a6),a4 + bsr vgb_blitter_update_skew_and_left_edge + TERMINATE_BLITTER_QUEUE + + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + CALLFW JoinBlitterQueue + + bsr vgb_update_skew_to_copperlist + bsr vgb_update_copper_list_pointers + + CALLFW VSyncWithTask + +; ----------- Frame 2 + + bsr vgb_flip_copper_frame + bsr vgb_calc_new_angle + + bsr vgb_check_beat + CALLFW CheckMusicScript + + bsr vgb_update_aold_sprite + + lea pd_BQBuffer(a6),a4 + bsr vgb_blitter_saturate_and_merge + TERMINATE_BLITTER_QUEUE + + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + bsr vgb_calc_bar_pos + bsr vgb_draw_precalced_bars ; draws bars with current angle + + CALLFW JoinBlitterQueue ; now the saturate is ready for left edge fixing + + bsr vgb_fix_left_edge + + lea pd_BQBuffer(a6),a4 + bsr vgb_blitter_update_skew_and_left_edge ; prior angle image is done + TERMINATE_BLITTER_QUEUE + + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + bsr vgb_update_skew_to_copperlist + + CALLFW JoinBlitterQueue + + bsr vgb_update_copper_list_pointers + + ;PUTMSG 10,<"Alt frame"> + CALLFW VSyncWithTask + + cmp.w #2736-8*6,fw_MusicFrameCount(a6) + blt.s .noinvert + PUTMSG 20,<"%d: Flipping!">,fw_MusicFrameCount-2(a6) + st pd_DecAngleWidth(a6) +.noinvert + cmp.w #3120,fw_MusicFrameCount(a6) + blt .loop + + rts + +.script + dc.w 1968,.move_overlay_left-* + dc.w 1968+32*6,.stop_overlay-* + dc.w 2352,.move_overlay_down-* + dc.w 2352+32*6,.stop_and_kill_overlay-* + dc.w 0 + +.move_overlay_left + clr.w pd_OverlayKilled(a6) + move.w #-1,pd_OverlayXDir(a6) + rts + +.stop_and_kill_overlay + st pd_OverlayKilled(a6) + +.stop_overlay + clr.l pd_OverlayXDir(a6) + rts + +.move_overlay_down + move.w #1,pd_OverlayYDir(a6) + rts + +;-------------------------------------------------------------------- + +vgb_wobble: + CALLFW SetBlitterQueueSingleFrame + + bsr vgb_load_light_break_sprites + + move.w #$6000,pd_HistorySub(a6) + move.w #8,pd_BeatZoom(a6) + + lea .script(pc),a0 + CALLFW InstallMusicScript + +; ----------- Frame 1 + bsr vgb_flip_history_frame + bsr vgb_flip_copper_frame + + CALLFW CheckMusicScript + bsr vgb_update_wobble_sprite + + move.l pd_ChunkyHamPtr(a6),a0 + lea 96(a0),a0 + move.l pd_LastChunkyResultPtr(a6),a1 + lea 96*2(a1),a1 + move.w #4*(VGBARS_WIDTH/8),d0 + moveq.l #(VGBARS_WIDTH/16)-1,d7 + bsr vgb_calc_ham_pixels_wobble + + move.l pd_ChunkyHamPtr(a6),a0 + lea 96(a0),a0 + move.l pd_CurrPlanesPtr(a6),a1 + lea (VGBARS_WIDTH/8)(a1),a2 + lea (VGBARS_WIDTH/8)(a2),a3 + lea (VGBARS_WIDTH/8)(a3),a4 + + moveq.l #(VGBARS_WIDTH/16)-1,d7 + bsr vgb_c2p_line + + bsr vgb_create_wobble_copperlist + bsr vgb_update_copper_list_pointers + + CALLFW VSyncWithTask + +; ----------- Frame 2 + + bsr vgb_flip_copper_frame + + CALLFW CheckMusicScript + bsr vgb_update_wobble_sprite + + lea pd_BQBuffer(a6),a4 + bsr vgb_blitter_saturate_and_merge_320 + TERMINATE_BLITTER_QUEUE + + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + bsr vgb_calc_intro_bar_pos + bsr vgb_calc_realtime_bar_data + bsr vgb_draw_realtime_bars ; draws bars with current angle + ;bsr vgb_draw_precalced_bars ; draws bars with current angle + + CALLFW JoinBlitterQueue + + bsr vgb_create_wobble_copperlist + bsr vgb_update_copper_list_pointers + + CALLFW VSyncWithTask + +.loop +; ----------- Frame 1 + bsr vgb_flip_history_frame + bsr vgb_flip_copper_frame + + CALLFW CheckMusicScript + bsr vgb_update_wobble_sprite + + moveq.l #0,d5 + bsr vgb_calc_wobble + + lea pd_BQBuffer(a6),a4 + bsr vgb_blitter_update_wobble_modulos + TERMINATE_BLITTER_QUEUE + + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + move.l pd_ChunkyHamPtr(a6),a0 + lea 96(a0),a0 + move.l pd_LastChunkyResultPtr(a6),a1 + lea 96*2(a1),a1 + move.w #4*(VGBARS_WIDTH/8),d0 + moveq.l #(VGBARS_WIDTH/16)-1,d7 + bsr vgb_calc_ham_pixels_wobble + + move.l pd_ChunkyHamPtr(a6),a0 + lea 96(a0),a0 + move.l pd_CurrPlanesPtr(a6),a1 + lea (VGBARS_WIDTH/8)(a1),a2 + lea (VGBARS_WIDTH/8)(a2),a3 + lea (VGBARS_WIDTH/8)(a3),a4 + + moveq.l #(VGBARS_WIDTH/16)-1,d7 + bsr vgb_c2p_line + + CALLFW JoinBlitterQueue + + bsr vgb_update_wobble_offset_to_copperlist + bsr vgb_update_copper_list_pointers + + CALLFW VSyncWithTask + +; ----------- Frame 2 + + bsr vgb_flip_copper_frame + + CALLFW CheckMusicScript + bsr vgb_update_wobble_sprite + + lea pd_BQBuffer(a6),a4 + bsr vgb_blitter_saturate_and_merge_320 + TERMINATE_BLITTER_QUEUE + + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + bsr vgb_calc_intro_bar_pos + bsr vgb_calc_realtime_bar_data + + moveq.l #1,d5 + bsr vgb_calc_wobble + + bsr vgb_fade_fancy_bars + CALLFW JoinBlitterQueue + + lea pd_BQBuffer(a6),a4 + bsr vgb_blitter_update_wobble_modulos + TERMINATE_BLITTER_QUEUE + + BLTWAIT + lea pd_BQBuffer(a6),a0 + CALLFW TriggerCustomBlitterQueue + + bsr vgb_draw_realtime_bars ; draws bars with current angle + ;bsr vgb_draw_precalced_bars ; draws bars with current angle + + CALLFW JoinBlitterQueue + + bsr vgb_update_wobble_offset_to_copperlist + bsr vgb_update_copper_list_pointers + + CALLFW VSyncWithTask + + cmp.w #3504+28*6,fw_MusicFrameCount(a6) + blt.s .nofadeout + st pd_FadeOutWobble(a6) + move.w #4,pd_BeatZoom(a6) +.nofadeout + cmp.w #3888-4*6,fw_MusicFrameCount(a6) + blt.s .loop + + rts + +.script + dc.w 3120+32*6,.move_overlay_right-* + dc.w 3120+56*6,.stop_overlay-* + dc.w 3504,vgb_load_stay_broken_sprites-* + dc.w 3504,vgb_load_stay_broken_sprites-* + dc.w 3504+32*6,.move_overlay_left-* + dc.w 3504+56*6,.stop_and_kill_overlay-* + dc.w 0 + +.move_overlay_right + clr.w pd_OverlayKilled(a6) + move.w #1,pd_OverlayXDir(a6) + rts + +.stop_and_kill_overlay + st pd_OverlayKilled(a6) + +.stop_overlay + clr.l pd_OverlayXDir(a6) + rts + +.move_overlay_left + move.w #-1,pd_OverlayXDir(a6) + rts + +;-------------------------------------------------------------------- + +vgb_flip_db_frame: + move.l pd_CurrChunkyPtr(a6),pd_LastChunkyPtr(a6) + move.l pd_CurrChunkyResultPtr(a6),pd_LastChunkyResultPtr(a6) + not.b pd_DbToggle(a6) + beq.s .selb1 + move.l pd_DbBuffer(a6),a0 + lea (BARLINE_WIDTH/8)*VGBARS_PLANES(a0),a0 + move.l a0,pd_CurrPlanesPtr(a6) + move.l pd_ChunkyArray2Ptr(a6),pd_CurrChunkyPtr(a6) + move.l pd_ChunkyResultRGB2Ptr(a6),pd_CurrChunkyResultPtr(a6) + rts +.selb1 + move.l pd_DbBuffer(a6),pd_CurrPlanesPtr(a6) + move.l pd_ChunkyArray1Ptr(a6),pd_CurrChunkyPtr(a6) + move.l pd_ChunkyResultRGB1Ptr(a6),pd_CurrChunkyResultPtr(a6) + rts + +;-------------------------------------------------------------------- + +vgb_flip_history_frame: + move.l pd_CurrChunkyPtr(a6),pd_LastChunkyPtr(a6) + move.l pd_CurrChunkyResultPtr(a6),pd_LastChunkyResultPtr(a6) + + move.l pd_HistoryBuffer(a6),a0 + move.w pd_HistoryNum(a6),d0 + addq.w #2,d0 + and.w #(NUM_HISTORY_BUFS-1)*2,d0 + move.w d0,pd_HistoryNum(a6) + lea pd_Mod40TablePos(a6),a1 + adda.w (a1,d0.w),a0 + move.l a0,pd_CurrPlanesPtr(a6) + + not.b pd_DbToggle(a6) + beq.s .selb1 + move.l pd_ChunkyArray2Ptr(a6),pd_CurrChunkyPtr(a6) + move.l pd_ChunkyResultRGB2Ptr(a6),pd_CurrChunkyResultPtr(a6) + rts +.selb1 + move.l pd_ChunkyArray1Ptr(a6),pd_CurrChunkyPtr(a6) + move.l pd_ChunkyResultRGB1Ptr(a6),pd_CurrChunkyResultPtr(a6) + rts + +;-------------------------------------------------------------------- + +vgb_flip_copper_frame: + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + not.b pd_CopperToggle(a6) + beq.s .selb1 + move.l pd_CopperList2(a6),pd_CurrCopListPtr(a6) + rts +.selb1 + move.l pd_CopperList1(a6),pd_CurrCopListPtr(a6) + rts + +;-------------------------------------------------------------------- + +vgb_flip_intro_copper_frame: + move.l pd_CurrCopListPtr(a6),pd_LastCopListPtr(a6) + not.b pd_CopperToggle(a6) + beq.s .selb1 + move.l pd_IntroCopperList2(a6),pd_CurrCopListPtr(a6) + rts +.selb1 + move.l pd_IntroCopperList1(a6),pd_CurrCopListPtr(a6) + rts + +;-------------------------------------------------------------------- + +vgb_update_copper_list_pointers: + lea vgb_extra_copperlist_ptr+2,a0 + move.w pd_CurrCopListPtr(a6),(a0) + move.w pd_CurrCopListPtr+2(a6),4(a0) + move.w #copjmp2,6(a0) + rts + +;-------------------------------------------------------------------- + +vgb_clear_chunky_buffers: + BLTHOGON + BLTWAIT + BLTCON_SET D,0,0,0 + move.w #0,bltdmod(a5) + move.l pd_ChunkyArray1Ptr(a6),bltdpt(a5) + move.w #(17)|((NUM_CHUNKY_PIXELS)<<6),bltsize(a5) + rts + +;-------------------------------------------------------------------- + +vgb_fill_line_with_default: + move.l pd_CurrPlanesPtr(a6),a0 + moveq.l #((BARLINE_WIDTH&1023)>>4)|((1)<<6),d3 + BLTHOGON + BLTWAIT + BLTCON_SET D,255,0,0 + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + + REPT 5 + lea (BARLINE_WIDTH)/8(a0),a0 + BLTWAIT + BLTCON_SET D,0,0,0 + move.l a0,bltdpt(a5) + move.w d3,bltsize(a5) + ENDR + rts + +;-------------------------------------------------------------------- + +vgb_check_beat: + move.w fw_MusicFrameCount(a6),d0 + move.w pd_NextBeatFrame(a6),d1 + cmp.w d1,d0 + blt.s .nobeat + PUTMSG 10,<"Beat at %d/%d, next size %d">,d0,d1,pd_BeatSize-2(a6) + add.w pd_BeatSize(a6),d1 + move.w d1,pd_NextBeatFrame(a6) + move.w #16,pd_BeatZoom(a6) +.nop + rts +.nobeat move.w pd_BeatZoom(a6),d0 + beq.s .nop + subq.w #1,d0 + move.w d0,pd_BeatZoom(a6) + rts + +;-------------------------------------------------------------------- + +vgb_calc_new_angle: + tst.w pd_DecAngleWidth(a6) + beq.s .inc + move.w pd_AngleWidth(a6),d1 + beq.s .cont + subq.w #1,d1 + move.w d1,pd_AngleWidth(a6) + bra.s .cont +.inc + move.w pd_AngleWidth(a6),d1 + cmp.w #100*4,d1 + bge.s .noinc + addq.w #1,d1 + move.w d1,pd_AngleWidth(a6) +.noinc + +.cont + move.w pd_Angle(a6),pd_LastAngle(a6) + move.l fw_SinTable(a6),a2 + move.w pd_AnglePhase(a6),d0 + addq.w #7,d0 + move.w d0,pd_AnglePhase(a6) + and.w #1023*2,d0 + move.w (a2,d0.w),d0 + muls d1,d0 + swap d0 + add.w d0,d0 + ;moveq.l #0,d0 + move.w d0,pd_Angle(a6) + ;PUTMSG 10,<"Angle %d">,d0 + rts + +;-------------------------------------------------------------------- + +vgb_calc_bar_pos: + move.w #256,d6 + move.w pd_Angle(a6),d0 + beq.s .standardwidth + bpl.s .noneg + neg.w d0 +.noneg + ; xw = w / cos(a) + ; ci = m / xw = m / (w / cos(a)) = (m / w) * cos(a) + lea pd_CotTable(a6),a2 + move.w (a2,d0.w),d6 +.standardwidth + + move.l fw_SinTable(a6),a2 + moveq.l #NUM_BARS-1,d7 + lea pd_BarData(a6),a1 +.bloop movem.w bd_Phase(a1),d0-d4 + add.w d2,d0 ; bd_Phase += bd_PhaseSpeed + move.w d0,bd_Phase(a1) + lsr.w #2,d0 + and.w #1023*2,d0 + move.w (a2,d0.w),d0 + muls d3,d0 + swap d0 + add.w #(NUM_CHUNKY_PIXELS)/2,d0 + move.w d0,bd_CurrXPos(a1) + mulu d6,d1 + swap d1 + move.w d1,bd_CurrWidth(a1) + lea bd_SIZEOF(a1),a1 + dbra d7,.bloop + rts + +;-------------------------------------------------------------------- + +vgb_calc_intro_bar_pos: + move.l fw_SinTable(a6),a2 + moveq.l #NUM_BARS-1,d7 + lea pd_BarData(a6),a1 +.bloop movem.w bd_Phase(a1),d0-d4 + move.w bd_FadePos(a1),d6 + add.w d6,d6 + not.w d6 + add.w d2,d0 ; bd_Phase += bd_PhaseSpeed + move.w d0,bd_Phase(a1) + lsr.w #2,d0 + and.w #1023*2,d0 + move.w (a2,d0.w),d0 + muls d3,d0 + swap d0 + add.w #(NUM_CHUNKY_PIXELS)/2,d0 + move.w d0,bd_CurrXPos(a1) + mulu d6,d1 + swap d1 + lsr.w #8,d1 + add.w #BAR_WIDTH,d1 + move.w d1,bd_CurrWidth(a1) + lea bd_SIZEOF(a1),a1 + dbra d7,.bloop + rts + +;-------------------------------------------------------------------- + +vgb_fade_in_bars: + lea pd_BarData(a6),a1 + move.w #256,d1 + moveq.l #NUM_BARS-1,d7 +.bloop move.w bd_FadePos(a1),d0 + add.w d1,d0 + bvc.s .noover + move.w #$7fff,d0 +.noover + move.w d0,bd_FadePos(a1) + lea bd_SIZEOF(a1),a1 + dbra d7,.bloop + rts + +;-------------------------------------------------------------------- + +vgb_fade_fancy_bars: + lea pd_BarData(a6),a1 + move.l fw_SinTable(a6),a2 + moveq.l #NUM_BARS-1,d7 + tst.w pd_FadeOutWobble(a6) + bne.s .fadeout +.bloop move.w bd_Phase(a1),d0 + add.w bd_ColRed(a1),d0 + sub.w bd_ColBlue(a1),d0 + and.w #1023*2,d0 + move.w (a2,d0.w),d0 + asr.w #1,d0 + add.w #$5ffe,d0 + cmp.w #$7fff,bd_FadePos(a1) + bne.s .overwrite + cmp.w #$7c00,d0 + blt.s .wait +.overwrite + move.w d0,bd_FadePos(a1) +.wait + lea bd_SIZEOF(a1),a1 + dbra d7,.bloop + rts + +.fadeout +.floop move.w bd_FadePos(a1),d0 + sub.w #$200,d0 + bcc.s .nozero + moveq.l #0,d0 +.nozero + move.w d0,bd_FadePos(a1) + lea bd_SIZEOF(a1),a1 + dbra d7,.floop + rts + +;-------------------------------------------------------------------- + +vgb_draw_precalced_bars: + lea pd_BarData(a6),a3 + + moveq.l #NUM_BARS-1,d6 +.bloop movem.w bd_CurrXPos(a3),d0-d2 + add.w pd_BeatZoom(a6),d1 + bsr vgb_add_precalced_bar + lea bd_SIZEOF(a3),a3 + dbra d6,.bloop + rts + +;-------------------------------------------------------------------- + +vgb_calc_realtime_bar_data: + lea pd_BarData(a6),a3 + + moveq.l #NUM_BARS-1,d6 + moveq.l #0,d0 + subq.w #1,d0 +.bloop movem.w bd_ColRed(a3),d2-d5 + tst.w d5 + ble.s .skip + movem.w bd_CurrWidth(a3),d1 + add.w d5,d5 + mulu d5,d2 + lsr.l #4,d2 + mulu d5,d3 + lsr.l #4,d3 + mulu d5,d4 + lsr.l #4,d4 + divu d1,d2 + divu d1,d3 + divu d1,d4 + and.l d0,d2 + and.l d0,d3 + and.l d0,d4 + lsl.l #4,d2 + lsl.l #4,d3 + lsl.l #4,d4 + movem.l d2-d4,bd_IncRed(a3) +.skip + lea bd_SIZEOF(a3),a3 + dbra d6,.bloop + rts + +;-------------------------------------------------------------------- + +vgb_draw_realtime_bars: + lea pd_BarData(a6),a3 + + moveq.l #NUM_BARS-1,d6 +.bloop tst.w bd_FadePos(a3) + ble .skip + move.w bd_CurrXPos(a3),d0 + move.w bd_CurrWidth(a3),d1 + movem.l bd_IncRed(a3),d2-d4 + move.l pd_CurrChunkyPtr(a6),a1 + add.w d0,d0 + adda.w d0,a1 ; go to x center + + add.w pd_BeatZoom(a6),d1 + move.w d1,d7 + subq.w #1,d7 + + add.w d1,d1 + lea (a1,d1.w),a2 ; right + suba.w d1,a1 ; left + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #0,d5 +.loop add.l d2,d0 + add.l d3,d1 + add.l d4,d5 + swap d0 + swap d1 + swap d5 + add.w d0,-(a2) + add.w d5,2*NUM_CHUNKY_PIXELS*2(a1) + add.w d5,2*NUM_CHUNKY_PIXELS*2(a2) + add.w d1,1*NUM_CHUNKY_PIXELS*2(a1) + add.w d1,1*NUM_CHUNKY_PIXELS*2(a2) + add.w d0,(a1)+ + swap d0 + swap d1 + swap d5 + dbra d7,.loop +.skip + lea bd_SIZEOF(a3),a3 + dbra d6,.bloop + rts + +;-------------------------------------------------------------------- + +vgb_calc_wobble: + move.l pd_WobbleDataPtr(a6),a3 + lea vgb_wobble_table(pc),a1 + lea pd_Mod40TablePos(a6),a4 + + moveq.l #0,d4 + move.w pd_Wobble2Pos(a6),d4 + addq.w #7,d4 + move.w d4,pd_Wobble2Pos(a6) + and.w #$3fe,d4 + lea (a1,d4.w),a2 + + moveq.l #0,d4 + move.w pd_Wobble1Pos(a6),d4 + addq.w #2,d4 + move.w d4,pd_Wobble1Pos(a6) + and.w #$3fe,d4 + adda.w d4,a1 + + move.w #(NUM_HISTORY_BUFS-1)*2,d1 + moveq.l #0,d3 + move.w #VGBARS_HEIGHT-1,d7 + move.w pd_HistoryNum(a6),d4 + add.w d5,d4 + + moveq.l #(VGBARS_WIDTH/8),d6 + move.w pd_HistorySub(a6),d5 +.yloop + move.w (a1)+,d0 + lsr.w #1,d0 + add.w -(a2),d0 + sub.w d5,d0 + bpl.s .notrunc + moveq.l #0,d0 +.notrunc + move.w d0,-(sp) + move.w d4,d0 + sub.b (sp)+,d0 + and.w d1,d0 + + exg d3,d0 + sub.w d3,d0 + neg.w d0 + move.w (a4,d0.w),d0 + move.w d0,d2 + sub.w d6,d2 + move.w d2,(a3)+ + dbra d7,.yloop + + sub.w #$100,d5 + bcs.s .skipmax + move.w d5,pd_HistorySub(a6) +.skipmax + rts + +;-------------------------------------------------------------------- + +vgb_calc_skew: + moveq.l #(VGBARS_HEIGHT/2),d3 + move.w d3,d1 ; error term + add.w d3,d3 ; xDec + move.w d3,d7 + subq.w #1,d7 ; loop count + + lea vgb_xpos_table(pc),a3 + tst.w d0 + bpl.s .rotright + neg.w d0 + move.w (a3,d0.w),d2 + add.w d2,d2 ; xInc + move.w d2,d0 + +.lineloopleft + move.w d0,(a0)+ + sub.w d2,d1 + dble d7,.lineloopleft +.extraleft + subq.w #2,d0 + add.w d3,d1 + ble.s .extraleft + subq.w #1,d7 + bpl.s .lineloopleft + rts + +.rotright + move.w (a3,d0.w),d2 + add.w d2,d2 ; xInc + move.w d2,d0 + neg.w d0 + +.lineloopright + move.w d0,(a0)+ + sub.w d2,d1 + dble d7,.lineloopright +.extraright + addq.w #2,d0 + add.w d3,d1 + ble.s .extraright + subq.w #1,d7 + bpl.s .lineloopright + rts + +;-------------------------------------------------------------------- + +; o0 = 0 -> adr0 = 0, mod = -42 + 2 loopmod = -42 +; o1 = 2 -> adr0 = 2, mod = -42 +; o2 = 2 -> adr +; +vgb_calc_modshift: + move.w #((BARLINE_WIDTH-VGBARS_WIDTH)-1)*2,d3 + move.w #VGBARS_HEIGHT-1,d7 + moveq.l #0,d2 +.yloop + move.w #(BARLINE_WIDTH-VGBARS_WIDTH),d0 + add.w (a0)+,d0 + bpl.s .noclipleft + moveq.l #0,d0 +.noclipleft + cmp.w d3,d0 + ble.s .noclipright + move.w d3,d0 +.noclipright + asr.w #1,d0 + moveq.l #15,d1 + moveq.l #16,d4 + sub.w d0,d4 + and.w d1,d4 ; lower 4 bit + move.w d4,d5 + lsl.w #4,d5 + or.w d5,d4 + move.w d4,(a1)+ + + add.w d0,d1 + asr.w #4,d1 + add.w d1,d1 + ;subq.w #2,d1 + + moveq.l #-(VGBARS_WIDTH+16)/8,d6 + add.w d1,d6 + sub.w d2,d6 + move.w d1,d2 + move.w d6,(a1)+ + dbra d7,.yloop + rts + +;-------------------------------------------------------------------- + +vgb_add_precalced_bar: + move.w d1,d7 + lsr.w #1,d7 + subq.w #1,d7 + move.l pd_PreCalcedBarsPtr(a6),a0 + lsl.w #5,d2 ; log2(BAR_WIDTH) + sub.w #BAR_WIDTH,d1 + cmp.w #BAR_WIDTH,d1 + bge.s .ext2 + add.w d2,d1 + mulu #(2*BAR_WIDTH)*3*2,d1 + adda.l d1,a0 + move.l pd_CurrChunkyPtr(a6),a1 + add.w d0,d0 + adda.w d0,a1 ; go to x center + move.l a1,a2 +.nloop1 + movem.l (a0)+,d0-d5 + add.l d2,2*NUM_CHUNKY_PIXELS*2(a1) + add.l d1,1*NUM_CHUNKY_PIXELS*2(a1) + add.l d0,(a1)+ + swap d0 + swap d1 + swap d2 + add.l d0,-(a2) + add.l d1,1*NUM_CHUNKY_PIXELS*2(a2) + add.l d2,2*NUM_CHUNKY_PIXELS*2(a2) + dbra d7,.nloop2 + rts +.nloop2 + add.l d5,2*NUM_CHUNKY_PIXELS*2(a1) + add.l d4,1*NUM_CHUNKY_PIXELS*2(a1) + add.l d3,(a1)+ + swap d3 + swap d4 + swap d5 + add.l d3,-(a2) + add.l d4,1*NUM_CHUNKY_PIXELS*2(a2) + add.l d5,2*NUM_CHUNKY_PIXELS*2(a2) + dbra d7,.nloop1 + rts + +.ext2 + sub.w #BAR_WIDTH,d1 + lsr.w #1,d1 + lsr.w #1,d7 + add.w d2,d1 + mulu #(2*BAR_WIDTH)*3*2,d1 + adda.l d1,a0 + move.l pd_CurrChunkyPtr(a6),a1 + add.w d0,d0 + adda.w d0,a1 ; go to x center + move.l a1,a2 +.ex2loop1 + movem.l (a0)+,d0-d5 + add.l d2,2*NUM_CHUNKY_PIXELS*2(a1) + add.l d1,1*NUM_CHUNKY_PIXELS*2(a1) + add.l d0,(a1)+ + add.l d2,2*NUM_CHUNKY_PIXELS*2(a1) + add.l d1,1*NUM_CHUNKY_PIXELS*2(a1) + add.l d0,(a1)+ + + swap d0 + swap d1 + swap d2 + add.l d0,-(a2) + add.l d1,1*NUM_CHUNKY_PIXELS*2(a2) + add.l d2,2*NUM_CHUNKY_PIXELS*2(a2) + add.l d0,-(a2) + add.l d1,1*NUM_CHUNKY_PIXELS*2(a2) + add.l d2,2*NUM_CHUNKY_PIXELS*2(a2) + + dbra d7,.ex2loop3 + rts +.ex2loop3 + add.l d5,2*NUM_CHUNKY_PIXELS*2(a1) + add.l d4,1*NUM_CHUNKY_PIXELS*2(a1) + add.l d3,(a1)+ + add.l d5,2*NUM_CHUNKY_PIXELS*2(a1) + add.l d4,1*NUM_CHUNKY_PIXELS*2(a1) + add.l d3,(a1)+ + + swap d3 + swap d4 + swap d5 + add.l d3,-(a2) + add.l d4,1*NUM_CHUNKY_PIXELS*2(a2) + add.l d5,2*NUM_CHUNKY_PIXELS*2(a2) + add.l d3,-(a2) + add.l d4,1*NUM_CHUNKY_PIXELS*2(a2) + add.l d5,2*NUM_CHUNKY_PIXELS*2(a2) + dbra d7,.ex2loop1 + rts + +;-------------------------------------------------------------------- + +vgb_precalc_bars: + lea vgb_bars_colors(pc),a4 + move.l pd_PreCalcedBarsPtr(a6),a2 + moveq.l #NUM_BARS-1,d7 +.barloop + swap d7 + moveq.l #BAR_WIDTH-1,d6 +.wloop + move.w #BAR_WIDTH*2-1,d7 + sub.w d6,d7 + + moveq.l #0,d2 + subq.w #1,d2 + + movem.w (a4),d3-d5 + PUTMSG 40,<"RGB %lx %lx %lx">,d3,d4,d5 + swap d3 + swap d4 + swap d5 + + lsr.l #4,d3 + divu d7,d3 + and.l d2,d3 + lsl.l #4,d3 + + lsr.l #4,d4 + divu d7,d4 + and.l d2,d4 + lsl.l #4,d4 + + lsr.l #4,d5 + divu d7,d5 + and.l d2,d5 + lsl.l #4,d5 + + PUTMSG 40,<"%d: %lx %lx %lx">,d7,d3,d4,d5 + + addq.w #1,d7 + and.w #-2,d7 + move.w d7,d0 + add.w d0,d0 + add.w d7,d0 + add.w d0,d0 + lea (a2,d0.w),a1 + moveq.l #0,d0 + moveq.l #0,d1 + moveq.l #0,d2 + lsr.w #1,d7 + subq.w #1,d7 +.xloop + add.l d3,d0 + add.l d4,d1 + add.l d5,d2 + swap d0 + swap d1 + swap d2 + movem.l d0-d2,-(a1) + swap d0 + swap d1 + swap d2 + add.l d3,d0 + add.l d4,d1 + add.l d5,d2 + swap d0 + swap d1 + swap d2 + move.w d0,(a1) + move.w d1,4(a1) + move.w d2,8(a1) + swap d0 + swap d1 + swap d2 + dbra d7,.xloop + lea (2*BAR_WIDTH)*3*2(a2),a2 + dbra d6,.wloop + swap d7 + addq.l #6,a4 + dbra d7,.barloop + rts + +;-------------------------------------------------------------------- + +vgb_c2p_line: + move.l #$55555555,d3 + move.l #$33333333,d4 + move.l #$00ff00ff,d5 +.loop + move.l (a0)+,d0 + lsl.l #4,d0 + or.l (a0)+,d0 + move.l (a0)+,d1 + lsl.l #4,d1 + or.l (a0)+,d1 + +; a3a2a1a0e3e2e1e0 b3b2b1b0f3f2f1f0 c3c2c1c0g3g2g1g0 d3d2d1d0h3h2h1h0 +; i3i2i1i0m3m2m1m0 j3j2j1j0n3n2n1n0 k3k2k1k0o3o2o1o0 l3l2l1l0p3p2p1p0 + + move.l d1,d2 + lsr.l #8,d2 + eor.l d0,d2 + and.l d5,d2 + eor.l d2,d0 + lsl.l #8,d2 + eor.l d2,d1 + +; a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0 +; b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0 + + move.l d1,d2 + lsr.l #1,d2 + eor.l d0,d2 + and.l d3,d2 + eor.l d2,d0 + add.l d2,d2 + eor.l d2,d1 + +; a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 +; a2b2a0b0e2f2f0f0 i2j2i0j0m2n2m0n0 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0 + + move.w d1,d2 + move.w d0,d1 + swap d1 + move.w d1,d0 + move.w d2,d1 + +; a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 a2b2a0b0e2f2f0f0 i2j2i0j0m2n2m0n0 +; c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0 + + move.l d1,d2 + lsr.l #2,d2 + eor.l d0,d2 + and.l d4,d2 + eor.l d2,d0 + lsl.l #2,d2 + eor.l d2,d1 + +; a3b3c3d3e3f3g3h3 i3j3k3l3m3n3o3p3 a2b2c2d2e2f2g2h2 i2j2k2l2m2n2o2p2 +; a1b1c1d1e1f1g1h1 i1j1k1l1m1n1o1p1 a0b0c0d0e0f0g0h0 i0j0k0l0m0n0o0p0 + + move.w d1,(a1)+ + swap d1 + move.w d1,(a2)+ + move.w d0,(a3)+ + swap d0 + move.w d0,(a4)+ + + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +vgb_fix_left_edge: + move.l pd_XPosBufferPtr(a6),a2 + move.w pd_LastAngle(a6),d0 + bpl.s .noflip + neg.w d0 + add.w #((ROT_ANGLES-1)*2),d0 +.noflip mulu #(VGBARS_HEIGHT*2)/2,d0 + adda.l d0,a2 + + move.l pd_LastChunkyResultPtr(a6),a1 + ;lea ((BARLINE_WIDTH-NUM_CHUNKY_PIXELS)/2)*2-64*2(a1),a1 + ;FIXME offset or something else is wrong here + lea 96*2(a1),a1 + + move.l pd_ChunkyLeftEdgeRGBPtr(a6),a0 + moveq.l #(VGBARS_HEIGHT/12)-1,d7 +.loop + REPT 2 + movem.w (a2)+,d0-d5 + move.w (a1,d0.w),(a0)+ + move.w (a1,d1.w),(a0)+ + move.w (a1,d2.w),(a0)+ + move.w (a1,d3.w),(a0)+ + move.w (a1,d4.w),(a0)+ + move.w (a1,d5.w),(a0)+ + ENDR + dbra d7,.loop + rts + +;-------------------------------------------------------------------- + +vgb_calc_ham_pixels: + move.l pd_OneColorChangeTable(a6),a2 + move.l pd_DiffTable(a6),a3 + move.l pd_CurrPlanesPtr(a6),a4 + adda.w d0,a4 + moveq.l #$000,d0 ; last color + moveq.l #0,d3 +.xloop + moveq.l #16-1,d6 +.loop add.w d4,d4 + add.w d5,d5 + move.w (a1)+,d1 ; new color + eor.w d1,d0 + beq.s .setblue + moveq.l #0,d2 + move.b (a2,d0.w),d2 + jmp .jmptab(pc,d2.w) + +.setblue + move.w d1,d0 ; 4 + and.w #15,d1 ; 4 + move.b d1,(a0)+ ; 8 + addq.w #1,d4 ; 4 + ; 20 + dbra d6,.loop + bra .done + +.setgreen + move.w d1,d0 ; 4 + lsr.b #4,d1 ; 14 + move.b d1,(a0)+ ; 8 + addq.w #1,d4 ; 4 + addq.w #1,d5 ; 4 + ; 34 + dbra d6,.loop + bra .done + +.setred + move.w d1,d0 ; 4 + move.b -2(a1),(a0)+ ; 24 + addq.w #1,d5 ; 4 + ; 32 + dbra d6,.loop + bra .done + +.jmptab + bra.s .setblue ; 0 + bra.s .setblue ; 1 + bra.s .setgreen ; 2 + bra.s .pickgb ; 3 + bra.s .setred ; 4 + bra.s .pickrb ; 5 + bra.s .pickrg ; 6 +.slowpick ; 7 + eor.w d1,d0 + PUTMSG 50,<"Slow pick to %x from %x!>,d1,d0 + move.b d0,-(sp) + move.w (sp)+,d2 ; gbxx + move.b d1,d2 ; gbGB + tst.b (a3,d2.l) ; if delta green < delta blue -> positive + bpl.s .pickrb2 + bra.s .pickrg2 + +.pickgb + eor.w d1,d0 + move.b d0,-(sp) + move.w (sp)+,d2 ; gbxx + move.b d1,d2 ; gbGB + tst.b (a3,d2.l) ; if delta green < delta blue -> positive + bpl.s .prefblue +.prefgreen + and.w #$0f0,d1 + and.w #$f0f,d0 + or.w d1,d0 + lsr.b #4,d1 + move.b d1,(a0)+ + addq.w #1,d4 + addq.w #1,d5 + dbra d6,.loop + bra .done + +.pickrg + eor.w d1,d0 +.pickrg2 + move.w d0,d2 + lsl.w #4,d2 ; rg00 + move.w d1,d3 + lsr.w #4,d3 ; 00RG + move.b d3,d2 ; rgRG + tst.b (a3,d2.l) ; if delta red < delta green -> positive + bpl.s .prefgreen + bra.s .prefred + +.pickrb eor.w d1,d0 +.pickrb2 + move.l pd_RedBlueTable(a6),a3 + move.b (a3,d0.w),-(sp) + move.w (sp)+,d2 ; rbxx + move.b (a3,d1.w),d2 ; rbRB + move.l pd_DiffTable(a6),a3 + tst.b (a3,d2.l) ; if delta red < delta blue -> positive + bpl.s .prefblue +.prefred + IF 1 + move.w d1,-(sp) ; 8 + move.b d0,1(sp) ; 12 + move.w (sp),d0 ; 8 + move.b (sp)+,(a0)+ ; 20 + ; 48 + ELSE + and.w #$f00,d1 ; 8 + and.w #$0ff,d0 ; 8 + or.w d1,d0 ; 4 + move.w d1,-(sp) ; 8 + move.b (sp)+,(a0)+ ; 20 + ; 48 + ENDC + addq.w #1,d5 + dbra d6,.loop + bra .done + +.prefblue + and.w #$00f,d1 ; 8 + and.w #$ff0,d0 ; 8 + or.w d1,d0 ; 4 + move.b d1,(a0)+ ; 8 + ; 28 + addq.w #1,d4 + dbra d6,.loop + +.done + move.w d5,1*(BARLINE_WIDTH/8)(a4) + move.w d4,(a4)+ + dbra d7,.xloop + rts + +;-------------------------------------------------------------------- + +vgb_calc_ham_pixels_wobble: + move.l pd_OneColorChangeTable(a6),a2 + move.l pd_DiffTable(a6),a3 + move.l pd_CurrPlanesPtr(a6),a4 + adda.w d0,a4 + moveq.l #$000,d0 ; last color + moveq.l #0,d3 +.xloop + moveq.l #16-1,d6 +.loop add.w d4,d4 + add.w d5,d5 + move.w (a1)+,d1 ; new color + eor.w d1,d0 + beq.s .setblue + moveq.l #0,d2 + move.b (a2,d0.w),d2 + jmp .jmptab(pc,d2.w) + +.setblue + move.w d1,d0 ; 4 + and.w #15,d1 ; 4 + move.b d1,(a0)+ ; 8 + addq.w #1,d4 ; 4 + ; 20 + dbra d6,.loop + bra .done + +.setgreen + move.w d1,d0 ; 4 + lsr.b #4,d1 ; 14 + move.b d1,(a0)+ ; 8 + addq.w #1,d4 ; 4 + addq.w #1,d5 ; 4 + ; 34 + dbra d6,.loop + bra .done + +.setred + move.w d1,d0 ; 4 + move.b -2(a1),(a0)+ ; 24 + addq.w #1,d5 ; 4 + ; 32 + dbra d6,.loop + bra .done + +.jmptab + bra.s .setblue ; 0 + bra.s .setblue ; 1 + bra.s .setgreen ; 2 + bra.s .pickgb ; 3 + bra.s .setred ; 4 + bra.s .pickrb ; 5 + bra.s .pickrg ; 6 +.slowpick ; 7 + eor.w d1,d0 + PUTMSG 50,<"Slow pick to %x from %x!>,d1,d0 + move.b d0,-(sp) + move.w (sp)+,d2 ; gbxx + move.b d1,d2 ; gbGB + tst.b (a3,d2.l) ; if delta green < delta blue -> positive + bpl.s .pickrb2 + bra.s .pickrg2 + +.pickgb + eor.w d1,d0 + move.b d0,-(sp) + move.w (sp)+,d2 ; gbxx + move.b d1,d2 ; gbGB + tst.b (a3,d2.l) ; if delta green < delta blue -> positive + bpl.s .prefblue +.prefgreen + and.w #$0f0,d1 + and.w #$f0f,d0 + or.w d1,d0 + lsr.b #4,d1 + move.b d1,(a0)+ + addq.w #1,d4 + addq.w #1,d5 + dbra d6,.loop + bra .done + +.pickrg + eor.w d1,d0 +.pickrg2 + move.w d0,d2 + lsl.w #4,d2 ; rg00 + move.w d1,d3 + lsr.w #4,d3 ; 00RG + move.b d3,d2 ; rgRG + tst.b (a3,d2.l) ; if delta red < delta green -> positive + bpl.s .prefgreen + bra.s .prefred + +.pickrb eor.w d1,d0 +.pickrb2 + move.l pd_RedBlueTable(a6),a3 + move.b (a3,d0.w),-(sp) + move.w (sp)+,d2 ; rbxx + move.b (a3,d1.w),d2 ; rbRB + move.l pd_DiffTable(a6),a3 + tst.b (a3,d2.l) ; if delta red < delta blue -> positive + bpl.s .prefblue +.prefred + move.w d1,-(sp) ; 8 + move.b d0,1(sp) ; 12 + move.w (sp),d0 ; 8 + move.b (sp)+,(a0)+ ; 20 + ; 48 + addq.w #1,d5 + dbra d6,.loop + bra .done + +.prefblue + and.w #$00f,d1 ; 8 + and.w #$ff0,d0 ; 8 + or.w d1,d0 ; 4 + move.b d1,(a0)+ ; 8 + ; 28 + addq.w #1,d4 + dbra d6,.loop + +.done + move.w d5,1*(VGBARS_WIDTH/8)(a4) + move.w d4,(a4)+ + dbra d7,.xloop + rts + +;-------------------------------------------------------------------- + +vgb_create_intro_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + lea pd_OverlaySprites(a6),a1 + move.w #sprpt,d1 + moveq.l #8*2-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + + COPIMOVE $6a00,bplcon0 + COPIMOVE 0,bplcon1 + COPIMOVE $0038,ddfstrt + COPIMOVE (-VGBARS_WIDTH)/8,bpl1mod + COPIMOVE (-VGBARS_WIDTH)/8,bpl2mod + + move.l pd_CurrPlanesPtr(a6),a1 + lea ((BARLINE_WIDTH-VGBARS_WIDTH)/2)/8(a1),a1 + moveq.l #VGBARS_PLANES-1,d7 + move.w #bplpt,d1 +.bplloop + move.l a1,d0 + swap d0 + move.w d1,(a0)+ + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + move.w a1,(a0)+ + addq.w #2,d1 + + lea (BARLINE_WIDTH)/8(a1),a1 + dbra d7,.bplloop + + moveq.l #-2,d3 + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +vgb_create_wobble_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + + lea pd_OverlaySprites(a6),a1 + move.w #sprpt,d1 + moveq.l #8*2-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + + COPIMOVE $6a00,bplcon0 + COPIMOVE 0,bplcon1 + COPIMOVE $0038,ddfstrt + + move.l a0,d1 + sub.l a2,d1 + addq.w #2,d1 + move.w d1,pd_CopperBplOffset(a6) + + move.l pd_CurrPlanesPtr(a6),a1 + moveq.l #VGBARS_PLANES-1,d7 + move.w #bplpt,d1 +.bplloop + move.l a1,d0 + swap d0 + move.w d1,(a0)+ + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + move.w a1,(a0)+ + addq.w #2,d1 + + lea (VGBARS_WIDTH/8)(a1),a1 + dbra d7,.bplloop + + move.l a0,d1 + sub.l a2,d1 + add.w #8+2,d1 + move.w d1,pd_CopperSkewOffset(a6) + + moveq.l #-2,d3 + move.w #$5137,d0 + move.w #$100,d2 + move.w #VGBARS_HEIGHT-1,d7 + move.w #-VGBARS_WIDTH/8,d4 +.yloop move.w d0,d1 + move.b #$df,d1 + move.w d1,(a0)+ + move.w d3,(a0)+ + + add.w d2,d0 + move.w d0,(a0)+ + move.w d3,(a0)+ + + COPRMOVE d4,bpl1mod + COPRMOVE d4,bpl2mod + dbra d7,.yloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +vgb_create_main_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + move.l a0,a2 + + move.l pd_CurrPlanesPtr(a6),a1 + moveq.l #VGBARS_PLANES-1,d7 + move.w #bplpt,d1 +.bplloop + move.l a1,d0 + swap d0 + move.w d1,(a0)+ + move.w d0,(a0)+ + addq.w #2,d1 + + move.w d1,(a0)+ + move.w a1,(a0)+ + addq.w #2,d1 + + lea (BARLINE_WIDTH)/8(a1),a1 + dbra d7,.bplloop + + COPIMOVE $6a00,bplcon0 + + lea pd_OverlaySprites(a6),a1 + move.w #sprpt,d1 + moveq.l #8*2-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + COPIMOVE DMAF_SETCLR|DMAF_SPRITE,dmacon ; enable sprite dma + + move.l a0,d1 + sub.l a2,d1 + addq.w #4+2,d1 + move.w d1,pd_CopperSkewOffset(a6) + + moveq.l #-2,d3 + move.w #$51d5,d0 + move.w #$100,d2 + move.w #VGBARS_HEIGHT-1,d7 +.cprloop + move.w d0,(a0)+ + move.w d3,(a0)+ + + COPIMOVE (-VGBARS_WIDTH-16)/8,bpl1mod + COPIMOVE (-VGBARS_WIDTH-16)/8,bpl2mod + COPIMOVE 0,bplcon1 + + add.w d2,d0 + move.w d0,d1 + move.b #$3b,d1 + move.w d1,(a0)+ + move.w d3,(a0)+ + COPIMOVE $000,color + COPIMOVE $000,color + + dbra d7,.cprloop + + move.l d3,(a0)+ + rts + +;-------------------------------------------------------------------- + +vgb_load_cat_sprites: + lea vgb_cat_sprite_palette(pc),a1 + lea color+17*2(a5),a0 + moveq.l #15-1,d7 +.catpalloop + move.w (a1)+,(a0)+ + dbra d7,.catpalloop + + lea pd_OverlaySprites(a6),a1 + lea vgb_cat_sprite,a3 + move.l a3,a2 + moveq.l #(CAT_WIDTH/16)*2-1,d7 +.sprloop2 + move.l a3,a0 + adda.w (a2)+,a0 + move.l d0,(a0) + move.l a0,(a1)+ + dbra d7,.sprloop2 + + move.w #VGBARS_WIDTH-CAT_WIDTH-2,pd_OverlayXPos(a6) + move.w #VGBARS_HEIGHT,pd_OverlayYPos(a6) + clr.l pd_OverlayXDir(a6) + st pd_OverlayKilled(a6) + + rts + +;-------------------------------------------------------------------- + +vgb_update_cat_sprite: + lea pd_OverlaySprites(a6),a2 + + moveq.l #0,d0 + moveq.l #0,d1 + tst.w pd_OverlayKilled(a6) + bne.s .filldata + + move.w pd_OverlayXPos(a6),d4 + move.w pd_OverlayYPos(a6),d1 + add.w pd_OverlayYDir(a6),d1 + move.w d1,pd_OverlayYPos(a6) + + add.w #128,d4 + add.w #$52,d1 + + move.w d1,d2 + add.w #CAT_HEIGHT,d2 + moveq.l #0,d0 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d0,d0 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d0,d0 ; ev8 + lsr.w #1,d4 ; sh8-sh1 in d4 + addx.w d0,d0 ; sh0 + or.w d2,d0 ; ev7-ev0, sv8, ev8, sh0 in d0 + move.b d4,d1 ; sv7-sv0, sh8-sh1 in d4 + tas d0 ; att TAS sets bit 7 +.filldata + REPT (CAT_WIDTH/16) + move.l (a2)+,a0 + move.w d1,(a0)+ + move.w d0,(a0)+ + move.l (a2)+,a0 + move.w d1,(a0)+ + move.w d0,(a0)+ + addq.w #8,d1 + ENDR + rts + +;-------------------------------------------------------------------- + +vgb_load_aold_sprites: + move.w #$ddd,color+17*2(a5) + move.w #$fff,color+21*2(a5) + move.w #$eee,color+25*2(a5) + ;move.w #$888,d0 + ;move.w d0,color+18*2(a5) + ;move.w d0,color+22*2(a5) + ;move.w d0,color+26*2(a5) + ;move.w d0,color+30*2(a5) + moveq.l #0,d0 + move.w d0,color+19*2(a5) + move.w d0,color+23*2(a5) + move.w d0,color+27*2(a5) + + lea pd_OverlaySprites(a6),a1 + lea vgb_add_of_light_div_sprite,a3 + move.l a3,a2 + moveq.l #(AOLD_WIDTH/16)-1,d7 +.sprloop2 + move.l a3,a0 + adda.w (a2)+,a0 + move.l d0,(a0) + move.l a0,(a1)+ + dbra d7,.sprloop2 + + move.l fw_EmptySprite(a6),(a1)+ + move.l fw_EmptySprite(a6),(a1)+ + + move.w #VGBARS_WIDTH,pd_OverlayXPos(a6) + move.w #VGBARS_HEIGHT-AOLD_HEIGHT-1,pd_OverlayYPos(a6) + clr.l pd_OverlayXDir(a6) + st pd_OverlayKilled(a6) + rts + +;-------------------------------------------------------------------- + +vgb_update_aold_sprite: + lea pd_OverlaySprites(a6),a2 + + moveq.l #0,d0 + moveq.l #0,d1 + tst.w pd_OverlayKilled(a6) + bne.s .filldata + + move.w pd_OverlayXPos(a6),d4 + add.w pd_OverlayXDir(a6),d4 + move.w d4,pd_OverlayXPos(a6) + move.w pd_OverlayYPos(a6),d1 + add.w pd_OverlayYDir(a6),d1 + move.w d1,pd_OverlayYPos(a6) + + add.w #128,d4 + add.w #$52,d1 + + move.w d1,d2 + add.w #AOLD_HEIGHT,d2 + moveq.l #0,d0 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d0,d0 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d0,d0 ; ev8 + lsr.w #1,d4 ; sh8-sh1 in d4 + addx.w d0,d0 ; sh0 + or.w d2,d0 ; ev7-ev0, sv8, ev8, sh0 in d0 + move.b d4,d1 ; sv7-sv0, sh8-sh1 in d4 + ;tas d0 ; att TAS sets bit 7 +.filldata + REPT (AOLD_WIDTH/16) + move.l (a2)+,a0 + move.w d1,(a0)+ + move.w d0,(a0)+ + addq.w #8,d1 + ENDR + rts + +;-------------------------------------------------------------------- + +vgb_load_light_break_sprites: + move.w #$999,color+17*2(a5) + move.w #$bbb,color+21*2(a5) + move.w #$ddd,color+25*2(a5) + move.w #$fff,color+29*2(a5) + move.w #$888,d0 + move.w d0,color+18*2(a5) + move.w d0,color+22*2(a5) + move.w d0,color+26*2(a5) + move.w d0,color+30*2(a5) + moveq.l #0,d0 + move.w d0,color+19*2(a5) + move.w d0,color+23*2(a5) + move.w d0,color+27*2(a5) + move.w d0,color+31*2(a5) + + lea pd_OverlaySprites(a6),a1 + lea vgb_light_break_sprite,a3 + move.l a3,a2 + moveq.l #(LIGHTBREAK_WIDTH/16)-1,d7 +.sprloop2 + move.l a3,a0 + adda.w (a2)+,a0 + move.l d0,(a0) + move.l a0,(a1)+ + dbra d7,.sprloop2 + + move.w #-LIGHTBREAK_WIDTH,pd_OverlayXPos(a6) + move.w #1,pd_OverlayYPos(a6) + clr.l pd_OverlayXDir(a6) + st pd_OverlayKilled(a6) + rts + +;-------------------------------------------------------------------- + +vgb_load_stay_broken_sprites: + move.w #$fff,color+17*2(a5) + move.w #$ddd,color+21*2(a5) + move.w #$bbb,color+25*2(a5) + move.w #$999,color+29*2(a5) + lea pd_OverlaySprites(a6),a1 + lea vgb_stay_broken_sprite,a3 + move.l a3,a2 + moveq.l #(STAYBROKEN_WIDTH/16)-1,d7 +.sprloop2 + move.l a3,a0 + adda.w (a2)+,a0 + move.l d0,(a0) + move.l a0,(a1)+ + dbra d7,.sprloop2 + + move.l pd_CurrCopListPtr(a6),a0 + lea pd_OverlaySprites(a6),a1 + move.w #sprpt,d1 + moveq.l #8*2-1,d7 +.sprloop + move.w d1,(a0)+ + move.w (a1)+,(a0)+ + addq.w #2,d1 + dbra d7,.sprloop + + rts + +;-------------------------------------------------------------------- + +vgb_update_wobble_sprite: + lea pd_OverlaySprites(a6),a2 + + moveq.l #0,d0 + moveq.l #0,d1 + tst.w pd_OverlayKilled(a6) + bne.s .filldata + + move.w pd_OverlayXPos(a6),d4 + add.w pd_OverlayXDir(a6),d4 + move.w d4,pd_OverlayXPos(a6) + move.w pd_OverlayYPos(a6),d1 + add.w pd_OverlayYDir(a6),d1 + move.w d1,pd_OverlayYPos(a6) + + add.w #128,d4 + add.w #$52,d1 + + move.w d1,d2 + add.w #LIGHTBREAK_HEIGHT,d2 + moveq.l #0,d0 + + lsl.w #8,d1 ; sv7-sv0 in d1 + addx.w d0,d0 ; sv8 + lsl.w #8,d2 ; ev7-ev0 in d2 + addx.w d0,d0 ; ev8 + lsr.w #1,d4 ; sh8-sh1 in d4 + addx.w d0,d0 ; sh0 + or.w d2,d0 ; ev7-ev0, sv8, ev8, sh0 in d0 + move.b d4,d1 ; sv7-sv0, sh8-sh1 in d4 + ;tas d0 ; att TAS sets bit 7 +.filldata + REPT (LIGHTBREAK_WIDTH/16) + move.l (a2)+,a0 + move.w d1,(a0)+ + move.w d0,(a0)+ + addq.w #8,d1 + ENDR + rts + +;-------------------------------------------------------------------- + +vgb_update_wobble_offset_to_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + adda.w pd_CopperBplOffset(a6),a0 + + move.l pd_WobbleDataPtr(a6),a3 + move.l pd_HistoryBuffer(a6),a1 + adda.w (a3)+,a1 + move.l a1,d0 + moveq.l #(VGBARS_WIDTH/8),d1 + moveq.l #VGBARS_PLANES-1,d7 +.bplloop + add.l d1,d0 + swap d0 + move.w d0,(a0) + swap d0 + move.w d0,4(a0) + addq.l #8,a0 + dbra d7,.bplloop + rts + +;-------------------------------------------------------------------- + +vgb_update_skew_to_copperlist: + move.l pd_CurrCopListPtr(a6),a0 + addq.w #2,a0 + + move.l pd_CurrPlanesPtr(a6),a1 + lea ((BARLINE_WIDTH-VGBARS_WIDTH)/2)/8-4(a1),a1 + adda.w pd_FirstLineOffset(a6),a1 + moveq.l #VGBARS_PLANES-1,d7 + move.w #bplpt,d1 +.bplloop + move.l a1,d0 + swap d0 + move.w d0,(a0) + move.w a1,4(a0) + addq.w #8,a0 + + lea (BARLINE_WIDTH)/8(a1),a1 + dbra d7,.bplloop + rts + +;-------------------------------------------------------------------- + +vgb_blitter_update_wobble_modulos: + move.l pd_WobbleDataPtr(a6),a2 + addq.w #2,a2 + move.l pd_CurrCopListPtr(a6),a0 + adda.w pd_CopperSkewOffset(a6),a0 + + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy,(a4)+ + move.l a2,(a4)+ + move.l a0,(a4)+ + + addq.l #4,a0 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_copy_more,(a4)+ + move.l a2,(a4)+ + move.l a0,(a4)+ + rts + +.bq_copy + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(0<<16)|(COP_WOBBLE_INST_PER_LINE*4-2),bltamod(a5) ; and bltdmod +.bq_copy_more + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w #(1|((VGBARS_HEIGHT-1)<<6)),(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +vgb_blitter_update_skew_and_left_edge: + move.l pd_ModShiftDataPtr(a6),a2 + move.w pd_LastAngle(a6),d0 + bpl.s .noflip + neg.w d0 + add.w #((ROT_ANGLES-1)*2),d0 +.noflip mulu #MODSHIFT_SIZE/2,d0 + adda.l d0,a2 + + move.w 2(a2),pd_FirstLineOffset(a6) + + move.l pd_CurrCopListPtr(a6),a0 + adda.w pd_CopperSkewOffset(a6),a0 + + addq.w #8,a0 + + SAFE_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy,(a4)+ + move.l a2,(a4)+ + move.l a0,(a4)+ + move.w #(1|(VGBARS_HEIGHT<<6)),(a4)+ + + addq.w #6,a2 + subq.w #4,a0 + move.w #(1|((VGBARS_HEIGHT-1)<<6)),d3 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_more,(a4)+ + move.l a2,(a4)+ + move.l a0,(a4)+ + move.w d3,(a4)+ + + subq.w #4,a0 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_copy_more,(a4)+ + move.l a2,(a4)+ + move.l a0,(a4)+ + move.w d3,(a4)+ + + lea 16(a0),a0 + + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_copy_edge,(a4)+ + move.l pd_ChunkyLeftEdgeRGBPtr(a6),(a4)+ + move.l a0,(a4)+ + move.w #(1|(VGBARS_HEIGHT<<6)),(a4)+ + rts + +.bq_copy + BLTHOGOFF + BLTCON_SET AD,BLT_A,0,0 + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + move.l #(2<<16)|(COP_INST_PER_LINE*4-2),bltamod(a5) ; and bltdmod +.bq_copy_more + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_copy_edge + move.w #0,bltamod(a5) + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +;-------------------------------------------------------------------- + +vgb_blitter_saturate_and_merge: + move.l pd_LastChunkyPtr(a6),a2 + move.l pd_ChunkySatPtr(a6),a1 + lea ((NUM_CHUNKY_PIXELS*3))*2-2(a2),a2 + lea ((NUM_CHUNKY_PIXELS*3))*2(a1),a1 + move.w #(1|(NUM_CHUNKY_PIXELS<<6)),d3 + + FIRST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_saturate_all,(a4)+ + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 2 + lea -NUM_CHUNKY_PIXELS*2(a2),a2 + lea -NUM_CHUNKY_PIXELS*2(a1),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_saturate_more,(a4)+ + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + move.l pd_LastChunkyPtr(a6),a0 + move.l pd_ChunkyResultRPtr(a6),a1 + move.l pd_ChunkySatRPtr(a6),a2 + addq.l #2,a0 + addq.l #2,a2 + + ;move.w #(1)|((NUM_CHUNKY_PIXELS)<<6),d3 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_extract_rgb,(a4)+ + move.l #((BLTEN_ABD+(((BLT_A|BLT_B)&BLT_C)&$ff))<<16)|(12<<28)|(12<<12),(a4)+ + move.w #$0f00,(a4)+ ; bltcdat + move.l a2,(a4)+ ; bltbpt + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea NUM_CHUNKY_PIXELS*2-2(a0),a0 + move.l pd_ChunkyResultGPtr(a6),a1 + move.l pd_ChunkySatGPtr(a6),a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_extract_rgb,(a4)+ + move.l #((BLTEN_ABD+(((BLT_A|BLT_B)&BLT_C)&$ff))<<16)|(0<<28)|(0<<12),(a4)+ + move.w #$00f0,(a4)+ ; bltcdat + move.l a2,(a4)+ ; bltbpt + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea NUM_CHUNKY_PIXELS*2(a0),a0 + move.l pd_ChunkyResultBPtr(a6),a1 + move.l pd_ChunkySatBPtr(a6),a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_extract_rgb,(a4)+ + move.l #((BLTEN_ABD+(((BLT_A|BLT_B)&BLT_C)&$ff))<<16)|(4<<28)|(4<<12),(a4)+ + move.w #$000f,(a4)+ ; bltcdat + move.l a2,(a4)+ ; bltbpt + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + ;move.w #(1)|((NUM_CHUNKY_PIXELS)<<6),d3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_merge_rgb,(a4)+ + move.l pd_ChunkyResultRPtr(a6),(a4)+ + move.l pd_ChunkyResultGPtr(a6),(a4)+ + move.l pd_ChunkyResultBPtr(a6),(a4)+ + move.l pd_CurrChunkyResultPtr(a6),(a4)+ + move.w d3,(a4)+ + + lea vgb_sudoku_dither(pc),a1 + move.w pd_SudokuDitherPos(a6),d0 + sub.w #9*2,d0 + bpl.s .noresetdither + moveq.l #2*9*2,d0 +.noresetdither + move.w d0,pd_SudokuDitherPos(a6) + adda.w d0,a1 + + move.w #(1)|((NUM_CHUNKY_PIXELS/3)<<6),d3 + move.w #(1)|(((NUM_CHUNKY_PIXELS+1)/3)<<6),d2 + + ; pixel 1, red + move.l pd_LastChunkyPtr(a6),a0 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d3,(a4)+ + + ; pixel 2, red + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 3, red + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 1, green + lea (NUM_CHUNKY_PIXELS-2)*2(a0),a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d3,(a4)+ + + ; pixel 2, green + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 3, green + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 1, blue + lea (NUM_CHUNKY_PIXELS-2)*2(a0),a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d3,(a4)+ + + ; pixel 2, blue + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 3, blue + addq.w #2,a0 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + rts + +.bq_saturate_all + BLTHOGOFF + BLTCON_SET_X AD,(BLT_A&BLT_C),8,0,BLTCON1F_DESC|BLTCON1F_IFE + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #0,d0 + move.l d0,bltcmod(a5) ; and bltbmod + move.l d0,bltamod(a5) ; and bltdmod + move.w #$0007,bltcdat(a5) +.bq_saturate_more + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_extract_rgb + lea bltcon0(a5),a1 + move.l (a0)+,(a1)+ ; bltcon0/bltcon1 + move.w (a0)+,bltcdat(a5) + addq.l #8,a1 + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_merge_rgb + BLTCON_SET ABCD,(BLT_A|BLT_B|BLT_C),0,0 + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_dither + BLTCON0_SET D,BLT_C,0 + move.w #4,bltdmod(a5) +.bq_dither_more + move.w (a0)+,bltcdat(a5) + move.l (a0)+,bltdpt(a5) + move.w (a0)+,bltsize(a5) + rts + +;-------------------------------------------------------------------- + +vgb_blitter_saturate_and_merge_320: + move.l pd_LastChunkyPtr(a6),a2 + move.l pd_ChunkySatPtr(a6),a1 + lea ((NUM_CHUNKY_PIXELS*3)-96)*2-2(a2),a2 + lea ((NUM_CHUNKY_PIXELS*3)-96)*2(a1),a1 + move.w #(1|((VGBARS_WIDTH)<<6)),d3 + + FIRST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_saturate_all,(a4)+ + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + REPT 2 + lea -NUM_CHUNKY_PIXELS*2(a2),a2 + lea -NUM_CHUNKY_PIXELS*2(a1),a1 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_saturate_more,(a4)+ + move.l a2,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + ENDR + + move.l pd_LastChunkyPtr(a6),a0 + move.l pd_ChunkyResultRPtr(a6),a1 + move.l pd_ChunkySatRPtr(a6),a2 + lea 96*2+2(a0),a0 + lea 96*2(a1),a1 + lea 96*2+2(a2),a2 + + ;move.w #(1)|((NUM_CHUNKY_PIXELS)<<6),d3 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_extract_rgb,(a4)+ + move.l #((BLTEN_ABD+(((BLT_A|BLT_B)&BLT_C)&$ff))<<16)|(12<<28)|(12<<12),(a4)+ + move.w #$0f00,(a4)+ ; bltcdat + move.l a2,(a4)+ ; bltbpt + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea NUM_CHUNKY_PIXELS*2-2(a0),a0 + move.l pd_ChunkyResultGPtr(a6),a1 + move.l pd_ChunkySatGPtr(a6),a2 + lea 96*2(a1),a1 + lea 96*2(a2),a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_extract_rgb,(a4)+ + move.l #((BLTEN_ABD+(((BLT_A|BLT_B)&BLT_C)&$ff))<<16)|(0<<28)|(0<<12),(a4)+ + move.w #$00f0,(a4)+ ; bltcdat + move.l a2,(a4)+ ; bltbpt + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + lea NUM_CHUNKY_PIXELS*2(a0),a0 + move.l pd_ChunkyResultBPtr(a6),a1 + move.l pd_ChunkySatBPtr(a6),a2 + lea 96*2(a1),a1 + lea 96*2(a2),a2 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_extract_rgb,(a4)+ + move.l #((BLTEN_ABD+(((BLT_A|BLT_B)&BLT_C)&$ff))<<16)|(4<<28)|(4<<12),(a4)+ + move.w #$000f,(a4)+ ; bltcdat + move.l a2,(a4)+ ; bltbpt + move.l a0,(a4)+ ; bltapt + move.l a1,(a4)+ ; bltdpt + move.w d3,(a4)+ ; bltsize + + move.l pd_ChunkyResultRPtr(a6),a0 + move.l pd_ChunkyResultGPtr(a6),a1 + move.l pd_ChunkyResultBPtr(a6),a2 + lea 96*2(a0),a0 + lea 96*2(a1),a1 + lea 96*2(a2),a2 + ;move.w #(1)|((NUM_CHUNKY_PIXELS)<<6),d3 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_merge_rgb,(a4)+ + move.l a0,(a4)+ + move.l a1,(a4)+ + move.l a2,(a4)+ + move.l pd_CurrChunkyResultPtr(a6),a0 + lea 96*2(a0),a0 + move.l a0,(a4)+ + move.w d3,(a4)+ + + lea vgb_sudoku_dither(pc),a1 + move.w pd_SudokuDitherPos(a6),d0 + sub.w #9*2,d0 + bpl.s .noresetdither + moveq.l #2*9*2,d0 +.noresetdither + move.w d0,pd_SudokuDitherPos(a6) + adda.w d0,a1 + + move.w #(1)|(((VGBARS_WIDTH+3)/3)<<6),d3 + move.w #(1)|(((VGBARS_WIDTH+4)/3)<<6),d2 + + ; pixel 1, red + move.l pd_LastChunkyPtr(a6),a0 + lea 96*2(a0),a0 + + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d3,(a4)+ + + ; pixel 2, red + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 3, red + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 1, green + lea (NUM_CHUNKY_PIXELS-2)*2(a0),a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d3,(a4)+ + + ; pixel 2, green + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 3, green + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 1, blue + lea (NUM_CHUNKY_PIXELS-2)*2(a0),a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d3,(a4)+ + + ; pixel 2, blue + addq.w #2,a0 + FAST_ADD_TO_BLITTER_QUEUE a4,a3 + addq.l #4,a4 + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + ; pixel 3, blue + addq.w #2,a0 + LAST_ADD_TO_BLITTER_QUEUE a4,a3 + clr.l (a4)+ + move.l #.bq_dither_more,(a4)+ + move.w (a1)+,(a4)+ + move.l a0,(a4)+ + move.w d2,(a4)+ + + rts + +.bq_saturate_all + BLTHOGOFF + BLTCON_SET_X AD,(BLT_A&BLT_C),8,0,BLTCON1F_DESC|BLTCON1F_IFE + moveq.l #-1,d0 + move.l d0,bltafwm(a5) + moveq.l #0,d0 + move.l d0,bltcmod(a5) ; and bltbmod + move.l d0,bltamod(a5) ; and bltdmod + move.w #$0007,bltcdat(a5) +.bq_saturate_more + lea bltapt(a5),a1 + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_extract_rgb + lea bltcon0(a5),a1 + move.l (a0)+,(a1)+ ; bltcon0/bltcon1 + move.w (a0)+,bltcdat(a5) + addq.l #8,a1 + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_merge_rgb + BLTCON_SET ABCD,(BLT_A|BLT_B|BLT_C),0,0 + lea bltcpt(a5),a1 + move.l (a0)+,(a1)+ ; bltcpt + move.l (a0)+,(a1)+ ; bltbpt + move.l (a0)+,(a1)+ ; bltapt + move.l (a0)+,(a1)+ ; bltdpt + move.w (a0)+,(a1)+ ; bltsize + rts + +.bq_dither + BLTCON0_SET D,BLT_C,0 + move.w #4,bltdmod(a5) +.bq_dither_more + move.w (a0)+,bltcdat(a5) + move.l (a0)+,bltdpt(a5) + move.w (a0)+,bltsize(a5) + rts + +;******************************************************************** + +vgb_sudoku_dither: + dc.w 5,8,1,7,9,2,3,6,4 + dc.w 6,7,2,8,4,3,5,9,1 + dc.w 4,3,9,6,5,1,7,8,2 + +vgb_bars_colors: + dc.w 130,190,240 + dc.w 230,60,150 + dc.w 120,50,10 + dc.w 10,100,70 + dc.w 150,200,30 + dc.w 10,120,50 + dc.w 80,20,130 + +vgb_bars_dists: + dc.w 130*4 + dc.w -80*4 + dc.w 90*4 + dc.w 100*4 + dc.w -140*4 + dc.w -40*4 + dc.w 150*4 + +vgb_xpos_table: + dc.w 0,1,3,4,6,7,9,11,12,14,15,17,18,20,22,23 + dc.w 25,27,28,30,32,33,35,37,38,40,42,44,45,47,49,51 + dc.w 53,54,56,58,60,62,64,66,68,70,72,74,76,78,81,83 + dc.w 85,87,90,92,94,97,99,102,105,107,110,113,116,118,121,124 + dc.w 128,131,134,137,141,144,148,152,155,159,164,168,172,177,181,186 + dc.w 191,196,202,207,213,219,225,232,239,246,254,262,270,279,288,298 + dc.w 309,320,331,344,357,372,387,404,421,441,462,485,511,538,570,604 + dc.w 643,687,737,795,862,942,1037,1154,1299,1486,1735,2083,2605,3475,5214,10429 + +vgb_cat_sprite_palette: + incbin "../data/virgillbars/PLT_Lolcat64x128x16.PAL" + + incbin "../data/virgillbars/curtainsine.bin" +vgb_wobble_table: + incbin "../data/virgillbars/curtainsine.bin" + incbin "../data/virgillbars/curtainsine.bin" + +;******************************************************************** + +;-------------------------------------------------------------------- + + section "vgb_copper",data,chip + +vgb_copperlist: + COP_MOVE dmacon,DMAF_BLITHOG ; disable blitter hogging to avoid interrupt latency + COP_MOVE diwstrt,$5281 ; window start + COP_MOVE diwstop,$06c1 ; window stop + COP_MOVE ddfstrt,$0030 ; bitplane start +vgb_ddfstop: + COP_MOVE ddfstop,$00d0 ; bitplane stop + + COP_MOVE bplcon3,$0c00 +vgb_fmode: + COP_MOVE fmode,$0000 ; fixes the aga modulo problem + + COP_MOVE color+0*2,$000 + COP_MOVE color+1*2,$000 + + COP_MOVE bplcon0,$0200 + COP_MOVE bplcon2,$0024 ; sprites in front + +vgb_extra_copperlist_ptr: + COP_MOVE cop2lc,0 + COP_MOVE cop2lc+2,0 + COP_MOVE $1fe,0 + COP_END + +vgb_cat_sprite: + incbin "../data/virgillbars/PLT_Lolcat64x128x16.ASP" + +vgb_add_of_light_div_sprite: + incbin "../data/virgillbars/additionsprite96x112x4.SPR" + +vgb_light_break_sprite: + incbin "../data/virgillbars/lightbreak128x128x4.SPR" + +vgb_stay_broken_sprite: + incbin "../data/virgillbars/staybroken128x128x4.SPR" + + IFND FW_DEMO_PART + IFD ENABLE_PART_MUSIC + section "part_music_samples",data,chip ; section for music playback +part_music_smp: + incbin "../data/music/dsr_68k_tune_2_v11.lsbank" + + section "part_music_data",data ; section for music playback +part_music_data: + incbin "../data/music/dsr_68k_tune_2_v11.lsmusic" + ENDC + ENDC + END \ No newline at end of file diff --git a/source/winuae/Roms/place_kickroms_here.txt b/source/winuae/Roms/place_kickroms_here.txt new file mode 100644 index 0000000..3a328be --- /dev/null +++ b/source/winuae/Roms/place_kickroms_here.txt @@ -0,0 +1,5 @@ +The configs expect the following rom files in this directory: + +- Kick13.rom +- Kick20.rom +- Kick31.rom diff --git a/source/winuae/configs/a1200_hrt.uae b/source/winuae/configs/a1200_hrt.uae new file mode 100644 index 0000000..c48ea48 --- /dev/null +++ b/source/winuae/configs/a1200_hrt.uae @@ -0,0 +1,749 @@ +config_description= +config_hardware=true +config_host=true +config_version=4.5.0 +config_hardware_path= +config_host_path= +config_all_path= +ksmirror=e0 +win32.rom_path=./ +win32.floppy_path=./ +win32.hardfile_path=./ +; host-specific +win32.middle_mouse=true +win32.logfile=true +win32.start_not_captured=true +win32.soundcard=0 +win32.soundcardname=WASAPI:Default Audio Device +win32.kbledmode=0 +; common +use_gui=no +use_debugger=false +kickstart_rom_file=.\roms\Kick31.rom +kickstart_rom_file_id=1483A091,KS ROM v3.1 (A1200) +kickstart_ext_rom_file= +pcmcia_mb_rom_file=:ENABLED +ide_mb_rom_file=:ENABLED +flash_file= +cart_file=:HRTMon +rtc_file= +kickshifter=false +floppy_volume=33 +floppy0= +floppy1= +floppy1type=-1 +floppy2= +floppy3= +nr_floppies=1 +floppy_speed=100 +cd_speed=100 +parallel_on_demand=false +serial_on_demand=false +serial_hardware_ctsrts=true +serial_direct=false +scsi=false +uaeserial=false +sana2=false +sound_output=exact +sound_channels=stereo +sound_stereo_separation=7 +sound_stereo_mixing_delay=0 +sound_max_buff=16384 +sound_frequency=44100 +sound_interpol=anti +sound_filter=emulated +sound_filter_type=standard +sound_volume=0 +sound_volume_paula=0 +sound_volume_cd=0 +sound_volume_ahi=0 +sound_volume_midi=0 +sound_volume_genlock=0 +sound_auto=true +sound_cdaudio=false +sound_stereo_swap_paula=false +sound_stereo_swap_ahi=false +comp_trustbyte=indirect +comp_trustword=indirect +comp_trustlong=indirect +comp_trustnaddr=indirect +comp_nf=true +comp_constjump=true +comp_flushmode=soft +compfpu=true +comp_catchfault=true +cachesize=0 +joyport0=mouse +joyport0autofire=none +joyportfriendlyname0=Windows mouse +joyportname0=WINMOUSE1 +joyport1=kbd1 +joyport1autofire=none +bsdsocket_emu=false +synchronize_clock=false +maprom=0x0 +parallel_postscript_emulation=false +parallel_postscript_detection=false +ghostscript_parameters= +parallel_autoflush=5 +gfx_display=0 +gfx_display_rtg=0 +gfx_framerate=1 +gfx_width=1508 +gfx_height=1152 +gfx_top_windowed=764 +gfx_left_windowed=1100 +gfx_width_windowed=1508 +gfx_height_windowed=1152 +gfx_width_fullscreen=1600 +gfx_height_fullscreen=1200 +gfx_refreshrate=0 +gfx_autoresolution=0 +gfx_autoresolution_vga=true +gfx_backbuffers=2 +gfx_backbuffers_rtg=1 +gfx_vsync=false +gfx_vsyncmode=normal +gfx_vsync_picasso=false +gfx_vsyncmode_picasso=normal +gfx_lores=false +gfx_resolution=hires +gfx_lores_mode=normal +gfx_flickerfixer=false +gfx_linemode=double +gfx_fullscreen_amiga=false +gfx_fullscreen_picasso=false +gfx_center_horizontal=none +gfx_center_vertical=none +gfx_colour_mode=32bit +gfx_blacker_than_black=false +gfx_api=direct3d11 +gfx_api_options=hardware +gfx_filter=no +gfx_filter_autoscale=max +immediate_blits=false +ntsc=false +genlock=false +chipset=aga +chipset_refreshrate=50.080410 +collision_level=playfields +chipset_compatible=A1200 +chipset_hacks=8 +rtc=none +ksmirror_a8=true +pcmcia=true +ide=a600/a1200 +fastmem_size=0 +debugmem_start=0x0 +debugmem_size=0 +mem25bit_size=0 +a3000mem_size=0 +mbresmem_size=0 +z3mem_size=0 +z3mem_start=0x40000000 +bogomem_size=0 +gfxcard_hardware_vblank=false +gfxcard_hardware_sprite=true +gfxcard_multithread=false +chipmem_size=4 +cpu_speed=real +cpu_throttle=0.0 +cpu_type=68ec020 +cpu_model=68020 +cpu_compatible=true +cpu_24bit_addressing=true +cpu_data_cache=false +cpu_multiplier=4 +cpu_cycle_exact=true +cpu_memory_cycle_exact=true +blitter_cycle_exact=true +cycle_exact=true +fpu_strict=false +rtg_nocustom=true +rtg_modes=0x212 +debug_mem=true +log_illegal_mem=true +kbd_lang=us +warp=true +filesystem2=rw,hd0:testhd:.\hd0,0 +uaehf0=dir,rw,hd0:testhd:.\hd0,0 +input.config=1 +input.joymouse_speed_analog=20 +input.joymouse_speed_digital=10 +input.joymouse_deadzone=33 +input.joystick_deadzone=33 +input.analog_joystick_multiplier=15 +input.analog_joystick_offset=-1 +input.mouse_speed=100 +input.autofire_speed=600 +input.autoswitch=1 +input.1.joystick.0.empty=false +input.1.joystick.0.disabled=false +input.1.joystick.0.axis.0=JOY1_HORIZ.0 +input.1.joystick.0.axis.1=JOY1_VERT.0 +input.1.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.1.empty=false +input.1.joystick.1.disabled=true +input.1.joystick.1.axis.0=JOY2_HORIZ.0 +input.1.joystick.1.axis.1=JOY2_VERT.0 +input.1.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.2.empty=false +input.1.joystick.2.disabled=true +input.1.joystick.2.axis.0=JOY1_HORIZ.0 +input.1.joystick.2.axis.1=JOY1_VERT.0 +input.1.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.3.empty=false +input.1.joystick.3.disabled=true +input.1.joystick.3.axis.0=JOY2_HORIZ.0 +input.1.joystick.3.axis.1=JOY2_VERT.0 +input.1.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.4.empty=false +input.1.joystick.4.disabled=true +input.1.joystick.4.axis.0=JOY1_HORIZ.0 +input.1.joystick.4.axis.1=JOY1_VERT.0 +input.1.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.5.empty=false +input.1.joystick.5.disabled=true +input.1.joystick.5.axis.0=JOY2_HORIZ.0 +input.1.joystick.5.axis.1=JOY2_VERT.0 +input.1.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.6.empty=false +input.1.joystick.6.disabled=true +input.1.joystick.6.axis.0=JOY1_HORIZ.0 +input.1.joystick.6.axis.1=JOY1_VERT.0 +input.1.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.7.empty=false +input.1.joystick.7.disabled=true +input.1.joystick.7.axis.0=JOY2_HORIZ.0 +input.1.joystick.7.axis.1=JOY2_VERT.0 +input.1.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.8.empty=true +input.1.joystick.9.empty=true +input.1.joystick.10.empty=true +input.1.joystick.11.empty=true +input.1.joystick.12.empty=true +input.1.joystick.13.empty=true +input.1.joystick.14.empty=true +input.1.joystick.15.empty=true +input.1.joystick.16.empty=true +input.1.joystick.17.empty=true +input.1.joystick.18.empty=true +input.1.joystick.19.empty=true +input.1.mouse.0.friendlyname=Windows mouse +input.1.mouse.0.name=WINMOUSE1 +input.1.mouse.0.empty=false +input.1.mouse.0.disabled=false +input.1.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.0.axis.1=MOUSE1_VERT.0 +input.1.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.1.friendlyname=HID-compliant mouse +input.1.mouse.1.name=\\?\HID#VID_203A&PID_FFFC&MI_01#7&2de99099&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.1.empty=true +input.1.mouse.2.friendlyname=Parallels Mouse Synchronization Device +input.1.mouse.2.name=\\?\ACPI#PNP0F03#4&1846b261&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.2.empty=true +input.1.mouse.3.friendlyname=Parallels USB Mouse Synchronization Device +input.1.mouse.3.name=\\?\HID#VID_203A&PID_FFFC&MI_00#7&37099d97&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.3.empty=true +input.1.mouse.4.empty=false +input.1.mouse.4.disabled=true +input.1.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.4.axis.1=MOUSE1_VERT.0 +input.1.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.5.empty=false +input.1.mouse.5.disabled=true +input.1.mouse.5.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.5.axis.1=MOUSE1_VERT.0 +input.1.mouse.5.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.5.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.5.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.5.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.5.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.5.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.6.empty=false +input.1.mouse.6.disabled=true +input.1.mouse.6.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.6.axis.1=MOUSE2_VERT.0 +input.1.mouse.6.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.6.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.6.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.7.empty=false +input.1.mouse.7.disabled=true +input.1.mouse.7.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.7.axis.1=MOUSE1_VERT.0 +input.1.mouse.7.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.7.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.7.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.7.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.7.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.7.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.8.empty=false +input.1.mouse.8.disabled=true +input.1.mouse.8.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.8.axis.1=MOUSE2_VERT.0 +input.1.mouse.8.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.8.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.8.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.9.empty=false +input.1.mouse.9.disabled=true +input.1.mouse.9.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.9.axis.1=MOUSE1_VERT.0 +input.1.mouse.9.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.9.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.9.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.9.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.9.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.9.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.10.empty=false +input.1.mouse.10.disabled=true +input.1.mouse.10.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.10.axis.1=MOUSE2_VERT.0 +input.1.mouse.10.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.10.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.10.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.11.empty=true +input.1.mouse.12.empty=true +input.1.mouse.13.empty=true +input.1.mouse.14.empty=true +input.1.mouse.15.empty=true +input.1.mouse.16.empty=true +input.1.mouse.17.empty=true +input.1.mouse.18.empty=true +input.1.mouse.19.empty=true +input.1.keyboard.0.friendlyname=WinUAE keyboard +input.1.keyboard.0.name=NULLKEYBOARD +input.1.keyboard.0.empty=false +input.1.keyboard.0.disabled=false +input.1.keyboard.0.button.103.KEY_66=SPC_PAUSE.0 +input.1.keyboard.0.button.104.KEY_67=SPC_SINGLESTEP.0 +input.1.keyboard.0.button.105.KEY_68=SPC_WARP.0 +input.1.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.1.keyboard.1.name=\\?\ACPI#PNP0303#4&1846b261&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.1.keyboard.1.empty=true +input.1.keyboard.2.empty=true +input.1.keyboard.3.empty=true +input.1.keyboard.4.empty=true +input.1.keyboard.5.empty=true +input.1.keyboard.6.empty=true +input.1.keyboard.7.empty=true +input.1.keyboard.8.empty=true +input.1.keyboard.9.empty=true +input.1.keyboard.10.empty=true +input.1.keyboard.11.empty=true +input.1.keyboard.12.empty=true +input.1.keyboard.13.empty=true +input.1.keyboard.14.empty=true +input.1.keyboard.15.empty=true +input.1.keyboard.16.empty=true +input.1.keyboard.17.empty=true +input.1.keyboard.18.empty=true +input.1.keyboard.19.empty=true +input.1.internal.0.friendlyname=Internal events +input.1.internal.0.name=INTERNALEVENTS1 +input.1.internal.0.empty=true +input.2.joystick.0.empty=false +input.2.joystick.0.disabled=false +input.2.joystick.0.axis.0=JOY1_HORIZ.0 +input.2.joystick.0.axis.1=JOY1_VERT.0 +input.2.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.1.empty=false +input.2.joystick.1.disabled=true +input.2.joystick.1.axis.0=JOY2_HORIZ.0 +input.2.joystick.1.axis.1=JOY2_VERT.0 +input.2.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.2.empty=false +input.2.joystick.2.disabled=true +input.2.joystick.2.axis.0=JOY1_HORIZ.0 +input.2.joystick.2.axis.1=JOY1_VERT.0 +input.2.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.3.empty=false +input.2.joystick.3.disabled=true +input.2.joystick.3.axis.0=JOY2_HORIZ.0 +input.2.joystick.3.axis.1=JOY2_VERT.0 +input.2.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.4.empty=false +input.2.joystick.4.disabled=true +input.2.joystick.4.axis.0=JOY1_HORIZ.0 +input.2.joystick.4.axis.1=JOY1_VERT.0 +input.2.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.5.empty=false +input.2.joystick.5.disabled=true +input.2.joystick.5.axis.0=JOY2_HORIZ.0 +input.2.joystick.5.axis.1=JOY2_VERT.0 +input.2.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.6.empty=false +input.2.joystick.6.disabled=true +input.2.joystick.6.axis.0=JOY1_HORIZ.0 +input.2.joystick.6.axis.1=JOY1_VERT.0 +input.2.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.7.empty=false +input.2.joystick.7.disabled=true +input.2.joystick.7.axis.0=JOY2_HORIZ.0 +input.2.joystick.7.axis.1=JOY2_VERT.0 +input.2.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.8.empty=true +input.2.joystick.9.empty=true +input.2.joystick.10.empty=true +input.2.joystick.11.empty=true +input.2.joystick.12.empty=true +input.2.joystick.13.empty=true +input.2.joystick.14.empty=true +input.2.joystick.15.empty=true +input.2.joystick.16.empty=true +input.2.joystick.17.empty=true +input.2.joystick.18.empty=true +input.2.joystick.19.empty=true +input.2.mouse.0.friendlyname=Windows mouse +input.2.mouse.0.name=WINMOUSE1 +input.2.mouse.0.empty=false +input.2.mouse.0.disabled=false +input.2.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.0.axis.1=MOUSE1_VERT.0 +input.2.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.1.friendlyname=HID-compliant mouse +input.2.mouse.1.name=\\?\HID#VID_203A&PID_FFFC&MI_01#7&2de99099&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.1.empty=true +input.2.mouse.2.friendlyname=Parallels Mouse Synchronization Device +input.2.mouse.2.name=\\?\ACPI#PNP0F03#4&1846b261&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.2.empty=true +input.2.mouse.3.friendlyname=Parallels USB Mouse Synchronization Device +input.2.mouse.3.name=\\?\HID#VID_203A&PID_FFFC&MI_00#7&37099d97&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.3.empty=true +input.2.mouse.4.empty=false +input.2.mouse.4.disabled=true +input.2.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.4.axis.1=MOUSE1_VERT.0 +input.2.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.5.empty=false +input.2.mouse.5.disabled=true +input.2.mouse.5.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.5.axis.1=MOUSE1_VERT.0 +input.2.mouse.5.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.5.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.5.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.5.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.5.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.5.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.6.empty=false +input.2.mouse.6.disabled=true +input.2.mouse.6.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.6.axis.1=MOUSE2_VERT.0 +input.2.mouse.6.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.6.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.6.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.7.empty=false +input.2.mouse.7.disabled=true +input.2.mouse.7.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.7.axis.1=MOUSE1_VERT.0 +input.2.mouse.7.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.7.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.7.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.7.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.7.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.7.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.8.empty=false +input.2.mouse.8.disabled=true +input.2.mouse.8.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.8.axis.1=MOUSE2_VERT.0 +input.2.mouse.8.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.8.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.8.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.9.empty=false +input.2.mouse.9.disabled=true +input.2.mouse.9.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.9.axis.1=MOUSE1_VERT.0 +input.2.mouse.9.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.9.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.9.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.9.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.9.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.9.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.10.empty=false +input.2.mouse.10.disabled=true +input.2.mouse.10.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.10.axis.1=MOUSE2_VERT.0 +input.2.mouse.10.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.10.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.10.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.11.empty=true +input.2.mouse.12.empty=true +input.2.mouse.13.empty=true +input.2.mouse.14.empty=true +input.2.mouse.15.empty=true +input.2.mouse.16.empty=true +input.2.mouse.17.empty=true +input.2.mouse.18.empty=true +input.2.mouse.19.empty=true +input.2.keyboard.0.friendlyname=WinUAE keyboard +input.2.keyboard.0.name=NULLKEYBOARD +input.2.keyboard.0.empty=false +input.2.keyboard.0.disabled=false +input.2.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.2.keyboard.1.name=\\?\ACPI#PNP0303#4&1846b261&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.2.keyboard.1.empty=true +input.2.keyboard.2.empty=true +input.2.keyboard.3.empty=true +input.2.keyboard.4.empty=true +input.2.keyboard.5.empty=true +input.2.keyboard.6.empty=true +input.2.keyboard.7.empty=true +input.2.keyboard.8.empty=true +input.2.keyboard.9.empty=true +input.2.keyboard.10.empty=true +input.2.keyboard.11.empty=true +input.2.keyboard.12.empty=true +input.2.keyboard.13.empty=true +input.2.keyboard.14.empty=true +input.2.keyboard.15.empty=true +input.2.keyboard.16.empty=true +input.2.keyboard.17.empty=true +input.2.keyboard.18.empty=true +input.2.keyboard.19.empty=true +input.2.internal.0.friendlyname=Internal events +input.2.internal.0.name=INTERNALEVENTS1 +input.2.internal.0.empty=true +input.3.joystick.0.empty=false +input.3.joystick.0.disabled=false +input.3.joystick.0.axis.0=JOY1_HORIZ.0 +input.3.joystick.0.axis.1=JOY1_VERT.0 +input.3.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.1.empty=false +input.3.joystick.1.disabled=true +input.3.joystick.1.axis.0=JOY2_HORIZ.0 +input.3.joystick.1.axis.1=JOY2_VERT.0 +input.3.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.2.empty=false +input.3.joystick.2.disabled=true +input.3.joystick.2.axis.0=JOY1_HORIZ.0 +input.3.joystick.2.axis.1=JOY1_VERT.0 +input.3.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.3.empty=false +input.3.joystick.3.disabled=true +input.3.joystick.3.axis.0=JOY2_HORIZ.0 +input.3.joystick.3.axis.1=JOY2_VERT.0 +input.3.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.4.empty=false +input.3.joystick.4.disabled=true +input.3.joystick.4.axis.0=JOY1_HORIZ.0 +input.3.joystick.4.axis.1=JOY1_VERT.0 +input.3.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.5.empty=false +input.3.joystick.5.disabled=true +input.3.joystick.5.axis.0=JOY2_HORIZ.0 +input.3.joystick.5.axis.1=JOY2_VERT.0 +input.3.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.6.empty=false +input.3.joystick.6.disabled=true +input.3.joystick.6.axis.0=JOY1_HORIZ.0 +input.3.joystick.6.axis.1=JOY1_VERT.0 +input.3.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.7.empty=false +input.3.joystick.7.disabled=true +input.3.joystick.7.axis.0=JOY2_HORIZ.0 +input.3.joystick.7.axis.1=JOY2_VERT.0 +input.3.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.8.empty=true +input.3.joystick.9.empty=true +input.3.joystick.10.empty=true +input.3.joystick.11.empty=true +input.3.joystick.12.empty=true +input.3.joystick.13.empty=true +input.3.joystick.14.empty=true +input.3.joystick.15.empty=true +input.3.joystick.16.empty=true +input.3.joystick.17.empty=true +input.3.joystick.18.empty=true +input.3.joystick.19.empty=true +input.3.mouse.0.friendlyname=Windows mouse +input.3.mouse.0.name=WINMOUSE1 +input.3.mouse.0.empty=false +input.3.mouse.0.disabled=false +input.3.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.0.axis.1=MOUSE1_VERT.0 +input.3.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.1.friendlyname=HID-compliant mouse +input.3.mouse.1.name=\\?\HID#VID_203A&PID_FFFC&MI_01#7&2de99099&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.1.empty=true +input.3.mouse.2.friendlyname=Parallels Mouse Synchronization Device +input.3.mouse.2.name=\\?\ACPI#PNP0F03#4&1846b261&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.2.empty=true +input.3.mouse.3.friendlyname=Parallels USB Mouse Synchronization Device +input.3.mouse.3.name=\\?\HID#VID_203A&PID_FFFC&MI_00#7&37099d97&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.3.empty=true +input.3.mouse.4.empty=false +input.3.mouse.4.disabled=true +input.3.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.4.axis.1=MOUSE1_VERT.0 +input.3.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.5.empty=false +input.3.mouse.5.disabled=true +input.3.mouse.5.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.5.axis.1=MOUSE1_VERT.0 +input.3.mouse.5.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.5.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.5.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.5.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.5.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.5.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.6.empty=false +input.3.mouse.6.disabled=true +input.3.mouse.6.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.6.axis.1=MOUSE2_VERT.0 +input.3.mouse.6.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.6.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.6.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.7.empty=false +input.3.mouse.7.disabled=true +input.3.mouse.7.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.7.axis.1=MOUSE1_VERT.0 +input.3.mouse.7.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.7.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.7.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.7.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.7.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.7.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.8.empty=false +input.3.mouse.8.disabled=true +input.3.mouse.8.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.8.axis.1=MOUSE2_VERT.0 +input.3.mouse.8.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.8.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.8.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.9.empty=false +input.3.mouse.9.disabled=true +input.3.mouse.9.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.9.axis.1=MOUSE1_VERT.0 +input.3.mouse.9.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.9.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.9.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.9.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.9.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.9.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.10.empty=false +input.3.mouse.10.disabled=true +input.3.mouse.10.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.10.axis.1=MOUSE2_VERT.0 +input.3.mouse.10.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.10.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.10.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.11.empty=true +input.3.mouse.12.empty=true +input.3.mouse.13.empty=true +input.3.mouse.14.empty=true +input.3.mouse.15.empty=true +input.3.mouse.16.empty=true +input.3.mouse.17.empty=true +input.3.mouse.18.empty=true +input.3.mouse.19.empty=true +input.3.keyboard.0.friendlyname=WinUAE keyboard +input.3.keyboard.0.name=NULLKEYBOARD +input.3.keyboard.0.empty=false +input.3.keyboard.0.disabled=false +input.3.keyboard.0.button.103.KEY_66=SPC_PAUSE.0 +input.3.keyboard.0.button.104.KEY_67=SPC_SINGLESTEP.0 +input.3.keyboard.0.button.105.KEY_68=SPC_WARP.0 +input.3.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.3.keyboard.1.name=\\?\ACPI#PNP0303#4&1846b261&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.3.keyboard.1.empty=true +input.3.keyboard.2.empty=true +input.3.keyboard.3.empty=true +input.3.keyboard.4.empty=true +input.3.keyboard.5.empty=true +input.3.keyboard.6.empty=true +input.3.keyboard.7.empty=true +input.3.keyboard.8.empty=true +input.3.keyboard.9.empty=true +input.3.keyboard.10.empty=true +input.3.keyboard.11.empty=true +input.3.keyboard.12.empty=true +input.3.keyboard.13.empty=true +input.3.keyboard.14.empty=true +input.3.keyboard.15.empty=true +input.3.keyboard.16.empty=true +input.3.keyboard.17.empty=true +input.3.keyboard.18.empty=true +input.3.keyboard.19.empty=true +input.3.internal.0.friendlyname=Internal events +input.3.internal.0.name=INTERNALEVENTS1 +input.3.internal.0.empty=true +input.4.keyboard.0.friendlyname=WinUAE keyboard +input.4.keyboard.0.name=NULLKEYBOARD +input.4.keyboard.0.custom=true diff --git a/source/winuae/configs/a500.uae b/source/winuae/configs/a500.uae new file mode 100755 index 0000000..9f12f95 --- /dev/null +++ b/source/winuae/configs/a500.uae @@ -0,0 +1,740 @@ +config_description= +config_hardware=true +config_host=true +config_version=4.5.0 +config_hardware_path= +config_host_path= +config_all_path= +ksmirror=e0 +win32.rom_path=./ +win32.floppy_path=./ +win32.hardfile_path=./ +; host-specific +win32.middle_mouse=true +win32.soundcard=0 +win32.soundcardname=WASAPI:Default Audio Device +win32.kbledmode=0 +; common +warp=true +use_gui=no +use_debugger=false +kickstart_rom_file=.\roms\Kick13.rom +kickstart_rom_file_id=C4F0F55F,KS ROM v1.3 (A500,A1000,A2000) +kickstart_ext_rom_file= +flash_file= +cart_file= +rtc_file= +kickshifter=false +floppy_volume=33 +floppy0= +floppy1= +floppy1type=-1 +floppy2= +floppy3= +nr_floppies=1 +floppy_speed=100 +cd_speed=100 +parallel_on_demand=false +serial_on_demand=false +serial_hardware_ctsrts=true +serial_direct=false +scsi=false +uaeserial=false +sana2=false +sound_output=exact +sound_channels=stereo +sound_stereo_separation=7 +sound_stereo_mixing_delay=0 +sound_max_buff=16384 +sound_frequency=44100 +sound_interpol=anti +sound_filter=emulated +sound_filter_type=standard +sound_volume=0 +sound_volume_paula=0 +sound_volume_cd=0 +sound_volume_ahi=0 +sound_volume_midi=0 +sound_volume_genlock=0 +sound_auto=true +sound_cdaudio=false +sound_stereo_swap_paula=false +sound_stereo_swap_ahi=false +comp_trustbyte=indirect +comp_trustword=indirect +comp_trustlong=indirect +comp_trustnaddr=indirect +comp_nf=true +comp_constjump=true +comp_flushmode=soft +compfpu=true +comp_catchfault=true +cachesize=0 +joyport0=mouse +joyport0autofire=none +joyportfriendlyname0=Windows mouse +joyportname0=WINMOUSE1 +joyport1=kbd1 +joyport1autofire=none +bsdsocket_emu=false +synchronize_clock=false +maprom=0x0 +parallel_postscript_emulation=false +parallel_postscript_detection=false +ghostscript_parameters= +parallel_autoflush=5 +gfx_display=0 +gfx_display_rtg=0 +gfx_framerate=1 +gfx_width=720 +gfx_height=568 +gfx_top_windowed=0 +gfx_left_windowed=31 +gfx_width_windowed=720 +gfx_height_windowed=568 +gfx_width_fullscreen=800 +gfx_height_fullscreen=600 +gfx_refreshrate=0 +gfx_autoresolution=0 +gfx_autoresolution_vga=true +gfx_backbuffers=2 +gfx_backbuffers_rtg=1 +gfx_vsync=false +gfx_vsyncmode=normal +gfx_vsync_picasso=false +gfx_vsyncmode_picasso=normal +gfx_lores=false +gfx_resolution=hires +gfx_lores_mode=normal +gfx_flickerfixer=false +gfx_linemode=double +gfx_fullscreen_amiga=false +gfx_fullscreen_picasso=false +gfx_center_horizontal=none +gfx_center_vertical=none +gfx_colour_mode=32bit +gfx_blacker_than_black=false +gfx_api=direct3d +gfx_api_options=hardware +gfx_filter=no +immediate_blits=false +waiting_blits=automatic +ntsc=false +genlock=false +chipset=ocs +chipset_refreshrate=49.920410 +collision_level=playfields +chipset_compatible=A500 +rtc=MSM6242B +resetwarning=false +cia_todbug=true +fastmem_size=0 +debugmem_start=0x0 +debugmem_size=0 +mem25bit_size=0 +a3000mem_size=0 +mbresmem_size=0 +z3mem_size=0 +z3mem_start=0x40000000 +bogomem_size=2 +gfxcard_hardware_vblank=false +gfxcard_hardware_sprite=true +gfxcard_multithread=false +chipmem_size=1 +cpu_speed=real +cpu_throttle=0.0 +cpu_type=68000 +cpu_model=68000 +cpu_compatible=true +cpu_24bit_addressing=true +cpu_data_cache=false +cpu_cycle_exact=true +cpu_memory_cycle_exact=true +blitter_cycle_exact=true +cycle_exact=true +fpu_strict=false +rtg_nocustom=true +rtg_modes=0x212 +debug_mem=true +log_illegal_mem=false +kbd_lang=us +filesystem2=rw,hd0:testhd:.\hd0,0 +uaehf0=dir,rw,hd0:testhd:.\hd0,0 +input.config=0 +input.joymouse_speed_analog=20 +input.joymouse_speed_digital=10 +input.joymouse_deadzone=33 +input.joystick_deadzone=33 +input.analog_joystick_multiplier=15 +input.analog_joystick_offset=-1 +input.mouse_speed=100 +input.autofire_speed=600 +input.autoswitch=1 +input.1.joystick.0.empty=false +input.1.joystick.0.disabled=false +input.1.joystick.0.axis.0=JOY1_HORIZ.0 +input.1.joystick.0.axis.1=JOY1_VERT.0 +input.1.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.1.empty=false +input.1.joystick.1.disabled=true +input.1.joystick.1.axis.0=JOY2_HORIZ.0 +input.1.joystick.1.axis.1=JOY2_VERT.0 +input.1.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.2.empty=false +input.1.joystick.2.disabled=true +input.1.joystick.2.axis.0=JOY1_HORIZ.0 +input.1.joystick.2.axis.1=JOY1_VERT.0 +input.1.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.3.empty=false +input.1.joystick.3.disabled=true +input.1.joystick.3.axis.0=JOY2_HORIZ.0 +input.1.joystick.3.axis.1=JOY2_VERT.0 +input.1.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.4.empty=false +input.1.joystick.4.disabled=true +input.1.joystick.4.axis.0=JOY1_HORIZ.0 +input.1.joystick.4.axis.1=JOY1_VERT.0 +input.1.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.5.empty=false +input.1.joystick.5.disabled=true +input.1.joystick.5.axis.0=JOY2_HORIZ.0 +input.1.joystick.5.axis.1=JOY2_VERT.0 +input.1.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.6.empty=false +input.1.joystick.6.disabled=true +input.1.joystick.6.axis.0=JOY1_HORIZ.0 +input.1.joystick.6.axis.1=JOY1_VERT.0 +input.1.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.7.empty=false +input.1.joystick.7.disabled=true +input.1.joystick.7.axis.0=JOY2_HORIZ.0 +input.1.joystick.7.axis.1=JOY2_VERT.0 +input.1.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.8.empty=true +input.1.joystick.9.empty=true +input.1.joystick.10.empty=true +input.1.joystick.11.empty=true +input.1.joystick.12.empty=true +input.1.joystick.13.empty=true +input.1.joystick.14.empty=true +input.1.joystick.15.empty=true +input.1.joystick.16.empty=true +input.1.joystick.17.empty=true +input.1.joystick.18.empty=true +input.1.joystick.19.empty=true +input.1.mouse.0.friendlyname=Windows mouse +input.1.mouse.0.name=WINMOUSE1 +input.1.mouse.0.empty=false +input.1.mouse.0.disabled=false +input.1.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.0.axis.1=MOUSE1_VERT.0 +input.1.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.1.friendlyname=HID-compliant mouse +input.1.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.1.empty=true +input.1.mouse.2.friendlyname=VMware Pointing Device +input.1.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.2.empty=true +input.1.mouse.3.friendlyname=VMware USB Pointing Device +input.1.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.3.empty=false +input.1.mouse.3.disabled=true +input.1.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.3.axis.1=MOUSE1_VERT.0 +input.1.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.4.empty=false +input.1.mouse.4.disabled=true +input.1.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.4.axis.1=MOUSE1_VERT.0 +input.1.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.5.empty=false +input.1.mouse.5.disabled=true +input.1.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.5.axis.1=MOUSE2_VERT.0 +input.1.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.6.empty=false +input.1.mouse.6.disabled=true +input.1.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.6.axis.1=MOUSE1_VERT.0 +input.1.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.7.empty=false +input.1.mouse.7.disabled=true +input.1.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.7.axis.1=MOUSE2_VERT.0 +input.1.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.8.empty=false +input.1.mouse.8.disabled=true +input.1.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.8.axis.1=MOUSE1_VERT.0 +input.1.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.9.empty=false +input.1.mouse.9.disabled=true +input.1.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.9.axis.1=MOUSE2_VERT.0 +input.1.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.10.empty=true +input.1.mouse.11.empty=true +input.1.mouse.12.empty=true +input.1.mouse.13.empty=true +input.1.mouse.14.empty=true +input.1.mouse.15.empty=true +input.1.mouse.16.empty=true +input.1.mouse.17.empty=true +input.1.mouse.18.empty=true +input.1.mouse.19.empty=true +input.1.keyboard.0.friendlyname=WinUAE keyboard +input.1.keyboard.0.name=NULLKEYBOARD +input.1.keyboard.0.empty=false +input.1.keyboard.0.disabled=false +input.1.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.1.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.1.keyboard.1.empty=true +input.1.keyboard.2.empty=true +input.1.keyboard.3.empty=true +input.1.keyboard.4.empty=true +input.1.keyboard.5.empty=true +input.1.keyboard.6.empty=true +input.1.keyboard.7.empty=true +input.1.keyboard.8.empty=true +input.1.keyboard.9.empty=true +input.1.keyboard.10.empty=true +input.1.keyboard.11.empty=true +input.1.keyboard.12.empty=true +input.1.keyboard.13.empty=true +input.1.keyboard.14.empty=true +input.1.keyboard.15.empty=true +input.1.keyboard.16.empty=true +input.1.keyboard.17.empty=true +input.1.keyboard.18.empty=true +input.1.keyboard.19.empty=true +input.1.internal.0.friendlyname=Internal events +input.1.internal.0.name=INTERNALEVENTS1 +input.1.internal.0.empty=true +input.1.internal.0.disabled=false +input.2.joystick.0.empty=false +input.2.joystick.0.disabled=false +input.2.joystick.0.axis.0=JOY1_HORIZ.0 +input.2.joystick.0.axis.1=JOY1_VERT.0 +input.2.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.1.empty=false +input.2.joystick.1.disabled=true +input.2.joystick.1.axis.0=JOY2_HORIZ.0 +input.2.joystick.1.axis.1=JOY2_VERT.0 +input.2.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.2.empty=false +input.2.joystick.2.disabled=true +input.2.joystick.2.axis.0=JOY1_HORIZ.0 +input.2.joystick.2.axis.1=JOY1_VERT.0 +input.2.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.3.empty=false +input.2.joystick.3.disabled=true +input.2.joystick.3.axis.0=JOY2_HORIZ.0 +input.2.joystick.3.axis.1=JOY2_VERT.0 +input.2.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.4.empty=false +input.2.joystick.4.disabled=true +input.2.joystick.4.axis.0=JOY1_HORIZ.0 +input.2.joystick.4.axis.1=JOY1_VERT.0 +input.2.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.5.empty=false +input.2.joystick.5.disabled=true +input.2.joystick.5.axis.0=JOY2_HORIZ.0 +input.2.joystick.5.axis.1=JOY2_VERT.0 +input.2.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.6.empty=false +input.2.joystick.6.disabled=true +input.2.joystick.6.axis.0=JOY1_HORIZ.0 +input.2.joystick.6.axis.1=JOY1_VERT.0 +input.2.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.7.empty=false +input.2.joystick.7.disabled=true +input.2.joystick.7.axis.0=JOY2_HORIZ.0 +input.2.joystick.7.axis.1=JOY2_VERT.0 +input.2.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.8.empty=true +input.2.joystick.9.empty=true +input.2.joystick.10.empty=true +input.2.joystick.11.empty=true +input.2.joystick.12.empty=true +input.2.joystick.13.empty=true +input.2.joystick.14.empty=true +input.2.joystick.15.empty=true +input.2.joystick.16.empty=true +input.2.joystick.17.empty=true +input.2.joystick.18.empty=true +input.2.joystick.19.empty=true +input.2.mouse.0.friendlyname=Windows mouse +input.2.mouse.0.name=WINMOUSE1 +input.2.mouse.0.empty=false +input.2.mouse.0.disabled=false +input.2.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.0.axis.1=MOUSE1_VERT.0 +input.2.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.1.friendlyname=HID-compliant mouse +input.2.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.1.empty=true +input.2.mouse.2.friendlyname=VMware Pointing Device +input.2.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.2.empty=true +input.2.mouse.3.friendlyname=VMware USB Pointing Device +input.2.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.3.empty=false +input.2.mouse.3.disabled=true +input.2.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.3.axis.1=MOUSE1_VERT.0 +input.2.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.4.empty=false +input.2.mouse.4.disabled=true +input.2.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.4.axis.1=MOUSE1_VERT.0 +input.2.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.5.empty=false +input.2.mouse.5.disabled=true +input.2.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.5.axis.1=MOUSE2_VERT.0 +input.2.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.6.empty=false +input.2.mouse.6.disabled=true +input.2.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.6.axis.1=MOUSE1_VERT.0 +input.2.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.7.empty=false +input.2.mouse.7.disabled=true +input.2.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.7.axis.1=MOUSE2_VERT.0 +input.2.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.8.empty=false +input.2.mouse.8.disabled=true +input.2.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.8.axis.1=MOUSE1_VERT.0 +input.2.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.9.empty=false +input.2.mouse.9.disabled=true +input.2.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.9.axis.1=MOUSE2_VERT.0 +input.2.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.10.empty=true +input.2.mouse.11.empty=true +input.2.mouse.12.empty=true +input.2.mouse.13.empty=true +input.2.mouse.14.empty=true +input.2.mouse.15.empty=true +input.2.mouse.16.empty=true +input.2.mouse.17.empty=true +input.2.mouse.18.empty=true +input.2.mouse.19.empty=true +input.2.keyboard.0.friendlyname=WinUAE keyboard +input.2.keyboard.0.name=NULLKEYBOARD +input.2.keyboard.0.empty=false +input.2.keyboard.0.disabled=false +input.2.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.2.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.2.keyboard.1.empty=true +input.2.keyboard.2.empty=true +input.2.keyboard.3.empty=true +input.2.keyboard.4.empty=true +input.2.keyboard.5.empty=true +input.2.keyboard.6.empty=true +input.2.keyboard.7.empty=true +input.2.keyboard.8.empty=true +input.2.keyboard.9.empty=true +input.2.keyboard.10.empty=true +input.2.keyboard.11.empty=true +input.2.keyboard.12.empty=true +input.2.keyboard.13.empty=true +input.2.keyboard.14.empty=true +input.2.keyboard.15.empty=true +input.2.keyboard.16.empty=true +input.2.keyboard.17.empty=true +input.2.keyboard.18.empty=true +input.2.keyboard.19.empty=true +input.2.internal.0.friendlyname=Internal events +input.2.internal.0.name=INTERNALEVENTS1 +input.2.internal.0.empty=true +input.3.joystick.0.empty=false +input.3.joystick.0.disabled=false +input.3.joystick.0.axis.0=JOY1_HORIZ.0 +input.3.joystick.0.axis.1=JOY1_VERT.0 +input.3.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.1.empty=false +input.3.joystick.1.disabled=true +input.3.joystick.1.axis.0=JOY2_HORIZ.0 +input.3.joystick.1.axis.1=JOY2_VERT.0 +input.3.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.2.empty=false +input.3.joystick.2.disabled=true +input.3.joystick.2.axis.0=JOY1_HORIZ.0 +input.3.joystick.2.axis.1=JOY1_VERT.0 +input.3.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.3.empty=false +input.3.joystick.3.disabled=true +input.3.joystick.3.axis.0=JOY2_HORIZ.0 +input.3.joystick.3.axis.1=JOY2_VERT.0 +input.3.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.4.empty=false +input.3.joystick.4.disabled=true +input.3.joystick.4.axis.0=JOY1_HORIZ.0 +input.3.joystick.4.axis.1=JOY1_VERT.0 +input.3.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.5.empty=false +input.3.joystick.5.disabled=true +input.3.joystick.5.axis.0=JOY2_HORIZ.0 +input.3.joystick.5.axis.1=JOY2_VERT.0 +input.3.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.6.empty=false +input.3.joystick.6.disabled=true +input.3.joystick.6.axis.0=JOY1_HORIZ.0 +input.3.joystick.6.axis.1=JOY1_VERT.0 +input.3.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.7.empty=false +input.3.joystick.7.disabled=true +input.3.joystick.7.axis.0=JOY2_HORIZ.0 +input.3.joystick.7.axis.1=JOY2_VERT.0 +input.3.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.8.empty=true +input.3.joystick.9.empty=true +input.3.joystick.10.empty=true +input.3.joystick.11.empty=true +input.3.joystick.12.empty=true +input.3.joystick.13.empty=true +input.3.joystick.14.empty=true +input.3.joystick.15.empty=true +input.3.joystick.16.empty=true +input.3.joystick.17.empty=true +input.3.joystick.18.empty=true +input.3.joystick.19.empty=true +input.3.mouse.0.friendlyname=Windows mouse +input.3.mouse.0.name=WINMOUSE1 +input.3.mouse.0.empty=false +input.3.mouse.0.disabled=false +input.3.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.0.axis.1=MOUSE1_VERT.0 +input.3.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.1.friendlyname=HID-compliant mouse +input.3.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.1.empty=true +input.3.mouse.2.friendlyname=VMware Pointing Device +input.3.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.2.empty=true +input.3.mouse.3.friendlyname=VMware USB Pointing Device +input.3.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.3.empty=false +input.3.mouse.3.disabled=true +input.3.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.3.axis.1=MOUSE1_VERT.0 +input.3.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.4.empty=false +input.3.mouse.4.disabled=true +input.3.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.4.axis.1=MOUSE1_VERT.0 +input.3.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.5.empty=false +input.3.mouse.5.disabled=true +input.3.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.5.axis.1=MOUSE2_VERT.0 +input.3.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.6.empty=false +input.3.mouse.6.disabled=true +input.3.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.6.axis.1=MOUSE1_VERT.0 +input.3.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.7.empty=false +input.3.mouse.7.disabled=true +input.3.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.7.axis.1=MOUSE2_VERT.0 +input.3.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.8.empty=false +input.3.mouse.8.disabled=true +input.3.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.8.axis.1=MOUSE1_VERT.0 +input.3.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.9.empty=false +input.3.mouse.9.disabled=true +input.3.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.9.axis.1=MOUSE2_VERT.0 +input.3.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.10.empty=true +input.3.mouse.11.empty=true +input.3.mouse.12.empty=true +input.3.mouse.13.empty=true +input.3.mouse.14.empty=true +input.3.mouse.15.empty=true +input.3.mouse.16.empty=true +input.3.mouse.17.empty=true +input.3.mouse.18.empty=true +input.3.mouse.19.empty=true +input.3.keyboard.0.friendlyname=WinUAE keyboard +input.3.keyboard.0.name=NULLKEYBOARD +input.3.keyboard.0.empty=false +input.3.keyboard.0.disabled=false +input.3.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.3.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.3.keyboard.1.empty=true +input.3.keyboard.2.empty=true +input.3.keyboard.3.empty=true +input.3.keyboard.4.empty=true +input.3.keyboard.5.empty=true +input.3.keyboard.6.empty=true +input.3.keyboard.7.empty=true +input.3.keyboard.8.empty=true +input.3.keyboard.9.empty=true +input.3.keyboard.10.empty=true +input.3.keyboard.11.empty=true +input.3.keyboard.12.empty=true +input.3.keyboard.13.empty=true +input.3.keyboard.14.empty=true +input.3.keyboard.15.empty=true +input.3.keyboard.16.empty=true +input.3.keyboard.17.empty=true +input.3.keyboard.18.empty=true +input.3.keyboard.19.empty=true +input.3.internal.0.friendlyname=Internal events +input.3.internal.0.name=INTERNALEVENTS1 +input.3.internal.0.empty=true +input.4.mouse.0.friendlyname=Windows mouse +input.4.mouse.0.name=WINMOUSE1 +input.4.mouse.0.custom=true +input.4.keyboard.0.friendlyname=WinUAE keyboard +input.4.keyboard.0.name=NULLKEYBOARD +input.4.keyboard.0.custom=true diff --git a/source/winuae/configs/a500_debug.uae b/source/winuae/configs/a500_debug.uae new file mode 100755 index 0000000..aca429c --- /dev/null +++ b/source/winuae/configs/a500_debug.uae @@ -0,0 +1,742 @@ +config_description= +config_hardware=true +config_host=true +config_version=4.4.0 +config_hardware_path= +config_host_path= +config_all_path= +ksmirror=e0 +comp_catchdetect=true +win32.rom_path=./ +win32.floppy_path=./ +win32.hardfile_path=./ +; host-specific +win32.middle_mouse=true +win32.logfile=true +win32.start_not_captured=true +win32.soundcard=0 +win32.soundcardname=WASAPI:Default Audio Device +win32.kbledmode=0 +; common +use_gui=no +use_debugger=false +kickstart_rom_file=.\roms\Kick20.rom +kickstart_rom_file_id=C3BDB240,KS ROM v2.04 (A500+) +kickstart_ext_rom_file= +flash_file= +cart_file=:HRTMon +rtc_file= +kickshifter=false +floppy_volume=33 +floppy0= +floppy1= +floppy1type=-1 +floppy2= +floppy3= +nr_floppies=1 +floppy_speed=100 +cd_speed=100 +parallel_on_demand=false +serial_on_demand=false +serial_hardware_ctsrts=true +serial_direct=false +scsi=false +uaeserial=false +sana2=false +sound_output=exact +sound_channels=stereo +sound_stereo_separation=7 +sound_stereo_mixing_delay=0 +sound_max_buff=16384 +sound_frequency=44100 +sound_interpol=anti +sound_filter=emulated +sound_filter_type=standard +sound_volume=0 +sound_volume_paula=0 +sound_volume_cd=0 +sound_volume_ahi=0 +sound_volume_midi=0 +sound_volume_genlock=0 +sound_auto=true +sound_cdaudio=false +sound_stereo_swap_paula=false +sound_stereo_swap_ahi=false +comp_trustbyte=indirect +comp_trustword=indirect +comp_trustlong=indirect +comp_trustnaddr=indirect +comp_nf=true +comp_constjump=true +comp_flushmode=soft +compfpu=true +comp_catchdetect=true +cachesize=0 +joyport0=mouse +joyport0autofire=none +joyportfriendlyname0=Windows mouse +joyportname0=WINMOUSE1 +joyport1=kbd1 +joyport1autofire=none +bsdsocket_emu=false +synchronize_clock=false +maprom=0x0 +parallel_postscript_emulation=false +parallel_postscript_detection=false +ghostscript_parameters= +parallel_autoflush=5 +gfx_display=0 +gfx_display_rtg=0 +gfx_framerate=1 +gfx_width=1508 +gfx_height=1152 +gfx_top_windowed=104 +gfx_left_windowed=60 +gfx_width_windowed=1508 +gfx_height_windowed=1152 +gfx_width_fullscreen=1600 +gfx_height_fullscreen=1200 +gfx_refreshrate=0 +gfx_autoresolution=0 +gfx_autoresolution_vga=true +gfx_backbuffers=2 +gfx_backbuffers_rtg=1 +gfx_vsync=false +gfx_vsyncmode=normal +gfx_vsync_picasso=false +gfx_vsyncmode_picasso=normal +gfx_lores=false +gfx_resolution=hires +gfx_lores_mode=normal +gfx_flickerfixer=false +gfx_linemode=double +gfx_fullscreen_amiga=false +gfx_fullscreen_picasso=false +gfx_center_horizontal=none +gfx_center_vertical=none +gfx_colour_mode=32bit +gfx_blacker_than_black=false +gfx_api=direct3d11 +gfx_api_options=hardware +gfx_filter=no +gfx_filter_autoscale=max +immediate_blits=false +ntsc=false +genlock=false +chipset=ocs +chipset_refreshrate=50.080410 +collision_level=none +chipset_compatible=A500 +rtc=MSM6242B +resetwarning=false +cia_todbug=true +fastmem_size=0 +;debugmem_start=0x40200000 +;debugmem_size=4 +debugmem_start=0x0 +debugmem_size=0 +mem25bit_size=0 +a3000mem_size=0 +mbresmem_size=0 +z3mem_size=0 +z3mem_start=0x80000000 +bogomem_size=3 +gfxcard_hardware_vblank=false +gfxcard_hardware_sprite=true +gfxcard_multithread=false +chipmem_size=1 +cpu_speed=real +cpu_throttle=0.0 +cpu_type=68020 +cpu_model=68020 +cpu_compatible=true +cpu_24bit_addressing=false +cpu_data_cache=false +cpu_multiplier=4 +cpu_cycle_exact=false +cpu_memory_cycle_exact=false +blitter_cycle_exact=false +cycle_exact=false +fpu_strict=false +rtg_nocustom=true +rtg_modes=0x212 +debug_mem=true +log_illegal_mem=true +kbd_lang=us +warp=true +filesystem2=rw,hd0:testhd:.\hd0,0 +uaehf0=dir,rw,hd0:testhd:.\hd0,0 +input.config=0 +input.joymouse_speed_analog=20 +input.joymouse_speed_digital=10 +input.joymouse_deadzone=33 +input.joystick_deadzone=33 +input.analog_joystick_multiplier=15 +input.analog_joystick_offset=-1 +input.mouse_speed=100 +input.autofire_speed=600 +input.autoswitch=1 +input.1.joystick.0.empty=false +input.1.joystick.0.disabled=false +input.1.joystick.0.axis.0=JOY1_HORIZ.0 +input.1.joystick.0.axis.1=JOY1_VERT.0 +input.1.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.1.empty=false +input.1.joystick.1.disabled=true +input.1.joystick.1.axis.0=JOY2_HORIZ.0 +input.1.joystick.1.axis.1=JOY2_VERT.0 +input.1.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.2.empty=false +input.1.joystick.2.disabled=true +input.1.joystick.2.axis.0=JOY1_HORIZ.0 +input.1.joystick.2.axis.1=JOY1_VERT.0 +input.1.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.3.empty=false +input.1.joystick.3.disabled=true +input.1.joystick.3.axis.0=JOY2_HORIZ.0 +input.1.joystick.3.axis.1=JOY2_VERT.0 +input.1.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.4.empty=false +input.1.joystick.4.disabled=true +input.1.joystick.4.axis.0=JOY1_HORIZ.0 +input.1.joystick.4.axis.1=JOY1_VERT.0 +input.1.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.5.empty=false +input.1.joystick.5.disabled=true +input.1.joystick.5.axis.0=JOY2_HORIZ.0 +input.1.joystick.5.axis.1=JOY2_VERT.0 +input.1.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.6.empty=false +input.1.joystick.6.disabled=true +input.1.joystick.6.axis.0=JOY1_HORIZ.0 +input.1.joystick.6.axis.1=JOY1_VERT.0 +input.1.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.7.empty=false +input.1.joystick.7.disabled=true +input.1.joystick.7.axis.0=JOY2_HORIZ.0 +input.1.joystick.7.axis.1=JOY2_VERT.0 +input.1.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.8.empty=true +input.1.joystick.9.empty=true +input.1.joystick.10.empty=true +input.1.joystick.11.empty=true +input.1.joystick.12.empty=true +input.1.joystick.13.empty=true +input.1.joystick.14.empty=true +input.1.joystick.15.empty=true +input.1.joystick.16.empty=true +input.1.joystick.17.empty=true +input.1.joystick.18.empty=true +input.1.joystick.19.empty=true +input.1.mouse.0.friendlyname=Windows mouse +input.1.mouse.0.name=WINMOUSE1 +input.1.mouse.0.empty=false +input.1.mouse.0.disabled=false +input.1.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.0.axis.1=MOUSE1_VERT.0 +input.1.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.1.friendlyname=HID-compliant mouse +input.1.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.1.empty=true +input.1.mouse.2.friendlyname=VMware Pointing Device +input.1.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.2.empty=true +input.1.mouse.3.friendlyname=VMware USB Pointing Device +input.1.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.3.empty=false +input.1.mouse.3.disabled=true +input.1.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.3.axis.1=MOUSE1_VERT.0 +input.1.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.4.empty=false +input.1.mouse.4.disabled=true +input.1.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.4.axis.1=MOUSE1_VERT.0 +input.1.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.5.empty=false +input.1.mouse.5.disabled=true +input.1.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.5.axis.1=MOUSE2_VERT.0 +input.1.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.6.empty=false +input.1.mouse.6.disabled=true +input.1.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.6.axis.1=MOUSE1_VERT.0 +input.1.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.7.empty=false +input.1.mouse.7.disabled=true +input.1.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.7.axis.1=MOUSE2_VERT.0 +input.1.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.8.empty=false +input.1.mouse.8.disabled=true +input.1.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.8.axis.1=MOUSE1_VERT.0 +input.1.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.9.empty=false +input.1.mouse.9.disabled=true +input.1.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.9.axis.1=MOUSE2_VERT.0 +input.1.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.10.empty=true +input.1.mouse.11.empty=true +input.1.mouse.12.empty=true +input.1.mouse.13.empty=true +input.1.mouse.14.empty=true +input.1.mouse.15.empty=true +input.1.mouse.16.empty=true +input.1.mouse.17.empty=true +input.1.mouse.18.empty=true +input.1.mouse.19.empty=true +input.1.keyboard.0.friendlyname=WinUAE keyboard +input.1.keyboard.0.name=NULLKEYBOARD +input.1.keyboard.0.empty=false +input.1.keyboard.0.disabled=false +input.1.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.1.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.1.keyboard.1.empty=true +input.1.keyboard.2.empty=true +input.1.keyboard.3.empty=true +input.1.keyboard.4.empty=true +input.1.keyboard.5.empty=true +input.1.keyboard.6.empty=true +input.1.keyboard.7.empty=true +input.1.keyboard.8.empty=true +input.1.keyboard.9.empty=true +input.1.keyboard.10.empty=true +input.1.keyboard.11.empty=true +input.1.keyboard.12.empty=true +input.1.keyboard.13.empty=true +input.1.keyboard.14.empty=true +input.1.keyboard.15.empty=true +input.1.keyboard.16.empty=true +input.1.keyboard.17.empty=true +input.1.keyboard.18.empty=true +input.1.keyboard.19.empty=true +input.1.internal.0.friendlyname=Internal events +input.1.internal.0.name=INTERNALEVENTS1 +input.1.internal.0.empty=true +input.2.joystick.0.empty=false +input.2.joystick.0.disabled=false +input.2.joystick.0.axis.0=JOY1_HORIZ.0 +input.2.joystick.0.axis.1=JOY1_VERT.0 +input.2.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.1.empty=false +input.2.joystick.1.disabled=true +input.2.joystick.1.axis.0=JOY2_HORIZ.0 +input.2.joystick.1.axis.1=JOY2_VERT.0 +input.2.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.2.empty=false +input.2.joystick.2.disabled=true +input.2.joystick.2.axis.0=JOY1_HORIZ.0 +input.2.joystick.2.axis.1=JOY1_VERT.0 +input.2.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.3.empty=false +input.2.joystick.3.disabled=true +input.2.joystick.3.axis.0=JOY2_HORIZ.0 +input.2.joystick.3.axis.1=JOY2_VERT.0 +input.2.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.4.empty=false +input.2.joystick.4.disabled=true +input.2.joystick.4.axis.0=JOY1_HORIZ.0 +input.2.joystick.4.axis.1=JOY1_VERT.0 +input.2.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.5.empty=false +input.2.joystick.5.disabled=true +input.2.joystick.5.axis.0=JOY2_HORIZ.0 +input.2.joystick.5.axis.1=JOY2_VERT.0 +input.2.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.6.empty=false +input.2.joystick.6.disabled=true +input.2.joystick.6.axis.0=JOY1_HORIZ.0 +input.2.joystick.6.axis.1=JOY1_VERT.0 +input.2.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.7.empty=false +input.2.joystick.7.disabled=true +input.2.joystick.7.axis.0=JOY2_HORIZ.0 +input.2.joystick.7.axis.1=JOY2_VERT.0 +input.2.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.8.empty=true +input.2.joystick.9.empty=true +input.2.joystick.10.empty=true +input.2.joystick.11.empty=true +input.2.joystick.12.empty=true +input.2.joystick.13.empty=true +input.2.joystick.14.empty=true +input.2.joystick.15.empty=true +input.2.joystick.16.empty=true +input.2.joystick.17.empty=true +input.2.joystick.18.empty=true +input.2.joystick.19.empty=true +input.2.mouse.0.friendlyname=Windows mouse +input.2.mouse.0.name=WINMOUSE1 +input.2.mouse.0.empty=false +input.2.mouse.0.disabled=false +input.2.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.0.axis.1=MOUSE1_VERT.0 +input.2.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.1.friendlyname=HID-compliant mouse +input.2.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.1.empty=true +input.2.mouse.2.friendlyname=VMware Pointing Device +input.2.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.2.empty=true +input.2.mouse.3.friendlyname=VMware USB Pointing Device +input.2.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.3.empty=false +input.2.mouse.3.disabled=true +input.2.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.3.axis.1=MOUSE1_VERT.0 +input.2.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.4.empty=false +input.2.mouse.4.disabled=true +input.2.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.4.axis.1=MOUSE1_VERT.0 +input.2.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.5.empty=false +input.2.mouse.5.disabled=true +input.2.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.5.axis.1=MOUSE2_VERT.0 +input.2.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.6.empty=false +input.2.mouse.6.disabled=true +input.2.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.6.axis.1=MOUSE1_VERT.0 +input.2.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.7.empty=false +input.2.mouse.7.disabled=true +input.2.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.7.axis.1=MOUSE2_VERT.0 +input.2.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.8.empty=false +input.2.mouse.8.disabled=true +input.2.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.8.axis.1=MOUSE1_VERT.0 +input.2.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.9.empty=false +input.2.mouse.9.disabled=true +input.2.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.9.axis.1=MOUSE2_VERT.0 +input.2.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.10.empty=true +input.2.mouse.11.empty=true +input.2.mouse.12.empty=true +input.2.mouse.13.empty=true +input.2.mouse.14.empty=true +input.2.mouse.15.empty=true +input.2.mouse.16.empty=true +input.2.mouse.17.empty=true +input.2.mouse.18.empty=true +input.2.mouse.19.empty=true +input.2.keyboard.0.friendlyname=WinUAE keyboard +input.2.keyboard.0.name=NULLKEYBOARD +input.2.keyboard.0.empty=false +input.2.keyboard.0.disabled=false +input.2.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.2.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.2.keyboard.1.empty=true +input.2.keyboard.2.empty=true +input.2.keyboard.3.empty=true +input.2.keyboard.4.empty=true +input.2.keyboard.5.empty=true +input.2.keyboard.6.empty=true +input.2.keyboard.7.empty=true +input.2.keyboard.8.empty=true +input.2.keyboard.9.empty=true +input.2.keyboard.10.empty=true +input.2.keyboard.11.empty=true +input.2.keyboard.12.empty=true +input.2.keyboard.13.empty=true +input.2.keyboard.14.empty=true +input.2.keyboard.15.empty=true +input.2.keyboard.16.empty=true +input.2.keyboard.17.empty=true +input.2.keyboard.18.empty=true +input.2.keyboard.19.empty=true +input.2.internal.0.friendlyname=Internal events +input.2.internal.0.name=INTERNALEVENTS1 +input.2.internal.0.empty=true +input.3.joystick.0.empty=false +input.3.joystick.0.disabled=false +input.3.joystick.0.axis.0=JOY1_HORIZ.0 +input.3.joystick.0.axis.1=JOY1_VERT.0 +input.3.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.1.empty=false +input.3.joystick.1.disabled=true +input.3.joystick.1.axis.0=JOY2_HORIZ.0 +input.3.joystick.1.axis.1=JOY2_VERT.0 +input.3.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.2.empty=false +input.3.joystick.2.disabled=true +input.3.joystick.2.axis.0=JOY1_HORIZ.0 +input.3.joystick.2.axis.1=JOY1_VERT.0 +input.3.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.3.empty=false +input.3.joystick.3.disabled=true +input.3.joystick.3.axis.0=JOY2_HORIZ.0 +input.3.joystick.3.axis.1=JOY2_VERT.0 +input.3.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.4.empty=false +input.3.joystick.4.disabled=true +input.3.joystick.4.axis.0=JOY1_HORIZ.0 +input.3.joystick.4.axis.1=JOY1_VERT.0 +input.3.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.5.empty=false +input.3.joystick.5.disabled=true +input.3.joystick.5.axis.0=JOY2_HORIZ.0 +input.3.joystick.5.axis.1=JOY2_VERT.0 +input.3.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.6.empty=false +input.3.joystick.6.disabled=true +input.3.joystick.6.axis.0=JOY1_HORIZ.0 +input.3.joystick.6.axis.1=JOY1_VERT.0 +input.3.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.7.empty=false +input.3.joystick.7.disabled=true +input.3.joystick.7.axis.0=JOY2_HORIZ.0 +input.3.joystick.7.axis.1=JOY2_VERT.0 +input.3.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.8.empty=true +input.3.joystick.9.empty=true +input.3.joystick.10.empty=true +input.3.joystick.11.empty=true +input.3.joystick.12.empty=true +input.3.joystick.13.empty=true +input.3.joystick.14.empty=true +input.3.joystick.15.empty=true +input.3.joystick.16.empty=true +input.3.joystick.17.empty=true +input.3.joystick.18.empty=true +input.3.joystick.19.empty=true +input.3.mouse.0.friendlyname=Windows mouse +input.3.mouse.0.name=WINMOUSE1 +input.3.mouse.0.empty=false +input.3.mouse.0.disabled=false +input.3.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.0.axis.1=MOUSE1_VERT.0 +input.3.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.1.friendlyname=HID-compliant mouse +input.3.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.1.empty=true +input.3.mouse.2.friendlyname=VMware Pointing Device +input.3.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.2.empty=true +input.3.mouse.3.friendlyname=VMware USB Pointing Device +input.3.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.3.empty=false +input.3.mouse.3.disabled=true +input.3.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.3.axis.1=MOUSE1_VERT.0 +input.3.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.4.empty=false +input.3.mouse.4.disabled=true +input.3.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.4.axis.1=MOUSE1_VERT.0 +input.3.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.5.empty=false +input.3.mouse.5.disabled=true +input.3.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.5.axis.1=MOUSE2_VERT.0 +input.3.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.6.empty=false +input.3.mouse.6.disabled=true +input.3.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.6.axis.1=MOUSE1_VERT.0 +input.3.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.7.empty=false +input.3.mouse.7.disabled=true +input.3.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.7.axis.1=MOUSE2_VERT.0 +input.3.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.8.empty=false +input.3.mouse.8.disabled=true +input.3.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.8.axis.1=MOUSE1_VERT.0 +input.3.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.9.empty=false +input.3.mouse.9.disabled=true +input.3.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.9.axis.1=MOUSE2_VERT.0 +input.3.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.10.empty=true +input.3.mouse.11.empty=true +input.3.mouse.12.empty=true +input.3.mouse.13.empty=true +input.3.mouse.14.empty=true +input.3.mouse.15.empty=true +input.3.mouse.16.empty=true +input.3.mouse.17.empty=true +input.3.mouse.18.empty=true +input.3.mouse.19.empty=true +input.3.keyboard.0.friendlyname=WinUAE keyboard +input.3.keyboard.0.name=NULLKEYBOARD +input.3.keyboard.0.empty=false +input.3.keyboard.0.disabled=false +input.3.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.3.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.3.keyboard.1.empty=true +input.3.keyboard.2.empty=true +input.3.keyboard.3.empty=true +input.3.keyboard.4.empty=true +input.3.keyboard.5.empty=true +input.3.keyboard.6.empty=true +input.3.keyboard.7.empty=true +input.3.keyboard.8.empty=true +input.3.keyboard.9.empty=true +input.3.keyboard.10.empty=true +input.3.keyboard.11.empty=true +input.3.keyboard.12.empty=true +input.3.keyboard.13.empty=true +input.3.keyboard.14.empty=true +input.3.keyboard.15.empty=true +input.3.keyboard.16.empty=true +input.3.keyboard.17.empty=true +input.3.keyboard.18.empty=true +input.3.keyboard.19.empty=true +input.3.internal.0.friendlyname=Internal events +input.3.internal.0.name=INTERNALEVENTS1 +input.3.internal.0.empty=true +input.4.keyboard.0.friendlyname=WinUAE keyboard +input.4.keyboard.0.name=NULLKEYBOARD +input.4.keyboard.0.custom=true diff --git a/source/winuae/configs/a500_hd.uae b/source/winuae/configs/a500_hd.uae new file mode 100755 index 0000000..f8049ae --- /dev/null +++ b/source/winuae/configs/a500_hd.uae @@ -0,0 +1,740 @@ +config_description= +config_hardware=true +config_host=true +config_version=4.3.0 +config_hardware_path= +config_host_path= +config_all_path= +comp_catchdetect=true +ksmirror=e0 +win32.rom_path=./ +win32.floppy_path=./ +win32.hardfile_path=./ +; host-specific +win32.middle_mouse=true +win32.logfile=true +win32.start_not_captured=true +win32.soundcard=0 +win32.soundcardname=WASAPI:Default Audio Device +win32.kbledmode=0 +; common +use_gui=no +use_debugger=false +kickstart_rom_file=.\roms\Kick13.rom +kickstart_rom_file_id=C4F0F55F,KS ROM v1.3 (A500,A1000,A2000) +kickstart_ext_rom_file= +flash_file= +cart_file=:HRTMon +rtc_file= +kickshifter=false +floppy_volume=33 +floppy0= +floppy1= +floppy1type=-1 +floppy2= +floppy3= +nr_floppies=1 +floppy_speed=100 +cd_speed=100 +parallel_on_demand=false +serial_on_demand=false +serial_hardware_ctsrts=true +serial_direct=false +scsi=false +uaeserial=false +sana2=false +sound_output=exact +sound_channels=stereo +sound_stereo_separation=7 +sound_stereo_mixing_delay=0 +sound_max_buff=16384 +sound_frequency=44100 +sound_interpol=anti +sound_filter=emulated +sound_filter_type=standard +sound_volume=0 +sound_volume_paula=0 +sound_volume_cd=0 +sound_volume_ahi=0 +sound_volume_midi=0 +sound_volume_genlock=0 +sound_auto=true +sound_cdaudio=false +sound_stereo_swap_paula=false +sound_stereo_swap_ahi=false +comp_trustbyte=indirect +comp_trustword=indirect +comp_trustlong=indirect +comp_trustnaddr=indirect +comp_nf=true +comp_constjump=true +comp_flushmode=soft +compfpu=true +comp_catchdetect=true +cachesize=0 +joyport0=mouse +joyport0autofire=none +joyportfriendlyname0=Windows mouse +joyportname0=WINMOUSE1 +joyport1=kbd1 +joyport1autofire=none +bsdsocket_emu=false +synchronize_clock=false +maprom=0x0 +parallel_postscript_emulation=false +parallel_postscript_detection=false +ghostscript_parameters= +parallel_autoflush=5 +gfx_display=0 +gfx_display_rtg=0 +gfx_framerate=1 +gfx_width=1440 +gfx_height=1136 +gfx_top_windowed=0 +gfx_left_windowed=30 +gfx_width_windowed=1440 +gfx_height_windowed=1136 +gfx_width_fullscreen=1600 +gfx_height_fullscreen=1200 +gfx_refreshrate=0 +gfx_autoresolution=0 +gfx_autoresolution_vga=true +gfx_backbuffers=2 +gfx_backbuffers_rtg=1 +gfx_vsync=false +gfx_vsyncmode=normal +gfx_vsync_picasso=false +gfx_vsyncmode_picasso=normal +gfx_lores=false +gfx_resolution=hires +gfx_lores_mode=normal +gfx_flickerfixer=false +gfx_linemode=double +gfx_fullscreen_amiga=false +gfx_fullscreen_picasso=false +gfx_center_horizontal=none +gfx_center_vertical=none +gfx_colour_mode=32bit +gfx_blacker_than_black=false +gfx_api=direct3d11 +gfx_api_options=hardware +gfx_filter=no +gfx_filter_autoscale=max +immediate_blits=false +waiting_blits=automatic +ntsc=false +genlock=false +chipset=ocs +chipset_refreshrate=49.920410 +collision_level=playfields +chipset_compatible=A500 +rtc=MSM6242B +resetwarning=false +cia_todbug=true +fastmem_size=0 +debugmem_start=0x0 +debugmem_size=0 +mem25bit_size=0 +a3000mem_size=0 +mbresmem_size=0 +z3mem_size=0 +z3mem_start=0x40000000 +bogomem_size=6 +gfxcard_hardware_vblank=false +gfxcard_hardware_sprite=true +gfxcard_multithread=false +chipmem_size=1 +cpu_speed=real +cpu_throttle=0.0 +cpu_type=68000 +cpu_model=68000 +cpu_compatible=true +cpu_24bit_addressing=true +cpu_data_cache=false +cpu_cycle_exact=false +cpu_memory_cycle_exact=false +blitter_cycle_exact=false +cycle_exact=false +fpu_strict=false +rtg_nocustom=true +rtg_modes=0x212 +log_illegal_mem=true +debug_mem=true +kbd_lang=us +warp=true +filesystem2=rw,hd0:testhd:.\hd0,0 +uaehf0=dir,rw,hd0:testhd:.\hd0,0 +input.config=0 +input.joymouse_speed_analog=20 +input.joymouse_speed_digital=10 +input.joymouse_deadzone=33 +input.joystick_deadzone=33 +input.analog_joystick_multiplier=15 +input.analog_joystick_offset=-1 +input.mouse_speed=100 +input.autofire_speed=600 +input.autoswitch=1 +input.1.joystick.0.empty=false +input.1.joystick.0.disabled=false +input.1.joystick.0.axis.0=JOY1_HORIZ.0 +input.1.joystick.0.axis.1=JOY1_VERT.0 +input.1.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.1.empty=false +input.1.joystick.1.disabled=true +input.1.joystick.1.axis.0=JOY2_HORIZ.0 +input.1.joystick.1.axis.1=JOY2_VERT.0 +input.1.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.2.empty=false +input.1.joystick.2.disabled=true +input.1.joystick.2.axis.0=JOY1_HORIZ.0 +input.1.joystick.2.axis.1=JOY1_VERT.0 +input.1.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.3.empty=false +input.1.joystick.3.disabled=true +input.1.joystick.3.axis.0=JOY2_HORIZ.0 +input.1.joystick.3.axis.1=JOY2_VERT.0 +input.1.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.4.empty=false +input.1.joystick.4.disabled=true +input.1.joystick.4.axis.0=JOY1_HORIZ.0 +input.1.joystick.4.axis.1=JOY1_VERT.0 +input.1.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.5.empty=false +input.1.joystick.5.disabled=true +input.1.joystick.5.axis.0=JOY2_HORIZ.0 +input.1.joystick.5.axis.1=JOY2_VERT.0 +input.1.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.6.empty=false +input.1.joystick.6.disabled=true +input.1.joystick.6.axis.0=JOY1_HORIZ.0 +input.1.joystick.6.axis.1=JOY1_VERT.0 +input.1.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.7.empty=false +input.1.joystick.7.disabled=true +input.1.joystick.7.axis.0=JOY2_HORIZ.0 +input.1.joystick.7.axis.1=JOY2_VERT.0 +input.1.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.8.empty=true +input.1.joystick.9.empty=true +input.1.joystick.10.empty=true +input.1.joystick.11.empty=true +input.1.joystick.12.empty=true +input.1.joystick.13.empty=true +input.1.joystick.14.empty=true +input.1.joystick.15.empty=true +input.1.joystick.16.empty=true +input.1.joystick.17.empty=true +input.1.joystick.18.empty=true +input.1.joystick.19.empty=true +input.1.mouse.0.friendlyname=Windows mouse +input.1.mouse.0.name=WINMOUSE1 +input.1.mouse.0.empty=false +input.1.mouse.0.disabled=false +input.1.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.0.axis.1=MOUSE1_VERT.0 +input.1.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.1.friendlyname=HID-compliant mouse +input.1.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.1.empty=true +input.1.mouse.2.friendlyname=VMware Pointing Device +input.1.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.2.empty=true +input.1.mouse.3.friendlyname=VMware USB Pointing Device +input.1.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.3.empty=false +input.1.mouse.3.disabled=true +input.1.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.3.axis.1=MOUSE1_VERT.0 +input.1.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.4.empty=false +input.1.mouse.4.disabled=true +input.1.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.4.axis.1=MOUSE1_VERT.0 +input.1.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.5.empty=false +input.1.mouse.5.disabled=true +input.1.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.5.axis.1=MOUSE2_VERT.0 +input.1.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.6.empty=false +input.1.mouse.6.disabled=true +input.1.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.6.axis.1=MOUSE1_VERT.0 +input.1.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.7.empty=false +input.1.mouse.7.disabled=true +input.1.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.7.axis.1=MOUSE2_VERT.0 +input.1.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.8.empty=false +input.1.mouse.8.disabled=true +input.1.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.8.axis.1=MOUSE1_VERT.0 +input.1.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.9.empty=false +input.1.mouse.9.disabled=true +input.1.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.9.axis.1=MOUSE2_VERT.0 +input.1.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.10.empty=true +input.1.mouse.11.empty=true +input.1.mouse.12.empty=true +input.1.mouse.13.empty=true +input.1.mouse.14.empty=true +input.1.mouse.15.empty=true +input.1.mouse.16.empty=true +input.1.mouse.17.empty=true +input.1.mouse.18.empty=true +input.1.mouse.19.empty=true +input.1.keyboard.0.friendlyname=WinUAE keyboard +input.1.keyboard.0.name=NULLKEYBOARD +input.1.keyboard.0.empty=false +input.1.keyboard.0.disabled=false +input.1.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.1.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.1.keyboard.1.empty=true +input.1.keyboard.2.empty=true +input.1.keyboard.3.empty=true +input.1.keyboard.4.empty=true +input.1.keyboard.5.empty=true +input.1.keyboard.6.empty=true +input.1.keyboard.7.empty=true +input.1.keyboard.8.empty=true +input.1.keyboard.9.empty=true +input.1.keyboard.10.empty=true +input.1.keyboard.11.empty=true +input.1.keyboard.12.empty=true +input.1.keyboard.13.empty=true +input.1.keyboard.14.empty=true +input.1.keyboard.15.empty=true +input.1.keyboard.16.empty=true +input.1.keyboard.17.empty=true +input.1.keyboard.18.empty=true +input.1.keyboard.19.empty=true +input.1.internal.0.friendlyname=Internal events +input.1.internal.0.name=INTERNALEVENTS1 +input.1.internal.0.empty=true +input.2.joystick.0.empty=false +input.2.joystick.0.disabled=false +input.2.joystick.0.axis.0=JOY1_HORIZ.0 +input.2.joystick.0.axis.1=JOY1_VERT.0 +input.2.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.1.empty=false +input.2.joystick.1.disabled=true +input.2.joystick.1.axis.0=JOY2_HORIZ.0 +input.2.joystick.1.axis.1=JOY2_VERT.0 +input.2.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.2.empty=false +input.2.joystick.2.disabled=true +input.2.joystick.2.axis.0=JOY1_HORIZ.0 +input.2.joystick.2.axis.1=JOY1_VERT.0 +input.2.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.3.empty=false +input.2.joystick.3.disabled=true +input.2.joystick.3.axis.0=JOY2_HORIZ.0 +input.2.joystick.3.axis.1=JOY2_VERT.0 +input.2.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.4.empty=false +input.2.joystick.4.disabled=true +input.2.joystick.4.axis.0=JOY1_HORIZ.0 +input.2.joystick.4.axis.1=JOY1_VERT.0 +input.2.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.5.empty=false +input.2.joystick.5.disabled=true +input.2.joystick.5.axis.0=JOY2_HORIZ.0 +input.2.joystick.5.axis.1=JOY2_VERT.0 +input.2.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.6.empty=false +input.2.joystick.6.disabled=true +input.2.joystick.6.axis.0=JOY1_HORIZ.0 +input.2.joystick.6.axis.1=JOY1_VERT.0 +input.2.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.7.empty=false +input.2.joystick.7.disabled=true +input.2.joystick.7.axis.0=JOY2_HORIZ.0 +input.2.joystick.7.axis.1=JOY2_VERT.0 +input.2.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.8.empty=true +input.2.joystick.9.empty=true +input.2.joystick.10.empty=true +input.2.joystick.11.empty=true +input.2.joystick.12.empty=true +input.2.joystick.13.empty=true +input.2.joystick.14.empty=true +input.2.joystick.15.empty=true +input.2.joystick.16.empty=true +input.2.joystick.17.empty=true +input.2.joystick.18.empty=true +input.2.joystick.19.empty=true +input.2.mouse.0.friendlyname=Windows mouse +input.2.mouse.0.name=WINMOUSE1 +input.2.mouse.0.empty=false +input.2.mouse.0.disabled=false +input.2.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.0.axis.1=MOUSE1_VERT.0 +input.2.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.1.friendlyname=HID-compliant mouse +input.2.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.1.empty=true +input.2.mouse.2.friendlyname=VMware Pointing Device +input.2.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.2.empty=true +input.2.mouse.3.friendlyname=VMware USB Pointing Device +input.2.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.3.empty=false +input.2.mouse.3.disabled=true +input.2.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.3.axis.1=MOUSE1_VERT.0 +input.2.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.4.empty=false +input.2.mouse.4.disabled=true +input.2.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.4.axis.1=MOUSE1_VERT.0 +input.2.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.5.empty=false +input.2.mouse.5.disabled=true +input.2.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.5.axis.1=MOUSE2_VERT.0 +input.2.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.6.empty=false +input.2.mouse.6.disabled=true +input.2.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.6.axis.1=MOUSE1_VERT.0 +input.2.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.7.empty=false +input.2.mouse.7.disabled=true +input.2.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.7.axis.1=MOUSE2_VERT.0 +input.2.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.8.empty=false +input.2.mouse.8.disabled=true +input.2.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.8.axis.1=MOUSE1_VERT.0 +input.2.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.9.empty=false +input.2.mouse.9.disabled=true +input.2.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.9.axis.1=MOUSE2_VERT.0 +input.2.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.10.empty=true +input.2.mouse.11.empty=true +input.2.mouse.12.empty=true +input.2.mouse.13.empty=true +input.2.mouse.14.empty=true +input.2.mouse.15.empty=true +input.2.mouse.16.empty=true +input.2.mouse.17.empty=true +input.2.mouse.18.empty=true +input.2.mouse.19.empty=true +input.2.keyboard.0.friendlyname=WinUAE keyboard +input.2.keyboard.0.name=NULLKEYBOARD +input.2.keyboard.0.empty=false +input.2.keyboard.0.disabled=false +input.2.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.2.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.2.keyboard.1.empty=true +input.2.keyboard.2.empty=true +input.2.keyboard.3.empty=true +input.2.keyboard.4.empty=true +input.2.keyboard.5.empty=true +input.2.keyboard.6.empty=true +input.2.keyboard.7.empty=true +input.2.keyboard.8.empty=true +input.2.keyboard.9.empty=true +input.2.keyboard.10.empty=true +input.2.keyboard.11.empty=true +input.2.keyboard.12.empty=true +input.2.keyboard.13.empty=true +input.2.keyboard.14.empty=true +input.2.keyboard.15.empty=true +input.2.keyboard.16.empty=true +input.2.keyboard.17.empty=true +input.2.keyboard.18.empty=true +input.2.keyboard.19.empty=true +input.2.internal.0.friendlyname=Internal events +input.2.internal.0.name=INTERNALEVENTS1 +input.2.internal.0.empty=true +input.3.joystick.0.empty=false +input.3.joystick.0.disabled=false +input.3.joystick.0.axis.0=JOY1_HORIZ.0 +input.3.joystick.0.axis.1=JOY1_VERT.0 +input.3.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.1.empty=false +input.3.joystick.1.disabled=true +input.3.joystick.1.axis.0=JOY2_HORIZ.0 +input.3.joystick.1.axis.1=JOY2_VERT.0 +input.3.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.2.empty=false +input.3.joystick.2.disabled=true +input.3.joystick.2.axis.0=JOY1_HORIZ.0 +input.3.joystick.2.axis.1=JOY1_VERT.0 +input.3.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.3.empty=false +input.3.joystick.3.disabled=true +input.3.joystick.3.axis.0=JOY2_HORIZ.0 +input.3.joystick.3.axis.1=JOY2_VERT.0 +input.3.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.4.empty=false +input.3.joystick.4.disabled=true +input.3.joystick.4.axis.0=JOY1_HORIZ.0 +input.3.joystick.4.axis.1=JOY1_VERT.0 +input.3.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.5.empty=false +input.3.joystick.5.disabled=true +input.3.joystick.5.axis.0=JOY2_HORIZ.0 +input.3.joystick.5.axis.1=JOY2_VERT.0 +input.3.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.6.empty=false +input.3.joystick.6.disabled=true +input.3.joystick.6.axis.0=JOY1_HORIZ.0 +input.3.joystick.6.axis.1=JOY1_VERT.0 +input.3.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.7.empty=false +input.3.joystick.7.disabled=true +input.3.joystick.7.axis.0=JOY2_HORIZ.0 +input.3.joystick.7.axis.1=JOY2_VERT.0 +input.3.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.8.empty=true +input.3.joystick.9.empty=true +input.3.joystick.10.empty=true +input.3.joystick.11.empty=true +input.3.joystick.12.empty=true +input.3.joystick.13.empty=true +input.3.joystick.14.empty=true +input.3.joystick.15.empty=true +input.3.joystick.16.empty=true +input.3.joystick.17.empty=true +input.3.joystick.18.empty=true +input.3.joystick.19.empty=true +input.3.mouse.0.friendlyname=Windows mouse +input.3.mouse.0.name=WINMOUSE1 +input.3.mouse.0.empty=false +input.3.mouse.0.disabled=false +input.3.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.0.axis.1=MOUSE1_VERT.0 +input.3.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.1.friendlyname=HID-compliant mouse +input.3.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.1.empty=true +input.3.mouse.2.friendlyname=VMware Pointing Device +input.3.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.2.empty=true +input.3.mouse.3.friendlyname=VMware USB Pointing Device +input.3.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.3.empty=false +input.3.mouse.3.disabled=true +input.3.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.3.axis.1=MOUSE1_VERT.0 +input.3.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.4.empty=false +input.3.mouse.4.disabled=true +input.3.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.4.axis.1=MOUSE1_VERT.0 +input.3.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.5.empty=false +input.3.mouse.5.disabled=true +input.3.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.5.axis.1=MOUSE2_VERT.0 +input.3.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.6.empty=false +input.3.mouse.6.disabled=true +input.3.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.6.axis.1=MOUSE1_VERT.0 +input.3.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.7.empty=false +input.3.mouse.7.disabled=true +input.3.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.7.axis.1=MOUSE2_VERT.0 +input.3.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.8.empty=false +input.3.mouse.8.disabled=true +input.3.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.8.axis.1=MOUSE1_VERT.0 +input.3.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.9.empty=false +input.3.mouse.9.disabled=true +input.3.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.9.axis.1=MOUSE2_VERT.0 +input.3.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.10.empty=true +input.3.mouse.11.empty=true +input.3.mouse.12.empty=true +input.3.mouse.13.empty=true +input.3.mouse.14.empty=true +input.3.mouse.15.empty=true +input.3.mouse.16.empty=true +input.3.mouse.17.empty=true +input.3.mouse.18.empty=true +input.3.mouse.19.empty=true +input.3.keyboard.0.friendlyname=WinUAE keyboard +input.3.keyboard.0.name=NULLKEYBOARD +input.3.keyboard.0.empty=false +input.3.keyboard.0.disabled=false +input.3.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.3.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.3.keyboard.1.empty=true +input.3.keyboard.2.empty=true +input.3.keyboard.3.empty=true +input.3.keyboard.4.empty=true +input.3.keyboard.5.empty=true +input.3.keyboard.6.empty=true +input.3.keyboard.7.empty=true +input.3.keyboard.8.empty=true +input.3.keyboard.9.empty=true +input.3.keyboard.10.empty=true +input.3.keyboard.11.empty=true +input.3.keyboard.12.empty=true +input.3.keyboard.13.empty=true +input.3.keyboard.14.empty=true +input.3.keyboard.15.empty=true +input.3.keyboard.16.empty=true +input.3.keyboard.17.empty=true +input.3.keyboard.18.empty=true +input.3.keyboard.19.empty=true +input.3.internal.0.friendlyname=Internal events +input.3.internal.0.name=INTERNALEVENTS1 +input.3.internal.0.empty=true +input.4.keyboard.0.friendlyname=WinUAE keyboard +input.4.keyboard.0.name=NULLKEYBOARD +input.4.keyboard.0.custom=true diff --git a/source/winuae/configs/a500_hrt.uae b/source/winuae/configs/a500_hrt.uae new file mode 100755 index 0000000..49d3045 --- /dev/null +++ b/source/winuae/configs/a500_hrt.uae @@ -0,0 +1,747 @@ +config_description= +config_hardware=true +config_host=true +config_version=4.3.0 +config_hardware_path= +config_host_path= +config_all_path= +comp_catchdetect=true +ksmirror=e0 +win32.rom_path=./ +win32.floppy_path=./ +win32.hardfile_path=./ +; host-specific +win32.middle_mouse=true +win32.logfile=true +win32.start_not_captured=true +win32.soundcard=0 +win32.soundcardname=WASAPI:Default Audio Device +win32.kbledmode=0 +; common +use_gui=no +use_debugger=false +kickstart_rom_file=.\roms\Kick13.rom +kickstart_rom_file_id=C4F0F55F,KS ROM v1.3 (A500,A1000,A2000) +kickstart_ext_rom_file= +flash_file= +cart_file=:HRTMon +rtc_file= +kickshifter=false +floppy_volume=33 +floppy0= +floppy1= +floppy1type=-1 +floppy2= +floppy3= +nr_floppies=1 +floppy_speed=100 +cd_speed=100 +parallel_on_demand=false +serial_on_demand=false +serial_hardware_ctsrts=true +serial_direct=false +scsi=false +uaeserial=false +sana2=false +sound_output=exact +sound_channels=stereo +sound_stereo_separation=7 +sound_stereo_mixing_delay=0 +sound_max_buff=16384 +sound_frequency=44100 +sound_interpol=anti +sound_filter=emulated +sound_filter_type=standard +sound_volume=0 +sound_volume_paula=0 +sound_volume_cd=0 +sound_volume_ahi=0 +sound_volume_midi=0 +sound_volume_genlock=0 +sound_auto=true +sound_cdaudio=false +sound_stereo_swap_paula=false +sound_stereo_swap_ahi=false +comp_trustbyte=indirect +comp_trustword=indirect +comp_trustlong=indirect +comp_trustnaddr=indirect +comp_nf=true +comp_constjump=true +comp_flushmode=soft +compfpu=true +comp_catchfault=true +cachesize=0 +joyport0=mouse +joyport0autofire=none +joyportfriendlyname0=Windows mouse +joyportname0=WINMOUSE1 +joyport1=kbd1 +joyport1autofire=none +bsdsocket_emu=false +synchronize_clock=false +maprom=0x0 +parallel_postscript_emulation=false +parallel_postscript_detection=false +ghostscript_parameters= +parallel_autoflush=5 +gfx_display=0 +gfx_display_rtg=0 +gfx_framerate=1 +gfx_width=1508 +gfx_height=1152 +gfx_top_windowed=0 +gfx_left_windowed=30 +gfx_width_windowed=1508 +gfx_height_windowed=1152 +gfx_width_fullscreen=1600 +gfx_height_fullscreen=1200 +gfx_refreshrate=0 +gfx_autoresolution=0 +gfx_autoresolution_vga=true +gfx_backbuffers=2 +gfx_backbuffers_rtg=1 +gfx_vsync=false +gfx_vsyncmode=normal +gfx_vsync_picasso=false +gfx_vsyncmode_picasso=normal +gfx_lores=false +gfx_resolution=hires +gfx_lores_mode=normal +gfx_flickerfixer=false +gfx_linemode=double +gfx_fullscreen_amiga=false +gfx_fullscreen_picasso=false +gfx_center_horizontal=none +gfx_center_vertical=none +gfx_colour_mode=32bit +gfx_blacker_than_black=false +gfx_api=direct3d11 +gfx_api_options=hardware +gfx_filter=no +gfx_filter_autoscale=max +immediate_blits=false +waiting_blits=automatic +ntsc=false +genlock=false +chipset=ocs +chipset_refreshrate=49.920410 +collision_level=playfields +chipset_compatible=A500 +chipset_hacks=8 +rtc=MSM6242B +resetwarning=false +cia_todbug=true +fastmem_size=0 +debugmem_start=0x0 +debugmem_size=0 +mem25bit_size=0 +a3000mem_size=0 +mbresmem_size=0 +z3mem_size=0 +z3mem_start=0x40000000 +bogomem_size=2 +gfxcard_hardware_vblank=false +gfxcard_hardware_sprite=true +gfxcard_multithread=false +chipmem_size=1 +cpu_speed=real +cpu_throttle=0.0 +cpu_type=68000 +cpu_model=68000 +cpu_compatible=true +cpu_24bit_addressing=true +cpu_data_cache=false +cpu_cycle_exact=false +cpu_memory_cycle_exact=false +blitter_cycle_exact=false +cycle_exact=false +fpu_strict=false +rtg_nocustom=true +rtg_modes=0x212 +log_illegal_mem=true +debug_mem=true +kbd_lang=us +warp=true +filesystem2=rw,hd0:testhd:.\hd0,0 +uaehf0=dir,rw,hd0:testhd:.\hd0,0 +input.config=1 +input.joymouse_speed_analog=20 +input.joymouse_speed_digital=10 +input.joymouse_deadzone=33 +input.joystick_deadzone=33 +input.analog_joystick_multiplier=15 +input.analog_joystick_offset=-1 +input.mouse_speed=100 +input.autofire_speed=600 +input.autoswitch=1 +input.1.joystick.0.empty=false +input.1.joystick.0.disabled=false +input.1.joystick.0.axis.0=JOY1_HORIZ.0 +input.1.joystick.0.axis.1=JOY1_VERT.0 +input.1.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.1.empty=false +input.1.joystick.1.disabled=true +input.1.joystick.1.axis.0=JOY2_HORIZ.0 +input.1.joystick.1.axis.1=JOY2_VERT.0 +input.1.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.2.empty=false +input.1.joystick.2.disabled=true +input.1.joystick.2.axis.0=JOY1_HORIZ.0 +input.1.joystick.2.axis.1=JOY1_VERT.0 +input.1.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.3.empty=false +input.1.joystick.3.disabled=true +input.1.joystick.3.axis.0=JOY2_HORIZ.0 +input.1.joystick.3.axis.1=JOY2_VERT.0 +input.1.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.4.empty=false +input.1.joystick.4.disabled=true +input.1.joystick.4.axis.0=JOY1_HORIZ.0 +input.1.joystick.4.axis.1=JOY1_VERT.0 +input.1.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.5.empty=false +input.1.joystick.5.disabled=true +input.1.joystick.5.axis.0=JOY2_HORIZ.0 +input.1.joystick.5.axis.1=JOY2_VERT.0 +input.1.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.6.empty=false +input.1.joystick.6.disabled=true +input.1.joystick.6.axis.0=JOY1_HORIZ.0 +input.1.joystick.6.axis.1=JOY1_VERT.0 +input.1.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.7.empty=false +input.1.joystick.7.disabled=true +input.1.joystick.7.axis.0=JOY2_HORIZ.0 +input.1.joystick.7.axis.1=JOY2_VERT.0 +input.1.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.8.empty=true +input.1.joystick.9.empty=true +input.1.joystick.10.empty=true +input.1.joystick.11.empty=true +input.1.joystick.12.empty=true +input.1.joystick.13.empty=true +input.1.joystick.14.empty=true +input.1.joystick.15.empty=true +input.1.joystick.16.empty=true +input.1.joystick.17.empty=true +input.1.joystick.18.empty=true +input.1.joystick.19.empty=true +input.1.mouse.0.friendlyname=Windows mouse +input.1.mouse.0.name=WINMOUSE1 +input.1.mouse.0.empty=false +input.1.mouse.0.disabled=false +input.1.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.0.axis.1=MOUSE1_VERT.0 +input.1.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.1.friendlyname=HID-compliant mouse +input.1.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.1.empty=true +input.1.mouse.2.friendlyname=VMware Pointing Device +input.1.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.2.empty=true +input.1.mouse.3.friendlyname=VMware USB Pointing Device +input.1.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.3.empty=false +input.1.mouse.3.disabled=true +input.1.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.3.axis.1=MOUSE1_VERT.0 +input.1.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.4.empty=false +input.1.mouse.4.disabled=true +input.1.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.4.axis.1=MOUSE1_VERT.0 +input.1.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.5.empty=false +input.1.mouse.5.disabled=true +input.1.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.5.axis.1=MOUSE2_VERT.0 +input.1.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.6.empty=false +input.1.mouse.6.disabled=true +input.1.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.6.axis.1=MOUSE1_VERT.0 +input.1.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.7.empty=false +input.1.mouse.7.disabled=true +input.1.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.7.axis.1=MOUSE2_VERT.0 +input.1.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.8.empty=false +input.1.mouse.8.disabled=true +input.1.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.8.axis.1=MOUSE1_VERT.0 +input.1.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.9.empty=false +input.1.mouse.9.disabled=true +input.1.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.9.axis.1=MOUSE2_VERT.0 +input.1.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.10.empty=true +input.1.mouse.11.empty=true +input.1.mouse.12.empty=true +input.1.mouse.13.empty=true +input.1.mouse.14.empty=true +input.1.mouse.15.empty=true +input.1.mouse.16.empty=true +input.1.mouse.17.empty=true +input.1.mouse.18.empty=true +input.1.mouse.19.empty=true +input.1.keyboard.0.friendlyname=WinUAE keyboard +input.1.keyboard.0.name=NULLKEYBOARD +input.1.keyboard.0.empty=false +input.1.keyboard.0.disabled=false +input.1.keyboard.0.button.103.KEY_66=SPC_PAUSE.0 +input.1.keyboard.0.button.104.KEY_67=SPC_SINGLESTEP.0 +input.1.keyboard.0.button.105.KEY_68=SPC_WARP.0 +input.1.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.1.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.1.keyboard.1.empty=true +input.1.keyboard.2.empty=true +input.1.keyboard.3.empty=true +input.1.keyboard.4.empty=true +input.1.keyboard.5.empty=true +input.1.keyboard.6.empty=true +input.1.keyboard.7.empty=true +input.1.keyboard.8.empty=true +input.1.keyboard.9.empty=true +input.1.keyboard.10.empty=true +input.1.keyboard.11.empty=true +input.1.keyboard.12.empty=true +input.1.keyboard.13.empty=true +input.1.keyboard.14.empty=true +input.1.keyboard.15.empty=true +input.1.keyboard.16.empty=true +input.1.keyboard.17.empty=true +input.1.keyboard.18.empty=true +input.1.keyboard.19.empty=true +input.1.internal.0.friendlyname=Internal events +input.1.internal.0.name=INTERNALEVENTS1 +input.1.internal.0.empty=true +input.2.joystick.0.empty=false +input.2.joystick.0.disabled=false +input.2.joystick.0.axis.0=JOY1_HORIZ.0 +input.2.joystick.0.axis.1=JOY1_VERT.0 +input.2.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.1.empty=false +input.2.joystick.1.disabled=true +input.2.joystick.1.axis.0=JOY2_HORIZ.0 +input.2.joystick.1.axis.1=JOY2_VERT.0 +input.2.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.2.empty=false +input.2.joystick.2.disabled=true +input.2.joystick.2.axis.0=JOY1_HORIZ.0 +input.2.joystick.2.axis.1=JOY1_VERT.0 +input.2.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.3.empty=false +input.2.joystick.3.disabled=true +input.2.joystick.3.axis.0=JOY2_HORIZ.0 +input.2.joystick.3.axis.1=JOY2_VERT.0 +input.2.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.4.empty=false +input.2.joystick.4.disabled=true +input.2.joystick.4.axis.0=JOY1_HORIZ.0 +input.2.joystick.4.axis.1=JOY1_VERT.0 +input.2.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.5.empty=false +input.2.joystick.5.disabled=true +input.2.joystick.5.axis.0=JOY2_HORIZ.0 +input.2.joystick.5.axis.1=JOY2_VERT.0 +input.2.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.6.empty=false +input.2.joystick.6.disabled=true +input.2.joystick.6.axis.0=JOY1_HORIZ.0 +input.2.joystick.6.axis.1=JOY1_VERT.0 +input.2.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.7.empty=false +input.2.joystick.7.disabled=true +input.2.joystick.7.axis.0=JOY2_HORIZ.0 +input.2.joystick.7.axis.1=JOY2_VERT.0 +input.2.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.8.empty=true +input.2.joystick.9.empty=true +input.2.joystick.10.empty=true +input.2.joystick.11.empty=true +input.2.joystick.12.empty=true +input.2.joystick.13.empty=true +input.2.joystick.14.empty=true +input.2.joystick.15.empty=true +input.2.joystick.16.empty=true +input.2.joystick.17.empty=true +input.2.joystick.18.empty=true +input.2.joystick.19.empty=true +input.2.mouse.0.friendlyname=Windows mouse +input.2.mouse.0.name=WINMOUSE1 +input.2.mouse.0.empty=false +input.2.mouse.0.disabled=false +input.2.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.0.axis.1=MOUSE1_VERT.0 +input.2.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.1.friendlyname=HID-compliant mouse +input.2.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.1.empty=true +input.2.mouse.2.friendlyname=VMware Pointing Device +input.2.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.2.empty=true +input.2.mouse.3.friendlyname=VMware USB Pointing Device +input.2.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.3.empty=false +input.2.mouse.3.disabled=true +input.2.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.3.axis.1=MOUSE1_VERT.0 +input.2.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.4.empty=false +input.2.mouse.4.disabled=true +input.2.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.4.axis.1=MOUSE1_VERT.0 +input.2.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.5.empty=false +input.2.mouse.5.disabled=true +input.2.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.5.axis.1=MOUSE2_VERT.0 +input.2.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.6.empty=false +input.2.mouse.6.disabled=true +input.2.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.6.axis.1=MOUSE1_VERT.0 +input.2.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.7.empty=false +input.2.mouse.7.disabled=true +input.2.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.7.axis.1=MOUSE2_VERT.0 +input.2.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.8.empty=false +input.2.mouse.8.disabled=true +input.2.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.8.axis.1=MOUSE1_VERT.0 +input.2.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.9.empty=false +input.2.mouse.9.disabled=true +input.2.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.9.axis.1=MOUSE2_VERT.0 +input.2.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.10.empty=true +input.2.mouse.11.empty=true +input.2.mouse.12.empty=true +input.2.mouse.13.empty=true +input.2.mouse.14.empty=true +input.2.mouse.15.empty=true +input.2.mouse.16.empty=true +input.2.mouse.17.empty=true +input.2.mouse.18.empty=true +input.2.mouse.19.empty=true +input.2.keyboard.0.friendlyname=WinUAE keyboard +input.2.keyboard.0.name=NULLKEYBOARD +input.2.keyboard.0.empty=false +input.2.keyboard.0.disabled=false +input.2.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.2.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.2.keyboard.1.empty=true +input.2.keyboard.2.empty=true +input.2.keyboard.3.empty=true +input.2.keyboard.4.empty=true +input.2.keyboard.5.empty=true +input.2.keyboard.6.empty=true +input.2.keyboard.7.empty=true +input.2.keyboard.8.empty=true +input.2.keyboard.9.empty=true +input.2.keyboard.10.empty=true +input.2.keyboard.11.empty=true +input.2.keyboard.12.empty=true +input.2.keyboard.13.empty=true +input.2.keyboard.14.empty=true +input.2.keyboard.15.empty=true +input.2.keyboard.16.empty=true +input.2.keyboard.17.empty=true +input.2.keyboard.18.empty=true +input.2.keyboard.19.empty=true +input.2.internal.0.friendlyname=Internal events +input.2.internal.0.name=INTERNALEVENTS1 +input.2.internal.0.empty=true +input.3.joystick.0.empty=false +input.3.joystick.0.disabled=false +input.3.joystick.0.axis.0=JOY1_HORIZ.0 +input.3.joystick.0.axis.1=JOY1_VERT.0 +input.3.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.1.empty=false +input.3.joystick.1.disabled=true +input.3.joystick.1.axis.0=JOY2_HORIZ.0 +input.3.joystick.1.axis.1=JOY2_VERT.0 +input.3.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.2.empty=false +input.3.joystick.2.disabled=true +input.3.joystick.2.axis.0=JOY1_HORIZ.0 +input.3.joystick.2.axis.1=JOY1_VERT.0 +input.3.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.3.empty=false +input.3.joystick.3.disabled=true +input.3.joystick.3.axis.0=JOY2_HORIZ.0 +input.3.joystick.3.axis.1=JOY2_VERT.0 +input.3.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.4.empty=false +input.3.joystick.4.disabled=true +input.3.joystick.4.axis.0=JOY1_HORIZ.0 +input.3.joystick.4.axis.1=JOY1_VERT.0 +input.3.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.5.empty=false +input.3.joystick.5.disabled=true +input.3.joystick.5.axis.0=JOY2_HORIZ.0 +input.3.joystick.5.axis.1=JOY2_VERT.0 +input.3.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.6.empty=false +input.3.joystick.6.disabled=true +input.3.joystick.6.axis.0=JOY1_HORIZ.0 +input.3.joystick.6.axis.1=JOY1_VERT.0 +input.3.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.7.empty=false +input.3.joystick.7.disabled=true +input.3.joystick.7.axis.0=JOY2_HORIZ.0 +input.3.joystick.7.axis.1=JOY2_VERT.0 +input.3.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.8.empty=true +input.3.joystick.9.empty=true +input.3.joystick.10.empty=true +input.3.joystick.11.empty=true +input.3.joystick.12.empty=true +input.3.joystick.13.empty=true +input.3.joystick.14.empty=true +input.3.joystick.15.empty=true +input.3.joystick.16.empty=true +input.3.joystick.17.empty=true +input.3.joystick.18.empty=true +input.3.joystick.19.empty=true +input.3.mouse.0.friendlyname=Windows mouse +input.3.mouse.0.name=WINMOUSE1 +input.3.mouse.0.empty=false +input.3.mouse.0.disabled=false +input.3.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.0.axis.1=MOUSE1_VERT.0 +input.3.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.1.friendlyname=HID-compliant mouse +input.3.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.1.empty=true +input.3.mouse.2.friendlyname=VMware Pointing Device +input.3.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.2.empty=true +input.3.mouse.3.friendlyname=VMware USB Pointing Device +input.3.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.3.empty=false +input.3.mouse.3.disabled=true +input.3.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.3.axis.1=MOUSE1_VERT.0 +input.3.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.4.empty=false +input.3.mouse.4.disabled=true +input.3.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.4.axis.1=MOUSE1_VERT.0 +input.3.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.5.empty=false +input.3.mouse.5.disabled=true +input.3.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.5.axis.1=MOUSE2_VERT.0 +input.3.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.6.empty=false +input.3.mouse.6.disabled=true +input.3.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.6.axis.1=MOUSE1_VERT.0 +input.3.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.7.empty=false +input.3.mouse.7.disabled=true +input.3.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.7.axis.1=MOUSE2_VERT.0 +input.3.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.8.empty=false +input.3.mouse.8.disabled=true +input.3.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.8.axis.1=MOUSE1_VERT.0 +input.3.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.9.empty=false +input.3.mouse.9.disabled=true +input.3.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.9.axis.1=MOUSE2_VERT.0 +input.3.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.10.empty=true +input.3.mouse.11.empty=true +input.3.mouse.12.empty=true +input.3.mouse.13.empty=true +input.3.mouse.14.empty=true +input.3.mouse.15.empty=true +input.3.mouse.16.empty=true +input.3.mouse.17.empty=true +input.3.mouse.18.empty=true +input.3.mouse.19.empty=true +input.3.keyboard.0.friendlyname=WinUAE keyboard +input.3.keyboard.0.name=NULLKEYBOARD +input.3.keyboard.0.empty=false +input.3.keyboard.0.disabled=false +input.3.keyboard.0.button.103.KEY_66=SPC_PAUSE.0 +input.3.keyboard.0.button.104.KEY_67=SPC_SINGLESTEP.0 +input.3.keyboard.0.button.105.KEY_68=SPC_WARP.0 +input.3.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.3.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.3.keyboard.1.empty=true +input.3.keyboard.2.empty=true +input.3.keyboard.3.empty=true +input.3.keyboard.4.empty=true +input.3.keyboard.5.empty=true +input.3.keyboard.6.empty=true +input.3.keyboard.7.empty=true +input.3.keyboard.8.empty=true +input.3.keyboard.9.empty=true +input.3.keyboard.10.empty=true +input.3.keyboard.11.empty=true +input.3.keyboard.12.empty=true +input.3.keyboard.13.empty=true +input.3.keyboard.14.empty=true +input.3.keyboard.15.empty=true +input.3.keyboard.16.empty=true +input.3.keyboard.17.empty=true +input.3.keyboard.18.empty=true +input.3.keyboard.19.empty=true +input.3.internal.0.friendlyname=Internal events +input.3.internal.0.name=INTERNALEVENTS1 +input.3.internal.0.empty=true +input.4.keyboard.0.friendlyname=WinUAE keyboard +input.4.keyboard.0.name=NULLKEYBOARD +input.4.keyboard.0.custom=true diff --git a/source/winuae/configs/a500_hrt_more_mem.uae b/source/winuae/configs/a500_hrt_more_mem.uae new file mode 100755 index 0000000..aed374d --- /dev/null +++ b/source/winuae/configs/a500_hrt_more_mem.uae @@ -0,0 +1,747 @@ +config_description= +config_hardware=true +config_host=true +config_version=4.3.0 +config_hardware_path= +config_host_path= +config_all_path= +comp_catchdetect=true +ksmirror=e0 +win32.rom_path=./ +win32.floppy_path=./ +win32.hardfile_path=./ +; host-specific +win32.middle_mouse=true +win32.logfile=true +win32.start_not_captured=true +win32.soundcard=0 +win32.soundcardname=WASAPI:Default Audio Device +win32.kbledmode=0 +; common +use_gui=no +use_debugger=false +kickstart_rom_file=.\roms\Kick13.rom +kickstart_rom_file_id=C4F0F55F,KS ROM v1.3 (A500,A1000,A2000) +kickstart_ext_rom_file= +flash_file= +cart_file=:HRTMon +rtc_file= +kickshifter=false +floppy_volume=33 +floppy0= +floppy1= +floppy1type=-1 +floppy2= +floppy3= +nr_floppies=1 +floppy_speed=100 +cd_speed=100 +parallel_on_demand=false +serial_on_demand=false +serial_hardware_ctsrts=true +serial_direct=false +scsi=false +uaeserial=false +sana2=false +sound_output=exact +sound_channels=stereo +sound_stereo_separation=7 +sound_stereo_mixing_delay=0 +sound_max_buff=16384 +sound_frequency=44100 +sound_interpol=anti +sound_filter=emulated +sound_filter_type=standard +sound_volume=0 +sound_volume_paula=0 +sound_volume_cd=0 +sound_volume_ahi=0 +sound_volume_midi=0 +sound_volume_genlock=0 +sound_auto=true +sound_cdaudio=false +sound_stereo_swap_paula=false +sound_stereo_swap_ahi=false +comp_trustbyte=indirect +comp_trustword=indirect +comp_trustlong=indirect +comp_trustnaddr=indirect +comp_nf=true +comp_constjump=true +comp_flushmode=soft +compfpu=true +comp_catchfault=true +cachesize=0 +joyport0=mouse +joyport0autofire=none +joyportfriendlyname0=Windows mouse +joyportname0=WINMOUSE1 +joyport1=kbd1 +joyport1autofire=none +bsdsocket_emu=false +synchronize_clock=false +maprom=0x0 +parallel_postscript_emulation=false +parallel_postscript_detection=false +ghostscript_parameters= +parallel_autoflush=5 +gfx_display=0 +gfx_display_rtg=0 +gfx_framerate=1 +gfx_width=1508 +gfx_height=1152 +gfx_top_windowed=0 +gfx_left_windowed=30 +gfx_width_windowed=1508 +gfx_height_windowed=1152 +gfx_width_fullscreen=1600 +gfx_height_fullscreen=1200 +gfx_refreshrate=0 +gfx_autoresolution=0 +gfx_autoresolution_vga=true +gfx_backbuffers=2 +gfx_backbuffers_rtg=1 +gfx_vsync=false +gfx_vsyncmode=normal +gfx_vsync_picasso=false +gfx_vsyncmode_picasso=normal +gfx_lores=false +gfx_resolution=hires +gfx_lores_mode=normal +gfx_flickerfixer=false +gfx_linemode=double +gfx_fullscreen_amiga=false +gfx_fullscreen_picasso=false +gfx_center_horizontal=none +gfx_center_vertical=none +gfx_colour_mode=32bit +gfx_blacker_than_black=false +gfx_api=direct3d11 +gfx_api_options=hardware +gfx_filter=no +gfx_filter_autoscale=max +immediate_blits=false +waiting_blits=automatic +ntsc=false +genlock=false +chipset=ocs +chipset_refreshrate=49.920410 +collision_level=playfields +chipset_compatible=A500 +chipset_hacks=8 +rtc=MSM6242B +resetwarning=false +cia_todbug=true +fastmem_size=0 +debugmem_start=0x0 +debugmem_size=0 +mem25bit_size=0 +a3000mem_size=0 +mbresmem_size=0 +z3mem_size=0 +z3mem_start=0x40000000 +bogomem_size=2 +gfxcard_hardware_vblank=false +gfxcard_hardware_sprite=true +gfxcard_multithread=false +chipmem_size=2 +cpu_speed=real +cpu_throttle=0.0 +cpu_type=68000 +cpu_model=68000 +cpu_compatible=true +cpu_24bit_addressing=true +cpu_data_cache=false +cpu_cycle_exact=false +cpu_memory_cycle_exact=false +blitter_cycle_exact=false +cycle_exact=false +fpu_strict=false +rtg_nocustom=true +rtg_modes=0x212 +log_illegal_mem=true +debug_mem=true +kbd_lang=us +warp=true +filesystem2=rw,hd0:testhd:.\hd0,0 +uaehf0=dir,rw,hd0:testhd:.\hd0,0 +input.config=1 +input.joymouse_speed_analog=20 +input.joymouse_speed_digital=10 +input.joymouse_deadzone=33 +input.joystick_deadzone=33 +input.analog_joystick_multiplier=15 +input.analog_joystick_offset=-1 +input.mouse_speed=100 +input.autofire_speed=600 +input.autoswitch=1 +input.1.joystick.0.empty=false +input.1.joystick.0.disabled=false +input.1.joystick.0.axis.0=JOY1_HORIZ.0 +input.1.joystick.0.axis.1=JOY1_VERT.0 +input.1.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.1.empty=false +input.1.joystick.1.disabled=true +input.1.joystick.1.axis.0=JOY2_HORIZ.0 +input.1.joystick.1.axis.1=JOY2_VERT.0 +input.1.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.2.empty=false +input.1.joystick.2.disabled=true +input.1.joystick.2.axis.0=JOY1_HORIZ.0 +input.1.joystick.2.axis.1=JOY1_VERT.0 +input.1.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.3.empty=false +input.1.joystick.3.disabled=true +input.1.joystick.3.axis.0=JOY2_HORIZ.0 +input.1.joystick.3.axis.1=JOY2_VERT.0 +input.1.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.4.empty=false +input.1.joystick.4.disabled=true +input.1.joystick.4.axis.0=JOY1_HORIZ.0 +input.1.joystick.4.axis.1=JOY1_VERT.0 +input.1.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.5.empty=false +input.1.joystick.5.disabled=true +input.1.joystick.5.axis.0=JOY2_HORIZ.0 +input.1.joystick.5.axis.1=JOY2_VERT.0 +input.1.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.6.empty=false +input.1.joystick.6.disabled=true +input.1.joystick.6.axis.0=JOY1_HORIZ.0 +input.1.joystick.6.axis.1=JOY1_VERT.0 +input.1.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.7.empty=false +input.1.joystick.7.disabled=true +input.1.joystick.7.axis.0=JOY2_HORIZ.0 +input.1.joystick.7.axis.1=JOY2_VERT.0 +input.1.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.8.empty=true +input.1.joystick.9.empty=true +input.1.joystick.10.empty=true +input.1.joystick.11.empty=true +input.1.joystick.12.empty=true +input.1.joystick.13.empty=true +input.1.joystick.14.empty=true +input.1.joystick.15.empty=true +input.1.joystick.16.empty=true +input.1.joystick.17.empty=true +input.1.joystick.18.empty=true +input.1.joystick.19.empty=true +input.1.mouse.0.friendlyname=Windows mouse +input.1.mouse.0.name=WINMOUSE1 +input.1.mouse.0.empty=false +input.1.mouse.0.disabled=false +input.1.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.0.axis.1=MOUSE1_VERT.0 +input.1.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.1.friendlyname=HID-compliant mouse +input.1.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.1.empty=true +input.1.mouse.2.friendlyname=VMware Pointing Device +input.1.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.2.empty=true +input.1.mouse.3.friendlyname=VMware USB Pointing Device +input.1.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.3.empty=false +input.1.mouse.3.disabled=true +input.1.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.3.axis.1=MOUSE1_VERT.0 +input.1.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.4.empty=false +input.1.mouse.4.disabled=true +input.1.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.4.axis.1=MOUSE1_VERT.0 +input.1.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.5.empty=false +input.1.mouse.5.disabled=true +input.1.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.5.axis.1=MOUSE2_VERT.0 +input.1.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.6.empty=false +input.1.mouse.6.disabled=true +input.1.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.6.axis.1=MOUSE1_VERT.0 +input.1.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.7.empty=false +input.1.mouse.7.disabled=true +input.1.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.7.axis.1=MOUSE2_VERT.0 +input.1.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.8.empty=false +input.1.mouse.8.disabled=true +input.1.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.8.axis.1=MOUSE1_VERT.0 +input.1.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.9.empty=false +input.1.mouse.9.disabled=true +input.1.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.9.axis.1=MOUSE2_VERT.0 +input.1.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.10.empty=true +input.1.mouse.11.empty=true +input.1.mouse.12.empty=true +input.1.mouse.13.empty=true +input.1.mouse.14.empty=true +input.1.mouse.15.empty=true +input.1.mouse.16.empty=true +input.1.mouse.17.empty=true +input.1.mouse.18.empty=true +input.1.mouse.19.empty=true +input.1.keyboard.0.friendlyname=WinUAE keyboard +input.1.keyboard.0.name=NULLKEYBOARD +input.1.keyboard.0.empty=false +input.1.keyboard.0.disabled=false +input.1.keyboard.0.button.103.KEY_66=SPC_PAUSE.0 +input.1.keyboard.0.button.104.KEY_67=SPC_SINGLESTEP.0 +input.1.keyboard.0.button.105.KEY_68=SPC_WARP.0 +input.1.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.1.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.1.keyboard.1.empty=true +input.1.keyboard.2.empty=true +input.1.keyboard.3.empty=true +input.1.keyboard.4.empty=true +input.1.keyboard.5.empty=true +input.1.keyboard.6.empty=true +input.1.keyboard.7.empty=true +input.1.keyboard.8.empty=true +input.1.keyboard.9.empty=true +input.1.keyboard.10.empty=true +input.1.keyboard.11.empty=true +input.1.keyboard.12.empty=true +input.1.keyboard.13.empty=true +input.1.keyboard.14.empty=true +input.1.keyboard.15.empty=true +input.1.keyboard.16.empty=true +input.1.keyboard.17.empty=true +input.1.keyboard.18.empty=true +input.1.keyboard.19.empty=true +input.1.internal.0.friendlyname=Internal events +input.1.internal.0.name=INTERNALEVENTS1 +input.1.internal.0.empty=true +input.2.joystick.0.empty=false +input.2.joystick.0.disabled=false +input.2.joystick.0.axis.0=JOY1_HORIZ.0 +input.2.joystick.0.axis.1=JOY1_VERT.0 +input.2.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.1.empty=false +input.2.joystick.1.disabled=true +input.2.joystick.1.axis.0=JOY2_HORIZ.0 +input.2.joystick.1.axis.1=JOY2_VERT.0 +input.2.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.2.empty=false +input.2.joystick.2.disabled=true +input.2.joystick.2.axis.0=JOY1_HORIZ.0 +input.2.joystick.2.axis.1=JOY1_VERT.0 +input.2.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.3.empty=false +input.2.joystick.3.disabled=true +input.2.joystick.3.axis.0=JOY2_HORIZ.0 +input.2.joystick.3.axis.1=JOY2_VERT.0 +input.2.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.4.empty=false +input.2.joystick.4.disabled=true +input.2.joystick.4.axis.0=JOY1_HORIZ.0 +input.2.joystick.4.axis.1=JOY1_VERT.0 +input.2.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.5.empty=false +input.2.joystick.5.disabled=true +input.2.joystick.5.axis.0=JOY2_HORIZ.0 +input.2.joystick.5.axis.1=JOY2_VERT.0 +input.2.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.6.empty=false +input.2.joystick.6.disabled=true +input.2.joystick.6.axis.0=JOY1_HORIZ.0 +input.2.joystick.6.axis.1=JOY1_VERT.0 +input.2.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.7.empty=false +input.2.joystick.7.disabled=true +input.2.joystick.7.axis.0=JOY2_HORIZ.0 +input.2.joystick.7.axis.1=JOY2_VERT.0 +input.2.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.8.empty=true +input.2.joystick.9.empty=true +input.2.joystick.10.empty=true +input.2.joystick.11.empty=true +input.2.joystick.12.empty=true +input.2.joystick.13.empty=true +input.2.joystick.14.empty=true +input.2.joystick.15.empty=true +input.2.joystick.16.empty=true +input.2.joystick.17.empty=true +input.2.joystick.18.empty=true +input.2.joystick.19.empty=true +input.2.mouse.0.friendlyname=Windows mouse +input.2.mouse.0.name=WINMOUSE1 +input.2.mouse.0.empty=false +input.2.mouse.0.disabled=false +input.2.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.0.axis.1=MOUSE1_VERT.0 +input.2.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.1.friendlyname=HID-compliant mouse +input.2.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.1.empty=true +input.2.mouse.2.friendlyname=VMware Pointing Device +input.2.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.2.empty=true +input.2.mouse.3.friendlyname=VMware USB Pointing Device +input.2.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.3.empty=false +input.2.mouse.3.disabled=true +input.2.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.3.axis.1=MOUSE1_VERT.0 +input.2.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.4.empty=false +input.2.mouse.4.disabled=true +input.2.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.4.axis.1=MOUSE1_VERT.0 +input.2.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.5.empty=false +input.2.mouse.5.disabled=true +input.2.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.5.axis.1=MOUSE2_VERT.0 +input.2.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.6.empty=false +input.2.mouse.6.disabled=true +input.2.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.6.axis.1=MOUSE1_VERT.0 +input.2.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.7.empty=false +input.2.mouse.7.disabled=true +input.2.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.7.axis.1=MOUSE2_VERT.0 +input.2.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.8.empty=false +input.2.mouse.8.disabled=true +input.2.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.8.axis.1=MOUSE1_VERT.0 +input.2.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.9.empty=false +input.2.mouse.9.disabled=true +input.2.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.9.axis.1=MOUSE2_VERT.0 +input.2.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.10.empty=true +input.2.mouse.11.empty=true +input.2.mouse.12.empty=true +input.2.mouse.13.empty=true +input.2.mouse.14.empty=true +input.2.mouse.15.empty=true +input.2.mouse.16.empty=true +input.2.mouse.17.empty=true +input.2.mouse.18.empty=true +input.2.mouse.19.empty=true +input.2.keyboard.0.friendlyname=WinUAE keyboard +input.2.keyboard.0.name=NULLKEYBOARD +input.2.keyboard.0.empty=false +input.2.keyboard.0.disabled=false +input.2.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.2.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.2.keyboard.1.empty=true +input.2.keyboard.2.empty=true +input.2.keyboard.3.empty=true +input.2.keyboard.4.empty=true +input.2.keyboard.5.empty=true +input.2.keyboard.6.empty=true +input.2.keyboard.7.empty=true +input.2.keyboard.8.empty=true +input.2.keyboard.9.empty=true +input.2.keyboard.10.empty=true +input.2.keyboard.11.empty=true +input.2.keyboard.12.empty=true +input.2.keyboard.13.empty=true +input.2.keyboard.14.empty=true +input.2.keyboard.15.empty=true +input.2.keyboard.16.empty=true +input.2.keyboard.17.empty=true +input.2.keyboard.18.empty=true +input.2.keyboard.19.empty=true +input.2.internal.0.friendlyname=Internal events +input.2.internal.0.name=INTERNALEVENTS1 +input.2.internal.0.empty=true +input.3.joystick.0.empty=false +input.3.joystick.0.disabled=false +input.3.joystick.0.axis.0=JOY1_HORIZ.0 +input.3.joystick.0.axis.1=JOY1_VERT.0 +input.3.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.1.empty=false +input.3.joystick.1.disabled=true +input.3.joystick.1.axis.0=JOY2_HORIZ.0 +input.3.joystick.1.axis.1=JOY2_VERT.0 +input.3.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.2.empty=false +input.3.joystick.2.disabled=true +input.3.joystick.2.axis.0=JOY1_HORIZ.0 +input.3.joystick.2.axis.1=JOY1_VERT.0 +input.3.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.3.empty=false +input.3.joystick.3.disabled=true +input.3.joystick.3.axis.0=JOY2_HORIZ.0 +input.3.joystick.3.axis.1=JOY2_VERT.0 +input.3.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.4.empty=false +input.3.joystick.4.disabled=true +input.3.joystick.4.axis.0=JOY1_HORIZ.0 +input.3.joystick.4.axis.1=JOY1_VERT.0 +input.3.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.5.empty=false +input.3.joystick.5.disabled=true +input.3.joystick.5.axis.0=JOY2_HORIZ.0 +input.3.joystick.5.axis.1=JOY2_VERT.0 +input.3.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.6.empty=false +input.3.joystick.6.disabled=true +input.3.joystick.6.axis.0=JOY1_HORIZ.0 +input.3.joystick.6.axis.1=JOY1_VERT.0 +input.3.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.7.empty=false +input.3.joystick.7.disabled=true +input.3.joystick.7.axis.0=JOY2_HORIZ.0 +input.3.joystick.7.axis.1=JOY2_VERT.0 +input.3.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.8.empty=true +input.3.joystick.9.empty=true +input.3.joystick.10.empty=true +input.3.joystick.11.empty=true +input.3.joystick.12.empty=true +input.3.joystick.13.empty=true +input.3.joystick.14.empty=true +input.3.joystick.15.empty=true +input.3.joystick.16.empty=true +input.3.joystick.17.empty=true +input.3.joystick.18.empty=true +input.3.joystick.19.empty=true +input.3.mouse.0.friendlyname=Windows mouse +input.3.mouse.0.name=WINMOUSE1 +input.3.mouse.0.empty=false +input.3.mouse.0.disabled=false +input.3.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.0.axis.1=MOUSE1_VERT.0 +input.3.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.1.friendlyname=HID-compliant mouse +input.3.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&2f818f48&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.1.empty=true +input.3.mouse.2.friendlyname=VMware Pointing Device +input.3.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.2.empty=true +input.3.mouse.3.friendlyname=VMware USB Pointing Device +input.3.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&17be0303&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.3.empty=false +input.3.mouse.3.disabled=true +input.3.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.3.axis.1=MOUSE1_VERT.0 +input.3.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.4.empty=false +input.3.mouse.4.disabled=true +input.3.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.4.axis.1=MOUSE1_VERT.0 +input.3.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.5.empty=false +input.3.mouse.5.disabled=true +input.3.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.5.axis.1=MOUSE2_VERT.0 +input.3.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.6.empty=false +input.3.mouse.6.disabled=true +input.3.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.6.axis.1=MOUSE1_VERT.0 +input.3.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.7.empty=false +input.3.mouse.7.disabled=true +input.3.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.7.axis.1=MOUSE2_VERT.0 +input.3.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.8.empty=false +input.3.mouse.8.disabled=true +input.3.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.8.axis.1=MOUSE1_VERT.0 +input.3.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.9.empty=false +input.3.mouse.9.disabled=true +input.3.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.9.axis.1=MOUSE2_VERT.0 +input.3.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.10.empty=true +input.3.mouse.11.empty=true +input.3.mouse.12.empty=true +input.3.mouse.13.empty=true +input.3.mouse.14.empty=true +input.3.mouse.15.empty=true +input.3.mouse.16.empty=true +input.3.mouse.17.empty=true +input.3.mouse.18.empty=true +input.3.mouse.19.empty=true +input.3.keyboard.0.friendlyname=WinUAE keyboard +input.3.keyboard.0.name=NULLKEYBOARD +input.3.keyboard.0.empty=false +input.3.keyboard.0.disabled=false +input.3.keyboard.0.button.103.KEY_66=SPC_PAUSE.0 +input.3.keyboard.0.button.104.KEY_67=SPC_SINGLESTEP.0 +input.3.keyboard.0.button.105.KEY_68=SPC_WARP.0 +input.3.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.3.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.3.keyboard.1.empty=true +input.3.keyboard.2.empty=true +input.3.keyboard.3.empty=true +input.3.keyboard.4.empty=true +input.3.keyboard.5.empty=true +input.3.keyboard.6.empty=true +input.3.keyboard.7.empty=true +input.3.keyboard.8.empty=true +input.3.keyboard.9.empty=true +input.3.keyboard.10.empty=true +input.3.keyboard.11.empty=true +input.3.keyboard.12.empty=true +input.3.keyboard.13.empty=true +input.3.keyboard.14.empty=true +input.3.keyboard.15.empty=true +input.3.keyboard.16.empty=true +input.3.keyboard.17.empty=true +input.3.keyboard.18.empty=true +input.3.keyboard.19.empty=true +input.3.internal.0.friendlyname=Internal events +input.3.internal.0.name=INTERNALEVENTS1 +input.3.internal.0.empty=true +input.4.keyboard.0.friendlyname=WinUAE keyboard +input.4.keyboard.0.name=NULLKEYBOARD +input.4.keyboard.0.custom=true diff --git a/source/winuae/configs/a500_rec.uae b/source/winuae/configs/a500_rec.uae new file mode 100755 index 0000000..7821eb1 --- /dev/null +++ b/source/winuae/configs/a500_rec.uae @@ -0,0 +1,746 @@ +config_description= +config_hardware=true +config_host=true +config_version=4.4.0 +config_hardware_path= +config_host_path= +config_all_path= +ksmirror=e0 +comp_catchdetect=true +win32.rom_path=./ +win32.floppy_path=./ +win32.hardfile_path=./ +; host-specific +win32.middle_mouse=true +win32.logfile=true +win32.start_not_captured=true +win32.soundcard=0 +win32.soundcardname=WASAPI:Default Audio Device +win32.kbledmode=0 +; common +use_gui=no +use_debugger=false +kickstart_rom_file=.\roms\Kick13.rom +kickstart_rom_file_id=C4F0F55F,KS ROM v1.3 (A500,A1000,A2000) +kickstart_ext_rom_file= +flash_file= +cart_file=:HRTMon +rtc_file= +kickshifter=false +floppy_volume=33 +floppy0= +floppy1= +floppy1type=-1 +floppy2= +floppy3= +nr_floppies=1 +floppy_speed=100 +cd_speed=100 +parallel_on_demand=false +serial_on_demand=false +serial_hardware_ctsrts=true +serial_direct=false +scsi=false +uaeserial=false +sana2=false +sound_output=exact +sound_channels=stereo +sound_stereo_separation=7 +sound_stereo_mixing_delay=0 +sound_max_buff=16384 +sound_frequency=44100 +sound_interpol=anti +sound_filter=emulated +sound_filter_type=standard +sound_volume=0 +sound_volume_paula=0 +sound_volume_cd=0 +sound_volume_ahi=0 +sound_volume_midi=0 +sound_volume_genlock=0 +sound_auto=true +sound_cdaudio=false +sound_stereo_swap_paula=false +sound_stereo_swap_ahi=false +comp_trustbyte=indirect +comp_trustword=indirect +comp_trustlong=indirect +comp_trustnaddr=indirect +comp_nf=true +comp_constjump=true +comp_flushmode=soft +compfpu=true +comp_catchdetect=true +cachesize=0 +joyport0=mouse +joyport0autofire=none +joyportfriendlyname0=Windows mouse +joyportname0=WINMOUSE1 +joyport1=kbd1 +joyport1autofire=none +bsdsocket_emu=false +synchronize_clock=false +maprom=0x0 +parallel_postscript_emulation=false +parallel_postscript_detection=false +ghostscript_parameters= +parallel_autoflush=5 +gfx_display=0 +gfx_display_rtg=0 +gfx_framerate=1 +gfx_width=377 +gfx_height=288 +gfx_top_windowed=14 +gfx_left_windowed=31 +gfx_resize_windowed=false +gfx_width_windowed=377 +gfx_height_windowed=288 +gfx_width_fullscreen=640 +gfx_height_fullscreen=480 +gfx_refreshrate=0 +gfx_autoresolution=0 +gfx_autoresolution_vga=false +gfx_backbuffers=2 +gfx_backbuffers_rtg=1 +gfx_vsync=false +gfx_vsyncmode=normal +gfx_vsync_picasso=false +gfx_vsyncmode_picasso=normal +gfx_lores=true +gfx_resolution=lores +gfx_lores_mode=normal +gfx_flickerfixer=false +gfx_linemode=none +gfx_fullscreen_amiga=false +gfx_fullscreen_picasso=false +gfx_center_horizontal=smart +gfx_center_vertical=smart +gfx_colour_mode=32bit +gfx_blacker_than_black=false +gfx_api=direct3d11 +gfx_api_options=hardware +gfx_filter=no +gfx_filter_autoscale=max +immediate_blits=false +waiting_blits=automatic +ntsc=false +genlock=false +chipset=ocs +chipset_refreshrate=49.920410 +collision_level=playfields +chipset_compatible=A500 +rtc=MSM6242B +resetwarning=false +cia_todbug=true +fastmem_size=0 +debugmem_start=0x0 +debugmem_size=0 +mem25bit_size=0 +a3000mem_size=0 +mbresmem_size=0 +z3mem_size=0 +z3mem_start=0x40000000 +bogomem_size=2 +gfxcard_hardware_vblank=false +gfxcard_hardware_sprite=true +gfxcard_multithread=false +chipmem_size=1 +cpu_speed=real +cpu_throttle=0.0 +cpu_type=68000 +cpu_model=68000 +cpu_compatible=true +cpu_24bit_addressing=true +cpu_data_cache=false +cpu_multiplier=2 +cpu_cycle_exact=false +cpu_memory_cycle_exact=false +blitter_cycle_exact=false +cycle_exact=false +fpu_strict=false +rtg_nocustom=true +rtg_modes=0x212 +debug_mem=false +log_illegal_mem=true +kbd_lang=us +warp=false +filesystem2=rw,hd0:testhd:.\hd0,0 +uaehf0=dir,rw,hd0:testhd:.\hd0,0 +input.config=0 +input.joymouse_speed_analog=20 +input.joymouse_speed_digital=10 +input.joymouse_deadzone=33 +input.joystick_deadzone=33 +input.analog_joystick_multiplier=15 +input.analog_joystick_offset=-1 +input.mouse_speed=100 +input.autofire_speed=600 +input.autoswitch=1 +input.1.joystick.0.empty=false +input.1.joystick.0.disabled=false +input.1.joystick.0.axis.0=JOY1_HORIZ.0 +input.1.joystick.0.axis.1=JOY1_VERT.0 +input.1.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.1.empty=false +input.1.joystick.1.disabled=true +input.1.joystick.1.axis.0=JOY2_HORIZ.0 +input.1.joystick.1.axis.1=JOY2_VERT.0 +input.1.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.2.empty=false +input.1.joystick.2.disabled=true +input.1.joystick.2.axis.0=JOY1_HORIZ.0 +input.1.joystick.2.axis.1=JOY1_VERT.0 +input.1.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.3.empty=false +input.1.joystick.3.disabled=true +input.1.joystick.3.axis.0=JOY2_HORIZ.0 +input.1.joystick.3.axis.1=JOY2_VERT.0 +input.1.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.4.empty=false +input.1.joystick.4.disabled=true +input.1.joystick.4.axis.0=JOY1_HORIZ.0 +input.1.joystick.4.axis.1=JOY1_VERT.0 +input.1.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.5.empty=false +input.1.joystick.5.disabled=true +input.1.joystick.5.axis.0=JOY2_HORIZ.0 +input.1.joystick.5.axis.1=JOY2_VERT.0 +input.1.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.6.empty=false +input.1.joystick.6.disabled=true +input.1.joystick.6.axis.0=JOY1_HORIZ.0 +input.1.joystick.6.axis.1=JOY1_VERT.0 +input.1.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.7.empty=false +input.1.joystick.7.disabled=true +input.1.joystick.7.axis.0=JOY2_HORIZ.0 +input.1.joystick.7.axis.1=JOY2_VERT.0 +input.1.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.8.empty=true +input.1.joystick.9.empty=true +input.1.joystick.10.empty=true +input.1.joystick.11.empty=true +input.1.joystick.12.empty=true +input.1.joystick.13.empty=true +input.1.joystick.14.empty=true +input.1.joystick.15.empty=true +input.1.joystick.16.empty=true +input.1.joystick.17.empty=true +input.1.joystick.18.empty=true +input.1.joystick.19.empty=true +input.1.mouse.0.friendlyname=Windows mouse +input.1.mouse.0.name=WINMOUSE1 +input.1.mouse.0.empty=false +input.1.mouse.0.disabled=false +input.1.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.0.axis.1=MOUSE1_VERT.0 +input.1.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.1.friendlyname=HID-compliant mouse +input.1.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.1.empty=true +input.1.mouse.2.friendlyname=VMware Pointing Device +input.1.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.2.empty=true +input.1.mouse.3.friendlyname=VMware USB Pointing Device +input.1.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.3.empty=false +input.1.mouse.3.disabled=true +input.1.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.3.axis.1=MOUSE1_VERT.0 +input.1.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.4.empty=false +input.1.mouse.4.disabled=true +input.1.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.4.axis.1=MOUSE1_VERT.0 +input.1.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.5.empty=false +input.1.mouse.5.disabled=true +input.1.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.5.axis.1=MOUSE2_VERT.0 +input.1.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.6.empty=false +input.1.mouse.6.disabled=true +input.1.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.6.axis.1=MOUSE1_VERT.0 +input.1.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.7.empty=false +input.1.mouse.7.disabled=true +input.1.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.7.axis.1=MOUSE2_VERT.0 +input.1.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.8.empty=false +input.1.mouse.8.disabled=true +input.1.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.8.axis.1=MOUSE1_VERT.0 +input.1.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.9.empty=false +input.1.mouse.9.disabled=true +input.1.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.9.axis.1=MOUSE2_VERT.0 +input.1.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.10.empty=true +input.1.mouse.11.empty=true +input.1.mouse.12.empty=true +input.1.mouse.13.empty=true +input.1.mouse.14.empty=true +input.1.mouse.15.empty=true +input.1.mouse.16.empty=true +input.1.mouse.17.empty=true +input.1.mouse.18.empty=true +input.1.mouse.19.empty=true +input.1.keyboard.0.friendlyname=WinUAE keyboard +input.1.keyboard.0.name=NULLKEYBOARD +input.1.keyboard.0.empty=false +input.1.keyboard.0.disabled=false +input.1.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.1.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.1.keyboard.1.empty=true +input.1.keyboard.2.empty=true +input.1.keyboard.3.empty=true +input.1.keyboard.4.empty=true +input.1.keyboard.5.empty=true +input.1.keyboard.6.empty=true +input.1.keyboard.7.empty=true +input.1.keyboard.8.empty=true +input.1.keyboard.9.empty=true +input.1.keyboard.10.empty=true +input.1.keyboard.11.empty=true +input.1.keyboard.12.empty=true +input.1.keyboard.13.empty=true +input.1.keyboard.14.empty=true +input.1.keyboard.15.empty=true +input.1.keyboard.16.empty=true +input.1.keyboard.17.empty=true +input.1.keyboard.18.empty=true +input.1.keyboard.19.empty=true +input.1.internal.0.friendlyname=Internal events +input.1.internal.0.name=INTERNALEVENTS1 +input.1.internal.0.empty=true +input.1.internal.0.disabled=false +input.2.joystick.0.empty=false +input.2.joystick.0.disabled=false +input.2.joystick.0.axis.0=JOY1_HORIZ.0 +input.2.joystick.0.axis.1=JOY1_VERT.0 +input.2.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.1.empty=false +input.2.joystick.1.disabled=true +input.2.joystick.1.axis.0=JOY2_HORIZ.0 +input.2.joystick.1.axis.1=JOY2_VERT.0 +input.2.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.2.empty=false +input.2.joystick.2.disabled=true +input.2.joystick.2.axis.0=JOY1_HORIZ.0 +input.2.joystick.2.axis.1=JOY1_VERT.0 +input.2.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.3.empty=false +input.2.joystick.3.disabled=true +input.2.joystick.3.axis.0=JOY2_HORIZ.0 +input.2.joystick.3.axis.1=JOY2_VERT.0 +input.2.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.4.empty=false +input.2.joystick.4.disabled=true +input.2.joystick.4.axis.0=JOY1_HORIZ.0 +input.2.joystick.4.axis.1=JOY1_VERT.0 +input.2.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.5.empty=false +input.2.joystick.5.disabled=true +input.2.joystick.5.axis.0=JOY2_HORIZ.0 +input.2.joystick.5.axis.1=JOY2_VERT.0 +input.2.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.6.empty=false +input.2.joystick.6.disabled=true +input.2.joystick.6.axis.0=JOY1_HORIZ.0 +input.2.joystick.6.axis.1=JOY1_VERT.0 +input.2.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.7.empty=false +input.2.joystick.7.disabled=true +input.2.joystick.7.axis.0=JOY2_HORIZ.0 +input.2.joystick.7.axis.1=JOY2_VERT.0 +input.2.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.8.empty=true +input.2.joystick.9.empty=true +input.2.joystick.10.empty=true +input.2.joystick.11.empty=true +input.2.joystick.12.empty=true +input.2.joystick.13.empty=true +input.2.joystick.14.empty=true +input.2.joystick.15.empty=true +input.2.joystick.16.empty=true +input.2.joystick.17.empty=true +input.2.joystick.18.empty=true +input.2.joystick.19.empty=true +input.2.mouse.0.friendlyname=Windows mouse +input.2.mouse.0.name=WINMOUSE1 +input.2.mouse.0.empty=false +input.2.mouse.0.disabled=false +input.2.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.0.axis.1=MOUSE1_VERT.0 +input.2.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.1.friendlyname=HID-compliant mouse +input.2.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.1.empty=true +input.2.mouse.2.friendlyname=VMware Pointing Device +input.2.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.2.empty=true +input.2.mouse.3.friendlyname=VMware USB Pointing Device +input.2.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.3.empty=false +input.2.mouse.3.disabled=true +input.2.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.3.axis.1=MOUSE1_VERT.0 +input.2.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.4.empty=false +input.2.mouse.4.disabled=true +input.2.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.4.axis.1=MOUSE1_VERT.0 +input.2.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.5.empty=false +input.2.mouse.5.disabled=true +input.2.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.5.axis.1=MOUSE2_VERT.0 +input.2.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.6.empty=false +input.2.mouse.6.disabled=true +input.2.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.6.axis.1=MOUSE1_VERT.0 +input.2.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.7.empty=false +input.2.mouse.7.disabled=true +input.2.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.7.axis.1=MOUSE2_VERT.0 +input.2.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.8.empty=false +input.2.mouse.8.disabled=true +input.2.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.8.axis.1=MOUSE1_VERT.0 +input.2.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.9.empty=false +input.2.mouse.9.disabled=true +input.2.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.9.axis.1=MOUSE2_VERT.0 +input.2.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.10.empty=true +input.2.mouse.11.empty=true +input.2.mouse.12.empty=true +input.2.mouse.13.empty=true +input.2.mouse.14.empty=true +input.2.mouse.15.empty=true +input.2.mouse.16.empty=true +input.2.mouse.17.empty=true +input.2.mouse.18.empty=true +input.2.mouse.19.empty=true +input.2.keyboard.0.friendlyname=WinUAE keyboard +input.2.keyboard.0.name=NULLKEYBOARD +input.2.keyboard.0.empty=false +input.2.keyboard.0.disabled=false +input.2.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.2.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.2.keyboard.1.empty=true +input.2.keyboard.2.empty=true +input.2.keyboard.3.empty=true +input.2.keyboard.4.empty=true +input.2.keyboard.5.empty=true +input.2.keyboard.6.empty=true +input.2.keyboard.7.empty=true +input.2.keyboard.8.empty=true +input.2.keyboard.9.empty=true +input.2.keyboard.10.empty=true +input.2.keyboard.11.empty=true +input.2.keyboard.12.empty=true +input.2.keyboard.13.empty=true +input.2.keyboard.14.empty=true +input.2.keyboard.15.empty=true +input.2.keyboard.16.empty=true +input.2.keyboard.17.empty=true +input.2.keyboard.18.empty=true +input.2.keyboard.19.empty=true +input.2.internal.0.friendlyname=Internal events +input.2.internal.0.name=INTERNALEVENTS1 +input.2.internal.0.empty=true +input.3.joystick.0.empty=false +input.3.joystick.0.disabled=false +input.3.joystick.0.axis.0=JOY1_HORIZ.0 +input.3.joystick.0.axis.1=JOY1_VERT.0 +input.3.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.1.empty=false +input.3.joystick.1.disabled=true +input.3.joystick.1.axis.0=JOY2_HORIZ.0 +input.3.joystick.1.axis.1=JOY2_VERT.0 +input.3.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.2.empty=false +input.3.joystick.2.disabled=true +input.3.joystick.2.axis.0=JOY1_HORIZ.0 +input.3.joystick.2.axis.1=JOY1_VERT.0 +input.3.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.3.empty=false +input.3.joystick.3.disabled=true +input.3.joystick.3.axis.0=JOY2_HORIZ.0 +input.3.joystick.3.axis.1=JOY2_VERT.0 +input.3.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.4.empty=false +input.3.joystick.4.disabled=true +input.3.joystick.4.axis.0=JOY1_HORIZ.0 +input.3.joystick.4.axis.1=JOY1_VERT.0 +input.3.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.5.empty=false +input.3.joystick.5.disabled=true +input.3.joystick.5.axis.0=JOY2_HORIZ.0 +input.3.joystick.5.axis.1=JOY2_VERT.0 +input.3.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.6.empty=false +input.3.joystick.6.disabled=true +input.3.joystick.6.axis.0=JOY1_HORIZ.0 +input.3.joystick.6.axis.1=JOY1_VERT.0 +input.3.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.7.empty=false +input.3.joystick.7.disabled=true +input.3.joystick.7.axis.0=JOY2_HORIZ.0 +input.3.joystick.7.axis.1=JOY2_VERT.0 +input.3.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.8.empty=true +input.3.joystick.9.empty=true +input.3.joystick.10.empty=true +input.3.joystick.11.empty=true +input.3.joystick.12.empty=true +input.3.joystick.13.empty=true +input.3.joystick.14.empty=true +input.3.joystick.15.empty=true +input.3.joystick.16.empty=true +input.3.joystick.17.empty=true +input.3.joystick.18.empty=true +input.3.joystick.19.empty=true +input.3.mouse.0.friendlyname=Windows mouse +input.3.mouse.0.name=WINMOUSE1 +input.3.mouse.0.empty=false +input.3.mouse.0.disabled=false +input.3.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.0.axis.1=MOUSE1_VERT.0 +input.3.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.1.friendlyname=HID-compliant mouse +input.3.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.1.empty=true +input.3.mouse.2.friendlyname=VMware Pointing Device +input.3.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.2.empty=true +input.3.mouse.3.friendlyname=VMware USB Pointing Device +input.3.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.3.empty=false +input.3.mouse.3.disabled=true +input.3.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.3.axis.1=MOUSE1_VERT.0 +input.3.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.4.empty=false +input.3.mouse.4.disabled=true +input.3.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.4.axis.1=MOUSE1_VERT.0 +input.3.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.5.empty=false +input.3.mouse.5.disabled=true +input.3.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.5.axis.1=MOUSE2_VERT.0 +input.3.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.6.empty=false +input.3.mouse.6.disabled=true +input.3.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.6.axis.1=MOUSE1_VERT.0 +input.3.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.7.empty=false +input.3.mouse.7.disabled=true +input.3.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.7.axis.1=MOUSE2_VERT.0 +input.3.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.8.empty=false +input.3.mouse.8.disabled=true +input.3.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.8.axis.1=MOUSE1_VERT.0 +input.3.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.9.empty=false +input.3.mouse.9.disabled=true +input.3.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.9.axis.1=MOUSE2_VERT.0 +input.3.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.10.empty=true +input.3.mouse.11.empty=true +input.3.mouse.12.empty=true +input.3.mouse.13.empty=true +input.3.mouse.14.empty=true +input.3.mouse.15.empty=true +input.3.mouse.16.empty=true +input.3.mouse.17.empty=true +input.3.mouse.18.empty=true +input.3.mouse.19.empty=true +input.3.keyboard.0.friendlyname=WinUAE keyboard +input.3.keyboard.0.name=NULLKEYBOARD +input.3.keyboard.0.empty=false +input.3.keyboard.0.disabled=false +input.3.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.3.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.3.keyboard.1.empty=true +input.3.keyboard.2.empty=true +input.3.keyboard.3.empty=true +input.3.keyboard.4.empty=true +input.3.keyboard.5.empty=true +input.3.keyboard.6.empty=true +input.3.keyboard.7.empty=true +input.3.keyboard.8.empty=true +input.3.keyboard.9.empty=true +input.3.keyboard.10.empty=true +input.3.keyboard.11.empty=true +input.3.keyboard.12.empty=true +input.3.keyboard.13.empty=true +input.3.keyboard.14.empty=true +input.3.keyboard.15.empty=true +input.3.keyboard.16.empty=true +input.3.keyboard.17.empty=true +input.3.keyboard.18.empty=true +input.3.keyboard.19.empty=true +input.3.internal.0.friendlyname=Internal events +input.3.internal.0.name=INTERNALEVENTS1 +input.3.internal.0.empty=true +input.4.mouse.0.friendlyname=Windows mouse +input.4.mouse.0.name=WINMOUSE1 +input.4.mouse.0.custom=true +input.4.keyboard.0.friendlyname=WinUAE keyboard +input.4.keyboard.0.name=NULLKEYBOARD +input.4.keyboard.0.custom=true diff --git a/source/winuae/configs/a500_slow.uae b/source/winuae/configs/a500_slow.uae new file mode 100755 index 0000000..d0a8199 --- /dev/null +++ b/source/winuae/configs/a500_slow.uae @@ -0,0 +1,745 @@ +config_description= +config_hardware=true +config_host=true +config_version=4.5.0 +config_hardware_path= +config_host_path= +config_all_path= +ksmirror=e0 +win32.rom_path=./ +win32.floppy_path=./ +win32.hardfile_path=./ +; host-specific +win32.middle_mouse=true +win32.soundcard=0 +win32.soundcardname=WASAPI:Default Audio Device +win32.kbledmode=0 +; common +use_gui=no +use_debugger=false +kickstart_rom_file=.\roms\Kick13.rom +kickstart_rom_file_id=C4F0F55F,KS ROM v1.3 (A500,A1000,A2000) +kickstart_ext_rom_file= +flash_file= +cart_file=:HRTMon +rtc_file= +kickshifter=false +floppy_volume=33 +floppy0= +floppy1= +floppy1type=-1 +floppy2= +floppy3= +nr_floppies=1 +floppy_speed=100 +cd_speed=100 +parallel_on_demand=false +serial_on_demand=false +serial_hardware_ctsrts=true +serial_direct=false +scsi=false +uaeserial=false +sana2=false +sound_output=exact +sound_channels=stereo +sound_stereo_separation=7 +sound_stereo_mixing_delay=0 +sound_max_buff=16384 +sound_frequency=44100 +sound_interpol=anti +sound_filter=emulated +sound_filter_type=standard +sound_volume=0 +sound_volume_paula=0 +sound_volume_cd=0 +sound_volume_ahi=0 +sound_volume_midi=0 +sound_volume_genlock=0 +sound_auto=true +sound_cdaudio=false +sound_stereo_swap_paula=false +sound_stereo_swap_ahi=false +comp_trustbyte=indirect +comp_trustword=indirect +comp_trustlong=indirect +comp_trustnaddr=indirect +comp_nf=true +comp_constjump=true +comp_flushmode=soft +compfpu=true +comp_catchfault=true +cachesize=0 +joyport0=mouse +joyport0autofire=none +joyportfriendlyname0=Windows mouse +joyportname0=WINMOUSE1 +joyport1=kbd1 +joyport1autofire=none +bsdsocket_emu=false +synchronize_clock=false +maprom=0x0 +parallel_postscript_emulation=false +parallel_postscript_detection=false +ghostscript_parameters= +parallel_autoflush=5 +gfx_display=0 +gfx_display_rtg=0 +gfx_framerate=1 +gfx_width=754 +gfx_height=576 +gfx_top_windowed=1015 +gfx_left_windowed=610 +gfx_width_windowed=754 +gfx_height_windowed=576 +gfx_width_fullscreen=800 +gfx_height_fullscreen=600 +gfx_refreshrate=0 +gfx_autoresolution=0 +gfx_autoresolution_vga=true +gfx_backbuffers=2 +gfx_backbuffers_rtg=1 +gfx_vsync=false +gfx_vsyncmode=normal +gfx_vsync_picasso=false +gfx_vsyncmode_picasso=normal +gfx_lores=false +gfx_resolution=hires +gfx_lores_mode=normal +gfx_flickerfixer=false +gfx_linemode=double +gfx_fullscreen_amiga=false +gfx_fullscreen_picasso=false +gfx_center_horizontal=none +gfx_center_vertical=none +gfx_colour_mode=32bit +gfx_blacker_than_black=false +gfx_api=direct3d +gfx_api_options=hardware +gfx_filter=no +immediate_blits=false +waiting_blits=automatic +ntsc=false +genlock=false +chipset=ocs +chipset_refreshrate=49.920410 +collision_level=playfields +chipset_compatible=A500 +rtc=MSM6242B +resetwarning=false +cia_todbug=true +fastmem_size=0 +debugmem_start=0x0 +debugmem_size=0 +mem25bit_size=0 +a3000mem_size=0 +mbresmem_size=0 +z3mem_size=0 +z3mem_start=0x40000000 +bogomem_size=2 +gfxcard_hardware_vblank=false +gfxcard_hardware_sprite=true +gfxcard_multithread=false +chipmem_size=1 +cpu_speed=real +cpu_throttle=0.0 +cpu_type=68000 +cpu_model=68000 +cpu_compatible=true +cpu_24bit_addressing=true +cpu_data_cache=false +cpu_cycle_exact=true +cpu_memory_cycle_exact=true +blitter_cycle_exact=true +cycle_exact=true +fpu_strict=false +rtg_nocustom=true +rtg_modes=0x212 +debug_mem=true +log_illegal_mem=false +kbd_lang=us +filesystem2=rw,hd0:testhd:.\hd0,0 +uaehf0=dir,rw,hd0:testhd:.\hd0,0 +input.config=1 +input.joymouse_speed_analog=20 +input.joymouse_speed_digital=10 +input.joymouse_deadzone=33 +input.joystick_deadzone=33 +input.analog_joystick_multiplier=15 +input.analog_joystick_offset=-1 +input.mouse_speed=100 +input.autofire_speed=600 +input.autoswitch=1 +input.1.joystick.0.empty=false +input.1.joystick.0.disabled=false +input.1.joystick.0.axis.0=JOY1_HORIZ.0 +input.1.joystick.0.axis.1=JOY1_VERT.0 +input.1.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.1.empty=false +input.1.joystick.1.disabled=true +input.1.joystick.1.axis.0=JOY2_HORIZ.0 +input.1.joystick.1.axis.1=JOY2_VERT.0 +input.1.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.2.empty=false +input.1.joystick.2.disabled=true +input.1.joystick.2.axis.0=JOY1_HORIZ.0 +input.1.joystick.2.axis.1=JOY1_VERT.0 +input.1.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.3.empty=false +input.1.joystick.3.disabled=true +input.1.joystick.3.axis.0=JOY2_HORIZ.0 +input.1.joystick.3.axis.1=JOY2_VERT.0 +input.1.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.4.empty=false +input.1.joystick.4.disabled=true +input.1.joystick.4.axis.0=JOY1_HORIZ.0 +input.1.joystick.4.axis.1=JOY1_VERT.0 +input.1.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.5.empty=false +input.1.joystick.5.disabled=true +input.1.joystick.5.axis.0=JOY2_HORIZ.0 +input.1.joystick.5.axis.1=JOY2_VERT.0 +input.1.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.6.empty=false +input.1.joystick.6.disabled=true +input.1.joystick.6.axis.0=JOY1_HORIZ.0 +input.1.joystick.6.axis.1=JOY1_VERT.0 +input.1.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.1.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.1.joystick.7.empty=false +input.1.joystick.7.disabled=true +input.1.joystick.7.axis.0=JOY2_HORIZ.0 +input.1.joystick.7.axis.1=JOY2_VERT.0 +input.1.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.1.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.1.joystick.8.empty=true +input.1.joystick.9.empty=true +input.1.joystick.10.empty=true +input.1.joystick.11.empty=true +input.1.joystick.12.empty=true +input.1.joystick.13.empty=true +input.1.joystick.14.empty=true +input.1.joystick.15.empty=true +input.1.joystick.16.empty=true +input.1.joystick.17.empty=true +input.1.joystick.18.empty=true +input.1.joystick.19.empty=true +input.1.mouse.0.friendlyname=Windows mouse +input.1.mouse.0.name=WINMOUSE1 +input.1.mouse.0.empty=false +input.1.mouse.0.disabled=false +input.1.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.0.axis.1=MOUSE1_VERT.0 +input.1.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.1.friendlyname=HID-compliant mouse +input.1.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.1.empty=true +input.1.mouse.2.friendlyname=VMware Pointing Device +input.1.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.2.empty=true +input.1.mouse.3.friendlyname=VMware USB Pointing Device +input.1.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.1.mouse.3.empty=false +input.1.mouse.3.disabled=true +input.1.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.3.axis.1=MOUSE1_VERT.0 +input.1.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.4.empty=false +input.1.mouse.4.disabled=true +input.1.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.4.axis.1=MOUSE1_VERT.0 +input.1.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.5.empty=false +input.1.mouse.5.disabled=true +input.1.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.5.axis.1=MOUSE2_VERT.0 +input.1.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.6.empty=false +input.1.mouse.6.disabled=true +input.1.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.6.axis.1=MOUSE1_VERT.0 +input.1.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.7.empty=false +input.1.mouse.7.disabled=true +input.1.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.7.axis.1=MOUSE2_VERT.0 +input.1.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.8.empty=false +input.1.mouse.8.disabled=true +input.1.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.1.mouse.8.axis.1=MOUSE1_VERT.0 +input.1.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.1.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.1.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.1.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.1.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.1.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.1.mouse.9.empty=false +input.1.mouse.9.disabled=true +input.1.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.1.mouse.9.axis.1=MOUSE2_VERT.0 +input.1.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.1.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.1.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.1.mouse.10.empty=true +input.1.mouse.11.empty=true +input.1.mouse.12.empty=true +input.1.mouse.13.empty=true +input.1.mouse.14.empty=true +input.1.mouse.15.empty=true +input.1.mouse.16.empty=true +input.1.mouse.17.empty=true +input.1.mouse.18.empty=true +input.1.mouse.19.empty=true +input.1.keyboard.0.friendlyname=WinUAE keyboard +input.1.keyboard.0.name=NULLKEYBOARD +input.1.keyboard.0.empty=false +input.1.keyboard.0.disabled=false +input.1.keyboard.0.button.103.KEY_66=SPC_PAUSE.0 +input.1.keyboard.0.button.104.KEY_67=SPC_SINGLESTEP.0 +input.1.keyboard.0.button.105.KEY_68=SPC_WARP.0 +input.1.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.1.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.1.keyboard.1.empty=true +input.1.keyboard.2.empty=true +input.1.keyboard.3.empty=true +input.1.keyboard.4.empty=true +input.1.keyboard.5.empty=true +input.1.keyboard.6.empty=true +input.1.keyboard.7.empty=true +input.1.keyboard.8.empty=true +input.1.keyboard.9.empty=true +input.1.keyboard.10.empty=true +input.1.keyboard.11.empty=true +input.1.keyboard.12.empty=true +input.1.keyboard.13.empty=true +input.1.keyboard.14.empty=true +input.1.keyboard.15.empty=true +input.1.keyboard.16.empty=true +input.1.keyboard.17.empty=true +input.1.keyboard.18.empty=true +input.1.keyboard.19.empty=true +input.1.internal.0.friendlyname=Internal events +input.1.internal.0.name=INTERNALEVENTS1 +input.1.internal.0.empty=true +input.1.internal.0.disabled=false +input.2.joystick.0.empty=false +input.2.joystick.0.disabled=false +input.2.joystick.0.axis.0=JOY1_HORIZ.0 +input.2.joystick.0.axis.1=JOY1_VERT.0 +input.2.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.1.empty=false +input.2.joystick.1.disabled=true +input.2.joystick.1.axis.0=JOY2_HORIZ.0 +input.2.joystick.1.axis.1=JOY2_VERT.0 +input.2.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.2.empty=false +input.2.joystick.2.disabled=true +input.2.joystick.2.axis.0=JOY1_HORIZ.0 +input.2.joystick.2.axis.1=JOY1_VERT.0 +input.2.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.3.empty=false +input.2.joystick.3.disabled=true +input.2.joystick.3.axis.0=JOY2_HORIZ.0 +input.2.joystick.3.axis.1=JOY2_VERT.0 +input.2.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.4.empty=false +input.2.joystick.4.disabled=true +input.2.joystick.4.axis.0=JOY1_HORIZ.0 +input.2.joystick.4.axis.1=JOY1_VERT.0 +input.2.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.5.empty=false +input.2.joystick.5.disabled=true +input.2.joystick.5.axis.0=JOY2_HORIZ.0 +input.2.joystick.5.axis.1=JOY2_VERT.0 +input.2.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.6.empty=false +input.2.joystick.6.disabled=true +input.2.joystick.6.axis.0=JOY1_HORIZ.0 +input.2.joystick.6.axis.1=JOY1_VERT.0 +input.2.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.2.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.2.joystick.7.empty=false +input.2.joystick.7.disabled=true +input.2.joystick.7.axis.0=JOY2_HORIZ.0 +input.2.joystick.7.axis.1=JOY2_VERT.0 +input.2.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.2.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.2.joystick.8.empty=true +input.2.joystick.9.empty=true +input.2.joystick.10.empty=true +input.2.joystick.11.empty=true +input.2.joystick.12.empty=true +input.2.joystick.13.empty=true +input.2.joystick.14.empty=true +input.2.joystick.15.empty=true +input.2.joystick.16.empty=true +input.2.joystick.17.empty=true +input.2.joystick.18.empty=true +input.2.joystick.19.empty=true +input.2.mouse.0.friendlyname=Windows mouse +input.2.mouse.0.name=WINMOUSE1 +input.2.mouse.0.empty=false +input.2.mouse.0.disabled=false +input.2.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.0.axis.1=MOUSE1_VERT.0 +input.2.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.1.friendlyname=HID-compliant mouse +input.2.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.1.empty=true +input.2.mouse.2.friendlyname=VMware Pointing Device +input.2.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.2.empty=true +input.2.mouse.3.friendlyname=VMware USB Pointing Device +input.2.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.2.mouse.3.empty=false +input.2.mouse.3.disabled=true +input.2.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.3.axis.1=MOUSE1_VERT.0 +input.2.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.4.empty=false +input.2.mouse.4.disabled=true +input.2.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.4.axis.1=MOUSE1_VERT.0 +input.2.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.5.empty=false +input.2.mouse.5.disabled=true +input.2.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.5.axis.1=MOUSE2_VERT.0 +input.2.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.6.empty=false +input.2.mouse.6.disabled=true +input.2.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.6.axis.1=MOUSE1_VERT.0 +input.2.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.7.empty=false +input.2.mouse.7.disabled=true +input.2.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.7.axis.1=MOUSE2_VERT.0 +input.2.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.8.empty=false +input.2.mouse.8.disabled=true +input.2.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.2.mouse.8.axis.1=MOUSE1_VERT.0 +input.2.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.2.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.2.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.2.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.2.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.2.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.2.mouse.9.empty=false +input.2.mouse.9.disabled=true +input.2.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.2.mouse.9.axis.1=MOUSE2_VERT.0 +input.2.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.2.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.2.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.2.mouse.10.empty=true +input.2.mouse.11.empty=true +input.2.mouse.12.empty=true +input.2.mouse.13.empty=true +input.2.mouse.14.empty=true +input.2.mouse.15.empty=true +input.2.mouse.16.empty=true +input.2.mouse.17.empty=true +input.2.mouse.18.empty=true +input.2.mouse.19.empty=true +input.2.keyboard.0.friendlyname=WinUAE keyboard +input.2.keyboard.0.name=NULLKEYBOARD +input.2.keyboard.0.empty=false +input.2.keyboard.0.disabled=false +input.2.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.2.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.2.keyboard.1.empty=true +input.2.keyboard.2.empty=true +input.2.keyboard.3.empty=true +input.2.keyboard.4.empty=true +input.2.keyboard.5.empty=true +input.2.keyboard.6.empty=true +input.2.keyboard.7.empty=true +input.2.keyboard.8.empty=true +input.2.keyboard.9.empty=true +input.2.keyboard.10.empty=true +input.2.keyboard.11.empty=true +input.2.keyboard.12.empty=true +input.2.keyboard.13.empty=true +input.2.keyboard.14.empty=true +input.2.keyboard.15.empty=true +input.2.keyboard.16.empty=true +input.2.keyboard.17.empty=true +input.2.keyboard.18.empty=true +input.2.keyboard.19.empty=true +input.2.internal.0.friendlyname=Internal events +input.2.internal.0.name=INTERNALEVENTS1 +input.2.internal.0.empty=true +input.3.joystick.0.empty=false +input.3.joystick.0.disabled=false +input.3.joystick.0.axis.0=JOY1_HORIZ.0 +input.3.joystick.0.axis.1=JOY1_VERT.0 +input.3.joystick.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.0.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.0.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.1.empty=false +input.3.joystick.1.disabled=true +input.3.joystick.1.axis.0=JOY2_HORIZ.0 +input.3.joystick.1.axis.1=JOY2_VERT.0 +input.3.joystick.1.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.1.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.1.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.2.empty=false +input.3.joystick.2.disabled=true +input.3.joystick.2.axis.0=JOY1_HORIZ.0 +input.3.joystick.2.axis.1=JOY1_VERT.0 +input.3.joystick.2.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.2.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.2.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.3.empty=false +input.3.joystick.3.disabled=true +input.3.joystick.3.axis.0=JOY2_HORIZ.0 +input.3.joystick.3.axis.1=JOY2_VERT.0 +input.3.joystick.3.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.3.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.3.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.4.empty=false +input.3.joystick.4.disabled=true +input.3.joystick.4.axis.0=JOY1_HORIZ.0 +input.3.joystick.4.axis.1=JOY1_VERT.0 +input.3.joystick.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.4.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.4.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.5.empty=false +input.3.joystick.5.disabled=true +input.3.joystick.5.axis.0=JOY2_HORIZ.0 +input.3.joystick.5.axis.1=JOY2_VERT.0 +input.3.joystick.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.5.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.5.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.6.empty=false +input.3.joystick.6.disabled=true +input.3.joystick.6.axis.0=JOY1_HORIZ.0 +input.3.joystick.6.axis.1=JOY1_VERT.0 +input.3.joystick.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.joystick.6.button.1=JOY1_2ND_BUTTON.0 +input.3.joystick.6.button.2=JOY1_3RD_BUTTON.0 +input.3.joystick.7.empty=false +input.3.joystick.7.disabled=true +input.3.joystick.7.axis.0=JOY2_HORIZ.0 +input.3.joystick.7.axis.1=JOY2_VERT.0 +input.3.joystick.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.joystick.7.button.1=JOY2_2ND_BUTTON.0 +input.3.joystick.7.button.2=JOY2_3RD_BUTTON.0 +input.3.joystick.8.empty=true +input.3.joystick.9.empty=true +input.3.joystick.10.empty=true +input.3.joystick.11.empty=true +input.3.joystick.12.empty=true +input.3.joystick.13.empty=true +input.3.joystick.14.empty=true +input.3.joystick.15.empty=true +input.3.joystick.16.empty=true +input.3.joystick.17.empty=true +input.3.joystick.18.empty=true +input.3.joystick.19.empty=true +input.3.mouse.0.friendlyname=Windows mouse +input.3.mouse.0.name=WINMOUSE1 +input.3.mouse.0.empty=false +input.3.mouse.0.disabled=false +input.3.mouse.0.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.0.axis.1=MOUSE1_VERT.0 +input.3.mouse.0.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.0.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.0.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.0.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.1.friendlyname=HID-compliant mouse +input.3.mouse.1.name=\\?\HID#VID_0E0F&PID_0003&MI_01#8&103f555a&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.1.empty=true +input.3.mouse.2.friendlyname=VMware Pointing Device +input.3.mouse.2.name=\\?\ACPI#VMW0003#4&205ad762&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.2.empty=true +input.3.mouse.3.friendlyname=VMware USB Pointing Device +input.3.mouse.3.name=\\?\HID#VID_0E0F&PID_0003&MI_00#8&3416931c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} +input.3.mouse.3.empty=false +input.3.mouse.3.disabled=true +input.3.mouse.3.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.3.axis.1=MOUSE1_VERT.0 +input.3.mouse.3.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.3.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.3.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.3.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.3.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.3.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.4.empty=false +input.3.mouse.4.disabled=true +input.3.mouse.4.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.4.axis.1=MOUSE1_VERT.0 +input.3.mouse.4.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.4.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.4.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.4.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.4.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.4.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.5.empty=false +input.3.mouse.5.disabled=true +input.3.mouse.5.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.5.axis.1=MOUSE2_VERT.0 +input.3.mouse.5.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.5.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.5.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.6.empty=false +input.3.mouse.6.disabled=true +input.3.mouse.6.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.6.axis.1=MOUSE1_VERT.0 +input.3.mouse.6.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.6.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.6.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.6.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.6.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.6.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.7.empty=false +input.3.mouse.7.disabled=true +input.3.mouse.7.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.7.axis.1=MOUSE2_VERT.0 +input.3.mouse.7.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.7.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.7.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.8.empty=false +input.3.mouse.8.disabled=true +input.3.mouse.8.axis.0=MOUSE1_HORIZ.0 +input.3.mouse.8.axis.1=MOUSE1_VERT.0 +input.3.mouse.8.axis.2=MOUSE1_WHEEL.0 +input.3.mouse.8.button.0=JOY1_FIRE_BUTTON.0 +input.3.mouse.8.button.1=JOY1_2ND_BUTTON.0 +input.3.mouse.8.button.2=JOY1_3RD_BUTTON.0 +input.3.mouse.8.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0 +input.3.mouse.8.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0 +input.3.mouse.9.empty=false +input.3.mouse.9.disabled=true +input.3.mouse.9.axis.0=MOUSE2_HORIZ.0 +input.3.mouse.9.axis.1=MOUSE2_VERT.0 +input.3.mouse.9.button.0=JOY2_FIRE_BUTTON.0 +input.3.mouse.9.button.1=JOY2_2ND_BUTTON.0 +input.3.mouse.9.button.2=JOY2_3RD_BUTTON.0 +input.3.mouse.10.empty=true +input.3.mouse.11.empty=true +input.3.mouse.12.empty=true +input.3.mouse.13.empty=true +input.3.mouse.14.empty=true +input.3.mouse.15.empty=true +input.3.mouse.16.empty=true +input.3.mouse.17.empty=true +input.3.mouse.18.empty=true +input.3.mouse.19.empty=true +input.3.keyboard.0.friendlyname=WinUAE keyboard +input.3.keyboard.0.name=NULLKEYBOARD +input.3.keyboard.0.empty=false +input.3.keyboard.0.disabled=false +input.3.keyboard.0.button.103.KEY_66=SPC_PAUSE.0 +input.3.keyboard.0.button.104.KEY_67=SPC_SINGLESTEP.0 +input.3.keyboard.0.button.105.KEY_68=SPC_WARP.0 +input.3.keyboard.1.friendlyname=Standard PS/2 Keyboard +input.3.keyboard.1.name=\\?\ACPI#PNP0303#4&205ad762&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} +input.3.keyboard.1.empty=true +input.3.keyboard.2.empty=true +input.3.keyboard.3.empty=true +input.3.keyboard.4.empty=true +input.3.keyboard.5.empty=true +input.3.keyboard.6.empty=true +input.3.keyboard.7.empty=true +input.3.keyboard.8.empty=true +input.3.keyboard.9.empty=true +input.3.keyboard.10.empty=true +input.3.keyboard.11.empty=true +input.3.keyboard.12.empty=true +input.3.keyboard.13.empty=true +input.3.keyboard.14.empty=true +input.3.keyboard.15.empty=true +input.3.keyboard.16.empty=true +input.3.keyboard.17.empty=true +input.3.keyboard.18.empty=true +input.3.keyboard.19.empty=true +input.3.internal.0.friendlyname=Internal events +input.3.internal.0.name=INTERNALEVENTS1 +input.3.internal.0.empty=true +input.4.mouse.0.friendlyname=Windows mouse +input.4.mouse.0.name=WINMOUSE1 +input.4.mouse.0.custom=true +input.4.keyboard.0.friendlyname=WinUAE keyboard +input.4.keyboard.0.name=NULLKEYBOARD +input.4.keyboard.0.custom=true diff --git a/source/winuae/hd0/dont_delete_me.txt b/source/winuae/hd0/dont_delete_me.txt new file mode 100644 index 0000000..e1bc937 --- /dev/null +++ b/source/winuae/hd0/dont_delete_me.txt @@ -0,0 +1 @@ +Please. \ No newline at end of file diff --git a/source/winuae/hd0/s/dont_delete_me.txt b/source/winuae/hd0/s/dont_delete_me.txt new file mode 100644 index 0000000..e1bc937 --- /dev/null +++ b/source/winuae/hd0/s/dont_delete_me.txt @@ -0,0 +1 @@ +Please. \ No newline at end of file diff --git a/source/winuae/winuae.exe b/source/winuae/winuae.exe new file mode 100644 index 0000000..221e625 Binary files /dev/null and b/source/winuae/winuae.exe differ diff --git a/source/winuae/winuae64.exe b/source/winuae/winuae64.exe new file mode 100644 index 0000000..d2a288b Binary files /dev/null and b/source/winuae/winuae64.exe differ diff --git a/tools/platostools/build.gradle.kts b/tools/platostools/build.gradle.kts new file mode 100644 index 0000000..c6cfa82 --- /dev/null +++ b/tools/platostools/build.gradle.kts @@ -0,0 +1,58 @@ +plugins { + application + kotlin("multiplatform") version "1.8.21" +} + +repositories { + mavenCentral() +} + +kotlin { + sourceSets { + commonMain { + dependencies { + implementation("org.jetbrains.kotlinx:kotlinx-cli:0.3.5") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0") + } + } + } + + val hostOs = System.getProperty("os.name") + val isMingwX64 = hostOs.startsWith("Windows") + val nativeTarget = when { + hostOs == "Mac OS X" -> macosX64("native") + hostOs == "Linux" -> linuxX64("native") + isMingwX64 -> mingwX64("native") + else -> throw GradleException("Host OS is not supported in Kotlin/Native.") + } + val crossTarget = mingwX64("wingw64") + + nativeTarget.apply { + compilations["main"].enableEndorsedLibs = true + binaries { + executable("platosadf") { + entryPoint = "de.platon42.demoscene.tools.platosadf.main" + } + executable("juggler") { + entryPoint = "de.platon42.demoscene.tools.juggler.main" + } + } + } + + crossTarget.apply { + compilations["main"].enableEndorsedLibs = true + binaries { + executable("platosadf") { + entryPoint = "de.platon42.demoscene.tools.platosadf.main" + } + executable("juggler") { + entryPoint = "de.platon42.demoscene.tools.juggler.main" + } + } + } + + sourceSets { + val nativeMain by getting + val nativeTest by getting + } +} \ No newline at end of file diff --git a/tools/platostools/gradle.properties b/tools/platostools/gradle.properties new file mode 100644 index 0000000..7fc6f1f --- /dev/null +++ b/tools/platostools/gradle.properties @@ -0,0 +1 @@ +kotlin.code.style=official diff --git a/tools/platostools/gradle/wrapper/gradle-wrapper.jar b/tools/platostools/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/tools/platostools/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tools/platostools/gradle/wrapper/gradle-wrapper.properties b/tools/platostools/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ae04661 --- /dev/null +++ b/tools/platostools/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/tools/platostools/gradlew b/tools/platostools/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/tools/platostools/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/tools/platostools/gradlew.bat b/tools/platostools/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/tools/platostools/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tools/platostools/settings.gradle.kts b/tools/platostools/settings.gradle.kts new file mode 100644 index 0000000..a81f37e --- /dev/null +++ b/tools/platostools/settings.gradle.kts @@ -0,0 +1,2 @@ +rootProject.name = "platostools" + diff --git a/tools/platostools/src/nativeMain/kotlin/de/platon42/demoscene/tools/juggler/main.kt b/tools/platostools/src/nativeMain/kotlin/de/platon42/demoscene/tools/juggler/main.kt new file mode 100644 index 0000000..cdf4cf2 --- /dev/null +++ b/tools/platostools/src/nativeMain/kotlin/de/platon42/demoscene/tools/juggler/main.kt @@ -0,0 +1,227 @@ +package de.platon42.demoscene.tools.juggler + +import kotlinx.cinterop.* +import kotlinx.cli.ArgParser +import kotlinx.cli.ArgType +import kotlinx.cli.ExperimentalCli +import kotlinx.cli.Subcommand +import platform.posix.* + +@OptIn(ExperimentalUnsignedTypes::class) +fun loadFile(filename: String): UByteArray? { + val file = fopen(filename, "rb") + if (file == null) { + perror("cannot read file $filename") + return null + } + memScoped { + fseek(file, 0, SEEK_END) + val expectedSize = ftell(file) + fseek(file, 0, SEEK_SET) + val image = allocArray(expectedSize) + val size = fread(image, expectedSize.toULong(), 1UL, file) + fclose(file) + //println("Read file $filename ($expectedSize bytes)") + return UByteArray(expectedSize.toInt()) { image[it] } + } +} + +@OptIn(ExperimentalUnsignedTypes::class) +fun saveFile(filename: String, data: UByteArray) { + val file = fopen(filename, "wb") + if (file == null) { + perror("cannot write file $filename") + return + } + memScoped { + val image = allocArray(data.size) + for (i in data.indices) { + image[i] = data[i] + } + val size = fwrite(image, data.size.toULong(), 1UL, file) + //println("Saved ${data.size} bytes to $filename") + fclose(file) + } +} + +@OptIn(ExperimentalUnsignedTypes::class) +fun main(args: Array) { + val argParser = ArgParser("juggler") + + val rootDirectoryOption by argParser.option( + ArgType.String, + "root", + shortName = "r", + description = "Root directory" + ) + + val layoutFileName by argParser.argument(ArgType.String, "layout", description = "Layout description file") + + try { + argParser.parse(args) + } catch (ex: IllegalStateException) { + println(ex.message) + exit(-1) + } + + val rootDirectory = if (rootDirectoryOption != null) "$rootDirectoryOption/" else "" + + val layoutBinary = loadFile(rootDirectory + layoutFileName) ?: throw IllegalStateException("Missing layout file!") + val layoutText = CharArray(layoutBinary.size) { layoutBinary[it].toInt().toChar() } + .concatToString() + .split("\n") + .filter { it.isNotBlank() && !it.startsWith("//") } + + var data = UByteArray(0) + for (line in layoutText) { + data = parseLayoutLine(line, rootDirectory, data) + } +} + +@ExperimentalCli +@OptIn(ExperimentalUnsignedTypes::class) +private fun parseLayoutLine( + line: String, + rootDirectory: String, + data: UByteArray, +): UByteArray { + val lineParser = ArgParser("layoutfile") + + var newData = data + + class ClearCommand : Subcommand("clear", "Clear buffers") { + override fun execute() { + newData = UByteArray(0) + println("Cleared buffer.") + } + } + + abstract class LoadSaveCommand(name: String, actionDescription: String, fileDesc: String) : + Subcommand(name, actionDescription) { + val filename by argument(ArgType.String, "filename", description = fileDesc) + val start by option(ArgType.Int, "start", "s", description = "Start offset in bytes") + val fromEnd by option(ArgType.Int, "fromEnd", "e", description = "Offset from end in bytes (instead of start)") + val length by option(ArgType.Int, "length", "l", description = "Length in bytes (or chunk size)") + val chunk by option(ArgType.Int, "chunk", "n", description = "Chunk number") + + var startOff = 0 + var newLength = 0 + + fun parseInfo(filesize: Int) { + startOff = 0 + newLength = filesize + if (start != null) { + if (start!! >= newLength) { + perror("$start is past end of file '$filename' ($newLength bytes)!") + startOff = newLength + newLength = 0 + } else { + startOff = start!! + newLength -= startOff + } + } + if (fromEnd != null) { + if (fromEnd!! >= newLength) { + perror("$fromEnd is before beginning of file '$filename' ($newLength bytes)!") + startOff = 0 + } else { + startOff = newLength - fromEnd!! + newLength = fromEnd!! + } + } + if (chunk == null && length != null) { + if (length!! > newLength - startOff) { + perror("$length is larger than possible for file '$filename' (${filesize} bytes, start $startOff)!") + newLength -= startOff + } else { + newLength = length!! + } + } + if (chunk != null) { + if (length != null) { + if (chunk!! * length!! >= newLength) { + perror("Chunk $chunk is past end of file '$filename' (${filesize} bytes, start $startOff)!") + newLength = 0 + } else { + startOff += chunk!! * length!! + newLength = if (startOff + length!! > filesize) { + perror("Chunk $chunk is truncated for file '$filename' (${filesize} bytes, start $startOff)!") + filesize - (startOff + length!!) + } else { + length!! + } + } + } else { + perror("Missing length option to be able to use the chunk option!") + } + } + } + } + + class LoadCommand : LoadSaveCommand("load", "Load a file (or a part)", "Input file") { + override fun execute() { + val wholeFile = loadFile(rootDirectory + filename) ?: return + parseInfo(wholeFile.size) + + newData = data.plus(wholeFile.sliceArray(startOff until startOff + newLength)) + println("Loaded $newLength bytes at offset $startOff (new size ${newData.size}).") + } + } + + class SaveCommand : LoadSaveCommand("save", "Save a file (or a part)", "Output file") { + override fun execute() { + parseInfo(data.size) + + val savePart = data.sliceArray(startOff until startOff + newLength) + saveFile(rootDirectory + filename, savePart) + println("Saved ${savePart.size} bytes from offset $startOff.") + } + } + + class ExtractCommand : LoadSaveCommand("extract", "Extract a portion of the current buffer", "Dummy") { + override fun execute() { + parseInfo(data.size) + + newData = data.sliceArray(startOff until startOff + newLength) + println("Extracted ${newData.size} bytes from offset $startOff.") + } + } + + class ReorganizeCommand : + Subcommand("reorganize", "Reorganize array in a different way") { + val height by argument(ArgType.Int, "height", description = "Outer length") + val widthOption by option(ArgType.Int, "width", "w", description = "Inner length (default: 1)") + val unitLenOption by option(ArgType.Int, "unitlength", "l", description = "Length of a unit (default: 1)") + val unitModOption by option(ArgType.Int, "unitmod", "um", description = "Space between units (default: 0)") + val rowModOption by option(ArgType.Int, "rowmod", "rm", description = "Space after a row (default: 0)") + val startOffOption by option(ArgType.Int, "start", "s", description = "Start offset in bytes (default: 0)") + + override fun execute() { + val unitLen = unitLenOption ?: 1 + val width = widthOption ?: 1 + val unitMod = unitModOption ?: 0 + val rowMod = rowModOption ?: 0 + newData = UByteArray(height * width * unitLen) + var inPos = startOffOption ?: 0 + var outPos = 0 + outer@ for (row in 1..height) { + for (column in 1..width) { + if (inPos >= data.size) { + println("Out of data at output position $outPos (row=$row, column=$column)") + break@outer + } + data.copyInto(newData, outPos, inPos, inPos + unitLen) + outPos += unitLen + inPos += unitLen + unitMod + } + inPos += rowMod + } + println("Reorganized data to ${newData.size} bytes.") + } + + } + lineParser.subcommands(ClearCommand(), LoadCommand(), SaveCommand(), ExtractCommand(), ReorganizeCommand()) + println(line) + lineParser.parse(line.split(" ").toTypedArray()) + return newData +} \ No newline at end of file diff --git a/tools/platostools/src/nativeMain/kotlin/de/platon42/demoscene/tools/platosadf/main.kt b/tools/platostools/src/nativeMain/kotlin/de/platon42/demoscene/tools/platosadf/main.kt new file mode 100644 index 0000000..73fe57e --- /dev/null +++ b/tools/platostools/src/nativeMain/kotlin/de/platon42/demoscene/tools/platosadf/main.kt @@ -0,0 +1,811 @@ +package de.platon42.demoscene.tools.platosadf + +import kotlinx.cinterop.* +import kotlinx.cli.ArgParser +import kotlinx.cli.ArgType +import kotlinx.coroutines.* +import platform.posix.* + +const val HUNK_HEADER = 0x3f3U +const val HUNK_CODE = 0x3e9U +const val HUNK_DATA = 0x3eaU +const val HUNK_BSS = 0x3ebU +const val HUNK_RELOC32 = 0x3ecU +const val HUNK_END = 0x3f2U + +const val MEM_ANY = 0U +const val MEM_CHIP = 1U +const val MEM_FAST = 2U + +const val DEFF_MORE_HUNKS = (1 shl 15) +const val DEFF_CHIPMEM = (1 shl 7) +const val DEFF_DATAFILE = (0 shl 0) +const val DEFF_HUNK_CODE = (1 shl 0) +const val DEFF_HUNK_DATA = (2 shl 0) +const val DEFF_HUNK_BSS = (3 shl 0) +const val DEFF_HUNK_RELOC = (4 shl 0) +const val DEFF_UNPACKED = (0 shl 4) +const val DEFF_LZ4 = (1 shl 4) +const val DEFF_DOYNAX = (2 shl 4) +const val DEFF_ZX0 = (3 shl 4) +const val DEFF_DELTA8 = (1 shl 8) +const val DEFF_DELTA16 = (2 shl 8) +const val DEFF_DELTA32 = (3 shl 8) + +const val DEFF_IN_PLACE = (1 shl 11) + +const val toolsdir = "" + +@OptIn(ExperimentalUnsignedTypes::class) +fun loadFile(filename: String): UByteArray? { + val file = fopen(filename, "rb") + if (file == null) { + perror("cannot read file $filename") + return null + } + memScoped { + fseek(file, 0, SEEK_END) + val expectedSize = ftell(file) + fseek(file, 0, SEEK_SET) + val image = allocArray(expectedSize) + val size = fread(image, expectedSize.toULong(), 1UL, file) + fclose(file) + //println("Read file $filename ($expectedSize bytes)") + return UByteArray(expectedSize.toInt()) { image[it] } + } +} + +@OptIn(ExperimentalUnsignedTypes::class) +fun saveFile(filename: String, data: UByteArray) { + val file = fopen(filename, "wb") + if (file == null) { + perror("cannot write file $filename") + return + } + memScoped { + val image = allocArray(data.size) + for (i in data.indices) { + image[i] = data[i] + } + val size = fwrite(image, data.size.toULong(), 1UL, file) + //println("Saved ${data.size} bytes to $filename") + fclose(file) + } +} + +var imageSize = 11 * 160 * 512 + +@OptIn(ExperimentalUnsignedTypes::class) +fun UByteArray.readLong(offset: Int): UInt { + return (this[offset].toUInt() shl 24) or (this[offset + 1].toUInt() shl 16) or (this[offset + 2].toUInt() shl 8) or (this[offset + 3].toUInt()) +} + +@OptIn(ExperimentalUnsignedTypes::class) +fun UByteArray.readWord(offset: Int): UInt { + return (this[offset].toUInt() shl 8) or (this[offset + 1].toUInt()) +} + +@OptIn(ExperimentalUnsignedTypes::class) +fun UByteArray.writeLong(offset: Int, value: UInt) { + this[offset] = (value shr 24).toUByte() + this[offset + 1] = (value shr 16).toUByte() + this[offset + 2] = (value shr 8).toUByte() + this[offset + 3] = value.toUByte() +} + +@OptIn(ExperimentalUnsignedTypes::class) +fun UByteArray.writeWord(offset: Int, value: UInt) { + this[offset] = (value shr 8).toUByte() + this[offset + 1] = value.toUByte() +} + +@OptIn(ExperimentalUnsignedTypes::class) +fun patchBootblockChecksum(adf: UByteArray) { + var chksum = 0UL + adf.writeLong(4, 0U) + for (i in 0..255) { + val longval = adf.readLong(i * 4) + chksum += longval + if (chksum >= (1UL shl 32)) { + chksum -= (1UL shl 32) - 1UL + } + } + chksum = chksum xor 0xffffffffUL + adf.writeLong(4, chksum.toUInt()) +} + +enum class FileEntryFlags { + CHIPMEM, + DATAFILE, + CODE_HUNK, + DATA_HUNK, + BSS_HUNK, + RELOC_HUNK, + LZ4, + DOYNAX, + ZX0, + ZSTD, + BEST_COMPRESSION, + DELTA8, + DELTA16, + FAST +} + +@OptIn(ExperimentalUnsignedTypes::class) +data class FileEntry( + val data: UByteArray, + val name: String, + val flags: Set, + val memorysize: Int, + var diskoffset: Int = 0, + val hunkNum: Int = 0, + val numHunks: Int = 0 +) + +@OptIn(ExperimentalUnsignedTypes::class) +fun main(args: Array) { + val argParser = ArgParser("platosadf") + + val rootDirectoryOption by argParser.option( + ArgType.String, + "root", + shortName = "r", + description = "Root directory" + ) + + val bootOnlyOption by argParser.option( + ArgType.Boolean, + "bootOnly", + shortName = "b", + description = "Only create ADF with bootblock" + ) + + val numDirBlocksOption by argParser.option( + ArgType.Int, + "numDirBlocks", + shortName = "ndb", + description = "Number of directory blocks to use (default 1)" + ) + + val imageSizeOption by argParser.option( + ArgType.Int, + "imageSize", + shortName = "is", + description = "Maximum image size in blocks (default 1760)" + ) + + val diskLabelOption by argParser.option( + ArgType.String, + "label", + shortName = "l", + description = "Disk label in bootblock (8 characters, default: PLATON42)" + ) + + val truncateOption by argParser.option( + ArgType.Boolean, + "truncate", + shortName = "t", + description = "Truncate disk image to actual used size (rounded to blocks)" + ) + + val fastOption by argParser.option( + ArgType.Boolean, + "fast", + shortName = "f", + description = "Do fast compression (may not be optimal)" + ) + + val sequentialOption by argParser.option( + ArgType.Boolean, + "singlethread", + shortName = "sth", + description = "Don't use parallel file packing" + ) + + if (imageSizeOption != null) { + imageSize = imageSizeOption!! * 512 + } + val diskimage = UByteArray(imageSize) { 0u } + + val adfTargetFileName by argParser.argument(ArgType.String, "adf", description = "Target ADF image") + val bootblockFileName by argParser.argument(ArgType.String, "bootblock", description = "Bootblock file") + val layoutFileName by argParser.argument(ArgType.String, "layout", description = "Layout description file") + + try { + argParser.parse(args) + } catch (ex: IllegalStateException) { + println(ex.message) + exit(-1) + } + + val rootDirectory = if (rootDirectoryOption != null) "$rootDirectoryOption/" else "" + + val bootblock = loadFile(rootDirectory + bootblockFileName) ?: throw IllegalStateException("Bootblock not found!") + if (((bootblock.size > 508) && (bootOnlyOption == null)) || bootblock.size > 1024) { + throw IllegalStateException("Bootblock too large!") + } + bootblock.copyInto(diskimage, destinationOffset = 0) + + if (bootOnlyOption != null) { + patchBootblockChecksum(diskimage) + saveFile(rootDirectory + adfTargetFileName, diskimage) + return + } + var diskLabel1 = 0x504c4154U + if (diskLabelOption != null) { + val diskLabelString = diskLabelOption!! + if (diskLabelString.length == 8) { + diskLabel1 = + (diskLabelString[0].code.toUByte().toUInt() shl 24) or + (diskLabelString[1].code.toUByte().toUInt() shl 16) or + (diskLabelString[2].code.toUByte().toUInt() shl 8) or + diskLabelString[3].code.toUByte().toUInt() + for (i in 4..7) { + diskimage[i + 4] = diskLabelString[i].code.toUByte() + } + } else { + println("Disklabel does not consist of 8 characters, ignoring.") + } + } + + val layoutBinary = loadFile(rootDirectory + layoutFileName) ?: throw IllegalStateException("Missing layout file!") + val layoutText = CharArray(layoutBinary.size) { layoutBinary[it].toInt().toChar() } + .concatToString() + .split("\n") + .filter { it.isNotBlank() && !it.startsWith("//") } + + // create the (packed) files + + val filetable = ArrayList() + val fileEntrySets = Array>(layoutText.size) { emptyList() } + + val dispatcher = Dispatchers.IO + if (sequentialOption != true) { + runBlocking { + val workers = ArrayList>>>() + for (line in layoutText.withIndex()) { + val worker = async(dispatcher) { + line.index to parseLayoutLine(line.value, rootDirectory, fastOption == true) + } + workers.add(worker) + } + for (worker in workers) { + val pair = worker.await() + fileEntrySets[pair.first] = pair.second + } + } + } else { + for (line in layoutText.withIndex()) { + fileEntrySets[line.index] = parseLayoutLine(line.value, rootDirectory, fastOption == true) + } + } + var diskoffset = 0 + for (entrySet in fileEntrySets) { + var entrySize = 0 + for (entry in entrySet) { + entry.diskoffset += diskoffset + entrySize += (entry.data.size + 1) and -2 + filetable.add(entry) + } + diskoffset += entrySize + } + + val numDirBlocks = numDirBlocksOption ?: 1 + + val startoffset = 512 + numDirBlocks * 512 + val freeBytes = imageSize - (startoffset + diskoffset) + println( + "${filetable.size} entries in image ${startoffset + diskoffset} of $imageSize used " + + "(${freeBytes} (${freeBytes / 1024} KB) free)" + ) + if (freeBytes < 0) { + println("Disk is full!") + exit(-1) + } + val directoryEntriesOffset = 512 + var fileentryOffset = directoryEntriesOffset + var lastname: String? = null + var uncompressedData = 0 + var chiphunk = 0 + var fasthunk = 0 + + for ((entrynum, fileentry) in filetable.withIndex()) { + val containsData = fileentry.data.isNotEmpty() + val finaldiskoffset = if (containsData) startoffset + fileentry.diskoffset else 0 + var flags = 0 + var flagsString: String + if (finaldiskoffset != 0) uncompressedData += fileentry.memorysize + if (lastname != fileentry.name) { + chiphunk = 0 + fasthunk = 0 + } + if (fileentry.flags.contains(FileEntryFlags.CHIPMEM)) { + flagsString = "CHIP" + flags = flags or DEFF_CHIPMEM + chiphunk += fileentry.memorysize + } else { + flagsString = "FAST" + fasthunk += fileentry.memorysize + } + if (fileentry.flags.contains(FileEntryFlags.DATAFILE)) { + flagsString += " DATA " + flags = flags or DEFF_DATAFILE + } + if (fileentry.flags.contains(FileEntryFlags.CODE_HUNK)) { + flagsString += " HUNK CODE " + flags = flags or DEFF_HUNK_CODE + } + if (fileentry.flags.contains(FileEntryFlags.DATA_HUNK)) { + flagsString += " HUNK DATA " + flags = flags or DEFF_HUNK_DATA + } + if (fileentry.flags.contains(FileEntryFlags.BSS_HUNK)) { + flagsString += " HUNK BSS " + flags = flags or DEFF_HUNK_BSS + } + if (fileentry.flags.contains(FileEntryFlags.RELOC_HUNK)) { + flagsString += " HUNK RELOC" + flags = flags or DEFF_HUNK_RELOC + } + if (containsData && fileentry.flags.contains(FileEntryFlags.LZ4)) { + flagsString += " LZ4" + flags = flags or DEFF_LZ4 + } + if (containsData && fileentry.flags.contains(FileEntryFlags.ZX0)) { + flagsString += " ZX0 IN-PLACE" + flags = flags or DEFF_ZX0 or DEFF_IN_PLACE + } + if (containsData && fileentry.flags.contains(FileEntryFlags.DOYNAX)) { + flagsString += " DOYNAX" + flags = flags or DEFF_DOYNAX + } + if (containsData && fileentry.flags.contains(FileEntryFlags.DELTA8)) { + flagsString += " DELTA8" + flags = flags or DEFF_DELTA8 + } + println( + "${entrynum.toString().padStart(2)}: " + + "${finaldiskoffset.toString().padStart(6)} ${fileentry.name.padEnd(16)} " + + "${fileentry.data.size.toString().padStart(7)} " + + "${fileentry.hunkNum}/${fileentry.numHunks} " + + "${fileentry.memorysize.toString().padStart(7)} | " + + "${(chiphunk / 1024).toString().padStart(3)} KB CHIP | " + + "${(fasthunk / 1024).toString().padStart(3)} KB FAST | " + + flagsString + ) + + if (containsData) { + fileentry.data.copyInto(diskimage, destinationOffset = finaldiskoffset) + } + if (lastname != fileentry.name) { + for (i in 0 until (fileentry.name.length.coerceAtMost(16))) { + diskimage[fileentryOffset + i] = fileentry.name[i].code.toUByte() + } + lastname = fileentry.name + } else { + if (entrynum > 0) { + diskimage.writeWord( + fileentryOffset - 16, + diskimage.readWord(fileentryOffset - 16) or DEFF_MORE_HUNKS.toUInt() + ) + } + fileentryOffset -= 16 + } + diskimage.writeWord(fileentryOffset + 16, flags.toUInt()) + diskimage[fileentryOffset + 18] = fileentry.hunkNum.toUByte() + diskimage[fileentryOffset + 19] = fileentry.numHunks.toUByte() + diskimage.writeLong(fileentryOffset + 20, fileentry.memorysize.toUInt()) + diskimage.writeLong(fileentryOffset + 24, finaldiskoffset.toUInt()) + diskimage.writeLong(fileentryOffset + 28, fileentry.data.size.toUInt()) + fileentryOffset += 32 + } + if (fileentryOffset >= directoryEntriesOffset + numDirBlocks * 512) { + println("Not enough space in directory table. Increase number of directory blocks!") + exit(-1) + } + println("Total size uncompressed: $uncompressedData (${uncompressedData / 1024} KB)") + + patchBootblockChecksum(diskimage) + val primaryChecksum = diskimage.readLong(4) + diskimage.writeLong(directoryEntriesOffset - 4, primaryChecksum + (diskLabel1 xor 0xffffffffU) + 1U) + patchBootblockChecksum(diskimage) + if (diskimage.readLong(4) != diskLabel1) { + diskimage.writeLong(directoryEntriesOffset - 4, primaryChecksum + (diskLabel1 xor 0xffffffffU)) + patchBootblockChecksum(diskimage) + } + if (diskimage.readLong(4) != diskLabel1) { + println("Bootblock checksum not cool!") + } + + if (truncateOption == true) { + saveFile(rootDirectory + adfTargetFileName, diskimage.copyOf((((startoffset + diskoffset) + 511) / 512) * 512)) + } else { + saveFile(rootDirectory + adfTargetFileName, diskimage) + } +} + +private fun removeAllCompressionFlags(fileFlags: MutableSet) { + fileFlags.remove(FileEntryFlags.LZ4) + fileFlags.remove(FileEntryFlags.DOYNAX) + fileFlags.remove(FileEntryFlags.ZX0) + fileFlags.remove(FileEntryFlags.ZSTD) +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun compressFile( + filename: String, + fileFlags: MutableSet, + rootDirectory: String, data: UByteArray +): UByteArray? { + val tmpfileName = rootDirectory + filename + ".tmp" + //println("Compressing to $tmpfileName") + val targetFileData = + if (fileFlags.contains(FileEntryFlags.DELTA8) && !fileFlags.contains(FileEntryFlags.BEST_COMPRESSION)) { + createDelta8EncodedData(data) + } else { + fileFlags.remove(FileEntryFlags.DELTA8) + data + } + saveFile(tmpfileName, targetFileData) + val thresholdSize = targetFileData.size - 16 + val compressedData = performCompression(rootDirectory, tmpfileName, thresholdSize, fileFlags) + + if (fileFlags.contains(FileEntryFlags.BEST_COMPRESSION)) { + val deltaTargetFileData = createDelta8EncodedData(data) + saveFile(tmpfileName, deltaTargetFileData) + val deltaCompressedData = + performCompression(rootDirectory, tmpfileName, compressedData?.size ?: thresholdSize, fileFlags) + if (deltaCompressedData != null) { + fileFlags.add(FileEntryFlags.DELTA8) + return deltaCompressedData + } + } + if (compressedData == null) { + removeAllCompressionFlags(fileFlags) + } + unlink(tmpfileName) + return compressedData +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun performCompression( + rootDirectory: String, + tmpfileName: String, + thresholdSize: Int, + fileFlags: MutableSet +): UByteArray? { + var dataOut: UByteArray? = null + if (fileFlags.contains(FileEntryFlags.ZX0) || fileFlags.contains(FileEntryFlags.BEST_COMPRESSION)) { + dataOut = compressZx0(rootDirectory, tmpfileName, dataOut?.size ?: thresholdSize, fileFlags) ?: dataOut + } + if (fileFlags.contains(FileEntryFlags.DOYNAX) || fileFlags.contains(FileEntryFlags.BEST_COMPRESSION)) { + dataOut = compressDoynax(rootDirectory, tmpfileName, dataOut?.size ?: thresholdSize, fileFlags) ?: dataOut + } + if (fileFlags.contains(FileEntryFlags.LZ4)) { + dataOut = compressLz4(rootDirectory, tmpfileName, dataOut?.size ?: thresholdSize, fileFlags) ?: dataOut + } + if (fileFlags.contains(FileEntryFlags.ZSTD)) { + dataOut = compressZStd(rootDirectory, tmpfileName, dataOut?.size ?: thresholdSize, fileFlags) ?: dataOut + } + return dataOut +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun compressZStd( + rootDirectory: String, + tmpfileName: String, + thresholdSize: Int, + fileFlags: MutableSet +): UByteArray? { + val bonusparams = "--ultra -22 -f" + val errno = + system("${rootDirectory}${toolsdir}zstd $bonusparams $tmpfileName") + if (errno != 0) println("ZSTD command failed") + val zstdCompressedFile = + loadFile(tmpfileName + ".zst") ?: throw IllegalStateException("Failed to load zst compressed file") + val result = if (zstdCompressedFile.size < thresholdSize) { + removeAllCompressionFlags(fileFlags) + fileFlags.add(FileEntryFlags.ZSTD) + zstdCompressedFile + } else { + null + } + unlink("$tmpfileName.zst") + return result +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun compressLz4( + rootDirectory: String, + tmpfileName: String, + thresholdSize: Int, + fileFlags: MutableSet +): UByteArray? { + val bonusparams = "-12 -BD --no-frame-crc -z -f" + val errno = + system("${rootDirectory}${toolsdir}lz4 $bonusparams $tmpfileName") + if (errno != 0) println("LZ4 command failed") + val lz4CompressedFile = + loadFile("$tmpfileName.lz4") ?: throw IllegalStateException("Failed to load lz4 compressed hunk") + val lz4CompressedBlock = lz4CompressedFile.copyOfRange(4 + 7, lz4CompressedFile.size - 4) // unwrap frame + + val result = if (lz4CompressedBlock.size < thresholdSize) { + removeAllCompressionFlags(fileFlags) + fileFlags.add(FileEntryFlags.LZ4) + lz4CompressedBlock + } else { + null + } + + unlink("$tmpfileName.lz4") + return result +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun compressZx0( + rootDirectory: String, + tmpfileName: String, + thresholdSize: Int, + fileFlags: MutableSet, +): UByteArray? { + if (fileFlags.contains(FileEntryFlags.FAST)) { + val errno = + system("${rootDirectory}${toolsdir}salvador $tmpfileName $tmpfileName.zx0") + if (errno != 0) println("salvador command failed") + } else { + val bonusparams = "-f" + val errno = + system("${rootDirectory}${toolsdir}zx0 $bonusparams $tmpfileName") + if (errno != 0) println("ZX0 command failed") + } + + val zx0CompressedFile = + loadFile("$tmpfileName.zx0") ?: throw IllegalStateException("Failed to load zx0 compressed hunk") + + val result = if (zx0CompressedFile.size < thresholdSize) { + removeAllCompressionFlags(fileFlags) + fileFlags.add(FileEntryFlags.ZX0) + zx0CompressedFile + } else { + null + } + + unlink("$tmpfileName.zx0") + return result +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun compressDoynax( + rootDirectory: String, + tmpfileName: String, + thresholdSize: Int, + fileFlags: MutableSet +): UByteArray? { + val errno = + system("${rootDirectory}${toolsdir}lz -o ${tmpfileName}.lz $tmpfileName") + if (errno != 0) println("lz command failed") + val doynaxCompressedFile = + loadFile("$tmpfileName.lz") ?: throw IllegalStateException("Failed to load lz compressed hunk") + + val result = if (doynaxCompressedFile.size < thresholdSize) { + removeAllCompressionFlags(fileFlags) + fileFlags.add(FileEntryFlags.DOYNAX) + doynaxCompressedFile + } else { + null + } + unlink("$tmpfileName.lz") + return result +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun createDelta8EncodedData(data: UByteArray): UByteArray { + val tmpdata = UByteArray(data.size) + var prior: UByte = 0U + for (i in tmpdata.indices) { + val old = data[i] + tmpdata[i] = (old - prior).toUByte() + prior = old + } + return tmpdata +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun parseLayoutLine( + line: String, + rootDirectory: String, + fastCompression: Boolean = false +): List { + val lineParser = ArgParser("layoutfile") + val filename by lineParser.argument(ArgType.String, "filename", description = "File to incorporate") + val targetNameOption by lineParser.option( + ArgType.String, + "target", + "n", + "Target filename in directory table" + ) + val lz4Option by lineParser.option(ArgType.Boolean, "lz4", "lz4", "Compress with LZ4") + val zx0Option by lineParser.option(ArgType.Boolean, "zx0", "zx0", "Compress with ZX0") + val zstdOption by lineParser.option(ArgType.Boolean, "zstandard", "zstd", "Compress with ZStandard") + val doynaxOption by lineParser.option(ArgType.Boolean, "doynax", "doy", "Compress with Doynax") + val bestCompressionOption by lineParser.option(ArgType.Boolean, "best", "bc", "Pick best compression") + val delta8Option by lineParser.option(ArgType.Boolean, "delta8", "d8", "Delta byte data preprocessing") + val chipmemOption by lineParser.option(ArgType.Boolean, "chipmem", "cm", "Decrunch to chipmem") + val hunksOption by lineParser.option( + ArgType.Boolean, + "hunks", + "dos", + "Loadable DOS hunk (will be split)" + ) + lineParser.parse(line.split(" ").toTypedArray()) + val rawFile = loadFile(rootDirectory + filename) ?: throw IllegalStateException("File not found") + val tableEntryName = if (targetNameOption != null) targetNameOption!! else filename.substringAfterLast("/") + + val fileFlags = HashSet() + if (doynaxOption == true) { + fileFlags.add(FileEntryFlags.DOYNAX) + } + if (lz4Option == true) { + fileFlags.add(FileEntryFlags.LZ4) + } + if (zx0Option == true) { + fileFlags.add(FileEntryFlags.ZX0) + } + if (zstdOption == true) { + fileFlags.add(FileEntryFlags.ZSTD) + } + if (bestCompressionOption == true) { + fileFlags.add(FileEntryFlags.BEST_COMPRESSION) + } + if (fastCompression) { + fileFlags.add(FileEntryFlags.FAST) + } + + val result = if (hunksOption == true) { + createEntriesForHunkFile(rawFile, fileFlags, rootDirectory, tableEntryName) + } else { + fileFlags.add(FileEntryFlags.DATAFILE) + if (chipmemOption == true) { + fileFlags.add(FileEntryFlags.CHIPMEM) + } + if (delta8Option == true) { + fileFlags.add(FileEntryFlags.DELTA8) + } + val compressedFile = compressFile(tableEntryName, fileFlags, rootDirectory, rawFile) + val fileEntry = FileEntry(compressedFile ?: rawFile, tableEntryName, fileFlags, rawFile.size, 0) + arrayListOf(fileEntry) + } + println("$tableEntryName processed (${result.sumOf { it.data.size } / 1024} KB diskspace)") + return result +} + +@OptIn(ExperimentalUnsignedTypes::class) +private fun createEntriesForHunkFile( + rawFile: UByteArray, + fileFlags: HashSet, + rootDirectory: String, + tableEntryName: String +): ArrayList { + if (rawFile.readLong(0) != HUNK_HEADER) throw IllegalStateException("Not a DOS file") + val numHunks = rawFile.readLong(8).toInt() + val firstHunk = rawFile.readLong(12).toInt() + val lastHunk = rawFile.readLong(16).toInt() + val hunkSizes = UIntArray(lastHunk - firstHunk + 1) { rawFile.readLong(20 + it * 4) } + var hunkOffset = 20 + numHunks * 4 + + var diskoffset = 0 + val filetable = ArrayList() + for (hunkNum in 0 until numHunks) { + val hunkFlags = HashSet(fileFlags) + if (hunkSizes[hunkNum] shr 30 == MEM_CHIP) { + hunkFlags.add(FileEntryFlags.CHIPMEM) + } + val memorysize = (hunkSizes[hunkNum] and 0xcfffffffU).toInt() * 4 + when (rawFile.readLong(hunkOffset)) { + HUNK_CODE -> { + hunkFlags.add(FileEntryFlags.CODE_HUNK) + hunkOffset += 4 + val hunkSize = rawFile.readLong(hunkOffset).toInt() * 4 + hunkOffset += 4 + val hunkData = rawFile.copyOfRange(hunkOffset, hunkOffset + hunkSize) + hunkOffset += hunkSize + //println("Compressing hunk $hunkNum/$numHunks of $tableEntryName") + val compressedFile = compressFile(tableEntryName, hunkFlags, rootDirectory, hunkData) + val codeHunkEntry = FileEntry( + compressedFile ?: hunkData, tableEntryName, + hunkFlags, memorysize, + diskoffset, + hunkNum, + numHunks + ) + diskoffset += (codeHunkEntry.data.size + 1) and 0x7ffffffe + filetable.add(codeHunkEntry) + } + + HUNK_DATA -> { + hunkFlags.add(FileEntryFlags.DATA_HUNK) + hunkOffset += 4 + val hunkSize = rawFile.readLong(hunkOffset).toInt() * 4 + hunkOffset += 4 + val hunkData = rawFile.copyOfRange(hunkOffset, hunkOffset + hunkSize) + hunkOffset += hunkSize + //println("Compressing hunk $hunkNum/$numHunks of $tableEntryName") + val compressedFile = compressFile(tableEntryName, hunkFlags, rootDirectory, hunkData) + val dataHunkEntry = FileEntry( + compressedFile ?: hunkData, tableEntryName, + hunkFlags, memorysize, + diskoffset, + hunkNum, + numHunks + ) + diskoffset += (dataHunkEntry.data.size + 1) and 0x7ffffffe + filetable.add(dataHunkEntry) + } + + HUNK_BSS -> { + hunkFlags.add(FileEntryFlags.BSS_HUNK) + hunkOffset += 4 + val hunkSize = rawFile.readLong(hunkOffset).toInt() * 4 + if (hunkSize != memorysize) throw IllegalStateException("BSS memory size does not match!") + hunkOffset += 4 + val bssHunkEntry = + FileEntry(UByteArray(0), tableEntryName, hunkFlags, memorysize, 0, hunkNum, numHunks) + filetable.add(bssHunkEntry) + } + + else -> throw IllegalStateException("Unknown hunk " + rawFile.readLong(hunkOffset) + " at offset $hunkOffset") + } + var done = false + do { + when (rawFile.readLong(hunkOffset)) { + HUNK_RELOC32 -> { + val relocFlags = HashSet() + relocFlags.add(FileEntryFlags.RELOC_HUNK) + hunkOffset += 4 + val newRelocArray = ArrayList() + do { + val numOffsets = rawFile.readLong(hunkOffset).toInt() + newRelocArray.add(numOffsets) + hunkOffset += 4 + if (numOffsets == 0) { + break + } + newRelocArray.add(rawFile.readLong(hunkOffset).toInt()) + hunkOffset += 4 + val newHunkRelocsArray = ArrayList() + for (i in 0 until numOffsets) { + val relocOffset = rawFile.readLong(hunkOffset).toInt() + if ((relocOffset and 1) == 1) { + throw IllegalStateException("Odd reloc") + } + if (relocOffset >= 128 * 1024) { + throw IllegalStateException("Reloc too big") + } + newHunkRelocsArray.add(relocOffset / 2) + hunkOffset += 4 + } + newHunkRelocsArray.sort() + newRelocArray.addAll(newHunkRelocsArray) + } while (true) + val hunkReloc = UByteArray(newRelocArray.size * 2) + for (i in newRelocArray.indices) { + hunkReloc.writeWord(i * 2, newRelocArray[i].toUInt()) + } + //println("Relocation Hunk " + hunkReloc.size) + val relocHunkEntry = + FileEntry(hunkReloc, tableEntryName, relocFlags, 0, diskoffset, hunkNum, numHunks) + filetable.add(relocHunkEntry) + diskoffset += hunkReloc.size + } + + HUNK_END -> { + hunkOffset += 4 + done = true + } + + else -> throw IllegalStateException("Unknown additional hunk " + rawFile.readLong(hunkOffset) + " at offset $hunkOffset") + } + } while (!done) + } + return filetable +} \ No newline at end of file