Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding constants and macros to level select code
  • Loading branch information
Clownacy committed Aug 15, 2015
1 parent 05cc73d commit 2f0d539
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
31 changes: 16 additions & 15 deletions sonic3k.asm
Expand Up @@ -9411,7 +9411,7 @@ loc_7AD2:
dbf d1,.clearloop

; S3 would remove the one zone name that wasn't cleared; Oil Ocean
;lea (RAM_start+$696planeLocH28(3,$15)).l,a3
;lea (RAM_start+planeLocH28(3,$15)).l,a3
;move.w #$F,d1

;- ;move.w #0,(a3)+
Expand All @@ -9436,6 +9436,7 @@ loc_7AD2:
; loc_7B58:
.writeletter:
move.b (a1)+,d0 ; Get character from string
;ori.w #make_art_tile($0000,0,0),d0
move.w d0,(a2)+ ; Send it to plane map
dbf d2,.writeletter ; Loop for entire string

Expand All @@ -9444,23 +9445,23 @@ loc_7AD2:
bcs.s .stringfull ; If there is none, skip ahead
; loc_7B68:
.blankloop:
move.w #' ',(a2)+ ; Full the remaining space with blank characters
move.w #make_art_tile(' ',0,0),(a2)+ ; Full the remaining space with blank characters
dbf d2,.blankloop
; loc_7B70:
.stringfull:
move.w #'1',(a2) ; Write (act) '1'
move.w #make_art_tile('1',0,0),(a2) ; Write (act) '1'
lea $50(a2),a2 ; Next line
move.w #'2',(a2) ; Write (act) '2'
move.w #make_art_tile('2',0,0),(a2) ; Write (act) '2'
dbf d1,.writezone

; Assuming the last line was the sound test...
move.w #' ',(a2) ; Get rid of (act) '2'
move.w #make_art_tile(' ',0,0),(a2) ; Get rid of (act) '2'
lea -$50(a2),a2 ; Go back to (act) '1'
move.w #'*',(a2) ; Replace that with '*'
move.w #make_art_tile('*',0,0),(a2) ; Replace that with '*'

; Overwrite duplicate LAVA REEF 1/2 with 3/4 (obviously, S3 didn't do this)
move.w #'3',(RAM_start+planeLocH28($25,4)).l
move.w #'4',(RAM_start+planeLocH28($25,5)).l
move.w #make_art_tile('3',0,0),(RAM_start+planeLocH28($25,4)).l
move.w #make_art_tile('4',0,0),(RAM_start+planeLocH28($25,5)).l

restore

Expand All @@ -9471,7 +9472,7 @@ loc_7AD2:
moveq #$1B,d2
jsr (Plane_Map_To_VRAM).l

moveq #0,d3
moveq #palette_line_0,d3
bsr.w LevelSelect_DrawSoundNumber

; in S3, there was some code here for the zone icons, but it was removed in S&K
Expand Down Expand Up @@ -9528,10 +9529,10 @@ LevelSelect_Main: ; routine running during level select
move.b #$16,(V_int_routine).w
bsr.w Wait_VSync
move #$2700,sr
moveq #0,d3
moveq #palette_line_0-palette_line_0,d3
bsr.w LevelSelect_MarkFields
bsr.w LevSelControls
move.w #$6000,d3
move.w #palette_line_3-palette_line_0,d3
bsr.w LevelSelect_MarkFields
; In S3, there was a branch to some zone icon code here
;bsr.w LevelSelect_DrawIcon
Expand Down Expand Up @@ -9892,10 +9893,10 @@ LevelSelect_MarkFields:
move.b (a3),d1
lsl.w #7,d1
add.b 1(a3),d1
addi.w #$C000,d1
addi.w #VRAM_Plane_A_Name_Table,d1
lsl.l #2,d1
lsr.w #2,d1
ori.w #$4000,d1
ori.w #vdpComm($0000,VRAM,WRITE)>>16,d1
swap d1
move.l d1,VDP_control_port-VDP_data_port(a6)

Expand All @@ -9918,10 +9919,10 @@ loc_7FB2: move.w (a1)+,d0
move.b (a3),d1
lsl.w #7,d1
add.b 1(a3),d1
addi.w #$C000,d1
addi.w #VRAM_Plane_A_Name_Table,d1
lsl.l #2,d1
lsr.w #2,d1
ori.w #$4000,d1
ori.w #vdpComm($0000,VRAM,WRITE)>>16,d1
swap d1
move.l d1,VDP_control_port-VDP_data_port(a6)
move.w (a1)+,d0
Expand Down
8 changes: 8 additions & 0 deletions sonic3k.constants.asm
Expand Up @@ -616,12 +616,20 @@ Checksum_string = ramaddr( $FFFFFFFC ) ; long ; set to 'SM&K' once the checksum

; ---------------------------------------------------------------------------
; Art tile stuff
palette_line_0 = (0<<13)
palette_line_1 = (1<<13)
palette_line_2 = (2<<13)
palette_line_3 = (3<<13)
high_priority = (1<<15)
tile_mask = $07FF
drawing_mask = $7FFF

; ---------------------------------------------------------------------------
; VRAM and tile art base addresses.
; VRAM Reserved regions.
VRAM_Plane_A_Name_Table = $C000 ; Extends until $CFFF
VRAM_Plane_B_Name_Table = $E000 ; Extends until $EFFF

; Menu background.
ArtTile_ArtKos_S3MenuBG = $0001

Expand Down

0 comments on commit 2f0d539

Please sign in to comment.