diff --git a/014.lace_mode/init.s b/014.lace_mode/init.s index 13d9500..a1ac62f 100644 --- a/014.lace_mode/init.s +++ b/014.lace_mode/init.s @@ -6,18 +6,18 @@ init: move #$7fff,INTENA(a6) ; disable all interrupts ;; set up default palette - bsr.s installColorPalette + bsr installColorPalette - if INTERLACE == 1 + if INTERLACE==1 ;; poke the bitplane pointers for the two copper lists. move.l #SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH,d0 lea copper(pc),a0 - bsr.s pokeBitplanePointers + bsr pokeBitplanePointers endif moveq.l #0,d0 lea copperLOF(pc),a0 - bsr.s pokeBitplanePointers + bsr pokeBitplanePointers ;; set up playfield move.w #(RASTER_Y_START<<8)|RASTER_X_START,DIWSTRT(a6) @@ -26,7 +26,7 @@ init: move.w #(RASTER_X_START/2-SCREEN_RES),DDFSTRT(a6) move.w #(RASTER_X_START/2-SCREEN_RES)+(8*((SCREEN_WIDTH/16)-1)),DDFSTOP(a6) - if INTERLACE == 1 + if INTERLACE==1 move.w #(SCREEN_BIT_DEPTH<<12)|COLOR_ON|HOMOD|LACE,BPLCON0(a6) move.w #2*SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL1MOD(a6) move.w #2*SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL2MOD(a6) diff --git a/014.lace_mode/lace_mode.s b/014.lace_mode/lace_mode.s index 864ca07..d280348 100644 --- a/014.lace_mode/lace_mode.s +++ b/014.lace_mode/lace_mode.s @@ -11,8 +11,8 @@ entry: .mainLoop: bsr waitVerticalBlank - if INTERLACE == 1 - btst.w #VPOSRLOFBIT,VPOSR(a6) + if INTERLACE==1 + btst #VPOSRLOFBIT,VPOSR(a6) beq.s .lof lea copper(pc),a0 move.l a0,COP1LC(a6) diff --git a/015.sliced_ham/bin/sliced_ham.adf b/015.sliced_ham/bin/sliced_ham.adf index 75e1c67..8529681 100644 Binary files a/015.sliced_ham/bin/sliced_ham.adf and b/015.sliced_ham/bin/sliced_ham.adf differ diff --git a/016.copper_fun/bin/copper_fun.adf b/016.copper_fun/bin/copper_fun.adf index 62e6545..d7f39f5 100644 Binary files a/016.copper_fun/bin/copper_fun.adf and b/016.copper_fun/bin/copper_fun.adf differ diff --git a/017.dual_playfield/init.s b/017.dual_playfield/init.s index 76ca918..23b3a27 100644 --- a/017.dual_playfield/init.s +++ b/017.dual_playfield/init.s @@ -6,17 +6,17 @@ init: move #$7fff,INTENA(a6) ; disable all interrupts ;; set up default palette - bsr.s installColorPalette + bsr installColorPalette ;; poke playfield 1 bitplane pointers lea pf1_bitplanepointers(pc),a0 lea pf1_bitplanes(pc),a1 - bsr.s pokeBitplanePointers + bsr pokeBitplanePointers ;; poke playfield 2 bitplane pointers lea pf2_bitplanepointers(pc),a0 lea pf2_bitplanes(pc),a1 - bsr.s pokeBitplanePointers + bsr pokeBitplanePointers ;; set up playfield move.w #(RASTER_Y_START<<8)|RASTER_X_START,DIWSTRT(a6) @@ -28,7 +28,7 @@ init: ;; enabled 2x the bitplanes as 2x playfields move.w #((SCREEN_BIT_DEPTH*2)<<12)|COLOR_ON|DBLPF,BPLCON0(a6) ;; set playfield2 to have priority - move.w #PF2PRI, BPLCON2(a6) + move.w #PF2PRI,BPLCON2(a6) move.w #SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL1MOD(a6) move.w #SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL2MOD(a6) diff --git a/018.vert_scroll/init.s b/018.vert_scroll/init.s index 6615edc..bbde5c9 100644 --- a/018.vert_scroll/init.s +++ b/018.vert_scroll/init.s @@ -6,11 +6,11 @@ init: move #$7fff,INTENA(a6) ; disable all interrupts ;; set up default palette - bsr.s installColorPalette + bsr installColorPalette moveq.l #0,d0 lea copper(pc),a0 - bsr.s pokeBitplanePointers + bsr pokeBitplanePointers ;; set up playfield move.w #(RASTER_Y_START<<8)|RASTER_X_START,DIWSTRT(a6) diff --git a/018.vert_scroll/vert_scroll.s b/018.vert_scroll/vert_scroll.s index 57a44a1..948dcdd 100644 --- a/018.vert_scroll/vert_scroll.s +++ b/018.vert_scroll/vert_scroll.s @@ -51,7 +51,7 @@ pokeBitplanePointers: ;; a0 = BPLP copper list address movem.l d0-a6,-(sp) lea bitplanes(pc),a1 - add.l d0, a1 + add.l d0,a1 moveq #SCREEN_BIT_DEPTH-1,d0 .bitplaneloop: move.l a1,d1 diff --git a/019.hori_scroll/hori_scroll.s b/019.hori_scroll/hori_scroll.s index b079afe..4ab95ae 100644 --- a/019.hori_scroll/hori_scroll.s +++ b/019.hori_scroll/hori_scroll.s @@ -37,13 +37,13 @@ SetupHoriScrollBitDelay: HoriScrollPlayfield: movem.l d0-a6,-(sp) - move.l hpos,d0 - lsr.l #3,d0 ;bytes to scroll - add.l d0,bitplaneAddress - move.l hpos,d1 - and.l #$F,d1 - move.l #$F,d0 - sub.l d1,d0 ;bits to delay + move.l hpos,d0 ; number of pixels we want to scroll + lsr.l #3,d0 ; bytes to scroll + add.l d0,bitplaneAddress ; used to set the bitplane pointers when combined with vertical scrolling + move.l hpos,d1 ; pixels = 0xf - (hpos - (hpos_bytes*8)) + and.l #$F,d1 + move.l #$F,d0 + sub.l d1,d0 ; bits to delay bsr SetupHoriScrollBitDelay .done: movem.l (sp)+,d0-a6 @@ -115,7 +115,7 @@ PokeBitplanePointers: ;; a0 = BPLP copper list address movem.l d0-a6,-(sp) lea bitplanes(pc),a1 - add.l d0, a1 + add.l d0,a1 moveq #SCREEN_BIT_DEPTH-1,d0 .bitplaneloop: move.l a1,d1 diff --git a/019.hori_scroll/init.s b/019.hori_scroll/init.s index 7f70653..b26b543 100644 --- a/019.hori_scroll/init.s +++ b/019.hori_scroll/init.s @@ -6,11 +6,11 @@ Init: move #$7fff,INTENA(a6) ; disable all interrupts ;; set up default palette - bsr.s InstallColorPalette + bsr InstallColorPalette moveq.l #0,d0 lea copper(pc),a0 - bsr.s PokeBitplanePointers + bsr PokeBitplanePointers ;; set up playfield move.w #(RASTER_Y_START<<8)|RASTER_X_START,DIWSTRT(a6) diff --git a/020.shrinkler/bin/shrinkler.adf b/020.shrinkler/bin/shrinkler.adf index 612aba1..c9775e9 100644 Binary files a/020.shrinkler/bin/shrinkler.adf and b/020.shrinkler/bin/shrinkler.adf differ diff --git a/020.shrinkler/init.s b/020.shrinkler/init.s index b4bf412..c2d3ec0 100644 --- a/020.shrinkler/init.s +++ b/020.shrinkler/init.s @@ -12,16 +12,16 @@ Init: ;; set up default palette jsr InstallColorPalette - if INTERLACE == 1 + if INTERLACE==1 ;; poke the bitplane pointers for the two copper lists. move.l #SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH,d0 - lea copperListAlternate(pc),a0 + lea copperListAlternate,a0 jsr PokeBitplanePointers endif moveq.l #0,d0 lea copperList,a0 - jsr PokeBitplanePointers + jsr PokeBitplanePointers ;; set up playfield move.w #(RASTER_Y_START<<8)|RASTER_X_START,DIWSTRT(a6) @@ -30,13 +30,13 @@ Init: move.w #(RASTER_X_START/2-SCREEN_RES),DDFSTRT(a6) move.w #(RASTER_X_START/2-SCREEN_RES)+(8*((SCREEN_WIDTH/16)-1)),DDFSTOP(a6) - if HAM_MODE == 1 + if HAM_MODE==1 HAMBIT equ HOMOD else HAMBIT equ 0 endif - if INTERLACE == 1 + if INTERLACE==1 move.w #(SCREEN_BIT_DEPTH<<12)|COLOR_ON|HAMBIT|LACE,BPLCON0(a6) move.w #2*SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL1MOD(a6) move.w #2*SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL2MOD(a6) diff --git a/020.shrinkler/shrinkler.s b/020.shrinkler/shrinkler.s index 670aaea..b8189e6 100644 --- a/020.shrinkler/shrinkler.s +++ b/020.shrinkler/shrinkler.s @@ -12,7 +12,7 @@ Entry: .mainLoop: jsr WaitVerticalBlank - if INTERLACE == 1 + if INTERLACE==1 btst.w #VPOSRLOFBIT,VPOSR(a6) beq.s .lof lea copperListAlternate(pc),a0 @@ -22,7 +22,7 @@ Entry: lea copperList(pc),a0 move.l a0,COP1LC(a6) .done - endif ; INTERLACE == 1 + endif; INTERLACE==1 bra .mainLoop @@ -47,7 +47,7 @@ InstallColorPalette: include "out/image-palette.s" rts - if INTERLACE == 1 + if INTERLACE==1 copperListAlternate: ;; bitplane pointers must be first else poking addresses will be incorrect dc.w BPL1PTL,0 @@ -63,7 +63,7 @@ copperListAlternate: dc.w BPL6PTL,0 dc.w BPL6PTH,0 dc.l $fffffffe - endif ; INTERLACE == 1 + endif; INTERLACE==1 copperList: ;; bitplane pointers must be first else poking addresses will be incorrect @@ -83,8 +83,8 @@ copperList: dc.l $fffffffe bitplanes: - if HAM_MODE == 1 + if HAM_MODE==1 incbin "out/image-ham.bin" - else + else; HAM_MODE==0 incbin "out/image.bin" - endif \ No newline at end of file + endif; HAM_MODE==1 \ No newline at end of file diff --git a/021.calling_c/bin/calling_c.adf b/021.calling_c/bin/calling_c.adf index 228906a..16d9a43 100644 Binary files a/021.calling_c/bin/calling_c.adf and b/021.calling_c/bin/calling_c.adf differ diff --git a/021.calling_c/calling_c.s b/021.calling_c/calling_c.s index a5cdba5..ac616e8 100644 --- a/021.calling_c/calling_c.s +++ b/021.calling_c/calling_c.s @@ -13,8 +13,8 @@ Entry: .mainLoop: jsr WaitVerticalBlank - if INTERLACE == 1 - btst.w #VPOSRLOFBIT,VPOSR(a6) + if INTERLACE==1 + btst #VPOSRLOFBIT,VPOSR(a6) beq.s .lof lea copperListAlternate(pc),a0 move.l a0,COP1LC(a6) @@ -23,7 +23,7 @@ Entry: lea copperList(pc),a0 move.l a0,COP1LC(a6) .done - endif ; INTERLACE == 1 + endif; INTERLACE==1 bra .mainLoop ;=========================================================== @@ -53,7 +53,7 @@ InstallColorPalette: include "out/image-palette.s" rts - if INTERLACE == 1 + if INTERLACE==1 copperListAlternate: ;; bitplane pointers must be first else poking addresses will be incorrect dc.w BPL1PTL,0 @@ -69,7 +69,7 @@ copperListAlternate: dc.w BPL6PTL,0 dc.w BPL6PTH,0 dc.l $fffffffe - endif ; INTERLACE == 1 + endif; INTERLACE==1 copperList: ;; bitplane pointers must be first else poking addresses will be incorrect @@ -89,7 +89,7 @@ copperList: dc.l $fffffffe bitplanes: - if HAM_MODE == 1 + if HAM_MODE==1 incbin "out/image-ham.bin" else incbin "out/image.bin" diff --git a/021.calling_c/init.s b/021.calling_c/init.s index 123fc1f..49821c2 100644 --- a/021.calling_c/init.s +++ b/021.calling_c/init.s @@ -15,7 +15,7 @@ Init: ;; Make a call to a C function with the following prototype: ;; void PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned short interlace, unsigned short numBitplanes, unsigned short screenWidthBytes) - if INTERLACE == 1 + if INTERLACE==1 ;; poke the bitplane pointers for the two copper lists. move.l #SCREEN_WIDTH_BYTES,-(sp) ; arguments are pushed onto the stack... move.l #SCREEN_BIT_DEPTH,-(sp) ; in reverse order. 16 bit variables are passed as 32 bits. @@ -41,13 +41,13 @@ Init: move.w #(RASTER_X_START/2-SCREEN_RES),DDFSTRT(a6) move.w #(RASTER_X_START/2-SCREEN_RES)+(8*((SCREEN_WIDTH/16)-1)),DDFSTOP(a6) - if HAM_MODE == 1 + if HAM_MODE==1 HAMBIT equ HOMOD else HAMBIT equ 0 endif - if INTERLACE == 1 + if INTERLACE==1 move.w #(SCREEN_BIT_DEPTH<<12)|COLOR_ON|HAMBIT|LACE,BPLCON0(a6) move.w #2*SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL1MOD(a6) move.w #2*SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL2MOD(a6) diff --git a/022.photons_bootloader/init.s b/022.photons_bootloader/init.s index 2e7f55b..c2d3ec0 100644 --- a/022.photons_bootloader/init.s +++ b/022.photons_bootloader/init.s @@ -12,7 +12,7 @@ Init: ;; set up default palette jsr InstallColorPalette - if INTERLACE == 1 + if INTERLACE==1 ;; poke the bitplane pointers for the two copper lists. move.l #SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH,d0 lea copperListAlternate,a0 @@ -30,13 +30,13 @@ Init: move.w #(RASTER_X_START/2-SCREEN_RES),DDFSTRT(a6) move.w #(RASTER_X_START/2-SCREEN_RES)+(8*((SCREEN_WIDTH/16)-1)),DDFSTOP(a6) - if HAM_MODE == 1 + if HAM_MODE==1 HAMBIT equ HOMOD else HAMBIT equ 0 endif - if INTERLACE == 1 + if INTERLACE==1 move.w #(SCREEN_BIT_DEPTH<<12)|COLOR_ON|HAMBIT|LACE,BPLCON0(a6) move.w #2*SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL1MOD(a6) move.w #2*SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES,BPL2MOD(a6) diff --git a/022.photons_bootloader/photons_bootloader.s b/022.photons_bootloader/photons_bootloader.s index 670aaea..2ed6d05 100644 --- a/022.photons_bootloader/photons_bootloader.s +++ b/022.photons_bootloader/photons_bootloader.s @@ -12,8 +12,8 @@ Entry: .mainLoop: jsr WaitVerticalBlank - if INTERLACE == 1 - btst.w #VPOSRLOFBIT,VPOSR(a6) + if INTERLACE==1 + btst #VPOSRLOFBIT,VPOSR(a6) beq.s .lof lea copperListAlternate(pc),a0 move.l a0,COP1LC(a6) @@ -22,7 +22,7 @@ Entry: lea copperList(pc),a0 move.l a0,COP1LC(a6) .done - endif ; INTERLACE == 1 + endif ; INTERLACE==1 bra .mainLoop @@ -47,7 +47,7 @@ InstallColorPalette: include "out/image-palette.s" rts - if INTERLACE == 1 + if INTERLACE==1 copperListAlternate: ;; bitplane pointers must be first else poking addresses will be incorrect dc.w BPL1PTL,0 @@ -63,7 +63,7 @@ copperListAlternate: dc.w BPL6PTL,0 dc.w BPL6PTH,0 dc.l $fffffffe - endif ; INTERLACE == 1 + endif; INTERLACE==1 copperList: ;; bitplane pointers must be first else poking addresses will be incorrect @@ -83,7 +83,7 @@ copperList: dc.l $fffffffe bitplanes: - if HAM_MODE == 1 + if HAM_MODE==1 incbin "out/image-ham.bin" else incbin "out/image.bin" diff --git a/shared/base.mk b/shared/base.mk index 6f89f00..b6126c1 100644 --- a/shared/base.mk +++ b/shared/base.mk @@ -11,6 +11,9 @@ RESIZE=$(RESIZEDIR)/out/resize A500_RUN_SCRIPT=~/Google\ Drive/Amiga/amiga500.sh A600_RUN_SCRIPT=~/Google\ Drive/Amiga/amiga600.sh +#VASM_ARGS=-phxass -Fhunk -quiet -spaces +VASM_ARGS=-Fhunk -quiet -esc + ifndef FLOPPY FLOPPY=bin/$(EXAMPLE_NAME).adf endif @@ -41,7 +44,7 @@ ifndef BOOTBLOCK_ASM BOOTBLOCK_ASM=../shared/shrinkler_bootblock.s endif PROGRAM_BIN=out/shrunk.bin -VASM_EXTRA_BOOTBLOCK_ARGS=-DDECOMPRESS_ADDRESS="\$$$(DECOMPRESS_ADDRESS)" -DSHRINKLER=$(SHRINKLER) +VASM_EXTRA_BOOTBLOCK_ARGS=-DSHRINKLER=$(SHRINKLER) -DDECOMPRESS_ADDRESS="\$$$(DECOMPRESS_ADDRESS)" else ifndef BOOTBLOCK_ASM BOOTBLOCK_ASM=../shared/bootblock.s @@ -97,13 +100,13 @@ out/bootblock.bin: out/bootblock.o vlink -brawbin1 $< -o $@ out/bootblock.o: $(BOOTBLOCK_ASM) $(PROGRAM_BIN) - vasmm68k_mot $(VASM_EXTRA_BOOTBLOCK_ARGS) -DUSERSTACK_ADDRESS="\$$$(USERSTACK_ADDRESS)" -DBASE_ADDRESS="\$$$(BASE_ADDRESS)" -Fhunk -phxass -opt-fconst -nowarn=62 -quiet $< -o $@ -I/usr/local/amiga/os-include + vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_BOOTBLOCK_ARGS) -DUSERSTACK_ADDRESS="\$$$(USERSTACK_ADDRESS)" -DBASE_ADDRESS="\$$$(BASE_ADDRESS)" $< -o $@ -I/usr/local/amiga/os-include out/main.o: $(MODULE) $(EXTRA) - vasmm68k_mot $(VASM_EXTRA_ARGS) -Fhunk -phxass -opt-fconst -nowarn=62 -quiet $< -o $@ -I/usr/local/amiga/os-include + vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ -I/usr/local/amiga/os-include out/%.o: %.s - vasmm68k_mot $(VASM_EXTRA_ARGS) -Fhunk -phxass -opt-fconst -nowarn=62 -quiet $< -o $@ -I/usr/local/amiga/os-include + vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ -I/usr/local/amiga/os-include out/%.o: %.c vc -O3 -c $< -o $@ diff --git a/shared/hardware_bootblock.s b/shared/hardware_bootblock.s index c6caf6d..c6d24d9 100644 --- a/shared/hardware_bootblock.s +++ b/shared/hardware_bootblock.s @@ -96,21 +96,21 @@ LoadScript: ;At $120, sysinfo in 4 regs, a6=$dff002 *--- load first part ---* - if SHRINKLER == 1 + if SHRINKLER==1 lea DECOMPRESS_ADDRESS,a0 ; load shrinkler compressed data here else lea BASE_ADDRESS,a0 ; main entry point endif moveq #2,d0 ;from sector 2 - move.w #-((mainEnd-mainStart)/512),d1;num sectors, - == Step0 + move.w #-((mainEnd-mainStart)/512),d1;num sectors, - ==Step0 jsr LoadMFMB lea $dff000,a6 ;restore plain custombase addr for demo - if SHRINKLER == 0 + if SHRINKLER==0 jmp (a0) ; -> main entry point - else ; SHRINKER == 1 + else ; SHRINKER==1 ; a0 = compressed data lea DECOMPRESS_ADDRESS,a0 @@ -131,7 +131,7 @@ CompressCallback: move.l (sp)+,a6 rts - endif ; SHRINKLER == 1 + endif ; SHRINKLER==1 @@ -337,7 +337,7 @@ NullCop: dc.w $ffdf,$fffe dc.l -2 - if SHRINKLER == 1 + if SHRINKLER==1 include "../tools/external/shrinkler/ShrinklerDecompress.S" endif BootE: @@ -353,15 +353,15 @@ MFMbuf equ LoaderVars+(BootE-CopyStart) MFMbufE equ MFMbuf+MFMlen ;lowest free address. $372e for a full bootblock. mainStart: - if SHRINKLER == 1 + if SHRINKLER==1 incbin "out/shrunk.bin" - else ; SHRINKLER == 0 + else ; SHRINKLER==0 incbin "out/main.bin" - endif ; SHRINKLER == 0 + endif ; SHRINKLER==0 cnop 0,512 mainEnd: end diff --git a/shared/shrinkler_bootblock.s b/shared/shrinkler_bootblock.s index 1c6f657..cff32d5 100644 --- a/shared/shrinkler_bootblock.s +++ b/shared/shrinkler_bootblock.s @@ -14,7 +14,7 @@ BootEntry: ;; a6 = exec base ;; a1 = trackdisk.device I/O request pointer - if SHRINKLER == 1 + if SHRINKLER==1 lea DECOMPRESS_ADDRESS,a5 ; load shrinkler compressed data here else lea BASE_ADDRESS,a5 ; main.s entry point @@ -32,11 +32,10 @@ BootEntry: move.w #TD_MOTOR,IO_COMMAND(a1) jsr _LVODoIO(a6) - if SHRINKLER == 0 - + if SHRINKLER==0 jmp (a5) ; -> main.s entry point - else ; SHRINKER == 1 + else ; SHRINKER==1 ; a0 = compressed data lea DECOMPRESS_ADDRESS,a0 @@ -59,21 +58,21 @@ Callback: move.l (sp)+,a6 rts - endif ; SHRINKLER == 1 + endif ; SHRINKLER==1 ;; Pad the remainder of the bootblock cnop 0,1024 mainStart: - if SHRINKLER == 1 + if SHRINKLER==1 incbin "out/shrunk.bin" - else ; SHRINKLER == 0 + else ; SHRINKLER==0 incbin "out/main.bin" - endif ; SHRINKLER == 0 + endif ; SHRINKLER==0 cnop 0,512 mainEnd: end \ No newline at end of file