Last Updated or created 2023-10-05
Loading a 320×200 image from 14 cilinders. There is no msdos on the floppy!
9 sectors, 14 cilinders, 1 head * sector size (512 bytes) = 64512 bytes
Mode 13h (320×200 265 colors)
Cuting the raw part from a BMP (see previous post)
root@battlestation:/mnt/# ls -la MAD.bmp -rw-rw-r-- 1 fash fash 65078 Sep 14 15:57 MAD.bmp I need 64000 bytes (320x200) 65078-64000 = 1078 root@battlestation:/mnt/# dd if=MAD.bmp of=mad.raw skip=1078 bs=1 64000+0 records in 64000+0 records out 64000 bytes (64 kB, 62 KiB) copied, 0.441618 s, 145 kB/s
I use debug to write to the sectors
debug mad.raw -w100 0 9 7f (write from address 100 drive=0 startsector=9 (cylinder 1) and 7f sectors long
Wrote a little sector viewer to debug/view data written.
- r – read sector again
- s – next sector (shift previous)
- c – next cylinder (shift previous)
- h – toggle head 0 – 1
- p – load palette from current 2 sectors
- l – clear screen
- 1 – goto graphic mode
- 2 – goto text mode and show sector,head and cylinder info
- q – quit
- -/+ tweak palette offset ( was needed for debugging
I will post the code after some code cleaning and adding some comments