Class: Badline::KernalTrap::Save

Inherits:
File
  • Object
show all
Defined in:
lib/badline/kernal_trap/save.rb

Overview

PC trap on the KERNAL serial SAVE routine ($F5ED, the default ISAVE vector target). Writes device 8 saves to a storage backend as a PRG (load address followed by the memory range); other devices fall through to the ROM.

Constant Summary collapse

ADDRESS =
0xf5ed

Constants inherited from File

File::DEVICE, File::MISSING_FILENAME

Instance Method Summary collapse

Methods inherited from File

#initialize

Methods included from IntegerHelper

#bcd, #bcd_to_i, #format16, #format8, #high_byte, #low_byte, #signed_int8, #uint16

Constructor Details

This class inherits a constructor from Badline::KernalTrap::File

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/badline/kernal_trap/save.rb', line 12

def call
  return unless active?

  name = filename
  if name.empty?
    error(MISSING_FILENAME)
  else
    @storage.write_file(name, payload)
    finish
  end
  return_to_caller
end