Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[F.Rq.] Support for Analogue Pocket .pocket roms #27

Open
YoshiRulz opened this issue Jul 19, 2024 · 0 comments
Open

[F.Rq.] Support for Analogue Pocket .pocket roms #27

YoshiRulz opened this issue Jul 19, 2024 · 0 comments

Comments

@YoshiRulz
Copy link
Contributor

YoshiRulz commented Jul 19, 2024

For those out-of-the-loop, the Pocket is a proprietary FPGA-based handheld. However, roms made for it (with GB Studio, or GBDK directly) are almost identical to GB roms:

sample diff

Diff from GB to AP variants of GB-Wordyl v1.0.3.

@@ -3,31 +3,31 @@
 00000020: e9ff ffff ffff ffff 220d 20fc c9ff ffff  ........". .....
 00000030: 1a22 130d 20fa c9ff ffff ffff ffff ffff  .".. ...........
 00000040: f5e5 21a5 c0c3 8000 ffff ffff ffff ffff  ..!.............
 00000050: ffff ffff ffff ffff ffff ffff ffff ffff  ................
 00000060: ffff ffff ffff ffff ffff ffff ffff ffff  ................
 00000070: ffff ffff ffff ffff ffff ffff ffff ffff  ................
 00000080: c5d5 2ab6 280b e53a 6e67 e7e1 2318 f3e8  ..*.(..:ng..#...
-00000090: 04d1 c1e1 f041 e602 20fa f1d9 21a3 c034  .....A.. ...!..4
-000000a0: 2002 2334 cd80 ff3e 01e0 91c9 f041 e602   .#4...>.....A..
+00000090: 04d1 c1e1 f041 e640 20fa f1d9 21a3 c034  .....A.@ ...!..4
+000000a0: 2002 2334 cd80 ff3e 01e0 91c9 f041 e640   .#4...>.....A.@
 000000b0: 20fa 3ec0 c384 ffd5 af01 8719 21a0 c0cd   .>.........!...
 000000c0: 3e75 3ec0 e092 67af 6f0e a0ef d1c9 ffff  >u>...g.o.......
 000000d0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
 000000e0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
 000000f0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
-00000100: 1855 ffff ceed 6666 cc0d 000b 0373 0083  .U....ff.....s..
-00000110: 000c 000d 0008 111f 8889 000e dccc 6ee6  ..............n.
-00000120: dddd d999 bbbb 6763 6e0e eccc dddc 999f  ......gcn.......
-00000130: bbb9 333e 4742 2d57 4f52 4459 4c00 0000  ..3>GB-WORDYL...
-00000140: 0000 0080 3030 031b 0002 0033 011c 7951  ....00.....3..yQ
+00000100: 1855 ffff 0110 ceef 0000 44aa 0074 0018  .U........D..t..
+00000110: 1195 0034 001a 00d5 0022 0069 6ff6 f773  ...4.....".io..s
+00000120: 0990 e110 4440 9a90 d5d0 4430 a921 5d48  [email protected].!]H
+00000130: 22e0 f860 4742 2d57 4f52 4459 4c00 0000  "..`GB-WORDYL...
+00000140: 0000 0080 3030 031b 0002 0033 011c 787f  ....00.....3..x.
 00000150: faa1 c047 faa0 c0f3 5758 3100 e0cd b700  ...G....WX1.....
 00000160: 7aea a0c0 fe11 2007 afcb 3b17 eaa1 c0cd  z..... ...;.....
 00000170: a275 afe0 42e0 43e0 41e0 4a3e 07e0 4b11  .u..B.C.A.J>..K.
 00000180: c601 2180 ff0e 0cf7 cd80 ff01 9c00 cd84  ..!.............
-00000190: 753e e4e0 47e0 483e 1be0 493e c0e0 40af  u>..G.H>..I>..@.
+00000190: 753e e4e0 47e0 483e 1be0 493e 03e0 4eaf  u>..G.H>..I>..N.
 000001a0: e00f 3e01 e0ff e090 af21 a3c0 2277 e026  ..>......!.."w.&
 000001b0: cd16 79fb cdd5 0276 0018 fcf3 f802 afe0  ..y....v........
 000001c0: 0f7e fbe0 ffc9 f092 b7c8 e046 3e28 3d20  .~.........F>(= 
 000001d0: fdc9 ffff ffff ffff ffff ffff ffff ffff  ................
 000001e0: c9ff ffff ffff ffff ffff ffff ffff ffff  ................
 000001f0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
 00000200: 21a2 cc36 0021 a3cc 3600 21a4 cc36 0121  !..6.!..6.!..6.!
@@ -41,25 +41,25 @@
 00000280: 0d11 0000 d511 a802 3e68 cdc1 27c9 01a2  ........>h..'...
 00000290: cc0a cb47 2804 af02 1803 3e01 023e 07cd  ...G(.....>..>..
 000002a0: 4a08 cd75 71c3 9d24 4841 5244 204d 4f44  J..uq..$HARD MOD
 000002b0: 453a 2043 414e 0a4f 4e4c 5920 4348 414e  E: CAN.ONLY CHAN
 000002c0: 4745 2041 540a 5354 4152 5420 4f46 2052  GE AT.START OF R
 000002d0: 4f55 4e44 003e 01e0 9021 0030 3600 2620  OUND.>...!.06.& 
 000002e0: 3601 2640 3600 6536 00cd 560c cde4 113e  6.&@6.e6..V....>
-000002f0: 07e0 4b3e 90e0 4af0 40f6 20e0 40f0 40f6  ..K>..J.@. .@.@.
-00000300: 01e0 40f0 40f6 80e0 40cd 1326 cdef 24cd  ..@.@...@..&..$.
+000002f0: 07e0 4b3e 90e0 4af0 4ef6 04e0 4ef0 4ef6  ..K>..J.N...N.N.
+00000300: 80e0 4ef0 4ef6 01e0 4ecd 1326 cdef 24cd  ..N.N...N..&..$.
 00000310: 1d15 218f cc36 003e 80e0 263e ffe0 253e  ..!..6.>..&>..%>
 00000320: 77e0 24f3 11c5 26d5 cdc5 75e1 fbfa 8fcc  w.$...&...u.....
 00000330: b728 17fa 8fcc d602 282b fa8f ccd6 0328  .(......(+.....(
 00000340: 69fa 8fcc d604 2868 18e3 cd39 1911 29da  i.....(h...9..).
 00000350: f004 1221 54cc 36de 2336 0dcd 940a 218f  ...!T.6.#6....!.
 00000360: cc36 0218 c8cd ca0a cd2b 1221 27da cb46  .6.......+.!'..F
 00000370: 282e cd35 0221 a6cc cb46 2805 cdc9 1b18  (..5.!...F(.....
 00000380: 03cd ec06 2127 da36 0011 28da f004 1221  ....!'.6..(....!
-00000390: 28da 2a4f 46c5 cd92 78e1 f040 f602 e040  (.*OF...x..@...@
+00000390: 28da 2a4f 46c5 cd92 78e1 f04e f640 e04e  (.*[email protected]
 000003a0: cd6e 0a21 8fcc 3603 1883 cdf9 0ac3 2d03  .n.!..6.......-.
 000003b0: cde4 1121 8fcc 3602 c32d 0321 b1c0 3600  ...!..6..-.!..6.
 000003c0: cd2d 0521 87da 3600 2185 da3e 7222 3605  .-.!..6.!..>r"6.
 000003d0: 1100 00d5 11b3 c03e 08cd c127 012a da21  .......>...'.*.!
 000003e0: b2c0 6e26 0029 095d 541a 2160 c122 131a  ..n&.).]T.!`."..
 000003f0: 7721 61c1 3ab6 280b 2160 c16e fa61 c167  w!a.:.(.!`.n.a.g
 00000400: cd69 7721 b1c0 cb46 2803 cd75 7121 87da  .iw!...F(..uq!..
@@ -192,29 +192,29 @@
 00000bf0: cc7e d604 3008 34c5 3e03 cd4a 08c1 0e01  .~..0.4.>..J....
 00000c00: 1809 c5af cd4a 08cd 7a0f c1c5 cda8 0ec1  .....J..z.......
 00000c10: c305 0b7a b328 1321 c1cc 7eb7 2808 35c5  ...z.(.!..~.(.5.
 00000c20: 3e03 cd4a 08c1 0e01 180a c53e 01cd 4a08  >..J.......>..J.
 00000c30: cdd0 0fc1 c5cd a80e c1c3 050b 3333 c901  ............33..
 00000c40: ddc1 0269 6023 73c5 cd70 73e1 c901 bb7f  ...i`#s..ps.....
 00000c50: b556 f925 0000 0e04 79b7 2806 cd92 750d  .V.%....y.(...u.
-00000c60: 18f6 f040 f680 e040 cd28 737b b7c8 216b  ...@...@.(s{..!k
+00000c60: 18f6 f04e f601 e04e cd28 737b b7c8 216b  ...N...N.(s{..!k
 00000c70: da36 010e 003e 1391 380b 21dd c106 0009  .6...>..8.!.....
 00000c80: 3600 0c18 f01e 013e b9cd 3f0c 3ee4 e049  6......>..?.>..I
-00000c90: 3ee4 e048 3ee4 e047 afe0 42af e043 f040  >..H>..G..B..C.@
-00000ca0: 4ff0 40e6 fde0 40f0 40e6 dfe0 40f0 40f6  O.@...@.@...@.@.
-00000cb0: 01e0 40f0 40f6 80e0 4011 f1c1 d511 f828  ..@.@...@......(
+00000c90: 3ee4 e048 3ee4 e047 afe0 42af e043 f04e  >..H>..G..B..C.N
+00000ca0: 4ff0 4ee6 bfe0 4ef0 4ee6 fbe0 4ef0 4ef6  O.N...N.N...N.N.
+00000cb0: 80e0 4ef0 4ef6 01e0 4e11 f1c1 d511 f828  ..N.N...N......(
 00000cc0: d5cd d874 e804 2151 cc3e f122 36c1 0600  ...t..!Q.>."6...
 00000cd0: 583e 0d93 381d 1600 3e13 9238 1378 04d5  X>..8...>..8.x..
 00000ce0: f533 7bf5 33d5 33cd d772 e803 d114 18e8  .3{.3.3..r......
 00000cf0: 1c18 de21 51cc 2a5f 56d5 2100 a6e5 cd04  ...!Q.*_V.!.....
 00000d00: 78e8 04c5 1e00 3e99 cd3f 0cc1 11f1 c1d5  x.....>..?......
 00000d10: 1186 1dd5 cdd8 74e8 0411 f1c1 d521 0070  ......t......!.p
 00000d20: e5cd 0478 e804 11d8 28d5 2180 02e5 cd04  ...x....(.!.....
 00000d30: 78e8 04c5 1e00 3ea1 cd3f 0cc1 114d 0cd5  x.....>..?...M..
-00000d40: cd70 73e1 79e0 40af 672e 12e5 3e14 f533  [email protected]...>..3
+00000d40: cd70 73e1 79e0 4eaf 672e 12e5 3e14 f533  .ps.y.N.g...>..3
 00000d50: af0f f5cd 1777 e805 1e00 3eb9 c33f 0ce8  .....w....>..?..
 00000d60: fa21 54cc 4e23 461e 1bf8 0036 e623 36d9  .!T.N#F....6.#6.
 00000d70: 0af8 0277 037e 3c28 4c0a f804 3203 0a22  ...w.~<(L...2.."
 00000d80: 2303 73f8 043a 9630 e723 d1d5 3a2b 12d1  #.s..:.0.#..:+..
 00000d90: d513 7e12 1333 33d5 f805 7eea 8bda 1104  ..~..33...~.....
 00000da0: 0ed5 2102 02e5 f806 2a23 f533 7ef5 33cd  ..!.....*#.3~.3.
 00000db0: 9d78 e806 218b da36 00f8 0534 3434 343a  .x..!..6...4444:
@@ -593,15 +593,15 @@
 00002500: d5af 3cf5 cd04 78e8 0401 b6d8 c511 f32f  ..<...x......../
 00002510: d5cd d874 e804 c521 c10a e5cd 4d76 e804  ...t...!....Mv..
 00002520: 11d6 d4d5 1143 2fd5 cdd8 74e8 0411 d6d4  .....C/...t.....
 00002530: d521 9308 e5cd 4d76 e804 116e d3d5 11d2  .!....Mv...n....
 00002540: 2fd5 cdd8 74e8 04c5 cd64 27c1 c511 4230  /...t....d'...B0
 00002550: d5cd d874 e804 c521 9b26 e5cd 4d76 e804  ...t...!.&..Mv..
 00002560: 11d6 d4d5 11fd 2cd5 cdd8 74e8 0411 682f  ......,...t...h/
-00002570: d5af f533 cdf0 73e8 03f0 40e6 fbe0 4021  ...3..s...@...@!
+00002570: d5af f533 cdf0 73e8 03f0 4ee6 dfe0 4e21  ...3..s...N...N!
 00002580: 02c0 3600 2106 c036 0021 0ac0 3600 210e  ..6.!..6.!..6.!.
 00002590: c036 0021 03c0 3600 2107 c036 2021 0bc0  .6.!..6.!..6 !..
 000025a0: 3640 210f c036 60f8 0036 010e 0479 d608  6@!..6`..6...y..
 000025b0: 301c f800 4634 6926 0029 295d 5421 01c0  0...F4i&.))]T!..
 000025c0: 1923 7021 01c0 1923 2336 030c 18df 2122  .#p!...##6....!"
 000025d0: c036 0521 26c0 3606 212a c036 0621 2ec0  .6.!&.6.!*.6.!..
 000025e0: 3605 2123 c036 1621 27c0 3616 212b c036  6.!#.6.!'.6.!+.6
@@ -1827,104 +1827,104 @@
 00007220: 4f9f 9047 f1e6 80c8 9793 5f9f 9257 c9f1  O..G......_..W..
 00007230: f1c9 0600 507b b220 0701 0000 5059 37c9  ....P{. ....PY7.
 00007240: 6960 0100 00b7 3e10 f5cb 15cb 14cb 11cb  i`....>.........
 00007250: 10c5 799b 4f78 9a47 3f38 08c1 f13d b720  ..y.Ox.G?8...=. 
 00007260: e718 08f1 f13d 3720 df18 0050 59cb 154d  .....=7 ...PY..M
 00007270: cb14 44b7 c9c5 0e6a 1803 c50e 68f8 042a  ..D....j....h..*
 00007280: 8787 87f6 80e2 0c2a 8787 8747 2a66 6ff0  .......*...G*fo.
-00007290: 41e6 0220 fa2a e205 20f5 c1c9 c50e 6a18  A.. .*.. .....j.
+00007290: 41e6 4020 fa2a e205 20f5 c1c9 c50e 6a18  A.@ .*.. .....j.
 000072a0: 03c5 0e68 f804 2a87 8747 2a80 87f6 80e2  ...h..*..G*.....
-000072b0: 0c2a 666f f041 e602 20fa 7de2 7ce2 c1c9  .*fo.A.. .}.|...
-000072c0: f802 2a5f 2a57 f041 e602 20fa 7e12 c9f0  ..*_*W.A.. .~...
-000072d0: 40e6 4028 0818 0af0 40e6 0820 0416 9818  @.@(....@.. ....
+000072b0: 0c2a 666f f041 e640 20fa 7de2 7ce2 c1c9  .*fo.A.@ .}.|...
+000072c0: f802 2a5f 2a57 f041 e640 20fa 7e12 c9f0  ..*_*W.A.@ .~...
+000072d0: 4ee6 0228 0818 0af0 4ee6 1020 0416 9818  N..(....N.. ....
 000072e0: 0216 9cc5 f804 2a47 2a5a cb37 074f e603  ......*G*Z.7.O..
-000072f0: 8357 3ee0 a180 5ff0 41e6 0220 fa7e 12c1  .W>..._.A.. .~..
-00007300: c9f0 40e6 4028 0818 0af0 40e6 0820 0416  ..@.@(....@.. ..
+000072f0: 8357 3ee0 a180 5ff0 41e6 4020 fa7e 12c1  .W>..._.A.@ .~..
+00007300: c9f0 4ee6 0228 0818 0af0 4ee6 1020 0416  ..N..(....N.. ..
 00007310: 9818 0216 9cf8 033a 6e5a cb37 0767 e603  .......:nZ.7.g..
 00007320: 8357 3ee0 a485 5fc9 c5e8 f0f8 000e 10af  .W>..._.........
 00007330: eff8 003e 8922 3e03 32cd 7573 0e00 3e30  ...>.">.2.us..>0
 00007340: e2f2 f21e 04f2 473e 20e2 f2f2 3e10 e2f2  ......G> ...>...
 00007350: f23e 30e2 f2f2 f2f2 b820 071d 20e8 1e00  .>0...... .. ...
 00007360: 180a f801 3e00 32cd 7573 1e01 e810 c1c9  ....>.2.us......
 00007370: f802 2a66 6fc5 7ee6 0328 39f5 0e00 e23e  ..*fo.~..(9....>
 00007380: 30e2 0610 1e08 2a57 cb3a 3e10 3802 3e20  0.....*W.:>.8.> 
 00007390: e2f2 f23e 30e2 f2f2 1d20 ed05 20e6 3e20  ...>0.... .. .> 
 000073a0: e2f2 f23e 30e2 11d0 20f0 001b 7ab3 20f9  ...>0... ...z. .
 000073b0: f13d 20c7 c1c9 d5f8 053a 6e60 477d 69cb  .= ......:n`G}i.
 000073c0: 381f 4f30 032a 1213 cb38 cb19 040c 300e  8.O0.*...8....0.
 000073d0: 1806 2a12 132a 1213 2a12 132a 1213 0d20  ..*..*..*..*... 
-000073e0: f105 20ee c1e1 f1e9 1690 f040 e610 2802  .. ........@..(.
+000073e0: f105 20ee c1e1 f1e9 1690 f04e e608 2802  .. ........N..(.
 000073f0: 1680 f802 2acb 375f e60f 8257 7be6 f05f  ....*.7_...W{.._
 00007400: cb5a 2802 cba2 2a66 6fc5 d52a b7ca b374  .Z(...*fo..*...t
 00007410: cb7f 2048 cb77 201a e63f 3c4f 2a47 f041  .. H.w ..?<O*G.A
-00007420: e602 20fa 7812 13cb 5a28 02cb a20d 20ee  .. .x...Z(.... .
-00007430: 18d9 e63f 3c4f 2a47 f041 e602 20fa 7812  ...?<O*G.A.. .x.
-00007440: 13cb 5a28 02cb a2f0 41e6 0220 fa7e 1213  ..Z(....A.. .~..
+00007420: e640 20fa 7812 13cb 5a28 02cb a20d 20ee  .@ .x...Z(.... .
+00007430: 18d9 e63f 3c4f 2a47 f041 e640 20fa 7812  ...?<O*G.A.@ .x.
+00007440: 13cb 5a28 02cb a2f0 41e6 4020 fa7e 1213  ..Z(....A.@ .~..
 00007450: cb5a 2802 cba2 0d20 df23 18af cb77 203a  .Z(.... .#...w :
 00007460: e63f 3ce5 4e23 46f8 03cb 6628 0b62 6b09  .?<.N#F...f(.bk.
-00007470: cb5c 2002 cbe4 1803 626b 094f f041 e602  .\ .....bk.O.A..
+00007470: cb5c 2002 cbe4 1803 626b 094f f041 e640  .\ .....bk.O.A.@
 00007480: 20fa 2a12 cb5c 2802 cba4 13cb 5a28 02cb   .*..\(.....Z(..
 00007490: a20d 20e8 e123 23c3 0b74 e63f 3c4f f041  .. ..##..t.?<O.A
-000074a0: e602 20fa 2a12 13cb 5a28 02cb a20d 20ee  .. .*...Z(.... .
+000074a0: e640 20fa 2a12 13cb 5a28 02cb a20d 20ee  .@ .*...Z(.... .
 000074b0: c30b 74d1 c1c9 f04d e680 c8f0 fff5 afe0  ..t....M........
 000074c0: ffe0 0f3e 30e0 003e 01e0 4d10 00f1 e0ff  ...>0..>..M.....
 000074d0: c9f0 4de6 80c0 18e3 f805 3a57 3a5f 3a6e  ..M.......:W:_:n
 000074e0: 67c5 d52a b728 4ecb 7f20 24cb 7720 0ce6  g..*.(N.. $.w ..
 000074f0: 3f3c 472a 1213 0520 fb18 e8e6 3f3c 4623  ?<G*... ....?<F#
 00007500: 4e23 f578 1213 7912 13f1 3d20 f518 d4cb  N#.x..y...= ....
 00007510: 7720 16e6 3f3c e54e 2346 626b 0947 2a12  w ..?<.N#Fbk.G*.
 00007520: 1305 20fa e123 2318 bae6 3f3c 472a 1213  .. ..##...?<G*..
 00007530: 0520 fa18 aee1 7b95 5f7a 9c57 c1c9 5f78  . ....{._z.W.._x
 00007540: b1c8 730b 545d 1378 b1c8 cb38 cb19 3003  ..s.T].x...8..0.
 00007550: 2a12 1304 0c18 062a 1213 2a12 130d 20f7  *......*..*... .
 00007560: 0520 f4c9 21a5 c02a 5f56 23b2 c87b b920  . ..!..*_V#..{. 
 00007570: f67a b820 f254 5d1b 1b2a 1247 132a 1213  .z. .T]..*.G.*..
 00007580: b0c8 18f5 21a5 c02a b628 0323 18f9 7832  ....!..*.(.#..x2
-00007590: 71c9 f040 e680 c8af e091 7600 f091 b728  [email protected]....(
-000075a0: f9c9 f040 e680 c8f0 44fe 9230 faf0 44fe  [email protected].
-000075b0: 9138 faf0 40e6 7fe0 40c9 c5f8 042a 4f46  .8..@...@....*OF
+00007590: 71c9 f04e e601 c8af e091 7600 f091 b728  q..N......v....(
+000075a0: f9c9 f04e e601 c8f0 44fe 9230 faf0 44fe  ...N....D..0..D.
+000075b0: 9138 faf0 4ee6 fee0 4ec9 c5f8 042a 4f46  .8..N...N....*OF
 000075c0: cd64 75c1 c9c5 f804 2a4f 46cd 8475 c1c9  .du.....*OF..u..
 000075d0: 1a4f 3e0f 2183 da96 3e00 17a1 c021 84da  .O>.!...>....!..
 000075e0: 4ecb 7928 0caf e019 afe0 18af e017 afe0  N.y(............
 000075f0: 16cb 6928 0caf e023 afe0 22af e021 afe0  ..i(...#.."..!..
 00007600: 201a e60f ea83 da1a ea84 da13 1aea 80da   ...............
 00007610: 1321 23da 7b22 7221 81da 3600 c943 4254  .!#.{"r!..6..CBT
 00007620: 2d46 5820 4259 2043 4f46 4645 4542 4154  -FX BY COFFEEBAT
 00007630: 2032 3032 312d 3230 3232 00c5 f804 2a57   2021-2022....*W
 00007640: 5ef8 083a 473a 666f cdc1 76c1 c916 90f0  ^..:G:fo..v.....
-00007650: 40e6 1028 0216 80c5 f804 2a5f 2a4f 2a66  @..(......*_*O*f
+00007650: 4ee6 0828 0216 80c5 f804 2a5f 2a4f 2a66  N..(......*_*O*f
 00007660: 6fcb 337b e60f 8257 7be6 f05f d554 5de1  o.3{...W{.._.T].
 00007670: cb5c 2802 cba4 0608 c51a 13d5 e521 88da  .\(..........!..
 00007680: 4e23 6669 1e08 1f38 0354 1801 55cb 3acb  N#fi...8.T..U.:.
-00007690: 19cb 3acb 181d 20ee e1f0 41e6 0220 fa71  ..:... ...A.. .q
+00007690: 19cb 3acb 181d 20ee e1f0 41e6 4020 fa71  ..:... ...A.@ .q
 000076a0: 2c70 23d1 c105 20d0 0d20 c5c1 c9c5 f804  ,p#... .. ......
 000076b0: 2a57 5ef8 093a 473a 4f3a 666f cda5 77c1  *W^..:G:O:fo..w.
-000076c0: c9e5 f040 e640 2809 180c e5f0 40e6 0820  ...@.@(.....@.. 
+000076c0: c9e5 f04e e602 2809 180c e5f0 4ee6 1020  ...N..(.....N.. 
 000076d0: 0521 0098 1803 2100 9cc5 cb33 cb03 7be6  .!....!....3..{.
-000076e0: 0384 473e e0a3 824f e1d1 d5c5 f041 e602  ..G>...O.....A..
+000076e0: 0384 473e e0a3 824f e1d1 d5c5 f041 e640  ..G>...O.....A.@
 000076f0: 20fa 7c02 79e6 e05f 793c e61f b34f 1520   .|.y.._y<...O. 
 00007700: ebc1 d11d c8d5 78e6 fc5f 3e20 814f 8891  ......x.._> .O..
 00007710: e603 b347 c518 d5c5 f804 2a57 5ef8 083a  ...G......*W^..:
 00007720: 473a 666f cdca 76c1 c9f5 d516 7fcd 3977  G:fo..v.......9w
 00007730: b720 f815 20f7 d1f1 c93e 20e0 00f0 00f0  . .. ....> .....
 00007740: 00e6 0f5f 3e10 e000 f000 f000 f000 f000  ..._>...........
 00007750: f000 f000 e60f cb37 b32f 5f3e 30e0 007b  .......7./_>0..{
 00007760: c957 cd39 77a2 28fa c9e9 f802 2aea 88da  .W.9w.(.....*...
 00007770: 2aea 89da 7eea 8ada c9c5 cd8f 7706 32c5  *...~.......w.2.
 00007780: c1c5 c100 05c2 7f77 00c1 c5c1 0000 c91b  .......w........
 00007790: 7bb2 c806 33c5 c1c5 c100 05c2 9577 00c5  {...3........w..
-000077a0: c100 0018 eae5 f040 e640 2809 180c e5f0  .......@.@(.....
-000077b0: 40e6 0820 0521 0098 1803 2100 9cc5 cb33  @.. .!....!....3
+000077a0: c100 0018 eae5 f04e e602 2809 180c e5f0  .......N..(.....
+000077b0: 4ee6 1020 0521 0098 1803 2100 9cc5 cb33  N.. .!....!....3
 000077c0: cb03 7be6 0384 473e e0a3 824f e1d1 d5c5  ..{...G>...O....
-000077d0: f041 e602 20fa fa8b da86 0223 79e6 e05f  .A.. ......#y.._
+000077d0: f041 e640 20fa fa8b da86 0223 79e6 e05f  .A.@ ......#y.._
 000077e0: 793c e61f b34f 1520 e7c1 d11d c8d5 78e6  y<...O. ......x.
 000077f0: fc5f 3e20 814f 8891 e603 b347 c518 d1f8  ._> .O.....G....
-00007800: 0656 180a 1690 f040 e610 2802 1680 c5f8  .V.....@..(.....
+00007800: 0656 180a 1690 f04e e608 2802 1680 c5f8  .V.....N..(.....
 00007810: 042a 5f2a 4f2a 666f cb33 7be6 0f82 577b  .*_*O*fo.3{...W{
-00007820: e6f0 5fcb 5a28 02cb a206 10f0 41e6 0220  .._.Z(......A.. 
+00007820: e6f0 5fcb 5a28 02cb a206 10f0 41e6 4020  .._.Z(......A.@ 
 00007830: fa2a 1213 0520 f40d 20e9 c1c9 f802 2a66  .*... .. .....*f
 00007840: 6f11 0000 2ab7 c813 18fa f802 2a5f 2a57  o...*.......*_*W
 00007850: 2a66 6f1a 9620 08be 1323 20f7 575f c911  *fo.. ...# .W_..
 00007860: ffff d811 0100 c9fa 25da 6f5f fa26 da57  ........%.o_.&.W
 00007870: cb25 17cb 2517 cb25 17cb 2517 677b 856f  .%..%..%..%.g{.o
 00007880: 7c8a 677d c693 ea25 da57 7cce 5cea 26da  |.g}...%.W|.\.&.
 00007890: 5fc9 f802 2aea 25da 7eea 26da c9c5 f804  _...*.%.~.&.....

(There doesn't appear to be any official documentation on this instruction set. Analogue, the company, apparently sponsored the addition of the ap target to GBDK, making it effectively a reference implementation.)

The main difference seems to be that the graphics interface uses a different bus address and uses bitmasks which are reversed as compared to the Game Boy. I'm inferring this from GBDK's source; when you replace the linker flag -msm83:gb with -msm83:ap, the platform-specific implementations are switched out, the differences between them being:

diffs

/gbdk-lib/libc/targets/sm83/{gb,ap}/crt0.s:

@@ -145,32 +145,26 @@ _set_interrupts::
         ;; Jump table for modes: 4 modes, 4 bytes each 16 bytes total
         RET
 
         ;; GameBoy Header
         .org    0x100
 .header:
         JR      .code_start
 
         ;; Nintendo logo
         .org    0x104
-        .byte   0xCE,0xED,0x66,0x66
-        .byte   0xCC,0x0D,0x00,0x0B
-        .byte   0x03,0x73,0x00,0x83
-        .byte   0x00,0x0C,0x00,0x0D
-        .byte   0x00,0x08,0x11,0x1F
-        .byte   0x88,0x89,0x00,0x0E
-        .byte   0xDC,0xCC,0x6E,0xE6
-        .byte   0xDD,0xDD,0xD9,0x99
-        .byte   0xBB,0xBB,0x67,0x63
-        .byte   0x6E,0x0E,0xEC,0xCC
-        .byte   0xDD,0xDC,0x99,0x9F
-        .byte   0xBB,0xB9,0x33,0x3E
+        .byte   0x01,0x10,0xCE,0xEF,0x00,0x00,0x44,0xAA
+        .byte   0x00,0x74,0x00,0x18,0x11,0x95,0x00,0x34
+        .byte   0x00,0x1A,0x00,0xD5,0x00,0x22,0x00,0x69
+        .byte   0x6F,0xF6,0xF7,0x73,0x09,0x90,0xE1,0x10
+        .byte   0x44,0x40,0x9A,0x90,0xD5,0xD0,0x44,0x30
+        .byte   0xA9,0x21,0x5D,0x48,0x22,0xE0,0xF8,0x60
 
         ;; Title of the game
         .org    0x134
         .asciz  "Title"
 
         .org    0x144
         .byte   0,0,0
 
         ;; Cartridge type is ROM only
         .org    0x147

/gbdk-lib/libc/targets/sm83/{gb,ap}/global.s:

@@ -182,69 +182,69 @@
         AUDTERM_2_RIGHT = 0b00000010
         AUDTERM_1_RIGHT = 0b00000001
 
         .NR52           = 0x26  ; Sound register
         rNR52           = 0xFF26
         rAUDENA         = 0xFF26
 
         AUDENA_ON       = 0b10000000
         AUDENA_OFF      = 0b00000000  ; sets all audio regs to 0!
 
-        .LCDC           = 0x40  ; LCD control
-        rLCDC           = 0xFF40
+        .LCDC           = 0x4E  ; LCD control
+        rLCDC           = 0xFF4E
 
         LCDCF_OFF       = 0b00000000 ; LCD Control Operation
-        LCDCF_ON        = 0b10000000 ; LCD Control Operation
+        LCDCF_ON        = 0b00000001 ; LCD Control Operation
         LCDCF_WIN9800   = 0b00000000 ; Window Tile Map Display Select
-        LCDCF_WIN9C00   = 0b01000000 ; Window Tile Map Display Select
+        LCDCF_WIN9C00   = 0b00000010 ; Window Tile Map Display Select
         LCDCF_WINOFF    = 0b00000000 ; Window Display
-        LCDCF_WINON     = 0b00100000 ; Window Display
+        LCDCF_WINON     = 0b00000100 ; Window Display
         LCDCF_BG8800    = 0b00000000 ; BG & Window Tile Data Select
-        LCDCF_BG8000    = 0b00010000 ; BG & Window Tile Data Select
+        LCDCF_BG8000    = 0b00001000 ; BG & Window Tile Data Select
         LCDCF_BG9800    = 0b00000000 ; BG Tile Map Display Select
-        LCDCF_BG9C00    = 0b00001000 ; BG Tile Map Display Select
+        LCDCF_BG9C00    = 0b00010000 ; BG Tile Map Display Select
         LCDCF_OBJ8      = 0b00000000 ; OBJ Construction
-        LCDCF_OBJ16     = 0b00000100 ; OBJ Construction
+        LCDCF_OBJ16     = 0b00100000 ; OBJ Construction
         LCDCF_OBJOFF    = 0b00000000 ; OBJ Display
-        LCDCF_OBJON     = 0b00000010 ; OBJ Display
+        LCDCF_OBJON     = 0b01000000 ; OBJ Display
         LCDCF_BGOFF     = 0b00000000 ; BG Display
-        LCDCF_BGON      = 0b00000001 ; BG Display
-        LCDCF_B_ON      = 7
-        LCDCF_B_WIN9C00 = 6
-        LCDCF_B_WINON   = 5
-        LCDCF_B_BG8000  = 4
-        LCDCF_B_BG9C00  = 3
-        LCDCF_B_OBJ16   = 2
-        LCDCF_B_OBJON   = 1
-        LCDCF_B_BGON    = 0
+        LCDCF_BGON      = 0b10000000 ; BG Display
+        LCDCF_B_ON      = 0
+        LCDCF_B_WIN9C00 = 1
+        LCDCF_B_WINON   = 2
+        LCDCF_B_BG8000  = 3
+        LCDCF_B_BG9C00  = 4
+        LCDCF_B_OBJ16   = 5
+        LCDCF_B_OBJON   = 6
+        LCDCF_B_BGON    = 7
 
         .STAT           = 0x41  ; LCD status
         rSTAT           = 0xFF41
 
-        STATF_LYC       = 0b01000000 ; LYC=LY Coincidence (Selectable)
-        STATF_MODE10    = 0b00100000 ; Mode 10
-        STATF_MODE01    = 0b00010000 ; Mode 01 (V-Blank)
-        STATF_MODE00    = 0b00001000 ; Mode 00 (H-Blank)
-        STATF_LYCF      = 0b00000100 ; Coincidence Flag
+        STATF_LYC       = 0b00000010 ; LYC=LY Coincidence (Selectable)
+        STATF_MODE10    = 0b00000100 ; Mode 10
+        STATF_MODE01    = 0b00001000 ; Mode 01 (V-Blank)
+        STATF_MODE00    = 0b00010000 ; Mode 00 (H-Blank)
+        STATF_LYCF      = 0b00100000 ; Coincidence Flag
         STATF_HBL       = 0b00000000 ; H-Blank
-        STATF_VBL       = 0b00000001 ; V-Blank
-        STATF_OAM       = 0b00000010 ; OAM-RAM is used by system
-        STATF_LCD       = 0b00000011 ; Both OAM and VRAM used by system
-        STATF_BUSY      = 0b00000010 ; When set, VRAM access is unsafe
-        STATF_B_LYC     = 6
-        STATF_B_MODE10  = 5
-        STATF_B_MODE01  = 4
-        STATF_B_MODE00  = 3
-        STATF_B_LYCF    = 2
-        STATF_B_VBL     = 0
-        STATF_B_OAM     = 1
-        STATF_B_BUSY    = 1
+        STATF_VBL       = 0b10000000 ; V-Blank
+        STATF_OAM       = 0b01000000 ; OAM-RAM is used by system
+        STATF_LCD       = 0b11000000 ; Both OAM and VRAM used by system
+        STATF_BUSY      = 0b01000000 ; When set, VRAM access is unsafe
+        STATF_B_LYC     = 1
+        STATF_B_MODE10  = 2
+        STATF_B_MODE01  = 3
+        STATF_B_MODE00  = 4
+        STATF_B_LYCF    = 5
+        STATF_B_VBL     = 7
+        STATF_B_OAM     = 6
+        STATF_B_BUSY    = 6
 
         .SCY            = 0x42  ; Scroll Y
         rSCY            = 0xFF42
 
         .SCX            = 0x43  ; Scroll X
         rSCX            = 0xFF43
 
         .LY             = 0x44  ; LCDC Y-coordinate
         rLY             = 0xFF44
 
@@ -502,24 +502,25 @@ lbl:
         ADD_A_REG16     regH, regL
 .endm
 
 .macro SIGNED_SUB_A_REG16 regH regL ?lbl
         ; negate A then add to 16-bit value
         CPL
         INC     A
         SIGNED_ADD_A_REG16      regH, regL
 .endm
 
-.macro MUL_DE_BY_A_RET_HL ?lbl1 ?lbl2
+.macro MUL_DE_BY_A_RET_HL ?lbl1 ?lbl2 ?lbl3
         ; Multiply DE by A, return result in HL; preserves: BC
         LD      HL, #0
 lbl1:
         SRL     A
         JR      NC, lbl2
         ADD     HL, DE
 lbl2:
+        JR      Z, lbl3
         SLA     E
         RL      D
-        OR      A
-        JR      NZ, lbl1
+        JR      lbl1
+lbl3:
 .endm

/gbdk-lib/libc/targets/sm83/{gb,ap}/sfr.s:

@@ -45,21 +45,21 @@ _NR33_REG    = 0xFF1D    ; Sound register
 _NR34_REG    = 0xFF1E    ; Sound register
 _NR41_REG    = 0xFF20    ; Sound register
 _NR42_REG    = 0xFF21    ; Sound register
 _NR43_REG    = 0xFF22    ; Sound register
 _NR44_REG    = 0xFF23    ; Sound register
 _NR50_REG    = 0xFF24    ; Sound register
 _NR51_REG    = 0xFF25    ; Sound register
 _NR52_REG    = 0xFF26    ; Sound register
 _PCM_SAMPLE  = 0xFF30    ; PCM wave pattern
 _AUD3WAVE    = 0xFF30    ; PCM wave pattern
-_LCDC_REG    = 0xFF40    ; LCD control
+_LCDC_REG    = 0xFF4E    ; LCD control
 _STAT_REG    = 0xFF41    ; LCD status
 _SCY_REG     = 0xFF42    ; Scroll Y
 _SCX_REG     = 0xFF43    ; Scroll X
 _LY_REG      = 0xFF44    ; LCDC Y-coordinate
 _LYC_REG     = 0xFF45    ; LY compare
 _DMA_REG     = 0xFF46    ; DMA transfer
 _BGP_REG     = 0xFF47    ; BG palette data
 _OBP0_REG    = 0xFF48    ; OBJ palette 0 data
 _OBP1_REG    = 0xFF49    ; OBJ palette 1 data
 _WY_REG      = 0xFF4A    ; Window Y coordinate

Presumably it's not enough to map the bytes of the rom, but would it be feasible to add a console variant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant