Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'optimize' of https://github.com/Drenn1/wla-dx
- Loading branch information
Showing
31 changed files
with
1,800 additions
and
613 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
|
||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
; colour gameboy hardware register definitions | ||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
|
||
.DEFINE P1 $FF00 | ||
.DEFINE SB $FF01 | ||
.DEFINE SC $FF02 | ||
.DEFINE DIV $FF04 | ||
.DEFINE TIMA $FF05 | ||
.DEFINE TMA $FF06 | ||
.DEFINE TAC $FF07 | ||
.DEFINE IF $FF0F | ||
.DEFINE NR10 $FF10 | ||
.DEFINE NR11 $FF11 | ||
.DEFINE NR12 $FF12 | ||
.DEFINE NR13 $FF13 | ||
.DEFINE NR14 $FF14 | ||
.DEFINE NR21 $FF16 | ||
.DEFINE NR22 $FF17 | ||
.DEFINE NR23 $FF18 | ||
.DEFINE NR24 $FF19 | ||
.DEFINE NR30 $FF1A | ||
.DEFINE NR31 $FF1B | ||
.DEFINE NR32 $FF1C | ||
.DEFINE NR33 $FF1D | ||
.DEFINE NR34 $FF1E | ||
.DEFINE NR41 $FF20 | ||
.DEFINE NR42 $FF21 | ||
.DEFINE NR43 $FF22 | ||
.DEFINE NR44 $FF23 | ||
.DEFINE NR50 $FF24 | ||
.DEFINE NR51 $FF25 | ||
.DEFINE NR52 $FF26 | ||
.DEFINE LCDC $FF40 | ||
.DEFINE STAT $FF41 | ||
.DEFINE SCY $FF42 | ||
.DEFINE SCX $FF43 | ||
.DEFINE LY $FF44 | ||
.DEFINE LYC $FF45 | ||
.DEFINE DMA $FF46 | ||
.DEFINE BGP $FF47 | ||
.DEFINE OBP0 $FF48 | ||
.DEFINE OBP1 $FF49 | ||
.DEFINE WY $FF4A | ||
.DEFINE WX $FF4B | ||
.DEFINE KEY1 $FF4D | ||
.DEFINE VBK $FF4F | ||
.DEFINE HDMA1 $FF51 | ||
.DEFINE HDMA2 $FF52 | ||
.DEFINE HDMA3 $FF53 | ||
.DEFINE HDMA4 $FF54 | ||
.DEFINE HDMA5 $FF55 | ||
.DEFINE RP $FF56 | ||
.DEFINE BCPS $FF68 | ||
.DEFINE BCPD $FF69 | ||
.DEFINE OCPS $FF6A | ||
.DEFINE OCPD $FF6B | ||
.DEFINE SVBK $FF70 | ||
.DEFINE IE $FFFF | ||
|
||
.DEFINE R_P1 $00 | ||
.DEFINE R_SB $01 | ||
.DEFINE R_SC $02 | ||
.DEFINE R_DIV $04 | ||
.DEFINE R_TIMA $05 | ||
.DEFINE R_TMA $06 | ||
.DEFINE R_TAC $07 | ||
.DEFINE R_IF $0F | ||
.DEFINE R_NR10 $10 | ||
.DEFINE R_NR11 $11 | ||
.DEFINE R_NR12 $12 | ||
.DEFINE R_NR13 $13 | ||
.DEFINE R_NR14 $14 | ||
.DEFINE R_NR21 $16 | ||
.DEFINE R_NR22 $17 | ||
.DEFINE R_NR23 $18 | ||
.DEFINE R_NR24 $19 | ||
.DEFINE R_NR30 $1A | ||
.DEFINE R_NR31 $1B | ||
.DEFINE R_NR32 $1C | ||
.DEFINE R_NR33 $1D | ||
.DEFINE R_NR34 $1E | ||
.DEFINE R_NR41 $20 | ||
.DEFINE R_NR42 $21 | ||
.DEFINE R_NR43 $22 | ||
.DEFINE R_NR44 $23 | ||
.DEFINE R_NR50 $24 | ||
.DEFINE R_NR51 $25 | ||
.DEFINE R_NR52 $26 | ||
.DEFINE R_LCDC $40 | ||
.DEFINE R_STAT $41 | ||
.DEFINE R_SCY $42 | ||
.DEFINE R_SCX $43 | ||
.DEFINE R_LY $44 | ||
.DEFINE R_LYC $45 | ||
.DEFINE R_DMA $46 | ||
.DEFINE R_BGP $47 | ||
.DEFINE R_OBP0 $48 | ||
.DEFINE R_OBP1 $49 | ||
.DEFINE R_WY $4A | ||
.DEFINE R_WX $4B | ||
.DEFINE R_KEY1 $4D | ||
.DEFINE R_VBK $4F | ||
.DEFINE R_HDMA1 $51 | ||
.DEFINE R_HDMA2 $52 | ||
.DEFINE R_HDMA3 $53 | ||
.DEFINE R_HDMA4 $54 | ||
.DEFINE R_HDMA5 $55 | ||
.DEFINE R_RP $56 | ||
.DEFINE R_BCPS $68 | ||
.DEFINE R_BCPD $69 | ||
.DEFINE R_OCPS $6A | ||
.DEFINE R_OCPD $6B | ||
.DEFINE R_SVBK $70 | ||
.DEFINE R_IE $FF |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
; universal defines | ||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
|
||
.NAME "WLA TEST ROM" | ||
.RAMSIZE 0 | ||
.EMPTYFILL $00 ;ret. | ||
.CARTRIDGETYPE 1 | ||
.LICENSEECODEOLD $1A | ||
.COMPUTECHECKSUM | ||
.COMPUTECOMPLEMENTCHECK | ||
|
||
.PRINTT WLA_FILENAME | ||
.PRINTT "\n" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
; universal defines | ||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
|
||
.RAMSIZE 0 | ||
.EMPTYFILL $C9 ;ret. | ||
.CARTRIDGETYPE 1 | ||
.LICENSEECODEOLD $1A | ||
.COMPUTECHECKSUM | ||
.COMPUTECOMPLEMENTCHECK |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
; game boy ROM memory map for MBC1-5 | ||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
|
||
.MEMORYMAP | ||
SLOTSIZE $4000 | ||
DEFAULTSLOT 1 | ||
SLOT 0 $0000 | ||
SLOT 1 $4000 | ||
.ENDME | ||
|
||
.ROMBANKSIZE $4000 | ||
.ROMBANKS 4 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[objects] | ||
setup.o | ||
main.o |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
|
||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
; This example means to test "namespaces" in wla-dx. Including "masking", | ||
; discarding, etc... | ||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
|
||
.OUTNAME "main.o" | ||
|
||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
; project includes | ||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
|
||
.incdir "bogus" | ||
.INCLUDE "gb_memory1.i" | ||
.incdir "" | ||
.INCLUDE "defines1.i" | ||
.include "cgb_hardware.i" | ||
|
||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
; main | ||
;»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» | ||
|
||
.BANK 0 SLOT 0 | ||
.ORG $150 | ||
|
||
.SECTION "Beginning [NO]" FORCE | ||
|
||
MAIN:DI | ||
LD SP, stack_ptr-1 ;stack_ptr is defined in setup.s | ||
LD A, 'C' - 10 | ||
SUB A | ||
LD ($FF00+R_IE), A ;no interrupts at all. | ||
|
||
LD A, 144 | ||
LDH (R_WY), A ;window y. | ||
|
||
LD A, %10000001 | ||
LDH [R_LCDC], A ;lcd control. | ||
|
||
SUB A | ||
|
||
call s1.func1 | ||
call s1.func2 | ||
call func3 | ||
call func4 | ||
call s3.func3 | ||
call shared.sharedFunc | ||
call shared.sharedEntry | ||
call _globalFunc | ||
|
||
/* | ||
; Uncomment for some errors | ||
call sharedFunc | ||
call sharedEntry | ||
call shared._localFunc | ||
*/ | ||
|
||
ld hl,_LOOP | ||
push hl | ||
ld hl,data | ||
ldi a,(hl) | ||
ld h,(hl) | ||
ld l,a | ||
ld b,20 | ||
- | ||
dec hl | ||
dec b | ||
jr nz,- | ||
jp hl | ||
|
||
_LOOP: LD ($FF00+R_BGP), A ;background palette. | ||
INC A | ||
JP _LOOP | ||
|
||
data: | ||
.dw s3.func3 + 20 ; Test arithmetic on namespaces | ||
|
||
|
||
.ENDS | ||
|
||
.SECTION "Second part of shared namespace" namespace "shared" | ||
|
||
sharedEntry: | ||
call sharedFunc | ||
; Uncomment for an error | ||
; call _localFunc | ||
ret | ||
|
||
_globalFunc: ; Should not be called | ||
jr _globalFunc | ||
.ENDS | ||
|
||
_globalFunc: | ||
ret |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
CC = ../../../binaries/wla-gb | ||
CFLAGS = -ox | ||
LD = ../../../binaries/wlalink | ||
LDFLAGS = -dvs | ||
|
||
SFILES = setup.s main.s | ||
IFILES = defines1.i defines2.i | ||
OFILES = main.o setup.o | ||
|
||
all: $(OFILES) makefile | ||
$(LD) $(LDFLAGS) linkfile linked.gb | ||
|
||
main.o: main.s defines1.i gb_memory1.i | ||
$(CC) $(CFLAGS) main.s | ||
|
||
setup.o: setup.s defines2.i gb_memory1.i | ||
$(CC) $(CFLAGS) setup.s | ||
|
||
|
||
$(OFILES): $(HFILES) | ||
|
||
|
||
clean: | ||
rm -f $(OFILES) core *~ linked.gb linked.sym |
Oops, something went wrong.