| |
carmel_andrews Account closed
Registered: Apr 2006 Posts: 2 |
hacking d64/t64 files using vice emul. and AR cart image
I have just downloaded a heap of d64/t64 files for use with above emu (latest version) and also a few AR cart images
I was looking for the c64 memory locations for disk load and number of blocks/sectors to load and the cassette eqiuv's
And also the c64 locations for run/init (to create autobooting files)
And also how to find out in memory where the d64/t64 file is been loaded into (secotr/block location etc) using the emulators built in debugger/monitor
And how much it loads into memory, as i understand the c64 uses the same 'bank switch' trick like the A8 does, so as to load data (force or hard load) in high mem i.e above bfffh
This is because i want to create autobootable binary files from the t64/d64 files that i have and pack them and put then on menu's etc
I am especially intested in hacking d64 files that load in more data (like multi load files) i.e gauntlet, giana sisters, zork etc (games that lad in extra levels) as well as single load d64/t64 files
I would al;so like to know how to create binary files that autoboot (or autostart) as commodore call it
Any definative guide or help is greatly appreciated
in the first instance please email if you can genuinely help here
carmel_andrews@yahoo.com
thx in advance |
|
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
The C64 DOS functions are higher level, they are all based on file access and not sector access.
If you just want to load a file you can use the LOAD vector. It will load a complete file to an address in memory. For stream access of a file, you need to call OPEN first to open it, then call CHKIN to select the opened file for input, then for every byte you call CHRIN and when you are finished you call CLOSE. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
You propably want this:
LDX #<filename
LDY #>filename
LDA #nameend-filename
JSR $FFBD ; SETNAM
LDA #$00 ; logical file number
LDX $BA ; get last used device number
BNE okdev
LDX #$08 ; no device number -> use device 8
okdev:
LDY #$01 ; not $00 = load file to save address
JSR $FFBA ; SETLFS
LDA #$00 ; $00 = load file
JSR $FFD5 ; LOAD
BCS error ; carry set -> load error
RTS
filename:
.TEXT "A FILENAME"
nameend:
And if you want to use a different address for loading:
LDX #<filename
LDY #>filename
LDA #nameend-filename
JSR $FFBD ; SETNAM
LDA #$00 ; logical file number
LDX $BA ; get last used device number
BNE okdev
LDX #$08 ; no device number -> use device 8
okdev:
LDY #$00
JSR $FFBA ; SETLFS
LDA #$00 ; $00 = load file
LDX #<address
LDY #>address
JSR $FFD5 ; LOAD
BCS error ; carry set -> load error
RTS
filename:
.TEXT "A FILENAME"
nameend: |
| |
carmel_andrews Account closed
Registered: Apr 2006 Posts: 2 |
sorry graham, etc... yopu obviously miss understood what i was asking for perhaps i'd better explain my self much better
Using my experience on hacking out A8 tapes/disk software to binary files (years ago) both on a pucka a8 and thru a800win+ pc emu
$304/5h... A8 mem locations for start sector to load or load address of 1st sector/track
$30a/bh...A8 mem location for number of sectors to load/number of bytes to load (these locations can be used for cassete i/o)
And the cassette version
$342/3h...A8 mem location for load address of 1st block of cassette data
$348/9h...A8 mem location for number of bytes or blocks/sectors to load (these locations can also be used for disk i/o)
And also $2/3...A8 mem location for Cassette/Disk Run/init (known as 'Casini')
$a/b or$ c/d... A8 mem location for Cassette/disk run/init (known as 'dosini')
If you are using binary files the following locations are also used for run/init addressed
$2e0/2e1 and $2e2/2e3...A8 mem location for run/init address for Dos binary load (also used sometimes for cassette and disk run/init (if they don't use 2/3 or a/b c or d)
like i said, using the vice emulator's built in ML monitor/debugger, i want to find out how and where the tape or disk image is being loaded into memory and how much is being loaded into memory and where it run/executes or initialises and how/where it loads extra data (like more levels in a game etc) and where that executes and initialises
Also i would like to know how to create binary files that autoboot (or autostart as commodore call it) using the aforementioned emulator's built in monitor/debugger
I hope that i've explained myself a little more better this time |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
I think what you request is impossible. Most demos/games use their own loaders, so there is no standard way how to find out where and how some data is loaded. You have to look through the code.
Basically something like this is done: The KERNAL is used to upload own loader code to the disk drive and then executed. After this, most software implements own protocols over the serial bus which means direct access to the hardware registers. There is no standard API to look for... just register accesses. |