[WHDLoad] ElectroMAN v1.0b1 #1

Open
tomekwojcik wants to merge 2 commits from whload_electroman into master
13 changed files with 627 additions and 0 deletions

View File

@ -1,6 +1,7 @@
root = true root = true
[*] [*]
charset = latin1
end_of_line = lf end_of_line = lf
[{Makefile}] [{Makefile}]
@ -10,3 +11,6 @@ tab_size = 4
[{*.c,*.h}] [{*.c,*.h}]
indent_style = space indent_style = space
tab_size = 4 tab_size = 4
[{LICENSE,README.md}]
charset = utf-8

View File

@ -0,0 +1,16 @@
root = true
[*]
charset = latin1
end_of_line = lf
[{Makefile}]
indent_style = tab
tab_size = 4
[{*.s}]
indent_style = space
tab_size = 4
[{README.md}]
charset = utf-8

13
WHDLoad/ElectroMAN/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
data/DAT/
data/L0/
data/L1/
data/L2/
data/L3/
data/L4/
data/L5/
data/L6/
data/L7/
data/L8/
data/SFX/
data/ElectroMan.exu*
ElectroMAN.slave

BIN
WHDLoad/ElectroMAN/ElectroMAN.inf Executable file

Binary file not shown.

327
WHDLoad/ElectroMAN/Install Executable file
View File

@ -0,0 +1,327 @@
(set #sub-dir "data") ;name of the sub-directory if any
(set #readme-file "ReadMe") ;name of readme file
(set #man-file "Manual") ;name of manual file
(set #hint-file "Hints") ;name of hint file
(set #sol-file "Solution") ;name of solution file
(set #highs-file "highs") ;name of high scores file
(set #exename "") ;name of executable program
(set #prefix "ElectroMAN")
;----------------------------
; copy file including icon if exist
; #copy-file - name of file to copy
(procedure P_CopyFile
(if
(exists #copy-file)
(
(copyfiles
(help @copyfiles-help)
(source #copy-file)
(dest #dest)
)
(if
(exists ("%s.info" #copy-file))
(
(copyfiles
(help @copyfiles-help)
(source ("%s.info" #copy-file))
(dest #dest)
)
(tooltype
(dest (tackon #dest #copy-file))
(noposition)
)
)
)
)
)
)
;****************************
;----------------------------
; checks if given program is installed, if not abort install
; #program - to check
(procedure P_ChkRun
(if
(= 0 (run ("cd SYS:\nWhich %s" #program)))
("")
(abort
(cat
"You must install \"" #program "\" first!\n"
"It must be accessible via the path.\n"
"You can find it in the WHDLoad package."
)
)
)
)
;----------------------------
; Wait for inserting disk
; IN: #AD_disk - name of disk
; OUT: -
(procedure P_disk
(askdisk
(dest #AD_disk)
(prompt ("\nInsert Disk \"%s\" in any drive!" #AD_disk))
(help @askdisk-help)
)
)
(procedure P_InstallDisk
(P_disk)
(copyfiles
(help @copyfiles-help)
(source ("%s:" #AD_disk))
(dest #dest)
(all)
)
)
(procedure P_Install
(set #AD_disk "ELECTROMAN")
(P_InstallDisk)
(set #AD_disk "SOUNDDATA")
(P_InstallDisk)
)
;****************************
(if
(< @installer-version (+ (* 44 65536) 10))
(
(message
(cat
"Warning: your installer is outdated.\n"
"All features of this installation won't be available, such as icon show and drawer opening.\n"
"You have version " (/ @installer-version 65536) "."
(BITAND @installer-version 65535) ", needed is at least version 44.10. "
"The 'installer' 44.10 comes with OS 3.5 but is also contained in the NDK 3.9. "
"You may also use the InstallerNG by Jens Tröger."
"\n\n"
"The installers can be obtained from the net:\n"
"http://www.amiga.com/3.9/download/NDK3.9.lha\n"
"aminet:util/sys/InstallerNG.lha"
)
)
(set #newstuff 0)
)
(set #newstuff 1)
)
(if
(exists #readme-file)
(if
(= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
("")
(run ("SYS:Utilities/More %s" #readme-file))
)
)
(set #program "WHDLoad")
(P_ChkRun)
(set #suffix "") ; replace by suffix if dic slave is peculiar
(if
(getenv "WHDLInstPath")
(set @default-dest (getenv "WHDLInstPath"))
)
(set #dest
(askdir
(prompt
(cat
"Where should \"" @app-name "\" be installed?\n"
"A drawer \"" #prefix "\" will be automatically created."
)
)
(help @askdir-help)
(default @default-dest)
)
)
; update for the end message
(set @default-dest #dest)
(run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" #dest))
(set #dest (tackon #dest #prefix))
(set #dest-org #dest)
(if
(exists #dest)
(
(set #choice
(askbool
(prompt
(cat
"\nDirectory \"" #dest "\" already exists.\n"
"Should it be deleted?"
)
)
(default 1)
(choices "Delete" "Skip")
(help @askbool-help)
)
)
(if
(= #choice 1)
(run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
)
)
)
(makedir #dest
(help @makedir-help)
(infos)
)
;----------------------------
(copyfiles
(help @copyfiles-help)
(source ("%s.Slave" #prefix #suffix))
(dest #dest)
)
(if (exists ("%s.glowexot" #prefix)) ((set #icon 7)(set #icnt (+ 1 #icnt))(set #icon-gex "Exotic GlowIcon")) (set #icon-gex ""))
(if (exists ("%s.newexot" #prefix)) ((set #icon 6)(set #icnt (+ 1 #icnt))(set #icon-nex "Exotic NewIcon")) (set #icon-nex ""))
(if (exists ("%s.exoticon" #prefix)) ((set #icon 5)(set #icnt (+ 1 #icnt))(set #icon-exo "Exoticon")) (set #icon-exo ""))
(if (exists ("%s.glowicon" #prefix)) ((set #icon 4)(set #icnt (+ 1 #icnt))(set #icon-glo "Glow Icon")) (set #icon-glo ""))
(if (exists ("%s.coloricon" #prefix)) ((set #icon 3)(set #icnt (+ 1 #icnt))(set #icon-col "OS3.5 Icon")) (set #icon-col ""))
(if (exists ("%s.newicon" #prefix)) ((set #icon 2)(set #icnt (+ 1 #icnt))(set #icon-new "NewIcon")) (set #icon-new ""))
(if (exists ("%s.romicon" #prefix)) ((set #icon 1)(set #icnt (+ 1 #icnt))(set #icon-rom "RomIcon")) (set #icon-rom ""))
(if (exists ("%s.inf" #prefix)) ((set #icon 0)(set #icnt (+ 1 #icnt))(set #icon-nor "Normal")) (set #icon-nor ""))
(procedure P_Icon
(copyfiles
(help @copyfiles-help)
(source ("%s.%s" #prefix #icon-suf))
(newname ("%s.info" #icon-name))
(dest #icon-dir)
)
(tooltype
(dest (tackon #icon-dir #icon-name))
(noposition)
)
)
(if
(> #icnt 1)
(
(set #icon-dir ("T:%s Icons" #prefix))
(makedir #icon-dir
(help @makedir-help)
)
(if #icon-nor ((set #icon-suf "inf") (set #icon-name #icon-nor) (P_Icon)))
(if #icon-rom ((set #icon-suf "romicon") (set #icon-name #icon-rom) (P_Icon)))
(if #icon-new ((set #icon-suf "newicon") (set #icon-name #icon-new) (P_Icon)))
(if #icon-col ((set #icon-suf "coloricon") (set #icon-name #icon-col) (P_Icon)))
(if #icon-glo ((set #icon-suf "glowicon") (set #icon-name #icon-glo) (P_Icon)))
(if #icon-exo ((set #icon-suf "exoticon") (set #icon-name #icon-exo) (P_Icon)))
(if #icon-nex ((set #icon-suf "newexot") (set #icon-name #icon-nex) (P_Icon)))
(if #icon-gex ((set #icon-suf "glowexot") (set #icon-name #icon-gex) (P_Icon)))
(if (= #newstuff 1)
(openwbobject #icon-dir)
)
(set #icon
(askchoice
(prompt "\nWhich icon would you like to install?\n")
(choices #icon-nor #icon-rom #icon-new #icon-col #icon-glo #icon-exo #icon-nex #icon-gex)
(default #icon)
(help @askchoice-help)
)
)
(if (= #newstuff 1)
(closewbobject #icon-dir)
)
(delete #icon-dir
(help @delete-help)
(all)
)
)
)
(set #isnewicon 0)
(select #icon
(set #icon "inf")
(set #icon "romicon")
(
(set #icon "newicon")
(set #isnewicon 1)
)
(set #icon "coloricon")
(set #icon "glowicon")
(set #icon "exoticon")
(
(set #icon "newexot")
(set #isnewicon 1)
)
(set #icon "glowexot")
)
(copyfiles
(help @copyfiles-help)
(source ("%s.%s" #prefix #icon))
(newname ("%s.info" #prefix))
(dest #dest)
)
(if
(= #isnewicon 1)
("")
(
(tooltype
(dest (tackon #dest #prefix))
(settooltype "Slave")
(settooltype "PreLoad")
)
(tooltype
(dest (tackon #dest #prefix))
(settooltype "PreLoad" "")
(settooltype "Slave" ("%s.Slave" #prefix))
)
)
)
(tooltype
(dest (tackon #dest #prefix))
(setdefaulttool "WHDLoad")
(setstack 10240)
(noposition)
)
(set #copy-file #readme-file)
(P_CopyFile)
(set #copy-file #man-file)
(P_CopyFile)
(set #copy-file #hint-file)
(P_CopyFile)
(set #copy-file #sol-file)
(P_CopyFile)
(if
(= #sub-dir "")
("")
(
(set #dest (tackon #dest #sub-dir))
(makedir #dest
(help @makedir-help)
)
)
)
(set #copy-file #highs-file)
(P_CopyFile)
(makedir (tackon #dest "save")
(help @makedir-help)
)
(makedir (tackon #dest "libs")
(help @makedir-help)
)
(P_Install)
(if (= #newstuff 1)
(openwbobject #dest-org)
)
(exit)

BIN
WHDLoad/ElectroMAN/Install.info Executable file

Binary file not shown.

View File

@ -0,0 +1,46 @@
# WHDLoad Installer for ElectroMAN by Tukinem
*ElectroMAN* is an Amiga port of Polish DOS game of the same title. I really
enjoyed playing the game in primary school. Now I can play it on the Amiga.
The game came on 2 floppy disks. Having dumped them, I figured I might as well
write WHDLoad slave so I can launch it from TinyLauncher.
This is my first time writing a WHDLoad slave. It's also the first time I
touched M68K assembly in over two decades. I took a lot of code from
[jotd/whdload_slaves](https://github.com/jotd666/whdload_slaves) repository
and WHDLoad sources.
As is, this work should be considered **unstable**.
## Known issues
* When exitting the game by pressing ESC key on the title screen, WHDLoad will
crash. For now, please exit the game by pressing the F10 key.
## TODO
* Add support for quitting the game with ESC key :).
## Requirements
AGA Amiga, Kickstart 3.1 or newer.
## Changelog
Version 1.0b1 (13.09.2024)
* Initial release.
## Contributing
If you think you found a bug or want to send a patch, feel free to contact
me through e-mail.
## Author
This WHDLoad installer is developed by [Tomek Wójcik](https://www.bthlabs.pl/).
## License
Public domain.

38
WHDLoad/ElectroMAN/ReadMe Executable file
View File

@ -0,0 +1,38 @@
THIS PACKAGE COMES WITH ABSOLUTELY NO WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, STATUTORY OR OTHERWISE. THE ENTIRE RISK AS TO USE, RESULTS AND
PERFORMANCE OF THE PACKAGE IS ASSUMED BY YOU AND IF THE PACKAGE SHOULD PROVE
TO BE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING,
REPAIR OR OTHER REMEDIATION.
UNDER NO CIRCUMSTANCES, CAN THE AUTHOR BE HELD RESPONSIBLE FOR ANY DAMAGE
CAUSED IN ANY USUAL, SPECIAL, OR ACCIDENTAL WAY, ALSO IF THE OWNER OR A THIRD
PARTY HAS BEEN POINTED AT SUCH POSSIBILITIES OF DAMAGE.
This install applies to "EletroMAN" (C) 2024 Tukinem & Retronics.
This install requires WHDLoad to be in the path. It can be found in the
WHDLoad package.
The installed program requires 2 MB ChipMem and 0 MB OtherMem.
It can be quit by pressing num 'F10' (key can be changed with Tooltype
"QuitKey=").
The game reuires AGA and Kickstart 3.1 or newer.
If you have problems with this installation please try and get a newer
version of this package from the WHDLoad WWW-Page. If that doesn't help try
some Tooltypes like NOCACHE, NOAUTOVEC, NOVBRMOVE, NOMMU, PAL or NTSC. If
that also fails, please inform the author via the Bug-Report-Form which
can be accessed on the WHDLoad WWW-Page or create a mantis issue directly
at http://mantis.whdload.de
For the full WHDLoad package, other installs and updates refer to:
http://www.whdload.de/
or aminet:dev/misc/whdload#?
and aminet:game/patch/
Version 1.0b1 (13.09.2024) done by Tomek Wojcik:
- initial release
- source code included
Make sure that you're using the install script, not a simple copy of disk
contents to "data".

Binary file not shown.

BIN
WHDLoad/ElectroMAN/data.info Executable file

Binary file not shown.

View File

View File

@ -0,0 +1,167 @@
;*---------------------------------------------------------------------------
; :Program. ElectroMAN.s
; :Contents. Slave for "ElectroMAN" from Tukinem & Retronics
; :Author. Tomek Wojcik, from Wepl sources
; :Original v1.0b1
; :Version. $Id: ElectroMAN.s 1.0b1 2024/09/13 22:20:34 BTHLabs Exp BTHLabs $
; :History. 2024-09-13 started
; :Requires. -
; :Copyright. Public Domain
; :Language. 68000 Assembler
; :Translator. Devpac 3.14, Barfly 2.9
; :To Do. * Add support for quitting the game with ESC key :)
;---------------------------------------------------------------------------*
INCLUDE whdload.i
INCLUDE whdmacros.i
INCLUDE lvo/dos.i
IFD BARFLY
OUTPUT "/ElectroMAN.Slave"
BOPT O+ ;enable optimizing
BOPT OG+ ;enable optimizing
BOPT ODd- ;disable mul optimizing
BOPT ODe- ;disable mul optimizing
BOPT w4- ;disable 64k warnings
BOPT wo- ;disable optimizer warnings
SUPER
ENDC
;============================================================================
CHIPMEMSIZE = $200000 ;size of chip memory
FASTMEMSIZE = 0 ;size of fast memory
NUMDRIVES = 1 ;amount of floppy drives to be configured
WPDRIVES = %0000 ;write protection of floppy drives
BLACKSCREEN ;set all initial colors to black
;BOOTBLOCK ;enable _bootblock routine
BOOTDOS ;enable _bootdos routine
;BOOTEARLY ;enable _bootearly routine
;CBDOSLOADSEG ;enable _cb_dosLoadSeg routine
;CBDOSREAD ;enable _cb_dosRead routine
;CBKEYBOARD ;enable _cb_keyboard routine
CACHE ;enable inst/data cache for fast memory with MMU
;CACHECHIP ;enable inst cache for chip/fast memory
;CACHECHIPDATA ;enable inst/data cache for chip/fast memory
;DEBUG ;add more internal checks
;DISKSONBOOT ;insert disks in floppy drives
DOSASSIGN ;enable _dos_assign routine
;FONTHEIGHT = 8 ;enable 80 chars per line
HDINIT ;initialize filesystem handler
;HRTMON ;add support for HrtMON
IOCACHE = 10000 ;cache for the filesystem handler (per fh)
INITAGA ;enable AGA
;MEMFREE = $200 ;location to store free memory counter
;NEEDFPU ;set requirement for a fpu
;POINTERTICKS = 1 ;set mouse speed
;SETPATCH ;enable patches from SetPatch 1.38
;SNOOPFS ;trace filesystem handler
;STACKSIZE = 6000 ;increase default stack
;TRDCHANGEDISK ;enable _trd_changedisk routine
;============================================================================
slv_Version = 17
slv_Flags = WHDLF_NoError|WHDLF_Examine
slv_keyexit = $59 ;F10
;============================================================================
INCLUDE whdload/kick31.s
;============================================================================
slv_name dc.b "ElectroMAN",0
slv_copy dc.b "2024 Tukinem & Retronics",0
slv_info dc.b "adapted by Tomek Wojcik",10
dc.b "Version 1.0b1 2024-09-13"
dc.b 0
slv_CurrentDir dc.b "data",0
slv_config dc.b 0
_disk1 dc.b "ELECTROMAN",0
_disk2 dc.b "SOUNDDATA",0
_program dc.b "ElectroMan.exu",0
_args dc.b 10
_args_end dc.b 0
EVEN
;============================================================================
_bootdos move.l _resload(pc),a2 ;A2 = resload
lea (_saveregs,pc),a0
movem.l d1-d6/a2-a6,(a0)
move.l (a7)+,(44,a0)
;open doslib
lea (_dosname,pc),a1
move.l (4),a6
jsr (_LVOOldOpenLibrary,a6)
lea (_dosbase,pc),a0
move.l d0,(a0)
move.l d0,a6 ;A6 = dosbase
;assigns
lea (_disk1,pc),a0
sub.l a1,a1
bsr _dos_assign
lea (_disk2,pc),a0
sub.l a1,a1
bsr _dos_assign
;load exe
lea (_program,pc),a0
move.l a0,d1
jsr (_LVOLoadSeg,a6)
move.l d0,d7 ;D7 = segment
beq .end
;patch
move.l a3,a0
move.l d7,a1
jsr (resload_PatchSeg,a2)
IFD DEBUG
;set debug
clr.l -(a7)
move.l d7,-(a7)
pea WHDLTAG_DBGSEG_SET
move.l a7,a0
jsr (resload_Control,a2)
add.w #12,a7
ENDC
;call
move.l d7,a1
add.l a1,a1
add.l a1,a1
moveq #_args_end-_args,d0
lea (_args,pc),a0
movem.l (_saveregs,pc),d1-d6/a2-a6
jsr (4,a1)
pea TDREASON_OK
jmp (resload_Abort,a2)
IFEQ 1
;remove exe
move.l d7,d1
move.l (_dosbase),a6
jsr (_LVOUnLoadSeg,a6)
ENDC
.end moveq #0,d0
move.l (_saverts,pc),-(a7)
rts
;============================================================================
_saveregs ds.l 11
_saverts dc.l 0
_dosbase dc.l 0
;============================================================================
END

View File

@ -0,0 +1,16 @@
DEVPACK := DEVPACK:
VBCC := $(DEVPACK)VBCC
VASM := $(VBCC)/bin/vasmm68k_mot -pic -x -devpac -I$(DEVPACK)SDK/NDK_3.9/Include/include_i -I$(DEVPACK)SDK/whdload/Include -I$(DEVPACK)SDK/whdload/Src/sources -nosym -Fhunkexe
OUTFILE := /ElectroMAN.slave
SOURCES := ElectroMAN.s
all: $(OUTFILE)
clean:
Delete ALL FORCE $(OUTFILE) $(OBJECTS)
$(OUTFILE): $(SOURCES)
$(VASM) -o $(OUTFILE) $(SOURCES)