Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
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
psych
Thierry
Raf/Vulture Design
Guests online: 137
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Mermaid  (9.5)
4 Facet  (9.4)
5 Shine  (9.4)

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