From 87eb196491fdfb12349725165da7a23a2c2e0274 Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Sat, 11 Sep 2021 12:23:03 -0400 Subject: [PATCH 01/12] Clean up options Personally, I'd rather have this option turned off, but this is the least I can do. --- build.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.bat b/build.bat index eb428bdd..062724d2 100755 --- a/build.bat +++ b/build.bat @@ -1,5 +1,5 @@ @echo off IF EXIST s1built.bin move /Y s1built.bin s1built.prev.bin >NUL -asm68k /k /p /o ae- /o c+ sonic.asm, s1built.bin >errors.txt, , sonic.lst -fixheadr.exe s1built.bin \ No newline at end of file +asm68k /k /p /o ae-,c+ sonic.asm, s1built.bin >errors.txt, , sonic.lst +fixheadr.exe s1built.bin From 0b1b2ff49991402956261124b0cb5760176caadc Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Sun, 12 Sep 2021 18:16:51 -0400 Subject: [PATCH 02/12] Correcting leftover uses of old names --- Macros.asm | 4 ++-- sonic.asm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Macros.asm b/Macros.asm index 398751e7..ee668d63 100644 --- a/Macros.asm +++ b/Macros.asm @@ -245,7 +245,7 @@ out_of_range: macro exit,pos music: macro track,terminate,branch,byte if OptimiseSound=1 - move.b #track,(v_snddriver_ram+v_playsnd1).l + move.b #track,(v_snddriver_ram+v_soundqueue0).l if terminate=1 rts endc @@ -273,7 +273,7 @@ music: macro track,terminate,branch,byte sfx: macro track,terminate,branch,byte if OptimiseSound=1 - move.b #track,(v_snddriver_ram+v_playsnd2).l + move.b #track,(v_snddriver_ram+v_soundqueue1).l if terminate=1 rts endc diff --git a/sonic.asm b/sonic.asm index 611c878b..144b1d26 100644 --- a/sonic.asm +++ b/sonic.asm @@ -2349,8 +2349,8 @@ LevelSelect: beq.s LevSel_Credits ; if yes, branch LevSel_NoCheat: - ; This is a workaround for a bug, see Sound_ChkValue for more. - ; Once you've fixed the bugs there, comment these four instructions out + ; This is a workaround for a bug; see PlaySoundID for more. + ; Once you've fixed the bugs there, comment these four instructions out. cmpi.w #bgm__Last+1,d0 ; is sound $80-$93 being played? blo.s LevSel_PlaySnd ; if yes, branch cmpi.w #sfx__First,d0 ; is sound $94-$9F being played? From c2d2735c82be65390fafee740c653d31886b36ac Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Sun, 19 Sep 2021 14:49:08 -0400 Subject: [PATCH 03/12] F8h -> $F8 This isn't Z80 code --- s1.sounddriver.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/s1.sounddriver.asm b/s1.sounddriver.asm index 4d0ab8e5..7f3f734b 100644 --- a/s1.sounddriver.asm +++ b/s1.sounddriver.asm @@ -785,7 +785,7 @@ Sound_PlayBGM: bset #7,(a1) ; Initial playback control: set 'track playing' bit (TrackPlaybackControl) move.b (a2)+,TrackVoiceControl(a1) ; Voice control bits move.b d4,TrackTempoDivider(a1) - move.b d6,TrackStackPointer(a1) ; set "gosub" (coord flag F8h) stack init value + move.b d6,TrackStackPointer(a1) ; set "gosub" (coord flag $F8) stack init value move.b d1,TrackAMSFMSPan(a1) ; Set AMS/FMS/Panning move.b d5,TrackDurationTimeout(a1) ; Set duration of first "note" moveq #0,d0 @@ -836,7 +836,7 @@ Sound_PlayBGM: bset #7,(a1) ; Initial playback control: set 'track playing' bit (TrackPlaybackControl) move.b (a2)+,TrackVoiceControl(a1) ; Voice control bits move.b d4,TrackTempoDivider(a1) - move.b d6,TrackStackPointer(a1) ; set "gosub" (coord flag F8h) stack init value + move.b d6,TrackStackPointer(a1) ; set "gosub" (coord flag $F8) stack init value move.b d5,TrackDurationTimeout(a1) ; Set duration of first "note" moveq #0,d0 move.w (a4)+,d0 ; load PSG channel pointer @@ -997,7 +997,7 @@ Sound_PlaySFX: move.l d0,TrackDataPointer(a5) ; Store track pointer move.w (a1)+,TrackTranspose(a5) ; load FM/PSG channel modifier move.b #1,TrackDurationTimeout(a5) ; Set duration of first "note" - move.b d6,TrackStackPointer(a5) ; set "gosub" (coord flag F8h) stack init value + move.b d6,TrackStackPointer(a5) ; set "gosub" (coord flag $F8) stack init value tst.b d4 ; Is this a PSG channel? bmi.s @sfxpsginitdone ; Branch if yes move.b #$C0,TrackAMSFMSPan(a5) ; AMS/FMS/Panning @@ -1102,7 +1102,7 @@ Sound_PlaySpecial: move.l d0,TrackDataPointer(a5) ; Store track pointer move.w (a1)+,TrackTranspose(a5) ; load FM/PSG channel modifier move.b #1,TrackDurationTimeout(a5) ; Set duration of first "note" - move.b d6,TrackStackPointer(a5) ; set "gosub" (coord flag F8h) stack init value + move.b d6,TrackStackPointer(a5) ; set "gosub" (coord flag $F8) stack init value tst.b d4 ; Is this a PSG channel? bmi.s @sfxpsginitdone ; Branch if yes move.b #$C0,TrackAMSFMSPan(a5) ; AMS/FMS/Panning From c5601c1ee92ab0d1942d043a9bebceeb6a9fd2e6 Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Tue, 21 Sep 2021 21:03:35 -0400 Subject: [PATCH 04/12] Two more fixes Forgot to remove a leftover "z" prefix in one part; also caught an instance of a game mode ID that would be problematic if the IDs were to be shuffled around. --- Constants.asm | 2 +- _incObj/85 Boss - Final.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Constants.asm b/Constants.asm index b8f26525..a184b593 100644 --- a/Constants.asm +++ b/Constants.asm @@ -59,7 +59,7 @@ TrackPSGNoise: equ $1F ; PSG only TrackFeedbackAlgo: equ $1F ; FM only TrackVoicePtr: equ $20 ; FM SFX only (4 bytes) TrackLoopCounters: equ $24 ; All tracks (multiple bytes) -TrackGoSubStack: equ TrackSz ; All tracks (multiple bytes. This constant won't get to be used because of an optimisation that just uses zTrackSz) +TrackGoSubStack: equ TrackSz ; All tracks (multiple bytes. This constant won't get to be used because of an optimisation that just uses TrackSz) TrackSz: equ $30 diff --git a/_incObj/85 Boss - Final.asm b/_incObj/85 Boss - Final.asm index 908d2f4b..70f84b76 100644 --- a/_incObj/85 Boss - Final.asm +++ b/_incObj/85 Boss - Final.asm @@ -447,7 +447,7 @@ loc_1A248: bcs.s loc_1A260 tst.b obRender(a0) bmi.s loc_1A260 - move.b #$18,(v_gamemode).w + move.b #id_Ending,(v_gamemode).w bra.w Obj85_Delete ; =========================================================================== From 0e8e8200dd47d0a5c32f8468f00d8cc7d488afd2 Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Sat, 9 Oct 2021 22:26:33 -0400 Subject: [PATCH 05/12] Update name at end of file I caught this very recently. I'll probably document this all later --- _incObj/26 Monitor (SolidSides subroutine).asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_incObj/26 Monitor (SolidSides subroutine).asm b/_incObj/26 Monitor (SolidSides subroutine).asm index 623fc834..5d80a3e6 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 From e1d3896a30d4d17aa567bc04189e114289e1f0f6 Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Mon, 8 Nov 2021 20:45:13 -0500 Subject: [PATCH 06/12] Fixing more typos --- s1.sounddriver.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/s1.sounddriver.asm b/s1.sounddriver.asm index 7f3f734b..5ca54555 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 From c138fa50ed09364d1e05f844917dd066c69a9727 Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Tue, 16 Nov 2021 20:15:30 -0500 Subject: [PATCH 07/12] Fixing typo in label --- s1.sounddriver.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/s1.sounddriver.asm b/s1.sounddriver.asm index 5ca54555..b26f9952 100644 --- a/s1.sounddriver.asm +++ b/s1.sounddriver.asm @@ -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 From 6514053ba45beb901d9b3bda3713835ffb31024c Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Tue, 16 Nov 2021 20:23:34 -0500 Subject: [PATCH 08/12] "Blackbird" to "Penguin" This has bugged me for a while now. The S2 and S3K disassemblies call the same animal a penguin, it's called a penguin in official material, and we all know what penguins are... so what's with this name that only makes things hard to understand? --- _inc/Pattern Load Cues.asm | 6 +++--- artnem/{Animal Blackbird.bin => Animal Penguin.bin} | Bin sonic.asm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename artnem/{Animal Blackbird.bin => Animal Penguin.bin} (100%) 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/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/sonic.asm b/sonic.asm index 6ae72e6d..80f5fda9 100644 --- a/sonic.asm +++ b/sonic.asm @@ -8854,7 +8854,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 From 43cba9595f1e16a74888114f0ec548d7564310ac Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Wed, 23 Mar 2022 19:29:15 -0400 Subject: [PATCH 09/12] Correcting missing constant --- _incObj/89 Ending Sequence STH.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 579906beb0ca544ca0251d59d1bfaa5bf55b4267 Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Fri, 22 Jul 2022 18:10:36 -0400 Subject: [PATCH 10/12] Increasing locVRAM use A mistake in the macro code led to its underuse. Some other changes were made for consistency as well. --- Macros.asm | 6 +++--- _inc/HUD_Update.asm | 17 ++++++----------- sonic.asm | 16 ++++------------ 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/Macros.asm b/Macros.asm index 314f3bef..a9bd5c34 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 @@ -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 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/sonic.asm b/sonic.asm index 62c6d98c..e2989154 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 From 7c66a4f75db3f42bda4d9d3531bb34b51eb97087 Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Fri, 22 Jul 2022 18:14:49 -0400 Subject: [PATCH 11/12] Missed this --- _inc/HUD (part 2).asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 78a08079cbd74786240f99a48eb1f48ac7ac5093 Mon Sep 17 00:00:00 2001 From: Brainulator9 <44907795+Brainulator9@users.noreply.github.com> Date: Fri, 22 Jul 2022 19:32:22 -0400 Subject: [PATCH 12/12] Macro fixes Finally fixed copyTilemap; writeVRAM and writeCRAM (should these be merged?) had some labels added (which it turns out the AS branch uses...) --- Macros.asm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Macros.asm b/Macros.asm index a9bd5c34..f53ef57a 100644 --- a/Macros.asm +++ b/Macros.asm @@ -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 @@ -75,7 +75,7 @@ fillVRAM: macro value,length,loc copyTilemap: macro source,destination,width,height lea (source).l,a1 - locVRAM destination,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 ; ---------------------------------------------------------------------------