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