This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def put_16bit(rom,addr,value): | |
| rom[addr] = value & 0xff | |
| rom[addr+1] = (value>>8) & 0xff | |
| def put_16bit_be(rom,addr,value): | |
| rom[addr] = (value>>8) & 0xff | |
| rom[addr+1] = value & 0xff | |
| def patch_rom(in_file,out_file,byte_value): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SGB_SEND_PACKET_new:: | |
| ld BC,16+1 ; B=0, C=SGB packet length in bytes, +1 . | |
| xor A ; A=0, also clear carry. | |
| ldh [rP1],A ; Send start bit. | |
| .bitloop | |
| ld A,$30 | |
| ldh [rP1],A ; Send idle state. | |
| .bitloop_into | |
| rr B ; Get next bit, plus zero check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FORMAT: MACRO | |
| ld hl, \1 | |
| ld de, \2 | |
| ld d, d | |
| jr .end\@ | |
| DW $6464 | |
| DW $0200 | |
| .end\@: | |
| ENDM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ld B,A ; Store untouched copy DULRSsBA | |
| and $A0 ; Mask out D0L00000 | |
| rrca ; Rotate right 0D0L0000 | |
| ld C,A ; Store 0D0L0000 for later. | |
| ld A,B ; Restore unmodified copy. | |
| and $F0 ; Mask out DULR0000 | |
| add B ; Shift only upper nibble left. | |
| ; A DULR0000 | |
| ; B +DULRSsBA | |
| ; =ULR0SsBA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xor a | |
| ldh [$FF40],a ; Disable LCD as early as possible | |
| ld hl,.hram_payload_start | |
| ld c,$80 ; Bottom of HRAM | |
| .copyloop | |
| ldi a,[hl] | |
| ld [$ff00+c],a | |
| inc c | |
| jr nz,.copyloop | |
| jp $FF80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) xx Ernst-Erich Stender - Fantasia et Fuga, BWV 542: Fuga (no) | |
| 2) Klaus Wunderlich - Hammond Pops - 06 - Bounce-Shuffle Medley | |
| 3) xx Galaxy Racer - Inside the Atmosphere (noooo) | |
| 4) xx London Music Works - Cornfield Chase (noooo) Pixel Tricks - Story of the Cherry Tree (noooo) | |
| 5) Nils Dacke - Mah-na-ma-na (yes!) | |
| 6) The Golden Nightingale Orchestra - La Bamba | |
| 7) xx Munk & Lizzie Paige - Southern Moon (Hnny Remix) (noooo) | |
| 8) Klaus Wunderlich - Die Lustige Weiber Von Windsor (yes!) | |
| 9) The Golden Nightningale Orchestra - Clarient Polka (yes!) | |
| 10) xx Suchard - The Halloween Street (noooo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; GBDK abs function | |
| ; Original rewrite by JL2210 | |
| ; int abs(int) | |
| _abs:: | |
| ; first word is return address | |
| ; second is argument | |
| pop hl ; 3 | |
| pop de ; 3 make copy of de | |
| push de ; 4 but leave it on the stack for the caller to clean up | |
| ld a, d ; 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [MENU] | |
| MENUITEM=WIN, Windows | |
| MENUITEM=GRUB, GRUB | |
| [GRUB] | |
| DEVICE=C:\GRUB.EXE | |
| [WIN] | |
| ; The original contents of config.sys go here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from big_ol_pile_of_manim_imports import * | |
| from math import sin | |
| def cos_product_approximation(order): | |
| return lambda x : np.prod([x]+[ | |
| np.cos(x/(2**k)) | |
| for k in range(1,order+2) | |
| ]) | |
| class ExampleApproximation(GraphScene): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Input conditions: | |
| ; HL contains the upper byte of the 16 bit variable. | |
| ; HL+1 contains the lower byte of the 16 bit variable. | |
| LD A,[HL+] ; A now contains the upper byte. HL contains a pointer to the lower byte. | |
| RL [HL] ; Extract the upper bit of the lower byte into the carry flag. | |
| ; Pseudo-C: carry = (LOWER & 0x80) ? 1 : 0; | |
| ADC A,A ; ADD A,A is equivalent to a 1 bit left shift. | |
| ; ADC A,A (add carry) is equivalent to a 1 bit left shift which also shifts in carry into the lowest bit. | |
| ; Pseudo-C: LOWER = (UPPER<<1)|carry; |
NewerOlder