Guest User

Untitled

a guest
Jan 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         ; same init stuff the kernel calls after reset
  2.         ldx #0
  3.         stx $d016
  4.         jsr $ff84   ; Initialise I/O
  5.  
  6.         jsr init_system_constants_light ; faster replacement for $ff87
  7.         jsr $ff8a   ; Restore Kernal Vectors
  8.         jsr $ff81   ; Initialize screen editor
  9.  
  10.  
  11. ...
  12.  
  13. ; ------------------------------------------------------------------------
  14. ; faster replacement for $ff87
  15. init_system_constants_light:
  16.         ; from KERNAL @ FD50:
  17.         lda #$00
  18.         tay
  19. :
  20.         sta $0002,y
  21.         sta $0200,y
  22.         sta $0300,y
  23.         iny
  24.         bne :-
  25.         ldx #$3c
  26.         ldy #$03
  27.         stx $b2
  28.         sty $b3
  29.         tay
  30.  
  31.         ; result from loop KERNAL @ FD6C:
  32.         lda #$00
  33.         sta $c1
  34.         sta $0283
  35.         lda #$a0
  36.         sta $c2
  37.         sta $0284
  38.  
  39.         ; from KERNAL @ FD90:
  40.         lda #$08
  41.         sta $0282       ; pointer: bottom of memory for operating system
  42.         lda #$04
  43.         sta $0288       ; high byte of screen memory address
  44.         rts
Add Comment
Please, Sign In to add comment