Sonic and Sega Retro Message Board: Source Code accidently compiled into games - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 3 Pages +
  • 1
  • 2
  • 3
    Locked
    Locked Forum

Source Code accidently compiled into games mega topic

#16 User is offline Chilly Willy 

Posted 17 February 2010 - 10:46 PM

  • Posts: 746
  • Joined: 10-April 09
  • Gender:Male
  • Project:Doom 32X
QUOTE (SegaLoco @ Feb 16 2010, 03:45 PM)
QUOTE (Chilly Willy @ Feb 13 2010, 10:11 PM)
QUOTE (SegaLoco @ Feb 12 2010, 10:43 PM)
@ChillyWilly: was there no equiv to /dev/zero on DOS nor an align macro in their assembler, or were they just lazy. =P (Sorry for no quote, on PSP)


I'm not aware of anything similar to /dev/zero on DOS, and assemblers vary considerably. Some assemblers had "align", some required you to make a macro for it, and other had other facilities for alignment, like the "even" directive. Even when you had "align", some assemblers use the argument directly while others use the argument as a power of 2.

I'm just saying, you said they probably dumped memory to write the ROM to the right size, why not just zero or nop it out =P.


If they are so lazy they just dump memory to get the binary, what makes you think they'd bother to clear the parts that aren't part of the actual binary? specialed.png
smile.png

#17 User is offline SegaLoco 

Posted 17 February 2010 - 10:48 PM

  • W)(at did you say?
  • Posts: 999
  • Joined: 16-August 06
  • Gender:Male
  • Location:Corpus Christi, TX
  • Wiki edits:79
QUOTE (Chilly Willy @ Feb 17 2010, 09:46 PM)
QUOTE (SegaLoco @ Feb 16 2010, 03:45 PM)
QUOTE (Chilly Willy @ Feb 13 2010, 10:11 PM)
QUOTE (SegaLoco @ Feb 12 2010, 10:43 PM)
@ChillyWilly: was there no equiv to /dev/zero on DOS nor an align macro in their assembler, or were they just lazy. =P (Sorry for no quote, on PSP)


I'm not aware of anything similar to /dev/zero on DOS, and assemblers vary considerably. Some assemblers had "align", some required you to make a macro for it, and other had other facilities for alignment, like the "even" directive. Even when you had "align", some assemblers use the argument directly while others use the argument as a power of 2.

I'm just saying, you said they probably dumped memory to write the ROM to the right size, why not just zero or nop it out =P.


If they are so lazy they just dump memory to get the binary, what makes you think they'd bother to clear the parts that aren't part of the actual binary? specialed.png
smile.png

Ah, okay =B

#18 User is offline evilhamwizard 

Posted 20 February 2010 - 11:43 AM

  • Posts: 1158
  • Joined: 16-June 04
  • Gender:Male
  • Wiki edits:109
Yay, if it weren't for SegaSaturno yesterday this topic would've been dead yet.

Yesterday SegaSaturno released yet another unreleased 32X game ~ the abandoned 32X port of SoulStar X from the Sega CD. There are TONS of code fragments, DOS files (I think the actual editor for the source code is partially in the rom), a bat file for compiling, as well as other unknown stuff (a symbol list maybe?). I need your help with this one, because there's A LOT. I'm only going through the stuff that's formatted. There are tons of other strings in the prototype as well.

For reference, you can download the prototype here.

Let's begin!

;	PWM Sample Program
;					SH2 Master Main
;
;	Copyright SEGA ENTERPRISES,LTD. 1994
;---------------------------------------------------------------*
;****************************************************************
	
	cnop	0,4

******************************************
* Initialize the PWM interupt and driver *
******************************************

initPWM
	move	#$20004030,r2
	move	#1047,r0			;1047 set cycle register (22Khz)
	move.w	r0,(2,r2)

	move	#$0305,r0			;105 set control register
	move.w	r0,(r2)

	move	#$20004030,r2                	;fill mono fifo
	move	#1,r0
	move.w	r0,(8,r2)
	move.w	r0,(8,r2)
	move.w	r0,(8,r2)

	rts
	nop

	cnop	0,4

	lits

	cnop	0,4

************************************************
* Play an 8 bit sample throught the PWM ciruit *
************************************************
; input
;	R1 = Address of sample
;	R2 = length of sample
;	R3 = channel number
;	R4 = step value

PlayPWM
	move	#comport1,r0
	move.w	(r0)+,r1		;get sfx number
	move.w	(r0)+,r4		;get step rate
	move.w	(r0)+,r2		;get volume

	move	#sample_table,r0
	shll2	r1
	shll	r1
	add	r1,r0
	move	(r0)+,r2		;get length
	move	(r0)+,r1		;get address

	move	#sfx_chan,r5		;get channel to play
	move	(r5),r0
	add	#1,r0
	and	#3,r0
	move	r0,(r5)
	move	r0,r3

	move	r2,r0
	shll8	r0
	move	#pwmstructs+TH,r2
	shll2	r3
	shll2	r3
	add	r3,r2
	move	r0,(r2)			;store sample length (bytes)

	cmpeq	#0,r0
	bt	.done_pwm

	move	r4,(PWMSTEP,r2)		;store step rate
	shll8	r1
	move	r1,(PWMADDR,r2)		;store sample address

.done_pwm
	rts
	nop

	cnop	0,4

sfx_chan dc.l	0

	lits

*************************
* PWM interrupt handler *
*************************

	cnop	0,4
spwm_irq
	push	r0
	push	r1
	push	r2
	push	r3
	push	r4
	push	r5
	push	r6

	move	#$20004038,r2
	move.b	(r2),r0			;is pwm fifo full?
	tst	#$80,r0
	bf	.exit

	push	pr
	bsr	process_pwm
	nop
	pop	pr
.exit
	move	#_FRT,r1      		;tweak FRT
	move.b	(_TOCR,r1),r0
	xor	#$02,r0
	move.b	r0,(_TOCR,r1)

	move	#$2000401C,r2		;clear irq
	move.w	r0,(r2)
	move.w	(r2),r0

	pop	r6
	pop	r5
	pop	r4
	pop	r3
	pop	r2
	pop	r1
	pop	r0

	rts
	nop
	
	LITS

	cnop	0,4

NUMCHANNELS	equ	4
PWMSIZE		equ	4	; number of elemts in the PWM structure

PWMADDR		equ	4
PWMSTEP		equ	8

*****************
* Fill PWM FIFO *
*****************

process_pwm
	move	#$20004038,r2
.loop
	move	#pwmstructs+TH,r3
	move	#NUMCHANNELS,r4
	move	#0,r5

.channelloop
	move	(r3),r0				;is channel on?
	cmppz	r0
	bf/s	.skip
	move.w	#$80,r1				;if channel off, use $7f (flat)

	move	(PWMSTEP,r3),r6
	sub	r6,r0
	move	r0,(r3)

	move	(PWMADDR,r3),r0			;get the next pcm byte
	move	r0,r1
	add	r6,r0
	move	r0,(PWMADDR,r3)
	shlr8	r1
	move	#samp_base,r0
	move.b	(r0,r1),r1
	extu.b	r1,r1
.skip
	add	#PWMSIZE*4,r3

	add	#1,r1   			;make sure it's not 0
	add	r1,r5

	dt	r4
	bf	.channelloop

	move.w	r5,(r2)				;store into mono width

	move.b	(r2),r0				;is pwm fifo full?
	tst	#$80,r0
	bt	.loop

	rts
	nop

	LITS

pwmstructrotate_player_sprite


More!

Syntax Highlighted Code: ASM
* rotate sprite routine *
*************************
 
cnop 0,4
 
rotate_player
move #comport1,r0 ;get level
move.w (r0)+,r1
move.w (r0)+,r2
move.w (r0)+,r3
 
move.w (r0)+,r4
shll2 r4
move #frame_table,r0
move (r0,r4),r4
 
* R1 = xpos
* R2 = ypos
* R3 = angle
* R4 = ptr to source data
 
rot_spr
move #divider_unit,r14
 
push r1 ;xpos
push r2 ;ypos
 
shll r3
move #sintab,r0
move.w (r0,r3),r13 ;sine (Dy)
move #costab,r0
move.w (r0,r3),r12 ;cosine (Dx)
 
move.w (r4)+,r8 ;xsize
move.w (r4)+,r9 ;ysize
 
move r12,r10 ;xadd
move r13,r11 ;yadd
add r10,r10
add r11,r11
 
move #rline_buf,r0 ;offset table
move #0,r1 ;dstX
move #0,r2 ;dstY
 
move #320,r3
 
move r8,r7
.loop
swap.w r2,r14 ;Yint * 320
exts.w r14,r14
dmuls r3,r14
swap.w r1,r5
exts.w r5,r5
move macl,r14
add r5,r14 ;+ Xint
move.w r14,(r0) ;store xy pos
add #2,r0
 
add r10,r1
add r11,r2
 
dt r7
bf .loop
 
pop r2
pop r1
 
shll16 r1
shll16 r2
 
move r4,r0
add #4,r0
.yloop
move #overwrite,r3
move r1,r5
shlr16 r5
exts.w r5,r5
add r5,r3
move r2,r5
shlr16 r5
exts.w r5,r5
move #320,r4
dmuls r4,r5
move macl,r5
add r5,r3
 
move r8,r5
 
move #rline_buf,r7
.oloop
move.w (r7)+,r6 ;get screen offset
add r3,r6 ;add screen base addr
move.b (r0)+,r4
dt r5 ;R7 = line length
 
move.b r4,(r6) ;store pixel
add #1,r6
 
bf/s .oloop
move.b r4,(r6) ;store pixel
 
sub r11,r1
add r10,r2
 
dt r9
bf .yloop
 
rts
nop
 
lits
 
cnop 0,4
 
rline_buf ds.w 128*2
 
;;rotate_player
;; move #comport1,r0 ;get level
;; move.w (r0)+,r1
;; move.w (r0)+,r2
;; move.w (r0)+,r3
;; move.w (r0)+,r4
;;
;; move #sp_pl_ship00,r4
;;
;;* R1 = xpos
;;* R2 = ypos
;;* R3 = angle
;;* R4 = ptr to source data
;;
;; cnop 0,4
;;
;;rot_spr
;; move #divider_unit,r14
;;
;; push r1 ;xpos
;; push r2 ;ypos
;;
;; shll r3
;; move #sintab,r0
;; move.w (r0,r3),r13 ;sine (Dy)
;; move #costab,r0
;; move.w (r0,r3),r12 ;cosine (Dx)
;;
;; move.w (r4)+,r7 ;get line length
;; dmuls r12,r7
;; move r7,r9
;; move macl,r7
;; add r7,r7
;; shlr16 r7
;; exts.w r7,r7
;;
;; move r9,r1 ;get line y height
;; dmuls r13,r1
;; move macl,r1
;; add r1,r1
;; shlr16 r1
;; exts.w r1,r1
;;
;; shll16 r9 ;calc line source x add
;; divs r7,r9 ;r9 = x adder,r7 = line length
;;
;; move r13,r6 ;get x adder for draw loop
;; shll2 r6
;;
;; move.w (r4)+,r8 ;get sprite height
;; dmuls r12,r8
;; move r8,r10
;; move macl,r8
;; add r8,r8
;; shlr16 r8
;; exts.w r8,r8
;;
;; shll16 r10
;; divs r0,r10 ;r10 = y adder,r8 = height
;;
;; push r7 ;
;; push r8 ;
;; push r10 ;
;;
;; move #320,r10 ;address yadd
;; cmppz r1
;; bt .1
;; neg r10,r10
;; neg r1,r1
;;.1
;; move r1,r0
;; cmpeq #0,r0
;; bt .2
;;
;; shll16 r1
;; divs r8,r1
;; shll16 r1 ;yadder
;;.2
;; move r1,r2 ;yfraction
;; shar r2 ;yfraction/2
;;
;; move #rline_buf,r0 ;offset table
;; move #0,r8 ;sourceX********************************
* 32X Initial 68K Header Code. *
********************************
 
opt l.
 
cramw equ $C0000000
icramw macro
.val = ((\1)>>14)
.vala = ((\1)<<16)&111111111111110000000000000000
.val = cramw!.val!.vala
move.l #.val,(a6)
endm
 
include debug.inc
 
l_type equ 1 0=eur,1=jap,2=USA
 
eur = 0
jap = 1
usa = 0
 
marsipl equ $880000
 
acomm0 equ $20 * * Communcation Reg.
acomm2 equ $22 * * Communcation Reg.
acomm4 equ $24 * * Communcation Reg.
acomm6 equ $26 * * Communcation Reg.
acomm8 equ $28 * * Communcation Reg.
acomm9 equ $29 * * Communcation Reg.
acomm10 equ $2a * * Communcation Reg.
acomm12 equ $2c * * Communcation Reg.
acomm14 equ $2e * * Communcation Reg.
 
vectors group
header group
code68k group
ramcode68k group
ramcodesh2 group
 
xref master_start,slave_start,master_vbr,slave_vbr
 
***************************
* 68000 vector ($000000). *
***************************
 
regs pc=$3f0
regs sr=$2700
 
entry_point equ $000003f0
stack_top equ $00000000
 
vdp_d equ $c00000
vdp_c equ $c00004
 
cp_0 equ $a15120
cp_2 equ $a15122
cp_4 equ $a15124
cp_6 equ $a15126
cp_8 equ $a15128
cp_a equ $a1512a
cp_c equ $a1512c
cp_e equ $a1512e
 
pollhost equ $fc0000 ;downloader ROM.
exception equ $fc0004 ;entry points.
 
if debug=1
 
polhost macro ;
dc.w $a000 ;poll host machine.
endm ;
 
break macro ;
dc.w $a002 ;software breakpoint.
endm ;
 
softentry macro ;
dc.w $a003 ;link to host machine.
endm ;
 
else
 
polhost macro ;
endm ;
 
break macro ;
endm ;
 
softentry macro ;
endm ;
 
endc
 
exc_buserror equ $02000000+exception
exc_addrerr equ $03000000+exception
exc_illinst equ $04000000+exception
exc_div0 equ $05000000+exception
exc_chk equ $06000000+exception
exc_trapv equ $07000000+exception
exc_priv equ $08000000+exception
exc_trace equ $09000000+exception
exc_linea equ pollhost
 
section vecs,vectors
 
dc.l stack_top ;Initial SSP and PC.
dc.l entry_point
 
dc.l $0220800c ;EX_BusError
dc.l $0320800c ;EX_AddressError
dc.l $0420800c ;EX_IllegalInstruction
dc.l $0520800c ;EX_DivideBy0
dc.l $0620800c ;EX_CHK
dc.l $0720800c ;EX_TrapV
dc.l $0820800c ;EX_Priviledge
dc.l $0920800c ;EX_Trace
dc.l EXC_LineA
dc.l EXC_LineF
* Reserved by motorola
dcb.l 12,0 ; EX_Motorola
* Hardware interrupts
dc.l EXC_Spurious
dc.l EXC_Level1
dc.l EXC_Level2
dc.l EXC_Level3
dc.l EXC_Level4
dc.l EXC_Level5
dc.l EXC_Level6
dc.l EXC_Level7
dc.l $20208008 ;EX_Trap0
dc.l EXC_Trap1
dc.l EXC_Trap2
dc.l EXC_Trap3
dc.l EXC_Trap4
dc.l EXC_Trap5
dc.l EXC_Trap6
dc.l EXC_Trap7
dc.l EXC_Trap8
dc.l EXC_Trap9
dc.l EXC_TrapA
dc.l EXC_TrapB
dc.l EXC_TrapC
dc.l EXC_TrapD
dc.l EXC_TrapE
dc.l EXC_TrapF
* Reserved by motorola
 
dcb.l 16,_error0
 
*************************
* Genesis ID ($000100). *
*************************
 
section hdr,header
 
dc.b 'SEGA 32X '
dc.b '©T115 1995.APR'
dc.b 'SOULSTAR X '
dc.b 'SOULSTAR X '
dc.b 'T-11505B-50 ' ;stuff
dc.w 0 ;checksum.
dc.b 'J ' ;joystick.
dc.l $000000 ;rom start.
dc.l $1fffff ;rom end.
dc.l $ff0000 ;ram start.
dc.l $ffffff ;ram end.
dc.b 'MR',0,0
dc.l 0,0
dc.b ' '********************
* Game Code Start. *
********************
 
include mequates.68k
include obj_equ.s
 
******************************************************************************
include coms_equ.s
 
com macro
move #com_\1,d0
jsr send_com
endm
 
com4 macro
move #com_\1,d0
jsr send_com4
endm
 
jcom macro
move #com_\1,d0
jmp send_com
endm
 
jcom4 macro
move #com_\1,d0
jmp send_com4
endm
 
******************************************************************************
 
no_traps equ 1
briefings equ 0
 
******************************************************************************
 
button_a equ 0
button_b equ 1
button_c equ 2
button_pause equ 3
button_option equ 4
button_y equ 5
button_z equ 6
 
******************************************************************************
 
ram_duration equ 31*20
bonus_hits equ 10
sh_del equ 4
mt_countdown08 equ 4
 
******************************************************************************
music macro
move #cdm_\1,d0
jsr start_music
endm
 
cdm_title equ $00
cdm_boss equ $2d
cdm_l360 equ $41
cdm_death equ $59
cdm_fame equ $5a
cdm_credits equ $6b
cdm_level123 equ $7b
cdm_kutra equ $93
cdm_gigun equ $a9
cdm_bulkan equ $c1
cdm_twingha equ $d6
cdm_guha equ $ea
cdm_metafus equ $101
cdm_krast equ $11a
 
******************************************************************************
******************************************
ntempsp equ 16
nweaps equ 16
nenweap equ 16
nenemy equ 20
nfxspr equ 32
wbase equ 128
 
maxshield equ 30
maxacc equ 224
 
******************************************************************************
******************************************************************************
hp_mult equ 4
hp_shift equ 2
 
cpu_hits equ 128*hp_mult
guha_hits equ 512*hp_mult
bulkan_hits equ 128*hp_mult ; Mid-Boss
bulkan2_hits equ (256/2)*hp_mult ; BOSS
metafus_hits equ 256*hp_mult
gigun_hits equ 256*hp_mult
 
hp_a0 macro
move #(\1)*hp_mult,en_hp(a0)
endm
 
hp_a5 macro
move #(\1)*hp_mult,en_hp(a5)
endm
 
hp_a6 macro
move #(\1)*hp_mult,en_hp(a6)
endm
******************************************************************************
sclip equ 200
*************************************************
pickup macro
dc (pu_\1<<12)+\2 ;tttt0mmmssssssss
endm
pu_shield equ 0
pu_energy equ 1
pu_shot equ 2
pu_hunter equ 3
pu_ring equ 4
pu_laser equ 5
pu_missile equ 6
pu_bomb equ 7
pu_rocket equ 8
pu_charge equ 9
******************************************************************************
odb macro
dc \1 ;col-dist
dc \2,\3 ;x1,x2
dc \4,\5 ;y1,y2
dc.l \6 ;hit handler
dc.l \7 ;logic handler
dc.l \8 ;360 logic handler
dc.l \9 ;output handler
dc.l \10 ;initialiser
dc.b \11 ;targetable
dc.b \12 ;radarable
endm
 
push macros
move. \1,-(sp)
pop macros
move. (sp)+,\1
 
pushm macros
movem. \1,-(sp)
popm macros
movem. (sp)+,\1
 
pushal macros
movem d3-d5,-(sp)
popal macros
movem (sp)+,d3-d5
 
pusha macros
movem.l d0-d7/a0-a6,-(sp)
popa macros
movem.l (sp)+,d0-d7/a0-a6
 
enemy macro
dc \1,ot_\2
dc \3,\4,\5
endm
 
set_ld macro
IF l_type=0
move.b #\1-1,ldel
ELSE
move.b #\1-1,ldel
ENDIF
* bsr modify_fire_rate
endm
 
set_ld2 macro
IF l_type=0
move.b #\1-1,ldel2
ELSE
move.b #\1-1,ldel2
ENDIF
endm
 
mp_sfx macro
pushm.l d1-d3
moveq #sam_\1,d1
move #(\2)/2,d2
move #\3,d3
com4 play_sfx
popm.l d1-d3
rts
endm
 
******************************************************************************
 
scratch_ram equ $ffff0000 ;guess wot?
 
v_spratt equ $fc00 ;SAT base.
v_hscrl equ $f000 ;H-scroll table base.
 
include equates.68k ;equates + macros.
 
game_code
SOFTENTRY
 
lea $880000+grouporg(ramcode68k),a0
lea $ffff8000,a1
move.l #groupend(ramcode68k)-grouporg(ramcode68k)-1,d7
.ccl move.b (a0)+,(a1)+
dbf d7,.ccl
 
move.l sp,sp_save
 
jsr setup_player
 
******************
* Game RAM Code. *
******************
 
game_start
di ;disable interrupts.
 
jsr init_vdp ;write initial values to VDP.
jsr init_joy ;read joystick types.
 
ei
 
main_start
jsr screen_on
 
clr level
; MOVE #2,LEVEL
; MOVE #3,LEVEL
 
bsr restart_life_lost
move #3,lives
 
sf diff_level
clr.l score
 
bsr level_setup
 
moveq #0,d0
jsr add_to_score
*******************************************************************************
lea node_head,a0
lea node_tail,a1
move.l a1,node_next(a0)
move.l a0,node_prev(a1)
clr game_del
clr fade_delay
*******************************************************************************
; jsr scroff
 
move.b #2,vbl_count
clr startup_count
st in_game
mloop
 
.1 jsr wait_vbl
tst.b vbl_count
bne.s .1
IF l_type=1
move.b #3,vbl_count
ELSE
move.b #2,vbl_count
ENDIF
 
lea vdp_c,a6
ivramw v_hscrl
move back_x,-4(a6)
move back_x,-4(a6)
 
***************************************
jsr level_flipper
***************************************
 
jsr level_output
 
***************************************
addq #1,game_del
and #$7fff,game_del
bne.s .ng_roll
or #$1000,game_del
.ng_roll:
***************************************
move scr_spd,d0
IF l_type=0
muls #$3334,d0
swap d0
add scr_spd,d0
ENDIF
move d0,scr_spd2
***************************************
tst sh_hit_num
beq.s .sh_hit_ok
tst dying_cnt
bne.s .sh_hit_ok
subq #1,sh_hit_del
bpl.s .sh_hit_ok
subq #1,sh_hit_num
jsr do_low_shield_sfx
move #sh_del,sh_hit_del
.sh_hit_ok:
***************************************
jsr pickup_system
cmp #04,level
bne.s .not_gigun
jsr gigun_checks
.not_gigun:
jsr end_fader
***************************************
sf hit_sfx_already
 
***************************************
clr tmp_slot
***************************************
* Do all processing here! *
***************************
subq #1,gcnt3
bpl.s .gcnt3
move #3-1,gcnt3
.gcnt3:
subq #1,gcnt5
bpl.s .gcnt5
move #5-1,gcnt5
.gcnt5:
subq #1,gcnt6
bpl.s .gcnt6
move #6-1,gcnt6
.gcnt6:
subq #1,gcnt9
bpl.s .gcnt9
move #9-1,gcnt9
.gcnt9:
subq #1,gcnt10
bpl.s .gcnt10
move #9-1,gcnt10
.gcnt10:
subq #1,gcnt12
bpl.s .gcnt12
move #12-1,gcnt12
.gcnt12:
subq #1,gcnt19
bpl.s .gcnt19
move #19-1,gcnt19
.gcnt19:
tst dying_cnt
beq.s .not_dying
jsr do_player_dying
bra.s .no_ctl
.not_dying:
tst startup_count
bne.s .no_ctl
jsr do_v_control
.no_ctl:
tst.b is_360
beq.s .no_360
jsr set_360_map_pos
.no_360:
***************************************
bsr level_control
***************************************
jsr create_enemies
jsr get_all_enemies
jsr get_all_weapons
jsr do_next_weapon
******************************************************************************
* Check for 2nd player *
************************
tst.b ply2mode
beq.s .1player_only
jsr do_next_weapon_2
jsr player_2_control
jsr player_2_weapons
bra.s .2player_done
.1player_only:
jsr power_transfer_1p
cmp #2,vehicle
bne.s .not_walker1
jsr do_1p_walker_targetting
 
tst poptarg
beq.s .no_poptarg
subq #1,poptarg
move.l mtarget,d0
beq.s .no_poptarg
move.l d0,a6
move mob_x(a6),d0
move mob_y(a6),d1
moveq #0,d2
moveq #0,d6
lea node_msight,a6
movem d0/d1/d2/d6/d7,node_data(a6)
move #ot_msight,mob_type(a6)
jsr insert_sprite
.no_poptarg:
 
bra.s .2player_done
.not_walker1:
lea weapon_tab,a0
add weapon,a0
cmp.b #pw_bomblet,(a0)
bne.s .2player_done
jsr handle_missile_sight
.2player_done:
******************************************************************************
jsr plot_rams
jsr plot_player
tst charge_cnt
beq.s .not_charging
jsr insert_charge_spr
.not_charging:
***************************************
 
bsr draw_sprites
jsr draw_panel
 
com flip_screen
jsr wait_com
 
btst #button_pause,joy1
bne.s .no_pause
.paused
jsr wait_vbl
btst #button_pause,joy1
beq.s .paused
 
.paused1
jsr wait_vbl
btst #button_pause,joy1
bne.s .paused1
.paused2
jsr wait_vbl
btst #button_pause,joy1
beq.s .paused2
.no_pause
 
MOVE.B #16,shield

bra mloop
 
******************************************************************************
* CPIC backgrounds *
********************
 
back_00a incbin backs\space1.cpi
even
back_00b incbin backs\space2.cpi
even
 
back_03 incbin backs\warpship.cpi
even
 
******************************************************************************
* 360 object data *
*******************
 
zone_03_dat incbin stages\zone03.dat
even
zone_05_dat incbin stages\zone05.dat
even
zone_08_dat incbin stages\zone08.dat
even
zone_11_dat incbin stages\zone11.dat
even
zone_17_dat incbin stages\zone17.dat
even
zone_24_dat incbin stages\zone24.dat
even
zone_26_dat incbin stages\zone26.dat
even
 
******************************************************************************
* Decompress background (2 playfields) *
****************************************
 
* A0 = playfield #1
* A1 = playfield #2
 
decomp_68k_backgr
push.l a1
 
lea scratch_ram,a1
jsr unpack
 
lea scratch_ram,a0
move #$e000,d0
move #64*2,d1
jsr decomp_cpic
 
pop.l a0
move.l a0,d0 ;if -I've, only decomp 1st screen
bmi.s .skip ;skip unpack

lea scratch_ram,a1
jsr unpack
.skip
lea scratch_ram,a0
move #$c000,d0
move #64*2,d1
***************
* decomp CPIC *
***************
* A0 = ptr to CPIC file
* D0 = dest. adr
* D1 = dest CMAP width*2
 
decomp_cpic
lea vdp_c,a6
 
vreg 15,2
bsr dc_palette
movem d0/d1,-(sp)
bsr dc_chars
movem (sp)+,d0/d1
dc_cmap
move d0,d4
move d1,dest_xsize
 
moveq #0,d2
move cpic_map(a0),d2
beq.s .map_done
lea (a0,d2.l),a2
moveq #0,d5
move.b cpic_x(a0),d5
moveq #0,d6
move.b cpic_y(a0),d6
subq #1,d6
.yloop
move d4,d2
move.l a2,d1
move d5,d0
add d5,a2
add d5,a2
bsr dma_trans_wr
add dest_xsize,d4
dbf d6,.yloop
.map_done
rts
dc_chars
move cpic_dchar(a0),d2
move cpic_char(a0),d3
lea (a0,d3),a1
move.l a1,d1
move cpic_nchar(a0),d0
bra dma_trans_wr
 
dc_palette
move.l a4,-(sp)
lea palette_store,a4
 
move cpic_opal(a0),d3
beq.s .no_palette
lea 2(a0,d3),a1
move cpic_cpal(a0),d2
add d2,a4
or #$c000,d2 ;CRAM write
move d2,(a6)
move #0,(a6)
lea -4(a6),a5
move.l (a1),(a4)+
move.l (a1)+,(a5)
move.l (a1),(a4)+
move.l (a1)+,(a5)
move.l (a1),(a4)+
move.l (a1)+,(a5)
move.l (a1),(a4)+
move.l (a1)+,(a5)
move.l (a1),(a4)+
move.l (a1)+,(a5)
move.l (a1),(a4)+
move.l (a1)+,(a5)
move.l (a1),(a4)+
move.l (a1)+,(a5)
move.l (a1),(a4)+
move.l (a1)+,(a5)
.no_palette
move.l (sp)+,a4
rts
 
dma_trans_wr
push.l a0
 
lea vdp_c,a6
vreg 15,2
 
addq #1,d0
lsr #1,d0
move.l d1,a0
 
move d2,d1
and #$3fff,d2
or #$4000,d2
and #$c000,d1
rol #2,d1
swap d2
move d1,d2
move.l d2,(a6)
lea -4(a6),a5
.loop
move.l (a0)+,(a5)
dbf d0,.loop
 
pop.l a0
rts
 
*******************
* Disable Screen. *
*******************
 
screen_off
and #~$0040,reg1_shadow ;disable screen output.
move reg1_shadow,vdp_c ;write reg1 (screen enable).
rts
 
******************
* Enable Screen. *
******************
 
screen_on
or #$0040,reg1_shadow ;enable screen output.
move reg1_shadow,vdp_c ;write reg1 (screen enable).
rts
 
***********************
* Read PAL/NTSC Flag. *
***********************
 
get_tv
lea vdp_c,a6 ;
moveq #1,d0 ;read PAL/NTSC flag.
and (a6),d0 ;
 
lea cp_a,a6 ;write result to smooth-scroll A.
move d0,(a6) ;
 
rts
 
***************
* Clear VRAM. *
***************
 
clear_vram
lea vdp_c,a6
vreg 15,2 ;
ivramw 0 ;clear VRAM.
move #(65536/4)-1,d7 ;
.cvl move.l #0,-4(a6)
dbf d7,.cvl
 
rts
 
******************************************************************************
reset_specials
move.l #$08090aff,weapon_tab+4
tst.b ply2mode
beq.s .1p
move.l #$08090a00,weapon_tab+4
.1p
rts
******************************************************************************
restart_life_lost
lea vars_start,a0
move #((vars_end-vars_start)/2)-1,d7
.cvars clr (a0)+
dbf d7,.cvars
 
lea STRUCT_START,a0
move #((STRUCT_END-STRUCT_START)/4)-1,d0
.c2loop clr.l (a0)+
dbf d0,.c2loop
 
move #128,msight_x
move #88,msight_y
 
moveq #4,d1
tst.b ply2mode
beq.s .n_2mw
move.l #$00070003,d1
.n_2mw move.l d1,weapon
lea weapon_tab,a0
move.l #$00ffff04,(a0)+
move.l #$08090aff,(a0)+
tst.b ply2mode
beq.s .1p
move.l #$ffffff04,-8(a0)
move.l #$08090a00,-4(a0)
.1p
st oweapon
st oweapon2
st opower
sf ram_weapon
clr ram_count
clr torpedo_count
 
move.b #maxshield/2,shield
move #(maxacc-1)/3,acc
clr bombs_rem
clr rockets_rem
move #40,missiles_rem
 
clr player_x
move #$48,player_y
 
move #sclip,yclip
rts
******************************************************************************
set_hp_a0
move d0,mob_hp(a0)
rts
******************************************************************************
scroff
jmp screen_off
set_scron_delay
move #3,scron_delay
rts
******************************************************************************
getrand
move.b rand_num,d0
move.b rand_num+1,rand_num
move.b d0,rand_num+1
; move $ff800c,d0
add rand_num,d0
ror rand_num
rts
******************************************************************************
play_music
add_qsound
remove_qsound_a5
do_pl_startup
rts
 
rotate_player_sprite
move node_player+mob_x,d1
move node_player+mob_y,d2
 
move pbank,d3
asr #3,d3
and #$7ff,d3
 
move node_player+mob_def,d4
 
jcom4 rotate_player
******************************************************************************
 
include planet.s
include surface.s
include sprite.s
include levels.s
include elogic.s
 
include mapping.s
 
include bulkan.s
include guha.s
include twingha.s
include metafus.s
include gigun.s
include krast.s
 
include map360.s
include weapons.s
include weapons2.s ;2nd player
 
include music.s
 
include control2.s
 
include title.s
include options.s
 
include panel.s
 
include cosin.s
 
odb_table
odb -001,$000,-$000,$000,-$000,0,h_null,h_null,h_null,h_null,0,0
 
rept 127
odb $400,$200,-$200,$200,-$200,hit_enemy,do_path_anim,0,plot_spr,init_path_alien,0,0
endr
 
* player weapons (20)
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_hunter_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_pl_laser,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_pl_rocket,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_chargeable_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_pl_laser,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
 
rept 107
odb -001,$000,-$000,$000,-$000,0,do_path_anim,0,plot_spr,hnull,0,0
endr
 
odb -001,$000,-$000,$000,-$000,0,h_null2,0,plot_spr,hnull,0,0
 
* explosions
odb -001,$000,-$000,$000,-$000,0,h_g_exp,h_g_exp_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_g_exp,h_g_exp_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_g_exp,h_g_exp_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0
* sm exp (or/bl)
odb -001,$000,-$000,$000,-$000,0,h_sm_exp_or,h_sm_exp_or_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_sm_exp_bl,h_sm_exp_bl_360,plot_spr,hnull,0,0
* small tank smoke
odb -001,$000,-$000,$000,-$000,0,h_st_smoke,h_st_smoke_360,plot_spr,hnull,0,0
* small exp (stage #09 BOSS)
odb -001,$000,-$000,$000,-$000,0,h_smexp09,0,plot_spr,h_null,0,0
* small smoke (GIGUN)
odb -001,$000,-$000,$000,-$000,0,h_sm_exp_bl2,0,plot_spr,h_null,0,0
 
* player explosions
odb -001,$000,-$000,$000,-$000,0,h_a_exp,h_a_exp_360,plot_spr,hnull,0,0
 
* enemy weaps (32)
odb -001,$000,-$000,$000,-$000,0,h_eweap00,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap01,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_grzap_laser,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap04,0,plot_tlaser_16,hnull,0,0
odb $400,$200,-$200,$200,-$200,hit_enemy_missile,h_eweap_missile05,0,plot_spr,hnull,0,0
odb $400,$300,-$300,$200,-$200,hit_enemy,h_eweap06,0,plot_spr,init_3hp,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap07,0,plot_spr,hnull,0,0
odb $400,$200,-$200,$200,-$200,hit_enemy_missile,h_eweap08,0,plot_spr,hnull,0,0
odb $c00,$080,-$000,$080,-$080,hit_enemy_missile,h_eweap09,h_eweap09_360,plot_spr,hnull,1,$4
odb -001,$000,-$000,$000,-$000,0,h_eweap0B,h_eweap0A_360,plot_spr,hnull,0,0
odb $c00,$080,-$000,$080,-$080,hit_28_shot,h_eweap0B,h_eweap0B_360,plot_spr,hnull,0,$f
odb -001,$000,-$000,$000,-$000,0,h_eweap0E,h_eweap0C_360,plot_tlaser_360,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap0E,h_eweap0D_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap0E,h_eweap0E_360,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap0F,h_eweap0F_360,plot_tlaser_360,hnull,0,0
 
odb $400,$200,-$200,$200,-$200,hit_enemy_missile,h_eweap10,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_eweap02,0,plot_spr,hnull,0,0
 
* player ship
odb -001,$000,-$000,$000,-$000,0,h_null,0,rotate_player_sprite,h_null,0,0
* player walker
odb -001,$000,-$000,$000,-$000,0,hnull,0,plot_player_walker,hnull,0,0
* missile sight
odb -001,$000,-$000,$000,-$000,0,hnull,0,plot_msight,hnull,0,0
* stage 08 warping orb
odb -001,$000,-$000,$000,-$000,0,h_worb08,0,plot_spr,h_null,0,0
* stage 05 laser sight
odb -001,$000,-$000,$000,-$000,0,h_null,hl_05_lsight,plot_05_lsight,h_null,0,0
* stage 05 laser beam
odb -001,$000,-$000,$000,-$000,0,h_null,hl_05_lbeam,plot_05_lbeam,h_null,0,0
 
* asteroid
odb -001,$000,-$000,$000,-$000,0,h_asteroid00,0,plot_star,h_null,0,0
* building fragments
odb -001,$000,-$000,$000,-$000,0,h_leira_bf1,h_leira_bf_360,plot_frag_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_leira_bf2,h_leira_bf_360,plot_frag_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_leira_bf3,h_leira_bf_360,plot_frag_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_leira_bf4,h_leira_bf_360,plot_frag_spr,h_null,0,0
* panel palette fragments
odb -001,$000,-$000,$000,-$000,0,h_pfrag1,h_leira_bf_360,plot_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_pfrag2,h_leira_bf_360,plot_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_pfrag3,h_leira_bf_360,plot_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_pfrag4,h_leira_bf_360,plot_spr,h_null,0,0
 
odb -001,$000,-$000,$000,-$000,0,h_pfrag1s,h_leira_bf_360,plot_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_pfrag2s,h_leira_bf_360,plot_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_pfrag3s,h_leira_bf_360,plot_spr,h_null,0,0
odb -001,$000,-$000,$000,-$000,0,h_pfrag4s,h_leira_bf_360,plot_spr,h_null,0,0
* player hit
odb -001,$000,-$000,$000,-$000,0,h_plyhit,0,plot_spr,hnull,0,0
* player RAM unit
odb -001,$000,-$000,$000,-$000,0,h_null,0,plot_spr,hnull,0,0
 
* enemy 2 - down
odb -001,$000,-$000,$000,-$000,0,h_enemy2_down,0,plot_spr,hnull,0,0
* leira lander down
odb $400,$200,-$200,$200,-$200,0,h_leira_lander_down,0,plot_spr,hnull,0,0
* falling mine
odb -001,$000,-$000,$000,-$000,0,h_falling_mine,0,plot_mine_spr,hnull,0,0
* sand spray
odb -001,$000,-$000,$000,-$000,0,h_sand_spray,hl_sand_spray_360,plot_spr,hnull,0,0
* sand spray (small)
odb -001,$000,-$000,$000,-$000,0,h_sand_spray2,hl_sand_spray2_360,plot_spr,hnull,0,0
* snakey sand spray
odb -001,$000,-$000,$000,-$000,0,h_sand_spray_s,0,plot_spr,hnull,0,0
* guha crater
odb -001,$000,-$000,$000,-$000,0,h_guha_crater,hl_guha_crater_360,plot_spr,hnull,0,0
* guha boss shield hit!
odb -001,$000,-$000,$000,-$000,0,h_guha_bhit,hl_guha_bhit,plot_spr,hnull,0,0
 
* twingha water splashes (vlarge/large/small)
odb -001,$000,-$000,$000,-$000,0,h_vl_splash10,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_l_splash10,0,plot_spr,hnull,0,0
odb -001,$000,-$000,$000,-$000,0,h_s_splash10,0,plot_spr,hnull,0,0
 
; rept 384-ot_fxlast
; odb -001,$000,-$000,$000,-$000,0,0,0,0,hnull,0,0
; endr
 
* bonus 1a-c
ci_bonus1
odb $400,$300,-$300,$300,-$300,hit_bonus1abc,h_bonus1a,0,plot_bonus,hnull,0,0
odb $400,$300,-$300,$300,-$300,hit_bonus1abc,h_bonus1b,0,plot_bonus,hnull,0,0
odb $400,$300,-$300,$300,-$300,hit_bonus1abc,h_bonus1c,0,plot_bonus,hnull,0,0
* leira rocks
odb $400,$100,-$100,$100,-$c00,hit_indestructible,h_leira_trock,0,plot_spr,hnull,0,0
odb $400,$100,-$100,$100,-$800,hit_indestructible,h_leira_mrock,0,plot_spr,hnull,0,0
odb $400,$100,-$100,$100,-$400,hit_indestructible,h_leira_srock,0,plot_spr,hnull,0,0
* warpship boss
odb $c00,$100,-$000,$100,-$000,hit_indestructible_360,h_boss03,0,plot_spr,hnull,0,$a
* warpship pilon
odb $c00,$0c0,-$000,$180,-$000,hit_indestructible_360,h_wpilon03,0,plot_spr,hnull,0,$a
* warpship shield
odb $c00,$0c0,-$000,$070,-$070,hit_indestructible_360,h_shields03,0,plot_spr,hnull,0,$a
* warpship warpgate
odb -001,$000,-$000,$000,-$000,0,h_warpgate03,0,plot_spr,hnull,0,$f
* cpu malfunction
odb -000,$000,-$000,$000,-$000,0,h_malf03,0,plot_spr,hnull,0,0
* warpship pylon
odb -001,$000,-$000,$000,-$000,0,h_wp_pilon,0,plot_spr,hnull,0,$a
* warpship small pylon
odb $c00,$080,-$000,$100,-$000,0,h_sm_pilon03,0,plot_spr,hnull,0,$a
* warpship fragment W,A,B
odb -001,$000,-$000,$000,-$000,0,h_fragment03w,0,h_null,h_null,0,0
odb $c00,$0e0,-$000,$120,-$000,hit_indestructible_360,h_fragment03a,h_fragment_03_360,plot_spr,hnull,0,0
odb $c00,$0e0,-$000,$120,-$000,hit_indestructible_360,h_fragment03b,0,plot_spr,hnull,0,$3
 
* guha rocks
odb $c00,$0c0,-$000,$100,-$000,hit_indestructible_360,h_guha_rock1,0,plot_spr,h_null,0,0
odb $c00,$080,-$000,$080,-$000,hit_indestructible_360,h_guha_rock2,0,plot_spr,h_null,0,0
* guha dome
odb $c00,$100,-$000,$0c0,-$000,hit_guha_dome360,h_guha_dome1,0,plot_spr,init_guha_dome,1,$2
odb $c00,$100,-$000,$0c0,-$000,hit_guha_dome360,h_guha_dome2,0,plot_spr,h_null,1,$2
odb $c00,$100,-$000,$050,-$000,hit_indestructible_360,h_guha_dome3,0,plot_spr,h_null,0,0
* guha small tower
odb $c00,$080,-$000,$0c0,-$000,hit_guha_smtower360,h_guha_smtower1,0,plot_spr,h_null,1,$3
odb $c00,$080,-$000,$080,-$000,hit_indestructible_360,h_guha_smtower2,0,plot_spr,h_null,0,0
* guha pilon
odb $c00,$080,-$000,$180,-$000,hit_guha_pilon360,h_guha_pilon,0,plot_guha_pilon,h_null,0,$3
 
********************************************************************
* twingha rocks *
*****************
* flat rock
odb $400,$180,-$180,$100,-$100,hit_indestructible,h_fl_rock10,0,plot_spr,hnull,0,0
* small rock
odb $400,$180,-$180,$100,-$400,hit_indestructible,h_s_rock10,0,plot_spr,hnull,0,0
* tall rock
odb $400,$180,-$180,$100,-$d00,hit_indestructible,h_t_rock10,0,plot_spr,hnull,0,0
* tall umbrella rock
odb $400,$180,-$180,$100,-$d00,hit_indestructible,h_tu_rock10,0,plot_spr,hnull,0,0
 
********************************************************************
 
; rept 512-ot_htlast
; odb -001,$000,-$000,$000,-$000,0,0,0,0,hnull,0,0
; endr
 
* bonus 1
ci_bonus2
odb $400,$200,-$200,$200,-$200,hit_bonus1,h_bonus1,0,plot_spr,init_bonus1,$1,0
*************
* STAGE #00 *
*************
* small starbase
odb -001,$000,-$000,$000,-$000,0,h_enemy4,0,plot_spr,init_en4,$0,0
*************
* STAGE #01 *
*************
* leira buildings
odb $400,$300,-$300,$100,-$800,hit_ground_obj_f,h_leira_od,0,plot_spr,init_1hp,$1,0
odb -001,$300,-$300,$100,-$400,hit_indestructible,h_leira_od_d,0,plot_spr,hnull,0,0
odb $400,$200,-$200,$100,-$b00,hit_ground_obj_f,h_leira_b1,0,plot_spr,init_3hp,$1,0
odb -001,$200,-$200,$100,-$200,hit_indestructible,h_leira_b1_d,0,plot_spr,hnull,0,0
odb $400,$300,-$400,$100,-$1000,hit_ground_obj_f,h_leira_rb2,0,plot_spr,init_6hp,$1,0
odb -001,$300,-$400,$100,-$600,hit_indestructible,h_leira_rb2_d,0,plot_spr,hnull,0,0
odb $400,$300,-$400,$100,-$1000,hit_ground_obj_f,h_leira_lb2,0,plot_spr,init_6hp,$1,0
odb -001,$300,-$400****************
* Control file *
****************
do_v_control
tst dying_cnt
beq.s .not_dying
rts
.not_dying
move.b joy0,d1
 
tst.b in_lava
beq.s .not_lava1
or.b #$0c,d1
.not_lava1
 
move vehicle,d0
subq #1,d0
bmi striker_ctrl
beq copter_ctrl
walker_ctl
cmp #2+4,walker_count
beq.s .t2
cmp #2,walker_count
bne.s .t1
.t2
move walker_count,d3
cmp l_walker_count,d3
beq.s .t2a
tst warp_count
bne.s .t2a
jsr do_walker_foot_sfx
.t2a
clr scr_spd
clr walker_dir
sf walker_turn
.t1
tst warp_count
bne .we_are_warping
 
move pbank,d3
 
btst #2,d1
bne.s .nl
 
st walker_turn
move #-1,walker_dir
 
add #$080,d3
cmp #$200,d3
blt.s .pbd
move #$200,d3
bra.s .pbd
.nl
btst #3,d1
bne.s .nr
 
st walker_turn
move #-1,walker_dir
 
sub #$080,d3
cmp #-$200,d3
bgt.s .pbd
move #-$200,d3
bra.s .pbd
.nr
tst.b walker_turn
bne.s .pbd

tst d3
beq.s .pbd
bmi.s .pbadd
.pbsub sub #$80,d3
bra.s .pbd
.pbadd add #$80,d3
.pbd move d3,pbank
 
move walker_count,l_walker_count
 
tst slide_count
beq .no_slide
 
btst #0,d1
beq.s .up_ok
cmp #6,slide_count
ble.s .fuel_ok_97
move #6,slide_count
; bra.s .fuel_ok_97
.up_ok
; moveq #7,d0
; and game_del,d0
; bne.s .fuel_ok_97
; subq #1,acc
.fuel_ok_97
 
sf walker_turn
move slide_count,d0
cmp #(20*3)-6,d0
ble.s .slide2
moveq #(20*3)-1,d0
sub slide_count,d0
lsl #4,d0
bra.s .slide1
.slide2
; tst acc
; bne.s .fuel_ok_98
; subq #2,scr_spd
; bpl .all_done
; clr scr_spd
; clr slide_count
;.fuel_ok_98
subq #1,d0
add d0,d0
add d0,d0
cmp #$60,d0
ble.s .slide1
moveq #$60,d0
.slide1
move d0,scr_spd
bra .all_done
 
.no_slide
tst jump_mode
beq .no_jump
 
cmp #1,jump_mode
bne.s .not_jm1
subq #1,jump_count2
bpl .all_done
move.b joy_spc1,d0
btst d0,joy1
beq.s .jmp1_ok
clr jump_mode
bsr find_next_target
jsr do_ntarg_sfx
bra .no_jump
.jmp1_ok
addq #1,jump_mode
.not_jm1
cmp #2,jump_mode
bne.s .not_jm2
addq #1,jump_count
cmp #(20+(20/2))/2,jump_count
bne .update_jmp
addq #1,jump_mode
move #20*3,jump_count2
bra .update_jmp
.not_jm2
cmp #3,jump_mode
bne.s .not_jm3
cmp #$58,jump_thrust
beq.s .jmp_th_ok
add #$0b,jump_thrust
.jmp_th_ok
move.b joy_spc1,d0
btst d0,joy1
bne.s .jump_x
; tst acc
; beq.s .jump_x
; moveq #7,d0
; and game_del,d0
; bne.s .fuel_ok_99
; subq #1,acc
;.fuel_ok_99
 
subq #1,jump_count2
bpl .update_jmp
.jump_x
addq #1,jump_mode
clr jump_count2
bra.s .update_jmp
.not_jm3
tst jump_thrust
beq.s .jmp_th_ok2
subq #4,jump_thrust
bpl.s .jmp_th_ok2
clr jump_thrust
.jmp_th_ok2
addq #1,jump_count
cmp #20,jump_count
bne.s .update_jmp
 
subq #1,jump_count
 
move jump_thrust,d0
asr #1,d0
move d0,scr_spd
 
clr player_y
 
cmp #20/2,jump_count2
beq.s .th_ok3
addq #1,jump_count2
.th_ok3
tst jump_thrust
bne .all_done
cmp #20/2,jump_count2
bne .all_done
 
clr jump_mode
clr player_y
rts
 
.update_jmp
lea sintab,a0
move jump_count,d0
muls #1024/20,d0
add d0,d0
move.b (a0,d0),d0
ext d0
push d0
asr #2,d0
move d0,player_y
asr #1,d0
add d0,player_y
 
pop d0
asr #1,d0
add jump_thrust,d0
asr #1,d0
move d0,scr_spd
bra .all_done
.no_jump
btst #0,d1
bne.s .no_act_slide
cmp #20/4,bb_down
ble.s .no_act_slide
; tst acc
; beq.s .no_act_slide
move #20*3,slide_count
move #2,walker_count
clr walker_dir
sf walker_turn
bra .all_done
.no_act_slide
 
move.b joy_spc1,d0
btst d0,joy1
bne.s .no_act_jump
move #1,jump_mode
clr jump_count
move #20/5,jump_count2
move #2,walker_count
clr scr_spd
clr walker_dir
sf walker_turn
bra .all_done
.no_act_jump
 
tst.b in_lava
bne.s .not_down
btst #0,d1
bne.s .not_up
move #1,walker_dir
move #$12,scr_spd
.not_up
btst #1,d1
bne.s .not_down
move #-1,walker_dir
move #-$12,scr_spd
.not_down
 
.we_are_warping
move walker_dir,d3
btst #0,game_del+1
beq.s .walk2
moveq #0,d3
.walk2 add d3,walker_count
and #7,walker_count
 
.all_done
rts
 
******************************************************************************
copter_ctrl
tst.b ctl_off
beq.s .ctl1
move.b ctl_off2,d1
bra.s .ctl2
.ctl1
move.b joy_spc1,d0
btst d0,joy1 ;*
beq .okay
.ctl2
btst #0,d1
bne.s .not_up
cmp #6,pitch_ang ;6
bge.s .okay
addq #2,pitch_ang
bra.s .okay
.not_up
btst #1,d1
bne.s .not_down
cmp #-6,pitch_ang ;-6
ble.s .okay
subq #2,pitch_ang
bra.s .okay
.not_down
tst pitch_ang
beq.s .okay
bmi.s .add
.sub
subq #1,pitch_ang
bra.s .okay
.add
addq #1,pitch_ang
.okay
move pitch_ang,d2
move d2,d0
asr #1,d0
neg d0
move d0,pitch_ang2
 
tst warp_count ;WARPSHIP
bne.s .sp_okay
 
moveq #8,d3
move d1,ccr
bcc.s .is_8
bvc.s .is_8
moveq #4,d3
.is_8
add d2,d2
add d2,d2
add d2,d2
tst cpu_rspd
bne.s .boss03act
add d2,d2
.boss03act
move scr_spd,d0
cmp d2,d0
beq.s .sp_okay
bge.s .sp_sub
.sp_add
add d3,scr_spd
bra.s .sp_okay
.sp_sub
sub d3,scr_spd
.sp_okay
tst xspeed
beq.s .xpbd
bmi.s .xpbadd
.xpbsub sub #$80,xspeed
bra.s .xpbd
.xpbadd add #$80,xspeed
.xpbd
move.b joy_spc1,d0
btst d0,joy1
bne.s .no_xmove
 
btst #2,d1
bne.s .xnl
cmp #$400,xspeed
bge.s .xnr
add #$100,xspeed
bra.s .xnr
.xnl
btst #3,d1
bne.s .xnr
cmp #-$400,xspeed
ble.s .xnr
sub #$100,xspeed
.xnr
bra .nr
.no_xmove
 
btst #2,d1
bne.s .nl
 
cmp #$400,pbank
bge.s .pbd
add #$100,pbank
bra.s .pbd
.nl
btst #3,d1
bne.s .nr
 
cmp #-$400,pbank
ble.s .pbd
sub #$100,pbank
bra.s .pbd
.nr
tst pbank
beq.s .pbd
bmi.s .pbadd
.pbsub sub #$80,pbank
bra.s .pbd
.pbadd add #$80,pbank
.pbd
tst.b ctl_off
bne.s .not_cd
move.b joy_spc1,d0
btst d0,joy1
bne .not_cd
btst #0,d1
bne .not_cu
 
cmp #6,yspd
bge.s .cud_okay
addq #2,yspd
bra.s .cud_okay
.not_cu
btst #1,d1
bne .not_cd
cmp #-6,yspd
ble.s .cud_okay
subq #2,yspd
bra.s .cud_okay
.not_cd
tst yspd
beq.s .cud_okay
bmi.s .cud_add
.cud_sub
subq #1,yspd
bra.s .cud_okay
.cud_add
addq #1,yspd
.cud_okay
move yspd,d0
add player_y,d0
cmp min_player_y,d0
bge.s .cud_1
move min_player_y,d0
.cud_1 cmp #112-2,d0
ble.s .cud_2
move #112-2,d0
.cud_2 move d0,player_y
rts
******************************************************************************
striker_ctrl
tst.b ctl_off
beq.s .ctl1
move.b ctl_off2,d1
.ctl1
move pbank,d0
 
btst #2,d1
bne.s .nl
 
add #$180,d0 ;$100
cmp #$400,d0
ble.s .pbd
move #$400,d0
bra.s .pbd
.nl
btst #3,d1
bne.s .nr
 
sub #$180,d0 ;$100
cmp #-$400,d0
bge.s .pbd
move #-$400,d0
bra.s .pbd
.nr
tst d0
beq.s .pbd
bmi.s .pbadd
.pbsub sub #$c0,d0 ;$80
bpl.s .pbd
moveq #0,d0
bra.s .pbd
.pbadd add #$c0,d0 ;$80
bmi.s .pbd
moveq #0,d0
.pbd move d0,pbank
 
ASR #4+3+1,D0 ;4+3
 
move d0,d2 ;
asr #1,d2 ;
add d2,d0 ;
 
NEG D0
**********************************************
ADD d0,player_x
**********************************************
cmp #-$65,player_x
bge.s .xd1
move #-$65,player_x
.xd1 cmp #$5b,player_x
ble.s .xd2
move #$5b,player_x
.xd2
moveq #8,d2
moveq #-8,d3
 
moveq #0,d5 ;
 
move yspd,d0
move.b joy_do1,d4
btst d4,d1
bne.s .nd
cmp d3,d0
beq.s .ydone
subq #4,d0 ;4
bra.s .ydone
.nd
move.b joy_up
include coms_equ.s
include obj_equ.s
 
dcmp macros
dc.w (\1)*4,\2
 
dup macros
dc.w -((\1)*4),\2
 
dupf macros
dc.w -(((\1)*4)+1),\2
 
divs MACRO
** move #divider_unit,r14 ;use R14 as ptr to divide unit
move \1,(_d_jr,r14)
move \2,(_d_hrl32,r14)
move (_d_rsr,r14),\2
ENDM
 
*************************
* SLAVE Wait-Task Loop. *
*************************
 
game_slave_start:
nop
.game_slave_loop:
move #comport7,r1 ;
move #0,r0 ;clear SLAVE control comport.
move.w r0,(r1) ;
 
.wait_task_loop:
POLHOST
 
move.w (r1),r0 ;
cmpeq #0,r0 ;wait for task.
bt .wait_task_loop ;
 
move #task_address+th,r0
move (15*4,r0),r1
move r1,gbr
move (1*4,r0),r1
move (2*4,r0),r2
move (3*4,r0),r3
move (4*4,r0),r4
move (5*4,r0),r5
move (6*4,r0),r6 ;
move (7*4,r0),r7 ;setup SLAVE r1-r14 & GBR.
move (8*4,r0),r8 ;
move (9*4,r0),r9
move (10*4,r0),r10
move (11*4,r0),r11
move (12*4,r0),r12
move (13*4,r0),r13
move (14*4,r0),r14
move (r0),r0
 
nop ;
jsr (r0) ;call task address.
nop ;
 
bra .game_slave_loop ;return to task loop.
nop
 
cnop 0,4 ;align to longword boundry.
 
task_address:
dc.l 0 ;slave task address.
task_registers:
dc.l 0,0,0,0,0,0,0 ;r1-r7.
dc.l 0,0,0,0,0,0,0 ;r8-r14.
dc.l 0 ;GBR.
 
lits
 
**************************
* MASTER Wait-Task Loop. *
**************************
 
game_master_start:
; mcom $000c
; move #comport5,r1 ;
; move.w (r1),r0 ;read Megadrive PAL/NTSC flag.
; move #pal_ntsc,r1 ;
; move.w r0,(r1)
 
move #_sysreg,r1 ;allow SH2 to access VDP +
move.w #$8008+PWMIRQ_ON,r0 ;enable VBL interrupts.
move.w r0,(r1) ;
 
move.w r0,(vintclr,r1) ;clear VINT ACK register.
move.w r0,(vintclr,r1) ;
 
move #_frt,r1
move #0,r0
move.b r0,(_tier,r1)
move #$c2,r0
move.b r0,(_tocr,r1)
move #0,r0
move.b r0,(_ocr_h,r1) ;
move #1,r0 ;set free run timer.
move.b r0,(_ocr_l,r1) ;
move #0,r0
move.b r0,(_tcr,r1)
move #1,r0
move.b r0,(_tcsr,r1)
move #0,r0
move.b r0,(_frc_l,r1)
move.b r0,(_frc_h,r1)
 
move #initPWM,r0
jsr (r0)
nop
 
move #$20,r0 ;SH interrupt enable.
move r0,sr ;
 
bsr setup_screen ;clear both screens
nop
 
MOVE #COMPORT6,R0 ;
MOVE #$8000,R1 ;ENABLE FADE.
MOVE.W R1,(R0) ;
.loop
move #comport0,r1 ;get command
move.w (r1),r0
cmpeq #0,r0
bt .loop
 
move.w (r1),r3 ;allow port to settle
cmpeq r3,r0
bf .loop
 
move #com_last,r3
cmphi r3,r0
bt .loop
 
move #.jump_tab-4,r2
add r0,r2
move (r2),r0
 
jsr (r0) ;...and call it
nop
 
move #comport0,r1 ;get command
move #0,r3 ;clear command port
move.w r3,(r1)
 
bra .loop
nop
 
cnop 0,4
 
dc.l 0
.jump_tab
dc.l wait_vbl
dc.l flip_screen
dc.l clear_screen
dc.l plot_sc_sprite
dc.l plot_pixel
dc.l plot_sprite
dc.l decompress_level
dc.l decompress_360_level
dc.l draw_360_floor
dc.l alloc_reset
dc.l PlayPWM
dc.l rotate_player
 
lits
 
pal_ntsc dc.w 0 ;PAL/NTSC flag from Megadrive.
 
************************
* Plot point to screen *
************************
 
cnop 0,4
 
plot_pixel
move #comport1,r0
move.w (r0)+,r1 ;get x
move.w (r0)+,r2 ;get y
move.w (r0)+,r3 ;get colour
 
move.w #224,r4
cmphs r4,r2
bt .exit
 
move.w #320,r4
muls r4,r2
cmphs r4,r1
bt .exit
 
move #screen,r0
move macl,r2
add r1,r0
add r2,r0
move.b r3,(r0)
.exit
rts
nop
 
lits
 
*************************
* Draw sprite to screen *
*************************
 
cnop 0,4
 
plot_sprite
move #comport1,r0
move.w (r0)+,r2 ;get x
move.w (r0)+,r3 ;get y
move.w (r0),r8 ;get def
 
shll2 r8
move #frame_table,r0
add r8,r0
move (r0),r0
 
cmpeq #0,r0 ;frame unused?
bf .skip
move #sp_ringcannon,r0
;.exit
; rts
; nop
.skip
move.w (r0)+,r4 ;get xsize
move.w (r0)+,r5 ;get ysize
add #4,r0
 
bra draw_sprite
move r0,r1 ;R1 = source data
 
*************************
* Draw sprite to screen *
*************************
 
cnop 0,4
 
plot_sc_sprite
move #comport1,r0
move.w (r0)+,r2 ;get x
move.w (r0)+,r3 ;get y
move.w (r0)+,r6 ;get scale
move.w (r0),r8 ;get def
 
shll2 r8
move #frame_table,r0
add r8,r0
move (r0),r0
 
cmpeq #0,r0 ;frame unused?
bf .skip
move #sp_ringcannon,r0
;.exit
; rts
; nop
.skip
move #1,r11 ;flip flag into R11 (0 = unflipped , 1 = flipped)
and r0,r11 ;
sub r11,r0 ;

move.w (r0)+,r4 ;get xsize
move.w (r0)+,r5 ;get ysize
move.w (r0)+,r8 ;get x-off
move.w (r0)+,r9 ;get y-off
 
shll8 r8
shll8 r9
shll2 r8
shll2 r9
shll r8
shll r9
 
move r0,r1 ;R1 = source data
move r11,r0
 
move #divider_unit,r10
 
move r6,(_d_jr,r10)
move r8,(_d_hrl32,r10)
move (_d_rsr,r10),r8
cmpeq #0,r0
bt .2
neg r8,r8
.2
sub r8,r2
 
move r6,(_d_jr,r10) ;is this trashed??
move r9,(_d_hrl32,r10)
move (_d_rsr,r10),r9
sub r9,r3

shll2 r6
shll2 r6
shll r6
 
cmpeq #0,r0
bf/s .1
move r6,r7 ;yscale = xscale
 
bra scale_sprite
nop
.1
bra scale_flip_sprite
nop
 
lits
 
*********************
* DMAC clear screen *
*********************
 
cnop 0,4
 
dmac_clear
move #_dmasource1,r8 ;point to DMAC.
 
move #0,r3
move.w r3,(r1)
 
move (12,r8),r0 ;read (clear TE flag)
 
move #0,r0 ;stop DMA.
move r0,(12,r8) ;
 
move #01,r0 ;enable DMA.
move r0,(32,r8) ;
 
move r1,(r8) ;store DMA source address.

move r1,(4,r8) ;store DMA destination address.

move r2,r0 ;store DMA size.
move r0,(8,r8) ;
 
move #%0100011000000001,r0 ;start DMA.
move r0,(12,r8) ;
 
rts
nop
 
lits
 
****************************
* Clear Screen - 360 stage *
****************************
 
clear_screen_360
stack
 
swait
 
move #task_address+th,r5 ;point to SLAVE task setup.
 
move #screen+(136*160),r1
move r1,(1*4,r5)
 
move #.clear,r0
move r0,(r5)
move #comport7,r14
move #1,r0
move.w r0,(r14)
 
bsr .clear
move #screen,r1
 
unstack
rts
nop
 
cnop 0,4
 
.clear
move #(136*320)/4,r0
move #0,r2
.clr_loop:
move.w r2,(r1)
dt r0
bf/s .clr_loop
add #2,r1
 
rts
nop
 
cnop 0,4
 
****************
* Clear Screen *
****************
 
clear_screen
stack
 
swait
 
move #task_address+th,r5 ;point to SLAVE task setup.
 
move #screen+(224*160),r1
move r1,(1*4,r5)
 
move #.clear,r0
move r0,(r5)
move #comport7,r14
move #1,r0
move.w r0,(r14)
 
bsr .clear
move #screen,r1
 
swait
 
unstack
rts
nop
 
cnop 0,4
 
.clear
move #(224*320)/4,r0
move #0,r2
.clr_loop:
move.w r2,(r1)
dt r0
bf/s .clr_loop
add #2,r1
 
rts
nop
 
lits
 
wait_slave
push r1
 
move #comport7,r1 ;point to slave control comport.
.wait_slave
move.w (r1),r0 ;
cmpeq #0,r0 ;wait slave.
bf .wait_slave ;
rts
pop r1
 
start_slave
push r1
move r0,(r5)
move #comport7,r1
move #1,r0
move.w r0,(r1)
rts
pop r1
 
*************************************
* Clear Screen + Setup Line-Tables. *
*************************************
 
setup_screen:
stack
 
move #fb_cont_reg,r14
 
move #bm_mode_reg+1,r0 ;
move.w #%10000001,r1 ;byte per pixel mode.
move.b r1,(r0) ;
 
move #$8000,r1
move #palette,r0
move.w r1,(r0)
 
move #1,r13
bsr .clear_flip ;
nop ;clear both flipscreens.
move #0,r13 ;
bsr .clear_flip
nop
 
unstack
 
rts
nop
 
.clear_flip
stack
 
move.w r13,(r14) ;
bsr wait_vbl ;select frame buffer.
nop ;
 
move #screen,r0 ;
move #(240*320)/2,r1 ;setup screen clear loop.
move #0,r2 ;
.clr_loop:
move.w r2,(r0) ;
add #2,r0 ;clear screen buffer.
dt r1 ;
bf .clr_loop
 
move #line_table,r0 ;
move.w #$1e0/2,r1 ;setup linestart setup loop.
move.w #160,r2 ;
move.w #240,r3
.set_line_loop:
move.w r1,(r0) ;write linestart.
 
add r2,r1 ;
add #2,r0 ;setup all linestarts.
dt r3 ;
bf .set_line_loop
 
unstack
 
rts
nop
 
lits
 
****************
* Flip Screen. *
****************
 
flip_screen:
move #flip_enable+th,r1 ;point to flip flag.
.wait:
move.w (r1),r0 ;
cmpeq #0,r0 ;buffer flips.
bf .wait ;
 
move #1,r0 ;flag flip.
move.w r0,(r1) ;
 
rts
nop
 
lits
 
*******************
* Wait for A VBL. *
*******************
 
wait_vbl:
move #vbl_count+th,r1 ;setup VBL wait loop.
move.w (r1),r0 ;
.loop:
move.w (r1),r2 ;
cmpeq r0,r2 ;wait for VBL_COUNT to change.
bt .loop ;
 
rts
nop
 
lits
 
************************************
* Enable,Disable & Set Fade Level. *
************************************
 
set_fade:
push r0
 
move #comport6,r0 ;write fade value to comport.
move.w r4,(r0) ;
 
pop r0
 
rts
nop
 
*****************************
* Setup Pointer to Palette. *
*****************************
 
set_palette:
move #pal_ptr,r0 ;setup pointer for VBL.
move r4,(r0) ;
 
rts
nop
 
*************************
* Master VBL Interrupt. *
*************************
 
vblank:
move #vbl_count+th,r1 ;
move.w (r1),r0 ;update VBL count.
add #1,r0 ;
move.w r0,(r1)
 
move #flip_enable+th,r1 ;
move.w (r1),r0 ;flip screen?
cmpeq #0,r0 ;
bt .no_flip
 
move #0,r0 ;flag screen flipped.
move.w r0,(r1) ;
 
move #fb_cont_reg+1,r1 ;
move.b (r1),r0 ;flip VDP bank.
not r0,r0 ;
move.b r0,(r1)
.no_flip:
move #comport6,r0 ;
move.w (r0),r0 ;fade screen?
cmppz r0 ;
bt .no_fade
 
push r2
push r3
push r4
push r5
push r6
push r7
push r8
push r9
push r10
push r11
 
move r0,r6 ;copy fade value.
 
move #game_pal+2,r0 ;
move #palette+2,r1 ;setup palette fade loop.
move #256-1,r2 ;
 
move #0000000011111,r3 ;
move #0001111100000,r4 ;setup palette fade masks.
move #%111110000000000,r5 ;
 
and r3,r6 ;mask out fade value (0-31).
 
move r6,r7
shll2 r7
shll2 r7 ;
shll r7 ;setup palette subtractors.
move r6,r8 ;
shll8 r8
shll2 r8
.fade_pal_loop:
move.w (r0)+,r9 ;
move r9,r10 ;read RGB value.
move r9,r11 ;
 
and r3,r9
sub r6,r9 ;
cmppz r9 ;reduce blue componant.
bt .no_blue ;
move #0,r9
.no_blue:
and r4,r10
sub r7,r10 ;
cmppz r10 ;reduce green componant.
bt .no_green ;
move #0,r10
.no_green:
and r5,r11
sub r8,r11 ;
cmppz r11 ;reduce red componant.
bt .no_red ;
move #0,r11
.no_red:
or r10,r9 ;
or r11,r9 ;write RGB value.
move.w r9,(r1) ;
 
dt r2 ;
bf/s .fade_pal_loop ;fade whole palette.
add #2,r1 ;
 
pop r11
pop r10
pop r9
pop r8
pop r7
pop r6
pop r5
pop r4
pop r3
pop r2
.no_fade:
push r2
move.w #($0F<<10)+($17<<5),r2
move #vbl_count+th,r1
move.w (r1),r0
tst #1,r0
bt .skip
move #0,r2
.skip move #engine_glow,r0
move.w (r0),r1
xor r2,r1
move.w r1,(r0)
move #palette+(192*2),r0
move.w r1,(r0)
pop r2
 
POLHOST
 
rts
nop
 
lits
 
cnop 0,4
 
floor_map dc.l 0
floor_blocks dc.l 0
map_lookup dc.l 0 ;128*8*2 = 90 blocks,8 rotations,2 longwords each.
tvb_table dc.l 0 ;ysize*4
 
vcnt dc.l $ff00
scr_ptr dc.l screen
pal_ptr dc.l game_pal+2
alloc_ptr2 dc.l 0
 
vbl_count dc.w 0
flip_enable dc.w 0
engine_glow dc.w ($1F<<10)+($1F<<5)
 
ship1_pal incbin sprites\ship1\ship.pal
ship2_pal incbin sprites\ship2\ship2.pal
 
game_pal
incbin panel.pal
incbin sprites\ship2\ship2.pal
game2_pal
incbin level02.pal
incbin sprite.pal
 
******************************************************************************
 
include sprite.sh2
include floor.sh2
include pwm.sh2
include rotspr.sh2
 
cnop 0,4
 
frame_table
dc.l sp_pl_ship00
dc.l sp_pl_ship01
dc.l sp_pl_ship02
dc.l sp_pl_ship03
dc.l sp_pl_ship04
dc.l sp_pl_ship05
dc.l sp_pl_ship06
dc.l sp_pl_ship07
dc.l sp_pl_ship08
dc.l sp_pl_ship09
dc.l sp_pl_ship10
dc.l sp_pl_ship11
dc.l sp_pl_ship12
dc.l sp_pl_ship13
dc.l sp_pl_ship14
dc.l sp_pl_ship05+1
dc.l sp_pl_ship06+1
dc.l sp_pl_ship07+1
dc.l sp_pl_ship08+1
dc.l sp_pl_ship09+1
dc.l sp_pl_ship00+1
dc.l sp_pl_ship01+1
dc.l sp_pl_ship02+1
dc.l sp_pl_ship03+1
dc.l sp_pl_ship04+1
 
ds.l 25
 
dc.l sp_tc_ship09
dc.l sp_tc_ship10
dc.l sp_tc_ship11
dc.l sp_tc_ship12
dc.l sp_tc_ship13
dc.l sp_tc_ship14
dc.l sp_tc_ship15
dc.l sp_tc_ship16
dc.l sp_tc_ship17
dc.l sp_tc_ship00
dc.l sp_tc_ship01
dc.l sp_tc_ship02
dc.l sp_tc_ship03
dc.l sp_tc_ship04
dc.l sp_tc_ship05
dc.l sp_tc_ship06
dc.l sp_tc_ship07
dc.l sp_tc_ship08
dc.l sp_tc_ship09+1
dc.l sp_tc_ship10+1
dc.l sp_tc_ship11+1
dc.l sp_tc_ship12+1
dc.l sp_tc_ship13+1
dc.l sp_tc_ship14+1
dc.l sp_tc_ship15+1
dc.l sp_tc_ship16+1
dc.l sp_tc_ship17+1
 
dc.l sp_plasma_shot ;o_weap1
 
ds.l 4 ;o_srocks
ds.l 42 ;o_enemy1
 
dc.l sp_gro_exp00 ;o_gro_exp
dc.l sp_gro_exp01
dc.l sp_gro_exp02
dc.l sp_gro_exp03
dc.l sp_gro_exp04
dc.l sp_gro_exp05
dc.l sp_gro_exp06
dc.l sp_gro_exp07
dc.l sp_gro_exp08
dc.l sp_gro_exp09
dc.l sp_gro_exp10
dc.l sp_gro_exp11
dc.l sp_gro_exp12
dc.l sp_gro_exp13
dc.l sp_gro_exp14
 
dc.l sp_air_exp00 ;o_air_exp
dc.l sp_air_exp01
dc.l sp_air_exp02
dc.l sp_air_exp03
dc.l sp_air_exp04
dc.l sp_air_exp05
dc.l sp_air_exp06
dc.l sp_air_exp07
dc.l sp_air_exp08
dc.l sp_air_exp09
 
dme_del
bne.s .ng_roll
or #$1000,game_del
.ng_roll:
***************************************
move scr_spd,d0
IF l_type=0
muls #$3334,d0
swap d0
add scr_spd,d0
ENDIF
move d0,scr_spd2
***************************************
tst sh_hit_num
beq.s .sh_hit_ok
tst dying_cnt
bne.s .sh_hit_ok
subq #1,sh_hit_del
bpl.s .sh_hit_ok
subq #1,sh_hit_num
jsr do_low_shield_sfx
move #sh_del,sh_hit_del
.sh_hit_ok:
***************************************
jsr pickup_system
cmp #04,level
bne.s .not_gigun
jsr gigun_checks
.not_gigun:
jsr end_fader
***************************************
sf hit_sfx_already
 
tst torpedo_count
beq.s .normal_pals
subq #1,torpedo_count
moveq #1,d0
and torpedo_count,d0
beq.s .normal_pals
move #$777f,torp_fade
bra.s .p4
.normal_pals:
clr torp_fade
.p4:
***************************************
jsr level_flipper
***************************************
clr tmp_slot
***************************************
* Do all processing here! *
***************************
subq #1,gcnt3
bpl.s .gcnt3
move #3-1,gcnt3
.gcnt3:
subq #1,gcnt5
bpl.s .gcnt5
move #5-1,gcnt5
.gcnt5:
subq #1,gcnt6
bpl.s .gcnt6
move #6-1,gcnt6
.gcnt6:
subq #1,gcnt9
bpl.s .gcnt9
move #9-1,gcnt9
.gcnt9:
subq #1,gcnt10
bpl.s .gcnt10
move #9-1,gcnt10
.gcnt10:
subq #1,gcnt12
bpl.s .gcnt12
move #12-1,gcnt12
.gcnt12:
subq #1,gcnt19
bpl.s .gcnt19
move #19-1,gcnt19
.gcnt19:
tst dying_cnt
beq.s .not_dying
jsr do_player_dying
bra.s .no_ctl
.not_dying:
tst startup_count
bne.s .no_ctl
jsr do_v_control
.no_ctl:
tst.b is_360
beq.s .no_360
jsr set_360_map_pos
.no_360:
***************************************
bsr level_control
***************************************
jsr handle_qsounds
***************************************
jsr create_enemies
jsr get_all_enemies
jsr get_all_weapons
jsr do_next_weapon
******************************************************************************
* Check for 2nd player *
************************
tst.b ply2mode
beq.s .1player_only
jsr do_next_weapon_2
jsr player_2_control
jsr player_2_weapons
bra.s .2player_done
.1player_only:
jsr power_transfer_1p
cmp #2,vehicle
bne.s .not_walker1
jsr do_1p_walker_targetting
 
tst poptarg
beq.s .no_poptarg
subq #1,poptarg
move.l mtarget,d0
beq.s .no_poptarg
move.l d0,a6
move mob_x(a6),d0
move mob_y(a6),d1
moveq #0,d2
moveq #0,d6
lea node_msight,a6
movem d0/d1/d2/d6/d7,node_data(a6)
move #ot_msight,mob_type(a6)
jsr insert_sprite
.no_poptarg:
 
bra.s .2player_done
.not_walker1:
lea weapon_tab,a0
add weapon,a0
cmp.b #pw_bomblet,(a0)
bne.s .2player_done
jsr handle_missile_sight
.2player_done:
******************************************************************************
jsr plot_rams
jsr plot_player
tst charge_cnt
beq.s .not_charging
jsr insert_charge_spr
.not_charging:
***************************************
moveq #1,d0
and torpedo_count,d0
bne .no_pause
cmp #16,game_del
ble .no_pause
tst end_fade
bne .no_pause
tst fade_count
bne .no_pause
 
tst.b ply2mode
beq.s .not_2ply_99
btst #button_pause,joy1_2
beq.s .pausing
.not_2ply_99:
btst #button_pause,joy1
bne .no_pause
.pausing:
move.l cs_reltime,-(sp)
jsr pause_sound
.pw1:
jsr wait_vbl
jsr readpad
 
tst.b ply2mode
beq.s .not_2ply_98
btst #button_pause,joy1_2
beq .pw1
.not_2ply_98:
btst #button_pause,joy1
beq .pw1
.pw2:
jsr wait_vbl
jsr readpad
 
tst.b ply2mode
beq.s .not_2ply_97
btst #button_pause,joy1_2
beq.s .pw3
.not_2ply_97:
btst #button_pause,joy1
bne.s .pw2
.pw3:
jsr wait_vbl
jsr readpad
btst #button_pause,joy1
beq.s .pw3
tst.b ply2mode
beq.s .not_2ply_96
btst #button_pause,joy1_2
beq.s .pw3
.not_2ply_96:
jsr unpause_sound
move.l (sp)+,cs_reltime
.no_pause:
******************************************************************************
jsr term_list
 
cmp #26,level
beq.s .bodge_26
cmp #08,level
bne.s .not_bodge_08
.bodge_26:
jsr draw_underside
.not_bodge_08:
 
move.l floorB,d0
move.l floorF,floorB
move.l d0,floorF
 
move.l scrB,d0
move.l scrF,scrB
move.l d0,scrF
 
move.l listB,d0
move.l listF,listB
move.l d0,listF
 
; MOVE.B #16,shield
 
******************************************************************************
cmp.b #2,reset_flag
beq main_start
******************************************************************************
 
tst dying_cnt
bne.s .die1
 
cmp.b #-2,shield
bge mloop
tst timer_val
beq.s .no_stop_music
jsr stop_music
.no_stop_music:
st deact_weaps
jsr do_exp2_sfx
.die1:
cmp #20*2,dying_cnt
bne.s .die2
clr last_plyhit
.die2:
jsr dying_fader
addq #1,dying_cnt
cmp #20*4,dying_cnt
bne mloop
 
sf in_game
jsr scroff
jsr set_scron_delay
 
lea stack,sp
subq #1,lives
bne continue_game
 
* All lives gone!
 
; lea the_end_seq_file,a1
; jsr play_anim
; jsr fade_out_anim
 
clr dying_fade_val
moveq #TITLE_FILE,d0
jsr load_files
jsr hiscore_game_over
 
jmp main_start2
 
continue_game:
bsr restart_life_lost
bsr level_setup
*************************************************
lea node_head,a0
lea node_tail,a1
move.l a1,node_next(a0)
move.l a0,node_prev(a1)
clr game_del
*************************************************
bra mloop
******************************************************************************
init_startup:
move #63+20,startup_count
jmp do_thrusting_sfx
 
do_pl_startup:
moveq #$00000037,d0
move.l d0,player_x
moveq #0,d6
cmp #62,d1
bge.s .1
add d1,d1
move pl_st_table-2(pc,d1),d6
move #256/2,d0
moveq #88,d1
.1:
subq #1,startup_count
move vehicle,d7
move.b .table2(pc,d7),d7
cmp #32,startup_count
ble.s .2
move #510,d7
.2:
rts
.table2:
dc.b 11,13
even
pl_st_table:
dc $801,$802,$804,$808,$810,$820,$830,$840
dc $860,$880,$8a0,$8c0,$8e0,$900,$940,$980
dc $9b0,$9e0,$a10,$a40,$a70,$aa0,$ac0,$ae0
dc $ae8,$af0,$af8,$afc,$afe,$afd,$afc,$afa
dc $af8,$af4,$af0,$ae8,$ae0,$ad8,$ad0,$ac0
dc $ab0,$aa0,$a80,$a60,$a40,$a00,$9c0,$980
dc $940,$900,$880,$800,$780,$700,$680,$600
dc $580,$500,$480,$400,$380
 
dump_gpu_floor:
lea lin_gpu,a0
lea overlays,a1
move #lin_gpuL/4,d7
.loop: move.l (a0)+,(a1)+
dbf d7,.loop
rts
 
dump_gpu_360:
lea l360_gpu,a0
lea overlays,a1
move #l360_gpuL/4,d7
.loop: move.l (a0)+,(a1)+
dbf d7,.loop
rts
******************************************************************************
draw_360_gpu:
lea vars,a0
move.l floorF,(a0)+
move.l map,(a0)+
move.l blocks,(a0)+
move.l #sintab,(a0)+
move.l #costab,(a0)+
move oax,d0
ext.l d0
move.l d0,(a0)+
move alt,d0
ext.l d0
move.l d0,(a0)+
movem v360_off_ox,d0
movem v360_off_oy,d1
move.l d0,(a0)+
move.l d1,(a0)+
move.l #$54,(a0)+
 
move.l #calc_floor_360,semaphore_adr
moveq #1,d0
move.l d0,semaphore
rts
 
draw_360_08_gpu:
lea vars,a0
move.l floorF,d0
add.l #104*256,d0
move.l d0,(a0)+
move.l map,(a0)+
move.l blocks,(a0)+
move.l #sintab,(a0)+
move.l #costab,(a0)+
move oax,d0
ext.l d0
move.l d0,(a0)+
move alt,d0
ext.l d0
move.l d0,(a0)+
movem v360_off_ox,d0
movem v360_off_oy,d1
move.l d0,(a0)+
move.l d1,(a0)+
move.l #100-4,(a0)+
 
move.l #calc_floor_360,semaphore_adr
moveq #1,d0
move.l d0,semaphore
rts
 
draw_linear_10_gpu:
sub #$2000,map_xpos ;KLUDGE
move.l #draw_linear_floor_10,d1
bsr.s draw_linear_gpu2
add #$2000,map_xpos ;KLUDGE
rts
 
draw_linear_city_gpu:
move.l #draw_linear_floor_city,d1
bra.s draw_linear_gpu2
 
draw_linear_gpu:
move.l #draw_linear_floor,semaphore_adr
moveq #1,d0
move.l d0,semaphore
jmp waitgpu
 
draw_linear_gpu2:
moveq #0,d2
 
lea vars,a0
move.l floorB,(a0)+
move.l d2,(a0)+
move.l fbuff_ptr,(a0)+
move.l d2,(a0)+
move.l d2,(a0)+
move.l d2,(a0)+
move alt,d0
ext.l d0
move.l d0,(a0)+
 
movem map_xpos,d0
move.l d0,(a0)+
movem map_zpos,d0
move.l d0,(a0)+
 
move.l d1,semaphore_adr
moveq #1,d0
move.l d0,semaphore
 
bra waitgpu
 
run_gpu_linear1:
bsr waitgpu
move.l #calc_linear_floor,semaphore_adr
moveq #1,d0
move.l d0,semaphore
rts
 
waitgpu:
lea semaphore,a0
.wait:
moveq #1,d0
divs d0,d0
divs d0,d0
tst.l (a0)
bne.s .wait
rts
 
waitgpu3:
push.l a0
push.l d0
 
lea G_FLAGS,a0
.loop:
moveq #1,d0
divu d0,d0
 
move.l (a0),d0
btst #6,d0
bne.s .loop
 
pop.l d0
pop.l a0
rts
 
******************************************************************************
rotate_player_sprite:
tst vehicle
bne rotate_player_sprite_copter
 
rotate_player_sprite_striker:
; lea player_ptr,a0
; move node_player+mob_def,a5
; cmp #25,a5
; blt.s .1
; move #12,a5
;.1:
; add a5,a5
; add a5,a5
; move.l (a0,a5),a0
 
move last_frame,a5
add a5,a5
add a5,a5
lea player_ship,a0
 
tst startup_count
beq.s .3
 
move.l a0,a1
jmp blit_sprite
.3:
lea 8(a0),a2
 
sub.l a3,a3
move node_player+mob_x,d4
sub #(96/2),d4
bpl.s .no_x1_clip
neg d4
move d4,a3
.no_x1_clip:
move node_player+mob_x,d4
add #(96/2),d4
sub #256,d4
bmi.s .no_x2_clip
move d4,a3
.no_x2_clip:
 
bsr waitblit
 
;set source...

move.l a2,A1_BASE
 
move.l #PITCH1|PIXEL16|WID96|XADDINC,A1_FLAGS ;a1 = source
 
move.l (a0),d4
swap d4
move.l d4,A1_CLIP
 
move 6(a0),d3
move d3,pyoff
 
move 2(a0),d3
 
move.l #(72<<16)+96,d0
sub a3,d0
move.l d0,B_COUNT
 
******************************************
* outer loop line increment *
*****************************
 
move xspeed,d0
add pbank,d0
 
cmp #$400,d0
ble.s .zb1
move #$400,d0
.zb1:
cmp #-$400,d0
bge.s .zb2
move #-$400,d0
.zb2:
cmp #15*4,a5
bge.s .2
neg d0
.2:
asr #2,d0
and #$ffe,d0
 
lea costab,a2
move (a2,d0),d5
move d5,sp_cos
 
lea sintab,a2
move (a2,d0),d5
move d5,sp_sin
 
move 4(a0),d4 ;get Offx
neg d4
lsl #3,d4
move d4,sp_midx
 
move 6(a0),d1 ;get Offy
add #12,d1
lsl #3,d1
move d1,sp_mid
neg d1
 
move sp_midx,d4
move sp_cos,d0
move d0,d2
move sp_sin,d7
move d7,d6
muls d4,d0
muls d1,d7
sub.l d0,d7
add.l d7,d7
swap d7
neg d7
muls d1,d2
muls d4,d6
add.l d2,d6
add.l d6,d6
swap d6
 
sub sp_midx,d7
 
add sp_mid,d6
add #(-12*8),d6
 
ext.l d6
ext.l d7
moveq #16-3,d2
lsl.l d2,d6
lsl.l d2,d7
move d6,d2
swap d2
move d7,d2
move.l d2,A1_FPIXEL
swap d7
move d7,d6
move.l d6,A1_PIXEL
 
;set inner loop
 
move sp_cos,d0
ext.l d0
add.l d0,d0
 
move sp_sin,d1
ext.l d1
add.l d1,d1
 
move d1,d2
swap d2
move d0,d2
move.l d2,A1_FINC
swap d0
move d0,d1
move.l d1,A1_INC
***
moveq #-96,d4
add a3,d4
moveq #1,d1
 
move sp_cos,d3
move d3,d2
move sp_sin,d7
move d7,d6
muls d4,d3
muls d1,d7
sub.l d3,d7
add.l d7,d7
 
muls d1,d2
muls d4,d6
add.l d2,d6
add.l d6,d6
***
neg.l d7
 
move d6,d2
swap d2
move d7,d2
move.l d2,A1_FSTEP
swap d7
move d7,d6
move.l d6,A1_STEP
 
******************************************
* set dest *
************
 
move.l scrB,A2_BASE
 
move node_player+mob_y,d1
sub pyoff,d1
sub #24,d1
 
swap d1
add node_player+mob_x,d1
sub #(96/2),d1
 
move.l #(1<<16)+(-96&$ffff),d2
add a3,d2
move.l #PITCH1|PIXEL16|WID256|XADDPIX,d3 ;a2 = dest (screen)
 
cmp #15*4,a5
bge.s .99
add #96,d1
neg d2
bset #19,d3
.99: move.l d1,A2_PIXEL
move.l d2,A2_STEP
move.l d3,A2_FLAGS
 
move striker_fade,d0
swap d0
clr d0
move.l d0,B_IINC
move.l d0,B_PATD
 
move.l #CLIP_A1|SRCSHADE|GOURZ|SRCEN|LFU_S|UPDA1F|UPDA2|DSTA2|DCOMPEN,B_CMD ;Start the BLTTER
.exit:
bsr waitblit
 
rts
 
rotate_player_sprite_copter:
lea player_ptr,a0
move node_player+mob_def,a5
sub #50,a5
add a5,a5
add a5,a5
move.l (a0,a5),a0
 
lea 8(a0),a2
 
bsr waitblit
 
;set source...

move.l a2,A1_BASE
 
move.l #PITCH1|PIXEL16|WID80|XADDINC,A1_FLAGS ;a1 = source
 
move.l (a0),d4
swap d4
move.l d4,A1_CLIP
 
move 6(a0),d3
move d3,pyoff
 
move 2(a0),d3
 
move.l #(72<<16)+80,B_COUNT
 
******************************************
* outer loop line increment *
*****************************
 
move xspeed,d0
add pbank,d0
 
cmp #$400,d0
ble.s .zb1
move #$400,d0
.zb1:
cmp #-$400,d0
bge.s .zb2
move #-$400,d0
.zb2:
cmp #15*4,a5
blt.s .2
neg d0
.2:
asr #2,d0
and #$ffe,d0
 
lea costab,a2
move (a2,d0),d5
move d5,sp_cos
 
lea sintab,a2
move (a2,d0),d5
move d5,sp_sin
 
move 4(a0),d4 ;get Offx
neg d4
lsl #3,d4
move d4,sp_midx
 
move 6(a0),d1 ;get Offy
add #12,d1
lsl #3,d1
move d1,sp_mid
neg d1
 
move sp_midx,d4
move sp_cos,d0
move d0,d2
move sp_sin,d7
move d7,d6
muls d4,d0
muls d1,d7
sub.l d0,d7
add.l d7,d7
swap d7
neg d7
muls d1,d2
muls d4,d6
add.l d2,d6
add.l d6,d6
swap d6
 
sub sp_midx,d7
add sp_mid,d6
add #(-12*8),d6
 
ext.l d6
ext.l d7
moveq #16-3,d2
lsl.l d2,d6
lsl.l d2,d7
move d6,d2
swap d2
move d7,d2
move.l d2,A1_FPIXEL
swap d7
move d7,d6
move.l d6,A1_PIXEL
 
;set inner loop
 
move sp_cos,d0
ext.l d0
add.l d0,d0
 
move sp_sin,d1
ext.l d1
add.l d1,d1
 
move d1,d2
swap d2
move d0,d2
move.l d2,A1_FINC
swap d0
move d0,d1
move.l d1,A1_INC
***
moveq #-80,d4
moveq #1,d1
 
move sp_cos,d3
move d3,d2
move sp_sin,d7
move d7,d6
muls d4,d3
muls d1,d7
sub.l d3,d7
add.l d7,d7
 
muls d1,d2
muls d4,d6
add.l d2,d6
add.l d6,d6
***
neg.l d7
 
move d6,d2
swap d2
move d7,d2
move.l d2,A1_FSTEP
swap d7
move d7,d6
move.l d6,A1_STEP
 
******************************************
* set dest *
************
 
move.l scrB,A2_BASE
 
move node_player+mob_y,d1
sub pyoff,d1
sub #40,d1
 
swap d1
add node_player+mob_x,d1
sub #(80/2),d1
 
cmp #18*4,a5
blt.s .98
subq #8,d1
bra.s .97
.98: cmp #9*4,a5
bge.s .97
addq #8,d1
.97:
move.l #(1<<16)+(-80&$ffff),d2
move.l #PITCH1|PIXEL16|WID256|XADDPIX,d3 ;a2 = dest (screen)
 
cmp #15*4,a5
blt.s .99
add #80,d1
neg d2
bset #19,d3
.99: move.l d1,A2_PIXEL
move.l d2,A2_STEP
move.l d3,A2_FLAGS
 
move striker_fade,d0
bne.s .96
 
move copter_flare,d0
lsl #4,d0


More More!

 4.49a
#readram3
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram2
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram1
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram0
 00000000  003FD7FF
 00880000  009FFFFF
 00FF0000  00FFFFFF
#writeram3
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram2
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram1
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram0
 00000000  003FBFFF 
 00880000  009FFFFF 
 00FF0000  00FFFFFF 
#update
 FF 0008
#video
 03 50 32
#label level
 02 00 00
#colour attributes
 17 20 60 40 1F 2F 6F 4F 3E B0 4F 5E 0C 70 C0 87 8E 8E F0 90 4F 87 7C 0E 0A 70
#mono attributes
 07 07 07 07 0F 0F 0F 0F 70 70 07 70 0F 70 01 07 0F 0F 70 0F 07 07 70 07 07 70
#default tabs
 68K 0F 17 28 30 00 00 00 00
 658 0F 17 28 30 00 00 00 00
 Z80 0F 17 28 30 00 00 00 00
 C   04 00 00 00 00 00 00 00
#expression C/ASM flags
 00 00 00 00 00
#window
 01 00 00 00
 00 01 4F 0A 3D 05
 00000000
#window
 82 00 00 00
 00 0A 4F 21 08 0B
 0088675A
#window
 03 01 00 00
 00 21 4F 2D 08 22
 FFFFFFEE
#history
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 0A $ffff802e
 0A ffff802e
 0A ff802e
 0A sp
 0A pwmstructs
 0A playpwm
 0A pwm_irq
 0A frame_table+(o_digit*4)


More! (the same thing as above, only different slightly):

#version
 4.49a
#readram3
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram2
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram1
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram0
 00000000  003FD7FF
 00880000  009FFFFF
 00FF0000  00FFFFFF
#writeram3
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram2
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram1
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram0
 00000000  003FBFFF 
 00880000  009FFFFF 
 00FF0000  00FFFFFF 
#update
 FF 0008
#video
 03 50 32
#label level
 02 00 00
#colour attributes
 17 20 60 40 1F 2F 6F 4F 3E B0 4F 5E 0C 70 C0 87 8E 8E F0 90 4F 87 7C 0E 0A 70
#mono attributes
 07 07 07 07 0F 0F 0F 0F 70 70 07 70 0F 70 01 07 0F 0F 70 0F 07 07 70 07 07 70
#default tabs
 68K 0F 17 28 30 00 00 00 00
 658 0F 17 28 30 00 00 00 00
 Z80 0F 17 28 30 00 00 00 00
 C   04 00 00 00 00 00 00 00
#expression C/ASM flags
 00 00 00 00 00
#window
 01 00 00 02
 00 01 4F 0A 0A 02
 00000000
#window
 02 00 00 02
 00 0A 4F 21 08 0B
 060004BC
#window
 83 02 00 02
 00 21 4F 2D 0A 22
 020FF8C2
#history
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 0A $ffff802e
 0A ffff802e
 0A ff802e
 0A sp
 0A pwmstructs
 0A playpwm
 0A pwm_irq
 0A frame_table+(o_digit*4)


Here's a batch file for compiling all that crap:

\psylink /m /z /I @soul.lnk,soul,soul.sym,soul.map

musdat.obj:	musdat.68k
	\psyq\asm68k /I /l /zd /g /w /z musdat.68k,musdat

soul68k.obj:	soul.68k main.68k music.68k joystick.68k
	\psyq\asm68k /I /l /zd /g /w /z main,main68k

soulsh2.obj:	main.sh2 soul.sh2 sprite.sh2
	\psyq\asmsh /z /I /l /zd /g /w main.sh2,mainsh2

debug:
	\psyq\dbug32x soul /u1 soul /u2 soul /e


same thing mentioned again:

#version
 4.49a
#readram3
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram2
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram1
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram0
 00000000  003FD7FF
 00880000  009FFFFF
 00FF0000  00FFFFFF
#writeram3
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram2
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram1
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram0
 00000000  003FBFFF 
 00880000  009FFFFF 
 00FF0000  00FFFFFF 
#update
 FF 0008
#video
 03 50 32
#label level
 02 00 00
#colour attributes
 17 20 60 40 1F 2F 6F 4F 3E B0 4F 5E 0C 70 C0 87 8E 8E F0 90 4F 87 7C 0E 0A 70
#mono attributes
 07 07 07 07 0F 0F 0F 0F 70 70 07 70 0F 70 01 07 0F 0F 70 0F 07 07 70 07 07 70
#default tabs
 68K 0F 17 28 30 00 00 00 00
 658 0F 17 28 30 00 00 00 00
 Z80 0F 17 28 30 00 00 00 00
 C   04 00 00 00 00 00 00 00
#expression C/ASM flags
 00 00 00 00 00
#window
 01 00 00 00
 00 01 4F 0A 3D 05
 00000000
#window
 82 00 00 00
 00 0A 4F 21 08 0B
 0088675A
#window
 03 01 00 00
 00 21 4F 2D 08 22
 FFFFFFEE
#history
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 0A $ffff802e
 0A ffff802e
 0A ff802e
 0A sp
 0A pwmstructs
 0A playpwm
 0A pwm_irq
 0A frame_table+(o_digit*4)


Again, more of the same. (These must be for different OBJ files)

#version
 4.49a
#readram3
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram2
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram1
 00000000  00003FFF
 02000000  023FFFFF
 04000000  0403FFFF
 06000000  0603FFFF
 20000000  20003FFF
 22000000  223FFFFF
 24000000  2403FFFF
 26000000  2603FFFF
#readram0
 00000000  003FD7FF
 00880000  009FFFFF
 00FF0000  00FFFFFF
#writeram3
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram2
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram1
 00000000  00003FFF 
 02000000  023FFFFF 
 04000000  0403FFFF 
 06000000  0603FFFF 
 20000000  20003FFF 
 22000000  223FFFFF 
 24000000  2403FFFF 
 26000000  2603FFFF 
#writeram0
 00000000  003FBFFF 
 00880000  009FFFFF 
 00FF0000  00FFFFFF 
#update
 FF 0008
#video
 03 50 32
#label level
 02 00 00
#colour attributes
 17 20 60 40 1F 2F 6F 4F 3E B0 4F 5E 0C 70 C0 87 8E 8E F0 90 4F 87 7C 0E 0A 70
#mono attributes
 07 07 07 07 0F 0F 0F 0F 70 70 07 70 0F 70 01 07 0F 0F 70 0F 07 07 70 07 07 70
#default tabs
 68K 0F 17 28 30 00 00 00 00
 658 0F 17 28 30 00 00 00 00
 Z80 0F 17 28 30 00 00 00 00
 C   04 00 00 00 00 00 00 00
#expression C/ASM flags
 00 00 00 00 00
#window
 01 00 00 01
 00 01 4F 0A 0A 02
 00000000
#window
 85 00 40 01
 00 0A 4F 21 08 12
 00000016
#file
C:\SOULSTAR.32X\ROTSPR.SH2
#tabs
 08 00 00 00 00 00 00 00

#window
 03 02 00 01
 00 21 4F 2D 16 22
 06001B48
#history
 02 rotspr.sh2
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 07 $fffff0
 0A $ffff802e
 0A ffff802e
 0A ff802e
 0A sp
 0A pwmstructs
 0A playpwm
 0A pwm_irq
 0A frame_table+(o_digit*4)


This seems to be another copy of the PWM Sample Program source, but changed slightly near the end:

;	PWM Sample Program
;					SH2 Master Main
;
;	Copyright SEGA ENTERPRISES,LTD. 1994
;---------------------------------------------------------------*
;****************************************************************
	
	cnop	0,4

******************************************
* Initialize the PWM interupt and driver *
******************************************

initPWM
	move	#$20004030,r2
	move	#1047,r0			;1047 set cycle register (22Khz)
	move.w	r0,(2,r2)

	move	#$0305,r0			;105 set control register
	move.w	r0,(r2)

	move	#$20004030,r2                	;fill mono fifo
	move	#1,r0
	move.w	r0,(8,r2)
	move.w	r0,(8,r2)
	move.w	r0,(8,r2)

	rts
	nop

	cnop	0,4

	lits

	cnop	0,4

************************************************
* Play an 8 bit sample throught the PWM ciruit *
************************************************
; input
;	R1 = Address of sample
;	R2 = length of sample
;	R3 = channel number
;	R4 = step value

PlayPWM
	move	#comport1,r0
	move.w	(r0)+,r1		;get sfx number
	move.w	(r0)+,r4		;get step rate
	move.w	(r0)+,r2		;get volume

	move	#sample_table,r0
	shll2	r1
	shll	r1
	add	r1,r0
	move	(r0)+,r2		;get length
	move	(r0)+,r1		;get address

	move	#sfx_chan,r5		;get channel to play
	move	(r5),r0
	add	#1,r0
	and	#3,r0
	move	r0,(r5)
	move	r0,r3

	move	r2,r0
	shll8	r0
	move	#pwmstructs+TH,r2
	shll2	r3
	shll2	r3
	add	r3,r2
	move	r0,(r2)			;store sample length (bytes)

	cmpeq	#0,r0
	bt	.done_pwm

	move	r4,(PWMSTEP,r2)		;store step rate
	shll8	r1
	move	r1,(PWMADDR,r2)		;store sample address

.done_pwm
	rts
	nop

	cnop	0,4

sfx_chan dc.l	0

	lits

*************************
* PWM interrupt handler *
*************************

	cnop	0,4
spwm_irq
	push	r0
	push	r1
	push	r2
	push	r3
	push	r4
	push	r5
	push	r6

	move	#$20004038,r2
	move.b	(r2),r0			;is pwm fifo full?
	tst	#$80,r0
	bf	.exit

	push	pr
	bsr	process_pwm
	nop
	pop	pr
.exit
	move	#_FRT,r1      		;tweak FRT
	move.b	(_TOCR,r1),r0
	xor	#$02,r0
	move.b	r0,(_TOCR,r1)

	move	#$2000401C,r2		;clear irq
	move.w	r0,(r2)
	move.w	(r2),r0

	pop	r6
	pop	r5
	pop	r4
	pop	r3
	pop	r2
	pop	r1
	pop	r0

	rts
	nop
	
	LITS

	cnop	0,4

NUMCHANNELS	equ	4
PWMSIZE		equ	4	; number of elemts in the PWM structure

PWMADDR		equ	4
PWMSTEP		equ	8

*****************
* Fill PWM FIFO *
*****************

process_pwm
	move	#$20004038,r2
.loop
	move	#pwmstructs+TH,r3
	move	#NUMCHANNELS,r4
	move	#0,r5

.channelloop
	move	(r3),r0				;is channel on?
	cmppz	r0
	bf/s	.skip
	move.w	#$80,r1				;if channel off, use $7f (flat)

	move	(PWMSTEP,r3),r6
	sub	r6,r0
	move	r0,(r3)

	move	(PWMADDR,r3),r0			;get the next pcm byte
	move	r0,r1
	add	r6,r0
	move	r0,(PWMADDR,r3)
	shlr8	r1
	move	#samp_base,r0
	move.b	(r0,r1),r1
	extu.b	r1,r1
.skip
	add	#PWMSIZE*4,r3

	add	#1,r1   			;make sure it's not 0
	add	r1,r5

	dt	r4
	bf	.channelloop

	move.w	r5,(r2)				;store into mono width

	move.b	(r2),r0				;is pwm fifo full?
	tst	#$80,r0
	bt	.loop

* player ship



Like I said, there are TONS of other stuff in here. Possibly some snippets from the actual computer it was compiled on. Definetly needs checking out.

More to come, hopefully.
This post has been edited by evilhamwizard: 20 February 2010 - 02:18 PM

#19 User is offline K2J 

Posted 20 February 2010 - 03:30 PM

  • YOU CAN USE A MACHINE WITH MEMORY DATA
  • Posts: 2068
  • Joined: 19-June 07
  • Gender:Male
  • Location:America, The United States of
  • Project:Not School
  • Wiki edits:8
I seem to recall Link's Awakening having some uncompiled code in it; interestingly, there was some sort of reference to QBasic inside.

#20 User is offline evilhamwizard 

Posted 20 February 2010 - 04:01 PM

  • Posts: 1158
  • Joined: 16-June 04
  • Gender:Male
  • Wiki edits:109
QUOTE (K2J @ Feb 20 2010, 03:30 PM)
I seem to recall Link's Awakening having some uncompiled code in it; interestingly, there was some sort of reference to QBasic inside.



I remember this.

It's nothing interesting. This is from a Russian translation (hacked) version of the game, which the translators disassembled the rom to help them add space for characters, etc.

#21 User is offline Chilly Willy 

Posted 21 February 2010 - 04:30 PM

  • Posts: 746
  • Joined: 10-April 09
  • Gender:Male
  • Project:Doom 32X
CODE
move #$0305,r0;105 set control register


Lord Almighty! An interrupt for every three audio samples! And at 22kHz, that's over 7000 interrupts per second. Talk about overhead! flunked.png

I don't know why programmers used interrupt driven audio on the 32X when SEGA went to all the trouble of giving them DMA driven PWM. Just set channel 1 of the DMA in either SH2 and let it rip! If anyone is contemplating 32X homebrew with audio, I released an example of double-buffered DMA driven PWM for the 32X over at SpritesMind. If folks are interested, I could post that here as well.
eng101.png
This post has been edited by Chilly Willy: 21 February 2010 - 04:31 PM

#22 User is offline Overlord 

Posted 21 February 2010 - 07:36 PM

  • Cat-herder
  • Posts: 14494
  • Joined: 12-January 03
  • Gender:Male
  • Location:Berkshire, England
  • Project:VGDB
  • Wiki edits:3,204
You have to wonder just how much of it was down to lack of hardware knowledge. I mean, 32X didn't exactly have the longest shelf life.

#23 User is offline Quickman 

Posted 22 February 2010 - 04:10 AM

  • Posts: 5584
  • Joined: 03-December 03
  • Gender:Male
  • Location::x
  • Project:omg porjcet
  • Wiki edits:10
Alternatively, same reason they never used CSM and rarely ever went near SSG-EG on the Megadrive - the documentation didn't mention it or said "don't do this, leave it alone".

#24 User is offline Chilly Willy 

Posted 22 February 2010 - 07:40 PM

  • Posts: 746
  • Joined: 10-April 09
  • Gender:Male
  • Project:Doom 32X
QUOTE (Overlord @ Feb 21 2010, 05:36 PM)
You have to wonder just how much of it was down to lack of hardware knowledge. I mean, 32X didn't exactly have the longest shelf life.


This is most likely the main reason. They just used whatever "sample" code SEGA provided. Most of the effort was probably spent trying to squeeze the memory requirements down.

#25 User is offline SegaLoco 

Posted 23 February 2010 - 11:10 PM

  • W)(at did you say?
  • Posts: 999
  • Joined: 16-August 06
  • Gender:Male
  • Location:Corpus Christi, TX
  • Wiki edits:79
I have this sample code actually, anyone want it (although I'm surprised that it isn't talked about much, its been in the "public domain" unofficially for quite a while).

#26 User is offline Andlabs 

Posted 24 February 2010 - 09:25 AM

  • 「いっきまーす」
  • Posts: 2175
  • Joined: 11-July 08
  • Gender:Male
  • Project:Writing my own MD/Genesis sound driver :D
  • Wiki edits:7,061
QUOTE (Chilly Willy @ Feb 21 2010, 04:30 PM)
I don't know why programmers used interrupt driven audio on the 32X when SEGA went to all the trouble of giving them DMA driven PWM. Just set channel 1 of the DMA in either SH2 and let it rip! If anyone is contemplating 32X homebrew with audio, I released an example of double-buffered DMA driven PWM for the 32X over at SpritesMind. If folks are interested, I could post that here as well.
eng101.png

I wouldn't know if this has anything to do with it, but it could also have to do with, for example, Space Harrier's sound driver allowing simultaneous FM and PWM. The chords at the beginning of the main song are FM.

Also Chaotix seems to have its PWM routine run as a routine in the slave SH-2 main loop.

#27 User is offline Quickman 

Posted 24 February 2010 - 09:32 AM

  • Posts: 5584
  • Joined: 03-December 03
  • Gender:Male
  • Location::x
  • Project:omg porjcet
  • Wiki edits:10
QUOTE (SegaLoco @ Feb 24 2010, 04:10 AM)
I have this sample code actually, anyone want it (although I'm surprised that it isn't talked about much, its been in the "public domain" unofficially for quite a while).

Yes please.

#28 User is offline SegaLoco 

Posted 24 February 2010 - 06:32 PM

  • W)(at did you say?
  • Posts: 999
  • Joined: 16-August 06
  • Gender:Male
  • Location:Corpus Christi, TX
  • Wiki edits:79
http://segaloco.spinfxrocks.com/Sega_32X_SDK.7z

Have fun wink.png

Has sample code for doing a lot of cool things.

#29 User is offline Chilly Willy 

Posted 24 February 2010 - 09:59 PM

  • Posts: 746
  • Joined: 10-April 09
  • Gender:Male
  • Project:Doom 32X
The DMA PWM in the SDK isn't that great - it's meant to be test code, not example code. A better example would be the demo I made.

Here's the main part:

CODE
void FillSoundBuff(int offset)
{
   int ix;
   short samp;
   short *buf = (short *)(((unsigned long)sndbuf + offset * 4) | 0x20000000);
   volatile int *aud_len = (int *)((unsigned int)&gAudioLen | 0x20000000);
   volatile int *aud_buf = (int *)((unsigned int)&gAudioBuf | 0x20000000);
   unsigned char *buffer = (unsigned char *)*aud_buf;
   int iy = *aud_len;

   if (iy >= NUM_SAMPS)
   {
      for (ix=0; ix<NUM_SAMPS; ix++)
      {
         samp = buffer[0] | (buffer[1] << 8);
         buf[0] = (samp >> 7) + 258;
         samp = buffer[2] | (buffer[3] << 8);
         buf[1] = (samp >> 7) + 258;
         buffer += 4;
         buf += 2;
      }
      *aud_buf += NUM_SAMPS * 4;
      *aud_len -= NUM_SAMPS;
   }
   else
   {
      for (ix=0; ix<iy; ix++)
      {
         samp = buffer[0] | (buffer[1] << 8);
         buf[0] = (samp >> 7) + 258;
         samp = buffer[2] | (buffer[3] << 8);
         buf[1] = (samp >> 7) + 258;
         buffer += 4;
         buf += 2;
      }
      for (ix=iy; ix<NUM_SAMPS; ix++)
      {
         buf[0] = 258;
         buf[1] = 258;
         buf += 2;
      }
      *aud_len = 0;
   }
}

void slave(void)
{
   // init DMA
    SH2_DMA_SAR0 = 0;
    SH2_DMA_DAR0 = 0;
    SH2_DMA_TCR0 = 0;
    SH2_DMA_CHCR0 = 0;
    SH2_DMA_DRCR0 = 0;
    SH2_DMA_SAR1 = 0;
    SH2_DMA_DAR1 = 0;
    SH2_DMA_TCR1 = 0;
    SH2_DMA_CHCR1 = 0;
    SH2_DMA_DRCR1 = 0;
   SH2_DMA_DMAOR = 1; // enable DMA

    // init the sound hardware
    MARS_PWM_CTRL = 0x0185; // TM = 1, RTP, RMD = right, LMD = left
    if (MARS_VDP_DISPMODE & MARS_NTSC_FORMAT)
        MARS_PWM_CYCLE = 23011361/44100 + 1; // 44.1kHz for NTSC clock
    else
        MARS_PWM_CYCLE = 22801467/44100 + 1; // 44.1kHz for PAL clock

    while (1)
    {
        // only do sound when sound subsytem initialized
        while (MARS_SYS_COMM4 != 0)
        {
         if (MARS_SYS_COMM4 == 1)
         {
            MARS_SYS_COMM4 = 2;
            MARS_PWM_MONO = 1;
            MARS_PWM_MONO = 1;
            MARS_PWM_MONO = 1;
         }

            // start DMA on first buffer and fill second
            SH2_DMA_SAR1 = (unsigned long)sndbuf | 0x20000000;
            SH2_DMA_DAR1 = 0x20004034; // storing a long here will set left and right
            SH2_DMA_TCR1 = NUM_SAMPS; // number longs
            SH2_DMA_CHCR1 = 0x18E1; // dest fixed, src incr, size long, ext req, dack mem to dev, dack hi, dack edge, dreq rising edge, cycle-steal, dual addr, intr disabled, clear TE, dma enabled

            FillSoundBuff(NUM_SAMPS);

            // wait on DMA
            while (!(SH2_DMA_CHCR1 & 2)); // wait on TE
            SH2_DMA_CHCR1 = 0x18E0; // clear TE, dma disabled

            // start DMA on second buffer and fill first
            SH2_DMA_SAR1 = ((unsigned long)sndbuf + NUM_SAMPS * 4) | 0x20000000;
            SH2_DMA_DAR1 = 0x20004034; // storing a long here will set left and right
            SH2_DMA_TCR1 = NUM_SAMPS; // number longs
            SH2_DMA_CHCR1 = 0x18E1; // dest fixed, src incr, size long, ext req, dack mem to dev, dack hi, dack edge, dreq rising edge, cycle-steal, dual addr, intr disabled, clear TE, dma enabled

            FillSoundBuff(0);

            // wait on DMA
            while (!(SH2_DMA_CHCR1 & 2)); // wait on TE
            SH2_DMA_CHCR1 = 0x18E0; // clear TE, dma disabled
        }
    }
}


and here's an archive of the demo... the code above is newer... I trimmed the demo code a bit, but didn't make a new archive.

http://www.fileden.com/files/2009/2/3/2304...udioTest32X.zip

#30 User is offline evilhamwizard 

Posted 21 March 2010 - 05:25 PM

  • Posts: 1158
  • Joined: 16-June 04
  • Gender:Male
  • Wiki edits:109
Time for some bumpage.

I checked out the PS2 port of Sonic R PC for Sonic Gems Collection (NTSC-J) and there's some remnants of some Maya source code for something related to editing. Not sure, can you figure it out?

*note there's some stuff that might not be part of this file, but whatever

CODE
// Maya Mel UI Configuration File.
//
// This script is machine generated. Edit at your own risk.
//
//

global string $gMainPane;
if (`paneLayout -exists $gMainPane`) {

global int $gUseScenePanelConfig;
int $useSceneConfig = $gUseScenePanelConfig;
int $menusOkayInPanels = `optionVar -q allowMenusInPanels`; int $nVisPanes = `paneLayout -q -nvp $gMainPane`;
int $nPanes = 0;
string $editorName;
string $panelName;
string $itemFilterName;
string $panelConfig;

//
// get current state of the UI
//
sceneUIReplacement -update $gMainPane;

$panelName = `sceneUIReplacement -getNextPanel "modelPanel" "Top View"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `modelPanel -unParent -l "Top View" -mbv $menusOkayInPanels `;
$editorName = $panelName;
modelEditor -e
-camera "top"
-useInteractiveMode 0
-displayLights "default"
-displayAppearance "wireframe"
-activeOnly 0
-wireframeOnShaded 0
-bufferMode "double"
-twoSidedLighting 1
-backfaceCulling 0
-xray 0
-displayTextures 0
-smoothWireframe 0
-textureAnisotropic 0
-textureHilight 1
-textureSampling 2
-textureDisplay "modulate"
-textureMaxSize 1024
-fogging 0
-fogSource "fragment"
-fogMode "linear"
-fogStart 0
-fogEnd 100
-fogDensity 0.1
-fogColor 0.5 0.5 0.5 1
-sortTransparent 1
-nurbsCurves 1
-nurbsSurfaces 1
-polymeshes 1
-subdivSurfaces 1
-planes 1
-lights 1
-cameras 1
-controlVertices 1
-hulls 1
-grid 1
-joints 1
-ikHandles 1
-deformers 1
-dynamics 1
-fluids 1
-locators 1
-dimensions 1
-handles 1
-pivots 1
-textures 1
-strokes 1
-shadows 0
$editorName;
modelEditor -e -viewSelected 0 $editorName;
}
} else {
$label = `panel -q -label $panelName`;
modelPanel -edit -l "Top View" -mbv $menusOkayInPanels $panelName;
$editorName = $panelName;
modelEditor -e
-camera "top"
-useInteractiveMode 0
-displayLights "default"
-displayAppearance "wireframe"
-activeOnly 0
-wireframeOnShaded 0
-bufferMode "double"
-twoSidedLighting 1
-backfaceCulling 0
-xray 0
-displayTextures 0
-smoothWireframe 0
-textureAnisotropic 0
-textureHilight 1
-textureSampling 2
-textureDisplay "modulate"
-textureMaxSize 1024
-fogging 0
-fogSource "fragment"
-fogMode "linear"
-fogStart 0
-fogEnd 100
-fogDensity 0.1
-fogColor 0.5 0.5 0.5 1
-sortTransparent 1
-nurbsCurves 1
-nurbsSurfaces 1
-polymeshes 1
-subdivSurfaces 1
-planes 1
-lights 1
-cameras 1
-controlVertices 1
-hulls 1
-grid 1
-joints 1
-ikHandles 1
-deformers 1
-dynamics 1
-fluids 1
-locators 1
-dimensions 1
-handles 1
-pivots 1
-textures 1
-strokes 1
-shadows 0
$editorName;
modelEditor -e -viewSelected 0 $editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextPanel "modelPanel" "Side View"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `modelPanel -unParent -l "Side View" -mbv $menusOkayInPanels `;
$editorName = $panelName;
modelEditor -e
-camera "side"
-useInteractiveMode 0
-displayLights "default"
-displayAppearance "wireframe"
-activeOnly 0
-wireframeOnShaded 0
-bufferMode "double"
-twoSidedLighting 1
-backfaceCulling 0
-xray 0
-displayTextures 0
-smoothWireframe 0
-textureAnisotropic 0
-textureHilight 1
-textureSampling 2
-textureDisplay "modulate"
-textureMaxSize 1024
-fogging 0
-fogSource "fragment"
-fogMode "linear"
-fogStart 0
-fogEnd 100
-fogDensity 0.1
-fogColor 0.5 0.5 0.5 1
-sortTransparent 1
-nurbsCurves 1
-nurbsSurfaces 1
-polymeshes 1
-subdivSurfaces 1
-planes 1
-lights 1
-cameras 1
-controlVertices 1
-hulls 1
-grid 1
-joints 1
-ikHandles 1
-deformers 1
-dynamics 1
-fluids 1
-locators 1
-dimensions 1
-handles 1
-pivots 1
-textures 1
-strokes 1
-shadows 0
$editorName;
modelEditor -e -viewSelected 0 $editorName;
}
} else {
$label = `panel -q -label $panelName`;
modelPanel -edit -l "Side View" -mbv $menusOkayInPanels $panelName;
$editorName = $panelName;
modelEditor -e
-camera "side"
-useInteractiveMode 0
-displayLights "default"
-displayAppearance "wireframe"
-activeOnly 0
-wireframeOnShaded 0
-bufferMode "double"
-twoSidedLighting 1
-backfaceCulling 0
-xray 0
-displayTextures 0
-smoothWireframe 0
-textureAnisotropic 0
-textureHilight 1
-textureSampling 2
-textureDisplay "modulate"
-textureMaxSize 1024
-fogging 0
-fogSource "fragment"
-fogMode "linear"
-fogStart 0
-fogEnd 100
-fogDensity 0.1
-fogColor 0.5 0.5 0.5 1
-sortTransparent 1
-nurbsCurves 1
-nurbsSurfaces 1
-polymeshes 1
-subdivSurfaces 1
-planes 1
-lights 1
-cameras 1
-controlVertices 1
-hulls 1
-grid 1
-joints 1
-ikHandles 1
-deformers 1
-dynamics 1
-fluids 1
-locators 1
-dimensions 1
-handles 1
-pivots 1
-textures 1
-strokes 1
-shadows 0
$editorName;
modelEditor -e -viewSelected 0 $editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextPanel "modelPanel" "Front View"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `modelPanel -unParent -l "Front View" -mbv $menusOkayInPanels `;
$editorName = $panelName;
modelEditor -e
-camera "front"
-useInteractiveMode 0
-displayLights "default"
-displayAppearance "wireframe"
-activeOnly 0
-wireframeOnShaded 0
-bufferMode "double"
-twoSidedLighting 1
-backfaceCulling 0
-xray 0
-displayTextures 0
-smoothWireframe 0
-textureAnisotropic 0
-textureHilight 1
-textureSampling 2
-textureDisplay "modulate"
-textureMaxSize 1024
-fogging 0
-fogSource "fragment"
-fogMode "linear"
-fogStart 0
-fogEnd 100
-fogDensity 0.1
-fogColor 0.5 0.5 0.5 1
-sortTransparent 1
-nurbsCurves 1
-nurbsSurfaces 1
-polymeshes 1
-subdivSurfaces 1
-planes 1
-lights 1
-cameras 1
-controlVertices 1
-hulls 1
-grid 1
-joints 1
-ikHandles 1
-deformers 1
-dynamics 1
-fluids 1
-locators 1
-dimensions 1
-handles 1
-pivots 1
-textures 1
-strokes 1
-shadows 0
$editorName;
modelEditor -e -viewSelected 0 $editorName;
}
} else {
$label = `panel -q -label $panelName`;
modelPanel -edit -l "Front View" -mbv $menusOkayInPanels $panelName;
$editorName = $panelName;
modelEditor -e
-camera "front"
-useInteractiveMode 0
-displayLights "default"
-displayAppearance "wireframe"
-activeOnly 0
-wireframeOnShaded 0
-bufferMode "double"
-twoSidedLighting 1
-backfaceCulling 0
-xray 0
-displayTextures 0
-smoothWireframe 0
-textureAnisotropic 0
-textureHilight 1
-textureSampling 2
-textureDisplay "modulate"
-textureMaxSize 1024
-fogging 0
-fogSource "fragment"
-fogMode "linear"
-fogStart 0
-fogEnd 100
-fogDensity 0.1
-fogColor 0.5 0.5 0.5 1
-sortTransparent 1
-nurbsCurves 1
-nurbsSurfaces 1
-polymeshes 1
-subdivSurfaces 1
-planes 1
-lights 1
-cameras 1
-controlVertices 1
-hulls 1
-grid 1
-joints 1
-ikHandles 1
-deformers 1
-dynamics 1
-fluids 1
-locators 1
-dimensions 1
-handles 1
-pivots 1
-textures 1
-strokes 1
-shadows 0
$editorName;
modelEditor -e -viewSelected 0 $editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextPanel "modelPanel" "Persp View"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `modelPanel -unParent -l "Persp View" -mbv $menusOkayInPanels `;
$editorName = $panelName;
modelEditor -e
-camera "persp"
-useInteractiveMode 0
-displayLights "default"
-displayAppearance "smoothShaded"
-activeOnly 0
-wireframeOnShaded 0
-bufferMode "double"
-twoSidedLighting 1
-backfaceCulling 0
-xray 0
-displayTextures 1
-smoothWireframe 0
-textureAnisotropic 0
-textureHilight 1
-textureSampling 2
-textureDisplay "modulate"
-textureMaxSize 1024
-fogging 0
-fogSource "fragment"
-fogMode "linear"
-fogStart 0
-fogEnd 100
-fogDensity 0.1
-fogColor 0.5 0.5 0.5 1
-sortTransparent 1
-nurbsCurves 1
-nurbsSurfaces 1
-polymeshes 1
-subdivSurfaces 1
-planes 1
-lights 1
-cameras 1
-controlVertices 1
-hulls 1
-grid 1
-joints 1
-ikHandles 1
-deformers 1
-dynamics 1
-fluids 1
-locators 1
-dimensions 1
-handles 1
-pivots 1
-textures 1
-strokes 1
-shadows 0
$editorName;
modelEditor -e -viewSelected 0 $editorName;
}
} else {
$label = `panel -q -label $panelName`;
modelPanel -edit -l "Persp View" -mbv $menusOkayInPanels $panelName;
$editorName = $panelName;
modelEditor -e
-camera "persp"
-useInteractiveMode 0
-displayLights "default"
-displayAppearance "smoothShaded"
-activeOnly 0
-wireframeOnShaded 0
-bufferMode "double"
-twoSidedLighting 1
-backfaceCulling 0
-xray 0
-displayTextures 1
-smoothWireframe 0
-textureAnisotropic 0
-textureHilight 1
-textureSampling 2
-textureDisplay "modulate"
-textureMaxSize 1024
-fogging 0
-fogSource "fragment"
-fogMode "linear"
-fogStart 0
-fogEnd 100
-fogDensity 0.1
-fogColor 0.5 0.5 0.5 1
-sortTransparent 1
-nurbsCurves 1
-nurbsSurfaces 1
-polymeshes 1
-subdivSurfaces 1
-planes 1
-lights 1
-cameras 1
-controlVertices 1
-hulls 1
-grid 1
-joints 1
-ikHandles 1
-deformers 1
-dynamics 1
-fluids 1
-locators 1
-dimensions 1
-handles 1
-pivots 1
-textures 1
-strokes 1
-shadows 0
$editorName;
modelEditor -e -viewSelected 0 $editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextPanel "outlinerPanel" "Outliner"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `outlinerPanel -unParent -l "Outliner" -mbv $menusOkayInPanels `;
$editorName = $panelName;
outlinerEditor -e
-mainListConnection "worldList"
-selectionConnection "modelList"
-showShapes 0
-showAttributes 0
-showConnected 0
-showAnimCurvesOnly 0
-autoExpand 0
-showDagOnly 1
-ignoreDagHierarchy 0
-expandConnections 0
-showUnitlessCurves 1
-showCompounds 1
-showLeafs 1
-showNumericAttrsOnly 0
-highlightActive 1
-autoSelectNewObjects 0
-doNotSelectNewObjects 0
-dropIsParent 1
-transmitFilters 0
-setFilter "defaultSetFilter"
-showSetMembers 1
-allowMultiSelection 1
-alwaysToggleSelect 0
-directSelect 0
-displayMode "DAG"
-expandObjects 0
-setsIgnoreFilters 1
-editAttrName 0
-showAttrValues 0
-highlightSecondary 0
-showUVAttrsOnly 0
-showTextureNodesOnly 0
-sortOrder "none"
-longNames 0
-niceNames 1
$editorName;
}
} else {
$label = `panel -q -label $panelName`;
outlinerPanel -edit -l "Outliner" -mbv $menusOkayInPanels $panelName;
$editorName = $panelName;
outlinerEditor -e
-mainListConnection "worldList"
-selectionConnection "modelList"
-showShapes 0
-showAttributes 0
-showConnected 0
-showAnimCurvesOnly 0
-autoExpand 0
-showDagOnly 1
-ignoreDagHierarchy 0
-expandConnections 0
-showUnitlessCurves 1
-showCompounds 1
-showLeafs 1
-showNumericAttrsOnly 0
-highlightActive 1
-autoSelectNewObjects 0
-doNotSelectNewObjects 0
-dropIsParent 1
-transmitFilters 0
-setFilter "defaultSetFilter"
-showSetMembers 1
-allowMultiSelection 1
-alwaysToggleSelect 0
-directSelect 0
-displayMode "DAG"
-expandObjects 0
-setsIgnoreFilters 1
-editAttrName 0
-showAttrValues 0
-highlightSecondary 0
-showUVAttrsOnly 0
-showTextureNodesOnly 0
-sortOrder "none"
-longNames 0
-niceNames 1
$editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "graphEditor" "Graph Editor"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "graphEditor" -l "Graph Editor" -mbv $menusOkayInPanels `;

$editorName = ($panelName+"OutlineEd");
outlinerEditor -e
-mainListConnection "graphEditorList"
-selectionConnection "graphEditor1FromOutliner"
-highlightConnection "keyframeList"
-showShapes 1
-showAttributes 1
-showConnected 1
-showAnimCurvesOnly 1
-autoExpand 1
-showDagOnly 0
-ignoreDagHierarchy 0
-expandConnections 1
-showUnitlessCurves 1
-showCompounds 0
-showLeafs 1
-showNumericAttrsOnly 1
-highlightActive 0
-autoSelectNewObjects 1
-doNotSelectNewObjects 0
-dropIsParent 1
-transmitFilters 1
-setFilter "0"
-showSetMembers 0
-allowMultiSelection 1
-alwaysToggleSelect 0
-directSelect 0
-displayMode "DAG"
-expandObjects 0
-setsIgnoreFilters 1
-editAttrName 0
-showAttrValues 0
-highlightSecondary 0
-showUVAttrsOnly 0
-showTextureNodesOnly 0
-sortOrder "none"
-longNames 0
-niceNames 1
$editorName;

$editorName = ($panelName+"GraphEd");
animCurveEditor -e
-mainListConnection "graphEditor1FromOutliner"
-displayKeys 1
-displayTangents 0
-displayActiveKeys 0
-displayActiveKeyTangents 1
-displayInfinities 0
-autoFit 0
-snapTime "integer"
-snapValue "none"
-showResults "off"
-showBufferCurves "off"
-smoothness "fine"
-resultSamples 1
-resultScreenSamples 0
-resultUpdate "delayed"
$editorName;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Graph Editor" -mbv $menusOkayInPanels $panelName;

$editorName = ($panelName+"OutlineEd");
outlinerEditor -e
-mainListConnection "graphEditorList"
-selectionConnection "graphEditor1FromOutliner"
-highlightConnection "keyframeList"
-showShapes 1
-showAttributes 1
-showConnected 1
-showAnimCurvesOnly 1
-autoExpand 1
-showDagOnly 0
-ignoreDagHierarchy 0
-expandConnections 1
-showUnitlessCurves 1
-showCompounds 0
-showLeafs 1
-showNumericAttrsOnly 1
-highlightActive 0
-autoSelectNewObjects 1
-doNotSelectNewObjects 0
-dropIsParent 1
-transmitFilters 1
-setFilter "0"
-showSetMembers 0
-allowMultiSelection 1
-alwaysToggleSelect 0
-directSelect 0
-displayMode "DAG"
-expandObjects 0
-setsIgnoreFilters 1
-editAttrName 0
-showAttrValues 0
-highlightSecondary 0
-showUVAttrsOnly 0
-showTextureNodesOnly 0
-sortOrder "none"
-longNames 0
-niceNames 1
$editorName;

$editorName = ($panelName+"GraphEd");
animCurveEditor -e
-mainListConnection "graphEditor1FromOutliner"
-displayKeys 1
-displayTangents 0
-displayActiveKeys 0
-displayActiveKeyTangents 1
-displayInfinities 0
-autoFit 0
-snapTime "integer"
-snapValue "none"
-showResults "off"
-showBufferCurves "off"
-smoothness "fine"
-resultSamples 1
-resultScreenSamples 0
-resultUpdate "delayed"
$editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "dopeSheetPanel" "Dope Sheet"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "dopeSheetPanel" -l "Dope Sheet" -mbv $menusOkayInPanels `;

$editorName = ($panelName+"OutlineEd");
outlinerEditor -e
-mainListConnection "animationList"
-selectionConnection "dopeSheetPanel1OutlinerSelection"
-highlightConnection "keyframeList"
-showShapes 1
-showAttributes 1
-showConnected 1
-showAnimCurvesOnly 1
-autoExpand 0
-showDagOnly 0
-ignoreDagHierarchy 0
-expandConnections 1
-showUnitlessCurves 0
-showCompounds 1
-showLeafs 1
-showNumericAttrsOnly 1
-highlightActive 0
-autoSelectNewObjects 0
-doNotSelectNewObjects 1
-dropIsParent 1
-transmitFilters 0
-setFilter "0"
-showSetMembers 0
-allowMultiSelection 1
-alwaysToggleSelect 0
-directSelect 0
-displayMode "DAG"
-expandObjects 0
-setsIgnoreFilters 1
-editAttrName 0
-showAttrValues 0
-highlightSecondary 0
-showUVAttrsOnly 0
-showTextureNodesOnly 0
-sortOrder "none"
-longNames 0
-niceNames 1
$editorName;

$editorName = ($panelName+"DopeSheetEd");
dopeSheetEditor -e
-mainListConnection "dopeSheetPanel1FromOutliner"
-highlightConnection "dopeSheetPanel1OutlinerSelection"
-displayKeys 1
-displayTangents 0
-displayActiveKeys 0
-displayActiveKeyTangents 0
-displayInfinities 0
-autoFit 0
-snapTime "integer"
-snapValue "none"
-outliner "dopeSheetPanel1OutlineEd"
-showSummary 1
-showScene 0
-hierarchyBelow 0
$editorName;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Dope Sheet" -mbv $menusOkayInPanels $panelName;

$editorName = ($panelName+"OutlineEd");
outlinerEditor -e
-mainListConnection "animationList"
-selectionConnection "dopeSheetPanel1OutlinerSelection"
-highlightConnection "keyframeList"
-showShapes 1
-showAttributes 1
-showConnected 1
-showAnimCurvesOnly 1
-autoExpand 0
-showDagOnly 0
-ignoreDagHierarchy 0
-expandConnections 1
-showUnitlessCurves 0
-showCompounds 1
-showLeafs 1
-showNumericAttrsOnly 1
-highlightActive 0
-autoSelectNewObjects 0
-doNotSelectNewObjects 1
-dropIsParent 1
-transmitFilters 0
-setFilter "0"
-showSetMembers 0
-allowMultiSelection 1
-alwaysToggleSelect 0
-directSelect 0
-displayMode "DAG"
-expandObjects 0
-setsIgnoreFilters 1
-editAttrName 0
-showAttrValues 0
-highlightSecondary 0
-showUVAttrsOnly 0
-showTextureNodesOnly 0
-sortOrder "none"
-longNames 0
-niceNames 1
$editorName;

$editorName = ($panelName+"DopeSheetEd");
dopeSheetEditor -e
-mainListConnection "dopeSheetPanel1FromOutliner"
-highlightConnection "dopeSheetPanel1OutlinerSelection"
-displayKeys 1
-displayTangents 0
-displayActiveKeys 0
-displayActiveKeyTangents 0
-displayInfinities 0
-autoFit 0
-snapTime "integer"
-snapValue "none"
-outliner "dopeSheetPanel1OutlineEd"
-showSummary 1
-showScene 0
-hierarchyBelow 0
$editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "clipEditorPanel" "Trax Editor"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "clipEditorPanel" -l "Trax Editor" -mbv $menusOkayInPanels `;

$editorName = ($panelName+"ClipEditor");
clipEditor -e
-characterOutline "clipEditorPanel1OutlineEditor"
-menuContext "track"
$editorName;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Trax Editor" -mbv $menusOkayInPanels $panelName;

$editorName = ($panelName+"ClipEditor");
clipEditor -e
-characterOutline "clipEditorPanel1OutlineEditor"
-menuContext "track"
$editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "hyperGraphPanel" "Hypergraph"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "hyperGraphPanel" -l "Hypergraph" -mbv $menusOkayInPanels `;

$editorName = ($panelName+"HyperGraphEd");
hyperGraph -e
-orientation "horiz"
-zoom 1
-animateTransition 0
-showShapes 0
-showDeformers 0
-showExpressions 0
-showConstraints 0
-showUnderworld 0
-showInvisible 0
-transitionFrames 1
-freeform 0
-imageEnabled 0
-graphType "DAG"
-updateSelection 1
-updateNodeAdded 1
$editorName;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Hypergraph" -mbv $menusOkayInPanels $panelName;

$editorName = ($panelName+"HyperGraphEd");
hyperGraph -e
-orientation "horiz"
-zoom 1
-animateTransition 0
-showShapes 0
-showDeformers 0
-showExpressions 0
-showConstraints 0
-showUnderworld 0
-showInvisible 0
-transitionFrames 1
-freeform 0
-imageEnabled 0
-graphType "DAG"
-updateSelection 1
-updateNodeAdded 1
$editorName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "hyperShadePanel" "Hypershade"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "hyperShadePanel" -l "Hypershade" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Hypershade" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "visorPanel" "Visor"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "visorPanel" -l "Visor" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Visor" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "polyTexturePlacementPanel" "UV Texture Editor"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "polyTexturePlacementPanel" -l "UV Texture Editor" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "UV Texture Editor" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "multiListerPanel" "Multilister"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "multiListerPanel" -l "Multilister" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Multilister" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "renderWindowPanel" "Render View"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "renderWindowPanel" -l "Render View" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Render View" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextPanel "blendShapePanel" "Blend Shape"`;
if ("" == $panelName) {
if ($useSceneConfig) {
blendShapePanel -unParent -l "Blend Shape" -mbv $menusOkayInPanels ;
}
} else {
$label = `panel -q -label $panelName`;
blendShapePanel -edit -l "Blend Shape" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "dynRelEdPanel" "Dynamic Relationships"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "dynRelEdPanel" -l "Dynamic Relationships" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Dynamic Relationships" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextPanel "devicePanel" "Devices"`;
if ("" == $panelName) {
if ($useSceneConfig) {
devicePanel -unParent -l "Devices" -mbv $menusOkayInPanels ;
}
} else {
$label = `panel -q -label $panelName`;
devicePanel -edit -l "Devices" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "relationshipPanel" "Relationship Editor"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "relationshipPanel" -l "Relationship Editor" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Relationship Editor" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "referenceEditorPanel" "Reference Editor"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "referenceEditorPanel" -l "Reference Editor" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Reference Editor" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "componentEditorPanel" "Component Editor"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "componentEditorPanel" -l "Component Editor" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Component Editor" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


$panelName = `sceneUIReplacement -getNextScriptedPanel "dynPaintScriptedPanelType" "Paint Effects"`;
if ("" == $panelName) {
if ($useSceneConfig) {
$panelName = `scriptedPanel -unParent -type "dynPaintScriptedPanelType" -l "Paint Effects" -mbv $menusOkayInPanels `;
}
} else {
$label = `panel -q -label $panelName`;
scriptedPanel -edit -l "Paint Effects" -mbv $menusOkayInPanels $panelName;
if (!$useSceneConfig) {
panel -e -l $label $panelName;
}
}


if ($useSceneConfig) {
string $configName = `getPanel -cwl "Current Layout"`;
if ("" != $configName) {
panelConfiguration -edit -label "Current Layout"
-defaultImage ""
-image ""
-sc false
-configString "global string $gMainPane; paneLayout -e -cn \"single\" -ps 1 100 100 $gMainPane;"
-removeAllPanels
-ap false
"Persp View"
"modelPanel"
"$panelName = `modelPanel -unParent -l \"Persp View\" -mbv $menusOkayInPanels `;\n$editorName = $panelName;\nmodelEditor -e \n -cam `findStartUpCamera persp` \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"smoothShaded\" \n -activeOnly 0\n -wireframeOnShaded 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 1\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 1024\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -locators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName"
"modelPanel -edit -l \"Persp View\" -mbv $menusOkayInPanels $panelName;\n$editorName = $panelName;\nmodelEditor -e \n -cam `findStartUpCamera persp` \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"smoothShaded\" \n -activeOnly 0\n -wireframeOnShaded 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 1\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 1024\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -locators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName"
$configName;

setNamedPanelLayout "Current Layout";
}

panelHistory -e -clear mainPanelHistory;
setFocus `paneLayout -q -p1 $gMainPane`;
sceneUIReplacement -deleteRemaining;
sceneUIReplacement -clear;
}


grid -spacing 5 -size 150 -divisions 5 -displayAxes yes -displayGridLines yes -displayDivisionLines yes -displayPerspectiveLabels no -displayOrthographicLabels no -displayAxesBold yes -perspectiveLabelPosition axis -orthographicLabelPosition edge;


This might be for this, which is supposed to be for an entirely different game:

/Dev3/drive/projects/rally/maya/WRC'04 Cars/Ford focus bp/TEXTURES/player00.tga

Beats me.

Anyways, here's something not really related to source code, but I decided to throw it in anyway. Just a directory listing:

CODE
Volume in drive H is FHD-1 Serial number is 15F6:3851
Directory of H:\projects\SonicR.Win\sonicpc_disc\ps2audio\*.vag

17/08/2004 12:56 4,864 AMY.VAG
17/08/2004 12:56 10,224 AMYSKID.VAG
17/08/2004 12:56 4,320 AMYWATER.VAG
17/08/2004 12:56 27,440 BEACH.VAG
17/08/2004 12:56 15,136 BONUS.VAG
17/08/2004 12:56 5,904 BUBBLE.VAG
17/08/2004 12:56 7,616 BUMPER1.VAG
17/08/2004 12:56 9,008 BUMPER2.VAG
17/08/2004 12:56 7,072 CHOOSE.VAG
17/08/2004 12:56 18,880 DOOR.VAG
17/08/2004 12:56 17,424 EXPLODE.VAG
17/08/2004 12:56 12,080 FIRE.VAG
17/08/2004 12:56 36,384 FLAME.VAG
17/08/2004 12:56 30,544 GETCHAOS.VAG
17/08/2004 12:56 22,048 GETTOKEN.VAG
17/08/2004 12:56 11,936 GO.VAG
17/08/2004 12:56 26,288 GOTALL.VAG
17/08/2004 12:56 4,480 HITCHAR.VAG
17/08/2004 12:56 8,496 JET.VAG
17/08/2004 12:56 6,528 JUMP.VAG
17/08/2004 12:56 16,096 PAUSE.VAG
17/08/2004 12:56 5,536 POP.VAG
17/08/2004 12:56 9,296 READY.VAG
17/08/2004 12:56 21,712 RECORD.VAG
17/08/2004 12:56 71,936 REPLAY1.VAG
17/08/2004 12:56 42,688 REPLAY2.VAG
17/08/2004 12:56 64,240 REPLAY3.VAG
17/08/2004 12:56 93,344 REPLAY4.VAG
17/08/2004 12:56 48,864 REPLAY5.VAG
17/08/2004 12:56 47,936 REPLAY6.VAG
17/08/2004 12:56 8,096 RING1.VAG
17/08/2004 12:56 3,856 RUNLEFT.VAG
17/08/2004 12:56 3,968 RUNRIGHT.VAG
17/08/2004 12:56 10,560 SELECT.VAG
17/08/2004 12:56 8,832 SET.VAG
17/08/2004 12:56 7,504 SKID1.VAG
17/08/2004 12:56 2,640 SKID2.VAG
17/08/2004 12:56 27,344 SPIN.VAG
17/08/2004 12:56 10,576 SPINGO.VAG
17/08/2004 12:56 25,984 SPINREV.VAG
17/08/2004 12:56 22,064 SPLASH.VAG
17/08/2004 12:56 16,512 SPRING.VAG
17/08/2004 12:56 19,264 TAG.VAG
17/08/2004 12:56 195,936 TAILS.VAG
17/08/2004 12:56 0 THUNDER.VAG
17/08/2004 12:56 22,448 WARP.VAG
17/08/2004 12:56 4,624 WATERRUN.VAG
1,098,528 bytes in 47 files and 0 dirs 1,966,080 bytes allocated
12,820,217,856 bytes free


It's the only listing in sonicr.dat.

I have stuff from other games but let's see what you guys can come up with...for once. :P

  • 3 Pages +
  • 1
  • 2
  • 3
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users