-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdandocs.html
9239 lines (7037 loc) · 615 KB
/
dandocs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<html>
<head>
<title>Dan Docs</title>
<meta charset="utf-8" />
<style type="text/css">
body
{
font-family: "times new roman", serif, verdana;
margin: 0px;
background-color: #FFFFFF;
padding: 8px;
height: 100%;
}
li
{
margin-top: 10px;
}
pre
{
font-family: monospace;
}
.toc_sec
{
width: 33%;
float: left;
}
.toc_con
{
width: 100%;
height: 20%;
overflow: auto;
}
.gray_title
{
width: 100%;
background-color: #C0C0C0;
margin-bottom: 15px;
padding-left: 5px;
font-size: 24px;
}
.toc_gray_title
{
width: 95%;
background-color: #C0C0C0;
margin-bottom: 15px;
font-size: 24px;
}
.list_head
{
margin-bottom: 0px;
}
.list_item
{
margin-top: 0px;
margin-bottom: 0px;
}
.list_item_none
{
margin-top: 0px;
margin-bottom: 0px;
list-style-type: none;
}
.list_tab
{
margin-top: 0px;
margin-bottom: 0px;
width: 100%;
}
.x
{
margin-top: 0px;
margin-bottom: 0px;
float: left;
width: 30%;
}
.y
{
margin-top: 0px;
margin-bottom: 0px;
float: left;
}
.bld
{
font-weight: bold;
}
.spc
{
margin-bottom: 100px;
}
</style>
</head>
<body>
<div class="toc_con">
<div class="toc_sec">
<p class="toc_gray_title">Hardware and Accessories</p>
<p class="list_head"><strong>Overview</strong></p>
<p class="list_item"><a href="#about">About Dan Docs</a></p>
<p class="list_head"><strong>DMG and GBC</strong></p>
<p class="list_item"><a href="#bcb">Barcode Boy</a></p>
<p class="list_item"><a href="#btb">Barcode Taisen Bardigun Scanner</a></p>
<p class="list_item"><a href="#dmg07">DMG-07 4-Player Adapter</a></p>
<p class="list_item"><a href="#zzh">Zok Zok Heroes Full Changer</a></p>
<p class="list_item"><a href="#ir">GBC Infrared Communication</a></p>
<p class="list_item"><a href="#ps">Gyogun Tanchiki: Pocket Sonar</a></p>
<p class="list_item"><a href="#pabs">Power Antenna + Bug Sensor</a></p>
<p class="list_item"><a href="#tbgb">Turbo File GB</a></p>
<p class="list_item"><a href="#sew">Sewing Machines</a></p>
<p class="list_head"><strong>GBA</strong></p>
<p class="list_item"><a href="#gss">GBA Screen Stretch</a></p>
<p class="list_item"><a href="#sda">Soul Doll Adapter</a></p>
<p class="list_item"><a href="#bcg">Battle Chip Gate</a></p>
<p class="list_item"><a href="#mpos">Multi Plust On System</a></p>
<p class="list_item"><a href="#tbfa">Turbo File Advance</a></p>
<p class="list_item"><a href="#agb006">AGB-006</a></p>
<p class="list_item"><a href="#vrs">Virtureal Racing System</a></p>
<p class="list_item"><a href="#maw">Magical Watch</a></p>
<p class="list_item"><a href="#jcc">Joy Carry Cartridge</a></p>
<p class="list_item"><a href="#ama">Advance Movie Adapter</a></p>
<p class="list_item"><a href="#mus">Music Recorder</a></p>
<p class="list_item"><a href="#pyn">Play-Yan</a></p>
<p class="list_item"><a href="#glu">Glucoboy</a></p>
<p class="list_item"><a href="#cam">Campho Advance</a></p>
<p class="list_item"><a href="#nmp">Nintendo MP3 Player</a></p>
<p class="list_item"><a href="#atv">Agatsuma TV Tuner</a></p>
<p class="list_head"><strong>NDS</strong></p>
<p class="list_item"><a href="#utp">Ubisoft Thrustmaster Pedometer</a></p>
<p class="list_item"><a href="#hcv">HCV-1000</a></p>
<p class="list_item"><a href="#kmr">Magic Reader</a></p>
</div>
<div class="toc_sec">
<p class="toc_gray_title">Mobile Adapter GB</p>
<p class="list_head"><strong>Hardware Documentation</strong></p>
<p class="list_item"><a href="#magb">Mobile Adapter GB</a></p>
<p class="list_head"><strong>Game and Server Documentation</strong></p>
<p class="list_item"><a href="#exm">EX Monopoly</a></p>
<p class="list_item"><a href="#gbw">Game Boy Wars 3</a></p>
<p class="list_item"><a href="#hkh">Hello Kitty no Happy House</a></p>
<p class="list_item"><a href="#mka">Mario Kart Advance</a></p>
<p class="list_item"><a href="#mpy">Mobile Pro Yakyuu</a></p>
<p class="list_item"><a href="#mbt">Mobile Trainer</a></p>
<p class="list_item"><a href="#ndg">Net de Get: Minigame @ 100</a></p>
<p class="list_item"><a href="#zng">Zen Nihon GT Senshuken</a></p>
</div>
</div>
<a name="about"></a>
<p class="gray_title">About Dan Docs</p>
<p>For the longest time, a technical document called Pan Docs formed the basis of nearly all known documentation about the Nintendo Game Boy. To this day, Pan Docs (or an updated version such as the GBDev wiki) continues to be the go-to source of general Game Boy information. However, while Pan Docs covers the basics well enough, it does not touch upon more obscure Game Boy hardware. Dan Docs, on the other hand, aims to fill this gap. Dan Docs is basically everything else you wanted to know about the Game Boy, but no one dared to ask.</p>
<p>All of the data here either comes from my research for the GBE+ project or from others studying Game Boy hardware and software. Much of this information is copied+pasted from the text files I've made over the years. For ease of use and access, however, it's been converted to a single HTML document. As more items are reverse-engineered and studied, they will be added to Dan Docs as well as GBE+.</p>
<p>Consider all information within this document to be Public Domain. Copy and share as you please.</p>
<p class="list_head"><strong>Credits</strong></p>
<p class="list_item">Billy - Mobile Adapter GB documentation</p>
<p class="list_item">ClawGrip - Scans of all known Barcode Boy cards</p>
<p class="list_item">EchelonPrime - Scans of all Card de Asobu cards + misc info</p>
<p class="list_item">endrift - MBC6 documentation. Collaboration on Battle Chip Gate documentation (especially Progress Chip Gate) + testing + verification of results.</p>
<p class="list_item">Háčky - Mobile Adapter GB documentation</p>
<p class="list_item">mid-kid - Mobile Adapter GB documentation</p>
<p class="list_item">pfero - Mobile Adapter GB documentation</p>
<p class="list_item">Robert Abel (Tauwasser) - Net de Get translation help</p>
<p class="list_item">Winter1760 - EX Monopoly and Mario Kart Advance documentation</p>
<!-- Barcode Boy -->
<a name="bcb"></a>
<p class="gray_title">Barcode Boy</p>
<p class="list_item"><a href="#bcb_gen">General Hardware Information</a></p>
<p class="list_item"><a href="#bcb_gam">Compatible Games</a></p>
<p class="list_item"><a href="#bcb_com">Barcode Boy to DMG Communication</a></p>
<p class="list_item"><a href="#bcb_bar">Barcode Format</a></p>
<p class="list_item"><a href="#bcb_rip">Card Dumping + Emulation</a></p>
<p class="list_item"><a href="#bcb_err">Barcode Errors</a></p>
<p class="list_item"><a href="#bcb_cod">Barcodes</a></p>
<a name="bcb_gen"></a>
<p class="gray_title">[Barcode Boy] : General Hardware Information</p>
<p>Appearing around 1992, the Barcode Boy is the earliest form of card-scanning on Nintendo's Game Boy line of handhelds, predating both the e-Reader and the Bardigun Taisen Reader by a number of years. Only a limited set of games made by Namcot were compatible with (or rather absolutely required) the Barcode Boy. All of the games and the Barcode Boy itself were only released in Japan.</p>
<ul>
<li class="list_item">Barcode Boy is a rather bulky add-on that snaps on top of the original DMG (the gray "brick")</li>
<li class="list_item">Barcode Boy requires 2 AA batteries (with a DMG-01, that brings the total to 6 AA necessary to play any Barcode Boy game)</li>
<li class="list_item">Barcode Boy games are always labeled with a "B.B." logo with a little card.</li>
<li class="list_item">Includes a very, very short Link Cable</li>
<li class="list_item">Unlike the Barcode Taisen Bardigun reader, the Barcode Boy has no button. It is always "ON" when switched on, thus draining batteries even while not scanning</li>
</ul>
<a name="bcb_gam"></a>
<p class="gray_title">[Barcode Boy] : Compatible Games</p>
<p>Only 5 Barcode Boy games are known to exist:</p>
<ul>
<li class="list_item">Battle Space</li>
<li class="list_item">Monster Maker Barcode Saga</li>
<li class="list_item">Kattobi Road</li>
<li class="list_item">Family Jockey 2</li>
<li class="list_item">Famista 3</li>
</ul>
<p>Barcode Boy titles come in two types: those that absolutely require the Barcode Boy for any gameplay at all (専用カートリッジ) and those that merely support the Barcode Boy as an accessory for additional content (対応カートリッジ). These games are differentiated with red and blue "B.B." logos respectively. Only Battle Space and Monster Maker: Barcode Saga fall into the first group.</p>
<a name="bcb_com"></a>
<p class="gray_title">[Barcode Boy] : Barcode Boy to DMG Communication</p>
<p>Each game will first try to detect if the Barcode Boy is plugged in and turned on. The Game Boy will send the bytes [0x10, 0x07, 0x10, 0x07] as part of a handshake. A properly functioning Barcode Boy will return the bytes [0xFF, 0xFF, 0x10, 0x07]. Barcode Boy games will still successfully detect the Barcode Boy scanner even if the first two bytes in the reply to the handshake aren't 0xFF, probably to simplify the game code. As a result, the first two bytes of the handshake are useless and ignored, but the last two bytes *MUST* be [0x10, 0x07]. If the Barcode Boy is plugged in but not turned on, it responds with 0x00 for the entire handshake, and the game produces an error message.</p>
<p>After detection passes, the Game Boy will sit and wait for a response. The Game Boy, unlike how it works with other SIO devices, takes on a passive role with the Barcode Boy by switching to an external clock. The Game Boy actually requires the Barcode Boy to take the initiative when scanning. Therefore, it is assumed that the Barcode Boy uses an internal clock and drives serial communications while scanning a barcode.</p>
<p>Nitty-gritty bits:</p>
<ol>
<li>The game logic pings the Barcode Boy with [0x10, 0x07, 0x10, 0x07]. The Barcode Boy is expected to reply; the first two bytes are not important (real hardware returns 0xFF), but the second two bytes must be [0x10, 0x07].</li>
<li>Afterwards, the Game Boy waits for input using an external clock. What follows are two strings of numbers representing the barcode data. The "numbers" are represented as ASCII instead of hex.</li>
<li>Both strings are 13-digits long and are the EAN-13 number corresponding to the barcode.</li>
<li>Before sending each string, the Barcode Boy sends a 0x02 byte.</li>
<li>After sending each string, the Barcode Boy sends a 0x03 byte.</li>
<li>Altogether, the Barcode Boy transmits 30 bytes to the Game Boy.</li>
</ol>
<p>Overall known communication protocol:</p>
<ul>
<li>Handshake -> Send [0x10, 0x07, 0x10, 0x07] : Receive [0xFF, 0xFF, 0x10, 0x07]</li>
<li>Start Barcode Data Transmission -> [0x02]</li>
<li>Stop Barcode Data Transmission -> [0x03]</li>
</ul>
<p>Standard communication flow:</p>
<pre>[DMG] [BCB]
Handshake --->
<--- Handshake
<--- 0x2
<--- EAN-13
<--- 0x3
<--- 0x2
<--- EAN-13
<--- 0x3</pre>
<p>Since the Barcode Boy acts as master (after the handshake at least), the Game Boy never initiates a transfer during barcode transmission. When sending barcode data, the Barcode Boy doesn't seem to care what value the Game Boy writes to SB, although no Barcode Boy games write to SB at that time anyway. Ultimately unknown if the Barcode Boy accepts input beyond the handshake, but no evidence has been observed to suggest otherwise.</p>
<p>Once the Barcode Boy sends the handshake [0x10, 0x07] back to the Game Boy, the scanner returns 0xFF anytime the Game Boy tries to send additional data while the handheld is still on its own internal clock. After the Barcode Boy finishes sending back the barcode data to the Game Boy, it requires the handshake again. It appears the handshake can fail for unknown reasons (probably related to the hardware). For example, the Barcode Boy at times may send back [0x90, 0x07], which seems to indicate an error of some sort.</p>
<p>It should be noted that the barcode data itself is encapsulated by ASCII control codes, where 0x02 represents the Start of Text (STX) and 0x03 represents the End of Text (ETX).</p>
<a name="bcb_bar"></a>
<p class="gray_title">[Barcode Boy] : Barcode Format</p>
<p>The two strings are the actual barcode data in numerical form. The barcode format itself is EAN-13, and a few games use JAN-13 specifically. Older JAN-13 barcodes start off with the flag code 49. Interestingly enough, the newer JAN-13 flag code is 45 and was introduced in 1992, the same year the Barcode Boy was released. Probably due to timing or convenience, the JAN-13 barcodes on the cards stuck to the older flag code. Some Barcode Boy barcodes are technically "coupons/vouchers" types, as they use the flag code 99 instead of 45 or 49. Family Jockey 2 and Famista 3 don't use JAN-13 specifically; instead they use random EAN-13 barcodes with varying flag codes.</p>
<p>Using scans of the barcode @ 600 DPI, the smallest bar width is approximately 7 pixels (give or take). With that information, it's possible to recreate the EAN-13 number with a sufficient image and barcode scanning software. It should be noted that the Barcode Boy appears to do away with the center guard, however, it maintains left and right guards.</p>
<a name="bcb_rip"></a>
<p class="gray_title">[Barcode Boy] : Card Dumping + Emulation</p>
<p>Amazingly simple in comparison to something like Barcode Taisen Bardigun, chiefly because such a small amount of bytes need to be sent to the Game Boy. Basically, all you need to do is convert the barcode to EAN-13. Anything capable of reading standard barcodes found on most products should be sufficient to grab the numerical form of each card.</p>
<p>As far as emulation goes, simply convert the EAN-13 ASCII string to hex and transmit it accordingly.</p>
<a name="bcb_err"></a>
<p class="gray_title">[Barcode Boy] : Barcode Errors</p>
<p>Interestingly enough, a vast majority of the barcodes for Family Jockey 2 are completely incorrect. Only 3 out of the 8 barcodes actually generate horses with the stats listed on the cards. Barcodes A1, B1, and A4 work fine; the rest give stats that do not match up with the card's. Some, such as A2, even generate horses that are totally unfit for competition (A2 produces stats with 2s and 0s, and the max is supposed to be 9 in each category). It's not clear if this was a programming glitch or a mistake Namcot made when printing the cards, or some combination of the two. All other Barcode Boy games came packaged with cards that have no issues whatsoever.</p>
<a name="bcb_cod"></a>
<p class="gray_title">[Barcode Boy] : Barcodes</p>
<p>Below are the full 13 digit barcodes for all known Barcode Boy cards along with any names, other identifying information found on the card, or important notes.</p>
<p><strong>Battle Space</strong></p>
<pre> * Berserker バーサーカー
* 4907981000301
* Valkyrie バルキリー
* 4908052808369
* Grizzly Bear グリズリー
* 4916911302309
* Magic Soldier マホウセンシ
* 4902776809367
* Knight ナイト
* 4905672306367
* Wraith レイス
* 4912713004366
* Shaman シャーマン
* 4913508504399
* Thief シーフ
* 4918156001351
* Sorcerer ソーサラー
* 4911826551347
* Warrior ウォリアー
* 4909062206350</pre>
<p><strong>Family Jockey 2</strong></p>
<pre> * A1
* 5893713522816
* A2 (Erroneous Barcode)
* 2378649896765
* A4
* 9845554422318
* B1
* 1509843019075
* B2 (Erroneous Barcode)
* 4232978865152
* B4 (Erroneous Barcode)
* 3572821107673
* C3 (Erroneous Barcode)
* 7164625542390
* C5 (Erroneous Barcode)
* 6319537443513</pre>
<p><strong>Famista 3</strong></p>
<pre> * Home-Run Batter ホームランバッター
* 8357933639923
* Senior Batter 高打者バッター
* 7814374127798
* Swift Batter 駿打者バッター
* 9880692151263
* Pitcher ピッチャー
* 1414213562177</pre>
<p><strong>Kattobi Road</strong></p>
<pre> * Truck フォワールド
* 4902105002063
* Sedan ガウディ
* 4901121110004
* Racecar ナイト 2000
* 4903301160625
* Japanese Street Car ミイラターボ
* 4902888119101
* 4x4 Jeep リイスラックス
* 4901780161157
* F1-style racecar ロクタスヨンート
* 4987084410924</pre>
<p><strong>Monster Maker: Barcode Saga</strong></p>
<pre> * Archer Lorian 弓使いロリエーン
* 9998017308336
* Archer Elysice 弓使いエリサイス
* 9447410810323
* Knight Lauren 騎士ローラン
* 9052091324955
* Dragon Knight Haagun 竜騎士ハーグン
* 9322158686716
* Warrior Diane 戦士ディアーネ
* 9752412234900
* Warrior Tamron 戦士タムローン
* 9362462085911</pre>
<!-- Barcode Taisen Bardigun -->
<a name="btb"></a>
<p class="gray_title">Barcode Taisen Bardigun Scanner</p>
<p class="list_item"><a href="#btb_gen">General Hardware Information</a></p>
<p class="list_item"><a href="#btb_com">Card Reader to GBC Communication</a></p>
<p class="list_item"><a href="#btb_bar">Barcode Format</a></p>
<p class="list_item"><a href="#btb_rip">Card Dumping</a></p>
<p class="list_item"><a href="#btb_rom">ROM Revision</a></p>
<p class="list_item"><a href="#btb_cod">Barcodes</a></p>
<a name="btb_gen"></a>
<p class="gray_title">[Barcode Taisen Bardigun] : General Hardware Information</p>
<p>Barcode Taisen Bardigun is a Japanese Game Boy game released December 11, 1998, made by TAM. It doesn't seem like a very interesting or noteworthy game in and of itself (yet another monster breeding/raising/fighting/collecting game). However, this game featured exclusive hardware, a card reader that scanned various barcodes</p>
<ul>
<li class="list_item">Barcode Taisen Bardigun (DMG-ABEJ-JPN) and (DMG-ABEJ-JPN-1)</li>
<li class="list_item">MBC3 + RTC + Battery Saves (Same as Pokemon Gold and Silver)</li>
<li class="list_item">Compatible with DMG, SGB, and GBC systems</li>
<li class="list_item">Japanese-text only (hiragana/katakana only, a bit of a blessing given 8x8 fonts are not the best for kanji)</li>
<li class="list_item">Supports Link Cable for multiplayer</li>
<li class="list_item">Comes with 1 card-reader powered by 3 AAA batteries</li>
<li class="list_item">Comes with 5 cards bundled (only 3 have barcodes, the other 2 are just collectables?)</li>
<li class="list_item">Some cards come as cut-outs from a cardboard sheet</li>
<li class="list_item">Reader connects to DMG/GBC serial port for communication</li>
</ul>
<a name="btb_com"></a>
<p class="gray_title">[Barcode Taisen Bardigun] : Card Reader to GBC Communication</p>
<p>Game Boy will initialize a transfer with an internal clock; much like every other Serial I/O device (GB Printer, GB Mobile Adapter), Game Boy sends initial data, then the reader responds. Transfer rate is 1KB/s, the slowest speed, so there is no difference between DMG and GBC transfers. To begin, the Game Boy constantly sends 0xFF to the reader. The game logic times out after a few seconds if no proper response is established.</p>
<p>To scan a card, hold it face down (barcode facing the ground and towards the reader), press the reader's button, and swipe. The scanner only seems to activate once the button is pushed (otherwise it'd waste battery if it were constantly on, or constantly on and trying to receieve commands from the Game Boy). Without pressing the button, the game logic times out the scanning process after a few seconds (about 9 seconds). If an error is detected during the scan process, the reader seems to acknowledge this pretty quickly.</p>
<p>Nitty-gritty bits</p>
<ol>
<li>When connected, the reader responds with 0x00 until it is prepared to send the barcode data.</li>
<li>Afterwards, it begins processing barcode data. Data is represented serially. A bit reading "1" indicates that the card reader is detecting whitespace. A bit reading "0" indicates the card reader is detecting a black segment (black bar).</li>
<li>The barcode sequence itself is nothing more than a continuous stream of zeroes and ones. That is to say, groups of ones and zeroes are always packed together, but the length of each group determines the length of any given bar.</li>
<li>There doesn't appear to be a fixed number of bytes that the Game Boy seems to expect when scanning. Different scans seem to produce different amounts of data transferred to the Game Boy. This could be due to numerous reasons in the hardware (swipe speed, how clean the scanner is, some other variance within the scanner's light sensitivity). Overall, however, the most important thing seems to be the length and sequence of the bars encoded as groups of ones and zeroes.</li>
<li>The Game Boy doesn't ever seem to send any interesting data, just 0xFF. No commands are sent. The Game Boy simply sends a byte and expects a result to come from the reader; the results are what matter and are interpreted later on.</li>
</ol>
<a name="btb_bar"></a>
<p class="gray_title">[Barcode Taisen Bardigun] : Barcode Format</p>
<p>Because the incoming barcode data is not consistent byte-for-byte, the patterns are what matters most. To illustrate this idea, below are two sets of data extracted after scanning a card (using a hacked version of Barcode Taisen Bardigun and saving all SIO communications to Cart RAM).</p>
<pre>SET_1 SET_2
00 00 00 03
7F FE FF F8
00 01 00 03
FF FF FF FF
FF FF FF FF
FF C0 FF E0
00 3F 00 0F
FF 00 FF 80
00 00 00 00
07 FF 00 FF
00 00 FC 00
FF FF 03 FF
FF C0 FF FF
00 00 C0 00</pre>
<p>Each set is actually a bitstream of 0s and 1s like so:</p>
<pre>Set 1 [16:0] [14:1] [15:0] [43:1] ...
Set 2 [14:0] [15:1] [14:0] [45:1] ...</pre>
<p>The patterns in the sets are roughly the same. They switch between 0s, 1s, and 0s (black, white, black) fairly quickly followed by a long segment of 1s (white) which is roughly the general pattern seen at the beginning/ends of the barcodes. Based on this information, the thinest bars are about 0.0133 inches (8 pixels when scanning at 600dpi). Some further calculations based on this information:</p>
<pre>Bar Width (in pixels @ 600dpi) -> Estimated bit-count sent to Game Boy
8 -> ~14-16
16 -> ~27-29
24 -> ~43-45</pre>
<p>Every 8 pixels should be approximately 15 bits worth of data sent to the Game Boy, so:</p>
<pre>Number of Pixels @ 600dpi * 1.875 = Approximate bit count</pre>
<p>The physical barcode format on the actual cards is EAN-13.</p>
<a name="btb_rip"></a>
<p class="gray_title">[Barcode Taisen Bardigun] : Card Dumping</p>
<p>With the above guideline, it is possible to dump the cards by scanning them, then creating a binary file containing barcodes as alternating bitstreams of 0s and 1s. With this method, no homebrew techniques are needed, and only an image file is necessary to actually preserve the card.</p>
<p>The second method involves using a hacked version of the Barcode Taisen Bardigun ROM on a flashcart to save incoming Serial I/O data as a card is scanned. The binary can be pulled from a save file. Both binary files could be used an input to feed back to an emulator.</p>
<a name="btb_rom"></a>
<p class="gray_title">[Barcode Taisen Bardigun] : ROM Revision</p>
<p>Barcode Taisen Bardigun has two known ROMs, DMG-ABEJ-JPN and DMG-ABEJ-JPN-1. The later version polishes many rough edges found in the first release (e.g. including a text box when barcode scanning fails). Currently, both games appear to be largely the same besides these UI and UX enhancements. Barcode scanning is exactly the same in each.</p>
<a name="btb_cod"></a>
<p class="gray_title">[Barcode Taisen Bardigun] : Barcodes</p>
<p>Below is a chart with barcodes verified to work with the game. Each barcode will produce a single Bardigun when scanning to hatch an egg. The barcode can also be used to give Bardigun unique attacks when scanned before a battle begins. The names of each are listed in kana as well as Romanji or English when translatable.</p>
<pre>------------------------------------------------------------------------------------------------
Barcode | Bardigun :: Attack Name (English) | Bardigun :: Attack Name (Japanese)
------------------------------------------------------------------------------------------------
4580245316402 | Chakanan :: High Hearing | チャカナン :: ハイヒーリング
4900287167419 | Chibisshii :: Sword | チビッシー :: ソード
4901330547479 | Chibisshii :: Eye Beam | チビッシー :: めからベーム
4983164730678 | Chip :: Lullaby | チップ :: こもりうた
4900753335663 | Noise :: Ikikaeeru | ノイヅー :: イキカエール
4900363432103 | Nyaari :: Kaenhoushaki | ニャーリー :: かえんほうしゃき
4900758340136 | Ralph :: Ikikaeeru | ラルフ :: イキカエール
4902370501445 | Takora :: Fire Bolt | タコラ :: ファイアーボルト
4900269429252 | Tamappi :: Nandemonaooru | タマッピ :: ナンデモナオール
------------------------------------------------------------------------------------------------</pre>
<!-- DMG-07 -->
<a name="dmg07"></a>
<p class="gray_title">DMG-07 4-Player Adapter</p>
<p class="list_item"><a href="#dmg07_gen">General Hardware Information</a></p>
<p class="list_item"><a href="#dmg07_gam">Compatible Games</a></p>
<p class="list_item"><a href="#dmg07_pro">Link Cable Protocol</a></p>
<p class="list_item"><a href="#dmg07_pin">Ping Phase</a></p>
<p class="list_item"><a href="#dmg07_tra">Transmission Phase</a></p>
<p class="list_item"><a href="#dmg07_res">Restarting Ping Phase</a></p>
<a name="dmg07_gen"></a>
<p class="gray_title">[DMG-07] : General Hardware Information</p>
<p>The DMG-07 is an accessory that allows 4 Game Boys to connect for multiplayer. In the West, it first appeared with the game F-1 Race as bundle in 1990. Only a few other games took advantage of the DMG-07 (namely Wave Race and Faceball 2000, Yoshi's Cookie) and it did not see widespread support at all.</p>
<ul>
<li class="list_item">DMG-07 is a gray "hub" with 3 input ports for Gen 1 Link Cables.</li>
<li class="list_item">DMG-07 is largely designed for Gen 1 Link Cables and DMG models. MGB-010s allow any Game Boy (up to the Micro) to connect as Players 2-4.</li>
<li class="list_item">Player 1 comes with a built-in cable (Gen 1). All other players need extra cables.</li>
<li class="list_item">Player 1 needs to be a DMG model unless an MGB-004 adapter is used.</li>
<li class="list_item">DMG-07 uses a Motorola 402038 for multiplexing stuff.</li>
</ul>
<a name="dmg07_gam"></a>
<p class="gray_title">[DMG-07] : Compatible Games</p>
<ul>
<li class="list_item">America Oudan Ultra Quiz</li>
<li class="list_item">Chachamaru Panix</li>
<li class="list_item">Downtown Nekketsu Koushinkyoku: Dokodemo Daiundoukai</li>
<li class="list_item">Faceball 2000</li>
<li class="list_item">F1 Race</li>
<li class="list_item">F1 Pole Position</li>
<li class="list_item">Janshirou</li>
<li class="list_item">Janshirou II</li>
<li class="list_item">Jantaku Boy</li>
<li class="list_item">Jinsei Game Densetsu</li>
<li class="list_item">Nakajima Satoru F-1 Hero GB World Championship '91</li>
<li class="list_item">Nekketsu Koukou Dodge Ball-Bu</li>
<li class="list_item">Super Momotarou Dentetsu</li>
<li class="list_item">Super R.C. Pro-Am</li>
<li class="list_item">Top Rank Tennis</li>
<li class="list_item">Trax</li>
<li class="list_item">Trump Boy II</li>
<li class="list_item">Uno: Small World</li>
<li class="list_item">Uno: Small World 2</li>
<li class="list_item">Wave Race</li>
<li class="list_item">Yoshi's Cookie</li>
</ul>
<p>F1 Pole Position is the localization of the Japanese game Nakajima Satoru F-1 Hero GB '92: The Graded Driver. Both versions support the DMG-07. The prequel, Nakajima Satoru F-1 Hero GB World Championship '91, was however a Japanese exclusive.</p>
<p>Several games are claimed to be compatible but actual support for the DMG-07 remains dubious at best for those titles. Gauntlet II advertises 4-player action via the Link Cable, but this may simply refer to 2-player mode with each Game Boy controlling 2 characters (and switching among friends when appropiate).</p>
<p>Micro Machines 1 claims to support the DMG-07 in its instruction manual, but it does not appear to work; it may have been a planned but unfinished feature. Although the game initially tries to handle the DMG-07 Ping Phase, the acknowledgement signal is malformed. Based on hardware tests the game does not properly follow the DMG-07 protocol. If a DMG-07 is plugged in while booting the game, the software may ignore all input from Player 1 if the title screen runs for a few seconds. Unplugging the DMG-07 restores input from Player 1. The main game can be accessed by pressing buttons quickly on the title screen, however, various glitches occur with the DMG-07 plugged in. Most immediately return to the title screen after choosing a race course.</p>
<p>Micro Machines 2 has no indication of 4-player support outside of other versions, such as the PC edition.</p>
<a name="dmg07_pro"></a>
<p class="gray_title">[DMG-07] : Link Cable Protocol</p>
<p>The DMG-07 protocol can be divided into 2 sections, the "ping" phase, and the "transmission" phase. The initial ping phase involves sending packets back and forth between connected Game Boys probing for their current connection status. Afterwards, the DMG-07 enters into transmission mode where the Game Boys exchange data across the network.</p>
<p>A very important thing to note is that all Game Boys transfer data across the DMG-07 via an external clock source. Apparently, the clock source is provided by the DMG-07 itself. Trying to send data via an internal clock results in garbage data.</p>
<a name="dmg07_pin"></a>
<p class="gray_title">[DMG-07] : Ping Phase</p>
<p>When a "master" Game Boy (Player 1) is first connected to the DMG-07, setting Bit 7 of 0xFF02 to 1 and setting Bit 0 of 0xFF02 to 0 causes the accessory to send out "ping" packets periodically. All connected Game Boys will receive 4 bytes as part of the ping packet, at a rate of about 2048 bits-per-second, or about 256 bytes-per-second. Essentially, the ping seems to run 1/4 as fast as the clock used for normal serial transfers on the DMG (1KB/s). The ping data looks like this:</p>
<pre>0xFE ID Byte
0x?? STAT1
0x?? STAT2
0x?? STAT3</pre>
<p>3 "STAT" bytes are sent indicating the current connection status of the other Game Boys. Each byte is usually the same, however, sometimes the status can change mid-way through a ping, typically on STAT2 or STAT3. Each STAT byte looks like such:</p>
<pre>Bit 0-2: Player ID
Bit 4: Player 1 Connected
Bit 5: Player 2 Connected
Bit 6: Player 3 Connected
Bit 7: Player 4 Connected</pre>
<p>The Player ID is simply a value of 1-4. Its value is determined by whichever port a Game Boy is connected to. As more Game Boys connect, the upper bits of the STAT bytes are turned on.</p>
<p>When talking about Game Boys and the "connection", this refers to a Game Boy properly responding to STAT1 and STAT2 bytes when receiving a ping packet from the DMG-07. In this way, the Game Boy broadcasts across the Link Cable network that it is an active participant in communications. It also acts as a sort of acknowledgement signal, where software can drop a Game Boy if the DMG-07 detects an improper response during a ping, or a Game Boy simply quits the network. The proper response is to send 0x88 *after* receiving the ID Byte and STAT1, in which case the upper-half of STAT1, STAT2, and STAT3 are updated to show that a Game Boy is "connected". If for whatever reason, the acknowledgement codes are not sent, the above bits are unset.</p>
<p>Some examples of ping packets are shown below:</p>
<pre>0xFE 0x01 0x01 0x01 -> Ping packet received by Player 1 with no other Game Boys connected
0xFE 0x11 0x11 0x11 -> Ping packet received by Player 1 when Player 1 has connected
0xFE 0x31 0x31 0x31 -> Ping packet received by Player 1 when Players 1 & 2 have connected
0xFE 0x71 0x71 0x71 -> Ping packet received by Player 1 when Players 1, 2, & 3 have connected
0xFE 0x62 0x62 0x62 -> Ping packet received by Player 2 when Players 2 & 3 are connected (but not Player 1)</pre>
<p>It's possible to have situations where some players are connected but others are not; the gaps don't matter. For example, Player 1 and Player 4 can be connected, while Player 2 and Player 3 can be disconnected (or non-existant, same thing); most games do not care so long as Player 1 is active, as that Game Boy acts as master and orchestrates the multiplayer session from a software point of view. Because of the way the DMG-07 hardcodes player IDs based on which port a Game Boy is physically connected to, in the above situation Player 4 wouldn't suddenly become Player 2 in a game like F-1 Race.</p>
<p>During the ping phase, the master Game Boy is capable of setting up two parameters that will be used during the transmission phase. The clock rate for the transmission phase can be adjusted, as well as the packet size each Game Boy will use. The master Game Boy needs to respond with one byte for STAT2 and STAT3 respectively. The chart below illustrates how a master Game Boy should respond to all bytes in a ping packet:</p>
<pre>----------------------------
DMG-07 Game Boy
----------------------------
0xFE <--> (ACK1) = 0x88
STAT1 <--> (ACK2) = 0x88
STAT2 <--> (RATE) = Link Cable Speed
STAT3 <--> (SIZE) = Packet Size</pre>
<p>The new clock rate is only applied when entering the transmission phase; the ping phase runs at a constant 2048 bits-per-second. The formula for the new clock rate is as follows:</p>
<pre>DMG-07 Bits-Per-Second --> 4194304 / ((6 * RATE) + 512)</pre>
<p>The lowest setting (RATE = 0) runs the DMG-07 at the normal speed DMGs usually transfer data (1KB/s), while setting it to 0xFF runs its close to the slowest speed (2042 bits-per-second).</p>
<p>SIZE sets the length of packets exchanged between all Game Boys. Nothing fancy, just the number of bytes in each packet. It probably shouldn't be set to zero.</p>
<a name="dmg07_tra"></a>
<p class="gray_title">[DMG-07] : Transmission Phase</p>
<p>When the master Game Boy (Player 1) is ready, it should send 4 bytes (0xAA 0xAA 0xAA 0xAA). Some games only send 3 bytes however (0xAA 0xAA 0xAA and 0x00). This alerts the DMG-07 to start the transmission phase. The RATE and SIZE parameters are applied at this point. The protocol is simple: Each Game Boy sends a packet to the DMG-07 simultaneously, then the DMG-07 outputs each packet to all connected Game Boys. All data is buffered, so there is a 4 packet delay after each Game Boy submits their data (the delay is still 4 packets long even if some Game Boys are not connected). For example, say the packet size is 4 bytes; the flow of data would look like this when sending:</p>
<pre>--------------------------------------------------------------------------------------------
P1 send P2 send P3 send P4 send Transfer count
--------------------------------------------------------------------------------------------
P1_byte_1 P2_byte_1 P3_byte_1 P4_byte_1 0
P1_byte_2 P2_byte_2 P3_byte_2 P4_byte_2 1
P1_byte_3 P2_byte_3 P3_byte_3 P4_byte_3 2
P1_byte_4 P2_byte_4 P3_byte_4 P4_byte_4 3
0 0 0 0 4 (Typically supposed to be zero, but DMG-07 ignores anything here)
0 0 0 0 5
0 0 0 0 6
0 0 0 0 7
0 0 0 0 8
0 0 0 0 9
0 0 0 0 10
0 0 0 0 11
0 0 0 0 12
0 0 0 0 13
0 0 0 0 14
0 0 0 0 15</pre>
<p>And when receiving, the flow of data would look like this:</p>
<pre>--------------------------------------------------------------------------------------------
P1 recv P2 recv P3 recv P4 recv Transfer count
--------------------------------------------------------------------------------------------
P1_byte_1 P1_byte_1 P1_byte_1 P1_byte_1 16
P1_byte_2 P1_byte_2 P1_byte_2 P1_byte_2 17
P1_byte_3 P1_byte_3 P1_byte_3 P1_byte_3 18
P1_byte_4 P1_byte_4 P1_byte_4 P1_byte_4 19
P2_byte_1 P2_byte_1 P2_byte_1 P2_byte_1 20
P2_byte_2 P2_byte_2 P2_byte_2 P2_byte_2 21
P2_byte_3 P2_byte_3 P2_byte_3 P2_byte_3 22
P2_byte_4 P2_byte_4 P2_byte_4 P2_byte_4 23
P3_byte_1 P3_byte_1 P3_byte_1 P3_byte_1 24
P3_byte_2 P3_byte_2 P3_byte_2 P3_byte_2 25
P3_byte_3 P3_byte_3 P3_byte_3 P3_byte_3 26
P3_byte_4 P3_byte_4 P3_byte_4 P3_byte_4 27
P4_byte_1 P4_byte_1 P4_byte_1 P4_byte_1 28
P4_byte_2 P4_byte_2 P4_byte_2 P4_byte_2 29
P4_byte_3 P4_byte_3 P4_byte_3 P4_byte_3 30
P4_byte_4 P4_byte_4 P4_byte_4 P4_byte_4 31</pre>
<p>Again, due to buffering, data output to the DMG-07 is actually delayed by several transfers according to the size of the packets. All connected Game Boys should send their data into the buffer during the first few transfers. Here, the packet size is 4 bytes, so each Game Boy should submit their data during the first 4 transfers. The other 12 transfers don't care what the Game Boys send; it won't enter into the buffer. The next 16 transfers return the packets each Game Boy previously sent (if no Game Boy exists for player, that slot is filled with zeroes).</p>
<p>With the buffering system, Game Boys would normally be reading data from previous packets during transfers 0-15, in addition to sending new packets. Likewise, during transfers 16-19 each Game Boy is sending new packets. In effect, while receiving old data, Game Boys are supposed to pump new data into the network.</p>
<p>When the DMG-07 enters the transmission phase, the buffer is initially filled with garbage data that is based on output the master Game Boy had sent during the ping phase. At this time, it is recommended to ignore the earliest packets received, however, it is safe to start putting new, relevant data into the buffer.</p>
<a name="dmg07_res"></a>
<p class="gray_title">[DMG-07] : Restarting Ping Phase</p>
<p>It's possible to restart the ping phase while operating in the transmission phase. To do so, the master Game Boy should send 4 or more bytes (0xFF 0xFF 0xFF 0xFF). Again, some games send less (0xFF 0xFF 0xFF and 0x00). It's possible only 1 or 2 0xFF bytes need to be sent, but this has not been extensively investigated yet. At any rate, the bytes alert the DMG-07 that the ping phase should begin again. Most games use this to end the multiplayer session and return to the title screen. For example, in F-1 Race, the game automatically jumps back to the title screen after all races have been completed, while Wave Race has a menu to continue playing or end the session. In either case, the games send 0xFF bytes and the DMG-07 sends ping packets after a brief delay. During this delay, the transmission protocol is still working as intended until the switch happens.</p>
<!-- Zok Zok Heroes Full Changer -->
<a name="zzh"></a>
<p class="gray_title">Zok Zok Heroes Full Changer</p>
<p class="list_item"><a href="#zzh_gen">General Hardware Information</a></p>
<p class="list_item"><a href="#zzh_opr">Operation</a></p>
<p class="list_item"><a href="#zzh_com">IR Communication</a></p>
<p class="list_item"><a href="#zzh_cap">Capturing IR Data</a></p>
<p class="list_item"><a href="#zzh_emu">Emulation</a></p>
<p class="list_item"><a href="#zzh_cos">Cosmic Characters</a></p>
<a name="zzh_gen"></a>
<p class="gray_title">[Full Changer] : General Hardware Information</p>
<p>Zok Zok Heroes was a GBC JRPG released on August 4, 2000, made by Media Factory when they still produced video games. It used a special accessory called the "Full Changer", a device that looks like a toy, but acts as an IR transmitter. It sent signals to the GBC once players moved it through the air to "draw" certain patterns. Once the GBC gets the IR light pulses, it allows players to transform into different "Bright Heroes" to do battle against evil bad guys. It never sold outside of Japan. After a specific point early in the game, it becomes impossible to progress further in emulators without cheat codes/hacks or by properly emulating the Full Changer.</p>
<ul>
<li class="list_item">Zok Zok Heroes (CGB-BZHJ-JPN)</li>
<li class="list_item">MBC5 + Battery Saves</li>
<li class="list_item">GBC Only</li>
<li class="list_item">Comes with 1 Full Changer accessory</li>
<li class="list_item">Full Changer uses one CR2032</li>
<li class="list_item">Full Changer contains 4 Hall effect sensors to detect movement</li>
<li class="list_item">Full Changer has a series of status lights and blinks/beeps when swung correctly</li>
</ul>
<a name="zzh_opr"></a>
<p class="gray_title">[Full Changer] : Operation</p>
<ol>
<li>Grab the Full Changer firmly, holding it by the strap</li>
<li>Press and release the top button. It should beep and the 3 lights should flash for approximately 5 seconds.</li>
<li>During those 5 seconds, move the Full Changer to draw the pattern of a "Cosmic Character" e.g. for "Z" start left, move right, stop, move downward and leftward, stop, move right, stop.</li>
<li>Make sure the Full Changer is always held upright while drawing.</li>
<li>For each successful movement, the Full Changer will activate another light and beep. Once all three at lit, it beeps a little tune and the data is ready to be sent to the GBC.</li>
<li>Put the bottom of the Full Changer on top of the GBC, making sure to cover the IR port. The Full Changer has a little plastic guide to make sure everything fits and faces the right direction.</li>
</ol>
<a name="zzh_com"></a>
<p class="gray_title">[Full Changer] : IR Communication</p>
<p>The Full Changer sends a total of 18 IR pulses (ON then OFF periods) when transmitting data. The length of these pulses varies and determines what values the Full Changer is trying to send. Zok Zok Heroes runs in a couple of loops while the pulse takes place. Each iteration, it increments a counter to get an idea of the overall "delay" it takes for the IR light to turn on then turn off. That counter is then placed in WRAM as a single byte (anything greater than 0xFF causes a timeout) and verified later. In this way, Zok Zok Heroes can view data from the Full Changer as a series of bytes rather than light pulses. These 18 bytes do not have especially strict values, rather they are expected to fall within a certain range to indicate long or short pulses.</p>
<a name="zzh_cap"></a>
<p class="gray_title">[Full Changer] : Capturing IR Data</p>
<p>Below is psuedo-code representing how Zok Zok Heroes grabs the 18 bytes:</p>
<pre>==================================
LABEL CHECK_ON_LOOP:
==================================
//Use an 8-bit CPU register as a Time-Out Counter, initially set to 0xFF, exit if it hits zero
TIMEOUT_COUNTER--
IF(TIMEOUT_COUNTER == 0)
{
RETURN
}
//Load A from 16-bit immediate address for RP register
A = [0xFF56]
//Wait for IR light to come on (Bit 1 of 0xFF56 goes to zero)
IF(A AND 0x1)
{
GOTO CHECK_ON_LOOP
}
//Use another 8-bit CPU register to act as a counter for total number of bytes processed from Full Changer
TOTAL_BYTES = 0x12
//Set a 16-bit CPU register pair as the destination address (0xD005+) to write IR data
DEST_ADDR = 0xD005
==================================
LABEL GRAB_IR_BYTES:
==================================
//Wait for IR light to go off (Bit 1 of 0xFF56 goes to one)
//Set an 8-bit CPU register to act as an IR pulse length counter, initialized to 0x00
PULSE_LENGTH = 0x00
CALL WAIT_FOR_OFF
CALL WAIT_FOR_ON
//Save pulse length results to 0xD005 - 0xD017
[DEST_ADDR] = PULSE_LENGTH
DEST_ADDR++
TOTAL_BYTES--
IF(TOTAL_BYTES != 0)
{
GOTO GRAB_IR_BYTES
}
...
//IR handling code ends here
==================================
FUNCTION WAIT_FOR_OFF:
==================================
PULSE_LENGTH++
IF(PULSE_LENGTH == 0)
{
RETURN
}
//Load A from 16-bit immediate address for RP register
A = [0xFF56]
//Wait for IR light to come on (Bit 1 of 0xFF56 goes to one)
IF((A AND 0x1) == 0x00)
{
GOTO WAIT_FOR_OFF
}
RETURN
==================================
FUNCTION WAIT_FOR_ON:
==================================
PULSE_LENGTH++
IF(PULSE_LENGTH == 0)
{
RETURN
}
//Load A from 16-bit immediate address for RP register
A = [0xFF56]
//Wait for IR light to come on (Bit 1 of 0xFF56 goes to zero)
IF(A AND 0x1)
{
GOTO WAIT_FOR_ON
}
RETURN</pre>
<p>Once all 18 bytes have been stored in WRAM, it's possible to read them and save them using a ROM hack. Alternatively, homebrew software can use code with the same timing to accurately capture IR data from the Full Changer.</p>
<a name="zzh_emu"></a>
<p class="gray_title">[Full Changer] : Emulation</p>
<p>The Full Changer can be successfully emulated by setting Bit 1 of RP register (located at 0xFF56) to 0 or 1 at the appropiate times. To do so requires accurate timing and knowing the amount of cycles it takes to generate the delays represented by those 18 bytes in WRAM. When activating the Full Changer, GBE+ always fires the 1st "ON" IR signal at a specific time to get consistent timings:</p>
<pre>TIMEOUT_COUNTER--
IF(TIMEOUT_COUNTER == 0)
{
RETURN
}
A = [0xFF56]
<---- After the CPU reads 0xFF56 and the user activates the Full Changer, IR light is turned on here
<---- This happens after the actual read instruction is executed, so the loop runs once more
IF(A AND 0x1)
{
GOTO CHECK_ON_LOOP
}</pre>
<p>Afterwards, the timings for ON and OFF pulses can be calculated as such (ALL TIMING IS IN DOUBLE SPEED):</p>
<pre>1st ON pulse length 74 + (20 * (LENGTH-2))
Every other ON pulse length 78 + (20 * (LENGTH-2))
OFF pulse length 38 + (20 * (LENGTH-2))</pre>
<p>The LENGTH is number of times the 8-bit CPU register is incremented in the WAIT_FOR_OFF or WAIT_FOR_ON functions. The sum of two LENGTHs from one ON pulse and one OFF pulse must be equal to the delay data in WRAM. For example, say the delay data contains 0x20. This means that the TOTAL amount of times the 8-bit register was incremented is 0x20. In a perfect world, the Full Changer would probably turn on the IR light so that this 8-bit register is incremented 0x10 times, then turn off the IR light so that D is incremented again 0x10 times. In reality, however, the length of the ON/OFF pulses could run a bit longer or shorter. As far as Zok Zok Heroes is concerned, the total amount of time the IR light is ON then OFF is what matters, so the ON/OFF pulse timings ultimately have to add up</p>
<p>The current database GBE+ uses recreates ON/OFF pulses that generally run for the same amount of cycles. However, based on hardware tests, the ON pulses have variable lengths, while the OFF pulses are typically constant. Again, Zok Zok Heroes won't care, as long as the total time of the ON/OFF pulses meets whatever value it expects.</p>
<a name="zzh_cos"></a>
<p class="gray_title">[Full Changer] : Cosmic Characters</p>
<p>There are a total of 70 "Cosmic Characters" available in Zok Zok Heroes, and by extension, there are 70 unique transformations. This Cosmic Character is simply an 8-bit ID generated from the ON and OFF pulses from the Full Changer. Using the delays stored in the 18 WRAM bytes, the game software uses the following logic to determine an ID.</p>
<p>The first pulse is checked to ensure that it has a delay greater than 0x20, signaling a long pulse, otherwise processing for the Cosmic Character does not continue. Afterwards, the next 16 pulses are examined to build two separate 8-bit values. These values are constructed LSB. A short pulse (any value from 0x00 to 0x13) translates into a "0", and a long pulse (any value from 0x14 to 0x20) translates into a "1". The 1st 8-bit value built from these pulses is used for a checksum of a sort, and the 2nd 8-bit value is complemented to form an ID. IDs range from 0x01 to 0x46 and correspond to the 70 Cosmic Characters. Note that while the 18th IR pulse is required by the software, it isn't used for the ID or checksum.</p>
<pre>Checksum Calculation:
Pulse Byte 1 + Pulse Byte 2 = 0xFF
Cosmic Character ID Calculation:
~Pulse Byte 2 = Cosmic Character ID
Pulse Byte 1 Calculation (using an arbitrary ID of one's choosing):
Pulse Byte 1 = 0xFF - (~Cosmic Character ID)
Pulse Byte 2 Calculation (using an arbitrary ID of one's choosing):
Pulse Byte 2 = ~Cosmic Character ID
------------------------------------------------------------------------------------------------------------
ID | Cosmic Character Movements (S* = Short Move) | Translated Name | (Character) Japanese Name
------------------------------------------------------------------------------------------------------------
01 | Up, Down, Up | Alkaline Powered | (あ) アルカリパワード
02 | Right, Left, Right | In Water | (い) イン ウォーター
03 | Down, Up, Down | Ultra Runner | (う) ウルトランナー
04 | Left, Right, Left | Aero Power | (え) エアロ パワー
05 | Down+Left, Right, Left | Ochaapa | (お) オチャッパ
06 | Up, Right, Down | Kaizer Edge | (か) カイザーエッジ
07 | Right, Down, Left | King Batter | (き) キングバッター
08 | Down, Left, Up | Crash Car | (く) クラッシッカー
09 | Left, Up, Right | Cellphone Tiger | (け) ケイタイがー
10 | Down+Left, Up, Right | Cup Ace | (こ) コップエース
11 | Up, Left, Down | Sakanard | (さ) サカナード
12 | Right, Up, Left | Thin Delta | (し) シンデルター
13 | Down, Right, Up | Skateboard Rider | (す) スケボーライダー
14 | Left, Down, Right | Celery Star | (せ) セロリスター
15 | Down+Left, S* Down, Right | Cleaning Killer | (そ) ソウジキラー
16 | S* Up, Right, S* Up | Takoyaki Kid | (た) タコアキッド
17 | S* Right, Down, S* Right | Chinkoman | (ち) チンコーマン
18 | S* Down, Left, S* Down | Tsukai Stater | (つ) ツカイステイター
19 | S* Left, Up, S* Left | Teppangar | (て) テッパンガー
20 | S* Down+Left, Up, S* Left | Tongararin | (と) トンガラリン
21 | S* Up, Right, Left | Nagashiman | (な) ナガシマン
22 | S* Right, Down, Up | Ninja | (に) ニンジャーノン
23 | S* Down, Left, Right | Plushy-chan | (ぬ) ぬいぬいちゃん
24 | S* Left, Up, Down | Screw Razor | (ね) ネジレイザー
25 | S* Down+Left, Up, Down | Nobel Brain | (の) ノーベルブレイン
26 | S* Up, Left, S* Up | Hard Hammer | (は) ハードハンマー
27 | S* Right, Up, S* Right | Heat Man | (ひ) ヒートマン
28 | S* Down, Right, S* Down | Flame Gourmet | (ふ) フレイムグルメ
29 | S* Left, Down, S* Left | Hercules Army | (へ) ヘラクレスアーミー
30 | S* Down+Left, S* Down, S* Left | Hot Card | (ほ) ホットカード
31 | S* Up, Left, Right | Mr. Muscle | (ま) マッスルさん
32 | S* Right, Up, Down | Mist Water | (み) ミストウォーター
33 | S* Down, Right, Left | Mushimushi Man | (む) ムシムシマン
34 | S* Left, Down, Up | Megaaten | (め) メガーテン
35 | Down+Left, Down, Up | Mobile Robot X | (も) モビルロボX
36 | Up, Down, Left | Yaki Bird | (や) ヤキバード
37 | Down, Up, Right | Utron | (ゆ) ユートロン
38 | Down+Left, Right, Down | Yo-Yo Mask | (よ) ヨーヨーマスク
39 | Up, Down, Right | Radial Road | (ら) ラジアルロード
40 | Right, Left, Down | Remote-Control Man | (り) リモコンマン
41 | Down, Up, Left | Ruby Hook | (る) ルビーフック
42 | Left, Right, Up | Retro Sounder | (れ) レトロサウンダー
43 | Down+Left, Right, S* Up | Rocket Bastard | (ろ) ロケットやろう
44 | Up, Down, Up+Left | Wild Sword | (わ) ワイルドソード
45 | Up, Down+Right, S* Left | Guts Lago | (が) ガッツラゴー
46 | Right, Down+Left, S* Up | Giniun | (ぎ) ギーニウン
47 | Down, Up+Left, S* Right | Great Fire | (ぐ) グレートファイヤー
48 | Left, Up+Right, S* Down | Gamemark | (げ) ゲーマルク
49 | Down+Left, Up+Right, S* Down | Gorilla Killa | (ご) ゴウリキラー
50 | Up, Down+Right, S* Right | The Climber | (ざ) ザ・クライマー
51 | Right, Up+Left, S* Down | G Shark | (じ) Gシャーク
52 | Down, Up+Right, S* Left | Zoom Laser | (ず) ズームレーザー
53 | Left, Down+right, S* Up | Zenmai | (ぜ) ゼンマイン
54 | S* Down+Left, S* Down+Right, S* Up | Elephant Shower | (ぞ) ゾウシャワー
55 | Up, Down+Right, Up | Diamond Mall | (だ) ダイヤモール
56 | Right, Down+Left, Right | Digronyan | (ぢ) ヂグロニャン
57 | Down, Up+Left, Down | Ziza One | (づ) ヅィザーワン
58 | Left, Up+Right, Left | Danger Red | (で) デンジャレッド
59 | Down+Left, Up+Right, Left | Dohatsuten | (ど) ドハツテン
60 | Up, Down+Left, Up | Balloon | (ば) バルバルーン
61 | Right, Up+Left, Right | Videoja | (び) ビデオージャ
62 | Down, Up+Right, Down | Boo Boo | (ぶ) ブーブーウー
63 | Left, Down+Right, Left | Belt Jain | (べ) ベルトジャイン
64 | S* Down+Left, Down+Right, Left | Boat Ron | (ぼ) ボートロン
65 | Up, Down+Left, Up+Left | Perfect Sun | (ぱ) パーフェクトサン
66 | Right, Up+Left, Up+Right | Pinspawn | (ぴ) ピンスポーン
67 | Down, Up+Right, Down+Right | Press Arm | (ぷ) プレスアーム
68 | Left, Down+Right, Down+Left | Pegasus Boy | (ぺ) ペガサスボーイ
69 | S* Down+Left, S* Down+Right, S* Down+Left | Pop Thunder | (ぽ) ポップサンダー
70 | Right, Down+Left, Down+Right | Ndjamenas | (ん) ンジャメナス</pre>
<!-- GBC IR -->
<a name="ir"></a>
<p class="gray_title">GBC Infrared Communication</p>
<p class="list_item"><a href="#ir_gen">General Hardware Information</a></p>
<p class="list_item"><a href="#ir_gam">Compatible Games</a></p>
<p class="list_item"><a href="#ir_typ">Communication Types</a></p>