Fix esp32 detection, add colored caption, live stats, single-loop playback

- Fix state_esp init bug: crt0.s never runs GSINIT and hex2bin fills
  unbacked memory with 0xFF (not 0), so a plain zero-init global always
  read 0xFF on load; give it a real 0xFF sentinel initializer instead.
- Vendor demyanenko-d/VGMPLAY.WMF's wc_api library (SDCC 4.6.0 +
  --sdcccall 1) instead of hand-rolled PRSRW/PRIAT wrappers, which
  corrupted esp32 file loading in three different shapes; colored "File:"
  caption now works.
- Trim shared-file footprint: vendor only the esp32.c functions actually
  used, drop unused sdklib.h/sdk.lib linkage.
- Re-enable periodic live stats (Pattern/Row/BPM/Time/progress bar).
- Limit playback to one loop via TRACK_SET_PARAMS/MAX_LOOP_COUNT, and
  auto-advance to the next file when a track finishes on its own
  (detected via a PLAYING->STOPPED ESP_REG_TRACK_STATUS transition).
- Pin the Z80 clock to 14MHz for the whole plugin lifetime so esp32 SPI
  wait-loop timeouts (raw iteration counts, not real time) don't depend
  on whatever turbo setting was active before the plugin started.
- Pad TRACK_INIT's timeout well past the firmware's 5s song-length
  measurement cap (XM_MEASURE_MAX_US).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-30 21:40:24 +03:00
co-authored by Claude Sonnet 5
parent 6163d0c8ca
commit ee64fb85a9
16 changed files with 3455 additions and 2802 deletions
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -79,7 +79,7 @@ _hdr:
.db #0x01 ; 1 .db #0x01 ; 1
.db #0x00 ; 0 .db #0x00 ; 0
.db #0x00 ; 0 .db #0x00 ; 0
.db #0x1d ; 29 .db #0x1e ; 30
.db 0x00 .db 0x00
.db 0x00 .db 0x00
.db 0x00 .db 0x00
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
:200200000000000000000000000000000000000057696C64436F6D6D616E6465724D444CDB :200200000000000000000000000000000000000057696C64436F6D6D616E6465724D444CDB
:2002200007000100001D000000000000000000000000000000000000000000000000000099 :2002200007000100001E000000000000000000000000000000000000000000000000000098
:20024000584D20584D5A53334D000000000000000000000000000000000000000000000007 :20024000584D20584D5A53334D000000000000000000000000000000000000000000000007
:2002600000000000000000000000000000000000000000000000000000000000000000007E :2002600000000000000000000000000000000000000000000000000000000000000000007E
:2002800000000000000000000000000000000000000000000000000000000000000000005E :2002800000000000000000000000000000000000000000000000000000000000000000005E
+1 -1
View File
@@ -79,7 +79,7 @@
00000022 01 79 .db #0x01 ; 1 00000022 01 79 .db #0x01 ; 1
00000023 00 80 .db #0x00 ; 0 00000023 00 80 .db #0x00 ; 0
00000024 00 81 .db #0x00 ; 0 00000024 00 81 .db #0x00 ; 0
00000025 1D 82 .db #0x1d ; 29 00000025 1E 82 .db #0x1e ; 30
00000026 00 83 .db 0x00 00000026 00 83 .db 0x00
00000027 00 84 .db 0x00 00000027 00 84 .db 0x00
00000028 00 85 .db 0x00 00000028 00 85 .db 0x00
+1 -1
View File
@@ -20,7 +20,7 @@ T 0C 00 00 00 00 00 00 00 57 69 6C 64 43 6F 6D 6D
R 00 00 00 00 R 00 00 00 00
T 18 00 00 00 61 6E 64 65 72 4D 44 4C 07 00 01 00 T 18 00 00 00 61 6E 64 65 72 4D 44 4C 07 00 01 00
R 00 00 00 00 R 00 00 00 00
T 24 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 T 24 00 00 00 00 1E 00 00 00 00 00 00 00 00 00 00
R 00 00 00 00 R 00 00 00 00
T 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 T 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
R 00 00 00 00 R 00 00 00 00
+419 -221
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+118 -98
View File
@@ -1,99 +1,119 @@
:20800300ED7B01B8C94F3E13D3773E01D357AFD357DB5779D357AFD3573E03D377C94F3EB8 :20800300ED7B00B8C906000E023E0EC306604F3E13D3773E01D357AFD357DB5779D357AF39
:2080230013D3773E02D35779D357DB57DB57DB574F3E03D37779C9DDE5DD210000DD39F556 :20802300D3573E03D377C94F3E13D3773E02D35779D357DB57DB57DB574F3E03D37779C916
:20804300F54F3E13D3773E02D35779D357DB57DB57DB574FDB575759DB57DD77FCAFDD77E5 :20804300DDE5DD210000DD39F5F54F3E13D3773E02D35779D357DB57DB57DB574FDB5757F8
:20806300FDDD77FEDD77FFDD7EFCDD77FEAFDD77FFDD77FCDD77FDDD6EFEDB57DD77FCAF95 :2080630059DB57DD77FCAFDD77FDDD77FEDD77FFDD7EFCDD77FEAFDD77FFDD77FCDD77FD31
:20808300DD77FDDD77FEDD77FFDD7EFCDD77FFAFDD77FCDD77FDDD77FEDD66FF3E03D377CE :20808300DD6EFEDB57DD77FCAFDD77FDDD77FEDD77FFDD7EFCDD77FFAFDD77FCDD77FDDD96
:2080A300DDF9DDE1C94F3E13D3773E02D35779D357DB57DB57FD210200FD39FD4E00790DDE :2080A30077FEDD66FF3E03D377DDF9DDE1C94F3E13D3773E02D35779D357DB57DB57FD21A5
:2080C300B72807DB571213C3C1803E03D377E133E9474D3E13D3773E01D35778D357DB5768 :2080C3000200FD39FD4E00790DB72807DB571213C3CA803E03D377E133E9474D3E13D37793
:2080E30079D3573E03D377C94F3E13D3773E01D35779D357DB57FD210200FD39FD7E00D3BA :2080E3003E01D35778D357DB5779D3573E03D377C94F3E13D3773E01D35779D357DB57FD24
:2081030057FD7E01D357FD7E02D357FD7E03D3573E03D377E1F1F1E93E13D3773E07D357CF :20810300210200FD39FD7E00D357FD7E01D357FD7E02D357FD7E03D3573E03D377E1F1F11B
:20812300DB573E03D377C97D01AF1AED797C01AF1BED79FD210200FD39FD7E0001AF1CEDD2 :20812300E93E13D3773E07D357DB573E03D377C97D01AF1AED797C01AF1BED79FD21020049
:2081430079FD7E01FD4E02FD23CB39CB1F3D01AF26ED79FD7E023D01AF28ED793E13D377C0 :20814300FD39FD7E0001AF1CED79FD7E01FD4E02FD23CB39CB1F3D01AF26ED79FD7E023D2F
:208163003E03D357DB57DB573E8201AF27ED793E27DBAF0738F93E03D377CD1B811160EABA :2081630001AF28ED793E13D3773E03D357DB57DB573E8201AF27ED793E27DBAF0738F93EF2
:20818300210000CDD881E1F1F133E93E13D3773E08D357DB573E03D377C9DDE5DD21000065 :2081830003D377CD24811160EA210000CDE181E1F1F133E93E13D3773E08D357DB573E0315
:2081A300DD394FDD5E04DD5605DD6E06DD66077BC6FF5F7ACEFF577DCEFF6F7CCEFF67B5EA :2081A300D377C9DDE5DD210000DD394FDD5E04DD5605DD6E06DD66077BC6FF5F7ACEFF5735
:2081C300B2B3280EE5C5D53E01CD2180D1C1E19120DDDDE1C97BC6FF5F7ACEFF577DCEFFC6 :2081C3007DCEFF6F7CCEFF67B5B2B3280EE5C5D53E01CD2A80D1C1E19120DDDDE1C97BC6E5
:2081E3006F7CCEFF67B5B2B3C8E5D53E01CD2180D1E1FE0228DFC9E5D53E03CDEB80FD2141 :2081E300FF5F7ACEFF577DCEFF6F7CCEFF67B5B2B3C8E5D53E01CD2A80D1E1FE0228DFC943
:208203000200FD39FD6E003E02CDD4803EE0CD088011204E210000CDD8813E0BCD21805F08 :20820300E5D53E03CDF480FD210200FD39FD6E003E02CDDD803EE0CD118011204E210000D8
:208223001600E133E9AFCD0880CD8E81CD1B813E01C90100180A20052F00000000008F824F :20822300CDE1813E0BCD2A805F1600E133E9AFCD1180CD9781CD24813E01C90100180A202B
:2082430099829A820100FFFF20052F00000000008F829982B0820100FFFF20052F000000E0 :20824300052F00000000009882A282A3820100FFFF20052F00000000009882A282B98201B7
:2082630000008F829982D0828100190A280B4F0000000000EE82998203830100160A2405FC :2082630000FFFF20052F00000000009882A282D9828100190A280B4F0000000000F782A2CF
:208283004F0000000000118399821A830E204572726F72212000000E0C014E6F20455350E7 :20828300820C830100160A24054F00000000001A83A28223830E204572726F722120000051
:2082A300333220646574656374656421000E0C014F7574206F66206D656D6F727920286624 :2082A3000E0C014E6F20455350333220646574656374656421000E0C014F7574206F66208B
:2082C300696C6520746F6F2062696729000E0C01506C61796261636B206572726F722028A0 :2082C3006D656D6F7279202866696C6520746F6F2062696729000E0C01506C617962616356
:2082E3006261642066696C653F29000E20584D2F584D5A2F53334D20506C6179657220007C :2082E3006B206572726F7220286261642066696C653F29000E20584D2F584D5A2F53334D2C
:208303000E0C01506C6179696E672E2E2E000E2041626F757420000E0C01584D20506C619B :2083030020506C6179657220000E0C01506C6179696E672E2E2E000E2041626F75742000EB
:208323007965722076312E3000DDE5DD210000DD3921ECFF39F93EA2CD0880111027210013 :208323000E0C01584D20506C617965722076312E3000DDE5DD210000DD3921ECFF39F93E76
:2083430000CDD8813EE4CD0880111027210000CDD8813A07B83D280A3A07B8D6022808C3C2 :20834300A2CD1180111027210000CDE1813EE4CD1180111027210000CDE1813A06B83D280D
:208363006F833E08C371833E0CC371833E05F533ED5B03B82A05B8CDFA812131B8733E01B1 :208363000A3A06B8D6022808C378833E08C37A833E0CC37A833E05F533ED5B02B82A04B8CF
:20838300CD21803209B83A09B83D2804AFC33C85210C0039EB2103B8010400EDB0AFDD7710 :20838300CD03822130B8733E01CD2A803208B83A08B83D2804AFC36385210C0039EB210233
:2083A300FCDD77FDDD77FEDD77FFDD7EFBDDB6FADDB6F9DDB6F8CAC984DD7EF9D610DD7E22 :2083A300B8010400EDB0AFDD77FCDD77FDDD77FEDD77FFDD7EFBDDB6FADDB6F9DDB6F8CAA7
:2083C300FADE00DD7EFBDE00301121000039EB210C0039010400EDB0C3ED83DD36EC00DDF1 :2083C300D284DD7EF9D610DD7EFADE00DD7EFBDE00301121000039EB210C0039010400EDC5
:2083E30036ED10AFDD77EEDD77EF21050039EB21000039010400EDB0DD7EF1C6FFDD7EF26F :2083E300B0C3F683DD36EC00DD36ED10AFDD77EEDD77EF21050039EB21000039010400EDB5
:20840300CE01473E00CE005F3E00CE005748435ACB3BCB18CB19DD71F779F5332101A8CD46 :20840300B0DD7EF1C6FFDD7EF2CE01473E00CE005F3E00CE005748435ACB3BCB18CB19DDD8
:208423000D8A210000E5DD6EF1DD66F2E53E03CDEB80DD6EFEDD66FFE5DD6EFCDD66FDE5F1 :2084230071F779F5332100A8CD3D8B210000E5DD6EF1DD66F2E53E03CDF480DD6EFEDD6668
:208443003E07CDEB803EE1CD0880210000E521D007E53E03CD9D81F1F1DD7EF7DD77F5DDBF :20844300FFE5DD6EFCDD66FDE53E07CDF4803EE1CD1180210000E521D007E53E03CDA681AE
:2084630036F6003A0260DD77F7DD6EF52600E5210002E5DD7EF7F5332101A8CD2A81DD5E9C :20846300F1F1DD7EF7DD77F5DD36F6003A0260DD77F7DD6EF52600E5210002E5DD7EF7F5F2
:20848300F1DD56F2DD6EFCDD66FD19DD75FCDD74FDDD7EFEDD8EF3DD77FE3003DD34FFDD5E :20848300332100A8CD3381DD5EF1DD56F2DD6EFCDD66FD19DD75FCDD74FDDD7EFEDD8EF318
:2084A3007EF8DD96F1DD77F8DD7EF9DD9EF2DD77F9DD7EFADD9EF3DD77FADD7EFBDD9EF4AF :2084A300DD77FE3003DD34FFDD7EF8DD96F1DD77F8DD7EF9DD9EF2DD77F9DD7EFADD9EF350
:2084C300DD77FBC3AD833A07B83D203D3A31B86F3E0BCDD4802E053E02CDD4802A05B8E568 :2084C300DD77FADD7EFBDD9EF4DD77FBC3B6833A06B83D203D3A30B86F3E0BCDDD802E0572
:2084E3002A03B8E53E03CDEB803EF2CD0880111027210000CDD8813E01CD21803209B83A48 :2084E3003E02CDDD802A04B8E52A02B8E53E03CDF4803EF2CD1180111027210000CDE181D3
:2085030009B83D2804AFC33C853EA0CD0880111027210000CDD8813E01CD21803209B83A5F :208503003E01CD2A803208B83A08B83D2804AFC363853EA0CD1180114042210F00CDE181C5
:2085230009B83D2804AFC33C853EA1CD0880111027210000CDD8813E01DDF9DDE1C976CD39 :208523003E01CD2A803208B83A08B83D2804AFC363853A30B86F3E0BCDDD802E013E3ACD5B
:20854300DB8AB728F9C94F790DB7C876C34A85217D82CD648ACD4185217D82CDC28AAFC39D :20854300DD803EA6CD1180111027210000CDE1813EA1CD1180111027210000CDE1813E01CD
:208563000380213582CD648ACD4185213582CDC28AAFC30380214782CD648A3E32CD4985B9 :20856300DDF9DDE1C976CD0B8CB728F9C94F790DB7C876C37185218682CD948BCD688521AD
:20858300214782CDC28A3E02C30380215982CD648A3E32CD4985215982CDC28A3E02C30372 :208583008682CDF28BAFC30380213E82CD948BCD6885213E82CDF28BAFC30380215082CD2A
:2085A30080ED4B0AB81E006B260009563E0C836F3EB8CE00677AB7280A7BD6203005721C32 :2085A300948B3E32CD7085215082CDF28B3E02C30380216282CD948B3E32CD70852162827C
:2085C300C3AA853600C93E45F533210500E5210101E511F385216B82CD7B8A210CB8CDCFFF :2085C300CDF28B3E02C30380ED4B09B81E006B260009563E0B836F3EB8CE00677AB7280AF8
:2085E3008AD5210107E5110CB8216B82CD2E8AC946696C653A00DDE5DD210000DD39EB015E :2085E3007BD6203005721CC3D1853600C93E45F533210500E5210101E5111A86217482CDD9
:208603002586DD7E0407070707E60F6F2600097E1213DD7E04E60F6F2600097E12DDE1E1DA :20860300AB8B210BB8CDFF8BD5210107E5110BB8217482CD5E8BC946696C653A00DDE5DD40
:2086230033E93031323334353637383941424344454600DDE5DD210000DD39F54D44E1D567 :20862300210000DD39EB014C86DD7E0407070707E60F6F2600097E1213DD7E04E60F6F26A8
:20864300C5116400DD6EFEDD66FFCDDE89EB110A00CD298AC17BC63002696023E5C5110AB3 :2086430000097E12DDE1E133E93031323334353637383941424344454600DDE5DD21000061
:2086630000DD6EFEDD66FFCDDE89EB110A00CD298AC1E17BC630770303C5110A00DD6EFEF9 :20866300DD39F54D44E1D5C5116400DD6EFEDD66FFCD0E8BEB110A00CD598BC17BC630028F
:20868300DD66FFCD298AC17BC63002DDF9DDE1C9DDE5DD210000DD39E5210000E52E3CE574 :20868300696023E5C5110A00DD6EFEDD66FFCD0E8BEB110A00CD598BC1E17BC630770303EE
:2086A300DD5E04DD5605DD6E06DD6607CDC3B8F1F1010000C50E64C5CD3CB8F1F14BC521AA :2086A300C5110A00DD6EFEDD66FFCD598BC17BC63002DDF9DDE1C9DDE5DD210000DD39E54F
:2086C3000000E52E3CE5DD5E04DD5605DD6E06DD6607CD3CB8F1F1C151D52E0A7ACDD989E6 :2086C300210000E52E3CE5DD5E04DD5605DD6E06DD6607CDE6B8F1F1010000C50E64C5CD19
:2086E3007B2E0ACD228A7BD1C630E1E577C1C503C5D52E0A7ACD228A7BD1C1C63002E1E5B3 :2086E3005FB8F1F14BC5210000E52E3CE5DD5E04DD5605DD6E06DD6607CD5FB8F1F1C1512F
:208703002323363AC1C5030303C5D52E0A7BCDD9897B2E0ACD228A7BD1C1C63002DD7EFE0B :20870300D52E0A7ACD098B7B2E0ACD528B7BD1C630E1E577C1C503C5D52E0A7ACD528B7B98
:20872300C6044FDD7EFFCE0047C52E0A7BCD228A7BC1C63002DDF9DDE1E1F1F1E92109001F :20872300D1C1C63002E1E52323363AC1C5030303C5D52E0A7BCD098B7B2E0ACD528B7BD14A
:20874300E5210301E5119687216B82CD2E8A210700E521030CE511A087216B82CD2E8A2158 :20874300C1C63002DD7EFEC6044FDD7EFFCE0047C52E0A7BCD528B7BC1C63002DDF9DDE192
:208763000600E5210315E511A887216B82CD2E8A210500E5210501E511AF87216B82CD2EB3 :20876300E1F1F1E9210900E5210301E511BD87217482CD5E8B210700E521030CE511C7878E
:208783008A210300E521050CE511B587216B82CD2E8AC95061747465726E3A2300202052B6 :20878300217482CD5E8B210600E5210315E511CF87217482CD5E8B210500E5210501E51183
:2087A3006F773A2300202042504D3A0054696D653A00202F2000DDE5DD210000DD3921F8F3 :2087A300D687217482CD5E8B210300E521050CE511DC87217482CD5E8BC9506174746572F2
:2087C300FF39F93A31B86F3E0BCDD4803EA8CD088011D007210000CDD8813E2BCD2180DD4B :2087C3006E3A23002020526F773A2300202042504D3A0054696D653A00202F2000DDE5DDC6
:2087E30077FA3E2CCD2180DD77FB3E02F53321010039EB3E31CDA8803E2DCD3A80DD73FC8E :2087E300210000DD394B42EBDD7E07DDB606DDB605DDB6042830D5C5112200210000CD6921
:20880300DD72FDDD75FEDD74FF3A30B8FD212DB8FDB602FDB601FDB600200C3E36CD3A8001 :20880300B9F1F1DD4E06DD4607C5DD4E04DD4605C5CDE6B8F1F14B423E22BB3E009A300978
:20882300ED532DB8222FB8DD7EFAF5332132B8CDF985210200E521030AE51132B8216B8210 :20882300012200C32C88010000110000213CB8197B917A9830053E3DC340883E2D77136BA2
:20884300CD2E8ADD7EFBF5332132B8CDF985210200E5210313E51132B8216B82CD2E8AD139 :20884300627DD6227CDE0038E3212200E5210601E5113CB8217482CD5E8BDDE1E1F1F1E958
:20886300D52134B8CD3686210300E521031BE51134B8216B82CD2E8A210000E52144ACE5D1 :20886300DDE5DD210000DD3921F8FF39F93A30B86F3E0BCDDD803EA8CD118011D007210084
:20888300DD5EFCDD56FDDD6EFEDD66FFCDC3B8F1E3D52137B8CD9386210500E5210507E5DF :2088830000CDE1813E28CD2A80DD77FF3A31B8D6212020DD7EFFD62020193EE4CD11801102
:2088A3001137B8216B82CD2E8A210000E52144ACE5ED5B2DB82A2FB8CDC3B8F1E3D521379F :2088A3001027210000CDE181217482CDF28B3E02CD0380DD7EFF3231B83E2BCD2A80DD7794
:2088C300B8CD9386210500E521050FE51137B8216B82CD2E8ADDF9DDE1C9CDA4853A00A80A :2088C300FA3E2CCD2A80DD77FB3E02F53321010039EB3E31CDB1803E2DCD4380DD73FCDD2C
:2088E300B7200DCD2882B73E0120023E023200A83A00A83DC26585322DB8322EB8322FB8D5 :2088E30072FDDD75FEDD74FF3A2FB8FD212CB8FDB602FDB601FDB600200C3E36CD4380ED0A
:208903003230B8CD2C83B7200B3A09B8D699CA7885C38E85216B82CD648ACDC985CD40875D :20890300532CB8222EB8DD7EFAF5332132B8CD2086210200E521030AE51132B8217482CD20
:20892300CDB98776CD718AB728273EA2CD0880111027210000CDD8813EE4CD088011102760 :208923005E8BDD7EFBF5332132B8CD2086210200E5210313E51132B8217482CD5E8BD1D5BD
:20894300210000CDD881216B82CDC28A3E02CD0380CDE58AB728273EA2CD08801110272136 :208943002134B8CD5D86210300E521031BE51134B8217482CD5E8B210000E52144ACE5DD87
:208963000000CDD8813EE4CD0880111027210000CDD881216B82CDC28A3E04CD0380CDDB67 :208963005EFCDD56FDDD6EFEDD66FFCDE6B8F1E3D52137B8CDBA86210500E5210507E51180
:208983008AB7289F3EA2CD0880111027210000CDD8813EE4CD0880111027210000CDD88102 :2089830037B8217482CD5E8B210000E52144ACE5ED5B2CB82A2EB8CDE6B8F1E3D52137B8BC
:2089A300216B82CDC28AAFCD0380C32689ED7301B83208B8ED430AB8083207B82203B8ED5C :2089A300CDBA86210500E521050FE51137B8217482CD5E8B2A2EB8E52A2CB8E5DD5EFCDDB9
:1689C3005305B83A08B8B7CADD883A08B8D603CA5285AFC3038045 :2089C30056FDDD6EFEDD66FFCDE087DDF9DDE1C93BCD0880CDCB853A5EB83C200DCD31823F
:03800000C3B08981 :2089E300B73E0120023E02325EB83A5EB83D280733C38C85C3DE8AAF322CB8322DB8322EAA
:2089D9005D6F2600547BE680B220110610ED6A17933001833FED6A10F65FEBC906097D6C02 :208A0300B8322FB8CD3583B720123A08B8D699200733C39F85C3DE8A33C3B585217482CD2B
:2089F9002600CB1DED6AED523001193F1710F5CB10505FC9DDE5DD210000DD39DD46043E87 :208A2300948BCDF085CD67872131B83621CD6388FD210000FD39FD36000076FD210000FDE6
:208A190030CD0660DDE1E133E95D6FCDDB89EBC9CDDE89EBC9DDE5E5D5DD210000DD39DD19 :208A430039FD3400FD7E00D60A3807FD360000CD6388CDA18BB728273EA2CD11801110279F
:208A3900460BDD4E0ADD5608DD5E09DD6E00DD6601D9DD6E02DD6603E5DDE1D93E03CD068D :208A6300210000CDE1813EE4CD1180111027210000CDE181217482CDF28B3E02CD0380CDCD
:188A590060D1E1DDE1E133333333E9DDE5E5DDE13E01CD0660DDE1C941 :208A8300158CB728273EA2CD1180111027210000CDE1813EE4CD1180111027210000CDE1BF
:20B83C00DDE5DD210000DD39010000DD7E07073838DDCB0426DDCB0516DDCB0616DDCB0734 :208AA30081217482CDF28B3E04CD0380CD0B8CB728883EA2CD1180111027210000CDE1819E
:20B85C00167BDD96047ADD9E057DDD9E067CDD9E073012DDCB073EDDCB061EDDCB051EDD2B :208AC3003EE4CD1180111027210000CDE181217482CDF28BAFCD0380C33D8A33C9ED730035
:20B87C00CB041E1804044818C27BDD96047ADD9E057DDD9E067CDD9E0738147BDD96045FF8 :208AE300B83207B8ED4309B8083206B82202B8ED5304B83A07B8B7CAD3893A07B8D603CA97
:20B89C007ADD9E05577DDD9E066F7CDD9E0767DDCB073EDDCB061EDDCB051EDDCB041E79A2 :068B03007985AFC3038079
:20B8BC000DB720C5DDE1C9DDE5DD210000DD39F5F5AFDD77FCDD77FDDD77FEDD77FF062061 :01BA4C00FFFA
:20B8DC007C07E6014FCB23CB12ED6ADDCBFC26DDCBFD16DDCBFE16DDCBFF16CB412804DD5E :03800000C3E08A50
:20B8FC00CBFCC6DD7EFCDD9604DD7EFDDD9E05DD7EFEDD9E06DD7EFFDD9E073826DD7EFC8E :208B09005D6F2600547BE680B220110610ED6A17933001833FED6A10F65FEBC906097D6CD0
:20B91C00DD9604DD77FCDD7EFDDD9E05DD77FDDD7EFEDD9E06DD77FEDD7EFFDD9E07DD77BF :208B29002600CB1DED6AED523001193F1710F5CB10505FC9DDE5DD210000DD39DD46043E55
:0AB93C00FFCBC3109BDDF9DDE1C96C :208B490030CD0660DDE1E133E95D6FCD0B8BEBC9CD0E8BEBC9DDE5E5D5DD210000DD39DD84
:208A7100DDE53E1ACD0660DDE1C9DDE5E5D5DD210000DD39DD460BDD4E0ADD5608DD5E099F :208B6900460BDD4E0ADD5608DD5E09DD6E00DD6601D9DD6E02DD6603E5DDE1D93E03CD065C
:208A9100DD6E00DD6601D9DD6E02DD6603DD7E0CF5E5DDE1D93E03CD0660F108D9E5DDE109 :188B890060D1E1DDE1E133333333E9DDE5E5DDE13E01CD0660DDE1C910
:208AB100D93E04CD0660D1E1DDE1E13333333333E9DDE5E5DDE13E02CD0660DDE1C9AF47C9 :20B85F00DDE5DD210000DD39010000DD7E07073838DDCB0426DDCB0516DDCB0616DDCB0711
:1E8AD1004FEDB121FFFFED42EBC9DDE53E17CD0660DDE1C9DDE53E19CD0660DDE1C9F4 :20B87F00167BDD96047ADD9E057DDD9E067CDD9E073012DDCB073EDDCB061EDDCB051EDD08
:20B89F00CB041E1804044818C27BDD96047ADD9E057DDD9E067CDD9E0738147BDD96045FD5
:20B8BF007ADD9E05577DDD9E066F7CDD9E0767DDCB073EDDCB061EDDCB051EDDCB041E797F
:20B8DF000DB720C5DDE1C9DDE5DD210000DD39F5F5AFDD77FCDD77FDDD77FEDD77FF06203E
:20B8FF007C07E6014FCB23CB12ED6ADDCBFC26DDCBFD16DDCBFE16DDCBFF16CB412804DD3B
:20B91F00CBFCC6DD7EFCDD9604DD7EFDDD9E05DD7EFEDD9E06DD7EFFDD9E073826DD7EFC6A
:20B93F00DD9604DD77FCDD7EFDDD9E05DD77FDDD7EFEDD9E06DD77FEDD7EFFDD9E07DD779C
:0AB95F00FFCBC3109BDDF9DDE1C949
:208BA100DDE53E1ACD0660DDE1C9DDE5E5D5DD210000DD39DD460BDD4E0ADD5608DD5E096E
:208BC100DD6E00DD6601D9DD6E02DD6603DD7E0CF5E5DDE1D93E03CD0660F108D9E5DDE1D8
:208BE100D93E04CD0660D1E1DDE1E13333333333E9DDE5E5DDE13E02CD0660DDE1C9AF4798
:1E8C01004FEDB121FFFFED42EBC9DDE53E17CD0660DDE1C9DDE53E19CD0660DDE1C9C2
:20B96900DDE5DD210000DD39F5F5F5DD73FCDD72FDDD75FEDD74FF4D44DD5E04DD56056960
:20B9890060CD1F8C4B42DD71FEDD70FFDD7E06DD77FADD7E07DD77FBE1D1D5E5C5DD6EFACB
:20B9A900DD66FBCD1F8CEBC1094D44DD71FEDD70FFDD5EFDDD6605C52E00550608293001BA
:20B9C9001910FAC109DD75FEDD74FFDD5E04DD66FD2E005506082930011910FA4D44DD5E78
:20B9E900FCDD6605C52E005506082930011910FAC1DD7505DD740609DD7505DD7406AFED65
:20BA0900423E0017DD7707DD5EFCDD66042E005506082930011910FADD75FCDD74FDDD36F0
:20BA29000400DD7EFCDD86045FDD7EFDDD8E0557DD7EFEDD8E066FDD7EFFDD8E0767DDF97B
:03BA4900DDE1C973
:178C1F004D44AF6FB00610200406087929CB111730011910F7EBC9FD
:00000001FF :00000001FF
+1994 -1796
View File
File diff suppressed because it is too large Load Diff
+117 -83
View File
@@ -7,7 +7,7 @@ Area Addr Size Decimal Bytes (A
Value Global Global Defined In Module Value Global Global Defined In Module
----- -------------------------------- ------------------------ ----- -------------------------------- ------------------------
00000000 .__.ABS. wc_key_pgup 00000000 .__.ABS. mul
00000000 l__BSEG 00000000 l__BSEG
00000000 l__BSS 00000000 l__BSS
00000000 l__CABS 00000000 l__CABS
@@ -16,130 +16,162 @@ Area Addr Size Decimal Bytes (A
00000000 l__GSINIT 00000000 l__GSINIT
00000000 l__HEADER 00000000 l__HEADER
00000000 l__HEAP 00000000 l__HEAP
00000000 l__INITIALIZED
00000000 l__INITIALIZER
00000000 s__CABS 00000000 s__CABS
00000000 s__DABS 00000000 s__DABS
00000000 s__HEADER 00000000 s__HEADER
00000000 s__HEADER0 00000000 s__HEADER0
00000001 l__INITIALIZED
00000001 l__INITIALIZER
00000003 l__HEADER0 00000003 l__HEADER0
0000010A l__HOME 000001ED l__HOME
00000AEC l__CODE 00000C33 l__CODE
0000103C l__DATA 0000105E l__DATA
00008003 s__CODE 00008003 s__CODE
0000A800 s__DATA 0000A800 s__DATA
0000B83C s__HOME 0000B85E s__INITIALIZED
0000B83C s__INITIALIZED 0000B85F s__HOME
0000B946 s__BSEG 0000BA4C s__GSFINAL
0000B946 s__BSS 0000BA4C s__GSINIT
0000B946 s__GSFINAL 0000BA4C s__INITIALIZER
0000B946 s__GSINIT 0000BA4D s__BSEG
0000B946 s__HEAP 0000BA4D s__BSS
0000B946 s__INITIALIZER 0000BA4D s__HEAP
ASxxxx Linker V05.50.4-SDLD, page 2. ASxxxx Linker V05.50.4-SDLD, page 2.
Hexadecimal [32-Bits] Hexadecimal [32-Bits]
Area Addr Size Decimal Bytes (Attributes) Area Addr Size Decimal Bytes (Attributes)
-------------------------------- ---- ---- ------- ----- ------------ -------------------------------- ---- ---- ------- ----- ------------
_CODE 00008003 00000AEC = 2796. bytes (REL,CON) _CODE 00008003 00000C33 = 3123. bytes (REL,CON)
Value Global Global Defined In Module Value Global Global Defined In Module
----- -------------------------------- ------------------------ ----- -------------------------------- ------------------------
00008003 _wc_exit main 00008003 _wc_exit main
00008008 _esp_cmd main 00008008 _wc_set_freq_14mhz main
00008021 _esp_rd_reg8 main 00008011 _esp_cmd main
0000803A _esp_rd_reg32 main 0000802A _esp_rd_reg8 main
000080A8 _esp_rd_regs main 00008043 _esp_rd_reg32 main
000080D4 _esp_wr_reg8 main 000080B1 _esp_rd_regs main
000080EB _esp_wr_reg32 main 000080DD _esp_wr_reg8 main
0000811B _esp_wr_end main 000080F4 _esp_wr_reg32 main
0000812A _esp_send_dma main 00008124 _esp_wr_end main
0000818E _esp_rd_end main 00008133 _esp_send_dma main
0000819D _esp_wait_status main 00008197 _esp_rd_end main
000081D8 _esp_wait_busy main 000081A6 _esp_wait_status main
000081FA _esp_create_obj main 000081E1 _esp_wait_busy main
00008228 _esp_init main 00008203 _esp_create_obj main
00008235 _err_no_esp main 00008231 _esp_init main
00008247 _err_out_of_mem main 0000823E _err_no_esp main
00008259 _err_playback main 00008250 _err_out_of_mem main
0000826B _win_xm main 00008262 _err_playback main
0000827D _win_about main 00008274 _win_xm main
0000832C _play_xm main 00008286 _win_about main
00008541 _wait_esc_key main 00008335 _play_xm main
00008549 _wait_frames main 00008568 _wait_esc_key main
00008552 _about main 00008570 _wait_frames main
00008565 _error_esp main 00008579 _about main
00008578 _error_oom main 0000858C _error_esp main
0000858E _error_playback main 0000859F _error_oom main
000085A4 _copy_file_name main 000085B5 _error_playback main
000085C9 _xm_draw_static_labels main 000085CB _copy_file_name main
000085F9 _put_hex2 main 000085F0 _xm_draw_static_labels main
00008636 _put_dec3 main 00008620 _put_hex2 main
00008693 _put_time main 0000865D _put_dec3 main
00008740 _xm_draw_stats_labels main 000086BA _put_time main
000087B9 _xm_update_info main 00008767 _xm_draw_stats_labels main
000088DD _main_start main 000087E0 _draw_progress_bar main
000089B0 _main main 00008863 _xm_update_info main
000089D9 __divuchar divunsigned 000089D3 _main_start main
000089DB __divu8 divunsigned 00008AE0 _main main
000089DE __divu16 divunsigned 00008B09 __divuchar divunsigned
000089DE __divuint divunsigned 00008B0B __divu8 divunsigned
00008A0D _wc_load512 wc_load512 00008B0E __divu16 divunsigned
00008A22 __moduchar modunsigned 00008B0E __divuint divunsigned
00008A29 __moduint modunsigned 00008B3D _wc_load512 wc_load512
00008A2E _wc_prsrw wc_prsrw 00008B52 __moduchar modunsigned
00008A64 _wc_prwow wc_prwow 00008B59 __moduint modunsigned
00008A71 _wc_key_pgdn wc_key_pgdn 00008B5E _wc_prsrw wc_prsrw
00008A7B _wc_prsrw_attr wc_prsrw_attr 00008B94 _wc_prwow wc_prwow
00008AC2 _wc_rresb wc_rresb 00008BA1 _wc_key_pgdn wc_key_pgdn
00008ACF _strlen strlen 00008BAB _wc_prsrw_attr wc_prsrw_attr
00008ADB _wc_key_esc wc_key_esc 00008BF2 _wc_rresb wc_rresb
00008AE5 _wc_key_pgup wc_key_pgup 00008BFF _strlen strlen
ASxxxx Linker V05.50.4-SDLD, page 3. ASxxxx Linker V05.50.4-SDLD, page 3.
Hexadecimal [32-Bits] Hexadecimal [32-Bits]
Area Addr Size Decimal Bytes (Attributes) Area Addr Size Decimal Bytes (Attributes)
-------------------------------- ---- ---- ------- ----- ------------ -------------------------------- ---- ---- ------- ----- ------------
_DATA 0000A800 0000103C = 4156. bytes (REL,CON) _CODE 00008003 00000C33 = 3123. bytes (REL,CON)
Value Global Global Defined In Module Value Global Global Defined In Module
----- -------------------------------- ------------------------ ----- -------------------------------- ------------------------
0000A800 _state_esp main 00008C0B _wc_key_esc wc_key_esc
0000A801 _fs_buf main 00008C15 _wc_key_pgup wc_key_pgup
0000B801 _ret_sp main 00008C1F __mulint mul
0000B803 _filesize main 00008C21 __mul16 mul
0000B807 _file_ext main
0000B808 _call_type main
0000B809 _last_esp_status main
0000B80A _p_file_name main
0000B80C _file_name main
0000B82D _total_samples main
0000B831 _xm_handle main
ASxxxx Linker V05.50.4-SDLD, page 4. ASxxxx Linker V05.50.4-SDLD, page 4.
Hexadecimal [32-Bits] Hexadecimal [32-Bits]
Area Addr Size Decimal Bytes (Attributes) Area Addr Size Decimal Bytes (Attributes)
-------------------------------- ---- ---- ------- ----- ------------ -------------------------------- ---- ---- ------- ----- ------------
_HOME 0000B83C 0000010A = 266. bytes (REL,CON) _DATA 0000A800 0000105E = 4190. bytes (REL,CON)
Value Global Global Defined In Module Value Global Global Defined In Module
----- -------------------------------- ------------------------ ----- -------------------------------- ------------------------
0000B83C __modulong _modulong 0000A800 _fs_buf main
0000B8C3 __divulong _divulong 0000B800 _ret_sp main
0000B802 _filesize main
0000B806 _file_ext main
0000B807 _call_type main
0000B808 _last_esp_status main
0000B809 _p_file_name main
0000B80B _file_name main
0000B82C _total_samples main
0000B830 _xm_handle main
0000B831 _last_track_status main
ASxxxx Linker V05.50.4-SDLD, page 5. ASxxxx Linker V05.50.4-SDLD, page 5.
Hexadecimal [32-Bits] Hexadecimal [32-Bits]
Area Addr Size Decimal Bytes (Attributes)
-------------------------------- ---- ---- ------- ----- ------------
_INITIALIZED 0000B85E 00000001 = 1. bytes (REL,CON)
Value Global Global Defined In Module
----- -------------------------------- ------------------------
0000B85E _state_esp main
ASxxxx Linker V05.50.4-SDLD, page 6.
Hexadecimal [32-Bits]
Area Addr Size Decimal Bytes (Attributes)
-------------------------------- ---- ---- ------- ----- ------------
_HOME 0000B85F 000001ED = 493. bytes (REL,CON)
Value Global Global Defined In Module
----- -------------------------------- ------------------------
0000B85F __modulong _modulong
0000B8E6 __divulong _divulong
0000B969 __mullong _mullong
ASxxxx Linker V05.50.4-SDLD, page 7.
Hexadecimal [32-Bits]
Area Addr Size Decimal Bytes (Attributes)
-------------------------------- ---- ---- ------- ----- ------------
_INITIALIZER 0000BA4C 00000001 = 1. bytes (REL,CON)
Value Global Global Defined In Module
----- -------------------------------- ------------------------
ASxxxx Linker V05.50.4-SDLD, page 8.
Hexadecimal [32-Bits]
Area Addr Size Decimal Bytes (Attributes) Area Addr Size Decimal Bytes (Attributes)
-------------------------------- ---- ---- ------- ----- ------------ -------------------------------- ---- ---- ------- ----- ------------
_HEADER0 00000000 00000003 = 3. bytes (ABS,CON) _HEADER0 00000000 00000003 = 3. bytes (ABS,CON)
Value Global Global Defined In Module Value Global Global Defined In Module
----- -------------------------------- ------------------------ ----- -------------------------------- ------------------------
ASxxxx Linker V05.50.4-SDLD, page 6. ASxxxx Linker V05.50.4-SDLD, page 9.
Files Linked [ module(s) ] Files Linked [ module(s) ]
@@ -162,8 +194,10 @@ vgm_wc_api.lib [ wc_rresb.rel ]
E:\SDCC\4.6.0\bin\..\lib\z80/z80.lib [ strlen.rel ] E:\SDCC\4.6.0\bin\..\lib\z80/z80.lib [ strlen.rel ]
vgm_wc_api.lib [ wc_key_esc.rel ] vgm_wc_api.lib [ wc_key_esc.rel ]
vgm_wc_api.lib [ wc_key_pgup.rel ] vgm_wc_api.lib [ wc_key_pgup.rel ]
E:\SDCC\4.6.0\bin\..\lib\z80/z80.lib [ _mullong.rel ]
E:\SDCC\4.6.0\bin\..\lib\z80/z80.lib [ mul.rel ]
ASxxxx Linker V05.50.4-SDLD, page 7. ASxxxx Linker V05.50.4-SDLD, page 10.
User Base Address Definitions User Base Address Definitions
+81 -75
View File
@@ -7,87 +7,93 @@ DEF l__GSFINAL 0x0
DEF l__GSINIT 0x0 DEF l__GSINIT 0x0
DEF l__HEADER 0x0 DEF l__HEADER 0x0
DEF l__HEAP 0x0 DEF l__HEAP 0x0
DEF l__INITIALIZED 0x0
DEF l__INITIALIZER 0x0
DEF s__CABS 0x0 DEF s__CABS 0x0
DEF s__DABS 0x0 DEF s__DABS 0x0
DEF s__HEADER 0x0 DEF s__HEADER 0x0
DEF s__HEADER0 0x0 DEF s__HEADER0 0x0
DEF l__INITIALIZED 0x1
DEF l__INITIALIZER 0x1
DEF l__HEADER0 0x3 DEF l__HEADER0 0x3
DEF l__HOME 0x10A DEF l__HOME 0x1ED
DEF l__CODE 0xAEC DEF l__CODE 0xC33
DEF l__DATA 0x103C DEF l__DATA 0x105E
DEF s__CODE 0x8003 DEF s__CODE 0x8003
DEF s__DATA 0xA800 DEF s__DATA 0xA800
DEF s__HOME 0xB83C DEF s__INITIALIZED 0xB85E
DEF s__INITIALIZED 0xB83C DEF s__HOME 0xB85F
DEF s__BSEG 0xB946 DEF s__GSFINAL 0xBA4C
DEF s__BSS 0xB946 DEF s__GSINIT 0xBA4C
DEF s__GSFINAL 0xB946 DEF s__INITIALIZER 0xBA4C
DEF s__GSINIT 0xB946 DEF s__BSEG 0xBA4D
DEF s__HEAP 0xB946 DEF s__BSS 0xBA4D
DEF s__INITIALIZER 0xB946 DEF s__HEAP 0xBA4D
DEF _wc_exit 0x8003 DEF _wc_exit 0x8003
DEF _esp_cmd 0x8008 DEF _wc_set_freq_14mhz 0x8008
DEF _esp_rd_reg8 0x8021 DEF _esp_cmd 0x8011
DEF _esp_rd_reg32 0x803A DEF _esp_rd_reg8 0x802A
DEF _esp_rd_regs 0x80A8 DEF _esp_rd_reg32 0x8043
DEF _esp_wr_reg8 0x80D4 DEF _esp_rd_regs 0x80B1
DEF _esp_wr_reg32 0x80EB DEF _esp_wr_reg8 0x80DD
DEF _esp_wr_end 0x811B DEF _esp_wr_reg32 0x80F4
DEF _esp_send_dma 0x812A DEF _esp_wr_end 0x8124
DEF _esp_rd_end 0x818E DEF _esp_send_dma 0x8133
DEF _esp_wait_status 0x819D DEF _esp_rd_end 0x8197
DEF _esp_wait_busy 0x81D8 DEF _esp_wait_status 0x81A6
DEF _esp_create_obj 0x81FA DEF _esp_wait_busy 0x81E1
DEF _esp_init 0x8228 DEF _esp_create_obj 0x8203
DEF _err_no_esp 0x8235 DEF _esp_init 0x8231
DEF _err_out_of_mem 0x8247 DEF _err_no_esp 0x823E
DEF _err_playback 0x8259 DEF _err_out_of_mem 0x8250
DEF _win_xm 0x826B DEF _err_playback 0x8262
DEF _win_about 0x827D DEF _win_xm 0x8274
DEF _play_xm 0x832C DEF _win_about 0x8286
DEF _wait_esc_key 0x8541 DEF _play_xm 0x8335
DEF _wait_frames 0x8549 DEF _wait_esc_key 0x8568
DEF _about 0x8552 DEF _wait_frames 0x8570
DEF _error_esp 0x8565 DEF _about 0x8579
DEF _error_oom 0x8578 DEF _error_esp 0x858C
DEF _error_playback 0x858E DEF _error_oom 0x859F
DEF _copy_file_name 0x85A4 DEF _error_playback 0x85B5
DEF _xm_draw_static_labels 0x85C9 DEF _copy_file_name 0x85CB
DEF _put_hex2 0x85F9 DEF _xm_draw_static_labels 0x85F0
DEF _put_dec3 0x8636 DEF _put_hex2 0x8620
DEF _put_time 0x8693 DEF _put_dec3 0x865D
DEF _xm_draw_stats_labels 0x8740 DEF _put_time 0x86BA
DEF _xm_update_info 0x87B9 DEF _xm_draw_stats_labels 0x8767
DEF _main_start 0x88DD DEF _draw_progress_bar 0x87E0
DEF _main 0x89B0 DEF _xm_update_info 0x8863
DEF __divuchar 0x89D9 DEF _main_start 0x89D3
DEF __divu8 0x89DB DEF _main 0x8AE0
DEF __divu16 0x89DE DEF __divuchar 0x8B09
DEF __divuint 0x89DE DEF __divu8 0x8B0B
DEF _wc_load512 0x8A0D DEF __divu16 0x8B0E
DEF __moduchar 0x8A22 DEF __divuint 0x8B0E
DEF __moduint 0x8A29 DEF _wc_load512 0x8B3D
DEF _wc_prsrw 0x8A2E DEF __moduchar 0x8B52
DEF _wc_prwow 0x8A64 DEF __moduint 0x8B59
DEF _wc_key_pgdn 0x8A71 DEF _wc_prsrw 0x8B5E
DEF _wc_prsrw_attr 0x8A7B DEF _wc_prwow 0x8B94
DEF _wc_rresb 0x8AC2 DEF _wc_key_pgdn 0x8BA1
DEF _strlen 0x8ACF DEF _wc_prsrw_attr 0x8BAB
DEF _wc_key_esc 0x8ADB DEF _wc_rresb 0x8BF2
DEF _wc_key_pgup 0x8AE5 DEF _strlen 0x8BFF
DEF _state_esp 0xA800 DEF _wc_key_esc 0x8C0B
DEF _fs_buf 0xA801 DEF _wc_key_pgup 0x8C15
DEF _ret_sp 0xB801 DEF __mulint 0x8C1F
DEF _filesize 0xB803 DEF __mul16 0x8C21
DEF _file_ext 0xB807 DEF _fs_buf 0xA800
DEF _call_type 0xB808 DEF _ret_sp 0xB800
DEF _last_esp_status 0xB809 DEF _filesize 0xB802
DEF _p_file_name 0xB80A DEF _file_ext 0xB806
DEF _file_name 0xB80C DEF _call_type 0xB807
DEF _total_samples 0xB82D DEF _last_esp_status 0xB808
DEF _xm_handle 0xB831 DEF _p_file_name 0xB809
DEF __modulong 0xB83C DEF _file_name 0xB80B
DEF __divulong 0xB8C3 DEF _total_samples 0xB82C
DEF _xm_handle 0xB830
DEF _last_track_status 0xB831
DEF _state_esp 0xB85E
DEF __modulong 0xB85F
DEF __divulong 0xB8E6
DEF __mullong 0xB969
LOAD obj/out.ihx LOAD obj/out.ihx
+539 -439
View File
File diff suppressed because it is too large Load Diff
+71 -65
View File
@@ -63,76 +63,81 @@ Hexadecimal [32-Bits]
Symbol Table Symbol Table
0 ___str_11 00000793 R 0 ___str_11 000007BA R
0 ___str_12 0000079D R 0 ___str_12 000007C4 R
0 ___str_13 000007A5 R 0 ___str_13 000007CC R
0 ___str_14 000007AC R 0 ___str_14 000007D3 R
0 ___str_15 000007B2 R 0 ___str_15 000007D9 R
0 ___str_9 000005F0 R 0 ___str_9 00000617 R
__divuchar ******** GX __divuchar ******** GX
__divuint ******** GX __divuint ******** GX
__divulong ******** GX __divulong ******** GX
__moduchar ******** GX __moduchar ******** GX
__moduint ******** GX __moduint ******** GX
__modulong ******** GX __modulong ******** GX
0 __str_0 0000028C R __mullong ******** GX
0 __str_1 00000296 R 0 __str_0 00000295 R
0 __str_2 00000297 R 0 __str_1 0000029F R
0 __str_3 000002AD R 0 __str_2 000002A0 R
0 __str_4 000002CD R 0 __str_3 000002B6 R
0 __str_5 000002EB R 0 __str_4 000002D6 R
0 __str_6 00000300 R 0 __str_5 000002F4 R
0 __str_7 0000030E R 0 __str_6 00000309 R
0 __str_8 00000317 R 0 __str_7 00000317 R
0 _about 0000054F GR 0 __str_8 00000320 R
1 _call_type 00001008 GR 7 __xinit__state_esp 00000000 R
0 _copy_file_name 000005A1 GR 0 _about 00000576 GR
1 _barbuf 0000103C R
1 _call_type 00001007 GR
0 _copy_file_name 000005C8 GR
1 _decbuf 00001034 R 1 _decbuf 00001034 R
0 _err_no_esp 00000232 GR 0 _draw_progress_bar 000007DD GR
0 _err_out_of_mem 00000244 GR 0 _err_no_esp 0000023B GR
0 _err_playback 00000256 GR 0 _err_out_of_mem 0000024D GR
0 _error_esp 00000562 GR 0 _err_playback 0000025F GR
0 _error_oom 00000575 GR 0 _error_esp 00000589 GR
0 _error_playback 0000058B GR 0 _error_oom 0000059C GR
0 _esp_cmd 00000005 GR 0 _error_playback 000005B2 GR
0 _esp_create_obj 000001F7 GR 0 _esp_cmd 0000000E GR
0 _esp_init 00000225 GR 0 _esp_create_obj 00000200 GR
0 _esp_rd_end 0000018B GR 0 _esp_init 0000022E GR
0 _esp_rd_reg32 00000037 GR 0 _esp_rd_end 00000194 GR
0 _esp_rd_reg8 0000001E GR 0 _esp_rd_reg32 00000040 GR
0 _esp_rd_regs 000000A5 GR 0 _esp_rd_reg8 00000027 GR
0 _esp_send_dma 00000127 GR 0 _esp_rd_regs 000000AE GR
0 _esp_wait_busy 000001D5 GR 0 _esp_send_dma 00000130 GR
0 _esp_wait_status 0000019A GR 0 _esp_wait_busy 000001DE GR
0 _esp_wr_end 00000118 GR 0 _esp_wait_status 000001A3 GR
0 _esp_wr_reg32 000000E8 GR 0 _esp_wr_end 00000121 GR
0 _esp_wr_reg8 000000D1 GR 0 _esp_wr_reg32 000000F1 GR
1 _file_ext 00001007 GR 0 _esp_wr_reg8 000000DA GR
1 _file_name 0000100C GR 1 _file_ext 00001006 GR
1 _filesize 00001003 GR 1 _file_name 0000100B GR
1 _fs_buf 00000001 GR 1 _filesize 00001002 GR
1 _fs_buf 00000000 GR
1 _hexbuf 00001032 R 1 _hexbuf 00001032 R
1 _last_esp_status 00001009 GR 1 _last_esp_status 00001008 GR
0 _main 000009AD GR 1 _last_track_status 00001031 GR
0 _main_start 000008DA GR
1 _p_file_name 0000100A GR
0 _play_xm 00000329 GR
0 _put_dec3 00000633 GR
ASxxxx Assembler V05.50.4+NoICE+SDCCmods-WIP-R14 (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80 / R800) Page 3 ASxxxx Assembler V05.50.4+NoICE+SDCCmods-WIP-R14 (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80 / R800) Page 3
Hexadecimal [32-Bits] Hexadecimal [32-Bits]
Symbol Table Symbol Table
0 _put_hex2 000005F6 GR 0 _main 00000ADD GR
0 _put_hex2_hexch_10000_105 00000622 R 0 _main_start 000009D0 GR
0 _put_time 00000690 GR 1 _p_file_name 00001009 GR
1 _ret_sp 00001001 GR 0 _play_xm 00000332 GR
1 _state_esp 00000000 GR 0 _put_dec3 0000065A GR
0 _put_hex2 0000061D GR
0 _put_hex2_hexch_10000_106 00000649 R
0 _put_time 000006B7 GR
1 _ret_sp 00001000 GR
2 _state_esp 00000000 GR
_strlen ******** GX _strlen ******** GX
1 _timebuf 00001037 R 1 _timebuf 00001037 R
1 _total_samples 0000102D GR 1 _total_samples 0000102C GR
0 _wait_esc_key 0000053E GR 0 _wait_esc_key 00000565 GR
0 _wait_frames 00000546 GR 0 _wait_frames 0000056D GR
0 _wc_exit 00000000 GR 0 _wc_exit 00000000 GR
_wc_key_esc ******** GX _wc_key_esc ******** GX
_wc_key_pgdn ******** GX _wc_key_pgdn ******** GX
@@ -142,25 +147,26 @@ Symbol Table
_wc_prsrw_attr ******** GX _wc_prsrw_attr ******** GX
_wc_prwow ******** GX _wc_prwow ******** GX
_wc_rresb ******** GX _wc_rresb ******** GX
0 _win_about 0000027A GR 0 _wc_set_freq_14mhz 00000005 GR
0 _win_xm 00000268 GR 0 _win_about 00000283 GR
0 _xm_draw_static_labels 000005C6 GR 0 _win_xm 00000271 GR
0 _xm_draw_stats_labels 0000073D GR 0 _xm_draw_static_labels 000005ED GR
1 _xm_handle 00001031 GR 0 _xm_draw_stats_labels 00000764 GR
0 _xm_update_info 000007B6 GR 1 _xm_handle 00001030 GR
0 _xm_update_info 00000860 GR
ASxxxx Assembler V05.50.4+NoICE+SDCCmods-WIP-R14 (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80 / R800) Page 4 ASxxxx Assembler V05.50.4+NoICE+SDCCmods-WIP-R14 (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80 / R800) Page 4
Hexadecimal [32-Bits] Hexadecimal [32-Bits]
Area Table Area Table
0 _CODE size 9D6 flags 0 0 _CODE size B06 flags 0
1 _DATA size 103C flags 0 1 _DATA size 105E flags 0
2 _INITIALIZED size 0 flags 0 2 _INITIALIZED size 1 flags 0
3 _DABS size 0 flags 8 3 _DABS size 0 flags 8
4 _HOME size 0 flags 0 4 _HOME size 0 flags 0
5 _GSINIT size 0 flags 0 5 _GSINIT size 0 flags 0
6 _GSFINAL size 0 flags 0 6 _GSFINAL size 0 flags 0
7 _INITIALIZER size 0 flags 0 7 _INITIALIZER size 1 flags 0
8 _CABS size 0 flags 8 8 _CABS size 0 flags 8
+90 -21
View File
@@ -12,12 +12,20 @@
// This used to be `const u8 state_esp = 0;`, written to via `*(u8*)&state_esp` // This used to be `const u8 state_esp = 0;`, written to via `*(u8*)&state_esp`
// as a code-size trick (skip GSINIT zero-init - a const's value is already // as a code-size trick (skip GSINIT zero-init - a const's value is already
// known at compile time). That's undefined behavior (modifying a const // known at compile time). That's undefined behavior (modifying a const
// object), and SDCC 4.6.0's more aggressive optimizer actually exploits it: // object), and SDCC 4.6.0's more aggressive optimizer exploited it (folded
// it folds `state_esp != 1` to a compile-time-constant `true` (since the // `state_esp != 1` to a compile-time-constant `true`), so it was replaced
// const's initializer is 0), permanently ignoring the "write" - which is // with a plain global on the assumption that BSS zero-init makes it start
// exactly why esp32 detection always failed after the 4.0.0->4.6.0 bump. // at 0. That assumption was WRONG for this project: crt0.s never calls
// Plain (non-const) global; BSS zero-init already makes it start at 0. // GSINIT (just `jp _main`), and hex2bin fills any address with no real hex
u8 state_esp; // record with 0xFF, not 0 - confirmed by reading obj/out.bin directly at
// state_esp's address (0xA800), which held 0xFF. So a truly-uninitialized
// global here always reads 0xFF on load, `!state_esp` is always false,
// esp_init() never runs, and error_esp() fires unconditionally - this is
// what actually broke esp32 detection, not (only) the const-UB optimizer
// fold. Fix: give it a real (non-zero) initializer so SDCC places it in the
// _DATA area with actual bytes in the loaded blob (like the original const
// did), and check against the real fill/sentinel value instead of 0.
u8 state_esp = 0xFF;
#define FS_BUF_SIZE 0x1000 #define FS_BUF_SIZE 0x1000
u8 fs_buf[FS_BUF_SIZE]; // at 0xAE00 (_PAGE2 to get page) u8 fs_buf[FS_BUF_SIZE]; // at 0xAE00 (_PAGE2 to get page)
@@ -36,6 +44,12 @@ char file_name[33];
u32 total_samples; u32 total_samples;
u8 xm_handle; u8 xm_handle;
// Set right after a successful play_xm() (track is genuinely PLAYING at that
// point); compared against TRACK_GET_INFO's ESP_REG_TRACK_STATUS on every
// poll so a PLAYING->STOPPED transition (loop limit reached, track stopped
// itself) can be told apart from a track that was simply never started.
u8 last_track_status;
// --- Extensions --------------------------- // --- Extensions ---------------------------
// file_ext is the matched entry's index into wc_h.c's ext[] table, so this // file_ext is the matched entry's index into wc_h.c's ext[] table, so this
// enum must stay in the same order as that array (XM, XMZ, S3M). // enum must stay in the same order as that array (XM, XMZ, S3M).
@@ -196,12 +210,27 @@ bool play_xm()
} }
esp_cmd(ESP_CMD_TRACK_INIT); esp_cmd(ESP_CMD_TRACK_INIT);
esp_wait_busy(10000); // TRACK_INIT now blocks on the firmware side while it measures the song's
// total sample count, capped at XM_MEASURE_MAX_US = 5s (tracker.cpp) - so
// this needs to comfortably cover 5s of real time, not the ~150ms the old
// 10000-iteration budget worked out to at 14MHz (each esp_wait_busy()
// iteration is a raw SPI status-register read, not a real-time wait).
// Iteration count isn't hardware-calibrated, so this is padded well past
// the 5s firmware cap - bump further if TRACK_INIT still times out.
esp_wait_busy(1000000);
last_esp_status = esp_rd_reg8(ESP_REG_STATUS); last_esp_status = esp_rd_reg8(ESP_REG_STATUS);
if (last_esp_status != ESP_ST_READY) if (last_esp_status != ESP_ST_READY)
return false; return false;
// Play just one loop instead of looping forever. TRACK_INIT resets the
// limit back to 0 (infinite), so this must be (re)issued after every
// TRACK_INIT/TRACK_RESET, not just once.
esp_wr_reg8(ESP_REG_OBJ_HANDLE, xm_handle);
esp_wr_reg8(ESP_REG_TRACK_MAX_LOOP_COUNT, 1);
esp_cmd(ESP_CMD_TRACK_SET_PARAMS);
esp_wait_busy(10000);
esp_cmd(ESP_CMD_TRACK_PLAY); esp_cmd(ESP_CMD_TRACK_PLAY);
esp_wait_busy(10000); esp_wait_busy(10000);
@@ -339,7 +368,7 @@ void xm_draw_stats_labels()
// wc_prsrw()'s text pointer MUST be in #8000-#BFFF (our own code/data // wc_prsrw()'s text pointer MUST be in #8000-#BFFF (our own code/data
// window) - but this plugin runs on WC's OWN stack, which lives in a // window) - but this plugin runs on WC's OWN stack, which lives in a
// DIFFERENT window (#4000-#7FFF, per plugins/READ_ME.TXT: "стек... в Win 1 // DIFFERENT window (#4000-#7FFF, per plugins/READ_ME.TXT: "стек... РІ Win 1
// #4000-#7FFF"). Local (stack-allocated) char buffers passed to wc_prsrw() // #4000-#7FFF"). Local (stack-allocated) char buffers passed to wc_prsrw()
// are therefore in the WRONG memory window entirely - this is almost // are therefore in the WRONG memory window entirely - this is almost
// certainly why xm_draw_static_labels() (string literal + a global array, // certainly why xm_draw_static_labels() (string literal + a global array,
@@ -349,10 +378,33 @@ void xm_draw_stats_labels()
static char hexbuf[2]; static char hexbuf[2];
static char decbuf[3]; static char decbuf[3];
static char timebuf[5]; static char timebuf[5];
static char barbuf[BAR_WIDTH];
#define BAR_FILLED_CH '='
#define BAR_EMPTY_CH '-'
void draw_progress_bar(u32 samples, u32 total)
{
u16 filled, i;
if (total)
{
filled = (u16)(((u32)samples * BAR_WIDTH) / total);
if (filled > BAR_WIDTH)
filled = BAR_WIDTH;
}
else
filled = 0; // total length unknown (measurement timed out) - show empty
for (i = 0; i < BAR_WIDTH; i++)
barbuf[i] = (i < filled) ? BAR_FILLED_CH : BAR_EMPTY_CH;
wc_prsrw(&win_xm, barbuf, ROW_BAR, BAR_X, BAR_WIDTH);
}
void xm_update_info() void xm_update_info()
{ {
u8 pattern, row; u8 pattern, row, status;
u16 bpm; u16 bpm;
u32 samples; u32 samples;
@@ -360,6 +412,19 @@ void xm_update_info()
esp_cmd(ESP_CMD_TRACK_GET_INFO); esp_cmd(ESP_CMD_TRACK_GET_INFO);
esp_wait_busy(2000); esp_wait_busy(2000);
// TRACK_GET_INFO already writes ESP_REG_TRACK_STATUS (same register
// TRACK_GET_STATE reports), so no separate command is needed to catch the
// PLAYING->STOPPED transition once the loop-count limit is reached.
status = esp_rd_reg8(ESP_REG_TRACK_STATUS);
if (last_track_status == TRACK_OBJ_ST_PLAYING && status == TRACK_OBJ_ST_STOPPED)
{
esp_cmd(ESP_CMD_KILL_OBJECTS);
esp_wait_busy(10000);
wc_rresb(&win_xm);
wc_exit(WC_NEXT_FILE);
}
last_track_status = status;
pattern = esp_rd_reg8(ESP_REG_TRACK_PATTERN); pattern = esp_rd_reg8(ESP_REG_TRACK_PATTERN);
row = esp_rd_reg8(ESP_REG_TRACK_ROW); row = esp_rd_reg8(ESP_REG_TRACK_ROW);
esp_rd_regs(ESP_REG_TRACK_BPM, &bpm, 2); esp_rd_regs(ESP_REG_TRACK_BPM, &bpm, 2);
@@ -383,17 +448,23 @@ void xm_update_info()
put_time(timebuf, total_samples / 44100UL); put_time(timebuf, total_samples / 44100UL);
wc_prsrw(&win_xm, timebuf, ROW_TIME, 15, 5); wc_prsrw(&win_xm, timebuf, ROW_TIME, 15, 5);
// Progress bar skipped for now per user request - reintroduce as its own draw_progress_bar(samples, total_samples);
// separate step once Pattern/Row/BPM/Time are confirmed stable.
} }
void main_start() void main_start()
{ {
u8 frame_ctr; u8 frame_ctr;
// Pin the Z80 clock for the whole plugin lifetime - our esp_wait_busy()
// timeouts are iteration counters, not real time, so leaving WC's turbo
// setting as-is would make esp32 SPI timing margins depend on whatever
// frequency happened to be active before the plugin started.
wc_set_freq_14mhz();
copy_file_name(); copy_file_name();
if (!state_esp) if (state_esp == 0xFF)
state_esp = esp_init() ? 1 : 2; state_esp = esp_init() ? 1 : 2;
if (state_esp != 1) if (state_esp != 1)
@@ -419,7 +490,8 @@ void main_start()
wc_prwow(&win_xm); wc_prwow(&win_xm);
xm_draw_static_labels(); xm_draw_static_labels();
xm_draw_stats_labels(); xm_draw_stats_labels();
xm_update_info(); // single call for now - periodic re-calling is a separate step, once this is confirmed stable last_track_status = TRACK_OBJ_ST_PLAYING;
xm_update_info();
frame_ctr = 0; frame_ctr = 0;
@@ -430,14 +502,11 @@ void main_start()
halt halt
__endasm; __endasm;
// DEBUG: periodic xm_update_info() disabled - isolating whether repeated if (++frame_ctr >= 10) // ~5 updates/sec at 50Hz
// wc_prsrw() calls over time (not just one initial call) is what causes {
// the screen to fill with garbage after a while. frame_ctr = 0;
// if (++frame_ctr >= 10) // ~5 updates/sec at 50Hz xm_update_info();
// { }
// frame_ctr = 0;
// xm_update_info();
// }
if (wc_key_pgdn()) // PgDn - unload and go to next file if (wc_key_pgdn()) // PgDn - unload and go to next file
{ {
+22
View File
@@ -39,3 +39,25 @@ void wc_exit(u8 rc) __naked
ret ret
__endasm; __endasm;
} }
// _TURBOPL (0x0E) is also ours - not wrapped by vgm_wc_api.lib. Our
// esp_wait_busy()/esp_wr_end()/etc. timeouts are plain iteration counters,
// not real-time based, so they implicitly assume a specific Z80 clock; if WC
// was left in turbo mode before the plugin started, the same iteration
// budget covers less real time and could cut SPI exchanges with the esp32
// short. Pinning a known frequency for the whole plugin lifetime removes
// that as a variable - set once at startup, left as-is on exit (per user
// request, not restored to whatever WC had before). No parameters (avoids
// depending on exactly how two u8 args would be register-assigned under
// --sdcccall 1 - not worth the risk for a fixed value), and IX isn't
// preserved since _WCAPI clobbering it is already tolerated by every other
// call in this file.
void wc_set_freq_14mhz() __naked
{
__asm
ld b, #0x00 ; type: Z80 frequency
ld c, #0x02 ; %10 = 14 MHz
ld a, #_TURBOPL
jp _WCAPI
__endasm;
}