Subversion Repositories NedoOS

Rev

Rev 555 | Rev 825 | 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=#4100
  18.         ld a,(cmdpgscreen0_0)
  19.         sub 4-1 ;ld a,#ff-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,#ff-1
  28.         SETPG32KLOW
  29.         inc a ;ld a,#ff-0
  30.         SETPG32KHIGH
  31.  
  32.         ;call loadhobeta
  33.         ;ret nz ;error
  34.         ;ld hl,#6000
  35.         ;ld bc,(#6000-17+11) ;len
  36.         ;add hl,bc
  37.         ;dec hl ;hl=load end
  38.         ;ex de,hl
  39.         ;ld hl,(#6000-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,#7f-5
  57.         ld bc,#bff7
  58.         out (c),a
  59.         ld a,#7f-4
  60.         ld bc,#fff7
  61.         out (c),a
  62.         ld hl,#c000
  63.         ld de,#8000
  64.         ld bc,#4000
  65.         ldir ;pg4 -> pg5
  66.         ld a,#7f-8;pgtrdosfs
  67.         ld bc,#fff7
  68.         out (c),a
  69.         ld hl,#1c00+#c000
  70.         ld de,#1c00+#8000
  71.         ld bc,#400
  72.         ldir ;restore sysvars
  73.         ld a,#7f-2
  74.         ld bc,#bff7
  75.         out (c),a
  76.         ld a,#7f-1
  77.         ld bc,#fff7
  78.         out (c),a
  79.         ld hl,#c000
  80.         ld de,#8000
  81.         ld bc,#4000
  82.         ldir ;pg1 -> pg2
  83.         ld a,#7f-0+#80
  84.         ld bc,#fff7
  85.         out (c),a
  86.         ld a,#00
  87.         ld bc,#7ffd
  88.         out (c),a
  89.         ld a,#81 ;128 basic (with 7ffd)
  90.         ld bc,#3ff7
  91.         out (c),a
  92.         ld a,#7f-5
  93.         ld bc,#7ff7
  94.         out (c),a
  95. ;128: pages 128/DOS,5,2,0(7ffd)
  96.         ld a,#10
  97.         ld bc,#7ffd
  98.         out (c),a
  99. ;48: pages 2,4,4,4
  100.         ld a,#7f-5
  101.         ld bc,#7ff7
  102.         out (c),a
  103.         ld a,#7f-2
  104.         ld bc,#bff7
  105.         out (c),a
  106.         ld a,#7f-0+#80
  107.         ld bc,#fff7
  108.         out (c),a
  109.         ld a,#83 ;48 basic switchable to DOS
  110.         ld bc,#3ff7
  111.         out (c),a
  112. ;48: pages 48/DOS,5,2,0(7ffd)
  113.        
  114.         LD A,%10101011 ;6912
  115.         ld bc,#ff77 ;shadow ports off, palette off
  116.         out (c),a
  117.         ld sp,#6000
  118.         ei
  119.          ld a,0
  120.          ld bc,#7ffd
  121.          out (c),a ;for 128 basic (проверено, работает, 48 тоже работает)
  122. hobetarunner_jp=$+1
  123.         jp 0;#6000
  124.         ent
  125. hobetarunner_sz=$-washobetarunner
  126.  
  127. cmd_end
  128.  
  129.         display "Size ",/d,cmd_end-cmd_begin," bytes"
  130.  
  131.         savebin "reset.com",cmd_begin,cmd_end-cmd_begin
  132.        
  133.         ;LABELSLIST "../us/user.l"
  134.