AgonConsole8 / agon-vdp

Official Firmware for the Agon Console8: ESP32 VDP
MIT License
43 stars 17 forks source link

Accepting segment records (type 02), warnings against overlapping ROM area addresses #74

Closed envenomator closed 1 year ago

envenomator commented 1 year ago

The VDP hexload code now accepts the less frequently used type 02 record, using 20-bit segment addresses. I found that the objcopy tool, when not passing it a start-address parameter, emits these records at each 64KB boundary. Reading the original Intel hex specification, it appears that tools use these type of records, originally meant for cpu's with a 20bit address space. Latter tools mostly use 32-bit addresses.

Also now displaying errors to the user when the uploaded hex file partly overlaps with the ROM/flash area. Users tend to forget to -offset their hex codes, when converting a binary file without address meta-data, which then lands starting at address 0 (rom/flash area).

When omitting the first address record in a hex-file, the tool previously already set the start-address to 0x40000. But when tools emit a 02 type record at the 64KB boundary to address 0x50000, they send 0x10000, because that is the sequential next address. Hexload now checks for a missing first address record and calculates the effective address when using record type 02 at each next 64KB boundary.