Subversion Repositories NedoOS

Rev

Rev 825 | Rev 1075 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download

  1.         DEVICE ZXSPECTRUM128
  2.         include "../_sdk/sys_h.asm"
  3.  
  4.         org PROGSTART
  5. cmd_begin
  6.         ld sp,0x4000
  7.        
  8.         ld e,3 ;6912
  9.         OS_SETGFX ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode)
  10.         YIELD ;set palette
  11.  
  12.         ;OS_GETSCREENPAGES
  13. ;de=pages of screen 0 (d=higher page), hl=pages of screen 1 (h=higher page)
  14.         ld a,(user_scr0_low) ;ok
  15.         ld (cmdpgscreen0_0),a
  16.  
  17. hobetarunner=0x4100
  18.         ld a,(cmdpgscreen0_0)
  19.         sub 4-1 ;ld a,0xff-4 ;pgkillable
  20.         SETPG16K
  21.  
  22.         ld hl,washobetarunner
  23.         ld de,hobetarunner
  24.         ld bc,hobetarunner_sz
  25.         ldir
  26. cmdpgscreen0_0=$+1
  27.         ld a,0xff-1
  28.         SETPG32KLOW
  29.         inc a ;ld a,0xff-0
  30.         SETPG32KHIGH
  31.  
  32.         ;call loadhobeta
  33.         ;ret nz ;error
  34.         ;ld hl,0x6000
  35.         ;ld bc,(0x6000-17+11) ;len
  36.         ;add hl,bc
  37.         ;dec hl ;hl=load end
  38.         ;ex de,hl
  39.         ;ld hl,(0x6000-17+9) ;start
  40.         ;ld (hobetarunner_jp),hl
  41.         ;add hl,bc
  42.         ;dec hl
  43.         ;ex de,hl ;de=destination end
  44.         ;lddr
  45.         jp hobetarunner
  46.  
  47. washobetarunner
  48. ;pgsys=pagexor-10
  49. ;pgfatfs=pagexor-9
  50. ;pgtrdosfs=pagexor-8
  51. ;pgkillable=pagexor-4 ;в 128K памяти, т.к. можно портить
  52.         disp hobetarunner ;in pgkillable
  53. ;$c loaded in pages 4,1,0
  54. ;only ATM2 ports here!
  55.         di
  56.         ld a,0x7f-5
  57.         ld bc,0xbff7
  58.         out (c),a
  59.         ld a,0x7f-4
  60.         ld bc,0xfff7
  61.         out (c),a
  62.         ld hl,0xc000
  63.         ld de,0x8000
  64.         ld bc,0x4000
  65.         ldir ;pg4 -> pg5
  66.         ld a,0x7f-8;pgtrdosfs
  67.         ld bc,0xfff7
  68.         out (c),a
  69.         ld hl,0x1c00+0xc000
  70.         ld de,0x1c00+0x8000
  71.         ld bc,0x400
  72.         ldir ;restore sysvars
  73.         ld a,0x7f-2
  74.         ld bc,0xbff7
  75.         out (c),a
  76.         ld a,0x7f-1
  77.         ld bc,0xfff7
  78.         out (c),a
  79.         ld hl,0xc000
  80.         ld de,0x8000
  81.         ld bc,0x4000
  82.         ldir ;pg1 -> pg2
  83.         ld a,0x7f-0+0x80
  84.         ld bc,0xfff7
  85.         out (c),a
  86.         ld a,0x00
  87.         ld bc,0x7ffd
  88.         out (c),a
  89.         ld a,0x01 ;128 basic (with 7ffd)
  90.         ld bc,0x3ff7
  91.         out (c),a
  92.         ld a,0x7f-5
  93.         ld bc,0x7ff7
  94.         out (c),a
  95. ;128: pages 128/DOS,5,2,0(7ffd)
  96.         ld a,0x10
  97.         ld bc,0x7ffd
  98.         out (c),a
  99. ;48: pages 2,4,4,4
  100.         ld a,0x7f-5
  101.         ld bc,0x7ff7
  102.         out (c),a
  103.         ld a,0x7f-2
  104.         ld bc,0xbff7
  105.         out (c),a
  106.         ld a,0x7f-0+0x80
  107.         ld bc,0xfff7
  108.         out (c),a
  109.         ld a,0x83 ;48 basic switchable to DOS
  110.         ld bc,0x3ff7
  111.         out (c),a
  112. ;48: pages 48/DOS,5,2,0(7ffd)
  113.        
  114.         LD A,%10101011 ;6912
  115.         ld bc,0xff77 ;shadow ports off, palette off
  116.         out (c),a
  117.         ld sp,0x6000
  118.    
  119.    
  120.     ld a,0x10
  121.     ld bc,0x7ffd
  122.     out (c),a ;for 128 basic (проверено, работает, 48 тоже работает)
  123.     ld a,(0x3CBC)
  124.     cp 0x87
  125.     call z,0x3C9E   ;переключить в vtrdos
  126.     ld bc,0x0001    ;хотресет втрдоса, на всякий случай, может и ненадо
  127.     call 0x3D42
  128.     ld bc,0x0001    ;хотресет втрдоса, на всякий случай, может и ненадо
  129.     call 0x3D42
  130.    
  131.    
  132.          ld a,0
  133.          ld bc,0x7ffd
  134.          out (c),a ;for 128 basic (проверено, работает, 48 тоже работает)
  135.         ei
  136. hobetarunner_jp=$+1
  137.         jp 0;0x6000
  138.         ent
  139. hobetarunner_sz=$-washobetarunner
  140.  
  141. cmd_end
  142.  
  143.         display "Size ",/d,cmd_end-cmd_begin," bytes"
  144.  
  145.         savebin "reset.com",cmd_begin,cmd_end-cmd_begin
  146.        
  147.         ;LABELSLIST "../us/user.l"
  148.