mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2024-06-04 05:29:30 +00:00
add box art support
This commit is contained in:
parent
bcddcf107f
commit
19a511e44f
32
Makefile
32
Makefile
|
@ -9,7 +9,7 @@
|
|||
# adapted by 4am on 2018-01-07
|
||||
#
|
||||
|
||||
DISK=PitchDark.2mg
|
||||
DISK=Pitch Dark.2mg
|
||||
|
||||
# third-party tools required to build
|
||||
# https://sourceforge.net/projects/acme-crossass/
|
||||
|
@ -34,24 +34,28 @@ asm: md
|
|||
$(ACME) src/onbeyond/z5u/z5u.s
|
||||
|
||||
dsk: md asm
|
||||
cp res/"Pitch Dark.master games collection.do.not.edit.2mg" build/$(DISK)
|
||||
cp res/"Pitch Dark.master games collection.do.not.edit.2mg" build/"$(DISK)"
|
||||
cp res/WEEGUI build/
|
||||
cp res/_FileInformation.txt build/
|
||||
$(CADIUS) ADDFILE build/$(DISK) "/PITCH.DARK/" "build/GRUE.SYSTEM"
|
||||
$(CADIUS) ADDFILE build/$(DISK) "/PITCH.DARK/" "build/PITCH.DARK"
|
||||
$(CADIUS) ADDFILE build/$(DISK) "/PITCH.DARK/" "build/WEEGUI"
|
||||
$(CADIUS) ADDFILE build/$(DISK) "/PITCH.DARK/" "build/ONBEYOND.SYSTEM"
|
||||
$(CADIUS) ADDFILE build/$(DISK) "/PITCH.DARK/" "build/ONBEYONDZ3"
|
||||
$(CADIUS) ADDFILE build/$(DISK) "/PITCH.DARK/" "build/ONBEYONDZ4"
|
||||
$(CADIUS) ADDFILE build/$(DISK) "/PITCH.DARK/" "build/ONBEYONDZ5"
|
||||
$(CADIUS) ADDFILE build/$(DISK) "/PITCH.DARK/" "build/ONBEYONDZ5U"
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/PITCH.DARK/" "build/GRUE.SYSTEM"
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/PITCH.DARK/" "build/PITCH.DARK"
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/PITCH.DARK/" "build/WEEGUI"
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/PITCH.DARK/" "build/ONBEYOND.SYSTEM"
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/PITCH.DARK/" "build/ONBEYONDZ3"
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/PITCH.DARK/" "build/ONBEYONDZ4"
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/PITCH.DARK/" "build/ONBEYONDZ5"
|
||||
$(CADIUS) ADDFILE build/"$(DISK)" "/PITCH.DARK/" "build/ONBEYONDZ5U"
|
||||
|
||||
txt: md dsk
|
||||
txt: dsk
|
||||
mkdir -p build/text
|
||||
$(PY3) bin/textnormalize.py text/*
|
||||
cd build && $(CADIUS) ADDFOLDER $(DISK) "/PITCH.DARK/TEXT" text
|
||||
cd build && $(CADIUS) ADDFOLDER "$(DISK)" "/PITCH.DARK/TEXT" text
|
||||
|
||||
artwork: dsk
|
||||
rsync -a res/artwork build/
|
||||
cd build && $(CADIUS) ADDFOLDER "$(DISK)" "/PITCH.DARK/ARTWORK" artwork
|
||||
|
||||
mount: dsk
|
||||
osascript bin/V2Make.scpt "`pwd`" bin/pitchdark.vii build/$(DISK)
|
||||
osascript bin/V2Make.scpt "`pwd`" bin/pitchdark.vii build/"$(DISK)"
|
||||
|
||||
all: clean asm dsk txt mount
|
||||
all: clean asm dsk txt artwork mount
|
||||
|
|
BIN
bin/V2Make.scpt
BIN
bin/V2Make.scpt
Binary file not shown.
|
@ -1,8 +1,8 @@
|
|||
GRUE.SYSTEM=Type(FF),AuxType(2000),VersionCreate(70),MinVersion(BE),Access(C3)
|
||||
PITCH.DARK=Type(06),AuxType(6000),VersionCreate(70),MinVersion(BE),Access(C3)
|
||||
ONBEYOND.SYSTEM=Type(FF),AuxType(2000),VersionCreate(70),MinVersion(BE),Access(C3)
|
||||
ONBEYONDZ3=Type(06),AuxType(3000),VersionCreate(70),MinVersion(BE),Access(C3)
|
||||
ONBEYONDZ4=Type(06),AuxType(3000),VersionCreate(70),MinVersion(BE),Access(C3)
|
||||
ONBEYONDZ5=Type(06),AuxType(3000),VersionCreate(70),MinVersion(BE),Access(C3)
|
||||
ONBEYONDZ5U=Type(06),AuxType(3000),VersionCreate(70),MinVersion(BE),Access(C3)
|
||||
WEEGUI=Type(06),AuxType(4000),VersionCreate(70),MinVersion(BE),Access(C3)
|
||||
GRUE.SYSTEM=Type(FF),AuxType(2000),Access(C3)
|
||||
PITCH.DARK=Type(06),AuxType(6000),Access(C3)
|
||||
ONBEYOND.SYSTEM=Type(FF),AuxType(2000),Access(C3)
|
||||
ONBEYONDZ3=Type(06),AuxType(3000),Access(C3)
|
||||
ONBEYONDZ4=Type(06),AuxType(3000),Access(C3)
|
||||
ONBEYONDZ5=Type(06),AuxType(3000),Access(C3)
|
||||
ONBEYONDZ5U=Type(06),AuxType(3000),Access(C3)
|
||||
WEEGUI=Type(06),AuxType(4000),Access(C3)
|
||||
|
|
15
res/artwork/_FileInformation.txt
Normal file
15
res/artwork/_FileInformation.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
BALLYHOO=Type(06),AuxType(2000),Access(C3)
|
||||
CUTTHROATS=Type(06),AuxType(2000),Access(C3)
|
||||
HGTTG=Type(06),AuxType(2000),Access(C3)
|
||||
HOLLYWOOD=Type(06),AuxType(2000),Access(C3)
|
||||
INFIDEL=Type(06),AuxType(2000),Access(C3)
|
||||
LURKING.HORROR=Type(06),AuxType(2000),Access(C3)
|
||||
MOONMIST=Type(06),AuxType(2000),Access(C3)
|
||||
PLANETFALL=Type(06),AuxType(2000),Access(C3)
|
||||
PLUNDERED=Type(06),AuxType(2000),Access(C3)
|
||||
SEASTALKER=Type(06),AuxType(2000),Access(C3)
|
||||
SUSPECT=Type(06),AuxType(2000),Access(C3)
|
||||
SUSPENDED=Type(06),AuxType(2000),Access(C3)
|
||||
WISHBRINGER=Type(06),AuxType(2000),Access(C3)
|
||||
ZORK.I=Type(06),AuxType(2000),Access(C3)
|
||||
ZORK.II=Type(06),AuxType(2000),Access(C3)
|
59
src/action.a
59
src/action.a
|
@ -12,8 +12,13 @@
|
|||
|
||||
!zone {
|
||||
kGameRootDirectory ; length-prefixed pathname of where game subdirectories are stored
|
||||
!byte 14
|
||||
!raw "/PITCH.DARK/Z/" ; TODO use relative path ('Z/') for final release
|
||||
!byte 2
|
||||
!raw "Z/"
|
||||
kArtworkRootDirectory ; length-prefixed pathname of DHGR box art
|
||||
!byte 8
|
||||
!raw "ARTWORK/"
|
||||
|
||||
; action keys for main screen (should correspond to button titles in paint.a)
|
||||
.keys
|
||||
!byte $D0,ID_PLAY ; P
|
||||
!byte $F0,ID_PLAY ; p
|
||||
|
@ -37,6 +42,8 @@ ID_SCROLLDOWN = $82
|
|||
!byte $8A,ID_SCROLLDOWN ; down arrow
|
||||
.endkeys
|
||||
|
||||
BELL = $FF3A
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; HandleKey
|
||||
; handle keypress to activate various UI elements
|
||||
|
@ -84,9 +91,11 @@ HandleKey
|
|||
jsr WeeGUI
|
||||
ldx #WGViewUnfocus
|
||||
jmp WeeGUI
|
||||
}
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
!zone {
|
||||
callback_previous
|
||||
lda gCurrentGame
|
||||
dec
|
||||
|
@ -104,15 +113,53 @@ callback_next
|
|||
.loadNewGameInfoAndRepaint
|
||||
jsr LoadGameInfo
|
||||
jmp RepaintSomeViews
|
||||
|
||||
callback_play
|
||||
jmp LaunchInterpreter
|
||||
}
|
||||
|
||||
callback_clues
|
||||
callback_boxart
|
||||
rts
|
||||
callback_options
|
||||
rts
|
||||
|
||||
!zone {
|
||||
callback_boxart
|
||||
jsr ResetPath
|
||||
lda #<kArtworkRootDirectory
|
||||
ldy #>kArtworkRootDirectory
|
||||
jsr AddToPath
|
||||
lda gCurrentGame
|
||||
asl
|
||||
tax
|
||||
lda GAMES, x
|
||||
ldy GAMES+1, x
|
||||
jsr AddToPath
|
||||
|
||||
jsr LoadDHRFile
|
||||
!word gPathname
|
||||
!word kProDOSFileBuffer
|
||||
bcs .nope
|
||||
|
||||
sta $C000 ; display double hi-res page 1
|
||||
sta $C00D
|
||||
sta $C05E
|
||||
sta $C057
|
||||
sta $C052
|
||||
sta $C054
|
||||
sta $C050
|
||||
|
||||
bit $c010
|
||||
- lda $c000
|
||||
bpl -
|
||||
bit $c010
|
||||
|
||||
sta $C001 ; back to text
|
||||
sta $C051
|
||||
rts
|
||||
.nope
|
||||
jmp BELL
|
||||
}
|
||||
|
||||
!zone {
|
||||
callback_play
|
||||
LaunchInterpreter
|
||||
jsr SaveGlobalPreferences
|
||||
jsr ResetPath
|
||||
|
|
|
@ -47,6 +47,7 @@ Start
|
|||
jsr LoadGlobalPreferences ; get current game
|
||||
jsr LoadGameInfo ; load and parse game description text
|
||||
|
||||
Restart
|
||||
jsr CreateViews ; create all WeeGUI views (UI elements)
|
||||
ldx #WGClearScreen ; clear screen
|
||||
jsr WeeGUI
|
||||
|
|
83
src/prodos.a
83
src/prodos.a
|
@ -5,6 +5,7 @@
|
|||
;
|
||||
; Public functions
|
||||
; - LoadFile
|
||||
; - LoadDHRFile
|
||||
; - SaveFile
|
||||
; - SetPrefix
|
||||
; - QuitToProDOS
|
||||
|
@ -31,7 +32,6 @@ PC_WRITE = $04
|
|||
PC_CLOSE = $01
|
||||
|
||||
PRODOSMLI = $BF00 ; [callable] MLI entry point
|
||||
MACHID = $BF98
|
||||
|
||||
;-------------------------------
|
||||
; LoadFile
|
||||
|
@ -106,6 +106,87 @@ LoadFile
|
|||
rts
|
||||
}
|
||||
|
||||
;-------------------------------
|
||||
; LoadDHRFile
|
||||
; load uncompressed DHR file into memory from .A2FC file
|
||||
; 1. load first half ($2000 bytes)
|
||||
; 2. copy to auxmem
|
||||
; 3. load second half ($2000 bytes)
|
||||
;
|
||||
; always loads into graphics page 1 ($2000/main and $2000/aux)
|
||||
;
|
||||
; in: stack contains 4 bytes of parameters:
|
||||
; +1 address of pathname
|
||||
; +3 address of ProDOS file buffer
|
||||
; out: if C set, load failed
|
||||
; if C clear, load succeeded
|
||||
; all other flags clobbered
|
||||
; all registers clobbered
|
||||
; stack set to next instruction after parameters
|
||||
;-------------------------------
|
||||
!zone {
|
||||
LoadDHRFile
|
||||
pla
|
||||
sta $00
|
||||
plx
|
||||
stx $01
|
||||
lda #$04
|
||||
clc
|
||||
adc $00
|
||||
bcc +
|
||||
inx
|
||||
+ phx
|
||||
pha
|
||||
|
||||
ldy #$04
|
||||
- lda ($00),y
|
||||
sta mliparam,y
|
||||
dey
|
||||
bne -
|
||||
|
||||
jsr _openfile
|
||||
bcs .exit ; C set on error
|
||||
sta .saverefnum+1 ; store file refnum
|
||||
|
||||
ldy #$20
|
||||
stz mliparam+2 ; read into $2000
|
||||
sty mliparam+3
|
||||
stz mliparam+4 ; max $2000 bytes
|
||||
sty mliparam+5
|
||||
|
||||
jsr _readfile
|
||||
bcs .close
|
||||
|
||||
sta $C000
|
||||
ldx #$20 ; copy $2000 bytes to auxmem
|
||||
stx .copya+2
|
||||
stx .copyb+2
|
||||
ldy #$00
|
||||
.writeToAux
|
||||
sta $C005
|
||||
.copya lda $FF00, y
|
||||
.copyb sta $FF00, y
|
||||
iny
|
||||
bne .copya
|
||||
sta $C004
|
||||
inc .copya+2
|
||||
inc .copyb+2
|
||||
dex
|
||||
bne .writeToAux
|
||||
|
||||
lda .saverefnum+1
|
||||
jsr _readfile
|
||||
|
||||
.close
|
||||
php ; save flags from readfile
|
||||
.saverefnum
|
||||
lda #$d1 ; file refnum (set above)
|
||||
jsr _closefile
|
||||
plp ; restore flags from readfile
|
||||
.exit
|
||||
rts
|
||||
}
|
||||
|
||||
;-------------------------------
|
||||
; SaveFile
|
||||
; save a file to disk all at once, using ProDOS MLI calls
|
||||
|
|
Loading…
Reference in New Issue
Block a user