Skip to content

Commit

Permalink
Add sectorlisp and sectorforth
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Nov 5, 2021
1 parent 7814f96 commit 5877d36
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ <h4>Select profile</h4>
A homebrew operating system from scratch, written in assembly language</td></tr>
<tr id="start_solos"><td><a href="?profile=solos">Solar OS</a> <small>0.3 MB</small></td><td>
Simple graphical OS</td></tr>
<tr id="start_bootchess"><td><a href="?profile=bootchess">Bootchess</a> <small>0.1 MB</small></td><td>
<tr id="start_bootchess"><td><a href="?profile=bootchess">Bootchess</a> <small>512 B</small></td><td>
A tiny chess program written in the boot sector</td></tr>
<tr id="start_sectorlisp"><td><a href="?profile=sectorlisp">SectorLISP</a> <small>512 B</small></td><td>
A LISP interpreter that fits into the boot sector</td></tr>
</table>

<hr>
Expand Down
20 changes: 20 additions & 0 deletions src/browser/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,26 @@
name: "bootBASIC",
homepage: "https://github.com/nanochess/bootBASIC",
},
{
id: "sectorlisp",
fda: {
"url": HOST + "sectorlisp.img",
"async": false,
"size": 512,
},
name: "SectorLISP",
homepage: "https://justine.lol/sectorlisp/",
},
{
id: "sectorforth",
fda: {
"url": HOST + "sectorforth.img",
"async": false,
"size": 512,
},
name: "sectorforth",
homepage: "https://github.com/cesarblum/sectorforth",
},
{
id: "floppybird",
fda: {
Expand Down
5 changes: 4 additions & 1 deletion src/floppy.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@ function FloppyController(cpu, fda_image, fdb_image)
1440 : { type: 4, tracks: 80, sectors: 18, heads: 2 },
1722 : { type: 5, tracks: 82, sectors: 21, heads: 2 },
2880 : { type: 5, tracks: 80, sectors: 36, heads: 2 },

// not a real floppy type, used to support sectorlisp and friends
0 : { type: 1, tracks: 1, sectors: 1, heads: 1 },
};

var number_of_cylinders,
sectors_per_track,
number_of_heads,
floppy_type = floppy_types[this.floppy_size >> 10];

if(floppy_type && (this.floppy_size & 0x3FF) === 0)
if(floppy_type && ((this.floppy_size & 0x3FF) === 0 || this.floppy_size === 512))
{
cpu.devices.rtc.cmos_write(CMOS_FLOPPY_DRIVE_TYPE, floppy_type.type << 4);

Expand Down

0 comments on commit 5877d36

Please sign in to comment.