Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *************************
- * 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement