Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Sepa ! (Registered 2024-05-13) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > hacking d64/t64 files using vice emul. and AR cart image
2006-04-18 10:04
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
2006-04-18 11:46
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.
2006-04-18 12:03
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:
2006-04-19 08:16
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
2006-04-19 11:28
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.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Sentinel/Excess/TREX
Durandal
kbs/Pht/Lxt
marty/RADWAR
Nith/TRIÉ…D
CopAss/Leader
Weasel/Padua/Hitmen/..
Alakran_64
Mibri/ATL^MSL^PRX
Trash
Paul Bearer
Guests online: 117
Top Demos
1 13:37  (9.8)
2 Next Level  (9.8)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Party Elk 2  (9.7)
2 It's More Fun to Com..  (9.6)
3 Layers  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Diskmag Editors
1 Jazzcat  (9.4)
2 Magic  (9.4)
3 hedning  (9.2)
4 Elwix  (9.1)
5 A Life in Hell  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.033 sec.