retrohackers.org
http://retrohackers.org/

Kernel: How to find out the device number
http://retrohackers.org/viewtopic.php?f=4&t=315
Page 1 of 1

Author:  RaveGuru [ Thu Dec 13, 2007 7:49 pm ]
Post subject:  Kernel: How to find out the device number

I'm trying to find a way to find out what Device number was used to load the current program, or what device was last accessed. I've been looking thru the kernel memory pages ($0000-03ff) but can't find it. I thought I could just read $00ba and get it, but no.

Author:  Devia [ Thu Dec 13, 2007 8:20 pm ]
Post subject:  Re: Kernel: How to find out the device number

RaveGuru wrote:
I thought I could just read $00ba and get it, but no.

erhm.. why not? - $ba always holds the last accessed disk device num!?

Author:  RaveGuru [ Thu Dec 13, 2007 10:51 pm ]
Post subject: 

I don't know, I'm currently using cc65 and I'm just reading 3, which is the screen IIRC. It must be the cc65 library that's messing with the devices. I'd want to check $ba before the lib does its things but I don't know if there's any convenient way of doing that other than with a ML Monitor....

Author:  MagerValp [ Thu Dec 13, 2007 10:59 pm ]
Post subject: 

Use conio.h instead of stdio.h. stdio uses device 3 to print, conio uses direct screen access and is much faster.

Author:  RaveGuru [ Sat Dec 29, 2007 5:49 pm ]
Post subject: 

Ah that explains why I'm reading dev #3. I had problems with conio at an early stage. Perhaps time to give it a go again :)

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/