?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.         DEVICE ZXSPECTRUM48
  2.         include "../../_sdk/sys_h.asm"
  3.         org PROGSTART
  4.  
  5. module equ 0x5000
  6. player_load = 0x4000
  7.  
  8. ovl_start = 0x4000
  9.  
  10. PLR_INIT  = 0x4000
  11. PLR_PLAY  = 0x4005
  12. PLR_MUTE  = 0x4007
  13.  
  14. GLOBVARS = 0x3800
  15. LOCVARS  = 0x3900
  16. ACTMENU  = 0x3a00
  17. ILINK    = 0x3b00
  18. STK_MENU = 0x3c00
  19. STK_SUB  = 0x3d64
  20.  
  21. FONT     = 0x8000
  22.  
  23. ANIM_BFF  = 0x9000
  24. ANIM_BFFR = 0x5000        
  25.  
  26. cmd_begin
  27.     OS_HIDEFROMPARENT
  28.     ld sp,0x4000
  29.     call pre_init    
  30.  
  31.  
  32. ;----------------------------------------------------
  33.  
  34.  
  35. begin:
  36.         call disable_anim
  37.         ld a,0x13
  38.         ld (COOOR+2),a ;y coord for ingame initial text position
  39.  
  40.         ld a,(menu_mus)
  41.         call load_mus
  42.  
  43.  
  44.         ld a,0
  45. intro_switch equ $-1
  46.         and a
  47.         call z,introduction
  48.  
  49. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  50. ; load menu picture
  51.         ld hl,menu_pic
  52.         call load_big_img_dark2
  53.  
  54.         call palette_precalc
  55.         call fade_fromwhite
  56.  
  57. _main_menu:
  58.         ld hl,TABLE_W
  59.         ld (CODEPAGE),hl
  60. _main_menu_mmm:
  61.  
  62.         ld hl,loc_main_menu
  63.         ld de,menu_main_action
  64.  
  65.         push de
  66.         ld a,(language)
  67.         call sel_word
  68.        
  69.         call _pre_setup
  70.         call _pre_menu_store_bgnd
  71.         call _prt_menu
  72. _mmnu_r1        
  73.         call _sel_menu
  74.         cp 0xff
  75.         jr z,_mmnu_r1 ;block esc
  76.  
  77.         call _pre_menu_restore_bgnd
  78.  
  79.         pop hl
  80.         call sel_word
  81.         jp (hl)
  82. ;       call waitkey
  83. _gamequit
  84.         call no_mus
  85.         jp cmd_quit
  86.  
  87.  
  88. _loadgame
  89.         ld hl,loc_load_menu
  90.         ld de,menu_load_action        
  91.  
  92.         push de
  93.         ld a,(language)
  94.         call sel_word
  95.        
  96.         call _pre_setup
  97.         call _pre_menu_store_bgnd
  98.         call _prt_menu
  99.        
  100.         call _sel_menu
  101.         call _pre_menu_restore_bgnd
  102.         pop hl
  103.  
  104.         cp 0xff
  105.         jp z,_main_menu_mmm
  106.  
  107.         call sel_word
  108.         jp (hl)
  109.  
  110. _load_slot1:
  111.         ld a,1
  112.         jr _load_slot
  113. _load_slot2:
  114.         ld a,2
  115.         jr _load_slot
  116. _load_slot3:
  117.         ld a,3
  118.         jr _load_slot
  119. _load_slot4:
  120.         ld a,4
  121.         jr _load_slot
  122. _load_slot5:
  123.         ld a,5
  124. _load_slot:
  125.         add a,"0"
  126.         ld (SAVETEMPL_N),a
  127.  
  128.  
  129.         ld de,SAVETEMPL
  130.         call openstream_file
  131.         or a
  132.         jp nz,_loadgame
  133.  
  134. _load_common:
  135.  
  136.         ld hl,538 ;len
  137.         ld de,buf
  138.         call readstream_file
  139.         or a
  140.         jp nz,filereaderror
  141.  
  142.         call closestream_file
  143.  
  144.         call save_to_globals
  145.  
  146.         jr GAMESTART1   ;hl-pointer to ovl name to load.
  147.  
  148. ;------------------------------------------------
  149. _newgame:
  150. NWGAM:
  151.         xor a
  152.         LD HL,GLOBVARS
  153.         LD B,A
  154.         LD (HL),A
  155.         INC HL
  156.         DJNZ $-2
  157.         ld hl,FSTOVL
  158.  
  159. GAMESTART1        
  160.         ld de,OVL
  161.         call copystr_hlde
  162.         xor a
  163.         ld (de),a        
  164.  
  165.  
  166.  
  167.         call clear_whole_screen
  168. GAMESTART
  169.         ld hl,TABLE_J
  170.         ld (CODEPAGE),HL
  171. ;---------------------------------------------
  172.  
  173. ;---------------------------------------------
  174. ;-draw pretty border
  175.        ld hl,ingame_border
  176.         call load_gfx_to_load_buf
  177.  
  178.         ld hl,pal
  179.         ld de,temppal
  180.         ld bc,32
  181.         ldir
  182.  
  183.         ld hl,blackpal
  184.         ld de,pal
  185.         ld bc,32
  186.         ldir
  187.  
  188.         call _immed_big
  189.  
  190.         ld hl,temppal
  191.         ld de,pal
  192.         ld bc,32
  193.         ldir        
  194.  
  195.         ld a,1
  196.         ld (setpalflag),a
  197.         halt
  198.  
  199. ;---------------------------------------------
  200. BEG
  201.         ld a,0xaf ;xor a
  202.         ld (SUBLOCK),a  ; ???? hz chto eto. ne pomnu
  203.  
  204.         call disable_anim
  205.  
  206. ;;ҒɐEʠLOCVARS ƠACTMENU
  207.         xor a
  208.         ld hl,LOCVARS
  209.         ld bc,2
  210.         ld (hl),a
  211.         inc hl
  212.         djnz $-2
  213.         dec c
  214.         jr nz,$-5
  215. ;---
  216.        ld h,a
  217.        ld l,h
  218.        ld (g_curpos),hl
  219.  
  220. ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  221. ; TODO 鲯񡣨󺟡!!
  222.  ;       LD HL,#1100
  223.  ;       LD (g_atpos),HL            ;ATPOS= Y=#11 X=1
  224. ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  225.  
  226.         ld hl,OVL
  227.         call load_ovl_to_script_buf
  228.  
  229.         ;store loaded ovl name
  230.         ld hl,OVL
  231.         ld de,LOADED
  232.         ld bc,13
  233.         ldir
  234.  
  235.  
  236.         call _ftp ;search first text
  237.         push hl
  238.         call _precache
  239.        
  240.         xor a
  241.         call _get_show_scr
  242.         pop hl    
  243.  
  244. TXTOUT:
  245.         LD BC,#1300
  246.         CALL _pradd
  247.         CALL _print
  248. TXTOUT1:
  249.         call WINCLR2
  250.         call _menu
  251.         call WINCLR2
  252.  
  253. SEARCH:
  254.         LD DE,ILINK
  255.         EX DE,HL
  256. SEARCH0:
  257.         LD A,(HL)
  258.         INC HL
  259.         CP E
  260.         JR NZ,SEARCH1
  261.         LD A,(HL)
  262.         INC HL
  263.         CP D
  264.         JR NZ,SEARCH1+1
  265.         LD A,(HL)
  266.         INC HL
  267.         LD H,(HL)
  268.         LD L,A
  269.         LD A,(HL)
  270.         INC HL
  271.         LD H,(HL)
  272.         LD L,A
  273.         LD A,#40
  274.         ADD A,H
  275.         LD H,A
  276.         LD BC,4
  277.         ADD HL,BC
  278.         LD A,(HL)
  279.         INC HL,HL
  280.         LD D,HIGH LOCVARS
  281.         LD E,A
  282.         LD A,(DE)
  283.         ADD A,A
  284.         LD E,A
  285.         LD D,0
  286.         ADD HL,DE
  287.         LD A,(HL)
  288.         INC HL
  289.         LD H,(HL)
  290.         LD L,A
  291.         LD A,#40
  292.         ADD A,H
  293.         LD H,A
  294.         JP TXTOUT
  295. SEARCH1:
  296.         INC HL,HL,HL
  297.         JR SEARCH0
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.         call waitkey
  316.         jp _gamequit
  317.  
  318.  
  319.  
  320. main_end:
  321.         include "../../_sdk/file.asm"
  322.  
  323. gf_func_start:
  324.         include "gfx_func.asm"
  325. gf_func_end:
  326.  
  327. sub_func_start:
  328.         include "sub_func.asm"
  329. sub_func_end:
  330.  
  331. sub_vars_start:
  332.         include "sub_vars.asm"
  333. sub_vars_end:
  334.  
  335. sub_dsk_start:
  336.         include "sub_dsk.asm"
  337. sub_dsk_end:
  338.  
  339. sub_variables_start:
  340.         include "variables.asm"
  341. sub_variables_end:
  342.  
  343.  
  344.  
  345.  
  346. ;FONT:   incbin  "font_rus.bin"
  347.  
  348. anim_stack_cursor dw 0
  349. anim_stack_spr_num db 0
  350.  
  351. anim1_seq: db 0,1,1,1,0xfe
  352. anim2_seq: db 0,20,1,20,2,20,1,20,0,100,1,20,2,20,1,20,0,20,0xff
  353. font_buf ds 16,0
  354.         align 256
  355. PUSH_DATA:  ds 256,0  ;//wait animation
  356. anim_stack: ds 256,0
  357.  
  358. _pal_bright:
  359.         ds 32,0xff ;0 -min
  360.         ds 32,0xff ;1
  361.         ds 32,0xff ;2
  362.         ds 32,0xff ;3-to black
  363.         ds 32,0xff ;4-to white
  364.         ds 32,0xff ;5
  365.         ds 32,0xff ;6 -max
  366.         ds 32,0xff ;7 -max
  367.  
  368. ;dw sprite adress
  369. ;dw sprite scr adress
  370. ;db len
  371. ;db hgt
  372. ;db num of phases
  373. ;db seq position
  374. ;db next seq counter
  375. ;ds 7,0 placeholder
  376.  
  377. ;0x0000 EOF
  378.  
  379.  
  380. buf:            
  381.          include "buf.asm"
  382.  
  383. ;buf_ext             ds 538-(buf_ext-txt_setup),0
  384.  
  385. cmd_end:        
  386.         include "ptsplay.asm"
  387.         include "intro.eng.asm"
  388.         include "intro.rus.asm"
  389.  
  390.  
  391.  
  392.         display "main.com free space ",/d,GLOBVARS-buf," bytes"
  393.  
  394.  
  395.  
  396.         display "main.com length ",/d,main_end-cmd_begin," bytes"
  397.         display "gf_func length ",/d,gf_func_end-gf_func_start," bytes"
  398.         display "sub_func length ",/d,sub_func_end-sub_func_start," bytes"
  399.         display "sub_vars length ",/d,sub_vars_end-sub_vars_start," bytes"
  400.         display "sub_dsk length ",/d,sub_dsk_end-sub_dsk_start," bytes"
  401.         display "sub_variables length ",/d,sub_variables_end-sub_variables_start," bytes"
  402.  
  403.         display "buf length",/d,cmd_end-buf," bytes"
  404.  
  405.  
  406.         savebin "SS-zx.com",cmd_begin,cmd_end-cmd_begin
  407.         savebin "aym_plr.bin",ptsbegin,ptsend-ptsbegin
  408.         savebin "intro.eng.OVL",introengbegin,introengend-introengbegin
  409.         savebin "intro.rus.OVL",introrusbegin,introrusend-introrusbegin
  410.         LABELSLIST "..\..\..\us\user.l"
  411.