Skip to content

Commit

Permalink
Added Flash ROM support
Browse files Browse the repository at this point in the history
  • Loading branch information
S0urceror committed Jun 19, 2020
1 parent 7c87ebf commit 74ed233
Show file tree
Hide file tree
Showing 11 changed files with 454 additions and 84 deletions.
10 changes: 5 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"label": "Driver - Nextor+UsbHost",
"type": "shell",
"command": "make -C ./drivers/NextorUsbHost/src/",
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$errmatcher-sjasmplus"
},
{
Expand Down Expand Up @@ -42,10 +45,7 @@
"label": "Software - flash",
"type": "shell",
"command": "make -C ./software/ -f makeflash.mk",
"group": {
"kind": "build",
"isDefault": true
},
"group": "build",
"problemMatcher": []
},
{
Expand Down
Binary file modified drivers/NextorUsbHost/dist/driver_low.rom
Binary file not shown.
Binary file modified drivers/NextorUsbHost/dist/driverrd.rom
Binary file not shown.
Binary file modified drivers/NextorUsbHost/dist/nextor.rom
Binary file not shown.
Binary file added drivers/NextorUsbHost/dist/nextor_complete.rom
Binary file not shown.
Binary file modified drivers/NextorUsbHost/dist/nextorlow.rom
Binary file not shown.
Binary file modified drivers/NextorUsbHost/dist/nextorrd.rom
Binary file not shown.
5 changes: 3 additions & 2 deletions drivers/NextorUsbHost/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ $(OUTPUT_DIR)/chgbnkrd.bin: chgbnk.asm
$(OUTPUT_DIR)/driver.rom: driver.asm driver_helpers.asm basic_extensions.asm print_bios.asm ch376s.asm ch376s_helpers.asm usbhost.asm nextordirect.asm
$(ASM) $(ASMFLAGS) $<

$(OUTPUT_DIR)/driverrd.rom: driver.asm driver_helpers.asm basic_extensions.asm print_bios.asm ch376s.asm ch376s_helpers.asm usbhost.asm nextordirect.asm
$(OUTPUT_DIR)/driverrd.rom: driver_low.asm driver_helpers_low.asm flashdisk.asm print_bios.asm ch376s.asm ch376s_helpers.asm usbhost.asm nextordirect.asm scsi.asm scsi_helpers.asm
$(ASM) $(RDASMFLAGS) $<

$(OUTPUT_DIR)/driver_low.rom: driver_low.asm driver_helpers_low.asm basic_extensions.asm print_bios.asm ch376s.asm ch376s_helpers.asm usbhost.asm nextordirect.asm scsi.asm scsi_helpers.asm
$(OUTPUT_DIR)/driver_low.rom: driver_low.asm driver_helpers_low.asm flashdisk.asm print_bios.asm ch376s.asm ch376s_helpers.asm usbhost.asm nextordirect.asm scsi.asm scsi_helpers.asm
$(ASM) $(ASMFLAGS) $<

$(OUTPUT_DIR)/extra1k.dat: extra1k.asm
Expand All @@ -38,6 +38,7 @@ $(OUTPUT_DIR)/nextorlow.rom: $(OUTPUT_DIR)/driver_low.rom $(OUTPUT_DIR)/chgbnk.b
$(KERNEL_DIR)/mknexrom $(KERNEL_DIR)/Nextor-2.1.0-beta2.base.dat $(OUTPUT_DIR)/nextorlow.rom \
/d:$(OUTPUT_DIR)/driver_low.rom /m:$(OUTPUT_DIR)/chgbnk.bin \
/e:$(OUTPUT_DIR)/extra1k.dat
cat $(OUTPUT_DIR)/nextorlow.rom $(OUTPUT_DIR)/RDDISK.DSK > $(OUTPUT_DIR)/nextor_complete.rom

$(OUTPUT_DIR)/nextorrd.rom: $(OUTPUT_DIR)/driverrd.rom $(OUTPUT_DIR)/chgbnkrd.bin $(OUTPUT_DIR)/extra1k.dat
$(KERNEL_DIR)/mknexrom $(KERNEL_DIR)/Nextor-2.1.0-beta2.base.dat $(OUTPUT_DIR)/nextorrd.rom \
Expand Down
12 changes: 9 additions & 3 deletions drivers/NextorUsbHost/src/driver_helpers_low.asm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ WANTED_PROTOCOL DB

STRUCT WRKAREA
BASE: ; Offset to the base of the data structure
STATUS: db ; bit 0 = CH376s present, bit 1 = initialised, bit 2 = USB device present, bit 3 = USB device mounted, bit 5 = DSK changed
STATUS: db ; bit 0 = CH376s present, bit 1 = initialised, bit 2 = USB device present, bit 3 = USB device mounted, bit 5 = DSK changed, bit 7 = Flash disk present
MAX_DEVICE_ADDRESS: db 0
USB_DEVICE_INFO: _USB_DEVICE_INFO
STORAGE_DEVICE_INFO: _USB_DEVICE_INFO
Expand All @@ -52,9 +52,10 @@ USB_DESCRIPTOR ds 140 ; memory area to hold the usb device+config descriptor o
USB_DESCRIPTORS ds USB_DESCRIPTORS_END - USB_DESCRIPTORS_START
NXT_DIRECT ds NXT_DIRECT_END - NXT_DIRECT_START
JUMP_TABLE ds JUMP_TABLE_END - JUMP_TABLE_START
FLASH_READ ds FLASH_READ_END - FLASH_READ_START
ENDS

TXT_START: db "MSXUSB v0.5 (c) Sourceror\r\n"
TXT_START: db "MSXUSB v0.6 (c) Sourceror\r\n"
db "GNU General Public License\r\n"
db "=============================\r\n\r\n",0
TXT_FOUND: db "+MSXUSB cartridge found\r\n",0
Expand All @@ -67,4 +68,9 @@ TXT_STORAGE_CHECK_OK: db "+Found USB Storage:",0
TXT_INQUIRY_OK: db "\r\n ",0
TXT_INQUIRY_NOK: db "\r\n-Error (Inquiry)\r\n",0
TXT_TEST_START: db "\r\n+Testing storage device",0
TXT_TEST_OK: db "\r\n+All systems go!\r\n",0
TXT_TEST_OK: db "\r\n+All systems go!\r\n",0
TXT_FLASHDISK_OK: db "+ROM disk detected\r\n",0

RD_MANUFACTURER: db "S0urceror",0
RD_DEVICE_NAME: db "Flash ROM Disk",0
RD_SERIAL: db "v0.1",0
Loading

0 comments on commit 74ed233

Please sign in to comment.