diff --git a/Macros.asm b/Macros.asm index 314f3bef..f53ef57a 100644 --- a/Macros.asm +++ b/Macros.asm @@ -20,7 +20,7 @@ locVRAM: macro loc,controlport if (narg=1) move.l #($40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14)),(vdp_control_port).l else - move.l #($40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14)),controlport + move.l #($40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14)),\controlport endc endm @@ -29,13 +29,13 @@ locVRAM: macro loc,controlport ; input: source, length, destination ; --------------------------------------------------------------------------- -writeVRAM: macro +writeVRAM: macro source,length,destination lea (vdp_control_port).l,a5 - move.l #$94000000+(((\2>>1)&$FF00)<<8)+$9300+((\2>>1)&$FF),(a5) - move.l #$96000000+(((\1>>1)&$FF00)<<8)+$9500+((\1>>1)&$FF),(a5) - move.w #$9700+((((\1>>1)&$FF0000)>>16)&$7F),(a5) - move.w #$4000+(\3&$3FFF),(a5) - move.w #$80+((\3&$C000)>>14),(v_vdp_buffer2).w + move.l #$94000000+(((length>>1)&$FF00)<<8)+$9300+((length>>1)&$FF),(a5) + move.l #$96000000+(((source>>1)&$FF00)<<8)+$9500+((source>>1)&$FF),(a5) + move.w #$9700+((((source>>1)&$FF0000)>>16)&$7F),(a5) + move.w #$4000+(destination&$3FFF),(a5) + move.w #$80+((destination&$C000)>>14),(v_vdp_buffer2).w move.w (v_vdp_buffer2).w,(a5) endm @@ -44,13 +44,13 @@ writeVRAM: macro ; input: source, length, destination ; --------------------------------------------------------------------------- -writeCRAM: macro +writeCRAM: macro source,length,destination lea (vdp_control_port).l,a5 - move.l #$94000000+(((\2>>1)&$FF00)<<8)+$9300+((\2>>1)&$FF),(a5) - move.l #$96000000+(((\1>>1)&$FF00)<<8)+$9500+((\1>>1)&$FF),(a5) - move.w #$9700+((((\1>>1)&$FF0000)>>16)&$7F),(a5) - move.w #$C000+(\3&$3FFF),(a5) - move.w #$80+((\3&$C000)>>14),(v_vdp_buffer2).w + move.l #$94000000+(((length>>1)&$FF00)<<8)+$9300+((length>>1)&$FF),(a5) + move.l #$96000000+(((source>>1)&$FF00)<<8)+$9500+((source>>1)&$FF),(a5) + move.w #$9700+((((source>>1)&$FF0000)>>16)&$7F),(a5) + move.w #$C000+(destination&$3FFF),(a5) + move.w #$80+((destination&$C000)>>14),(v_vdp_buffer2).w move.w (v_vdp_buffer2).w,(a5) endm @@ -73,9 +73,9 @@ fillVRAM: macro value,length,loc ; input: source, destination, width [cells], height [cells] ; --------------------------------------------------------------------------- -copyTilemap: macro source,loc,width,height +copyTilemap: macro source,destination,width,height lea (source).l,a1 - move.l #$40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14),d0 + locVRAM \destination,d0 moveq #width,d1 moveq #height,d2 bsr.w TilemapToVRAM @@ -244,11 +244,11 @@ out_of_range: macro exit,pos ; --------------------------------------------------------------------------- gotoSRAM: macro - move.b #1,($A130F1).l + move.b #1,($A130F1).l endm gotoROM: macro - move.b #0,($A130F1).l + move.b #0,($A130F1).l endm ; --------------------------------------------------------------------------- diff --git a/_inc/HUD (part 2).asm b/_inc/HUD (part 2).asm index 3292f282..5e135278 100644 --- a/_inc/HUD (part 2).asm +++ b/_inc/HUD (part 2).asm @@ -152,7 +152,7 @@ Hud_ClrBonusLoop: Hud_Lives: - hudVRAM $FBA0 ; set VRAM address + locVRAM $FBA0,d0 ; set VRAM address moveq #0,d1 move.b (v_lives).w,d1 ; load number of lives lea (Hud_10).l,a2 diff --git a/_inc/HUD_Update.asm b/_inc/HUD_Update.asm index 7c9d66dc..7541d92e 100644 --- a/_inc/HUD_Update.asm +++ b/_inc/HUD_Update.asm @@ -4,11 +4,6 @@ ; ||||||||||||||| S U B R O U T I N E ||||||||||||||||||||||||||||||||||||||| -hudVRAM: macro loc - move.l #($40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14)),d0 - endm - - HUD_Update: tst.w (f_debugmode).w ; is debug mode on? bne.w HudDebug ; if yes, branch @@ -16,7 +11,7 @@ HUD_Update: beq.s @chkrings ; if not, branch clr.b (f_scorecount).w - hudVRAM $DC80 ; set VRAM address + locVRAM $DC80,d0 ; set VRAM address move.l (v_score).w,d1 ; load score bsr.w Hud_Score @@ -28,7 +23,7 @@ HUD_Update: @notzero: clr.b (f_ringcount).w - hudVRAM $DF40 ; set VRAM address + locVRAM $DF40,d0 ; set VRAM address moveq #0,d1 move.w (v_rings).w,d1 ; load number of rings bsr.w Hud_Rings @@ -56,11 +51,11 @@ HUD_Update: move.b #9,(a1) ; keep as 9 @updatetime: - hudVRAM $DE40 + locVRAM $DE40,d0 moveq #0,d1 move.b (v_timemin).w,d1 ; load minutes bsr.w Hud_Mins - hudVRAM $DEC0 + locVRAM $DEC0,d0 moveq #0,d1 move.b (v_timesec).w,d1 ; load seconds bsr.w Hud_Secs @@ -105,13 +100,13 @@ HudDebug: @notzero: clr.b (f_ringcount).w - hudVRAM $DF40 ; set VRAM address + locVRAM $DF40,d0 ; set VRAM address moveq #0,d1 move.w (v_rings).w,d1 ; load number of rings bsr.w Hud_Rings @objcounter: - hudVRAM $DEC0 ; set VRAM address + locVRAM $DEC0,d0 ; set VRAM address moveq #0,d1 move.b (v_spritecount).w,d1 ; load "number of objects" counter bsr.w Hud_Secs diff --git a/_inc/Pattern Load Cues.asm b/_inc/Pattern Load Cues.asm index 884184f1..883ddb14 100644 --- a/_inc/Pattern Load Cues.asm +++ b/_inc/Pattern Load Cues.asm @@ -302,7 +302,7 @@ PLC_GHZAnimals: dc.w ((PLC_GHZAnimalsend-PLC_GHZAnimals-2)/6)-1 ; Pattern load cues - LZ animals ; --------------------------------------------------------------------------- PLC_LZAnimals: dc.w ((PLC_LZAnimalsend-PLC_LZAnimals-2)/6)-1 - plcm Nem_BlackBird, $B000 ; blackbird + plcm Nem_Penguin, $B000 ; penguin plcm Nem_Seal, $B240 ; seal PLC_LZAnimalsend: ; --------------------------------------------------------------------------- @@ -330,7 +330,7 @@ PLC_SYZAnimals: dc.w ((PLC_SYZAnimalsend-PLC_SYZAnimals-2)/6)-1 ; Pattern load cues - SBZ animals ; --------------------------------------------------------------------------- PLC_SBZAnimals: dc.w ((PLC_SBZAnimalsend-PLC_SBZAnimals-2)/6)-1 - plcm Nem_Rabbit, $B000 ; rabbit + plcm Nem_Rabbit, $B000 ; rabbit plcm Nem_Chicken, $B240 ; chicken PLC_SBZAnimalsend: ; --------------------------------------------------------------------------- @@ -356,7 +356,7 @@ PLC_Ending: dc.w ((PLC_Endingend-PLC_Ending-2)/6)-1 endc plcm Nem_Rabbit, $AA60 ; rabbit plcm Nem_Chicken, $ACA0 ; chicken - plcm Nem_BlackBird, $AE60 ; blackbird + plcm Nem_Penguin, $AE60 ; penguin plcm Nem_Seal, $B0A0 ; seal plcm Nem_Pig, $B260 ; pig plcm Nem_Flicky, $B4A0 ; flicky diff --git a/_incObj/26 Monitor (SolidSides subroutine).asm b/_incObj/26 Monitor (SolidSides subroutine).asm index cbe42ffb..00ea2e27 100644 --- a/_incObj/26 Monitor (SolidSides subroutine).asm +++ b/_incObj/26 Monitor (SolidSides subroutine).asm @@ -63,4 +63,4 @@ loc_A4EA: bcc.s loc_A4E2 moveq #-1,d1 rts -; End of function Obj26_SolidSides +; End of function Mon_SolidSides diff --git a/_incObj/89 Ending Sequence STH.asm b/_incObj/89 Ending Sequence STH.asm index b08ac1bb..97c3bd09 100644 --- a/_incObj/89 Ending Sequence STH.asm +++ b/_incObj/89 Ending Sequence STH.asm @@ -4,7 +4,7 @@ EndSTH: moveq #0,d0 - move.b $24(a0),d0 + move.b obRoutine(a0),d0 move.w ESth_Index(pc,d0.w),d1 if Revision=0 jmp ESth_Index(pc,d1.w) @@ -58,4 +58,4 @@ ESth_GotoCredits: bra.w DisplaySprite else rts - endc \ No newline at end of file + endc diff --git a/artnem/Animal Blackbird.bin b/artnem/Animal Penguin.bin similarity index 100% rename from artnem/Animal Blackbird.bin rename to artnem/Animal Penguin.bin diff --git a/s1.sounddriver.asm b/s1.sounddriver.asm index a1670028..c18b719e 100644 --- a/s1.sounddriver.asm +++ b/s1.sounddriver.asm @@ -146,7 +146,7 @@ UpdateMusic: ; loc_71BB2: @skipfadein: ; DANGER! The following line only checks v_soundqueue0 and v_soundqueue1, breaking v_soundqueue2. - tst.w v_soundqueue0(a6) ; is a music or sound queued for played? + tst.w v_soundqueue0(a6) ; is a music or sound queued for playing? beq.s @nosndinput ; if not, branch jsr CycleSoundQueue(pc) ; loc_71BBC: @@ -202,7 +202,7 @@ UpdateMusic: @sfxpsgloop: adda.w #TrackSz,a5 tst.b (a5) ; Is track playing? (TrackPlaybackControl) - bpl.s @sfxpsgnext ; Branch of not + bpl.s @sfxpsgnext ; Branch if not jsr PSGUpdateTrack(pc) ; loc_71C22: @sfxpsgnext: @@ -420,7 +420,7 @@ NoteTimeoutUpdate: subq.b #1,TrackNoteTimeout(a5) ; Update note fill timeout bne.s @locret ; Return if it hasn't expired bset #1,(a5) ; Put track at rest (TrackPlaybackControl) - tst.b TrackVoiceControl(a5) ; Is this a psg track? + tst.b TrackVoiceControl(a5) ; Is this a PSG track? bmi.w @psgnoteoff ; If yes, branch jsr FMNoteOff(pc) addq.w #4,sp ; Do not return to caller @@ -620,7 +620,7 @@ CycleSoundQueue: cmp.b d3,d2 ; Is it a lower priority sound? blo.s @nextinput ; Branch if yes move.b d2,d3 ; Store new priority - move.b d1,v_sound_id(a6) ; Queue sound for play + move.b d1,v_sound_id(a6) ; Queue sound for playing ; loc_71F3E: @nextinput: dbf d4,@inputloop @@ -781,7 +781,7 @@ Sound_PlayBGM: lea v_music_fmdac_tracks(a6),a1 lea FMDACInitBytes(pc),a2 ; loc_72098: -@bmg_fmloadloop: +@bgm_fmloadloop: bset #7,(a1) ; Initial playback control: set 'track playing' bit (TrackPlaybackControl) move.b (a2)+,TrackVoiceControl(a1) ; Voice control bits move.b d4,TrackTempoDivider(a1) @@ -791,10 +791,10 @@ Sound_PlayBGM: moveq #0,d0 move.w (a4)+,d0 ; load DAC/FM pointer add.l a3,d0 ; Relative pointer - move.l d0,TrackDataPointer(a1) ; Store track pointer + move.l d0,TrackDataPointer(a1) ; Store track pointer move.w (a4)+,TrackTranspose(a1) ; load FM channel modifier adda.w d6,a1 - dbf d7,@bmg_fmloadloop + dbf d7,@bgm_fmloadloop cmpi.b #7,2(a3) ; Are 7 FM tracks defined? bne.s @silencefm6 diff --git a/sonic.asm b/sonic.asm index 49f69722..b7ddab4a 100644 --- a/sonic.asm +++ b/sonic.asm @@ -3457,7 +3457,7 @@ SS_BGLoad: lea (Eni_SSBg1).l,a0 ; load mappings for the birds and fish move.w #$4051,d0 bsr.w EniDec - move.l #$50000001,d3 + locVRAM $5000,d3 lea ($FF0080).l,a2 moveq #6,d7 @@ -3506,16 +3506,8 @@ loc_491C: lea (Eni_SSBg2).l,a0 ; load mappings for the clouds move.w #$4000,d0 bsr.w EniDec - lea ($FF0000).l,a1 - move.l #$40000003,d0 - moveq #$3F,d1 - moveq #$1F,d2 - bsr.w TilemapToVRAM - lea ($FF0000).l,a1 - move.l #$50000003,d0 - moveq #$3F,d1 - moveq #$3F,d2 - bsr.w TilemapToVRAM + copyTilemap $FF0000,$C000,$3F,$1F + copyTilemap $FF0000,$D000,$3F,$3F rts ; End of function SS_BGLoad @@ -8277,7 +8269,7 @@ SS_AniEmeraldSparks: bne.s locret_1B60C clr.l (a0) clr.l 4(a0) - move.b #4,($FFFFD024).w + move.b #4,(v_player+obRoutine).w move.w #sfx_SSGoal,d0 jsr (PlaySound_Special).l ; play special stage GOAL sound @@ -8878,7 +8870,7 @@ Nem_Rabbit: incbin "artnem\Animal Rabbit.bin" even Nem_Chicken: incbin "artnem\Animal Chicken.bin" even -Nem_BlackBird: incbin "artnem\Animal Blackbird.bin" +Nem_Penguin: incbin "artnem\Animal Penguin.bin" even Nem_Seal: incbin "artnem\Animal Seal.bin" even