git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit b179fae124746b85eab9a2382612449c35ab2d6e
parent 7161638dd214ffebcb69a635d0951e848d3f2bdb
Author: Toxa <untoxa@mail.ru>
Date:   Thu,  2 Sep 2021 18:16:39 +0300

SMS/GG: joypad_init() returns 1 available joypad on GG

Diffstat:
Mgbdk-lib/include/gb/gb.h54+++++++++++++++++++++++++++---------------------------
Mgbdk-lib/include/gb/hardware.h22+++++++++++-----------
Mgbdk-lib/include/sms/hardware.h30+++++++++++++++---------------
Mgbdk-lib/include/sms/sms.h16++++++++--------
Mgbdk-lib/libc/targets/gbz80/gb/global.s56++++++++++++++++++++++++++++----------------------------
Mgbdk-lib/libc/targets/z80/gg/global.s60++++++++++++++++++++++++++++++------------------------------
Mgbdk-lib/libc/targets/z80/sms/global.s56++++++++++++++++++++++++++++----------------------------
7 files changed, 147 insertions(+), 147 deletions(-)

diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -179,8 +179,8 @@ void remove_JOY(int_handler h) NONBANKED; only three may be added. Do not use '__critical' and '__interrupt' attributes for a - function added via add_VBL() (or LCD, etc). The attributes - are only required when constructing a bare jump from the + function added via add_VBL() (or LCD, etc). The attributes + are only required when constructing a bare jump from the interrupt vector itself. Note: The default VBL is installed automatically. @@ -631,7 +631,7 @@ void display_off(void) NONBANKED __preserves_regs(b, c, d, e, h, l); /** Copies data from shadow OAM to OAM */ -void refresh_OAM() NONBANKED; +void refresh_OAM() NONBANKED; /** Copies data from somewhere in the lower address space to part of hi-ram. @@ -658,11 +658,11 @@ void hiramcpy(uint8_t dst, /** Does nothing for GB */ -#define HIDE_LEFT_COLUMN +#define HIDE_LEFT_COLUMN /** Does nothing for GB */ -#define SHOW_LEFT_COLUMN +#define SHOW_LEFT_COLUMN /** Turns on the background layer. Sets bit 0 of the LCDC register to 1. @@ -716,7 +716,7 @@ void hiramcpy(uint8_t dst, /** * Set byte in vram at given memory location - * + * * @param addr address to write to * @param v value */ @@ -724,7 +724,7 @@ void set_vram_byte(uint8_t * addr, uint8_t v) __preserves_regs(b, c); /** * Get byte from vram at given memory location - * + * * @param addr address to read from * @return read value */ @@ -819,12 +819,12 @@ void get_bkg_data(uint8_t first_tile, Use @ref set_bkg_submap() instead when: \li Source map is wider than 32 tiles. - \li Writing a width that does not match the source map width __and__ more + \li Writing a width that does not match the source map width __and__ more than one row high at a time. One byte per source tile map entry. - Writes that exceed coordinate 31 on the x or y axis will wrap around to + Writes that exceed coordinate 31 on the x or y axis will wrap around to the Left and Top edges. Note: Patterns 128-255 overlap with patterns 128-255 of the sprite Tile Pattern table. @@ -866,8 +866,8 @@ void set_bkg_tiles(uint8_t x, #define set_tile_map set_bkg_tiles -/** Sets a rectangular area of the Background Tile Map using a sub-region - from a source tile map. Useful for scrolling implementations of maps +/** Sets a rectangular area of the Background Tile Map using a sub-region + from a source tile map. Useful for scrolling implementations of maps larger than 32 x 32 tiles. @param x X Start position in Background Map tile coordinates. Range 0 - 31 @@ -878,16 +878,16 @@ void set_bkg_tiles(uint8_t x, @param map_w Width of source tile map in tiles. Range 1 - 255 Entries are copied from __map__ to the Background Tile Map starting at - __x__, __y__ writing across for __w__ tiles and down for __h__ tiles, + __x__, __y__ writing across for __w__ tiles and down for __h__ tiles, using __map_w__ as the rowstride for the source tile map. Use this instead of @ref set_bkg_tiles when the source map is wider than - 32 tiles or when writing a width that does not match the source map width. + 32 tiles or when writing a width that does not match the source map width. One byte per source tile map entry. - Writes that exceed coordinate 31 on the x or y axis will wrap around to - the Left and Top edges. + Writes that exceed coordinate 31 on the x or y axis will wrap around to + the Left and Top edges. See @ref set_bkg_tiles for setting CGB attribute maps with @ref VBK_REG. @@ -926,7 +926,7 @@ void get_bkg_tiles(uint8_t x, * @param y Y-coordinate * @param t tile index * @return returns the address of tile, so you may use faster set_vram_byte() later - */ + */ uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) __preserves_regs(b, c); #define set_tile_xy set_bkg_tile_xy @@ -935,7 +935,7 @@ uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) __preserves_regs(b, c * @param x X-coordinate * @param y Y-coordinate * @return returns tile index - */ + */ uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) __preserves_regs(b, c); @@ -1040,12 +1040,12 @@ void get_win_data(uint8_t first_tile, Use @ref set_win_submap() instead when: \li Source map is wider than 32 tiles. - \li Writing a width that does not match the source map width __and__ more + \li Writing a width that does not match the source map width __and__ more than one row high at a time. One byte per source tile map entry. - Writes that exceed coordinate 31 on the x or y axis will wrap around to + Writes that exceed coordinate 31 on the x or y axis will wrap around to the Left and Top edges. Note: Patterns 128-255 overlap with patterns 128-255 of the sprite Tile Pattern table. @@ -1065,7 +1065,7 @@ void set_win_tiles(uint8_t x, const uint8_t *tiles) NONBANKED __preserves_regs(b, c); -/** Sets a rectangular area of the Window Tile Map using a sub-region +/** Sets a rectangular area of the Window Tile Map using a sub-region from a source tile map. @param x X Start position in Window Map tile coordinates. Range 0 - 31 @@ -1076,15 +1076,15 @@ void set_win_tiles(uint8_t x, @param map_w Width of source tile map in tiles. Range 1 - 255 Entries are copied from __map__ to the Window Tile Map starting at - __x__, __y__ writing across for __w__ tiles and down for __h__ tiles, + __x__, __y__ writing across for __w__ tiles and down for __h__ tiles, using __map_w__ as the rowstride for the source tile map. Use this instead of @ref set_win_tiles when the source map is wider than - 32 tiles or when writing a width that does not match the source map width. + 32 tiles or when writing a width that does not match the source map width. One byte per source tile map entry. - Writes that exceed coordinate 31 on the x or y axis will wrap around to + Writes that exceed coordinate 31 on the x or y axis will wrap around to the Left and Top edges. GBC only: @ref VBK_REG determines whether Tile Numbers or Tile Attributes get set. @@ -1126,7 +1126,7 @@ void get_win_tiles(uint8_t x, * @param y Y-coordinate * @param t tile index * @return returns the address of tile, so you may use faster set_vram_byte() later - */ + */ uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) __preserves_regs(b, c); @@ -1135,7 +1135,7 @@ uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) __preserves_regs(b, c * @param x X-coordinate * @param y Y-coordinate * @return returns the tile index - */ + */ uint8_t get_win_tile_xy(uint8_t x, uint8_t y) __preserves_regs(b, c); @@ -1471,7 +1471,7 @@ void set_tiles(uint8_t x, uint8_t *vram_addr, const uint8_t *tiles) NONBANKED __preserves_regs(b, c); -/** Sets VRAM Tile Pattern data starting from given base address +/** Sets VRAM Tile Pattern data starting from given base address without taking into account the state of LCDC bit 4. @param first_tile Index of the first tile to write @@ -1479,7 +1479,7 @@ void set_tiles(uint8_t x, @param data Pointer to (2 bpp) source Tile Pattern data. @param base MSB of the destination address in VRAM (usually 0x80 or 0x90 which gives 0x8000 or 0x9000) -set_tile_data() allows to load tile data not taking into account LCDC bit 4 state +set_tile_data() allows to load tile data not taking into account LCDC bit 4 state */ void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, diff --git a/gbdk-lib/include/gb/hardware.h b/gbdk-lib/include/gb/hardware.h @@ -15,26 +15,26 @@ /** Memoty map */ -__BYTES _VRAM[]; +__BYTES _VRAM[]; __BYTES _VRAM8000[]; __BYTES _VRAM8800[]; __BYTES _VRAM9000[]; -__BYTES _SCRN0[]; -__BYTES _SCRN1[]; -__BYTES _SRAM[]; -__BYTES _RAM[]; -__BYTES _RAMBANK[]; -__BYTES _OAMRAM[]; -__BYTE_REG _IO[]; +__BYTES _SCRN0[]; +__BYTES _SCRN1[]; +__BYTES _SRAM[]; +__BYTES _RAM[]; +__BYTES _RAMBANK[]; +__BYTES _OAMRAM[]; +__BYTE_REG _IO[]; __BYTE_REG _AUD3WAVERAM[]; -__BYTE_REG _HRAM[]; +__BYTE_REG _HRAM[]; /** MBC5 registers */ -__BYTE_REG rRAMG; +__BYTE_REG rRAMG; __BYTE_REG rROMB0; __BYTE_REG rROMB1; -__BYTE_REG rRAMB; +__BYTE_REG rRAMB; /** IO Registers */ diff --git a/gbdk-lib/include/sms/hardware.h b/gbdk-lib/include/sms/hardware.h @@ -89,38 +89,38 @@ extern UBYTE shadow_VDP_R3; extern UBYTE shadow_VDP_R4; #define VDP_R5 0b10000101 extern UBYTE shadow_VDP_R5; - + #define R5_SAT_0x3F00 0xFF #define R5_SAT_MASK 0b10000001 - + #define VDP_R6 0b10000110 extern UBYTE shadow_VDP_R6; - + #define R6_BANK0 0xFB #define R6_DATA_0x0000 0xFB #define R6_BANK1 0xFF #define R6_DATA_0x2000 0xFF - + #define VDP_R7 0b10000111 extern UBYTE shadow_VDP_R7; #define VDP_RBORDER 0b10000111 extern UBYTE shadow_VDP_RBORDER; - + #define R7_COLOR_MASK 0b11110000 - + #define VDP_R8 0b10001000 extern UBYTE shadow_VDP_R8; #define VDP_RSCX 0b10001000 extern UBYTE shadow_VDP_RSCX; - + #define VDP_R9 0b10001001 extern UBYTE shadow_VDP_R9; #define VDP_RSCY 0b10001001 extern UBYTE shadow_VDP_RSCY; - + #define VDP_R10 0b10001010 extern UBYTE shadow_VDP_R10; - + #define R10_INT_OFF 0xFF #define R10_INT_EVERY 0x00 @@ -151,19 +151,19 @@ static volatile __sfr __at(0xF0) FMADDRESS; static volatile __sfr __at(0xF1) FMDATA; static volatile __sfr __at(0xF2) AUDIOCTRL; -static volatile UBYTE __at(0xfffc) RAM_CONTROL; - +static volatile UBYTE __at(0xfffc) RAM_CONTROL; + #define RAMCTL_BANK 0b00000100 #define RAMCTL_ROM 0b00000000 #define RAMCTL_RAM 0b00001000 #define RAMCTL_RO 0b00010000 #define RAMCTL_PROT 0b10000000 - + static volatile UBYTE __at(0xfff8) GLASSES_3D; -static volatile UBYTE __at(0xfffd) MAP_FRAME0; -static volatile UBYTE __at(0xfffe) MAP_FRAME1; -static volatile UBYTE __at(0xffff) MAP_FRAME2; +static volatile UBYTE __at(0xfffd) MAP_FRAME0; +static volatile UBYTE __at(0xfffe) MAP_FRAME1; +static volatile UBYTE __at(0xffff) MAP_FRAME2; extern const UBYTE _BIOS; diff --git a/gbdk-lib/include/sms/sms.h b/gbdk-lib/include/sms/sms.h @@ -132,7 +132,7 @@ void set_interrupts(uint8_t flags) __z88dk_fastcall; */ typedef void (*int_handler)(void) NONBANKED; -/** Removes the VBL interrupt handler. +/** Removes the VBL interrupt handler. @see add_VBL() */ void remove_VBL(int_handler h) __z88dk_fastcall __preserves_regs(iyh, iyl); @@ -225,12 +225,12 @@ void refresh_OAM(); /** Turns off the background layer. Not yet implemented */ -#define HIDE_BKG +#define HIDE_BKG /** Turns on the window layer Not yet implemented */ -#define SHOW_WIN +#define SHOW_WIN /** Turns off the window layer. Not yet implemented @@ -554,7 +554,7 @@ inline uint8_t get_sprite_tile(uint8_t nb) { Moving the sprite to 0,0 (or similar off-screen location) will hide it. */ inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) { - shadow_OAM[nb] = (y < VDP_SAT_TERM) ? y : 0xC0; + shadow_OAM[nb] = (y < VDP_SAT_TERM) ? y : 0xC0; shadow_OAM[0x40+(nb << 1)] = x; } @@ -571,7 +571,7 @@ inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) { */ inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) { uint8_t new_y = shadow_OAM[nb] + y; - shadow_OAM[nb] = (new_y < VDP_SAT_TERM) ? new_y : 0xC0; + shadow_OAM[nb] = (new_y < VDP_SAT_TERM) ? new_y : 0xC0; shadow_OAM[0x40+(nb << 1)] = x; } @@ -586,7 +586,7 @@ inline void hide_sprite(uint8_t nb) { /** * Set byte in vram at given memory location - * + * * @param addr address to write to * @param v value */ @@ -598,7 +598,7 @@ void set_vram_byte(uint8_t * addr, uint8_t v) __z88dk_callee __preserves_regs(iy * @param y Y-coordinate * @param t tile index * @return returns the address of tile, so you may use faster set_vram_byte() later - */ + */ uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) __z88dk_callee __preserves_regs(iyh, iyl); /** @@ -607,7 +607,7 @@ uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) __z88dk_calle * @param y Y-coordinate * @param t tile index * @return returns the address of tile, so you may use faster set_vram_byte() later - */ + */ uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) __z88dk_callee __preserves_regs(iyh, iyl); #define set_bkg_tile_xy set_tile_xy #define set_win_tile_xy set_tile_xy diff --git a/gbdk-lib/libc/targets/gbz80/gb/global.s b/gbdk-lib/libc/targets/gbz80/gb/global.s @@ -1,5 +1,5 @@ .NEAR_CALLS = 1 ; <near_calls> - tag so that sed can change this - + ;; Changed by astorgb.pl to 1 __RGBDS__ = 0 @@ -25,7 +25,7 @@ rROMB0 = 0x2000 ; $2000->$2fff rROMB1 = 0x3000 ; $3000->$3fff - If more than 256 ROM banks are present. rRAMB = 0x4000 ; $4000->$5fff - Bit 3 enables rumble (if present) - + ;; Keypad .START = 0x80 .SELECT = 0x40 @@ -39,7 +39,7 @@ .P14 = 0x10 .P15 = 0x20 - ;; Screen dimensions + ;; Screen dimensions .MAXCURSPOSX = 0x13 ; In tiles .MAXCURSPOSY = 0x11 @@ -51,17 +51,17 @@ .MAXWNDPOSY = 0x8F ;; Hardware registers - + .P1 = 0x00 ; Joystick: 1.1.P15.P14.P13.P12.P11.P10 rP1 = 0xFF00 - + P1F_5 = 0b00100000 ; P15 out port, set to 0 to get buttons P1F_4 = 0b00010000 ; P14 out port, set to 0 to get dpad P1F_3 = 0b00001000 ; P13 in port P1F_2 = 0b00000100 ; P12 in port P1F_1 = 0b00000010 ; P11 in port P1F_0 = 0b00000001 ; P10 in port - + P1F_GET_DPAD = 0b00100000 P1F_GET_BTN = 0b00010000 P1F_GET_NONE = 0b00110000 @@ -80,7 +80,7 @@ .TMA = 0x06 ; Timer modulo rTMA = 0xFF06 - + .TAC = 0x07 ; Timer control rTAC = 0xFF07 @@ -93,7 +93,7 @@ .IF = 0x0F ; Interrupt flags: 0.0.0.JST.SIO.TIM.LCD.VBL rIF = 0xFF0F - + .NR10 = 0x10 ; Sound register rNR10 = 0xFF10 rAUD1SWEEP = 0xFF10 @@ -108,7 +108,7 @@ .NR12 = 0x12 ; Sound register rNR12 = 0xFF12 rAUD1ENV = 0xFF12 - + .NR13 = 0x13 ; Sound register rNR13 = 0xFF13 rAUD1LOW = 0xFF13 @@ -291,21 +291,21 @@ .HDMA2 = 0x52 ; DMA control 2 rHDMA2 = 0xFF52 - + .HDMA3 = 0x53 ; DMA control 3 rHDMA3 = 0xFF53 - + .HDMA4 = 0x54 ; DMA control 4 rHDMA4 = 0xFF54 - + .HDMA5 = 0x55 ; DMA control 5 rHDMA5 = 0xFF55 - + HDMA5F_MODE_GP = 0b00000000 ; General Purpose DMA (W) HDMA5F_MODE_HBL = 0b10000000 ; HBlank DMA (W) HDMA5F_BUSY = 0b10000000 ; 0=Busy (DMA still in progress), 1=Transfer complete (R) - + .RP = 0x56 ; IR port rRP = 0xFF56 @@ -316,7 +316,7 @@ .BCPS = 0x68 ; BG color palette specification rBCPS = 0xFF68 - + BCPSF_AUTOINC = 0b10000000 ; Auto Increment (0=Disabled, 1=Increment after Writing) .BCPD = 0x69 ; BG color palette data @@ -324,18 +324,18 @@ .OCPS = 0x6A ; OBJ color palette specification rOCPS = 0xFF6A - + OCPSF_AUTOINC = 0b10000000 ; Auto Increment (0=Disabled, 1=Increment after Writing) .OCPD = 0x6B ; OBJ color palette data rOCPD = 0xFF6B - + .SVBK = 0x70 ; WRAM bank rSVBK = 0xFF70 rSMBK = 0xFF70 rPCM12 = 0xFF76 - + rPCM34 = 0xFF77 .IE = 0xFF ; Interrupt enable @@ -354,21 +354,21 @@ IEF_VBLANK = 0b00000001 ; V-Blank ;; Flags common to multiple sound channels - + AUDLEN_DUTY_12_5 = 0b00000000 ; 12.5% AUDLEN_DUTY_25 = 0b01000000 ; 25% AUDLEN_DUTY_50 = 0b10000000 ; 50% AUDLEN_DUTY_75 = 0b11000000 ; 75% - + AUDENV_UP = 0b00001000 AUDENV_DOWN = 0b00000000 - + AUDHIGH_RESTART = 0b10000000 AUDHIGH_LENGTH_ON = 0b01000000 AUDHIGH_LENGTH_OFF = 0b00000000 ;; OAM related constants - + OAM_COUNT = 40 ; number of OAM entries in OAM RAM OAMF_PRI = 0b10000000 ; Priority @@ -386,11 +386,11 @@ OAMB_XFLIP = 5 ; X flip OAMB_PAL1 = 4 ; Palette number; 0,1 (DMG) OAMB_BANK1 = 3 ; Bank number; 0,1 (GBC) - + ;; CPU detection .DMG_TYPE = 0x01 ; Original GB or Super GB .MGB_TYPE = 0xFF ; Pocket GB or Super GB 2 - .CGB_TYPE = 0x11 ; Color GB + .CGB_TYPE = 0x11 ; Color GB ;; GBDK library screen modes @@ -400,7 +400,7 @@ .T_MODE_INOUT = 0x03 ; Text mode with input .M_NO_SCROLL = 0x04 ; Disables scrolling of the screen in text mode .M_NO_INTERP = 0x08 ; Disables special character interpretation - + ;; Status codes for IO .IO_IDLE = 0x00 .IO_SENDING = 0x01 @@ -428,7 +428,7 @@ .globl __current_bank .globl __shadow_OAM_base - + ;; Global variables .globl .mode @@ -444,7 +444,7 @@ .globl .wait_vbl_done - ;; Interrupt routines + ;; Interrupt routines .globl .add_VBL ; .globl .add_LCD ;; don't link LCD.o by default ; .globl .add_TIM ;; don't link TIM.o by default @@ -456,7 +456,7 @@ .globl _shadow_OAM .globl .refresh_OAM - ;; Main user routine + ;; Main user routine .globl _main ;; Macro definitions diff --git a/gbdk-lib/libc/targets/z80/gg/global.s b/gbdk-lib/libc/targets/z80/gg/global.s @@ -12,7 +12,7 @@ .MEMCTL_ROMOFF = 0b01000000 .MEMCTL_EXTON = 0b00000000 .MEMCTL_EXTOFF = 0b10000000 - + .JOY_CTL = 0x3F .JOY_P1_LATCH = 0b00000010 @@ -32,11 +32,11 @@ .VDP_DATA = 0xBE .VDP_CMD = 0xBF .VDP_STAT = 0xBF - + .STATF_INT_VBL = 0b10000000 .STATF_9_SPR = 0b01000000 .STATF_SPR_COLL = 0b00100000 - + .VDP_REG_MASK = 0b10000000 .VDP_R0 = 0b10000000 @@ -78,34 +78,34 @@ .VDP_R3 = 0b10000011 .VDP_R4 = 0b10000100 .VDP_R5 = 0b10000101 - + .R5_SAT_0x3F00 = 0xFF .R5_SAT_MASK = 0b10000001 - + .VDP_R6 = 0b10000110 - + .R6_BANK0 = 0xFB .R6_DATA_0x0000 = 0xFB .R6_BANK1 = 0xFF .R6_DATA_0x2000 = 0xFF - + .VDP_R7 = 0b10000111 .VDP_RBORDER = 0b10000111 - + .R7_COLOR_MASK = 0b11110000 - + .VDP_R8 = 0b10001000 .VDP_RSCX = 0b10001000 - + .VDP_R9 = 0b10001001 .VDP_RSCY = 0b10001001 - + .VDP_R10 = 0b10001010 - + .R10_INT_OFF = 0xFF .R10_INT_EVERY = 0x00 - .JOYPAD_COUNT = 2 ; let's support 2-joypad mods + .JOYPAD_COUNT = 1 .UP = 0b00000001 .DOWN = 0b00000010 @@ -115,9 +115,9 @@ .B = 0b00100000 .SELECT = 0b01000000 ; map to RESET .START = 0b01000000 ; map to RESET - + .JOY_PORT1 = 0xDC - + .JOY_P1_UP = 0b00000001 .JOY_P1_DOWN = 0b00000010 .JOY_P1_LEFT = 0b00000100 @@ -127,9 +127,9 @@ .JOY_P1_SW2 = 0b00100000 .JOY_P2_UP = 0b01000000 .JOY_P2_DOWN = 0b10000000 - + .JOY_PORT2 = 0xDD - + .JOY_P2_LEFT = 0b00000001 .JOY_P2_RIGHT = 0b00000010 .JOY_P2_SW1 = 0b00000100 @@ -138,19 +138,19 @@ .JOY_RESET = 0b00010000 .JOY_P1_LIGHT = 0b01000000 .JOY_P2_LIGHT = 0b10000000 - + .FMADDRESS = 0xF0 .FMDATA = 0xF1 .AUDIOCTRL = 0xF2 .RAM_CONTROL = 0xfffc - + .RAMCTL_BANK = 0b00000100 .RAMCTL_ROM = 0b00000000 .RAMCTL_RAM = 0b00001000 .RAMCTL_RO = 0b00010000 .RAMCTL_PROT = 0b10000000 - + .GLASSES_3D = 0xfff8 .MAP_FRAME0 = 0xfffd @@ -158,7 +158,7 @@ .MAP_FRAME2 = 0xffff .BIOS = 0xC000 - + .SYSTEM_PAL = 0x00 .SYSTEM_NTSC = 0x01 @@ -176,8 +176,8 @@ .SCREEN_Y_OFS = 3 .SCREEN_WIDTH = 20 .SCREEN_HEIGHT = 18 - .VDP_MAP_HEIGHT = 28 - .VDP_MAP_WIDTH = 32 + .VDP_MAP_HEIGHT = 28 + .VDP_MAP_WIDTH = 32 ;; Interrupt flags @@ -191,7 +191,7 @@ ;; Global variables .globl .mode - ;; Interrupt routines + ;; Interrupt routines .globl _INT_ISR .globl _NMI_ISR @@ -199,8 +199,8 @@ .globl .STACK .globl _shadow_OAM .globl __shadow_OAM_OFF - - ;; Main user routine + + ;; Main user routine .globl _main ;; Macro definitions @@ -225,7 +225,7 @@ lbl: ld a, regH jp po, lbl ei -lbl: +lbl: out (#.VDP_CMD), a .endm @@ -281,7 +281,7 @@ lbl3: .endm .macro DIV_PART divident divisor ?lbl - rl divident + rl divident rla sub divisor jr nc, lbl @@ -290,7 +290,7 @@ lbl: .endm .macro FAST_DIV8 divident divisor ; returns modulus in A - .rept 8 + .rept 8 DIV_PART divident divisor .endm ld a, divident @@ -298,7 +298,7 @@ lbl: .endm .macro FAST_MOD8 divident divisor ; returns modulus in A - .rept 8 + .rept 8 DIV_PART divident divisor .endm .endm diff --git a/gbdk-lib/libc/targets/z80/sms/global.s b/gbdk-lib/libc/targets/z80/sms/global.s @@ -12,7 +12,7 @@ .MEMCTL_ROMOFF = 0b01000000 .MEMCTL_EXTON = 0b00000000 .MEMCTL_EXTOFF = 0b10000000 - + .JOY_CTL = 0x3F .JOY_P1_LATCH = 0b00000010 @@ -32,11 +32,11 @@ .VDP_DATA = 0xBE .VDP_CMD = 0xBF .VDP_STAT = 0xBF - + .STATF_INT_VBL = 0b10000000 .STATF_9_SPR = 0b01000000 .STATF_SPR_COLL = 0b00100000 - + .VDP_REG_MASK = 0b10000000 .VDP_R0 = 0b10000000 @@ -78,30 +78,30 @@ .VDP_R3 = 0b10000011 .VDP_R4 = 0b10000100 .VDP_R5 = 0b10000101 - + .R5_SAT_0x3F00 = 0xFF .R5_SAT_MASK = 0b10000001 - + .VDP_R6 = 0b10000110 - + .R6_BANK0 = 0xFB .R6_DATA_0x0000 = 0xFB .R6_BANK1 = 0xFF .R6_DATA_0x2000 = 0xFF - + .VDP_R7 = 0b10000111 .VDP_RBORDER = 0b10000111 - + .R7_COLOR_MASK = 0b11110000 - + .VDP_R8 = 0b10001000 .VDP_RSCX = 0b10001000 - + .VDP_R9 = 0b10001001 .VDP_RSCY = 0b10001001 - + .VDP_R10 = 0b10001010 - + .R10_INT_OFF = 0xFF .R10_INT_EVERY = 0x00 @@ -113,11 +113,11 @@ .B = 0b00100000 .SELECT = 0b01000000 ; map to RESET .START = 0b01000000 ; map to RESET - + .JOYPAD_COUNT = 2 .JOY_PORT1 = 0xDC - + .JOY_P1_UP = 0b00000001 .JOY_P1_DOWN = 0b00000010 .JOY_P1_LEFT = 0b00000100 @@ -127,9 +127,9 @@ .JOY_P1_SW2 = 0b00100000 .JOY_P2_UP = 0b01000000 .JOY_P2_DOWN = 0b10000000 - + .JOY_PORT2 = 0xDD - + .JOY_P2_LEFT = 0b00000001 .JOY_P2_RIGHT = 0b00000010 .JOY_P2_SW1 = 0b00000100 @@ -138,19 +138,19 @@ .JOY_RESET = 0b00010000 .JOY_P1_LIGHT = 0b01000000 .JOY_P2_LIGHT = 0b10000000 - + .FMADDRESS = 0xF0 .FMDATA = 0xF1 .AUDIOCTRL = 0xF2 .RAM_CONTROL = 0xfffc - + .RAMCTL_BANK = 0b00000100 .RAMCTL_ROM = 0b00000000 .RAMCTL_RAM = 0b00001000 .RAMCTL_RO = 0b00010000 .RAMCTL_PROT = 0b10000000 - + .GLASSES_3D = 0xfff8 .MAP_FRAME0 = 0xfffd @@ -158,7 +158,7 @@ .MAP_FRAME2 = 0xffff .BIOS = 0xC000 - + .SYSTEM_PAL = 0x00 .SYSTEM_NTSC = 0x01 @@ -177,7 +177,7 @@ .SCREEN_WIDTH = 32 .SCREEN_HEIGHT = 24 .VDP_MAP_HEIGHT = 28 - .VDP_MAP_WIDTH = 32 + .VDP_MAP_WIDTH = 32 ;; Interrupt flags @@ -191,7 +191,7 @@ ;; Global variables .globl .mode - ;; Interrupt routines + ;; Interrupt routines .globl _INT_ISR .globl _NMI_ISR @@ -199,8 +199,8 @@ .globl .STACK .globl _shadow_OAM .globl __shadow_OAM_OFF - - ;; Main user routine + + ;; Main user routine .globl _main ;; Macro definitions @@ -225,7 +225,7 @@ lbl: ld a, regH jp po, lbl ei -lbl: +lbl: out (#.VDP_CMD), a .endm @@ -281,7 +281,7 @@ lbl3: .endm .macro DIV_PART divident divisor ?lbl - rl divident + rl divident rla sub divisor jr nc, lbl @@ -290,7 +290,7 @@ lbl: .endm .macro FAST_DIV8 divident divisor ; returns modulus in A - .rept 8 + .rept 8 DIV_PART divident divisor .endm ld a, divident @@ -298,7 +298,7 @@ lbl: .endm .macro FAST_MOD8 divident divisor ; returns modulus in A - .rept 8 + .rept 8 DIV_PART divident divisor .endm .endm

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.