Create proper save file on all disks. Updated memory map.

This commit is contained in:
Martin Haye 2017-01-12 07:30:54 -08:00
parent 99f9f9f35c
commit 4b9f2c9a85
2 changed files with 60 additions and 33 deletions

View File

@ -1820,10 +1820,9 @@ class A2PackPartitions
}
// Ready to write the output file.
println "Writing output file."
println "Writing output files."
new File("build/root").mkdir()
def part1Path = new File("build/root/game.part.1.bin").path
new File(part1Path).withOutputStream { stream -> writePartition(stream, 1) }
@ -2604,8 +2603,27 @@ end
}
}
def copyOrCreateSave(dstDir)
{
def prevSave = new File("build/prevGame/game.1.save.\$f1")
def newSave = new File("${dstDir}/game.1.save.\$f1")
if (prevSave.exists()) {
copyIfNewer(prevSave, newSave)
}
else {
// Create empty save file
newSave.withOutputStream { outStream ->
(0..3071).each {
outStream.write( (byte) 0)
}
}
}
}
def createHddImage()
{
println "Creating hdd image."
// Copy the combined core executable to the output directory
copyIfNewer(new File("build/src/core/build/LEGENDOS.SYSTEM.sys#2000"),
new File("build/root/LEGENDOS.SYSTEM.sys#2000"))
@ -2614,9 +2632,7 @@ end
new File("build/root/PROBOOT.sys#800"))
// If we preserved a previous save game, copy it to the new image.
def prevSave = new File("build/prevGame/game.1.save.\$f1")
if (prevSave.exists())
copyIfNewer(prevSave, new File("build/root/game.1.save.\$f1"))
copyOrCreateSave("build/root")
// Decompress the base image.
// No need to delete old file; that was done by outer-level code.
@ -2630,6 +2646,9 @@ end
def createFloppyImages()
{
println "Creating floppy images."
// We'll be copying stuff from the hdd directory
def hddDir = new File("build/root")
// Build a DSK image for each floppy
@ -2643,8 +2662,11 @@ end
// Copy files.
def rootDir = new File("build/root$i")
rootDir.mkdir()
if (i == 1)
if (i == 1) {
copyIfNewer(new File(hddDir, "LEGENDOS.SYSTEM.sys#2000"), new File(rootDir, "LEGENDOS.SYSTEM.sys#2000"))
copyOrCreateSave("build/root$i")
}
copyIfNewer(new File(hddDir, "game.part.${i}.bin"), new File(rootDir, "game.part.${i}.bin"))
// Unzip a fresh empty disk image

View File

@ -46,36 +46,41 @@
;
; MAIN 64K MEMORY
; :::::::::::::::
; 0000.01FF 6502 zero page and stack
; 0200.03FF input buffer, misc vecs
; 0400.07FF text screen (used for debugging)
; 0800.0Dxx memory manager
; 0Exx.0Fxx PLASMA locals storage
; 10xx.18xx gameloop asm, data and stubs
; 19xx.1FFF (free)
; 2000.3FFF hi-res page 1
; 4000.4FFF hi-res page 2 /
; memory manager work space
; 6000.6xxx 2D or 3D renderer
; 7xxx.BFFF (free)
; C000.CFFF I/O
; D000.DFFF bank 1: memory manager and decompressor
; bank 2: PLASMA runtime
; E000.EBFF small-object heap
; EC00.FAFF font engine
; FB00.FFF9 font data
; FFFA.FFFF 6502 vectors
; 0000.01FF 6502 zero page and stack
; 0200.03FF input buffer, misc vecs
; 0400.07FF text screen (used for debugging)
; 0800.0Dxx memory manager part 1
; 0Exx.0Fxx PLASMA locals storage
; 10xx.18xx gameloop asm, data and stubs
; 19xx.1FFF (free)
; 2000.3FFF hi-res page 1
; 4000.5FFF hi-res page 2 /
; memory manager work space
; 6000.6xxx 2D or 3D renderer
; 7xxx.BFFF (free)
; C000.CFFF I/O
; (bank 1) D000.DEFF memory manager part 2
; (bank 1) DF00.DFFF decompressor
; (bank 2) D000.D9FF PLASMA runtime
; (bank 2) DA00.DFFF (unused)
; E000.EBFF small-object heap
; EC00.FAFF font engine
; FB00.FFF9 font data
; FFFA.FFFF 6502 vectors
;
; AUX 64K MEMORY
; ::::::::::::::
; 0000.01FF 6502 zero page and stack
; 0200.2xxx expander (if 3D map is running)
; 3000.9xxx (free)
; Axxx.BFFF gameloop PLASMA code (loaded as high as possible)
; C000.CFFF I/O
; D000.DFFF bank 1: ProRWTS runtime (Note: D900.DFFF free)
; bank 2: part of expander
; E000.FFF9 (free)
; 0000.01FF 6502 zero page and stack
; 0200.03FF (currently unused)
; 0400.07FF (unused, but screen holes overwritten by hard-disk C7xx ROM)
; 0800.2xxx expander part 1 (if 3D map is running)
; 3000.9xxx (free)
; Axxx.BFFF gameloop PLASMA code (loaded as high as possible)
; C000.CFFF I/O
; (bank 1) D000.DAFF ProRWTS runtime
; (bank 1) DB00.DFFF (unused)
; (bank 2) D000.DFFF expander part 2
; E000.FFF9 (free)
; FFFA.FFFF 6502 vectors
;
; ----------------------------